1
0
mirror of synced 2024-11-14 18:38:05 +01:00
FFBArcadePlugin/Common Files/TeknoParrotGame.cpp

84 lines
2.0 KiB
C++
Raw Normal View History

2019-11-01 21:34:57 +01:00
#include "TeknoParrotGame.h"
static wchar_t* settingsFilename = TEXT(".\\FFBPlugin.ini");
static int configGameId = GetPrivateProfileInt(TEXT("Settings"), TEXT("GameId"), 0, settingsFilename);
2019-11-01 21:34:57 +01:00
TeknoParrotGame::TeknoParrotGame()
{
2021-04-17 00:31:12 +02:00
secData = 0;
2019-11-01 21:34:57 +01:00
hSection = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, 64, L"TeknoParrot_JvsState");
2021-04-17 00:31:12 +02:00
if (hSection)
2019-11-01 21:34:57 +01:00
secData = MapViewOfFile(hSection, FILE_MAP_ALL_ACCESS, 0, 0, 64);
2021-04-17 00:31:12 +02:00
if (secData)
{
2021-04-17 00:31:12 +02:00
if (*((int*)secData + 2) > 0)
*((int*)secData + 2) = 0;
if (*((int*)secData + 6) > 0)
*((int*)secData + 6) = 0;
if (*((int*)secData + 7) > 0)
*((int*)secData + 7) = 0;
if (*((int*)secData + 8) > 0)
*((int*)secData + 8) = 0;
2022-06-08 07:06:23 +02:00
if (*((int*)secData + 9) > 0)
*((int*)secData + 9) = 0;
if (configGameId == 61)
{
ffbOffset = *((int*)secData + 6);
ffbOffset2 = *((int*)secData + 7);
ffbOffset3 = *((int*)secData + 8);
ffbOffset4 = *((int*)secData + 9);
}
else if (configGameId == 54 || configGameId == 55)
2021-04-17 00:31:12 +02:00
{
ffbOffset = *((int*)secData + 6);
ffbOffset2 = *((int*)secData + 7);
ffbOffset3 = *((int*)secData + 8);
}
else if (configGameId == 19)
{
ffbOffset = *((int*)secData + 6);
ffbOffset2 = *((int*)secData + 7);
}
2022-06-08 07:06:23 +02:00
else if (configGameId == 62)
ffbOffset = *((int*)secData + 6);
2021-04-17 00:31:12 +02:00
else
ffbOffset = *((int*)secData + 2);
}
2019-11-01 21:34:57 +01:00
}
int TeknoParrotGame::GetTeknoParrotFFB()
{
2022-06-08 07:06:23 +02:00
if (configGameId == 19 || configGameId == 54 || configGameId == 55 || configGameId == 61 || configGameId == 62)
ffbOffset = *((int*)secData + 6);
else
ffbOffset = *((int*)secData + 2);
2019-11-01 21:34:57 +01:00
return ffbOffset;
}
int TeknoParrotGame::GetTeknoParrotFFB2()
{
ffbOffset2 = *((int*)secData + 7);
return ffbOffset2;
}
2021-04-17 00:31:12 +02:00
int TeknoParrotGame::GetTeknoParrotFFB3()
{
ffbOffset3 = *((int*)secData + 8);
return ffbOffset3;
}
2022-06-08 07:06:23 +02:00
int TeknoParrotGame::GetTeknoParrotFFB4()
{
ffbOffset4 = *((int*)secData + 9);
return ffbOffset4;
}
2019-11-01 21:34:57 +01:00
void TeknoParrotGame::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers) {
helpers->log("TeknoParrot game not implemented");
}