Compare commits

...

2 Commits

View File

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