Port all 59NL/59NJ patches to 50YJ (US 1.24.3)
This commit is contained in:
committed by
Martin Michelsen
parent
6f9c442e7a
commit
ea74b4ac07
@@ -1,7 +1,7 @@
|
||||
# (uint16_t entity_id @ eax) -> TObjectV00b441c0* @ eax
|
||||
# Preserves all registers except eax
|
||||
|
||||
.versions 59NJ 59NL
|
||||
.versions 50YJ 59NJ 59NL
|
||||
|
||||
get_enemy_entity:
|
||||
push esi
|
||||
@@ -15,15 +15,15 @@ get_enemy_entity:
|
||||
cmp edx, 0x4000
|
||||
jge done
|
||||
|
||||
mov esi, [<VERS 0x00AABCE8 0x00AAE168>] # bs_low = next_player_entity_index
|
||||
mov edi, [<VERS 0x00AABCE4 0x00AAE164>]
|
||||
mov esi, [<VERS 0x00AA1CA8 0x00AABCE8 0x00AAE168>] # bs_low = next_player_entity_index
|
||||
mov edi, [<VERS 0x00AA1CA4 0x00AABCE4 0x00AAE164>]
|
||||
lea edi, [edi + esi - 1] # bs_high = next_player_entity_index + next_enemy_entity_index - 1
|
||||
bs_again:
|
||||
cmp esi, edi
|
||||
jge bs_done
|
||||
lea ecx, [esi + edi]
|
||||
shr ecx, 1
|
||||
mov eax, [ecx * 4 + <VERS 0x00AAB2A0 0x00AAD720>] # all_entities[ecx]
|
||||
mov eax, [ecx * 4 + <VERS 0x00AA1260 0x00AAB2A0 0x00AAD720>] # all_entities[ecx]
|
||||
cmp [eax + 0x1C], dx
|
||||
jge bs_not_less
|
||||
lea esi, [ecx + 1]
|
||||
@@ -33,7 +33,7 @@ bs_not_less:
|
||||
jmp bs_again
|
||||
bs_done:
|
||||
|
||||
mov eax, [esi * 4 + <VERS 0x00AAB2A0 0x00AAD720>] # all_entities[bs_low]
|
||||
mov eax, [esi * 4 + <VERS 0x00AA1260 0x00AAB2A0 0x00AAD720>] # all_entities[bs_low]
|
||||
test eax, eax
|
||||
je done
|
||||
xor ecx, ecx
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# allocated code at the specified pointer. The allocated memory is never freed. This function pops its arguments off
|
||||
# the stack before returning.
|
||||
|
||||
.versions 59NJ 59NL
|
||||
.versions 50YJ 59NJ 59NL
|
||||
|
||||
write_call_to_code:
|
||||
# [esp + 0x04] = code ptr
|
||||
@@ -15,9 +15,9 @@ write_call_to_code:
|
||||
# [esp + 0x0C] = ptr addr
|
||||
|
||||
# Allocate memory for the copied code
|
||||
mov ecx, [<VERS 0x00AA8F84 0x00AAB404>]
|
||||
mov ecx, [<VERS 0x00A9EF44 0x00AA8F84 0x00AAB404>]
|
||||
push dword [esp + 0x08]
|
||||
mov eax, <VERS 0x007A984C 0x007A8A38>
|
||||
mov eax, <VERS 0x007A2254 0x007A984C 0x007A8A38>
|
||||
call eax # malloc7
|
||||
test eax, eax
|
||||
je done
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.versions 59NJ 59NL
|
||||
.versions 50YJ 59NJ 59NL
|
||||
|
||||
# This file defines the following function:
|
||||
# write_call_to_code(
|
||||
@@ -20,9 +20,9 @@ write_call_to_code:
|
||||
# [esp + 0x10] = callsite size (if zero, write the address instead of a call)
|
||||
|
||||
# Allocate memory for the copied code
|
||||
mov ecx, [<VERS 0x00AA8F84 0x00AAB404>]
|
||||
mov ecx, [<VERS 0x00A9EF44 0x00AA8F84 0x00AAB404>]
|
||||
push dword [esp + 0x08]
|
||||
mov eax, <VERS 0x007A984C 0x007A8A38>
|
||||
mov eax, <VERS 0x007A2254 0x007A984C 0x007A8A38>
|
||||
call eax # malloc7
|
||||
test eax, eax
|
||||
je done
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
|
||||
.versions 59NJ 59NL
|
||||
.versions 50YJ 59NJ 59NL
|
||||
|
||||
write_call_to_code:
|
||||
# [esp + 0x04] = code ptr
|
||||
@@ -25,9 +25,9 @@ write_call_to_code:
|
||||
# ... (further callsite address/size pairs)
|
||||
|
||||
# Allocate memory for the copied code
|
||||
mov ecx, [<VERS 0x00AA8F84 0x00AAB404>]
|
||||
mov ecx, [<VERS 0x00A9EF44 0x00AA8F84 0x00AAB404>]
|
||||
push dword [esp + 0x08]
|
||||
mov eax, <VERS 0x007A984C 0x007A8A38>
|
||||
mov eax, <VERS 0x007A2254 0x007A984C 0x007A8A38>
|
||||
call eax # malloc7
|
||||
test eax, eax
|
||||
je done
|
||||
|
||||
@@ -118,7 +118,7 @@ first_patch_header:
|
||||
|
||||
|
||||
|
||||
.versions 2OJW 2OJZ 59NJ 59NL
|
||||
.versions 2OJW 2OJZ 50YJ 59NJ 59NL
|
||||
|
||||
start:
|
||||
push ebx
|
||||
|
||||
Reference in New Issue
Block a user