From d1f8a2dc587e0f3700e946b6161a18ed1def710f Mon Sep 17 00:00:00 2001 From: RocketRobz Date: Thu, 26 Oct 2023 17:34:21 -0600 Subject: [PATCH] Add more changes by @nibbles27 --- README.TXT | 17 +++++-- arm9/source/mappers/map910.s | 95 ++++++++++++++++++++---------------- 2 files changed, 65 insertions(+), 47 deletions(-) diff --git a/README.TXT b/README.TXT index a2da08a..deec48c 100644 --- a/README.TXT +++ b/README.TXT @@ -5,15 +5,24 @@ Since the 0.40 version, I ported the code of EX Edtion to the original nesDS, no If you found any bug on nesDS, just tell me. Maybe I could fix it. -09-30-2023 +10-25-2023 nibbles27: + -Made bad Punch Out hack from PNES-9.98 not so bad. (Mapper 9/10) - - Also updated to include map 159 for DBZ 2 and 3 translations, please set from 16 to 159 for these two titles with iNES Header Editor - https://www.romhacking.net/utilities/1352/ +09-17-2023 +nibbles27: + - Added in support for mappers: + - mapper 42 + - mapper 119 - partial + - mapper 140 + - mapper 249 - partial + +Some of these use existing mappers just added in support for them in cart.s and added/modified some mapper files to add support for these! 09-15-2023 nibbles27: - - Restored Debug menu so as to not break Mapper 4 games to a crash (like Dragon Warrior 1) - - Restored bad Punch Out hack from PNES-9.98 + - Restored Debug menu so as to not break Mapper 4 games and others to a crash (like Dragon Warrior 1) + - Restored bad Punch Out hack from PNES-9.98 (Mapper 9/10) 08-01-2023 nibbles27: diff --git a/arm9/source/mappers/map910.s b/arm9/source/mappers/map910.s index c65a90b..e0810ab 100644 --- a/arm9/source/mappers/map910.s +++ b/arm9/source/mappers/map910.s @@ -7,7 +7,7 @@ .global mapper9init .global mapper10init .global mapper9BGcheck - .global mapper_9_hook +@ .global mapper_9_hook reg = mapperdata reg0 = mapperdata + 0 @@ -23,13 +23,23 @@ mapper9init: @really bad Punchout hack @--------------------------------------------------------------------------------- .word empty_W,writeAB,write,write map10start: + mov r0, #0 + str_ r0, reg + mov r0, #4 + strb_ r0, reg1 + mov r0, #0xFE + strb_ r0, latch_a + strb_ r0, latch_b ldrb_ r0,cartflags bic r0,r0,#SCREEN4 @(many punchout roms have bad headers) strb_ r0,cartflags - ldr r0,=mapper_9_hook - str_ r0,scanlinehook +@ ldr r0,=mapper_9_hook +@ str_ r0,scanlinehook + + adr r0,framehook + str_ r0,newframehook adr r0, chrlatch2 str_ r0, ppuchrlatch @@ -101,40 +111,24 @@ f000: @------------------------- tst r0,#1 b mirror2V_ @------------------------------ -mapper_9_hook: -@--------------------------------------------------------------------------------- - ldr_ r0,scanline - sub r0,r0,#1 - tst r0,#7 - ble h9 - cmp r0,#239 - bhi h9 - - ldr r2,=latchtbl - ldrb r0,[r2,r0,lsr#3] - - cmp r0,#0xfd - ldreqb_ r0,reg2 - ldrneb_ r0,reg3 - bl chr4567_ -h9: - fetch 0 +@mapper_9_hook: @--------------------------------------------------------------------------------- -mapper9BGcheck: @called from PPU.s, r0=FD-FF -@--------------------------------------------------------------------------------- - cmp r0,#0xff - moveq pc,lr - - ldr r1,=latchtbl - and r2,addy,#0x3f - cmp r2,#0x10 - strlob r0,[r1,addy,lsr#6] - - mov pc,lr - -latchtbl: -.skip 32 - +@ ldr_ r0,scanline +@ sub r0,r0,#1 +@ tst r0,#7 +@ ble h9 +@ cmp r0,#239 +@ bhi h9 +@ +@ ldr r2,=latchtbl +@ ldrb r0,[r2,r0,lsr#3] +@ +@ cmp r0,#0xfd +@ ldreqb_ r0,reg2 +@ ldrneb_ r0,reg3 +@ bl chr4567_ +@h9: +@ fetch 0 @--------------------------------------------------------------------------------- framehook: stmfd sp!, {r3-r9} @@ -177,9 +171,13 @@ latlp: streqb_ r5, latch_a strneb_ r5, latch_b +@ ldreqb_ r2,reg2 +@ ldrneb_ r2,reg3 +@ beq chr4567_ + ldr r9, =currentBG ldr r8, [r9] @get the current bg. - adr r7, bgchrdata @to check if the chrbg is cached... + adr r7, latchtbl @to check if the chrbg is cached... ldrb r4, [r7, r8, lsr#3] rechr: @@ -232,11 +230,6 @@ lend: mov pc, lr -@----------------------------------------------- -bgchrdata: - .skip 32 @30 needed, equals to SLOTS.. - - @--------------------------------------------------------------------------------- chrlatch: @@ -330,4 +323,20 @@ chrlatch2: mov r0, #0xFE strb_ r0, latch_b ldrb_ r0, reg3 - b chr4567_ \ No newline at end of file + b chr4567_ + +@--------------------------------------------------------------------------------- +mapper9BGcheck: @called from PPU.s, r0=FD-FF +@--------------------------------------------------------------------------------- + cmp r0,#0xff + moveq pc,lr + + ldr r1,=latchtbl + and r2,addy,#0x3f + cmp r2,#0x10 + strlob r0,[r1,addy,lsr#6] + + mov pc,lr + +latchtbl: +.skip 32 \ No newline at end of file