GameSettings: Disable analog mode forcing instead of forcing digital controller

This commit is contained in:
Albert Liu 2020-12-11 00:59:40 -08:00
parent 8716c33f41
commit def9a98cb9
8 changed files with 102 additions and 102 deletions

View file

@ -14,7 +14,7 @@ ForcePGXPCPUMode = true
# Doom (USA) (Rev 1) (SLUS-00077)
[SLUS-00077]
DisableUpscaling = true
ForceDigitalController = true
DisableAnalogModeForcing = true
# Pop'n Music 6 (Japan) (SLPM-87089)
[SLPM-87089]
@ -113,94 +113,94 @@ DisplayActiveEndOffset = 68
[SLUS-00297]
DisableUpscaling = true
DisablePGXP = true
ForceDigitalController = true
DisableAnalogModeForcing = true
# SCUS-94350 (Destruction Derby 2 (USA))
[SCUS-94350]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SCUS-94900 (Crash Bandicoot (USA))
[SCUS-94900]
ForceDigitalController = true
DisableAnalogModeForcing = true
# PCPX-96085 (Gran Turismo (Japan) (Demo 1))
[PCPX-96085]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-00590 (Need for Speed - V-Rally (USA))
[SLUS-00590]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-00403 (Rage Racer (USA))
[SLUS-00403]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SCUS-94300 (Ridge Racer (USA))
[SCUS-94300]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-00214 (Ridge Racer Revolution (USA))
[SLUS-00214]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-00204 (Road & Track Presents - The Need for Speed (USA))
[SLUS-00204]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-00006 (Tekken (USA))
[SLUS-00006]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-00213 (Tekken 2 (USA))
[SLUS-00213]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SCES-00344 (Crash Bandicoot (Europe))
[SCES-00344]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-00355 (Duke Nukem - Total Meltdown (USA))
[SLUS-00355]
DisableUpscaling = true
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-00331 (Final Doom (USA))
[SLUS-00331]
DisableUpscaling = true
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-00106 (Grand Theft Auto (USA))
[SLUS-00106]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-00005 (Rayman (USA))
[SLUS-00005]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-01265 (Rayman Brain Games (USA))
[SLUS-01265]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-00601 (Skullmonkeys (USA))
[SLUS-00601]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLPS-00435 (Megatudo 2096 (Japan))
@ -240,17 +240,17 @@ ForcePGXPVertexCache = true
# SLPM-86023 (Akumajou Dracula X: Gekka no Yasoukyoku)
[SLPM-86023]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-00067 (Castlevania - Symphony of the Night (USA))
[SLUS-00067]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLES-00524 (Castlevania - Symphony of the Night (Europe))
[SLES-00524]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLPS-00712 (Tenga Seiha (Japan))
@ -270,7 +270,7 @@ ForceInterpreter = true
# SLPS-02459 (Otona no Asobi (Japan))
[SLPS-02459]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLPM-86750 (Shiritsu Justice Gakuen: Nekketsu Seishun Nikki 2 (Japan))
@ -285,93 +285,93 @@ ForceInterlacing = true
# PowerSlave (SLUS-00102)
[SLUS-00102]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Tomb Raider (SLUS-00152)
[SLUS-00152]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Megaman Legends (SLUS-00603)
[SLUS-00603]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Hexen (SLUS-00348)
[SLUS-00348]
DisableUpscaling = true
ForceDigitalController = true
DisableAnalogModeForcing = true
# Gex (SLUS-00042)
[SLUS-00042]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Megaman x4 (SLUS-00561)
[SLUS-00561]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Road Rash (SLUS-00035)
[SLUS-00035]
ForceDigitalController = true
DisableAnalogModeForcing = true
# StarBlade Alpha (SLUS-00057)
[SLUS-00057]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Spot Goes to Hollywood (SLUS-00014)
[SLUS-00014]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Philsoma (SCUS-94403)
[SCUS-94403]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Rampage World Tour (SLUS-00549)
[SLUS-00549]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Soul Blade (SLUS-00240)
[SLUS-00240]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Blood Omen Legacy of Kain (SLUS-00027)
[SLUS-00027]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Die Hard Trilogy (SLUS-00119)
[SLUS-00119]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Disrupter (SLUS-00224)
[SLUS-00224]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Megaman 8 (SLUS-00453)
[SLUS-00453]
ForceDigitalController = true
DisableAnalogModeForcing = true
# R-Types (SLUS-00753)
[SLUS-00753]
ForceDigitalController = true
DisableAnalogModeForcing = true
# Guardian's Crusade (SLUS-00811)
[SLUS-00811]
ForceDigitalController = true
DisableAnalogModeForcing = true
# SLUS-00208 (Buster Bros. Collection (USA))

View file

@ -31,7 +31,7 @@ def parse_ini(path):
"DisablePGXPTextureCorrection",
"ForcePGXPVertexCache",
"ForcePGXPCPUMode",
"ForceDigitalController",
"DisableAnalogModeForcing",
"ForceRecompilerMemoryExceptions",
"ForceRecompilerICache"
]

View file

