From 1047117fe697986fdfbba67f803620f9ca54a815 Mon Sep 17 00:00:00 2001 From: Philip Zembrod Date: Fri, 2 Apr 2021 00:07:59 +0200 Subject: [PATCH] Switch X16 ConOut to $ffd2, and introduce more labels to prepare switch to X16 R39. --- 6502/C64/src/vf-sys-x16.fth | 51 +++++++++++++++++++----------------- 6502/C64/tests/logtofile.fth | 4 +-- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/6502/C64/src/vf-sys-x16.fth b/6502/C64/src/vf-sys-x16.fth index 732dcc9..ce6f0cb 100644 --- a/6502/C64/src/vf-sys-x16.fth +++ b/6502/C64/src/vf-sys-x16.fth @@ -5,7 +5,7 @@ include vf-lbls-cbm.fth \ X16 labels -0c28c >label ConOut +0ffd2 >label ConOut 0286 >label IOStatus 028c >label MsgFlg 028b >label OutDev @@ -18,6 +18,19 @@ include vf-lbls-cbm.fth 0381 >label CurFlg \ aka qtsw 0385 >label InsCnt \ aka insrt +09f60 >label RomBank +09f61 >label RamBank + +0a000 >label KeyD \ keyboard buffer +0a00a >label Ndx \ #keys in keyboard buffer + + 037B >label blnsw \ C64: $cc +\ 037C >label blnct \ C64: $cd +\ 037D >label gdbln \ C64: $ce +\ 037E >label blnon \ C64: $cf +\ 0262 >label pnt \ C64: $d1 +\ 0380 >label pntr \ C64: $d3 +\ 0373 >label gdcol \ C64 labels that X16 doesn't have: @@ -30,22 +43,22 @@ include vf-lbls-cbm.fth \ X16 c64key? getkey Code c64key? ( -- flag) - 9f61 ldx - 0 # lda 9f61 sta - 0a00a lda + RamBank ldx + 0 # lda RamBank sta + Ndx lda 0<> ?[ 0FF # lda ]? pha - 9f61 stx + RamBank 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 - N lda 9f61 sta + RamBank lda N sta + 0 # lda RamBank sta + Ndx lda 0<> + ?[ sei KeyD ldy + [[ KeyD 1+ ,X lda KeyD ,X sta inx + Ndx cpx 0= ?] + Ndx dec + N lda RamBank sta tya cli 0A0 # cmp 0= ?[ bl # lda ]? ]? @@ -57,16 +70,6 @@ Code getkey ( -- 8b) \ X16 curon curoff - 037B >label blnsw \ C64: $cc -\ 037C >label blnct \ C64: $cd -\ 037D >label gdbln \ C64: $ce -\ 037E >label blnon \ C64: $cf -\ 0262 >label pnt \ C64: $d1 -\ 0380 >label pntr \ C64: $d3 -\ 0373 >label gdcol - -09f60 >label via1pb - Code curon ( --) blnsw stx Next jmp end-code @@ -109,7 +112,7 @@ Label restore pha txa pha tya pha cld Label first-init sei cld - via1pb lda $f8 # and via1pb sta \ map in KERNAL ROM + RomBank lda $f8 # and RomBank sta \ map in KERNAL ROM IOINIT jsr CINT jsr RESTOR jsr \ init. and set I/O-Vectors ink-pot lda BrdCol sta \ border ink-pot 1+ lda BkgCol sta \ backgrnd diff --git a/6502/C64/tests/logtofile.fth b/6502/C64/tests/logtofile.fth index 37a5ebd..68b5149 100644 --- a/6502/C64/tests/logtofile.fth +++ b/6502/C64/tests/logtofile.fth @@ -17,8 +17,8 @@ Output: alsologtofile c64at c64at? ; : logopen" - ascii " parse log-dev-2nd@ busopen - 2dup type + ascii " parse 2dup type + log-dev-2nd@ busopen bustype " ,s,w" count bustype busoff i/o-status? IF c64cr log-dev @ dos-error abort THEN alsologtofile ;