1
0
mirror of synced 2024-11-14 23:07:36 +01:00

- WMMT5DX+ Support thanks to doomertheboomer

This commit is contained in:
nzgamer41 2021-08-25 21:05:20 +12:00
parent 3caa6df704
commit 4567de4d2a
6 changed files with 1489 additions and 15 deletions

View File

@ -802,14 +802,6 @@ static int LoadGameData()
return 1;
}
BOOL FileExists(char *szPath)
{
DWORD dwAttrib = GetFileAttributesA(szPath);
return (dwAttrib != INVALID_FILE_ATTRIBUTES &&
!(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
}
static void LoadWmmt5CarData()
{
if (!loadOk)

File diff suppressed because it is too large Load Diff

View File

@ -450,12 +450,6 @@ void GameDetect::DetectCurrentGame()
SetGameId(GameID::WMMT5, "WMMT5");
break;
}
// PATCHES 10-21
if (*(uint32_t*)(moduleBase + 0x2F00) == 0x084AFF48)
{
SetGameId(GameID::WMMT5, "WMMT5");
break;
}
#endif
// Craft CRC detection without virtual address
memcpy(newCrc, GetModuleHandle(nullptr), 0x400);
@ -482,6 +476,19 @@ void GameDetect::DetectCurrentGame()
break;
}
// PATCHES 10-21 & 5DX+
if (*(uint32_t*)(moduleBase + 0x2F00) == 0x084AFF48)
{
if (newCrcResult == 0x1BB6F051)
{
SetGameId(GameID::WMMT5DXPlus, "WMMT5DX+");
}
else {
SetGameId(GameID::WMMT5, "WMMT5 Update 10-21");
}
break;
}
}
#endif
switch (newCrcResult)

View File

@ -111,5 +111,6 @@ enum class GameID
Doa6FM12,
Doa6FM13,
Doa6FM14,
Doa6Test
Doa6Test,
WMMT5DXPlus
};

View File

@ -45,6 +45,14 @@ int Compare(const std::string& str1, const std::string& str2, bool case_sensitiv
return (str1.length() < str2.length() ? -1 : 1);
}
BOOL FileExists(char* szPath)
{
DWORD dwAttrib = GetFileAttributesA(szPath);
return (dwAttrib != INVALID_FILE_ATTRIBUTES &&
!(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
}
bool ToBool(const std::string& s)
{
if (s.empty())

View File

@ -20,6 +20,8 @@ inline void safeJMP(injector::memory_pointer_tr at, injector::memory_pointer_raw
}
}
BOOL FileExists(char* szPath);
uint32_t GetCRC32(const void* pData, int length);
DWORD crc32buf(unsigned char *buf, size_t len);