1
0
mirror of synced 2024-11-28 00:20:52 +01:00

Update with output reading and fix strange bug with logging etc

This commit is contained in:
Aaron M 2019-12-06 21:55:39 +13:00
parent 40ebed5560
commit d5bef2b65b
10 changed files with 2175 additions and 39 deletions

View File

@ -81,7 +81,6 @@ GameId=3
MinForce=0 MinForce=0
MaxForce=75 MaxForce=75
DefaultCentering=15 DefaultCentering=15
RemoveCelShadedFilter=0
[GRID] [GRID]
GameId=10 GameId=10
@ -239,6 +238,9 @@ GameId=13
DefaultCentering=25 DefaultCentering=25
FeedbackLength=500 FeedbackLength=500
[Output Reading]
GameId=22
[Outrun 2 Special Tours Deluxe Custom] [Outrun 2 Special Tours Deluxe Custom]
GameId=12 GameId=12
MinForce=0 MinForce=0

View File

@ -24,6 +24,7 @@
<ClInclude Include="Game Files\HOTD4.h" /> <ClInclude Include="Game Files\HOTD4.h" />
<ClInclude Include="Game Files\InitialD0.h" /> <ClInclude Include="Game Files\InitialD0.h" />
<ClInclude Include="Game Files\KODrive.h" /> <ClInclude Include="Game Files\KODrive.h" />
<ClInclude Include="Game Files\OutputReading.h" />
<ClInclude Include="Game Files\OutRun2Real.h" /> <ClInclude Include="Game Files\OutRun2Real.h" />
<ClInclude Include="Game Files\ButtonRumble.h" /> <ClInclude Include="Game Files\ButtonRumble.h" />
<ClInclude Include="Game Files\Demul.h" /> <ClInclude Include="Game Files\Demul.h" />
@ -50,6 +51,7 @@
<ClCompile Include="Game Files\HOTD4.cpp" /> <ClCompile Include="Game Files\HOTD4.cpp" />
<ClCompile Include="Game Files\InitialD0.cpp" /> <ClCompile Include="Game Files\InitialD0.cpp" />
<ClCompile Include="Game Files\KODrive.cpp" /> <ClCompile Include="Game Files\KODrive.cpp" />
<ClCompile Include="Game Files\OutputReading.cpp" />
<ClCompile Include="Game Files\OutRun2Real.cpp" /> <ClCompile Include="Game Files\OutRun2Real.cpp" />
<ClCompile Include="Game Files\ButtonRumble.cpp" /> <ClCompile Include="Game Files\ButtonRumble.cpp" />
<ClCompile Include="Common Files\TeknoParrotGame.cpp" /> <ClCompile Include="Common Files\TeknoParrotGame.cpp" />

View File

@ -114,6 +114,7 @@
<ClCompile Include="Game Files\HOTD4.cpp" /> <ClCompile Include="Game Files\HOTD4.cpp" />
<ClCompile Include="Game Files\GRID.cpp" /> <ClCompile Include="Game Files\GRID.cpp" />
<ClCompile Include="Game Files\Mame.cpp" /> <ClCompile Include="Game Files\Mame.cpp" />
<ClCompile Include="Game Files\OutputReading.cpp" />
<ClCompile Include="Game Files\InitialD0.cpp" /> <ClCompile Include="Game Files\InitialD0.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -232,6 +233,9 @@
<ClInclude Include="Game Files\Mame.h"> <ClInclude Include="Game Files\Mame.h">
<Filter>Common Header Files</Filter> <Filter>Common Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Game Files\OutputReading.h">
<Filter>Common Header Files</Filter>
</ClInclude>
<ClInclude Include="Game Files\InitialD0.h"> <ClInclude Include="Game Files\InitialD0.h">
<Filter>Common Header Files</Filter> <Filter>Common Header Files</Filter>
</ClInclude> </ClInclude>

View File

@ -41,6 +41,7 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#include "Game Files/InitialD7.h" #include "Game Files/InitialD7.h"
#include "Game Files/InitialD8.h" #include "Game Files/InitialD8.h"
#include "Game Files/MarioKartGPDX.h" #include "Game Files/MarioKartGPDX.h"
#include "Game Files/OutputReading.h"
#include "Game Files/OutRun2Fake.h" #include "Game Files/OutRun2Fake.h"
#include "Game Files/OutRun2Real.h" #include "Game Files/OutRun2Real.h"
#include "Game Files/SegaRacingClassic.h" #include "Game Files/SegaRacingClassic.h"
@ -898,6 +899,7 @@ const int INITIAL_D_8 = 18;
const int POKKEN_TOURNAMENT = 19; const int POKKEN_TOURNAMENT = 19;
const int MARIO_KART_GPDX_110 = 20; const int MARIO_KART_GPDX_110 = 20;
const int Sonic_Sega_AllStars_Racing = 21; const int Sonic_Sega_AllStars_Racing = 21;
const int OUTPUT_READING = 22;
const int INITIAL_D_5 = 23; const int INITIAL_D_5 = 23;
const int INITIAL_D_4_Japan = 24; const int INITIAL_D_4_Japan = 24;
const int M2_Emulator = 25; const int M2_Emulator = 25;
@ -1712,6 +1714,9 @@ DWORD WINAPI FFBLoop(LPVOID lpParam)
case DAYTONA_3: case DAYTONA_3:
game = new Daytona3; game = new Daytona3;
break; break;
case OUTPUT_READING:
game = new OutputReading;
break;
case FORD_RACING: case FORD_RACING:
game = new FordRacing; game = new FordRacing;
break; break;

