Th128/Binary hacks
From Touhou Patch Center
< Th128
|
This page is locked for editing because it contains crucial data required for the basic operation of the patch engine. Please discuss possible improvements or additions on the Talk page; after review, these may then be added to the main page here. |
Contents
Bugs
Safe sprintf (call #1)(sprintf_call_1 ) |
||
---|---|---|
Address |
|
|
Code |
|
Safe sprintf (call #2)(sprintf_call_2 ) |
||
---|---|---|
Address |
|
|
Code |
|
Safe sprintf (call #3)(sprintf_call_3 ) |
||
---|---|---|
Address |
|
|
Code |
|
Safe sprintf (replace pointer)(sprintf_rep ) |
||
---|---|---|
Address |
|
|
Code |
|
Logging
Restore the game's built-in logging(log_restore ) |
||
---|---|---|
Description | Very useful for debugging. | |
Address |
|
|
Code |
|
Textbox size
Correct text length calculation for Fairy Wars-style text boxes(fw_textbox_size ) |
||
---|---|---|
Description | This replaces the basic text box length calculation (string length * 8) with a call to GetTextExtent.
To apply these for later games, do an instruction search for:
PUSH opcode to reflect the register with the string buffer address (EDI in this case). |
|
Address |
|
|
Code |
|
Spells
Spell card alignment(spell_align ) |
||
---|---|---|
Description | In this game, the fonts for dialog and spell cards have different sizes. For this reason, we would have to reset the font after the SelectObject setup - otherwise, dialog text width calculation would use the wrong font for the rest of the game. Thus, GetTextExtentForFont is used, which takes the font for the calculation as a parameter and does temporary font selection on its own. | |
Address |
|
|
Code |
|
Player data
Remove spell "alignment" in the result screen(result_spell_align ) |
||
---|---|---|
Address |
|
|
Code |
|