RsMouseSetPos call for III

This commit is contained in:
Silent 2014-09-14 17:12:28 +02:00
parent 1a5e22d7a5
commit ee0adecc4b
2 changed files with 24 additions and 0 deletions

View File

@ -17,6 +17,11 @@ struct RsGlobalType
void* pad; void* pad;
}; };
struct RwV2d
{
float x; /**< X value*/
float y; /**< Y value */
};
static void (*DrawRect)(const CRect&,const CRGBA&); static void (*DrawRect)(const CRect&,const CRGBA&);
@ -65,6 +70,15 @@ void PurpleNinesGlitchFix()
pGangModelOverrides[i * 16] = -1; pGangModelOverrides[i * 16] = -1;
} }
static void (* const ConstructRenderList)() = AddressByVersion<void(*)()>(0x4A76B0, 0x4A77A0, 0x4A7730);
static void (* const RsMouseSetPos)(RwV2d*) = AddressByVersion<void(*)(RwV2d*)>(0x580D20, 0x581070, 0x580F70);
void ResetMousePos()
{
RwV2d vecPos = { RsGlobal->MaximumWidth * 0.5f, RsGlobal->MaximumHeight * 0.5f };
RsMouseSetPos(&vecPos);
ConstructRenderList();
}
void __declspec(naked) M16StatsFix() void __declspec(naked) M16StatsFix()
{ {
_asm _asm
@ -257,6 +271,9 @@ void Patch_III_10()
InjectHook(0x50A142, AlteredPrintStringXOnly<0x50A139>); InjectHook(0x50A142, AlteredPrintStringXOnly<0x50A139>);
InjectHook(0x57E9F5, AlteredPrintString<0x57E9EE,0x57E9CD>); InjectHook(0x57E9F5, AlteredPrintString<0x57E9EE,0x57E9CD>);
// RsMouseSetPos call (SA style fix)
InjectHook(0x48E539, ResetMousePos);
// Armour cheat as TORTOISE - like in 1.1 and Steam // Armour cheat as TORTOISE - like in 1.1 and Steam
Patch<const char*>(0x4925FB, "ESIOTROT"); Patch<const char*>(0x4925FB, "ESIOTROT");
@ -366,6 +383,9 @@ void Patch_III_11()
InjectHook(0x509B45, AlteredPrintStringMinus<0x509B3E,0x509B1D>); InjectHook(0x509B45, AlteredPrintStringMinus<0x509B3E,0x509B1D>);
InjectHook(0x50A222, AlteredPrintStringXOnly<0x50A219>); InjectHook(0x50A222, AlteredPrintStringXOnly<0x50A219>);
InjectHook(0x57ED45, AlteredPrintString<0x57ED3E,0x57ED1D>); InjectHook(0x57ED45, AlteredPrintString<0x57ED3E,0x57ED1D>);
// RsMouseSetPos call (SA style fix)
InjectHook(0x48E5F9, ResetMousePos);
} }
void Patch_III_Steam() void Patch_III_Steam()
@ -466,6 +486,9 @@ void Patch_III_Steam()
InjectHook(0x509AD5, AlteredPrintStringMinus<0x509ACE,0x509AAD>); InjectHook(0x509AD5, AlteredPrintStringMinus<0x509ACE,0x509AAD>);
InjectHook(0x50A1B2, AlteredPrintStringXOnly<0x50A1A9>); InjectHook(0x50A1B2, AlteredPrintStringXOnly<0x50A1A9>);
InjectHook(0x57EC45, AlteredPrintString<0x57EC3E,0x57EC1D>); InjectHook(0x57EC45, AlteredPrintString<0x57EC3E,0x57EC1D>);
// RsMouseSetPos call (SA style fix)
InjectHook(0x48E589, ResetMousePos);
} }
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)

View File

@ -13,6 +13,7 @@
#include <windows.h> #include <windows.h>
#include <mmsystem.h> #include <mmsystem.h>
#include <cassert>
#include "MemoryMgr.h" #include "MemoryMgr.h"