From 34d12e26ac563f57f80d21d1d244aa962dc0db5b Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Thu, 28 Nov 2019 20:12:09 +0100 Subject: [PATCH] started JiffyDOS byte fetch synchronization --- c64/aliases/,aliases_config.s | 4 ++-- c64/kernal/iec/iec_jiffydos.s | 18 ++++++++++++++++-- c64/kernal/iec/talk.s | 10 ---------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/c64/aliases/,aliases_config.s b/c64/aliases/,aliases_config.s index 619223aa..e40cbefb 100644 --- a/c64/aliases/,aliases_config.s +++ b/c64/aliases/,aliases_config.s @@ -308,7 +308,7 @@ #elif CONFIG_TAPE_TURBO .eval features_str = ADD_FEATURE(features_str, "TAPE LOAD TURBO") #elif CONFIG_TAPE_NORMAL && CONFIG_TAPE_TURBO - .eval features_str = ADD_FEATURE(features_str, "TAPE LOAD NORMAL+TURBO") + .eval features_str = ADD_FEATURE(features_str, "TAPE LOAD NORMAL TURBO") #endif .eval feature_new_line = true @@ -317,7 +317,7 @@ #if !CONFIG_IEC_JIFFYDOS .eval features_str = ADD_FEATURE(features_str, "IEC") #else - .eval features_str = ADD_FEATURE(features_str, "IEC+JIFFY DEV") + .eval features_str = ADD_FEATURE(features_str, "IEC JIFFY-DEV") #endif #endif diff --git a/c64/kernal/iec/iec_jiffydos.s b/c64/kernal/iec/iec_jiffydos.s index 257d35d7..33331fad 100644 --- a/c64/kernal/iec/iec_jiffydos.s +++ b/c64/kernal/iec/iec_jiffydos.s @@ -122,29 +122,43 @@ iec_rx_byte_jiffydos: // Ask device to start sending bits stx CIA2_PRA // cycles: 4 - // Retrieve byte XXX count cycles, synchronize + // XXX we have to wait 20 cycles??? seriously??? what the hell shall we do here??? + pla // 4 cycles + pha // 3 cycles + pla // 4 cycles + pha // 3 cycles + nop // 2 cycles + nop // 2 cycles + nop // 2 cycles + // Get bits, cycles: 4 + 2 + 2 = 8 lda CIA2_PRA // bits 0 and 1 on CLK/DATA lsr lsr + // Wait for the drive, cycles: 2 + nop + + // Get bits, cycles: 4 + 2 + 2 = 8 ora CIA2_PRA // bits 2 and 3 on CLK/DATA lsr lsr + // Get bits, cycles: 3 + 4 + 2 + 2 = 11 eor C3PO eor CIA2_PRA // bits 4 and 5 on CLK/DATA lsr lsr + // Get bits, cycles: 3 + 4 = 7 eor C3PO eor CIA2_PRA // bits 6 and 7 on CLK/DATA + tax // XXX CLK and DATA active = EOI lda CIA2_PRA - // FALLTROUGH jiffydos_return_success: diff --git a/c64/kernal/iec/talk.s b/c64/kernal/iec/talk.s index ccf6d405..52b689c3 100644 --- a/c64/kernal/iec/talk.s +++ b/c64/kernal/iec/talk.s @@ -26,16 +26,6 @@ TALK: // Encode and execute the command ora #$40 -#if CONFIG_IEC_JIFFYDOS - - // XXX temporary, until receiving is implemented too - sta TBTCNT - lda #$00 // standard protocol - sta IECPROTO - jmp iec_tx_command - -#endif // CONFIG_IEC_JIFFYDOS - common_talk_listen: // common part of TALK and LISTEN sta TBTCNT