View File

@ -14,8 +14,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#include <string> #include <string>
#include "ChaseHQ2.h" #include "ChaseHQ2.h"
static bool removecel = false;
int ttx2chasehq2(int ffRaw) { int ttx2chasehq2(int ffRaw) {
switch (ffRaw) { switch (ffRaw) {
// moving right, from weakest to strongest (30 => 16). // moving right, from weakest to strongest (30 => 16).
@ -89,9 +87,6 @@ int ttx2chasehq2(int ffRaw) {
void ChaseHQ2::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers) { void ChaseHQ2::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers) {
static wchar_t* settingsFilename = TEXT(".\\FFBPlugin.ini");
static int RemoveCelShadedFilter = GetPrivateProfileInt(TEXT("Settings"), TEXT("RemoveCelShadedFilter"), 0, settingsFilename);
int ff = 0; int ff = 0;
{ {
long ffAddress = helpers->ReadInt32(0x130B558, /* isRelativeOffset*/ true); long ffAddress = helpers->ReadInt32(0x130B558, /* isRelativeOffset*/ true);
@ -106,21 +101,6 @@ void ChaseHQ2::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTrigg
ff = ttx2chasehq2(ffRaw); ff = ttx2chasehq2(ffRaw);
} }
if (RemoveCelShadedFilter == 1)
{
if (!removecel)
{
helpers->WriteNop(0x31FFA, true);
helpers->WriteNop(0x31FFB, true);
helpers->WriteNop(0x31FFC, true);
helpers->WriteNop(0x31FFD, true);
helpers->WriteNop(0x31FFE, true);
helpers->WriteNop(0x31FFF, true);
removecel = true;
}
helpers->WriteByte(0x130CB30, 0x00, true); // Remove Cel Shaded Filter
}
helpers->log("got value: "); helpers->log("got value: ");
std::string ffs = std::to_string(ff); std::string ffs = std::to_string(ff);
helpers->log((char *)ffs.c_str()); helpers->log((char *)ffs.c_str());

2129
Game Files/OutputReading.cpp Normal file

File diff suppressed because it is too large Load Diff

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

View File

@ -15,23 +15,28 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#include "SonicSegaAllStarsRacing.h" #include "SonicSegaAllStarsRacing.h"
void SonicSegaAllStarsRacing::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers) { void SonicSegaAllStarsRacing::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers) {
UINT8 FFBEnable = helpers->ReadByte(0x5CD858, /* isRelativeOffset*/ true); INT_PTR FFBEnable = helpers->ReadByte(0x5CD858, /* isRelativeOffset*/ true);
UINT8 FFB = helpers->ReadByte(0x5CD864, /* isRelativeOffset*/ true); INT_PTR FFB = helpers->ReadByte(0x5CD864, /* isRelativeOffset*/ true);
{ {
//Enable FFB //Enable FFB
helpers->WriteByte(0x5CD858, 0x03, true); helpers->WriteByte(0x5CD858, 0x03, true);
} }
{
if ((FFB > 0) && (FFB < 19)) //Trigger friction to stop any oscillation
double percentForce = 0.2;
triggers->Friction(percentForce);
}
if ((FFB > 0) & (FFB < 19))
{ {
helpers->log("moving wheel right"); helpers->log("moving wheel right");
double percentForce = (FFB) / 18.0; double percentForce = (FFB) / 18.0;
double percentLength = 100; double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength); triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
} }
else if ((FFB > 237) && (FFB < 256)) else if ((FFB > 237) & (FFB < 256))
{ {
helpers->log("moving wheel right"); helpers->log("moving wheel right");
double percentForce = (256 - FFB) / 18.0; double percentForce = (256 - FFB) / 18.0;

View File

@ -1,6 +1,6 @@
***FFB Arcade Plugin*** ***FFB Arcade Plugin***
Version 1.2 Version 1.1a
Brought to you by Boomslangnz, Ducon2016, Spazzy & pinkimo. Brought to you by Boomslangnz, Ducon2016, Spazzy & pinkimo.
@ -10,15 +10,6 @@ While best efforts were made to try to resemble the real arcade force feedback,
in some cases eg Mario Kart GP DX, Pokken Tournament and Battle Gear 4,effects were created entirely from scratch in some cases eg Mario Kart GP DX, Pokken Tournament and Battle Gear 4,effects were created entirely from scratch
so are not using real force feedback values. Most games use correct ffb values however :) so are not using real force feedback values. Most games use correct ffb values however :)
***1.2 Changes***
- Added Initial D Arcade Stage Zero FFB Support
- Added ChaseHQ2 shader filter removal checkbox under Input/Misc setting in GUI
- Sorry had wrong SDL2.dll for all 64bit games on last release
***1.1a Changes*** ***1.1a Changes***
- Fixed issue with inputs not working correctly - Fixed issue with inputs not working correctly
@ -359,8 +350,6 @@ extremely generous.
-Indy 500 [dinput8.dll into m2 emulator 1.1a folder] -Indy 500 [dinput8.dll into m2 emulator 1.1a folder]
-Initial D0 [dinput8.dll into game exe folder]
-Initial D4 [opengl32.dll into Teknoparrot folder inside Main Teknoparrot folder] -Initial D4 [opengl32.dll into Teknoparrot folder inside Main Teknoparrot folder]
-Initial D4 Japan [opengl32.dll into Teknoparrot folder inside Main Teknoparrot folder] -Initial D4 Japan [opengl32.dll into Teknoparrot folder inside Main Teknoparrot folder]