optimized pop_keyboard_buffer
This commit is contained in:
1 parent
470c4bded6
commit
fb2e13f9a9
9 files changed
+22
-20
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -51,10 +51,10 @@
|
||||
// #define CONFIG_LEGACY_SCNKEY
|
||||
#define CONFIG_KEYBOARD_C128
|
||||
// #define CONFIG_KEY_REPEAT_DEFAULT
|
||||
// #define CONFIG_KEY_REPEAT_ALWAYS
|
||||
#define CONFIG_KEY_REPEAT_ALWAYS
|
||||
#define CONFIG_KEY_FAST_SCAN
|
||||
#define CONFIG_JOY1_CURSOR
|
||||
// #define CONFIG_JOY2_CURSOR
|
||||
#define CONFIG_JOY2_CURSOR
|
||||
|
||||
|
||||
// Eye candy
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in new issue
Block a user