implemented MERGE command
This commit is contained in:
1 parent
6639ac5609
commit
c3335393c2
6 files changed
+105
-32
No files matched your search
@@ -50,6 +50,9 @@ cmd_load_got_params: // input for tape wedge
|
|||||||
|
|
||||||
ldy TXTTAB+1
|
ldy TXTTAB+1
|
||||||
ldx TXTTAB+0
|
ldx TXTTAB+0
|
||||||
|
|
||||||
|
cmd_load_loadmerge: // entry point for 'cmd_merge'
|
||||||
|
|
||||||
lda VERCKB // LOAD or VERIFY
|
lda VERCKB // LOAD or VERIFY
|
||||||
|
|
||||||
jsr JLOAD
|
jsr JLOAD
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
// #LAYOUT# STD * #TAKE
|
|
||||||
// #LAYOUT# * BASIC_0 #TAKE
|
|
||||||
// #LAYOUT# * * #IGNORE
|
|
||||||
|
|
||||||
|
|
||||||
cmd_bload:
|
|
||||||
|
|
||||||
jmp do_NOT_IMPLEMENTED_error // XXX implement the command
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
// #LAYOUT# STD * #TAKE
|
||||||
|
// #LAYOUT# * BASIC_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
|
||||||
|
cmd_bverify:
|
||||||
|
|
||||||
|
// LOAD and VERIFY are very similar, from BASIC perspective there is almost no difference;
|
||||||
|
// just different parameter passed to Kernal and different error message in case of failure
|
||||||
|
|
||||||
|
lda #$01 // mark operation as VERIFY
|
||||||
|
skip_2_bytes_trash_nvz
|
||||||
|
|
||||||
|
cmd_bload:
|
||||||
|
|
||||||
|
lda #$00 // mark operation as LOAD
|
||||||
|
sta VERCKB
|
||||||
|
|
||||||
|
// Set default device and secondary address; channel is not important now
|
||||||
|
|
||||||
|
jsr select_device
|
||||||
|
ldy #$00 // secondary address 0 - it has to be loaded precisely where we want
|
||||||
|
jsr JSETFLS
|
||||||
|
|
||||||
|
// Fetch the file name
|
||||||
|
|
||||||
|
jsr 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
|
||||||
|
!:
|
||||||
|
// XXX finish the implementation
|
||||||
|
|
||||||
|
jmp do_NOT_IMPLEMENTED_error
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
// #LAYOUT# STD * #TAKE
|
|
||||||
// #LAYOUT# * BASIC_0 #TAKE
|
|
||||||
// #LAYOUT# * * #IGNORE
|
|
||||||
|
|
||||||
|
|
||||||
cmd_bverify:
|
|
||||||
|
|
||||||
jmp do_NOT_IMPLEMENTED_error // XXX implement the command
|
|
||||||
@@ -5,4 +5,46 @@
|
|||||||
|
|
||||||
cmd_merge:
|
cmd_merge:
|
||||||
|
|
||||||
jmp do_NOT_IMPLEMENTED_error // XXX implement the command
|
lda #$00 // mark operation as LOAD
|
||||||
|
sta VERCKB
|
||||||
|
|
||||||
|
// Set default device and secondary address; channel is not important now
|
||||||
|
|
||||||
|
jsr select_device
|
||||||
|
ldy #$00 // secondary address 0 - it has to be loaded precisely where we want
|
||||||
|
jsr JSETFLS
|
||||||
|
|
||||||
|
// Fetch the file name
|
||||||
|
|
||||||
|
jsr 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
|
||||||
|
!:
|
||||||
|
// Fetch device number
|
||||||
|
|
||||||
|
jsr fetch_device_secondary_uint8
|
||||||
|
bcs !+
|
||||||
|
|
||||||
|
sta FA
|
||||||
|
!:
|
||||||
|
// Perform loading - just for a different address
|
||||||
|
|
||||||
|
sec
|
||||||
|
lda VARTAB+0
|
||||||
|
sbc #$02
|
||||||
|
sta VARTAB+0
|
||||||
|
tax
|
||||||
|
bcs !+
|
||||||
|
dec VARTAB+1
|
||||||
|
!:
|
||||||
|
ldy VARTAB+1
|
||||||
|
|
||||||
|
jmp cmd_load_loadmerge // XXX check variable handling (VARTAB) after failure to load
|
||||||
@@ -11,15 +11,9 @@ fetch_device_secondary:
|
|||||||
|
|
||||||
// Fetch the device number
|
// Fetch the device number
|
||||||
|
|
||||||
jsr injest_comma
|
jsr fetch_device_secondary_uint8
|
||||||
bcs fetch_secondary
|
bcs fetch_device_secondary_done
|
||||||
|
|
||||||
jsr injest_spaces
|
|
||||||
jsr basic_parse_line_number
|
|
||||||
lda LINNUM+1
|
|
||||||
bne_16 do_ILLEGAL_QUANTITY_error
|
|
||||||
|
|
||||||
lda LINNUM+0
|
|
||||||
sta FA
|
sta FA
|
||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
@@ -28,15 +22,9 @@ fetch_secondary:
|
|||||||
|
|
||||||
// Fetch secondary address
|
// Fetch secondary address
|
||||||
|
|
||||||
jsr injest_comma
|
jsr fetch_device_secondary_uint8
|
||||||
bcs fetch_device_secondary_done
|
bcs fetch_device_secondary_done
|
||||||
|
|
||||||
jsr injest_spaces
|
|
||||||
jsr basic_parse_line_number
|
|
||||||
lda LINNUM+1
|
|
||||||
bne_16 do_ILLEGAL_QUANTITY_error
|
|
||||||
|
|
||||||
lda LINNUM+0
|
|
||||||
sta SA
|
sta SA
|
||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
@@ -44,3 +32,18 @@ fetch_secondary:
|
|||||||
fetch_device_secondary_done:
|
fetch_device_secondary_done:
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
fetch_device_secondary_uint8: // also called by 'cmd_merge'
|
||||||
|
|
||||||
|
jsr injest_comma
|
||||||
|
bcs !+
|
||||||
|
|
||||||
|
jsr injest_spaces
|
||||||
|
jsr basic_parse_line_number
|
||||||
|
lda LINNUM+1
|
||||||
|
bne_16 do_ILLEGAL_QUANTITY_error
|
||||||
|
lda LINNUM+0
|
||||||
|
clc
|
||||||
|
!:
|
||||||
|
rts
|
||||||
Reference in new issue
Block a user