-
Notifications
You must be signed in to change notification settings - Fork 1
/
astro_turret_1_data.asm
268 lines (221 loc) · 13.3 KB
/
astro_turret_1_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
//////////////////////////////////////////////////////////////////////////////
// astro_turret_1_data.asm
// Copyright(c) 2021 Neal Smith.
// License: MIT. See LICENSE file in root directory.
//////////////////////////////////////////////////////////////////////////////
// file contains the data for turret 1 frames as they are stepped through.
// turret 1 is the on that shoots straight up
#importonce
#import "../nv_c64_util/nv_color_macs.asm"
#import "../nv_c64_util/nv_screen_rect_macs.asm"
//////////////////
// turret 1 consts and variables
.const TURRET_1_START_ROW = 10
.const TURRET_1_START_COL = 37
.const TURRET_1_COLOR = NV_COLOR_YELLOW
.const TURRET_1_CHAR = $5D
.const TURRET_1_BULLET_HEIGHT = 2
.const TURRET_1_Y_VEL = -1
.const TURRET_1_X_VEL = 0
.const TURRET_1_CHAR_MEM_START = 1024 + (TURRET_1_START_ROW * 40) + 37
.const TURRET_1_COLOR_MEM_START = $D800 + (TURRET_1_CHAR_MEM_START - 1024)
.const TURRET_1_MEM_VEL = ((40*TURRET_1_Y_VEL) + (TURRET_1_X_VEL)) // -40
// number of raster frames for turret effect
.const TURRET_1_FRAMES=7
// when turret shot starts this will be non zero and count down each frame
// TurretStep will decrement it.
turret_1_count: .byte 0
turret_1_all_color_stream:
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 0)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 1)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 2)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 3)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 4)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 5)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 6)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 7)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 8)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 9)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 10)
.word $FFFF // stream command marker
.byte $FF // stream quit command
// table of the addresses of all the streams for each frame
Turret1StreamAddrTable:
.word turret_1_stream_frame_1
.word turret_1_stream_frame_2
.word turret_1_stream_frame_3
.word turret_1_stream_frame_4
.word turret_1_stream_frame_5
.word turret_1_stream_frame_6
.word turret_1_stream_frame_7
turret_1_stream_frame_1:
// copy characters to screen mem for the frame
.word $FFFF // stream command marker
.byte $01, TURRET_1_CHAR // new source byte is the bullet char
.word TURRET_1_CHAR_MEM_START + (TURRET_1_MEM_VEL * 0)
.word TURRET_1_CHAR_MEM_START + (TURRET_1_MEM_VEL * 1)
// now copy the color to the color memory for this frame
.word $FFFF // stream command marker
.byte $01, TURRET_1_COLOR // new source byte is background color
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 0)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 1)
// set the rect for this frame
.word $FFFF
.byte $02, $08 // blk copy command for 8 bytes
.word turret_1_bullet_rect // dest base for block copy
.word nv_screen_rect_char_to_screen_pixel_left(TURRET_1_START_COL, TURRET_1_START_ROW)
.word nv_screen_rect_char_to_screen_pixel_top(TURRET_1_START_COL, TURRET_1_START_ROW) - ((TURRET_1_BULLET_HEIGHT-1) * CHAR_PIXEL_HEIGHT)
.word nv_screen_rect_char_to_screen_pixel_right(TURRET_1_START_COL, TURRET_1_START_ROW)
.word nv_screen_rect_char_to_screen_pixel_bottom(TURRET_1_START_COL, TURRET_1_START_ROW)
// end the frame
.word $FFFF // stream command marker
.byte $FF // stream quit command
turret_1_stream_frame_2:
// set to bullet char poke bullet
.word $FFFF // stream command marker
.byte $01, TURRET_1_CHAR // new source byte is the bullet char
.word TURRET_1_CHAR_MEM_START + (TURRET_1_MEM_VEL * 2)
.word TURRET_1_CHAR_MEM_START + (TURRET_1_MEM_VEL * 3)
// set color for bullets and poke bullet color
.word $FFFF // stream command marker
.byte $01, TURRET_1_COLOR // new source byte is yellow color
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 2)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_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_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 0)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 1)
// set the rect for this frame
.word $FFFF
.byte $02, $08 // blk copy command for 8 bytes
.word turret_1_bullet_rect // dest base for block copy
.word nv_screen_rect_char_to_screen_pixel_left(TURRET_1_START_COL, TURRET_1_START_ROW-2)
.word nv_screen_rect_char_to_screen_pixel_top(TURRET_1_START_COL, TURRET_1_START_ROW-2) - ((TURRET_1_BULLET_HEIGHT-1) * CHAR_PIXEL_HEIGHT)
.word nv_screen_rect_char_to_screen_pixel_right(TURRET_1_START_COL, TURRET_1_START_ROW-2)
.word nv_screen_rect_char_to_screen_pixel_bottom(TURRET_1_START_COL, TURRET_1_START_ROW-2)
.word $FFFF // stream command marker
.byte $FF // stream quit command
turret_1_stream_frame_3:
// set to bullet char poke bullet
.word $FFFF // stream command marker
.byte $01, TURRET_1_CHAR // new source byte is the bullet char
.word TURRET_1_CHAR_MEM_START + (TURRET_1_MEM_VEL * 4)
.word TURRET_1_CHAR_MEM_START + (TURRET_1_MEM_VEL * 5)
// set color for bullets and poke bullet color
.word $FFFF // stream command marker
.byte $01, TURRET_1_COLOR // new source byte is yellow color
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 4)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_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_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 2)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 3)
// set the rect for this frame
.word $FFFF
.byte $02, $08 // blk copy command for 8 bytes
.word turret_1_bullet_rect // dest base for block copy
.word nv_screen_rect_char_to_screen_pixel_left(TURRET_1_START_COL, TURRET_1_START_ROW-4)
.word nv_screen_rect_char_to_screen_pixel_top(TURRET_1_START_COL, TURRET_1_START_ROW-4) - ((TURRET_1_BULLET_HEIGHT-1) * CHAR_PIXEL_HEIGHT)
.word nv_screen_rect_char_to_screen_pixel_right(TURRET_1_START_COL, TURRET_1_START_ROW-4)
.word nv_screen_rect_char_to_screen_pixel_bottom(TURRET_1_START_COL, TURRET_1_START_ROW-4)
.word $FFFF // stream command marker
.byte $FF // stream quit command
turret_1_stream_frame_4:
// set to bullet char poke bullet
.word $FFFF // stream command marker
.byte $01, TURRET_1_CHAR // new source byte is the bullet char
.word TURRET_1_CHAR_MEM_START + (TURRET_1_MEM_VEL * 6)
.word TURRET_1_CHAR_MEM_START + (TURRET_1_MEM_VEL * 7)
// set color for bullets and poke bullet color
.word $FFFF // stream command marker
.byte $01, TURRET_1_COLOR // new source byte is yellow color
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 6)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_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_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 4)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 5)
// set the rect for this frame
.word $FFFF
.byte $02, $08 // blk copy command for 8 bytes
.word turret_1_bullet_rect // dest base for block copy
.word nv_screen_rect_char_to_screen_pixel_left(TURRET_1_START_COL, TURRET_1_START_ROW-6)
.word nv_screen_rect_char_to_screen_pixel_top(TURRET_1_START_COL, TURRET_1_START_ROW-6) - ((TURRET_1_BULLET_HEIGHT-1) * CHAR_PIXEL_HEIGHT)
.word nv_screen_rect_char_to_screen_pixel_right(TURRET_1_START_COL, TURRET_1_START_ROW-6)
.word nv_screen_rect_char_to_screen_pixel_bottom(TURRET_1_START_COL, TURRET_1_START_ROW-6)
.word $FFFF // stream command marker
.byte $FF // stream quit command
turret_1_stream_frame_5:
// set to bullet char poke bullet
.word $FFFF // stream command marker
.byte $01, TURRET_1_CHAR // new source byte is the bullet char
.word TURRET_1_CHAR_MEM_START + (TURRET_1_MEM_VEL * 8)
.word TURRET_1_CHAR_MEM_START + (TURRET_1_MEM_VEL * 9)
// set color for bullets and poke bullet color
.word $FFFF // stream command marker
.byte $01, TURRET_1_COLOR // new source byte is yellow color
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 8)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_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_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 6)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 7)
// set the rect for this frame
.word $FFFF
.byte $02, $08 // blk copy command for 8 bytes
.word turret_1_bullet_rect // dest base for block copy
.word nv_screen_rect_char_to_screen_pixel_left(TURRET_1_START_COL, TURRET_1_START_ROW-8)
.word nv_screen_rect_char_to_screen_pixel_top(TURRET_1_START_COL, TURRET_1_START_ROW-8 - ((TURRET_1_BULLET_HEIGHT-1) * CHAR_PIXEL_HEIGHT))
.word nv_screen_rect_char_to_screen_pixel_right(TURRET_1_START_COL, TURRET_1_START_ROW-8)
.word nv_screen_rect_char_to_screen_pixel_bottom(TURRET_1_START_COL, TURRET_1_START_ROW-8)
.word $FFFF // stream command marker
.byte $FF // stream quit command
turret_1_stream_frame_6:
// set to bullet char poke bullet
.word $FFFF // stream command marker
.byte $01, TURRET_1_CHAR // new source byte is the bullet char
.word TURRET_1_CHAR_MEM_START + (TURRET_1_MEM_VEL * 10)
// set color for bullets and poke bullet color
.word $FFFF // stream command marker
.byte $01, TURRET_1_COLOR // new source byte is yellow color
.word TURRET_1_COLOR_MEM_START + (TURRET_1_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_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 8)
.word TURRET_1_COLOR_MEM_START + (TURRET_1_MEM_VEL * 9)
// set the rect for this frame
.word $FFFF
.byte $02, $08 // blk copy command for 8 bytes
.word turret_1_bullet_rect // dest base for block copy
.word nv_screen_rect_char_to_screen_pixel_left(TURRET_1_START_COL, TURRET_1_START_ROW-10)
.word nv_screen_rect_char_to_screen_pixel_top(TURRET_1_START_COL, TURRET_1_START_ROW-10)
.word nv_screen_rect_char_to_screen_pixel_right(TURRET_1_START_COL, TURRET_1_START_ROW-10)
.word nv_screen_rect_char_to_screen_pixel_bottom(TURRET_1_START_COL, TURRET_1_START_ROW-10)
.word $FFFF // stream command marker
.byte $FF // stream quit command
turret_1_stream_frame_7:
// no bullet for frame 7, its already off screen
// set to background color and clear previous frames color
.word $FFFF // stream command marker
.byte $FE // new source byte is background color
.word TURRET_1_COLOR_MEM_START + (TURRET_1_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_1_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 1. 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_1_bullet_rect: .word $0000, $0000 // (left, top)
.word $0000, $0000 // (right, bottom)