fixed tape filename pattern matching
This commit is contained in:
1 parent
b076e3ccd0
commit
4a1351de4c
4 files changed
+31
-26
No files matched your search
@@ -163,6 +163,9 @@
|
||||
.return 0
|
||||
}
|
||||
{
|
||||
#if CONFIG_LEGACY_SCNKEY && CONFIG_RS232_UP9600
|
||||
.error "CONFIG_LEGACY_SCNKEY is not compatible with CONFIG_RS232_UP9600"
|
||||
#endif
|
||||
#if CONFIG_LEGACY_SCNKEY && (CONFIG_KEYBOARD_C128 || CONFIG_KEYBOARD_C128_CAPS_LOCK || CONFIG_KEYBOARD_C65 || CONFIG_KEYBOARD_C65_CAPS_LOCK)
|
||||
.error "CONFIG_LEGACY_SCNKEY and CONFIG_KEYBOARD_C128* / CONFIG_KEYBOARD_C65* are mutually exclusive"
|
||||
#endif
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
.label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551
|
||||
.label M51CDR = $294 // -- NOT IMPLEMENTED -- mock 6551
|
||||
.label M51AJB = $295 // $295-$296 -- NOT IMPLEMENTED -- mock 6551
|
||||
.label RSSTAT = $297 // -- WIP -- mock 6551, RS-232 status
|
||||
.label RSSTAT = $297 // -- WIP -- (UP9600 only) mock 6551, RS-232 status
|
||||
.label BITNUM = $298 // -- NOT IMPLEMENTED --
|
||||
.label BAUDOF = $299 // $299-$29A -- NOT IMPLEMENTED --
|
||||
#endif
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
// XXX use calibration bits to improve reading
|
||||
// XXX handle load address from Kernal API
|
||||
// XXX finish pattern matching
|
||||
|
||||
|
||||
#if CONFIG_TAPE_TURBO
|
||||
@@ -30,17 +29,31 @@ load_tape_turbo:
|
||||
|
||||
load_tape_turbo_header:
|
||||
|
||||
// Read file header
|
||||
// Read file header; structure described here:
|
||||
// - https://www.luigidifraia.com/c64/docs/tapeloaders.html#turbotape64
|
||||
//
|
||||
// 1 byte (skipped) - file type (0 = data, odd value = relocatable, even value = non-relocatable)
|
||||
// 2 bytes - start address
|
||||
// 2 bytes - end address + 1
|
||||
// 1 byte - if $0B (tape timing) contained at the time of saving
|
||||
// 16 bytes - filename, padded with 0x20
|
||||
|
||||
jsr tape_turbo_sync_header
|
||||
ldy #$10
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
load_tape_turbo_header_loop: // this strange loop puts metadata after file name
|
||||
|
||||
ldy #$00
|
||||
!:
|
||||
jsr tape_turbo_get_byte
|
||||
sta (TAPE1), y
|
||||
iny
|
||||
cpy #$15
|
||||
bne !-
|
||||
bne !+
|
||||
ldy #$00
|
||||
!:
|
||||
cpy #$10
|
||||
bne load_tape_turbo_header_loop
|
||||
|
||||
jsr tape_handle_header
|
||||
bcs load_tape_turbo_header // if name does not match, look for other header
|
||||
|
||||
@@ -122,26 +122,17 @@ tape_handle_header:
|
||||
|
||||
jsr tape_screen_show_motor_off
|
||||
|
||||
// Header structure described here:
|
||||
// - https://www.luigidifraia.com/c64/docs/tapeloaders.html#turbotape64
|
||||
//
|
||||
// 1 byte (skipped) - file type (0 = data, odd value = relocatable, even value = non-relocatable)
|
||||
// 2 bytes - start address
|
||||
// 2 bytes - end address + 1
|
||||
// 1 byte - if $0B (tape timing) contained at the time of saving
|
||||
// 16 bytes - filename, padded with 0x20
|
||||
|
||||
// Print FOUND + file name
|
||||
|
||||
ldx #__MSG_KERNAL_FOUND
|
||||
jsr print_kernal_message
|
||||
|
||||
ldy #$05
|
||||
ldy #$00
|
||||
!:
|
||||
lda (TAPE1), y
|
||||
jsr JCHROUT
|
||||
iny
|
||||
cpy #$15
|
||||
cpy #$10
|
||||
bne !-
|
||||
jsr print_return
|
||||
|
||||
@@ -152,13 +143,12 @@ tape_handle_header:
|
||||
|
||||
// Check if file name matches
|
||||
|
||||
/* XXX does not work yet
|
||||
jsr tape_match_filename
|
||||
bcs tape_handle_header_skip
|
||||
*/
|
||||
|
||||
// Setup STAL and EAL
|
||||
|
||||
ldy #$00
|
||||
ldy #$10
|
||||
lda (TAPE1), y
|
||||
sta STAL+0
|
||||
|
||||
@@ -206,26 +196,25 @@ tape_return_not_ok:
|
||||
//
|
||||
// Check whether file name matches the pattern
|
||||
//
|
||||
/* XXX does not work yet
|
||||
|
||||
tape_match_filename:
|
||||
|
||||
lda FNLEN
|
||||
beq tape_return_ok // no pattern to match
|
||||
|
||||
ldy $00
|
||||
ldy #$00
|
||||
|
||||
tape_match_loop:
|
||||
|
||||
lda #$20 // default byte, for padding
|
||||
cpy FNLEN
|
||||
beq !+ // end of pattern
|
||||
bcs !+ // end of pattern
|
||||
lda (FNADDR), y // byte from pattern
|
||||
!:
|
||||
.break
|
||||
cmp #KEY_ASTERISK
|
||||
beq tape_return_ok
|
||||
|
||||
cmp (TAPE1 + 5),y
|
||||
cmp (TAPE1), y
|
||||
bne tape_return_not_ok
|
||||
|
||||
iny
|
||||
@@ -234,7 +223,7 @@ tape_match_loop:
|
||||
|
||||
clc
|
||||
rts
|
||||
*/
|
||||
|
||||
|
||||
//
|
||||
// Get user decision whether to load the file or not
|
||||
|
||||
Reference in new issue
Block a user