Port all 59NL/59NJ patches to 50YJ (US 1.24.3)
This commit is contained in:
committed by
Martin Michelsen
parent
6f9c442e7a
commit
ea74b4ac07
@@ -6,7 +6,7 @@
|
||||
.meta name="Palette"
|
||||
.meta description="Enables the alternate action\npalette for number keys"
|
||||
|
||||
.versions 59NJ 59NL
|
||||
.versions 50YJ 59NJ 59NL
|
||||
|
||||
entry_ptr:
|
||||
reloc0:
|
||||
@@ -17,10 +17,10 @@ write_call_func:
|
||||
|
||||
start:
|
||||
mov al, 0xEB
|
||||
mov [<VERS 0x0068A7A5 0x0068A739>], al # SecondaryPaletteAttack1
|
||||
mov [<VERS 0x0068515D 0x0068A7A5 0x0068A739>], al # SecondaryPaletteAttack1
|
||||
xor al, al
|
||||
mov [<VERS 0x006A11B7 0x006A114F>], al # SecondaryPaletteAttack2
|
||||
mov [<VERS 0x006A0CB7 0x006A0C4F>], al # SecondaryPaletteAttack3
|
||||
mov [<VERS 0x0069B53B 0x006A11B7 0x006A114F>], al # SecondaryPaletteAttack2
|
||||
mov [<VERS 0x0069B047 0x006A0CB7 0x006A0C4F>], al # SecondaryPaletteAttack3
|
||||
|
||||
call patch_func_1 # GetCurrentPalette
|
||||
call patch_func_2 # CheckHotkey1_1
|
||||
@@ -35,7 +35,7 @@ start:
|
||||
patch_func_1:
|
||||
pop ecx
|
||||
push 8
|
||||
push <VERS 0x00748990 0x00748944>
|
||||
push <VERS 0x0074196B 0x00748990 0x00748944>
|
||||
call get_code_size1
|
||||
.deltaof patch_code1, patch_code_end1
|
||||
get_code_size1:
|
||||
@@ -47,7 +47,7 @@ patch_code1:
|
||||
mov edx, [edx + 0x2C]
|
||||
movzx edx, byte [edx + 0x62]
|
||||
test edx, edx
|
||||
setnz byte [<VERS 0x00748B1B 0x00748ACF>]
|
||||
setnz byte [<VERS 0x00741B59 0x00748B1B 0x00748ACF>]
|
||||
mov edx, edi
|
||||
and edx, 0xFF
|
||||
ret
|
||||
@@ -59,7 +59,7 @@ patch_code_end1:
|
||||
patch_func_2:
|
||||
pop ecx
|
||||
push 5
|
||||
push <VERS 0x007489DE 0x00748992>
|
||||
push <VERS 0x007419B9 0x007489DE 0x00748992>
|
||||
call get_code_size2
|
||||
.deltaof patch_code2, patch_code_end2
|
||||
get_code_size2:
|
||||
@@ -67,7 +67,7 @@ get_code_size2:
|
||||
push dword [eax]
|
||||
call patch_code_end2
|
||||
patch_code2:
|
||||
cmp byte [<VERS 0x00748B1B 0x00748ACF>], 0
|
||||
cmp byte [<VERS 0x00741B59 0x00748B1B 0x00748ACF>], 0
|
||||
jnz +0x06
|
||||
movzx edx, byte [eax + esi * 4 + 0x04] # main palette
|
||||
ret
|
||||
@@ -81,7 +81,7 @@ patch_code_end2:
|
||||
patch_func_3:
|
||||
pop ecx
|
||||
push 5
|
||||
push <VERS 0x007489ED 0x007489A1>
|
||||
push <VERS 0x007419C8 0x007489ED 0x007489A1>
|
||||
call get_code_size3
|
||||
.deltaof patch_code3, patch_code_end3
|
||||
get_code_size3:
|
||||
@@ -89,7 +89,7 @@ get_code_size3:
|
||||
push dword [eax]
|
||||
call patch_code_end3
|
||||
patch_code3:
|
||||
cmp byte [<VERS 0x00748B1B 0x00748ACF>], 0
|
||||
cmp byte [<VERS 0x00741B59 0x00748B1B 0x00748ACF>], 0
|
||||
jnz +0x06
|
||||
movzx ecx, byte [eax + ecx * 2 + 0x05] # main palette
|
||||
ret
|
||||
@@ -103,7 +103,7 @@ patch_code_end3:
|
||||
patch_func_4:
|
||||
pop ecx
|
||||
push 5
|
||||
push <VERS 0x00748A88 0x00748A3C>
|
||||
push <VERS 0x00741A63 0x00748A88 0x00748A3C>
|
||||
call get_code_size4
|
||||
.deltaof patch_code4, patch_code_end4
|
||||
get_code_size4:
|
||||
@@ -111,7 +111,7 @@ get_code_size4:
|
||||
push dword [eax]
|
||||
call patch_code_end4
|
||||
patch_code4:
|
||||
cmp byte [<VERS 0x00748B1B 0x00748ACF>], 0
|
||||
cmp byte [<VERS 0x00741B59 0x00748B1B 0x00748ACF>], 0
|
||||
jnz +0x06
|
||||
movzx edx, byte [edx + ebx * 4 + 0x04] # main palette
|
||||
ret
|
||||
@@ -125,7 +125,7 @@ patch_code_end4:
|
||||
patch_func_5:
|
||||
pop ecx
|
||||
push 5
|
||||
push <VERS 0x00748A97 0x00748A4B>
|
||||
push <VERS 0x00741A72 0x00748A97 0x00748A4B>
|
||||
call get_code_size5
|
||||
.deltaof patch_code5, patch_code_end5
|
||||
get_code_size5:
|
||||
@@ -133,7 +133,7 @@ get_code_size5:
|
||||
push dword [eax]
|
||||
call patch_code_end5
|
||||
patch_code5:
|
||||
cmp byte [<VERS 0x00748B1B 0x00748ACF>], 0
|
||||
cmp byte [<VERS 0x00741B59 0x00748B1B 0x00748ACF>], 0
|
||||
jnz +0x06
|
||||
movzx ecx, byte [edx + eax * 2 + 0x05] # main palette
|
||||
ret
|
||||
@@ -147,7 +147,7 @@ patch_code_end5:
|
||||
patch_func_6:
|
||||
pop ecx
|
||||
push 5
|
||||
push <VERS 0x007103D3 0x007103B7>
|
||||
push <VERS 0x0070A11F 0x007103D3 0x007103B7>
|
||||
call get_code_size6
|
||||
.deltaof patch_code6, patch_code_end6
|
||||
get_code_size6:
|
||||
@@ -155,7 +155,7 @@ get_code_size6:
|
||||
push dword [eax]
|
||||
call patch_code_end6
|
||||
patch_code6:
|
||||
cmp byte [<VERS 0x00748B1B 0x00748ACF>], 0
|
||||
cmp byte [<VERS 0x00741B59 0x00748B1B 0x00748ACF>], 0
|
||||
jnz +0x06
|
||||
movzx ecx, byte [eax + edx * 4 + 0x04] # main palette
|
||||
ret
|
||||
@@ -169,7 +169,7 @@ patch_code_end6:
|
||||
patch_func_7:
|
||||
pop ecx
|
||||
push 5
|
||||
push <VERS 0x007103DC 0x007103C0>
|
||||
push <VERS 0x0070A128 0x007103DC 0x007103C0>
|
||||
call get_code_size7
|
||||
.deltaof patch_code7, patch_code_end7
|
||||
get_code_size7:
|
||||
@@ -177,7 +177,7 @@ get_code_size7:
|
||||
push dword [eax]
|
||||
call patch_code_end7
|
||||
patch_code7:
|
||||
cmp byte [<VERS 0x00748B1B 0x00748ACF>], 0
|
||||
cmp byte [<VERS 0x00741B59 0x00748B1B 0x00748ACF>], 0
|
||||
jnz +0x06
|
||||
movzx ecx, byte [eax + edx * 4 + 0x05] # main palette
|
||||
ret
|
||||
@@ -190,29 +190,29 @@ patch_code_end7:
|
||||
write_code_blocks:
|
||||
.include WriteCodeBlocks
|
||||
|
||||
.data <VERS 0x00748A05 0x007489B9>
|
||||
.data <VERS 0x007419E0 0x00748A05 0x007489B9>
|
||||
.deltaof code_block1_start, code_block1_end
|
||||
|
||||
# UnsetHotkey1
|
||||
code_block1_start:
|
||||
push dword [<VERS 0x00748B1B 0x00748ACF>]
|
||||
push dword [<VERS 0x00741B59 0x00748B1B 0x00748ACF>]
|
||||
push eax
|
||||
mov eax, <VERS 0x0068CE4C 0x0068CDE0> # SetPaletteHotkey
|
||||
mov eax, <VERS 0x00687710 0x0068CE4C 0x0068CDE0> # SetPaletteHotkey
|
||||
call eax
|
||||
.binary 909090909090909090
|
||||
code_block1_end:
|
||||
.data <VERS 0x00748AAB 0x00748A5F>
|
||||
.data <VERS 0x00741A86 0x00748AAB 0x00748A5F>
|
||||
.deltaof code_block2_start, code_block2_end
|
||||
|
||||
# UnsetHotkey2
|
||||
code_block2_start:
|
||||
push dword [<VERS 0x00748B1B 0x00748ACF>]
|
||||
push dword [<VERS 0x00741B59 0x00748B1B 0x00748ACF>]
|
||||
push eax
|
||||
mov eax, <VERS 0x0068CE4C 0x0068CDE0> # SetPaletteHotkey
|
||||
mov eax, <VERS 0x00687710 0x0068CE4C 0x0068CDE0> # SetPaletteHotkey
|
||||
call eax
|
||||
.binary 909090909090909090
|
||||
code_block2_end:
|
||||
.data <VERS 0x00748B0A 0x00748ABE>
|
||||
.data <VERS 0x00741B48 0x00748B0A 0x00748ABE>
|
||||
.deltaof code_block3_start, code_block3_end
|
||||
|
||||
# SetHotkey
|
||||
@@ -224,9 +224,9 @@ code_block3_start:
|
||||
push edx
|
||||
push ebx
|
||||
push esi
|
||||
.binary 6800000000 # tmpCurrentPalette = <VERS 0x00748B1B 0x00748ACF>
|
||||
.binary 6800000000 # tmpCurrentPalette = <VERS 0x00741B59 0x00748B1B 0x00748ACF>
|
||||
push 0
|
||||
mov eax, <VERS 0x0068CE4C 0x0068CDE0> # SetPaletteHotkey
|
||||
mov eax, <VERS 0x00687710 0x0068CE4C 0x0068CDE0> # SetPaletteHotkey
|
||||
call eax
|
||||
.binary 90909090909090909090909090909090
|
||||
code_block3_end:
|
||||
|
||||
Reference in New Issue
Block a user