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
|
.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)
|
#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"
|
.error "CONFIG_LEGACY_SCNKEY and CONFIG_KEYBOARD_C128* / CONFIG_KEYBOARD_C65* are mutually exclusive"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -206,7 +206,7 @@
|
|||||||
.label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551
|
.label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551
|
||||||
.label M51CDR = $294 // -- NOT IMPLEMENTED -- mock 6551
|
.label M51CDR = $294 // -- NOT IMPLEMENTED -- mock 6551
|
||||||
.label M51AJB = $295 // $295-$296 -- 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 BITNUM = $298 // -- NOT IMPLEMENTED --
|
||||||
.label BAUDOF = $299 // $299-$29A -- NOT IMPLEMENTED --
|
.label BAUDOF = $299 // $299-$29A -- NOT IMPLEMENTED --
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
// XXX use calibration bits to improve reading
|
// XXX use calibration bits to improve reading
|
||||||
// XXX handle load address from Kernal API
|
// XXX handle load address from Kernal API
|
||||||
// XXX finish pattern matching
|
|
||||||
|
|
||||||
|
|
||||||
#if CONFIG_TAPE_TURBO
|
#if CONFIG_TAPE_TURBO
|
||||||
@@ -30,17 +29,31 @@ load_tape_turbo:
|
|||||||
|
|
||||||
load_tape_turbo_header:
|
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
|
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
|
jsr tape_turbo_get_byte
|
||||||
sta (TAPE1), y
|
sta (TAPE1), y
|
||||||
iny
|
iny
|
||||||
cpy #$15
|
cpy #$15
|
||||||
bne !-
|
bne !+
|
||||||
|
ldy #$00
|
||||||
|
!:
|
||||||
|
cpy #$10
|
||||||
|
bne load_tape_turbo_header_loop
|
||||||
|
|
||||||
jsr tape_handle_header
|
jsr tape_handle_header
|
||||||
bcs load_tape_turbo_header // if name does not match, look for other 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
|
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
|
// Print FOUND + file name
|
||||||
|
|
||||||
ldx #__MSG_KERNAL_FOUND
|
ldx #__MSG_KERNAL_FOUND
|
||||||
jsr print_kernal_message
|
jsr print_kernal_message
|
||||||
|
|
||||||
ldy #$05
|
ldy #$00
|
||||||
!:
|
!:
|
||||||
lda (TAPE1), y
|
lda (TAPE1), y
|
||||||
jsr JCHROUT
|
jsr JCHROUT
|
||||||
iny
|
iny
|
||||||
cpy #$15
|
cpy #$10
|
||||||
bne !-
|
bne !-
|
||||||
jsr print_return
|
jsr print_return
|
||||||
|
|
||||||
@@ -152,13 +143,12 @@ tape_handle_header:
|
|||||||
|
|
||||||
// Check if file name matches
|
// Check if file name matches
|
||||||
|
|
||||||
/* XXX does not work yet
|
|
||||||
jsr tape_match_filename
|
jsr tape_match_filename
|
||||||
bcs tape_handle_header_skip
|
bcs tape_handle_header_skip
|
||||||
*/
|
|
||||||
// Setup STAL and EAL
|
// Setup STAL and EAL
|
||||||
|
|
||||||
ldy #$00
|
ldy #$10
|
||||||
lda (TAPE1), y
|
lda (TAPE1), y
|
||||||
sta STAL+0
|
sta STAL+0
|
||||||
|
|
||||||
@@ -206,26 +196,25 @@ tape_return_not_ok:
|
|||||||
//
|
//
|
||||||
// Check whether file name matches the pattern
|
// Check whether file name matches the pattern
|
||||||
//
|
//
|
||||||
/* XXX does not work yet
|
|
||||||
tape_match_filename:
|
tape_match_filename:
|
||||||
|
|
||||||
lda FNLEN
|
lda FNLEN
|
||||||
beq tape_return_ok // no pattern to match
|
beq tape_return_ok // no pattern to match
|
||||||
|
|
||||||
ldy $00
|
ldy #$00
|
||||||
|
|
||||||
tape_match_loop:
|
tape_match_loop:
|
||||||
|
|
||||||
lda #$20 // default byte, for padding
|
lda #$20 // default byte, for padding
|
||||||
cpy FNLEN
|
cpy FNLEN
|
||||||
beq !+ // end of pattern
|
bcs !+ // end of pattern
|
||||||
lda (FNADDR), y // byte from pattern
|
lda (FNADDR), y // byte from pattern
|
||||||
!:
|
!:
|
||||||
.break
|
|
||||||
cmp #KEY_ASTERISK
|
cmp #KEY_ASTERISK
|
||||||
beq tape_return_ok
|
beq tape_return_ok
|
||||||
|
|
||||||
cmp (TAPE1 + 5),y
|
cmp (TAPE1), y
|
||||||
bne tape_return_not_ok
|
bne tape_return_not_ok
|
||||||
|
|
||||||
iny
|
iny
|
||||||
@@ -234,7 +223,7 @@ tape_match_loop:
|
|||||||
|
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*/
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get user decision whether to load the file or not
|
// Get user decision whether to load the file or not
|
||||||
|
|||||||
Reference in new issue
Block a user