-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMain.asm
More file actions
622 lines (587 loc) · 18.1 KB
/
Main.asm
File metadata and controls
622 lines (587 loc) · 18.1 KB
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
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
DEFINE SNA_FILENAME "linesIRQ.snx"
device zxspectrum48
org $E000
INCLUDE "../../Constants.asm"
INCLUDE "../../Macros.asm"
INCLUDE "../../TestFunctions.asm"
INCLUDE "../../OutputFunctions.asm"
DEFINE _CONTROLS_DEBOUNCE_REGULAR 2
INCLUDE "../../controls.i.asm"
OPT --zxnext ; enable Z80N instructions, this test does use few of them
; max scanline is 260..320 (depending on the mode), so values 0..63 may happen twice, 64+ only once
TEST_LINE_LSB = 200 ; start at +8 pixels under PAPER area
TEST_TYPE_READ EQU 2
TEST_TYPE_IRQ EQU 1
TEST_TYPE_COPPER EQU 0
LegendText:
DW MEM_ZX_SCREEN_4000+4*32+1
DB "Q/A: Target line LSB: ",0
DW MEM_ZX_SCREEN_4000+5*32+1
DB "W/S: Target line LSB +-8",0
DW MEM_ZX_SCREEN_4000+6*32+1
DB "Z: NR_$1F INTER. COPPER",0
DW MEM_ZX_SCREEN_4000+7*32+1
DB "F8/T: MHz: 3.5 7 14 28",0
DW MEM_ZX_SCREEN_4000+8*256+0*32+1
DB "F3/F: Display: 50Hz 60Hz",0
DW MEM_ZX_SCREEN_4000+8*256+1*32+1
DB "V: VGA: ?? 48 +2 +3 Pg",0
DW MEM_ZX_SCREEN_4000+8*256+2*32+1
DB "O/K: Line offset $64: ",0
DW MEM_ZX_SCREEN_4000+8*256+3*32+1
DB "P/L: Line offset $64 +-8",0
DW MEM_ZX_SCREEN_4000+8*256+5*32+1
DB "(F# keys are NMI+number)",0
DW MEM_ZX_SCREEN_4000+8*256+6*32+1
DB "(HDMI ignores V key)",0
DW MEM_ZX_SCREEN_4000+16*256+7*32
DB '[', SNA_FILENAME, ']', 0
DB 0, 0, 0
LineLsbVramAdr EQU MEM_ZX_SCREEN_4000+4*32+24
OffsetVramAdr EQU MEM_ZX_SCREEN_4000+8*256+2*32+24
HighlightKeysData:
DW MEM_ZX_ATTRIB_5800+4*32+1, MEM_ZX_ATTRIB_5800+4*32+3
DW MEM_ZX_ATTRIB_5800+5*32+1, MEM_ZX_ATTRIB_5800+5*32+3
DW MEM_ZX_ATTRIB_5800+6*32+1
DW MEM_ZX_ATTRIB_5800+7*32+1, MEM_ZX_ATTRIB_5800+7*32+2, MEM_ZX_ATTRIB_5800+7*32+4
DW MEM_ZX_ATTRIB_5800+8*32+1, MEM_ZX_ATTRIB_5800+8*32+2, MEM_ZX_ATTRIB_5800+8*32+4
DW MEM_ZX_ATTRIB_5800+9*32+1
DW MEM_ZX_ATTRIB_5800+10*32+1, MEM_ZX_ATTRIB_5800+10*32+3
DW MEM_ZX_ATTRIB_5800+11*32+1, MEM_ZX_ATTRIB_5800+11*32+3
.count = ($ - HighlightKeysData)/2
R_5 EQU %0000'0101
R_10 EQU %0001'1111
R_50 EQU %0101'1111
R_100 EQU %1111'1111
RulerTicks:
DB R_100, R_5, R_10, R_5, R_10, R_5, R_10, R_5, R_10, R_5
DB R_50, R_5, R_10, R_5, R_10, R_5, R_10, R_5, R_10, R_5
DB R_100, R_5, R_10, R_5, R_10, R_5, R_10, R_5, R_10, R_5
DB R_50, R_5, R_10, R_5, R_10, R_5, R_10, R_5, R_10, 0
R_LAB_0:
DG -----#--
DG ----#-#-
DG ----#-#-
DG ----#-#-
DG -----#--
R_LAB_50:
DG ###--#--
DG #---#-#-
DG ##--#-#-
DG --#-#-#-
DG ##---#--
R_LAB_00:
DG -#---#--
DG #-#-#-#-
DG #-#-#-#-
DG #-#-#-#-
DG -#---#--
R_LAB_1:
DG ------#-
DG -----##-
DG ------#-
DG ------#-
DG ------#-
UiLineLsb DB TEST_LINE_LSB-1
UiType DB -1
UiMhz DB -1
UiVidHz DB -1
UiVidVga DB -1
UiOffset DB -1
KeysRepeatDelay DB 0
TestLineLsb DB TEST_LINE_LSB
TestType DB TEST_TYPE_READ
TestOffset DB 0
UiVidHzAttrs:
BLOCK 5, P_WHITE
BLOCK 6, A_BRIGHT|P_CYAN
.len: BLOCK 5, P_WHITE
UiTypeAttrs:
BLOCK 7, P_WHITE
.oneOfs: BLOCK 7, P_WHITE
BLOCK 8, A_BRIGHT|P_CYAN
.len: BLOCK 7, P_WHITE
BLOCK 7, P_WHITE
UiMhzAttrs:
BLOCK 4, P_WHITE
BLOCK 4, P_WHITE
BLOCK 4, P_WHITE
.ofs: BLOCK 5, A_BRIGHT|P_CYAN
.len: BLOCK 4, P_WHITE
BLOCK 4, P_WHITE
BLOCK 4, P_WHITE
UiVidVgaAttrs:
BLOCK 3, P_WHITE
BLOCK 3, P_WHITE
BLOCK 3, P_WHITE
BLOCK 3, P_WHITE
.ofs: BLOCK 4, A_BRIGHT|P_CYAN
.len: BLOCK 3, P_WHITE
BLOCK 3, P_WHITE
BLOCK 3, P_WHITE
BLOCK 3, P_WHITE
MACRO SET_PALETTE_ELEMENT newColor?
nextreg PALETTE_VALUE_NR_41,newColor?
ENDM
Start:
call StartTest
nextreg TURBO_CONTROL_NR_07,0 ; 3.5MHz
NEXTREG2A PERIPHERAL_2_NR_06
or %1010'0000 ; force-enable F8 and F3 keys
nextreg PERIPHERAL_2_NR_06,a
; show MachineID and core version
ld de,MEM_ZX_SCREEN_4000+1*32+1
ld bc,MEM_ZX_SCREEN_4000+2*32+1
ld ix,$ED01 ; display also extended info after MachineId
call OutMachineIdAndCore_defLabels
; show controls + legend
ld hl,LegendText
jr .legendPrintLoopEntry
.legendPrintLoop:
call OutStringAtDe
.legendPrintLoopEntry:
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld a,(hl)
or a
jr nz,.legendPrintLoop
ld a,A_BRIGHT|P_BLUE|WHITE
ld hl,HighlightKeysData
ld b,HighlightKeysData.count
.highlightKeysLoop:
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld (de),a
djnz .highlightKeysLoop
call drawRightEdgeRuler
call refreshUi ; initial draw of UI values
; install the keyboard handlers
REGISTER_KEY KEY_Q, KeyHandlerLsbUp
REGISTER_KEY KEY_A, KeyHandlerLsbDown
REGISTER_KEY KEY_Z, KeyHandlerTestType
REGISTER_KEY KEY_T, KeyHandlerSwTurboKey
REGISTER_KEY KEY_F, KeyHandlerSwHzKey
REGISTER_KEY KEY_W, KeyHandlerLsbUp8
REGISTER_KEY KEY_S, KeyHandlerLsbDown8
REGISTER_KEY KEY_V, KeyHandlerVgaTiming
REGISTER_KEY KEY_O, KeyHandlerOfsUp
REGISTER_KEY KEY_K, KeyHandlerOfsDown
REGISTER_KEY KEY_P, KeyHandlerOfsUp8
REGISTER_KEY KEY_L, KeyHandlerOfsDown8
; setup the color registers to modify white PAPER color in ULA palette (to show "line")
nextreg PALETTE_CONTROL_NR_43,%1'000'0000 ; ULA palette, no-increment, classic ULA
nextreg PALETTE_INDEX_NR_40,16+7 ; white paper color index
; set IM2 handler
ld a,im2tabHI
ld i,a
im 2
nextreg VIDEO_INTERUPT_CONTROL_NR_22,%00000'1'1'0 ; scanline interrupt only, disable ULA
MainLoop:
ld a,(TestOffset)
nextreg VIDEO_LINE_OFFSET_NR_64,a
ld a,(KeysRepeatDelay)
sub 1
adc a,0
ld (KeysRepeatDelay),a
call RefreshKeyboardState
call refreshUi
ld a,(TestType)
cp TEST_TYPE_READ
jr z,TestReadNr1F
cp TEST_TYPE_COPPER
jr z,TestCopper
; nothing more to do in interrupt type
halt
jr MainLoop
TestReadNr1F:
; wait for scanline (reading nextreg $1F) type of test
SET_PALETTE_ELEMENT %101'101'10 ; white paper
ld hl,(TestLineLsb) ; L = LSB value
; read NextReg $1F - LSB of current raster line
ld de,VIDEO_LINE_LSB_NR_1F|(VIDEO_LINE_MSB_NR_1E<<8) ; E = $1F, D = $1E
ld bc,TBBLUE_REGISTER_SELECT_P_243B
out (c),e ; select NextReg $1F
inc b ; BC = TBBLUE_REGISTER_ACCESS_P_253B
; if not yet at scanline, wait for it ... wait for it ...
.waitLoop:
in a,(c) ; read the raster line LSB
cp l
jr nz,.waitLoop
SET_PALETTE_ELEMENT %000'011'00 ; green paper
; read MSB of the target LSB line
dec b
out (c),d ; select NextReg $1E
inc b
in h,(c) ; H = current MSB
dec b
out (c),e ; select NextReg $1F
inc b
; do some dead-waste time loop before next LSB reading
ld a,6
.wasteTimeLoop:
dec a
jr nz,.wasteTimeLoop
; read LSB again until it leaves target value
.waitFullLine:
in a,(c) ; read the raster line LSB
cp l
jr z,.waitFullLine
SET_PALETTE_ELEMENT %101'101'10 ; white paper
; for MSB=1 re-run the test loop again, so the house-keeping is done after 0:n line
; (between 1:n and 0:n may be not enough time in 60Hz modes)
dec h
jr z,TestReadNr1F
; for 0:n match continue with regular MainLoop
jr MainLoop
TestCopper:
; refresh the copper code to latest TestLineLsb value (keep doing that every frame)
nextreg COPPER_CONTROL_LO_NR_61,0 ; reset low index
; high index is already reset by setup routine (writing %11'000'000 at its end)
call KeyHandlerTestType.writeCopperCode
; wait single scanline to make the keyboard handler refresh at correct rate
; read NextReg $1F - LSB of current raster line
ld bc,TBBLUE_REGISTER_SELECT_P_243B
ld a,VIDEO_LINE_LSB_NR_1F
out (c),a ; select NextReg $1F
inc b ; BC = TBBLUE_REGISTER_ACCESS_P_253B
.waitInside150:
in a,(c) ; read the raster line LSB
cp 150
jr z,.waitInside150
.waitFor150:
in a,(c) ; read the raster line LSB
cp 150
jr nz,.waitFor150
jr MainLoop
;--------------------------------------------------------------------------------------
; keyboard handlers
;--------------------------------------------------------------------------------------
KeyHandlerTestType:
di
ld a,(TestType)
nextreg COPPER_CONTROL_HI_NR_62,a ; stop copper if it is running (A = 0..2)
sub 1
jr nc,.noWrapYet
ld a,TEST_TYPE_READ
.noWrapYet
ld (TestType),a
ret c ; TEST_TYPE_READ is set up (by DI and Copper stop)
jr nz,.setupIrqTest ; if A=1 jump (irq type), A=0 stay (copper type)
; TEST_TYPE_COPPER - code the copper instructions to trigger at desired line
nextreg COPPER_CONTROL_LO_NR_61,a
nextreg COPPER_CONTROL_HI_NR_62,a ; write index = 0
.writeCopperCode:
ld a,(TestLineLsb)
nextreg COPPER_DATA_16B_NR_63,$80
nextreg COPPER_DATA_16B_NR_63,a ; WAIT for lineLSB (9th bit is zero)
nextreg COPPER_DATA_16B_NR_63,PALETTE_VALUE_NR_41
nextreg COPPER_DATA_16B_NR_63,%100'010'00 ; copper-ish paper
nextreg COPPER_DATA_16B_NR_63,$80|(52<<1)
nextreg COPPER_DATA_16B_NR_63,a ; WAIT for H=52, revert color back
nextreg COPPER_DATA_16B_NR_63,PALETTE_VALUE_NR_41
nextreg COPPER_DATA_16B_NR_63,%101'101'10 ; white paper
nextreg COPPER_DATA_16B_NR_63,$81
nextreg COPPER_DATA_16B_NR_63,a ; WAIT for lineLSB (9th bit is one)
nextreg COPPER_DATA_16B_NR_63,PALETTE_VALUE_NR_41
nextreg COPPER_DATA_16B_NR_63,%101'011'00 ; yellow-ish paper
nextreg COPPER_DATA_16B_NR_63,$81|(52<<1)
nextreg COPPER_DATA_16B_NR_63,a ; WAIT for H=52 (9th bit is one)
nextreg COPPER_DATA_16B_NR_63,PALETTE_VALUE_NR_41
nextreg COPPER_DATA_16B_NR_63,%101'101'10 ; white paper
nextreg COPPER_DATA_16B_NR_63,$FF ; copper "HALT" instruction
nextreg COPPER_DATA_16B_NR_63,$FF
; start copper code in "restart at [0,0]" mode
nextreg COPPER_CONTROL_HI_NR_62,%11'000'000
ret
.setupIrqTest:
; TEST_TYPE_IRQ - enable the interrupt at correct line
ld a,(TestLineLsb)
nextreg VIDEO_INTERUPT_VALUE_NR_23,a
ei
ret
KeyHandlerSwHzKey:
NEXTREG2A PERIPHERAL_1_NR_05
xor 4
nextreg PERIPHERAL_1_NR_05,a
ret
KeyHandlerVgaTiming:
ld a,(UiVidVga)
inc a
ret z ; ignore HDMI video (no action)
NEXTREG2A MACHINE_TYPE_NR_03
add a,$90 ; ++displayTiming and set $80
cp %1101'0000 ; this should set carry for any legal mode (bits6-4: 000..100)
jr c,.newValueReady
and %1000'1111 ; reset video timing to 000 from invalid one
.newValueReady:
nextreg MACHINE_TYPE_NR_03,a
ret
KeyHandlerSwTurboKey:
NEXTREG2A TURBO_CONTROL_NR_07
inc a
and 3
nextreg TURBO_CONTROL_NR_07,a
ret
KeyHandlerLsbUp:
call KeyHandlerWithRepeat
ret nz
ld hl,TestLineLsb
dec (hl)
ret
KeyHandlerLsbDown:
call KeyHandlerWithRepeat
ret nz
ld hl,TestLineLsb
inc (hl)
ret
KeyHandlerLsbUp8:
call KeyHandlerWithRepeat
ret nz
ld a,(TestLineLsb)
sub 8
ld (TestLineLsb),a
ret
KeyHandlerLsbDown8:
call KeyHandlerWithRepeat
ret nz
ld a,(TestLineLsb)
add a,8
ld (TestLineLsb),a
ret
KeyHandlerOfsUp:
call KeyHandlerWithRepeat
ret nz
ld hl,TestOffset
inc (hl)
ret
KeyHandlerOfsDown:
call KeyHandlerWithRepeat
ret nz
ld hl,TestOffset
dec (hl)
ret
KeyHandlerOfsUp8:
call KeyHandlerWithRepeat
ret nz
ld a,(TestOffset)
add a,8
ld (TestOffset),a
ret
KeyHandlerOfsDown8:
call KeyHandlerWithRepeat
ret nz
ld a,(TestOffset)
sub 8
ld (TestOffset),a
ret
KeyHandlerWithRepeat: ; returns Zf=1 if the value should be adjusted
xor a ; modify controls.i.asm behaviour for auto-repeat and own delay
ld (debounceState),a
ld a,(KeysRepeatDelay)
or a
ret nz
ld a,3
ld (KeysRepeatDelay),a
ret
;--------------------------------------------------------------------------------------
; draw-UI related functions
;--------------------------------------------------------------------------------------
getVideoModeNumber:
; return -1 if the HDMI display is used
NEXTREG2A VIDEO_TIMING_NR_11
inc a
and %00000'111 ; bits 2-0 are video mode (+1 from INC)
ld a,-1
ret z
NEXTREG2A MACHINE_TYPE_NR_03
swapnib
and 7
ret ; for VGA return 0..5 for video timing selected
refreshUi:
ld hl,UiOffset
ld a,(TestOffset)
cp (hl)
call nz,refreshUiOffset
ld hl,UiLineLsb
ld a,(TestLineLsb)
cp (hl)
call nz,refreshUiLineLsb
ld hl,UiType
ld a,(TestType)
cp (hl)
call nz,refreshUiType
NEXTREG2A TURBO_CONTROL_NR_07
and 3
ld hl,UiMhz
cp (hl)
call nz,refreshUiMhz
call getVideoModeNumber
ld hl,UiVidVga
cp (hl)
call nz,refreshVidVga
NEXTREG2A PERIPHERAL_1_NR_05
and 4
ld hl,UiVidHz
cp (hl)
ret z
; |
; fallthrough to refreshUiVidHz
; |
; v
refreshUiVidHz:
ld (hl),a
ld hl,UiVidHzAttrs ; add +5 or +0 for 50Hz/60Hz
xor 4
add hl,a
rrca
rrca
add hl,a
ld de,MEM_ZX_ATTRIB_5800+8*32+15
ld bc,UiVidHzAttrs.len-UiVidHzAttrs
ldir
ret
refreshVidVga:
ld (hl),a
sub 4
neg
ld e,a
add a,a
add a,e ; A = (5-mode)*3 (offset into attr data)
ld hl,UiVidVgaAttrs
add hl,a
ld de,MEM_ZX_ATTRIB_5800+9*32+11
ld bc,UiVidVgaAttrs.len-UiVidVgaAttrs
ldir
ret
refreshUiType:
ld (hl),a
ld d,UiTypeAttrs.oneOfs-UiTypeAttrs
ld e,a
mul de
ld hl,UiTypeAttrs
add hl,de
ld de,MEM_ZX_ATTRIB_5800+6*32+6
ld bc,UiTypeAttrs.len-UiTypeAttrs
ldir
ret
refreshUiMhz:
ld (hl),a
xor 3
rlca
rlca ; A = (3-turbo)*4 = offset into UiMhzAttrs data
ld hl,UiMhzAttrs
add hl,a
ld de,MEM_ZX_ATTRIB_5800+7*32+11
ld bc,UiMhzAttrs.len-UiMhzAttrs
ldir
ret
refreshUiLineLsb:
ld (hl),a
; clear old value in pixel VRAM
ld hl,LineLsbVramAdr
; |
; fallthrough into refreshUi_PrintDecimal
; |
; v
refreshUi_PrintDecimal:
ld bc,$0400
push hl
.clearLoop:
ld (hl),c ; clear 3 bytes to right
inc l
ld (hl),c
inc l
ld (hl),c
inc h
ld (hl),c ; clear 3 bytes back to left
dec l
ld (hl),c
dec l
ld (hl),c
inc h
djnz .clearLoop ; do it four times => 8 lines cleared
pop hl
ld (OutCurrentAdr),hl
jp OutDecimalValue
refreshUiOffset:
ld (hl),a
; clear old value in pixel VRAM
ld hl,OffsetVramAdr
jr refreshUi_PrintDecimal
MACRO DRAW_RULER_LABEL coords?, labeladr?
ld de,coords?
pixelad
ld de,labeladr?
call drawRulerLabelChar
ENDM
MACRO DRAW_RULER_LABEL2 coords?, labeladr1?, labeladr2?
ld de,coords?
pixelad
push hl
ld de,labeladr1?
call drawRulerLabelChar
pop hl
inc l
ld de,labeladr2?
call drawRulerLabelChar
ENDM
drawRulerLabelChar:
ld b,5
.loop:
ld a,(de)
inc de
ld (hl),a
pixeldn
djnz .loop
ret
drawRightEdgeRuler:
; display numbers at right edge of PAPER
DRAW_RULER_LABEL $00F0, R_LAB_0
DRAW_RULER_LABEL $30F0, R_LAB_50
DRAW_RULER_LABEL2 $62E8, R_LAB_1, R_LAB_00
DRAW_RULER_LABEL2 $94E8, R_LAB_1, R_LAB_50
; create rules at right edge of PAPER
ld de,$00FF
ld bc,RulerTicks
.rulerLoop:
ld a,(bc)
inc bc
or a
ret z
pixelad ; Z80N special
ld (hl),a ; draw ruler line at [E,D] coordinates
; move Y by +5
ld hl,$0500
add hl,de
ex de,hl
jr .rulerLoop
;--------------------------------------------------------------------------------------
; interrupt at scanline type of test - interrupt table + handler
;--------------------------------------------------------------------------------------
; IM2 vector table
ALIGN 256
im2tabHI = high $
im2handlerHI = im2tabHI+1
BLOCK 257,im2tabHI+1
; IM2 handler itself
ORG (im2handlerHI<<8) | im2handlerHI
im2handler:
SET_PALETTE_ELEMENT %000'011'01 ; cyan paper
push af
; set interrupt line with new value in TestLineLsb
ld a,(TestLineLsb)
nextreg VIDEO_INTERUPT_VALUE_NR_23,a
ld a,20
.waitLoop:
dec a
jr nz,.waitLoop
; finish IM2 handler
pop af
ei
SET_PALETTE_ELEMENT %101'101'10 ; white paper
ret
savesna SNA_FILENAME, Start