Mercurial > repos > blastem
comparison tmss.s68 @ 2041:638eb2d25696 mame_interp
Merge from default
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 05 Aug 2021 09:29:33 -0700 |
parents | 5b51f03b2227 |
children | f500831f7fb4 |
comparison
equal
deleted
inserted
replaced
1984:0d5f88e53dca | 2041:638eb2d25696 |
---|---|
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 empty_handler | |
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 IS COOL " | |
80 dc.b "(C)M.Pavone 2021" | |
81 dc.b "TRAIN MEMES STAN" | |
82 dc.b "D SILENTLY " | |
83 dc.b " " | |
84 dc.b "TRIUMPHANT MAMMA" | |
85 dc.b "LS SALUTE SOCIAL" | |
86 dc.b "ITES " | |
87 dc.b "MP 20210227-01",0,0 | |
88 dc.b "J " | |
89 dc.l $0 | |
90 dc.l romend-1 | |
91 dc.l $FF0000 | |
92 dc.l $FFFFFF | |
93 dc.b " " | |
94 dc.b " " | |
95 dc.b " " | |
96 dc.b " " | |
97 dc.b "JUE " | |
98 | |
99 frame_counter equ $FFFF8000 | |
100 ram_code equ $FFFF8002 | |
101 | |
102 empty_handler: | |
103 rte | |
104 start: | |
105 lea $A14000, a3 | |
106 move.l #'SEGA', (a3) | |
107 lea $C00000, a0 | |
108 lea $C00004, a1 | |
109 move.w #$8104, (a1) ;Mode 5, everything turned off | |
110 move.w #$8004, (a1) | |
111 move.w #$8220, (a1) ;Scroll a table $8000 | |
112 move.w #$8404, (a1) ;Scroll b table $8000 | |
113 move.w #$8560, (a1) ;SAT table $C000 | |
114 move.w #$8700, (a1) ;backdrop color 0 | |
115 move.w #$8A01, (a1) ;Set HINT counter | |
116 move.w #$8B00, (a1) ;full screen scroll | |
117 move.w #$8C81, (a1) ;40 cell mode, no interlace | |
118 move.w #$8D00, (a1) ;hscroll table at 0 | |
119 move.w #$8F02, (a1) ;autoinc 2 | |
120 move.w #$9011, (a1) ;64x64 scroll size | |
121 move.l #$C0000000, (a1) | |
122 move.w #$000, (a0) | |
123 move.w #$EEE, (a0) | |
124 | |
125 ;clear scroll table | |
126 move.l #$40000000, (a1) | |
127 move.l #0, (a0) | |
128 | |
129 ;load tiles | |
130 move.l #$44000000, (a1) | |
131 lea font, a2 | |
132 move.w #((fontend-font)/4 - 1), d0 | |
133 tloop: | |
134 move.l (a2)+, (a0) | |
135 dbra d0, tloop | |
136 | |
137 ;clear name table | |
138 move.l #$40000002, (a1) | |
139 moveq #32, d0 | |
140 move.w #(64*64-1), d1 | |
141 ploop: | |
142 move.w d0, (a0) | |
143 dbra d1, ploop | |
144 move.l #$45960002, d7 | |
145 move.l d7, (a1) | |
146 move.l #$800000, d6 | |
147 | |
148 lea ram_code_src(pc), a6 | |
149 lea ram_code.w, a5 | |
150 moveq #(font-ram_code_src)/2-1, d0 | |
151 copy: | |
152 move.w (a6)+, (a5)+ | |
153 dbra d0, copy | |
154 lea $101(a3), a4 | |
155 lea $100.w, a5 | |
156 move.l #'SEGA', d5 | |
157 move.l #' SEG', d4 | |
158 moveq #0, d0 | |
159 moveq #1, d2 | |
160 move.w #180, d3 | |
161 btst #6, $A10001 | |
162 beq .not_pal | |
163 move.w #150, d3 | |
164 .not_pal: | |
165 jmp ram_code.w | |
166 | |
167 ram_code_src: | |
168 move.b d2, (a4) | |
169 cmp.l (a5), d5 | |
170 beq.s is_good | |
171 cmp.l (a5), d4 | |
172 bne.s is_bad | |
173 is_good: | |
174 move.b d0, (a4) | |
175 lea good(pc), a6 | |
176 bsr.s print_string | |
177 | |
178 add.l d6, d7 | |
179 move.l d7, (a1) | |
180 bsr.s print_string | |
181 | |
182 add.l d6, d7 | |
183 move.l d7, (a1) | |
184 bsr.s print_string | |
185 | |
186 move.w #$8164, (a1) | |
187 move #$2500, SR | |
188 wait: | |
189 cmp.w frame_counter.w, d3 | |
190 bne.s wait | |
191 move #$2700, SR | |
192 move.b d2, (a4) | |
193 move.l $0.w, a7 | |
194 move.l $4.w, a6 | |
195 move.w #$8104, (a1) | |
196 move.l d0, (a3) | |
197 jmp (a6) | |
198 | |
199 is_bad: | |
200 move.b d0, (a4) | |
201 lea bad(pc), a6 | |
202 bsr.s print_string | |
203 | |
204 add.l d6, d7 | |
205 move.l d7, (a1) | |
206 bsr.s print_string | |
207 | |
208 add.l d6, d7 | |
209 move.l d7, (a1) | |
210 bsr.s print_string | |
211 | |
212 move.w #$8144, (a1) | |
213 forever: | |
214 bra.s forever | |
215 | |
216 | |
217 int_6: | |
218 addq.w #1, frame_counter.w | |
219 rte | |
220 | |
221 ;Prints a null terminated string | |
222 ;a6 - pointer to string | |
223 ;a0 - VDP data port | |
224 ;d0 - base tile attribute | |
225 ; | |
226 ;Clobbers: d1.w | |
227 print_string: | |
228 .loop | |
229 moveq #0, d1 | |
230 move.b (a6)+, d1 | |
231 beq .end | |
232 add.w d0, d1 | |
233 move.w d1, (a0) | |
234 bra .loop | |
235 .end | |
236 rts | |
237 | |
238 good: | |
239 dc.b " BLASTEM THINKS", 0 | |
240 dc.b " THAT THIS CART", 0 | |
241 dc.b " TASTES DELICIOUS!", 0 | |
242 | |
243 bad: | |
244 dc.b " *sniff* *sniff*", 0 | |
245 dc.b " something doesn't", 0 | |
246 dc.b " smell right...", 0 | |
247 | |
248 align 1 | |
249 font: | |
250 incbin font.tiles | |
251 fontend | |
252 | |
253 romend |