Romhacking => ROM Hacking Discussion => Topic started by: Alex O. on July 28, 2021, 11:48:05 pm

Title: Help with compressed GFX?
Post by: Alex O. on July 28, 2021, 11:48:05 pm
I'm trying to modify compressed graphics in Super Mario Advance 4.

Even though most of my edits insert with no issues, my versions of the graphics at offsets 0x23F48C and 0x235C08 won't go through; Nintenlord's GBA Graphics Editor says they're too big, even though they're the same size (I checked both through HxD and the files' properties.).
Title: Re: Help with compressed GFX?
Post by: FAST6191 on July 29, 2021, 09:18:57 am
Nintenlord's stuff and my chosen workflows don't get along that well so I have not properly put it through its paces.

If it says it is too big though then I would generally assume it is not an error in the program (at least a first, have had some issues with other compression tools in the past doing RAM rather than VRAM options) but that the compressed version of your edit is larger than the original compressed data that is there (if your edit is effectively a random jumble of pixels to the original's repeated runs then yeah compressed will tend to be larger and most people don't edit less detail into things).
If you have the offsets in the ROM then might be worth manually extracting them with whatever, editing, recompressing with GBA crusher (should be on and most other ROM hacking lists of GBA tools) and manually inserting again assuming it fits before the next run of data.

If it is bigger and you still want your edit as is then you get to repoint. Chances are the game uses the GBA BIOS functions (SWI calls in some parlances) and those you can probably redirect to wherever else in the ROM (or expanded version thereof*) more easily than some pointers.

*at least for the sake of others playing along at home then GBA expansion is trivial. Outside of a handful of video carts ( ) and homebrew (see pogoshell and general NOR era GBA flash carts) there are no mappers, memory bank controllers, special chips or other bankswitching and expansion techniques to get in the way like most older consoles we see around here. This is to say you can expand any GBA game you like to 32 megabytes/256megabit just by adding blank data to the end of the ROM to get there (though most will suggest you get away with as little as you need for the sake of flash cart users, some of which have annoyances with games above 16 megabytes). Pointers are then the plain GBA pointers still, though if you go above 16 megabytes you might have to unlearn the shorthand of GBA pointers start with 08 as the real main ROM range is 08000000 through 09FFFFFF + the various mirrors).
Title: Re: Help with compressed GFX?
Post by: Alex O. on July 29, 2021, 06:50:25 pm
Thank you for your help. I was able to insert my edits at 0x23F48C (by inserting a .png copy at that offset), and my edits at 0x235C08 by repointing them to 0x3E1600.