Compare commits

..

No commits in common. "223d284939f703f2f0d1dba2337b29e3d0057fca" and "6c29091fcbdaadc093403e604be48807b2294fd0" have entirely different histories.

View File

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