From 9187e3e601ba8982706044544080d008f05b7c5f Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Mon, 5 Aug 2019 22:51:16 +0200 Subject: [PATCH] more routines placed under compatible addresses --- c64/kernal/{f157.chrin.s => chrin_real.s} | 2 +- c64/kernal/{chrout.s => chrout_real.s} | 2 +- c64/kernal/{f32f.clall.s => clall_real.s} | 4 ++-- c64/kernal/close_load.s | 23 +++++++++++++++++++++++ c64/kernal/{clrchn.s => clrchn_real.s} | 2 +- c64/kernal/f157.chrin.jmp.s | 6 ++++++ c64/kernal/f1ca.chrout.jmp.s | 6 ++++++ c64/kernal/f291.close.s | 22 +--------------------- c64/kernal/f32f.clall.jmp.s | 6 ++++++ c64/kernal/f333.clrchn.jmp.s | 6 ++++++ c64/kernal/vector_defaults.s | 6 +++--- 11 files changed, 56 insertions(+), 29 deletions(-) rename c64/kernal/{f157.chrin.s => chrin_real.s} (99%) rename c64/kernal/{chrout.s => chrout_real.s} (99%) rename c64/kernal/{f32f.clall.s => clall_real.s} (94%) create mode 100644 c64/kernal/close_load.s rename c64/kernal/{clrchn.s => clrchn_real.s} (98%) create mode 100644 c64/kernal/f157.chrin.jmp.s create mode 100644 c64/kernal/f1ca.chrout.jmp.s create mode 100644 c64/kernal/f32f.clall.jmp.s create mode 100644 c64/kernal/f333.clrchn.jmp.s diff --git a/c64/kernal/f157.chrin.s b/c64/kernal/chrin_real.s similarity index 99% rename from c64/kernal/f157.chrin.s rename to c64/kernal/chrin_real.s index 8a84f5d6..b69db61d 100644 --- a/c64/kernal/f157.chrin.s +++ b/c64/kernal/chrin_real.s @@ -14,7 +14,7 @@ ;; 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: +chrin_real: ;; Determine the device number lda DFLTN diff --git a/c64/kernal/chrout.s b/c64/kernal/chrout_real.s similarity index 99% rename from c64/kernal/chrout.s rename to c64/kernal/chrout_real.s index 6f340a0f..128a7426 100644 --- a/c64/kernal/chrout.s +++ b/c64/kernal/chrout_real.s @@ -9,7 +9,7 @@ ;; -chrout: +chrout_real: sta last_printed_character_ascii diff --git a/c64/kernal/f32f.clall.s b/c64/kernal/clall_real.s similarity index 94% rename from c64/kernal/f32f.clall.s rename to c64/kernal/clall_real.s index ba595c20..33649858 100644 --- a/c64/kernal/f32f.clall.s +++ b/c64/kernal/clall_real.s @@ -9,7 +9,7 @@ ;; -clall: +clall_real: ;; Store .Y register tya @@ -23,7 +23,7 @@ clall: beq + dey lda LAT, y - jsr close ; XXX jump through ICLOSE? + jsr JCLOSE jmp - * ;; Restore .Y register diff --git a/c64/kernal/close_load.s b/c64/kernal/close_load.s new file mode 100644 index 00000000..f594590f --- /dev/null +++ b/c64/kernal/close_load.s @@ -0,0 +1,23 @@ + + +;; Common ppart of CLOSE and LOAD routines + +close_load: + + tax + + ;; Command drive to stop talking and to close the file + jsr untlk + + txa + jsr listen + + lda #$E0 ; CLOSE command + sta IEC_TMP2 + jsr iec_tx_command + jsr iec_tx_command_finalize + + ;; Tell drive to unlisten + jsr unlsn + + rts diff --git a/c64/kernal/clrchn.s b/c64/kernal/clrchn_real.s similarity index 98% rename from c64/kernal/clrchn.s rename to c64/kernal/clrchn_real.s index 3cc53078..2abee15e 100644 --- a/c64/kernal/clrchn.s +++ b/c64/kernal/clrchn_real.s @@ -9,7 +9,7 @@ ;; -clrchn: +clrchn_real: ;; Handle IEC input device lda DFLTN diff --git a/c64/kernal/f157.chrin.jmp.s b/c64/kernal/f157.chrin.jmp.s new file mode 100644 index 00000000..c063c752 --- /dev/null +++ b/c64/kernal/f157.chrin.jmp.s @@ -0,0 +1,6 @@ + +;; Our implementation is longer than the original one, +;; placing it here would cause a collision with CHROUT + +chrin: + jmp chrin_real diff --git a/c64/kernal/f1ca.chrout.jmp.s b/c64/kernal/f1ca.chrout.jmp.s new file mode 100644 index 00000000..02e434ea --- /dev/null +++ b/c64/kernal/f1ca.chrout.jmp.s @@ -0,0 +1,6 @@ + +;; Our implementation is longer than the original one, +;; placing it here would cause a collision with CHKIN + +chrout: + jmp chrout_real diff --git a/c64/kernal/f291.close.s b/c64/kernal/f291.close.s index 40c2f8c1..693362ce 100644 --- a/c64/kernal/f291.close.s +++ b/c64/kernal/f291.close.s @@ -38,7 +38,7 @@ close: jsr iec_tx_command bcs close_remove_from_table jsr iec_tx_command_finalize - + close_remove_from_table: ;; Remove channel from the table iny @@ -62,23 +62,3 @@ close_error_not_found: sec ; report success - not sure if original CLOSE does this, but it's nevertheless a good practice rts - -close_load: ; entry also for LOAD routine - - tax - - ;; Command drive to stop talking and to close the file - jsr untlk - - txa - jsr listen - - lda #$E0 ; CLOSE command - sta IEC_TMP2 - jsr iec_tx_command - jsr iec_tx_command_finalize - - ;; Tell drive to unlisten - jsr unlsn - - rts diff --git a/c64/kernal/f32f.clall.jmp.s b/c64/kernal/f32f.clall.jmp.s new file mode 100644 index 00000000..56567151 --- /dev/null +++ b/c64/kernal/f32f.clall.jmp.s @@ -0,0 +1,6 @@ + +;; Our implementation is longer than the original one, +;; placing it here would cause a collision with CLRCHN + +clall: + jmp clall_real diff --git a/c64/kernal/f333.clrchn.jmp.s b/c64/kernal/f333.clrchn.jmp.s new file mode 100644 index 00000000..ac23dc8e --- /dev/null +++ b/c64/kernal/f333.clrchn.jmp.s @@ -0,0 +1,6 @@ + +;; Our implementation is longer than the original one, +;; placing it here would cause a collision with OPEN + +clrchn: + jmp clrchn_real diff --git a/c64/kernal/vector_defaults.s b/c64/kernal/vector_defaults.s index 67e7791a..9d8c025a 100644 --- a/c64/kernal/vector_defaults.s +++ b/c64/kernal/vector_defaults.s @@ -10,14 +10,14 @@ vector_defaults: .word default_irq_handler ;; CINV .word $0000 ;; CBINV XXX implement this, has to be $FE66 for autostart support .word $0000 ;; NMINV XXX implement this, has to be $FE47 for autostart support - + .word open ;; IOPEN .word close ;; ICLOSE .word chkin ;; ICHKIN XXX move routine to $F20E - for autostart support .word ckout ;; ICKOUT XXX move routine to $F250 - for autostart support - .word clrchn ;; ICLRCH XXX move routine to $F333 - for autostart support + .word clrchn ;; ICLRCH .word chrin ;; IBASIN - .word chrout ;; IBSOUT XXX move routine to $F1CA - for autostart support + .word chrout ;; IBSOUT .word stop ;; ISTOP .word getin ;; IGETIN .word clall ;; ICLALL