Re: [stella] I think I got F8 bankswitching to work.

Subject: Re: [stella] I think I got F8 bankswitching to work.
From: Aaron Bergstrom <aaron.bergstrom@xxxxxxxxxxxxxx>
Date: Fri, 20 Jun 2003 01:16:27 -0500
So what you're saying is that everything will be correct if I adjust the first bank to read:

   org $1fed
   rorg $dfed
Start2
   LDX $1ff9
   ..blah
   ..blah

I thought I had counted correctly... I must endevour to learn my hex numbers better. Thanks again Thomas for the help.

Aaron

Thomas Jentzsch wrote:

Aaron Bergstrom wrote:


The file seems to run fine in both stella and z26.



But only due to some luck!





Could you check it once more please?



It's not correct.


       org $1fea
       rorg $dfea
Start2
       LDX $1ff9

After the instruction the program counter (PC) is at $2fed in the other
bank. But there is "nothing", because the code starts at $2ff0:

       org $2ff0   ;other bank start
       rorg $fff0  ;
       jmp Start

But you are lucky here. DASM fills all unused gaps with $FF. And $FF is
a valid illegal opcode (ISB abs,x; ISB = increase M and subtract from A)
that doesn't crash the CPU and has the correct length of the 3 missing
bytes.


So when your code starts at the 1st bank this happens:
$1fea LDX $1ff9   ; X = $FF
$2fed ISB $ffff,x ; M = $FFFF + X = $00FE
$2ff0 jmp Start   ; back on track again!

And because you initialize whole zeropage anyway, you won't notice that
change at the end of the RAM. :-)

Have fun!
Thomas _______________________________________________________
Thomas Jentzsch | *** Every bit is sacred ! ***
tjentzsch at web dot de |


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





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


Current Thread