1
0
mirror of synced 2024-11-23 22:40:57 +01:00

Added Batman

This commit is contained in:
Aaron M 2020-03-14 11:05:19 +13:00
parent 093073ca8c
commit e9fe5ded5e
7 changed files with 86 additions and 1 deletions

View File

@ -156,6 +156,10 @@ FeedbackLength=500
GameId=44
FeedbackLength=500
[Batman]
GameId=45
FeedbackLength=500
[Sega Racing Classic]
GameId=5
FeedbackLength=500

View File

@ -20,6 +20,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="Game Files\AliensExtermination.h" />
<ClInclude Include="Game Files\Batman.h" />
<ClInclude Include="Game Files\DirtyDrivin.h" />
<ClInclude Include="Game Files\FordRacingOther.h" />
<ClInclude Include="Game Files\GoldenGun.h" />
@ -52,6 +53,7 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="Game Files\AliensExtermination.cpp" />
<ClCompile Include="Game Files\Batman.cpp" />
<ClCompile Include="Game Files\DirtyDrivin.cpp" />
<ClCompile Include="Game Files\FordRacingOther.cpp" />
<ClCompile Include="Game Files\GoldenGun.cpp" />

View File

@ -123,6 +123,7 @@
<ClCompile Include="Game Files\DirtyDrivin.cpp" />
<ClCompile Include="Game Files\H2Overdrive.cpp" />
<ClCompile Include="Game Files\SnoCross.cpp" />
<ClCompile Include="Game Files\Batman.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Game Files\Daytona3.h">
@ -267,6 +268,9 @@
<ClInclude Include="Game Files\SnoCross.h">
<Filter>Common Header Files</Filter>
</ClInclude>
<ClInclude Include="Game Files\Batman.h">
<Filter>Common Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<MASM Include="DLLWrapper.asm" />

View File

@ -29,6 +29,8 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
// include all game header files here.
#include "Game Files/TestGame.h"
#include "Game Files/AliensExtermination.h"
#include "Game Files/Batman.h"
#include "Game Files/BG4JP.h"
#include "Game Files/ChaseHQ2.h"
#include "Game Files/Daytona3.h"
#include "Game Files/DirtyDrivin.h"
@ -53,7 +55,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#include "Game Files/OldMame.h"
#include "Game Files/WackyRaces.h"
#include "Game Files/WMMT5.h"
#include "Game Files/BG4JP.h"
#include "Game Files/Machstorm.h"
#include "Game Files/AfterburnerClimax.h"
#include "Game Files/PokkenTournament.h"
@ -959,6 +960,7 @@ const int Golden_Gun = 41;
const int Dirty_Drivin = 42;
const int H2_Overdrive = 43;
const int Sno_Cross = 44;
const int Bat_man = 45;
HINSTANCE Get_hInstance()
{
@ -2092,6 +2094,9 @@ DWORD WINAPI FFBLoop(LPVOID lpParam)
case Sno_Cross:
game = new SnoCross;
break;
case Bat_man:
game = new Batman;
break;
case TEST_GAME_CONST:
case TEST_GAME_FRICTION:
case TEST_GAME_SINE:

39
Game Files/Batman.cpp Normal file
View File

@ -0,0 +1,39 @@
/*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 "Batman.h"
void Batman::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
float ff = helpers->ReadFloat32(0x7EF524, true);
helpers->log("got value: ");
std::string ffs = std::to_string(ff);
helpers->log((char*)ffs.c_str());
if (ff > 0)
{
double percentForce = ff / 1.2;
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
}
else if (ff < 0)
{
double percentForce = -ff / 1.2;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
}

20
Game Files/Batman.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 Batman : public Game {
public:
void FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers);
};

View File

@ -22,8 +22,10 @@ static int DaytonaAIMultiplayerHack = GetPrivateProfileInt(TEXT("Settings"), TEX
static int DaytonaForcePanoramicAttract = GetPrivateProfileInt(TEXT("Settings"), TEXT("DaytonaForcePanoramicAttract"), 0, settingsFilename);
static int EnableForceSpringEffect = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableForceSpringEffect"), 0, settingsFilename);
static int ForceSpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrength"), 0, settingsFilename);
static int EnableOutputs = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableOutputs"), 0, settingsFilename);
static bool init = false;
static bool outputinit = false;
static bool __stdcall ExitHook(UINT uExitCode)
{
@ -83,6 +85,15 @@ void M2Emulator::FFBLoop(EffectConstants * constants, Helpers * helpers, EffectT
triggers->Springi(ForceSpringStrength / 100.0);
}
if (!outputinit)
{
if (EnableOutputs == 1)
{
HMODULE lib = LoadLibraryA("OutputBlaster.dll");
}
outputinit = true;
}
HMODULE hMod = GetModuleHandleA("KERNEL32.dll");
if (hMod)
{