ROM Hack GBA Palette Editor/Patcher?

Immortallix

Well-Known Member
OP
Member
Joined
Mar 15, 2009
Messages
174
Trophies
1
XP
1,088
Country
United States
Was curious if there any any apps that can allow me to edit the color palettes or do simple color correction to a GBA rom and then patch it? Sort of like the dark filters in the GBA injectors for 3DS but with some more customization options. I know there are a few color restoration rom hacks for the most popular games, but even stuff like the Fire Emblem games don't seem to have any of those, and the bright colors are a bit of an eye sore to me.
 

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,724
Trophies
2
XP
8,500
Country
Tuvalu
i recommend getting no$gba, and checking the graphics and palette information for the colors in the game you want to edit.
hopefully it's easy! let us know how you get on.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
Various tile editors will have the option to pull the palette from various parts of the ROM, import and export various palettes and inject it back in when the time is right. I usually use crystaltile2 (it sticks it in its hex editor https://filetrip.net/nds-downloads/utilities/download-crystaltile2-2010-09-06-f23649.html ) and tiled2002 ( https://www.romhacking.net/utilities/112/ ).

Most of the restorations are from SNES games as the SNES uses the same palette format so it is easy enough to transfer across, though I suppose no different than most games.

Finding a palette in a game varies somewhat
https://www.romhacking.net/documents/361/
https://web.archive.org/web/20080408022631/http://etk.scener.org/?op=showtutorial&st=3
You can also try simply dumping the palette from RAM (tiled2002 might even be able to pull them automatically from savestates, various emulators also have the option) and searching the ROM for that or a fragment thereof.
I cover a few things in https://gbatemp.net/threads/gbatemp-rom-hacking-documentation-project-new-2016-edition-out.73394/

Main problems will be compression (nobody really compresses palettes as they are so small but it is a possibility), palette animations (I usually suggest Mr Driller 2 or Summon Night 2 as examples) or selectable palettes (I believe Final Fantasy Tactics has something here, but normally summon night 2 is where I would look). Though most such things should not change it in the long run (still should be colours to edit or base colours for it to later do maths on).
 
  • Like
Reactions: swosho

Immortallix

Well-Known Member
OP
Member
Joined
Mar 15, 2009
Messages
174
Trophies
1
XP
1,088
Country
United States
i recommend getting no$gba, and checking the graphics and palette information for the colors in the game you want to edit.
hopefully it's easy! let us know how you get on.

Will it allow me to apply those changes as a patch to the ROM? So I could play them on a DS/3DS or other systems' emulators? Thanks

Various tile editors will have the option to pull the palette from various parts of the ROM, import and export various palettes and inject it back in when the time is right. I usually use crystaltile2 (it sticks it in its hex editor https://filetrip.net/nds-downloads/utilities/download-crystaltile2-2010-09-06-f23649.html ) and tiled2002 ( https://www.romhacking.net/utilities/112/ ).

I've never messed around with ROM hacking myself, which is why I'm wondering if there's an application for simple color correction or filters, but I will give these a try, thanks.
 

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,724
Trophies
2
XP
8,500
Country
Tuvalu
Will it allow me to apply those changes as a patch to the ROM? So I could play them on a DS/3DS or other systems' emulators? Thanks
no it won't allow you to make any changes (maybe temporary ones) - but you will use it to find where you need to make changes, then you will change the data yourself with a hex editor, you can even make a custom tool in something like python that changes it for you once you know what has to be done :)
i want to do something similar myself for a game. (mr driller games for gba)
what game are you working with?
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
Will it allow me to apply those changes as a patch to the ROM? So I could play them on a DS/3DS or other systems' emulators? Thanks



I've never messed around with ROM hacking myself, which is why I'm wondering if there's an application for simple color correction or filters, but I will give these a try, thanks.
GBA palettes are software defined (no more prebaked list of colours you can feed an emulator* or something) and frequently altered at runtime for purposes of colour correction, certain types of shading effect, simple animation, more complex animations and other such purposes. Not to mention there are multiple graphics modes with slightly different takes on palettes if you want to view it that way ( http://www.coranac.com/tonc/text/video.htm http://problemkaputt.de/gbatek.htm#lcdcolorpalettes https://www.cs.rit.edu/~tjh8300/CowBite/CowBiteSpec.htm#Graphics Hardware Overview ).

*said emulator might have the option for filters of certain types. This will be for PC though as most ones for embedded devices have limited options here, and terribly unlikely to do anything on hardware.

To that end the only point and click palette editors you will find will be for individual games that people have gone in and fished out the location of. Not everything uses animations or has correction options and you can get pretty far by searching the ROM for the palette as you snatch it from RAM/savestates, often even with ones that see simple animations you can still use snippets of it (if like Mr Driller 2 it is just the one colour that gets cycled for rainbow blocks then the static aspects of the palette will likely be there somewhere).

If the simple methods already covered are not doing it for you and if you absolutely must find it for a given game, and it is one of the more complex types (be it from animation, generation or compression), then be prepared to have to go full bore ROM hacker, or consult one. It is not usually a massively complicated affair; it is not like you are spotting subtle bugs, optimising code to fit something else in, expanding the scope of a game in some weird way, or watching an algorithm play out to create something like https://www.dragonflycave.com/mechanics/gen-i-capturing the likes of which tend to need some measure of familiarity with assembly coding. It is then usually just a matter of getting to a point just before the data you care about is loaded into the palette section**, making a savestate, telling the emulator to break on write (by the way the guide is for vba-sdl-h but these days most would suggest the graphical no$gba debugger https://problemkaputt.de/gba.htm , the logic behind the actions it takes though are the same between emulators here, and for that matter most other debuggers you will likely ever see), then either looking back up to see a nice read (might be the CPU read, might be BIOS related, might be DMA) that fetched it from the ROM or repeating for that until you get back to a read of that data from the ROM.

**many emulators will have a palette viewer and you can select "update in real time". Usually though if you can get into another room or just before you start a new level/minigame/battle and maybe step out of a menu then you will be at a point where it swaps a palette in or out.
 

Immortallix

Well-Known Member
OP
Member
Joined
Mar 15, 2009
Messages
174
Trophies
1
XP
1,088
Country
United States
what game are you working with?

I was going to start with Fire Emblem & Sacred Stones. Injecting GBA Roms on 3DS has become my preferred way to play, and while the dark filter in the injector is acceptable, it still doesn't really fix the colors/overall look of the game. So if I don't find it too daunting I'll probably get to work on those.

If the simple methods already covered are not doing it for you and if you absolutely must find it for a given game, and it is one of the more complex types (be it from animation, generation or compression), then be prepared to have to go full bore ROM hacker, or consult one.

I'll start with the simpler looking editors you posted above, and thanks for all the resources/documentation! Not sure if I'm willing to go all in on ROM hacking, but if anyone does requests/commissions I would be interested in that for some more ambitious ideas.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
Commissions are rare -- ROM hacking itself already walks a fairly fine line and adding money to the mix just makes lawyers perk up, not to mention for the time taken then the costs can be rather high (market rates for someone able to debug closed source code for an obscure machine... not typically a cheap affair).
Requests might happen for this -- nobody likes making someone's personal slash fiction hack for them but fixing a game, much less one that does not mess with game mechanics, is a different matter.

Careful with the "simpler looking" thing -- Crystaltile2 might look scary compared to tiled2002 but most of the stuff you want is just the same (the hex to palette and palette to hex commands being nice and easy, or indeed not buried down under loads of menus like they are in tiled 2002) and you can ignore much of it for your purposes in this.

That said if you don't want to go have fun with a debugger do try the easier stuff -- open up the palette viewer in the game and tick the live update box, any animations usually become apparent very quickly. If you are not faced with animation* dump the palette from the emulator or a savestate and search the ROM for it. If you find it in the ROM from that then you can load it, tweak it (even if it involves double clicking on every colour and fiddling with a slider) and then overwrite the one in the ROM. Might have to repeat a bunch of times if there are different palettes for different things you want to sort as part of this but said tedium was not a possibility in all this, and even if you could do all the hard stuff mentioned earlier with a debugger you are likely to still have to go through and figure out what is what.

*and again you can still search for fragments and leave the animation parts alone or hope they work on maths rather than the game sending a new pattern every few frames. This is less reliable though than the no animations stuff.


Also I thought of a way you could theoretically do a straight (or patterned) darker filter within a game. It would not be elegant but as the palette is in memory you could probably do cheat that looks for a cue and then writes a darker palette into it. It is horribly clunky but it should be noted as part of this. Anybody that can reasonably do that (I don't know if the average flash cart or emulator cheat engine, or the likes of GABsharky is up for the task) could easily do the find the palette and alter it themselves dance though.
 

Immortallix

Well-Known Member
OP
Member
Joined
Mar 15, 2009
Messages
174
Trophies
1
XP
1,088
Country
United States
Gotcha, I hadn't thought of the legal aspect with that. When you said consult a rom hacker I assumed you meant requests/commissions, my bad. Guess I'll see what works best. Any thoughts on NLZ-GBA Advance compared to crystile2 or Tiled2002? Came across that on romhacking.net & looks like it may also serve my purposes.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
It is one of the compression searching tools, probably one of the better ones. Like most of them it is tied to a graphics viewer as well. As far as palettes are concerned though then it will be of limited use really outside of confirming you got the right palette/edited it properly if the palette is used by a compressed image.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Psionic Roshambo @ Psionic Roshambo: @SylverReZ, Indeed lol