Oldskooler Ramblings

the unlikely child born of the home computer wars

World Firsts and Happy Accidents

Posted by Trixter on July 20, 2013


(Impatient?  Scroll down to the end of this post if you just want to watch the videos or download the programs.)

The demoscene used to be based almost completely on “world firsts”, which are bonus levels of street cred given when you are the first in the world to produce a living, working example of some new technological marvel.  In the early days it was as simple as “most sprites onscreen at once” (impressive because you were exceeding the hardware’s published limitations for that kind of thing) or “first example of texture mapping on PC” or similar.  Nowadays the “world first”, as a pure concept, as been boiled down to “first demo for a platform”.  So for modern hardware, this will likely translate into something like the very first demo for the XBone or the PS4.

But what of old hardware?  Just about every single old personal computer has had a demo made for it.  Pouet lists over 25,000 demos for over 90 platforms from the Acorn to the ZX Spectrum.  There are demos for the TI-86 calculator, for old nokia cell phones… even a goddamn typewriter.  Linus Åkesson even created his own hardware platform out of a microcontroller when nothing else seemed interesting.  It is pretty hard to find something that hasn’t had a proper demoscene demo made for it.

Luckily, my obsession with the IBM PCjr’s 30th anniversary pays off in this area.  Around the beginning of the year, I noted that there have been a few demos that supported the Tandy 1000’s 16-color graphics and 3-voice sound, but nothing that was specifically designed for the PCjr, which made it a “virgin platform”.  Since I had intimate knowledge of the CPU and had a decent development toolchain, and with @party 2013 coming up, I realized this was probably my last chance to achieve a world first, so I starting writing code around April.

To qualify as a “world first” for the platform, I felt it was appropriate to perform one or more effects that specifically required a PCjr to run, and for good measure, that nobody had ever seen before so that DOSBox or any other emulator would not be able to run the code properly.  One of my favorite features of the PCjr is a real vertical retrace interrupt that you can use to perform display operations “behind the scenes” so that any tricks you’re pulling remain invisible.  Coding to use that went very well, and no emulator or clones (save for a few early Tandy 1000 models) provided it, so I started off on a proper little demo for the platform.

Along the way, I found that my ideas to use the vertical retrace interrupt broke down because I needed to do more operations than I had time for in the blanking interval, so I wrote my own interrupt sync’d to the interval I wanted using the system timer instead.  I also discovered that the PCjr’s legendary lack of speed (it’s the slowest PC clone ever made) meant I couldn’t use the 320x200x16 mode I originally wanted to — there’s just too many bits to move around in a reasonable amount of time.  To maintain world-first status, I pondered creating a PCjr cartridge-based demo — a ton of work I wasn’t really prepared for — when I discovered that some poor coding on my part had resulted in some odd graphical properties in the 160x200x16 mode.  The wrong values had configured the PCjr’s video gate array to double each line.  Completely by accident, I had created a lower-res 160x100x16 mode with a true linear chunky organization!  (This is not the same as CGA “lowres” mode, which is based on text mode and is slow to work with.)

That mode was a great match for the slower speed of the PCjr, and I proceeded to write the entire demo and all its effects to use that mode.  I had already started a silly joke game for the PCjr, and when I discovered the 160×100 mode, I retrofitted the game to use it as well!  Both of these productions won 2nd and 1st place in their respective categories at @party 2013 (and Phoenix doing the graphics and sound for the demo was a big help; check the video below for his tiny Charlie Chaplin).

But more important than winning competitions… world first, y’all.  I’m part of an elite group of less than 100 people in the entire world.  Which I know just about nobody cares about, but I care, and that’s what makes me smile.  :-)

To view the demo, watch INTROjr on Youtube.  Regrettably, the demo is not shown at the full framerate because Youtube doesn’t support 60fps video and has no plans to in the near future (of course, they support near useless 4K resolution video, but whatever).  Download links for the software can be found on INTROjr’s Pouet page.  .

To view the game with a silly theme attached, watch HARLEM SHAKEjr  on Youtube.  Download links for the software can be found on SHAKEjr’s Pouet page.

PS: If you want source code to the PCjr-specific bits, such as the music player, the vertical retrace interrupt, setting the special graphics mode up, using multiple graphics pages, reading the joystick, etc., drop me a line.

One Response to “World Firsts and Happy Accidents”

  1. Serendipity! This mode could be useful because it trades resolution for speed, which is especially important in the un-expanded Jr.’s case.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.