The 8-bit inspiration special: real work on a Plus/4 in 2020
Last time I promised some additional trees, however, I ran into something meanwhile which is probably worth describing. 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 are some pictures 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 COCOM 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?
Well, the 3-plus-1 office suite of the Plus/4 was neither in the focus of interest back in the day. Neither the Wikipedia page of the machine, nor the otherwise excellent plus4world.com say much about this apart from mentioning its existence in a few words. Anyway, the possibility to have a typewriter where I can correct text easily, and even print it, was very tempting for me. (It appears that I had atypical interests also as a kid.) 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 around knew what a spreadsheet was 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) for I find some components of the rather complex 8-bit mood as valuable. To take your time, being focused on something without switching to different windows and checking everything on the Web, having a single program or code and maybe a book with you... 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. Also in order to have a comparison and appreciate more what we are having now...
I've already started to illustrate, 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 indeed, why shouldn't I sit there typing text on the good old Plus/4 sometimes?
After all, I have a monochrome monitor on purpose: it is is better for programming and typing than the colour monitors of the era. Alright, it is not ideal for gaming, but that isn't my preference. 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 on this side of the iron curtain. I can hardly imagine any popular circuitry: radio, guitar amp, car tester, etc. which was not created by someone in a soap box. Hence, even though my sd2iec is not housed in a stylish box made of recycled original C64 plastic material, I find it authentic enough. 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".
[I pull out the SD card now, turn off the Plus/4 and return to my desk...]
So back to the contemporary Linux box (and of course my shell and emacs), lets see what we have on the card. We have a file there: EDBLOG.S00 (click on it to download, if yo want to read the first part of this blog on your own Plus/4 eventually). It is a "sequential file", which is supposed to be something like an ASCII file. In spite of that, taking a good look at it with "less", we will see something weird: 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.
What could have been the reason to opt for such a cumbersome format? Anyway, I wrote a python code to decrypt it. 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, emacs org outline, system docs, or whatever your are keen on, 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.