small cleanup in BASIC

This commit is contained in:
FeralChild64 committed 2020-06-22 18:45:24 +02:00
1 parent 37b32759dc
commit 524d532433
8 files changed
+64 -48

No files matched your search

+3 -9
View File
@@ -14,18 +14,12 @@ cmd_verify:
cmd_load:
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
jsr JSETFLS
lda #$00 // mark operation as LOAD
jsr helper_load_init_params
// Fetch the file name
jsr fetch_filename
jsr helper_load_fetch_filename
bcs cmd_load_no_filename
// Try to fetch device and secondary address
+1 -1
View File
@@ -13,7 +13,7 @@ cmd_save:
// Fetch the file name
jsr fetch_filename
jsr helper_load_fetch_filename
bcs_16 do_MISSING_FILENAME_error
// Try to fetch device
@@ -0,0 +1,41 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Fetches file name, Carry set if not found
//
helper_load_fetch_filename:
// Check if end of statement
jsr end_of_statement_check
bcs !+
// Call the expression parser, make sure it returned a string
jsr FRMEVL
lda VALTYP
bpl_16 do_SYNTAX_error
// Set the filename address and pointer
lda __FAC1+0
sta FNLEN
lda __FAC1+1
sta FNADDR+0
lda __FAC1+2
sta FNADDR+1
// Mark success
clc
// FALLTROUGH
!:
rts
@@ -0,0 +1,23 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Sets initial parameters for LOAD and simiar commands
//
// Input:
// - VERCKB content in .A
//
helper_load_init_params:
// Set LOAD/VERIFY flag
sta VERCKB
// Set default device, set secondary address to 0
jsr select_device
ldy #$00 // secondary address
jmp JSETFLS