over 20 bytes saved in IEC LOAD code
This commit is contained in:
1 parent
3d9e713f07
commit
966658eae0
1 file changed
+32
-33
+32
-33
@@ -4,6 +4,16 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
|
load_iec_dev_not_found:
|
||||||
|
jmp lvs_device_not_found_error
|
||||||
|
|
||||||
|
load_iec_file_not_found:
|
||||||
|
jmp kernalerror_FILE_NOT_FOUND
|
||||||
|
|
||||||
|
load_iec_error:
|
||||||
|
jmp lvs_load_verify_error
|
||||||
|
|
||||||
|
|
||||||
load_iec:
|
load_iec:
|
||||||
|
|
||||||
// Display SEARCHING FOR + filename
|
// Display SEARCHING FOR + filename
|
||||||
@@ -16,51 +26,43 @@ load_iec:
|
|||||||
// Call device to LISTEN (p16)
|
// Call device to LISTEN (p16)
|
||||||
lda FA
|
lda FA
|
||||||
jsr LISTEN
|
jsr LISTEN
|
||||||
bcc !+
|
bcs load_iec_dev_not_found
|
||||||
jmp lvs_device_not_found_error // XXX deduplicate with other jumps in this routine
|
|
||||||
!:
|
|
||||||
// Open channel 0 (reserved for file reading)
|
// Open channel 0 (reserved for file reading)
|
||||||
lda #$00
|
lda #$00
|
||||||
jsr iec_cmd_open
|
jsr iec_cmd_open
|
||||||
bcc !+
|
bcs load_iec_dev_not_found
|
||||||
jmp lvs_device_not_found_error // XXX deduplicate with other jumps in this routine
|
|
||||||
!:
|
|
||||||
// Send file name
|
// Send file name
|
||||||
jsr lvs_send_file_name
|
jsr lvs_send_file_name
|
||||||
bcc !+
|
bcs load_iec_error
|
||||||
jmp lvs_load_verify_error // XXX deduplicate with other jumps in this routine
|
|
||||||
!:
|
|
||||||
// Now command device to talk (p16)
|
// Now command device to talk (p16)
|
||||||
lda FA
|
lda FA
|
||||||
jsr TALK
|
jsr TALK
|
||||||
bcc !+
|
bcs load_iec_error
|
||||||
jmp lvs_load_verify_error // XXX deduplicate with other jumps in this routine
|
|
||||||
!:
|
|
||||||
lda #$60 // open channel / data (p3) , required according to p13
|
lda #$60 // open channel / data (p3) , required according to p13
|
||||||
sta TBTCNT
|
sta TBTCNT
|
||||||
jsr iec_tx_command
|
jsr iec_tx_command
|
||||||
bcc !+
|
bcs load_iec_error
|
||||||
jmp lvs_load_verify_error // XXX deduplicate with other jumps in this routine
|
|
||||||
!:
|
|
||||||
// We are currently talker, so do the IEC turn around so that we
|
// We are currently talker, so do the IEC turn around so that we
|
||||||
// are the listener (p16)
|
// are the listener (p16)
|
||||||
jsr iec_turnaround_to_listen
|
jsr iec_turnaround_to_listen
|
||||||
bcc !+
|
bcs load_iec_error
|
||||||
jmp lvs_load_verify_error // XXX deduplicate with other jumps in this routine
|
|
||||||
!:
|
|
||||||
// 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
|
||||||
bcc !+
|
bcs load_iec_file_not_found
|
||||||
jmp kernalerror_FILE_NOT_FOUND // XXX deduplicate with other jumps in this routine
|
|
||||||
!:
|
|
||||||
ldx SA
|
ldx SA
|
||||||
beq !+
|
beq !+
|
||||||
sta STAL+0
|
sta STAL+0
|
||||||
!:
|
!:
|
||||||
jsr iec_rx_byte
|
jsr iec_rx_byte
|
||||||
bcc !+
|
bcs load_iec_file_not_found
|
||||||
jmp kernalerror_FILE_NOT_FOUND // XXX deduplicate with other jumps in this routine
|
|
||||||
!:
|
|
||||||
ldx SA
|
ldx SA
|
||||||
beq !+
|
beq !+
|
||||||
sta STAL+1
|
sta STAL+1
|
||||||
@@ -71,19 +73,16 @@ load_iec:
|
|||||||
iec_load_loop:
|
iec_load_loop:
|
||||||
// We are now ready to receive bytes
|
// We are now ready to receive bytes
|
||||||
jsr iec_rx_byte
|
jsr iec_rx_byte
|
||||||
bcc !+
|
bcs load_iec_error
|
||||||
jmp lvs_load_verify_error // XXX deduplicate with other jumps in this routine
|
|
||||||
!:
|
|
||||||
// Handle the byte (store in memory / verify)
|
// Handle the byte (store in memory / verify)
|
||||||
jsr lvs_handle_byte_load_verify
|
jsr lvs_handle_byte_load_verify
|
||||||
bcc !+
|
bcs load_iec_error
|
||||||
jmp lvs_load_verify_error // XXX deduplicate with other jumps in this routine
|
|
||||||
!:
|
|
||||||
// Advance pointer to data
|
// Advance pointer to data
|
||||||
jsr lvs_advance_pointer
|
jsr lvs_advance_pointer
|
||||||
bcc !+
|
bcs_far lvs_wrap_around_error
|
||||||
jmp lvs_wrap_around_error
|
|
||||||
!:
|
|
||||||
// Check for EOI - if so, this was the last byte
|
// Check for EOI - if so, this was the last byte
|
||||||
lda IOSTATUS
|
lda IOSTATUS
|
||||||
and #K_STS_EOI
|
and #K_STS_EOI
|
||||||
|
|||||||
Reference in new issue
Block a user