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 #standard_jump - PHA - LDA #standard_jump - PHA - LDA #