From c2490345f5eff263f744c38ddc806281faa32593 Mon Sep 17 00:00:00 2001 From: Philip Zembrod Date: Sun, 30 Aug 2020 01:38:07 +0200 Subject: [PATCH] Adapt c64key? and getkey to X16 --- 6502/C64/src/vf-sys-x16.fth | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/6502/C64/src/vf-sys-x16.fth b/6502/C64/src/vf-sys-x16.fth index 301f82f..9353314 100644 --- a/6502/C64/src/vf-sys-x16.fth +++ b/6502/C64/src/vf-sys-x16.fth @@ -33,16 +33,18 @@ Label ConOut clc console_put_char jmp \ C64 c64key? getkey Code c64key? ( -- flag) - 0C6 lda + 0 # lda 9f61 sta + 0a00a lda 0<> ?[ 0FF # lda ]? pha Push jmp end-code Code getkey ( -- 8b) - 0C6 lda 0<> - ?[ sei 0277 ldy - [[ 0277 1+ ,X lda 0277 ,X sta inx - 0C6 cpx 0= ?] - 0C6 dec tya cli 0A0 # cmp + 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 0= ?[ bl # lda ]? ]? Push0A jmp end-code