Format reference/end06

This is the ending script format for Touhou 06-09 (,, and ).

Opcodes
As this is a text-based format, all parameters are given as ASCII strings. Each parameter is terminated with a null byte, each instruction with a line break1.


 * 1 The static English patch for by NDT seems to have an extra null after most instructions. For compatibility with that patch, ignore any extra arguments.
 * 2 as used by Egor's decompiler
 * 3 in this is actually a single byte. 0x10 is ending theme, 0x11 is staff roll theme.

Limitations

 * Text lines are limited to 64 bytes.
 * : Like all longer text in this game, these are split on the 32th byte and rendered as a left and right half.
 * A maximum of 6 lines can be displayed at once. Everything after that will be invisible, and the 10th line crashes the game.

Patching approach

 * Firstly, I'd really like to have the layout engine done before doing this. Aligning text and character names with full-width spaces is silly.
 * Also, EoSD requires its separate beautification treatment.

Each contiguous block of text, delimited by,   or  , counts as one translation unit/template. Then, we simply replace the entire block with the new translated text.

Line count doesn't matter at all - it's highly unlikely to crash the game, and there's always one additional line available. Empty lines do matter, though.