kl_new_fast_ticker equ &bce0
mc_set_inks equ &bd25
mc_wait_flyback equ &bd19
kl_new_frame_fly equ &bcd7
kl_init_event equ &bcef
km_wait_char equ &bb06
txt_set_cursor equ &bb75
txt_output equ &bb5a
scr_set_mode equ &bc0e
org &8000
start:
ld a,1
call scr_set_mode
ld h,8
ld l,1
ld b,4
tl1:
push bc
push hl
call txt_set_cursor
ld hl,text
call print_msg
pop hl
ld a,l
add a,8
ld l,a
pop bc
djnz tl1
call km_wait_char
call mc_wait_flyback
ld a,6
ld (ticker_counter),a
ld hl,colours
ld (current_colour_pointer),hl
ld hl,ticker_event_block
ld b,%10000010
ld c,&80
ld de,ticker_function
call kl_new_fast_ticker
loop1:
jp loop1
text:
defb 15,0,"PEN 0",13,10
defb 15,1,"PEN 1",13,10
defb 15,2,"PEN 2",13,10
defb 15,3,"PEN 3","$"
print_msg:
ld a,(hl)
inc hl
cp "$"
ret z
call txt_output
jr print_msg
ticker_event_block:
defs 10
ticker_function:
push af
push hl
ld a,(ticker_counter)
dec a
ld (ticker_counter),a
or a
jr nz,ticker_function2
ld a,6
ld (ticker_counter),a
ld hl,colours
ld (current_colour_pointer),hl
ticker_function2:
ld de,(current_colour_pointer)
call mc_set_inks
ld hl,(current_colour_pointer)
ld bc,17
add hl,bc
ld (current_colour_pointer),hl
pop af
pop hl
ret
ticker_counter: defb 0
current_colour_pointer: defw colours
colours:
defb &04,&14,&19,&13,&0c,&0b,&14,&15,&0d,&06,&1e,&1f,&07,&12,&19,&04,&17
defb &03,&01,&1f,&1e,&0c,&0b,&14,&15,&0d,&06,&1e,&1f,&07,&12,&19,&04,&17
defb &11,&05,&02,&0b,&0c,&0b,&14,&15,&0d,&06,&1e,&1f,&07,&12,&19,&04,&17
defb &0c,&08,&03,&1b,&0c,&0b,&14,&15,&0d,&06,&1e,&1f,&07,&12,&19,&04,&17
defb &12,&09,&0c,&06,&0c,&0b,&14,&15,&0d,&06,&1e,&1f,&07,&12,&19,&04,&17
defb &1f,&0a,&06,&16,&0c,&0b,&14,&15,&0d,&06,&1e,&1f,&07,&12,&19,&04,&17
end