Compare commits

...

2 Commits

View File

@ -26,52 +26,30 @@ read_keyboard:
jr read_keyboard
key_1:
ld c, 0
call highlight_key
ld a, (counter)
call play
ld c, 0
call highlight_key
jr inc_counter
ld de, 0x0000
jr invoke
key_2:
ld c, 3
call highlight_key
ld a, (counter)
inc a
call play
ld c, 3
call highlight_key
jr inc_counter
ld de, 0x0103
jr invoke
key_3:
ld c, 6
call highlight_key
ld a, (counter)
inc a
inc a
call play
ld c, 6
call highlight_key
jr inc_counter
ld de, 0x0206
jr invoke
key_4:
ld c, 9
call highlight_key
ld a, (counter)
add a, 3
call play
ld c, 9
call highlight_key
jr inc_counter
ld de, 0x0309
jr invoke
key_5:
ld c, 12
ld de, 0x040C
invoke:
push de
call highlight_key
ld a, (counter)
add a, 4
add a, d
call play
ld c, 12
pop de
call highlight_key
inc_counter:
@ -79,26 +57,26 @@ inc_counter:
add a, 5
cp 25
jr nz, set_counter
jp zero_counter
jr zero_counter
highlight_key:
ld hl, xylo
ld b, 0
add hl, bc
ld d, 15
highlight_row:
ld e, 3
push de
ld d, 0
add hl, de
ld e, 30
ld b, 15
highlight_block:
ld a, (hl)
xor %01000000
ld (hl), a
inc hl
dec e
jr nz, highlight_block
ld c, 29
add hl, bc
dec d
jr nz, highlight_row
ld (hl), a
inc hl
ld (hl), a
add hl, de
djnz highlight_block
pop de
ret
INCLUDE "sample.asm"