Emulating Pioneer LaserActive (Mega-LD) games

Moderator: Mask of Destiny

Misty
Interested
Posts: 15
Joined: Mon Nov 14, 2011 4:08 am

Post by Misty » Thu Nov 24, 2011 12:56 am

Nemesis wrote:Thanks Misty, it's good to see there's some interest out there about this. I'm taking a short break from this for now to work on other things, but I'll be coming back around to it in the coming months, so watch this space.
I'll definitely keep an eye out. I've got the thread watched so I'll get an e-mail as soon as someone posts. ;)
If I get a dumping process working for the disks, I'll definitely need people like you who have the actual media to help out with the dumping efforts. The only game I have is Space Berserker.
If you don't mind sharing your techniques, I'd be glad to help out where I can, too - by dumping discs, or helping with coming up with the dumping process (if I can!), or the video stuff, etc. I've got some video capture experience, and good hardware.

I've got five games right now:

Blue Chicago Blues
Hyperion
Manhattan Requiem
Pyramid Patrol
Space Berserker

I lost interest in collecting for a bit because most games for the system are just so crappy, but the prospect of dumping them is making me interested in buying again. ;)
Yikes, I didn't know that. My capture card can capture individual frames without deinterlacing, (IE, grab either the odd, even, or interlaced frame), but I don't know if it can record video without deinterlacing. I'll have to check the settings.
Definitely look into that, because it could be a deal breaker. If deinterlacing changes the frame references, then even on games that use 480i footage it might be hard to use for emulation.

Another thing I noticed that you might want to keep an eye out for - at least from the glance I've taken so far, it seems like all game discs I have (whether Japanese or North American) run at the NTSC-J IRE of 0.0, instead of the standard NTSC-M IRE of 7.5. You'll want to see if your capture card has an option to choose an IRE, because if you use the wrong setting you'll probably either clip or crush the darkest part of the image. The difference isn't a huge deal on analogue monitors, where the values aren't absolute and it's possible to display "blacker than black" colours; the signal just looks slightly darker. But when digitizing the signal most capture devices interpret the base IRE level as an absolute black and clip any values below that.

(IRE is basically the amplitude of the video signal, and the bottom of the range represents the black level.)

THE_MOOGLEKING
Newbie
Posts: 5
Joined: Wed Dec 14, 2011 7:13 pm

Post by THE_MOOGLEKING » Wed Dec 14, 2011 7:16 pm

Hey, everyone.

I'm currently in the process of obtaining a fully-functioning Laseractive with the Sega PAC (I already have the PAC and a game, Pyramid Patrol, just waiting for an auction on the player itself to open up).

I am all for the preservation of this highly unique system. While I'm not well versed in the technical knowledge required to write dumping or emulation software, I am more than willing to run any of said software on my unit and dump any game I come across. My Laseractive is yours.

I will also be getting a cap change on this Sega PAC to ensure its longevity, in case serious talks of emulation get underway. Thanks, and I hope that this project becomes a reality!

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

Post by Nemesis » Wed Dec 28, 2011 10:13 am

Just a quick update, I've had another go at this tonight, and made some progress. It seems there's something different about the LaserActive that prevents the normal mode 1 boot procedure from working correctly, so I haven't been able to successfully initialize the LaserActive from a cartridge boot yet, but I did find a bug in my code which was responsible for the DRVINIT command failing before. After fixing the bug, I can now successfully boot a CD on the LaserActive, switch disks, and dump another CD across the controller port. Unfortunately, without an LD burner this doesn't directly help us, since once the LaserActive has booted from a CD, it gets the CD sub-cpu bios loaded, which can't read from an LD.

The next stage now is somehow getting the LD sub-cpu bios loaded and working, so I can get it to read a MegaLD disk. Since all attempts at loading the sub-cpu bios manually have failed so far, I'm going back to my original method of hijacking the system after a MegaLD game has booted, but this time, I'm going to try and quietly inject code into the sub-cpu without interrupting the bios, and take control of that too, so I can stream data back from the sub-cpu without having to re-initialize the bios. I'm hopeful this will allow me to successfully dump the data. I'll give this a try early next week.

THE_MOOGLEKING
Newbie
Posts: 5
Joined: Wed Dec 14, 2011 7:13 pm

Post by THE_MOOGLEKING » Thu Jan 12, 2012 8:09 am

If you need a copy of Rocket Coaster at some point in the future, I have one. For reference.

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

Post by Nemesis » Fri Jan 13, 2012 12:02 am

Thanks, I'm hoping to be ready to dump disks soon. I've made very good progress, I can now boot from a cartridge and gain complete control over the main cpu and sub cpu in the LaserActive, and I can get the bios to execute my commands. I've managed to dump some data from Space Berserker, but I'm still having a bit of trouble getting a complete dump of all the data. I need to do more testing, but I'm getting there.

Misty
Interested
Posts: 15
Joined: Mon Nov 14, 2011 4:08 am

Post by Misty » Fri Jan 13, 2012 12:58 am

Very good news!

Out of curiosity, how did the technique on the last Space Berzerker dump work? Is that different from what you're doing now?

I'm not familiar with how the filesystems are stored - I wonder if dumping over MegaLD is feasible for LD-ROM2 games, or if that'll require a separate dumping technique.

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

Post by Nemesis » Fri Jan 13, 2012 4:24 am

Well, with some help from this thread:
viewtopic.php?t=1018&start=0
I managed to get full access to the hardware, but dumping is proving slightly problematic. I can dump the first sector, but after that, there's a 165 sector block that I can't read from. It seems I can't successfully seek to those sectors and read from them. After these 165 sectors, I can read again to the very end of the track, but the digital data here is all 0's, which I would kind of expect, since Space Berserker isn't very complex, so I expect all the rest of the actual data for the game is in those 165 sectors I can't get access to.

Here's what I believe the problem is: Right now, when trying to read from any sectors on the LD, the actual video/audio data is being decoded in step with my attempts to read the digital data from the disk. If I seek to a given sector and try and initiate a read, the video seeks to that sector and starts playing there too. Well, I can tell there's something that's been done at the very start of the first track on the disk which is specifically designed to prevent an LD player from advancing, sort of like a bad sector if you will. The idea behind that is that what is essentially the first frame on the disk shows a "This disk can only be played on the Pioneer LaserActive" kind of message, and this malformed sector or whatever is supposed to stop any LaserDisk player from moving past that point into other areas of the disk. I think, since the hardware is in a mode where it's actively playing the video data at the same time I'm trying to dump the digitial data from the disk, these bad sectors which affect the video track are also preventing me from getting at the digitial data. I suspect if I can somehow turn off video playback, I can read from those sectors without obstruction. At least, that's the theory, but the data in the first sector does seem to indicate that valid data is supposed to exist in at least the first 5 sectors, so I believe it is possible to read from them, and my analysis of the bios seems to confirm this, since it appears it would have to read from those sectors before any of the game code is run.

The game works perfectly when I boot it, so I know there's nothing wrong with the disk, it's just a matter of figuring out how to get the hardware in the correct state so I can read all the data. Unfortunately, I haven't been able to find the hardware command for that yet. There are dozens of bios commands which are unique to the LaserActive which I have no idea what they do, so I'm poking around testing things out and trying to get something working. I've been disassembling the bios code and working my way through it, trying to find calls or initialization steps which can get my code working. This will probably be one of those things where I just have to keep trying dozens of different things one after the other, until finally something just works. I'm taking a short break from this over the next few days, but I'm close now, very close.
I'm not familiar with how the filesystems are stored - I wonder if dumping over MegaLD is feasible for LD-ROM2 games, or if that'll require a separate dumping technique.
I suspect this dumping method should work for LD-ROM2 games as well, since they almost certainly use the same method to store the data, which, for the record, is using the digital audio channel of the LaserDisc video itself to store digital data. With this dumping system, it doesn't matter if the game itself is compatible with the hardware, it just has to use the same method of data storage.

Misty
Interested
Posts: 15
Joined: Mon Nov 14, 2011 4:08 am

Post by Misty » Fri Jan 13, 2012 4:57 am

Yeah, I noticed the pausing when I was trying to record video from it on another player. I did need to step-frame in order to access the rest of the data.

