forked from X16Community/x16-rom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BASIC/BANNEX] Implement EDIT command (X16Community#182)
- Loading branch information
1 parent
5152994
commit 3583e76
Showing
8 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.include "banks.inc" | ||
|
||
.export x16edit | ||
.import bajsrfar, frmevl, valtyp, fcerr, frefac, index1 | ||
|
||
.segment "ANNEX" | ||
|
||
.proc x16edit | ||
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 | ||
|
||
error: | ||
jmp fcerr ; Input was not a string => error | ||
|
||
file: | ||
jsr frefac ; Get string | ||
beq new ; String is empty, open new empty buffer | ||
|
||
sta $04 ; R1L = file name length | ||
lda index1 | ||
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 | ||
|
||
new: | ||
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 | ||
jsr bajsrfar | ||
.word $C003 | ||
.byte BANK_X16EDIT | ||
rts | ||
.endproc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters