Mercurial > repos > ghero
annotate genesis.s68 @ 9:997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 04 Sep 2013 00:41:52 -0700 |
parents | 4ffd621f1d0c |
children |
rev | line source |
---|---|
3 | 1 dc.l $0, start |
2 dc.l empty_handler | |
3 dc.l empty_handler | |
4 ;$10 | |
5 dc.l empty_handler | |
6 dc.l empty_handler | |
7 dc.l empty_handler | |
8 dc.l empty_handler | |
9 ;$20 | |
10 dc.l empty_handler | |
11 dc.l empty_handler | |
12 dc.l empty_handler | |
13 dc.l empty_handler | |
14 ;$30 | |
15 dc.l empty_handler | |
16 dc.l empty_handler | |
17 dc.l empty_handler | |
18 dc.l empty_handler | |
19 ;$40 | |
20 dc.l empty_handler | |
21 dc.l empty_handler | |
22 dc.l empty_handler | |
23 dc.l empty_handler | |
24 ;$50 | |
25 dc.l empty_handler | |
26 dc.l empty_handler | |
27 dc.l empty_handler | |
28 dc.l empty_handler | |
29 ;$60 | |
30 dc.l empty_handler | |
31 dc.l empty_handler | |
32 dc.l empty_handler | |
33 dc.l empty_handler | |
34 ;$70 | |
35 dc.l HINT | |
36 dc.l empty_handler | |
37 dc.l VINT | |
38 dc.l empty_handler | |
39 ;$80 | |
40 dc.l empty_handler | |
41 dc.l empty_handler | |
42 dc.l empty_handler | |
43 dc.l empty_handler | |
44 ;$90 | |
45 dc.l empty_handler | |
46 dc.l empty_handler | |
47 dc.l empty_handler | |
48 dc.l empty_handler | |
49 ;$A0 | |
50 dc.l empty_handler | |
51 dc.l empty_handler | |
52 dc.l empty_handler | |
53 dc.l empty_handler | |
54 ;$B0 | |
55 dc.l empty_handler | |
56 dc.l empty_handler | |
57 dc.l empty_handler | |
58 dc.l empty_handler | |
59 ;$C0 | |
60 dc.l empty_handler | |
61 dc.l empty_handler | |
62 dc.l empty_handler | |
63 dc.l empty_handler | |
64 ;$D0 | |
65 dc.l empty_handler | |
66 dc.l empty_handler | |
67 dc.l empty_handler | |
68 dc.l empty_handler | |
69 ;$E0 | |
70 dc.l empty_handler | |
71 dc.l empty_handler | |
72 dc.l empty_handler | |
73 dc.l empty_handler | |
74 ;$F0 | |
75 dc.l empty_handler | |
76 dc.l empty_handler | |
77 dc.l empty_handler | |
78 dc.l empty_handler | |
79 dc.b "SEGA" | |
80 empty_handler: | |
81 rte | |
82 start: | |
83 ;background and sprite test | |
84 | |
85 ButtonState equ $FFFFEFF0 | |
86 ButtonStateNew equ ButtonState+2 | |
87 PalAddress equ ButtonStateNew+2 | |
88 | |
89 CRAMXferSizeCmd equ $9308 | |
9
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
90 CRAMDMACmd equ $C0000080 |
3 | 91 StaticColors equ 8 |
92 | |
93 USE_HINT equ 0 | |
94 move.b #$40, $A10009 | |
95 move.l #$C00000, a4 | |
96 move.l #$c00004, a5 | |
97 | |
98 move.l #$0, a7 | |
99 | |
7
4ffd621f1d0c
Initialize VDP register 0 so it works on the Mega Everdrive. Temporarily disable the sprite stuff
Mike Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
100 move.w #$8004, (a5) |
3 | 101 move.w #$8104, (a5) ;turn off display |
102 move.w #$8200, (a5) ;Table A = 0000 | |
103 move.w #$8400, (a5) ;Table B = 0000 | |
104 move.w #$857C, (a5) ;Sprite Table = F800 | |
105 move.w #$8B00, (a5) ;set full screen vertical and horizontal scrolling | |
106 move.w #$8C01, (a5) ;H40 mode, no shadow/hilight, no interlace | |
107 move.w #$8D3F, (a5) ;H Scroll = FC00 | |
108 move.w #$9001, (a5) ;64x32 scroll tables | |
109 | |
110 | |
111 | |
112 lea BgData(pc), a0 | |
113 move.w (a0)+, d0 ;size in words | |
114 move.w (a0)+, d1 ;width in cells | |
115 move.w (a0)+, d2 ;height in cells | |
116 move.w d2, d7 | |
117 | |
118 subq #1, d0 ;adjust for 68K dbra routine | |
119 move.w #$8f02, (a5) ;autoincrement = 2 | |
120 move.l #$50200000, (a5);beginning of background tile area | |
121 CopyTiles: | |
122 move.w (a0)+, (a4) ;copy tiles to VRAM | |
123 dbra d0, CopyTiles | |
124 | |
125 move.l #$40000000, d4 ;beginning of Plane A Name table | |
126 move.l #$00800000, d5 ;delta between lines | |
127 move.w #$81, d6 | |
128 subq #1, d1 | |
129 subq #1, d2 | |
130 move.w d1, d3 | |
131 WriteNamesY: | |
132 move.l d4, (a5) | |
133 move.w d3, d1 | |
134 | |
135 WriteNamesX: | |
136 move.w d6, (a4) | |
137 addq #1, d6 | |
138 dbra d1, WriteNamesX | |
139 | |
140 add.l d5, d4 | |
141 dbra d2, WriteNamesY | |
142 | |
143 move.l #$C0000000, (a5) ;setup writes to CRAM | |
9
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
144 move.b (a0)+, d0 ;Number of static colors |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
145 move.b (a0)+, d1 ;Number of dynamic colors |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
146 ext.w d0 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
147 move.w d0, -(a7) |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
148 beq NoStatic |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
149 subq.w #1, d0 |
3 | 150 CopyColors: |
151 move.w (a0)+, (a4) | |
152 dbra d0, CopyColors | |
9
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
153 move.w (a7)+, d0 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
154 NoStatic: |
3 | 155 |
156 move.l a0, (PalAddress).w | |
157 | |
158 | |
159 move.l #$60000010, (a5) ;setup writes to VSRAM | |
160 move.w #$0, (a4) ;vscroll = 0 | |
161 | |
162 move.l #$7C000003, (a5) ;setup writes to HScroll Table FC00 | |
163 move.w #0, (a4) ;Plane A&B HScroll = 0; | |
164 move.w #0, (a4) ; | |
165 | |
166 move.l #$78000003, (a5) ;clear sprite table | |
167 move.l #0, (a4) | |
168 move.l #0, (a4) | |
169 | |
170 move.w #$8114, (a5) ;turn on DMA | |
171 | |
7
4ffd621f1d0c
Initialize VDP register 0 so it works on the Mega Everdrive. Temporarily disable the sprite stuff
Mike Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
172 ;bsr InitSprites |
4ffd621f1d0c
Initialize VDP register 0 so it works on the Mega Everdrive. Temporarily disable the sprite stuff
Mike Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
173 ;bsr AddSprite |
3 | 174 |
175 move.w #$0, (a0) | |
176 | |
7
4ffd621f1d0c
Initialize VDP register 0 so it works on the Mega Everdrive. Temporarily disable the sprite stuff
Mike Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
177 ;bsr LoadSpritePal |
4ffd621f1d0c
Initialize VDP register 0 so it works on the Mega Everdrive. Temporarily disable the sprite stuff
Mike Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
178 ;bsr InitFrameBigSprite |
3 | 179 moveq #0, d3 |
7
4ffd621f1d0c
Initialize VDP register 0 so it works on the Mega Everdrive. Temporarily disable the sprite stuff
Mike Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
180 ;bsr ChangeFrameBigSprite |
3 | 181 |
9
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
182 move.w d0, d5 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
183 ext.l d5 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
184 moveq #17, d2 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
185 lsl.l d2, d5 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
186 or.l #CRAMDMACmd, d5 ;setup DMA command word |
3 | 187 |
9
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
188 ext.w d1 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
189 beq NoDynamic |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
190 or.w #$9300, d1 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
191 move.w d1, (a5) ;set Transfer length |
3 | 192 move.w #$9400, (a5) |
193 | |
194 move.w #$8114, d6 | |
195 move.w #$8174, d7 | |
196 | |
197 if USE_HINT | |
198 | |
199 move.w #$8014, (a5) | |
200 move.w #$8A00, (a5) ;HINT occurs on every line | |
201 endif | |
202 | |
203 move.w #$8174, (a5) | |
204 move #$2300, SR | |
205 | |
206 | |
207 Loop: | |
208 if USE_HINT | |
209 bra Loop | |
210 endif | |
211 WaitTop: | |
212 cmpi.b #$FF, 4(a5) | |
213 bne.s WaitTop | |
214 | |
215 LineDone: | |
216 move.b 4(a5), d0 | |
217 WaitNextLine: | |
218 cmp.b 4(a5), d0 | |
219 beq WaitNextLine | |
220 | |
221 | |
222 | |
223 HINT: | |
9
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
224 move.w d6, (a5) |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
225 move.l d5, (a5) ;start DMA |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
226 move.w d7, (a5) |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
227 ;move.l d6, (a5) |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
228 ;move.l d7, (a5) |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
229 move.w d1, (a5) ;set Transfer length |
3 | 230 move.w #$9400, (a5) |
231 | |
232 if USE_HINT | |
233 rte | |
234 endif | |
235 | |
236 cmp.b #223, 4(a5) | |
237 beq WaitTop | |
238 | |
239 bra LineDone | |
9
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
240 NoDynamic: |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
241 move.w #$8174, (a5) |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
242 move #$2300, SR |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
243 .loop |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
244 bra .loop |
3 | 245 VINT: |
9
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
246 move.w d1, -(a7) |
3 | 247 if USE_HINT |
248 move.w #$8144, (a5) | |
249 endif | |
7
4ffd621f1d0c
Initialize VDP register 0 so it works on the Mega Everdrive. Temporarily disable the sprite stuff
Mike Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
250 ;bsr SpriteCopyVRAM |
3 | 251 |
252 bsr ReadPad | |
253 | |
7
4ffd621f1d0c
Initialize VDP register 0 so it works on the Mega Everdrive. Temporarily disable the sprite stuff
Mike Pavone <pavone@retrodev.com>
parents:
3
diff
changeset
|
254 ;bsr Player1Vint |
3 | 255 |
256 move.l (PalAddress).w, d7 ;setup DMA source address | |
257 move.w #$9500, d6 | |
258 ror.l #1, d7 | |
259 move.b d7, d6 | |
260 move.w d6, (a5) | |
261 ror.l #8, d7 | |
262 move.b d7, d6 | |
263 add.w #$100, d6 | |
264 move.w d6,(a5) | |
265 ror.l #8, d7 | |
266 move.b d7, d6 | |
267 add.w #$100, d6 | |
268 and.b #$7F, d6 | |
269 move.w d6,(a5) | |
270 | |
271 ;move.l d5, (a5) ;do DMA for first line | |
272 | |
9
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
273 move.w (a7)+, d1 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
274 move.w d1, (a5) ;set Transfer length |
3 | 275 move.w #$9400, (a5) |
276 | |
277 move.w #$8114, d6 ;VDP commands to turn screen on and off during HBlank | |
9
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
278 ;swap d6 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
279 ;swap d5 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
280 ;move.w d5, d6 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
281 ;swap d5 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
282 ;move.w d5, d7 |
997690aa0507
Improve method for choosing line palette entries. Read number of global and dynamic colors from image binary. Go back to doing a word, longword, word pattern of writes for turning off display, doing DMA and turning it back on again to make things work correctly on the real hardware.
Mike Pavone <pavone@retrodev.com>
parents:
7
diff
changeset
|
283 ;swap d7 |
3 | 284 move.w #$8174, d7 |
285 if USE_HINT | |
286 move.w d7, (a5) | |
287 endif | |
288 rte | |
289 | |
290 LoadSpritePal: | |
291 move.l #$C0200000, (a5) | |
292 moveq #$F, d0 | |
293 lea SpriteData, a0 | |
294 PalLoop: | |
295 move.w (a0)+, (a4) | |
296 dbra d0, PalLoop | |
297 rts | |
298 | |
299 Player1Vint: | |
300 move.b (ButtonState).w, d2 | |
301 move.b (ButtonStateNew).w, d3 | |
302 | |
303 moveq #0, d0 | |
304 move.w d0, d1 | |
305 | |
306 btst #5, d2 | |
307 bne ScrollRight | |
308 | |
309 btst #7, d2 | |
310 bne ScrollLeft | |
311 | |
312 btst #4, d3 | |
313 bne IncrementFrame | |
314 | |
315 | |
316 btst #6, d3 | |
317 bne DecrementFrame | |
318 | |
319 btst #2, d2 | |
320 beq PlayerShipNotLeft | |
321 subq #1, d0 | |
322 PlayerShipNotLeft: | |
323 | |
324 btst #3, d2 | |
325 beq PlayerShipNotRight | |
326 addq #1, d0 | |
327 PlayerShipNotRight: | |
328 | |
329 btst #0, d2 | |
330 beq PlayerShipNotDown | |
331 subq #1, d1 | |
332 PlayerShipNotDown: | |
333 | |
334 btst #1, d2 | |
335 beq PlayerShipNotUp | |
336 addq #1, d1 | |
337 PlayerShipNotUp: | |
338 | |
339 bsr MoveBigSprite | |
340 | |
341 rts | |
342 IncrementFrame: | |
343 move.w (PlayerShipFrame), d3 | |
344 addq #1, d3 | |
345 move.w d3, (PlayerShipFrame) | |
346 bsr ChangeFrameBigSprite | |
347 | |
348 rts | |
349 | |
350 DecrementFrame: | |
351 | |
352 move.w (PlayerShipFrame), d3 | |
353 subq #1, d3 | |
354 move.w d3, (PlayerShipFrame) | |
355 bsr ChangeFrameBigSprite | |
356 | |
357 rts | |
358 | |
359 ScrollRight: | |
360 move.w (ScrollValue), d0 | |
361 subq #1, d0 | |
362 move.l #$7C000003, (a5) ;setup writes to HScroll Table FC00 | |
363 move.w d0, (a4) | |
364 move.w d0, (a4) | |
365 move.w d0, (ScrollValue) | |
366 | |
367 rts | |
368 | |
369 ScrollLeft: | |
370 move.w (ScrollValue), d0 | |
371 addq #1, d0 | |
372 move.l #$7C000003, (a5) ;setup writes to HScroll Table FC00 | |
373 move.w d0, (a4) | |
374 move.w d0, (a4) | |
375 move.w d0, (ScrollValue) | |
376 | |
377 rts | |
378 | |
379 include sprites.s68 | |
380 | |
381 PlayerShipFrame: | |
382 dc.w 0 | |
383 | |
384 | |
385 ScrollValue: | |
386 dc.w 0 | |
387 | |
388 ReadPad: | |
389 move.b #$FF, $a10003 ;set TH for controller A | |
390 move.b $a10003, d0 ;CBRLUD | |
391 andi.b #$3F, d0 | |
392 move.b #0, $a10003 | |
393 move.b $a10003, d1 ;SA00UD | |
394 andi.b #$30, d1 | |
395 lsl.b #2, d1 | |
396 or.b d1, d0 ;SACBRLUD | |
397 not.b d0 | |
398 move.b (ButtonState).w, d1 | |
399 eor.b d0, d1 | |
400 and.b d0, d1 | |
401 move.b d0, (ButtonState).w | |
402 move.b d1, (ButtonStateNew).w | |
403 | |
404 rts | |
405 | |
406 | |
407 SpriteData: | |
408 incbin bultest.bin | |
409 BgData: | |
410 incbin logo.bin | |
411 |