Re: [stella] nop and wrap around

Subject: Re: [stella] nop and wrap around
From: Erik Mooney <emooney@xxxxxxxxxxxxxxxx>
Date: Tue, 12 Jan 1999 20:27:32 -0500 (EST)
> have an LCD screen that allows the user to select a game from it's large
> ROM(and simultaniously display instructions while playing), load one from
> a pc via serial, load one from actual cart(and send to pc), setup
> bankswitching, and any other number of things that I can dream up along
> the way.

Cool... where do I buy one? :)

> My original thoughts to run it would be that my system would be able to
> switch on and off the power to the VCS so that once a game was choosen, it
> would power cycle the VCS to play the new game.  But while working I came
> across an idea.  What if my system just swaped the rom while that last
> game was running?  What I was thinking is swapping it to a rom that is all
> nop's, and allowing the VCS to run those nops until it got to a certain
> address(startup vector?) which would cause some of my hardware to switch
> to the new game.  Or perhaps to a dummy program which would just display
> some text, or maybe a screen saver of some sort until the user selects the
> next game.  It's kinda like a bankswitch without having a software call to
> do it.
> Will this work?  Is there a common startup address(as in, is there a
> location in memory where the 6507 fetches the very first instruction upon
> startup?)? What is it?  Will the program counter in the 6507 wrap around
> from the max to the minimum address?

There is not a common startup address, but there is a startup vector at
$FFFC - on powerup, the 6507's PC is set to the word stored at locations
$FFFC and $FFFD.
> Anybody have any ideas of how else to be able to get from a game running
> to another one when you have no control over how either program was
> written or where in it's execution it is?

Try experimenting with swapping in a ROM full of BRK instructions.  I
*think* the BRK instruction acts as a soft reset, resetting the PC to the
startup vector.

As for wrapping around the PC... that's very unlikely to work.  Within the
2600's address space, $1000-$1fff is ROM space, then the very next byte at
$2000 wraps back around to $0, which is TIA input/output registers -
trying to execute code out of those registers is unpredictable, to say the
least. :)

Archives (includes files) at
Unsub & more at

Current Thread