another keyboard code optimization

This commit is contained in:
FeralChild64 committed 2020-12-04 17:41:26 +01:00
1 parent d01c7e8ac9
commit 22936314fe
1 file changed
+7 -6
+7 -6
View File
@@ -88,6 +88,7 @@ m65_scnkey:
stx SHFLAG ; .X is $00 here stx SHFLAG ; .X is $00 here
lda M65_KB_BUCKY lda M65_KB_BUCKY
beq m65_scnkey_bucky_done
dex ; index into kb_matrix_bucky_shflag dex ; index into kb_matrix_bucky_shflag
; FALLTROUGH ; FALLTROUGH
@@ -96,21 +97,21 @@ m65_scnkey_bucky_loop:
inx inx
asr ; ASR preserves most significant bit, but in our case it is 0 asr ; ASR preserves most significant bit, but in our case it is 0
bcc m65_scnkey_bucky_next bcc @1
; Bucky key pressed ; Bucky key pressed
pha tay
lda kb_matrix_bucky_shflag, x lda kb_matrix_bucky_shflag, x
ora SHFLAG ora SHFLAG
sta SHFLAG sta SHFLAG
pla tya
@1:
bne m65_scnkey_bucky_loop
; FALLTROUGH ; FALLTROUGH
m65_scnkey_bucky_next: m65_scnkey_bucky_done:
bne m65_scnkey_bucky_loop
; Set KEYTAB vector ; Set KEYTAB vector