completed tape format autodetection, updated binaries

This commit is contained in:
FeralChild64 committed 2020-01-27 21:08:35 +01:00
1 parent 94a0338ee7
commit e410bc0900
18 files changed
+57 -25

No files matched your search

+1 -1
View File
@@ -56,7 +56,7 @@
#define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO
#define CONFIG_TAPE_AUTODETECT // mostly works, but not fully done yet!
#define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
// #define CONFIG_TAPE_NO_ERROR_CORRECTION
+3 -2
View File
@@ -50,6 +50,7 @@
#define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO
#define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
// #define CONFIG_TAPE_NO_ERROR_CORRECTION
@@ -70,8 +71,8 @@
// Keyboard settings
// #define CONFIG_LEGACY_SCNKEY
#define CONFIG_KEYBOARD_C128
#define CONFIG_KEYBOARD_C128_CAPS_LOCK
// #define CONFIG_KEYBOARD_C128
// #define CONFIG_KEYBOARD_C128_CAPS_LOCK
// #define CONFIG_KEYBOARD_C65 // untested
// #define CONFIG_KEYBOARD_C65_CAPS_LOCK // untested
// #define CONFIG_KEY_REPEAT_DEFAULT
+2 -1
View File
@@ -50,9 +50,10 @@
// #define CONFIG_TAPE_NORMAL
// #define CONFIG_TAPE_TURBO
// #define CONFIG_TAPE_AUTODETECT
// #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
+1
View File
@@ -50,6 +50,7 @@
// #define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO
// #define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
#define CONFIG_TAPE_NO_ERROR_CORRECTION
+1
View File
@@ -50,6 +50,7 @@
#define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO
#define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
// #define CONFIG_TAPE_NO_ERROR_CORRECTION
+30 -11
View File
@@ -33,10 +33,6 @@
// (L,S) = end-of-data marker
// XXX add error correction
// XXX implement proper takeover to turbo during sync/pilot
#if CONFIG_TAPE_NORMAL
@@ -50,25 +46,36 @@ load_tape_normal:
jsr tape_common_prepare_cia
jsr tape_ask_play
// FALLTROUGH
load_tape_normal_header:
#else
load_tape_normal_takeover: // entry point for turbo->normal takeover
#endif
// FALLTROUGH
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
#if CONFIG_TAPE_AUTODETECT
bcs load_tape_normal_switch_turbo // failed, try turbo
#endif
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
#if !CONFIG_TAPE_AUTODETECT
bcs load_tape_normal_header // unable to read block, try again
#else
bcc !+
load_tape_normal_switch_turbo:
jsr lvs_STAL_to_MEMUSS
jmp load_tape_turbo_takeover // unable to read block, try turbo instead
!:
#endif
#if CONFIG_TAPE_NO_ERROR_CORRECTION
lda RIPRTY
@@ -77,11 +84,15 @@ load_tape_normal_header:
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
#if !CONFIG_TAPE_AUTODETECT
bcs load_tape_normal_header // block load error, try again
#else
bcs load_tape_normal_switch_turbo // block load error, try turbo instead
#endif
// Check header type
ldy #$00 // XXX probably can be optimized for 65C02
ldy #$00
lda (TAPE1),y
cmp #$05
@@ -90,7 +101,11 @@ load_tape_normal_header:
cmp #$01
beq !+
cmp #$03
#if !CONFIG_TAPE_AUTODETECT
bne load_tape_normal_header // header types 1 and 3 are loadable, see Mapping the C64, page 77
#else
bne load_tape_normal_takeover
#endif
lda #$01
sta SA // this file is non-relocatable; override secondary address with 1
@@ -99,7 +114,11 @@ load_tape_normal_header:
jsr lvs_STAL_to_MEMUSS
jsr tape_handle_header
#if !CONFIG_TAPE_AUTODETECT
bcs load_tape_normal_header // if name does not match, look for other header
#else
bcs load_tape_normal_takeover
#endif
// FALLTROUGH
+1 -1
View File
@@ -37,7 +37,7 @@ load_tape_auto:
#if CONFIG_TAPE_AUTODETECT
load_tape_turbo_takeover: // entry point for turbo->normal takeover
load_tape_turbo_takeover: // entry point for normal->turbo takeover
jsr tape_common_autodetect
bcc_16 load_tape_normal_takeover
-3
View File
@@ -8,9 +8,6 @@
// Carry clear - normal, Carry set - turbo
//
// XXX implement fallback to autodetection in normal
#if CONFIG_TAPE_AUTODETECT
+9 -4
View File
@@ -16,8 +16,6 @@
#if CONFIG_TAPE_NORMAL
// XXX in tape_normal_get_pilot_header also try to detect turbo
tape_normal_get_pilot_header: // entry point, reset calibration, require 128x $40 pulses
// Reading the pilot header is the first action performed,
@@ -71,9 +69,14 @@ tape_normal_get_pilot_common_loop_outer:
tape_normal_get_pilot_common_loop_inner:
jsr tape_common_get_pulse
// XXX check for short pulses of turbo here
bcc tape_normal_get_pilot_common_restart // not a pilot - try again
#if CONFIG_TAPE_AUTODETECT
// Try to distinguish turbo by cheecking for short signals
cmp #$B9 // see comment in tape_common_autodetect.s
bcs !+
#endif
jsr tape_normal_calibrate_during_pilot
dey
@@ -82,6 +85,8 @@ tape_normal_get_pilot_common_loop_inner:
dec ROPRTY
bne tape_normal_get_pilot_common_loop_outer
clc
!:
rts