annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1 dc.l $0, start
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4 ;$10
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
8 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
9 ;$20
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
10 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
11 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
12 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
13 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
14 ;$30
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
15 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
16 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
17 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
18 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
19 ;$40
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
20 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
21 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
22 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
23 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
24 ;$50
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
25 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
26 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
27 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
28 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
29 ;$60
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
30 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
31 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
32 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
33 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
34 ;$70
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
35 dc.l int_4
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
36 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
37 dc.l int_6
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
38 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
39 ;$80
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
40 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
41 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
42 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
43 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
44 ;$90
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
45 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
46 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
47 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
48 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
49 ;$A0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
50 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
51 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
52 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
53 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
54 ;$B0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
55 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
56 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
57 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
58 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
59 ;$C0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
60 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
61 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
62 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
63 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
64 ;$D0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
65 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
66 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
67 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
68 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
69 ;$E0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
70 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
71 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
72 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
73 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
74 ;$F0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
75 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
76 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
77 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
78 dc.l empty_handler
790
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
79 dc.b "SEGA GENESIS "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
80 dc.b "(c) 2015.JULY "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
81 dc.b "Menu "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
82 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
83 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
84 dc.b "Menu "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
85 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
86 dc.b " "
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
87 dc.b "MP BlstMenu-00", 0, 0
790
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
88 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
89 dc.l $0, rom_end-1, $FF0000, $FFFFFF
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
90 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
91 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
92 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
93 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
94 dc.b "JUE "
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
95
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
96 ;register addresses
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
97 VDP_DATA equ $C00000
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
98 VDP_CTRL equ $C00004
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
99 VDP_HV equ $C00008
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
100 Z80_RAM equ $A00000
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
101 IO_AREA equ $A10000
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
102 PAD1_DATA equ (IO_AREA + 3)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
103 PAD2_DATA equ (IO_AREA + 5)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
104 EXT_DATA equ (IO_AREA + 7)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
105 PAD1_CTRL equ (IO_AREA + 9)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
106 PAD2_CTRL equ (IO_AREA + 11)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
107 EXT_CTRL equ (IO_AREA + 13)
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
108
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
109 MODE_1 equ 0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
110 MODE_2 equ 1
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
111 SCROLL_A equ 2
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
112 WINDOW equ 3
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
113 SCROLL_B equ 4
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
114 SAT equ 5
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
115 BG_COLOR equ 7
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
116 HINT equ $A
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
117 MODE_3 equ $B
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
118 MODE_4 equ $C
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
119 HSCROLL equ $D
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
120 AUTOINC equ $F
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
121 SCROLL EQU $10
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
122 WINDOW_H equ $11
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
123 WINDOW_V equ $12
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
124 DMALEN_L equ $13
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
125 DMALEN_H equ $14
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
126 DMASRC_L equ $15
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
127 DMASRC_M equ $16
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
128 DMASRC_H equ $17
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
129
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
130 VDP_VRAM_WRITE equ $40000000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
131 VDP_CRAM_WRITE equ $C0000000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
132 VDP_VSRAM_WRITE equ $40000010
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
133 VDP_DMA_FLAG equ $80
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
134
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
135 vdpregset macro
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
136 move.w #(((\1) << 8) | $8000 | (\2)), (a1)
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
137 endm
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
138
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
139 vdpreg macro
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
140 dc.w (((\1) << 8) | $8000 | (\2))
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
141 endm
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
142
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
143 ;Writes a normal VDP command to the control port
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
144 ;\1 - VDP address
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
145 ;\2 - Access type
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
146 vdpaccess macro
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
147 move.l #((\2) | (\1) << 16 & $3FFF0000 | (\1) >> 14 & 3), (a1)
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
148 endm
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
149
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
150 ;Writes a DMA command to the control port
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
151 ;\1 - Destination address
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
152 ;\2 - Destination type
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
153 startdma macro
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
154 move.l #(\2 | VDP_DMA_FLAG | (\1 << 16) & $3FFF0000 | (\1 >> 14) & 3), (a1)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
155 endm
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
156
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
157 DMA_SRC_68K equ 0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
158 DMA_SRC_VRAM equ $C0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
159 DMA_SRC_FILL equ $80
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
160
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
161 dmasrc macro
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
162 move.l #($95009600 + (\1) << 15 & $FF0000 + (\1) >> 9 & $FF), (a1)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
163 move.w #($9700 + (\1) >> 17 & $7F | (\2)), (a1)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
164 endm
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
165
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
166 dir_buffer equ $100000
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
167 menu_port equ $180000
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
168
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
169 MAX_DISPLAY equ 24
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
170
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
171 rsset $FFFF8000
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
172 x_pos rs.w 1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
173 base_cmd rs.l 1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
174 sprite_list rs.l 160
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
175 num_sprites rs.b 1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
176 last_pad rs.b 1
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
177
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
178 int_6:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
179 dmasrc sprite_list, DMA_SRC_68K
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
180 ;set DMA length
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
181 move.l #$94009300, d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
182 moveq #0, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
183 move.b num_sprites.w, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
184 add.w d1, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
185 add.w d1, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
186 move.b d1, d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
187 swap d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
188 lsr.w #8, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
189 move.b d1, d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
190 move.l d0, (a1)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
191 startdma $C000, VDP_VRAM_WRITE
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
192
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
193 lea PAD1_DATA, a2
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
194 move.b #$40, (a2)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
195 move.b (a2), d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
196 and.b #$3F, d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
197 move.b d0, (a2)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
198 move.b (a2), d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
199 and.b #$30, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
200 add.b d1, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
201 add.b d1, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
202 or.b d1, d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
203 not.b d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
204 move.b (last_pad).w, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
205 eor.b d0, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
206 and.b d0, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
207 move.b d0, (last_pad).w
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
208
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
209 moveq #16, d2
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
210 btst #1, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
211 bne down
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
212 btst #0, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
213 bne up
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
214 rte
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
215
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
216 down:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
217 add.w d2, (sprite_list).w
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
218 add.w d2, (sprite_list+8).w
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
219 rte
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
220 up:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
221 sub.w d2, (sprite_list).w
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
222 sub.w d2, (sprite_list+8).w
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
223 rte
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
224
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
225 int_4:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
226 empty_handler:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
227 rte
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
228
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
229
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
230
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
231 initial_regs:
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
232 vdpreg MODE_2, $4 ;Mode 5, everything turned off
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
233 vdpreg MODE_1, $4
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
234 vdpreg SCROLL_A, $20 ;Scroll a table $8000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
235 vdpreg SCROLL_B, $05 ;Scroll b table $A000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
236 vdpreg SAT, $60 ;SAT table $C000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
237 vdpreg BG_COLOR, 0
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
238 vdpreg HINT, $FF
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
239 vdpreg MODE_3, 0 ;full screen scroll
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
240 vdpreg MODE_4, $87 ;40 cell mode, double-res interlace
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
241 vdpreg HSCROLL, 0
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
242 vdpreg AUTOINC, 2
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
243 vdpreg SCROLL, 1 ;64x32 scroll size
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
244 end_initial_regs
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
245
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
246 start:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
247 lea $C00000, a0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
248 lea $C00004, a1
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
249
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
250 moveq #(end_initial_regs-initial_regs-1), d0
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
251 lea initial_regs.w, a2
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
252 .regloop
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
253 move.w (a2)+, (a1)
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
254 dbra d0, .regloop
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
255
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
256 vdpaccess $0, VDP_CRAM_WRITE
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
257 move.w #$020, (a0)
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
258 move.w #$EEE, (a0)
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
259 move.w #$222, (a0)
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
260
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
261 ;init scroll table
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
262 vdpaccess $0, VDP_VRAM_WRITE
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
263 move.w #0, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
264 move.w #4, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
265
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
266 ;load tiles
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
267 vdpaccess $800, VDP_VRAM_WRITE
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
268 lea font(pc), a2
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
269 move.w #((arrowend-font)/4 - 1), d0
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
270 tloop:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
271 move.l (a2)+, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
272 dbra d0, tloop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
273
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
274
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
275
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
276 ;clear name tables
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
277 vdpaccess $8000, VDP_VRAM_WRITE
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
278 moveq #32, d0
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
279 swap d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
280 move.b #32, d0
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
281 move.w #(64*64-1), d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
282 ploop:
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
283 move.l d0, (a0)
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
284 dbra d1, ploop
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
285
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
286 ;setup SAT
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
287 ;;vdpaccess $C000, VDP_VRAM_WRITE
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
288
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
289 lea sprite_list.w, a2
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
290 ;left arrow
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
291 move.l #$01080501, (a2)+
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
292 move.l #$807F0086, (a2)+
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
293
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
294 ;right arrow
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
295 move.l #$01080500, (a2)+
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
296 move.l #$887F01AA, (a2)+
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
297 move.b #2, num_sprites.w
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
298
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
299 move.l #$40860002, d3
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
300 move.l d3, (a1)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
301 move.l d3, base_cmd.w
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
302
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
303 lea dir_buffer, a6
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
304 lea menu_port, a2
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
305 move.l a6, (a2)
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
306
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
307 wait_complete:
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
308 tst.w (a2)
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
309 bne wait_complete
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
310
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
311 moveq #MAX_DISPLAY-1, d7
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
312 file_loop:
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
313 tst.b (a6)+
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
314 addq #1, a6 ;TODO: Do something with directory flag
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
315
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
316 cmp.b #$2E, (a6)
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
317 bne normal
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
318 cmp.b #$2E, (1, a6)
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
319 beq normal
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
320 addq #1, a6
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
321 .skip_loop:
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
322 tst.b (a6)+
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
323 bne .skip_loop
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
324 addq #1, d7
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
325 move.l a6, d6
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
326 bra skip
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
327 normal:
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
328 moveq #0, d0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
329 bsr print_string
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
330 move.l a6, d6
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
331
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
332 lea Newline(pc), a6
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
333 bsr print_string
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
334
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
335 skip:
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
336 ;word align pointer
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
337 addq #1, d6
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
338 and.w #$FFFE, d6
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
339 move.l d6, a6
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
340
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
341 dbra d7, file_loop
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
342
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
343 ;setup gamepad in port 1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
344 move.b #$40, PAD1_CTRL
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
345
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
346 move.w #$8174, (a1) ;enable display, vertical interrupts, DMA
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
347
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
348
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
349 wait_forever
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
350 stop #2500
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
351 bra wait_forever
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
352
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
353 Newline:
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
354 dc.b $A, 0
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
355
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
356 align 1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
357
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
358 ;Prints a null terminated string
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
359 ;a6 - pointer to string
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
360 ;a0 - VDP data port
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
361 ;d0 - base tile attribute
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
362 ;
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
363 ;Clobbers: d1.w, d2.w, d3.l
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
364 print_string:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
365 lea widths(pc), a5
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
366 move.w x_pos.w, d2
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
367 move.l base_cmd.w, d3
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
368 .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
369 moveq #0, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
370 move.b (a6)+, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
371 beq .end
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
372 cmp.b #$A, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
373 beq .newline
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
374 tst.b (-32, a5, d1.w)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
375 beq .narrow
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
376 add.w d0, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
377 move.w d1, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
378 addq #2, d2
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
379 bra .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
380 .narrow
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
381 add.w d0, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
382 move.w d1, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
383 addq #1, d2
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
384 move.l d2, d1
791
60686f8d5e48 Add a couple of comments to menu.s68
Michael Pavone <pavone@retrodev.com>
parents: 790
diff changeset
385 ;switch to other plane
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
386 and.w #$FFFE, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
387 swap d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
388 eor.l #$20000000, d3
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
389 add.l d3, d1
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
390 move.l d1, (a1)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
391 bra .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
392 .newline
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
393 moveq #0, d2
791
60686f8d5e48 Add a couple of comments to menu.s68
Michael Pavone <pavone@retrodev.com>
parents: 790
diff changeset
394 ;switch back to plane A
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
395 and.l #$DFFFFFFF, d3
791
60686f8d5e48 Add a couple of comments to menu.s68
Michael Pavone <pavone@retrodev.com>
parents: 790
diff changeset
396 ;skip to next row
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
397 add.l #$00800000, d3
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
398 move.l d3, (a1)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
399 bra .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
400 .end
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
401 move.w d2, x_pos.w
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
402 move.l d3, base_cmd.w
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
403 rts
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
404
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
405 align 1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
406 font:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
407 incbin font_interlace_variable.tiles
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
408 fontend
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
409 arrow:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
410 incbin arrow.tiles
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
411 arrowend:
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
412
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
413 widths:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
414 dc.b 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
415 dc.b 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
416 dc.b 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
417 dc.b 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
418 dc.b 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1
866
69a6ec208111 Menu ROM now pulls real file names from the OS rather than using a fake list
Michael Pavone <pavone@retrodev.com>
parents: 827
diff changeset
419
790
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
420 rom_end: