diff --git a/CONFIG.md b/CONFIG.md index e0badbbf..5de6e5b2 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -113,6 +113,12 @@ Needs over 1000 bytes in KERNAL segment. If unsure - enable. Causes screen blanking during some IEC operations (currently only JiffyDOS file loading) to increase the data transfer performance. +### `CONFIG_IEC_DOLPHINDOS` + +Adds support for DolphinDOS fast protocol to the IEC bus, using UserPort cable. + +Needs some space in KERNAL segment. If unsure - enable. + ### `CONFIG_IEC_JIFFYDOS` Adds support for JiffyDOS fast protocol to the IEC bus. diff --git a/STATUS.md b/STATUS.md index 31ed9acc..be9e1b84 100644 --- a/STATUS.md +++ b/STATUS.md @@ -61,7 +61,7 @@ The following ROM features are currently missing: | :-----------: | :------: | :------------------------------------------------: | | standard | DONE | | | JiffyDOS | DONE | | -| DolphinDOS | NOT DONE | | +| DolphinDOS | PARTIAL | for now only LOAD is accelerated | | CIA burst mod | NOT DONE | | ## RS-232 diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index 67d6d761..a9606597 100644 Binary files a/bin/basic_generic.rom and b/bin/basic_generic.rom differ diff --git a/bin/basic_testing.rom b/bin/basic_testing.rom index 30d6963d..5bba5411 100644 Binary files a/bin/basic_testing.rom and b/bin/basic_testing.rom differ diff --git a/bin/basic_ultimate64.rom b/bin/basic_ultimate64.rom index 3e91cd62..2c786995 100644 Binary files a/bin/basic_ultimate64.rom and b/bin/basic_ultimate64.rom differ diff --git a/bin/kernal_generic.rom b/bin/kernal_generic.rom index 2a5d2dae..8f5cddb3 100644 Binary files a/bin/kernal_generic.rom and b/bin/kernal_generic.rom differ diff --git a/bin/kernal_testing.rom b/bin/kernal_testing.rom index 4ee9d0c3..34730d2b 100644 Binary files a/bin/kernal_testing.rom and b/bin/kernal_testing.rom differ diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index 0851f524..6e0565b3 100644 Binary files a/bin/kernal_ultimate64.rom and b/bin/kernal_ultimate64.rom differ diff --git a/bin/mega65.rom b/bin/mega65.rom index 495d1f41..404a994e 100644 Binary files a/bin/mega65.rom and b/bin/mega65.rom differ diff --git a/c64/,,config_custom.s b/c64/,,config_custom.s index 3ab327ae..c6eb3fa8 100644 --- a/c64/,,config_custom.s +++ b/c64/,,config_custom.s @@ -46,7 +46,7 @@ #define CONFIG_IEC #define CONFIG_IEC_BLANK_SCREEN -#define CONFIG_IEC_DOLPHINDOS // not finished yet +#define CONFIG_IEC_DOLPHINDOS // not finished yet, but LOAD works #define CONFIG_IEC_JIFFYDOS #define CONFIG_TAPE_NORMAL diff --git a/c64/,,config_generic.s b/c64/,,config_generic.s index 8049f2c2..b2a02c59 100644 --- a/c64/,,config_generic.s +++ b/c64/,,config_generic.s @@ -43,6 +43,7 @@ #define CONFIG_IEC #define CONFIG_IEC_BLANK_SCREEN +#define CONFIG_IEC_DOLPHINDOS #define CONFIG_IEC_JIFFYDOS #define CONFIG_TAPE_NORMAL diff --git a/c64/,,config_testing.s b/c64/,,config_testing.s index 2134a928..07823cc3 100644 --- a/c64/,,config_testing.s +++ b/c64/,,config_testing.s @@ -43,6 +43,7 @@ #define CONFIG_IEC // #define CONFIG_IEC_BLANK_SCREEN +#define CONFIG_IEC_DOLPHINDOS #define CONFIG_IEC_JIFFYDOS // #define CONFIG_TAPE_NORMAL diff --git a/c64/,,config_ultimate64.s b/c64/,,config_ultimate64.s index 4295ccdd..5a0e5923 100644 --- a/c64/,,config_ultimate64.s +++ b/c64/,,config_ultimate64.s @@ -43,6 +43,7 @@ #define CONFIG_IEC #define CONFIG_IEC_BLANK_SCREEN +#define CONFIG_IEC_DOLPHINDOS #define CONFIG_IEC_JIFFYDOS #define CONFIG_TAPE_NORMAL diff --git a/c64/kernal/iec/load_iec.s b/c64/kernal/iec/load_iec.s index 92c983a1..cf5e5995 100644 --- a/c64/kernal/iec/load_iec.s +++ b/c64/kernal/iec/load_iec.s @@ -107,9 +107,8 @@ load_iec: #endif #if CONFIG_IEC_DOLPHINDOS - // XXX enable when finished - // cmp #$02 - // beq_far load_dolphindos // branch if JiffyDOS + cmp #$02 + beq_far load_dolphindos // branch if DolphinDOS #endif #endif diff --git a/c64/kernal/iec_fast/dolphindos_detect.s b/c64/kernal/iec_fast/dolphindos_detect.s index b8cb278d..dbdafab7 100644 --- a/c64/kernal/iec_fast/dolphindos_detect.s +++ b/c64/kernal/iec_fast/dolphindos_detect.s @@ -54,8 +54,6 @@ dolphindos_detect_loop: dolphindos_detect_fail: - panic #$00 - rts dolphindos_detect_success: diff --git a/c64/kernal/iec_fast/load_dolphindos.s b/c64/kernal/iec_fast/load_dolphindos.s index a80eba8e..27258a14 100644 --- a/c64/kernal/iec_fast/load_dolphindos.s +++ b/c64/kernal/iec_fast/load_dolphindos.s @@ -19,9 +19,60 @@ load_dolphindos: load_dolphindos_loop: + // Check if this was EOI + lda IOSTATUS + and #K_STS_EOI + bne load_dolphindos_end + // Wait for the talker to release the CLK line +!: + bit CIA2_PRA + bvc !- - panic #$00 // XXX this routine is not finished yet + // Release the DATA to signal we are ready + lda CIA2_PRA + and #$FF - BIT_CIA2_PRA_DAT_OUT // release + sta CIA2_PRA + + // Wait till data line is released (someone else might be holding it) +!: + lda CIA2_PRA + bpl !- + + // Check if EOI - routine can damage .Y, so store it in safe place + sty TBTCNT + jsr iec_rx_check_eoi + ldy TBTCNT + + // Retrieve and store byte + lda CIA2_PRB + iny + sta (EAL),y + + // Pull DATA to acknowledge + lda CIA2_PRA + ora #BIT_CIA2_PRA_DAT_OUT + sta CIA2_PRA + + // Handle EAL + cpy #$FF + bne load_dolphindos_loop + inc EAL+1 + jmp load_dolphindos_loop + +load_dolphindos_end: + + // Update EAL - XXX deduplicate with JiffyDOS counterpart + tya + sec + adc EAL+0 + sta EAL+0 + bcc !+ + inc EAL+1 +!: + + // End of load loop + jmp load_iec_loop_end #endif // CONFIG_IEC_DOLPHINDOS and not CONFIG_MEMORY_MODEL_60K