The OLD command is still crashing the emulator (R46, Windows 10), if you enter it when there is no past program history. On boot, type OLD (enter) and it will hang. If you were to boot up, move around screen, even type in 10 (enter) [with no program] and then try OLD it will still hang. If you enter some function/command it seems to break the spell - so, if you direct enter PRINT "HELLO" (enter) then it seems to be okay if type OLD.
* I don't have a x16 computer, so not sure if it's the same in hardware version.
[Emulator] OLD - command crashes (on start / reset with no 'old' code)
-
- Posts: 8
- Joined: Wed Jan 25, 2023 8:03 am
Re: [Emulator] OLD - command crashes (on start / reset with no 'old' code)
Mine hangs, also R46 w/Win10.OldOzC64er wrote: ↑Mon Dec 11, 2023 3:56 am ...if you direct enter PRINT "HELLO" (enter) then it seems to be okay if type OLD.
Re: [Emulator] OLD - command crashes (on start / reset with no 'old' code)
I believe this is a known issue, and one that I don't think anyone is inclined to fix.
-
- Posts: 8
- Joined: Wed Jan 25, 2023 8:03 am
Re: [Emulator] OLD - command crashes (on start / reset with no 'old' code)
Hmm... I can't seem to replicate what I did when I noticed this? Mine too just hangs even after the print command.Mine hangs, also R46 w/Win10.
Re: [Emulator] OLD - command crashes (on start / reset with no 'old' code)
It's because the "OLD" command naively assumes there's a valid BASIC program in memory at $0801, and in your case, the emulator is likely initializing RAM to random values instead, so the routine is trying to scan through garbage data as though it were a BASIC program and it ends up choking.
More specifically, the issue is in x16rom/basic/code1.s, at lnkprg. This routine needs to read some zeroes at the correct times in order to terminate. With garbage data, it probably won't, so it gets stuck in a loop like you're seeing.
EDIT: I don't think the solution is necessarily to update lnkprg, but instead to update the OLD command itself to do some kind of contingency check to make sure something that "looks like" a BASIC program is indeed at $0801 before doing anything else.
More specifically, the issue is in x16rom/basic/code1.s, at lnkprg. This routine needs to read some zeroes at the correct times in order to terminate. With garbage data, it probably won't, so it gets stuck in a loop like you're seeing.
EDIT: I don't think the solution is necessarily to update lnkprg, but instead to update the OLD command itself to do some kind of contingency check to make sure something that "looks like" a BASIC program is indeed at $0801 before doing anything else.
-
- Posts: 8
- Joined: Wed Jan 25, 2023 8:03 am
Re: [Emulator] OLD - command crashes (on start / reset with no 'old' code)
Thanks for explanation.
I noticed a previous post from Tomxp411 mentioning the CTRL + R key to reset, and it seems to work in this lock-up .
It's fringe case situation that someone does enter OLD, but I was more wondering if it pointed to a bigger issue (originally).
I noticed a previous post from Tomxp411 mentioning the CTRL + R key to reset, and it seems to work in this lock-up .
It's fringe case situation that someone does enter OLD, but I was more wondering if it pointed to a bigger issue (originally).
Re: [Emulator] OLD - command crashes (on start / reset with no 'old' code)
It may be fringe, but I'm all for eliminating any kind of "lol here's how you can crash the X16 with one simple command lol" memes.
- JimmyDansbo
- Posts: 476
- Joined: Sun Apr 26, 2020 8:10 pm
- Location: Denmark
- Contact:
Re: [Emulator] OLD - command crashes (on start / reset with no 'old' code)
I have just created a pull request that will prevent OLD command from hanging.
https://github.com/X16Community/x16-rom/pull/237
Granted, it will restore a random BASIC line, but it does not hang.
Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark