farmerbb / RED-Project

ROM Extraction Documentation Project
197 stars 10 forks source link

Extracting Master System and Arcade Game ROMs from Lost Judgment (PC Steam) #60

Open PW5190 opened 1 year ago

PW5190 commented 1 year ago

I've been wanting to ask, since Lost Judgment is out on PC via Steam. I wonder if ROMs from the Master System and Arcade games can be extracted out of the game's data... Is it actually possible? I know the Master System emulation side was coded by M2, and might use the same alldata.bin and alldata.psb.m files as many of their compilation titles and re-releases, such as SEGA AGES on Nintendo Switch, SEGA 3D Classics on 3DS, Namco Museum Archives, Konami's Anniversary Collection series, the SEGA Genesis and Mega Drive Minis 1 and 2, Game Gear Micro, and the GBA games on the Wii U Virtual Console.

Anyways, back on track. Is there a possible method of extracting the Master System and Arcade ROMs out of Lost Judgment's game data? If not, let me know, and keep me posted, OK?

PW5190 commented 1 year ago

Master System Games: Alex Kidd in Miracle World Alien Syndrome Enduro Racer Fantasy Zone Fantasy Zone II: The Tears of Opa-Opa Global Defense Maze Hunter 3-D Penguin Land Quartet Sagaia Secret Command Woody Pop

Arcade Games: Fantasy Zone Fighting Vipers HAMA of the DEAD Motor Raid Sonic the Fighters Space Harrier Super Hang-On Virtua Fighter 5 Final Showdown

kjetil-f commented 1 year ago

Wait, can you extract the SEGA 3D Classics? Does this work for the arcade games as well?

PW5190 commented 1 year ago

Wait, can you extract the SEGA 3D Classics? Does this work for the arcade games as well?

Actually, that's for another issue. I'm talking about the Master System and arcade games in Lost Judgment. I want to know if they can be extracted.

StefiStarlite commented 1 year ago

Lost Judgment does not use the "alldata.psb" and "alldata.psb.m" file formats like past M2 packages for the emulated titles. Instead, you'll find ".par" files under the Mini-Game folder. I don't have access to the exact path, but you can use something like ParTool to extract the Master System games rather easily (all of which match their known dump checksums - just rename the file extensions).

As for the arcade titles, I don't have enough of an understanding in how the titles available within the game function to be of any assistance.

Update The two files you'll want to run ParTool on for the SMS ROMs are "m3e_00.par" and "m3e_01.par". The arcade titles are contained in .acf, .acb, .awb, and .par file formats (fv, mr, and stf accordingly).

einstein95 commented 1 year ago

The two files you'll want to run ParTool on for the SMS ROMs are "m3e_00.par" and "m3e_01.par". The arcade titles are contained in .acf, .acb, .awb, and .par file formats (fv, mr, and stf accordingly).

The full paths for these files are:

runtime/media/data/minigame/m3e_00.par
runtime/media/data/minigame/m3e_01.par
runtime/media/m2ftg/rom/

Additionally the arcade machine bezels are in runtime/media/data/minigame/segaages_w64/ in dds format

DrAzathoth commented 1 year ago

The Master System 1.3 BIOS is in the "s8xle_w64.dll" file. This is especially important because Snail Maze is a game that is baked into it. It starts at 0x1A6D0.

espiox commented 1 year ago

Sagaia (which was only released in US/EU) shows up as Darius II when played in Japanese in Lost Judgment, which is new for this collection. Is there a separate ROM for that version, or is it patched on-the-fly by the emulator? (and if so, is there a way to extract the patch info?)

DrAzathoth commented 1 year ago

Sagaia (which was only released in US/EU) shows up as Darius II when played in Japanese in Lost Judgment, which is new for this collection. Is there a separate ROM for that version, or is it patched on-the-fly by the emulator? (and if so, is there a way to extract the patch info?)

It is a single ROM. The title screen changes depending on what region you play it on, as is the case with some other SMS games (Wonder Boy III/Monster World II as an example).

DrAzathoth commented 1 year ago

I stand corrected. Just tested swapping the region for Sagaia and the title screen remained the same. Could someone dump the patched ROM from RAM, perhaps?

espiox commented 1 year ago

Yeah, the Darius 2 localisation is new for Lost Judgment, the existing ROMs don’t have different regions. What would be involved in dumping from RAM?

DrAzathoth commented 1 year ago

Yeah, the Darius 2 localisation is new for Lost Judgment, the existing ROMs don’t have different regions. What would be involved in dumping from RAM?

This is completely hypothetical, but because almost all emulated rereleases store the ROM in RAM, one could assume that would be the same here. Unless, of course, the ROM doesn't get patched at all and it just overwrites the graphics with the emulator.

As for actually creating a memory dump on Windows, open Task Manager and right-click your process of choice. Just be sure to expect a fairly large dump to sift through.

farmerbb commented 9 months ago

Like A Dragon Gaiden also contains Master System ROMs as well as arcade games.

For the Master System ROMs, they are found uncompressed in the folders runtime/media/data/minigame/m3e/00 and runtime/media/data/minigame/m3e/00. The m3e_00.par and m3e_01.par files are also present, but they contain the same ROM files as the uncompressed versions found in the above folders.

The US Master System BIOS (v1.3) is found inside runtime/media/emu/sms/smsce_w64.dll at offset 0x2B320. The Japanese BIOS (v2.1) is in the same file at 0x2D320. Both BIOSes are 8 kilobytes in size.

The data for the arcade games are found at runtime/media/m2ftg/rom/ and runtime/media/pre3/image/.

RealRelativeEase commented 9 months ago

Like A Dragon Gaiden also contains Master System ROMs as well as arcade games.

Thanks for the heads-up about the ROMs and the BIOS! This also works with the Game Pass version of Like a Dragon Gaiden, you don't even have to wait for the installation to finish.

Has anyone been able to build ROMs out of the arcade game files?

SamuraiOndo commented 4 months ago

Hi, hello. I've reversed the encryption of the sega ages arcade games used in games such as yakuza 7 (located in data/minigames/segaages_w64/), and have written a tool to decrypt the assets. it is available at https://github.com/SamuraiOndo/yakuzaArcadeDecryptor/blob/main/decrypt.py. It also seems to work for yakuza 6. These files seem to have all the rom files packed into a custom file format. I know nothing of said format as of now. I am also free to answer any questions if need be.

DrAzathoth commented 4 months ago

@SamuraiOndo, thank you for your contribution! FYI, I can also confirm it works with Lost Judgment. I am currently working out what to do with the decrypted data, but this is certainly a great start!

Edit: I have results! Some of the data appears to be in big-endian format (similar to my research for Chronicles of Mystara), which is not usable by any emulator. We will need a program to convert the endianness of the file in order to fully extract all of the ROM data.

kjetil-f commented 4 months ago

This is all very confusing for someone not too familiar with the franchise. But is it correct that at least these ones contains extrudable Sega Master System and arcade ROMs?

DrAzathoth commented 4 months ago

@kjetil-f, SMS games and the SMS bootrom (Snail Maze) are only in Lost Judgment and Gaiden. Arcade games are found in most Yakuza titles, but not all. In Gaiden, there is also an SG-1000 game included with the SMS games, Flicky.

As for SamuraiOndo's tool, I can only confirm it works with Yakuza 6, Like A Dragon, and Lost Judgment; however, it is unable to convert the decrypted data into a usable romset at this time.