improved tape adapters support

This commit is contained in:
FeralChild64 committed 2019-12-30 21:06:34 +01:00
1 parent f05ddef5fd
commit 465753b0a2
10 files changed
+68 -5

No files matched your search

+2
View File
@@ -55,6 +55,8 @@
#define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
// #define CONFIG_RS232_UP2400 // please keep disabled for now
// #define CONFIG_RS232_UP9600 // please keep disabled for now
+2
View File
@@ -49,6 +49,8 @@
#define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
// Multiple SID support
+2
View File
@@ -49,6 +49,8 @@
// #define CONFIG_TAPE_NORMAL
// #define CONFIG_TAPE_TURBO
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
// Multiple SID support
+2
View File
@@ -49,6 +49,8 @@
// #define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
// Multiple SID support
+2
View File
@@ -49,6 +49,8 @@
#define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
// Multiple SID support
+2 -2
View File
@@ -16,7 +16,7 @@ iec_wait1ms:
ldx #18 // we probably won't start with the beginning of raster
#endif // CONFIG_IEC
#if CONFIG_IEC || CONFIG_TAPE_TURBO || CONFIG_TAPE_NORMAL
#if CONFIG_IEC || (!CONFIG_TAPE_NO_MOTOR_CONTROL && (CONFIG_TAPE_TURBO || CONFIG_TAPE_NORMAL))
wait_x_bars: // additional entry point for tape support
// has to preserve .Y and put .X to 0
@@ -34,4 +34,4 @@ iec_wait_rts: // dummy RTS, for very short waits
rts
#endif // CONFIG_IEC || CONFIG_TAPE_TURBO || CONFIG_TAPE_NORMAL
#endif
+46 -2
View File
@@ -28,12 +28,16 @@ tape_ask_play:
sei // timing is critical for tape loading
#if !CONFIG_TAPE_NO_KEY_SENSE
// First check whether the button is already pressed
lda CPU_R6510
and #$10
beq tape_wait_play_done
#endif
// Display message
ldx #__MSG_KERNAL_PRESS_PLAY
@@ -41,6 +45,8 @@ tape_ask_play:
// FALLTROUGH
#if !CONFIG_TAPE_NO_KEY_SENSE
tape_wait_play_loop:
jsr udtim_keyboard
@@ -51,6 +57,26 @@ tape_wait_play_loop:
and #$10 // check for pressed button
bne tape_wait_play_loop
// FALLTROUGH
#else
// We have no key sense - so just turn the motor on and wait for the first pulse
jsr tape_motor_on
lda #$10
!:
bit CIA1_ICR // $DC0D
bne !-
!:
bit CIA1_ICR // $DC0D
beq !-
#endif
// FALLTROUGH
tape_wait_play_done:
// Prepare for reading
@@ -68,8 +94,12 @@ tape_wait_play_done:
tape_handle_header:
#if !CONFIG_TAPE_NO_MOTOR_CONTROL
jsr tape_screen_on_motor_off
#endif
// Print FOUND + file name
ldx #__MSG_KERNAL_FOUND
@@ -83,11 +113,15 @@ tape_handle_header:
cpy #$15
bne !-
#if !CONFIG_TAPE_NO_MOTOR_CONTROL
// Header, wait for user decision
jsr tape_header_get_decision
bcs tape_break_error
#endif
// Check if file name matches
jsr tape_match_filename
@@ -151,14 +185,20 @@ tape_handle_header:
jsr lvs_display_loading_verifying
// FALLTROUGH
#if !CONFIG_TAPE_NO_MOTOR_CONTROL
tape_handle_header_displayed:
// Load the file
jsr tape_screen_off_motor_on
// FALLTROUGH
#endif
tape_return_ok:
clc
@@ -211,6 +251,8 @@ tape_match_loop:
rts
#if !CONFIG_TAPE_NO_MOTOR_CONTROL
//
// Get user decision whether to load the file or not
//
@@ -223,7 +265,7 @@ tape_header_get_decision:
lda STKEY
bpl tape_header_wait_stop // STOP pressed
and #$10
beq tape_header_wait_space // space pressed
beq tape_header_wait_space // SPACE pressed
ldx #$80
jsr wait_x_bars // sets .X to 0
@@ -245,6 +287,8 @@ tape_header_wait_stop:
sec
rts
#endif
//
// Report that file loading succeeded (or not)