Author Archives: Multimedia Mike

8088 Corruption Data Format

By now, Trixter is gaining more fame due to his 8088 Corruption video thanks to a Digg mention. Since Alex more or less dared me to create Unix playback software for this format I downloaded the package and examined the 8088_COR.DAT file. It’s pretty straightforward: There are 0x7D0 bytes before the start of what looks like unsigned, 8-bit PCM data (you can tell because it is all 0x80 values, silence on a scale of 0x00..0xFF). There are 0x2DF PCM bytes before the non-PCM bytes start up again.

Let’s look at these numbers: 0x2DF = 735. I recognize this thanks to the Wing Commander III MVE format. 735 happens to be the quotient of 22050/30. The 8088 Corruption page mentions 30 frames/second in the first place.

What about the 0x7D0 number? That’s an even 2000 in decimal. 2000 = 80 x 25, the size of the standard text mode, in cells, of the old IBM 8088 machines. However, the first frame is entirely a sequence of 0xDB 0x10 byte pairs. My guess is that the video is actually using 40×25 text mode which makes for 1000 cells. Each cell is represented by an attribute byte (defines foreground color, background color, and flashing) and the actual extended ASCII character (0..255).

This strikes me as a classic vector quantizer problem– all the brainpower/horsepower goes into the compression side; the decompression is trivial. I can understand why Trixter claims the compressor is so complex.

Anyway, you want to write a program to interpret the data file? If my guesses are correct, the video will be rendered as 40×25 8×8-pixel cells, or 320×200 pixels. Find a table of all of the ASCII characters. Find another table of all the attributes. Load 2000 bytes from the data file. Render the data based on the attribute and character tables. Load the next 735 bytes. Play them back as mono, 8-bit, unsigned PCM data. Repeat until EOF.

As a means of validation, the size of a single frame should divide evenly into the total size of the Corruption data file which is 9268915 bytes. One frame is 2000 + 735 = 2735 bytes. 9268915 bytes / 2735 bytes/frame = 3389 frames. 3389 frames / 30 frames/sec = ~113 sec.

Hey, Jim: Do I have that all correct? :)

More on this topic:

MultimediaWiki Documentation

No matter how ambitious I get I can not stay ahead of the rest of the multimedia hacking community. I thought it was a lofty goal when I set out the re-categorize and expand upon a bunch of the information maintained at the FOURCC list using a Wiki. But I got suggestions to go further and incorporate the technical documents into the Wiki as well so that anyone can edit them.

And so it begins: I have entered the first few tech docs into Wiki format:

Much more to come.

Meet fusepak

I am pleased to learn that I may not have to go through the bother of implementing fusegraf after all. There is already a program called fusepak which mounts several different GRAFs onto the filesystem using fuse. Further, the author, Janusz Dziemidowicz, has expressed interest in implementing a BMS parser to allow an impressive amount of extensibility for fusepak. This part of the project is being written in (what I understand to be) an object-oriented, functional programming language: OCaml. If you have ever heard of this language, maybe you will wish to investigate this project as an academic matter. For my part, I’m looking forward to the finished product.


Caml logo

Profiles In Multimedia Hacking

Kudos to Reimar Döffinger for a new, clean implementation of the LZO lossless coding algorithm for the FFmpeg project. This means that there is one less external package that multimedia players have to rely on since there is an equivalent capability in FFmpeg.

I wanted to highlight this because it is useful when someone undertakes to re-implement a decoder from another package as another FFmpeg module. This has happened a number of times already, in the cases of Vorbis, FLAC, and VP3, for example. Remember, reverse engineering also applies to understanding bodies of code written in higher level languages than ASM and re-implementing them based on your newfound understanding.

For eye candy, check out Reimar’s “show your work” handwritten notes for understanding the LZO decoder. The original LZO decoder seemed to have so many labels and goto statements that it might as well have been written in straight ASM.