comparison menu.s68 @ 866:69a6ec208111

Menu ROM now pulls real file names from the OS rather than using a fake list
author Michael Pavone <pavone@retrodev.com>
date Fri, 06 Nov 2015 12:19:39 -0800
parents 35f5658d141f
children 1bab7e01ae98
comparison
equal deleted inserted replaced
865:305c85c0b954 866:69a6ec208111
82 dc.b " " 82 dc.b " "
83 dc.b " " 83 dc.b " "
84 dc.b "Menu " 84 dc.b "Menu "
85 dc.b " " 85 dc.b " "
86 dc.b " " 86 dc.b " "
87 dc.b "GM MK-00000-00", 0, 0 87 dc.b "MP BlstMenu-00", 0, 0
88 dc.b " " 88 dc.b " "
89 dc.l $0, rom_end-1, $FF0000, $FFFFFF 89 dc.l $0, rom_end-1, $FF0000, $FFFFFF
90 dc.b " " 90 dc.b " "
91 dc.b " " 91 dc.b " "
92 dc.b " " 92 dc.b " "
93 dc.b " " 93 dc.b " "
94 dc.b "JUE " 94 dc.b "JUE "
95 95
96 ;register addresses 96 ;register addresses
97 VDP_DATA equ $C00000 97 VDP_DATA equ $C00000
98 VDP_CTRL equ $C00004 98 VDP_CTRL equ $C00004
99 VDP_HV equ $C00008 99 VDP_HV equ $C00008
100 Z80_RAM equ $A00000 100 Z80_RAM equ $A00000
137 endm 137 endm
138 138
139 vdpreg macro 139 vdpreg macro
140 dc.w (((\1) << 8) | $8000 | (\2)) 140 dc.w (((\1) << 8) | $8000 | (\2))
141 endm 141 endm
142 142
143 ;Writes a normal VDP command to the control port 143 ;Writes a normal VDP command to the control port
144 ;\1 - VDP address 144 ;\1 - VDP address
145 ;\2 - Access type 145 ;\2 - Access type
146 vdpaccess macro 146 vdpaccess macro
147 move.l #((\2) | (\1) << 16 & $3FFF0000 | (\1) >> 14 & 3), (a1) 147 move.l #((\2) | (\1) << 16 & $3FFF0000 | (\1) >> 14 & 3), (a1)
148 endm 148 endm
149 149
150 ;Writes a DMA command to the control port 150 ;Writes a DMA command to the control port
151 ;\1 - Destination address 151 ;\1 - Destination address
152 ;\2 - Destination type 152 ;\2 - Destination type
153 startdma macro 153 startdma macro
154 move.l #(\2 | VDP_DMA_FLAG | (\1 << 16) & $3FFF0000 | (\1 >> 14) & 3), (a1) 154 move.l #(\2 | VDP_DMA_FLAG | (\1 << 16) & $3FFF0000 | (\1 >> 14) & 3), (a1)
155 endm 155 endm
156 156
157 DMA_SRC_68K equ 0 157 DMA_SRC_68K equ 0
158 DMA_SRC_VRAM equ $C0 158 DMA_SRC_VRAM equ $C0
159 DMA_SRC_FILL equ $80 159 DMA_SRC_FILL equ $80
160 160
161 dmasrc macro 161 dmasrc macro
162 move.l #($95009600 + (\1) << 15 & $FF0000 + (\1) >> 9 & $FF), (a1) 162 move.l #($95009600 + (\1) << 15 & $FF0000 + (\1) >> 9 & $FF), (a1)
163 move.w #($9700 + (\1) >> 17 & $7F | (\2)), (a1) 163 move.w #($9700 + (\1) >> 17 & $7F | (\2)), (a1)
164 endm 164 endm
165 165
166 dir_buffer equ $100000
167 menu_port equ $180000
168
169 MAX_DISPLAY equ 24
170
166 rsset $FFFF8000 171 rsset $FFFF8000
167 x_pos rs.w 1 172 x_pos rs.w 1
168 base_cmd rs.l 1 173 base_cmd rs.l 1
169 sprite_list rs.l 160 174 sprite_list rs.l 160
170 num_sprites rs.b 1 175 num_sprites rs.b 1
171 last_pad rs.b 1 176 last_pad rs.b 1
172 177
173 int_6: 178 int_6:
174 dmasrc sprite_list, DMA_SRC_68K 179 dmasrc sprite_list, DMA_SRC_68K
175 ;set DMA length 180 ;set DMA length
176 move.l #$94009300, d0 181 move.l #$94009300, d0
177 moveq #0, d1 182 moveq #0, d1
182 swap d0 187 swap d0
183 lsr.w #8, d1 188 lsr.w #8, d1
184 move.b d1, d0 189 move.b d1, d0
185 move.l d0, (a1) 190 move.l d0, (a1)
186 startdma $C000, VDP_VRAM_WRITE 191 startdma $C000, VDP_VRAM_WRITE
187 192
188 lea PAD1_DATA, a2 193 lea PAD1_DATA, a2
189 move.b #$40, (a2) 194 move.b #$40, (a2)
190 move.b (a2), d0 195 move.b (a2), d0
191 and.b #$3F, d0 196 and.b #$3F, d0
192 move.b d0, (a2) 197 move.b d0, (a2)
198 not.b d0 203 not.b d0
199 move.b (last_pad).w, d1 204 move.b (last_pad).w, d1
200 eor.b d0, d1 205 eor.b d0, d1
201 and.b d0, d1 206 and.b d0, d1
202 move.b d0, (last_pad).w 207 move.b d0, (last_pad).w
203 208
204 moveq #16, d2 209 moveq #16, d2
205 btst #1, d1 210 btst #1, d1
206 bne down 211 bne down
207 btst #0, d1 212 btst #0, d1
208 bne up 213 bne up
209 rte 214 rte
210 215
211 down: 216 down:
212 add.w d2, (sprite_list).w 217 add.w d2, (sprite_list).w
213 add.w d2, (sprite_list+8).w 218 add.w d2, (sprite_list+8).w
214 rte 219 rte
215 up: 220 up:
216 sub.w d2, (sprite_list).w 221 sub.w d2, (sprite_list).w
217 sub.w d2, (sprite_list+8).w 222 sub.w d2, (sprite_list+8).w
218 rte 223 rte
219 224
220 int_4: 225 int_4:
221 empty_handler: 226 empty_handler:
222 rte 227 rte
223 228
224 229
225 230
226 initial_regs: 231 initial_regs:
227 vdpreg MODE_2, $4 ;Mode 5, everything turned off 232 vdpreg MODE_2, $4 ;Mode 5, everything turned off
228 vdpreg MODE_1, $4 233 vdpreg MODE_1, $4
239 end_initial_regs 244 end_initial_regs
240 245
241 start: 246 start:
242 lea $C00000, a0 247 lea $C00000, a0
243 lea $C00004, a1 248 lea $C00004, a1
244 249
245 moveq #(end_initial_regs-initial_regs-1), d0 250 moveq #(end_initial_regs-initial_regs-1), d0
246 lea initial_regs.w, a2 251 lea initial_regs.w, a2
247 .regloop 252 .regloop
248 move.w (a2)+, (a1) 253 move.w (a2)+, (a1)
249 dbra d0, .regloop 254 dbra d0, .regloop
250 255
251 vdpaccess $0, VDP_CRAM_WRITE 256 vdpaccess $0, VDP_CRAM_WRITE
252 move.w #$020, (a0) 257 move.w #$020, (a0)
253 move.w #$EEE, (a0) 258 move.w #$EEE, (a0)
254 move.w #$222, (a0) 259 move.w #$222, (a0)
255 260
275 move.b #32, d0 280 move.b #32, d0
276 move.w #(64*64-1), d1 281 move.w #(64*64-1), d1
277 ploop: 282 ploop:
278 move.l d0, (a0) 283 move.l d0, (a0)
279 dbra d1, ploop 284 dbra d1, ploop
280 285
281 ;setup SAT 286 ;setup SAT
282 ;;vdpaccess $C000, VDP_VRAM_WRITE 287 ;;vdpaccess $C000, VDP_VRAM_WRITE
283 288
284 lea sprite_list.w, a2 289 lea sprite_list.w, a2
285 ;left arrow 290 ;left arrow
286 move.l #$01080501, (a2)+ 291 move.l #$01080501, (a2)+
287 move.l #$807F0086, (a2)+ 292 move.l #$807F0086, (a2)+
288 293
289 ;right arrow 294 ;right arrow
290 move.l #$01080500, (a2)+ 295 move.l #$01080500, (a2)+
291 move.l #$887F01AA, (a2)+ 296 move.l #$887F01AA, (a2)+
292 move.b #2, num_sprites.w 297 move.b #2, num_sprites.w
293 298
294 move.l #$40860002, d3 299 move.l #$40860002, d3
295 move.l d3, (a1) 300 move.l d3, (a1)
296 move.l d3, base_cmd.w 301 move.l d3, base_cmd.w
297 302
298 lea Message(pc), a6 303 lea dir_buffer, a6
304 lea menu_port, a2
305 move.l a6, (a2)
306
307 wait_complete:
308 tst.w (a2)
309 bne wait_complete
310
311 moveq #MAX_DISPLAY-1, d7
312 file_loop:
313 tst.b (a6)+
314 addq #1, a6 ;TODO: Do something with directory flag
315
316 cmp.b #$2E, (a6)
317 bne normal
318 cmp.b #$2E, (1, a6)
319 beq normal
320 addq #1, a6
321 .skip_loop:
322 tst.b (a6)+
323 bne .skip_loop
324 addq #1, d7
325 move.l a6, d6
326 bra skip
327 normal:
299 moveq #0, d0 328 moveq #0, d0
300 bsr print_string 329 bsr print_string
301 330 move.l a6, d6
331
332 lea Newline(pc), a6
333 bsr print_string
334
335 skip:
336 ;word align pointer
337 addq #1, d6
338 and.w #$FFFE, d6
339 move.l d6, a6
340
341 dbra d7, file_loop
342
302 ;setup gamepad in port 1 343 ;setup gamepad in port 1
303 move.b #$40, PAD1_CTRL 344 move.b #$40, PAD1_CTRL
304 345
305 move.w #$8174, (a1) ;enable display, vertical interrupts, DMA 346 move.w #$8174, (a1) ;enable display, vertical interrupts, DMA
306 347
307 348
308 wait_forever 349 wait_forever
309 stop #2500 350 stop #2500
310 bra wait_forever 351 bra wait_forever
311 352
312 Message: 353 Newline:
313 dc.b "Journey From Darkness - Strider Returns (U) [c][!].bin", $A 354 dc.b $A, 0
314 dc.b "Toejam & Earl in Panic on Funkotron (U) [!].bin", $A
315 dc.b "Fire Shark (U) [c][!].bin", $A
316 dc.b "Sonic and Knuckles (W) [!].bin", 0
317 355
318 align 1 356 align 1
319 357
320 ;Prints a null terminated string 358 ;Prints a null terminated string
321 ;a6 - pointer to string 359 ;a6 - pointer to string
376 dc.b 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1 414 dc.b 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1
377 dc.b 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0 415 dc.b 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0
378 dc.b 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1 416 dc.b 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1
379 dc.b 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 417 dc.b 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
380 dc.b 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1 418 dc.b 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1
381 419
382 rom_end: 420 rom_end: