diff --git a/c64/,,config_generic.s b/c64/,,config_generic.s index ace77aa5..09774f1b 100644 --- a/c64/,,config_generic.s +++ b/c64/,,config_generic.s @@ -41,7 +41,7 @@ // I/O devices #define CONFIG_IEC -#define CONFIG_IEC_JIFFYDOS // please keep disabled for now +// #define CONFIG_IEC_JIFFYDOS // please keep disabled for now // #define CONFIG_TAPE_NORMAL // please keep disabled for now #define CONFIG_TAPE_TURBO // #define CONFIG_RS232_UP2400 // please keep disabled for now diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 85004a2a..e5e8e393 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -106,7 +106,7 @@ #if !CONFIG_IEC_JIFFYDOS .label TSFCNT = $A3 // temporary variable for tape and IEC, [!] our usage differs #else - .label IECPROTO = $A3 // -- WIP -- [!] 0 = normal, 1 = JiffyDOS, $80 or above = detect protocol + .label IECPROTO = $A3 // -- WIP -- [!] 0 = normal, 1 = JiffyDOS, >= $80 for unknown #endif .label TBTCNT = $A4 // temporary variable for tape and IEC, [!] our usage probably differs in details .label CNTDN = $A5 // -- NOT IMPLEMENTED -- diff --git a/c64/kernal/iec/iec_tx_command.s b/c64/kernal/iec/iec_tx_command.s index afdd57a5..04c8a0ca 100644 --- a/c64/kernal/iec/iec_tx_command.s +++ b/c64/kernal/iec/iec_tx_command.s @@ -16,22 +16,6 @@ iec_tx_command: phx_trash_a phy_trash_a -#if CONFIG_IEC_JIFFYDOS - - // IMHO detecting JiffDOS would be sufficient for TALK and LISTEN commands, - // this would also make the protocol slightly faster. But, for some reason - // (this is clearly visible in the logs) the original JiffyDOS Kernal tries - // to detect the JiffyDOS drive during each and every command - and trying - // to limit the detection to TALK/LISTEN only was causing transmission - // errors (at least with 1541 JiffyDOS ROM) - - lda #$FF // force JiffyDOS detection - sta IECPROTO - - // FALLTROUGH - -#endif // CONFIG_IEC_JIFFYDOS - // Notify all devices that we are going to send a byte // and it is going to be a command (pulled ATN) jsr iec_pull_atn_clk_release_data diff --git a/c64/kernal/iec/talk.s b/c64/kernal/iec/talk.s index 94b6ec65..76b83ff0 100644 --- a/c64/kernal/iec/talk.s +++ b/c64/kernal/iec/talk.s @@ -32,6 +32,18 @@ common_talk_listen: // common part of TALK and LISTEN sta TBTCNT +#if CONFIG_IEC_JIFFYDOS + + // It seems that only TALK/LISTEN is used to detect the JiffyDOS support + + lda #$FF // unknown protocol - check what is supported + sta IECPROTO + + // FALLTROUGH + +#endif // CONFIG_IEC_JIFFYDOS + + jmp iec_tx_command #else diff --git a/c64/kernal/iec/unlsn.s b/c64/kernal/iec/unlsn.s index 55fb5fd4..b5dc8990 100644 --- a/c64/kernal/iec/unlsn.s +++ b/c64/kernal/iec/unlsn.s @@ -18,6 +18,13 @@ UNLSN: // According to serial-bus.pdf (page 15) this routine flushes the IEC out buffer jsr iec_tx_flush +#if CONFIG_IEC_JIFFYDOS + + lda #$00 // switch back to standard protocol + sta IECPROTO + +#endif + // Buffer empty, send the command lda #$3F diff --git a/c64/kernal/iec/untlk.s b/c64/kernal/iec/untlk.s index 1e7f542a..3dfceb2b 100644 --- a/c64/kernal/iec/untlk.s +++ b/c64/kernal/iec/untlk.s @@ -18,6 +18,13 @@ UNTLK: // According to serial-bus.pdf (page 15) this routine flushes the IEC out buffer jsr iec_tx_flush +#if CONFIG_IEC_JIFFYDOS + + lda #$00 // switch back to standard protocol + sta IECPROTO + +#endif + // Buffer empty, send the command lda #$5F