Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .thumb
- # To enable all difficulties:
- # put 1F 20 70 47 at x9E9FC
- # org x28FBA
- .org 0xA
- ldr r0, MethodAddr
- bx r0
- .align 2
- MethodAddr: .word 0x09000001
- .org 0x40
- # check that the attacker is not red
- # and check that the defender is red
- ldr r0, AttackerAddr
- ldr r1, DefenderAddr
- ldrb r0, [r0, #0xB]
- ldrb r1, [r1, #0xB]
- mov r2, #0x80
- and r0, r2
- and r1, r2
- cmp r0, #0x0
- bne Abort
- cmp r1, #0x80
- bne Abort
- # check that the defending red unit is armed
- # a unit not being armed is the game's signal not to counter
- ldr r0, DefenderAddr
- mov r1, #0x48
- ldrh r0, [r0, r1]
- cmp r0, #0x0
- beq Abort
- # reverse turn order here
- mov r0, r13
- mov r1, r4
- ldr r2, DefenderAddr
- str r2, [r0]
- ldr r0, AttackerAddr
- str r0, [r1]
- b Return
- Abort:
- mov r0, r13
- mov r1, r4
- ldr r2, AttackerAddr
- str r2, [r0]
- ldr r0, DefenderAddr
- str r0, [r1]
- Return:
- ldr r0, ReturnAddr
- bx r0
- .align 2
- AttackerAddr: .word 0x0203A3F0
- DefenderAddr: .word 0x0203A470
- ReturnAddr: .word 0x08028FC5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement