optimized pop_keyboard_buffer

This commit is contained in:
FeralChild64 committed 2019-10-16 19:10:28 +02:00
1 parent 470c4bded6
commit fb2e13f9a9
9 files changed
+22 -20

No files matched your search

-18
View File
@@ -149,21 +149,3 @@ not_enter:
// Keep looking for input from keyboard until carriage return
jmp chrin_repeat
pop_keyboard_buffer:
// Pop key out of keyboard buffer
// Disable interrupts while reading from keyboard buffer
// so that no race conditions can occur
sei
ldx #$00
ldy #$01
!: lda KEYD,y
sta KEYD,x
inx
iny
cpy XMAX
bne !-
dec NDX
cli
rts
+20
View File
@@ -0,0 +1,20 @@
// Pop key out of keyboard buffer
// Disable interrupts while reading from keyboard buffer
// so that no race conditions can occur
pop_keyboard_buffer:
ldy #$01
sei
!: lda KEYD,y
sta KEYD-1,y
iny
cpy XMAX
bne !-
dec NDX
cli
rts