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