Refactor version checking in III/VC to new method

This commit is contained in:
Silent 2018-01-14 12:04:22 +01:00
parent 883b0dde94
commit 2d1c7f97e6
2 changed files with 8 additions and 6 deletions

View File

@ -858,9 +858,10 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
std::unique_ptr<ScopedUnprotect::Unprotect> Protect = ScopedUnprotect::UnprotectSectionOrFullModule( GetModuleHandle( nullptr ), ".text" );
if (*(DWORD*)0x5C1E75 == 0xB85548EC) Patch_III_10(desktop);
else if (*(DWORD*)0x5C2135 == 0xB85548EC) Patch_III_11(desktop);
else if (*(DWORD*)0x5C6FD5 == 0xB85548EC) Patch_III_Steam(desktop);
const int8_t version = Memory::GetVersion().version;
if ( version == 0 ) Patch_III_10(desktop);
else if ( version == 1 ) Patch_III_11(desktop);
else if ( version == 2 ) Patch_III_Steam(desktop);
Patch_III_Common();
Common::Patches::III_VC_Common();

View File

@ -671,9 +671,10 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
std::unique_ptr<ScopedUnprotect::Unprotect> Protect = ScopedUnprotect::UnprotectSectionOrFullModule( GetModuleHandle( nullptr ), ".text" );
if(*(DWORD*)0x667BF5 == 0xB85548EC) Patch_VC_10(desktop);
else if(*(DWORD*)0x667C45 == 0xB85548EC) Patch_VC_11(desktop);
else if (*(DWORD*)0x666BA5 == 0xB85548EC) Patch_VC_Steam(desktop);
const int8_t version = Memory::GetVersion().version;
if ( version == 0 ) Patch_VC_10(desktop);
else if ( version == 1 ) Patch_VC_11(desktop);
else if ( version == 2 ) Patch_VC_Steam(desktop);
// Y axis sensitivity only
else if (*(DWORD*)0x601048 == 0x5E5F5D60) Patch_VC_JP();