8088 Corruption

An exercise in displaying full-motion video on the first IBM PC

8088 Corruption is a program that Sandor Tojzan and myself created in 2004 to demonstrate that it was indeed possible to display full-motion, full-screen color video (with sync'd audio) on an original 4.77MHz IBM PC with nothing more than a Sound Blaster card and CGA. I came up with the player and first few encoders; Sandor created the final (quality) version of the encoder.

Downloads of the player and sample video files are available so that you can try it yourself on your own classic hardware. And, while Sandor's encoder has not yet been released, Mike Chambers worked on and released an encoder so you can make your own 8088 Corruption-style videos yourself.

This started as a bit of a joke around the office about doing st00pid things with old technology, like, "Oh yeah? Well, I can calculate fractals on an abacus!" or "Oh yeah? Well, I can whistle at 300 baud!", etc. During said nerdly session, I blurted out, "Oh yeah? Well, I can display video on my XT!". And then I caught myself, because it was at that point I realized it was actually possible. And then became obsessed.

Months later of tinkering on an IBM PC Model 5150, I had something working, and casually mentioning the project to gODjR/iq2000 (Sandor) sparked his interest and he began work on a MUCH vastly improved transcoder for video to our system. He delivered it a few days before the demoparty Pilgrimage 2004, and I encoded the sample video I had prepared into raw data, transferred it to the 5150, and then packed the whole thing up (monitor and all) and took it on the plane with me. Once there, I ran into massive hard drive corruption problems and lost half the video data and 75% of the audio data -- but, even with a broken production, we won 1st place ;-)

I gave a presentation on 8088 Corruption at Block Party 2007. The best way to see what 8088 Corruption is all about, if you're not able to run it yourself, is to watch the video of that talk. The video of that talk is available at The Internet Archive. While it is possible to watch it online, I highly suggest you download the MPEG-2 file, burn it to a DVD, and watch it on a set-top DVD player; this is because some of the examples have full 60Hz motion that can only be seen properly with a non-broken video player. The presentation not only shows the program in action, but more importantly explains exactly how it was created, the methods that were used, and ways to improve the system.

The original video I made for the Scene.org awards in 2004 is still available below, but the quality isn't nearly as good as the Archive version above. It's presented here only for historical purposes:

8088flex.zip: This is the most recent version of the player program and the file you should download first. It contains an updated player, the original "8088 Corruption" video in a new format ("TMV") to work with the new player, documentation, and some source code.

Mike Chambers' encoder is also available. It's a Win32 command-line executable that takes .AVI files as input.

Some additional videos are available:

mike1984.tmv wast contributed by Mike Richardson in 2006 -- which is no small feat because even in 2007 I haven't released the converter (yet). He writes: "My encoder is very simple. It takes a QuickTime movie at 80x25 resolution, and a WAV file of the appropriate specifications. The hardest part was determining the best color to use. It's fast though.". I was impressed and flattered by his attempt. I've converted it to the new TMV format so that you can use it with the 8088flex player.

the8trix.tmv is a section of The Matrix. I created this file to illustrate some points I made in my Block Party presentation. Although the conversion is not that great, it's still possible to figure out what's going on because of elements I talked about in my presentation: Faces, human movement, and an easily-recognizable pop culture reference help your brain to fill in the gaps.

pop.tmv is a small section of the beginning of M's Pop Muzik video from 1979. It was created to illustrate what 60Hz motion looks like. It rebuffers, but it still shows you how eerily realistic 60fps can look. Run it through the AVPAD utility to decrease the buffering times.

tronlite.tmv is here by popular demand; it's the light-cycle sequence from the movie TRON. Parts of it look fantastic (the game grid, the cycles) and other parts look like total ass (the Recognizers, the distant shots). Still, it knocked 'em dead at Pilgrimage, so here you go. It's also pretty large -- 20MB drive required.

trondisc.tmv is another sequence from TRON, which is the first disc-throwing scene and our introduction to the TRON program. It's a great conversion -- the colors are vibrant, the motion is good, and you can easily tell what is going on. It's also 24fps and 22KHz audio, so it should play without rebuffering on any MFM hard disk.

trondisc_source.avi is the source file for the TRON disc sequence. I'm providing it so that anyone who wants to take a stab at making their own transcoder can use the same source file I did and make comparisons.

The original 8088 Corruption program is still available, but only for historical purposes. You should really be downloading the 8088flex distribution.

Not patient enough for me to release the source code, Mike Melanson reverse-engineered the data format in case people wanted to write a player for your own platform. After his page went up, several people did just that:

Q: Is that a cat I hear in the background of the video? Yep, my at-the-time 14-year-old tabby Niki, gone but not forgotten. I didn't realize she was audible in the video until after it was submitted, and I didn't feel like re-editing the video for fear that I would be accused of tampering.

