Th09/Binary hacks
From Touhou Patch Center
< Th09
|
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 (first call)(sprintf_call_1 ) |
||
---|---|---|
Address |
|
|
Code |
|
Safe sprintf (second call)(sprintf_call_2 ) |
||
---|---|---|
Address |
|
|
Code |
|
Safe sprintf (replace pointer)(sprintf_rep ) |
||
---|---|---|
Address |
|
|
Code |
|
Music Room
Prepare Music Room title parameter fetching(music_title_prepare ) |
||
---|---|---|
Description | th09's code optimization certainly was better than those of earlier games, but there's still room for improvement. The original code calculates the same address twice. By optimizing this calculation and spilling the result to the stack, we save 13 bytes - enough to load both the track string and the track number into registers. | |
Address |
|
|
Code |
|
Rewrite Music Room comment render calls(music_cmt_rewrite ) |
||
---|---|---|
Description | Because it would have been completely impossible to add music comment breakpoints to the original function with its 8 case statements, one for each comment line. Turns out that all necessary structure offsets can be easily calculated and the switch statement isn't necessary at all. This removes a total of 391 bytes from the function! | |
Address |
|
|
Code |
|