From c98407bd845a181aa1046f18d5b0511a63f5f179 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Thu, 22 Oct 2020 19:39:11 +0200 Subject: [PATCH] more tape improvements --- doc/Extended-BASIC.md | 20 ++++++++++++++------ src/basic/wedge/wedge_tape.s | 15 ++++++++++++++- src/kernal/assets/kernal_messages.s | 8 +++++--- src/kernal/board_crt/crt_imports.s | 2 +- src/kernal/board_m65/mega65_imports.s | 2 +- src/kernal/tape/tape_common.s | 2 +- 6 files changed, 36 insertions(+), 13 deletions(-) diff --git a/doc/Extended-BASIC.md b/doc/Extended-BASIC.md index eac72c6d..b82d72d2 100644 --- a/doc/Extended-BASIC.md +++ b/doc/Extended-BASIC.md @@ -1,7 +1,7 @@ # Extended BASIC -NOTE: Command syntax, behaviour details, and tokens are still subject to change! Currently the availability of some depends on the build configuration, in the future most (if not all) extended commands will be available only on machines with extended ROM, like the MEGA65 or Ultimate 64. +NOTE: Command syntax, behaviour details, and tokens are still subject to change! Currently the availability of some depends on the build configuration, in the future most (if not all) extended commands will be available only on machines with extended ROM, like the *MEGA65* or *Ultimate 64*. ## DOS Wedge @@ -29,22 +29,30 @@ Sends the DOS command to the current unit. ## Tape Wedge -The Tape Wedge commands are only available in direct mode, and they have to start from the first character of the line. +The Tape Wedge commands are only available in direct mode, and they have to start from the first character of the line. It is designed to ressemble wedge from *BlackBox* series of cartridges and several tape turbo implementations. ### `←L ["file_name"]` (all) -Loads the file from tape. Depending on the configuration, it tries to load the file in TurboTape 64 format, in the standard CBM format, or autodetects the file format. +Loads the file from tape. Depending on the configuration, it tries to load the file: +* in any format (standard/turbo) - if format autodetection is compiled in +* in *TurboTape 64* format - if turbo support is compiled in +* in the normal CBM format - if only this one is compiled in ### `←M ["file_name"]` (all) Like above, but merges a BASIC program to the one already stored in memory. -### `←H` (MEGA65, cartridge) +### `←H` or `←HF` (MEGA65, cartridge) -Launches a built-in tape head alignment tool. Destroys program in memory. Press `RUN/STOP` to terminate the tool. +Launches a built-in tape head alignment tool. Destroys program in memory. Press `RUN/STOP` to terminate the tool. `←HF` is for compatibility with the *BlackBox v3/v4/v8* cartridges. ## Additional BASIC commands - I/O +### Device numbers + +* if tape format autodetection is compiled-in, you can load file from tape using either device #1 (CBM compatible way) or from device #7 (in a way compatible with *Final* and *Action Replay* cartridges) +* if autodetection is not available, than device #1 means normal CBM format, and device #7 means *Turbo Tape 64* format + ### `MERGE "file_name" [, device_number]` (all) Appends the BASIC program from a storage medium to the one currently present in memory. @@ -106,4 +114,4 @@ Switches machine to C64 compatibility mode or to MEGA65 native mode. Performs `C ### `IF MEGA65 THEN`, `IF MEGA65 GOTO` (MEGA65) -Special check for running under MEGA65. The `MEGA65` string is not tokenized, therefore it will be listed properly even under original BASIC V2. `MEGA65` is not a variable here - it is still possible to normally use the `ME` variable. +Special check for running on *MEGA65* motherboard. The `MEGA65` string is not tokenized, therefore it will be listed properly even under original BASIC V2. `MEGA65` is not a variable here - it is still possible to normally use the `ME` variable. diff --git a/src/basic/wedge/wedge_tape.s b/src/basic/wedge/wedge_tape.s index dfa2478e..54926c89 100644 --- a/src/basic/wedge/wedge_tape.s +++ b/src/basic/wedge/wedge_tape.s @@ -28,6 +28,10 @@ wedge_tape: beq wedge_arrow_H } + ; FALLTROUGH + +wedge_tape_syntax_error: + jmp do_SYNTAX_error !ifdef CONFIG_TAPE_HEAD_ALIGN { @@ -39,7 +43,16 @@ wedge_arrow_H: jsr fetch_character_skip_spaces cmp #$00 - +bne do_SYNTAX_error + beq wedge_arrow_H_or_HF + cmp #$46 ; 'F' + bne wedge_tape_syntax_error + + jsr fetch_character_skip_spaces + + cmp #$00 + bne wedge_tape_syntax_error + +wedge_arrow_H_or_HF: jsr tape_head_align diff --git a/src/kernal/assets/kernal_messages.s b/src/kernal/assets/kernal_messages.s index 7504e91d..6eb9fb56 100644 --- a/src/kernal/assets/kernal_messages.s +++ b/src/kernal/assets/kernal_messages.s @@ -19,7 +19,7 @@ !ifdef HAS_TAPE { !addr __MSG_KERNAL_PRESS_PLAY = __msg_kernalplay - __msg_kernal_first !addr __MSG_KERNAL_FOUND = __msg_kernalfound - __msg_kernal_first -!addr __MSG_KERNAL_OK = __msg_kernalok - __msg_kernal_first +!addr __MSG_KERNAL_OK_SEARCH = __msg_kernaloksearch - __msg_kernal_first } !ifdef CONFIG_PANIC_SCREEN { @@ -69,9 +69,11 @@ __msg_kernalfound: !pet "found" !byte $80 + $20 ; end of string mark + space -__msg_kernalok: +__msg_kernaloksearch: !pet "ok" - !byte $80 + $0D ; end of string mark + return + !byte $0D, $0D + !pet "searchin" + !byte $80 + $47 ; end of string mark + 'G' } !ifdef CONFIG_PANIC_SCREEN { diff --git a/src/kernal/board_crt/crt_imports.s b/src/kernal/board_crt/crt_imports.s index 3da1707e..dd21e1cd 100644 --- a/src/kernal/board_crt/crt_imports.s +++ b/src/kernal/board_crt/crt_imports.s @@ -40,7 +40,7 @@ ;; #ALIAS# print_return = KERNAL_0.proxy_K1_print_return ;; #ALIAS# __MSG_KERNAL_PRESS_PLAY = KERNAL_0.__MSG_KERNAL_PRESS_PLAY -;; #ALIAS# __MSG_KERNAL_OK = KERNAL_0.__MSG_KERNAL_OK +;; #ALIAS# __MSG_KERNAL_OK_SEARCH = KERNAL_0.__MSG_KERNAL_OK_SEARCH ;; #ALIAS# __MSG_KERNAL_FOUND = KERNAL_0.__MSG_KERNAL_FOUND ;; #ALIAS# tape_normal_byte_store = KERNAL_0.tape_normal_byte_store diff --git a/src/kernal/board_m65/mega65_imports.s b/src/kernal/board_m65/mega65_imports.s index b74001ec..60a496f9 100644 --- a/src/kernal/board_m65/mega65_imports.s +++ b/src/kernal/board_m65/mega65_imports.s @@ -70,7 +70,7 @@ ;; #ALIAS# print_return = KERNAL_0.proxy_K1_print_return ;; #ALIAS# __MSG_KERNAL_PRESS_PLAY = KERNAL_0.__MSG_KERNAL_PRESS_PLAY -;; #ALIAS# __MSG_KERNAL_OK = KERNAL_0.__MSG_KERNAL_OK +;; #ALIAS# __MSG_KERNAL_OK_SEARCH = KERNAL_0.__MSG_KERNAL_OK_SEARCH ;; #ALIAS# __MSG_KERNAL_FOUND = KERNAL_0.__MSG_KERNAL_FOUND ;; #ALIAS# tape_normal_byte_store = KERNAL_0.tape_normal_byte_store diff --git a/src/kernal/tape/tape_common.s b/src/kernal/tape/tape_common.s index 2efb626f..45b4a12a 100644 --- a/src/kernal/tape/tape_common.s +++ b/src/kernal/tape/tape_common.s @@ -116,7 +116,7 @@ tape_prepare_reading: ; Display confirmation - ldx #__MSG_KERNAL_OK + ldx #__MSG_KERNAL_OK_SEARCH jsr print_kernal_message ; Prepare for reading