Would be cool to have implemented some kind of linux features like history commands and !10 to reuse command number 10 in the history
another feature that would have been cool is some kind of debug cartridge emulation like the final cartridge, or like action replay from the Amiga 500 times.
commands and stuff
Re: commands and stuff
Consider this an opportunity to make your own. That's the beauty of this system; all the development is done in the open, so everyone is free to contribute and to learn from the existing codebase.
Re: commands and stuff
The BASIC environment that the X16 starts up in has a built-in history feature. After executing a command in immediate mode, you can use the cursor-up key to go back to that line and execute it again.Sitan wrote: ↑Wed May 24, 2023 7:54 pm Would be cool to have implemented some kind of linux features like history commands and !10 to reuse command number 10 in the history
another feature that would have been cool is some kind of debug cartridge emulation like the final cartridge, or like action replay from the Amiga 500 times.
Here's a quick demonstration:
After the emulator starts up, the real time clock has no value, and will not update. The time is stored in a special BASIC variable called TI$ (short for TIME$, because X16 BASIC only supports two-letter variable names). To assign a value to it, then, enter the following line of code, and press Enter afterward:
TI$="000000"That sets the time to 00:00:00 (it just doesn't bother with the colons). Now that it has been assigned a value, the real time clock will start updating, so you can ask the X16 what time it is by telling it to print the value of TI$ (again, remember to press Enter after typing in this line of BASIC code):
PRINT TI$Here's where we see the 'history' function in action. After the X16 prints out the current value of TI$, well, it just sits there, doesn't it. Because it just prints the value as it was when we asked for it. But we can update it. Use the cursor-up key to bring the cursor up to the line that says PRINT TI$ and press Enter again.
Et voilà! The number changed. And you can just keep doing that, over and over again, putting the cursor back to that line and pressing Enter, and it'll update with the current value of TI$.
And if you want to reset the value of TI$ to all zeroes again, then go cursor-up to that line, where it says TI$="000000", and press Enter twice (once to reset TI$ to 000000, and then the cursor winds up on the PRINT TI$ line again, so pressing Enter again is just like when we used the cursor to get back to it).
Re: commands and stuff
That's not a "history" feature. Your only re-issuing commands that are currently on the screen. Once they disappear off the top, you have to retype them. What Sitan is referring to is recalling commands that are no longer on the screen. In Linux this is done using the cursor up/down keys. Naturally, that would have to change for the CX16.
Re: commands and stuff
The implementation is different; the effect is the same. It just has a relatively short buffer. And as to whether or not they were talking about commands that have scrolled off the screen, you just don't know how much experience and understanding someone has with the way the screen editor works, especially when they ask a question like that.
I was trying to be more helpful than "It doesn't work like that."
I was trying to be more helpful than "It doesn't work like that."
Re: commands and stuff
I'm not a huge fan of this command history idea - not on this kind of system.
The main reason is just because of the memory resources such a thing uses. You have to store those commands "somewhere" and I wouldn't want to sacrifice any address space for it.
BUT - I got to thinking about it.... Might there be a low overhead way to do this? Would it be possible to add an ISR that listens for something like CTRL+UP ARROW, then it scans a file on the SD card (yea has to assume Device 8 connected to that) and maybe another file to store the current command index?
I see in the KERNEL now, you can press CTRL+1, etc to change the current color. So it may be possible, or would it require an SMC update?
Presently, it looks like CTRL+UP or SHIFT+UP or ALT+UP all do the same thing as just pressing UP. So maybe the ISR could use CTRL+PGUP/PGDN instead?
I bet Jakobsson could do this But it's a similar issue - even if it coud done in say 100 bytes, that has to sit somewhere. It could be a ROM thing someday, that would just require a System ROM build?
Not saying it's worth a ROM slot - but am curious if the IRQ stuff is flexibility enough to make something like this possible? And I imagine it would still feel pretty instant even if going to the SD card each time it is used.
The main reason is just because of the memory resources such a thing uses. You have to store those commands "somewhere" and I wouldn't want to sacrifice any address space for it.
BUT - I got to thinking about it.... Might there be a low overhead way to do this? Would it be possible to add an ISR that listens for something like CTRL+UP ARROW, then it scans a file on the SD card (yea has to assume Device 8 connected to that) and maybe another file to store the current command index?
I see in the KERNEL now, you can press CTRL+1, etc to change the current color. So it may be possible, or would it require an SMC update?
Presently, it looks like CTRL+UP or SHIFT+UP or ALT+UP all do the same thing as just pressing UP. So maybe the ISR could use CTRL+PGUP/PGDN instead?
I bet Jakobsson could do this But it's a similar issue - even if it coud done in say 100 bytes, that has to sit somewhere. It could be a ROM thing someday, that would just require a System ROM build?
Not saying it's worth a ROM slot - but am curious if the IRQ stuff is flexibility enough to make something like this possible? And I imagine it would still feel pretty instant even if going to the SD card each time it is used.
Re: commands and stuff
Yes, a command history would have to be logging to a file.