Secrets of the Machine - A Roadmap on Paper...
Hello everyone! I hope that your Summer is beginning well, and that nice weather showed up with it for Memorial Day. In this third installment of "The Retro Repair Adventures", we're going to take a closer look at the truly AMAZING documentation which came with the VIC-20 right out of the box. Then I'll take you through some of the other programming books gifted to me on that fateful Christmas, so long ago. I will also explain in further detail how this documentation enabled me to effect a repair for the "glitchy characters" which my ailing VIC-20 displayed in the last episode.
Back in the first installment of this series, I regaled you with the story of how I acquired my much-beloved VIC-20. I also hinted at the first steps with my VIC-20; steps that set me on the 'Engineering Path'--a journey which still keeps me gainfully employed today. As good as the machine was though, none of those early steps in programming and design would have taken me anywhere, or would have even been possible, had it not been for the effort that Commodore put into the documentation for the VIC-20.
Out of the box, my VIC-20 came with a small "User's Guide"; a spiral-bound, high-gloss thing. (Everything Commodore put out for the VIC was printed in this manner; big, cartoony, colorful, and high-gloss. I suppose they were constantly trying to remind you that, "This was the Wonder Color Computer of the 1980's!") In comparison to the sad little 1-page pamphlets and 3-page CD-only PDFs that might come bundled with a modern PC, this booklet looks like The Library of Congress.
Now it is undeniably true that nearly all of the 8-bit computers from that bygone era came with far better documentation than any modern PC's do. This is partially because computers were so new at the time; there was little "cultural awareness" of how they functioned, and what you could do with them. Manufacturer's had to introduce their customers to the product (to reassure the customer they'd spent their money wisely, and to encourage them to buy the equally expensive peripheral devices.) The other primary reason for providing higher quality documentation was to simply offset the crudity of the machines themselves--these were extremely "user unfriendly" boxes, no matter what the colorful packaging (or William Shatner) might claim.
At least initially, to get any use whatsoever out of the machines, the user was essentially forced to program the thing. For a long time, pre-packaged software was limited to games, or perhaps 1 or 2 very crude text-editors which masqueraded as "word processors" in those days. Unsurprisingly, the manuals which came with the various brands of 8-bit machines tended to focus on programming, providing lots of little example programs written in the various flavors of BASIC. They also focused on how to hook up peripherals, like cassette-tape players and printers, and how to configure those to work. (This was WAAY before the era of "Plug and Play". This didn't even qualify as "Plug and Pray". This was more like, "Plug, Dig through the manual to configure 15 obscure little switches, Attach the adapter box, Attach the other cable to the computer, Turn it on, Turn on the peripheral, and THEN Pray... that you didn't plug something in wrong, blow up your computer, and burn down your house.")
But the Commodore manuals were different, special; even by the standards of the time. The User's Guide which came included in the box with the VIC-20, not only explained BASIC programming, not only showed you where to plug in joysticks, cassette-tape recorders, disk-drives, and printers, not only showed how to use those peripherals via code examples, but it also provided some pertinent (and honestly, highly technical) details of the machine's innards.
Here are some excerpts:
As you can see from the examples, there is a goodly bit of information here. A lot of topics are covered:
All of this is presented in a very approachable way, with simple hand-holding steps building on top of one another. Despite it's smallish size, the User's Guide provided sufficient information about the machine layout and BASIC programming, such that a determined kid could write some rather complex software. A little bit of ingenuity, a lot of effort, and a goodly chunk of time was all that was required to create code that could: simulate physics, sample and analyze data (via the joystick and paddle port), control external devices, provide hours of gameplay, analyze and graph complicated math functions, tell stories, generate sound-effects, and so forth.
In the weeks after Christmas, I devoured the information and code-examples in the User's Guide. I spent countless hours typing in the sample games and programs, and making modifications to experiment with them. This was my first real experience with the addictive power of "The Zone", which comes when deeply immersed in rewarding mental effort. It was also, much to my mother's dismay, my first experience with a serious side-effect of getting into "The Zone": namely, Sleep Deprivation--something which all true programmers come to know well.
The plebian notions of "Day" and "Night" drifted together; they were meaningless designations. Everything was forgotten while I was buried so deeply in the machine; studying, puzzling, experimenting, and forever doodling new ideas. My utter immersion into the machine-world was aided by one simple fact: the weather.
During winter in Pennsylvania, there really is very little to differentiate "Day" from "Night". Both are cold, dark, grey, windy, wet, and generally filled with snow. In fact, to this very day I'm convinced that crappy weather is a prime factor in creating successful software. How many big/famous software development houses have ever existed in Hawaii, Tahiti, or along the sandy shores of the Caribbean? None so far as I know. All the biggest ones are in cold, snowy, rainy, or otherwise adverse climates.
Having exhausted the examples and information in the VIC-20 User's Guide. I next split my attention between two of the other books gifted to me: Compute's First Book of VIC and The VIC-20 Programmer's Reference Guide.
At that time, Compute! magazine (exclamation point included) was THE resource for information on the 8-bit systems. This particular book served as a collection of those articles and examples, dedicated specifically to the VIC-20. It was from this book that I obtained a great number of sample type-in programs. This book also rounded out my knowledge on the capabilities and limitations of BASIC programming for the VIC-20. It covered topics such as:
Nearly all the code in the book is written in BASIC, so I could follow along easily. Just as with the simple examples from the User's Guide, I spent a great deal of time fiddling with my own modifications to the example code--and that's where I really began to make progress. Over time, the patterns and methods and "larger-scale" concepts of designing software began to sink in. (For those of you who are rolling your eyes at this statement, particularly given that I'm talking about line-numbered BASIC here, deal with it. I wrote an article last year explaining why I think BASIC is STILL a good choice for learning to program.)
I had written a goodly bit of software before this, on the TRS-80 and Apple ][e machines at school. Now, my output exploded, both at home and at school. I began scribbling down program ideas and code at every opportunity: during study-hall, on the bus, at the dinner table, in the middle of the night, while sitting in the bathroom... (Hey, you've got to do SOMETHING, and crossword puzzles never were my thing.)
Having wrung out most of the information available in Compute!'s First Book of VIC, it was around this same time that I also began experimenting seriously with Assembly Language. I found the process incredibly frustrating at times, as I had no one to teach me, and no one with whom to bounce ideas around. The Programmer's Reference Guide came to my rescue. The book led me through the complexity of programming Assembly Language, and the bizarre intricacies of doing so on a real machine, with real constraints.
This is the book which really opened my eyes to the possibilities and capabilities of the VIC-20 and computers in general. This is the book that made that 'mysterious, secret knowledge' accessible to me. This is the book, above nearly all others I've ever read, which helped determine the course of my life.
It may surprise you to learn that this amazing book is still incredibly valuable today, and not just to me personally as a 'nostalgia piece' or in general as a 'historical artifact'. Why? Because even now, this book contains the knowledge equivalent to roughly 3 to 4 COMPLETE SEMESTERS of a modern Computer Science / Electrical Engineering degree.
No, I'm not kidding.
Topics this book covers:
ALL of these topics are the daily meat and potatoes of a modern systems engineer. And this single book covers them, providing an introduction to each concept, discussing the difficulties and pitfalls, and including sample code and explanatory diagrams.
Believe it or not, the venerable old MOS 6502 CPU which powers my VIC-20 is RELEVANT EVEN TODAY. In the realm of "Embedded Systems", modern variations of the 6502 CPU are still being designed into new equipment. (Wikipedia Entry on the MOS 6502 CPU.) This processor, along with the Zilog Z-80 CPU it competed against, not only helped define and shape the world of modern computing and electronics, they both continue to do so. This is an astounding achievement, a credit to their designers' ingenuity and effort.
So my thanks go out to the authors, anonymous and otherwise, who put together those books. I honestly have no idea what I would be doing today, had I not been able to study, learn, and grow my skills with those manuals. Walking dogs or selling 'slightly used' lemons door-to-door more than likely...
Ok, I know this has been lengthy, but stay with me, we're in the home-stretch here.
Waaay back in Part #2 of this series, there was a little video which showed the sad state of my VIC-20's screen output. How was it possible to diagnose the glitchy, sparkly, display problem? In a word: Documentation, damn fine documentation. The Programmer's Reference Guide came with full-schematics for my VIC-20. These schematics enabled me to track down and fix the video/character-corruption fault.
Without dragging you fine folks through too many details, I was able to use the schematic and Programmer's Guide in roughly this fashion:
That the blinky-bits fluctuated in the same pixels of a given character, SIMULTANEOUSLY on every appearance of that character on-screen, was telling. More than likely, the VIC-20 character ROM (901460-03) was faulty, or had broken/flaky pins. Opening the machine again, removing that ROM chip, and doing an inspection yielded no cracked or bent pins, and no corrosion or burn-marks on the circuit board. Time to dig up a replacement chip.
Five minutes searching on-line and less than $10 later, a NOS (new old-stock) VIC-20 character ROM was on the way. When it arrived, I plugged the chip into the socket on the motherboard, fired it up, and VOILA!
Thanks for hanging in there everyone! I know this was a long article, but it helps set the stage for next time. In the next and final installment of the Retro-Repair Adventures, you're in for a little treat; I will be revealing, for the first time ANYWHERE, some of my very own early attempts at BASIC game programming. I'll also give you a look at some of my hand-sketched notes for a Defender clone which never made it past the drawing-board stage. With that as a starting point, I'll then explain why the VIC-20 is both very EASY to program, but very DIFFICULT to program well.
See you soon, and happy retro-gaming!
Wow, awesome troubleshooting. Glad it went well with the ROM chip and you didn't have to dive much deeper.
I actually just ordered a third VIC-20 off of eBay (the second original-style model), hoping this one has that elusive combination of low interference video and working keyboard.
Awesome job. I can only marvel at your engineering prowess.