Dimedime-d / kptranslation

English translation of the GBA game Kururin Paradise
Other
27 stars 0 forks source link

Dialogue text interpreter re-write using global IDs #10

Closed Dimedime-d closed 8 months ago

Dimedime-d commented 8 months ago

small optimization for the bytecode interpreter to parse Shift-JIS strings from a dialogue table using IDs, instead of embedding the strings directly in the bytecode location.

The storage of Shift-JIS strings in the original ROM is inefficient, as each dialogue string is actually duplicated in the ROM: The bytecode interpreter parses it once to know which objects to display in VRAM, and one more time to know which sound effects to play.

The global dialogue table resides in text/dialogue.asm while the bytecode commands to load characters are now fixed in length (12 bytes to parse as objects, another 12 bytes to parse as sound effects)

Should have no changes in gameplay, but under the hood, it makes managing free space a bit easier. The cutscenes now have predictable sizes (instead of varying with the length of strings), and just the dialogue table/entries vary in length.

I've also overwritten the space taken by original cutscenes, and fixed some coupling there. Still a far way off from figuring out what all the bytecode commands, but if/when I do, I probably could overwrite some more space.

Dimedime-d commented 8 months ago

just tested every cutscene and did some more menuing. Seems stable now. For future me: If something unrelated gets messed up, you probably forgot an .align directive somewhere.

Merged.