jPSXdec is a cross-platform PlayStation 1 media decoder/converter.
Get the latest version here.

Saturday, October 27, 2007

Close the world, Open the nExt.

After watching and enjoying the Serial Experiments Lain anime series, my interest was piqued by something I saw on the disc extras.

A Lain Playstation game.

And I had to own it.

With the help of my Japanese co-worker during my trip to Japan, I managed to acquire a copy all of my own.

Jen's site was accurate when it said there was very little info about the game. Following her lead, I wanted to change that. I wanted to decode the video for all to see. The audio could be ripped just fine, but the video refused to decode. Endless Googles later and I was still left wanting.

While toying with the game in an emulator, it dawned on me that if I couldn't decode the video off the disc, maybe I could let the game do it for me. I got the open source P.E.Op.S. GPU plug-in and went to work grabbing the video frames before anything was drawn over them. Soon I had nearly all the media from disc 1 sitting on my hard drive.

However, I ran into a snag. The decoded audio from the disc wasn't lining up with the video frames I had captured.

I had big plans, but was burning out and couldn't ever find a reason for this discrepancy. The project was abandoned for another day.

Two years later...

Finding myself still stumped over the audio/video mismatching, I veered a different direction. Could I possibly learn how to decode PSX videos myself?

Another endless bout of Googles later and I learned about JPEG and MPEG encoding. Soon I had my own I-frame decoder. It was the Q-gears source code that finally pushed the decoder into aligning with PSX data. It was done. I was seeing video frames from games I'd never seen before, and without ever touching someone else's decoder.

I could do what existing decoders could do, but what of Lain? What is with all this video data? It doesn't add up to anything sensible. Again I hit a snag. The only way to know what the data means is to see what the game is doing, and how could I do that?

I was just about ready to settle with my mis-matched audio and video frames, but I couldn't leave well enough alone. I ran across the pSX emulator that provides debugging capabilities. So over a three day weekend I swam through a sea of R3051 assembly code. By the end I knew how it is all done.

Outraged at the lack of information and source code about the PSX, I decided to take my little decoder to the big time and share everything I have learned over the last few months.

And thus is the jPSXdec.

3 comments:

  1. congrats!

    ReplyDelete
  2. hey, this blog is like me from an alternate universe where I actually finished doing this

    ReplyDelete