-
Notifications
You must be signed in to change notification settings - Fork 0
Finding text
First, I kinda banked on the fact that Kururin Paradise uses SHIFT-JIS encoding to store text, so I just searched the first couple characters in the intro "くるりんむら" whilst browsing the ROM in crystaltile2.
I noticed this text starts at $A7C08, and I kinda just saw a pattern in the bytes before this text (more documentation on these scriptcode function thingies later)
Starting at $A7BE8:
Code bytes | Function |
---|---|
06 00 00 00 12 FF FF 7F 0F 00 00 00 | Sets text x-position |
06 00 00 00 13 FF FF 7F 95 00 00 00 | Sets text y-position |
0A 00 14 00 18 FF FF 7F | Stores the actual text in a buffer somewhere |
Those last bytes were key to finding other instances of "scrolling" text. Using some rudimentary Java code to automate this searching process, I was able to find the 370-something text scripts in kp_script.txt.
So, after doing some tracing on the menu text (specifically, the 2 lines at the bottom when you hover a main menu option), I isolated a subroutine at 08023194
that handles both parsing and drawing text. Now, to find all instances where this subroutine was called, it's as easy as opening the ROM in Ghidra (using GhidraGBA to load the ROM, going to 08023194
and boom, there's a list of references to that subroutine. I gotta find a better way to doc these params, but here they are: r0 = x, r1 = y, r2 = text ptr, r3 = palette
. This accounts for the ~36 blocks at the end of kp_script.txt
.