initial work towards burst IEC protocol support

This commit is contained in:
FeralChild64 committed 2019-12-30 20:28:52 +01:00
1 parent 99afae45c6
commit f05ddef5fd
20 files changed
+280 -68

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
//
// Helper routine for burst IEC protocol support
//
//
// Based on idea by Pasi 'Albert' Ojala
//
#if CONFIG_IEC_BURST_CIA1
burst_detect:
#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS
lda IECPROTO
bmi !+
bne burst_detect_fail // skip if other protocol already detected
!:
#endif
panic #$FF // XXX implement this
burst_detect_fail:
rts
#endif
+66
View File
@@ -0,0 +1,66 @@
//
// Helper routine for burst IEC protocol support
//
//
// Based on idea by Pasi 'Albert' Ojala
//
#if CONFIG_IEC_BURST_CIA2
burst_detect:
#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS
lda IECPROTO
bmi !+
bne burst_detect_fail // skip if other protocol already detected
!:
#endif
// For extra safety, do it on disabled interupts
php
sei
// Set the clock rate to the fastest possible
ldy #$01
sty CIA2_TIMALO
dey
sty CIA2_TIMAHI
// Prepare registers for transfer
lda #$C1
sta CIA2_CRA // start timer A, serial out, TOD 50Hz
bit CIA2_ICR // clear interrupt register
// Send test byte
lda #$FF // $FF keeps DATA released, see https://www.c64-wiki.com/wiki/Fast_serial_bus_protocol
sta CIA2_SDR
// Wait until byte sent
lda #$08 // interrupt mask
!:
bit CIA2_ICR
beq !-
// Now see if we get any byte back
lda CIA2_SDR // XXX we do not need a value, we need to know if it was received
panic #$00 // XXX finish this routine
plp
// FALLTROUGH
burst_detect_fail:
rts
#endif
+27
View File
@@ -0,0 +1,27 @@
//
// Helper routine for burst IEC protocol support
//
#if CONFIG_IEC_BURST_SOFT
burst_detect:
#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS
lda IECPROTO
bmi !+
bne burst_detect_fail // skip if other protocol already detected
!:
#endif
panic #$FF // XXX implement this
burst_detect_fail:
rts
#endif
-21
View File
@@ -1,21 +0,0 @@
//
// Common routines for multiple IEC fact protocols
//
#if (CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS) && !CONFIG_MEMORY_MODEL_60K
iec_update_EAL_by_Y: // note: Carry has to be set by caller!
tya
adc EAL+0
sta EAL+0
bcc !+
inc EAL+1
!:
rts
#endif
+3 -3
View File
@@ -20,7 +20,7 @@ jiffydos_load:
// Timing is critical, do not allow interrupts
sei
#if CONFIG_IEC_BLANK_SCREEN
#if CONFIG_IEC_JIFFYDOS_BLANK
// Preserve register with screen status (blank/visibe)
lda VIC_SCROLY
@@ -57,7 +57,7 @@ jiffydos_load_loop:
lda CIA2_PRA
and #$FF - BIT_CIA2_PRA_DAT_OUT // release
#if CONFIG_IEC_BLANK_SCREEN
#if CONFIG_IEC_JIFFYDOS_BLANK
// It seems JiffyDOS needs some time here; waste few cycles
nop
@@ -143,7 +143,7 @@ jiffydos_load_end:
lda #$01
sta IECPROTO
#if CONFIG_IEC_BLANK_SCREEN
#if CONFIG_IEC_JIFFYDOS_BLANK
// Restore screen state
lda TBTCNT