The Connection Infrastructure
To stream real-time visual registers and color matrix bytes directly from your C# server to a C64 client, you establish a virtual serial connection chain. Here is a high-fidelity visual map of the data loop from the emulator out to your endpoints:
βββββββββββββββββββββββββββββββββββ
β VICE Emulator (C64/C128) β
β [SwiftLink ACIA Emulation] β (Simulates 38.4kbps hardware link)
ββββββββββββββββββ¬βββββββββββββββββ
β (Virtual RS-232 device loopback)
βΌ
βββββββββββββββββββββββββββββββββββ
β TCPSER (Virtual Modem) β (Bridges the virtual serial port
β [Listens on TCP 6400] β over Hayes AT-modem loops)
ββββββββββββββββββ¬βββββββββββββββββ
β (Hayes "ATDT localhost:8000" loop)
βΌ
βββββββββββββββββββββββββββββββββββ
β RIFT GATE Proxy (8000) β (Recommended: Acts as a dynamic
β [Keeps Client Connected] β socket fail-safe directory)
ββββββββββββββββββ¬βββββββββββββββββ
β (Bridges stream session live)
βΌ
βββββββββββββββββββββββββββββββββββ
β RIFT64 App Server (SDK Port) β (Your custom SDK project,
β [e.g. Tetris on 8001] β Snake, or Rift Writer)
βββββββββββββββββββββββββββββββββββ
Setting up the Pipeline (Steps)
To configure and run this exact rendering pipeline locally on your computer, follow these simple step-by-step instructions:
Configure VICE
Open your VICE emulator settings. Enable SwiftLink ACIA cartridge emulation, map its base address registers to $DE00, and set its baud speed limit to 38400. Enable the RS-232 Userport/Userport device, mapping it to a virtual loopback COM port or pipe.
Fire up TCPSER
Start tcpser inside your command-line interface to act as your virtual modem. Instruct it to bridge your virtual loopback COM port over local TCP/IP, listening on port 6400 for incoming C64 Hayes commands:
tcpser -d /dev/ttyS0 -s 38400 -p 6400
Start Rift Gate
Start the lightweight RiftGate proxy server on your PC (listening on port 8000). Load and run the rift64.prg client inside your emulator, and instruct its modem terminal to dial the gateway:
ATDT localhost:8000
Automated Emulation Launch Script (Windows .bat)
To make development much smoother, you can automate starting both tcpser and VICE with the correct command-line flags. Copy and save this script as run_emulator_loop.bat on your development PC:
@echo off
set "TCPSER_EXE=C:\Path\To\tcpser.exe"
set "VICE_EXE=C:\Path\To\x64sc.exe"
set "OUTPUT_PRG=D:\Commodore\Repos\Project01\CTTY\build\rift64.prg"
echo Starting tcpser...
start "tcpser" "%TCPSER_EXE%" ^
-v 25232 ^
-s 38400 ^
-l 4 ^
-p 6400
timeout /t 1 /nobreak >nul
echo Launching VICE with SwiftLink ACIA Enabled...
start "" "%VICE_EXE%" ^
-default ^
-autostartprgmode 1 ^
-acia1 ^
-acia1base 0xDE00 ^
-acia1irq 1 ^
-acia1mode 1 ^
-myaciadev 0 ^
-rsdev1 "127.0.0.1:25232" ^
-rsdev1ip232 ^
-rsdev1baud 38400 ^
"%OUTPUT_PRG%"
This script starts the virtual modem in ip232 loopback mode on port 25232, pauses for a second, and then spawns VICE with SwiftLink ACIA cartridge emulation enabled, base address mapped to $DE00, baud set to 38400, and autostarts the rift64.prg client, bridging it immediately to the local virtual modem. This saves you from having to configure VICE settings manually every time!
The Developer Fail-Safe: Why Rift Gate is Essential
While you *can* connect a C64 client directly to a hosted RIFT64 application, utilizing the lightweight Rift Gate proxy server is highly recommendedβespecially when you are active in the developer seat writing and debugging software:
π Protection Against Connection Drops
During active software development, your backend application server will constantly crash, disconnect, or restart as you edit code, compile, and debug.
If the C64 client is connected directly to your application, any backend crash or restart will instantly drop the C64's serial carrier socket, freezing your emulator or physical hardware and forcing you to reboot, reload, and re-dial manually.
π Dynamic Web-Based Administration
Rift Gate features a clean, responsive web-based administration dashboard. Instead of editing raw CSV databases on your C64 or server-side configs, you can manage your personal directory of favorite endpoints directly from your browser.
The dashboard allows you to configure, add, edit, or delete custom server IP endpoints and ports on-the-fly, as well as live-overriding gateway settings (such as toggling background animations) with immediate, automatic synchronization.
π Dynamic Gateway Fallback Routing
Rift Gate acts as an active, persistent socket proxy. It establishes and maintains a permanent, rock-solid connection stream with the Commodore 64 client.
If your backend application server disconnects or crashes during debugging, the Rift Gate proxy gracefully intercepts the drop, prevents the C64 serial connection from resetting, and instantly returns the C64 user safely back to the interactive Rift Gate directory menu! Once you recompile and restart your server, you can re-select and re-launch it from the gateway menu without ever having to touch your emulator or hardware terminal again!