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
@@ -147,13 +147,13 @@ Causes screen blanking during JiffyDOS file loading to increase performance.
|
||||
|
||||
Adds a minimal normal (standard Commodore format) tape support - just LOAD command.
|
||||
|
||||
Needs about 700 bytes in KERNAL segment (if both normal and turbo are enabled, about 900 bytes are needed, as they share some code). If unsure - enable.
|
||||
Needs about 850 bytes in KERNAL segment (if both normal and turbo are enabled, about 900 bytes are needed, as they share some code). If unsure - enable.
|
||||
|
||||
### `CONFIG_TAPE_TURBO`
|
||||
|
||||
Adds a minimal turbo tape support - just LOAD command (device 7, like on _Action Replay_ and _Final_ cartridges), up to 250 blocks
|
||||
|
||||
Needs about 700 bytes in KERNAL segment (if both normal and turbo are enabled, about 950 bytes are needed, as they share some code). If unsure - enable.
|
||||
Needs about 700 bytes in KERNAL segment (if both normal and turbo are enabled, about 1050 bytes are needed, as they share some code). If unsure - enable.
|
||||
|
||||
### `CONFIG_TAPE_NO_KEY_SENSE`
|
||||
|
||||
@@ -167,7 +167,7 @@ Enable this option if you are using a tape interface adapter lacking tape motor
|
||||
|
||||
Normal tape format contains two copies of each data block - in case some bytes from the first one are damaged, they can be corrected by reading them from the second copy. Enabling this option omits the core to read the second block.
|
||||
|
||||
If using real magnetic tape - disable. Enable if only using Tapuino or other tape emulators.
|
||||
If used with `CONFIG_TAPE_NORMAL`, saves about 125 bytes in KERNAL segment. Not recommended when using real magnetic tapes.
|
||||
|
||||
## 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
|
||||
|
||||
@@ -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