The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Development of this patch has moved to GitHub .
Please use the Issues page there to discuss possible improvements or additions to this patch, or simply send a pull request.
For now, the existing wiki pages of this patch will remain for the sake of documentation, but they are no longer functional.
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.
Bugs
Safe sprintf (call #1) (sprintf_call_1
)
Address
v1.00a 0x46639f
Code
50
e8 [strings_vsprintf]
8985 7cffffff
89bd 78ffffff
push eax
call [ strings_vsprintf ]
mov dword ptr ss :[ ebp-0x84 ], eax
mov dword ptr ss :[ ebp-0x88 ], edi
Safe sprintf (call #2) (sprintf_call_2
)
Address
v1.00a 0x466234
Code
50
e8 [strings_vsprintf]
8985 78ffffff
push eax
call [ strings_vsprintf ]
mov dword ptr ss :[ ebp-0x88 ], eax
Safe sprintf (call #3) (sprintf_call_3
)
Address
v1.00a 0x4662cf
Code
50
e8 [strings_vsprintf]
8985 74ffffff
push eax
call [ strings_vsprintf ]
mov dword ptr ss :[ ebp-0x8c ], eax
Safe sprintf (replace pointer) (sprintf_rep
)
Address
v1.00a 0x466272, 0x466342, 0x46640f
Code
Logging
Restore the game's built-in logging (log_restore
)
Description
Very useful for debugging.
Address
v1.00a 0x46c320
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:
sub eax , edx
lea ecx ,[ eax * 8 ]
and ecx , fffffff0
and don't forget to change the PUSH
opcode to reflect the register with the string buffer address (EDI
in this case).
Address
v1.00a 0x423960, 0x423b20
Code
ff35 bc2a4d00
57
e8 [GetTextExtentForFont]
89c1
90 90 90
push dword ptr ds :[ th128.4d2abc ]
push edi
call [ GetTextExtentForFont ]
mov ecx , eax
nop (* 3 )
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
v1.00a 0x466307
Code
c1e9 04
83e1 01
51
ff75 0c
ff75 08
ff35 cc2a4d00
ff75 18
e8 [GetTextExtentForFont]
50
db04e4
58
90 90 90
shr ecx , 4
and ecx , 00000001
push ecx
push dword ptr ss :[ ebp + 0 C ]
push dword ptr ss :[ ebp + 8 ]
push dword ptr ds :[ th128.004d2acc ]
push dword ptr ss :[ ebp + 18 ]
call [ GetTextExtentForFont ]
push eax
fild dword ptr ss :[ esp ]
pop eax
nop (* 3 )
Player data
Remove spell "alignment" in the result screen (result_spell_align
)
Address
v1.00a 0x466409
Code