Incidentally, regarding the data - from the ugly static I get when I accidentally set the player to "play" the data track, I can tell that most games stripe their data across their disc rather than leave it all in one chunk at the beginning. Presumably it makes access easier by keeping data closer to the analogue video and audio it'll be used with. If I remember right, for example, Hyperion has a set of data right before the video stream for every level, with 0s padding it out the rest of the time. I also noticed that Blue Chicago Blues uses a mixture of data and standard LD PCM audio in the same track, so it can interleave two stereo audio tracks (along with its "two" video tracks).

Sounds like it's pretty tedious work. Glad you're close though!!

So, out of curiosity - when you crack this, what hardware would I need to dump my games?

tommyptr
Newbie
Posts: 3
Joined: Fri Jan 13, 2012 8:03 pm

LaserActive games

Post by tommyptr » Fri Jan 13, 2012 8:10 pm

I am looking to buy Blue Chiacgo blues, any region for any module. I will pay top dollar if you are looking to sell... please get back to me at treehouse2000us@yahoo.com Thanks a lot- Tom

I also have some games I am willing to have dumped if you can figure out a way.. I have US versions of Ghost Rush and Don Quixote, along with 10 more games. -Tom

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

Post by TascoDLX » Fri Jan 13, 2012 10:39 pm

Misty wrote:Yeah, I noticed the pausing when I was trying to record video from it on another player. I did need to step-frame in order to access the rest of the data.
Sounds like the video was mastered w/ picture stop codes. Some Pioneer players (and maybe others) have a setting to ignore them. Pioneer calls it picture stop cancel (PSC).

That's what I've observed in the bios: In order to read beyond the first sector, PSC must be turned on (at least). PSC can be set using function 0161.
Nemesis wrote:The game works perfectly when I boot it, so I know there's nothing wrong with the disk, it's just a matter of figuring out how to get the hardware in the correct state so I can read all the data.
When all else fails, do what the bios do: ldboot.c :wink:

The code basically does what the bios does verbatim (v1.04, for the record). I'm sure much of it is necessary and some is not. I would expect things to work without messing with the overlay and faders. But on the whole, it should get the job done.

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

Post by Nemesis » Wed Jan 18, 2012 4:06 am

Where do you get all this information? lol

You're figuring this out a lot faster than I am, I was looking for the overlay control, since right now, as soon as I boot the MegaLD sub-cpu bios I effectively lose picture, since the LaserDisk video layer goes to the top. I look forward to trying that out and see if I finally have control over the picture. You seem to have a number of calls figured out that I wasn't aware of their use. I tried enabling PSC by calling function 0161, but that hasn't done what I want it to so far. It seems like I stop being able to read at all once I've enabled PSC, the drive doesn't even seek when I issue the ROMREADN command.

Your boot example code is very useful though, I'll give that a try and see if I get different results. Out of curiosity, how did you work out that boot sequence? I was trying to do a similar thing and work out the full sequence of LD bios calls made prior to booting a disk, but I haven't found even half of what you have listed there. That call to 012F for example, where does that happen in code? I couldn't find any references to that function in the sub-cpu bios code. Is it somehow forwarded on from the main cpu bios? I think this function could be critical. 012F modifies what appears to be the main control register for the LD hardware at 0xFDFE59, and I haven't tried calling it before. I'll have to give it a go, it just might be what I need.

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

Post by TascoDLX » Wed Jan 18, 2012 10:22 am

Nemesis wrote:Where do you get all this information? lol
It's all there in the bios. Just takes a little bit of time and a little bit of practice :wink:
Nemesis wrote:I was looking for the overlay control, since right now, as soon as I boot the MegaLD sub-cpu bios I effectively lose picture, since the LaserDisk video layer goes to the top.
Good observation. The subcpu bios definitely resets the vid faders. To get the vdp graphics to show, these calls should do it:

Code: Select all

