From 24a8e52ad3c4aabe746b13ecf059e8b4ed20a54a Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Mon, 2 Dec 2019 18:10:31 +0100 Subject: [PATCH] commented-out some dead code, improved ATN handling --- c64/kernal/errors.s | 22 ++++++++++++---------- c64/kernal/iec_fast/iec_tx_byte_jiffydos.s | 7 +++++-- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/c64/kernal/errors.s b/c64/kernal/errors.s index 70f9847e..73e6c552 100644 --- a/c64/kernal/errors.s +++ b/c64/kernal/errors.s @@ -63,17 +63,19 @@ kernalstatus_reset: sta IOSTATUS rts -kernalstatus_TIMEOUT_WRITE: // XXX detect this! - lda IOSTATUS - ora #K_STS_TIMEOUT_WRITE - sta IOSTATUS - rts +// The following two statuses are currentl not implemented - and most likely not really needed -kernalstatus_TIMEOUT_READ: // XXX detect this! - lda IOSTATUS - ora #K_STS_TIMEOUT_READ - sta IOSTATUS - rts +// kernalstatus_TIMEOUT_WRITE: +// lda IOSTATUS +// ora #K_STS_TIMEOUT_WRITE +// sta IOSTATUS +// rts + +// kernalstatus_TIMEOUT_READ: +// lda IOSTATUS +// ora #K_STS_TIMEOUT_READ +// sta IOSTATUS +// rts kernalstatus_EOI: lda IOSTATUS diff --git a/c64/kernal/iec_fast/iec_tx_byte_jiffydos.s b/c64/kernal/iec_fast/iec_tx_byte_jiffydos.s index 26b15c27..0cf331cc 100644 --- a/c64/kernal/iec_fast/iec_tx_byte_jiffydos.s +++ b/c64/kernal/iec_fast/iec_tx_byte_jiffydos.s @@ -20,6 +20,9 @@ iec_tx_byte_jiffydos: phx_trash_a phy_trash_a + // Make sure we are not sending data on ATN + jsr iec_release_atn + // Store previous sprite status on stack jsr jiffydos_prepare pha @@ -45,7 +48,7 @@ iec_tx_byte_jiffydos: // Notify device that we are going to send byte by releasing everything stx CIA2_PRA // cycles: 4 - + // Send high nibble; cycles: 4 + 3 + 4 + 2 + 2 + 2 + 3 + 4 = 24 pla // retrieve high nibble from stack ora C3PO // restore VIC-II and RS-232 bits @@ -96,7 +99,7 @@ iec_tx_byte_jiffydos_finalize: iec_tx_byte_jiffydos_wait_eoi: - jsr iec_wait20us // XXX is it enough? + jsr iec_wait60us // XXX is it enough? lda C3PO jmp iec_tx_byte_jiffydos_finalize