more fixes

This commit is contained in:
duncathan 2023-10-12 22:04:14 -06:00
parent db760f1710
commit 01082581a8
8 changed files with 17 additions and 4 deletions

View File

@ -118,7 +118,7 @@ def patch_hash(hash: list[int], output_dir: Path):
def patch_uuid(uuid: str, output_dir: Path):
output_dir.joinpath("data", "uuid.txt").write_text(uuid)
def wrap_msg_text(text: str, facepic: bool, max_text_boxes: int | None = 1) -> str:
def wrap_msg_text(text: str, facepic: bool, *, ending: str = "<NOD", max_text_boxes: int | None = 1) -> str:
hard_limit = 35
msgbox_limit = 26 if facepic else hard_limit
@ -133,7 +133,7 @@ def wrap_msg_text(text: str, facepic: bool, max_text_boxes: int | None = 1) -> s
text += "<NOD"
if len(l) != hard_limit:
text += "\r\n"
text += "<NOD"
text += ending
return text
@ -141,4 +141,4 @@ def create_hint_script(text: str, facepic: bool, ending: str) -> str:
"""
A desperate attempt to generate valid <MSG text. Fills one text box (up to three lines). Attempts to wrap words elegantly.
"""
return f"<PRI<MSG<TUR{wrap_msg_text(text, facepic)}{ending}"
return f"<PRI<MSG<TUR{wrap_msg_text(text, facepic, ending=ending)}"

View File

@ -41,6 +41,8 @@ xor esi, esi
:$LL4@RestoreStr
; Line 153
mov eax, [Strip_addr]
test eax, eax
je :return
test [edi+eax], 128 ; 00000080H
je :$LN2@RestoreStr
; Line 155
@ -77,7 +79,8 @@ add edi, 50 ; 00000050H
cmp esi, MAX_STRIPx10 ; 000007f0H
jl :$LL4@RestoreStr
; Line 164
:return
pop edi
pop esi
leave
retn
retn

View File

@ -0,0 +1,4 @@
0x40CD91
03
0x40CDC8
03

View File

@ -0,0 +1,4 @@
0x40149E
8B 4D F8 49 79 01 41 B8 68 9C 49 00 31 D2 39 10
7D 02 89 08 39 08 7E 14 89 10 90 90 90 90 90 90
90 90 90 90 90 90 90 90 90 90 90 90

View File

@ -0,0 +1,2 @@
0x41DB17
95 EA

Binary file not shown.

Binary file not shown.

Binary file not shown.