LOAD command understands device number and secondary address

This commit is contained in:
FeralChild64 committed 2019-07-20 17:59:24 +02:00
1 parent 2613553ef3
commit c7727d4f0f
3 files changed
+58 -9

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ Here are the features of the Open ROMs not found in the original ROMs from the 8
* banking in the BASIC interpreter: 61436 bytes free * banking in the BASIC interpreter: 61436 bytes free
* LOAD start/end addresses are displayed, in the Final cartridge style * LOAD start/end addresses are displayed, in the Final cartridge style
* LOAD command with just the file name tries to use the last device if it's number seems sane; otherwise uses 8 * LOAD command with just the file name tries to use the last device if it's number seems sane; otherwise uses 8
* LOAD secondary address over 255 is considered a start address; NOTE: syntax will most likely change here in the future!
# Features missing # Features missing
+37 -8
View File
@@ -20,10 +20,6 @@ cmd_load:
* *
jsr JSETMSG jsr JSETMSG
;; XXX handle device number from arguments, if not present, use the call below
jsr select_device
stx current_device_number
;; Set filename and length ;; Set filename and length
lda #$00 lda #$00
sta FNLEN sta FNLEN
@@ -62,13 +58,46 @@ getting_filename:
got_filename: got_filename:
;; Try to load an IEC file ;; Now fetch the file number, start from the default one
lda #0 ; use supplied load address, not the one from the file jsr select_device
stx current_device_number
jsr injest_comma
bcs got_devicenumber
jsr basic_parse_line_number
lda basic_line_number+1
bne do_ILLEGAL_QUANTITY_error
lda basic_line_number+0
sta current_device_number
got_devicenumber:
;; Now fetch the secondary address
lda #$00
sta current_secondary_address sta current_secondary_address
lda #$00 ; LOAD not verify jsr injest_comma
ldx #<$0801 ; LOAD address = $0801 bcs got_secondaryaddress
jsr basic_parse_line_number
lda basic_line_number+1
bne +
lda basic_line_number+0
sta current_secondary_address
jmp got_secondaryaddress
*
;; Second parameter is above 255, this can't be a secondary address
;; Use it as load address instead
;; XXX temporary syntax, it would be better to use something
;; XXX like 'LOAD"FILE",8 TO 49152'
ldx basic_line_number+0
ldy basic_line_number+1
bne got_loadaddress
got_secondaryaddress:
ldx #<$0801
ldy #>$0801 ldy #>$0801
got_loadaddress:
lda #$00 ; LOAD not verify
jsr JLOAD jsr JLOAD
bcc + bcc +
+20
View File
@@ -0,0 +1,20 @@
;; Consummes a comma in a BASIC code, C set for no coma found
injest_comma:
jsr basic_fetch_and_consume_character
cmp #$2C ; comma character
beq injest_comma_found
cmp #$20
beq injest_comma ; space, can always be skipped
;; not found
jsr basic_unconsume_character
sec
rts
injest_comma_found:
clc
rts