Copy Link
Add to Bookmark
Report
Small patch to make Neon64 support Mapper 10
Small patch to make Neon64 support Mapper 10.
***
ROM.INC
***
*** LINES 197+ ***
notmapper9
li t1,10
bne t0,t1,notmapper10
nop
; Mapper 10 (MMC4, identical to MMC2 but PRGROM)
jal mmc4prgrom
nop
jal nchrrom
nop
j endofloadrom
nop
notmapper10
...
*** LINES 443+ ***
mmc4prgrom ; Mapper #10 (MMC4)-style PRGROM load
; first 16k ROM bank at $8000,
; last 16k ROM bank at $c000
_tpa(lbu,t2,prgromsize)
nop
addi t2,-1 ; last page
sll t2,10+4 ; 16 K
la t1,prgrom
addu t2,t1
li t1,0xC000
subu t2,t1
li t1,0x40-1
la t3,nespagetable+(0xC0*4)
map10resetPRGloop
sw t2,(t3)
addi t3,4
bnez t1,map10resetPRGloop
addi t1,-1
jr ra
nop
***
MMC4.INC
***
; MMC4 (nearly identical to MMC2 but PRGROM storage is different)
andi t4,A6502_regaddr,$f000
li t5,$a000
bne t5,t4,map9notprgrom
li t5,$b000
andi A6502_regval, 0x0F
sll A6502_regval,10+4 ; 16K
la t4,prgrom
addu A6502_regval,t4
li t4,0x8000
subu A6502_regval,t4
li t4,0x40-1
la t5,nespagetable+(0x80*4)
map10setPRGloop
sw A6502_regval,(t5)
addi t5,4
bnez t4,map10setPRGloop
addi t4,-1
jr A6502_return
nop
; remaining stuff is done in mmc2.inc
***
NEON64.ASM
***
; Da Cheat!
_tpa(lbu,t0,mapper)
li t1,9
beq t0,t1,mmc2_4_hack
nop
mmc4test ;could probably be more efficient with one flag set for both mapper 9 and 10
li t1,10
bne t0,t1,mmc2not_1
nop
mmc2_4_hack
li t0,1
_tpa(sb,t0,mmc2_toggle)
jal mmc2latchgfx
nop
mmc2not_1
...nothing changed here...
***
WRITE.INC
***
LINE 629
map10
#include mmc4.inc