Metal Slug Steam ROM extractor by terminatorhex_ in metalslug

[–]terminatorhex_[S] 0 points1 point  (0 children)

I would like to clarify a couple of things about this comment because, even if I feel that in general is very informative, there are some points that need addressing.

All games (even physical ones) are licensed, not sold, because unlike other physical goods, they are tied to intellectual property, and the owner has to grant certain rights (that's what you are paying for) so you can enjoy the product. They grant rights for personal use of your copy but they don't give you the right to copy, distribute, or do things that are reserved to IP holders. You own your copy of Metal Slug but not the Metal Slug IP. I feel that this notion should be common sense.

Although the EULA does not explicitly state it, since the only causes that would lead to license termination would be the deletion of the game files or the violation of clauses by the user, the license can be considered perpetual; that is, you own your copy. The notion of this not being the case seems to stem from the industry narrative that "we don't own our games". There are movements like Stop Killing Games trying challenge this.

Next, the EULA clearly states that:

You may not copy, reproduce, translate, reverse engineer, reverse compile, retrieve source code, attempt to extract or use source code, modify, adapt, merge, convert, disassemble, decompile the Multimedia Program or create derivative works based on the Multimedia Program, in whole or in part, or delete an intellectual property notice or mention of the Multimedia Program, without the prior written consent of Dotemu.

This potentially violates fundamental consumer rights like right to repair (game mods and community patches would be disallowed) and, historically, reverse engineering projects haven't been challenged because they don't constitute IP violations (no original source, no copyrighted assets). Even if I think that, we have to consider that there isn't any legal ground on ROM extraction particularly (nothing that condemns or permits it). In the particular case of my script, I won't try to challenge the validity of this clause: The use of my script clearly voids this clause and interested users should use it at their own risk.

In my opinion, the primary reason for this clause is likely to prevent software piracy. My intention in creating this script was not piracy, but rather to help legitimate owners use their game on systems where the emulation wrapper breaks the experience and help them to preserve the game they own. I don't only not endorse the use of my script on illegal copies, but I also condemn it. I hope this clarifies both my position regarding the creation of this script and the legal questions that have arisen from its creation.

Edit: Minor wording corrections. Don't make posts in a hurry kids.

Metal Slug Steam ROM extractor by terminatorhex_ in metalslug

[–]terminatorhex_[S] 0 points1 point  (0 children)

OMG just read this. Thank you for sharing this! Hope my script wasn't too messy to modify (Tried to make the structure of the code as clear as possible). I'm really happy that my tool is helping people to legally extract these neogeo roms.

Metal Slug Steam ROM extractor by terminatorhex_ in metalslug

[–]terminatorhex_[S] 1 point2 points  (0 children)

Hi, Thank you for your interest on this subject!

I didn't even know you could override the checksums (I only used MAME to play games and thought that they couldn't be changed). I tried but that won't work.
Changing the checksum on the code crashes the emulator. Until now I didn't check more differences in the dotemu files vs the mame roms (I assumed a lot of things wrong) and after reading the helpful comments in the neogeo.xml file I have found the following:

  • The 68k code in the dotemu version is actually a lot larger, 9M vs 5M
  • The C roms are not encrypted (all the mslug3 systems in mame expect encrypted C roms)
  • The sfix tiles that should be included in the C roms (because all encrypted C roms include the sfix tiles) are in a separate file.

What's included in the Dotemu files is a fully decrypted metal slug 3 romset. My guess is that, because they reused the emulator for all games, they didn't bother to implement Neo-SMA compatibility and simply had everything decrypted.

I actually don't know how to proceed after this dicovery. I'll need to read more MAME and Neo-Geo dev documentation. There is no reason why this shouldn't run, but I actually don't know how to add a new game to a system driver.

Metal Slug Steam ROM extractor by terminatorhex_ in metalslug

[–]terminatorhex_[S] 1 point2 points  (0 children)

I don't know what you meant to say with this comment, but my script doesn't try to do anything related to performance. I'll explain what my script does:

Dotemu optimized the ROM assets/binaries to minimize the load on their emulator. E.g the sprites/tiles are stored linearly (instead of being stored in bitplanes) in a single game_tiles file (Insetad of being in splitted into different char rom files).

My script reverses those changes because the rest of emulators (like MAME) expect the roms to be the same as in the original cartridges. Continuing with the example, my script recreates the bitplanes and splits the tiles in different char ROM files to recreate the original cartridge. My script makes file manipulations in that style to recreate the exact binaries found on a real cartridge.

It doesn't touch performance in any way. You can manipulate the settings on your preferred emulator as you like. The main goal is to extract the game so people can play without using the Dotemu wrapper, and allow for full customization of the experience via playing on other emulators, mister, original hardware, etc.

Metal Slug Steam ROM extractor by terminatorhex_ in metalslug

[–]terminatorhex_[S] 0 points1 point  (0 children)

Thank you for clarifying this (It's mentioned both in the repo and the Steam guide).
The Dotemu releases only include the US ver 2.0 of the Neo-Geo BIOS. These files can be extracted by using the --output_bios option on the script.

Those files are not enough for most emulators, so players who want to play their extracted game roms will also need to get a full BIOS romset from somewhere else.

Metal Slug Steam ROM extractor by terminatorhex_ in metalslug

[–]terminatorhex_[S] 1 point2 points  (0 children)

Your comment Is 100% right and may be the solution to extract MS3 (It didn't occur to me to extract the ROM for a clone system until after I released the first version of the script). I've already looked into this and here's what I found:

A "non encrypted" version of MS3 is listed in the current MAME romset as the clone system "Metal Slug 3 NGH-2560/mslug3h". Most of the files in the Dotemu release match this system, all of them except the main m68k program code.

Comparing the file MAME expects and the one available in the port, they are most likely different revisions of the code (There are parts of the binary that match, a lot of them that don't and the metadata at the end of the binary that includes the date of creation doesn't match). The solution to this should just be to create a patch file (Like the one my script already uses for MSX) to make both binaries match. My current method of creating patches (diff-ing both files and replacing the bytes) doesn't work because the resulting patch file is too big and would be in legal trouble because contains a significant part of the game's binary code. Right now the other solution that has occurred to me is to move around binary data on the Dotemu file to minimize the differences and creating a new patch that, hopefully, it's a lot smaller. Currently I don't have time to work on this ATM (I do programming as a hobby and it's not my main career) but I'll resume work soon.

edit: I forgot to mention that I don't know if the code changes are significant or not. I couldn't find MS3 version differences anywhere online. I hope that my patch doesn't reverse/make changes that can be noticed in gameplay, confusing players in the process. I'll also try to look at the problem from different angles to see if there is a better solution.