Save a few t-states in loop and clean up numeric literals

This commit is contained in:
Neil McPhail 2024-10-22 11:56:45 +00:00
parent 30105450d6
commit 8310e65e6b

View File

@ -1,7 +1,7 @@
org 51000 org 51000
counter EQU inc_counter + 1 counter EQU inc_counter + 1
attrs EQU &5800 attrs EQU #5800
xylo EQU attrs + 40 xylo EQU attrs + 40
zero_counter: zero_counter:
@ -11,8 +11,8 @@ set_counter:
ld (counter), a ld (counter), a
read_keyboard: read_keyboard:
ld a, &f7 ld a, #f7
in a, (&fe) in a, (#fe)
rra rra
jr nc, key_1 jr nc, key_1
rra rra
@ -25,23 +25,23 @@ read_keyboard:
jr c, read_keyboard jr c, read_keyboard
key_5: key_5:
ld de, 0x040C ld de, #040C
jr invoke jr invoke
key_2: key_2:
ld de, 0x0103 ld de, #0103
jr invoke jr invoke
key_3: key_3:
ld de, 0x0206 ld de, #0206
jr invoke jr invoke
key_4: key_4:
ld de, 0x0309 ld de, #0309
jr invoke jr invoke
key_1: key_1:
ld de, 0x0000 ld de, #0000
invoke: invoke:
push de push de
call highlight_key call highlight_key
@ -64,10 +64,10 @@ highlight_key:
ld d, 0 ld d, 0
add hl, de add hl, de
ld e, 30 ld e, 30
ld b, 15
highlight_block:
ld a, (hl) ld a, (hl)
xor %01000000 xor %01000000
ld b, 15
highlight_block:
ld (hl), a ld (hl), a
inc hl inc hl
ld (hl), a ld (hl), a