@ -3,6 +3,7 @@
#include "common/state_wrapper.h"
#include "common/string_util.h"
#include "host_interface.h"
#include "settings.h"
#include "system.h"
#include <cmath>
Log_SetChannel(AnalogController);
@ -31,8 +32,18 @@ void AnalogController::Reset()
ResetRumbleConfig();
if (m_force_analog_on_reset)
{
if (g_settings.controller_disable_analog_mode_forcing)
{
g_host_interface->AddOSDMessage(
g_host_interface->TranslateStdString(
"OSDMessage", "Analog mode forcing is disabled by game settings. Controller will start in digital mode."),
10.0f);
}
else
SetAnalogMode(true);
}
}
bool AnalogController::DoState(StateWrapper& sw)
{

View file

@ -218,6 +218,7 @@ void Settings::Load(SettingsInterface& si)
ParseControllerTypeName(
si.GetStringValue("Controller2", "Type", GetControllerTypeName(DEFAULT_CONTROLLER_2_TYPE)).c_str())
.value_or(DEFAULT_CONTROLLER_2_TYPE);
controller_disable_analog_mode_forcing = false;
memory_card_types[0] =
ParseMemoryCardTypeName(

View file

@ -175,6 +175,8 @@ struct Settings
bool bios_patch_fast_boot = false;
std::array<ControllerType, NUM_CONTROLLER_AND_CARD_PORTS> controller_types{};
bool controller_disable_analog_mode_forcing = false;
std::array<MemoryCardType, NUM_CONTROLLER_AND_CARD_PORTS> memory_card_types{};
std::array<std::string, NUM_CONTROLLER_AND_CARD_PORTS> memory_card_paths{};
bool memory_card_use_playlist_title = true;

View file

@ -19,7 +19,7 @@ std::unique_ptr<GameSettings::Entry> GetSettingsForGame(const std::string& game_
if (game_code == "SLUS-00077")
{
gs->AddTrait(GameSettings::Trait::DisableUpscaling);
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
@ -138,111 +138,111 @@ std::unique_ptr<GameSettings::Entry> GetSettingsForGame(const std::string& game_
{
gs->AddTrait(GameSettings::Trait::DisableUpscaling);
gs->AddTrait(GameSettings::Trait::DisablePGXP);
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SCUS-94350")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SCUS-94900")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "PCPX-96085")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00590")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00403")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SCUS-94300")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00214")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00204")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00006")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00213")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SCES-00344")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00355")
{
gs->AddTrait(GameSettings::Trait::DisableUpscaling);
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00331")
{
gs->AddTrait(GameSettings::Trait::DisableUpscaling);
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00106")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00005")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-01265")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00601")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
@ -290,19 +290,19 @@ std::unique_ptr<GameSettings::Entry> GetSettingsForGame(const std::string& game_
if (game_code == "SLPM-86023")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00067")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLES-00524")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
@ -326,7 +326,7 @@ std::unique_ptr<GameSettings::Entry> GetSettingsForGame(const std::string& game_
if (game_code == "SLPS-02459")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
@ -344,110 +344,110 @@ std::unique_ptr<GameSettings::Entry> GetSettingsForGame(const std::string& game_
if (game_code == "SLUS-00102")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00152")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00603")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00348")
{
gs->AddTrait(GameSettings::Trait::DisableUpscaling);
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00042")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00561")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00035")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00057")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00014")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SCUS-94403")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00549")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00240")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00027")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00119")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00224")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00453")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00753")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00811")
{
gs->AddTrait(GameSettings::Trait::ForceDigitalController);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}

View file

@ -34,7 +34,7 @@ std::array<std::pair<const char*, const char*>, static_cast<u32>(Trait::Count)>
{"DisablePGXPTextureCorrection", TRANSLATABLE("GameSettingsTrait", "Disable PGXP Texture Correction")},
{"ForcePGXPVertexCache", TRANSLATABLE("GameSettingsTrait", "Force PGXP Vertex Cache")},
{"ForcePGXPCPUMode", TRANSLATABLE("GameSettingsTrait", "Force PGXP CPU Mode")},
{"ForceDigitalController", TRANSLATABLE("GameSettingsTrait", "Force Digital Controller")},
{"DisableAnalogModeForcing", TRANSLATABLE("GameSettingsTrait", "Disable Forcing Controller Analog Mode on Reset")},
{"ForceRecompilerMemoryExceptions", TRANSLATABLE("GameSettingsTrait", "Force Recompiler Memory Exceptions")},
{"ForceRecompilerICache", TRANSLATABLE("GameSettingsTrait", "Force Recompiler ICache")},
}};
@ -709,23 +709,9 @@ void Entry::ApplySettings(bool display_osd_messages) const
g_settings.gpu_pgxp_cpu = true;
}
if (HasTrait(Trait::ForceDigitalController))
if (HasTrait(Trait::DisableAnalogModeForcing))
{
for (u32 i = 0; i < NUM_CONTROLLER_AND_CARD_PORTS; i++)
{
if (g_settings.controller_types[i] == ControllerType::AnalogController)
{
if (display_osd_messages)
{
g_host_interface->AddFormattedOSDMessage(
osd_duration,
g_host_interface->TranslateString("OSDMessage", "Controller %u changed to digital by game settings."),
i + 1u);
}
g_settings.controller_types[i] = ControllerType::DigitalController;
}
}
g_settings.controller_disable_analog_mode_forcing = true;
}
if (HasTrait(Trait::ForceRecompilerMemoryExceptions))

View file

@ -24,7 +24,7 @@ enum class Trait : u32
DisablePGXPTextureCorrection,
ForcePGXPVertexCache,
ForcePGXPCPUMode,
ForceDigitalController,
DisableAnalogModeForcing,
ForceRecompilerMemoryExceptions,
ForceRecompilerICache,