-
Notifications
You must be signed in to change notification settings - Fork 2
/
bank_07b.asm
290 lines (248 loc) · 7.4 KB
/
bank_07b.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
.segment "BANK_07b"
; $B000-$BFFF
.setcpu "6502X"
.feature org_per_seg
.feature pc_assignment
.include "globals.inc"
; -----------------------------------------------------------------------------
.export sub_ending_prepare
; Sets the attribute table for the ending screen. Each character can use a
; a different set of colours.
; Then copies the ending text data to RAM ($6F00-$6FFF).
; Notes: rendering should be disabled.
; Parameters:
; zp_plr1_fighter_idx = index of the winning character
sub_ending_prepare:
; Prepare pointer
ldy zp_plr1_fighter_idx
lda tbl_ending_attr_ptrs_lo,Y
sta zp_ptr2_lo
lda tbl_ending_attr_ptrs_hi,Y
sta zp_ptr2_hi
; Copy attribute data to PPU
ldy #$00
:
lda #$23
sta PpuAddr_2006
lda @tbl_ppu_addr,Y
sta PpuAddr_2006
lda (zp_ptr2_lo),Y
sta PpuData_2007
iny
cpy #$09
bcc :-
lda #$80 ; Write protection disabled
sta mmc3_ram_protect
; Prepare pointer
ldy zp_plr1_fighter_idx
lda tbl_ending_text_ptrs_lo,Y
sta zp_ptr1_lo
lda tbl_ending_text_ptrs_hi,Y
sta zp_ptr1_hi
; Copy ending text data to RAM
ldy #$00
:
lda (zp_ptr1_lo),Y
sta $6F00,Y
iny
cmp #$FF
bne :-
lda #$C0 ; Write protection enabled
sta mmc3_ram_protect
rts
@tbl_ppu_addr:
.byte $D0, $D1, $D2, $D8, $D9, $DA, $E0, $E1, $E2
; -----------------------------------------------------------------------------
tbl_ending_attr_ptrs_lo:
.byte <tbl_ending_attr_raiden
.byte <tbl_ending_attr_sonya
.byte <tbl_ending_attr_subzero
.byte <tbl_ending_attr_scorpion
.byte <tbl_ending_attr_kano
.byte <tbl_ending_attr_cage
.byte <tbl_ending_attr_liukang
.byte <tbl_ending_attr_goro
.byte <tbl_ending_attr_shangtsung
tbl_ending_attr_ptrs_hi:
.byte >tbl_ending_attr_raiden
.byte >tbl_ending_attr_sonya
.byte >tbl_ending_attr_subzero
.byte >tbl_ending_attr_scorpion
.byte >tbl_ending_attr_kano
.byte >tbl_ending_attr_cage
.byte >tbl_ending_attr_liukang
.byte >tbl_ending_attr_goro
.byte >tbl_ending_attr_shangtsung
; ----------------
tbl_ending_attr_raiden:
.byte $CC, $55, $11 ; $23D0, $23D1, $23D2
.byte $4C, $DD, $11 ; $23D8, $23D9, $23DA
.byte $04, $0D, $03 ; $23E0, $23E1, $23E2
tbl_ending_attr_sonya:
.byte $44, $5D, $33 ; $23D0, $23D1, $23D2
.byte $44, $15, $13 ; $23D8, $23D9, $23DA
.byte $04, $05, $01 ; $23E0, $23E1, $23E2
tbl_ending_attr_subzero:
.byte $44, $FF, $F1 ; $23D0, $23D1, $23D2
.byte $4C, $57, $1F ; $23D8, $23D9, $23DA
.byte $04, $05, $01 ; $23E0, $23E1, $23E2
tbl_ending_attr_scorpion:
.byte $44, $DD, $33 ; $23D0, $23D1, $23D2
.byte $44, $DD, $33 ; $23D8, $23D9, $23DA
.byte $04, $0D, $03 ; $23E0, $23E1, $23E2
tbl_ending_attr_kano:
.byte $CC, $FF, $33 ; $23D0, $23D1, $23D2
.byte $CC, $44, $11 ; $23D8, $23D9, $23DA
.byte $0C, $07, $01 ; $23E0, $23E1, $23E2
tbl_ending_attr_cage:
.byte $44, $55, $11 ; $23D0, $23D1, $23D2
.byte $44, $55, $11 ; $23D8, $23D9, $23DA
.byte $04, $05, $01 ; $23E0, $23E1, $23E2
tbl_ending_attr_liukang:
.byte $44, $55, $11 ; $23D0, $23D1, $23D2
.byte $44, $55, $11 ; $23D8, $23D9, $23DA
.byte $04, $05, $01 ; $23E0, $23E1, $23E2
tbl_ending_attr_goro:
.byte $44, $55, $11 ; $23D0, $23D1, $23D2
.byte $44, $55, $11 ; $23D8, $23D9, $23DA
.byte $04, $05, $01 ; $23E0, $23E1, $23E2
tbl_ending_attr_shangtsung:
.byte $44, $55, $11 ; $23D0, $23D1, $23D2
.byte $44, $55, $11 ; $23D8, $23D9, $23DA
.byte $04, $05, $01 ; $23E0, $23E1, $23E2
; -----------------------------------------------------------------------------
tbl_ending_text_ptrs_lo:
.byte <txt_raiden_ending
.byte <txt_sonya_ending
.byte <txt_subzero_ending
.byte <txt_scorpion_ending
.byte <txt_kano_ending
.byte <text_cage_ending
.byte <txt_liukang_ending
.byte <txt_goro_ending
.byte <txt_shangtsung_ending
tbl_ending_text_ptrs_hi:
.byte >txt_raiden_ending
.byte >txt_sonya_ending
.byte >txt_subzero_ending
.byte >txt_scorpion_ending
.byte >txt_kano_ending
.byte >text_cage_ending
.byte >txt_liukang_ending
.byte >txt_goro_ending
.byte >txt_shangtsung_ending
; ----------------
.repeat 26, i ; Letters
.charmap $61 + i, $E0 + i ; Lowercase
.charmap $41 + i, $E0 + i ; Uppercase
.endrepeat
.charmap $20, $B4 ; Space
.charmap $2D, $A0 ; -
.charmap $27, $A1 ; '
.charmap $2C, $B0 ; ,
.charmap $3A, $B1 ; ;
.charmap $2E, $B2 ; .
; ----------------
txt_raiden_ending:
.byte "raiden's victory", $00
.byte "comes as no", $00
.byte "surprise to him.", $00
.byte "he was never", $00
.byte "impressed by", $00
.byte "shang tsung's", $00
.byte "inferior sorcery", $00
.byte "goro's brute", $00
.byte "force, or the", $00
.byte "challenge of the", $00
.byte "other fighters.", $FF
txt_sonya_ending:
.byte "sonya has won", $00
.byte "the contest. her", $00
.byte "victory not only", $00
.byte "released her", $00
.byte "unit, but also", $00
.byte "put and end to", $00
.byte "the black dragon", $00
.byte "and shang", $00
.byte "tsung's powerful", $00
.byte "grip on the", $00
.byte "tournament.", $FF
txt_subzero_ending:
.byte "sub-zero was", $00
.byte "paid a large sum", $00
.byte "of money for the", $00
.byte "assassination of", $00
.byte "shang tsung.", $00
.byte "with his mission", $00
.byte "accomplished, he", $00
.byte "will now retire", $00
.byte "from his dange-", $00
.byte "rous profession.", $FF
txt_scorpion_ending:
.byte "even with his", $00
.byte "triumph in the", $00
.byte "tournament, the", $00
.byte "price scorpion", $00
.byte "paid was high.", $00
.byte "he can never see", $00
.byte "his family again", $00
.byte "and must live", $00
.byte "with his secret", $00
.byte "curse.", $FF
txt_kano_ending:
.byte "with the defeat", $00
.byte "of goro and", $00
.byte "shang tsung,", $00
.byte "kano will bring", $00
.byte "his own brand of", $00
.byte "treachery to the", $00
.byte "tournament, now", $00
.byte "under the", $00
.byte "monopoly of", $00
.byte "the black dragon.", $FF
text_cage_ending:
.byte "cage returns to", $00
.byte "hollywood after", $00
.byte "defending his", $00
.byte "new title as", $00
.byte "grand champion.", $00
.byte "he goes on to", $00
.byte "film mortal", $00
.byte "kombat:the movie", $00
.byte "and its many", $00
.byte "successful", $00
.byte "sequels.", $FF
txt_liukang_ending:
.byte "after defeating", $00
.byte "goro and shang", $00
.byte "tsung, kang will", $00
.byte "continue the", $00
.byte "tranditions of", $00
.byte "the shaolin tem-", $00
.byte "ples and restore", $00
.byte "the true pride", $00
.byte "and respect of", $00
.byte "this once great", $00
.byte "tournament.", $FF
txt_goro_ending:
.byte "after annihila-", $00
.byte "ting all of the", $00
.byte "tournament's", $00
.byte "competitors,", $00
.byte "goro reaps the", $00
.byte "rewards and", $00
.byte "invades the", $00
.byte "earth kingdoms", $00
.byte "with his master", $00
.byte "shang tsung.", $FF
txt_shangtsung_ending:
.byte "once again,shang", $00
.byte "tsung has trium-", $00
.byte "phed as the only", $00
.byte "champion of the", $00
.byte "tournament.", $00
.byte "his evil reign", $00
.byte "will now forever", $00
.byte "extend to the", $00
.byte "earthrealm.", $FF
; -----------------------------------------------------------------------------