CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/Core/Compatibility.h
Views: 1401
// Copyright (c) 2015- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1617#pragma once1819#include <string>20#include <cstdint>21#include <set>2223// Compatibility flags are controlled by assets/compat.ini.24// Alternatively, if PSP/System/compat.ini exists, it is merged on top, to enable editing25// the file on Android for tests.26//27// This file is not meant to be user-editable, although is kept as a separate ini28// file instead of compiled into the code for debugging purposes.29//30// The uses cases are strict:31// * Enable fixes for things we can't reasonably emulate without completely ruining32// performance for other games, such as the screen copies in Dangan Ronpa33// * Disabling accuracy features like 16-bit depth rounding, when we can't seem to34// implement them at all in a 100% compatible way35// * Emergency game-specific compatibility fixes before releases, such as the GTA36// music problem where every attempted fix has reduced compatibility with other games37// * Enable "unsafe" performance optimizations that some games can tolerate and38// others cannot. We do not currently have any of those.39//40// This functionality should NOT be used for any of the following:41// * Cheats42// * Fun hacks, like enlarged heads or whatever43// * Fixing general compatibility issues. First try to find a general solution. Try hard.44//45// We already have the Action Replay-based cheat system for such use cases.4647// TODO: Turn into bitfield for smaller mem footprint. Though I think it still fits in a cacheline...48struct CompatFlags {49bool VertexDepthRounding;50bool PixelDepthRounding;51bool DepthRangeHack;52bool ClearToRAM;53bool Force04154000Download;54bool DrawSyncEatCycles;55bool DrawSyncInstant;56bool FakeMipmapChange;57bool RequireBufferedRendering;58bool RequireBlockTransfer;59bool RequireDefaultCPUClock;60bool DisableAccurateDepth;61bool MGS2AcidHack;62bool SonicRivalsHack;63bool BlockTransferAllowCreateFB;64bool IntraVRAMBlockTransferAllowCreateFB;65bool YugiohSaveFix;66bool ForceUMDDelay;67bool ForceMax60FPS;68bool GoWFramerateHack60;69bool FramerateHack30;70bool JitInvalidationHack;71bool HideISOFiles;72bool MoreAccurateVMMUL;73bool ForceSoftwareRenderer;74bool DarkStalkersPresentHack;75bool ReportSmallMemstick;76bool MemstickFixedFree;77bool DateLimited;78bool ShaderColorBitmask;79bool DisableFirstFrameReadback;80bool MpegAvcWarmUp;81bool BlueToAlpha;82bool CenteredLines;83bool MaliDepthStencilBugWorkaround;84bool ZZT3SelectHack;85bool AllowLargeFBTextureOffsets;86bool AtracLoopHack;87bool DeswizzleDepth;88bool SplitFramebufferMargin;89bool ForceLowerResolutionForEffectsOn;90bool ForceLowerResolutionForEffectsOff;91bool AllowDownloadCLUT;92bool NearestFilteringOnFramebufferCreate;93bool SecondaryTextureCache;94bool EnglishOrJapaneseOnly;95bool OldAdrenoPixelDepthRoundingGL;96bool ForceCircleButtonConfirm;97bool DisallowFramebufferAtOffset;98bool RockmanDash2SoundFix;99bool ReadbackDepth;100bool BlockTransferDepth;101bool DaxterRotatedAnalogStick;102bool ForceMaxDepthResolution;103bool SOCOMClut8Replacement;104bool Fontltn12Hack;105bool LoadCLUTFromCurrentFrameOnly;106bool ForceUMDReadSpeed;107bool AllowDelayedReadbacks;108bool KernelGetSystemTimeLowEatMoreCycles;109bool TacticsOgreEliminateDebugReadback;110bool FramebufferAllowLargeVerticalOffset;111bool DisableMemcpySlicing;112bool ForceEnableGPUReadback;113bool UseFFMPEGFindStreamInfo;114};115116struct VRCompat {117bool ForceMono;118bool ForceFlatScreen;119bool IdentityViewHack;120int MirroringVariant;121bool ProjectionHack;122bool Skyplane;123float UnitsPerMeter;124};125126class IniFile;127128class Compatibility {129public:130Compatibility() {131Clear();132}133134// Flags enforced read-only through const. Only way to change them is to load assets/compat.ini.135const CompatFlags &flags() const { return flags_; }136137const VRCompat &vrCompat() const { return vrCompat_; }138139void Load(const std::string &gameID);140141private:142void Clear();143void CheckSettings(IniFile &iniFile, const std::string &gameID);144void CheckVRSettings(IniFile &iniFile, const std::string &gameID);145void CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag);146void CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, float *value);147void CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, int *value);148149CompatFlags flags_{};150VRCompat vrCompat_{};151std::set<std::string> ignored_;152};153154155