simplified some tape related code

This commit is contained in:
FeralChild64 committed 2019-12-19 22:44:50 +01:00
1 parent 42c516f44f
commit 698a66202c
4 files changed
+25 -21

No files matched your search

+1 -1
View File
@@ -135,7 +135,7 @@
.label SA = $B9 // current secondary address
.label FA = $BA // current device number
.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 MYCH = $BF // -- NOT IMPLEMENTED --
.label CAS1 = $C0 // tape motor interlock
+12 -11
View File
@@ -61,25 +61,25 @@ load_tape_normal:
load_tape_normal_header:
// Read pilot and sync of the first header
jsr tape_normal_pilot
ldy #$89
jsr tape_normal_sync
bcs load_tape_normal_header
ldy #$10
ldy #$00
// 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
sta (TAPE1), y
iny
cpy #$14
bne !+
ldy #$00
!:
cpy #$10
cpy #$15
bne load_tape_normal_header_loop
// 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
lda TAPE1+$10
ldy #$00
lda (TAPE1),y
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
@@ -109,11 +111,10 @@ load_tape_normal_header_loop: // this strange loop puts metadata after
// 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
!:
+9 -6
View File
@@ -8,6 +8,8 @@
// 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
@@ -38,24 +40,25 @@ load_tape_turbo_header:
// 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
// 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
jsr tape_turbo_sync_header
ldy #$10
ldy #$01 // to match original ROM header layout
// FALLTROUGH
load_tape_turbo_header_loop: // this strange loop puts metadata after file name
load_tape_turbo_header_loop:
jsr tape_turbo_get_byte
sta (TAPE1), y
iny
cpy #$15
cpy #$05
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
// Handle the header
+3 -3
View File
@@ -147,12 +147,12 @@ tape_handle_header:
ldx #__MSG_KERNAL_FOUND
jsr print_kernal_message
ldy #$00
ldy #$05
!:
lda (TAPE1), y
jsr JCHROUT
iny
cpy #$10
cpy #$15
bne !-
// Header, wait for user decision
@@ -167,7 +167,7 @@ tape_handle_header:
// Setup STAL and EAL
ldy #$10
ldy #$01
lda (TAPE1), y
sta STAL+0