2015-09-26 14:01:16 +00:00
|
|
|
// Copyright (c) 2015- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program 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, version 2.0 or later versions.
|
|
|
|
|
|
|
|
// This program 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 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
2017-12-17 12:14:06 +00:00
|
|
|
#include <cstdint>
|
2015-09-26 14:01:16 +00:00
|
|
|
|
|
|
|
// Compatibility flags are controlled by assets/compat.ini.
|
|
|
|
// Alternatively, if PSP/SYSTEM/compat.ini exists, it is merged on top, to enable editing
|
|
|
|
// the file on Android for tests.
|
|
|
|
//
|
|
|
|
// This file is not meant to be user-editable, although is kept as a separate ini
|
|
|
|
// file instead of compiled into the code for debugging purposes.
|
|
|
|
//
|
|
|
|
// The uses cases are strict:
|
|
|
|
// * Enable fixes for things we can't reasonably emulate without completely ruining
|
|
|
|
// performance for other games, such as the screen copies in Dangan Ronpa
|
|
|
|
// * Disabling accuracy features like 16-bit depth rounding, when we can't seem to
|
|
|
|
// implement them at all in a 100% compatible way
|
|
|
|
// * Emergency game-specific compatibility fixes before releases, such as the GTA
|
|
|
|
// music problem where every attempted fix has reduced compatibility with other games
|
|
|
|
// * Enable "unsafe" performance optimizations that some games can tolerate and
|
|
|
|
// others cannot. We do not currently have any of those.
|
|
|
|
//
|
|
|
|
// This functionality should NOT be used for any of the following:
|
|
|
|
// * Cheats
|
|
|
|
// * Fun hacks, like enlarged heads or whatever
|
|
|
|
// * Fixing general compatibility issues. First try to find a general solution. Try hard.
|
|
|
|
//
|
|
|
|
// We already have the Action Replay-based cheat system for such use cases.
|
|
|
|
|
|
|
|
struct CompatFlags {
|
2016-01-16 10:31:27 +00:00
|
|
|
bool VertexDepthRounding;
|
2015-10-11 18:44:58 +00:00
|
|
|
bool PixelDepthRounding;
|
2016-02-07 04:28:45 +00:00
|
|
|
bool DepthRangeHack;
|
2017-01-28 09:04:50 +00:00
|
|
|
bool ClearToRAM;
|
2017-01-28 23:10:50 +00:00
|
|
|
bool Force04154000Download;
|
2017-02-03 14:30:22 +00:00
|
|
|
bool DrawSyncEatCycles;
|
2017-02-14 15:56:53 +00:00
|
|
|
bool FakeMipmapChange;
|
2017-03-14 09:36:51 +00:00
|
|
|
bool RequireBufferedRendering;
|
2017-03-21 07:23:31 +00:00
|
|
|
bool RequireBlockTransfer;
|
2017-12-17 12:14:06 +00:00
|
|
|
bool RequireDefaultCPUClock;
|
2017-11-10 15:32:56 +00:00
|
|
|
bool DisableReadbacks;
|
2017-11-21 10:56:42 +00:00
|
|
|
bool DisableAccurateDepth;
|
2018-04-13 15:32:36 +00:00
|
|
|
bool MGS2AcidHack;
|
2018-04-13 16:05:04 +00:00
|
|
|
bool SonicRivalsHack;
|
2019-08-13 21:07:58 +00:00
|
|
|
bool RenderPassMerge;
|
2018-11-04 23:28:01 +00:00
|
|
|
bool BlockTransferAllowCreateFB;
|
2018-11-27 14:45:51 +00:00
|
|
|
bool YugiohSaveFix;
|
2019-02-06 09:45:12 +00:00
|
|
|
bool ForceUMDDelay;
|
2019-02-06 09:54:03 +00:00
|
|
|
bool ForceMax60FPS;
|
2019-03-01 09:55:43 +00:00
|
|
|
bool JitInvalidationHack;
|
2019-08-01 16:38:40 +00:00
|
|
|
bool HideISOFiles;
|
2019-08-05 04:37:33 +00:00
|
|
|
bool MoreAccurateVMMUL;
|
2015-09-26 14:01:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class IniFile;
|
|
|
|
|
|
|
|
class Compatibility {
|
|
|
|
public:
|
|
|
|
Compatibility() {
|
|
|
|
Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Flags enforced read-only through const. Only way to change them is to load assets/compat.ini.
|
|
|
|
const CompatFlags &flags() const { return flags_; }
|
|
|
|
|
|
|
|
void Load(const std::string &gameID);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void Clear();
|
2016-01-16 10:24:04 +00:00
|
|
|
void CheckSettings(IniFile &iniFile, const std::string &gameID);
|
2017-01-28 09:04:50 +00:00
|
|
|
void CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag);
|
2015-09-26 14:01:16 +00:00
|
|
|
|
2019-05-10 21:26:34 +00:00
|
|
|
CompatFlags flags_{};
|
2017-11-10 15:32:56 +00:00
|
|
|
};
|