annotate menu.s68 @ 814:109ac52ffecd

Menu cleanup with macros
author Michael Pavone <pavone@retrodev.com>
date Mon, 27 Jul 2015 09:27:15 -0700
parents 60686f8d5e48
children 35f5658d141f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1 dc.l $0, start
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4 ;$10
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
8 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
9 ;$20
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
10 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
11 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
12 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
13 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
14 ;$30
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
15 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
16 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
17 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
18 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
19 ;$40
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
20 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
21 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
22 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
23 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
24 ;$50
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
25 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
26 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
27 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
28 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
29 ;$60
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
30 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
31 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
32 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
33 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
34 ;$70
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
35 dc.l int_4
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
36 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
37 dc.l int_6
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
38 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
39 ;$80
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
40 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
41 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
42 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
43 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
44 ;$90
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
45 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
46 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
47 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
48 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
49 ;$A0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
50 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
51 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
52 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
53 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
54 ;$B0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
55 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
56 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
57 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
58 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
59 ;$C0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
60 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
61 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
62 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
63 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
64 ;$D0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
65 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
66 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
67 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
68 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
69 ;$E0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
70 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
71 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
72 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
73 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
74 ;$F0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
75 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
76 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
77 dc.l empty_handler
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
78 dc.l empty_handler
790
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
79 dc.b "SEGA GENESIS "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
80 dc.b "(c) 2015.JULY "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
81 dc.b "Menu "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
82 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
83 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
84 dc.b "Menu "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
85 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
86 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
87 dc.b "GM MK-00000-00", 0, 0
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
88 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
89 dc.l $0, rom_end-1, $FF0000, $FFFFFF
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
90 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
91 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
92 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
93 dc.b " "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
94 dc.b "JUE "
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
95
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
96 ;register addresses
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
97 VDP_DATA equ $C00000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
98 VDP_CTRL equ $C00004
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
99 VDP_HV equ $C00008
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
100 Z80_RAM equ $A00000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
101 IO_AREA equ $A10000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
102
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
103 MODE_0 equ 0
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
104 MODE_1 equ 1
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
105 SCROLL_A equ 2
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
106 WINDOW equ 3
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
107 SCROLL_B equ 4
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
108 SAT equ 5
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
109 BG_COLOR equ 7
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
110 HINT equ $A
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
111 MODE_3 equ $B
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
112 MODE_4 equ $C
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
113 HSCROLL equ $D
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
114 AUTOINC equ $F
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
115 SCROLL EQU $10
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
116 WINDOW_H equ $11
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
117 WINDOW_V equ $12
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
118 DMALEN_L equ $13
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
119 DMALEN_H equ $14
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
120 DMASRC_L equ $15
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
121 DMASRC_M equ $16
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
122 DMASRC_H equ $17
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
123
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
124 VDP_VRAM_WRITE equ $40000000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
125 VDP_CRAM_WRITE equ $C0000000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
126 VDP_VSRAM_WRITE equ $40000010
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
127 VDP_DMA_FLAG equ $80
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
128
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
129 vdpregset macro
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
130 move.w #(((\1) << 8) | $8000 | (\2)), (a1)
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
131 endm
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
132
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
133 vdpreg macro
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
134 dc.w (((\1) << 8) | $8000 | (\2))
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
135 endm
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
136
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
137 ;Writes a normal VDP command to the control port
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
138 ;\1 - VDP address
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
139 ;\2 - Access type
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
140 vdpaccess macro
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
141 move.l #((\2) | (\1) << 16 & $3FFF0000 | (\1) >> 14 & 3), (a1)
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
142 endm
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
143
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
144 empty_handler:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
145 int_6:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
146 rte
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
147 int_4:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
148 rte
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
149
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
150 rsset $FFFF8000
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
151 x_pos rs.w 1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
152 base_cmd rs.l 1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
153
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
154 initial_regs:
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
155 vdpreg MODE_1, $4 ;Mode 5, everything turned off
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
156 vdpreg MODE_0, $4
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
157 vdpreg SCROLL_A, $20 ;Scroll a table $8000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
158 vdpreg SCROLL_B, $05 ;Scroll b table $A000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
159 vdpreg SAT, $60 ;SAT table $C000
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
160 vdpreg BG_COLOR, 0
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
161 vdpreg HINT, $FF
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
162 vdpreg MODE_3, 0 ;full screen scroll
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
163 vdpreg MODE_4, $87 ;40 cell mode, double-res interlace
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
164 vdpreg HSCROLL, 0
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
165 vdpreg AUTOINC, 2
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
166 vdpreg SCROLL, 1 ;64x32 scroll size
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
167 end_initial_regs
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
168
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
169 start:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
170 lea $C00000, a0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
171 lea $C00004, a1
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
172
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
173 moveq #(end_initial_regs-initial_regs-1), d0
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
174 lea initial_regs.w, a2
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
175 .regloop
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
176 move.w (a2)+, (a1)
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
177 dbra d0, .regloop
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
178
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
179 vdpaccess $0, VDP_CRAM_WRITE
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
180 move.w #$000, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
181 move.w #$EEE, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
182
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
183 ;init scroll table
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
184 vdpaccess $0, VDP_VRAM_WRITE
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
185 move.w #0, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
186 move.w #4, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
187
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
188 ;load tiles
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
189 vdpaccess $800, VDP_VRAM_WRITE
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
190 lea font(pc), a2
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
191 move.w #((fontend-font)/4 - 1), d0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
192 tloop:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
193 move.l (a2)+, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
194 dbra d0, tloop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
195
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
196
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
197
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
198 ;clear name tables
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
199 vdpaccess $8000, VDP_VRAM_WRITE
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
200 moveq #32, d0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
201 move.w #(64*64-1), d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
202 ploop:
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
203 move.l d0, (a0)
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
204 dbra d1, ploop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
205
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
206 move.l #$40000002, d3
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
207 move.l d3, (a1)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
208 move.l d3, base_cmd.w
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
209
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
210 lea Message(pc), a6
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
211 moveq #0, d0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
212 bsr print_string
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
213
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
214
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
215
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
216 move.w #$8144, (a1) ;enable display
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
217 move #$2300, sr
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
218
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
219
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
220 wait_forever
814
109ac52ffecd Menu cleanup with macros
Michael Pavone <pavone@retrodev.com>
parents: 791
diff changeset
221 stop #2500
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
222 bra wait_forever
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
223
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
224 Message:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
225 dc.b "Journey From Darkness - Strider Returns (U) [c][!].bin", $A
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
226 dc.b "Toejam & Earl in Panic on Funkotron (U) [!].bin", $A
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
227 dc.b "Fire Shark (U) [c][!].bin", $A
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
228 dc.b "Sonic and Knuckles (W) [!].bin", 0
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
229
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
230 align 1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
231
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
232 ;Prints a null terminated string
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
233 ;a6 - pointer to string
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
234 ;a0 - VDP data port
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
235 ;d0 - base tile attribute
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
236 ;
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
237 ;Clobbers: d1.w, d2.w, d3.l
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
238 print_string:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
239 lea widths(pc), a5
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
240 move.w x_pos.w, d2
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
241 move.l base_cmd.w, d3
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
242 .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
243 moveq #0, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
244 move.b (a6)+, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
245 beq .end
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
246 cmp.b #$A, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
247 beq .newline
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
248 tst.b (-32, a5, d1.w)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
249 beq .narrow
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
250 add.w d0, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
251 move.w d1, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
252 addq #2, d2
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
253 bra .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
254 .narrow
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
255 add.w d0, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
256 move.w d1, (a0)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
257 addq #1, d2
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
258 move.l d2, d1
791
60686f8d5e48 Add a couple of comments to menu.s68
Michael Pavone <pavone@retrodev.com>
parents: 790
diff changeset
259 ;switch to other plane
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
260 and.w #$FFFE, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
261 swap d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
262 eor.l #$20000000, d3
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
263 or.l d3, d1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
264 move.l d1, (a1)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
265 bra .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
266 .newline
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
267 moveq #0, d2
791
60686f8d5e48 Add a couple of comments to menu.s68
Michael Pavone <pavone@retrodev.com>
parents: 790
diff changeset
268 ;switch back to plane A
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
269 and.l #$DFFFFFFF, d3
791
60686f8d5e48 Add a couple of comments to menu.s68
Michael Pavone <pavone@retrodev.com>
parents: 790
diff changeset
270 ;skip to next row
789
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
271 add.l #$00800000, d3
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
272 move.l d3, (a1)
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
273 bra .loop
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
274 .end
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
275 move.w d2, x_pos.w
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
276 move.l d3, base_cmd.w
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
277 rts
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
278
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
279 align 1
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
280 font:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
281 incbin font_interlace_variable.tiles
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
282 fontend
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
283
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
284 widths:
41e83b38bdc8 Initial work on silly Genesis based menu
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
285 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
286 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
287 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
288 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
289 dc.b 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1
790
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
290
e8b14d5a5b5a Add something resembling a proper header
Michael Pavone <pavone@retrodev.com>
parents: 789
diff changeset
291 rom_end: