Skip to content

Commit

Permalink
Add more changes by @nibbles27
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Oct 26, 2023
1 parent 634baae commit d1f8a2d
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 47 deletions.
17 changes: 13 additions & 4 deletions README.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
95 changes: 52 additions & 43 deletions arm9/source/mappers/map910.s
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.global mapper9init
.global mapper10init
.global mapper9BGcheck
.global mapper_9_hook
@ .global mapper_9_hook

reg = mapperdata
reg0 = mapperdata + 0
Expand All @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -232,11 +230,6 @@ lend:
mov pc, lr


@-----------------------------------------------
bgchrdata:
.skip 32 @30 needed, equals to SLOTS..



@---------------------------------------------------------------------------------
chrlatch:
Expand Down Expand Up @@ -330,4 +323,20 @@ chrlatch2:
mov r0, #0xFE
strb_ r0, latch_b
ldrb_ r0, reg3
b chr4567_
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

0 comments on commit d1f8a2d

Please sign in to comment.