diff --git a/c64/kernal/iec/acptr.s b/c64/kernal/iec/acptr.s index e5e818e7..d379da49 100644 --- a/c64/kernal/iec/acptr.s +++ b/c64/kernal/iec/acptr.s @@ -20,7 +20,7 @@ ACPTR: !: #if CONFIG_IEC -#if CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS jmp iec_rx_dispatch #else // no turbo supported jmp iec_rx_byte diff --git a/c64/kernal/iec/ciout.s b/c64/kernal/iec/ciout.s index 4c6137bd..5e4c3e8b 100644 --- a/c64/kernal/iec/ciout.s +++ b/c64/kernal/iec/ciout.s @@ -33,7 +33,7 @@ ciout_store_in_buffer: ciout_send_byte: clc // don't send with EOI -#if CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS jsr iec_tx_dispatch #else // no turbo supported jsr iec_tx_byte diff --git a/c64/kernal/iec/iec_send_file_name.s b/c64/kernal/iec/iec_send_file_name.s index 7530f7a0..a372b8cd 100644 --- a/c64/kernal/iec/iec_send_file_name.s +++ b/c64/kernal/iec/iec_send_file_name.s @@ -30,7 +30,7 @@ iec_send_file_name_loop: !: // Transmit one character sta TBTCNT -#if CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS jsr iec_tx_dispatch #else // no turbo supported jsr iec_tx_byte diff --git a/c64/kernal/iec/load_iec.s b/c64/kernal/iec/load_iec.s index a638f521..790e643c 100644 --- a/c64/kernal/iec/load_iec.s +++ b/c64/kernal/iec/load_iec.s @@ -111,7 +111,7 @@ load_iec: load_iec_loop: // We are now ready to receive bytes -#if CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS jsr iec_rx_dispatch #else // no turbo supported jsr iec_rx_byte @@ -167,7 +167,7 @@ load_iec_loop_end: load_iec_get_addr_byte: -#if CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS jsr iec_rx_dispatch #else // no turbo supported jsr iec_rx_byte diff --git a/c64/kernal/iec/save_iec.s b/c64/kernal/iec/save_iec.s index 19413839..71d7f02d 100644 --- a/c64/kernal/iec/save_iec.s +++ b/c64/kernal/iec/save_iec.s @@ -48,7 +48,7 @@ save_iec: lda STAL+0 sta TBTCNT clc -#if CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS jsr iec_tx_dispatch #else // no turbo supported jsr iec_tx_byte @@ -57,7 +57,7 @@ save_iec: lda STAL+1 sta TBTCNT clc -#if CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS jsr iec_tx_dispatch #else // no turbo supported jsr iec_tx_byte @@ -78,7 +78,7 @@ iec_save_loop: // Send the byte sta TBTCNT clc -#if CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS jsr iec_tx_dispatch #else // no turbo supported jsr iec_tx_byte diff --git a/c64/kernal/iec_fast/dolphindos_detect.s b/c64/kernal/iec_fast/dolphindos_detect.s index 093750bb..dbdafab7 100644 --- a/c64/kernal/iec_fast/dolphindos_detect.s +++ b/c64/kernal/iec_fast/dolphindos_detect.s @@ -18,13 +18,26 @@ #if CONFIG_IEC_DOLPHINDOS -dolphindos_detect: // XXX find out why this does not work +dolphindos_detect: + +#if CONFIG_IEC_JIFFYDOS + + lda IECPROTO + bne dolphindos_detect_fail // skip if other protocol already detected + +#endif + + // Make sure the port settings are correct + + lda #$7F + sta CIA2_ICR // disable interrupt generation + lda #$00 + sta CIA2_DDRB // set all port B lines as input // According to logs collected from modified VICE emulator, original DolphinDOS ROM // constantly reads $DD0D and $DD01 until handshake bit of $DD0D is set, or some kind // of timeout occurs - php ldx #$20 dolphindos_detect_loop: @@ -37,18 +50,19 @@ dolphindos_detect_loop: dex bne dolphindos_detect_loop - // Protocol not detected + // FALLTROUGH - protocol not detected + +dolphindos_detect_fail: - plp rts dolphindos_detect_success: - // XXX protocol not implemented yet + // Protocol detected - panic #$00 + lda #$02 + sta IECPROTO - plp rts diff --git a/c64/kernal/iec_fast/iec_rx_byte_dolphindos.s b/c64/kernal/iec_fast/iec_rx_byte_dolphindos.s new file mode 100644 index 00000000..97a908ab --- /dev/null +++ b/c64/kernal/iec_fast/iec_rx_byte_dolphindos.s @@ -0,0 +1,15 @@ + +// +// DolphinDOS protocol support for IEC - byte reception +// + + +#if CONFIG_IEC_DOLPHINDOS + + +iec_rx_byte_dolphindos: + + panic #$00 // XXX implement this + + +#endif diff --git a/c64/kernal/iec_fast/iec_rx_dispatch.s b/c64/kernal/iec_fast/iec_rx_dispatch.s index 465ee4b5..ba4c1ef1 100644 --- a/c64/kernal/iec_fast/iec_rx_dispatch.s +++ b/c64/kernal/iec_fast/iec_rx_dispatch.s @@ -4,7 +4,7 @@ // -#if CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS iec_rx_dispatch: @@ -16,6 +16,11 @@ iec_rx_dispatch: beq_far iec_rx_byte_jiffydos #endif // CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_DOLPHINDOS + cmp #$02 + beq_far iec_rx_byte_dolphindos +#endif // CONFIG_IEC_DOLPHINDOS + jmp iec_rx_byte diff --git a/c64/kernal/iec_fast/iec_tx_byte_dolphindos.s b/c64/kernal/iec_fast/iec_tx_byte_dolphindos.s new file mode 100644 index 00000000..1f2cbbe9 --- /dev/null +++ b/c64/kernal/iec_fast/iec_tx_byte_dolphindos.s @@ -0,0 +1,15 @@ + +// +// DolphinDOS protocol support for IEC - byte transfer +// + + +#if CONFIG_IEC_DOLPHINDOS + + +iec_tx_byte_dolphindos: + + panic #$00 // XXX implement this + + +#endif diff --git a/c64/kernal/iec_fast/iec_tx_dispatch.s b/c64/kernal/iec_fast/iec_tx_dispatch.s index 88898664..e7310024 100644 --- a/c64/kernal/iec_fast/iec_tx_dispatch.s +++ b/c64/kernal/iec_fast/iec_tx_dispatch.s @@ -4,7 +4,7 @@ // -#if CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS iec_tx_dispatch: @@ -17,6 +17,11 @@ iec_tx_dispatch: beq iec_tx_dispatch_jiffydos #endif // CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_DOLPHINDOS + cmp #$02 + beq iec_tx_dispatch_dolphindos +#endif // CONFIG_IEC_DOLPHINDOS + // FALLTROUGH iec_tx_dispatch_normal: @@ -30,5 +35,11 @@ iec_tx_dispatch_jiffydos: jmp iec_tx_byte_jiffydos #endif // CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_DOLPHINDOS +iec_tx_dispatch_dolphindos: + plp + jmp iec_tx_byte_dolphindos +#endif // CONFIG_IEC_DOLPHINDOS + #endif // any turbo supported