Re: [stella] FE Bankswitching

Subject: Re: [stella] FE Bankswitching
From: "Eckhard Stolberg" <Eckhard_Stolberg@xxxxxx>
Date: Sun, 15 Dec 2002 14:32:47 +0100
> Can someone help me out with FE Bankswitching?  I am
> working on a Cart Emulator and I cant figure out how
> FE works.  The sizes document is wrong according to
> the stella emulator code documentation.  The code
> is written from the processor point of view so it is
> easy, just look at address bit 13.  But the cart cant
> see address 13.  The cart has to know when to switch
> from the bus (contrary to the code documents), the
> bus is all it has.

FE games use JSR and RTS commands to trigger the
bankswitching. These commands will transfer all
16 bits of the return address over the data bus, so
your cart will only have to find out when A13 is
on the data bus.

Due to the inner workings of JSR/RTS the high byte
of the return address will be pushed/pulled after
two accesses to the stack. So your bankswitching logic
has to wait if the address on the cart port is in the
stack area ($0100-$01FF). Then it has to check if the
next address is in this area too. If this is the case
you can check data line D5 and set the banks accordingly.

Two stack accesses in a row is a combination that usually
only happens for JSR/RTS in VCS programming, so if this
happens, you can safely assume that your bankswitching
logic is supposed to be triggered.


Ciao, Eckhard Stolberg


----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread