I've recently started dipping my toe into ROM hacking - recently I've gotten really into the Taito arcade puzzler Puchi Carat, especially its characters and setting - though all the English releases of the game have notoriously poor translations, so I decided to see how feasible it would be to edit a new script into the GBC version of the game. It seemed like a pretty good starter project - the game's already in English, and it's not particularly complex or text-heavy.
My first attempts involved poking around the memory. I found out that the text is just printed as tiles on a map and is really easy to change on the fly. Perfect!
I immediately started going mad with power.
Of course, changing a tilemap and changing text are two different things, but from what I found out about how text is displayed, I figured that nothing particularly complicated was going on here. I downloaded Transhextion, and its "relative search" feature quickly turned up results for familiar dialogue. From there, it was easy to make a table (link!)
and start decoding the text in the ROM.
It turns out the text box system for Puchi Carat is super flexible! When I made changes, I found that not only could text be any length (even proceeding to print off the box and off the screen if you let it) but scenes could consist of any arbitrary number of text boxes - good news for me, since I planned on adding in more detailed dialogue for my new script. There's tons of extra empty space available in the ROM too.
After determining which values corresponded to text, I deciphered all the control codes (link!)
and found out how to build essentially any scene possible in the game - including moving the speech bubble arrow or changing the left or right side portraits. There seem to be no obvious limits to when they can be used - portraits can even be changed mid-dialogue on the same text box if you want, something the game never does.
I also made another wonderful discovery - though the game only ever prints 2 or 3 lines of dialogue at a time, all the line spacing in the dialogue is totally manual, so you can use all five lines if you want! Good news for me and my dream of a more fleshed out script.
Unfortunately, this is where I'm hitting my biggest roadblock. The way dialogue is presented in the ROM, it's just one scene after another, scattered in a few different locations. There's a control code to end a scene, but no code for the start of a scene, so the dialogue system must be pointing to specific locations in the ROM for the text. This code must also be initializing the portraits at the start, as the control codes for portrait swapping only show up when there's a need for the portrait to change mid-scene, which doesn't happen too often.
The big problem is... I can't find it! I tried taking the locations of the start of some scenes and converting them to pointers, but that didn't turn up any results - I also am not experienced enough to look at any of the disassembly code that the emulator spits out and be able to tell what's going on. I imagine there must be a table or something somewhere that assigns each scene in the game a location in the ROM to load the scene data from, but unfortunately I can't even begin to find out where to find it.
In the meantime, what I can do is bookmark and label the location of every scene in the game for future reference - while I'm getting that done, any help on how to move forward would be much appreciated! Thanks for reading - I hope I have more to show before too long!