From aa7e2205758bf113cc2a5319360e7887078b8b93 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 26 Jul 2019 21:18:01 +0200 Subject: [PATCH] shortened DOS wedge implementation --- c64/basic/wedge_dos.s | 51 ++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/c64/basic/wedge_dos.s b/c64/basic/wedge_dos.s index 2eb93cba..5c58829e 100644 --- a/c64/basic/wedge_dos.s +++ b/c64/basic/wedge_dos.s @@ -37,29 +37,12 @@ wedge_dos: wedge_dos_command: - ;; Set remaining file parameters, open the channel - lda #$00 ; empty file name + ;; Provide command name + jsr wedge_dos_setnam + jsr JSETNAM jsr via_IOPEN bcs wedge_dos_basic_error -* - ;; Set channel for output - ldx #$0F - jsr via_ICKOUT - bcs wedge_dos_basic_error -* - jsr basic_fetch_and_consume_character - cmp #$00 - beq + - - jsr via_IBSOUT - bcs wedge_dos_basic_error - jmp - -* - ;; Finalize command - lda #$0D - jsr via_IBSOUT - bcs wedge_dos_basic_error ;; Retrieve status, print it if not OK jsr via_ICLALL @@ -149,18 +132,8 @@ wedge_dos_directory: lda #$00 sta current_secondary_address - ;; Now determine the length of the 'file' name - ldy #$FF -* - iny - lda (basic_current_statement_ptr), y - bne - - - ;; Set the name to open - tya - ldx basic_current_statement_ptr+0 - ldy basic_current_statement_ptr+1 - jsr JSETNAM + ;; Provide file name + jsr wedge_dos_setnam ;; Open the file jsr via_IOPEN @@ -228,4 +201,18 @@ wedge_dos_basic_error: dex jmp do_basic_error +wedge_dos_setnam: + ;; Now determine the length of the 'file' name + ldy #$FF +* + iny + lda (basic_current_statement_ptr), y + bne - + + ;; Set the name to open + tya + ldx basic_current_statement_ptr+0 + ldy basic_current_statement_ptr+1 + jmp JSETNAM + ;; END wedge support