I ran into this when adapting VolksForth from the R38 to the R41 X16 Kernal. The Kernal version dependencies were all around use of Kernal variables which, for C64 and C16 was perfectly safe but for the X16 isn't as they, for good reasons, can still move from Kernal version to Kernal version.
The right thing to do was, of course, to replace the Kernal variable references with calls to the Kernal API, and in almost all cases I was successful doing that (thanks at this point for the new keyboard API). The one exception I couldn't yet fix was a reference to IOStatus (C64: $90, X16: currently $0289), for the purpose of clearing it before calls to LISTEN and TALK, respectively. As it turns out, IOStatus is not cleared at the beginning of these two Kernal routines, so one must clear it manually before calling them, or IEC error detection won't work properly. And it turns out there's no way to clear IOStatus in a reasonable way through Kernal API calls.
I have therefore two proposals:
Fix this old Kernal bug: Clear IOStatus at the beginning of LISTEN and TALK
Add an API call to clear IOStatus. It seems kinda wrong that one cannot do this.
I ran into this when adapting VolksForth from the R38 to the R41 X16 Kernal. The Kernal version dependencies were all around use of Kernal variables which, for C64 and C16 was perfectly safe but for the X16 isn't as they, for good reasons, can still move from Kernal version to Kernal version.
The right thing to do was, of course, to replace the Kernal variable references with calls to the Kernal API, and in almost all cases I was successful doing that (thanks at this point for the new keyboard API). The one exception I couldn't yet fix was a reference to IOStatus (C64: $90, X16: currently $0289), for the purpose of clearing it before calls to LISTEN and TALK, respectively. As it turns out, IOStatus is not cleared at the beginning of these two Kernal routines, so one must clear it manually before calling them, or IEC error detection won't work properly. And it turns out there's no way to clear IOStatus in a reasonable way through Kernal API calls.
I have therefore two proposals:
WDYT?