fixed potential bug in cx16.kbdbuf_clear() is and it is now cbm.kbdbuf_clear() and is available on all cbm like targets

This commit is contained in:
Irmen de Jong 2024-03-14 22:12:29 +01:00
parent 7e1e7a0780
commit 1818738fc8
4 changed files with 40 additions and 10 deletions

View File

@ -138,6 +138,16 @@ sub CLEARST() {
CLOSE(15) CLOSE(15)
} }
asmsub kbdbuf_clear() {
; -- convenience helper routine to clear the keyboard buffer
%asm {{
- jsr GETIN
cmp #0
bne -
rts
}}
}
} }
c64 { c64 {

View File

@ -135,6 +135,16 @@ sub CLEARST() {
CLOSE(15) CLOSE(15)
} }
asmsub kbdbuf_clear() {
; -- convenience helper routine to clear the keyboard buffer
%asm {{
- jsr GETIN
cmp #0
bne -
rts
}}
}
} }
c64 { c64 {

View File

@ -90,6 +90,16 @@ sub CLEARST() {
CLOSE(15) CLOSE(15)
} }
asmsub kbdbuf_clear() {
; -- convenience helper routine to clear the keyboard buffer
%asm {{
- jsr GETIN
cmp #0
bne -
rts
}}
}
} }
cx16 { cx16 {
@ -436,7 +446,7 @@ romsub $ff4d = clock_set_date_time(uword yearmonth @R0, uword dayhours @R1, uwor
romsub $ff50 = clock_get_date_time() clobbers(A, X, Y) -> uword @R0, uword @R1, uword @R2, uword @R3 ; result registers see clock_set_date_time() romsub $ff50 = clock_get_date_time() clobbers(A, X, Y) -> uword @R0, uword @R1, uword @R2, uword @R3 ; result registers see clock_set_date_time()
; keyboard, mouse, joystick ; keyboard, mouse, joystick
; note: also see the kbdbuf_clear() helper routine below! ; note: also see the cbm.kbdbuf_clear() helper routine
romsub $febd = kbdbuf_peek() -> ubyte @A, ubyte @X ; key in A, queue length in X romsub $febd = kbdbuf_peek() -> ubyte @A, ubyte @X ; key in A, queue length in X
romsub $febd = kbdbuf_peek2() -> uword @AX ; alternative to above to not have the hassle to deal with multiple return values romsub $febd = kbdbuf_peek2() -> uword @AX ; alternative to above to not have the hassle to deal with multiple return values
romsub $fec0 = kbdbuf_get_modifiers() -> ubyte @A romsub $fec0 = kbdbuf_get_modifiers() -> ubyte @A
@ -534,15 +544,6 @@ asmsub get_screen_mode() -> byte @A, byte @X, byte @Y {
}} }}
} }
asmsub kbdbuf_clear() {
; -- convenience helper routine to clear the keyboard buffer
%asm {{
- jsr cbm.GETIN
bne -
rts
}}
}
asmsub mouse_config2(byte shape @A) clobbers (A, X, Y) { asmsub mouse_config2(byte shape @A) clobbers (A, X, Y) {
; -- convenience wrapper function that handles the screen resolution for mouse_config() for you ; -- convenience wrapper function that handles the screen resolution for mouse_config() for you
%asm {{ %asm {{

View File

@ -75,6 +75,15 @@ asmsub RDTIM16() clobbers(X) -> uword @AY {
}} }}
} }
asmsub kbdbuf_clear() {
; -- convenience helper routine to clear the keyboard buffer
%asm {{
- jsr GETIN
cmp #0
bne -
rts
}}
}
} }