-
Notifications
You must be signed in to change notification settings - Fork 53
/
fastcredits.asm
157 lines (113 loc) · 1.92 KB
/
fastcredits.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
FastCreditsActive = $50
;===================================================================================================
FlagFastCredits:
LDA.b #$40
TRB.b FastCreditsActive
AND.b Joy1B_All
TSB.b FastCreditsActive
LDA.b #$20
AND.b Joy1A_New
EOR.b FastCreditsActive
STA.b FastCreditsActive
LDA.b FastCreditsActive
AND.b #$60
BEQ .slow
LDA.b #$01
TSB.b FastCreditsActive
.slow
LDA.b $11
ASL
TAX
RTL
;===================================================================================================
FastCreditsCutsceneTimer:
LDA.b ScrapBufferBD+$0B
INC
JSR IsFastCredits
BCC .slow
INC
INC
INC
AND.w #$FFFE
.slow
STA.b ScrapBufferBD+$0B
SEP #$20
RTL
FastCreditsScrollOW:
JSR FastCreditsCutsceneScrollY
TAY
STY.b $30
JSR FastCreditsCutsceneScrollX
TAY
STY.b $31
RTL
FastCreditsCutsceneScrollX:
PHX
TXA
CLC
ADC.w #$0020
TAX
LDY.b #$00
JSR FastCreditsCutsceneScroll
PLX
RTS
FastCreditsCutsceneScrollY:
LDY.b #$06
FastCreditsCutsceneScroll:
LDA.w $00E2,Y
CMP.l $8EC308,X ; compare to target
ROL.b Scrap00 ; put carry in here
LDA.l $8EC348,X ; get movement
BPL ++ ; if positive, leave saved carry alone
INC.b Scrap00 ; otherwise, flip it
++ ROR.b Scrap00 ; recover carry
BCC ++ ; scroll if carry not set
LDA.w #$0000
++ JSR IsFastCredits
BCC .slow
AND.w #$FFFF ; get sign of A
BPL .positive
EOR.w #$FFFF
INC
ASL
ASL
EOR.w #$FFFF
INC
RTS
.positive
ASL
ASL
.slow
RTS
FastCreditsCutsceneUnderworldX:
JSR FastCreditsCutsceneScrollX
CLC
ADC.b BG2H
STA.b BG2H
RTL
FastCreditsCutsceneUnderworldY:
JSR FastCreditsCutsceneScrollY
CLC
ADC.b BG2V
STA.b BG2V
RTL
FastTextScroll:
LDA.b FrameCounter
SEP #$10
JSR IsFastCredits
BCC .slow
AND.w #$0000
REP #$10
RTL
.slow
AND.w #$0003
REP #$10
RTL
DumbFlagForMSU:
STA.l CurrentWorld
STZ.b FastCreditsActive
RTL
IsFastCredits:
LDY.b FastCreditsActive
CPY.b #$20
RTS