1
ROM Hacking Discussion / Re: Help with smb1 hack
« on: May 17, 2013, 12:46:55 am »
Solution is pretty simple.
If you look at the code at ROM Address $5FB1 (CPU $DFA1):
$DFA1: CMP #$C2
$DFA3: BEQ $DFAB
$DFA5: CMP #$C3
$DFA7: BEQ $DFAB
$DFA9: CLC
$DFAA: RTS
This is a 'check for coin block' routine. What you have to do is to insert the spike block judgement code into this routine.
So this is what you have to do:
1: Jump to some free space. Remain the coin block judgement unchanged. That is, if you jumped from $DFA7 you need to write the rest of the coin block judgement code there.
2: If the block isn't a coin block, do not write CLC RTS immediately. Instead write your own spike code.
Example:
;Coin judgement fails
CMP #$69 ;Which is the spike block in one of my hacks, in personal projects
BNE CLCRTSCode
LDX #$00
JSR $D958 ;Instant death if one touches it. Of course you can make changes here.
PLA
PLA
RTS ;Immediately jump out of the previous routine. After all, as the player's dead, there's no point of continuing the block judgement routine. Probably PLA-PLA-LDX-JMP is also okay, but that doesn't matter much.
CLCRTSCode:
CLC
RTS
If you look at the code at ROM Address $5FB1 (CPU $DFA1):
$DFA1: CMP #$C2
$DFA3: BEQ $DFAB
$DFA5: CMP #$C3
$DFA7: BEQ $DFAB
$DFA9: CLC
$DFAA: RTS
This is a 'check for coin block' routine. What you have to do is to insert the spike block judgement code into this routine.
So this is what you have to do:
1: Jump to some free space. Remain the coin block judgement unchanged. That is, if you jumped from $DFA7 you need to write the rest of the coin block judgement code there.
2: If the block isn't a coin block, do not write CLC RTS immediately. Instead write your own spike code.
Example:
;Coin judgement fails
CMP #$69 ;Which is the spike block in one of my hacks, in personal projects
BNE CLCRTSCode
LDX #$00
JSR $D958 ;Instant death if one touches it. Of course you can make changes here.
PLA
PLA
RTS ;Immediately jump out of the previous routine. After all, as the player's dead, there's no point of continuing the block judgement routine. Probably PLA-PLA-LDX-JMP is also okay, but that doesn't matter much.
CLCRTSCode:
CLC
RTS
Home
Help
Login
Register


