IEC code compatibility improvements

This commit is contained in:
FeralChild64 committed 2019-10-06 13:02:14 +02:00
1 parent 77320e2e91
commit 1480350bfb
3 files changed
+16 -8

No files matched your search

+6 -6
View File
@@ -13,7 +13,9 @@ iec_rx_byte:
pha
// Timing is critical here - execute on disabled IRQs
php
// The best practice would be to do PHP first, but it seems this is not
// what the original ROM does; furthermore, pushing additional bytes to
// stack can wreck autostart softwaree loading at $0100
sei
// First, we wait for the talker to release the CLK line
@@ -107,8 +109,7 @@ iec_rx_clk_wait2:
// Timeout
jsr kernalstatus_EOI
pla
plp
// Restore registers
pla
tay
@@ -116,6 +117,7 @@ iec_rx_clk_wait2:
tax
sec // XXX confirm that sec is really a way to report timeout here
cli
rts
!:
// More bits?
@@ -130,9 +132,6 @@ iec_rx_clk_wait2:
// Retreive the received byte
pla
// Return no-error
plp
// Restore registers
sta TBTCNT // $A4 is a byte buffer according to http://sta.c64.org/cbm64mem.html
@@ -143,5 +142,6 @@ iec_rx_clk_wait2:
lda TBTCNT
clc
cli
rts
+4 -2
View File
@@ -26,7 +26,9 @@ iec_tx_byte:
iec_tx_common:
// Timing is critical here - execute on disabled IRQs
php
// The best practice would be to do PHP first, but it seems this is not
// what the original ROM does; furthermore, pushing additional bytes to
// stack can wreck autostart softwaree loading at $0100
sei
// Wait till all receivers are ready, they should all release DATA
@@ -79,7 +81,7 @@ iec_tx_common_bit_is_sent:
dex
bpl iec_tx_common_sendbit
plp
cli
// Give device time to tell if they are busy by pulling DATA
// They should do it within 1ms
+6
View File
@@ -41,6 +41,7 @@ lvs_handle_byte_load_verify:
// Thus we have to use a helper routine in low memory
// to do the memory access
#if CONFIG_MEMORY_MODEL_60K
// Save byte under ROMs and IO if required
php
sei
@@ -52,6 +53,11 @@ lvs_handle_byte_load_verify:
ldx #$37
stx $01
plp
#else
ldy #0
sta (STAL),y
#endif
rts
lvs_advance_pointer: