Posted By azog on October 1, 2012
There are a number of Ethernet devices available for Commodores, such as the 64NIC or the RR-Net, but these are all memory I/O based. The Flyer instead uses Commodore device channels to communicate with the network.
For me, this seems to open up a whole lot of possibilities that may not be practical with the 64NIC/RR-Net stuff, because each and every individual program needs to be “net aware”, while with the Flyer, you use standard Commodore device commands (OPEN, GET, etc).
The network device appears as #7, and you can open, read and write to this just like any other Commodore device. There is even a command channel, sub-address 15, where you can issue net specific commands.
On the Retroswitch web page are a couple of demos of network-aware programs: irc and telnet. But since web traffic is just another protocol, would it be possible to have a Commodore PET web browser?
Of course, I am using the Hack-a-Day retro challenge as my example…
Fundamentally this is pretty easy: open a channel to a URL, read the incoming text, and process it. I wrote a short BASIC program which is probably the crudest HTML processor you’ve ever come across…
You’ll excuse the spaghetti code. It’s unavoidable in a language whose only conditional is a simple IF, and whose basic control flow consists of GOTOs and GOSUBs. Niceties like “do while” didn’t exist yet…
Some comments on the actual code:
Line #1 sets the lower case. This is in conjunction with line 61, which converts from ASCII ATOZ to PETSCII ATOZ. I needed to do this to ake sure the “if” statements in 600+ would process correctly.
Line 35 sends the string to the open network socket; line 40 is for the network processor (secondary device 15).
From there, it simply grabs characters between < and > (HTML delimiters) and does some very simple processing in lines 600 and up.
Given the limitation of the hardware, I did not go all-out. There is only 1k of video memory, and 32k of RAM, so you probably would not be able to implement buffering to allow scrolling. There’s not many text formatting, so things like bold and italic, well, use your imagination.
It’s also VERY SLOW. You probably could re-write it in machine language for speed, and add a few more parsers.
Check out the Flyer documentation for some more interesting possibilities.
Edit: I made the Hack-a-day front page!, and just for that occassion, I made a short video of this: