From 53a10802779531e9fe2af647d9b2fce7b5e29bc6 Mon Sep 17 00:00:00 2001 From: nstbayless Date: Fri, 26 Jul 2024 11:01:13 -0700 Subject: [PATCH] unified jp/us hacks --- _improved_controls.asm | 109 ++++++++++++++++++++++++++++++++++++ offsets-jp.asm | 3 +- offsets-us.asm | 2 +- out-jp.ips | Bin 304 -> 358 bytes patch-jp.asm | 99 +++------------------------------ patch-us.asm | 122 ++--------------------------------------- test_protocol.txt | 1 + 7 files changed, 126 insertions(+), 210 deletions(-) create mode 100644 _improved_controls.asm diff --git a/_improved_controls.asm b/_improved_controls.asm new file mode 100644 index 0000000..9d9a8a8 --- /dev/null +++ b/_improved_controls.asm @@ -0,0 +1,109 @@ +; -------------------------------------------------------------------- +BANK $E +BASE $8000 + +include "_hooks.asm" + +; custom code +FROM empty_bank_e + +stair_jumping: + ; pressed jump button? + LDA joypad_pressed + AND #$80 ; (pressed jump) + + BEQ __recover_step + + ; perform jump + LDA #$06 ; begin jump + STA simon_state + + ; double-return + ; (quit out of stair logic as well) + PLA + PLA + RTS + +__recover_step: + ; here we perform the detour logic to resume a standard tick + ; however, we must do different logic depending on state/call site + + LDA simon_state + CMP #$14 ; stair walk + BEQ __recover_stair_walk +__recover_stair_idle: + LDA joypad_down + AND #$40 + RTS +__recover_stair_walk: + JMP stair_walk_resume + +crouch_direction: + LDA joypad_down + LSR A + BCC + + LDX #$00 + STX facing ++ + LSR A + BCC + + LDX #$01 + STX facing ++ + ; resolve detour: trampoline + JMP crouch_resolve + +custom_knockback: + BANKSWAP CUSTOM_JUMP_BANK +custom_knockback_bankswap_loc: + rts + +custom_jump_then_standard_jump: + ; push return address (-1) + LDA #>standard_jump + PHA + LDA #%d#o(;fUp(H_xmiK?&|Lb0DoIbeEzL*EJ(5X}greRx`2{oMfJyfttD diff --git a/patch-jp.asm b/patch-jp.asm index 68f619b..f51e517 100644 --- a/patch-jp.asm +++ b/patch-jp.asm @@ -7,102 +7,17 @@ include "offsets-jp.asm" VSP_CONTROL_ZERO_VSPEED=$1C -; -------------------------------------------------------------------- -BANK $E -BASE $8000 - -FROM $81FE -getting_hit: - -FROM $8307 -knockback_step: - -FROM $8AC6 -standard_state_0: - - -FROM $952D -standard_idle: - -FROM $9624 -standard_begin_jump: - -FROM $9667 -standard_walk: - -include "_hooks.asm" - -; custom code -FROM empty_bank_e - LDA #$01 - STA hspint,X -custom_jump_then_standard_jump: - ; push return address (-1) - LDA #>standard_jump - PHA - LDA #standard_jump - PHA - LDA #