$0134 (D1=$3F) ; vdp gfx up
$0135 (D1=$3F) ; LD vid down
$012E (D1=1)   ; overlay on
If you want LD video along with the vdp gfx, it should be $0135 (D1=0), I think. I'm just going off what the bios does.
Nemesis wrote:Out of curiosity, how did you work out that boot sequence? I was trying to do a similar thing and work out the full sequence of LD bios calls made prior to booting a disk, but I haven't found even half of what you have listed there.
All of that stuff happens in the MAINBOOT sp. That sequence is exactly what the bios does right before it reads out the boot sectors. It's all done in the same subroutine; I just converted it to C to make it easier to digest.

There's also some stuff that is done earlier, just after the subcpu is loaded, but much of it has been covered. There are some calls to $0130, $0131, and $0132 that don't exactly look important, but at this point who knows. FWIW, they don't appear to be called by the v1.02 bios.

BTW, if you want to really figure out when everything gets called (without resorting to elaborate hacks), you need to trace it all out from the maincpu. It gets a little tricky, but it helps if you know how the regular SegaCD bios works.
Nemesis wrote:I tried enabling PSC by calling function 0161, but that hasn't done what I want it to so far. It seems like I stop being able to read at all once I've enabled PSC, the drive doesn't even seek when I issue the ROMREADN command.
MAINBOOT definitely calls $0161 (D1=1) right before calling ROMREADN ($0121). I get the feeling this is required. If the bios fails to detect a valid MegaLD disc, it disables PSC. Otherwise, it leaves it enabled.
Nemesis wrote:012F modifies what appears to be the main control register for the LD hardware at 0xFDFE59, and I haven't tried calling it before. I'll have to give it a go, it just might be what I need.
I hadn't considered 0xFDFE59 to be the main control register, but there is quite a bit going on in there.

Just to clarify the usage of $012F: The MAINBOOT SP calls $012F (D1=4) after DRVINIT but before CBTCHKDISC. If it fails to detect a valid MegaLD disc, it will call $012F (D1=0). Otherwise, it keeps it set to 4 up until the boot sequence.

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

Post by Nemesis » Fri Jan 20, 2012 9:18 am

Ok, I'm missing something here. I started looking at the sub-cpu bios app that gets loaded, and I'm trying to do the exact same things as it does, and it's not working. When I literally do all the exact same instructions as the sub-cpu bios app in both the _usercall0 and _usercall1 entry points, when I hit the very first bios call that gets made, which is $11F, it fails, and I'm starting to see a pattern here. Almost all the bios functions that deal with the MegaLD hardware itself fail to work, and more than that, they seem to cause a critical error when I try and call them, and then pretty much everything stops working. If I don't call any other bios functions, I can use the ROMREAD and CDC functions without worry, since they're just talking to the Sanyo LC8951, but almost all the other bios functions I'm trying to call fail, and leave the system in some kind of error state.

There must be something else that needs to be called or cleared or initialized, before I can even call these bios functions. Maybe it's in the main bios code, or maybe it's buried in the sub-cpu bios somewhere, and it only gets called when it performs its normal bootstrapping when booting straight from the system bios. I'm going to keep looking, but there's definitely something else I need to do before all of this it seems. I can't even call those overlay and video fader functions you gave me TascoDLX, they error out too. In fact, the only thing that's not errored out and actually had a noticeable result so far are $118 and $119, where $118 freezes the video output and displays the video data from the digital memory, and $119 unfreezes the video.

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

Post by TascoDLX » Fri Jan 20, 2012 11:46 am

Nemesis wrote:When I literally do all the exact same instructions as the sub-cpu bios app in both the _usercall0 and _usercall1 entry points, when I hit the very first bios call that gets made, which is $11F, it fails, and I'm starting to see a pattern here.
If you email me your binary, I'll take a look at it. Otherwise, I have no idea. $011F should succeed without question.
Nemesis wrote:If I don't call any other bios functions, I can use the ROMREAD and CDC functions without worry, since they're just talking to the Sanyo LC8951
That's not true for ROMREAD. The read is initiated through the LD hardware. If it succeeds, there is no reason everything else would fail.

THE_MOOGLEKING
Newbie
Posts: 5
Joined: Wed Dec 14, 2011 7:13 pm

Post by THE_MOOGLEKING » Thu Feb 02, 2012 6:49 am

How goes it? May be getting a copy of 3D Museum soon, so there's that on the table as well.

Post Reply