Dimedime-d / kptranslation

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

Dynamic intro cutscene script location #1

Closed Dimedime-d closed 3 years ago

Dimedime-d commented 3 years ago

The way I laid my custom code out to add variable width/auto-center text is the following:

This is done in nextscriptpointer.asm. Both of these partially overwrite Japanese text and leave some unused bytes interlaced between where the script parser reads the data. Also, as my pointer fixes in nextscriptpointer.asm affect every script in the game, this causes the game to softlock in any other cutscene that loads dialogue, as I haven't put in any English text there yet.

I would rather have the script parser read English text directly, without having to point to any text. This would improve the locality of my text relative to the cutscene data and also not have the unused bytes.

However, English text takes more bytes to represent than Japanese characters, which is why I added pointers to English text in the first place.

I would need to determine at what offsets does the intro cutscene start and end, and copy most of this script-code into some free space, where I can freely add my English text between the script-codes.

Dimedime-d commented 3 years ago

My PR not only moves the intro cutscene data elsewhere, but also frees up the space of the original intro cutscene data.

This turned out to be tricker than expected, because the script parser also reads pointers in the original cutscene data to jump around in. I have gone through the entire intro cutscene data and replaced these static pointers with dynamic armips ones. The intro cutscene should still work fine, regardless of whether I delete the original intro cutscene data or where I put my intro cutscene data.

Also, as I'm now inserting the intro text using armips + my table file, Atlas is no longer needed for inserting dialogue (though I am still using it for menu descriptions).

As this is the approach I've decided to take, this would require going through every other cutscene data, adjusting local pointers, and placing it at an arbitrary location in the ROM.