tape autocalibration code is dangerous on 1MHz, disable it for slower machines

This commit is contained in:
FeralChild64 committed 2020-10-22 16:32:45 +02:00
1 parent b2623f9ec8
commit 3a33a00d9d
9 files changed
+39 -9

No files matched your search

+2 -2
View File
@@ -10,7 +10,7 @@
;
!ifdef CONFIG_TAPE_NORMAL {
!ifdef CONFIG_TAPE_NORMAL { !ifdef HAS_TAPE_AUTOCALIBRATE {
tape_normal_calibrate_during_pilot: ; reecalibration during the pilot
@@ -122,4 +122,4 @@ tape_normal_calibrate_threshold_inc:
tape_normal_calibrate_done:
rts
}
} }
+8 -2
View File
@@ -22,13 +22,16 @@ tape_normal_get_bit:
; First impulse was short, second should be medium
!ifdef HAS_TAPE_AUTOCALIBRATE {
jsr tape_normal_calibrate_after_S
}
jsr tape_common_get_pulse
bcs tape_normal_get_bit_error
!ifdef HAS_TAPE_AUTOCALIBRATE {
jsr tape_normal_calibrate_after_M
}
; We have a bit '0'
lda #$00
@@ -46,13 +49,16 @@ tape_normal_get_bit_1:
; First impulse was medium, second should be short
!ifdef HAS_TAPE_AUTOCALIBRATE {
jsr tape_normal_calibrate_after_M
}
jsr tape_common_get_pulse
bcc tape_normal_get_bit_error
!ifdef HAS_TAPE_AUTOCALIBRATE {
jsr tape_normal_calibrate_after_S
}
; We have a bit '1'
clc
+4 -3
View File
@@ -32,16 +32,17 @@ tape_normal_get_marker_type:
; Not an entry point!!!
tape_normal_get_marker_while_sync_loop:
tape_normal_get_marker_while_sync__loop:
!ifdef HAS_TAPE_AUTOCALIBRATE {
jsr tape_normal_calibrate_during_pilot ; while sync use short pulses for calibration
}
; FALLTROUGH
tape_normal_get_marker_while_sync:
jsr tape_common_get_pulse
bcs tape_normal_get_marker_while_sync_loop ; branch if short pulse
bcs tape_normal_get_marker_while_sync__loop ; branch if short pulse
cmp __pulse_threshold_ML
bcs tape_normal_get_marker_while_sync ; too short for a long pulse
+2 -1
View File
@@ -96,8 +96,9 @@ tape_normal_get_pilot_common_loop_inner:
@1:
}
!ifdef HAS_TAPE_AUTOCALIBRATE {
jsr tape_normal_calibrate_during_pilot
}
dey
bne tape_normal_get_pilot_common_loop_inner
+8
View File
@@ -19,9 +19,12 @@ tape_turbo_get_bit:
jsr tape_common_get_pulse
bcs @1
!ifdef HAS_TAPE_AUTOCALIBRATE {
clc
ror
sta __turbo_half_S ; store half of the last measurement result for short pulse
}
lda #$01
!ifdef CONFIG_MB_M65 {
@@ -34,10 +37,15 @@ tape_turbo_get_bit:
sta VIC_EXTCOL
sec
rts
@1:
!ifdef HAS_TAPE_AUTOCALIBRATE {
clc
ror
sta __turbo_half_L ; store half of the last measurement result for long pulse
}
lda #$00
!ifdef CONFIG_MB_M65 {
+3
View File
@@ -27,6 +27,8 @@ tape_turbo_get_byte:
bcc @1 ; is the initial 1 shifted into carry already?
+plx_trash_a
!ifdef HAS_TAPE_AUTOCALIBRATE {
; Compensate for tape speed variations
lda __turbo_half_S ; half of the last value for bit '0'
@@ -51,6 +53,7 @@ tape_turbo_get_byte:
beq tape_turbo_get_byte_done ; do not increase threshold too far no matter what
inc __pulse_threshold
}
tape_turbo_get_byte_done: