Recently I'm trying to understand how this MMC3 works, so I wrote up a short code based from the examples provided (Nerdy Nights) and then run it on the emulator (Nintendulator and FCEUX).
On the program:
1.) Assume that PRG 16KB block is one:
Code: Select all
.inesprg 2 ; 1x 16KB PRG code
.ineschr 0 ; 1x 8KB CHR data
.inesmap 4 ; mapper 0 = NROM, no bank swapping
.inesmir 0 ; background mirroring
Code: Select all
;;;;;;;;;;;;;;
.bank 3
.org $FFFA ;first of the three vectors starts here
.dw NMI ;when an NMI happens (once per frame if enabled) the
;processor will jump to the label NMI:
.dw RESET ;when the processor first turns on or is reset, it will jump
;to the label RESET:
.dw 0 ;external interrupt IRQ is not used in this tutorial
Code: Select all
;;;;;;;;;;;;;;
.bank 1
.org $8000
f1:
LDA #$01
LDA #$02
HERE:
JMP HERE
Code: Select all
.bank 0
.org $8000
RESET:
SEI ; disable IRQs
CLD ; disable decimal mode
LDX #$40
STX $4017 ; disable APU frame IRQ
LDA #%00000110
STA $8000
LDA #$01
STA $8001
JMP f1
;Forever:
; JMP Forever ;jump back to Forever, infinite loop
NMI:
RTI
Is there a way I need to make it directly jump to Bank 1's 0x8000 from Bank 0? It looks like right after a bank-switch, it continues where the PC left off.