- Set up each snes bank with 4 levels
- Store new loading address for each bank in ram, instead of doing a hard load from B800, there will be ones for 9800/B800/D800/F800
No, that's going to transfer A bytes from $02:X to $02:Y.
Ok thank you, and everyone else as well, thank you.93143 wrote: ↑Sat Mar 20, 2021 7:10 pmNo, that's going to transfer A bytes from $02:X to $02:Y.
What you want is phk; plb to change the data bank to the current value of the program bank.
If you want a different bank, load a register with the bank number you want, push that register on the stack, and plb.
You could also use the method lidnariq recommends, which is pea #$0202; plb; plb. A bit wasteful in some senses, but it doesn't destroy the contents of any registers, which may be more important.
Code: Select all
lda #$00 sta $01 phy lda #$02 phk plb stz $7d lda $f6 ldy #$00 cmp $ecb3'y beq $ec7d iny jmp $ec74 lda $ecc8,y sta $7f ;here I tried simply adding phk/plb, since at this point A is 1E, but 1E never got placed into the DB register. So I tried loading $7F with 1E, phk/plb, still no DB change. lda $7f phk plb lda $ecdd,y sta $7e ply jmp $d2a7