From 3678e8f90b25a5e2dc293f46b528b192a4b54fbe Mon Sep 17 00:00:00 2001 From: Philip Zembrod Date: Sun, 26 May 2024 22:43:18 +0200 Subject: [PATCH] On X16, clear IOStatus byte (C64: $0090) via new Kernal call instead of writing directly to Kernal variable (which may break between Kernal revisions) --- 6502/C64/src/vf-sys-cbm.fth | 6 ++++-- 6502/C64/src/vf-sys-x16.fth | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/6502/C64/src/vf-sys-cbm.fth b/6502/C64/src/vf-sys-cbm.fth index 0b21057..b5047fb 100644 --- a/6502/C64/src/vf-sys-cbm.fth +++ b/6502/C64/src/vf-sys-cbm.fth @@ -150,8 +150,10 @@ Label nodevice 0 # ldx 1 # ldy \ ?device clv12jul87 -Label (?dev - IOStatus stx \ because IOStatus isn't cleared by LISTEN or TALK +Label (?dev ( a: dev ) + \ Clear IOStatus because it isn't cleared by LISTEN or TALK + (C64 IOStatus stx ( ) (C16 IOStatus stx ( ) + (X16 pha 1 # lda ExtApi jsr pla ( ) \ It's unclear in which situation or use case the following \ workaround for a C16 OS error is needed. The v4th tests pass \ even with the following line removed. diff --git a/6502/C64/src/vf-sys-x16.fth b/6502/C64/src/vf-sys-x16.fth index 802617b..c959cfa 100644 --- a/6502/C64/src/vf-sys-x16.fth +++ b/6502/C64/src/vf-sys-x16.fth @@ -7,7 +7,7 @@ include vf-lbls-cbm.fth 0ffd2 >label ConOut 0febd >label KbdbufPeek - 0287 >label IOStatus \ aka status +0feab >label ExtApi 028d >label MsgFlg 09f2c >label BrdCol 0376 >label BkgPenCol \ aka color