more I/O work in BASIC
This commit is contained in:
1 parent
524d532433
commit
e1d21e287f
10 files changed
+130
-29
No files matched your search
@@ -16,26 +16,19 @@ cmd_load:
|
||||
|
||||
lda #$00 // mark operation as LOAD
|
||||
jsr helper_load_init_params
|
||||
jsr helper_load_setnam_any // if no file name found, use "*"
|
||||
|
||||
// Fetch the file name
|
||||
|
||||
jsr helper_load_fetch_filename
|
||||
bcs cmd_load_no_filename
|
||||
bcs !+
|
||||
|
||||
// Try to fetch device and secondary address
|
||||
|
||||
jsr fetch_device_secondary
|
||||
jmp cmd_load_got_params
|
||||
|
||||
cmd_load_no_filename:
|
||||
|
||||
// If no file name is supplied, try to load first file from disc
|
||||
|
||||
lda #$01 // name length
|
||||
ldx #<filename_any
|
||||
ldy #>filename_any
|
||||
jsr JSETNAM
|
||||
// Try to fetch device number and secondary address
|
||||
|
||||
jsr helper_load_fetch_devnum
|
||||
bcs !+
|
||||
jsr helper_load_fetch_secondary
|
||||
!:
|
||||
// FALLTROUGH
|
||||
|
||||
cmd_load_got_params: // input for tape wedge
|
||||
|
||||
@@ -5,22 +5,22 @@
|
||||
|
||||
cmd_save:
|
||||
|
||||
// Set default device and secondary address; channel is not important now
|
||||
// Set default device and secondary address
|
||||
|
||||
jsr select_device
|
||||
ldy #$00
|
||||
jsr JSETFLS
|
||||
jsr helper_load_init_params_no_VERCKB
|
||||
|
||||
// Fetch the file name
|
||||
|
||||
jsr helper_load_fetch_filename
|
||||
bcs_16 do_MISSING_FILENAME_error
|
||||
|
||||
// Try to fetch device
|
||||
// Try to fetch device number and secondary address
|
||||
|
||||
jsr fetch_device_secondary
|
||||
|
||||
// Setup the start and end addresses
|
||||
jsr helper_load_fetch_devnum
|
||||
bcs !+
|
||||
jsr helper_load_fetch_secondary
|
||||
!:
|
||||
// Setup the start address
|
||||
|
||||
lda #TXTTAB
|
||||
|
||||
@@ -29,6 +29,10 @@ cmd_save:
|
||||
ldx VARTAB+0
|
||||
ldy VARTAB+1
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
cmd_save_do: // entry point for BSAVE
|
||||
|
||||
// Perform saving
|
||||
|
||||
jsr JSAVE
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
//
|
||||
// Tries to fetch device number - sets Carry if failure
|
||||
//
|
||||
|
||||
|
||||
helper_load_fetch_devnum:
|
||||
|
||||
// Fetch the device number
|
||||
|
||||
jsr fetch_coma_uint8
|
||||
bcs !+
|
||||
|
||||
sta FA
|
||||
!:
|
||||
rts
|
||||
@@ -0,0 +1,20 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
//
|
||||
// Tries to fetch secondary address - sets Carry if failure
|
||||
//
|
||||
|
||||
|
||||
helper_load_fetch_secondary:
|
||||
|
||||
// Fetch the device number
|
||||
|
||||
jsr fetch_coma_uint8
|
||||
bcs !+
|
||||
|
||||
sta SA
|
||||
!:
|
||||
rts
|
||||
@@ -16,6 +16,10 @@ helper_load_init_params:
|
||||
|
||||
sta VERCKB
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
helper_load_init_params_no_VERCKB:
|
||||
|
||||
// Set default device, set secondary address to 0
|
||||
|
||||
jsr select_device
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Set '*' as file name
|
||||
//
|
||||
|
||||
|
||||
helper_load_setnam_any:
|
||||
|
||||
lda #$01 // name length
|
||||
ldx #<filename_any
|
||||
ldy #>filename_any
|
||||
jmp JSETNAM
|
||||
Reference in new issue
Block a user