2009-09-08 12:08:10 +00:00
/* PCSX2 - PS2 Emulator for PCs
2021-04-25 02:17:59 +00:00
* Copyright ( C ) 2002 - 2021 PCSX2 Dev Team
2009-11-12 12:51:00 +00:00
*
2009-09-08 12:08:10 +00:00
* PCSX2 is free software : you can redistribute it and / or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found -
* ation , either version 3 of the License , or ( at your option ) any later version .
2009-04-27 02:04:31 +00:00
*
2009-09-08 12:08:10 +00:00
* PCSX2 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 for more details .
2009-04-27 02:04:31 +00:00
*
2009-09-08 12:08:10 +00:00
* You should have received a copy of the GNU General Public License along with PCSX2 .
* If not , see < http : //www.gnu.org/licenses/>.
2009-04-27 02:04:31 +00:00
*/
# pragma once
2021-09-01 20:31:46 +00:00
# include "common/emitter/tools.h"
# include "common/General.h"
2021-09-21 10:05:11 +00:00
# include <string>
2020-11-24 03:25:47 +00:00
2021-09-22 07:38:30 +00:00
class SettingsInterface ;
class SettingsWrapper ;
2009-04-27 02:04:31 +00:00
2021-09-16 10:14:42 +00:00
enum class CDVD_SourceType : uint8_t ;
2010-06-15 14:13:23 +00:00
enum GamefixId
{
GamefixId_FIRST = 0 ,
2021-09-29 10:02:27 +00:00
Fix_FpuMultiply = GamefixId_FIRST ,
2010-06-15 14:13:23 +00:00
Fix_FpuNegDiv ,
2021-09-29 10:02:27 +00:00
Fix_GoemonTlbMiss ,
2021-12-18 14:43:50 +00:00
Fix_SoftwareRendererFMV ,
2010-06-15 14:13:23 +00:00
Fix_SkipMpeg ,
2010-07-26 18:55:18 +00:00
Fix_OPHFlag ,
2021-09-29 10:02:27 +00:00
Fix_EETiming ,
2011-03-30 10:54:43 +00:00
Fix_DMABusy ,
2021-09-29 10:02:27 +00:00
Fix_GIFFIFO ,
2011-04-30 18:30:31 +00:00
Fix_VIFFIFO ,
2011-08-25 16:23:25 +00:00
Fix_VIF1Stall ,
2021-09-29 10:02:27 +00:00
Fix_VuAddSub ,
2021-06-08 17:42:55 +00:00
Fix_Ibit ,
2022-02-27 21:58:42 +00:00
Fix_VUSync ,
2021-09-29 09:50:49 +00:00
Fix_VUOverflow ,
2021-09-29 10:02:27 +00:00
Fix_XGKick ,
2022-04-23 06:37:11 +00:00
Fix_BlitInternalFPS ,
2010-06-15 14:13:23 +00:00
GamefixId_COUNT
} ;
2020-12-14 02:23:28 +00:00
// TODO - config - not a fan of the excessive use of enums and macros to make them work
// a proper object would likely make more sense (if possible).
enum SpeedhackId
{
SpeedhackId_FIRST = 0 ,
Speedhack_mvuFlag = SpeedhackId_FIRST ,
Speedhack_InstantVU1 ,
2021-10-23 19:36:02 +00:00
Speedhack_MTVU ,
2020-12-14 02:23:28 +00:00
SpeedhackId_COUNT
} ;
2017-07-14 13:15:37 +00:00
enum class VsyncMode
{
Off ,
On ,
Adaptive ,
} ;
2021-09-16 10:54:06 +00:00
enum class AspectRatioType : u8
2021-08-17 12:51:47 +00:00
{
2021-09-16 10:54:06 +00:00
Stretch ,
2022-04-11 13:00:18 +00:00
RAuto4_3_3_2 ,
2021-09-16 10:54:06 +00:00
R4_3 ,
R16_9 ,
MaxCount
2021-08-17 12:51:47 +00:00
} ;
2021-09-16 10:54:06 +00:00
enum class FMVAspectRatioSwitchType : u8
2021-08-17 12:51:47 +00:00
{
2021-09-16 10:54:06 +00:00
Off ,
2022-04-11 13:00:18 +00:00
RAuto4_3_3_2 ,
2021-09-16 10:54:06 +00:00
R4_3 ,
R16_9 ,
MaxCount
2021-08-17 12:51:47 +00:00
} ;
2021-10-02 09:47:10 +00:00
enum class MemoryCardType
2021-08-17 12:51:47 +00:00
{
2021-10-02 09:47:10 +00:00
Empty ,
File ,
Folder ,
MaxCount
2021-08-17 12:51:47 +00:00
} ;
2022-01-14 19:43:15 +00:00
enum class MemoryCardFileType
{
Unknown ,
PS2_8MB ,
PS2_16MB ,
PS2_32MB ,
PS2_64MB ,
PS1 ,
MaxCount
} ;
2021-09-16 10:54:06 +00:00
enum class LimiterModeType : u8
{
Nominal ,
Turbo ,
Slomo ,
2021-12-18 14:43:50 +00:00
Unlimited ,
} ;
enum class GSRendererType : s8
{
Auto = - 1 ,
DX11 = 3 ,
Null = 11 ,
OGL = 12 ,
SW = 13 ,
2021-10-21 08:45:27 +00:00
VK = 14 ,
2021-11-19 06:25:51 +00:00
Metal = 17 ,
2022-03-19 12:19:16 +00:00
DX12 = 15 ,
2021-12-18 14:43:50 +00:00
} ;
enum class GSInterlaceMode : u8
{
Off ,
WeaveTFF ,
WeaveBFF ,
BobTFF ,
BobBFF ,
BlendTFF ,
BlendBFF ,
Automatic ,
Count
} ;
// Ordering was done to keep compatibility with older ini file.
enum class BiFiltering : u8
{
Nearest ,
Forced ,
PS2 ,
Forced_But_Sprite ,
} ;
2022-03-25 12:51:45 +00:00
enum class TriFiltering : s8
2021-12-18 14:43:50 +00:00
{
2022-03-25 12:51:45 +00:00
Automatic = - 1 ,
2021-12-18 14:43:50 +00:00
Off ,
PS2 ,
Forced ,
} ;
enum class HWMipmapLevel : s8
{
Automatic = - 1 ,
Off ,
Basic ,
Full
} ;
enum class CRCHackLevel : s8
{
Automatic = - 1 ,
Off ,
Minimum ,
Partial ,
Full ,
Aggressive
} ;
enum class AccBlendLevel : u8
{
Minimum ,
Basic ,
Medium ,
High ,
Full ,
2022-04-24 12:37:34 +00:00
Maximum ,
2021-09-16 10:54:06 +00:00
} ;
2022-01-23 05:19:06 +00:00
enum class TexturePreloadingLevel : u8
{
Off ,
Partial ,
Full ,
} ;
2022-05-16 11:10:34 +00:00
enum class GSDumpCompressionMethod : u8
{
Uncompressed ,
2022-05-16 12:33:47 +00:00
LZMA ,
Zstandard ,
2022-05-16 11:10:34 +00:00
} ;
2022-06-06 11:01:31 +00:00
enum class GSHardwareDownloadMode : u8
{
Enabled ,
NoReadbacks ,
Unsynchronized ,
Disabled
} ;
2016-11-05 18:31:41 +00:00
// Template function for casting enumerations to their underlying type
template < typename Enumeration >
typename std : : underlying_type < Enumeration > : : type enum_cast ( Enumeration E )
{
return static_cast < typename std : : underlying_type < Enumeration > : : type > ( E ) ;
}
2021-10-05 01:59:03 +00:00
ImplementEnumOperators ( GamefixId ) ;
ImplementEnumOperators ( SpeedhackId ) ;
2010-06-15 14:13:23 +00:00
2009-08-15 06:17:43 +00:00
//------------ DEFAULT sseMXCSR VALUES ---------------
2021-10-05 01:59:03 +00:00
# define DEFAULT_sseMXCSR 0xffc0 //FPU rounding > DaZ, FtZ, "chop"
# define DEFAULT_sseVUMXCSR 0xffc0 //VU rounding > DaZ, FtZ, "chop"
2022-09-08 13:08:10 +00:00
# define SYSTEM_sseMXCSR 0x1f80
2009-08-15 06:17:43 +00:00
2009-11-10 17:53:22 +00:00
// --------------------------------------------------------------------------------------
// TraceFiltersEE
// --------------------------------------------------------------------------------------
struct TraceFiltersEE
{
BITFIELD32 ( )
bool
2021-10-05 01:59:03 +00:00
m_EnableAll : 1 , // Master Enable switch (if false, no logs at all)
m_EnableDisasm : 1 ,
m_EnableRegisters : 1 ,
m_EnableEvents : 1 ; // Enables logging of event-driven activity -- counters, DMAs, etc.
2009-11-10 17:53:22 +00:00
BITFIELD_END
2009-11-12 12:51:00 +00:00
2009-11-10 17:53:22 +00:00
TraceFiltersEE ( )
{
bitset = 0 ;
}
2021-10-05 01:59:03 +00:00
bool operator = = ( const TraceFiltersEE & right ) const
2009-11-10 17:53:22 +00:00
{
2021-10-05 01:59:03 +00:00
return OpEqu ( bitset ) ;
2009-11-10 17:53:22 +00:00
}
2021-10-05 01:59:03 +00:00
bool operator ! = ( const TraceFiltersEE & right ) const
2009-11-10 17:53:22 +00:00
{
2021-10-05 01:59:03 +00:00
return ! this - > operator = = ( right ) ;
2009-11-10 17:53:22 +00:00
}
} ;
// --------------------------------------------------------------------------------------
// TraceFiltersIOP
// --------------------------------------------------------------------------------------
struct TraceFiltersIOP
{
BITFIELD32 ( )
bool
2021-10-05 01:59:03 +00:00
m_EnableAll : 1 , // Master Enable switch (if false, no logs at all)
m_EnableDisasm : 1 ,
m_EnableRegisters : 1 ,
m_EnableEvents : 1 ; // Enables logging of event-driven activity -- counters, DMAs, etc.
2009-11-10 17:53:22 +00:00
BITFIELD_END
TraceFiltersIOP ( )
{
bitset = 0 ;
}
2021-10-05 01:59:03 +00:00
bool operator = = ( const TraceFiltersIOP & right ) const
2009-11-10 17:53:22 +00:00
{
2021-10-05 01:59:03 +00:00
return OpEqu ( bitset ) ;
2009-11-10 17:53:22 +00:00
}
2021-10-05 01:59:03 +00:00
bool operator ! = ( const TraceFiltersIOP & right ) const
2009-11-10 17:53:22 +00:00
{
2021-10-05 01:59:03 +00:00
return ! this - > operator = = ( right ) ;
2009-11-10 17:53:22 +00:00
}
} ;
// --------------------------------------------------------------------------------------
// TraceLogFilters
// --------------------------------------------------------------------------------------
struct TraceLogFilters
{
// Enabled - global toggle for high volume logging. This is effectively the equivalent to
// (EE.Enabled() || IOP.Enabled() || SIF) -- it's cached so that we can use the macros
// below to inline the conditional check. This is desirable because these logs are
// *very* high volume, and debug builds get noticably slower if they have to invoke
// methods/accessors to test the log enable bits. Debug builds are slow enough already,
// so I prefer this to help keep them usable.
2021-10-05 01:59:03 +00:00
bool Enabled ;
2009-11-10 17:53:22 +00:00
2021-10-05 01:59:03 +00:00
TraceFiltersEE EE ;
TraceFiltersIOP IOP ;
2009-11-10 17:53:22 +00:00
TraceLogFilters ( )
{
2021-10-05 01:59:03 +00:00
Enabled = false ;
2009-11-10 17:53:22 +00:00
}
2021-10-05 01:59:03 +00:00
void LoadSave ( SettingsWrapper & ini ) ;
2009-11-12 12:51:00 +00:00
2021-10-05 01:59:03 +00:00
bool operator = = ( const TraceLogFilters & right ) const
2009-11-10 17:53:22 +00:00
{
2021-10-05 01:59:03 +00:00
return OpEqu ( Enabled ) & & OpEqu ( EE ) & & OpEqu ( IOP ) ;
2009-11-10 17:53:22 +00:00
}
2021-10-05 01:59:03 +00:00
bool operator ! = ( const TraceLogFilters & right ) const
2009-11-10 17:53:22 +00:00
{
2021-10-05 01:59:03 +00:00
return ! this - > operator = = ( right ) ;
2009-11-10 17:53:22 +00:00
}
} ;
2009-09-16 17:23:02 +00:00
// --------------------------------------------------------------------------------------
// Pcsx2Config class
// --------------------------------------------------------------------------------------
2009-08-04 13:00:28 +00:00
// This is intended to be a public class library between the core emulator and GUI only.
2009-09-05 12:02:07 +00:00
//
2009-08-04 13:00:28 +00:00
// When GUI code performs modifications of this class, it must be done with strict thread
// safety, since the emu runs on a separate thread. Additionally many components of the
// class require special emu-side resets or state save/recovery to be applied. Please
// use the provided functions to lock the emulation into a safe state and then apply
// chances on the necessary scope (see Core_Pause, Core_ApplySettings, and Core_Resume).
2009-04-27 02:04:31 +00:00
//
2009-11-10 17:53:22 +00:00
struct Pcsx2Config
2009-04-27 02:04:31 +00:00
{
2009-08-04 13:00:28 +00:00
struct ProfilerOptions
2009-04-27 02:04:31 +00:00
{
2009-08-18 19:47:00 +00:00
BITFIELD32 ( )
2021-10-05 01:59:03 +00:00
bool
Enabled : 1 , // universal toggle for the profiler.
RecBlocks_EE : 1 , // Enables per-block profiling for the EE recompiler [unimplemented]
RecBlocks_IOP : 1 , // Enables per-block profiling for the IOP recompiler [unimplemented]
RecBlocks_VU0 : 1 , // Enables per-block profiling for the VU0 recompiler [unimplemented]
RecBlocks_VU1 : 1 ; // Enables per-block profiling for the VU1 recompiler [unimplemented]
2009-09-16 17:23:02 +00:00
BITFIELD_END
2009-08-18 19:47:00 +00:00
// Default is Disabled, with all recs enabled underneath.
2021-10-05 01:59:03 +00:00
ProfilerOptions ( )
: bitset ( 0xfffffffe )
{
}
void LoadSave ( SettingsWrapper & wrap ) ;
2009-08-15 06:17:43 +00:00
2021-10-05 01:59:03 +00:00
bool operator = = ( const ProfilerOptions & right ) const
2009-08-15 06:17:43 +00:00
{
2021-10-05 01:59:03 +00:00
return OpEqu ( bitset ) ;
2009-08-15 06:17:43 +00:00
}
2021-10-05 01:59:03 +00:00
bool operator ! = ( const ProfilerOptions & right ) const
2009-08-15 06:17:43 +00:00
{
2021-10-05 01:59:03 +00:00
return ! OpEqu ( bitset ) ;
2009-08-15 06:17:43 +00:00
}
2009-04-27 02:04:31 +00:00
} ;
2009-08-18 19:47:00 +00:00
2009-08-04 13:00:28 +00:00
// ------------------------------------------------------------------------
struct RecompilerOptions
2009-04-27 02:04:31 +00:00
{
2009-08-18 19:47:00 +00:00
BITFIELD32 ( )
2021-10-05 01:59:03 +00:00
bool
EnableEE : 1 ,
EnableIOP : 1 ,
EnableVU0 : 1 ,
EnableVU1 : 1 ;
bool
vuOverflow : 1 ,
vuExtraOverflow : 1 ,
vuSignOverflow : 1 ,
vuUnderflow : 1 ;
bool
fpuOverflow : 1 ,
fpuExtraOverflow : 1 ,
fpuFullMode : 1 ;
bool
StackFrameChecks : 1 ,
PreBlockCheckEE : 1 ,
PreBlockCheckIOP : 1 ;
bool
EnableEECache : 1 ;
2009-09-16 17:23:02 +00:00
BITFIELD_END
2009-09-05 12:02:07 +00:00
2009-11-01 11:27:50 +00:00
RecompilerOptions ( ) ;
2009-11-01 16:49:20 +00:00
void ApplySanityCheck ( ) ;
2009-11-01 11:27:50 +00:00
2021-10-05 01:59:03 +00:00
void LoadSave ( SettingsWrapper & wrap ) ;
2009-07-07 20:53:32 +00:00
2021-10-05 01:59:03 +00:00
bool operator = = ( const RecompilerOptions & right ) const
2009-08-15 06:17:43 +00:00
{
2021-10-05 01:59:03 +00:00
return OpEqu ( bitset ) ;
2009-08-15 06:17:43 +00:00
}
2021-10-05 01:59:03 +00:00
bool operator ! = ( const RecompilerOptions & right ) const
2009-08-15 06:17:43 +00:00
{
2021-10-05 01:59:03 +00:00
return ! OpEqu ( bitset ) ;
2009-08-15 06:17:43 +00:00
}
2022-09-17 12:45:03 +00:00
u32 GetEEClampMode ( ) const
{
return fpuFullMode ? 3 : ( fpuExtraOverflow ? 2 : ( fpuOverflow ? 1 : 0 ) ) ;
}
void SetEEClampMode ( u32 value )
{
fpuOverflow = ( value > = 1 ) ;
fpuExtraOverflow = ( value > = 2 ) ;
fpuFullMode = ( value > = 3 ) ;
}
u32 GetVUClampMode ( ) const
{
return vuSignOverflow ? 3 : ( vuExtraOverflow ? 2 : ( vuOverflow ? 1 : 0 ) ) ;
}
void SetVUClampMode ( u32 value )
{
vuOverflow = ( value > = 1 ) ;
vuExtraOverflow = ( value > = 2 ) ;
vuSignOverflow = ( value > = 3 ) ;
}
2010-09-26 19:51:54 +00:00
} ;
2009-04-27 02:04:31 +00:00
2009-07-07 20:53:32 +00:00
// ------------------------------------------------------------------------
2009-08-04 08:21:10 +00:00
struct CpuOptions
2009-04-27 02:04:31 +00:00
{
2009-08-15 06:17:43 +00:00
RecompilerOptions Recompiler ;
2009-11-02 07:00:59 +00:00
SSE_MXCSR sseMXCSR ;
SSE_MXCSR sseVUMXCSR ;
2009-04-27 02:04:31 +00:00
2021-10-31 09:59:31 +00:00
u32 AffinityControlMode ;
2009-08-18 19:47:00 +00:00
CpuOptions ( ) ;
2021-10-05 01:59:03 +00:00
void LoadSave ( SettingsWrapper & wrap ) ;
2009-11-02 07:00:59 +00:00
void ApplySanityCheck ( ) ;
2009-11-12 12:51:00 +00:00
2022-04-03 04:02:06 +00:00
bool CpusChanged ( const CpuOptions & right ) const ;
2021-10-05 01:59:03 +00:00
bool operator = = ( const CpuOptions & right ) const
2009-08-15 06:17:43 +00:00
{
2021-10-31 09:59:31 +00:00
return OpEqu ( sseMXCSR ) & & OpEqu ( sseVUMXCSR ) & & OpEqu ( AffinityControlMode ) & & OpEqu ( Recompiler ) ;
2009-08-15 06:17:43 +00:00
}
2021-10-05 01:59:03 +00:00
bool operator ! = ( const CpuOptions & right ) const
2009-08-15 06:17:43 +00:00
{
2021-10-05 01:59:03 +00:00
return ! this - > operator = = ( right ) ;
2009-08-15 06:17:43 +00:00
}
2009-04-27 02:04:31 +00:00
} ;
2009-07-07 20:53:32 +00:00
// ------------------------------------------------------------------------
2009-12-03 15:51:39 +00:00
struct GSOptions
2009-04-27 02:04:31 +00:00
{
2021-12-18 14:43:50 +00:00
static const char * AspectRatioNames [ ] ;
static const char * FMVAspectRatioSwitchNames [ ] ;
static const char * GetRendererName ( GSRendererType type ) ;
2022-09-08 13:08:10 +00:00
static constexpr float DEFAULT_FRAME_RATE_NTSC = 59.94f ;
static constexpr float DEFAULT_FRAME_RATE_PAL = 50.00f ;
2021-12-18 14:43:50 +00:00
union
{
u64 bitset ;
struct
{
bool
2022-06-14 22:54:08 +00:00
PCRTCAntiBlur : 1 ,
2022-06-05 17:03:13 +00:00
DisableInterlaceOffset : 1 ,
2022-04-10 14:30:55 +00:00
PCRTCOffsets : 1 ,
2022-06-05 17:03:13 +00:00
PCRTCOverscan : 1 ,
2021-12-18 14:43:50 +00:00
IntegerScaling : 1 ,
LinearPresent : 1 ,
2022-02-06 12:17:48 +00:00
SyncToHostRefreshRate : 1 ,
2021-12-18 14:43:50 +00:00
UseDebugDevice : 1 ,
UseBlitSwapChain : 1 ,
DisableShaderCache : 1 ,
2021-12-31 07:29:26 +00:00
DisableDualSourceBlend : 1 ,
2022-03-07 14:36:05 +00:00
DisableFramebufferFetch : 1 ,
2021-10-21 08:45:14 +00:00
ThreadedPresentation : 1 ,
2022-01-09 09:27:19 +00:00
SkipDuplicateFrames : 1 ,
2021-12-18 14:43:50 +00:00
OsdShowMessages : 1 ,
OsdShowSpeed : 1 ,
OsdShowFPS : 1 ,
OsdShowCPU : 1 ,
2022-03-11 12:05:38 +00:00
OsdShowGPU : 1 ,
2021-12-18 14:43:50 +00:00
OsdShowResolution : 1 ,
2022-02-23 11:52:18 +00:00
OsdShowGSStats : 1 ,
2022-09-17 12:45:03 +00:00
OsdShowIndicators : 1 ,
OsdShowSettings : 1 ,
OsdShowInputs : 1 ;
2021-12-18 14:43:50 +00:00
bool
GPUPaletteConversion : 1 ,
AutoFlushSW : 1 ,
PreloadFrameWithGSData : 1 ,
WrapGSMem : 1 ,
Mipmap : 1 ,
2022-03-03 13:55:27 +00:00
PointListPalette : 1 ,
2022-03-03 12:36:05 +00:00
ManualUserHacks : 1 ,
2021-12-18 14:43:50 +00:00
UserHacks_AlignSpriteX : 1 ,
UserHacks_AutoFlush : 1 ,
UserHacks_CPUFBConversion : 1 ,
UserHacks_DisableDepthSupport : 1 ,
UserHacks_DisablePartialInvalidation : 1 ,
UserHacks_DisableSafeFeatures : 1 ,
UserHacks_MergePPSprite : 1 ,
UserHacks_WildHack : 1 ,
UserHacks_TextureInsideRt : 1 ,
FXAA : 1 ,
ShadeBoost : 1 ,
ShaderFX : 1 ,
DumpGSData : 1 ,
SaveRT : 1 ,
SaveFrame : 1 ,
SaveTexture : 1 ,
2022-02-19 14:20:18 +00:00
SaveDepth : 1 ,
DumpReplaceableTextures : 1 ,
DumpReplaceableMipmaps : 1 ,
DumpTexturesWithFMVActive : 1 ,
2022-05-11 10:36:04 +00:00
DumpDirectTextures : 1 ,
DumpPaletteTextures : 1 ,
2022-02-19 14:20:18 +00:00
LoadTextureReplacements : 1 ,
LoadTextureReplacementsAsync : 1 ,
PrecacheTextureReplacements : 1 ;
2021-12-18 14:43:50 +00:00
} ;
} ;
2021-10-05 01:59:03 +00:00
int VsyncQueueSize { 2 } ;
2018-03-04 14:03:50 +00:00
2021-08-30 07:10:48 +00:00
// forces the MTGS to execute tags/tasks in fully blocking/synchronous
// style. Useful for debugging potential bugs in the MTGS pipeline.
2021-10-05 01:59:03 +00:00
bool SynchronousMTGS { false } ;
bool FrameLimitEnable { true } ;
2009-07-08 01:10:59 +00:00
2021-10-05 01:59:03 +00:00
VsyncMode VsyncEnable { VsyncMode : : Off } ;
2010-04-25 00:31:27 +00:00
2022-09-08 13:08:10 +00:00
float LimitScalar { 1.0f } ;
float FramerateNTSC { DEFAULT_FRAME_RATE_NTSC } ;
float FrameratePAL { DEFAULT_FRAME_RATE_PAL } ;
2009-12-03 15:51:39 +00:00
2022-04-11 13:00:18 +00:00
AspectRatioType AspectRatio { AspectRatioType : : RAuto4_3_3_2 } ;
2021-09-16 10:54:06 +00:00
FMVAspectRatioSwitchType FMVAspectRatioSwitch { FMVAspectRatioSwitchType : : Off } ;
2021-12-18 14:43:50 +00:00
GSInterlaceMode InterlaceMode { GSInterlaceMode : : Automatic } ;
2021-09-16 10:54:06 +00:00
2022-09-08 13:08:10 +00:00
float Zoom { 100.0f } ;
float StretchY { 100.0f } ;
2022-06-29 12:45:01 +00:00
# ifndef PCSX2_CORE
2022-09-08 13:08:10 +00:00
float OffsetX { 0.0f } ;
float OffsetY { 0.0f } ;
2022-06-29 12:45:01 +00:00
# else
int Crop [ 4 ] { } ;
# endif
2021-09-16 10:54:06 +00:00
2022-09-08 13:08:10 +00:00
float OsdScale { 100.0 } ;
2021-12-18 14:43:50 +00:00
GSRendererType Renderer { GSRendererType : : Auto } ;
2022-07-19 10:46:59 +00:00
float UpscaleMultiplier { 1.0f } ;
2021-12-18 14:43:50 +00:00
HWMipmapLevel HWMipmap { HWMipmapLevel : : Automatic } ;
AccBlendLevel AccurateBlendingUnit { AccBlendLevel : : Basic } ;
CRCHackLevel CRCHack { CRCHackLevel : : Automatic } ;
BiFiltering TextureFiltering { BiFiltering : : PS2 } ;
2022-07-02 13:16:12 +00:00
TexturePreloadingLevel TexturePreloading { TexturePreloadingLevel : : Full } ;
2022-08-12 08:29:11 +00:00
GSDumpCompressionMethod GSDumpCompression { GSDumpCompressionMethod : : LZMA } ;
2022-06-06 11:01:31 +00:00
GSHardwareDownloadMode HWDownloadMode { GSHardwareDownloadMode : : Enabled } ;
2021-12-18 14:43:50 +00:00
int Dithering { 2 } ;
int MaxAnisotropy { 0 } ;
int SWExtraThreads { 2 } ;
int SWExtraThreadsHeight { 4 } ;
int TVShader { 0 } ;
2022-03-03 12:36:05 +00:00
int SkipDrawStart { 0 } ;
int SkipDrawEnd { 0 } ;
2021-12-18 14:43:50 +00:00
int UserHacks_HalfBottomOverride { - 1 } ;
int UserHacks_HalfPixelOffset { 0 } ;
int UserHacks_RoundSprite { 0 } ;
int UserHacks_TCOffsetX { 0 } ;
int UserHacks_TCOffsetY { 0 } ;
2022-06-02 15:00:39 +00:00
int UserHacks_CPUSpriteRenderBW { 0 } ;
2022-10-01 03:32:31 +00:00
TriFiltering TriFilter { TriFiltering : : Automatic } ;
2022-01-05 11:13:27 +00:00
int OverrideTextureBarriers { - 1 } ;
int OverrideGeometryShaders { - 1 } ;
2021-12-18 14:43:50 +00:00
int ShadeBoost_Brightness { 50 } ;
int ShadeBoost_Contrast { 50 } ;
int ShadeBoost_Saturation { 50 } ;
int SaveN { 0 } ;
int SaveL { 5000 } ;
std : : string Adapter ;
std : : string ShaderFX_Conf ;
std : : string ShaderFX_GLSL ;
GSOptions ( ) ;
2017-07-14 13:10:46 +00:00
2021-12-18 14:43:50 +00:00
void LoadSave ( SettingsWrapper & wrap ) ;
2021-10-05 01:59:03 +00:00
2021-12-18 14:43:50 +00:00
# ifndef PCSX2_CORE
/// Because some GS settings are stored in a separate INI in wx, we need a way to reload them.
/// This is because the SettingsWrapper is only created on full save/load.
void ReloadIniSettings ( ) ;
# else
void LoadSaveIniSettings ( SettingsWrapper & wrap ) ;
# endif
2021-10-05 01:59:03 +00:00
2021-12-18 14:43:50 +00:00
/// Sets user hack values to defaults when user hacks are not enabled.
void MaskUserHacks ( ) ;
2021-10-05 01:59:03 +00:00
2022-03-03 11:32:32 +00:00
/// Sets user hack values to defaults when upscaling is not enabled.
void MaskUpscalingHacks ( ) ;
2021-12-18 14:43:50 +00:00
/// Returns true if any of the hardware renderers are selected.
bool UseHardwareRenderer ( ) const ;
2021-10-19 02:00:02 +00:00
2021-12-18 14:43:50 +00:00
/// Returns false if the compared to the old settings, we need to reopen GS.
/// (i.e. renderer change, swap chain mode change, etc.)
bool RestartOptionsAreEqual ( const GSOptions & right ) const ;
2021-10-19 02:00:02 +00:00
2021-12-18 14:43:50 +00:00
/// Returns false if any options need to be applied to the MTGS.
bool OptionsAreEqual ( const GSOptions & right ) const ;
2009-09-09 14:08:15 +00:00
2021-12-18 14:43:50 +00:00
bool operator = = ( const GSOptions & right ) const ;
bool operator ! = ( const GSOptions & right ) const ;
2009-04-27 02:04:31 +00:00
} ;
2021-12-18 14:23:43 +00:00
struct SPU2Options
{
enum class InterpolationMode
{
Nearest ,
Linear ,
Cubic ,
Hermite ,
CatmullRom ,
Gaussian
} ;
enum class SynchronizationMode
{
TimeStretch ,
ASync ,
NoSync ,
} ;
BITFIELD32 ( )
bool
AdvancedVolumeControl : 1 ;
BITFIELD_END
InterpolationMode Interpolation = InterpolationMode : : Gaussian ;
SynchronizationMode SynchMode = SynchronizationMode : : TimeStretch ;
s32 FinalVolume = 100 ;
s32 Latency { 100 } ;
s32 SpeakerConfiguration { 0 } ;
2022-08-14 01:23:52 +00:00
s32 DplDecodingLevel { 0 } ;
2021-12-18 14:23:43 +00:00
2022-09-08 13:08:10 +00:00
float VolumeAdjustC { 0.0f } ;
float VolumeAdjustFL { 0.0f } ;
float VolumeAdjustFR { 0.0f } ;
float VolumeAdjustBL { 0.0f } ;
float VolumeAdjustBR { 0.0f } ;
float VolumeAdjustSL { 0.0f } ;
float VolumeAdjustSR { 0.0f } ;
float VolumeAdjustLFE { 0.0f } ;
2021-12-18 14:23:43 +00:00
std : : string OutputModule ;
2022-10-01 03:23:25 +00:00
std : : string BackendName ;
2021-12-18 14:23:43 +00:00
SPU2Options ( ) ;
void LoadSave ( SettingsWrapper & wrap ) ;
bool operator = = ( const SPU2Options & right ) const
{
return OpEqu ( bitset ) & &
OpEqu ( Interpolation ) & &
OpEqu ( SynchMode ) & &
OpEqu ( FinalVolume ) & &
OpEqu ( Latency ) & &
OpEqu ( SpeakerConfiguration ) & &
2022-08-14 01:23:52 +00:00
OpEqu ( DplDecodingLevel ) & &
2021-12-18 14:23:43 +00:00
OpEqu ( VolumeAdjustC ) & &
OpEqu ( VolumeAdjustFL ) & &
OpEqu ( VolumeAdjustFR ) & &
OpEqu ( VolumeAdjustBL ) & &
OpEqu ( VolumeAdjustBR ) & &
OpEqu ( VolumeAdjustSL ) & &
OpEqu ( VolumeAdjustSR ) & &
OpEqu ( VolumeAdjustLFE ) & &
2022-10-01 03:23:25 +00:00
OpEqu ( OutputModule ) & &
OpEqu ( BackendName ) ;
2021-12-18 14:23:43 +00:00
}
bool operator ! = ( const SPU2Options & right ) const
{
return ! this - > operator = = ( right ) ;
}
} ;
2022-02-07 23:38:50 +00:00
struct DEV9Options
{
enum struct NetApi : int
{
Unset = 0 ,
PCAP_Bridged = 1 ,
PCAP_Switched = 2 ,
TAP = 3 ,
2021-02-27 19:37:48 +00:00
Sockets = 4 ,
2022-02-07 23:38:50 +00:00
} ;
static const char * NetApiNames [ ] ;
2022-03-07 20:39:51 +00:00
enum struct DnsMode : int
{
Manual = 0 ,
Auto = 1 ,
Internal = 2 ,
} ;
static const char * DnsModeNames [ ] ;
2022-03-07 20:40:40 +00:00
# ifdef PCSX2_CORE
struct HostEntry
{
std : : string Url ;
std : : string Desc ;
u8 Address [ 4 ] { } ;
bool Enabled ;
bool operator = = ( const HostEntry & right ) const
{
return OpEqu ( Url ) & &
OpEqu ( Desc ) & &
( * ( int * ) Address = = * ( int * ) right . Address ) & &
OpEqu ( Enabled ) ;
}
bool operator ! = ( const HostEntry & right ) const
{
return ! this - > operator = = ( right ) ;
}
} ;
# endif
2022-02-07 23:38:50 +00:00
bool EthEnable { false } ;
NetApi EthApi { NetApi : : Unset } ;
std : : string EthDevice ;
bool EthLogDNS { false } ;
bool InterceptDHCP { false } ;
u8 PS2IP [ 4 ] { } ;
u8 Mask [ 4 ] { } ;
u8 Gateway [ 4 ] { } ;
u8 DNS1 [ 4 ] { } ;
u8 DNS2 [ 4 ] { } ;
bool AutoMask { true } ;
bool AutoGateway { true } ;
2022-03-07 20:39:51 +00:00
DnsMode ModeDNS1 { DnsMode : : Auto } ;
DnsMode ModeDNS2 { DnsMode : : Auto } ;
2022-02-07 23:38:50 +00:00
2022-03-07 20:40:40 +00:00
# ifdef PCSX2_CORE
std : : vector < HostEntry > EthHosts ;
# endif
2022-02-07 23:38:50 +00:00
bool HddEnable { false } ;
std : : string HddFile ;
/* The PS2's HDD max size is 2TB
* which is 2 ^ 32 * 512 byte sectors
* Note that we don ' t yet support
* 48 bit LBA , so our limit is lower */
2022-03-06 20:12:55 +00:00
uint HddSizeSectors { 40 * ( 1024 * 1024 * 1024 / 512 ) } ;
2022-02-07 23:38:50 +00:00
DEV9Options ( ) ;
void LoadSave ( SettingsWrapper & wrap ) ;
bool operator = = ( const DEV9Options & right ) const
{
return OpEqu ( EthEnable ) & &
OpEqu ( EthApi ) & &
OpEqu ( EthDevice ) & &
OpEqu ( EthLogDNS ) & &
OpEqu ( InterceptDHCP ) & &
( * ( int * ) PS2IP = = * ( int * ) right . PS2IP ) & &
( * ( int * ) Gateway = = * ( int * ) right . Gateway ) & &
( * ( int * ) DNS1 = = * ( int * ) right . DNS1 ) & &
( * ( int * ) DNS2 = = * ( int * ) right . DNS2 ) & &
OpEqu ( AutoMask ) & &
OpEqu ( AutoGateway ) & &
2022-03-07 20:39:51 +00:00
OpEqu ( ModeDNS1 ) & &
OpEqu ( ModeDNS2 ) & &
2022-02-07 23:38:50 +00:00
2022-03-07 20:40:40 +00:00
# ifdef PCSX2_CORE
OpEqu ( EthHosts ) & &
# endif
2022-02-07 23:38:50 +00:00
OpEqu ( HddEnable ) & &
OpEqu ( HddFile ) & &
OpEqu ( HddSizeSectors ) ;
}
bool operator ! = ( const DEV9Options & right ) const
{
return ! this - > operator = = ( right ) ;
}
protected :
static void LoadIPHelper ( u8 * field , const std : : string & setting ) ;
static std : : string SaveIPHelper ( u8 * field ) ;
} ;
2009-07-07 20:53:32 +00:00
// ------------------------------------------------------------------------
2009-09-08 13:14:34 +00:00
// NOTE: The GUI's GameFixes panel is dependent on the order of bits in this structure.
2009-04-27 02:04:31 +00:00
struct GamefixOptions
{
2021-07-13 12:54:54 +00:00
BITFIELD32 ( )
2021-10-05 01:59:03 +00:00
bool
FpuMulHack : 1 , // Tales of Destiny hangs.
FpuNegDivHack : 1 , // Gundam games messed up camera-view.
GoemonTlbHack : 1 , // Gomeon tlb miss hack. The game need to access unmapped virtual address. Instead to handle it as exception, tlb are preloaded at startup
2021-12-18 14:43:50 +00:00
SoftwareRendererFMVHack : 1 , // Switches to software renderer for FMVs
2021-10-05 01:59:03 +00:00
SkipMPEGHack : 1 , // Skips MPEG videos (Katamari and other games need this)
OPHFlagHack : 1 , // Bleach Blade Battlers
EETimingHack : 1 , // General purpose timing hack.
DMABusyHack : 1 , // Denies writes to the DMAC when it's busy. This is correct behaviour but bad timing can cause problems.
GIFFIFOHack : 1 , // Enabled the GIF FIFO (more correct but slower)
VIFFIFOHack : 1 , // Pretends to fill the non-existant VIF FIFO Buffer.
VIF1StallHack : 1 , // Like above, processes FIFO data before the stall is allowed (to make sure data goes over).
VuAddSubHack : 1 , // Tri-ace games, they use an encryption algorithm that requires VU ADDI opcode to be bit-accurate.
IbitHack : 1 , // I bit hack. Needed to stop constant VU recompilation in some games
2022-02-27 21:58:42 +00:00
VUSyncHack : 1 , // Makes microVU run behind the EE to avoid VU register reading/writing sync issues. Useful for M-Bit games
2021-10-05 01:59:03 +00:00
VUOverflowHack : 1 , // Tries to simulate overflow flag checks (not really possible on x86 without soft floats)
2022-04-23 06:37:11 +00:00
XgKickHack : 1 , // Erementar Gerad, adds more delay to VU XGkick instructions. Corrects the color of some graphics, but breaks Tri-ace games and others.
BlitInternalFPSHack : 1 ; // Disables privileged register write-based FPS detection.
2009-09-16 17:23:02 +00:00
BITFIELD_END
2009-08-18 19:47:00 +00:00
2010-09-29 13:48:36 +00:00
GamefixOptions ( ) ;
2021-10-05 01:59:03 +00:00
void LoadSave ( SettingsWrapper & wrap ) ;
2010-09-29 13:48:36 +00:00
GamefixOptions & DisableAll ( ) ;
2009-08-15 06:17:43 +00:00
2021-10-05 01:59:03 +00:00
bool Get ( GamefixId id ) const ;
void Set ( GamefixId id , bool enabled = true ) ;
void Clear ( GamefixId id ) { Set ( id , false ) ; }
2010-06-15 14:13:23 +00:00
2021-10-05 01:59:03 +00:00
bool operator = = ( const GamefixOptions & right ) const
2009-08-15 06:17:43 +00:00
{
2021-10-05 01:59:03 +00:00
return OpEqu ( bitset ) ;
2009-08-15 06:17:43 +00:00
}
2021-10-05 01:59:03 +00:00
bool operator ! = ( const GamefixOptions & right ) const
2009-08-15 06:17:43 +00:00
{
2021-10-05 01:59:03 +00:00
return ! OpEqu ( bitset ) ;
2009-08-15 06:17:43 +00:00
}
2009-04-27 02:04:31 +00:00
} ;
2009-07-08 01:10:59 +00:00
2009-07-07 20:53:32 +00:00
// ------------------------------------------------------------------------
2009-04-27 02:04:31 +00:00
struct SpeedhackOptions
{
2009-08-18 19:47:00 +00:00
BITFIELD32 ( )
2021-10-05 01:59:03 +00:00
bool
fastCDVD : 1 , // enables fast CDVD access
IntcStat : 1 , // tells Pcsx2 to fast-forward through intc_stat waits.
WaitLoop : 1 , // enables constant loop detection and fast-forwarding
vuFlagHack : 1 , // microVU specific flag hack
vuThread : 1 , // Enable Threaded VU1
vu1Instant : 1 ; // Enable Instant VU1 (Without MTVU only)
2009-09-16 17:23:02 +00:00
BITFIELD_END
2009-08-18 19:47:00 +00:00
2021-10-05 01:59:03 +00:00
s8 EECycleRate ; // EE cycle rate selector (1.0, 1.5, 2.0)
u8 EECycleSkip ; // EE Cycle skip factor (0, 1, 2, or 3)
2009-08-18 19:47:00 +00:00
SpeedhackOptions ( ) ;
2021-09-22 07:38:30 +00:00
void LoadSave ( SettingsWrapper & conf ) ;
2010-09-29 13:48:36 +00:00
SpeedhackOptions & DisableAll ( ) ;
2009-08-15 06:17:43 +00:00
2020-12-14 02:23:28 +00:00
void Set ( SpeedhackId id , bool enabled = true ) ;
2021-10-05 01:59:03 +00:00
bool operator = = ( const SpeedhackOptions & right ) const
2009-08-15 06:17:43 +00:00
{
2021-10-05 01:59:03 +00:00
return OpEqu ( bitset ) & & OpEqu ( EECycleRate ) & & OpEqu ( EECycleSkip ) ;
2009-08-15 06:17:43 +00:00
}
2021-10-05 01:59:03 +00:00
bool operator ! = ( const SpeedhackOptions & right ) const
2009-08-15 06:17:43 +00:00
{
2021-10-05 01:59:03 +00:00
return ! this - > operator = = ( right ) ;
2009-08-15 06:17:43 +00:00
}
2009-04-27 02:04:31 +00:00
} ;
2009-11-12 12:51:00 +00:00
2014-02-24 10:48:06 +00:00
struct DebugOptions
{
BITFIELD32 ( )
2021-10-05 01:59:03 +00:00
bool
ShowDebuggerOnStart : 1 ;
bool
AlignMemoryWindowStart : 1 ;
2014-02-24 10:48:06 +00:00
BITFIELD_END
u8 FontWidth ;
u8 FontHeight ;
2015-12-28 16:41:19 +00:00
u32 WindowWidth ;
u32 WindowHeight ;
2017-04-15 07:41:40 +00:00
u32 MemoryViewBytesPerRow ;
2014-02-24 10:48:06 +00:00
DebugOptions ( ) ;
2021-10-05 01:59:03 +00:00
void LoadSave ( SettingsWrapper & wrap ) ;
bool operator = = ( const DebugOptions & right ) const
2014-02-24 10:48:06 +00:00
{
2021-10-05 01:59:03 +00:00
return OpEqu ( bitset ) & & OpEqu ( FontWidth ) & & OpEqu ( FontHeight ) & & OpEqu ( WindowWidth ) & & OpEqu ( WindowHeight ) & & OpEqu ( MemoryViewBytesPerRow ) ;
2014-02-24 10:48:06 +00:00
}
2021-10-05 01:59:03 +00:00
bool operator ! = ( const DebugOptions & right ) const
2014-02-24 10:48:06 +00:00
{
2021-10-05 01:59:03 +00:00
return ! this - > operator = = ( right ) ;
2014-02-24 10:48:06 +00:00
}
} ;
2021-09-16 10:54:06 +00:00
// ------------------------------------------------------------------------
struct FramerateOptions
{
2022-09-08 13:08:10 +00:00
float NominalScalar { 1.0f } ;
float TurboScalar { 2.0f } ;
float SlomoScalar { 0.5f } ;
2021-09-16 10:54:06 +00:00
2021-09-22 07:38:30 +00:00
void LoadSave ( SettingsWrapper & wrap ) ;
2021-09-16 10:54:06 +00:00
void SanityCheck ( ) ;
2021-10-05 01:58:34 +00:00
bool operator = = ( const FramerateOptions & right ) const
{
2022-06-10 15:11:03 +00:00
return OpEqu ( NominalScalar ) & & OpEqu ( TurboScalar ) & & OpEqu ( SlomoScalar ) ;
2021-10-05 01:58:34 +00:00
}
bool operator ! = ( const FramerateOptions & right ) const
{
return ! this - > operator = = ( right ) ;
}
2021-09-16 10:54:06 +00:00
} ;
2021-09-16 10:14:42 +00:00
// ------------------------------------------------------------------------
struct FilenameOptions
{
2021-09-22 07:38:58 +00:00
std : : string Bios ;
2021-09-16 10:14:42 +00:00
2021-09-22 07:38:58 +00:00
FilenameOptions ( ) ;
2021-09-22 07:38:30 +00:00
void LoadSave ( SettingsWrapper & wrap ) ;
2021-09-16 10:14:42 +00:00
bool operator = = ( const FilenameOptions & right ) const
{
return OpEqu ( Bios ) ;
}
bool operator ! = ( const FilenameOptions & right ) const
{
return ! this - > operator = = ( right ) ;
}
} ;
2021-09-17 08:42:39 +00:00
// ------------------------------------------------------------------------
// Options struct for each memory card.
//
struct McdOptions
{
2021-10-05 01:59:03 +00:00
std : : string Filename ; // user-configured location of this memory card
bool Enabled ; // memory card enabled (if false, memcard will not show up in-game)
MemoryCardType Type ; // the memory card implementation that should be used
2021-09-17 08:42:39 +00:00
} ;
2022-04-18 13:35:14 +00:00
// ------------------------------------------------------------------------
# ifdef ENABLE_ACHIEVEMENTS
struct AchievementsOptions
{
BITFIELD32 ( )
bool
Enabled : 1 ,
TestMode : 1 ,
UnofficialTestMode : 1 ,
RichPresence : 1 ,
ChallengeMode : 1 ,
Leaderboards : 1 ,
2022-10-06 09:38:53 +00:00
SoundEffects : 1 ,
PrimedIndicators : 1 ;
2022-04-18 13:35:14 +00:00
BITFIELD_END
AchievementsOptions ( ) ;
void LoadSave ( SettingsWrapper & wrap ) ;
bool operator = = ( const AchievementsOptions & right ) const
{
return OpEqu ( bitset ) ;
}
bool operator ! = ( const AchievementsOptions & right ) const
{
return ! this - > operator = = ( right ) ;
}
} ;
# endif
// ------------------------------------------------------------------------
2009-08-18 19:47:00 +00:00
BITFIELD32 ( )
2021-10-05 01:59:03 +00:00
bool
CdvdVerboseReads : 1 , // enables cdvd read activity verbosely dumped to the console
CdvdDumpBlocks : 1 , // enables cdvd block dumping
CdvdShareWrite : 1 , // allows the iso to be modified while it's loaded
EnablePatches : 1 , // enables patch detection and application
EnableCheats : 1 , // enables cheat detection and application
2021-05-29 16:01:27 +00:00
EnablePINE : 1 , // enables inter-process communication
2021-10-05 01:59:03 +00:00
EnableWideScreenPatches : 1 ,
2022-05-01 05:47:00 +00:00
EnableNoInterlacingPatches : 1 ,
2022-04-03 23:41:41 +00:00
// TODO - Vaser - where are these settings exposed in the Qt UI?
2021-10-05 01:59:03 +00:00
EnableRecordingTools : 1 ,
2022-03-30 18:26:48 +00:00
# ifdef PCSX2_CORE
EnableGameFixes : 1 , // enables automatic game fixes
2022-05-07 12:56:44 +00:00
SaveStateOnShutdown : 1 , // default value for saving state on shutdown
2022-10-01 12:28:48 +00:00
EnableDiscordPresence : 1 , // enables discord rich presence integration
2022-10-02 13:05:05 +00:00
InhibitScreensaver : 1 ,
2018-07-03 00:40:44 +00:00
# endif
2010-04-27 13:12:03 +00:00
// when enabled uses BOOT2 injection, skipping sony bios splashes
2021-10-05 01:59:03 +00:00
UseBOOT2Injection : 1 ,
BackupSavestate : 1 ,
2022-04-12 08:41:22 +00:00
SavestateZstdCompression : 1 ,
2009-08-18 19:47:00 +00:00
// enables simulated ejection of memory cards when loading savestates
2021-10-05 01:59:03 +00:00
McdEnableEjection : 1 ,
McdFolderAutoManage : 1 ,
2009-09-13 17:11:35 +00:00
2021-10-05 01:59:03 +00:00
MultitapPort0_Enabled : 1 ,
MultitapPort1_Enabled : 1 ,
2009-11-12 12:51:00 +00:00
2021-10-05 01:59:03 +00:00
ConsoleToStdio : 1 ,
2022-08-01 05:32:21 +00:00
HostFs : 1 ,
WarnAboutUnsafeSettings : 1 ;
2021-09-17 08:42:39 +00:00
2021-10-05 01:59:03 +00:00
// uses automatic ntfs compression when creating new memory cards (Win32 only)
2022-05-19 14:46:33 +00:00
# ifdef _WIN32
2021-10-05 01:59:03 +00:00
bool McdCompressNTFS ;
2021-09-17 08:42:39 +00:00
# endif
2009-09-16 17:23:02 +00:00
BITFIELD_END
2009-07-08 01:10:59 +00:00
2021-10-05 01:59:03 +00:00
CpuOptions Cpu ;
GSOptions GS ;
SpeedhackOptions Speedhacks ;
GamefixOptions Gamefixes ;
ProfilerOptions Profiler ;
DebugOptions Debugger ;
FramerateOptions Framerate ;
2021-12-18 14:23:43 +00:00
SPU2Options SPU2 ;
2022-02-07 23:38:50 +00:00
DEV9Options DEV9 ;
2009-07-20 00:39:38 +00:00
2021-10-05 01:59:03 +00:00
TraceLogFilters Trace ;
2009-11-10 17:53:22 +00:00
2021-09-16 10:14:42 +00:00
FilenameOptions BaseFilenames ;
2021-09-17 08:42:39 +00:00
2022-04-18 13:35:14 +00:00
# ifdef ENABLE_ACHIEVEMENTS
AchievementsOptions Achievements ;
# endif
2021-09-17 08:42:39 +00:00
// Memorycard options - first 2 are default slots, last 6 are multitap 1 and 2
// slots (3 each)
McdOptions Mcd [ 8 ] ;
2021-09-21 10:05:11 +00:00
std : : string GzipIsoIndexTemplate ; // for quick-access index with gzipped ISO
2021-09-17 08:25:52 +00:00
2021-09-16 10:14:42 +00:00
// Set at runtime, not loaded from config.
2021-09-21 10:05:11 +00:00
std : : string CurrentBlockdump ;
std : : string CurrentIRX ;
std : : string CurrentGameArgs ;
2022-04-11 13:00:18 +00:00
AspectRatioType CurrentAspectRatio = AspectRatioType : : RAuto4_3_3_2 ;
2021-09-16 10:54:06 +00:00
LimiterModeType LimiterMode = LimiterModeType : : Nominal ;
2009-09-09 14:08:15 +00:00
2009-08-18 19:47:00 +00:00
Pcsx2Config ( ) ;
2021-09-22 07:38:30 +00:00
void LoadSave ( SettingsWrapper & wrap ) ;
void LoadSaveMemcards ( SettingsWrapper & wrap ) ;
2009-09-09 14:08:15 +00:00
2021-09-25 04:35:21 +00:00
std : : string FullpathToBios ( ) const ;
2022-05-19 14:46:33 +00:00
std : : string FullpathToMcd ( uint slot ) const ;
2021-09-16 10:14:42 +00:00
2021-10-05 01:59:03 +00:00
bool MultitapEnabled ( uint port ) const ;
2009-09-13 17:11:35 +00:00
2021-10-05 01:59:03 +00:00
bool operator = = ( const Pcsx2Config & right ) const ;
bool operator ! = ( const Pcsx2Config & right ) const
2009-09-09 14:08:15 +00:00
{
2021-10-05 01:59:03 +00:00
return ! this - > operator = = ( right ) ;
2009-09-09 14:08:15 +00:00
}
2021-09-16 10:14:42 +00:00
// You shouldn't assign to this class, because it'll mess with the runtime variables (Current...).
// But you can still use this to copy config. Only needed until we drop wx.
void CopyConfig ( const Pcsx2Config & cfg ) ;
2022-09-12 14:56:26 +00:00
/// Copies runtime configuration settings (e.g. frame limiter state).
void CopyRuntimeConfig ( Pcsx2Config & cfg ) ;
2009-08-04 08:21:10 +00:00
} ;
2009-07-20 00:39:38 +00:00
2021-09-15 21:52:00 +00:00
extern Pcsx2Config EmuConfig ;
2009-07-08 01:10:59 +00:00
2021-09-25 00:49:48 +00:00
namespace EmuFolders
{
2022-05-19 14:46:33 +00:00
extern std : : string AppRoot ;
extern std : : string DataRoot ;
extern std : : string Settings ;
extern std : : string Bios ;
extern std : : string Snapshots ;
extern std : : string Savestates ;
extern std : : string MemoryCards ;
extern std : : string Langs ;
extern std : : string Logs ;
extern std : : string Cheats ;
extern std : : string CheatsWS ;
2022-05-01 05:47:00 +00:00
extern std : : string CheatsNI ;
2022-05-19 14:46:33 +00:00
extern std : : string Resources ;
extern std : : string Cache ;
extern std : : string Covers ;
extern std : : string GameSettings ;
extern std : : string Textures ;
2022-04-02 12:17:26 +00:00
extern std : : string InputProfiles ;
2021-12-18 15:08:12 +00:00
// Assumes that AppRoot and DataRoot have been initialized.
2022-09-07 07:44:10 +00:00
void SetDefaults ( SettingsInterface & si ) ;
2021-12-18 15:08:12 +00:00
void LoadConfig ( SettingsInterface & si ) ;
2022-09-07 07:44:10 +00:00
bool EnsureFoldersExist ( ) ;
2021-10-05 01:59:03 +00:00
} // namespace EmuFolders
2021-09-25 00:49:48 +00:00
2009-08-04 08:21:10 +00:00
/////////////////////////////////////////////////////////////////////////////////////////
// Helper Macros for Reading Emu Configurations.
//
2009-04-27 02:04:31 +00:00
2009-08-04 08:21:10 +00:00
// ------------ CPU / Recompiler Options ---------------
2021-10-05 01:59:03 +00:00
# define THREAD_VU1 (EmuConfig.Cpu.Recompiler.EnableVU1 && EmuConfig.Speedhacks.vuThread)
# define INSTANT_VU1 (EmuConfig.Speedhacks.vu1Instant)
# define CHECK_EEREC (EmuConfig.Cpu.Recompiler.EnableEE)
# define CHECK_CACHE (EmuConfig.Cpu.Recompiler.EnableEECache)
# define CHECK_IOPREC (EmuConfig.Cpu.Recompiler.EnableIOP)
2009-08-04 08:21:10 +00:00
//------------ SPECIAL GAME FIXES!!! ---------------
2021-10-05 01:59:03 +00:00
# define CHECK_VUADDSUBHACK (EmuConfig.Gamefixes.VuAddSubHack) // Special Fix for Tri-ace games, they use an encryption algorithm that requires VU addi opcode to be bit-accurate.
# define CHECK_FPUMULHACK (EmuConfig.Gamefixes.FpuMulHack) // Special Fix for Tales of Destiny hangs.
# define CHECK_FPUNEGDIVHACK (EmuConfig.Gamefixes.FpuNegDivHack) // Special Fix for Gundam games messed up camera-view.
# define CHECK_XGKICKHACK (EmuConfig.Gamefixes.XgKickHack) // Special Fix for Erementar Gerad, adds more delay to VU XGkick instructions. Corrects the color of some graphics.
# define CHECK_EETIMINGHACK (EmuConfig.Gamefixes.EETimingHack) // Fix all scheduled events to happen in 1 cycle.
# define CHECK_SKIPMPEGHACK (EmuConfig.Gamefixes.SkipMPEGHack) // Finds sceMpegIsEnd pattern to tell the game the mpeg is finished (Katamari and a lot of games need this)
# define CHECK_OPHFLAGHACK (EmuConfig.Gamefixes.OPHFlagHack) // Bleach Blade Battlers
# define CHECK_DMABUSYHACK (EmuConfig.Gamefixes.DMABusyHack) // Denies writes to the DMAC when it's busy. This is correct behaviour but bad timing can cause problems.
# define CHECK_VIFFIFOHACK (EmuConfig.Gamefixes.VIFFIFOHack) // Pretends to fill the non-existant VIF FIFO Buffer.
# define CHECK_VIF1STALLHACK (EmuConfig.Gamefixes.VIF1StallHack) // Like above, processes FIFO data before the stall is allowed (to make sure data goes over).
# define CHECK_GIFFIFOHACK (EmuConfig.Gamefixes.GIFFIFOHack) // Enabled the GIF FIFO (more correct but slower)
# define CHECK_VUOVERFLOWHACK (EmuConfig.Gamefixes.VUOverflowHack) // Special Fix for Superman Returns, they check for overflows on PS2 floats which we can't do without soft floats.
2020-10-09 21:19:17 +00:00
2009-08-04 08:21:10 +00:00
//------------ Advanced Options!!! ---------------
2021-10-05 01:59:03 +00:00
# define CHECK_VU_OVERFLOW (EmuConfig.Cpu.Recompiler.vuOverflow)
# define CHECK_VU_EXTRA_OVERFLOW (EmuConfig.Cpu.Recompiler.vuExtraOverflow) // If enabled, Operands are clamped before being used in the VU recs
# define CHECK_VU_SIGN_OVERFLOW (EmuConfig.Cpu.Recompiler.vuSignOverflow)
# define CHECK_VU_UNDERFLOW (EmuConfig.Cpu.Recompiler.vuUnderflow)
2009-08-04 13:00:28 +00:00
2021-10-05 01:59:03 +00:00
# define CHECK_FPU_OVERFLOW (EmuConfig.Cpu.Recompiler.fpuOverflow)
# define CHECK_FPU_EXTRA_OVERFLOW (EmuConfig.Cpu.Recompiler.fpuExtraOverflow) // If enabled, Operands are checked for infinities before being used in the FPU recs
# define CHECK_FPU_EXTRA_FLAGS 1 // Always enabled now // Sets D/I flags on FPU instructions
# define CHECK_FPU_FULL (EmuConfig.Cpu.Recompiler.fpuFullMode)
2009-08-04 08:21:10 +00:00
//------------ EE Recompiler defines - Comment to disable a recompiler ---------------
2021-10-05 01:59:03 +00:00
# define SHIFT_RECOMPILE // Speed majorly reduced if disabled
# define BRANCH_RECOMPILE // Speed extremely reduced if disabled - more then shift
2009-08-04 08:21:10 +00:00
// Disabling all the recompilers in this block is interesting, as it still runs at a reasonable rate.
// It also adds a few glitches. Really reminds me of the old Linux 64-bit version. --arcum42
# define ARITHMETICIMM_RECOMPILE
# define ARITHMETIC_RECOMPILE
# define MULTDIV_RECOMPILE
# define JUMP_RECOMPILE
# define LOADSTORE_RECOMPILE
# define MOVE_RECOMPILE
# define MMI_RECOMPILE
# define MMI0_RECOMPILE
# define MMI1_RECOMPILE
# define MMI2_RECOMPILE
# define MMI3_RECOMPILE
# define FPU_RECOMPILE
# define CP0_RECOMPILE
# define CP2_RECOMPILE
// You can't recompile ARITHMETICIMM without ARITHMETIC.
# ifndef ARITHMETIC_RECOMPILE
# undef ARITHMETICIMM_RECOMPILE
# endif
2010-03-10 20:59:43 +00:00
# define EE_CONST_PROP 1 // rec2 - enables constant propagation (faster)
2009-10-09 05:50:10 +00:00
2014-03-06 23:00:09 +00:00
// Change to 1 for console logs of SIF, GPU (PS1 mode) and MDEC (PS1 mode).
// These do spam a lot though!
# define PSX_EXTRALOGS 0