Q: Big deal, my 8-bit C64/Atari/Speccy can do more with less. Digitized audio aside, yes, they can, because they have much more flexible graphics hardware. Even the simple act of being able to redefine the character font in text mode gives them much higher graphics capabilities than what we had to work with. The true hack of 8088 Corruption isn't the playback software, but rather the video conversion to make the most of CGA, which was very fixed and limited (can't change the font, can't change colors, etc.).

Q: It has a hard drive in it; can you really call that a "stock" 5150? No, I suppose it isn't "stock". But it was perfectly possible to add hard drives to a 5150 before the introduction of the XT (5160) in 1983. I have always claimed that all you need to run 8088 Corruption is a 5150, a hard drive, and a Sound Blaster, which is not an unreasonable or false claim.

There are lots of things I would like to add if I had the time. If any of these appeal to you, let me know and I might fire up the compiler again:

Stereo audio (somewhat easy, just need to code support for it in the header and then perform realtime mixing for mono cards)

Using the system timer interrupt to make the system work if you don't have a sound card installed. Playback should be possible on PCjr and Tandy with this option, albeit without any sound.

Lossless real-time decompression (audio and/or video, although video would provide the most bang for the buck). I already have several ideas on how to do this for "free", but doing so is such an undertaking that it will probably become its own project...

The AVCOMP video compiler utility adjusts the sample rate so that each chunk is an integral number. This is good for various reasons. Unfortunately, on long files (3 minutes or longer) with fractional framerates and sample rates, the compiler introduces drift into the final file. This is bad for obvious reasons. The workaround is to use samplerates and framerates that don't require adjustment, such as 30fps and 22050 sample rate (22050 / 30 = 735, a nice integer). If your file is 2 minutes long or less, you probably don't need to worry about this.

8088 Corruption was originally only seen by about 70 people at Pilgrimage 2004, after which I fixed it up and released it. In Spring of 2005, it was nominated for a scene.org "best of 2004" award; while I don't think anyone seriously thought I would win :-) I was still extremely flattered and humbled.

A year later, I noticed Google Video was in beta, so I took the scene.org video I created (since hardly anyone has a real 5150 any more), stuck it there, and promptly forgot about it. 2 weeks later, 8088 Corruption gave me another 15 minutes of fame when someone noticed it on Google Video and posted it on digg.com, where it became one of the most "dugg" stories for the week of January 22, 2006. During the next 24 hours, news of it spread to Slashdot, waxy.org, and two dozen blogs and my home network (where I initially hosted everything) ground to a screaming halt.

Because it was one of the most "dugg" stories that week, discussion of 8088 Corruption became a short segment of Diggnation. You can download a portion of that segment if you originally missed it.

Two years later, on New Year's Day 2008, it hit Digg again. I'm very flattered!

8088 Corruption wouldn't have nearly been such a fun project without many other people. I would like to thank:

Igor Prokopinskiy, for daring me one day at the office to put my money where my mouth was

Sandor, for taking such an interest in the project and writing the final encoder

Jason Scott, for encouraging me not to give up at Pilgrimage after I suffered a hard drive crash and lost half the video/audio data

Mike Melanson, for taking such an interest in the project and always being encouraging

The Oldwarez Boyz (you know who you are) for being my fellow partners in oldskool crime since 1997

Brian Hirt and Dan Singer, two programmers whom I will never equal but have provided me with 20+ years of inspiration

And of course, a really big thank-you to everyone who has contacted me over the years to say how much they like it.

Please check UPDATES.TXT in the archive for the latest info.

20130223: Added "/q" for "quiet" operation. This doesn't bother checking for a sound card, so you can run 8088flex on any system now. Mind you, running it on a mono system with no sound card is a little depressing, but it does run. 20120920: COMPLETELY REWRITTEN memory, disk, and interrupt-handling scheme. This player should NEVER crash... However, if you are playing a file with an extremely high framerate (like pop.tmv, which is 60fps) with an extremely slow hardisk (ie. 20MB MFM), it might crash, maybe. If that happens, reduce the "IO Magnification factor" using /x. The default is /x4, but you can reduce it to /x3, /x2, and finally to /x1 to get the same IO handling and performance of the previous version to see if that helps. Any hard disk should now be able to play the 8088_cor.tmv file without any pauses. Performance is so good now that I've added CPU idle tracking (thanks James Pearce!) so you can see how idle the CPU was during playback, as well as how much time was spent reading from disk. Yes, your lowly 8088 can multitask if programmed correctly!

Comments

Some of my favorite comments by people who like 8088 Corruption:

In order to get the a/v synch, he's got the soundcard (the only element in the machine with a reliable timer) initiating all the video transfers. So the machine essentially has a sound card-driven OS. My brain fell out when I heard that. -- Guybrush / Northern Dragons

Smoother video than my dual core Vista machine! -- Krumm

If he is able to achieve full motion video at 30FPS on a 4.77MHZ processor can you imagine what he could do given the right funding for research? -- gamemaster357