The overall aesthetic of the text-mode user interface will be influenced by dialup BBS design, which may help explain the design strategy. Data sent from the 65C02 to the terminal display will be parsed for ANSI escape sequences, which will be translated into commands to the TFT driver, e.g., to set text foreground and background colors, move the cursor, and delete things. Said driver also has codepage 437 support, which makes it perfect for this application. As you'd expect, data from the BBS will be likewise marked up with ANSI sequences.
Long story short, I intend to integrate local programs and online services in a cohesive environment that has an old school BBS look and feel.
Foremost in my mind in recent days has been a software loader. This part of the 6502 firmware would send an in-band file request over the terminal connection to the onboard ESP32 that runs the terminal and controls the SD card slot and WiFi connection.
Coincidentally, AlexeyM82 recently mentioned a loader he wrote for his 6502 SBC that loads files over a serial connection, which I'd very much like to see. Thanks in advance!
My preliminary research into creating a loader turned up the Sixty502 project on Github. That package was expressly designed to work with the hardware in Ben Eater's breadboard computer kit, and does not reflect the way I'd write client-server software. It requires that the server and client computers be connected via an Arduino Mega and ten or so Dupont wires. The user must manually initiate both ends of the transfer. My software will transfer files the way one would actually download a file in real life.
The Sixty502 server, "sender.js," is written in JavaScript and runs on Node.js. Node.js is one of the countless unnecessary platforms du jour that cropped up in the late 2000s and 2010s. Although JavaScript is my favorite language, and Microsoft's sever object bindings in the original Active Server Pages were well designed, the latest trends in software abstraction make simple things like creating a TCP socket unnecessarily tedious. Programmers are way too literalistic where design patterns are concerned. I almost wish they'd never been taught. Wanna know how I write a page controller or section front controller for a WebMVC site? I write a switch statement, because that's all a controller really is. I use PHP on the server side because it's "unixy," by which I mean it implements scriptable versions of Unix system calls that closely parallel their C counterparts. You shouldn't have to instantiate a bunch of objects and pass them to each other to do this:
Code: Select all
$socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
@socket_bind($socket, $address, $port);
@socket_listen($socket);
@socket_set_nonblock($socket);
Incidentally, if you've tried to connect to an Arduino from a Linux terminal and failed, that's because it's weird. I forget where I learned this, but here's how to do it:
Code: Select all
if (strtolower($type) == "arduino") {
$command = "/bin/stty -F {$device} {$baudRate} {$dataBits} {$this->stopBits} {$localEcho} ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts";
}
else {
$command = "/bin/stty -F {$device} {$baudRate} sane raw {$dataBits} {$stopBits} hupcl cread clocal {$localEcho} -onlcr";
}
exec($command);
But I digress.
As I mentioned elsewhere, I'm inclined to forego an onboard BASIC interpreter altogether, as writing programs on the desktop and downloading them over WiFi seems a more natural workflow. Therefore, the main 6502 firmware components would appear to be as follows:
- * terminal I/O
* command interpreter, main menu, or hybrid
* in-band serial file transfer protocol, possibly a custom CSI extension
* loader
* text editor
* monitor
Since the terminal will have a CSI parser for the UI anyway, it may as well handle filesystem and WiFi commands too.