Game: Teenage Mutant Ninja Turtles 3
System: NES
Emulator: FCEUX SP 1.07
Author: Abystus
I'm not sure if there is a tutorial for this yet (I did do some searching both in the library and through the forums.) so I decided to make this one.
Basically this is for the people still using several codes to achieve "One Hit Kills" by setting each enemy's health to 0. Most games have a death routine for their enemies, and we should take advantage of this so we can make the most compact code possible.
First we need to find any enemy health address (you should know how to do this by now). Our example address is $0626. Now that we have our health address what we need to do is set a BPW (Break on Write) to this address. From this point we have 2 options:
Our debugger will snap to the below ($D151):
Enemy Damage Routine (In this game it handles all standard enemy damage. This excludes bosses.)
So now we just keep hitting the enemy until on the last hit the debugger snaps to the below ($D19C):
Enemy Death Routine (In this game it handles all standard enemy deaths. This excludes bosses.)
Now for all you wondering how we got to this location that were not using a tracer please repeat the previous step with the tracer on. Most of the time this will be close to where the enemy damage routine is but this is not always the case. I personally prefer the tracer to make things simple especially if there are multiple branches involved before our stop at the death routine.
Now if you had your tracer on you would notice the last branch before the storing 0 to the enemy health address was [D14D:90 4B BCC $D19A].
We are wanting to make the branch above always happen when striking our enemies. To do this we make the following modification below in blue:
Our Code: D14D10
Take note that some games such as this one will use a different damage/death routine for bosses than for normal enemies. If this is the case most if not all bosses will share the same routines such as these standard enemies do with each other.
System: NES
Emulator: FCEUX SP 1.07
Author: Abystus
I'm not sure if there is a tutorial for this yet (I did do some searching both in the library and through the forums.) so I decided to make this one.
Basically this is for the people still using several codes to achieve "One Hit Kills" by setting each enemy's health to 0. Most games have a death routine for their enemies, and we should take advantage of this so we can make the most compact code possible.
First we need to find any enemy health address (you should know how to do this by now). Our example address is $0626. Now that we have our health address what we need to do is set a BPW (Break on Write) to this address. From this point we have 2 options:
- Turn on the Tracer, strike the enemy and wait for the break. (My preferred method.)
- Strike the enemy, wait for the break. (Finding the death routine manually can be a pain.)
Our debugger will snap to the below ($D151):
Enemy Damage Routine (In this game it handles all standard enemy damage. This excludes bosses.)
Code:
$D147:BD 21 06 LDA $0621,X @ $0626 = #$04 $D14A:38 SEC $D14B:E5 10 SBC $0010 = #$03 $D14D:90 4B BCC $D19A $D14F:F0 49 BEQ $D19A $D151:9D 21 06 STA $0621,X @ $0626 = #$04 [COLOR="Red"]//We break here when an enemy is struck.[/COLOR]
Enemy Death Routine (In this game it handles all standard enemy deaths. This excludes bosses.)
Code:
$D19A:A9 00 LDA #$00 [COLOR="Red"]//Load our Accumulator with 00 since our enemy is now considered dead.[/COLOR] $D19C:9D 21 06 STA $0621,X @ $0626 = #$04 [COLOR="Red"]//We break here. Store the accumulator to make the enemy die.[/COLOR]
Now if you had your tracer on you would notice the last branch before the storing 0 to the enemy health address was [D14D:90 4B BCC $D19A].
We are wanting to make the branch above always happen when striking our enemies. To do this we make the following modification below in blue:
Code:
$D147:BD 21 06 LDA $0621,X @ $0626 = #$04 $D14A:38 SEC $D14B:E5 10 SBC $0010 = #$03 $D14D:[COLOR="blue"][B]10[/B][/COLOR] 4B BPL [COLOR="Red"]$D19A[/COLOR][COLOR="Green"] //Changing this to a BPL will automatically send us to the death routine everytime an enemy is struck with an attack.[/COLOR] $D14F:F0 49 BEQ $D19A $D151:9D 21 06 STA $0621,X @ $0626 = #$04 [COLOR="Red"]//We break here when an enemy is struck.[/COLOR]
Take note that some games such as this one will use a different damage/death routine for bosses than for normal enemies. If this is the case most if not all bosses will share the same routines such as these standard enemies do with each other.

.

Comment