So, here you're saying that your "dominate" bank would have to be exactly the same in each 16 bank set if you were to do it the first way you mentioned? This would keep your addresses all in line. Correct?
The second method sounds somewhat more efficent, right? I appoligize for being thick here, but I really can't wrap my head around how you would do that.
And here wouldn't you have to have reset code in the second set of banks to at least switch to the first one as it could load any random bank during start up? Don't suppose you have a quick example of this? At least the bank switching via RAM part?
Thank you for the help.
LDA banknumber STA bankreg ; load bank bit 0 to shift register from data bit 0 LSR A ; shift in next data bit to position 0 STA bankreg ; load bank bit 1 from data bit 0 LSR A STA bankreg ; bank bit 2 LSR A STA bankreg ; bank bit 3 LSR A STA bankreg ; bank bit 4, bank register loaded, bank switch happens here
LDA #%10000000 STA $8000
43210 ----- CPRMM ||||| |||++- Mirroring (0: one-screen, lower bank; 1: one-screen, upper bank; ||| 2: vertical; 3: horizontal) ||+--- PRG swap range (0: switch 16 KB bank at $C000; 1: switch 16 KB bank at $8000; || only used when PRG bank mode bit below is set to 1) |+---- PRG size (0: switch 32 KB at $8000, ignoring low bit of bank number; | 1: switch 16 KB at address specified by location bit above) +----- CHR size (0: switch 8 KB at a time; 1: switch two separate 4 KB banks)
| 4KB mode | 8KB mode |
| controls $0000-0FFF | controls $0000-1FFF bottom bit is ignored |
| 4KB mode | 8KB mode |
| controls $1000-1FFF | register ignored |
43210 ----- WPPPP ||||| |++++- Select a PRG ROM bank (low bit ignored in 32 KB mode) +----- WRAM chip enable (0: enabled; 1: disabled)
| 16KB mode swap=0 | 16KB mode swap=1 | 32KB mode |
| controls $C000-FFFF | controls $8000-BFFF (default setting) | controls $8000-FFFF low bit ignored |
ConfigWrite: ; make sure this is in a fixed PRG bank so the RTS doesn't get swapped away LDA #$80 STA $8000 ; reset the shift register LDA #%00001110 ; 8KB CHR, 16KB PRG, $8000-BFFF swappable, vertical mirroring STA $8000 ; first data bit LSR A ; shift to next bit STA $8000 ; second data bit LSR A ; etc STA $8000 LSR A STA $8000 LSR A STA $8000 ; config bits written here, takes effect immediately RTS PRGBankWrite: ; make sure this is in a fixed bank so it doesnt get swapped away LDA bankNumber ; get bank number into A STA $E000 ; first data bit LSR A ; shift to next bit STA $E000 LSR A STA $E000 LSR A STA $E000 LSR A STA $E000 ; bank switch happens immediately here RTS