From 0bb8cc9e02c6382b43c29ebf8083e9aa232802fa Mon Sep 17 00:00:00 2001 From: Philip Zembrod Date: Sat, 19 Dec 2020 01:57:55 +0100 Subject: [PATCH] On X16 preserve selected RAM bank when querying the keyboard buffer --- 6502/C64/src/vf-sys-x16.fth | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/6502/C64/src/vf-sys-x16.fth b/6502/C64/src/vf-sys-x16.fth index 3e5062a..3ce44ff 100644 --- a/6502/C64/src/vf-sys-x16.fth +++ b/6502/C64/src/vf-sys-x16.fth @@ -29,18 +29,23 @@ include vf-lbls-cbm.fth \ X16 c64key? getkey Code c64key? ( -- flag) + 9f61 ldx 0 # lda 9f61 sta 0a00a lda 0<> ?[ 0FF # lda ]? pha + 9f61 stx Push jmp end-code Code getkey ( -- 8b) + 9f61 lda N sta 0 # lda 9f61 sta 0a00a lda 0<> ?[ sei 0a000 ldy [[ 0a000 1+ ,X lda 0a000 ,X sta inx 0a00a cpx 0= ?] - 0a00a dec tya cli 0A0 # cmp + 0a00a dec + N lda 9f61 sta + tya cli 0A0 # cmp 0= ?[ bl # lda ]? ]? Push0A jmp end-code