more work on reading second copy from tape, some cleanup

This commit is contained in:
FeralChild64 committed 2020-01-25 21:08:05 +01:00
1 parent 28a96a7ffc
commit 92c8a9d03d
11 files changed
+84 -36

No files matched your search

+17 -5
View File
@@ -60,15 +60,17 @@ load_tape_normal_takeover: // entry point for turbo->normal takeover
load_tape_normal_header:
jsr load_MEMUSS_to_STAL
// Try to load header into tape buffer (we will restore MEMUSS later)
jsr tape_normal_get_pilot_header
jsr load_tape_normal_buf_MEMUSS
jsr load_TAPE1_to_MEMUSS
jsr tape_normal_get_data_1
bcs load_tape_normal_header // unable to read block, try again XXX jump to turbo detection
jsr load_tape_normal_buf_MEMUSS
jsr load_TAPE1_to_MEMUSS
jsr tape_normal_get_data_2
bcs load_tape_normal_header // block load error, try again XXX jump to turbo detection
@@ -90,7 +92,7 @@ load_tape_normal_header:
!:
// Restore MEMUSS, handle header
jsr lvs_setup_MEMUSS
jsr lvs_STAL_to_MEMUSS
jsr tape_handle_header
bcs load_tape_normal_header // if name does not match, look for other header
@@ -108,14 +110,15 @@ load_tape_normal_payload:
jsr lvs_check_EAL
bne_16 tape_load_error // amount of data read does not match header info
// XXX setup MEMUSS once again
jsr lvs_STAL_to_MEMUSS
jsr tape_normal_get_data_2
bcs_16 tape_load_error
jmp tape_load_success
load_tape_normal_buf_MEMUSS: // set MEMUSS (start address) as tape buffer
load_TAPE1_to_MEMUSS: // set MEMUSS (start address) as tape buffer
lda TAPE1+1
sta MEMUSS+1
@@ -124,5 +127,14 @@ load_tape_normal_buf_MEMUSS: // set MEMUSS (start address) as tape buf
rts
load_MEMUSS_to_STAL: // preserve MEMUSS
lda MEMUSS+1
sta STAL+1
lda MEMUSS+0
sta STAL+0
rts
#endif
+2 -2
View File
@@ -160,7 +160,7 @@ tape_handle_header:
sbc STAL+1
sta EAL+1
// STAL = MEMUSS XXX is it needed?
// STAL = MEMUSS
lda MEMUSS+0
sta STAL+0
@@ -179,7 +179,7 @@ tape_handle_header:
!:
// Setup MEMUSS (see Mapping the C64, page 36)
jsr lvs_setup_MEMUSS
jsr lvs_STAL_to_MEMUSS
// Print LOADING and start address
+44 -3
View File
@@ -9,13 +9,20 @@
#if CONFIG_TAPE_NORMAL
tape_normal_get_data_2:
lda RIPRTY
cmp #$01
rts
#elif DISABLED_DISABLED
tape_normal_get_data_2:
// First check if there is a need to read anything
lda PTR1
beq tape_normal_get_data_2_checksum
// XXX lda PTR1
// XXX beq tape_normal_get_data_2_checksum
// Read sync of the block
@@ -28,7 +35,32 @@ tape_normal_get_data_2:
tape_normal_get_data_2_loop:
// XXX read missing bytes
// Read missing bytes
jsr tape_normal_get_byte
bcc tape_normal_get_data_2_loop_byte_OK
// Problem reading byte
jsr load_cmp_log_MEMUSS
bne tape_normal_get_data_2_loop_advance
sec
rts
tape_normal_get_data_2_loop_byte_OK:
jsr load_cmp_log_MEMUSS
bne tape_normal_get_data_2_loop_advance
// This is a byte from the log
// XXX store correct byte
tape_normal_get_data_2_loop_advance:
// XXX finish the implementation
sec
rts
@@ -48,4 +80,13 @@ tape_normal_get_data_2_done:
rts
load_cmp_log_MEMUSS:
// XXX
!:
rts
#endif