mirror of
https://github.com/gurrgur/er-patcher.git
synced 2026-06-13 09:47:54 +00:00
Merge pull request #71 from polsrepo/patch-3
Fix for crash on death with --disable-rune-loss + potential fix for 60Hz fullscreen lock
This commit is contained in:
commit
808bf71966
1 changed files with 8 additions and 4 deletions
12
er-patcher
12
er-patcher
|
|
@ -46,9 +46,9 @@ if __name__ == "__main__":
|
||||||
print("er-patcher: rate pattern scan failed")
|
print("er-patcher: rate pattern scan failed")
|
||||||
|
|
||||||
if patch.disable_rune_loss:
|
if patch.disable_rune_loss:
|
||||||
rl_pattern = "b0 01 .. 8b .. e8 .. .. .. .. .. 8b .. .. .. 32 c0 .. 83 .. 28 c3".replace(" ", "")
|
rl_pattern = "41 .. 01 48 .. .. e8 .. .. .. .. 48 .. .. .. .. 32 c0".replace(" ", "")
|
||||||
if (res := re.search(rl_pattern, exe_hex)) is not None:
|
if (res := re.search(rl_pattern, exe_hex)) is not None:
|
||||||
rl_addr = res.span()[0] + 6
|
rl_addr = res.span()[0] + 12
|
||||||
rl_patch = "90 90 90 90 90".replace(" ", "") # NOP
|
rl_patch = "90 90 90 90 90".replace(" ", "") # NOP
|
||||||
exe_hex = exe_hex[:rl_addr] + rl_patch + exe_hex[rl_addr + len(rl_patch):]
|
exe_hex = exe_hex[:rl_addr] + rl_patch + exe_hex[rl_addr + len(rl_patch):]
|
||||||
else:
|
else:
|
||||||
|
|
@ -102,11 +102,15 @@ if __name__ == "__main__":
|
||||||
print("er-patcher: skip_intro pattern scan failed")
|
print("er-patcher: skip_intro pattern scan failed")
|
||||||
|
|
||||||
if patch.remove_60hz_fullscreen or patch.all:
|
if patch.remove_60hz_fullscreen or patch.all:
|
||||||
fs_pattern = "c7 45 ef 3c 00 00 00".replace(" ", "")
|
fs_pattern = "eb .. c7 .. .. 3c 00 00 00 c7 .. .. 01 00 00 00".replace(" ", "")
|
||||||
if (res := re.search(fs_pattern, exe_hex)) is not None:
|
if (res := re.search(fs_pattern, exe_hex)) is not None:
|
||||||
fs_addr = res.span()[0] + 3
|
fs_addr = res.span()[0] + 10
|
||||||
fs_patch = "00"
|
fs_patch = "00"
|
||||||
exe_hex = exe_hex[:fs_addr] + fs_patch + exe_hex[fs_addr + len(fs_patch):]
|
exe_hex = exe_hex[:fs_addr] + fs_patch + exe_hex[fs_addr + len(fs_patch):]
|
||||||
|
|
||||||
|
fs_addr_2 = res.span()[0] + 24
|
||||||
|
fs_patch_2 = "00"
|
||||||
|
exe_hex = exe_hex[:fs_addr_2] + fs_patch_2 + exe_hex[fs_addr_2 + len(fs_patch_2):]
|
||||||
else:
|
else:
|
||||||
print("er-patcher: remove_60hz_fullscreen pattern scan failed")
|
print("er-patcher: remove_60hz_fullscreen pattern scan failed")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue