mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2025-01-01 16:53:01 +05:00
Compare commits
18 commits
dcde67d8e2
...
a48e81a296
Author | SHA1 | Date | |
---|---|---|---|
|
a48e81a296 | ||
|
b742b73ad4 | ||
|
9ab93cd79e | ||
|
0d1694aeee | ||
|
8ed97f0e7f | ||
|
055a319374 | ||
|
5459cbf037 | ||
|
a3f946b30f | ||
|
0c377ae10e | ||
|
47ac4d7f2d | ||
|
c815a407da | ||
|
b13b3139d6 | ||
|
ccfa4eda99 | ||
|
2b5c5b7ce0 | ||
|
33074475bd | ||
|
e0a0200f90 | ||
|
c7354a8ebf | ||
|
47e7ab6b1f |
5 changed files with 63 additions and 62 deletions
|
@ -9,8 +9,10 @@
|
||||||
// FIXME: Common.h might be a better place for this (but SA doesn't include it)
|
// FIXME: Common.h might be a better place for this (but SA doesn't include it)
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define NOBUFFERCHECKS __declspec(safebuffers)
|
#define NOBUFFERCHECKS __declspec(safebuffers)
|
||||||
#else
|
#elif defined(__GNUC__) && !defined(__clang__)
|
||||||
#define NOBUFFERCHECKS __attribute__((optimize("-fno-stack-protector")))
|
#define NOBUFFERCHECKS __attribute__((optimize("-fno-stack-protector")))
|
||||||
|
#else
|
||||||
|
#define NOBUFFERCHECKS __attribute__((no_stack_protector))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
constexpr double RAD_TO_DEG (180.0/M_PI);
|
constexpr double RAD_TO_DEG (180.0/M_PI);
|
||||||
|
|
|
@ -201,7 +201,7 @@ void __declspec(naked) M16StatsFix()
|
||||||
{
|
{
|
||||||
add eax, 0x34
|
add eax, 0x34
|
||||||
add ebx, 0x34
|
add ebx, 0x34
|
||||||
mov ecx, [InstantHitsFiredByPlayer]
|
mov ecx, InstantHitsFiredByPlayer
|
||||||
inc dword ptr [ecx]
|
inc dword ptr [ecx]
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
@ -210,17 +210,17 @@ void __declspec(naked) M16StatsFix()
|
||||||
(
|
(
|
||||||
"add eax, 0x34\n"
|
"add eax, 0x34\n"
|
||||||
"add ebx, 0x34\n"
|
"add ebx, 0x34\n"
|
||||||
"mov ecx, [%[InstantHitsFiredByPlayer]]\n"
|
"mov ecx, %[InstantHitsFiredByPlayer]\n"
|
||||||
"inc dword ptr [ecx]\n"
|
"inc dword ptr [ecx]\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
:: [InstantHitsFiredByPlayer] "m" (InstantHitsFiredByPlayer)
|
:: [InstantHitsFiredByPlayer] "m" (InstantHitsFiredByPlayer)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const float fMinusOne = -1.0f;
|
||||||
void __declspec(naked) HeadlightsFix()
|
void __declspec(naked) HeadlightsFix()
|
||||||
{
|
{
|
||||||
static const float fMinusOne = -1.0f;
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
_asm
|
_asm
|
||||||
{
|
{
|
||||||
|
@ -237,7 +237,7 @@ HeadlightsFix_DontLimit:
|
||||||
fld dword ptr [esp+0x708-0x690]
|
fld dword ptr [esp+0x708-0x690]
|
||||||
fabs
|
fabs
|
||||||
fld st
|
fld st
|
||||||
jmp [HeadlightsFix_JumpBack]
|
jmp HeadlightsFix_JumpBack
|
||||||
}
|
}
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
__asm__ volatile
|
__asm__ volatile
|
||||||
|
@ -248,15 +248,15 @@ HeadlightsFix_DontLimit:
|
||||||
"and ah, 5\n"
|
"and ah, 5\n"
|
||||||
"cmp ah, 1\n"
|
"cmp ah, 1\n"
|
||||||
"jnz HeadlightsFix_DontLimit\n"
|
"jnz HeadlightsFix_DontLimit\n"
|
||||||
"fld %0\n"
|
"fld %[fMinusOne]\n"
|
||||||
"fstp dword ptr [esp+0x708-0x690]\n"
|
"fstp dword ptr [esp+0x708-0x690]\n"
|
||||||
|
|
||||||
"HeadlightsFix_DontLimit:\n"
|
"HeadlightsFix_DontLimit:\n"
|
||||||
"fld dword ptr [esp+0x708-0x690]\n"
|
"fld dword ptr [esp+0x708-0x690]\n"
|
||||||
"fabs\n"
|
"fabs\n"
|
||||||
"fld st\n"
|
"fld st\n"
|
||||||
"jmp [%[HeadlightsFix_JumpBack]]\n"
|
"jmp %[HeadlightsFix_JumpBack]"
|
||||||
:: [fMinusOne] "m" (fMinusOne),
|
:: [fMinusOne] "f" (fMinusOne),
|
||||||
[HeadlightsFix_JumpBack] "m" (HeadlightsFix_JumpBack)
|
[HeadlightsFix_JumpBack] "m" (HeadlightsFix_JumpBack)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
@ -354,7 +354,7 @@ void __declspec(naked) SubtitlesShadowFix()
|
||||||
push eax
|
push eax
|
||||||
call Recalculate
|
call Recalculate
|
||||||
fadd dword ptr [esp+0x50+8]
|
fadd dword ptr [esp+0x50+8]
|
||||||
fadd [fShadowYSize]
|
fadd fShadowYSize
|
||||||
jmp SubtitlesShadowFix_JumpBack
|
jmp SubtitlesShadowFix_JumpBack
|
||||||
}
|
}
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
|
@ -363,8 +363,8 @@ void __declspec(naked) SubtitlesShadowFix()
|
||||||
"push eax\n"
|
"push eax\n"
|
||||||
"call %[Recalculate]\n"
|
"call %[Recalculate]\n"
|
||||||
"fadd dword ptr [esp+0x50+8]\n"
|
"fadd dword ptr [esp+0x50+8]\n"
|
||||||
"fadd [%[fShadowYSize]]\n"
|
"fadd %[fShadowYSize]\n"
|
||||||
"jmp %[SubtitlesShadowFix_JumpBack]\n"
|
"jmp %[SubtitlesShadowFix_JumpBack]"
|
||||||
:: [Recalculate] "i" (Recalculate),
|
:: [Recalculate] "i" (Recalculate),
|
||||||
[fShadowYSize] "m" (fShadowYSize),
|
[fShadowYSize] "m" (fShadowYSize),
|
||||||
[SubtitlesShadowFix_JumpBack] "m" (SubtitlesShadowFix_JumpBack)
|
[SubtitlesShadowFix_JumpBack] "m" (SubtitlesShadowFix_JumpBack)
|
||||||
|
@ -396,7 +396,7 @@ void __declspec(naked) III_SensResetFix()
|
||||||
"rep stosd\n"
|
"rep stosd\n"
|
||||||
"fstp dword ptr [ebp+0x198]\n"
|
"fstp dword ptr [ebp+0x198]\n"
|
||||||
"fstp dword ptr [ebp+0x194]\n"
|
"fstp dword ptr [ebp+0x194]\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -408,7 +408,7 @@ void __declspec(naked) RadarBoundsCheckCoordBlip()
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
_asm
|
_asm
|
||||||
{
|
{
|
||||||
mov edx, dword ptr [RadarBoundsCheckCoordBlip_Count]
|
mov edx, RadarBoundsCheckCoordBlip_Count
|
||||||
cmp cl, byte ptr [edx]
|
cmp cl, byte ptr [edx]
|
||||||
jnb OutOfBounds
|
jnb OutOfBounds
|
||||||
mov edx, ecx
|
mov edx, ecx
|
||||||
|
@ -423,7 +423,7 @@ OutOfBounds:
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
__asm__ volatile
|
__asm__ volatile
|
||||||
(
|
(
|
||||||
"mov edx, dword ptr [%[RadarBoundsCheckCoordBlip_Count]]\n"
|
"mov edx, %[RadarBoundsCheckCoordBlip_Count]\n"
|
||||||
"cmp cl, byte ptr [edx]\n"
|
"cmp cl, byte ptr [edx]\n"
|
||||||
"jnb OutOfBounds\n"
|
"jnb OutOfBounds\n"
|
||||||
"mov edx, ecx\n"
|
"mov edx, ecx\n"
|
||||||
|
@ -433,7 +433,7 @@ OutOfBounds:
|
||||||
"OutOfBounds:\n"
|
"OutOfBounds:\n"
|
||||||
"or eax, -1\n"
|
"or eax, -1\n"
|
||||||
"fcompp\n"
|
"fcompp\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
:: [RadarBoundsCheckCoordBlip_Count] "m" (RadarBoundsCheckCoordBlip_Count),
|
:: [RadarBoundsCheckCoordBlip_Count] "m" (RadarBoundsCheckCoordBlip_Count),
|
||||||
[RadarBoundsCheckCoordBlip_JumpBack] "m" (RadarBoundsCheckCoordBlip_JumpBack)
|
[RadarBoundsCheckCoordBlip_JumpBack] "m" (RadarBoundsCheckCoordBlip_JumpBack)
|
||||||
);
|
);
|
||||||
|
@ -446,7 +446,7 @@ void __declspec(naked) RadarBoundsCheckEntityBlip()
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
_asm
|
_asm
|
||||||
{
|
{
|
||||||
mov edx, dword ptr [RadarBoundsCheckCoordBlip_Count]
|
mov edx, RadarBoundsCheckCoordBlip_Count
|
||||||
cmp cl, byte ptr [edx]
|
cmp cl, byte ptr [edx]
|
||||||
jnb OutOfBounds
|
jnb OutOfBounds
|
||||||
mov edx, ecx
|
mov edx, ecx
|
||||||
|
@ -460,7 +460,7 @@ void __declspec(naked) RadarBoundsCheckEntityBlip()
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
__asm__ volatile
|
__asm__ volatile
|
||||||
(
|
(
|
||||||
"mov edx, dword ptr [%[RadarBoundsCheckCoordBlip_Count]]\n"
|
"mov edx, %[RadarBoundsCheckCoordBlip_Count]\n"
|
||||||
"cmp cl, byte ptr [edx]\n"
|
"cmp cl, byte ptr [edx]\n"
|
||||||
"jnb OutOfBounds2\n"
|
"jnb OutOfBounds2\n"
|
||||||
"mov edx, ecx\n"
|
"mov edx, ecx\n"
|
||||||
|
@ -469,7 +469,7 @@ void __declspec(naked) RadarBoundsCheckEntityBlip()
|
||||||
|
|
||||||
"OutOfBounds2:\n"
|
"OutOfBounds2:\n"
|
||||||
"or eax, -1\n"
|
"or eax, -1\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
:: [RadarBoundsCheckCoordBlip_Count] "m" (RadarBoundsCheckCoordBlip_Count),
|
:: [RadarBoundsCheckCoordBlip_Count] "m" (RadarBoundsCheckCoordBlip_Count),
|
||||||
[RadarBoundsCheckEntityBlip_JumpBack] "m" (RadarBoundsCheckEntityBlip_JumpBack)
|
[RadarBoundsCheckEntityBlip_JumpBack] "m" (RadarBoundsCheckEntityBlip_JumpBack)
|
||||||
);
|
);
|
||||||
|
@ -539,7 +539,7 @@ void __declspec(naked) AutoPilotTimerFix_III()
|
||||||
"pop ebp\n"
|
"pop ebp\n"
|
||||||
"pop esi\n"
|
"pop esi\n"
|
||||||
"pop ebx\n"
|
"pop ebx\n"
|
||||||
"ret 4\n"
|
"ret 4"
|
||||||
:: [AutoPilotTimerCalculation_III] "i" (AutoPilotTimerCalculation_III)
|
:: [AutoPilotTimerCalculation_III] "i" (AutoPilotTimerCalculation_III)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
@ -723,7 +723,7 @@ namespace RemoveDriverStatusFix
|
||||||
"or al, 0x20\n"
|
"or al, 0x20\n"
|
||||||
|
|
||||||
"DontSetStatus:\n"
|
"DontSetStatus:\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -778,7 +778,7 @@ namespace EvasiveDiveFix
|
||||||
"add esp, 8\n"
|
"add esp, 8\n"
|
||||||
|
|
||||||
"mov ecx, ebp\n"
|
"mov ecx, ebp\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
:: [CalculateAngle] "i" (CalculateAngle)
|
:: [CalculateAngle] "i" (CalculateAngle)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
@ -799,14 +799,14 @@ namespace NullTerminatedLines
|
||||||
{
|
{
|
||||||
mov eax, [esp+4]
|
mov eax, [esp+4]
|
||||||
mov byte ptr [eax+ecx], 0
|
mov byte ptr [eax+ecx], 0
|
||||||
jmp [orgSscanf_LoadPath]
|
jmp orgSscanf_LoadPath
|
||||||
}
|
}
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
__asm__ volatile
|
__asm__ volatile
|
||||||
(
|
(
|
||||||
"mov eax, [esp+4]\n"
|
"mov eax, [esp+4]\n"
|
||||||
"mov byte ptr [eax+ecx], 0\n"
|
"mov byte ptr [eax+ecx], 0\n"
|
||||||
"jmp [%[orgSscanf_LoadPath]]\n"
|
"jmp %[orgSscanf_LoadPath]"
|
||||||
:: [orgSscanf_LoadPath] "m" (orgSscanf_LoadPath)
|
:: [orgSscanf_LoadPath] "m" (orgSscanf_LoadPath)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
@ -820,14 +820,14 @@ namespace NullTerminatedLines
|
||||||
{
|
{
|
||||||
mov eax, [esp+4]
|
mov eax, [esp+4]
|
||||||
mov byte ptr [eax+ecx], 0
|
mov byte ptr [eax+ecx], 0
|
||||||
jmp [orgSscanf1]
|
jmp orgSscanf1
|
||||||
}
|
}
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
__asm__ volatile
|
__asm__ volatile
|
||||||
(
|
(
|
||||||
"mov eax, [esp+4]\n"
|
"mov eax, [esp+4]\n"
|
||||||
"mov byte ptr [eax+ecx], 0\n"
|
"mov byte ptr [eax+ecx], 0\n"
|
||||||
"jmp [%[orgSscanf1]]\n"
|
"jmp %[orgSscanf1]"
|
||||||
:: [orgSscanf1] "m" (orgSscanf1)
|
:: [orgSscanf1] "m" (orgSscanf1)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
@ -838,7 +838,7 @@ namespace NullTerminatedLines
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
_asm
|
_asm
|
||||||
{
|
{
|
||||||
mov ecx, [gString]
|
mov ecx, gString
|
||||||
mov byte ptr [ecx+edx], 0
|
mov byte ptr [ecx+edx], 0
|
||||||
mov ecx, [esi]
|
mov ecx, [esi]
|
||||||
inc ebp
|
inc ebp
|
||||||
|
@ -848,12 +848,12 @@ namespace NullTerminatedLines
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
__asm__ volatile
|
__asm__ volatile
|
||||||
(
|
(
|
||||||
"mov ecx, [%[gString]]\n"
|
"mov ecx, %[gString]\n"
|
||||||
"mov byte ptr [ecx+edx], 0\n"
|
"mov byte ptr [ecx+edx], 0\n"
|
||||||
"mov ecx, [esi]\n"
|
"mov ecx, [esi]\n"
|
||||||
"inc ebp\n"
|
"inc ebp\n"
|
||||||
"add ecx, [esp+0xAC-0x98]\n"
|
"add ecx, [esp+0xAC-0x98]\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
:: [gString] "m" (gString)
|
:: [gString] "m" (gString)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
@ -886,8 +886,8 @@ namespace DodoKeyboardControls
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
_asm
|
_asm
|
||||||
{
|
{
|
||||||
call [orgFindPlayerVehicle]
|
call orgFindPlayerVehicle
|
||||||
mov ecx, [bAllDodosCheat]
|
mov ecx, bAllDodosCheat
|
||||||
cmp byte ptr [ecx], 0
|
cmp byte ptr [ecx], 0
|
||||||
je CheatDisabled
|
je CheatDisabled
|
||||||
mov byte ptr [esp+0x1C-0x14], 1
|
mov byte ptr [esp+0x1C-0x14], 1
|
||||||
|
@ -898,14 +898,14 @@ namespace DodoKeyboardControls
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
__asm__ volatile
|
__asm__ volatile
|
||||||
(
|
(
|
||||||
"call [%[orgFindPlayerVehicle]]\n"
|
"call %[orgFindPlayerVehicle]\n"
|
||||||
"mov ecx, [%[bAllDodosCheat]]\n"
|
"mov ecx, %[bAllDodosCheat]\n"
|
||||||
"cmp byte ptr [ecx], 0\n"
|
"cmp byte ptr [ecx], 0\n"
|
||||||
"je CheatDisabled\n"
|
"je CheatDisabled\n"
|
||||||
"mov byte ptr [esp+0x1C-0x14], 1\n"
|
"mov byte ptr [esp+0x1C-0x14], 1\n"
|
||||||
|
|
||||||
"CheatDisabled:\n"
|
"CheatDisabled:\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
:: [orgFindPlayerVehicle] "m" (orgFindPlayerVehicle),
|
:: [orgFindPlayerVehicle] "m" (orgFindPlayerVehicle),
|
||||||
[bAllDodosCheat] "m" (bAllDodosCheat)
|
[bAllDodosCheat] "m" (bAllDodosCheat)
|
||||||
);
|
);
|
||||||
|
@ -969,7 +969,7 @@ namespace GenerateNewPickup_ReuseObjectFix
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
_asm
|
_asm
|
||||||
{
|
{
|
||||||
mov eax, [pPickupObject]
|
mov eax, pPickupObject
|
||||||
add eax, ebp
|
add eax, ebp
|
||||||
mov eax, [eax]
|
mov eax, [eax]
|
||||||
test eax, eax
|
test eax, eax
|
||||||
|
@ -978,7 +978,7 @@ namespace GenerateNewPickup_ReuseObjectFix
|
||||||
mov edi, eax
|
mov edi, eax
|
||||||
|
|
||||||
push edi
|
push edi
|
||||||
call [WorldRemove]
|
call offset WorldRemove
|
||||||
add esp, 4
|
add esp, 4
|
||||||
|
|
||||||
// Call dtor
|
// Call dtor
|
||||||
|
@ -990,12 +990,12 @@ namespace GenerateNewPickup_ReuseObjectFix
|
||||||
pop edi
|
pop edi
|
||||||
|
|
||||||
NoPickup:
|
NoPickup:
|
||||||
jmp [orgGiveUsAPickUpObject]
|
jmp orgGiveUsAPickUpObject
|
||||||
}
|
}
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
__asm__ volatile
|
__asm__ volatile
|
||||||
(
|
(
|
||||||
"mov eax, [%[pPickupObject]]\n"
|
"mov eax, %[pPickupObject]\n"
|
||||||
"add eax, ebp\n"
|
"add eax, ebp\n"
|
||||||
"mov eax, [eax]\n"
|
"mov eax, [eax]\n"
|
||||||
"test eax, eax\n"
|
"test eax, eax\n"
|
||||||
|
@ -1004,7 +1004,7 @@ namespace GenerateNewPickup_ReuseObjectFix
|
||||||
"mov edi, eax\n"
|
"mov edi, eax\n"
|
||||||
|
|
||||||
"push edi\n"
|
"push edi\n"
|
||||||
"call [%[WorldRemove]]\n"
|
"call offset %[WorldRemove]\n"
|
||||||
"add esp, 4\n"
|
"add esp, 4\n"
|
||||||
|
|
||||||
// Call dtor
|
// Call dtor
|
||||||
|
@ -1016,7 +1016,7 @@ namespace GenerateNewPickup_ReuseObjectFix
|
||||||
"pop edi\n"
|
"pop edi\n"
|
||||||
|
|
||||||
"NoPickup:\n"
|
"NoPickup:\n"
|
||||||
"jmp [%[orgGiveUsAPickUpObject]]\n"
|
"jmp %[orgGiveUsAPickUpObject]"
|
||||||
:: [pPickupObject] "m" (pPickupObject),
|
:: [pPickupObject] "m" (pPickupObject),
|
||||||
[WorldRemove] "m" (WorldRemove),
|
[WorldRemove] "m" (WorldRemove),
|
||||||
[orgGiveUsAPickUpObject] "m" (orgGiveUsAPickUpObject)
|
[orgGiveUsAPickUpObject] "m" (orgGiveUsAPickUpObject)
|
||||||
|
|
|
@ -2614,7 +2614,7 @@ namespace NewResolutionSelectionDialog
|
||||||
static bool ShouldSkipDeviceSelection()
|
static bool ShouldSkipDeviceSelection()
|
||||||
{
|
{
|
||||||
char cTmpPath[MAX_PATH];
|
char cTmpPath[MAX_PATH];
|
||||||
PathCombineA(cTmpPath, GetMyDocumentsPathSA(), SettingsFileName);
|
PathCombineA(cTmpPath, orgGetDocumentsPath(), SettingsFileName);
|
||||||
|
|
||||||
bool bSkip = false;
|
bool bSkip = false;
|
||||||
|
|
||||||
|
@ -2631,7 +2631,7 @@ namespace NewResolutionSelectionDialog
|
||||||
static void RememberDeviceSelection(bool bDoNotShowAgain)
|
static void RememberDeviceSelection(bool bDoNotShowAgain)
|
||||||
{
|
{
|
||||||
char cTmpPath[MAX_PATH];
|
char cTmpPath[MAX_PATH];
|
||||||
PathCombineA(cTmpPath, GetMyDocumentsPathSA(), SettingsFileName);
|
PathCombineA(cTmpPath, orgGetDocumentsPath(), SettingsFileName);
|
||||||
|
|
||||||
FILE* hFile = nullptr;
|
FILE* hFile = nullptr;
|
||||||
if (fopen_s(&hFile, cTmpPath, "w") == 0)
|
if (fopen_s(&hFile, cTmpPath, "w") == 0)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define _USE_MATH_DEFINES
|
|
||||||
#include <rwcore.h>
|
#include <rwcore.h>
|
||||||
#include <rpworld.h>
|
#include <rpworld.h>
|
||||||
|
|
||||||
|
|
|
@ -695,7 +695,7 @@ void __declspec(naked) SubtitlesShadowFix()
|
||||||
"lea eax, [esp+0x24-0x14]\n"
|
"lea eax, [esp+0x24-0x14]\n"
|
||||||
"push eax\n"
|
"push eax\n"
|
||||||
"call %[Recalculate]\n"
|
"call %[Recalculate]\n"
|
||||||
"jmp %[SubtitlesShadowFix_JumpBack]\n"
|
"jmp %[SubtitlesShadowFix_JumpBack]"
|
||||||
:: [Recalculate] "i" (Recalculate),
|
:: [Recalculate] "i" (Recalculate),
|
||||||
[SubtitlesShadowFix_JumpBack] "m" (SubtitlesShadowFix_JumpBack)
|
[SubtitlesShadowFix_JumpBack] "m" (SubtitlesShadowFix_JumpBack)
|
||||||
);
|
);
|
||||||
|
@ -724,7 +724,7 @@ void __declspec(naked) CreateInstance_BikeFix()
|
||||||
"push eax\n"
|
"push eax\n"
|
||||||
"mov ecx, ebp\n"
|
"mov ecx, ebp\n"
|
||||||
"call %[CVehicleModelInfo_GetExtrasFrame]\n"
|
"call %[CVehicleModelInfo_GetExtrasFrame]\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
:: [CVehicleModelInfo_GetExtrasFrame] "i" (CVehicleModelInfo_GetExtrasFrame)
|
:: [CVehicleModelInfo_GetExtrasFrame] "i" (CVehicleModelInfo_GetExtrasFrame)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
@ -793,7 +793,7 @@ void __declspec(naked) AutoPilotTimerFix_VC()
|
||||||
"add esp, 0x30\n"
|
"add esp, 0x30\n"
|
||||||
"pop ebp\n"
|
"pop ebp\n"
|
||||||
"pop ebx\n"
|
"pop ebx\n"
|
||||||
"ret 4\n"
|
"ret 4"
|
||||||
:: [AutoPilotTimerCalculation_VC] "i" (AutoPilotTimerCalculation_VC)
|
:: [AutoPilotTimerCalculation_VC] "i" (AutoPilotTimerCalculation_VC)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
@ -949,7 +949,7 @@ namespace SirenSwitchingFix
|
||||||
|
|
||||||
"IsFBIRanchOrFBICar_HighPitchSiren:\n"
|
"IsFBIRanchOrFBICar_HighPitchSiren:\n"
|
||||||
"xor al, al\n"
|
"xor al, al\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1046,7 +1046,7 @@ namespace RemoveDriverStatusFix
|
||||||
"or al, 0x20\n"
|
"or al, 0x20\n"
|
||||||
|
|
||||||
"DontSetStatus:\n"
|
"DontSetStatus:\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1126,14 +1126,14 @@ namespace NullTerminatedLines
|
||||||
{
|
{
|
||||||
mov eax, [esp+4]
|
mov eax, [esp+4]
|
||||||
mov byte ptr [eax+ecx], 0
|
mov byte ptr [eax+ecx], 0
|
||||||
jmp [orgSscanf_LoadPath]
|
jmp orgSscanf_LoadPath
|
||||||
}
|
}
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
__asm__ volatile
|
__asm__ volatile
|
||||||
(
|
(
|
||||||
"mov eax, [esp+4]\n"
|
"mov eax, [esp+4]\n"
|
||||||
"mov byte ptr [eax+ecx], 0\n"
|
"mov byte ptr [eax+ecx], 0\n"
|
||||||
"jmp [%[orgSscanf_LoadPath]]\n"
|
"jmp %[orgSscanf_LoadPath]"
|
||||||
:: [orgSscanf_LoadPath] "m" (orgSscanf_LoadPath)
|
:: [orgSscanf_LoadPath] "m" (orgSscanf_LoadPath)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1173,7 +1173,7 @@ namespace PickupEffectsFixes
|
||||||
(
|
(
|
||||||
"mov byte ptr [esp+0x184-0x170], 0\n"
|
"mov byte ptr [esp+0x184-0x170], 0\n"
|
||||||
"mov dword ptr [esp+0x184-0x174], 37\n"
|
"mov dword ptr [esp+0x184-0x174], 37\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1210,7 +1210,7 @@ namespace PickupEffectsFixes
|
||||||
|
|
||||||
"Return:\n"
|
"Return:\n"
|
||||||
"mov ebx, ecx\n"
|
"mov ebx, ecx\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1234,11 +1234,11 @@ namespace IsPlayerTargettingCharFix
|
||||||
{
|
{
|
||||||
test bl, bl
|
test bl, bl
|
||||||
jnz ReturnToUpdateCompareFlag
|
jnz ReturnToUpdateCompareFlag
|
||||||
mov eax, [bUseMouse3rdPerson]
|
mov eax, bUseMouse3rdPerson
|
||||||
cmp byte ptr [eax], 0
|
cmp byte ptr [eax], 0
|
||||||
jne CmpAndReturn
|
jne CmpAndReturn
|
||||||
mov ecx, [TheCamera]
|
mov ecx, TheCamera
|
||||||
call [Using1stPersonWeaponMode]
|
call Using1stPersonWeaponMode
|
||||||
test al, al
|
test al, al
|
||||||
jz ReturnToUpdateCompareFlag
|
jz ReturnToUpdateCompareFlag
|
||||||
|
|
||||||
|
@ -1255,11 +1255,11 @@ namespace IsPlayerTargettingCharFix
|
||||||
(
|
(
|
||||||
"test bl, bl\n"
|
"test bl, bl\n"
|
||||||
"jnz ReturnToUpdateCompareFlag\n"
|
"jnz ReturnToUpdateCompareFlag\n"
|
||||||
"mov eax, [%[bUseMouse3rdPerson]]\n"
|
"mov eax, %[bUseMouse3rdPerson]\n"
|
||||||
"cmp byte ptr [eax], 0\n"
|
"cmp byte ptr [eax], 0\n"
|
||||||
"jne CmpAndReturn\n"
|
"jne CmpAndReturn\n"
|
||||||
"mov ecx, [%[TheCamera]]\n"
|
"mov ecx, %[TheCamera]\n"
|
||||||
"call [%[Using1stPersonWeaponMode]]\n"
|
"call %[Using1stPersonWeaponMode]\n"
|
||||||
"test al, al\n"
|
"test al, al\n"
|
||||||
"jz ReturnToUpdateCompareFlag\n"
|
"jz ReturnToUpdateCompareFlag\n"
|
||||||
|
|
||||||
|
@ -1269,7 +1269,7 @@ namespace IsPlayerTargettingCharFix
|
||||||
|
|
||||||
"ReturnToUpdateCompareFlag:\n"
|
"ReturnToUpdateCompareFlag:\n"
|
||||||
"xor al, al\n"
|
"xor al, al\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
:: [bUseMouse3rdPerson] "m" (bUseMouse3rdPerson),
|
:: [bUseMouse3rdPerson] "m" (bUseMouse3rdPerson),
|
||||||
[TheCamera] "m" (TheCamera),
|
[TheCamera] "m" (TheCamera),
|
||||||
[Using1stPersonWeaponMode] "m" (Using1stPersonWeaponMode)
|
[Using1stPersonWeaponMode] "m" (Using1stPersonWeaponMode)
|
||||||
|
@ -1366,7 +1366,7 @@ namespace SelectableBackfaceCulling
|
||||||
push ebx
|
push ebx
|
||||||
mov ebx, ecx
|
mov ebx, ecx
|
||||||
cmp dword ptr [ebx+0x4C], 0
|
cmp dword ptr [ebx+0x4C], 0
|
||||||
jmp [EntityRender_Prologue_JumpBack]
|
jmp EntityRender_Prologue_JumpBack
|
||||||
}
|
}
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
__asm__ volatile
|
__asm__ volatile
|
||||||
|
@ -1374,7 +1374,7 @@ namespace SelectableBackfaceCulling
|
||||||
"push ebx\n"
|
"push ebx\n"
|
||||||
"mov ebx, ecx\n"
|
"mov ebx, ecx\n"
|
||||||
"cmp dword ptr [ebx+0x4C], 0\n"
|
"cmp dword ptr [ebx+0x4C], 0\n"
|
||||||
"jmp [%[EntityRender_Prologue_JumpBack]]\n"
|
"jmp %[EntityRender_Prologue_JumpBack]"
|
||||||
:: [EntityRender_Prologue_JumpBack] "m" (EntityRender_Prologue_JumpBack)
|
:: [EntityRender_Prologue_JumpBack] "m" (EntityRender_Prologue_JumpBack)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1569,7 +1569,7 @@ namespace TommyFistShakeWithWeapons
|
||||||
"call %[WeaponProhibitsFistShake]\n"
|
"call %[WeaponProhibitsFistShake]\n"
|
||||||
"add esp, 4\n"
|
"add esp, 4\n"
|
||||||
"test al, al\n"
|
"test al, al\n"
|
||||||
"ret\n"
|
"ret"
|
||||||
:: [WeaponProhibitsFistShake] "i" (WeaponProhibitsFistShake)
|
:: [WeaponProhibitsFistShake] "i" (WeaponProhibitsFistShake)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue