-
Notifications
You must be signed in to change notification settings - Fork 7
/
8-scrolling.8o
494 lines (420 loc) · 7.07 KB
/
8-scrolling.8o
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# Scrolling test
# This is a new test for this test suite, that allows you to test if your
# scrolling opcodes do the right thing. All the arrows should land in their
# boxes in the direction they point in.
:include "../utils/helpers.8o"
:include "../utils/menu.8o"
:include "../utils/text-rendering.8o"
: main
# Jump to the right test based on magic values
i := 0x1FF
load v0
if v0 == 1 then jump scrolling-superchip-lores-full-pixels
if v0 == 2 then jump scrolling-superchip-lores-half-pixels
if v0 == 3 then jump scrolling-superchip-hires
if v0 == 4 then jump scrolling-xochip-lores
if v0 == 5 then jump scrolling-xochip-hires
: menu-1
lores
clear
text 6 2 scrolling-choose-1
text 12 12 scrolling-str-superchip
text 12 17 scrolling-str-xochip
render-version
:unpack 0xA scrolling-menu-1
v2 := 1
jump menu-start
: menu-2
lores
clear
text 7 2 scrolling-choose-2
text 15 12 scrolling-str-lores
text 15 17 scrolling-str-hires
render-version
:unpack 0xA scrolling-menu-2
v2 := 1
jump menu-start
: menu-3
lores
clear
text 10 2 scrolling-choose-3
text 18 12 scrolling-str-modern
text 18 17 scrolling-str-legacy
render-version
:unpack 0xA scrolling-menu-3
v2 := 1
jump menu-start
: render-version
x := 50
y := 27
i := version-0-0
sprite x y 4
x := 58
i := version-1-0
sprite x y 4
return
: scrolling-superchip
i := selection
v0 := 0
save v0
jump menu-2
: scrolling-xochip
i := selection
v0 := 1
save v0
jump menu-2
: scrolling-lores
i := selection
load v0
if v0 == 0 then jump menu-3
jump scrolling-xochip-lores
: scrolling-hires
i := selection
load v0
if v0 == 0 then jump scrolling-superchip-hires
jump scrolling-xochip-hires
: scrolling-superchip-lores-full-pixels
clear
i := scrolling-arrow-left
v0 := 46
v1 := 11
sprite v0 v1 8
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
i := scrolling-arrow-right
v0 := 10
v1 := 11
sprite v0 v1 8
scroll-right
scroll-right
scroll-right
i := scrolling-arrow-down
v0 := 28
v1 := 0
sprite v0 v1 8
scroll-down 6
jump scrolling-draw-borders-lores
: scrolling-superchip-lores-half-pixels
clear
i := scrolling-arrow-left
v0 := 46
v1 := 11
sprite v0 v1 8
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
i := scrolling-arrow-right
v0 := 10
v1 := 11
sprite v0 v1 8
scroll-right
scroll-right
scroll-right
scroll-right
scroll-right
scroll-right
i := scrolling-arrow-down
v0 := 28
v1 := 0
sprite v0 v1 8
scroll-down 12
: scrolling-draw-borders-lores
i := scrolling-pixel
v0 := 21 # X
v1 := 33
v2 := 27
v3 := 26 # Y
v4 := 15
v5 := 4
loop
sprite v0 v3 1
sprite v1 v3 1
sprite v0 v4 1
sprite v1 v4 1
sprite v2 v5 1
v0 += 1
v1 += 1
v2 += 1
if v0 != 31 then
again
v0 := 20 # X
v1 := 31
v2 := 32
v3 := 43
v4 := 26
v5 := 37
v6 := 16 # Y
v7 := 5
loop
sprite v0 v6 1
sprite v1 v6 1
sprite v2 v6 1
sprite v3 v6 1
sprite v4 v7 1
sprite v5 v7 1
v6 += 1
v7 += 1
if v6 != 26 then
again
v0 := key
waitKeyRelease
jump main
: scrolling-superchip-hires
clear
hires
i := scrolling-arrow-left
v0 := 78
v1 := 22
sprite v0 v1 8
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
i := scrolling-arrow-right
v0 := 42
v1 := 22
sprite v0 v1 8
scroll-right
scroll-right
scroll-right
i := scrolling-arrow-down
v0 := 60
v1 := 11
sprite v0 v1 8
scroll-down 12
i := scrolling-pixel
v0 := 53 # X
v1 := 65
v2 := 59
v3 := 43 # Y
v4 := 32
v5 := 21
loop
sprite v0 v3 1
sprite v1 v3 1
sprite v0 v4 1
sprite v1 v4 1
sprite v2 v5 1
v0 += 1
v1 += 1
v2 += 1
if v0 != 63 then
again
v0 := 52 # X
v1 := 63
v2 := 64
v3 := 75
v4 := 58
v5 := 69
v6 := 33 # Y
v7 := 22
loop
sprite v0 v6 1
sprite v1 v6 1
sprite v2 v6 1
sprite v3 v6 1
sprite v4 v7 1
sprite v5 v7 1
v6 += 1
v7 += 1
if v7 != 32 then
again
v0 := key
waitKeyRelease
jump main
: scrolling-xochip-lores
clear
i := scrolling-arrow-left
v0 := 45
v1 := 23
sprite v0 v1 8
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
i := scrolling-arrow-right
v0 := 10
v1 := 12
sprite v0 v1 8
scroll-right
scroll-right
scroll-right
i := scrolling-arrow-up
v0 := 22
v1 := 23
sprite v0 v1 8
scroll-up 12
i := scrolling-arrow-down
v0 := 33
v1 := 0
sprite v0 v1 8
scroll-down 6
i := scrolling-pixel
v0 := 21 # X
v1 := 26 # Y
v2 := 15
v3 := 4
loop
sprite v0 v1 1
sprite v0 v2 1
sprite v0 v3 1
v0 += 1
if v0 != 42 then
again
v0 := 20 # X
v1 := 31
v2 := 42
v3 := 5 # Y
loop
sprite v0 v3 1
sprite v1 v3 1
sprite v2 v3 1
v3 += 1
if v3 != 26 then
again
v0 := key
waitKeyRelease
jump main
: scrolling-xochip-hires
clear
hires
i := scrolling-arrow-left
v0 := 77
v1 := 46
sprite v0 v1 8
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
scroll-left
i := scrolling-arrow-right
v0 := 42
v1 := 35
sprite v0 v1 8
scroll-right
scroll-right
scroll-right
i := scrolling-arrow-up
v0 := 54
v1 := 46
sprite v0 v1 8
scroll-up 12
scroll-up 12
i := scrolling-arrow-down
v0 := 65
v1 := 11
sprite v0 v1 8
scroll-down 12
i := scrolling-pixel
v0 := 53 # X
v1 := 21 # Y
v2 := 32
v3 := 43
loop
sprite v0 v1 1
sprite v0 v2 1
sprite v0 v3 1
v0 += 1
if v0 != 74 then
again
v0 := 52 # X
v1 := 63
v2 := 74
v3 := 22 # Y
loop
sprite v0 v3 1
sprite v1 v3 1
sprite v2 v3 1
v3 += 1
if v3 != 43 then
again
v0 := key
waitKeyRelease
jump main
:segment data
: scrolling-menu-1
8 13 :pointer scrolling-superchip
8 18 :pointer scrolling-xochip
: scrolling-choose-1
str "PICK PLATFORM" 0
: scrolling-str-superchip
str "1 SUPERCHIP" 0
: scrolling-str-xochip
str "2 XO-CHIP" 0
: scrolling-menu-2
11 13 :pointer scrolling-lores
11 18 :pointer scrolling-hires
: scrolling-choose-2
str "PICK SCR SIZE" 0
: scrolling-str-lores
str "1 LOW RES" 0
: scrolling-str-hires
str "2 HIGH RES" 0
: scrolling-menu-3
14 13 :pointer scrolling-superchip-lores-full-pixels
14 18 :pointer scrolling-superchip-lores-half-pixels
: scrolling-choose-3
str "PICK TARGET" 0
: scrolling-str-modern
str "1 MODERN" 0
: scrolling-str-legacy
str "2 LEGACY" 0
: scrolling-arrow-left
0b11111111
0b11100111
0b11001111
0b10000001
0b10000001
0b11001111
0b11100111
0b11111111
: scrolling-arrow-right
0b11111111
0b11100111
0b11110011
0b10000001
0b10000001
0b11110011
0b11100111
0b11111111
: scrolling-arrow-up
0b11111111
0b11100111
0b11000011
0b10000001
0b10100101
0b11100111
0b11100111
0b11111111
: scrolling-arrow-down
0b11111111
0b11100111
0b11100111
0b10100101
0b10000001
0b11000011
0b11100111
0b11111111
: scrolling-pixel
0b10000000
: selection
0
:include "../../pictures/version.png"