comparison menu.s68 @ 789:41e83b38bdc8

Initial work on silly Genesis based menu
author Michael Pavone <pavone@retrodev.com>
date Sat, 25 Jul 2015 02:25:44 -0700
parents
children e8b14d5a5b5a
comparison
equal deleted inserted replaced
788:a91a19dbb5bc 789:41e83b38bdc8
1 dc.l $0, start
2 dc.l empty_handler
3 dc.l empty_handler
4 ;$10
5 dc.l empty_handler
6 dc.l empty_handler
7 dc.l empty_handler
8 dc.l empty_handler
9 ;$20
10 dc.l empty_handler
11 dc.l empty_handler
12 dc.l empty_handler
13 dc.l empty_handler
14 ;$30
15 dc.l empty_handler
16 dc.l empty_handler
17 dc.l empty_handler
18 dc.l empty_handler
19 ;$40
20 dc.l empty_handler
21 dc.l empty_handler
22 dc.l empty_handler
23 dc.l empty_handler
24 ;$50
25 dc.l empty_handler
26 dc.l empty_handler
27 dc.l empty_handler
28 dc.l empty_handler
29 ;$60
30 dc.l empty_handler
31 dc.l empty_handler
32 dc.l empty_handler
33 dc.l empty_handler
34 ;$70
35 dc.l int_4
36 dc.l empty_handler
37 dc.l int_6
38 dc.l empty_handler
39 ;$80
40 dc.l empty_handler
41 dc.l empty_handler
42 dc.l empty_handler
43 dc.l empty_handler
44 ;$90
45 dc.l empty_handler
46 dc.l empty_handler
47 dc.l empty_handler
48 dc.l empty_handler
49 ;$A0
50 dc.l empty_handler
51 dc.l empty_handler
52 dc.l empty_handler
53 dc.l empty_handler
54 ;$B0
55 dc.l empty_handler
56 dc.l empty_handler
57 dc.l empty_handler
58 dc.l empty_handler
59 ;$C0
60 dc.l empty_handler
61 dc.l empty_handler
62 dc.l empty_handler
63 dc.l empty_handler
64 ;$D0
65 dc.l empty_handler
66 dc.l empty_handler
67 dc.l empty_handler
68 dc.l empty_handler
69 ;$E0
70 dc.l empty_handler
71 dc.l empty_handler
72 dc.l empty_handler
73 dc.l empty_handler
74 ;$F0
75 dc.l empty_handler
76 dc.l empty_handler
77 dc.l empty_handler
78 dc.l empty_handler
79 dc.b "SEGA"
80 empty_handler:
81 int_6:
82 rte
83 int_4:
84 rte
85
86 rsset $FFFF8000
87 x_pos rs.w 1
88 base_cmd rs.l 1
89
90 start:
91 lea $C00000, a0
92 lea $C00004, a1
93 move.w #$8104, (a1) ;Mode 5, everything turned off
94 move.w #$8004, (a1)
95 move.w #$8220, (a1) ;Scroll a table $8000
96 move.w #$8405, (a1) ;Scroll b table $A000
97 move.w #$8560, (a1) ;SAT table $C000
98 move.w #$8700, (a1) ;backdrop color 0
99 move.w #$8B00, (a1) ;full screen scroll
100 move.w #$8C87, (a1) ;40 cell mode, double-res interlace
101 move.w #$8D00, (a1) ;hscroll table at 0
102 move.w #$8F02, (a1) ;autoinc 2
103 move.w #$9001, (a1) ;64x32 scroll size
104 move.l #$C0000000, (a1)
105 move.w #$000, (a0)
106 move.w #$EEE, (a0)
107
108 ;init scroll table
109 move.l #$40000000, (a1)
110 move.w #0, (a0)
111 move.w #4, (a0)
112
113 ;load tiles
114 move.l #$48000000, (a1)
115 lea font(pc), a2
116 move.w #((fontend-font)/4 - 1), d0
117 tloop:
118 move.l (a2)+, (a0)
119 dbra d0, tloop
120
121
122
123 ;clear name table
124 move.l #$40000002, (a1)
125 moveq #32, d0
126 move.w #(64*64-1), d1
127 ploop:
128 move.w d0, (a0)
129 dbra d1, ploop
130
131 move.l #$40000002, d3,
132 move.l d3, (a1)
133 move.l d3, base_cmd.w
134
135 lea Message(pc), a6
136 moveq #0, d0
137 bsr print_string
138
139
140
141 move.w #$8144, (a1) ;enable display
142 move #$2300, sr
143
144
145 wait_forever
146 bra wait_forever
147
148 Message:
149 dc.b "Journey From Darkness - Strider Returns (U) [c][!].bin", $A
150 dc.b "Toejam & Earl in Panic on Funkotron (U) [!].bin", $A
151 dc.b "Fire Shark (U) [c][!].bin", $A
152 dc.b "Sonic and Knuckles (W) [!].bin", 0
153
154 align 1
155
156 ;Prints a null terminated string
157 ;a6 - pointer to string
158 ;a0 - VDP data port
159 ;d0 - base tile attribute
160 ;
161 ;Clobbers: d1.w, d2.w, d3.l
162 print_string:
163 lea widths(pc), a5
164 move.w x_pos.w, d2
165 move.l base_cmd.w, d3
166 .loop
167 moveq #0, d1
168 move.b (a6)+, d1
169 beq .end
170 cmp.b #$A, d1
171 beq .newline
172 tst.b (-32, a5, d1.w)
173 beq .narrow
174 add.w d0, d1
175 move.w d1, (a0)
176 addq #2, d2
177 bra .loop
178 .narrow
179 add.w d0, d1
180 move.w d1, (a0)
181 addq #1, d2
182 move.l d2, d1
183 ;add.w d1, d1
184 and.w #$FFFE, d1
185 swap d1
186 eor.l #$20000000, d3
187 or.l d3, d1
188 move.l d1, (a1)
189 bra .loop
190 .newline
191 moveq #0, d2
192 and.l #$DFFFFFFF, d3
193 add.l #$00800000, d3
194 move.l d3, (a1)
195 bra .loop
196 .end
197 move.w d2, x_pos.w
198 move.l d3, base_cmd.w
199 rts
200
201 align 1
202 font:
203 incbin font_interlace_variable.tiles
204 fontend
205
206 widths:
207 dc.b 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1
208 dc.b 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0
209 dc.b 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1
210 dc.b 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
211 dc.b 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1