-
Notifications
You must be signed in to change notification settings - Fork 1
/
astro_turret_5_data.asm
359 lines (301 loc) · 14.5 KB
/
astro_turret_5_data.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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
//////////////////////////////////////////////////////////////////////////////
// astro_turret_5_data.asm
// Copyright(c) 2021 Neal Smith.
// License: MIT. See LICENSE file in root directory.
//////////////////////////////////////////////////////////////////////////////
// file contains the data for turret 5 frames as they are stepped through.
#importonce
#import "../nv_c64_util/nv_color_macs.asm"
#import "../nv_c64_util/nv_screen_rect_macs.asm"
/////////////////
// turret 2 consts and variables
.const TURRET_5_START_ROW = 14
.const TURRET_5_START_COL = 37
.const TURRET_5_COLOR = NV_COLOR_YELLOW
.const TURRET_5_CHAR = $4E
.const TURRET_5_BULLET_HEIGHT = 2
// number of raster frames for turret effect
.const TURRET_5_FRAMES=7
// when turret shot starts this will be non zero and count down each frame
// TurretStep will decrement it.
turret_5_count: .byte 0
.const TURRET_5_Y_VEL = 1
.const TURRET_5_X_VEL = -1
.const TURRET_5_CHARS_PER_FRAME = 1
//.const T5_ROW = TURRET_5_START_ROW
//.const T5_COL = TURRET_5_START_COL
.const TURRET_5_CHAR_MEM_START = 1024 + (TURRET_5_START_ROW * 40) + 37 // 1621
.const TURRET_5_COLOR_MEM_START = $D800 + (TURRET_5_CHAR_MEM_START - 1024)
.const TURRET_5_MEM_VEL = ((40*TURRET_5_Y_VEL) + (TURRET_5_X_VEL)) // 39
.function DeathRectLeftT5(frame_num)
{
//.var char_col = TURRET_5_START_COL - ((frame_num * 2)-1)
//.var char_row = TURRET_5_START_ROW - ((frame_num * 2)-1)
.var char_col = TURRET_5_START_COL + ((frame_num-1) * (2*TURRET_5_X_VEL))
.var char_row = TURRET_5_START_ROW + ((frame_num-1) * (2*TURRET_5_Y_VEL))
.if (frame_num == 6)
{
.eval char_col = char_col - 1
.eval char_row = char_row - 1
}
.var screen_left = nv_screen_rect_char_to_screen_pixel_left(char_col, char_row)
.eval screen_left = screen_left +2
.if (frame_num > 6)
{
.eval screen_left = 0
}
.return screen_left
}
.function DeathRectTopT5(frame_num)
{
//.var char_col = TURRET_5_START_COL - ((frame_num * 2)-1)
//.var char_row = TURRET_5_START_ROW - ((frame_num * 2)-1)
.var char_col = TURRET_5_START_COL + ((frame_num-1) * (2*TURRET_5_X_VEL))
.var char_row = TURRET_5_START_ROW + ((frame_num-1) * (2*TURRET_5_Y_VEL))
.if (frame_num == 6)
{
.eval char_col = char_col - 1
.eval char_row = char_row - 1
}
.var screen_top = nv_screen_rect_char_to_screen_pixel_top(char_col, char_row)
.eval screen_top = screen_top +2
.if (frame_num > 6)
{
.eval screen_top = 0
}
.return screen_top
}
.function DeathRectRightT5(frame_num)
{
//.var char_col = TURRET_5_START_COL - ((frame_num * 2)-1)
//.var char_row = TURRET_5_START_ROW - ((frame_num * 2)-1)
.var char_col = TURRET_5_START_COL + ((frame_num-1) * (2*TURRET_5_X_VEL))
.var char_row = TURRET_5_START_ROW + ((frame_num-1) * (2*TURRET_5_Y_VEL))
.if (frame_num == 6)
{
.eval char_col = char_col - 1
.eval char_row = char_row - 1
}
.var screen_right = nv_screen_rect_char_to_screen_pixel_right(char_col, char_row)
.eval screen_right = screen_right+6
.if (frame_num > 6)
{
.eval screen_right = 0
}
.return screen_right
}
.function DeathRectBottomT5(frame_num)
{
//.var char_col = TURRET_5_START_COL - ((frame_num * 2)-1)
//.var char_row = TURRET_5_START_ROW - ((frame_num * 2)-1)
.var char_col = TURRET_5_START_COL + ((frame_num-1) * (2*TURRET_5_X_VEL))
.var char_row = TURRET_5_START_ROW + ((frame_num-1) * (2*TURRET_5_Y_VEL))
.if (frame_num == 6)
{
.eval char_col = char_col - 1
.eval char_row = char_row - 1
}
.var screen_bottom = nv_screen_rect_char_to_screen_pixel_bottom(char_col, char_row)
.eval screen_bottom = screen_bottom + 6
.if (frame_num > 6)
{
.eval screen_bottom = 0
}
.return screen_bottom
}
turret_5_all_color_stream:
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 0)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 1)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 2)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 3)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 4)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 5)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 6)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 7)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 8)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 9)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 10)
.word $FFFF // stream command marker
.byte $FF // stream quit command
// table of the addresses of all the streams for each frame for turret 2
Turret5StreamAddrTable:
.word turret_5_stream_frame_1
.word turret_5_stream_frame_2
.word turret_5_stream_frame_3
.word turret_5_stream_frame_4
.word turret_5_stream_frame_5
.word turret_5_stream_frame_6
.word turret_5_stream_frame_7
turret_5_stream_frame_1:
.word $FFFF // stream command marker
.byte $01, TURRET_5_CHAR // new source byte is the bullet char
.word TURRET_5_CHAR_MEM_START + (TURRET_5_MEM_VEL * 0)
.word TURRET_5_CHAR_MEM_START + (TURRET_5_MEM_VEL * 1)
.word $FFFF // stream command marker
.byte $01, TURRET_5_COLOR // new source byte is background color
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 0)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 1)
// set the rect for this frame
.word $FFFF
.byte $02, $08 // blk copy command for 8 bytes
.word turret_5_bullet_rect // dest base for block copy
.word DeathRectLeftT5(1)
.word DeathRectTopT5(1)
.word DeathRectRightT5(1)
.word DeathRectBottomT5(1)
.word $FFFF // stream command marker
.byte $FF // stream quit command
turret_5_stream_frame_2:
// set to bullet char poke bullet
.word $FFFF // stream command marker
.byte $01, TURRET_5_CHAR // new source byte is the bullet char
.word TURRET_5_CHAR_MEM_START + (TURRET_5_MEM_VEL * 2)
.word TURRET_5_CHAR_MEM_START + (TURRET_5_MEM_VEL * 3)
// set color for bullets and poke bullet color
.word $FFFF // stream command marker
.byte $01, TURRET_5_COLOR // new source byte is yellow color
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 2)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 3)
// set to background color and clear previous frames color
.word $FFFF // stream command marker
.byte $FE // new source byte is background color
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 0)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 1)
// set the rect for this frame
.word $FFFF
.byte $02, $08 // blk copy command for 8 bytes
.word turret_5_bullet_rect // dest base for block copy
//.word nv_screen_rect_char_to_screen_pixel_left(TURRET_5_START_COL-3, TURRET_5_START_ROW-3)
.word DeathRectLeftT5(2)
.word DeathRectTopT5(2)
.word DeathRectRightT5(2)
.word DeathRectBottomT5(2)
.word $FFFF // stream command marker
.byte $FF // stream quit command
turret_5_stream_frame_3:
// set to bullet char poke bullet
.word $FFFF // stream command marker
.byte $01, TURRET_5_CHAR // new source byte is the bullet char
.word TURRET_5_CHAR_MEM_START + (TURRET_5_MEM_VEL * 4)
.word TURRET_5_CHAR_MEM_START + (TURRET_5_MEM_VEL * 5)
// set color for bullets and poke bullet color
.word $FFFF // stream command marker
.byte $01, TURRET_5_COLOR // new source byte is yellow color
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 4)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 5)
// set to background color and clear previous frames color
.word $FFFF // stream command marker
.byte $FE // new source byte is background color
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 2)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 3)
// set the rect for this frame
.word $FFFF
.byte $02, $08 // blk copy command for 8 bytes
.word turret_5_bullet_rect // dest base for block copy
//.word nv_screen_rect_char_to_screen_pixel_left(TURRET_5_START_COL-5, TURRET_5_START_ROW-5)
.word DeathRectLeftT5(3)
.word DeathRectTopT5(3)
.word DeathRectRightT5(3)
.word DeathRectBottomT5(3)
.word $FFFF // stream command marker
.byte $FF // stream quit command
turret_5_stream_frame_4:
// set to bullet char poke bullet
.word $FFFF // stream command marker
.byte $01, TURRET_5_CHAR // new source byte is the bullet char
.word TURRET_5_CHAR_MEM_START + (TURRET_5_MEM_VEL * 6)
.word TURRET_5_CHAR_MEM_START + (TURRET_5_MEM_VEL * 7)
// set color for bullets and poke bullet color
.word $FFFF // stream command marker
.byte $01, TURRET_5_COLOR // new source byte is yellow color
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 6)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 7)
// set to background color and clear previous frames color
.word $FFFF // stream command marker
.byte $FE // new source byte is background color
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 4)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 5)
// set the rect for this frame
.word $FFFF
.byte $02, $08 // blk copy command for 8 bytes
.word turret_5_bullet_rect // dest base for block copy
//.word nv_screen_rect_char_to_screen_pixel_left(TURRET_5_START_COL-7, TURRET_5_START_ROW-7)
.word DeathRectLeftT5(4)
.word DeathRectTopT5(4)
.word DeathRectRightT5(4)
.word DeathRectBottomT5(4)
.word $FFFF // stream command marker
.byte $FF // stream quit command
turret_5_stream_frame_5:
// set to bullet char poke bullet
.word $FFFF // stream command marker
.byte $01, TURRET_5_CHAR // new source byte is the bullet char
.word TURRET_5_CHAR_MEM_START + (TURRET_5_MEM_VEL * 8)
.word TURRET_5_CHAR_MEM_START + (TURRET_5_MEM_VEL * 9)
// set color for bullets and poke bullet color
.word $FFFF // stream command marker
.byte $01, TURRET_5_COLOR // new source byte is yellow color
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 8)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 9)
// set to background color and clear previous frames color
.word $FFFF // stream command marker
.byte $FE // new source byte is background color
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 6)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 7)
// set the rect for this frame
.word $FFFF
.byte $02, $08 // blk copy command for 8 bytes
.word turret_5_bullet_rect // dest base for block copy
//.word nv_screen_rect_char_to_screen_pixel_left(TURRET_5_START_COL-9, TURRET_5_START_ROW-9)
.word DeathRectLeftT5(5)
.word DeathRectTopT5(5)
.word DeathRectRightT5(5)
.word DeathRectBottomT5(5)
.word $FFFF // stream command marker
.byte $FF // stream quit command
turret_5_stream_frame_6:
// set to bullet char poke bullet
.word $FFFF // stream command marker
.byte $01, TURRET_5_CHAR // new source byte is the bullet char
.word TURRET_5_CHAR_MEM_START + (TURRET_5_MEM_VEL * 10)
// set color for bullets and poke bullet color
.word $FFFF // stream command marker
.byte $01, TURRET_5_COLOR // new source byte is yellow color
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 10)
// set to background color and clear previous frames color
.word $FFFF // stream command marker
.byte $FE // new source byte is background color
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 8)
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 9)
// set the rect for this frame
.word $FFFF
.byte $02, $08 // blk copy command for 8 bytes
.word turret_5_bullet_rect // dest base for block copy
//.word nv_screen_rect_char_to_screen_pixel_left(TURRET_5_START_COL-10, TURRET_5_START_ROW-10)
.word DeathRectLeftT5(6)
.word DeathRectTopT5(6)
.word DeathRectRightT5(6)
.word DeathRectBottomT5(6)
.word $FFFF // stream command marker
.byte $FF // stream quit command
turret_5_stream_frame_7:
// no bullet just erasing last frame's bullet
// set to background color and clear previous frames color
.word $FFFF // stream command marker
.byte $FE // new source byte is background color
.word TURRET_5_COLOR_MEM_START + (TURRET_5_MEM_VEL * 10)
// set the rect for this frame, clear it out
.word $FFFF
.byte $02, $08 // blk copy command for 8 bytes
.word turret_5_bullet_rect // dest base for block copy
.word $0000, $0000, $0000, $0000
.word $FFFF // stream command marker
.byte $FF // stream quit command
//////////////////////////////////////////////////////////////////////////////
// Data that will be modified via this wind effect and the main program can
// take actions upon
// the death rectangle for bullet 2. Turret step will update this
// rect as the bullet travels. the main engine can check this rectangle
// for overlap with sprites and act accordingly.
turret_5_bullet_rect: .word $0000, $0000 // (left, top)
.word $0000, $0000 // (right, bottom)