2015-09-26 16:01:16 +02: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 13:14:06 +01:00
|
|
|
#include <cstdint>
|
2022-07-04 14:48:48 -07:00
|
|
|
#include <set>
|
2015-09-26 16:01:16 +02: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.
|
|
|
|
|
2022-04-24 20:53:09 +02:00
|
|
|
// TODO: Turn into bitfield for smaller mem footprint. Though I think it still fits in a cacheline...
|
2015-09-26 16:01:16 +02:00
|
|
|
struct CompatFlags {
|
2016-01-16 11:31:27 +01:00
|
|
|
bool VertexDepthRounding;
|
2015-10-11 20:44:58 +02:00
|
|
|
bool PixelDepthRounding;
|
2016-02-06 20:28:45 -08:00
|
|
|
bool DepthRangeHack;
|
2017-01-28 10:04:50 +01:00
|
|
|
bool ClearToRAM;
|
2017-01-29 00:10:50 +01:00
|
|
|
bool Force04154000Download;
|
2017-02-03 15:30:22 +01:00
|
|
|
bool DrawSyncEatCycles;
|
2017-02-15 00:56:53 +09:00
|
|
|
bool FakeMipmapChange;
|
2017-03-14 10:36:51 +01:00
|
|
|
bool RequireBufferedRendering;
|
2017-03-21 14:23:31 +07:00
|
|
|
bool RequireBlockTransfer;
|
2017-12-17 13:14:06 +01:00
|
|
|
bool RequireDefaultCPUClock;
|
2017-11-21 11:56:42 +01:00
|
|
|
bool DisableAccurateDepth;
|
2018-04-13 17:32:36 +02:00
|
|
|
bool MGS2AcidHack;
|
2018-04-13 18:05:04 +02:00
|
|
|
bool SonicRivalsHack;
|
2018-11-05 00:28:01 +01:00
|
|
|
bool BlockTransferAllowCreateFB;
|
2020-10-10 23:48:37 +02:00
|
|
|
bool IntraVRAMBlockTransferAllowCreateFB;
|
2018-11-27 22:45:51 +08:00
|
|
|
bool YugiohSaveFix;
|
2019-02-06 10:45:12 +01:00
|
|
|
bool ForceUMDDelay;
|
2019-02-06 10:54:03 +01:00
|
|
|
bool ForceMax60FPS;
|
2022-07-04 00:58:48 +02:00
|
|
|
bool GoWFramerateHack60;
|
|
|
|
bool GoWFramerateHack30;
|
2019-03-01 10:55:43 +01:00
|
|
|
bool JitInvalidationHack;
|
2019-08-01 18:38:40 +02:00
|
|
|
bool HideISOFiles;
|
2019-08-04 21:37:33 -07:00
|
|
|
bool MoreAccurateVMMUL;
|
2019-10-22 21:38:14 +02:00
|
|
|
bool ForceSoftwareRenderer;
|
2019-10-24 00:10:39 +02:00
|
|
|
bool DarkStalkersPresentHack;
|
2020-10-05 20:26:04 +02:00
|
|
|
bool ReportSmallMemstick;
|
2020-10-19 22:42:49 -07:00
|
|
|
bool MemstickFixedFree;
|
2020-10-11 16:19:06 +08:00
|
|
|
bool DateLimited;
|
2020-11-27 23:34:02 +01:00
|
|
|
bool ShaderColorBitmask;
|
2020-12-20 12:59:44 +01:00
|
|
|
bool DisableFirstFrameReadback;
|
2021-02-09 16:11:59 +01:00
|
|
|
bool MpegAvcWarmUp;
|
2022-04-24 20:53:09 +02:00
|
|
|
bool BlueToAlpha;
|
2022-06-11 00:20:35 +02:00
|
|
|
bool CenteredLines;
|
2022-04-16 23:47:05 +02:00
|
|
|
bool MaliDepthStencilBugWorkaround;
|
2022-07-14 23:17:32 +02:00
|
|
|
bool ZZT3SelectHack;
|
2022-07-15 11:43:49 +02:00
|
|
|
bool AllowLargeFBTextureOffsets;
|
2022-08-14 14:54:06 +08:00
|
|
|
bool AtracLoopHack;
|
2022-08-19 00:34:02 +02:00
|
|
|
bool DeswizzleDepth;
|
2022-08-30 19:36:08 +02:00
|
|
|
bool SplitFramebufferMargin;
|
2022-09-04 23:42:35 +02:00
|
|
|
bool ForceLowerResolutionForEffectsOn;
|
2022-12-02 00:35:28 +01:00
|
|
|
bool ForceLowerResolutionForEffectsOff;
|
2022-09-11 10:26:01 +02:00
|
|
|
bool AllowDownloadCLUT;
|
2022-09-26 20:47:55 +02:00
|
|
|
bool NearestFilteringOnFramebufferCreate;
|
2022-11-06 17:28:50 +01:00
|
|
|
bool SecondaryTextureCache;
|
2022-11-13 23:16:09 +01:00
|
|
|
bool EnglishOrJapaneseOnly;
|
2022-11-23 17:32:32 +01:00
|
|
|
bool OldAdrenoPixelDepthRoundingGL;
|
2022-11-27 23:32:43 +01:00
|
|
|
bool ForceCircleButtonConfirm;
|
2022-12-07 13:23:33 +01:00
|
|
|
bool DisallowFramebufferAtOffset;
|
2023-01-12 11:30:42 +01:00
|
|
|
bool RockmanDash2SoundFix;
|
2023-02-04 13:28:59 +01:00
|
|
|
bool ReadbackDepth;
|
2023-02-13 23:28:10 +01:00
|
|
|
bool BlockTransferDepth;
|
2015-09-26 16:01:16 +02:00
|
|
|
};
|
|
|
|
|
2022-09-12 18:46:04 +02:00
|
|
|
struct VRCompat {
|
2022-12-26 15:57:29 +01:00
|
|
|
bool ForceFlatScreen;
|
2022-11-09 19:25:08 +01:00
|
|
|
bool IdentityViewHack;
|
2022-09-13 21:16:03 +02:00
|
|
|
bool Skyplane;
|
2022-09-12 18:46:04 +02:00
|
|
|
float UnitsPerMeter;
|
|
|
|
};
|
|
|
|
|
2015-09-26 16:01:16 +02: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_; }
|
|
|
|
|
2022-09-12 18:46:04 +02:00
|
|
|
const VRCompat &vrCompat() const { return vrCompat_; }
|
|
|
|
|
2015-09-26 16:01:16 +02:00
|
|
|
void Load(const std::string &gameID);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void Clear();
|
2016-01-16 11:24:04 +01:00
|
|
|
void CheckSettings(IniFile &iniFile, const std::string &gameID);
|
2022-10-22 16:16:23 +02:00
|
|
|
void CheckVRSettings(IniFile &iniFile, const std::string &gameID);
|
2017-01-28 10:04:50 +01:00
|
|
|
void CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag);
|
2022-09-12 18:46:04 +02:00
|
|
|
void CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, float *value);
|
2015-09-26 16:01:16 +02:00
|
|
|
|
2019-05-10 23:26:34 +02:00
|
|
|
CompatFlags flags_{};
|
2022-09-12 18:46:04 +02:00
|
|
|
VRCompat vrCompat_{};
|
2022-07-04 14:48:48 -07:00
|
|
|
std::set<std::string> ignored_;
|
2017-11-10 16:32:56 +01:00
|
|
|
};
|