Compare commits

..

2 commits

Author SHA1 Message Date
Echo J.
f53acc255b
Merge c6885c4d03 into 2a597da1bc 2024-11-29 11:27:52 +01:00
Echo J
c6885c4d03 SilentPatchVC: Add GCC-style inline assembly statements
This also includes a small wrapper to call a C++ function from GCC-style inline ASM

These statements almost work on llvm-mingw too (but there's some stubborn call instructions)
2024-11-29 12:20:52 +02:00

View file

@ -671,7 +671,7 @@ float FixedRefValue()
__declspec(naked) void SubtitlesShadowFix()
{
#ifdef _MSC_VER
#ifdef MSC_VER
_asm
{
mov [esp], eax
@ -710,7 +710,7 @@ RwFrame* __thiscall CVehicleModelInfo_GetExtrasFrame(CVehicleModelInfo* modelInf
__declspec(naked) void CreateInstance_BikeFix()
{
#ifdef _MSC_VER
#ifdef MSC_VER
_asm
{
push eax
@ -767,7 +767,7 @@ unsigned int __cdecl AutoPilotTimerCalculation_VC(unsigned int nTimer, int nScal
__declspec(naked) void AutoPilotTimerFix_VC()
{
#ifdef _MSC_VER
#ifdef MSC_VER
_asm
{
push dword ptr [esp + 0xC]
@ -917,7 +917,7 @@ namespace SirenSwitchingFix
{
__declspec(naked) static void IsFBIRanchOrFBICar()
{
#ifdef _MSC_VER
#ifdef MSC_VER
_asm
{
mov dword ptr [esi+0x1C], 0x1C
@ -1020,7 +1020,7 @@ namespace RemoveDriverStatusFix
{
// if (m_nStatus != STATUS_WRECKED)
// m_nStatus = STATUS_ABANDONED;
#ifdef _MSC_VER
#ifdef MSC_VER
_asm
{
mov cl, [ebx+0x50]
@ -1121,7 +1121,7 @@ namespace NullTerminatedLines
static void* orgSscanf_LoadPath;
__declspec(naked) static void sscanf1_LoadPath_Terminate()
{
#ifdef _MSC_VER
#ifdef MSC_VER
_asm
{
mov eax, [esp+4]
@ -1161,7 +1161,7 @@ namespace PickupEffectsFixes
{
__declspec(naked) static void PickUpEffects_BigDollarColor()
{
#ifdef _MSC_VER
#ifdef MSC_VER
_asm
{
mov byte ptr [esp+0x184-0x170], 0
@ -1180,7 +1180,7 @@ namespace PickupEffectsFixes
__declspec(naked) static void PickUpEffects_Minigun2Glow()
{
#ifdef _MSC_VER
#ifdef MSC_VER
_asm
{
cmp ecx, 294 // minigun2
@ -1229,7 +1229,7 @@ namespace IsPlayerTargettingCharFix
__declspec(naked) static void IsPlayerTargettingChar_ExtraChecks()
{
// After this extra block of code, there is a jz Return, so set ZF to 0 here if this path is to be entered
#ifdef _MSC_VER
#ifdef MSC_VER
_asm
{
test bl, bl
@ -1358,7 +1358,7 @@ namespace SelectableBackfaceCulling
static void* EntityRender_Prologue_JumpBack;
__declspec(naked) static void __fastcall EntityRender_Original(CEntity*)
{
#ifdef _MSC_VER
#ifdef MSC_VER
_asm
{
push ebx
@ -1551,7 +1551,7 @@ namespace TommyFistShakeWithWeapons
__declspec(naked) static void CheckWeaponGroupHook()
{
#ifdef _MSC_VER
#ifdef MSC_VER
_asm
{
push dword ptr [eax]