Emulating Pioneer LaserActive (Mega-LD) games

Moderator: Mask of Destiny

Post Reply
Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Thu Apr 05, 2012 12:34 pm

My capture card allows me to select between 0 IRE and 7.5 IRE. Am I right in assuming I should use 0 IRE? How do I determine which is the best setting to use?

Also, my capture card seems to capture directly in the YCbCr colour space, not RGB, so I shouldn't have any problems with the "mapping" of that signal to RGB values, until I'm ready to export the "lossy" version of it anyway. One of the reasons I used the huffyuv codec on the videos I posted above because it was able to store the video in the YCbCr colour space, so I never had to perform any colour space conversion.

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Thu Apr 05, 2012 2:00 pm

I've just started working on dumping the digital MegaLD disk contents again too. I've been looking at where I was up to before, and while my sub-cpu app isn't working correctly yet, I've been able to successfully load the bios sub-cpu app from my loader program, and I can see that it is managing to make bios calls that just fail from my app right now (eg, overlay control). I still don't know why my code isn't working, but rather than bash away at it any more right now, I'm going to use the bios sub-cpu app as a known working start point. By taking that code and stripping it back, then inserting my code into it, I should be able to get something that works quite quickly.

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Thu Apr 05, 2012 3:11 pm

I've finally fixed my dumper program! Huge thanks to TascoDLX for all his help. It's 1AM in the morning here right now, so I won't upload a full iso image of Space Berserker just yet, but watch this space! I'll also work more on the process for ripping the analog video and get that uploaded here in the next little while.

LocalH
Very interested
Posts: 152
Joined: Tue Dec 19, 2006 5:04 pm

Post by LocalH » Thu Apr 05, 2012 8:06 pm

Nemesis wrote:My capture card allows me to select between 0 IRE and 7.5 IRE. Am I right in assuming I should use 0 IRE? How do I determine which is the best setting to use?
A number of ways. You can use the origin of the disc as a starting point. If it's NTSC-JP or PAL, you'll want 0 IRE. If it's NTSC-US, you'll want 7.5 IRE. You definitely don't want to capture a US disc with 0 IRE setting, as you'll have no true blacks (and you'll also compress the luma details into a smaller range and thus lose a little detail that way). You can also capture a couple of small segments (black screen/really dark and really bright scenes) and see what your capture looks like (if it's too dark then it's likely NTSC-US captured as NTSC-JP, and if it's washed out and shadows are really gray looking, it's likely NTSC-JP captured as NTSC-US). Luckily, on the off chance you come across PAL MegaLDs, there is no setup at all to worry about. If you happen to have access to or own an analog video waveform monitor, you can run your LD player's output into it and see whether blacks sit at 0 or 7.5.

Also, my capture card seems to capture directly in the YCbCr colour space, not RGB, so I shouldn't have any problems with the "mapping" of that signal to RGB values, until I'm ready to export the "lossy" version of it anyway. One of the reasons I used the huffyuv codec on the videos I posted above because it was able to store the video in the YCbCr colour space, so I never had to perform any colour space conversion.
I'll need to clarify (and slightly correct myself) a bit here - as video is not generally stored in RGB colorspace, the output range would vary as needed by different playback devices. It's the YCbCr values that should ideally be between 16-235, although some devices can properly play back YCbCr 0-255 but as we're dealing with analog SD video here, I'd stick with 16-235. If your capture device captures 0-255 this can be adjusted for with AviSynth fairly easily. The nice thing about MPEG-2 is that it also uses YCbCr, so there would be no need for colorspace conversion until playback.

TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Post by TascoDLX » Sat Apr 07, 2012 5:36 am

Nemesis wrote:I've finally fixed my dumper program! Huge thanks to TascoDLX for all his help. It's 1AM in the morning here right now, so I won't upload a full iso image of Space Berserker just yet, but watch this space! I'll also work more on the process for ripping the analog video and get that uploaded here in the next little while.
Awesome. I was expecting you'd figure it out. ;)

I'm curious about the data (at least the first 24 sectors, maybe?), but I'm sure I can wait. My next few weeks are kinda busy, though I might be able to take a peek.

Huge
Very interested
Posts: 197
Joined: Sat Dec 13, 2008 11:50 pm

Post by Huge » Sat Apr 07, 2012 4:32 pm

I can offer my bandwidth for distributing any full images & data if needed.

Though with file hosting services being so popular, I doubt you'll need my help.

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Tue Apr 10, 2012 12:25 am

I'm still fiddling around with the video, but without further ado, here's the full data track for Space Berserker:
Space Berserker (MegaLD) (U) - Side 1 Track 1 Data (00-02-00).7z
This is the first dump of a MegaLD game to ever be posted online, and to my knowledge, the first dump ever performed. While this is all the digital data contained on the disk, it's incomplete without the analog video and audio to accompany it. I'll continue working on ripping that data over the coming days, and hopefully have a proper release of the video done soon.

Image

Space Berserker is quite a simplistic game, and most of the graphics and audio come from the analog LaserDisk video/audio tracks themselves, so the data for this game is quite small, and entirely contained in one track. This should make it a good candidate for initial work on emulation, You'll notice, the data track itself is around 13MB, but almost all of that is empty. I've ripped the entire region of the disk that contains digital data, to preserve information on the complete, readable sector range of the digital data. The filename itself provides the information on the disk side, track number, and start time (in min:sec:frame format) for the data. The video tracks will follow a similar format when I release them.

Since there's very little information about the Pioneer LaserActive online, and in particular, since I expect most people trying to emulate it won't have access to the real hardware, I've taken a short video showing the boot process and some gameplay for Space Berserker:
http://nemesis.hacking-cult.org/MegaDrive/MegaLD/Space Berserker/Space Berserker Gameplay.avi
It's not a full run through of the game by any means, but it will hopefully serve as a useful reference for anyone who wants to know how the game boots or looks while it's running. I've mostly skipped past the starting video sequences for the game, since it's just showing a video. When I upload the full video for the game, you can see the full sequences from that.


I should note, I'm at the point now where I'm ready to accept loans of MegaLD disks for the purpose of dumping them. Note that I'm also confident this dumping process will work for both MEGA-LD (Sega) and LD-ROM2 (NEC) disks, so if anyone has some LD-ROM2's and wants to see those dumped, send them my way and I'll make it happen.

TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Post by TascoDLX » Fri Apr 13, 2012 11:58 am

SHOOT THEIR PHASERS! :D

Here's my scouting report for Space Berserker.

As far as the data goes, it's just like an ordinary CD game. In fact, Space Berserker uses the same basic disc read routines as at least one other game: Lethal Enforcers. (There are probably a few others that use that code, but I haven't confirmed that. EDIT: Snatcher does [NOTE: Konami].) Obviously, the function numbers are different w/ maybe a few tweaks, but that should give you an idea of how the LD BIOS is designed.

The code for Space Berserker is pretty straight forward. A lot simpler than the usual FMV games, as you might expect. Probably true for most other MegaLD titles.

In case you're wondering, the init sequence of LD BIOS calls used by the game:
0131 [02], 0132 [00], 0118

I thought 0118 could be mute, which is undone by 0119, though I expect it would be video related based on the register it sets. Space Berserker sets it on the pause screen, so there's not a lot it could be doing. Maybe it freezes the frame. I don't know exactly what 0131 & 0132 do, but they're used similarly in the BIOS-run sequences. 0130 is related to 0132, and may be used to control volume.

Note, SB uses a couple different methods of disabling the overlay. The obvious one is using the vid faders. But it some cases, it just flips off the VDP display. Seem like that would be preferable if you're operating from the main cpu. Otherwise, I don't see a difference.

Here's something that caught me off guard: it seems the MegaLD uses video interleaving. So in a way, it can display one of two analog video streams at any time (which makes sense after watching the gameplay a few times). I'm not sure about the audio, but one thing to remember: the main audio stream is split into two channels (L/R). SB uses one for Japanese and the other for English.

EDIT: Just found out about Zapping Satsui, which highlights the video split feature. Also, it's multilanguage (Japanese & English), so that would entail 4 audio tracks concurrent with the video.

If you want to mess with this stuff:

Video Select: 012C [00] or 012C [01]
You may want to try 012D, too, as that might disable it?

Audio Select: 0139 [01] or 0139 [02]
If you want stereo, it's 0139 [00]. SB sometimes also sets bit 7. That suppresses an additional audio track? Not sure.

EDIT: 0131 may select the digital track (which that bit disables), and that may play in tandem with the video. Just tossing around ideas. Not completely sure of anything at this point.

One other thing to mention is the frames. Video frames are addressed by frame number in BCD form. So, frame number $10000 comes right after $9999, and the count runs at 30fps NTSC (or 29.97fps, I suppose?). It should be noted that there may be LDs that use a different form of addressing (like HH:MM:SS:FF or whatnot).

Nemesis, one other request of you. At some point if you could dump the LD registers, some of that information may be useful. Just a call to 011D w/ A0 pointing to a buffer of 32 bytes, anytime after the disc is loaded. Thanks.

I'll let you know what else I find. I still want to go over all the LD BIOS functions to try and narrow them down further. It might help to have a capture of the SB video for reference, so I'll be waiting for that. ;)
Last edited by TascoDLX on Sat May 12, 2012 6:46 am, edited 1 time in total.

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Mon Apr 16, 2012 1:08 pm

I'm looking at this again right now, trying to deal with the multiple audio track issue, but what you've mentioned about the video track surprises me. You mean, there can actually be two completely independent video frames together at any one address?

I'm going to play with those bios functions you mentioned and see what the result is. I already know $118 and $119, they freeze and unfreeze the video, as you suspected. The LaserActive has a digital memory buffer, and when you call $118, stops loading new frames into it and just outputs whatever is in the buffer. The audio tracks are unaffected, and continue along with whatever track is playing in the background. $119 unfreezes the video.

Here are some dumps of the LD registers:

Just after calling BIOS_DRVINIT, and in this case, after a bunch of calls to BIOS_CDBTOCREAD, but before issuing any read commands:

Code: Select all

0080 C548 0C7F 1400 4100 0000 0000 0000
0000 0000 0001 0000 0000 0000 0000 0000
After the first read command, reading 0x6F sectors starting from sector number 0:

Code: Select all

0080 C548 0E7F 0500 C100 0300 FFFF FFFF
0044 0003 3101 0001 0400 0000 0000 0000
After the second read command, reading 0x6F sectors starting from sector number 0x6F:

Code: Select all

0080 C548 0E7F 0500 C100 0300 FFFF FFFF
0044 0005 0701 0001 5300 0000 0000 0000
A few read blocks later:

Code: Select all

0080 C548 0E7F 0500 C100 0300 FFFF FFFF
0044 0005 0501 0001 5400 0000 0000 0000

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Mon Apr 16, 2012 1:58 pm

I'm not seeing any result from $12C, $139, or $131 yet, but some further info that might help. You said this before:
the main audio stream is split into two channels (L/R). SB uses one for Japanese and the other for English.
I think this is incorrect. Right now, when I play the SB video stream, I get video, and I get stereo audio, but the audio is just background noise. There's no voices on the audio at all right now. From what I understand, NTSC laserdisks could carry 2 analog audio streams and 2 digital audio streams concurrently, so I had theorized that the 2 analog audio streams were carrying the stereo background audio track, while the 2 digital audio streams were carrying mono voice sounds, one in English, the other in Japanese. I've been trying to figure out how to control the audio track selection so I can enable the digital audio streams, and mute the analog ones, so that I can rip all the audio tracks separately. No luck on this so far.

TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Post by TascoDLX » Mon Apr 16, 2012 2:32 pm

I think I missed a call for you. 0130 [A0] should set the volume to the correct level. SB is constantly setting the volume with this call, so I don't know if the value gets reset somewhere and this is how they counter it.

The video streams A & B should be basically the same, except only one of them has the comm chatter videos. Also, a slight difference on the Super Nova scenes.

EDIT

And, I did mention the game's init sequence, including: 0131 [02] and 0132 [00]. That would be important to setup the digital audio.

Also, thanks for the register dumps. I'll keep those handy as I check over some details.

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Mon Apr 16, 2012 2:52 pm

I still get no voice track following all those steps. I did find however that if I call $138 [FF], I do get the voice tracks, with the english track in the right speaker, and the japanese track in the left speaker. The background audio track disappears completely. I have no idea if this is a sensible parameter for $138, I haven't looked at its implementation, I was just mucking around with the bios calls trying to get something to enable digital audio. This is the only way I've successfully managed to play the voice tracks so far.

TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Post by TascoDLX » Mon Apr 16, 2012 3:10 pm

Based on what I've seen, I would set the same value to 0138 as you do for 0139. I haven't found where 0138 is set, but I'm sure it's there somewhere. The settings I gave for 0139 should be correct.

BlueBMW
Newbie
Posts: 2
Joined: Tue Apr 17, 2012 4:15 pm
Location: Knoxville, TN

Post by BlueBMW » Tue Apr 17, 2012 4:28 pm

I just read through this whole thread. Fantastic information and news!

Very glad to see some progress towards emulation. Having done a lot of repair work on these systems, I fear for their longevity. Especially with the rates at which PACs seem to be dying. My success rate on non working pacs is very low. The leaked caps seem to just demolish tons of traces on the Sega PACs making them very difficult to revive. Even the ones that still work are usually on the brink of failure. (Tasco, your pac ended up being a LOT worse than it originally appeared to be! I'll get you pics later on. Dont worry, it'll be good when I'm done :) )

Anyways, if this project needs any hardware or software I have quite a bit that can be loaned out no problem.

Hardware:
Multiple laseractive base units (9 to be exact)
Us and jpn sega pacs
Us and jpn nec pacs

Software:

Mega ld:
I will
Pyramid Patrol
Virtual cameraman
Virtual cameraman 2
Triad stone
Road Blaster
Rocket Coaster
Don Quixote (us)
Space Berzerker
Hyperion
3D museum
The Great Pyramid

Ldrom2:
Vajra
Manhattan requiem
Quiz econosaurus
Angel mate

And if I can convince a few of my friends to loan their copies I know people who own all the other games except for dr paolos and blue chicago blues (mld or ldr2)

Great project guys!

EDIT:

Also, I had a thought... It might be better to tap the LD video before it even reaches the chip where it gets mixed with PAC video. I'll look at the schematic again, but we can probably wire up a system to tap video way before the composite out jack on the back. Might help with quality etc. I have heard that when LD video (movie or game) is run through a PAC, the video is run in a different (lower quality) mode than when playback is done without a PAC (movies only of course) Maybe someone else can chime in on more details concerning this, but if its true, then maybe we can look into modding a system specifically for capturing this video.

TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Post by TascoDLX » Wed Apr 18, 2012 5:30 pm

BlueBMW wrote:(Tasco, your pac ended up being a LOT worse than it originally appeared to be! I'll get you pics later on. Dont worry, it'll be good when I'm done :) )
Cool. You are the man! Can't wait to see. ;)
BlueBMW wrote:Also, I had a thought... It might be better to tap the LD video before it even reaches the chip where it gets mixed with PAC video. I'll look at the schematic again, but we can probably wire up a system to tap video way before the composite out jack on the back. Might help with quality etc. I have heard that when LD video (movie or game) is run through a PAC, the video is run in a different (lower quality) mode than when playback is done without a PAC (movies only of course) Maybe someone else can chime in on more details concerning this, but if its true, then maybe we can look into modding a system specifically for capturing this video.
I would guess that the video runs at half the resolution considering the video split (where even and odd fields carry a different video stream). It would be helpful if there was a setting that allowed playback at full res for discs that don't use the split, but I'm skeptical. Your method sounds interesting. Even if resolution is the main issue, maybe it's possible to get a cleaner image by tapping it.

Anyway, welcome to SpritesMind! Great to have your support. :)

Post Reply