From d5d6581901193bf042beae79b3288ead20b0e167 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Mon, 5 Aug 2019 18:08:15 +0200 Subject: [PATCH 1/6] jump table now uses vectors in RAM --- c64/basic/ab1e.print_string.s | 2 +- c64/basic/basic_cold_start.s | 2 +- c64/basic/basic_do_error.s | 10 +++---- c64/basic/basic_main_loop.s | 2 +- c64/basic/cmd_break.s | 2 +- c64/basic/cmd_list.s | 8 +++--- c64/basic/cmd_load.s | 5 ++-- c64/basic/print_integer.s | 2 +- c64/basic/print_packed_message.s | 10 +++---- c64/basic/printf.s | 6 ++--- c64/basic/via_vector.s | 42 ----------------------------- c64/basic/wedge_dos.s | 30 ++++++++++----------- c64/kernal/jumptable/ffc0.jopen.s | 3 ++- c64/kernal/jumptable/ffc3.jclose.s | 3 ++- c64/kernal/jumptable/ffc6.jchkin.s | 3 ++- c64/kernal/jumptable/ffc9.jckout.s | 3 ++- c64/kernal/jumptable/ffcc.jclrchn.s | 3 ++- c64/kernal/jumptable/ffcf.jchrin.s | 3 ++- c64/kernal/jumptable/ffd2.jchrout.s | 3 ++- c64/kernal/jumptable/ffe1.jstop.s | 3 ++- c64/kernal/jumptable/ffe4.jgetin.s | 3 ++- c64/kernal/jumptable/ffe7.jclall.s | 3 ++- c64/kernal/vector.s | 21 --------------- strings/036C1C036C | 3 --- strings/036C1E036C | 3 --- strings/036C20036C | 3 --- strings/036C22036C | 3 --- strings/036C24036C | 3 --- strings/036C2603 | 3 --- strings/036C2A036C | 4 --- strings/036C2C03 | 3 --- strings/6C1A036C | 3 --- 32 files changed, 60 insertions(+), 140 deletions(-) delete mode 100644 c64/basic/via_vector.s delete mode 100644 strings/036C1C036C delete mode 100644 strings/036C1E036C delete mode 100644 strings/036C20036C delete mode 100644 strings/036C22036C delete mode 100644 strings/036C24036C delete mode 100644 strings/036C2603 delete mode 100644 strings/036C2A036C delete mode 100644 strings/036C2C03 delete mode 100644 strings/6C1A036C diff --git a/c64/basic/ab1e.print_string.s b/c64/basic/ab1e.print_string.s index 83f8d366..0ea252a3 100644 --- a/c64/basic/ab1e.print_string.s +++ b/c64/basic/ab1e.print_string.s @@ -20,7 +20,7 @@ print_string_loop: lda (temp_string_ptr),y beq print_string_end - jsr via_IBSOUT + jsr JCHROUT txa tay diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index 325bd1ed..341e0909 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -29,7 +29,7 @@ startup_banner: jsr print_integer lda #$20 - jsr via_IBSOUT + jsr JCHROUT ;; Print the rest of the start up message ldx #34 diff --git a/c64/basic/basic_do_error.s b/c64/basic/basic_do_error.s index 92d7e46d..731f99c2 100644 --- a/c64/basic/basic_do_error.s +++ b/c64/basic/basic_do_error.s @@ -7,9 +7,9 @@ basic_do_error: ;; Print ? at start lda #$0d - jsr via_IBSOUT + jsr JCHROUT lda #$3f - jsr via_IBSOUT + jsr JCHROUT ;; Print main part of error message pla @@ -18,7 +18,7 @@ basic_do_error: ;; Print ERROR at end lda #$20 - jsr via_IBSOUT + jsr JCHROUT ldx #33 jsr print_packed_message @@ -27,9 +27,9 @@ basic_do_error: ;; XXX print line number if not in direct mode lda #$0d - jsr via_IBSOUT + jsr JCHROUT lda #$0d - jsr via_IBSOUT + jsr JCHROUT ;; Reset stack, and go back to main loop ldx #$fe diff --git a/c64/basic/basic_main_loop.s b/c64/basic/basic_main_loop.s index 2d7afdd6..69e12c9d 100644 --- a/c64/basic/basic_main_loop.s +++ b/c64/basic/basic_main_loop.s @@ -52,7 +52,7 @@ rsl_l1: lda $0200,x * ;; Do printing of the new line lda #$0d - jsr via_IBSOUT + jsr JCHROUT ;; Ignore empty lines lda tokenise_work1 diff --git a/c64/basic/cmd_break.s b/c64/basic/cmd_break.s index 31194132..36128422 100644 --- a/c64/basic/cmd_break.s +++ b/c64/basic/cmd_break.s @@ -17,7 +17,7 @@ basic_do_break: * lda #$0d - jsr via_IBSOUT + jsr JCHROUT cmd_end: jmp basic_main_loop diff --git a/c64/basic/cmd_list.s b/c64/basic/cmd_list.s index a1be1724..72e9edd9 100644 --- a/c64/basic/cmd_list.s +++ b/c64/basic/cmd_list.s @@ -42,7 +42,7 @@ list_single_line: ; entry point needed by DOS wedge pla jsr print_integer lda #$20 - jsr via_IBSOUT + jsr JCHROUT ;; Iterate through printing out the line ;; contents @@ -111,16 +111,16 @@ list_not_rem: bne list_print_loop list_is_literal: - jsr via_IBSOUT + jsr JCHROUT iny bne list_print_loop list_end_of_line: ;; Clear reverse flag lda #$92 - jsr via_IBSOUT + jsr JCHROUT ;; Print end of line lda #$0d - jsr via_IBSOUT + jsr JCHROUT rts diff --git a/c64/basic/cmd_load.s b/c64/basic/cmd_load.s index dc900c54..ac286c6e 100644 --- a/c64/basic/cmd_load.s +++ b/c64/basic/cmd_load.s @@ -191,6 +191,7 @@ end_of_line_search: pla sta basic_current_line_ptr+0 - - jmp basic_relink_loop + +via_ILOAD: + jmp (ILOAD) diff --git a/c64/basic/print_integer.s b/c64/basic/print_integer.s index 7e897243..f5d93fa7 100644 --- a/c64/basic/print_integer.s +++ b/c64/basic/print_integer.s @@ -115,7 +115,7 @@ found_start_of_number: ;; Print digits * lda $0100,y ora #$30 - jsr via_IBSOUT + jsr JCHROUT iny cpy #5 bne - diff --git a/c64/basic/print_packed_message.s b/c64/basic/print_packed_message.s index 7aac0876..006bf70e 100644 --- a/c64/basic/print_packed_message.s +++ b/c64/basic/print_packed_message.s @@ -38,7 +38,7 @@ found_message_in_token_stream: beq + jsr print_packed_word lda #$20 - jsr via_IBSOUT + jsr JCHROUT pla tay iny @@ -47,7 +47,7 @@ found_message_in_token_stream: pla ;; Rub out space at the end lda #$14 - jsr via_IBSOUT + jsr JCHROUT rts print_packed_word: @@ -144,7 +144,7 @@ next_packed_word_char: ;; X=1-14 = first 14 chars, so subtract one lda packed_message_chars-1,x - jsr via_IBSOUT + jsr JCHROUT ;; See if there is a char in the low nybl to print pla @@ -171,7 +171,7 @@ has_nybl: ;; X=1-14 = first 14 chars, so subtract one lda packed_message_chars-1,x - jsr via_IBSOUT + jsr JCHROUT * pla tay @@ -207,7 +207,7 @@ unpack_literal_char: tya pha lda (temp_string_ptr),y - jsr via_IBSOUT + jsr JCHROUT pla tay rts diff --git a/c64/basic/printf.s b/c64/basic/printf.s index 85fa0cf8..ceb4337b 100644 --- a/c64/basic/printf.s +++ b/c64/basic/printf.s @@ -112,7 +112,7 @@ not_hexword: not_pointer: ;; Print character - jsr via_IBSOUT + jsr JCHROUT printf_nextchar: jsr printf_advance @@ -148,11 +148,11 @@ printf_printhexbyte: cmp #$3A bcc + adc #6 -* jsr via_IBSOUT +* jsr JCHROUT pla and #$0f ora #$30 cmp #$3A bcc + adc #6 -* jmp via_IBSOUT +* jmp JCHROUT diff --git a/c64/basic/via_vector.s b/c64/basic/via_vector.s deleted file mode 100644 index 3cfc7480..00000000 --- a/c64/basic/via_vector.s +++ /dev/null @@ -1,42 +0,0 @@ - -;; -;; Helper routines for jumping via vectors, to be used with JSR -;; -;; Note: they are not in the order of low memory vectors, to avoid -;; similarity with the original ROMs - -via_ISAVE: - jmp (ISAVE) - -via_ILOAD: - jmp (ILOAD) - -via_ICLOSE: - jmp (ICLOSE) - -via_IOPEN: - jmp (IOPEN) - -via_ICHKIN: - jmp (ICHKIN) - -via_IBASIN: - jmp (IBASIN) - -via_IGETIN: - jmp (IGETIN) - -via_ICKOUT: - jmp (ICKOUT) - -via_IBSOUT: - jmp (IBSOUT) - -via_ICLRCH: - jmp (ICLRCH) - -via_ICLALL: - jmp (ICLALL) - -via_ISTOP: - jmp (ISTOP) diff --git a/c64/basic/wedge_dos.s b/c64/basic/wedge_dos.s index e147e9fe..ccfffe4d 100644 --- a/c64/basic/wedge_dos.s +++ b/c64/basic/wedge_dos.s @@ -4,7 +4,7 @@ wedge_dos: ;; Close all the channels, so that wedge has full control - jsr via_ICLALL + jsr JCLALL ;; Set file parameters, channel 15 is a typical one for commands jsr select_device ; sets X register @@ -41,11 +41,11 @@ wedge_dos_command: jsr wedge_dos_setnam jsr JSETNAM - jsr via_IOPEN + jsr JOPEN bcs wedge_dos_basic_error ;; Retrieve status, print it if not OK - jsr via_ICLALL + jsr JCLALL jsr wedge_dos_status_get lda BUF+0 cmp #$30 ; '0' @@ -82,12 +82,12 @@ wedge_dos_status_get: ;; Set remaining file parameters, open the channel lda #$00 ; empty file name jsr JSETNAM - jsr via_IOPEN + jsr JOPEN bcs wedge_dos_basic_error ;; Set channel for input ldx #$0F - jsr via_ICHKIN + jsr JCHKIN bcs wedge_dos_basic_error ldy #$00 @@ -98,7 +98,7 @@ wedge_dos_status_get: ;; XXX error in case of status != EOF ;; Print out everything retrieved from the drive bne + - jsr via_IBASIN + jsr JCHRIN bcs wedge_dos_basic_error sta BUF, y iny @@ -118,7 +118,7 @@ wedge_dos_status_print: dey bmi + lda BUF, x - jsr via_IBSOUT + jsr JCHROUT inx bne - * @@ -139,18 +139,18 @@ wedge_dos_directory: jsr wedge_dos_setnam ;; Open the file - jsr via_IOPEN + jsr JOPEN bcs wedge_dos_basic_error ;; Set channel for file reading ldx #$00 - jsr via_ICHKIN + jsr JCHKIN bcs wedge_dos_basic_error ;; Ignore start address (2 first bytes) - XXX check for errors - jsr via_IBASIN + jsr JCHRIN bcs wedge_dos_basic_error - jsr via_IBASIN + jsr JCHRIN bcs wedge_dos_basic_error wedge_dos_directory_line: @@ -159,7 +159,7 @@ wedge_dos_directory_line: ldy #$FF * iny - jsr via_IBASIN + jsr JCHRIN bcs wedge_dos_basic_error sta BUF, y cpy #$50 @@ -199,15 +199,15 @@ wedge_dos_directory_display: ;; FALLTROUGH wedge_dos_clean_exit: - jsr via_ICLALL + jsr JCLALL ;; Print new line lda #$0D - jsr via_IBSOUT + jsr JCHROUT jmp basic_end_of_line wedge_dos_basic_error: pha - jsr via_ICLALL + jsr JCLALL pla tax dex diff --git a/c64/kernal/jumptable/ffc0.jopen.s b/c64/kernal/jumptable/ffc0.jopen.s index 58339e6b..7aafbb7e 100644 --- a/c64/kernal/jumptable/ffc0.jopen.s +++ b/c64/kernal/jumptable/ffc0.jopen.s @@ -1,3 +1,4 @@ ; open a logical file ; C64 Programmer's Reference Guide Page 272 - jmp open +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (IOPEN) diff --git a/c64/kernal/jumptable/ffc3.jclose.s b/c64/kernal/jumptable/ffc3.jclose.s index c4b44418..b59159d3 100644 --- a/c64/kernal/jumptable/ffc3.jclose.s +++ b/c64/kernal/jumptable/ffc3.jclose.s @@ -1,3 +1,4 @@ ; close a specified logical file ; C64 Programmer's Reference Guide Page 272 - jmp close +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (ICLOSE) diff --git a/c64/kernal/jumptable/ffc6.jchkin.s b/c64/kernal/jumptable/ffc6.jchkin.s index 842faeb9..da8948c7 100644 --- a/c64/kernal/jumptable/ffc6.jchkin.s +++ b/c64/kernal/jumptable/ffc6.jchkin.s @@ -1,3 +1,4 @@ ; Open channel for input ; C64 Programmer's Reference Guide Page 272 - jmp chkin +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (ICHKIN) diff --git a/c64/kernal/jumptable/ffc9.jckout.s b/c64/kernal/jumptable/ffc9.jckout.s index ccfe9a2f..f394d46d 100644 --- a/c64/kernal/jumptable/ffc9.jckout.s +++ b/c64/kernal/jumptable/ffc9.jckout.s @@ -1,3 +1,4 @@ ; Open channel for output ; C64 Programmer's Reference Guide Page 272 - jmp ckout +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (ICKOUT) diff --git a/c64/kernal/jumptable/ffcc.jclrchn.s b/c64/kernal/jumptable/ffcc.jclrchn.s index 174f0557..9fb7697c 100644 --- a/c64/kernal/jumptable/ffcc.jclrchn.s +++ b/c64/kernal/jumptable/ffcc.jclrchn.s @@ -1,3 +1,4 @@ ; close input and output channels ; C64 Programmer's Reference Guide Page 272 - jmp clrchn +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (ICLRCH) diff --git a/c64/kernal/jumptable/ffcf.jchrin.s b/c64/kernal/jumptable/ffcf.jchrin.s index d2952a23..465ac6b8 100644 --- a/c64/kernal/jumptable/ffcf.jchrin.s +++ b/c64/kernal/jumptable/ffcf.jchrin.s @@ -1,3 +1,4 @@ ; Input character from channel ; C64 Programmer's Reference Guide Page 272 - jmp chrin +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (IBASIN) diff --git a/c64/kernal/jumptable/ffd2.jchrout.s b/c64/kernal/jumptable/ffd2.jchrout.s index 816a6ece..318b26cf 100644 --- a/c64/kernal/jumptable/ffd2.jchrout.s +++ b/c64/kernal/jumptable/ffd2.jchrout.s @@ -1,3 +1,4 @@ ; Output character to channel ; C64 Programmer's Reference Guide Page 272 - jmp chrout +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (IBSOUT) diff --git a/c64/kernal/jumptable/ffe1.jstop.s b/c64/kernal/jumptable/ffe1.jstop.s index c9c13712..e5b6c4ec 100644 --- a/c64/kernal/jumptable/ffe1.jstop.s +++ b/c64/kernal/jumptable/ffe1.jstop.s @@ -1,3 +1,4 @@ ; Scan stop key ; C64 Programmer's Reference Guide Page 273 - jmp stop +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (ISTOP) diff --git a/c64/kernal/jumptable/ffe4.jgetin.s b/c64/kernal/jumptable/ffe4.jgetin.s index c1b21dbe..c9f67cf4 100644 --- a/c64/kernal/jumptable/ffe4.jgetin.s +++ b/c64/kernal/jumptable/ffe4.jgetin.s @@ -1,3 +1,4 @@ ; Get character from keyboard queue (keyboard buffer) ; C64 Programmer's Reference Guide Page 272 - jmp getin +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (IGETIN) diff --git a/c64/kernal/jumptable/ffe7.jclall.s b/c64/kernal/jumptable/ffe7.jclall.s index 03e1725f..f5050a8a 100644 --- a/c64/kernal/jumptable/ffe7.jclall.s +++ b/c64/kernal/jumptable/ffe7.jclall.s @@ -1,3 +1,4 @@ ; $FFE7 - Close all files vector ; (http://codebase64.org/doku.php?id=base:kernalreference) - jmp clall +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (ICLALL) diff --git a/c64/kernal/vector.s b/c64/kernal/vector.s index 5fb49426..9afc2ef8 100644 --- a/c64/kernal/vector.s +++ b/c64/kernal/vector.s @@ -65,24 +65,3 @@ vector_restore: rts .scend - - ;; XXX below we have quite a lot of data... should we decouple them? - -vector_defaults: - .word default_irq_handler ;; CINV - .word $0000 ;; CBINV XXX implement this - .word $0000 ;; NMINV XXX implement this - - .word open ;; IOPEN - .word close ;; ICLOSE - .word chkin ;; ICHKIN - .word ckout ;; ICKOUT - .word clrchn ;; ICLRCH - .word chrin ;; IBASIN - .word chrout ;; IBSOUT - .word stop ;; ISTOP - .word getin ;; IGETIN - .word clall ;; ICLALL - .word $0000 ;; USRCMD XXX implement this - .word load ;; ILOAD - .word save ;; ISAVE diff --git a/strings/036C1C036C b/strings/036C1C036C deleted file mode 100644 index ebb399e0..00000000 --- a/strings/036C1C036C +++ /dev/null @@ -1,3 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($031C) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/036C1E036C b/strings/036C1E036C deleted file mode 100644 index e6f9e218..00000000 --- a/strings/036C1E036C +++ /dev/null @@ -1,3 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($031E) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/036C20036C b/strings/036C20036C deleted file mode 100644 index ab5ed572..00000000 --- a/strings/036C20036C +++ /dev/null @@ -1,3 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($0320) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/036C22036C b/strings/036C22036C deleted file mode 100644 index f05b4581..00000000 --- a/strings/036C22036C +++ /dev/null @@ -1,3 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($0322) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/036C24036C b/strings/036C24036C deleted file mode 100644 index 4b11242c..00000000 --- a/strings/036C24036C +++ /dev/null @@ -1,3 +0,0 @@ -03 (most likely adddress higher byte) + JMP ($0324) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/036C2603 b/strings/036C2603 deleted file mode 100644 index 3271b1af..00000000 --- a/strings/036C2603 +++ /dev/null @@ -1,3 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($0326) (via public, documented vector) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/036C2A036C b/strings/036C2A036C deleted file mode 100644 index 552a4b08..00000000 --- a/strings/036C2A036C +++ /dev/null @@ -1,4 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($032A) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. - diff --git a/strings/036C2C03 b/strings/036C2C03 deleted file mode 100644 index 3bf23438..00000000 --- a/strings/036C2C03 +++ /dev/null @@ -1,3 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($032C) (via public, documented vector) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/6C1A036C b/strings/6C1A036C deleted file mode 100644 index b2044ce0..00000000 --- a/strings/6C1A036C +++ /dev/null @@ -1,3 +0,0 @@ -JMP ($031A) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. From a79564b37410c4aeadc2596c992d6e077214a05d Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Mon, 5 Aug 2019 18:22:31 +0200 Subject: [PATCH 2/6] drive led is now turned OFF after @$ --- c64/kernal/close.s | 27 ++++++++++++++++++++++++++- c64/kernal/load.s | 13 +------------ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/c64/kernal/close.s b/c64/kernal/close.s index fc8e0a8c..40c2f8c1 100644 --- a/c64/kernal/close.s +++ b/c64/kernal/close.s @@ -26,8 +26,13 @@ close: ;; IEC device jsr iec_tx_flush ; make sure no byte is awaiting -* lda SAT, y ; get secondary address + cmp #$60 + bne + + ;; workaround for using CLOSE on reading executable - XXX is this a proper way? + jsr close_load + jmp close_remove_from_table +* ora $E0 ; CLOSE command sta IEC_TMP2 jsr iec_tx_command @@ -57,3 +62,23 @@ 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/load.s b/c64/kernal/load.s index e845b546..ece03816 100644 --- a/c64/kernal/load.s +++ b/c64/kernal/load.s @@ -125,19 +125,8 @@ load_loop: ;; Close file on drive - ;; Command drive to stop talking and to close the file - jsr untlk - lda current_device_number - jsr listen - - lda #$E0 - sta IEC_TMP2 - jsr iec_tx_command - jsr iec_tx_command_finalize - - ;; Tell drive to unlisten - jsr unlsn + jsr close_load ;; Return last address jmp lvs_return_last_address From 3a562447264700e41379d3a99b4c4e15016bd85b Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Mon, 5 Aug 2019 18:32:55 +0200 Subject: [PATCH 3/6] fix for missing file --- c64/kernal/vector_defaults.s | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 c64/kernal/vector_defaults.s diff --git a/c64/kernal/vector_defaults.s b/c64/kernal/vector_defaults.s new file mode 100644 index 00000000..962cd3c5 --- /dev/null +++ b/c64/kernal/vector_defaults.s @@ -0,0 +1,26 @@ + +;; +;; Default values for Kernal vectors - described in: +;; +;; - [RG64] C64 Programmer's Reference Guide - page 293 (RESTOR), 304 (VECTOR) +;; - [CM64] Compute's Mapping the Commodore 64 - page 237 +;; + +vector_defaults: + .word default_irq_handler ;; CINV + .word $0000 ;; CBINV XXX implement this + .word $0000 ;; NMINV XXX implement this + + .word open ;; IOPEN + .word close ;; ICLOSE + .word chkin ;; ICHKIN + .word ckout ;; ICKOUT + .word clrchn ;; ICLRCH + .word chrin ;; IBASIN + .word chrout ;; IBSOUT + .word stop ;; ISTOP + .word getin ;; IGETIN + .word clall ;; ICLALL + .word $0000 ;; USRCMD XXX implement this + .word load ;; ILOAD + .word save ;; ISAVE From 80dafcee32143ac958a710bfd13e9d9f53e0fe05 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Mon, 5 Aug 2019 18:38:01 +0200 Subject: [PATCH 4/6] fix for improper rule in .gitignore --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fe4f9202..1d25926a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,8 @@ build/* # Input to the similarity tool - copyrighted material, we can't check it in! -basic -kernal +/basic +/kernal # Various IDE project files, temporary files, etc. From 802890ff9cb151d062c630848d56d62235b0a899 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Mon, 5 Aug 2019 19:14:38 +0200 Subject: [PATCH 5/6] started working on autostart software support --- STATUS.md | 2 +- c64/kernal/ea31.interop | 8 ++++++++ c64/kernal/{getin.s => f13e.getin.s} | 0 c64/kernal/f13e.interop | 8 ++++++++ c64/kernal/{chrin.s => f157.chrin.s} | 0 c64/kernal/f157.interop | 8 ++++++++ c64/kernal/f1ca.interop | 8 ++++++++ c64/kernal/f20e.interop | 8 ++++++++ c64/kernal/f250.interop | 8 ++++++++ c64/kernal/{close.s => f291.close.s} | 0 c64/kernal/f291.interop | 8 ++++++++ c64/kernal/{clall.s => f32f.clall.s} | 0 c64/kernal/f32f.interop | 8 ++++++++ c64/kernal/f333.interop | 8 ++++++++ c64/kernal/f34a.interop | 8 ++++++++ c64/kernal/{open.s => f34a.open.s} | 0 c64/kernal/f4a5.interop | 8 ++++++++ c64/kernal/{load.s => f4a5.load.s} | 0 c64/kernal/f5ed.interop | 8 ++++++++ c64/kernal/{save.s => f5ed.save.s} | 0 c64/kernal/f6ed.interop | 8 ++++++++ c64/kernal/{stop.s => f6ed.stop.s} | 0 c64/kernal/fe47.interop | 8 ++++++++ c64/kernal/fe66.interop | 8 ++++++++ c64/kernal/vector_defaults.s | 16 ++++++++-------- 25 files changed, 129 insertions(+), 9 deletions(-) create mode 100644 c64/kernal/ea31.interop rename c64/kernal/{getin.s => f13e.getin.s} (100%) create mode 100644 c64/kernal/f13e.interop rename c64/kernal/{chrin.s => f157.chrin.s} (100%) create mode 100644 c64/kernal/f157.interop create mode 100644 c64/kernal/f1ca.interop create mode 100644 c64/kernal/f20e.interop create mode 100644 c64/kernal/f250.interop rename c64/kernal/{close.s => f291.close.s} (100%) create mode 100644 c64/kernal/f291.interop rename c64/kernal/{clall.s => f32f.clall.s} (100%) create mode 100644 c64/kernal/f32f.interop create mode 100644 c64/kernal/f333.interop create mode 100644 c64/kernal/f34a.interop rename c64/kernal/{open.s => f34a.open.s} (100%) create mode 100644 c64/kernal/f4a5.interop rename c64/kernal/{load.s => f4a5.load.s} (100%) create mode 100644 c64/kernal/f5ed.interop rename c64/kernal/{save.s => f5ed.save.s} (100%) create mode 100644 c64/kernal/f6ed.interop rename c64/kernal/{stop.s => f6ed.stop.s} (100%) create mode 100644 c64/kernal/fe47.interop create mode 100644 c64/kernal/fe66.interop diff --git a/STATUS.md b/STATUS.md index 286da229..77ec702d 100644 --- a/STATUS.md +++ b/STATUS.md @@ -30,7 +30,7 @@ The following ROM features are currently missing: Features currently being worked on: -* IEC support needs more testing ang bugfixing; alternative drive ROMs (JiffyDOS, DolphinDOS, etc) usually don't work with current implementation, `@$` leaves the drive led on, most likely other problems can be found +* IEC support needs more work; alternative drive ROMs (JiffyDOS, DolphinDOS, etc) usually don't work with current implementation, SAVE / VERIFY are not implemented, etc. # API status diff --git a/c64/kernal/ea31.interop b/c64/kernal/ea31.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/ea31.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/getin.s b/c64/kernal/f13e.getin.s similarity index 100% rename from c64/kernal/getin.s rename to c64/kernal/f13e.getin.s diff --git a/c64/kernal/f13e.interop b/c64/kernal/f13e.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/f13e.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/chrin.s b/c64/kernal/f157.chrin.s similarity index 100% rename from c64/kernal/chrin.s rename to c64/kernal/f157.chrin.s diff --git a/c64/kernal/f157.interop b/c64/kernal/f157.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/f157.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/f1ca.interop b/c64/kernal/f1ca.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/f1ca.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/f20e.interop b/c64/kernal/f20e.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/f20e.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/f250.interop b/c64/kernal/f250.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/f250.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/close.s b/c64/kernal/f291.close.s similarity index 100% rename from c64/kernal/close.s rename to c64/kernal/f291.close.s diff --git a/c64/kernal/f291.interop b/c64/kernal/f291.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/f291.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/clall.s b/c64/kernal/f32f.clall.s similarity index 100% rename from c64/kernal/clall.s rename to c64/kernal/f32f.clall.s diff --git a/c64/kernal/f32f.interop b/c64/kernal/f32f.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/f32f.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/f333.interop b/c64/kernal/f333.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/f333.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/f34a.interop b/c64/kernal/f34a.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/f34a.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/open.s b/c64/kernal/f34a.open.s similarity index 100% rename from c64/kernal/open.s rename to c64/kernal/f34a.open.s diff --git a/c64/kernal/f4a5.interop b/c64/kernal/f4a5.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/f4a5.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/load.s b/c64/kernal/f4a5.load.s similarity index 100% rename from c64/kernal/load.s rename to c64/kernal/f4a5.load.s diff --git a/c64/kernal/f5ed.interop b/c64/kernal/f5ed.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/f5ed.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/save.s b/c64/kernal/f5ed.save.s similarity index 100% rename from c64/kernal/save.s rename to c64/kernal/f5ed.save.s diff --git a/c64/kernal/f6ed.interop b/c64/kernal/f6ed.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/f6ed.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/stop.s b/c64/kernal/f6ed.stop.s similarity index 100% rename from c64/kernal/stop.s rename to c64/kernal/f6ed.stop.s diff --git a/c64/kernal/fe47.interop b/c64/kernal/fe47.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/fe47.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/fe66.interop b/c64/kernal/fe66.interop new file mode 100644 index 00000000..09ebb21a --- /dev/null +++ b/c64/kernal/fe66.interop @@ -0,0 +1,8 @@ +All the Kernal routines, for which there are vectors in $0314-$0333, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (custom IRQ routine, custom STOP routine, etc.), while others points the original Kernal routines. Different techniques modify +different vectors (while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 Kernal addresses there (for example, if the file overrides keyboard input buffer and screeen memory). + +For various cartridges (like IDE64) this just means disabling their extensions; for us that would mean improperly functionning Kernal. diff --git a/c64/kernal/vector_defaults.s b/c64/kernal/vector_defaults.s index 962cd3c5..67e7791a 100644 --- a/c64/kernal/vector_defaults.s +++ b/c64/kernal/vector_defaults.s @@ -8,19 +8,19 @@ vector_defaults: .word default_irq_handler ;; CINV - .word $0000 ;; CBINV XXX implement this - .word $0000 ;; NMINV XXX implement this + .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 - .word ckout ;; ICKOUT - .word clrchn ;; ICLRCH + .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 chrin ;; IBASIN - .word chrout ;; IBSOUT + .word chrout ;; IBSOUT XXX move routine to $F1CA - for autostart support .word stop ;; ISTOP .word getin ;; IGETIN .word clall ;; ICLALL - .word $0000 ;; USRCMD XXX implement this - .word load ;; ILOAD + .word $0000 ;; USRCMD XXX implement this, has to be $FE66 for autostart support + .word load ;; ILOAD .word save ;; ISAVE From 9187e3e601ba8982706044544080d008f05b7c5f Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Mon, 5 Aug 2019 22:51:16 +0200 Subject: [PATCH 6/6] 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