IEC routines can now be called with enabled IRQs

This commit is contained in:
FeralChild64 committed 2019-07-17 21:56:42 +02:00
1 parent 152120a3fe
commit 6bf715e610
3 files changed
+14 -9

No files matched your search

+6
View File
@@ -4,6 +4,10 @@
iec_rx_byte:
;; Timing is critical here - execute on disabled IRQs
php
sei
;; First, we wait for the talker to release the CLK line
jsr iec_wait_for_clk_release
@@ -95,6 +99,7 @@ iec_rx_clk_wait2:
;; Timeout
jsr kernalstatus_EOI
pla
plp
sec ; XXX confirm that sec is really a way to report timeout here
rts
*
@@ -112,6 +117,7 @@ iec_rx_clk_wait2:
pla
;; Return no-error
plp
clc
rts
+5
View File
@@ -5,6 +5,10 @@
iec_tx_common:
;; Timing is critical here - execute on disabled IRQs
php
sei
;; Store the byte to send on a stack
pha
@@ -64,6 +68,7 @@ iec_tx_common_bit_is_sent:
bpl iec_tx_common_nextbit
pla
plp
rts ; Flow continues differently for data/command
iec_tx_common_nextbit:
+3 -9
View File
@@ -33,9 +33,6 @@ load:
;; We need our helpers to get to filenames under ROMs or IO area
jsr install_ram_routines
;; Disable IRQs, since timing matters!
sei
;; Display SEARCHING FOR + filename
lda MSGFLG
@@ -162,12 +159,15 @@ load_loop:
;; to do the memory access
;; Save byte under ROMs and IO if required
php
sei
ldx #$33
stx $01
ldy #0
sta (load_save_start_ptr),y
ldx #$37
stx $01
plp
;; Advance pointer
inc load_save_start_ptr
@@ -221,34 +221,28 @@ load_done:
ldy load_save_start_ptr+1
clc
cli
rts
load_wrap_around_error:
;; This error is probably not even detected by C64 Kernal;
;; report BASIC error code that looks the most sane
cli
lda #B_ERR_OVERFLOW
sec
rts
rts
load_device_not_found_error:
cli
jsr kernalstatus_DEVICE_NOT_FOUND
jmp kernalerror_DEVICE_NOT_FOUND
load_file_not_found_error:
cli
jmp kernalerror_FILE_NOT_FOUND
load_error:
;; XXX should we really return BASIC error code here?
cli
lda kernal_load_or_verify_flag
beq load_verify_error
lda #B_ERR_LOAD