BLOAD/BVERIFY can now parse parameters and read data

This commit is contained in:
FeralChild64 committed 2020-06-24 17:30:49 +02:00
1 parent f2520eacb2
commit 4462a15061
6 files changed
+92 -42

No files matched your search

@@ -38,8 +38,6 @@ cmd_load_got_params: // input for tape wedge
ldy TXTTAB+1
ldx TXTTAB+0
cmd_load_loadmerge: // entry point for 'cmd_merge'
lda VERCKB // LOAD or VERIFY
jsr JLOAD
bcs_16 do_kernal_error
+18 -11
View File
@@ -18,18 +18,25 @@ cmd_bload:
// Fetch the file name
jsr helper_load_fetch_filename
bcc !+
jsr helper_bload_fetch_filename
// No filename supplied - this should only be allowed for tape (device number below 8)
// Fetch device number
lda FA
and #%11111000
bne_16 do_MISSING_FILENAME_error
jsr fetch_coma_uint8
bcs_16 do_SYNTAX_error
lda #$00
sta FNLEN
!:
// XXX finish the implementation
sta FA
jmp do_NOT_IMPLEMENTED_error
// Fetch the start address
jsr helper_bload_fetch_address
// Perform loading
lda VERCKB // LOAD or VERIFY
jsr JLOAD
bcs_16 do_kernal_error
// That is it - continue execution
jmp execute_line
+4 -17
View File
@@ -21,27 +21,14 @@ cmd_bsave:
// Fetch memory area start address
jsr injest_comma
bcs_16 do_SYNTAX_error
jsr helper_bload_fetch_address
jsr basic_parse_line_number // XXX detect errors here
lda LINNUM+0
pha
lda LINNUM+1
pha
phx_trash_a
phy_trash_a
// Fetch memory area end address
jsr injest_comma
bcs_16 do_SYNTAX_error
jsr basic_parse_line_number // XXX detect errors here
// Setup start/end addresses
ldx LINNUM+0
ldy LINNUM+1
jsr helper_bload_fetch_address
pla
sta LINNUM+1
+24 -12
View File
@@ -10,24 +10,16 @@ cmd_merge:
// Fetch the file name
jsr helper_load_fetch_filename
bcc !+
jsr helper_bload_fetch_filename
// No filename supplied - this should only be allowed for tape (device number below 8)
lda FA
and #%11111000
bne_16 do_MISSING_FILENAME_error
lda #$00
sta FNLEN
!:
// Fetch device number
jsr helper_load_fetch_devnum
// Perform loading - just for a different address
// XXX sometimes works, sometimes does not - probably improper handling of VARTAB somewhere
sec
lda VARTAB+0
sbc #$02
@@ -38,4 +30,24 @@ cmd_merge:
!:
ldy VARTAB+1
jmp cmd_load_loadmerge // XXX check variable handling (VARTAB) after failure to load
lda VERCKB // LOAD or VERIFY
jsr JLOAD
bcs_16 do_kernal_error
cmd_merge_no_error:
// Store last loaded address
stx VARTAB+0
sty VARTAB+1
// Clear the variables
jsr basic_do_clr
// Now relink the loaded program, line links supplied are almost certainly wrong
jsr LINKPRG
// Continue execution
jmp execute_statements
@@ -0,0 +1,20 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Fetches address for BLOAD/BVERIFY/BSAVE, reports error if not found
//
helper_bload_fetch_address:
jsr injest_comma
bcs_16 do_SYNTAX_error
jsr basic_parse_line_number // XXX detect errors here
ldx LINNUM+0
ldy LINNUM+1
rts
@@ -0,0 +1,26 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Fetches file name for BLOAD/BVERIFY/MERGE, reports error if not found
//
helper_bload_fetch_filename:
// Fetch the file name
jsr helper_load_fetch_filename
bcc !+
// No filename supplied - this should only be allowed for tape (device number below 8)
lda FA
and #%11111000
bne_16 do_MISSING_FILENAME_error
lda #$00
sta FNLEN
!:
rts