1
0
mirror of synced 2024-11-30 17:34:33 +01:00

add Showdown

This commit is contained in:
Boomslangnz 2023-08-26 18:07:18 +12:00
parent 7da2880658
commit ddd1d7c298
10 changed files with 152 additions and 1 deletions

View File

@ -114,6 +114,13 @@ DefaultCentering=15
EnableDamper=0 EnableDamper=0
DamperStrength=100 DamperStrength=100
[Showdown]
GameId=73
FeedbackLength=80
EnableDamper=0
DamperStrength=100
FFBOrRumble=0
[GRID Real] [GRID Real]
GameId=10 GameId=10
FeedbackLength=80 FeedbackLength=80

Binary file not shown.

Binary file not shown.

View File

@ -63,6 +63,7 @@
<ClInclude Include="Game Files\RoadFighters3D.h" /> <ClInclude Include="Game Files\RoadFighters3D.h" />
<ClInclude Include="Game Files\LGI.h" /> <ClInclude Include="Game Files\LGI.h" />
<ClInclude Include="Game Files\LGI3D.h" /> <ClInclude Include="Game Files\LGI3D.h" />
<ClInclude Include="Game Files\Showdown.h" />
<ClInclude Include="Game Files\StormRacerG.h" /> <ClInclude Include="Game Files\StormRacerG.h" />
<ClInclude Include="Game Files\SWDC2018.h" /> <ClInclude Include="Game Files\SWDC2018.h" />
<ClInclude Include="Game Files\TokyoCop.h" /> <ClInclude Include="Game Files\TokyoCop.h" />
@ -139,6 +140,7 @@
<ClCompile Include="Game Files\FordRacing.cpp" /> <ClCompile Include="Game Files\FordRacing.cpp" />
<ClCompile Include="Game Files\MarioKartGPDXCustom.cpp" /> <ClCompile Include="Game Files\MarioKartGPDXCustom.cpp" />
<ClCompile Include="Game Files\SegaRally3Other.cpp" /> <ClCompile Include="Game Files\SegaRally3Other.cpp" />
<ClCompile Include="Game Files\Showdown.cpp" />
<ClCompile Include="Game Files\SnoCross.cpp" /> <ClCompile Include="Game Files\SnoCross.cpp" />
<ClCompile Include="Game Files\SonicSegaAllStarsRacing.cpp" /> <ClCompile Include="Game Files\SonicSegaAllStarsRacing.cpp" />
<ClCompile Include="Game Files\StormRacerG.cpp" /> <ClCompile Include="Game Files\StormRacerG.cpp" />

View File

@ -157,6 +157,7 @@
<ClCompile Include="Game Files\MarioKartGPDXUSAReal.cpp" /> <ClCompile Include="Game Files\MarioKartGPDXUSAReal.cpp" />
<ClCompile Include="Game Files\GRIDCustom.cpp" /> <ClCompile Include="Game Files\GRIDCustom.cpp" />
<ClCompile Include="Game Files\MarioKartGPDX1.18Custom.cpp" /> <ClCompile Include="Game Files\MarioKartGPDX1.18Custom.cpp" />
<ClCompile Include="Game Files\Showdown.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="Game Files\Daytona3.h"> <ClInclude Include="Game Files\Daytona3.h">
@ -391,6 +392,9 @@
<ClInclude Include="Game Files\MarioKartGPDX1.18Custom.h"> <ClInclude Include="Game Files\MarioKartGPDX1.18Custom.h">
<Filter>Common Header Files</Filter> <Filter>Common Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Game Files\Showdown.h">
<Filter>Common Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MASM Include="DLLWrapper.asm" /> <MASM Include="DLLWrapper.asm" />

View File

