Merge pull request #20 from Boomslangnz/master
Fixed issue where Pokken Controls didn't work
This commit is contained in:
commit
4e9e9f8613
@ -3,6 +3,10 @@
|
|||||||
#include "Utility/InitFunction.h"
|
#include "Utility/InitFunction.h"
|
||||||
#include "Functions/Global.h"
|
#include "Functions/Global.h"
|
||||||
|
|
||||||
|
typedef unsigned char U8;
|
||||||
|
typedef unsigned int U32;
|
||||||
|
typedef uint16_t U16;
|
||||||
|
|
||||||
extern LPCSTR hookPort;
|
extern LPCSTR hookPort;
|
||||||
static InitFunction MachStormFunc([]()
|
static InitFunction MachStormFunc([]()
|
||||||
{
|
{
|
||||||
@ -18,6 +22,44 @@ static InitFunction MachStormFunc([]()
|
|||||||
// Patch test menu etc
|
// Patch test menu etc
|
||||||
injector::WriteMemoryRaw(imageBase + 0x544BB0, (char*)".\\%c%s.dat", 12, true);
|
injector::WriteMemoryRaw(imageBase + 0x544BB0, (char*)".\\%c%s.dat", 12, true);
|
||||||
|
|
||||||
|
if (ToBool(config["General"]["Dome Hack"]))
|
||||||
|
{
|
||||||
|
U16 *buffer = new U16[1920 * 1080 * 2];
|
||||||
|
|
||||||
|
for (int y = 0; y < 1080; y++)
|
||||||
|
{
|
||||||
|
for (int x = 0; x < 1920; x++)
|
||||||
|
{
|
||||||
|
float d = 0.5f;
|
||||||
|
float xf = x / 1920.0f;
|
||||||
|
float yf = y / 1080.0f;
|
||||||
|
xf = 2.0f * xf - 1.0f;
|
||||||
|
yf = 2.0f * yf - 1.0f;
|
||||||
|
if (0.0f > xf)
|
||||||
|
{
|
||||||
|
float k = 0.95f * -xf / (-xf + d);
|
||||||
|
xf = -k;
|
||||||
|
yf = yf * (1.0f - k);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
float k = 0.95f * xf / (xf + d);
|
||||||
|
xf = k;
|
||||||
|
yf = yf * (1.0f - k);
|
||||||
|
}
|
||||||
|
xf = 0.5f * xf + 0.5f;
|
||||||
|
yf = -0.5f * yf - 0.5f;
|
||||||
|
buffer[(y * 1920 + x) * 2] = 65535 * xf;
|
||||||
|
buffer[(y * 1920 + x) * 2 + 1] = 65535 * yf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
injector::WriteMemory<U8>(imageBase + 0x003D2FEE, 0x45, true);
|
||||||
|
injector::WriteMemory<U8>(imageBase + 0x003D3637, 0xB8, true);
|
||||||
|
injector::WriteMemory<U32>(imageBase + 0x003D3638, (U32)buffer, true);
|
||||||
|
injector::WriteMemory<U32>(imageBase + 0x003D363C, 0x0C244489, true);
|
||||||
|
}
|
||||||
|
|
||||||
hookPort = "COM3";
|
hookPort = "COM3";
|
||||||
}, GameID::MachStorm);
|
}, GameID::MachStorm);
|
||||||
#endif
|
#endif
|
@ -73,7 +73,7 @@ DWORD WINAPI XInputGetState
|
|||||||
{
|
{
|
||||||
XINPUT_GAMEPAD gamepadState = { 0 };
|
XINPUT_GAMEPAD gamepadState = { 0 };
|
||||||
|
|
||||||
if (GameDetect::currentGame == GameID::Daytona3)
|
if (GameDetect::currentGame == GameID::Daytona3 || GameDetect::currentGame == GameID::PokkenTournament)
|
||||||
gamepadState.wButtons |= *ffbOffset;
|
gamepadState.wButtons |= *ffbOffset;
|
||||||
else
|
else
|
||||||
gamepadState.wButtons |= 0;
|
gamepadState.wButtons |= 0;
|
||||||
@ -280,7 +280,7 @@ DWORD WINAPI XInputGetStateEx
|
|||||||
{
|
{
|
||||||
XINPUT_GAMEPAD gamepadState = { 0 };
|
XINPUT_GAMEPAD gamepadState = { 0 };
|
||||||
|
|
||||||
if (GameDetect::currentGame == GameID::Daytona3)
|
if (GameDetect::currentGame == GameID::Daytona3 || GameDetect::currentGame == GameID::PokkenTournament)
|
||||||
gamepadState.wButtons = *ffbOffset;
|
gamepadState.wButtons = *ffbOffset;
|
||||||
else
|
else
|
||||||
gamepadState.wButtons = 0;
|
gamepadState.wButtons = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user