Compare commits

..

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

View File

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