Articles posted December 2006

A Quick Look Back

Now that the power is back on and Christmas vacation is over, I decided it was finally time to update a few stale pages on the site. The end of the year is always a good time to clean house. First, I removed the old MAME art section, since Mr. Do is doing a fantastic job accumulating nice, high quality artwork scans, and my feeble page seemed kind of sad in comparison!

Second, I went ahead and updated my MAME Log page with a summary of what I've been up to this past year. You'll notice heavy use of the word "rewrote" -- guess I felt some significant changes were needed. :) Luckily, I think things will settle down this coming year, with fewer rewrites (except for a few crufty drivers), and more fine tuning of the code that's currently there.

Third, I got to remove a few items from my fairly random MAME To-Do List and threw a couple more onto the fire. The exciting thing is that both of the "core" items that used to be there -- rewrite the video system and add laserdisc support -- are either complete or in progress. The only other major change I have in my sights right now is combining some of the Windows and SDLMAME code into common core pieces, which I hope I get a chance to do in the coming year.

But first I need to get back to that laserdisc support! I've had a lot of offers of help from people who are really excited to see this finally happen in MAME, and some great and very talented folks are helping to make sure this is done right. With luck, we'll have something to show for MAME's 10th anniversary (that's my hope, anyways!)

Out of Commission

As you might have heard, we got hit by a pretty nasty windstorm Thursday night. Fortunately, Vera and I didn't suffer any trees falling on our house or other bits of devastation that hit the area (though at least one of my coworkers did). However, since about 10pm Thursday, we've been without power, as has most of the entire region. It's all a bit eerie and strange. Last night was particularly fun as the outside temperatures dipped into the upper 20s and the inside temperatures were in the 40s.

The few places that do have power are completely mobbed. Downtown Seattle is one of those, which is where I'm at now, typing this from Vera's companies swanky new offices. Thanks to firewall issues, I don't have mail access here, so if you've sent me anything, you'll have to wait until I'm online for real before getting any response. Hopefully we won't have to be without power too much longer ... I can already feel the withdrawal setting in. :)

Given this, there's only a slim chance of seeing a MAME update between now and Christmas. Oh, and thanks to the various folks who responded to my last post, I think I have a disc secured now.

Wanted: Dragon’s Lair Laserdisc

I'm looking for someone, preferably in the U.S., who owns an original Dragon's Lair laserdisc and is willing to loan it out for a couple of months. Either contact me via my webform, or reply to this post. Thanks!

Yes, Laserdisc Support is Coming

It should be pretty obvious with the update to the Dragon's Lair driver in 0.110u4 that something is brewing on the laserdisc front. There has been a lot of discussion over the years about how to make it happen, what video formats to use, etc, etc. In the end, it seemed that nobody was ever happy enough with the proposed ideas to actually take them and run. But with the discs and equipment getting older and older, and my (relatively) recent success in reading an NFL Football CED (thanks to Tim's help), I figured it was finally time to just pick a direction and move forward.

One of the big stumbling blocks is that pretty much all existing video compression algorithms are heavily patented. Which means that for freely developed and freely available software, there isn't really a good way of utilizing standards such as MPEG. Plus, MPEG hardly qualifies as "archival" quality. For this reason, MAME will be going its own way, but it won't be straying too far from the usual paths.

The container format for the data will be CHD (which originally stood for Compressed Hard Drive, but has since been redubbed as Compressed Hunks of Data). Each frame, including audio and video data, will be a fixed length (some frames will have one fewer audio sample due to rounding, but this is easy to compute). The video frame rate, height, width, audio sample rate, and number of channels will be encoded in the CHD metadata. Each frame is independently compressed.

Audio data is stored as multiple 16-bit channels at an arbitrary sample rate (we will be shooting for 44.1kHz stereo during sampling). The audio data is compressed losslessly using Huffman-compressed deltas. This gives a nice compromise between storing the data raw and doing something more complex and aggressive like FLAC. Audio data is just a drop in the bucket anyway from a data rate perspective, so why skimp? This compression may also be used in the future for CHD-CD's with audio tracks, and for systems that read/playback tape-based data.

Video data compression is still being fine-tuned, and is waiting some good quality source data to experiment with, both animated and filmed. At a minimum, a lossless compression based on Huffman-compressed per-channel (Y,Cb,Cr) deltas will be available. This is essentially what HuffYUV does. I have also written a lossy DCT-based compressor that is tuned for archival purposes rather than bit rate limiting. That is, with an MPEG compressor you specify your data rate, and the compressor quantizes the DCT coefficients to fit the data rate. With our video compression, you specify a maximum error and a maximum average error for each channel, and the compressor tweaks the quantization on each 8x8 block indepedently to ensure that those criteria are met.

The source material will be sampled at DVD resolutions (720x486 for NTSC video) in "uncompressed" form -- which is actually slightly compressed in that it is 4:2:2 subsampled, so each Cr and Cb sample covers two pixels horizontally. This is oversampling for laserdisc video, but it's better to have more data than not enough data. This effectively gives you 16 bits per pixel uncompressed, or 720 x 486 x 2 = 699,840 bytes per frame. Add in a frames' worth of audio data (assuming 29.97fps) at 44100Hz gives an extra 5886 bytes, for a total per-frame average of 705,726 bytes (5.4 MBits) per frame.

Once you start multiplying that out, it's a lot of data: 20.6 MB/second, 1.18 GB/minute, or 70.9 GB/hour. Most video game laserdiscs are CAV, which maxes out at 54000 frames, or just over 30 minutes. Lossless tends to give you between 2:1 and 3:1 compression. Going up to lossy with medium deltas (up to 4/256 per component) gets you closer to 4:1 and 5:1 compression with almost no visible difference. Increasing the max deltas beyond that helps further with compression, but it definitely starts to become visible.

Not everything is nailed down yet, and it will probably take a couple of months to materialize, but those are the basics. The first game I'm looking at is obviously Dragon's Lair, but coincidentally, I just received in the mail a driver for the American Laser Games series of shooters as well, which were all run on an Amiga 500 with a genlock. Fortunately, the Amiga emulation is pretty decent these days, so things are progressing well there. :)

Now that the basic system is up and running, I'm hoping others can help get the rest of the laser games moving forward. In 0.110u4 I included support for a couple of common laserdisc players. Even though you can't see any video yet, you can at least watch their operation to see if things are working properly. In 0.110u5 I'll have support for the Sony LDP-1450 laserdisc player and the ability to display dummy frames (each frame is solid color and gets a unique Cb/Cr value) so that you get a little better sense of the operation. And hopefully in the next month or so, I'll have the first video running at last....