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