-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_improved_controls.asm
109 lines (88 loc) · 2.15 KB
/
_improved_controls.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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-1
PHA
custom_jump_jsr:
BANKSWAP CUSTOM_JUMP_BANK
custom_jump_bankswap_loc:
rts
jumping_attack:
JSR custom_jump_jsr
JMP attack_resolve ; .. not necessarily air-attacking?
LIMIT $C000
; --------------------------------------------------------------------
BANK CUSTOM_JUMP_BANK
BASE $8000
FROM empty_bank_jump
include "_custom_jump.asm"
include "_custom_knockback.asm"
end_bank_0_core:
FROM custom_knockback_bankswap_loc-5
ATLEAST end_bank_0_core
custom_knockback_bankswap_loc_pre:
BANKSWAP PLAYER_UPDATE_BANK
; (bankswap)
EXACT custom_knockback_bankswap_loc
jsr _custom_knockback
jmp custom_knockback_bankswap_loc_pre
end_custom_knockback_bankswap_tramp
FROM custom_jump_bankswap_loc-5
ATLEAST end_custom_knockback_bankswap_tramp
custom_jump_bankswap_loc_pre:
BANKSWAP PLAYER_UPDATE_BANK
; (bankswap)
EXACT custom_jump_bankswap_loc
jsr _custom_jump
jmp custom_jump_bankswap_loc_pre
end_custom_jump_bankswap_tramp: