Example: Legend of Zelda (1.0) - NES Emulator Used: FCEUX To make this kind of code you need to find the health for the enemies. For this game in address 0x485+. In this example the enemy's HP was at 0x488. I put a breakpoint on write on that address. The debugger snaps here: $7C63:9D 85 04 STA $0485,X @ $0488 = #$20 Now we need to works backwards to see what determines when an enemy is hit. We can use the tracer from this emulator to see what's going on. To get what we want leave the breakpoint for the enemy's HP on. Then start the trace logger when close to the enemy and swing your sword. When the debugger snaps stop the tracer. The file you get is going to be a few megabytes long but what you need is the last part of the file. Now we know that 0x7C63 is where the HP for enemies is stored so I worked my way backwards looking at the trace log looking for any branch that was skipping 0x7C63. Another way to check is to be around enemies swing your sword with a breakpoint on execute if the debugger snaps then you are on the right path. This is the code that determines if an enemy is hit: $7BEF:20 FF 7D JSR $7DFF $7DFF:A9 00 LDA #$00 This routine is used by the enemy and $7E01:85 06 STA $0006 = #$00 the player. It checks to see how close the enemy and the player are. $7E03:A4 00 LDY $0000 = #$0D $7E05:A5 02 LDA $0002 = #$69 $7E07:38 SEC $7E08:E5 04 SBC $0004 = #$75 $7E0A:20 1F 70 JSR $701F $701F:10 05 BPL $7026 $7021:49 FF EOR #$FF $7023:18 CLC $7024:69 01 ADC #$01 $7026:60 RTS $7E0D:85 0A STA $000A = #$08 $7E0F:C5 0D CMP $000D = #$10 $7E11:B0 10 BCS $7E23 $7E13:A5 03 LDA $0003 = #$C5 $7E15:38 SEC $7E16:E5 05 SBC $0005 = #$C6 $7E18:20 1F 70 JSR $701F $701F:10 05 BPL $7026 $7021:49 FF EOR #$FF $7023:18 CLC $7024:69 01 ADC #$01 $7026:60 RTS $7E1B:85 0B STA $000B = #$00 $7E1D:C5 0E CMP $000E = #$0C $7E1F:B0 02 BCS $7E23 $7E21:E6 06 INC $0006 = #$00 $7E23:A5 06 LDA $0006 = #$01 $7E25:60 RTS $7BF2:F0 74 BEQ $7C68 if 0x0006 = 0 go to end. Stop this opcode from jumping $7BF4:C0 0F CPY #$0F $7BF6:D0 1E BNE $7C16 $7C16:BD B2 04 LDA $04B2,X @ $04B5 = #$00 $7C19:25 09 AND $0009 = #$01 $7C1B:D0 4C BNE $7C69 $7C1D:BD 4F 03 LDA $034F,X @ $0352 = #$10 $7C20:C9 33 CMP #$33 $7C22:F0 04 BEQ $7C28 $7C24:C9 34 CMP #$34 $7C26:D0 03 BNE $7C2B $7C28:4C 40 A4 JMP $A440 Stop this one from jumping. $7C2B:C9 13 CMP #$13 $7C2D:F0 04 BEQ $7C33 $7C2F:C9 12 CMP #$12 $7C31:D0 0C BNE $7C3F $7C3F:C9 0B CMP #$0B $7C41:F0 04 BEQ $7C47 $7C43:C9 0C CMP #$0C $7C45:D0 0D BNE $7C54 $7C54:A9 02 LDA #$02 $7C56:8D 04 06 STA $0604 = #$00 $7C59:BD 85 04 LDA $0485,X @ $0488 = #$20 $7C5C:C5 07 CMP $0007 = #$10 $7C5E:90 16 BCC $7C76 $7C60:38 SEC $7C61:E5 07 SBC $0007 = #$10 $7C63:9D 85 04 STA $0485,X @ $0488 = #$20 After stopping the branch and the jump you'll be able to hit enemies anywhere on the screen. Getting items from anywhere is similar to this hit anywhere. I tried to make it at clear as possible.