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

+8 -2
View File
@@ -147,13 +147,19 @@ Causes screen blanking during JiffyDOS file loading to increase performance.
Adds a minimal normal (standard Commodore format) tape support - just LOAD command. Adds a minimal normal (standard Commodore format) tape support - just LOAD command.
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. Needs about 1050 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` ### `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 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 1050 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 1300 bytes are needed, as they share some code). If unsure - enable.
### `CONFIG_TAPE_AUTODETECT`
Tape format (normal/turbo) is always autodetected.
Needs about 100 more bytes in KERNAL segment.
### `CONFIG_TAPE_NO_KEY_SENSE` ### `CONFIG_TAPE_NO_KEY_SENSE`
+1
View File
@@ -13,6 +13,7 @@ Here are the features of the Open ROMs not found in the original ROMs from the 8
* turbo tape load support (as device 7, or using `←L`), 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`), quite sophisticated: up to 250 blocks (can store bytes under I/O), automatically adjusts 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
* 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
* extended `LOAD` command * extended `LOAD` command
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -56,7 +56,7 @@
#define CONFIG_TAPE_NORMAL #define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO #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_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL // #define CONFIG_TAPE_NO_MOTOR_CONTROL
// #define CONFIG_TAPE_NO_ERROR_CORRECTION // #define CONFIG_TAPE_NO_ERROR_CORRECTION
+3 -2
View File
@@ -50,6 +50,7 @@
#define CONFIG_TAPE_NORMAL #define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO #define CONFIG_TAPE_TURBO
#define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE // #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL // #define CONFIG_TAPE_NO_MOTOR_CONTROL
// #define CONFIG_TAPE_NO_ERROR_CORRECTION // #define CONFIG_TAPE_NO_ERROR_CORRECTION
@@ -70,8 +71,8 @@
// Keyboard settings // Keyboard settings
// #define CONFIG_LEGACY_SCNKEY // #define CONFIG_LEGACY_SCNKEY
#define CONFIG_KEYBOARD_C128 // #define CONFIG_KEYBOARD_C128
#define CONFIG_KEYBOARD_C128_CAPS_LOCK // #define CONFIG_KEYBOARD_C128_CAPS_LOCK
// #define CONFIG_KEYBOARD_C65 // untested // #define CONFIG_KEYBOARD_C65 // untested
// #define CONFIG_KEYBOARD_C65_CAPS_LOCK // untested // #define CONFIG_KEYBOARD_C65_CAPS_LOCK // untested
// #define CONFIG_KEY_REPEAT_DEFAULT // #define CONFIG_KEY_REPEAT_DEFAULT
+2 -1
View File
@@ -50,9 +50,10 @@
// #define CONFIG_TAPE_NORMAL // #define CONFIG_TAPE_NORMAL
// #define CONFIG_TAPE_TURBO // #define CONFIG_TAPE_TURBO
// #define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE // #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL // #define CONFIG_TAPE_NO_MOTOR_CONTROL
#define CONFIG_TAPE_NO_ERROR_CORRECTION // #define CONFIG_TAPE_NO_ERROR_CORRECTION
// Multiple SID support // Multiple SID support
+1
View File
@@ -50,6 +50,7 @@
// #define CONFIG_TAPE_NORMAL // #define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO #define CONFIG_TAPE_TURBO
// #define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE // #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL // #define CONFIG_TAPE_NO_MOTOR_CONTROL
#define CONFIG_TAPE_NO_ERROR_CORRECTION #define CONFIG_TAPE_NO_ERROR_CORRECTION
+1
View File
@@ -50,6 +50,7 @@
#define CONFIG_TAPE_NORMAL #define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO #define CONFIG_TAPE_TURBO
#define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE // #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL // #define CONFIG_TAPE_NO_MOTOR_CONTROL
// #define CONFIG_TAPE_NO_ERROR_CORRECTION // #define CONFIG_TAPE_NO_ERROR_CORRECTION
+30 -11
View File
@@ -33,10 +33,6 @@
// (L,S) = end-of-data marker // (L,S) = end-of-data marker
// XXX add error correction
// XXX implement proper takeover to turbo during sync/pilot
#if CONFIG_TAPE_NORMAL #if CONFIG_TAPE_NORMAL
@@ -50,25 +46,36 @@ load_tape_normal:
jsr tape_common_prepare_cia jsr tape_common_prepare_cia
jsr tape_ask_play jsr tape_ask_play
// FALLTROUGH
load_tape_normal_header:
#else #else
load_tape_normal_takeover: // entry point for turbo->normal takeover load_tape_normal_takeover: // entry point for turbo->normal takeover
#endif #endif
// FALLTROUGH
load_tape_normal_header:
jsr load_MEMUSS_to_STAL jsr load_MEMUSS_to_STAL
// Try to load header into tape buffer (we will restore MEMUSS later) // Try to load header into tape buffer (we will restore MEMUSS later)
jsr tape_normal_get_pilot_header 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 load_TAPE1_to_MEMUSS
jsr tape_normal_get_data_1 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 #if CONFIG_TAPE_NO_ERROR_CORRECTION
lda RIPRTY lda RIPRTY
@@ -77,11 +84,15 @@ load_tape_normal_header:
jsr load_TAPE1_to_MEMUSS jsr load_TAPE1_to_MEMUSS
jsr tape_normal_get_data_2 jsr tape_normal_get_data_2
#endif #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 // Check header type
ldy #$00 // XXX probably can be optimized for 65C02 ldy #$00
lda (TAPE1),y lda (TAPE1),y
cmp #$05 cmp #$05
@@ -90,7 +101,11 @@ load_tape_normal_header:
cmp #$01 cmp #$01
beq !+ beq !+
cmp #$03 cmp #$03
#if !CONFIG_TAPE_AUTODETECT
bne load_tape_normal_header // header types 1 and 3 are loadable, see Mapping the C64, page 77 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 lda #$01
sta SA // this file is non-relocatable; override secondary address with 1 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 lvs_STAL_to_MEMUSS
jsr tape_handle_header jsr tape_handle_header
#if !CONFIG_TAPE_AUTODETECT
bcs load_tape_normal_header // if name does not match, look for other header bcs load_tape_normal_header // if name does not match, look for other header
#else
bcs load_tape_normal_takeover
#endif
// FALLTROUGH // FALLTROUGH
+1 -1
View File
@@ -37,7 +37,7 @@ load_tape_auto:
#if CONFIG_TAPE_AUTODETECT #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 jsr tape_common_autodetect
bcc_16 load_tape_normal_takeover bcc_16 load_tape_normal_takeover
-3
View File
@@ -8,9 +8,6 @@
// Carry clear - normal, Carry set - turbo // Carry clear - normal, Carry set - turbo
// //
// XXX implement fallback to autodetection in normal
#if CONFIG_TAPE_AUTODETECT #if CONFIG_TAPE_AUTODETECT
+9 -4
View File
@@ -16,8 +16,6 @@
#if CONFIG_TAPE_NORMAL #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 tape_normal_get_pilot_header: // entry point, reset calibration, require 128x $40 pulses
// Reading the pilot header is the first action performed, // 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: tape_normal_get_pilot_common_loop_inner:
jsr tape_common_get_pulse 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 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 jsr tape_normal_calibrate_during_pilot
dey dey
@@ -82,6 +85,8 @@ tape_normal_get_pilot_common_loop_inner:
dec ROPRTY dec ROPRTY
bne tape_normal_get_pilot_common_loop_outer bne tape_normal_get_pilot_common_loop_outer
clc
!:
rts rts