@ -71,6 +71,7 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#include "Game Files/SegaRacingClassic.h" #include "Game Files/SegaRacingClassic.h"
#include "Game Files/SegaRally3.h" #include "Game Files/SegaRally3.h"
#include "Game Files/SegaRally3Other.h" #include "Game Files/SegaRally3Other.h"
#include "Game Files/Showdown.h"
#include "Game Files/SnoCross.h" #include "Game Files/SnoCross.h"
#include "Game Files/WackyRaces.h" #include "Game Files/WackyRaces.h"
#include "Game Files/WMMT3.h" #include "Game Files/WMMT3.h"
@ -1059,6 +1060,7 @@ const int MARIO_KART_GPDX_110_REAL = 69;
const int MARIO_KART_GPDX_USA_REAL = 70; const int MARIO_KART_GPDX_USA_REAL = 70;
const int GRID_Custom = 71; const int GRID_Custom = 71;
const int MARIO_KART_GPDX_118_CUSTOM = 72; const int MARIO_KART_GPDX_118_CUSTOM = 72;
const int SEGA_SHOWDOWN = 73;
HINSTANCE Get_hInstance() HINSTANCE Get_hInstance()
{ {
@ -2566,6 +2568,9 @@ DWORD WINAPI FFBLoop(LPVOID lpParam)
case GRID_Custom: case GRID_Custom:
game = new GRIDCustom; game = new GRIDCustom;
break; break;
case SEGA_SHOWDOWN:
game = new Showdown;
break;
case TEST_GAME_CONST: case TEST_GAME_CONST:
case TEST_GAME_FRICTION: case TEST_GAME_FRICTION:
case TEST_GAME_SINE: case TEST_GAME_SINE:

112
Game Files/Showdown.cpp Normal file
View File

@ -0,0 +1,112 @@
/*This file is part of FFB Arcade Plugin.
FFB Arcade Plugin is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FFB Arcade Plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
*/
#include <string>
#include "Showdown.h"
#include "SDL.h"
#include <Xinput.h>
static EffectTriggers* myTriggers;
static EffectConstants* myConstants;
static Helpers* myHelpers;
extern int EnableDamper;
extern int DamperStrength;
extern int FFBOrRumble;
static bool init;
static int(__stdcall* Out32Ori)(DWORD device, DWORD data);
static int __stdcall Out32Hook(DWORD device, DWORD data)
{
if (device == 0x378)
{
//static char test[256];
//memset(test, 0, 256);
//sprintf(test, "data: %d", data);
//OutputDebugStringA(test);
if (data > 15)
{
double percentForce = (31 - data) / 15.0;
double percentLength = 100;
myTriggers->Rumble(percentForce, 0, percentLength);
myTriggers->Constant(myConstants->DIRECTION_FROM_LEFT, percentForce);
}
else if (data > 0)
{
double percentForce = (16 - data) / 15.0;
double percentLength = 100;
myTriggers->Rumble(0, percentForce, percentLength);
myTriggers->Constant(myConstants->DIRECTION_FROM_RIGHT, percentForce);
}
}
return 0;
}
//static int(__fastcall* EnableFFBOri)(int a1, double a2);
//static int __fastcall EnableFFBHook(int a1, double a2)
//{
// EnableFFBOri(a1, a2);
//
// *(BYTE*)(a1 + 92) = 1; // FFB
//
// if (FFBOrRumble)
// *(BYTE*)(a1 + 12) = 1; // Rumble
//
// return 0;
//}
static int(__fastcall* EnableFFBOri)(float* a1, XINPUT_VIBRATION pVibration);
static int __fastcall EnableFFBHook(float* a1, XINPUT_VIBRATION pVibration)
{
static char test[256];
memset(test, 0, 256);
sprintf(test, "pVibration: %08X", a1[43]);
OutputDebugStringA(test);
return EnableFFBOri(a1, pVibration);
}
//
//
//static DWORD WINAPI XInputSetStateGRID(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration)
//{
// static char test[256];
// memset(test, 0, 256);
// sprintf(test, "pVibration: %08X %08X", pVibration->wLeftMotorSpeed, pVibration->wRightMotorSpeed);
// OutputDebugStringA(test);
// myTriggers->Rumble(pVibration->wLeftMotorSpeed / 65535.0, pVibration->wRightMotorSpeed / 65535.0, 100.0);
//
// return ERROR_SUCCESS;
//}
void Showdown::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
if (!init)
{
init = true;
DWORD ImageBase = (DWORD)GetModuleHandleA(0);
MH_Initialize();
//MH_CreateHook((void*)(ImageBase + 0x92E000), EnableFFBHook, (void**)&EnableFFBOri);
MH_CreateHookApi(L"inpout32.dll", "Out32", Out32Hook, (void**)&Out32Ori);
//if (FFBOrRumble)
// MH_CreateHookApi(L"xinput1_3.dll", "XInputSetState", &XInputSetStateGRID, NULL);
MH_EnableHook(MH_ALL_HOOKS);
}
myTriggers = triggers;
myConstants = constants;
myHelpers = helpers;
}

20
Game Files/Showdown.h Normal file
View File

@ -0,0 +1,20 @@
/*This file is part of FFB Arcade Plugin.
FFB Arcade Plugin is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FFB Arcade Plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
*/
#pragma once
#include "../Common Files/Game.h"
class Showdown : public Game {
public:
void FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers);
};

View File

@ -227,6 +227,7 @@ TEKNOPARROT:
-Sega Racing Classic -Sega Racing Classic
-Sega Rally 3 -Sega Rally 3
-Sega World Drivers Championship 2018 -Sega World Drivers Championship 2018
-Showdown
-SnoCross -SnoCross
-Sonic & Sega All Stars Racing -Sonic & Sega All Stars Racing
-Storm Racer G -Storm Racer G

View File

@ -1 +1 @@
v2.0.0.30 v2.0.0.31