Open dirkwhoffmann opened 8 months ago
Another possibility would be to merge the RetroShell viewer and the RetroShell commander into a single device and to use a unique character to enter command mode.
As this is all about retro, we could use the ASCII character 16 (DLE, Data Link Escape). Once this character is detected, transmitted bytes are no longer just displayed in RetroShell but typed in. Command mode will be reset to text mode on the following line.
Unfortunately, I didn't find a way to echo the DLE character in Amiga DOS. There seems to be no way to specify an ASCII character by number inside a string, which would make the special character approach tedious to use.
If some Amiga DOS expert knows a solution, please let me know.
I think there is no way to create a DLE char with the standard tools. But it would be easy to create a command which outputs it or prepend the output with a DLE. On 1.3 you anyway need the Echo command to print something.
dle.zip attached a dle command which prints the argument prepended with a DLE
Thinking more deeply about the available options, I think the dual-device approach is superior. That is because I want to let the Commander send back the RetroShell output to the Amiga eventually, which the viewer (sniffer) should never do. In particular, the two devices will behave as follows:
Sniffer Listens to the serial port and displays all incoming and outgoing bytes in RetroShell. This is the same as the Port inspector panel does in the Mac app, just inside RetroShell.
Commander
The commander types all outgoing bytes into RetroShell and executes the command when \n
is received. Eventually, it will send the RetroShell output back to the Amiga through the serial port (I will have to expand the UART class accordingly).
The important part of the Commander is already implemented (but still needs to be ported over to vAmigaWeb).
In the Mac app, plug in the Commander into the serial port:
In Kick 3.0 (which allows ser:
to be addressed directly), send a RetroShell command simply via echo
(no special characters needed):
With the Commander plugged in, the command is executed inside RetroShell:
With the Commander plugged in, you have complete control over the emulator. You can enable or disable warp mode as you like or anything else.
Sending RetroShell output to the Amiga also works (in the lower window, I've typed in type ser:
) :
There are two issues left:
With the latest code changes, RetroShell can be used inside a Terminal program such as A-Talk III (unlike the type ser:
solution, there are no buffering issues, and communication is possible with high baud rates).
Important:
There are some caveats, though:
Some commands, such as amiga power off
will crash the emulator. That is because RetroShell commands are expected to be executed within the GUI thread. The RetroShell commander executes the commands within the emulator thread which causes issues with several commands such as all commands that trigger a state change. The emulator will run into an assertion checking the thread type. This will not change until vAmiga 3.0, which will utilize the new code architecture currently being developed for VirtualC64.
Terminal emulation is not perfect. For example, typing a backspace in A-Talk III will not result in a backspace inside RetroShell. As a result, correcting typos when entering commands is impossible. Furthermore, RetroShell's clear command does not clear the terminal.
Summing up:
Update: With the latest code changes, the Commander no longer crashes the emulator.
Before hitting Ctrl+Return:
After hitting Ctrl+Return:
In another repo, a user requested to control the emulator from within the Amiga to implement a smart warp boot mechanism (switching off warp mode when a specific task has finished).
A clean and easy way to solve this problem is to allow users to (virtually) plug RetroShell into the serial port.
At the moment, there are two serial port devices:
Proposal: Add two more devices:
RetroShell viewer This device will listen to the serial port and display the transmitted, readable text in the RetroShell console. Such functionality did already exist. However, it was only possible to enable it via a RetroShell command, and, more importantly, it no longer works in the latest release.
RetroShell commander This device will listen to the serial port and translate every readable character into a RetroShell key press in the background. Thus, the transmitted text will be executed as a shell command after '\n' is transmitted.
I've already hacked together a small prototype as a proof-of-concept implementation: