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

+1 -1
View File
@@ -18,7 +18,7 @@ Here are the features of the Open ROMs not found in the original ROMs from the 8
* `LIST` command should never damage the screen if trying to list memory content which is not a BASIC program * `LIST` command should never damage the screen if trying to list memory content which is not a BASIC program
* high performance garbage collector * high performance garbage collector
* turbo tape load support (as device 7, or using `←L` / `←M`, optionally with a file name), quite sophisticated: up to 250 blocks (can store bytes under I/O), automatically adjusts for tape speed differences * turbo tape load support (as device 7, or using `←L` / `←M`, optionally with a file name), quite sophisticated: up to 250 blocks (can store bytes under I/O), on MEGA65 motherboard automatically adjusts itself for tape speed differences
* normal tape load error log is limited by free stack space only (no artificial limitation like in original ROMs) * normal tape load error log is limited by free stack space only (no artificial limitation like in original ROMs)
* tape format autodetection; normal vs turbo is mostly transparent to user * tape format autodetection; normal vs turbo is mostly transparent to user
* improved support for tape adapters (for using regular casette players and other audio devices instead of Datasette) and emulators * improved support for tape adapters (for using regular casette players and other audio devices instead of Datasette) and emulators
+8
View File
@@ -451,6 +451,14 @@
; Determine if it is OK to include tape autocalibration routines
!ifndef CONFIG_MB_M65 {
!set HAS_TAPE_AUTOCALIBRATE = 1
}
; Defines for multi-segment ROMs ; Defines for multi-segment ROMs
!ifdef CONFIG_MB_M65 { !ifdef CONFIG_MB_M65 {
+3
View File
@@ -310,11 +310,14 @@
!ifdef HAS_TAPE { !ifdef HAS_TAPE {
!ifdef HAS_TAPE_AUTOCALIBRATE {
!addr __normal_time_S = IRQTMP+0 ; duration of the short pulse !addr __normal_time_S = IRQTMP+0 ; duration of the short pulse
!addr __normal_time_M = IRQTMP+1 ; duration of the medium pulse !addr __normal_time_M = IRQTMP+1 ; duration of the medium pulse
!addr __turbo_half_S = IRQTMP+0 ; half-duration of the short pulse !addr __turbo_half_S = IRQTMP+0 ; half-duration of the short pulse
!addr __turbo_half_L = IRQTMP+1 ; half-duration of the long pulse !addr __turbo_half_L = IRQTMP+1 ; half-duration of the long pulse
}
!addr __pulse_threshold = SVXT ; pulse classification threshold !addr __pulse_threshold = SVXT ; pulse classification threshold
!addr __pulse_threshold_ML = SYNO ; M/L pulse classification threshold, for normal only !addr __pulse_threshold_ML = SYNO ; M/L pulse classification threshold, for normal only
+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 tape_normal_calibrate_during_pilot: ; reecalibration during the pilot
@@ -122,4 +122,4 @@ tape_normal_calibrate_threshold_inc:
tape_normal_calibrate_done: tape_normal_calibrate_done:
rts rts
} } }
+8 -2
View File
@@ -22,13 +22,16 @@ tape_normal_get_bit:
; First impulse was short, second should be medium ; First impulse was short, second should be medium
!ifdef HAS_TAPE_AUTOCALIBRATE {
jsr tape_normal_calibrate_after_S jsr tape_normal_calibrate_after_S
}
jsr tape_common_get_pulse jsr tape_common_get_pulse
bcs tape_normal_get_bit_error bcs tape_normal_get_bit_error
!ifdef HAS_TAPE_AUTOCALIBRATE {
jsr tape_normal_calibrate_after_M jsr tape_normal_calibrate_after_M
}
; We have a bit '0' ; We have a bit '0'
lda #$00 lda #$00
@@ -46,13 +49,16 @@ tape_normal_get_bit_1:
; First impulse was medium, second should be short ; First impulse was medium, second should be short
!ifdef HAS_TAPE_AUTOCALIBRATE {
jsr tape_normal_calibrate_after_M jsr tape_normal_calibrate_after_M
}
jsr tape_common_get_pulse jsr tape_common_get_pulse
bcc tape_normal_get_bit_error bcc tape_normal_get_bit_error
!ifdef HAS_TAPE_AUTOCALIBRATE {
jsr tape_normal_calibrate_after_S jsr tape_normal_calibrate_after_S
}
; We have a bit '1' ; We have a bit '1'
clc clc
+4 -3
View File
@@ -32,16 +32,17 @@ tape_normal_get_marker_type:
; Not an entry point!!! ; 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 jsr tape_normal_calibrate_during_pilot ; while sync use short pulses for calibration
}
; FALLTROUGH ; FALLTROUGH
tape_normal_get_marker_while_sync: tape_normal_get_marker_while_sync:
jsr tape_common_get_pulse 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 cmp __pulse_threshold_ML
bcs tape_normal_get_marker_while_sync ; too short for a long pulse 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: @1:
} }
!ifdef HAS_TAPE_AUTOCALIBRATE {
jsr tape_normal_calibrate_during_pilot jsr tape_normal_calibrate_during_pilot
}
dey dey
bne tape_normal_get_pilot_common_loop_inner bne tape_normal_get_pilot_common_loop_inner
+8
View File
@@ -19,9 +19,12 @@ tape_turbo_get_bit:
jsr tape_common_get_pulse jsr tape_common_get_pulse
bcs @1 bcs @1
!ifdef HAS_TAPE_AUTOCALIBRATE {
clc clc
ror ror
sta __turbo_half_S ; store half of the last measurement result for short pulse sta __turbo_half_S ; store half of the last measurement result for short pulse
}
lda #$01 lda #$01
!ifdef CONFIG_MB_M65 { !ifdef CONFIG_MB_M65 {
@@ -34,10 +37,15 @@ tape_turbo_get_bit:
sta VIC_EXTCOL sta VIC_EXTCOL
sec sec
rts rts
@1: @1:
!ifdef HAS_TAPE_AUTOCALIBRATE {
clc clc
ror ror
sta __turbo_half_L ; store half of the last measurement result for long pulse sta __turbo_half_L ; store half of the last measurement result for long pulse
}
lda #$00 lda #$00
!ifdef CONFIG_MB_M65 { !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? bcc @1 ; is the initial 1 shifted into carry already?
+plx_trash_a +plx_trash_a
!ifdef HAS_TAPE_AUTOCALIBRATE {
; Compensate for tape speed variations ; Compensate for tape speed variations
lda __turbo_half_S ; half of the last value for bit '0' 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 beq tape_turbo_get_byte_done ; do not increase threshold too far no matter what
inc __pulse_threshold inc __pulse_threshold
}
tape_turbo_get_byte_done: tape_turbo_get_byte_done: