cleanup in tape support code
This commit is contained in:
1 parent
ade6cecbb3
commit
94a0338ee7
5 files changed
+21
-31
No files matched your search
@@ -52,7 +52,7 @@
|
||||
#define CONFIG_TAPE_TURBO
|
||||
// #define CONFIG_TAPE_NO_KEY_SENSE
|
||||
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
|
||||
#define CONFIG_TAPE_NO_ERROR_CORRECTION
|
||||
// #define CONFIG_TAPE_NO_ERROR_CORRECTION
|
||||
|
||||
|
||||
// Multiple SID support
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#define CONFIG_TAPE_TURBO
|
||||
// #define CONFIG_TAPE_NO_KEY_SENSE
|
||||
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
|
||||
#define CONFIG_TAPE_NO_ERROR_CORRECTION
|
||||
// #define CONFIG_TAPE_NO_ERROR_CORRECTION
|
||||
|
||||
|
||||
// Multiple SID support
|
||||
|
||||
@@ -70,8 +70,13 @@ load_tape_normal_header:
|
||||
jsr tape_normal_get_data_1
|
||||
bcs load_tape_normal_header // unable to read block, try again XXX jump to turbo detection
|
||||
|
||||
#if CONFIG_TAPE_NO_ERROR_CORRECTION
|
||||
lda RIPRTY
|
||||
cmp #$01 // sets Carry if checksum verification fails
|
||||
#else
|
||||
jsr load_TAPE1_to_MEMUSS
|
||||
jsr tape_normal_get_data_2
|
||||
#endif
|
||||
bcs load_tape_normal_header // block load error, try again XXX jump to turbo detection
|
||||
|
||||
// Check header type
|
||||
@@ -110,8 +115,13 @@ load_tape_normal_payload:
|
||||
jsr lvs_check_EAL
|
||||
bne_16 tape_load_error // amount of data read does not match header info
|
||||
|
||||
#if CONFIG_TAPE_NO_ERROR_CORRECTION
|
||||
lda RIPRTY
|
||||
cmp #$01 // sets Carry if checksum verification fails
|
||||
#else
|
||||
jsr lvs_STAL_to_MEMUSS
|
||||
jsr tape_normal_get_data_2
|
||||
#endif
|
||||
bcs_16 tape_load_error
|
||||
|
||||
jmp tape_load_success
|
||||
|
||||
@@ -7,21 +7,7 @@
|
||||
//
|
||||
|
||||
|
||||
#if CONFIG_TAPE_NORMAL
|
||||
|
||||
#if CONFIG_TAPE_NO_ERROR_CORRECTION
|
||||
|
||||
|
||||
tape_normal_get_data_2: // XXX implement under separate name
|
||||
|
||||
// Just validate the checksum
|
||||
|
||||
lda RIPRTY
|
||||
cmp #$01
|
||||
rts
|
||||
|
||||
|
||||
#else
|
||||
#if CONFIG_TAPE_NORMAL && !CONFIG_TAPE_NO_ERROR_CORRECTION
|
||||
|
||||
|
||||
tape_normal_get_data_2:
|
||||
@@ -42,6 +28,11 @@ tape_normal_get_data_2:
|
||||
|
||||
tape_normal_get_data_2_loop:
|
||||
|
||||
// Check if there are missing bytes to read
|
||||
lda PTR1
|
||||
cmp PTR2
|
||||
beq tape_normal_get_data_2_log_checksum // branch if no more errors to correct
|
||||
|
||||
// Read missing bytes
|
||||
|
||||
jsr tape_normal_get_byte
|
||||
@@ -106,16 +97,8 @@ tape_normal_get_data_2_done:
|
||||
rts
|
||||
|
||||
|
||||
|
||||
load_cmp_log_MEMUSS:
|
||||
|
||||
lda PTR1 // XXX this comparison can be probably moved somewhere else
|
||||
cmp PTR2
|
||||
bne !+
|
||||
|
||||
lda #$01 // to clear Zero flag
|
||||
rts
|
||||
!:
|
||||
ldx PTR2
|
||||
lda STACK+0, x
|
||||
cmp MEMUSS+0
|
||||
@@ -135,6 +118,3 @@ load_cmp_log_MEMUSS:
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user