Skip to content

Commit

Permalink
Flip around how compat.ini works (now the settings are the categories…
Browse files Browse the repository at this point in the history
…, games are listed within)
  • Loading branch information
hrydgard committed Jan 16, 2016
1 parent 2fc2261 commit 03674fd
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 73 deletions.
31 changes: 20 additions & 11 deletions Core/Compatibility.cpp
Expand Up @@ -20,26 +20,35 @@
#include "Core/System.h"

void Compatibility::Load(const std::string &gameID) {
IniFile compat;
Clear();

// This loads from assets.
if (compat.LoadFromVFS("compat.ini")) {
LoadIniSection(compat, gameID);
{
IniFile compat;
// This loads from assets.
if (compat.LoadFromVFS("compat.ini")) {
CheckSettings(compat, gameID);
}
}

// This one is user-editable. Need to load it after the system one.
std::string path = GetSysDirectory(DIRECTORY_SYSTEM) + "compat.ini";
if (compat.Load(path)) {
LoadIniSection(compat, gameID);
{
IniFile compat2;
// This one is user-editable. Need to load it after the system one.
std::string path = GetSysDirectory(DIRECTORY_SYSTEM) + "compat.ini";
if (compat2.Load(path)) {
CheckSettings(compat2, gameID);
}
}
}

void Compatibility::Clear() {
memset(&flags_, 0, sizeof(flags_));
}

void Compatibility::LoadIniSection(IniFile &iniFile, std::string section) {
iniFile.Get(section.c_str(), "NoDepthRounding", &flags_.NoDepthRounding, flags_.NoDepthRounding);
iniFile.Get(section.c_str(), "PixelDepthRounding", &flags_.PixelDepthRounding, flags_.PixelDepthRounding);
void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "NoDepthRounding", flags_.NoDepthRounding);
CheckSetting(iniFile, gameID, "PixelDepthRounding", flags_.PixelDepthRounding);
}

void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool &flag) {
iniFile.Get(option, gameID.c_str(), &flag, flag);
}
3 changes: 2 additions & 1 deletion Core/Compatibility.h
Expand Up @@ -64,7 +64,8 @@ class Compatibility {

private:
void Clear();
void LoadIniSection(IniFile &iniFile, std::string section);
void CheckSettings(IniFile &iniFile, const std::string &gameID);
void CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool &flag);

CompatFlags flags_;
};
93 changes: 32 additions & 61 deletions assets/compat.ini
Expand Up @@ -28,86 +28,57 @@
# Issue numbers refer to issues on https://github.com/hrydgard/ppsspp/issues
# ========================================================================================

[NoDepthRounding]
# Fight Night Round 3
# Our accurate rounding of depth to 16-bit precision appears to cause a regression
# in this game. The game doesn't seem to need it, so let's turn it off.
# Issue #8004
[ULES00270]
NoDepthRounding = true
[ULUS10066]
NoDepthRounding = true

ULES00270 = true
ULUS10066 = true

# Ridge Racer
# Our accurate rounding of depth to 16-bit precision appears to cause a regression
# in this game. The game doesn't seem to need it, so let's turn it off.
# Issue 8031
[UCAS40015]
NoDepthRounding = true
[ULUS10001]
NoDepthRounding = true
[UCKS45002]
NoDepthRounding = true
[UCES00002]
NoDepthRounding = true
[ULJS19002]
NoDepthRounding = true
[UCKS45053]
NoDepthRounding = true
[NPJH50140]
NoDepthRounding = true
UCAS40015 = true
ULUS10001 = true
UCKS45002 = true
UCES00002 = true
ULJS19002 = true
UCKS45053 = true
NPJH50140 = true

# Do the same for Ridge Racer 2, it's nearly the exact same game except more levels and cars.
[ULJS00080]
NoDepthRounding = true
[UCES00422]
NoDepthRounding = true
[NPJH50366]
NoDepthRounding = true
ULJS00080 = true
UCES00422 = true
NPJH50366 = true

# Same for Lost Heroes (JP).
[ULJS00489]
NoDepthRounding = true
[NPJH50647]
NoDepthRounding = true
ULJS00489 = true
NPJH50647 = true

# Summon Night 5 (JP). Issue #8181
[ULJS00553]
NoDepthRounding = true
[NPJH50696]
NoDepthRounding = true
[ULJS19096]
NoDepthRounding = true
ULJS00553 = true
NPJH50696 = true
ULJS19096 = true

#MotorStorm Arctic Edge
[UCUS98743]
NoDepthRounding = true
[UCES01250]
NoDepthRounding = true
[UCAS40266]
NoDepthRounding = true
[UCJS10104]
NoDepthRounding = true
[NPJG00047]
NoDepthRounding = true
[UCKS45124]
NoDepthRounding = true
UCUS98743 = true
UCES01250 = true
UCAS40266 = true
UCJS10104 = true
NPJG00047 = true
UCKS45124 = true

#Saigo no Yakusoku no Monogatari (JP)
[NPJH50416]
NoDepthRounding = true
[UCAS40339]
NoDepthRounding = true
[ULJM05860]
NoDepthRounding = true
NPJH50416 = true
UCAS40339 = true
ULJM05860 = true

[PixelDepthRounding]
# Heroes Phantasia requires pixel depth rounding.
[NPJH50558]
PixelDepthRounding = true
[ULJS00456]
PixelDepthRounding = true
[ULJS00454]
PixelDepthRounding = true
NPJH50558 = true
ULJS00456 = true
ULJS00454 = true
# Heroes Phantasia Limited Edition Disc requires pixel depth rounding.
[ULJS00455]
PixelDepthRounding = true
ULJS00455 = true

0 comments on commit 03674fd

Please sign in to comment.