implemented BASIC command OLD
This commit is contained in:
1 parent
7117255ced
commit
c88cce6045
4 files changed
+72
-1
No files matched your search
@@ -13,6 +13,10 @@ Tries to switch the machine to turbo mode - details differ depending on the conf
|
|||||||
|
|
||||||
Tries to switch the machine back to 1 MHz operation mode.
|
Tries to switch the machine back to 1 MHz operation mode.
|
||||||
|
|
||||||
|
### `OLD`
|
||||||
|
|
||||||
|
Tries to restore program destroyed by NEW or a reset.
|
||||||
|
|
||||||
### `MERGE "file_name" [, device_number]`
|
### `MERGE "file_name" [, device_number]`
|
||||||
|
|
||||||
Appends the BASIC program from a storage medium to the one currently present in memory.
|
Appends the BASIC program from a storage medium to the one currently present in memory.
|
||||||
|
|||||||
@@ -13,7 +13,9 @@
|
|||||||
|
|
||||||
cmd_bload,
|
cmd_bload,
|
||||||
cmd_bsave,
|
cmd_bsave,
|
||||||
cmd_bverify
|
cmd_bverify,
|
||||||
|
|
||||||
|
cmd_old
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
// #LAYOUT# STD * #TAKE
|
||||||
|
// #LAYOUT# * BASIC_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
|
||||||
|
cmd_old:
|
||||||
|
|
||||||
|
// First make sure we are in direct mode
|
||||||
|
|
||||||
|
ldx CURLIN+1
|
||||||
|
inx
|
||||||
|
bne_16 do_DIRECT_MODE_ONLY_error
|
||||||
|
|
||||||
|
// Now try to restore program linkage
|
||||||
|
|
||||||
|
ldy #$01
|
||||||
|
tya
|
||||||
|
sta (TXTTAB),y
|
||||||
|
|
||||||
|
jsr LINKPRG
|
||||||
|
|
||||||
|
// Now we have to restore VARTAB XXX deduplicate this with line editor
|
||||||
|
|
||||||
|
lda TXTTAB+0
|
||||||
|
sta OLDTXT+0
|
||||||
|
lda TXTTAB+1
|
||||||
|
sta OLDTXT+1
|
||||||
|
!:
|
||||||
|
lda OLDTXT+0
|
||||||
|
sta VARTAB+0
|
||||||
|
lda OLDTXT+1
|
||||||
|
sta VARTAB+1
|
||||||
|
|
||||||
|
jsr basic_follow_link_to_next_line
|
||||||
|
|
||||||
|
lda OLDTXT+0
|
||||||
|
ora OLDTXT+1
|
||||||
|
bne !- // branch if pointer not NULL
|
||||||
|
|
||||||
|
// Correct VARTAB by 2 bytes NULL pointer
|
||||||
|
|
||||||
|
#if HAS_OPCODES_65CE02
|
||||||
|
|
||||||
|
inw VARTAB
|
||||||
|
inw VARTAB
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
clc
|
||||||
|
lda VARTAB+0
|
||||||
|
adc #$02
|
||||||
|
sta VARTAB+0
|
||||||
|
bcc !+
|
||||||
|
inc VARTAB+1
|
||||||
|
!:
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Call CLR to restore remaining variables
|
||||||
|
|
||||||
|
jsr do_clr
|
||||||
|
|
||||||
|
// Quit
|
||||||
|
|
||||||
|
jmp shell_main_loop
|
||||||
@@ -181,6 +181,7 @@ const StringEntryList GLOBAL_Keywords_CC = { ListType::KEYWORDS, "keywords_CC",
|
|||||||
{ true, true, true, "KCC_02", "BLOAD", }, // http://www.antonis.de/qbebooks/gwbasman/bload.html
|
{ true, true, true, "KCC_02", "BLOAD", }, // http://www.antonis.de/qbebooks/gwbasman/bload.html
|
||||||
{ true, true, true, "KCC_03", "BSAVE", }, // http://www.antonis.de/qbebooks/gwbasman/bsave.html
|
{ true, true, true, "KCC_03", "BSAVE", }, // http://www.antonis.de/qbebooks/gwbasman/bsave.html
|
||||||
{ true, true, true, "KCC_04", "BVERIFY", },
|
{ true, true, true, "KCC_04", "BVERIFY", },
|
||||||
|
{ true, true, true, "KCC_05", "OLD", }, // OpenROMs specific, not present in CBM BASIC dialects
|
||||||
} };
|
} };
|
||||||
|
|
||||||
// extended BASIC keywords - reserved for BASIC commands likely making sense on most C64-compatible machines
|
// extended BASIC keywords - reserved for BASIC commands likely making sense on most C64-compatible machines
|
||||||
|
|||||||
Reference in new issue
Block a user