tape wedge now accepts file name
This commit is contained in:
1 parent
01775af002
commit
3b11d1b881
5 files changed
+106
-42
No files matched your search
@@ -285,9 +285,9 @@ Feature needs about 330 bytes in BASIC segment. If unsure - enable.
|
||||
|
||||
### `CONFIG_TAPE_WEDGE`
|
||||
|
||||
If enabled, a simple DOS wedge is available from the direct mode for tape loading - supports `←L` only.
|
||||
If enabled, a simple DOS wedge is available from the direct mode for tape loading - supports `←L` only, optionally with a file name.
|
||||
|
||||
Feature needs few bytes in BASIC segment. If unsure - enable.
|
||||
Feature needs several bytes in BASIC segment. If unsure - enable.
|
||||
|
||||
### `CONFIG_TAPE_HEAD_ALIGN`
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Here are the features of the Open ROMs not found in the original ROMs from the 8
|
||||
* DOS wedge (direct mode only) - `@<drive_number>`, `@<command>`, `@$`, `@$<params>`, `@`
|
||||
* BASIC extensions, see the [documentation](doc/Extended-BASIC.md)
|
||||
|
||||
* turbo tape load support (as device 7, or using `←L`), quite sophisticated: up to 250 blocks (can store bytes under I/O), automatically adjusts for tape speed differences
|
||||
* turbo tape load support (as device 7, or using `←L`, optionallly with a file name), quite sophisticated: up to 250 blocks (can store bytes under I/O), automatically adjusts for tape speed differences
|
||||
* normal tape load error log is limited by free stack space only (no artificial limitation like in original ROMs)
|
||||
* tape format autodetection; normal vs turbo is mostly transparent to user
|
||||
* improved support for tape adapters (for using regular casette players and other audio devices instead of Datasette) and emulators
|
||||
|
||||
+11
-19
@@ -37,7 +37,10 @@ shell_got_line:
|
||||
|
||||
// Store length of input buffer ready for tokenising
|
||||
stx __tokenise_work1
|
||||
// XXX we should probably store 0 at the end of used BUF
|
||||
|
||||
// Store 0 as the sentinel
|
||||
lda #$00
|
||||
sta BUF, x
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
@@ -76,10 +79,13 @@ shell_process_line:
|
||||
|
||||
// Check if a wedge should take over
|
||||
|
||||
#if CONFIG_DOS_WEDGE
|
||||
|
||||
ldx __tokenise_work1 // size of the input, DOS wedges needs this XXX this should not be needed
|
||||
|
||||
#endif
|
||||
#if CONFIG_DOS_WEDGE || CONFIG_TAPE_WEDGE
|
||||
|
||||
ldx __tokenise_work1 // size of the input, wedges need this XXX this should not be needed
|
||||
|
||||
// Check if DOS wedge should take over
|
||||
lda BUF
|
||||
|
||||
@@ -170,20 +176,6 @@ shell_add_delete_line:
|
||||
|
||||
shell_execute_line:
|
||||
|
||||
// Setup pointer to the statement
|
||||
lda #<BUF
|
||||
sta TXTPTR+0
|
||||
lda #>BUF
|
||||
sta TXTPTR+1
|
||||
|
||||
// There is no stored line, so zero that pointer out
|
||||
lda #$00
|
||||
sta OLDTXT+0
|
||||
sta OLDTXT+1
|
||||
|
||||
// Put invalid line number in current line number value,
|
||||
// so that we know we are in direct mode (Computes Mapping the 64 p19)
|
||||
lda #$FF
|
||||
sta CURLIN+1
|
||||
|
||||
jsr prepare_direct_execution
|
||||
jmp execute_statements
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Prepare interpreter to execute commands in direct mode
|
||||
//
|
||||
|
||||
prepare_direct_execution:
|
||||
|
||||
// Setup pointer to the statement
|
||||
lda #<BUF
|
||||
sta TXTPTR+0
|
||||
lda #>BUF
|
||||
sta TXTPTR+1
|
||||
|
||||
// There is no stored line, so zero that pointer out
|
||||
lda #$00
|
||||
sta OLDTXT+0
|
||||
sta OLDTXT+1
|
||||
|
||||
// Put invalid line number in current line number value,
|
||||
// so that we know we are in direct mode (Computes Mapping the 64 p19)
|
||||
lda #$FF
|
||||
sta CURLIN+1
|
||||
|
||||
rts
|
||||
@@ -6,17 +6,16 @@
|
||||
#if CONFIG_TAPE_WEDGE
|
||||
|
||||
|
||||
// .X has to contain size of the buffer
|
||||
|
||||
wedge_tape:
|
||||
|
||||
lda #$FF
|
||||
sta CURLIN+1 // in case of error do not print line number
|
||||
// Prepare for execution
|
||||
|
||||
cpx #$02
|
||||
bne_16 do_SYNTAX_error
|
||||
jsr prepare_direct_execution
|
||||
jsr fetch_character
|
||||
|
||||
lda BUF+1
|
||||
// First character is a 'left arrow', we can ignore it - determine the command
|
||||
|
||||
jsr fetch_character
|
||||
|
||||
cmp #$4C // 'L'
|
||||
beq wedge_arrow_L
|
||||
@@ -30,12 +29,69 @@ wedge_tape:
|
||||
|
||||
jmp do_SYNTAX_error
|
||||
|
||||
#if CONFIG_TAPE_HEAD_ALIGN
|
||||
|
||||
wedge_arrow_H:
|
||||
|
||||
// Make sure the syntax is correct
|
||||
|
||||
jsr injest_spaces
|
||||
jsr fetch_character
|
||||
|
||||
cmp #$00
|
||||
bne_16 do_SYNTAX_error
|
||||
|
||||
jsr tape_head_align
|
||||
|
||||
jsr print_return
|
||||
jmp do_BREAK_error
|
||||
|
||||
#endif
|
||||
|
||||
wedge_arrow_L:
|
||||
|
||||
// Execute 'arrow + L'
|
||||
// Make sure the syntax is correct
|
||||
|
||||
jsr injest_spaces
|
||||
jsr fetch_character
|
||||
|
||||
cmp #$00
|
||||
beq wedge_arrow_L_no_filename // branch if no file name given
|
||||
cmp #$22
|
||||
bne_16 do_SYNTAX_error // branch if no opening quote
|
||||
|
||||
// Fetch the file name
|
||||
|
||||
lda TXTPTR+0
|
||||
sta FNADDR+0
|
||||
lda TXTPTR+1
|
||||
sta FNADDR+1
|
||||
|
||||
ldx #$00
|
||||
!:
|
||||
jsr fetch_character
|
||||
|
||||
cmp #$00
|
||||
beq !+
|
||||
cmp #$22
|
||||
beq !+
|
||||
|
||||
inx
|
||||
bne !-
|
||||
!:
|
||||
stx FNLEN
|
||||
|
||||
lda #$00
|
||||
sta FNLEN // default file name is empty
|
||||
beq wedge_arrow_L_got_filename
|
||||
|
||||
wedge_arrow_L_no_filename:
|
||||
|
||||
sta FNLEN // .A is 0 here, default file name is empty
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
wedge_arrow_L_got_filename: // .A has to be 0
|
||||
|
||||
sta VERCKB // operation is LOAD, not VERIFY
|
||||
|
||||
ldy #$01
|
||||
@@ -51,16 +107,5 @@ wedge_arrow_L:
|
||||
|
||||
jmp cmd_load_got_params
|
||||
|
||||
#if CONFIG_TAPE_HEAD_ALIGN
|
||||
|
||||
wedge_arrow_H:
|
||||
|
||||
jsr tape_head_align
|
||||
|
||||
jsr print_return
|
||||
jmp do_BREAK_error
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // CONFIG_TAPE_WEDGE
|
||||
Reference in new issue
Block a user