From 893371733b3141f948512f6ea6be0a106a759614 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Thu, 25 Jul 2019 18:12:39 +0200 Subject: [PATCH] more work on register preservation --- STATUS.md | 10 +++++----- c64/kernal/chrin.s | 14 +++++++------- c64/kernal/clall.s | 13 ++++++++++--- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/STATUS.md b/STATUS.md index e0d57f7b..3bbd5099 100644 --- a/STATUS.md +++ b/STATUS.md @@ -90,18 +90,18 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | $FFBD | SETNAM | DONE | | | $FFC0 | OPEN | PARTIAL | * work in progress | | $FFC3 | CLOSE | DONE | | -| $FFC6 | CHKIN | PARTIAL | * work in progress | -| $FFC9 | CHKOUT | PARTIAL | * work in progress | -| $FFCC | CLRCHN | PARTIAL | * work in progress | +| $FFC6 | CHKIN | DONE | | +| $FFC9 | CHKOUT | PARTIAL | | +| $FFCC | CLRCHN | DONE | | | $FFCF | CHRIN | PARTIAL | | | $FFD2 | CHROUT | PARTIAL | | -| $FFD5 | LOAD | PARTIAL | no VERIFY support yet | +| $FFD5 | LOAD | PARTIAL | * work in progress, no VERIFY support yet | | $FFD8 | SAVE | NOT DONE | * work in progress | | $FFDB | SETTIM | NOT DONE | | | $FFDE | RDTIM | NOT DONE | | | $FFE1 | STOP | PARTIAL | no connection with UDTIM | | $FFE4 | GETIN | PARTIAL | * work in progress | -| $FFE7 | CLALL | PARTIAL | * work in progress | +| $FFE7 | CLALL | DONE | | | $FFEA | UDTIM | NOT DONE | | | $FFED | SCREEN | DONE | | | $FFF0 | PLOT | NOT DONE | | diff --git a/c64/kernal/chrin.s b/c64/kernal/chrin.s index 8bd4850b..591936d2 100644 --- a/c64/kernal/chrin.s +++ b/c64/kernal/chrin.s @@ -8,11 +8,11 @@ ;; CPU registers that has to be preserved (see [RG64]): .Y ;; -;; XXX currently does not preserve register Y, to be fixed! +;; XXX keyboard part currently does not preserve register Y, to be fixed! - ;; Reads a byte of input, unless from keyboard. - ;; If from keyboard, then it gets a whole line of input, and returns the first char. - ;; Repeated calls after that read out the successive bytes of the line of input. +;; Reads a byte of input, unless from keyboard. +;; If from keyboard, then it gets a whole line of input, and returns the first char. +;; Repeated calls after that read out the successive bytes of the line of input. chrin: ;; First determine the device number @@ -202,7 +202,7 @@ not_shifted: clc adc #$40 + ;; FALLTROUGH +not_vendor: rts -not_vendor: - - rts + diff --git a/c64/kernal/clall.s b/c64/kernal/clall.s index 059804ed..01145a00 100644 --- a/c64/kernal/clall.s +++ b/c64/kernal/clall.s @@ -8,20 +8,27 @@ ;; CPU registers that has to be preserved (see [RG64]): .Y ;; -;; XXX currently does not preserve register Y, to be fixed! clall: + ;; Store .Y register + tya + pha + ;; Original routine probably just sets LDTND to 0, but this is not really safe, ;; so we actually close all the channels; at least IDE64 does the same for ;; it's channels, see CLALL description in the IDE64 User's Guide - +* ldy LDTND beq + dey lda LAT, y jsr close ; XXX jump through ICLOSE? - jmp clall + jmp - * + ;; Restore .Y register + pla + tay + ;; 'C64 Programmers Reference Guide', page 281, claims it calls CLRCHN too jmp clrchn