ds-pokemon-hacking / CTRMap-CE

CTRMap Community Edition, an extensible level editor for Pokémon Black/White/Black 2/White 2.
GNU General Public License v3.0
17 stars 3 forks source link

Can you add IRED (Gen V Germany) Support ? #2

Closed TomKannenberg closed 1 year ago

TomKannenberg commented 1 year ago

hi, i tried to do it myself but i can't even get the program to build :/ i have dumped my Pokemon Black 2 but it's a German Cartridge (cuz i'm from germany) and it's ID is IRED and it says "The ROM is not recognizable Gen 5 game (IRED)" if it's more than just an ID that needs to be changed in the GameDetector i'd be happy to look more into it although i'm a more of a cpp programmer

HelloOO7 commented 1 year ago

It is unfortunately more than just the title code, as the localized games have a different binary layout and as such the data offsets that CTRMap uses would have to be adjusted for them. Automatic code injection would also most likely have to be disabled as it's written for W2-U.

The game detection backend was originally written for Gen VI which are Multi8 games (as far as I know), and since I never bothered with adding support for versions above 1.0, there isn't any substantial base that would enable the same game to have multiple versions whose only differences lie in the binary structure (and I guess language). Adding support for localized games can be done easily and dirtily (and anyone can do it for their own purposes with the source code), but if it was to be part of the official branch, a more robust solution designed from the ground up (and not the other way around as I sometimes tend to do) would be warranted.

TomKannenberg commented 1 year ago

Okay, then i'd be better of by using a W2-U version, i got a clean dump with dsi support now but i ran into another problem, whenever i'm exporting the rom (unchanged or changed doesn't matter) i get a rom that won't load into Desmume and is only 274mb big in comparison to the original Rom that is 512mb big (Edit: also tried it on DS Lite and o3DS XL it doesn't go past a white screen)

HelloOO7 commented 1 year ago

The file size change is intentional. The original ROM images are exact replicas of the 512MB cartridges, however, the game doesn't actually use all of that space, so it can be trimmed when rebuilt. Most NDS ROM utilities can do this optionally, CTRMap just does it automatically since you can pad it yourself anyway.

Since this is no longer a localization-related topic, you might wanna open a new issue and either close this one or leave it open for (unlikely) PRs.