simplified some tape related code
This commit is contained in:
1 parent
42c516f44f
commit
698a66202c
4 files changed
+25
-21
No files matched your search
@@ -135,7 +135,7 @@
|
|||||||
.label SA = $B9 // current secondary address
|
.label SA = $B9 // current secondary address
|
||||||
.label FA = $BA // current device number
|
.label FA = $BA // current device number
|
||||||
.label FNADDR = $BB // $BB-$BC current file name pointer
|
.label FNADDR = $BB // $BB-$BC current file name pointer
|
||||||
.label ROPRTY = $BD // tape / RS-232 temporary storage
|
.label ROPRTY = $BD // -- NOT IMPLEMENTED -- tape / RS-232 temporary storage
|
||||||
.label FSBLK = $BE // -- NOT IMPLEMENTED --
|
.label FSBLK = $BE // -- NOT IMPLEMENTED --
|
||||||
.label MYCH = $BF // -- NOT IMPLEMENTED --
|
.label MYCH = $BF // -- NOT IMPLEMENTED --
|
||||||
.label CAS1 = $C0 // tape motor interlock
|
.label CAS1 = $C0 // tape motor interlock
|
||||||
|
|||||||
@@ -61,25 +61,25 @@ load_tape_normal:
|
|||||||
|
|
||||||
load_tape_normal_header:
|
load_tape_normal_header:
|
||||||
|
|
||||||
|
// Read pilot and sync of the first header
|
||||||
|
|
||||||
jsr tape_normal_pilot
|
jsr tape_normal_pilot
|
||||||
ldy #$89
|
ldy #$89
|
||||||
jsr tape_normal_sync
|
jsr tape_normal_sync
|
||||||
bcs load_tape_normal_header
|
bcs load_tape_normal_header
|
||||||
|
|
||||||
ldy #$10
|
ldy #$00
|
||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
|
|
||||||
load_tape_normal_header_loop: // this strange loop puts metadata after file name
|
load_tape_normal_header_loop:
|
||||||
|
|
||||||
|
// Read the header
|
||||||
|
|
||||||
jsr tape_normal_get_byte // XXX handle errors
|
jsr tape_normal_get_byte // XXX handle errors
|
||||||
sta (TAPE1), y
|
sta (TAPE1), y
|
||||||
iny
|
iny
|
||||||
cpy #$14
|
cpy #$15
|
||||||
bne !+
|
|
||||||
ldy #$00
|
|
||||||
!:
|
|
||||||
cpy #$10
|
|
||||||
bne load_tape_normal_header_loop
|
bne load_tape_normal_header_loop
|
||||||
|
|
||||||
// Read pilot and sync of the second header
|
// Read pilot and sync of the second header
|
||||||
@@ -98,9 +98,11 @@ load_tape_normal_header_loop: // this strange loop puts metadata after
|
|||||||
|
|
||||||
// For now only one type of header is supported
|
// For now only one type of header is supported
|
||||||
|
|
||||||
lda TAPE1+$10
|
ldy #$00
|
||||||
|
lda (TAPE1),y
|
||||||
|
|
||||||
cmp #$01
|
cmp #$01
|
||||||
bne load_tape_normal_header // XXX also handle other header types
|
bne load_tape_normal_header // XXX also handle other header types, see Mapping the C64 page 77
|
||||||
|
|
||||||
// Handle the header
|
// Handle the header
|
||||||
|
|
||||||
@@ -109,11 +111,10 @@ load_tape_normal_header_loop: // this strange loop puts metadata after
|
|||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
|
|
||||||
|
load_tape_normal_payload:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lda #$00
|
|
||||||
sta ROPRTY // initialize EOR checksum XXX is it needed here?
|
|
||||||
|
|
||||||
// XXX replace this placeholder with a real routine
|
// XXX replace this placeholder with a real routine
|
||||||
!:
|
!:
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
|
|
||||||
// XXX use calibration bits to improve reading
|
// XXX use calibration bits to improve reading
|
||||||
|
// XXX find out how to use B0 tape timing
|
||||||
|
// XXX put header type into (TAPE1)
|
||||||
|
|
||||||
|
|
||||||
#if CONFIG_TAPE_TURBO
|
#if CONFIG_TAPE_TURBO
|
||||||
@@ -38,24 +40,25 @@ load_tape_turbo_header:
|
|||||||
// 1 byte (skipped) - file type (0 = data, odd value = relocatable, even value = non-relocatable)
|
// 1 byte (skipped) - file type (0 = data, odd value = relocatable, even value = non-relocatable)
|
||||||
// 2 bytes - start address
|
// 2 bytes - start address
|
||||||
// 2 bytes - end address + 1
|
// 2 bytes - end address + 1
|
||||||
// 1 byte - if $0B (tape timing) contained at the time of saving
|
// 1 byte - if $B0 (tape timing) contained at the time of saving
|
||||||
|
// (we skip this one to match normal system header)
|
||||||
// 16 bytes - filename, padded with 0x20
|
// 16 bytes - filename, padded with 0x20
|
||||||
|
|
||||||
jsr tape_turbo_sync_header
|
jsr tape_turbo_sync_header
|
||||||
ldy #$10
|
ldy #$01 // to match original ROM header layout
|
||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
|
|
||||||
load_tape_turbo_header_loop: // this strange loop puts metadata after file name
|
load_tape_turbo_header_loop:
|
||||||
|
|
||||||
jsr tape_turbo_get_byte
|
jsr tape_turbo_get_byte
|
||||||
sta (TAPE1), y
|
sta (TAPE1), y
|
||||||
iny
|
iny
|
||||||
cpy #$15
|
cpy #$05
|
||||||
bne !+
|
bne !+
|
||||||
ldy #$00
|
jsr tape_turbo_get_byte // tape timing - skip this XXX how to use it?
|
||||||
!:
|
!:
|
||||||
cpy #$10
|
cpy #$15
|
||||||
bne load_tape_turbo_header_loop
|
bne load_tape_turbo_header_loop
|
||||||
|
|
||||||
// Handle the header
|
// Handle the header
|
||||||
|
|||||||
@@ -147,12 +147,12 @@ tape_handle_header:
|
|||||||
ldx #__MSG_KERNAL_FOUND
|
ldx #__MSG_KERNAL_FOUND
|
||||||
jsr print_kernal_message
|
jsr print_kernal_message
|
||||||
|
|
||||||
ldy #$00
|
ldy #$05
|
||||||
!:
|
!:
|
||||||
lda (TAPE1), y
|
lda (TAPE1), y
|
||||||
jsr JCHROUT
|
jsr JCHROUT
|
||||||
iny
|
iny
|
||||||
cpy #$10
|
cpy #$15
|
||||||
bne !-
|
bne !-
|
||||||
|
|
||||||
// Header, wait for user decision
|
// Header, wait for user decision
|
||||||
@@ -167,7 +167,7 @@ tape_handle_header:
|
|||||||
|
|
||||||
// Setup STAL and EAL
|
// Setup STAL and EAL
|
||||||
|
|
||||||
ldy #$10
|
ldy #$01
|
||||||
lda (TAPE1), y
|
lda (TAPE1), y
|
||||||
sta STAL+0
|
sta STAL+0
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user