diff --git a/c64/basic/basic_main_loop.s b/c64/basic/basic_main_loop.s index 6f962dff..fd4dede5 100644 --- a/c64/basic/basic_main_loop.s +++ b/c64/basic/basic_main_loop.s @@ -6,7 +6,8 @@ basic_main_loop: // Tell user we are ready - jsr ready_message + ldx #30 + jsr print_packed_message // Enable Kernal messages lda #$80 @@ -16,7 +17,6 @@ basic_read_next_line: // Read a line of input ldx #$00 read_line_loop: - jsr JCHRIN bcs read_line_loop @@ -24,11 +24,8 @@ read_line_loop: beq got_line_of_input // Not carriage return, so try to append to line so far cpx #80 - bcc !+ - // Report STRING TOO LONG error (Computes Mapping the 64 p93) - ldx #22 - jmp do_basic_error -!: + bcs_16 do_STRING_TOO_LONG_error // see Computes Mapping the 64 p93 + sta BUF,x inx jmp read_line_loop diff --git a/c64/basic/engine/fetch_file_name.s b/c64/basic/engine/fetch_file_name.s index 9a2d4de2..ece023d2 100644 --- a/c64/basic/engine/fetch_file_name.s +++ b/c64/basic/engine/fetch_file_name.s @@ -14,40 +14,24 @@ fetch_filename: jsr end_of_statement_check bcs fetch_filename_done - // Search for opening quote + // Call the expression parser, make sure it returned a string - jsr fetch_character - cmp #$22 - bne_16 do_SYNTAX_error + jsr FRMEVL - // Filename starts here so set pointer + lda VALTYP + bpl_16 do_SYNTAX_error - lda TXTPTR+0 + // Set the filename address and pointer + + lda __FAC1+0 + sta FNLEN + + lda __FAC1+1 sta FNADDR+0 - lda TXTPTR+1 + lda __FAC1+2 sta FNADDR+1 - // Now search for end of line or closing quote - // so that we know the length of the filename - - lda #$00 - sta FNLEN -!: - jsr fetch_character - cmp #$22 - beq fetch_filename_fail - cmp #$00 - beq !+ - - inc FNLEN - bne !- - -!: - jsr unconsume_character - - // FALLTROUGH - -fetch_filename_fail: + // Mark success clc diff --git a/c64/basic/ready_message.s b/c64/basic/ready_message.s deleted file mode 100644 index 4486bbf8..00000000 --- a/c64/basic/ready_message.s +++ /dev/null @@ -1,9 +0,0 @@ -// #LAYOUT# STD * #TAKE -// #LAYOUT# * BASIC_0 #TAKE -// #LAYOUT# * * #IGNORE - - -ready_message: - - ldx #30 - jmp print_packed_message