Genesis, MD, Sega CD, 32x Region Bypass/Patching Tool

Started by Tony H, May 31, 2022, 05:08:36 PM

Previous topic - Next topic

Tony H

Been working on a new tool that will convert most region locked Genesis, Mega Drive, Sega CD, and 32x ROMs so that they will work in all regions, or specific regions if you prefer.

So far, I've tested it with 5 different ROMs, and it worked with all of them.  Would like to test some more ROMs, so...

If you have a ROM that is region locked and you want it to work with any region, post the name of it here (just the name, not the actual ROM).  I will run it through the tool and see if it works, and will post the results.  If I can find some ROMs that don't work with the tool, I will try to make it more compatible.

The GUI is just for testing and notes right now...



Screenshot shows the Japanese game 'Pulseman' opened.  The game normally only works on a Japanese Mega Drive, and gives you region warnings and won't run if you try to play it on any other console besides a Japanese MD.  After patching it, it plays on any region without any region warnings.

Some ROMs can be easily fixed to run in any region you want just by changing the region letters in the ROM header, but that method doesn't work on many games.  This tool also checks to see if there are region checks in the ROM itself, and will patch those so the ROM is tricked into thinking the console is the same region as the ROM. 

When there is a region check within the ROM (not the region letters in ROM header), the ROM checks the console to see what region it is, and stores the region code of the console in a register (D0).  This tool changes it so that the programing that checks the region of the console is changed so that it stores it's own region code into that register (D0), and the ROM never actually checks the console for it's region.  If the ROM will only work if it sees the Japanese region code in register D0, forcing the Japanese region code into register D0 will make it always run, no matter what console you have.  There are other ways to do this, but this way seemed to be the easiest as far as using it with a simple program.  There also may be other ways that ROMs do region checks, but I haven't seen any so far.  If I find other methods, I may add it to the program for better compatibility.

Functional so far:

* It can open a ROM and tell what region(s) it's for.  Will work with the original style of region codes (JUE), as well as the new style (1, 4, A, F, etc).

* Will show what regions are in the ROM header, as well as ROM addresses of any region checks within the ROM.

* Can patch ROM to work with all regions, and possibly with a specific region (still need to do testing on specific region patches).

* Have the option to create a new ROM when patching (recommended).  If you do make a new ROM, it will automatically add the word "Patched" to the end of your ROM file, as well as the region that it was patched to.  Example, the Pulseman ROM in the screenshot was renamed to "Pulseman (Japan) Patched J.md"

* Tool can tell if the ROM has been patched by the tool before.  If the ROM was previously region patched by the tool, it will give you a warning message saying that you need to use a ROM that hasn't been patched by the tool, since it won't work correctly.  The message also tells you which region the ROM was patched to, in case you forgot.

* It lets you know if your ROM is using the new style of region codes. 

* If it can't figure out what region your ROM is, it may still be able to patch your ROM to work in any region.

Not working yet:

* Button to fix the checksum on Genesis, MD, and 32x ROMs.

* Get 32x and Sega CD check boxes working (since program does things differently with those two systems).  They will be checked automatically.

Still need to do a lot of testing.

All of the testing has only been done with an emulator, but I'm pretty sure it will work on real hardware as well.

Let me know if you have any ROMs you want tested.
The Code Hut: http://codehut.gshi.org/

Game Genie codes and ROM hacking guides

Tony H

Update: Pretty sure everything (besides the Help/Info buttons) is working now.  Have made these changes/additions:

* Added more types of region checks to search for, which means better compatibility.

* Finished the checksum section, so you can have the program try to fix your ROM's checksum after patching it.  Many games don't use checksum checks, so this section may not be needed with some ROMs.

* Uses an improved check for Electronic Arts checksum issues, and should work on 100% of EA ROMs that use checksum checks.

* Displays the ROM address where EA ROMs start their checksum check routine.

* The checksum section can be used by itself if you'd like, in case you just want to try to fix the checksum of a ROM that you have patched.

* If you have a ROM that uses more than 3 types of the same region check in the ROM (eg. Thunder Force IV, Lightening Force, Sonic CD, etc), the program can only display the first 3, but it writes something in an unused part of the ROM header so the program knows if you've previously patched the ROM.  It will let you open the previously patched ROM again, so you can see the rest of the region checks that it didn't patch the first time.  If there were no region checks left to patch, it won't let you re-open the ROM, since there's nothing left to patch.  In this case, you would just open a new/unpatched ROM.

* The program writes which console/region the ROM was patched to in an unused part of the ROM header, and that region will be displayed in a message box when you open a previously patched ROM, in case you forgot which region you patched.


In most cases, the program actually changes which console the ROM will see when it does a region check. Example: If the ROM is for European Mega Drive consoles and it checks to see what console it's being played on, if that check always sees that it's a European console, it will always work.  This program will make it so that the ROM will always see the console as a European Mega Drive, which means it will always run, no matter which region the console is actually for.  In other words, the program usually doesn't change the region of the ROM, it changes which console the ROM thinks it is.

