started work on better JiffyDOS LOAD routine

This commit is contained in:
FeralChild64 committed 2020-05-07 18:39:24 +02:00
1 parent dad5d21945
commit 37a4df415c
1 file changed
+77 -2
+77 -2
View File
@@ -6,7 +6,6 @@
// JiffyDOS protocol support for IEC - optimized load loop
//
#if CONFIG_IEC_JIFFYDOS && !CONFIG_MEMORY_MODEL_60K
@@ -20,12 +19,88 @@
jiffydos_load:
/* XXX NEW version, not yet finished
//
// JiffyDOS protocol support for IEC - optimized load loop
//
// Based on description from https://github.com/mist64/cbmbus_doc
//
// First we need to switch the device to optimized LOAD protocol,
// by making it talk on channel 1 instead of 0
jsr UNTLK
lda FA
jsr TALK
// XXX bcs load_iec_err
lda #$61 // ask to talk on channel 1
sta TBTCNT
jsr iec_tx_command
// XXX bcs load_iec_error
// XXX if not on JiffyDOS protoccol, report error
// Timing is critical, do not allow interrupts
sei
#if CONFIG_IEC_JIFFYDOS_BLANK
// Preserve register with screen status (blank/visibe)
// Preserve register with screen status (blank/visible)
lda VIC_SCROLY
sta TBTCNT
// Blank screen to make sure no sprite/badline will interrupt
jsr screen_off
#else
// Store previous sprite status in temporary variable
jsr jiffydos_prepare
sta TBTCNT
#endif
// FALLTROUGH
jiffydos_load_mode_escape:
// We are now in escape mode - release DATA so that we can read it
jsr iec_release_clk_data // XXX maybe release just data?
// Wait till device tells us whether this is EOI/error
jsr iec_wait_for_clk_release
// Check DATA line - if pulled, there is more data
bit CIA2_PRA
bpl jiffydos_load_mode_receive
// XXX check for error
jiffydos_load_mode_receive:
// Preserve 3 lowest bits of CIA2_PRA XXX deduplicate this
lda CIA2_PRA
and #%00000111
sta C3PO
// XXX read data
*/
// Timing is critical, do not allow interrupts
sei
#if CONFIG_IEC_JIFFYDOS_BLANK
// Preserve register with screen status (blank/visible)
lda VIC_SCROLY
sta TBTCNT