Re: [stella] Space Savers

Subject: Re: [stella] Space Savers
From: "Eckhard Stolberg" <Eckhard_Stolberg@xxxxxx>
Date: Fri, 3 Sep 2004 23:08:23 +0200
> Thinking like this isn't the CPU supposed to start with all registeres
> cleared and can't we just throw out
> CLD and LDX,$00 to save another 3 bytes ?

I think you are right. But this is only the case on the 2600 where
the game starts right after power-up. On the 7800 however the BIOS
is executed first, and that changes the state of the 6502. So, if
you want your game to work on this console too, it would be better
to initialize everything that is important for your code. The same
think is true, if you want to be able to try out your binary on
a Supercharger or the Cuttle Cart. Here the loader routine is
executed first before control is handed over to the game.

> Maybe I'm a little Paranoid But I think those bytes are the worst things
to
> save on. If those ports do start up
> as outputs(Power up/CPU doing garbage/Eckhard's point?). The RIOT ports
> might get damaged.

It might be possible to damage the RIOT depending on what you
have connnected to the controller port, but I don't think it's
very likely. In fact Star Raiders sets all 8 pins on both controller
ports to output and then sets these pins all high. On the right
controller port Star Raiders uses a keyboard controller where the
output pins are used to select the key row to read.

But on the left controller port the game uses a joystick. It is
still able to read the joystick through the output pins, because
the pins are left unconnected when the joystick isn't moved in
any direction. When the joystick is moved, the corresponding pin
is connected to ground, which seems to be the same thing that
happens when you set the output pins low. So the game is able
to read back the state of the controller port.


Ciao, Eckhard Stolberg


Current Thread