If the program doesn't find any region checks in the ROM, then it only changes the region letters in the ROM header.  Just changing the region letters in the ROM header works for lots of games.

There are lots of different ways to do region checks and checksum checks, so this program will certainly not work on every game, but it seems to have pretty good compatibility so far.

Still have to do some testing with Sega CD ROMs since I'm not sure how they do region checks, but the program does find region checks in some Sega CD ROMs.

Someone had made a post here on RHDN about a Korean ROM that needed a region bypass code.  I tried that ROM with my region bypass tool, but it didn't find the region check in the ROM.  I have added that type of region check to the tool, so any game that uses a similar type of region check will now work with the program.  The very first random ROM that I tried this new type on ended up using it (Alien Storm), so it appears to be a fairly common method for checking regions.

Jorpho had posted a link to a YouTube video in that post that showed a type of region check for Mickey Mania, so I added that type of check to the program as well.

Link to that post: https://www.romhacking.net/forum/index.php?topic=35060.0

Should have this ready to submit to RHDN in a few days.

The Code Hut: http://codehut.gshi.org/

Game Genie codes and ROM hacking guides


KingMike

Quote from: Tony H on June 09, 2022, 01:11:00 PM
Jorpho had posted a link to a YouTube video in that post that showed a type of region check for Mickey Mania, so I added that type of check to the program as well.
WOW, YOUR CONSOLE HAS SOMEHOW BECOME AN NTSC MEGA DRIVE!
"My watch says 30 chickens" Google, 2018

Tony H

Quote from: KingMike on June 10, 2022, 09:59:51 AM
WOW, YOUR CONSOLE HAS SOMEHOW BECOME AN NTSC MEGA DRIVE!

I saw that in the ROM.  Someone had a good sense of humor.
The Code Hut: http://codehut.gshi.org/

Game Genie codes and ROM hacking guides

ryouga

I know SSF2 has region checks, I tried to adjust the header but that just broke my rom and I couldn't even change it back.

The Smurf games also have region checks.

I think Tintin in Tibet too.

Tony H

I tested those games with the program.  Results:

SSF2 (only tested the E version): Program was able to find and fix the region check in the ROM, however, it couldn't fix the checksum (or some other check?).  Would need to use a Game Genie master code to get it running, but should work in any region.

I've made a few Game Genie region codes, along with any master codes that are needed with them (including SSF2): https://codehut.gshi.org/RegionalBypassGG.txt

The program didn't work with the three other games (both Smurf games, and the Tintin in Tibet game).  Did some checking, and all 3 of those games were made by the same company, so there's a good chance that they all use the same type of region checking.  As you probably know, just changing the region letter codes in these ROM headers doesn't work.

I've already submitted the program to RHDN, so can't add any of this to the current version, but will see if I can get this type of region check for those 3 games figured out and possibly add it to a future update. 

As far as getting that checksum issue fixed (or whatever is causing it not to run after fixing the SSF2 region check), there are a ton of ways that Genesis games do checksum checks, and it's too big of a job getting all of them into a program.  I think I was able to get all Electronic Arts games working as far as fixing checksums (EA games use a different method), but not sure I'd be able to do the rest of them.  Lots of games use a checksum value in the ROM header (at 0x018E) to determine if the checksum is correct, and that's the main way that this program fixes checksum issues.  Once a ROM is patched, the program re-calculates the new checksum in the ROM, and patches that value to ROM address 0x018E.  Works with many games, but not all.
The Code Hut: http://codehut.gshi.org/

Game Genie codes and ROM hacking guides

Tony H

Available here: https://www.romhacking.net/utilities/1687/

May add more types of region checks in the future for better compatibility.

Early on, someone had asked to make sure that the program would work on Robocop vs Terminator (USA).  After looking, found that it used a way of checking the region that I've never seen before.  Every game I've seen so far either uses the region letters in the ROM header, or they check the Genesis/Mega Drive region code at 00A10001.  Each region has it's own code, so it's very easy for the ROM to figure out what region the console is for.

In Robocop vs Terminator, instead of 00A10001, it uses 00C00004 to determine the region (NTSC or PAL).  After some checking, I found one small mention of how it's done.  At the very bottom of this page, it shows that bit zero of 00C00004 is used to determine if it's NTSC or PAL (0 = NTSC, 1 = PAL): https://segaretro.org/Sega_Mega_Drive/VDP_registers
The Code Hut: http://codehut.gshi.org/

Game Genie codes and ROM hacking guides

Felipefpl

Thank you for making this tool for us: i posted about it on ngemu, emutalk and neofighters.  :thumbsup:
Core i7 Celeron Sandy Bridge G460 1.8 Ghz - 4 GB RAM - Win7 x64 - Intel HD Graphics 2000


T29