removed 'branch out of range' warnings

This commit is contained in:
FeralChild64 committed 2019-09-02 20:56:37 +02:00
1 parent a4114dd0d1
commit e0bbee443b
8 files changed
+76 -43

No files matched your search

+3 -2
View File
@@ -30,8 +30,9 @@ basic_execute_statement:
;; Check for RUN/STOP ;; Check for RUN/STOP
lda STKEY lda STKEY
bpl basic_do_break bmi +
jmp basic_do_break
*
;; Skip over any white space and : ;; Skip over any white space and :
ldy #0 ldy #0
ldx #<basic_current_statement_ptr ldx #<basic_current_statement_ptr
+3 -1
View File
@@ -66,7 +66,9 @@ got_filename:
jsr basic_parse_line_number jsr basic_parse_line_number
lda basic_line_number+1 lda basic_line_number+1
bne do_ILLEGAL_QUANTITY_error beq +
jmp do_ILLEGAL_QUANTITY_error
*
lda basic_line_number+0 lda basic_line_number+0
sta current_device_number sta current_device_number
+17 -9
View File
@@ -17,11 +17,13 @@ wedge_dos:
;; Check if user asked for a status ;; Check if user asked for a status
ldy #$00 ldy #$00
lda (basic_current_statement_ptr), y lda (basic_current_statement_ptr), y
beq wedge_dos_status bne +
jmp wedge_dos_status ; XXX try to optimize this, perhaps move 'wedge_dos_status' above?
*
;; Check if asked for a directory ;; Check if asked for a directory
cmp #$24 cmp #$24
beq wedge_dos_directory bne +
jmp wedge_dos_directory
* *
;; Check if asked to change drive number, or if it is a regular command ;; Check if asked to change drive number, or if it is a regular command
cmp #$30 cmp #$30
@@ -42,8 +44,9 @@ wedge_dos_command:
jsr JSETNAM jsr JSETNAM
jsr JOPEN jsr JOPEN
bcs wedge_dos_basic_error bcc +
jmp wedge_dos_basic_error ; XXX combine with other such jumps
*
;; Retrieve status, print it if not OK ;; Retrieve status, print it if not OK
jsr JCLALL jsr JCLALL
jsr wedge_dos_status_get jsr wedge_dos_status_get
@@ -83,12 +86,16 @@ wedge_dos_status_get:
lda #$00 ; empty file name lda #$00 ; empty file name
jsr JSETNAM jsr JSETNAM
jsr JOPEN jsr JOPEN
bcs wedge_dos_basic_error bcc +
jmp wedge_dos_basic_error ; XXX combine with other such jumps
*
;; Set channel for input ;; Set channel for input
ldx #$0F ldx #$0F
jsr JCHKIN jsr JCHKIN
bcs wedge_dos_basic_error bcc +
jmp wedge_dos_basic_error ; XXX combine with other such jumps
*
ldy #$00 ldy #$00
* *
@@ -99,7 +106,9 @@ wedge_dos_status_get:
;; Print out everything retrieved from the drive ;; Print out everything retrieved from the drive
bne + bne +
jsr JCHRIN jsr JCHRIN
bcs wedge_dos_basic_error bcc wedge_dos_x1
jmp wedge_dos_basic_error ; XXX try to optimize this
wedge_dos_x1:
sta BUF, y sta BUF, y
iny iny
jmp - jmp -
@@ -129,7 +138,6 @@ wedge_dos_directory:
;; First change the secondary address to the one suitable for ;; First change the secondary address to the one suitable for
;; directory loading ;; directory loading
;; XXX
lda #$00 ; logical device number lda #$00 ; logical device number
ldx current_device_number ldx current_device_number
ldy #$60 ldy #$60
+3 -2
View File
@@ -448,8 +448,9 @@ screen_grow_logical_line:
ldy current_screen_y ldy current_screen_y
;; Don't grow line if it is already grown ;; Don't grow line if it is already grown
lda screen_line_link_table,y lda screen_line_link_table,y
bmi done_grow_line bpl +
jmp done_grow_line
*
lda #$80 lda #$80
sta screen_line_link_table,y sta screen_line_link_table,y
+36 -22
View File
@@ -41,8 +41,9 @@ load:
;; Check whether we support the requested device ;; Check whether we support the requested device
lda current_device_number lda current_device_number
and #$FC and #$FC
beq lvs_illegal_device_number ; device number below 4, not an IEC device bne +
jmp lvs_illegal_device_number ; device number below 4, not an IEC device
*
;; Device numbers above 30 are also illegal (see https://www.pagetable.com/?p=1031), ;; Device numbers above 30 are also illegal (see https://www.pagetable.com/?p=1031),
;; as the protocol combines device number with command code int one byte, ;; as the protocol combines device number with command code int one byte,
;; above 30 it is no longer possible (UNLISTEN and UNTALK codes prevent using ;; above 30 it is no longer possible (UNLISTEN and UNTALK codes prevent using
@@ -60,41 +61,51 @@ load:
;; Call device to LISTEN (p16) ;; Call device to LISTEN (p16)
lda current_device_number lda current_device_number
jsr listen jsr listen
bcs lvs_device_not_found_error bcc +
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
bcs lvs_device_not_found_error bcc +
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
bcs lvs_load_verify_error bcc +
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 current_device_number lda current_device_number
jsr talk jsr talk
bcs lvs_load_verify_error bcc +
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 IEC_TMP2 sta IEC_TMP2
jsr iec_tx_command jsr iec_tx_command
bcs lvs_load_verify_error bcc +
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
bcs lvs_load_verify_error bcc +
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
bcs lvs_file_not_found_error bcc +
jmp lvs_file_not_found_error ; XXX deduplicate with other jumps in this routine
*
ldx current_secondary_address ldx current_secondary_address
beq + beq +
sta STAL+0 sta STAL+0
* *
jsr iec_rx_byte jsr iec_rx_byte
bcs lvs_file_not_found_error bcc +
jmp lvs_file_not_found_error ; XXX deduplicate with other jumps in this routine
*
ldx current_secondary_address ldx current_secondary_address
beq + beq +
sta STAL+1 sta STAL+1
@@ -105,16 +116,19 @@ load:
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
bcs lvs_load_verify_error bcc +
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
bcs lvs_load_verify_error bcc +
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
bcs lvs_wrap_around_error bcc +
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
+3 -2
View File
@@ -22,8 +22,9 @@ iec_tx_command:
;; Give devices time to respond (response is mandatory!) by pulling DATA ;; Give devices time to respond (response is mandatory!) by pulling DATA
jsr iec_wait1ms jsr iec_wait1ms
lda CIA2_PRA ; pulled DATA = highest bit 0 = 'plus' lda CIA2_PRA ; pulled DATA = highest bit 0 = 'plus'
bmi iec_return_DEVICE_NOT_FOUND bpl +
jmp iec_return_DEVICE_NOT_FOUND
*
;; At least one device responded, but they are still allowed to stall ;; At least one device responded, but they are still allowed to stall
;; (can be busy processing something), we have to wait till they are all ;; (can be busy processing something), we have to wait till they are all
;; ready (or bored with DOS attack...) ;; ready (or bored with DOS attack...)
+5 -2
View File
@@ -51,10 +51,13 @@ lvs_handle_byte_load_verify:
lvs_advance_pointer: lvs_advance_pointer:
;; Advance pointer ;; Advance pointer
inc STAL inc STAL
bne lvs_success_end beq +
jmp lvs_success_end
*
inc STAL+1 inc STAL+1
;; If we wrap around to $0000, then this is bad. ;; If we wrap around to $0000, then this is bad.
beq lvs_error_end bne +
jmp lvs_error_end
* *
clc clc
rts rts
+6 -3
View File
@@ -322,8 +322,9 @@ next_row:
stx $dc00 ;// Disconnect all Keyboard Rows stx $dc00 ;// Disconnect all Keyboard Rows
cpx $dc01 ;// Only Control Port activity will be detected cpx $dc01 ;// Only Control Port activity will be detected
bne ReturnNoKeys beq +
jmp ReturnNoKeys
*
;; Make X = $00, assumed below ;; Make X = $00, assumed below
inx inx
@@ -462,7 +463,9 @@ RecordKeypress:
;; // New Key Detected ;; // New Key Detected
ldy BufferQuantity ldy BufferQuantity
cpy #MaxKeyRollover cpy #MaxKeyRollover
bcs TooManyNewKeys bcc +
jmp TooManyNewKeys
*
AcceptKeyEvent: AcceptKeyEvent:
sta Buffer,y sta Buffer,y
iny iny