fix detection and reporting of FILE NOT FOUND error
This commit is contained in:
1 parent
4ddd31176e
commit
1005ee4952
4 files changed
+33
-22
No files matched your search
@@ -64,7 +64,7 @@ got_filename:
|
|||||||
;; error code to X, decrement, and handle normally
|
;; error code to X, decrement, and handle normally
|
||||||
tax
|
tax
|
||||||
dex
|
dex
|
||||||
jmp do_LOAD_error
|
jmp do_basic_error
|
||||||
|
|
||||||
*
|
*
|
||||||
;; $YYXX is the last loaded address, so store it
|
;; $YYXX is the last loaded address, so store it
|
||||||
|
|||||||
@@ -23,6 +23,14 @@ iec_rx_clk_wait:
|
|||||||
rol
|
rol
|
||||||
bpl not_eoi
|
bpl not_eoi
|
||||||
dex
|
dex
|
||||||
|
cpx #$21
|
||||||
|
bne not_rx_timeout
|
||||||
|
;; Time out waiting for CLK to assert again.
|
||||||
|
;; = error
|
||||||
|
sec
|
||||||
|
rts
|
||||||
|
not_rx_timeout:
|
||||||
|
cpx #$00
|
||||||
bpl iec_rx_clk_wait
|
bpl iec_rx_clk_wait
|
||||||
|
|
||||||
;; Remember EOI condition
|
;; Remember EOI condition
|
||||||
@@ -35,8 +43,6 @@ iec_rx_clk_wait:
|
|||||||
jsr iec_wait60us
|
jsr iec_wait60us
|
||||||
jsr iec_release_clk_and_data
|
jsr iec_release_clk_and_data
|
||||||
|
|
||||||
;; Assert some kind of flag so that we know if it was EOI = the last byte on offer
|
|
||||||
|
|
||||||
;; And still wait for CLK to be asserted
|
;; And still wait for CLK to be asserted
|
||||||
;; XXX - This will cause periodic EOI pulses if the sender takes too long.
|
;; XXX - This will cause periodic EOI pulses if the sender takes too long.
|
||||||
;; That is probably ok.
|
;; That is probably ok.
|
||||||
|
|||||||
@@ -18,23 +18,22 @@ iec_turnaround_to_listen:
|
|||||||
;; page 8 tells us we should not do anything here after waiting for
|
;; page 8 tells us we should not do anything here after waiting for
|
||||||
;; the clock line to assert.
|
;; the clock line to assert.
|
||||||
|
|
||||||
;; ldx #$ff
|
ldx #$ff
|
||||||
;; * lda $dd00
|
* lda $dd00
|
||||||
;; and #$40
|
and #$40
|
||||||
;; bne +
|
bne +
|
||||||
;; dex
|
dex
|
||||||
;; bne -
|
bne -
|
||||||
|
|
||||||
;; jsr printf
|
jsr printf
|
||||||
;; .byte "TURNAROUND FAILED - FILE NOT FOUND?",$0d,$00
|
.byte "TURNAROUND FAILED - FILE NOT FOUND?",$0d,$00
|
||||||
|
|
||||||
;; ;; Timeout = file not found error
|
;; ;; Timeout = file not found error
|
||||||
;; ;; (https://www.pagetable.com/?p=1023)
|
;; ;; (https://www.pagetable.com/?p=1023)
|
||||||
;; lda #4
|
lda #4
|
||||||
;; sec
|
sec
|
||||||
;; rts
|
rts
|
||||||
*
|
*
|
||||||
|
|
||||||
;; ATN turn around successful
|
;; ATN turn around successful
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
+13
-7
@@ -126,24 +126,23 @@ sent_filename:
|
|||||||
jsr iec_turnaround_to_listen
|
jsr iec_turnaround_to_listen
|
||||||
bcs load_error
|
bcs load_error
|
||||||
|
|
||||||
jsr printf
|
|
||||||
.byte "LOADING",$0d,0
|
|
||||||
|
|
||||||
|
|
||||||
;; Get load address and store it if secondary address is zero
|
;; Get load address and store it if secondary address is zero
|
||||||
jsr iec_rx_byte
|
jsr iec_rx_byte
|
||||||
bcs load_error
|
bcs file_not_found_error
|
||||||
ldx current_secondary_address
|
ldx current_secondary_address
|
||||||
beq +
|
beq +
|
||||||
sta load_save_start_ptr+0
|
sta load_save_start_ptr+0
|
||||||
*
|
*
|
||||||
jsr iec_rx_byte
|
jsr iec_rx_byte
|
||||||
bcs load_error
|
bcs file_not_found_error
|
||||||
ldx current_secondary_address
|
ldx current_secondary_address
|
||||||
beq +
|
beq +
|
||||||
sta load_save_start_ptr+1
|
sta load_save_start_ptr+1
|
||||||
*
|
*
|
||||||
|
|
||||||
|
jsr printf
|
||||||
|
.byte "LOADING",$0d,0
|
||||||
|
|
||||||
load_loop:
|
load_loop:
|
||||||
;; We are now ready to receive bytes
|
;; We are now ready to receive bytes
|
||||||
jsr iec_rx_byte
|
jsr iec_rx_byte
|
||||||
@@ -206,10 +205,17 @@ load_error:
|
|||||||
|
|
||||||
;; XXX - Indicate KERNAL (not BASIC) LOAD error condtion
|
;; XXX - Indicate KERNAL (not BASIC) LOAD error condtion
|
||||||
sec
|
sec
|
||||||
lda #$02
|
lda #28
|
||||||
|
|
||||||
;; Re-enable interrupts and return
|
;; Re-enable interrupts and return
|
||||||
cli
|
cli
|
||||||
;; (iec_tx_byte will have set/cleared C flag and put result code
|
;; (iec_tx_byte will have set/cleared C flag and put result code
|
||||||
;; in A if it was an error).
|
;; in A if it was an error).
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
file_not_found_error:
|
||||||
|
;; Indicate KERNAL error condition for file not found
|
||||||
|
sec
|
||||||
|
lda #$04
|
||||||
|
cli
|
||||||
|
rts
|
||||||
Reference in new issue
Block a user