Mercurial > repos > blastem
comparison tmss.s68 @ 2035:33f454232aee
Added open source TMSS replacement
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 07 Mar 2021 10:41:35 -0800 |
parents | |
children | 5b51f03b2227 |
comparison
equal
deleted
inserted
replaced
2034:8b2ef428d1aa | 2035:33f454232aee |
---|---|
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 | |
145 move.b #$40, $A10009 | |
146 move.b #$00, $A10003 | |
147 | |
148 move.l #$45960002, d7 | |
149 move.l d7, (a1) | |
150 move.l #$800000, d6 | |
151 | |
152 lea ram_code_src(pc), a6 | |
153 lea ram_code.w, a5 | |
154 moveq #(font-ram_code_src)/2-1, d0 | |
155 copy: | |
156 move.w (a6)+, (a5)+ | |
157 dbra d0, copy | |
158 lea $101(a3), a4 | |
159 lea $100.w, a5 | |
160 move.l #'SEGA', d5 | |
161 move.l #' SEG', d4 | |
162 moveq #0, d0 | |
163 moveq #1, d2 | |
164 move.w #180, d3 | |
165 btst #6, $A10001 | |
166 beq .not_pal | |
167 move.w #150, d3 | |
168 .not_pal: | |
169 jmp ram_code.w | |
170 | |
171 ram_code_src: | |
172 move.b d2, (a4) | |
173 cmp.l (a5), d5 | |
174 beq.s is_good | |
175 cmp.l (a5), d4 | |
176 bne.s is_bad | |
177 is_good: | |
178 move.b d0, (a4) | |
179 lea good(pc), a6 | |
180 bsr.s print_string | |
181 | |
182 add.l d6, d7 | |
183 move.l d7, (a1) | |
184 bsr.s print_string | |
185 | |
186 add.l d6, d7 | |
187 move.l d7, (a1) | |
188 bsr.s print_string | |
189 | |
190 move.w #$8164, (a1) | |
191 move #$2500, SR | |
192 wait: | |
193 cmp.w frame_counter.w, d3 | |
194 bne.s wait | |
195 move #$2700, SR | |
196 move.b d2, (a4) | |
197 move.l $0.w, a7 | |
198 move.l $4.w, a6 | |
199 move.w #$8104, (a1) | |
200 move.l d0, (a3) | |
201 jmp (a6) | |
202 | |
203 is_bad: | |
204 lea bad(pc), a6 | |
205 bsr.s print_string | |
206 | |
207 add.l d6, d7 | |
208 move.l d7, (a1) | |
209 bsr.s print_string | |
210 | |
211 add.l d6, d7 | |
212 move.l d7, (a1) | |
213 bsr.s print_string | |
214 | |
215 move.w #$8144, (a1) | |
216 forever: | |
217 bra.s forever | |
218 | |
219 | |
220 int_6: | |
221 addq.w #1, frame_counter.w | |
222 rte | |
223 | |
224 ;Prints a null terminated string | |
225 ;a6 - pointer to string | |
226 ;a0 - VDP data port | |
227 ;d0 - base tile attribute | |
228 ; | |
229 ;Clobbers: d1.w | |
230 print_string: | |
231 .loop | |
232 moveq #0, d1 | |
233 move.b (a6)+, d1 | |
234 beq .end | |
235 add.w d0, d1 | |
236 move.w d1, (a0) | |
237 bra .loop | |
238 .end | |
239 rts | |
240 | |
241 good: | |
242 dc.b " BLASTEM THINKS", 0 | |
243 dc.b " THAT THIS CART", 0 | |
244 dc.b " TASTES DELICIOUS!", 0 | |
245 | |
246 bad: | |
247 dc.b " *sniff* *sniff*", 0 | |
248 dc.b " something doesn't", 0 | |
249 dc.b " smell right...", 0 | |
250 | |
251 align 1 | |
252 font: | |
253 incbin font.tiles | |
254 fontend | |
255 | |
256 romend |