From 782a7c63a0e309ca49ed0dcfdfda8eaa6cb1c108 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 18 Dec 2019 19:26:24 +0100 Subject: [PATCH] initial code for DolphinDOS detection (not working yet) --- c64/kernal/iec/talk.s | 9 +++++++ c64/kernal/iec_fast/dolphindos_detect.s | 31 ++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/c64/kernal/iec/talk.s b/c64/kernal/iec/talk.s index d0c11e65..e65b4e68 100644 --- a/c64/kernal/iec/talk.s +++ b/c64/kernal/iec/talk.s @@ -41,9 +41,18 @@ common_talk_listen: // common part of TALK and LISTEN #endif // CONFIG_IEC_JIFFYDOS +#if CONFIG_IEC_DOLPHINDOS + + jsr iec_tx_command + jmp dolphindos_detect + +#else jmp iec_tx_command +#endif // no CONFIG_IEC_JIFFYDOS + + #else jmp kernalerror_ILLEGAL_DEVICE_NUMBER diff --git a/c64/kernal/iec_fast/dolphindos_detect.s b/c64/kernal/iec_fast/dolphindos_detect.s index ef135e8d..093750bb 100644 --- a/c64/kernal/iec_fast/dolphindos_detect.s +++ b/c64/kernal/iec_fast/dolphindos_detect.s @@ -18,9 +18,38 @@ #if CONFIG_IEC_DOLPHINDOS -dolphindos_detect: +dolphindos_detect: // XXX find out why this does not work + + // 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: + + lda CIA2_ICR + and #$10 + bne dolphindos_detect_success + lda CIA2_PRB // XXX do we need this read? + + dex + bne dolphindos_detect_loop + + // Protocol not detected + + plp + rts + +dolphindos_detect_success: + + // XXX protocol not implemented yet panic #$00 + plp + rts + #endif // CONFIG_IEC_DOLPHINDOS