cleanup in multiprotocol IEC support

This commit is contained in:
FeralChild64 committed 2020-08-22 22:20:51 +02:00
1 parent 274a3c070a
commit 379eb746fe
10 files changed
+33 -18

No files matched your search

+20 -5
View File
@@ -103,11 +103,7 @@
.label PTR1 = $9E // for tape support, counter of errorneous bytes
.label PTR2 = $9F // for tape support, counter for errorneous bytes correction
.label TIME = $A0 // $A0-$A2 jiffy clock
#if !CONFIG_IEC_JIFFYDOS && !CONFIG_IEC_DOLPHINDOS && !CONFIG_IEC_BURST_CIA1 && !CONFIG_IEC_BURST_CIA2 && !CONFIG_IEC_BURST_MEGA_65
.label TSFCNT = $A3 // temporary variable for tape and IEC, [!] our usage differs
#else
.label IECPROTO = $A3 // -- WIP -- [!] 0 = normal, 1 = JiffyDOS, >= $80 for unknown
#endif
.label IECPROTO = $A3 // [!] IEC or pseudo-IEC protocol, >= $80 for unknown; originally named TSFCNT
.label TBTCNT = $A4 // temporary variable for tape and IEC, [!] our usage probably differs in details
.label CNTDN = $A5 // -- NOT IMPLEMENTED --
.label BUFPNT = $A6 // -- NOT IMPLEMENTED --
@@ -290,6 +286,25 @@
// $3FC $3FC-$3FF -- UNUSED -- free for user software
//
// Definitions for extended IEC functionality
//
.const IEC_NORMAL = 0 // has to be 0, always!
#if CONFIG_IEC_JIFFYDOS
.const IEC_JIFFY = 1 // has to be 1, always!
#endif
#if CONFIG_IEC_DOLPHINDOS
.const IEC_DOLPHIN = 2
#endif
#if CONFIG_IEC_BURST_CIA1 || CONFIG_IEC_BURST_CIA2 || ROM_LAYOUT_M65
.const IEC_BURST = 3
#endif
#if ROM_LAYOUT_M65
.const IEC_ROMDOS = 4
#endif
//
// Definitions for tape functionality
//
+2 -2
View File
@@ -17,7 +17,7 @@
iec_rx_dispatch:
lda IECPROTO
cmp #$01
cmp #IEC_JIFFY
beq_16 jiffydos_rx_byte
// FALLTROUGH
@@ -54,7 +54,7 @@ iec_rx_byte:
// Check if DolphinDOS was detected
lda IECPROTO
cmp #$02
cmp #IEC_DOLPHIN
bne iec_rx_no_dolphindos
// For DolphinDOS just fetch the byte from parallel port
+2 -2
View File
@@ -19,7 +19,7 @@ iec_tx_dispatch:
php // preserve C flag for EOI indication
lda IECPROTO
cmp #$01
cmp #IEC_JIFFY
bne !+
plp
@@ -71,7 +71,7 @@ iec_tx_common:
// Check if DolphinDOS was detected
lda IECPROTO
cmp #$02
cmp #IEC_DOLPHIN
bne iec_tx_no_dolphindos
// For DolphinDOS just push the byte to parallel port (set it to output first)
+2 -2
View File
@@ -107,12 +107,12 @@ load_iec:
lda IECPROTO
#if CONFIG_IEC_JIFFYDOS
cmp #$01
cmp #IEC_JIFFY
beq_16 jiffydos_load // branch if JiffyDOS
#endif
#if CONFIG_IEC_DOLPHINDOS
cmp #$02
cmp #IEC_DOLPHIN
beq_16 dolphindos_load // branch if DolphinDOS
#endif
+1 -1
View File
@@ -56,7 +56,7 @@ dolphindos_detect_success:
// Protocol detected
lda #$02
lda #IEC_DOLPHIN
sta IECPROTO
rts
+1 -1
View File
@@ -76,7 +76,7 @@ dolphindos_load_loop:
jsr iec_update_EAL_by_Y
// Restore proper IECPROTO value
lda #$02
lda #IEC_DOLPHIN
sta IECPROTO
// End of load loop
+2 -2
View File
@@ -33,12 +33,12 @@ jiffydos_detect_loop:
lda IECPROTO
bpl jiffydos_detect_end // no detection requested, preserve existing protocol
lda #$00 // normal protocol
lda #IEC_NORMAL // normal protocol
beq jiffydos_store_proto // branch always
jiffydos_detected:
jsr iec_wait_for_data_release // guessed from VICE logs
lda #$01 // JiffyDOS protocol
lda #IEC_JIFFY // JiffyDOS protocol
// FALLTROUGH
+1 -1
View File
@@ -145,7 +145,7 @@ jiffydos_load_end:
sta C3PO
// Restore proper IECPROTO value
lda #$01
lda #IEC_JIFFY
sta IECPROTO
#if CONFIG_IEC_JIFFYDOS_BLANK
+1 -1
View File
@@ -102,7 +102,7 @@ jiffydos_rx_byte_end:
sta C3PO
// Restore proper IECPROTO value
lda #$01
lda #IEC_JIFFY
sta IECPROTO
// Re-enable sprites
+1 -1
View File
@@ -83,7 +83,7 @@ jiffydos_tx_byte_finalize:
sta CIA2_PRA
// Restore proper IECPROTO value
lda #$01
lda #IEC_JIFFY
sta IECPROTO
// Re-enable sprites and interrupts