- Pokken Tournament: Added support for final version.

This commit is contained in:
Harm committed 2021-06-19 18:41:34 +02:00
1 parent 291b662343
commit 555629c3ef
6 files changed
+78 -20

No files matched your search

@@ -46,10 +46,54 @@ static HWND WINAPI CreateWindowExWHook(DWORD dwExStyle, LPCWSTR lpClassName, LPC
return CreateWindowExW(dwExStyle, lpClassName, lpWindowName, windowStyle, centeredX, centeredY, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
}
enum class INIT_STATE : int32_t
{
CHECKING = 0,
OK = 1,
NG = 2,
NOT_CHECKED = 3,
OFFLINE = 4,
DASH = 5
};
class InitData
{
public:
uint64_t StateFunctionCurrent; //0x0000
uint64_t StateFunctionNext; //0x0008
uint32_t StateFunctionRV; //0x0010
INIT_STATE StateSN; //0x0014
INIT_STATE StateIO; //0x0018
INIT_STATE StateBackupMemory; //0x001C
INIT_STATE StateCardReader; //0x0020
INIT_STATE StateUsbController; //0x0024
INIT_STATE StateLocalNetwork; //0x0028
INIT_STATE StateAllNet; //0x002C
INIT_STATE StateGameServer; //0x0030
INIT_STATE StateMatchingServer; //0x0034
INIT_STATE StateVersion; //0x0038
INIT_STATE StateClock; //0x003C
uint32_t Timer1; //0x0040
uint32_t Timer2; //0x0044
bool Done; //0x0048
char SerialNumber[13]; //0x0049
}; //Size: 0x0056
static uintptr_t imageBase;
static __int64 __fastcall StateFunctionSN(InitData* a1)
{
a1->StateSN = INIT_STATE::OK;
sprintf(a1->SerialNumber, "TEKNOPARROT");
a1->StateFunctionNext = imageBase + 0x5902E0;
return 1;
}
static InitFunction PokkenFunc([]()
{
hookPort = "COM3";
uintptr_t imageBase = (uintptr_t)GetModuleHandleA(0);
imageBase = (uintptr_t)GetModuleHandleA(0);
// force windowed
// BE 01 00 00 00 8B CE -0x8 // ok 00-24
@@ -124,4 +168,10 @@ static InitFunction PokkenFunc([]()
}
}
}, GameID::PokkenTournament);
static InitFunction PokkenFunc26([]()
{
InitFunction::RunFunctions(GameID::PokkenTournament);
safeJMP(imageBase + 0x590320, StateFunctionSN);
}, GameID::PokkenTournament26);
#endif
@@ -376,7 +376,7 @@ HRESULT __stdcall Hook_DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFI
static InitFunction initFunc([]()
{
if (GameDetect::currentGame == GameID::PokkenTournament || GameDetect::currentGame == GameID::FNFDrift || GameDetect::currentGame == GameID::FNFSC || GameDetect::currentGame == GameID::FNF || GameDetect::currentGame == GameID::FNFSB || GameDetect::currentGame == GameID::FNFSB2 || GameDetect::currentGame == GameID::JLeague)
if (GameDetect::currentGame == GameID::PokkenTournament || GameDetect::currentGame == GameID::PokkenTournament26 || GameDetect::currentGame == GameID::FNFDrift || GameDetect::currentGame == GameID::FNFSC || GameDetect::currentGame == GameID::FNF || GameDetect::currentGame == GameID::FNFSB || GameDetect::currentGame == GameID::FNFSB2 || GameDetect::currentGame == GameID::JLeague)
return;
MH_Initialize();
+2 -1
View File
@@ -241,8 +241,9 @@ extern linb::ini config;
static InitFunction initFunc([]()
{
if (GameDetect::currentGame == GameID::PokkenTournament || GameDetect::currentGame == GameID::SchoolOfRagnarok || GameDetect::currentGame == GameID::TER || GameDetect::currentGame == GameID::Tekken7Update00)
if (GameDetect::currentGame == GameID::PokkenTournament || GameDetect::currentGame == GameID::PokkenTournament26 || GameDetect::currentGame == GameID::SchoolOfRagnarok || GameDetect::currentGame == GameID::TER || GameDetect::currentGame == GameID::Tekken7Update00)
return;
if (ToBool(config["General"]["Windowed"]))
{
InitDXGIWindowHook();
+3 -3
View File
@@ -81,7 +81,7 @@ DWORD WINAPI XInputGetState
}
if (controllerInit && dwUserIndex == 0)
{
if (GameDetect::currentGame == GameID::Daytona3 || GameDetect::currentGame == GameID::PokkenTournament)
if (GameDetect::currentGame == GameID::Daytona3 || GameDetect::currentGame == GameID::PokkenTournament || GameDetect::currentGame == GameID::PokkenTournament26)
{
gamepadState.wButtons = *ffbOffset;
}
@@ -362,7 +362,7 @@ DWORD WINAPI XInputGetStateEx
{
XINPUT_GAMEPAD gamepadState = { 0 };
if (GameDetect::currentGame == GameID::Daytona3 || GameDetect::currentGame == GameID::PokkenTournament)
if (GameDetect::currentGame == GameID::Daytona3 || GameDetect::currentGame == GameID::PokkenTournament || GameDetect::currentGame == GameID::PokkenTournament26)
gamepadState.wButtons = *ffbOffset;
else
gamepadState.wButtons = 0;
@@ -419,7 +419,7 @@ LPCWSTR ptrToUse;
static InitFunction XInputHook([]()
{
if (GameDetect::currentGame == GameID::PokkenTournament || GameDetect::currentGame == GameID::SchoolOfRagnarok || GameDetect::currentGame == GameID::Daytona3 || GameDetect::currentGame == GameID::GHA || GameDetect::currentGame == GameID::JLeague)
if (GameDetect::currentGame == GameID::PokkenTournament || GameDetect::currentGame == GameID::PokkenTournament26 || GameDetect::currentGame == GameID::SchoolOfRagnarok || GameDetect::currentGame == GameID::Daytona3 || GameDetect::currentGame == GameID::GHA || GameDetect::currentGame == GameID::JLeague)
{
controllerInit = true;
+20 -14
View File
@@ -444,12 +444,6 @@ void GameDetect::DetectCurrentGame()
// currentGame = GameID::SchoolOfRagnarok;
// isNesica = true;
//}
// Update 08-26
if (*(uint32_t*)(moduleBase + 0x1C04) == 0x7401C3F6)
{
currentGame = GameID::PokkenTournament;
break;
}
// PATCHES 0-9
if (*(uint32_t*)(moduleBase + 0x2F00) == 0xFFCB8B48)
{
@@ -475,6 +469,18 @@ void GameDetect::DetectCurrentGame()
#endif
* (DWORD*)(newCrc + pePTR + 54) = 0x00000000;
uint32_t newCrcResult = GetCRC32(newCrc, 0x400);
// Pokken update 08-26
if (*(uint32_t*)(moduleBase + 0x1C04) == 0x7401C3F6)
{
if (newCrcResult == 0x4D4F1EBF)
currentGame = GameID::PokkenTournament26;
else
currentGame = GameID::PokkenTournament;
break;
}
switch (newCrcResult)
{
case 0xfe7afff4:
@@ -625,14 +631,14 @@ void GameDetect::DetectCurrentGame()
case 0xce9718fd:
currentGame = GameID::Tekken7Update00;
break;
case 0xc017f0be: // 00 doesn't work, broken dump?
case 0x17059cf3: // 01
case 0xe325036f: // 02
case 0x652fee7d: // 03
case 0x246b5f7e: // 04
case 0x94d16ccc: // 05
case 0x3cc1be43: // 06
case 0x247b6f8c: // 07
case 0xC017F0BE: // 00 doesn't work, broken dump?
case 0x17059CF3: // 01
case 0xE325036F: // 02
case 0x652FEE7D: // 03
case 0x246B5F7E: // 04
case 0x94D16CCC: // 05
case 0x3CC1BE43: // 06
case 0x247B6F8C: // 07
currentGame = GameID::PokkenTournament;
break;
#endif
+1
View File
@@ -40,6 +40,7 @@ enum class GameID
VirtuaRLimit,
SchoolOfRagnarok,
PokkenTournament,
PokkenTournament26,
ExBoardGeneric,
GrooveCoaster2,
PuzzleBobble,