annotate menu.s68 @ 1420:975b5b7eaa77

Fix DMA from byte-wide SRAM
author Michael Pavone <pavone@retrodev.com>
date Mon, 26 Jun 2017 21:13:17 -0700
parents 19044d5e388c
children 2b34469e3f81
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 " "
1399
19044d5e388c Remove E from region header of menu so it does not run at 50Hz if the user changes the default_region setting to E
Michael Pavone <pavone@retrodev.com>
parents: 1354
diff changeset
94 dc.b "JU "
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
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
147 ifeq NARG-2
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
148 move.l #((\2) | (\1) << 16 & $3FFF0000 | (\1) >> 14 & 3), (a1)
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
149 else
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
150 move.l #((\2) | (\1) << 16 & $3FFF0000 | (\1) >> 14 & 3), \3
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
151 endif
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
152 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
153
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
154 ;Writes a DMA command to the control port
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
155 ;\1 - Destination address
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
156 ;\2 - Destination type
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
157 startdma macro
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
158 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
159 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
160
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
161 DMA_SRC_68K equ 0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
162 DMA_SRC_VRAM equ $C0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
163 DMA_SRC_FILL equ $80
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
164
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
165 dmasrc macro
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
166 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
167 move.w #($9700 + (\1) >> 17 & $7F | (\2)), (a1)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
168 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
169
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 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
171 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
172
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
173 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
174
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
175 rsset $FFFF8000
994
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
176 x_pos rs.w 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
177 base_cmd rs.l 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
178 sprite_list rs.l 160
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
179 page_index rs.l MAX_DISPLAY+1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
180 page_stack rs.l 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
181 page_pointers rs.l 1024
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
182 mouse_sprite rs.l 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
183 menu_functions rs.l 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
184 cursor_show_fun rs.l 1
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
185 special_click rs.l 1
994
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
186 mouse_x rs.w 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
187 selection_top rs.w 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
188 selection_bot rs.w 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
189 selection_mask rs.w 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
190 num_sprites rs.b 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
191 last_pad1 rs.b 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
192 last_pad2 rs.b 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
193 selected rs.b 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
194 more_pages rs.b 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
195 mouse_buf rs.b 3
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
196 mouse_shown rs.b 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
197 last_mbuttons rs.b 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
198 num_menu rs.b 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
199 num_slots rs.b 1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
200 port_off rs.b 1
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
201
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
202
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
203 int_6:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
204 dmasrc sprite_list, DMA_SRC_68K
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
205 ;set DMA length
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
206 move.l #$94009300, d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
207 moveq #0, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
208 move.b num_sprites.w, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
209 add.w d1, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
210 add.w d1, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
211 move.b d1, d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
212 swap d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
213 lsr.w #8, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
214 move.b d1, d0
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
215 move.l d0, (a1)
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
216 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
217
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
218 ;read gamepad/mouse in port 1
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
219 lea PAD1_DATA, a2
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
220
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
221 bsr io_read
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
222
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
223 cmp.b #3, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
224 beq .mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
225
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
226 move.b last_pad1.w, d1
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
227 eor.b d0, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
228 and.b d0, d1
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
229 move.b d0, last_pad1.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
230
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
231 bsr handle_pad_buttons
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 bra pad2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
234 .mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
235 bsr handle_mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
236
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
237 pad2:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
238 ;read gamepad/mouse in port 2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
239 lea PAD2_DATA, a2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
240
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
241 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
242
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
243 cmp.b #3, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
244 beq .mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
245
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
246 move.b last_pad2.w, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
247 eor.b d0, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
248 and.b d0, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
249 move.b d0, last_pad2.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
250
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
251 bsr handle_pad_buttons
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
252 rte
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
253 .mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
254 bsr handle_mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
255 rte
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
256
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
257
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
258 ;d0 = SACBRLUD
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
259 ;d1 = newly pressed buttons
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
260 handle_pad_buttons:
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
261 tst.b num_menu.w
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
262 bne handle_buttons_menu
960
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
263 tst.b num_slots.w
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
264 bne handle_buttons_save
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
265 moveq #16, d2
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
266
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
267
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
268 btst #3, d1
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
269 bne right
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
270 btst #2, d1
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
271 bne left
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
272 buttons_no_leftright
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
273 btst #1, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
274 bne down
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
275 btst #0, d1
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
276 bne up
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
277 btst #7, d1
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
278 bne select_entry
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
279 btst #5, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
280 bne select_entry
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
281 handle_done:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
282 rts
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
283 handle_buttons_menu
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
284 moveq #48, d2
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
285 bra buttons_no_leftright
960
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
286 handle_buttons_save
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
287 moveq #32, d2
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
288 bra buttons_no_leftright
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
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
290 down:
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
291
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
292 ;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
293 moveq #1, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
294 add.b (selected).w, d0
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
295 tst.b num_menu.w
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
296 bne .menu
960
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
297 tst.b num_slots.w
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
298 bne .slots
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
299 move.w d0, d1
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
300 add.w d1, d1
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
301 add.w d1, d1
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
302 lea page_index.w, a2
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
303 tst.l (0, a2, d1.w)
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
304 beq handle_done
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
305 .do_move
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
306 move.b d0, (selected).w
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
307
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
308 add.w d2, (sprite_list).w
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
309 add.w d2, (sprite_list+8).w
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
310 rts
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
311 .menu:
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
312 cmp.b num_menu.w, d0
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
313 beq handle_done
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
314 bra .do_move
960
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
315 .slots:
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
316 cmp.b num_slots.w, d0
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
317 beq handle_done
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
318 bra .do_move
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
319
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
320 up:
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
321 ;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
322 move.b (selected).w, d0
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
323 beq handle_done
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
324 subq #1, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
325 move.b d0, (selected).w
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
326
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
327 sub.w d2, (sprite_list).w
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
328 sub.w d2, (sprite_list+8).w
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
329 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
330
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
331 right:
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
332 ;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
333 tst.b more_pages.w
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
334 beq handle_done
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
335 ;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
336 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
337 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
338
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
339 addq #6, a7
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
340 bra render_page
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
341
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
342 left:
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
343 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
344 ;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
345 cmp.l #(page_pointers+8), a5
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
346 beq handle_done
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
347 ;switch to previous page
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
348 lea (-12, a5), a5
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
349 move.l (a5)+, a6
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
350 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
351
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
352 addq #6, a7
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
353 bra render_page
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
354
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
355 select_entry:
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
356 moveq #0, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
357 move.b (selected).w, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
358 add.w d0, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
359 add.w d0, d0
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
360 tst.b num_menu.w
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
361 bne .select_menu_button
961
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
362 tst.b num_slots.w
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
363 bne .select_save_slot
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
364 lea page_index.w, a2
869
4298db923cf8 Fix detection of directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 868
diff changeset
365 move.l (0, a2, d0.w), a2
4298db923cf8 Fix detection of directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 868
diff changeset
366 tst.b (-1, a2)
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
367 bne enter_dir
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
368 ;regular file
872
7022ba865cfd Initial work for allowing loading a ROM from menu
Michael Pavone <pavone@retrodev.com>
parents: 871
diff changeset
369 lea menu_port+8, a3
7022ba865cfd Initial work for allowing loading a ROM from menu
Michael Pavone <pavone@retrodev.com>
parents: 871
diff changeset
370 move.l a2, (a3)
950
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
371
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
372 addq #6, a7
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
373 bra show_pause_menu
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
374 .select_menu_button:
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
375 movea.l menu_functions.w, a2
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
376 move.l (0, a2, d0.w), a2
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
377 addq #6, a7
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
378 jmp (a2)
961
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
379 .select_save_slot:
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
380 lea menu_port, a3
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
381 moveq #0, d0
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
382 move.b port_off.w, d0
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
383 add.w d0, a3
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
384 move.b selected.w, d0
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
385 move.l d0, (a3)
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
386 addq #6, a7
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
387 jmp show_pause_menu
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
388
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
389 enter_dir:
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
390 lea menu_port+4, a3
869
4298db923cf8 Fix detection of directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 868
diff changeset
391 move.l a2, (a3)
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
392 .wait_complete
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
393 tst.w (a3)
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
394 bne .wait_complete
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
395 addq #6, a7
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
396 bra menu_start
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
397
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
398 handle_mouse:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
399 move.b last_mbuttons.w, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
400 eor.b d3, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
401 and.b d3, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
402 move.b d3, last_mbuttons.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
403
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
404 move.b d0, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
405 or.b d1, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
406 beq .no_mouse_move
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
407
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
408
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
409 tst.b mouse_shown.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
410 bne .skip_show_check
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
411
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
412 moveq #0, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
413 move.b num_sprites.w, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
414 move.w d2, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
415 lsl.w #3, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
416 lea sprite_list.w, a2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
417 move.b d2, (-5, a2, d4.w)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
418 lea (0, a2, d4.w), a2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
419 move.l a2, mouse_sprite.w
1198
8715174e9366 Adjust mouse cursor in absolute mode/menu to account for presence of top border
Michael Pavone <pavone@retrodev.com>
parents: 1069
diff changeset
420 move.l #$00EA0500, (a2)+
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
421 move.w #$8083, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
422 move.w #$100, mouse_x.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
423 addq #1, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
424 move.b d2, num_sprites.w
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 move.b #1, mouse_shown.w
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
427
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
428 move.l cursor_show_fun.w, d2
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
429 beq .skip_show_check
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
430 move.l d2, a2
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
431 jsr (a2)
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
432
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
433
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
434 .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
435 neg.w d1
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
436 move.l mouse_sprite.w, a2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
437 add.w d1, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
438 add.w d0, mouse_x.w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
439 move.w mouse_x.w, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
440 asr.w #1, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
441 move.w d0, (6, a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
442 move.w (a2), d1
970
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
443 cmp.w selection_top.w, d1
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
444 blo .done
970
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
445 cmp.w selection_bot.w, d1
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
446 bhi .special_click
970
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
447 tst.b num_menu.w
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
448 bne .handle_menu
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
449 tst.b num_slots.w
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
450 bne .handle_slots
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
451 and.w #$FFF0, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
452 subq #8, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
453 move.w d1, (sprite_list).w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
454 move.w d1, (sprite_list+8).w
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
455
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
456 sub.w #264, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
457 lsr.w #4, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
458 move.b d1, selected.w
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
459 bra .normal_click
970
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
460 .handle_menu
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
461 ;TODO: FIXME
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
462 and.w #$FFF0, d1
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
463 moveq #0, d0
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
464 move.w d1, d0
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
465 sub.w selection_top.w, d0
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
466 divu.w #48, d0
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
467 swap d0
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
468 tst.w d0
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
469 beq .no_adjust
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
470
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
471 cmp.w #16, d0
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
472 bne .round_up
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
473 swap d0
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
474 sub.w #16, d1
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
475 bra .set_cursor_pos
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
476
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
477 .round_up
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
478 swap d0
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
479 addq #1, d0
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
480 add.w #16, d1
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
481 bra .set_cursor_pos
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
482
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
483 .no_adjust
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
484 swap d0
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
485 .set_cursor_pos
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
486 move.w d1, (sprite_list).w
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
487 move.w d1, (sprite_list+8).w
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
488
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
489 move.b d0, selected.w
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
490
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
491 bra .normal_click
970
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
492 .handle_slots
973
fbd783ccbadb Get mouse working in save state slot selection menu
Michael Pavone <pavone@retrodev.com>
parents: 970
diff changeset
493 and.w #$FFE0, d1
fbd783ccbadb Get mouse working in save state slot selection menu
Michael Pavone <pavone@retrodev.com>
parents: 970
diff changeset
494 subq #8, d1
fbd783ccbadb Get mouse working in save state slot selection menu
Michael Pavone <pavone@retrodev.com>
parents: 970
diff changeset
495 move.w d1, (sprite_list).w
fbd783ccbadb Get mouse working in save state slot selection menu
Michael Pavone <pavone@retrodev.com>
parents: 970
diff changeset
496 move.w d1, (sprite_list+8).w
fbd783ccbadb Get mouse working in save state slot selection menu
Michael Pavone <pavone@retrodev.com>
parents: 970
diff changeset
497
fbd783ccbadb Get mouse working in save state slot selection menu
Michael Pavone <pavone@retrodev.com>
parents: 970
diff changeset
498 sub.w #264, d1
fbd783ccbadb Get mouse working in save state slot selection menu
Michael Pavone <pavone@retrodev.com>
parents: 970
diff changeset
499 lsr.w #5, d1
fbd783ccbadb Get mouse working in save state slot selection menu
Michael Pavone <pavone@retrodev.com>
parents: 970
diff changeset
500 move.b d1, selected.w
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
501 .normal_click
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
502 btst #0, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
503 bne select_entry
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
504 .done
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
505 rts
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
506 .no_mouse_move
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
507 tst.b mouse_shown
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
508 bne .skip_show_check
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
509 rts
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
510 .special_click:
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
511 btst #0, d4
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
512 beq .done
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
513 move.l special_click.w, d2
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
514 beq .done
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
515 move.l d2, a2
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
516 jmp (a2)
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
517 int_4:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
518 empty_handler:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
519 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
520
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
521 id_lookup:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
522 dc.b $0, $1, $4, $5
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
523 dc.b $2, $3, $6, $7
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
524 dc.b $8, $9, $C, $D
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
525 dc.b $A, $B, $E, $F
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
526
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
527 io_read:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
528 ;read TH=1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
529 move.b (a2), d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
530 ;read TH=0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
531 move.b #0, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
532 nop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
533 nop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
534 move.b (a2), d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
535 ;reset TH to 1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
536 move.b #$40, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
537
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
538 moveq #0, d2 ;4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
539
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
540 ;calculate Mega Drive peripheral ID
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
541 move.b d1, d2 ;4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
542 lsr.b #1, d2 ;8, 12
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
543 or.b d1, d2 ;4, 16
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
544 and.b #5, d2 ;8, 24
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
545
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
546 move.b d0, d3 ;4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
547 add.b d3, d3 ;4, 8
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
548 or.b d0, d3 ;4, 12
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
549 and.b #$A, d3 ;8, 20
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
550
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
551 or.b d3, d2 ;4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
552 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
553
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
554
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
555 cmp.b #$3, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
556 beq .mouse
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
557
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
558 cmp.b #$D, d2
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
559 bne .not_pad
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
560
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
561 and.b #$3F, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
562 and.b #$30, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
563 add.b d1, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
564 add.b d1, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
565 or.b d1, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
566 not.b d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
567 rts
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
568 .not_pad:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
569 moveq #0, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
570 rts
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
571
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
572 .mouse:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
573
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
574 move.b #$60, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
575 move.b #$60, (PAD1_CTRL-PAD1_DATA, a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
576 move.b #$60, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
577
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
578 moveq #$f, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
579 wait_hi_init:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
580 btst #4, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
581 beq wait_hi_init
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
582 nop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
583 nop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
584 move.b #$20, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
585 nop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
586 nop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
587 moveq #$f, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
588 move.b #0, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
589 .wait_lo
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
590 btst #4, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
591 bne .wait_lo
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
592 moveq #$f, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
593 move.b #$20, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
594 .wait_hi
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
595 btst #4, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
596 beq .wait_hi
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
597
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
598 lea mouse_buf.w, a3
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
599 move.l a3, a4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
600 moveq #2, d3
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
601 moveq #0, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
602 loop:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
603 moveq #$f, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
604 move.b #0, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
605 .wait_lo
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
606 btst #4, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
607 bne .wait_lo
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
608 move.b (a2), d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
609 lsl.b #4, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
610 moveq #$f, d4
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
611 move.b #$20, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
612 .wait_hi
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
613 btst #4, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
614 beq .wait_hi
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
615 move.b (a2), d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
616 and.b #$f, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
617 or.b d1, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
618 move.b d0, (a3)+
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
619
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
620 dbra d3, loop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
621
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
622 ;end request
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
623 move.b #$60, (a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
624
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
625
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
626 ;massage data
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
627 moveq #0, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
628 move.b d0, d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
629 move.b (a4)+, d3
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
630 move.b (a4), d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
631
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
632 btst #4, d3
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
633 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
634 or.w #$FF00, d0
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
635 xpos
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
636 btst #5, d3
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
637 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
638 or.w #$FF00, d1
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
639 ypos
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
640 ;set port config back to normal controller mode
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
641 move.b #$40, (PAD1_CTRL-PAD1_DATA, a2)
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
642 rts
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
643
925
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
644 topcorner equ (button-font)/64 + 32
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
645 topmiddle equ topcorner+1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
646 botcorner equ topmiddle+1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
647 botmiddle equ botcorner+1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
648 horiz_flip equ $800
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
649 vert_flip equ $1000
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
650
925
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
651 ; draws a button
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
652 ; d0.w - x in cells
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
653 ; d1.w - y in cells
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
654 ; d2.w - width in cells
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
655 ;
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
656 ; clobbers a6
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
657 draw_button:
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
658 ;multiply x by 2
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
659 add.w d0, d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
660 ;multiply y by 128
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
661 lsl.w #7, d1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
662 add.w d1, d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
663 add.w #$A000, d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
664 move.w d0, d1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
665 and.w #$3FFF, d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
666 rol.w #2, d1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
667 and.w #3, d1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
668 ori.w #(VDP_VRAM_WRITE >> 16), d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
669 swap d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
670 move.w d1, d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
671 move.l d0, (a1)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
672 move.w d2, d1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
673 ;top left corner
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
674 move.w #topcorner, (a0)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
675 subq #3, d1
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
676 bmi .notopmiddle
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
677 .toploop:
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
678 ;top middle
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
679 move.w #topmiddle, (a0)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
680 dbra d1, .toploop
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
681 .notopmiddle
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
682 ;top right corner
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
683 move.w #(topcorner | horiz_flip), (a0)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
684 ;go to next row in name table
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
685 add.l #((2*64) << 16), d0
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
686 move.l d0, (a1)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
687 ;bottom left corner
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
688 move.w #botcorner, (a0)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
689 subq #3, d2
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
690 bmi .nomiddlebot
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
691 .botloop:
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
692 ;bottom middle
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
693 move.w #botmiddle, (a0)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
694 dbra d2, .botloop
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
695 .nomiddlebot
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
696 ;bottom right corner
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
697 move.w #(botcorner | horiz_flip), (a0)
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
698 rts
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
699
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
700 ;a5 - menu pointer
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
701 ;d6 - initial Y position of menu
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
702 draw_menu:
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
703 moveq #0, d7
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
704 moveq #0, d5
1010
edab85c29d4d Fix bug in which trying to load another ROM after saving or loading a savestate through the menu resulted in trying to save/load a savestate instead
Michael Pavone <pavone@retrodev.com>
parents: 994
diff changeset
705 ;clear out save slot state
edab85c29d4d Fix bug in which trying to load another ROM after saving or loading a savestate through the menu resulted in trying to save/load a savestate instead
Michael Pavone <pavone@retrodev.com>
parents: 994
diff changeset
706 move.b d5, num_slots.w
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
707 ;clear out event handlers
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
708 move.l d5, cursor_show_fun.w
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
709 move.l d5, special_click.w
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
710 ;select first item
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
711 move.b d7, selected.w
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
712 ;save menu pointer for second pass
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
713 movea.l a5, a4
970
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
714 ;adjust arrow mask
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
715 move.w #$FFE0, selection_mask.w
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
716 .lenloop
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
717 tst.b (a5)
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
718 beq .lendone
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
719 addq #1, d5
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
720 movea.l a5, a6
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
721 bsr strlen
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
722 cmp.w d7, d0
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
723 blo .nochange
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
724 move.w d0, d7
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
725 .nochange
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
726 lea (1, a5, d0.w), a5
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
727 bra .lenloop
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
728 .lendone
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
729
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
730 addq #2, d7
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
731 move.b d5, num_menu.w
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
732
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
733 ;calculate X position
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
734 move.w d7, d4
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
735 lsr.w #1, d4
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
736 moveq #20, d5
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
737 sub.w d4, d5
943
05229aa23b00 Adjust arrow X positions in menu
Michael Pavone <pavone@retrodev.com>
parents: 942
diff changeset
738 ;calculate left arrow X
05229aa23b00 Adjust arrow X positions in menu
Michael Pavone <pavone@retrodev.com>
parents: 942
diff changeset
739 move.w d5, d4
05229aa23b00 Adjust arrow X positions in menu
Michael Pavone <pavone@retrodev.com>
parents: 942
diff changeset
740 lsl.w #3, d4
05229aa23b00 Adjust arrow X positions in menu
Michael Pavone <pavone@retrodev.com>
parents: 942
diff changeset
741 add.w #(128-24), d4
05229aa23b00 Adjust arrow X positions in menu
Michael Pavone <pavone@retrodev.com>
parents: 942
diff changeset
742 move.w d4, (sprite_list+6).w
05229aa23b00 Adjust arrow X positions in menu
Michael Pavone <pavone@retrodev.com>
parents: 942
diff changeset
743 ;calculate right arrow x
05229aa23b00 Adjust arrow X positions in menu
Michael Pavone <pavone@retrodev.com>
parents: 942
diff changeset
744 move.w d7, d3
05229aa23b00 Adjust arrow X positions in menu
Michael Pavone <pavone@retrodev.com>
parents: 942
diff changeset
745 lsl.w #3, d3
05229aa23b00 Adjust arrow X positions in menu
Michael Pavone <pavone@retrodev.com>
parents: 942
diff changeset
746 add.w d3, d4
05229aa23b00 Adjust arrow X positions in menu
Michael Pavone <pavone@retrodev.com>
parents: 942
diff changeset
747 add.w #32, d4
05229aa23b00 Adjust arrow X positions in menu
Michael Pavone <pavone@retrodev.com>
parents: 942
diff changeset
748 move.w d4, (sprite_list+6+8).w
944
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
749 ;update left arrow Y
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
750 move.w d6, d4
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
751 lsl.w #4, d4
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
752 add.w #256, d4
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
753 move.w d4, (sprite_list).w
10dd8c04cbbc Handle up down buttons when in a menu
Michael Pavone <pavone@retrodev.com>
parents: 943
diff changeset
754 move.w d4, (sprite_list+8).w
970
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
755 ;update mouse top limit
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
756 move.w d4, selection_top.w
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
757 ;restore menu pointer
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
758 movea.l a4, a5
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
759 .drawloop
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
760 tst.b (a5)
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
761 beq .done
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
762 ;x pos
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
763 move.w d5, d0
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
764 ;y pos
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
765 move.w d6, d1
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
766 ;width
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
767 move.w d7, d2
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
768 bsr draw_button
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
769
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
770 movea.l a5, a6
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
771 bsr strlen
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
772 movea.l a5, a6
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
773 lea (1, a5, d0.w), a5
942
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
774 ;x pos
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
775 move.w d7, d1
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
776 lsr.w #1, d1
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
777 add.w d5, d1
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
778 lsr.w #1, d0
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
779 sub.w d0, d1
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
780 ;y pos
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
781 move.w d6, d2
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
782 ;base attribute
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
783 move.w #$206B, d0
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
784 bsr print_string_fixed
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
785
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
786 addq #3, d6
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
787 bra .drawloop
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
788 .done
970
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
789 ;update mouse bottom limit
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
790 lsl.w #4, d6
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
791 add.w #224, d6
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
792 move.w d6, selection_bot.w
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
793 rts
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
794
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
795 clear_screen:
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
796 ;clear name tables
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
797 vdpaccess $8000, VDP_VRAM_WRITE
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
798 moveq #32, d0
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
799 swap d0
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
800 move.b #32, d0
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
801 move.w #(64*64-1), d1
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
802 ploop:
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
803 move.l d0, (a0)
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
804 dbra d1, ploop
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
805 rts
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
806
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
807 initial_regs:
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
808 vdpreg MODE_2, $4 ;Mode 5, everything turned off
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
809 vdpreg MODE_1, $4
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
810 vdpreg SCROLL_A, $20 ;Scroll a table $8000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
811 vdpreg SCROLL_B, $05 ;Scroll b table $A000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
812 vdpreg SAT, $60 ;SAT table $C000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
813 vdpreg BG_COLOR, 0
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
814 vdpreg HINT, $FF
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
815 vdpreg MODE_3, 0 ;full screen scroll
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
816 vdpreg MODE_4, $87 ;40 cell mode, double-res interlace
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
817 vdpreg HSCROLL, 0
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
818 vdpreg AUTOINC, 2
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
819 vdpreg SCROLL, 1 ;64x32 scroll size
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
820 end_initial_regs
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
821
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
822 start:
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
823 lea $FF0000, a0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
824 moveq #0, d0
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
825 move.w #($10000/8 - 1), d1
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
826 .clearloop:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
827 move.l d0, (a0)+
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
828 move.l d0, (a0)+
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
829 dbra d1, .clearloop
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
830
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
831 lea $C00000, a0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
832 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
833
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
834 moveq #(end_initial_regs-initial_regs-1), d0
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
835 lea initial_regs.w, a2
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
836 .regloop
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
837 move.w (a2)+, (a1)
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
838 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
839
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
840 vdpaccess $0, VDP_CRAM_WRITE
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
841 move.w #$020, (a0)
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
842 move.w #$EEE, (a0)
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
843 move.w #$222, (a0)
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
844
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
845 ;init scroll table
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
846 vdpaccess $0, VDP_VRAM_WRITE
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
847 move.w #0, (a0)
942
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
848 move.w #0, (a0)
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
849
946
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
850
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
851 ;load tiles
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
852 vdpaccess $800, VDP_VRAM_WRITE
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
853 lea font(pc), a2
925
a3b08915624b WIP menu button stuff
Michael Pavone <pavone@retrodev.com>
parents: 917
diff changeset
854 move.w #((buttonend-font)/4 - 1), d0
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
855 tloop:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
856 move.l (a2)+, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
857 dbra d0, tloop
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
858 move.w #((fontfixedend-fontfixed)/4 - 1), d0
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
859 dtloop:
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
860 move.l (a2)+, d1
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
861 move.l d1, (a0)
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
862 move.l d1, (a0)
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
863 dbra d0, dtloop
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
864
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
865
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
866 ;setup SAT
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
867 ;;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
868
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
869 lea sprite_list.w, a2
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
870 ;left arrow
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
871 move.l #$01080501, (a2)+
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
872 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
873
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
874 ;right arrow
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
875 move.l #$01080500, (a2)+
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
876 move.l #$887F01AA, (a2)+
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
877 move.b #2, num_sprites.w
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
878
946
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
879 show_main_menu:
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
880 bsr clear_screen
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
881 ;init vertical scroll RAM
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
882 vdpaccess $0, VDP_VSRAM_WRITE
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
883 move.w #-4, (a0)
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
884 move.w #0, (a0)
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
885
946
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
886 moveq #8, d6
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
887 move.l #main_menu_func, menu_functions.w
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
888 lea main_menu(pc), a5
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
889 bsr draw_menu
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
890 bra gamepad_setup
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
891
950
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
892 show_pause_menu:
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
893 bsr clear_screen
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
894 ;init vertical scroll RAM
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
895 vdpaccess $0, VDP_VSRAM_WRITE
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
896 move.w #-4, (a0)
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
897 move.w #0, (a0)
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
898 moveq #8, d6
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
899 move.l #pause_menu_func, menu_functions.w
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
900 lea pause_menu(pc), a5
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
901 bsr draw_menu
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
902 bra gamepad_setup
946
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
903
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
904 menu_start:
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
905 moveq #0, d0
946
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
906 ;init vertical scroll RAM
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
907 vdpaccess $0, VDP_VSRAM_WRITE
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
908 move.w d0, (a0)
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
909 move.w d0, (a0)
946
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
910
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
911 ;reset arrow position
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
912 move.w #$0108, sprite_list.w
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
913 move.w #$0108, (sprite_list + 8).w
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
914 move.w #$0086, (sprite_list + 6).w
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
915 move.w #$01AA, (sprite_list + 6 + 8).w
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
916
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
917 ;reset selection
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
918 move.b d0, selected.w
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
919
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
920 ;reset special click handler
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
921 move.l d0, special_click.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
922
946
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
923
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
924 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
925 lea dir_buffer, a6
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
926 move.l a6, (a5)+
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
927 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
928 lea menu_port, a2
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
929 move.l a6, (a2)
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
930
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
931 wait_complete:
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
932 tst.w (a2)
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
933 bne wait_complete
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
934
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
935 render_page:
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
936 bsr clear_screen
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
937
946
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
938 ;clear menu state
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
939 move.b #0, num_menu.w
970
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
940 move.w #272, selection_top.w
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
941 move.w #655, selection_bot.w
e2d7067ea2d8 Got mouse working right in main and about menus
Michael Pavone <pavone@retrodev.com>
parents: 961
diff changeset
942 move.w #$FFF0, selection_mask.w
946
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
943
942
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
944 ;init scroll table
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
945 vdpaccess $0, VDP_VRAM_WRITE
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
946 move.w #0, (a0)
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
947 move.w #4, (a0)
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
948
946
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
949 move.l #$40860002, d3
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
950 move.l d3, (a1)
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
951 move.l d3, base_cmd.w
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
952
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
953 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
954 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
955 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
956 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
957 tst.b (a6)+
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
958 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
959 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
960
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
961 ;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
962 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
963 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
964 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
965 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
966 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
967 .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
968 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
969 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
970 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
971 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
972 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
973 normal:
868
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
974 ;save entry pointer to page index
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
975 move.l a6, (a3)+
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
976 ;print name on screen
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
977 moveq #0, d0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
978 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
979 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
980
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
981 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
982 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
983
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
984 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
985 ;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
986 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
987 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
988 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
989
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
990 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
991 tst.b (a6)
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
992 beq done_files
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
993 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
994 done_files:
871
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
995 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
996 move.l a6, (a5)+
f364f4f22f8f Allow navigation between pages for long directories in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 869
diff changeset
997 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
998
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
999 ;null terminate page_index
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
1000 moveq #0, d0
1bab7e01ae98 Allow directory navigation in menu. Sort directory entries
Michael Pavone <pavone@retrodev.com>
parents: 866
diff changeset
1001 move.l d0, (a3)
994
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1002
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1003 tst.b mouse_shown
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1004 beq .no_mouse
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1005
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1006 tst.b more_pages.w
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1007 beq .no_next_page
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1008
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1009 ;draw Next button
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1010 moveq #30, d0
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1011 moveq #26, d1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1012 moveq #6, d2
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1013 bsr draw_button
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1014
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1015 ;base attribute
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1016 move.w #$206B, d0
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1017 ;x pos
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1018 moveq #32, d1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1019 ;y pos
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1020 moveq #26, d2
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1021 lea next_str(pc), a6
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1022 bsr print_string_fixed
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1023
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1024 .no_next_page
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1025
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1026 cmp.l #(page_pointers+8), a5
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1027 beq .no_prev_page
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1028
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1029 ;draw Prev button
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1030 moveq #3, d0
994
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1031 moveq #26, d1
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1032 moveq #6, d2
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1033 bsr draw_button
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1034
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1035 ;base attribute
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1036 move.w #$206B, d0
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1037 ;x pos
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1038 moveq #5, d1
994
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1039 ;y pos
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1040 moveq #26, d2
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1041 lea prev_str(pc), a6
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1042 bsr print_string_fixed
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1043
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1044 .no_prev_page
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1045
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1046 move.l #0, cursor_show_fun.w
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1047
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1048 bra .done_page_buttons
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1049 .no_mouse
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1050 move.l #show_prev_next_buttons, cursor_show_fun.w
994
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1051 .done_page_buttons
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1052 move.l #handle_prev_next_click, special_click.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
1053
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1054 gamepad_setup:
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
1055 ;setup gamepads
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
1056 move.b #$40, PAD1_CTRL
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
1057 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
1058
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
1059 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
1060
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1061
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1062 wait_forever
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
1063 stop #2500
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1064 bra wait_forever
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1065
1011
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1066 handle_prev_next_click:
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1067 ;make sure we're actually low enough
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1068 cmp.w #663, d1
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1069 bls .no_prev_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1070
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1071
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1072 tst.b more_pages.w
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1073 beq .no_next_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1074
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1075 cmp.w #373, d0
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1076 blo .no_next_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1077
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1078 cmp.w #419, d0
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1079 bhi .no_next_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1080
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1081 ;switch to the next page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1082 move.l page_stack.w, a6
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1083 move.l (-4, a6), a6
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1084
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1085 add.w #10, a7
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1086 bra render_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1087
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1088 .no_next_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1089 cmp.l #(page_pointers+8), a5
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1090 beq .no_prev_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1091
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1092 cmp.w #157, d0
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1093 blo .no_prev_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1094
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1095 cmp.w #203, d0
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1096 bhi .no_prev_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1097
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1098 ;switch to previous page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1099 lea (-12, a5), a5
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1100 move.l (a5)+, a6
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1101 move.l a5, page_stack.w
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1102
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1103 add.w #10, a7
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1104 bra render_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1105
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1106 .no_prev_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1107 rts
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1108
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1109 show_prev_next_buttons:
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1110 movem.l d0-d2/a6, -(a7)
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1111 tst.b more_pages.w
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1112 beq .no_next_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1113
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1114 ;draw Next button
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1115 moveq #30, d0
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1116 moveq #26, d1
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1117 moveq #6, d2
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1118 bsr draw_button
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1119
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1120 ;base attribute
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1121 move.w #$206B, d0
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1122 ;x pos
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1123 moveq #32, d1
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1124 ;y pos
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1125 moveq #26, d2
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1126 lea next_str(pc), a6
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1127 bsr print_string_fixed
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1128
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1129 .no_next_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1130
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1131 cmp.l #(page_pointers+8), a5
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1132 beq .no_prev_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1133
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1134 ;draw Prev button
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1135 moveq #3, d0
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1136 moveq #26, d1
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1137 moveq #6, d2
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1138 bsr draw_button
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1139
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1140 ;base attribute
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1141 move.w #$206B, d0
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1142 ;x pos
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1143 moveq #5, d1
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1144 ;y pos
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1145 moveq #26, d2
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1146 lea prev_str(pc), a6
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1147 bsr print_string_fixed
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1148
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1149 .no_prev_page
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1150 move.l #0, cursor_show_fun.w
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1151 movem.l (a7)+, d0-d2/a6
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1152 rts
4a14d80584b6 Fully functional next/previous buttons
Michael Pavone <pavone@retrodev.com>
parents: 1010
diff changeset
1153
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1154 show_about:
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1155 bsr clear_screen
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1156 moveq #1, d7
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1157 lea about_text(pc), a6
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1158 ;base attribute
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1159 move.w #$006B, d0
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1160 .loop
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1161 tst.b (a6)
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1162 beq .done
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1163 ;x pos
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1164 moveq #1, d1
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1165 ;y pos
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1166 move.w d7, d2
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1167 bsr print_string_fixed
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1168 addq #1, d7
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1169 bra .loop
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1170 .done
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1171 moveq #8, d6
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1172 move.l #about_menu_func, menu_functions.w
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1173 lea about_menu(pc), a5
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1174 bsr draw_menu
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1175 .wait
960
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1176 stop #$2500
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1177 bra .wait
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1178
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1179 exit:
954
cbc5b39e5518 Implement "Resume" button in pause menu
Michael Pavone <pavone@retrodev.com>
parents: 950
diff changeset
1180 move.l #1, menu_port+12
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1181 bra exit
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1182
950
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1183 resume:
954
cbc5b39e5518 Implement "Resume" button in pause menu
Michael Pavone <pavone@retrodev.com>
parents: 950
diff changeset
1184 move.l #2, menu_port+12
cbc5b39e5518 Implement "Resume" button in pause menu
Michael Pavone <pavone@retrodev.com>
parents: 950
diff changeset
1185 bra show_pause_menu
950
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1186
958
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1187 show_save_slots:
960
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1188 move.w #(256+26), sprite_list.w
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1189 move.w #(256+26), (sprite_list+8).w
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1190 move.w #(128+8), (sprite_list+6).w
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1191 move.w #(128+320-24), (sprite_list+6+8).w
973
fbd783ccbadb Get mouse working in save state slot selection menu
Michael Pavone <pavone@retrodev.com>
parents: 970
diff changeset
1192 move.w #(256+32), selection_top.w
960
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1193 move.b #0, selected.w
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1194 move.b #0, num_menu.w
958
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1195 lea dir_buffer, a6
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1196 lea menu_port+16, a3
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1197 move.l a6, (a3)
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1198 .waitdone:
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1199 tst.w (a3)
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1200 bne .waitdone
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1201 bsr clear_screen
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1202 moveq #0, d0
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1203
960
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1204 moveq #0, d6
958
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1205 moveq #2, d7
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1206 .slotloop
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1207 tst.b (a6)
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1208 beq .done
960
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1209 addq #1, d6
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1210 moveq #4, d1
958
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1211 move.w d7, d2
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1212 bsr print_string_fixed
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1213 addq #2, d7
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1214 bra .slotloop
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1215 .done
973
fbd783ccbadb Get mouse working in save state slot selection menu
Michael Pavone <pavone@retrodev.com>
parents: 970
diff changeset
1216 lsl.w #4, d7
fbd783ccbadb Get mouse working in save state slot selection menu
Michael Pavone <pavone@retrodev.com>
parents: 970
diff changeset
1217 add.w #248, d7
fbd783ccbadb Get mouse working in save state slot selection menu
Michael Pavone <pavone@retrodev.com>
parents: 970
diff changeset
1218 move.w d7, selection_bot.w
960
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1219 move.b d6, num_slots.w
958
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1220 rts
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1221
950
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1222 save_state:
961
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
1223 move.b #(5*4), port_off.w
958
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1224 bsr show_save_slots
960
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1225 .wait
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1226 stop #$2500
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1227 bra .wait
950
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1228
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1229 load_state:
961
750995b587a0 Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents: 960
diff changeset
1230 move.b #(6*4), port_off.w
958
83532f944e3b Get slot list displaying in "Save State" and "Load State" menu items
Michael Pavone <pavone@retrodev.com>
parents: 957
diff changeset
1231 bsr show_save_slots
960
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1232 .wait
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1233 stop #$2500
0abfecaaf5c8 Get cursor behaving properly in save state slot list
Michael Pavone <pavone@retrodev.com>
parents: 958
diff changeset
1234 bra .wait
950
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1235
994
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1236 next_str:
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1237 dc.b "Next", 0
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1238 prev_str:
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1239 dc.b "Prev", 0
4360cb5960c8 Added code to display Next and Prev buttons on file listing screens to menu
Michael Pavone <pavone@retrodev.com>
parents: 973
diff changeset
1240
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1241 about_text:
1354
34798ad9c570 Updated special thanks and version number listed in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 1198
diff changeset
1242 dc.b "BlastEm v0.5.0", 0
34798ad9c570 Updated special thanks and version number listed in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 1198
diff changeset
1243 dc.b "Copyright 2011-2017 Michael Pavone", 0
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1244 dc.b " ", 0
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1245 dc.b "BlastEm is a high performance, open", 0
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1246 dc.b "source (GPLv3) Genesis/Megadrive", 0
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1247 dc.b "emulator.",0
1064
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1248 dc.b " ", 0
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1249 dc.b " ", 0
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1250 dc.b " ", 0
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1251 dc.b " ", 0
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1252 dc.b " --- Special Thanks ---", 0
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1253 dc.b " ", 0
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1254 dc.b "Nemesis: Documentatino and test ROMs", 0
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1255 dc.b "Charles MacDonald: Documentation", 0
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1256 dc.b "Eke-Eke: Documentation", 0
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1257 dc.b "Bart Trzynadlowski: Documentation", 0
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1258 dc.b "KanedaFR: Hosting the best Sega forum", 0
1354
34798ad9c570 Updated special thanks and version number listed in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 1198
diff changeset
1259 dc.b "Titan: Awesome demos and documentation", 0
1069
dc05e3a7d8da Updated special thanks
Michael Pavone <pavone@retrodev.com>
parents: 1064
diff changeset
1260 dc.b "micky: Testing", 0
1354
34798ad9c570 Updated special thanks and version number listed in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 1198
diff changeset
1261 dc.b "Sasha: Testing", 0
34798ad9c570 Updated special thanks and version number listed in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 1198
diff changeset
1262 dc.b "lol-frank: Testing", 0
1064
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1263 dc.b "Sik: Testing", 0
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1264 dc.b "Tim Lawrence : Testing", 0
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1265 dc.b "ComradeOj: Testing", 0
c58be8ac3b02 Add Special Thanks to About menu
Michael Pavone <pavone@retrodev.com>
parents: 1063
diff changeset
1266 dc.b "Vladikcomper: Testing", 0
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1267 dc.b 0
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1268
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1269
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
1270 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
1271 dc.b $A, 0
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1272
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1273 align 1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1274
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1275 ;Prints a null terminated string
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1276 ;a6 - pointer to string
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1277 ;a0 - VDP data port
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1278 ;d0 - base tile attribute
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1279 ;
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1280 ;Clobbers: d1.w, d2.w, d3.l
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1281 print_string:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1282 lea widths(pc), a5
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1283 move.w x_pos.w, d2
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1284 move.l base_cmd.w, d3
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1285 .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1286 moveq #0, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1287 move.b (a6)+, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1288 beq .end
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1289 cmp.b #$A, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1290 beq .newline
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1291 tst.b (-32, a5, d1.w)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1292 beq .narrow
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1293 add.w d0, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1294 move.w d1, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1295 addq #2, d2
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1296 bra .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1297 .narrow
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1298 add.w d0, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1299 move.w d1, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1300 addq #1, d2
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1301 move.l d2, d1
791
60686f8d5e48 Add a couple of comments to menu.s68
Michael Pavone <pavone@retrodev.com>
parents: 790
diff changeset
1302 ;switch to other plane
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1303 and.w #$FFFE, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1304 swap d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1305 eor.l #$20000000, d3
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
1306 add.l d3, d1
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1307 move.l d1, (a1)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1308 bra .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1309 .newline
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1310 moveq #0, d2
791
60686f8d5e48 Add a couple of comments to menu.s68
Michael Pavone <pavone@retrodev.com>
parents: 790
diff changeset
1311 ;switch back to plane A
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1312 and.l #$DFFFFFFF, d3
791
60686f8d5e48 Add a couple of comments to menu.s68
Michael Pavone <pavone@retrodev.com>
parents: 790
diff changeset
1313 ;skip to next row
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1314 add.l #$00800000, d3
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1315 move.l d3, (a1)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1316 bra .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1317 .end
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1318 move.w d2, x_pos.w
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1319 move.l d3, base_cmd.w
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1320 rts
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1321
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1322 ;Prints a null-terminated string with a fixed width font
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1323 ;a6 - pointer to string
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1324 ;a0 - VDP data port
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1325 ;d0 - base tile attribute
942
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1326 ;d1 - x col
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1327 ;d2 - y col
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1328 ;
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1329 print_string_fixed:
942
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1330 ;multiply x by 2
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1331 add.w d1, d1
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1332 ;multiply y by 128
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1333 lsl.w #7, d2
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1334 add.w d2, d1
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1335 add.w #$8000, d1
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1336 move.w d1, d2
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1337 and.w #$3FFF, d1
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1338 rol.w #2, d2
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1339 and.w #3, d2
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1340 ori.w #(VDP_VRAM_WRITE >> 16), d1
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1341 swap d1
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1342 move.w d2, d1
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1343 move.l d1, (a1)
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1344 .loop
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1345 moveq #0, d1
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1346 move.b (a6)+, d1
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1347 beq .end
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1348 add.w d0, d1
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1349 move.w d1, (a0)
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1350 bra .loop
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1351 .end
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1352 rts
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1353
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1354 ;Returns string length in d0
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1355 ;a6 - pointer to string
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1356 strlen:
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1357 moveq #-1, d0
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1358 .loop
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1359 addq #1, d0
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1360 tst.b (a6)+
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1361 bne .loop
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1362 rts
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1363
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1364 align 1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1365 font:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1366 incbin font_interlace_variable.tiles
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1367 fontend
827
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
1368 arrow:
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
1369 incbin arrow.tiles
35f5658d141f Add selection arrow to menu
Michael Pavone <pavone@retrodev.com>
parents: 814
diff changeset
1370 arrowend:
909
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
1371 cursor:
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
1372 incbin cursor.tiles
e60eb88d7b09 Added mouse support to menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 872
diff changeset
1373 cursorend:
917
f057975212e9 Added button graphic for menu
Michael Pavone <pavone@retrodev.com>
parents: 910
diff changeset
1374 button:
f057975212e9 Added button graphic for menu
Michael Pavone <pavone@retrodev.com>
parents: 910
diff changeset
1375 incbin button.tiles
f057975212e9 Added button graphic for menu
Michael Pavone <pavone@retrodev.com>
parents: 910
diff changeset
1376 buttonend:
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1377 fontfixed:
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1378 incbin font.tiles
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1379 fontfixedend:
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1380
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1381 widths:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1382 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
1383 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
1384 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
1385 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
1386 dc.b 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1387
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1388 main_menu:
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1389 dc.b "Load ROM", 0
942
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1390 dc.b "About", 0
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1391 dc.b "Exit", 0
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1392 dc.b 0
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1393
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1394 align 1
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1395 main_menu_func:
946
6b90ec50daf3 Get "Load ROM" menu option working correctly
Michael Pavone <pavone@retrodev.com>
parents: 945
diff changeset
1396 dc.l menu_start
945
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1397 dc.l show_about
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1398 dc.l exit
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1399
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1400 about_menu:
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1401 dc.b "Return", 0
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1402 dc.b 0
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1403
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1404 align 1
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1405 about_menu_func:
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1406 dc.l show_main_menu
67f738bda7e2 Working about menu
Michael Pavone <pavone@retrodev.com>
parents: 944
diff changeset
1407
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1408 pause_menu:
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1409 dc.b "Resume", 0
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1410 dc.b "Load ROM", 0
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1411 dc.b "Save State", 0
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1412 dc.b "Load State", 0
942
74bb286e6174 Draw button labels
Michael Pavone <pavone@retrodev.com>
parents: 941
diff changeset
1413 dc.b "Exit", 0
941
c96647630320 WIP buttons in menu ROM
Michael Pavone <pavone@retrodev.com>
parents: 932
diff changeset
1414 dc.b 0
950
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1415
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1416 align 1
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1417 pause_menu_func
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1418 dc.l resume
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1419 dc.l menu_start
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1420 dc.l save_state
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1421 dc.l load_state
938c72a2f7a9 Initial work on pause menu
Michael Pavone <pavone@retrodev.com>
parents: 949
diff changeset
1422 dc.l exit
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
1423
790
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
1424 rom_end: