Replace the telnet server by an RPC server
Current situation:
VirtualC64 includes a server that allows users to connect to RetroShell via Telnet. This implementation was primarily a proof of concept for the socket server code. From a practical standpoint, however, interacting with the emulator through Telnet offers little value.
Proposal:
Replace the Telnet server with an RPC server that exposes VirtualC64’s control interface via the JSON-RPC protocol. This change would make the system more flexible and could enable meaningful integrations in the future; for example, using VirtualC64 as a debugging backend in VSC.
Experimental RPC server support has been achieved.
Example 1:
- Start the RPC server in RetroShell:
server rpc set PORT 8088 server rpc start - Send an RPC packet via netcat:
VirtualC64 executes theecho '{"jsonrpc":"2.0","method":"retroshell","params":"shutdown","id":1}' | nc localhost 8088shutdowncommand in RetroShell and terminates the app.
Example 2:
-
Start netcat
nc localhost 8088 -
Switch to the debugger and call the disassembler
{"jsonrpc":"2.0","method":"retroshell","params":"debugger","id":1} {"jsonrpc":"2.0","method":"retroshell","params":"d $AF00","id":2}VirtualC64 responds with the package:
{"jsonrpc":"2.0","method":"retroshell","params":"d $AF00","id":2} {"id":2,"jsonrpc":"2.0","result":" AF00 00 BRK\n AF01 D1 7A CMP (7A),Y\n AF03 D0 03 BNE AF08\n AF05 4C 73 00 JMP 0073\n AF08 A2 0B LDX #0B\n AF0A 4C 37 A4 JMP A437\n AF0D A0 15 LDY #15\n AF0F 68 PLA\n AF10 68 PLA\n AF11 4C FA AD JMP ADFA\n AF14 38 SEC\n AF15 A5 64 LDA 64\n AF17 E9 00 SBC #00\n AF19 A5 65 LDA 65\n AF1B E9 A0 SBC #A0\n AF1D 90 08 BCC AF27\n"}
Next step: Remove the telnet server
I decided to keep all existing servers and make them accessible through a dedicated settings panel. Previously, the servers had to be started via RetroShell.
The DAP server is not functional yet. I’m looking for a volunteer to develop a suitable DAP client to help move its implementation forward.