From 9247e6e2b83d6902574c5f54f0f473eb3c885f1f Mon Sep 17 00:00:00 2001 From: stefan-b-jakobsson <70063525+stefan-b-jakobsson@users.noreply.github.com> Date: Mon, 9 Oct 2023 19:16:22 +0300 Subject: [PATCH] [BANNEX] Change EDIT to use the current device number (basic_fa) (#188) --- bannex/x16edit.s | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/bannex/x16edit.s b/bannex/x16edit.s index 2e0edc60..122892e0 100644 --- a/bannex/x16edit.s +++ b/bannex/x16edit.s @@ -1,7 +1,7 @@ .include "banks.inc" .export x16edit -.import bajsrfar, frmevl, valtyp, fcerr, frefac, index1 +.import bajsrfar, frmevl, valtyp, fcerr, frefac, index1, basic_fa .segment "ANNEX" @@ -9,12 +9,12 @@ beq new ; No input param, open editor with a new empty buffer jsr frmevl ; Evaluate input bit valtyp - bmi file ; Input is a string, try to open file in the editor + bmi set_file ; Input is a string, try to open file in the editor error: jmp fcerr ; Input was not a string => error -file: +set_file: jsr frefac ; Get string beq new ; String is empty, open new empty buffer @@ -23,20 +23,27 @@ file: sta $02 ; R0L = file name address low lda index1+1 sta $03 ; R0H = file name address high - ldx #10 ; First RAM bank used by the editor - ldy #255 ; Last RAM bank used by the editor - - jsr bajsrfar - .word $C003 - .byte BANK_X16EDIT - rts + bra launch new: + stz $04 ; R1L = file name length, 0 => no file + +launch: ldx #10 ; First RAM bank used by the editor ldy #255 ; Last RAM bank used by the editor - stz $04 ; R1L = file name length, 0 => no file + stz $05 ; Default value: Auto-indent and word + stz $06 ; Default value: Tab stop width + stz $07 ; Default value: Word wrap position + lda basic_fa + sta $08 ; Set current active device number + stz $09 ; Default value: text/background + stz $0a ; Default value: header + stz $0b ; Default value: status bar + jsr bajsrfar - .word $C003 + .word $C006 .byte BANK_X16EDIT rts + + .endproc