Post subject: How to palette swap NES ROMs with BizHawk?
Sonia
She/Her
Joined: 12/6/2013
Posts: 435
Location: Brazil
I'd like to use BizHawk to do some palette swapping on NES ROMs. I'm guessing the emulator's built-in Hex Editor can do this task, but I didn't have much luck trying to get the job done. For example, let's use RockMan 2 as test: I opened the PPU Viewer with the rom, then opened the Hex Editor, then went to "Options>Memory Domains>PALRAM. Let's say I want to change Air Man's stage background from blue to red. To do that, I know I need to edit the first palette address (which is "21" on this case) to "05". Basically, address 21 is a shade of blue on the NES palette chart, and address 05 is a shade of red. This is how the screen would look like (edited through Photoshop): But how can I actually edit the 21 into 05? I tried poking the address but the emulator won't let me change it. What should I do?
adelikat
He/Him
Emulator Coder, Site Developer, Site Owner, Expert player (3573)
Joined: 11/3/2004
Posts: 4754
Location: Tennessee
To be clear, it IS letting you change it, and your new value is reflected. It just isn't having the behavior you expect. I confirmed that in quicknes, the PALRAM domain does in fact implement writing. I don't know too much about the internals to know if it is expected that writing to the domain would have immediate on screen effects.
It's hard to look this good. My TAS projects
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
You're in a level that animates its palette. The game is re-writing the palette values every frame, clobbering your changes. Freeze them if you want to fight it, but it might not work due to how freezing is implemented vs how the game works.
MarbleousDave
He/Him
Player (13)
Joined: 9/12/2009
Posts: 1559
This reminds me back when I used NESticle to mess with the color palettes and tiles, but there wasn't an ability to save palettes. We could create palettes based off of other emulators and clone systems. Also we could recreate the NEStopia Boosted Yellow palette, Also Famtasia, FCE Ultra, RockNES, GNES, JNES, and VirtuaNES palettes.
nesrocks
He/Him
Player (246)
Joined: 5/1/2004
Posts: 4096
Location: Rio, Brazil
Shouldn't you hack the rom directly instead? This is one such tool you could use instead of directly finding the address in an hex editor (great for palettes used in sprites): http://www.romhacking.net/utilities/428/ Background flat colors are difficult to find, so I used an hex editor to find it by brute force. It's 7E22. I just changed it to 05. Then it is easy to edit the rest of the palettes. Indeed it cycles through some palettes on that area. There's some fixing to do afterwards. I realize my post doesn't answer the topic's question though. heh sry edit: I tried to hex edit using bizhawk. When I change the hex editor in bizhawk to "file on disk" I can change it fine, but as soon as I click "file" it throws an unhandled exception "illegal characters in path". - Rom not zipped, named rockman2.nes - emulator placed in D:\jogos\_emuladores\nes\bizhawk\ - bizhawk ver 1.11.4
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
file on disk is a garbage concept, i doubt its been tested in years.
nesrocks
He/Him
Player (246)
Joined: 5/1/2004
Posts: 4096
Location: Rio, Brazil
Well, the thing is that any changes to ram wouldn't exactly be permanent... Right? So it would only work as a cheat code and even then it would mess up other levels. So unless I'm not getting exactly what the OP wants to do, the only option is rom editing, which can't be done on bizhawk then. edit: ok maybe it can be done through the chr or prg memory domains. gonna test that later. done. prg can't be written.