Changing the Save Name | mariteaux |
|
Here at homeOther projectsOther SomnoliansLast modified: 12/27/2021 |
While changing the disc ID of your custom disc is easy, there's a problem. If you haven't come up with a custom save icon, your new save will appear as a perfect duplicate of the vanilla GH2/GH2DX save, and people won't know which is which when they go to manage their save games. Unlike changing the disc ID, which can be done in DTA, you'll need to edit the string inside the game executable itself. This is the file located in the root of the disc that isn't A word of caution about hex editorsWhen using a hex editor, you need to be extremely careful not to change the length of the save name (or whatever else you're editing), or else the executable will no longer work. This is because the executable looks for things (strings, game code, paths, etc.) in offsets from the first byte of the file. If you change the number of bytes, you change everything's offset, or their locations in the file, and the game can no longer find what it needs. Always remember to overwrite, and not insert, characters when using a hex editor. Editing the save nameYou can use any hex editor you want to edit the executable, but the one I use is called HxD. It's easy and it's free. Drag your executable into the HxD window. Pull down Search and select "Go to...", or press Ctrl+G. Either one will bring up the Go to dialog. In the list below, find your executable's save name offset and put it into the Offset: box.
You'll be parked right at the start of the save name if you did it right. For GH2DX's main game, we just called the save name "GH2 Deluxe". Your mileage may vary depending on which executable you're editing. In any case, your cursor will start right at the first character of the game name. This is the save name. Punch in a new one, being mindful of your limited amount of characters (14 for GH2-based discs and 27 for 80's-based discs). If your name is shorter, you can fill the rest of the characters in the save name with Delete your existing save from your memory card and make a new one. If you did it right, you'll be using a custom save name. NewlinesThere is one more thing you should be aware of, and that's the newline. The PS2 memory card browser allows for two lines of save name, and GH2 is hardcoded to insert a newline at a specific spot in the name, breaking the name onto that second line. Unfortunately, I don't know the newline offset for 80's. Our resident Ghidra person, GenericMadScientist, never looked for it, and he's not in MiloHax as of writing. I do know the offsets for GH2 and the debug GH2 executable though. Repeat the above process, going to the offset 4C140 for the retail GH2 executable or 54710 in the debug GH2 executable. For GH2DX, we set the value of that byte to 10 ("GH2 Deluxe" is ten characters, so the newline comes after the save name is done and the second line appears blank). If you have the newest versions of HxD, the data inspector on the right will show you what the byte means in decimal, as opposed to hexadecimal, in the Int8, UInt8, Int16, and UInt16 fields. Punch in the number of characters you want the newline to appear after, either in hex if you're editing the raw data or the decimal if you're editing in the data inspector. Save the executable. Delete your save again and remake it. Now, your custom name won't break in the middle of a word. |