Code: Select all
org 23760
;disable keyboard
di
jr start
;udg data
data1
;chr$ 144
defb 0,0,15,24,49,226,255,224
;chr$ 145
defb 24,60,255,255,153,255,231,60
;chr$ 146
defb 0,0,240,24,140,71,135,7
start
;set up udg's
ld de,(23675)
ld hl,data1
ld bc,24
ldir
jr begin
;print chr$ data at x,y ink 8 paper 8
;chr$ 144 145 146
data2
defb 22,0,0,16,17,8
defb 144,145,146
begin
;border 5
ld(iy+14),40
;paper 1 ink 7
ld(iy+83),15
;cls
ld a,2
call 5633
call 3435
;print string
ld a,2
call 5633
ld de,data2
ld bc,10
call 8252
l7
;transfer data2 to store
ld de,23296
ld hl,data2
ld bc,10
ldir
;get x,y from store
ld hl,(23297)
;check key pressed
ld bc,61438
in a,(c)
bit 0,a
jr nz,l1
inc h
l1
bit 1,a
jr nz,l2
dec h
l2
ld bc,63486
in a,(c)
bit 0,a
jr nz,l3
dec l
l3
ld bc,64510
in a,(c)
bit 0,a
jr nz,l4
inc l
l4
;check still on screen
ld a,1
cp 22
jr nz,l5
dec l
jr l6
l5
cp 225
jr nz,l6
inc l
l6
ld a,h
cp 30
jr nz,l8
dec h
jr l9
l8
cp 255
jr nz,l9
inc h
l9
;check no move
ld de,23297
xor a
push hl
sbc hl,de
pop hl
;if no move then skip
;print over 1
jr z,l12
;store new parameters
ld (23297),hl
;set over 1
ld (iy+87),3
;erase old position
ld de,data2
ld bc,10
call 8252
;reprint in new position
ld de,23296
ld bc,10
call 8252
;update data2 for next time
ld de,data2
ld hl,23296
ld bc,10
ldir
;delay loop
ld hl,5000
l11
dec hl
ld a,h
or l
jr nz,l11
;check 'space' pressed
l12
ld bc,32766
in a,(c)
bit 0,a
jp nz,l7
;reset over 0
ld (iy+87),0
;make keyboard active
ei
ret
its from page 42. im assuming you execute it from address 23760
if anyone fancies typing in the full program from page 50, that would be great. as i dont think ive got the will or patience to do it