The 8-bit inspiration vol 2: real work on a Plus/4 in 2020
Last time I promised some additional trees, however, I ran into something nice, so let me tell about it. The fact is, believe or not: I'm just now typing this very blog on my very Commodore Plus/4. Don't believe me? Here is a photo for you:
Indeed, this is the editor giving the name of the machine: Plus/4 stands for a built-in office suite offering a text editor, a spreadsheet, a database manager and a diagram creator. All these are of course very simplistic when compared to modern office suites,but back in the day…
Well, back in the day the classic UNIX editors were already available. In fact, both vi and emacs were born in the same year as myself, 1976. So when the Plus/4 came out, they were mature pieces of software. So in principle the editors I use for work today were already available when I was born, and when computers were not yet seen by ordinary people, they were just very futuristic things mentioned in the news. So why was the Plus/4 editor interesting then? Well, as a kid I was not amongst those who were allowed to sit next to a video terminal (the price of a new car) of a professional computer (price of a house) to use emacs or vi. (Or at least some clone as UNIX was CO-COM listed…) But not only kids, most adults were also missing this opportunity. In contrast to that, nowadays you can get a used computer that runs emacs or vi for free. Even a brand new Raspberry PI kit is a bargain. But do people appreciate it?
Anyway, the possibility to have a typewriter where I can correct text easily, and even print it, was very tempting. There was a minor problem though. To use the suite really, a floppy drive was needed, and optimally a printer, too. A price of a new Lada car again… Luckily at the school we had one of each of these, so I had some experience. Interestingly, virtually nobody knew what a spreadsheet is good for. Neither me. But I made my first database also with the built in Plus/4 package… A big jump then to today. I'm having the 8-bit desk (and writing these blogs) as I find some valuable element of the rather complex 8-bit feeling. One of these elements is to take time, being focused at something without switching to different windows and checking everything on the Web. Of course I do not consider today's opportunities as bad, I just find that sometimes it is inspiring to return to the old approach.
I've already illustrated, for instance, that writing 8-bit programs can be very inspiring. But of course, nobody will pay for this activity itself. So if I want to spend more time next to my Plus/4, I need something which is really useful in my work. As a scientist and IT expert, I spend most of my time next to my emacs… So why not typing text on the good old Plus/4 sometimes.
After all, I have a monochrome monitor which is better for programming and typing. O.K. it is less good for gaming, but that is not the most important for me. So the characters look nice, albeit one has to get used to the 40-column display, and the non-emacs (and non-vi, and not even modern) key-stroke commands. It works out, and I started to enjoy quickly. But I will be in the need of the results on a PC, so the question arises: how will I transfer the files? Well, I have an sd2iec anyway. I purchased it without housing, so to maintain the 1980-s Hungary feeling, I installed it into a soap box:
Back in the day this was the most universal plastic chassis which was
readily available to electronics hobbyist. I can hardly imagine any
popular circuitry: radio, guitar amp, car tester, etc. which was not
created by someone in the soviet era in a soap box. So even though my
sd2iec is not housed in recycled original C64 plastic material, I find
it authentic, and more practical than having a real floppy drive
either. Especially as I can directly plug in its card to my laptop. So
let me save it right now, and move back to my normal desk to explain
how I will get this text… So right now I press C= + C
(command-mode), use the command sf
, and enter the file name, say,
edblog
.
So back to the contemporary Linux box (and of course my Emacs), lets see what we have on the card. We have a file EDBLOG.S00 there, which is a "sequential file", which is supposed to be something like an ASCII file. Taking a look at it with "less" shows something weird though:
As I'm not a Commodore guru, nor have I found any documentation on how
this editor (or the Plus/4 itself, together with my sd2iec
) will store
its files, I tried to decode it myself. Looking at the values of
bytes, I came to the following conclusion:
- It starts with a rubbish, which lasts till the last control character with the code "255" at the beginning of the file. I throw this part away.
- Small English letters and are coded starting with 1, so bytes with values between 1 and 32 should be shifted by 92.
- Capital English letters have their normal ASCII code. Wow.
- Some other characters have different codes, notably, 159 is a newline.
- There are may spaces saved in the file, probably because the goal of the editor was to produce documents for the printer. So blocks of 2 or more spaces are cut out.
I wrote a python code for this. If you are interested, please find it here: commodore_3plus1_s00_cat.py . It takes the file from the SD card as a positional argument and types the text to STDOUT in ASCII, so that you can continue working on your code, paper, blog, or whatever, with your favourite editor. (Which is, hopefully, emacs or vi. I just think so because you keep on reading this blog. So we must have some common attitudes.)
A word of caution though. I tested it with my own machine only, so in your setting it might be different. I also have a version which I first wrote using VICE under Linux (I was on a train, no Plus/4 around). It saved a ".SEQ" file to the Commodore floppy image, which was slightly different, I won't explain it right now. Here is my version of the code for that: commodore_3plus1_seq_cat.py, you can see how it works if interested. Oh, and both were written with a Plus/4 having an English ROM, unfortunately I don't have the Hungarian version. So it will not decode Hungarian characters… Anyway, I hope you had a good time reading my little story. Give it a try eventually, it is fun. Thanks for reading.