Copy Link
Add to Bookmark
Report

Small patch to make Neon64 support Mapper 10

Nintendo64's profile picture
Published in 
N64 various
 · 3 years ago

  
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

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT