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

Emulating Pioneer LaserActive (Mega-LD) games

Post by Nemesis » Thu Apr 30, 2009 6:05 am

Has anyone attempted this? For people who may not be familiar with the system, the Pioneer Laseractive ( http://en.wikipedia.org/wiki/Laseractive ) was a Laserdisc player which had several addon modules engineered for it, one of which was a MegaDrive/MegaCD/MegaLD module. This module allowed regular Mega Drive and MegaCD games to be played through the unit, but it also allowed some unique "MegaLD" games to be played. MegaLD games are essentially unique MegaCD games which were made for the system and not available on any other format, which were stored on Laserdiscs. These games use analog video tracks from the Laserdisc and overlay them with the output from the MegaDrive hardware (akin to the way the 32x works) to blend MegaDrive graphics with true full motion video.

This system keeps popping into my mind. I don't think anyone's had a serious crack at emulating it yet, and I really don't think it would be very hard to do. Now that Virtua Racing has finally been emulated, Mega-LD games would be the only remaining commercial games for the Mega Drive which haven't been emulated yet, wouldn't they? According to Wikipedia, there are a good 20 or so unique Sega MegaLD games which were produced. I think we should have a serious look at what would be involved in adding support for MegaLD games.


What I want to do is simply open a discussion. It seems to me there are three main stages that we need to figure out how to approach in order to emulate this system:
1. Dumping the digital data from a MegaLD disk
2. Ripping the analog video from a MegaLD disk
3. Emulating the LaserActive hardware
I'm going to give my comments on each step.


1. Dumping the digital data from a MegaLD disk
As far as I can tell, nobody has ever dumped the digital data from a MegaLD disk. This would seem to be the first, most fundamental step. I think we'll find it won't turn out to be very hard at all to run a MegaLD game in existing MegaCD emulators, all be it without any analog video initially.

I think the best way to rip the digital data from a MegaLD disk would be to write a custom ROM file for this purpose, which we can load onto a flashcart. This ROM would have to directly communicate with the MegaCD hardware (similar to what the Flux cart does), and read the digital data from the disk sector by sector. As the data is read from the disk, it is streamed over the second controller port using MoD's parallel transfer code, and saved to an iso file on the target computer.

I think it's almost certain that the process for reading digital data from a MegaLD game would be identical to the process for reading the digital data from a MegaCD game. If this is correct, it should be possible for anyone who has a MegaCD to develop and test this ROM. Note that the ROM would have to be a normal Mega Drive ROM, not a MegaCD iso. The Laseractive physically locks down the disk it is currently running, and the CD and LD drives use the same physical spindle, so it wouldn't be possible to boot a MegaCD iso with some kind of ripping program, then switch out the disks and rip a MegaLD game, without making significant modifications to the Laseractive drive bay.


2. Ripping the analog video from a MegaLD disk
Ok, now this is the one we really need to discuss. A laserdisk stores analog video. There is no digital video content to rip. That means we need to decide on some kind of format to store this video data in. This is going to be back to the days of something akin to an iso+mp3 rip of a disk. We're going to have a digital image of the data area of the disk, then a series of separate video files for each analog video track. This seems to be the only option. The question then, is which video format are we going to use?

I have absolutely no idea about this one. We need to decide on some kind of format we can work with, and in reality, we probably need to make up our minds before any kind of effort can begin to even rip the video content from these disks. The format should be something which is supported across multiple platforms (IE, not windows-specific). It also needs to be something we can not only play back within our emulator, it needs to be something that we can work with during emulation. This video stream from the Laseractive needs to be composited with the video output from the Mega Drive, in a similar fashion to the way the 32x video is combined with the Mega Drive video. That means whatever library we use to access the video, we need to be able to get at the raw output. I haven't ever written an app to work with any kind of video container format before, so I don't really know what's out there, or what it's like to work with. Anyone have any advice or suggestions in this area?

In terms of the practical question of how to rip the video, I think that'll actually be pretty easy. Once we have a copy of the digital data from a MegaLD game, we should be able to easily see what interface the MegaLD games use to instruct the Laseractive to play a given video track. We then just need to write a test ROM which allows the user to trigger playback of individual tracks, and doesn't include any visible output from the VDP which would interfere with it. Load this ROM onto a flashcart and place a MegaLD game in the drive, and use an analog capture card to record each video segment out one at a time. Some care would have to be taken to provide clear markers as to the beginning and end of each track, but it shouldn't be too difficult.


3. Emulating the LaserActive hardware
I really don't think this is going to be very hard compared to the task of ripping the games themselves. I doubt there is going to be all that much difference between a MegaDrive+MegaCD and the Laseractive when all is said and done, and this is evidenced by the fact that the unit can of course play MegaCD and Mega Drive games. There is probably simply going to be an extra set of control registers somewhere in the MegaCD interface which allows the analog video tracks from MegaLD games to be controlled. All we really should have to do is emulate this interface, and use it to select which ripped video track to play.



I have a LaserActive, and I have one MegaLD game. I also have a flashcart, and a damn good analog capture card. I'm keen to attempt to rip a MegaLD game, but I can't do it by myself, at least not any time soon. I've never written anything for the MegaCD. It's a foreign world to me. I've never even looked at what would be involved in emulating it, or writing code for it. As a result, I've got no damn idea about how to go about writing the homebrew ROM(s) we need in order to rip either the digital or analog video from the disk. One of the reasons I'm posting this now is to see if someone here wants to give it a go. What we need is a MegaDrive ROM which can directly access the MegaCD hardware, and read out the digital contents of a disk sector by sector. Is this even possible? Do we have a resident MegaCD guru who wants to take up the challenge?

As for the rest of this project, has anyone looked into emulating this system before? Any comments/suggestions/advice?

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Apr 30, 2009 6:14 am

Actually, what would be cool would be to make a "player" for the CD 32X for MegaLD games. Use the 32X to play the video on the 32X display off the CD while the Genny takes care of the rest.

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

Post by Nemesis » Thu Apr 30, 2009 6:55 am

The MegaLD games can hold quite a bit of analog video, over an hour's worth I would think. How much video the released games actually use is another question, but I doubt you'd be able to fit many games with their ripped video tracks on a CD, especially using any video format simple enough to be decoded in realtime by the 32x.

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Thu Apr 30, 2009 12:33 pm

How about to check the MAME laserdisc games emulation? It uses own format to store analog video.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Thu Apr 30, 2009 1:14 pm

Fonzie is some of the most knowledgable persons regarding MegaCD, but he has his hands full of other things...
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

matteus
Very interested
Posts: 336
Joined: Mon Feb 04, 2008 1:41 pm

Post by matteus » Thu Apr 30, 2009 5:57 pm

What’s strange about this discussion is I did ask if it was possible for Fonz to release his Mega CD video player as a converter to allow videos to be place onto disc.

He said it would take too long as the process required a very specific video format, I guess using the 32x expanded palette would make things less restrictive and easier to optimise frame for frame...

Ahh I can dream lol it would be kinda cool to have a system capable of playing its own Video CD format haha.

I'm not up on my 32x hardware did it use tiles and palettes of a specific size?

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Re: Emulating Pioneer LaserActive (Mega-LD) games

Post by Mask of Destiny » Thu Apr 30, 2009 6:21 pm

Nemesis wrote:Note that the ROM would have to be a normal Mega Drive ROM, not a MegaCD iso. The Laseractive physically locks down the disk it is currently running, and the CD and LD drives use the same physical spindle, so it wouldn't be possible to boot a MegaCD iso with some kind of ripping program, then switch out the disks and rip a MegaLD game, without making significant modifications to the Laseractive drive bay.
The Sega CD BIOS has a function for unlocking the drive (the multi-disc games use it). I imagine it would work on the Laseractive as well.
Nemesis wrote:Do we have a resident MegaCD guru who wants to take up the challenge?
No promises, but I can probably take a whack at it over the weekend. I don't have a flashcart though so I can't help out with a ROM based approach if the disc unlock+swap strategy doesn't work out.

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

Post by Huge » Thu Apr 30, 2009 6:54 pm

As for ripping the laserdiscs, the MAME team has implemented a few advanced techniques for this recently, and they are using it for the Dragon's Lair-era games. Though, from what I've recall, their format is something like 10 gigabytes per disc (partly because they store it losslessly (?)).

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Apr 30, 2009 8:28 pm

Nemesis wrote:The MegaLD games can hold quite a bit of analog video, over an hour's worth I would think. How much video the released games actually use is another question, but I doubt you'd be able to fit many games with their ripped video tracks on a CD, especially using any video format simple enough to be decoded in realtime by the 32x.
I've been looking into VQ for 32X video. It would be like CinePak, but a little more regular. I was looking at 4x4 blocks, with a codebook split over two frames. That plus ADPCM audio gives a data rate the CD can maintain at 1X, so we're looking at about an hour on a CD.

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

Post by Nemesis » Fri May 01, 2009 12:05 am

Mask of Destiny wrote:The Sega CD BIOS has a function for unlocking the drive (the multi-disc games use it). I imagine it would work on the Laseractive as well.
Ooh, now that would be cool. Yeah, if the system supports multi-disk games at all, this would have to work.
Mask of Destiny wrote:No promises, but I can probably take a whack at it over the weekend.
If you can, that would be awesome. :D I really want to take a look at the code for these games.
Shiru wrote:How about to check the MAME laserdisc games emulation? It uses own format to store analog video.
Huge wrote:As for ripping the laserdiscs, the MAME team has implemented a few advanced techniques for this recently, and they are using it for the Dragon's Lair-era games. Though, from what I've recall, their format is something like 10 gigabytes per disc (partly because they store it losslessly (?)).
Wow, I've just read a bunch of stuff Aaron Giles wrote about this. It sounds like they've already dealt with all the video storage questions for us. They're using their own CHD container format to store the data. Not really what it was originally designed for, but it works. In terms of encoding the video/audio, they store it in a lossless format, but it's still a capture from an analog medium. The lossless compression is mostly to ensure no additional data loss after the capture process. Makes sense. If anyone uses any kind of lossy compression, inevitably someone is going to want to re-rip all the tracks in another 10 years time.

Rather than re-inventing the wheel, it looks like the best approach to the video tracks is probably to get the MAME team to have a look at it. They've obviously got the means and the method to get good, clean rips of the video. If MAME wanted to add MegaLD support, they would obviously want to rip the video to CHM files. Since they've already done the hard yards in this area, we could look into getting the MAME team to rip the video from the MegaLD disks for us. They'll be able to generate the CHM files which contain all the video data. From that point, we could accept the CHM encoding they came up with as the standard, and add support for playback of these MegaLD games from the CHM format in our emulators, or at the very least, simply convert from the CHM format to some other format. Since the CHM format is lossless, it makes sense for that to be the "master" format to store the original rips of the video content.

In terms of the data track, I still think we're in the best position to take care of that. I'm pretty sure the way the data track is encoded on a MegaLD disk is not part of the Laserdisk standard. The MegaLD module is probably the only device which can properly decode it to read the digital data. That means the easiest, most reliable way to rip the digital content from the MegaLD disks is to get the MegaLD module to read it for us. We can also rip the digital data now and work on emulating it, or at least document what would be involved in emulating it, without waiting for the analog video to be ripped.

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

Re: Emulating Pioneer LaserActive (Mega-LD) games

Post by TascoDLX » Fri May 01, 2009 12:31 pm

Mask of Destiny wrote:
Nemesis wrote:Note that the ROM would have to be a normal Mega Drive ROM, not a MegaCD iso. The Laseractive physically locks down the disk it is currently running, and the CD and LD drives use the same physical spindle, so it wouldn't be possible to boot a MegaCD iso with some kind of ripping program, then switch out the disks and rip a MegaLD game, without making significant modifications to the Laseractive drive bay.
The Sega CD BIOS has a function for unlocking the drive (the multi-disc games use it). I imagine it would work on the Laseractive as well.
I should point out that the MegaLD uses one of two subcpu BIOS based on the disc type -- the usual CD BIOS and a special LD BIOS. The CD BIOS is basically the same as a normal one except for some code that probably sets up some sort of compatibility mode. The LD BIOS is different where disc access is involved including many of the CD-BIOS function calls (though some of the functions are apparently similar) but the CDC is unchanged.

If you wanted to run such code from a CD, you would have to completely reload the subcpu BIOS in the process. This should work unless a hardware reset is required, in which case you would have to do the same running from ROM.

As for the LD registers, they are at 0xFDFE40 at odd addresses, half host (r/w) and half device (r/o). I'd have to check my notes for details. It's basically just ram with a byte for the command and a sync is used to send it.

(EDIT: Sorry, I had the wrong address. Corrected.)

I should be getting some more free time in the near future so hopefully I'll be able to help out. :wink:
Nemesis wrote:I really want to take a look at the code for these games.
Me too.
Last edited by TascoDLX on Mon May 04, 2009 7:54 am, edited 1 time in total.

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Re: Emulating Pioneer LaserActive (Mega-LD) games

Post by Mask of Destiny » Fri May 01, 2009 4:01 pm

TascoDLX wrote: I should point out that the MegaLD uses one of two subcpu BIOS based on the disc type -- the usual CD BIOS and a special LD BIOS.
How does the Main CPU know what the disc type is before it loads the BIOS on the Sub CPU? Does it load a BIOS on the Sub CPU (or some other code) ask it the disc type and then reload the BIOS as necessary or is there some register for checking it on the Main CPU side?

How does the unit determine disc type? Is it based on the size of the disc (or some other physical feature of the disc) or on some field in the first data area? In other words, can we make a disc that the BIOS will treat as if it was an LD game and thus avoid any BIOS reloading?
The LD BIOS is different where disc access is involved including many of the CD-BIOS function calls (though some of the functions are apparently similar) but the CDC is unchanged.
Have any notes on the differences?

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

Re: Emulating Pioneer LaserActive (Mega-LD) games

Post by TascoDLX » Sat May 02, 2009 3:30 am

Mask of Destiny wrote:How does the Main CPU know what the disc type is before it loads the BIOS on the Sub CPU?
It loads the LD BIOS by default. If it detects a CD (or not LD, perhaps) upon boot, it will reload with the CD BIOS. That means the system can transition from LD BIOS to CD BIOS without a hardware reset but I don't know if the opposite is true.
Mask of Destiny wrote:How does the unit determine disc type?
It's based on a value returned from the LD device. So, I doubt it can be faked (without a hack, of course).
Mask of Destiny wrote:
TascoDLX wrote:The LD BIOS is different where disc access is involved including many of the CD-BIOS function calls (though some of the functions are apparently similar) but the CDC is unchanged.
Have any notes on the differences?
As far as the CD-BIOS calls are concerned, all the functions numbers are different. They start from 0x0100 so there's no confusion with the original numbers. Some of the functions (like the CDC functions) are the same except for a different number, several of the functions appear to be equivalent to original functions except that they use the LD interface -- for example, there are DRVINIT and DRVOPEN equivalents -- and some functions are a bit of a mystery.

On the hardware level, the CDD registers (CDD comm, fader) are not used -- comm is handled via the LD interface (through the LD register array). Consequently, the level 4 CDD interrupt is also not used. Status is queried and received directly through the LD interface.

Snake
Very interested
Posts: 206
Joined: Sat Sep 13, 2008 1:01 am

Re: Emulating Pioneer LaserActive (Mega-LD) games

Post by Snake » Fri May 08, 2009 7:08 pm

Nemesis wrote:I have a LaserActive, and I have one MegaLD game.
You're the first person I've spoken to who actually has one.

From what I understand the discs contain a "normal" 600MB SegaCD-style image, so that should be pretty damn easy to rip. If it becomes necessary to avoid the BIOS and go direct to hardware for this, that's doable too. It's going to take a loooong time over the controller port, though ;) Or maybe not - I don't imagine these games are very big - no FMV required, and since it's physically impossible for the system to play analogue video and CDDA at the same time, I would think there wouldn't be any standard audio tracks either.

I don't believe the video on LDs is arranged as tracks, just a single big stream, like a VHS tape - but with the ability to seek to any point. For this you're going to need a good capture card.

I haven't thought about it beyond this point (mainly because I've never found anyone who has one) but I don't see it being particularly difficult. Still far busier than I really want to be, but I'll check in when I can and offer whatever help/advice comes to mind.

powerofrecall
Very interested
Posts: 237
Joined: Fri Apr 17, 2009 7:35 pm
Location: USA

Post by powerofrecall » Sun May 10, 2009 4:51 am

I can't even PRETEND to have a lot to contribute, but I for one would love to see some MAME style CHD's of MegaLD games--it's a totally forgotten aspect of the megadrive legacy...

So MegaLD's actually could utilize analogue, LD based FMV's? My mind is blown.

Post Reply