News: 11 March 2016 - Forum Rules

Author Topic: Help editing metroid fusion's script  (Read 315 times)

anotherswitchanon

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Help editing metroid fusion's script
« on: July 09, 2021, 05:12:28 am »
I tried it the "dumb" person way by loading https://github.com/attilathedud/gba_dumper this up in linux but it gives me errors when trying to reinsert the modified script back into the script dump and reinserting it back into the game.

After some light research, I found http://www.romhacking.net/utilities/647/ and http://www.romhacking.net/utilities/224/ but I'm not well versed in using this with the gba, I know from this https://datacrystal.romhacking.net/wiki/Pointer#Game_Boy_Advance_Pointers about how gba pointers work but I'm a bit lost in how to actually find them, I did try loading the game in ghidra but I couldn't find any text strings but that's probably because I don't know what I'm doing, I don't really know how to search for things when running the debugger in mgba but I was able to make a table for the text but that wasn't very helpful in the end as I couldn't find a way to get to the script.

I was able to find the script with http://www.romhacking.net/utilities/1442/ but I don't know how close/far I am to reinserting it back into the game.

Don't need a step by step tutorial but some documentation about gba pointers or a helping hand in using cartographer and atlas would be great. Not really sure what I'm asking, I feel like I'm almost there in modifying then reinserting the script.

FAST6191

  • Hero Member
  • *****
  • Posts: 3237
    • View Profile
Re: Help editing metroid fusion's script
« Reply #1 on: July 09, 2021, 08:53:10 am »
That method is a simplistic method that often works but is not foolproof.

The idea behind it is the GBA has the whole cart for most games* visible in memory all at once. 08000000 through 09FFFFFF is the main window/highest priority under standard conditions. As most GBA games are 16 megabytes or less then that window becomes 08000000 through 08FFFFFF, though any game can happily use the 09 region without any trouble at all (give or take those flash cart and emulator users with 16 meg restrictions of various forms) -- not so much as a value in the header indicating ROM size, never mind the fun and games of mbc change, mapper swap and all the other traumas normally associated with changing the effective cart type on other systems.
Additionally you do have the 0A000000-0BFFFFFF and 0C000000-0DFFFFFF http://problemkaputt.de/gbatek.htm#gbamemorymap but I am going to be hard pressed to name examples of things actively using it off the top of my head.


*various flash carts, a handful of tourist trap ?? in 1 carts (basically flash carts), some repros (they mixed their save data in with the ROM from what I saw) and https://mgba.io/2015/10/20/dumping-the-undumped/ being the exception, the latter being all film playback efforts and most of the others being irrelevant in this (some do like to try dumping the ?? in 1 if they have some interesting cheats or hacks applied).

The troubles (other than the different waitstate things mentioned above) tend to come from compression. The GBA was powerful enough to use compression regularly (it even has decode methods in the BIOS for games to use) so if it is compressed then it will tend to be copied to the RAM and might be referenced from there.
Pointer maths is also a thing (start at location X, add the values in the following table to find the resulting location) but less common than it is on the DS, where things are also copied to RAM to run at all (cart not being in memory).

Atlas and Cartographer I have never been a great fan of for the GBA. The are very good generalist programs but they lean hard enough into the older stuff that it makes a bit harder and I don't really have a guide as a result.
The main competition comes in the form of kruptar7 ( https://www.romhacking.net/utilities/612/ , https://romhack.github.io/doc/kruptarPlugins/ is probably a nicer intro than the official readme) and sometimes that is flanked by oriton ( https://www.romhacking.net/utilities/709/ ).
Usually though most people playing on the GBA either go manual, go spreadsheet (if you have a list of locations, say from a search of the given area for all end of section markers that goes rather nicely for start of next one) or go full custom program (including relocating things as again free 16 megs to do whatever you want with in most games out there, and even those titles the 256MBit size range tend to have a bunch of free space still, Mother 3 being the main exception here).