annotate menu.s68 @ 931:126c0294c1e4

Make stateview and vgmplay compile again
author Michael Pavone <pavone@retrodev.com>
date Tue, 16 Feb 2016 19:13:00 -0800
parents a3b08915624b
children 5e90fa4da2ec
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
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
172 x_pos rs.w 1
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
173 base_cmd rs.l 1
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
174 sprite_list rs.l 160
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
175 page_index rs.l MAX_DISPLAY+1
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
176 page_stack rs.l 1
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
177 page_pointers rs.l 1024
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
178 mouse_sprite rs.l 1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
179 mouse_x rs.w 1
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
180 num_sprites rs.b 1
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
181 last_pad1 rs.b 1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
182 last_pad2 rs.b 1
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
183 selected rs.b 1
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
184 more_pages rs.b 1
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
185 mouse_buf rs.b 3
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
186 mouse_shown rs.b 1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
187 last_mbuttons rs.b 1
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
188
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
189
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
190 int_6:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
191 dmasrc sprite_list, DMA_SRC_68K
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
192 ;set DMA length
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
193 move.l #$94009300, d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
194 moveq #0, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
195 move.b num_sprites.w, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
196 add.w d1, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
197 add.w d1, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
198 move.b d1, d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
199 swap d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
200 lsr.w #8, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
201 move.b d1, d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
202 move.l d0, (a1)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
203 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
204
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
205 ;read gamepad/mouse in port 1
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
206 lea PAD1_DATA, a2
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
207
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
208 bsr io_read
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
209
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
210 cmp.b #3, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
211 beq .mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
212
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
213 move.b last_pad1.w, d1
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
214 eor.b d0, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
215 and.b d0, d1
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
216 move.b d0, last_pad1.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
217
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
218 bsr handle_pad_buttons
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
219
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
220 bra pad2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
221 .mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
222 bsr handle_mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
223
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
224 pad2:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
225 ;read gamepad/mouse in port 2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
226 lea PAD2_DATA, a2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
227
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
228 bsr io_read
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
229
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
230 cmp.b #3, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
231 beq .mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
232
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
233 move.b last_pad2.w, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
234 eor.b d0, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
235 and.b d0, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
236 move.b d0, last_pad2.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
237
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
238 bsr handle_pad_buttons
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
239 rte
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
240 .mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
241 bsr handle_mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
242 rte
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
243
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
244
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
245 ;d0 = SACBRLUD
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
246 ;d1 = newly pressed buttons
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
247 handle_pad_buttons:
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
248 moveq #16, d2
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
249 btst #1, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
250 bne down
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
251 btst #0, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
252 bne up
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
253 btst #3, d1
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
254 bne right
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
255 btst #2, d1
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
256 bne left
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
257 btst #7, d1
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
258 bne select_entry
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
259 btst #5, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
260 bne select_entry
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
261 handle_done:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
262 rts
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
263
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
264 down:
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
265 ;check if we are already at the bottom of the page
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
266 moveq #1, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
267 add.b (selected).w, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
268 move.w d0, d1
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
269 add.w d0, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
270 add.w d0, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
271 lea page_index.w, a2
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
272 tst.l (0, a2, d0.w)
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
273 beq handle_done
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
274 move.b d1, (selected).w
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
275
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
276 add.w d2, (sprite_list).w
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
277 add.w d2, (sprite_list+8).w
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
278 rts
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
279 up:
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
280 ;check if we are already at the top of the page
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
281 move.b (selected).w, d0
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
282 beq handle_done
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
283 subq #1, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
284 move.b d0, (selected).w
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
285
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
286 sub.w d2, (sprite_list).w
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
287 sub.w d2, (sprite_list+8).w
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
288 rts
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
289
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
290 right:
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
291 ;check that we have another page to go to
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
292 tst.b more_pages.w
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
293 beq handle_done
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
294 ;switch to the next page
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
295 move.l page_stack.w, a6
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
296 move.l (-4, a6), a6
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
297
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
298 addq #6, a7
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
299 bra render_page
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
300
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
301 left:
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
302 move.l page_stack.w, a5
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
303 ;check if we're already on the first page
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
304 cmp.l #(page_pointers+8), a5
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
305 beq handle_done
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
306 ;switch to previous page
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
307 lea (-12, a5), a5
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
308 move.l (a5)+, a6
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
309 move.l a5, page_stack.w
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
310
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
311 addq #6, a7
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
312 bra render_page
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
313
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
314 select_entry:
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
315 moveq #0, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
316 move.b (selected).w, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
317 add.w d0, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
318 add.w d0, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
319 lea page_index.w, a2
869
4298db923cf8 Fix detection of directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 868
diff changeset
320 move.l (0, a2, d0.w), a2
4298db923cf8 Fix detection of directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 868
diff changeset
321 tst.b (-1, a2)
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
322 bne enter_dir
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
323 ;regular file
872
7022ba865cfd Initial work for allowing loading a ROM from menu
Michael Pavone <pavone@retrodev.com>
parents: 871
diff changeset
324 lea menu_port+8, a3
7022ba865cfd Initial work for allowing loading a ROM from menu
Michael Pavone <pavone@retrodev.com>
parents: 871
diff changeset
325 move.l a2, (a3)
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
326 rts
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
327 enter_dir:
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
328 lea menu_port+4, a3
869
4298db923cf8 Fix detection of directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 868
diff changeset
329 move.l a2, (a3)
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
330 .wait_complete
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
331 tst.w (a3)
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
332 bne .wait_complete
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
333 addq #6, a7
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
334 bra menu_start
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
335
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
336 handle_mouse:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
337 move.b last_mbuttons.w, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
338 eor.b d3, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
339 and.b d3, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
340 move.b d3, last_mbuttons.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
341
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
342 move.b d0, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
343 or.b d1, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
344 beq .no_mouse_move
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
345
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
346
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
347 tst.b mouse_shown.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
348 bne .skip_show_check
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
349
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
350 moveq #0, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
351 move.b num_sprites.w, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
352 move.w d2, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
353 lsl.w #3, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
354 lea sprite_list.w, a2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
355 move.b d2, (-5, a2, d4.w)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
356 lea (0, a2, d4.w), a2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
357 move.l a2, mouse_sprite.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
358 move.l #$01000500, (a2)+
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
359 move.w #$8083, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
360 move.w #$100, mouse_x.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
361 addq #1, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
362 move.b d2, num_sprites.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
363
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
364 move.b #1, mouse_shown.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
365
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
366 .skip_show_check
910
c030e4af32b7 Mouse X and Y are 9-bit 2's complement not 8-bit magnitude + sign bit like I thought. Fixed mouse Y direction.
Michael Pavone <pavone@retrodev.com>
parents: 909
diff changeset
367 neg.w d1
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
368 move.l mouse_sprite.w, a2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
369 add.w d1, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
370 add.w d0, mouse_x.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
371 move.w mouse_x.w, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
372 asr.w #1, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
373 move.w d0, (6, a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
374 move.w (a2), d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
375 cmp.w #272, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
376 blo .done
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
377 cmp.w #655, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
378 bhi .done
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
379 and.w #$FFF0, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
380 subq #8, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
381 move.w d1, (sprite_list).w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
382 move.w d1, (sprite_list+8).w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
383
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
384 sub.w #264, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
385 lsr.w #4, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
386 move.b d1, selected.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
387 .no_mouse_move
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
388 btst #0, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
389 bne select_entry
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
390 .done
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
391 rts
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
392 int_4:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
393 empty_handler:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
394 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
395
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
396 id_lookup:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
397 dc.b $0, $1, $4, $5
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
398 dc.b $2, $3, $6, $7
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
399 dc.b $8, $9, $C, $D
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
400 dc.b $A, $B, $E, $F
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
401
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
402 io_read:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
403 ;read TH=1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
404 move.b (a2), d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
405 ;read TH=0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
406 move.b #0, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
407 nop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
408 nop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
409 move.b (a2), d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
410 ;reset TH to 1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
411 move.b #$40, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
412
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
413 moveq #0, d2 ;4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
414
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
415 ;calculate Mega Drive peripheral ID
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
416 move.b d1, d2 ;4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
417 lsr.b #1, d2 ;8, 12
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
418 or.b d1, d2 ;4, 16
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
419 and.b #5, d2 ;8, 24
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
420
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
421 move.b d0, d3 ;4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
422 add.b d3, d3 ;4, 8
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
423 or.b d0, d3 ;4, 12
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
424 and.b #$A, d3 ;8, 20
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
425
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
426 or.b d3, d2 ;4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
427 move.b (id_lookup, pc, d2.w), d2 ;14
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
428
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
429
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
430 cmp.b #$3, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
431 beq .mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
432
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
433 cmp.b #$D, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
434 bne .not_pad
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
435
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
436 and.b #$3F, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
437 and.b #$30, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
438 add.b d1, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
439 add.b d1, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
440 or.b d1, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
441 not.b d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
442 rts
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
443 .not_pad:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
444 moveq #0, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
445 rts
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
446
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
447 .mouse:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
448
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
449 move.b #$60, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
450 move.b #$60, (PAD1_CTRL-PAD1_DATA, a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
451 move.b #$60, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
452
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
453 moveq #$f, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
454 wait_hi_init:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
455 btst #4, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
456 beq wait_hi_init
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
457 nop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
458 nop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
459 move.b #$20, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
460 nop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
461 nop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
462 moveq #$f, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
463 move.b #0, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
464 .wait_lo
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
465 btst #4, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
466 bne .wait_lo
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
467 moveq #$f, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
468 move.b #$20, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
469 .wait_hi
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
470 btst #4, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
471 beq .wait_hi
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
472
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
473 lea mouse_buf.w, a3
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
474 move.l a3, a4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
475 moveq #2, d3
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
476 moveq #0, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
477 loop:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
478 moveq #$f, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
479 move.b #0, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
480 .wait_lo
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
481 btst #4, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
482 bne .wait_lo
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
483 move.b (a2), d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
484 lsl.b #4, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
485 moveq #$f, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
486 move.b #$20, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
487 .wait_hi
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
488 btst #4, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
489 beq .wait_hi
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
490 move.b (a2), d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
491 and.b #$f, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
492 or.b d1, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
493 move.b d0, (a3)+
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
494
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
495 dbra d3, loop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
496
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
497 ;end request
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
498 move.b #$60, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
499
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
500
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
501 ;massage data
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
502 moveq #0, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
503 move.b d0, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
504 move.b (a4)+, d3
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
505 move.b (a4), d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
506
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
507 btst #4, d3
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
508 beq xpos
910
c030e4af32b7 Mouse X and Y are 9-bit 2's complement not 8-bit magnitude + sign bit like I thought. Fixed mouse Y direction.
Michael Pavone <pavone@retrodev.com>
parents: 909
diff changeset
509 or.w #$FF00, d0
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
510 xpos
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
511 btst #5, d3
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
512 beq ypos
910
c030e4af32b7 Mouse X and Y are 9-bit 2's complement not 8-bit magnitude + sign bit like I thought. Fixed mouse Y direction.
Michael Pavone <pavone@retrodev.com>
parents: 909
diff changeset
513 or.w #$FF00, d1
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
514 ypos
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
515 ;set port config back to normal controller mode
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
516 move.b #$40, (PAD1_CTRL-PAD1_DATA, a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
517 rts
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
518
925
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
519 topcorner equ (button-font)/64 + 32
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
520 topmiddle equ topcorner+1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
521 botcorner equ topmiddle+1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
522 botmiddle equ botcorner+1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
523 horiz_flip equ $800
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
524 vert_flip equ $1000
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
525
925
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
526 ; draws a button
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
527 ; d0.w - x in cells
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
528 ; d1.w - y in cells
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
529 ; d2.w - width in cells
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
530 ;
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
531 ; clobbers a6
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
532 draw_button:
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
533 ;multiply x by 2
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
534 add.w d0, d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
535 ;multiply y by 128
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
536 lsl.w #7, d1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
537 add.w d1, d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
538 add.w #$A000, d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
539 move.w d0, d1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
540 and.w #$3FFF, d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
541 rol.w #2, d1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
542 and.w #3, d1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
543 ori.w #(VDP_VRAM_WRITE >> 16), d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
544 swap d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
545 move.w d1, d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
546 move.l d0, (a1)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
547 move.w d2, d1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
548 ;top left corner
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
549 move.w #topcorner, (a0)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
550 subq #3, d1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
551 bmi .notopmiddle
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
552 .toploop:
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
553 ;top middle
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
554 move.w #topmiddle, (a0)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
555 dbra d1, .toploop
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
556 .notopmiddle
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
557 ;top right corner
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
558 move.w #(topcorner | horiz_flip), (a0)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
559 ;go to next row in name table
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
560 add.l #((2*64) << 16), d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
561 move.l d0, (a1)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
562 ;bottom left corner
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
563 move.w #botcorner, (a0)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
564 subq #3, d2
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
565 bmi .nomiddlebot
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
566 .botloop:
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
567 ;bottom middle
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
568 move.w #botmiddle, (a0)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
569 dbra d2, .botloop
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
570 .nomiddlebot
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
571 ;bottom right corner
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
572 move.w #(botcorner | horiz_flip), (a0)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
573 rts
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
574
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
575 initial_regs:
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
576 vdpreg MODE_2, $4 ;Mode 5, everything turned off
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
577 vdpreg MODE_1, $4
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
578 vdpreg SCROLL_A, $20 ;Scroll a table $8000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
579 vdpreg SCROLL_B, $05 ;Scroll b table $A000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
580 vdpreg SAT, $60 ;SAT table $C000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
581 vdpreg BG_COLOR, 0
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
582 vdpreg HINT, $FF
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
583 vdpreg MODE_3, 0 ;full screen scroll
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
584 vdpreg MODE_4, $87 ;40 cell mode, double-res interlace
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
585 vdpreg HSCROLL, 0
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
586 vdpreg AUTOINC, 2
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
587 vdpreg SCROLL, 1 ;64x32 scroll size
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
588 end_initial_regs
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
589
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
590 start:
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
591 lea $FF0000, a0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
592 moveq #0, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
593 move.w #($10000/8 - 1), d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
594 .clearloop:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
595 move.l d0, (a0)+
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
596 move.l d0, (a0)+
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
597 dbra d1, .clearloop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
598
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
599 lea $C00000, a0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
600 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
601
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
602 moveq #(end_initial_regs-initial_regs-1), d0
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
603 lea initial_regs.w, a2
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
604 .regloop
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
605 move.w (a2)+, (a1)
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
606 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
607
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
608 vdpaccess $0, VDP_CRAM_WRITE
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
609 move.w #$020, (a0)
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
610 move.w #$EEE, (a0)
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
611 move.w #$222, (a0)
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
612
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
613 ;init scroll table
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
614 vdpaccess $0, VDP_VRAM_WRITE
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
615 move.w #0, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
616 move.w #4, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
617
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
618 ;load tiles
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
619 vdpaccess $800, VDP_VRAM_WRITE
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
620 lea font(pc), a2
925
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
621 move.w #((buttonend-font)/4 - 1), d0
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
622 tloop:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
623 move.l (a2)+, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
624 dbra d0, tloop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
625
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
626
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
627 ;setup SAT
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
628 ;;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
629
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
630 lea sprite_list.w, a2
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
631 ;left arrow
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
632 move.l #$01080501, (a2)+
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
633 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
634
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
635 ;right arrow
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
636 move.l #$01080500, (a2)+
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
637 move.l #$887F01AA, (a2)+
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
638 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
639
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
640 menu_start:
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
641 lea page_pointers.w, a5
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
642 lea dir_buffer, a6
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
643 move.l a6, (a5)+
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
644 move.l a5, page_stack.w
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
645 lea menu_port, a2
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
646 move.l a6, (a2)
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
647
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
648 wait_complete:
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
649 tst.w (a2)
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
650 bne wait_complete
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
651
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
652 render_page:
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
653 ;clear name tables
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
654 vdpaccess $8000, VDP_VRAM_WRITE
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
655 moveq #32, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
656 swap d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
657 move.b #32, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
658 move.w #(64*64-1), d1
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
659 ploop:
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
660 move.l d0, (a0)
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
661 dbra d1, ploop
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
662
925
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
663 moveq #0, d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
664 moveq #26, d1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
665 moveq #6, d2
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
666 bsr draw_button
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
667
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
668 move.l #$40860002, d3
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
669 move.l d3, (a1)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
670 move.l d3, base_cmd.w
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
671
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
672 move.b #0, more_pages.w
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
673 lea page_index.w, a3
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
674 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
675 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
676 tst.b (a6)+
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
677 beq done_files
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
678 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
679
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
680 ;skip over entries starting with a dot except ..
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
681 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
682 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
683 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
684 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
685 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
686 .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
687 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
688 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
689 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
690 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
691 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
692 normal:
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
693 ;save entry pointer to page index
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
694 move.l a6, (a3)+
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
695 ;print name on screen
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
696 moveq #0, d0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
697 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
698 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
699
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
700 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
701 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
702
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
703 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
704 ;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
705 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
706 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
707 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
708
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
709 dbra d7, file_loop
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
710 tst.b (a6)
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
711 beq done_files
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
712 move.b #1, more_pages.w
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
713 done_files:
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
714 move.l page_stack.w, a5
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
715 move.l a6, (a5)+
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
716 move.l a5, page_stack.w
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
717
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
718 ;null terminate page_index
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
719 moveq #0, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
720 move.l d0, (a3)
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
721
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
722 ;setup gamepads
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
723 move.b #$40, PAD1_CTRL
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
724 move.b #$40, PAD2_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
725
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
726 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
727
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
728
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
729 wait_forever
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
730 stop #2500
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
731 bra wait_forever
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
732
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
733 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
734 dc.b $A, 0
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
735
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
736 align 1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
737
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
738 ;Prints a null terminated string
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
739 ;a6 - pointer to string
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
740 ;a0 - VDP data port
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
741 ;d0 - base tile attribute
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
742 ;
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
743 ;Clobbers: d1.w, d2.w, d3.l
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
744 print_string:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
745 lea widths(pc), a5
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
746 move.w x_pos.w, d2
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
747 move.l base_cmd.w, d3
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
748 .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
749 moveq #0, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
750 move.b (a6)+, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
751 beq .end
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
752 cmp.b #$A, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
753 beq .newline
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
754 tst.b (-32, a5, d1.w)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
755 beq .narrow
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
756 add.w d0, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
757 move.w d1, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
758 addq #2, d2
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
759 bra .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
760 .narrow
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
761 add.w d0, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
762 move.w d1, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
763 addq #1, d2
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
764 move.l d2, d1
791
60686f8d5e48 Add a couple of comments to menu.s68
Michael Pavone <pavone@retrodev.com>
parents: 790
diff changeset
765 ;switch to other plane
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
766 and.w #$FFFE, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
767 swap d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
768 eor.l #$20000000, d3
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
769 add.l d3, d1
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
770 move.l d1, (a1)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
771 bra .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
772 .newline
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
773 moveq #0, d2
791
60686f8d5e48 Add a couple of comments to menu.s68
Michael Pavone <pavone@retrodev.com>
parents: 790
diff changeset
774 ;switch back to plane A
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
775 and.l #$DFFFFFFF, d3
791
60686f8d5e48 Add a couple of comments to menu.s68
Michael Pavone <pavone@retrodev.com>
parents: 790
diff changeset
776 ;skip to next row
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
777 add.l #$00800000, d3
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
778 move.l d3, (a1)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
779 bra .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
780 .end
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
781 move.w d2, x_pos.w
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
782 move.l d3, base_cmd.w
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
783 rts
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
784
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
785 align 1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
786 font:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
787 incbin font_interlace_variable.tiles
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
788 fontend
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
789 arrow:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
790 incbin arrow.tiles
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
791 arrowend:
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
792 cursor:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
793 incbin cursor.tiles
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
794 cursorend:
917
f057975212e9 Added button graphic for menu
Michael Pavone <pavone@retrodev.com>
parents: 910
diff changeset
795 button:
f057975212e9 Added button graphic for menu
Michael Pavone <pavone@retrodev.com>
parents: 910
diff changeset
796 incbin button.tiles
f057975212e9 Added button graphic for menu
Michael Pavone <pavone@retrodev.com>
parents: 910
diff changeset
797 buttonend:
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
798
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
799 widths:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
800 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
801 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
802 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
803 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
804 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
805
790
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
806 rom_end: