[Project64] Get settings to use standard types

This commit is contained in:
zilmar 2015-11-15 08:49:08 +11:00
parent 68513c1101
commit 46fea05262
30 changed files with 342 additions and 302 deletions

View File

@ -9,6 +9,7 @@
* * * *
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
#include "Debug Settings.h"
int CDebugSettings::m_RefCount = 0; int CDebugSettings::m_RefCount = 0;

View File

@ -10,7 +10,7 @@
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include <N64 System/N64 Types.h> #include <Project64\N64 System\N64 Types.h>
class CDebugSettings class CDebugSettings
{ {
@ -37,6 +37,6 @@ private:
static bool m_bShowTLBMisses; static bool m_bShowTLBMisses;
static bool m_bShowDivByZero; static bool m_bShowDivByZero;
static int m_RefCount; static int32_t m_RefCount;
static bool m_Registered; static bool m_Registered;
}; };

View File

@ -9,6 +9,9 @@
* * * *
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
#include <Project64\N64 System\System Globals.h>
#include <Project64\N64 System\N64 Class.h>
#include "Game Settings.h"
bool CGameSettings::m_bSMM_StoreInstruc; bool CGameSettings::m_bSMM_StoreInstruc;
bool CGameSettings::m_bSMM_Protect; bool CGameSettings::m_bSMM_Protect;
@ -16,12 +19,12 @@ bool CGameSettings::m_bSMM_ValidFunc;
bool CGameSettings::m_bSMM_PIDMA; bool CGameSettings::m_bSMM_PIDMA;
bool CGameSettings::m_bSMM_TLB; bool CGameSettings::m_bSMM_TLB;
bool CGameSettings::m_bUseTlb; bool CGameSettings::m_bUseTlb;
DWORD CGameSettings::m_CountPerOp = 2; uint32_t CGameSettings::m_CountPerOp = 2;
DWORD CGameSettings::m_ViRefreshRate = 1500; uint32_t CGameSettings::m_ViRefreshRate = 1500;
DWORD CGameSettings::m_AiCountPerBytes = 500; uint32_t CGameSettings::m_AiCountPerBytes = 500;
bool CGameSettings::m_DelayDP = false; bool CGameSettings::m_DelayDP = false;
bool CGameSettings::m_DelaySI = false; bool CGameSettings::m_DelaySI = false;
DWORD CGameSettings::m_RdramSize = 0; uint32_t CGameSettings::m_RdramSize = 0;
bool CGameSettings::m_bFixedAudio = true; bool CGameSettings::m_bFixedAudio = true;
bool CGameSettings::m_bSyncingToAudio = true; bool CGameSettings::m_bSyncingToAudio = true;
bool CGameSettings::m_bSyncToAudio = true; bool CGameSettings::m_bSyncToAudio = true;
@ -31,7 +34,7 @@ bool CGameSettings::m_RspAudioSignal;
bool CGameSettings::m_bRomInMemory; bool CGameSettings::m_bRomInMemory;
bool CGameSettings::m_RegCaching; bool CGameSettings::m_RegCaching;
bool CGameSettings::m_bLinkBlocks; bool CGameSettings::m_bLinkBlocks;
DWORD CGameSettings::m_LookUpMode; //FUNC_LOOKUP_METHOD uint32_t CGameSettings::m_LookUpMode; //FUNC_LOOKUP_METHOD
SYSTEM_TYPE CGameSettings::m_SystemType = SYSTEM_NTSC; SYSTEM_TYPE CGameSettings::m_SystemType = SYSTEM_NTSC;
CPU_TYPE CGameSettings::m_CpuType = CPU_Recompiler; CPU_TYPE CGameSettings::m_CpuType = CPU_Recompiler;

View File

@ -10,7 +10,7 @@
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include <N64 System/N64 Types.h> #include <Project64\N64 System\N64 Types.h>
class CGameSettings class CGameSettings
{ {
@ -22,12 +22,12 @@ public:
inline static bool bLinkBlocks(void) { return m_bLinkBlocks; } inline static bool bLinkBlocks(void) { return m_bLinkBlocks; }
inline static FUNC_LOOKUP_METHOD LookUpMode(void) { return (FUNC_LOOKUP_METHOD)m_LookUpMode; } inline static FUNC_LOOKUP_METHOD LookUpMode(void) { return (FUNC_LOOKUP_METHOD)m_LookUpMode; }
inline static bool bUseTlb(void) { return m_bUseTlb; } inline static bool bUseTlb(void) { return m_bUseTlb; }
inline static DWORD CountPerOp(void) { return m_CountPerOp; } inline static uint32_t CountPerOp(void) { return m_CountPerOp; }
inline static DWORD ViRefreshRate(void) { return m_ViRefreshRate; } inline static uint32_t ViRefreshRate(void) { return m_ViRefreshRate; }
inline static DWORD AiCountPerBytes(void) { return m_AiCountPerBytes; } inline static uint32_t AiCountPerBytes(void) { return m_AiCountPerBytes; }
inline static bool bDelayDP(void) { return m_DelayDP; } inline static bool bDelayDP(void) { return m_DelayDP; }
inline static bool bDelaySI(void) { return m_DelaySI; } inline static bool bDelaySI(void) { return m_DelaySI; }
inline static DWORD RdramSize(void) { return m_RdramSize; } inline static uint32_t RdramSize(void) { return m_RdramSize; }
inline static bool bFixedAudio(void) { return m_bFixedAudio; } inline static bool bFixedAudio(void) { return m_bFixedAudio; }
inline static bool bSyncToAudio(void) { return m_bSyncingToAudio; } inline static bool bSyncToAudio(void) { return m_bSyncingToAudio; }
inline static bool bFastSP(void) { return m_bFastSP; } inline static bool bFastSP(void) { return m_bFastSP; }
@ -42,21 +42,21 @@ public:
inline static CPU_TYPE CpuType(void) { return m_CpuType; } inline static CPU_TYPE CpuType(void) { return m_CpuType; }
protected: protected:
static void SpeedChanged(int SpeedLimit); static void SpeedChanged(int32_t SpeedLimit);
private: private:
//Settings that can be changed on the fly //Settings that can be changed on the fly
static bool m_bRomInMemory; static bool m_bRomInMemory;
static bool m_RegCaching; static bool m_RegCaching;
static bool m_bLinkBlocks; static bool m_bLinkBlocks;
static DWORD m_LookUpMode; //FUNC_LOOKUP_METHOD static uint32_t m_LookUpMode; //FUNC_LOOKUP_METHOD
static bool m_bUseTlb; static bool m_bUseTlb;
static DWORD m_CountPerOp; static uint32_t m_CountPerOp;
static DWORD m_ViRefreshRate; static uint32_t m_ViRefreshRate;
static DWORD m_AiCountPerBytes; static uint32_t m_AiCountPerBytes;
static bool m_DelayDP; static bool m_DelayDP;
static bool m_DelaySI; static bool m_DelaySI;
static DWORD m_RdramSize; static uint32_t m_RdramSize;
static bool m_bFixedAudio; static bool m_bFixedAudio;
static bool m_bSyncingToAudio; static bool m_bSyncingToAudio;
static bool m_bSyncToAudio; static bool m_bSyncToAudio;

View File

@ -9,8 +9,9 @@
* * * *
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
#include "N64System Settings.h"
int CN64SystemSettings::m_RefCount = 0; int32_t CN64SystemSettings::m_RefCount = 0;
bool CN64SystemSettings::m_bShowCPUPer; bool CN64SystemSettings::m_bShowCPUPer;
bool CN64SystemSettings::m_bProfiling; bool CN64SystemSettings::m_bProfiling;

View File

@ -33,5 +33,5 @@ private:
static bool m_bShowDListAListCount; static bool m_bShowDListAListCount;
static bool m_bDisplayFrameRate; static bool m_bDisplayFrameRate;
static int m_RefCount; static int32_t m_RefCount;
}; };

View File

@ -9,6 +9,7 @@
* * * *
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
#include "Recompiler Settings.h"
int CRecompilerSettings::m_RefCount = 0; int CRecompilerSettings::m_RefCount = 0;

View File

@ -10,7 +10,7 @@
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include <N64 System/N64 Types.h> #include <Project64\N64 System\N64 Types.h>
class CRecompilerSettings class CRecompilerSettings
{ {
@ -34,5 +34,5 @@ private:
static bool m_bShowRecompMemSize; static bool m_bShowRecompMemSize;
static bool m_bProfiling; static bool m_bProfiling;
static int m_RefCount; static int32_t m_RefCount;
}; };

View File

@ -27,23 +27,23 @@ public:
virtual SettingType GetSettingType ( void ) const { return m_UseRegistry ? SettingType_Registry : SettingType_CfgFile; } virtual SettingType GetSettingType ( void ) const { return m_UseRegistry ? SettingType_Registry : SettingType_CfgFile; }
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int32_t Index, bool & Value ) const;
virtual void LoadDefault ( int Index, uint32_t & Value ) const; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int32_t Index );
// Initialize this class to use ini or registry // Initialize this class to use ini or registry
static void Initialize( const char * AppName ); static void Initialize( const char * AppName );

View File

@ -23,23 +23,23 @@ public:
virtual bool IndexBasedSetting ( void ) const { return true; } virtual bool IndexBasedSetting ( void ) const { return true; }
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int32_t Index, bool & Value ) const;
virtual void LoadDefault ( int Index, uint32_t & Value ) const; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int32_t Index );
private: private:
CSettingTypeApplicationIndex(void); // Disable default constructor CSettingTypeApplicationIndex(void); // Disable default constructor

View File

@ -19,7 +19,7 @@ public:
CSettingTypeApplicationPath(const char * Section, const char * Name, SettingID DefaultSetting ); CSettingTypeApplicationPath(const char * Section, const char * Name, SettingID DefaultSetting );
//return the values //return the values
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
private: private:
CSettingTypeApplicationPath(void); // Disable default constructor CSettingTypeApplicationPath(void); // Disable default constructor

View File

@ -39,21 +39,21 @@ public:
virtual bool IndexBasedSetting ( void ) const = 0; virtual bool IndexBasedSetting ( void ) const = 0;
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const = 0; virtual bool Load ( int32_t Index, bool & Value ) const = 0;
virtual bool Load ( int Index, uint32_t & Value ) const = 0; virtual bool Load ( int32_t Index, uint32_t & Value ) const = 0;
virtual bool Load ( int Index, stdstr & Value ) const = 0; virtual bool Load ( int32_t Index, stdstr & Value ) const = 0;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const = 0; virtual void LoadDefault ( int32_t Index, bool & Value ) const = 0;
virtual void LoadDefault ( int Index, uint32_t & Value ) const = 0; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const = 0;
virtual void LoadDefault ( int Index, stdstr & Value ) const = 0; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const = 0;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ) = 0; virtual void Save ( int32_t Index, bool Value ) = 0;
virtual void Save ( int Index, uint32_t Value ) = 0; virtual void Save ( int32_t Index, uint32_t Value ) = 0;
virtual void Save ( int Index, const stdstr & Value ) = 0; virtual void Save ( int32_t Index, const stdstr & Value ) = 0;
virtual void Save ( int Index, const char * Value ) = 0; virtual void Save ( int32_t Index, const char * Value ) = 0;
// Delete the setting // Delete the setting
virtual void Delete ( int Index ) = 0; virtual void Delete ( int32_t Index ) = 0;
}; };

View File

@ -24,23 +24,23 @@ public:
virtual SettingType GetSettingType ( void ) const { return SettingType_CheatSetting; } virtual SettingType GetSettingType ( void ) const { return SettingType_CheatSetting; }
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int32_t Index, bool & Value ) const;
virtual void LoadDefault ( int Index, uint32_t & Value ) const; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int32_t Index );
// Initialize this class to use ini or registry // Initialize this class to use ini or registry
static void Initialize ( void ); static void Initialize ( void );

View File

@ -35,23 +35,23 @@ public:
static void CleanUp ( void ); static void CleanUp ( void );
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int32_t Index, bool & Value ) const;
virtual void LoadDefault ( int Index, uint32_t & Value ) const; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int32_t Index );
private: private:
CSettingTypeGame(void); // Disable default constructor CSettingTypeGame(void); // Disable default constructor

View File

@ -25,23 +25,23 @@ public:
virtual SettingType GetSettingType ( void ) const { return SettingType_GameSetting; } virtual SettingType GetSettingType ( void ) const { return SettingType_GameSetting; }
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int32_t Index, bool & Value ) const;
virtual void LoadDefault ( int Index, uint32_t & Value ) const; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int32_t Index );
private: private:
CSettingTypeGameIndex(void); // Disable default constructor CSettingTypeGameIndex(void); // Disable default constructor

View File

@ -15,27 +15,27 @@ class CSettingTypeRDBCpuType :
{ {
public: public:
CSettingTypeRDBCpuType(const char * Name, SettingID DefaultSetting ); CSettingTypeRDBCpuType(const char * Name, SettingID DefaultSetting );
CSettingTypeRDBCpuType(const char * Name, int DefaultValue ); CSettingTypeRDBCpuType(const char * Name, int32_t DefaultValue );
~CSettingTypeRDBCpuType(); ~CSettingTypeRDBCpuType();
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int32_t Index, bool & Value ) const;
virtual void LoadDefault ( int Index, uint32_t & Value ) const; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int32_t Index );
private: private:
CSettingTypeRDBCpuType(void); // Disable default constructor CSettingTypeRDBCpuType(void); // Disable default constructor

View File

@ -15,27 +15,27 @@ class CSettingTypeRDBOnOff :
{ {
public: public:
CSettingTypeRDBOnOff(const char * Name, SettingID DefaultSetting ); CSettingTypeRDBOnOff(const char * Name, SettingID DefaultSetting );
CSettingTypeRDBOnOff(const char * Name, int DefaultValue ); CSettingTypeRDBOnOff(const char * Name, int32_t DefaultValue );
~CSettingTypeRDBOnOff(); ~CSettingTypeRDBOnOff();
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int32_t Index, bool & Value ) const;
virtual void LoadDefault ( int Index, uint32_t & Value ) const; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int32_t Index );
private: private:
CSettingTypeRDBOnOff(void); // Disable default constructor CSettingTypeRDBOnOff(void); // Disable default constructor

View File

@ -15,27 +15,27 @@ class CSettingTypeRDBRDRamSize :
{ {
public: public:
CSettingTypeRDBRDRamSize(const char * Name, SettingID DefaultSetting ); CSettingTypeRDBRDRamSize(const char * Name, SettingID DefaultSetting );
CSettingTypeRDBRDRamSize(const char * Name, int DefaultValue ); CSettingTypeRDBRDRamSize(const char * Name, int32_t DefaultValue );
~CSettingTypeRDBRDRamSize(); ~CSettingTypeRDBRDRamSize();
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int32_t Index, bool & Value ) const;
virtual void LoadDefault ( int Index, uint32_t & Value ) const; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int32_t Index );
private: private:
CSettingTypeRDBRDRamSize(void); // Disable default constructor CSettingTypeRDBRDRamSize(void); // Disable default constructor

View File

@ -15,27 +15,27 @@ class CSettingTypeRDBSaveChip :
{ {
public: public:
CSettingTypeRDBSaveChip(const char * Name, SettingID DefaultSetting ); CSettingTypeRDBSaveChip(const char * Name, SettingID DefaultSetting );
CSettingTypeRDBSaveChip(const char * Name, int DefaultValue ); CSettingTypeRDBSaveChip(const char * Name, int32_t DefaultValue );
~CSettingTypeRDBSaveChip(); ~CSettingTypeRDBSaveChip();
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int32_t Index, bool & Value ) const;
virtual void LoadDefault ( int Index, uint32_t & Value ) const; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int32_t Index );
private: private:
CSettingTypeRDBSaveChip(void); // Disable default constructor CSettingTypeRDBSaveChip(void); // Disable default constructor

View File

@ -15,27 +15,27 @@ class CSettingTypeRDBYesNo :
{ {
public: public:
CSettingTypeRDBYesNo(const char * Name, SettingID DefaultSetting ); CSettingTypeRDBYesNo(const char * Name, SettingID DefaultSetting );
CSettingTypeRDBYesNo(const char * Name, int DefaultValue ); CSettingTypeRDBYesNo(const char * Name, int32_t DefaultValue );
~CSettingTypeRDBYesNo(); ~CSettingTypeRDBYesNo();
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int32_t Index, bool & Value ) const;
virtual void LoadDefault ( int Index, uint32_t & Value ) const; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int32_t Index );
private: private:
CSettingTypeRDBYesNo(void); // Disable default constructor CSettingTypeRDBYesNo(void); // Disable default constructor

View File

@ -25,23 +25,23 @@ public:
SettingType GetSettingType ( void ) const { return SettingType_RelativePath; } SettingType GetSettingType ( void ) const { return SettingType_RelativePath; }
//return the values //return the values
bool Load ( int /*Index*/, bool & /*Value*/ ) const { return false; }; bool Load ( int32_t /*Index*/, bool & /*Value*/ ) const { return false; };
bool Load ( int /*Index*/, uint32_t & /*Value*/ ) const { return false; }; bool Load ( int32_t /*Index*/, uint32_t & /*Value*/ ) const { return false; };
bool Load ( int Index, stdstr & Value ) const; bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
void LoadDefault ( int Index, bool & Value ) const; void LoadDefault ( int32_t Index, bool & Value ) const;
void LoadDefault ( int Index, uint32_t & Value ) const; void LoadDefault ( int32_t Index, uint32_t & Value ) const;
void LoadDefault ( int Index, stdstr & Value ) const; void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
void Save ( int Index, bool Value ); void Save ( int32_t Index, bool Value );
void Save ( int Index, uint32_t Value ); void Save ( int32_t Index, uint32_t Value );
void Save ( int Index, const stdstr & Value ); void Save ( int32_t Index, const stdstr & Value );
void Save ( int Index, const char * Value ); void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
void Delete ( int Index ); void Delete ( int32_t Index );
private: private:
CSettingTypeRelativePath(void); // Disable default constructor CSettingTypeRelativePath(void); // Disable default constructor

View File

@ -19,7 +19,7 @@ class CSettingTypeRomDatabase :
public: public:
CSettingTypeRomDatabase(const char * Name, const char * DefaultValue, bool DeleteOnDefault = false ); CSettingTypeRomDatabase(const char * Name, const char * DefaultValue, bool DeleteOnDefault = false );
CSettingTypeRomDatabase(const char * Name, bool DefaultValue, bool DeleteOnDefault = false ); CSettingTypeRomDatabase(const char * Name, bool DefaultValue, bool DeleteOnDefault = false );
CSettingTypeRomDatabase(const char * Name, int DefaultValue, bool DeleteOnDefault = false ); CSettingTypeRomDatabase(const char * Name, int32_t DefaultValue, bool DeleteOnDefault = false );
CSettingTypeRomDatabase(const char * Name, SettingID DefaultSetting, bool DeleteOnDefault = false ); CSettingTypeRomDatabase(const char * Name, SettingID DefaultSetting, bool DeleteOnDefault = false );
virtual ~CSettingTypeRomDatabase(); virtual ~CSettingTypeRomDatabase();
@ -28,23 +28,23 @@ public:
virtual SettingType GetSettingType ( void ) const { return SettingType_RomDatabase; } virtual SettingType GetSettingType ( void ) const { return SettingType_RomDatabase; }
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int32_t Index, bool & Value ) const;
virtual void LoadDefault ( int Index, uint32_t & Value ) const; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int32_t Index );
static void Initialize( void ); static void Initialize( void );
static void CleanUp ( void ); static void CleanUp ( void );
@ -58,7 +58,7 @@ protected:
mutable stdstr m_KeyName; mutable stdstr m_KeyName;
const char *const m_DefaultStr; const char *const m_DefaultStr;
const int m_DefaultValue; const int32_t m_DefaultValue;
const SettingID m_DefaultSetting; const SettingID m_DefaultSetting;
const bool m_DeleteOnDefault; const bool m_DeleteOnDefault;
bool m_GlideSetting; bool m_GlideSetting;

View File

@ -16,7 +16,7 @@ class CSettingTypeRomDatabaseIndex :
public: public:
CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, const char * DefaultValue ); CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, const char * DefaultValue );
CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, bool DefaultValue ); CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, bool DefaultValue );
CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, int DefaultValue ); CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, int32_t DefaultValue );
CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, SettingID DefaultSetting ); CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, SettingID DefaultSetting );
virtual ~CSettingTypeRomDatabaseIndex(); virtual ~CSettingTypeRomDatabaseIndex();
@ -24,23 +24,23 @@ public:
virtual bool IndexBasedSetting ( void ) const { return true; } virtual bool IndexBasedSetting ( void ) const { return true; }
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int32_t Index, bool & Value ) const;
virtual void LoadDefault ( int Index, uint32_t & Value ) const; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int32_t Index );
private: private:
CSettingTypeRomDatabaseIndex(void); // Disable default constructor CSettingTypeRomDatabaseIndex(void); // Disable default constructor

View File

@ -6,22 +6,22 @@ class CSettingTypeRomDatabase :
public: public:
CSettingTypeRomDatabase(const char * Name, const char * DefaultValue ); CSettingTypeRomDatabase(const char * Name, const char * DefaultValue );
CSettingTypeRomDatabase(const char * Name, bool DefaultValue ); CSettingTypeRomDatabase(const char * Name, bool DefaultValue );
CSettingTypeRomDatabase(const char * Name, int DefaultValue ); CSettingTypeRomDatabase(const char * Name, int32_t DefaultValue );
CSettingTypeRomDatabase(const char * Name, SettingID DefaultSetting ); CSettingTypeRomDatabase(const char * Name, SettingID DefaultSetting );
~CSettingTypeRomDatabase(); ~CSettingTypeRomDatabase();
virtual SettingLocation GetSettingsLocation ( void ) const { return SettingLocation_RomDatabase; } virtual SettingLocation GetSettingsLocation ( void ) const { return SettingLocation_RomDatabase; }
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
static void Initilize ( void ); static void Initilize ( void );
@ -32,7 +32,7 @@ private:
const const char * m_KeyName; const const char * m_KeyName;
const const char * m_DefaultStr; const const char * m_DefaultStr;
const int m_DefaultValue; const int32_t m_DefaultValue;
const SettingID m_DefaultSetting; const SettingID m_DefaultSetting;
static CIniFile * m_SettingsIniFile; static CIniFile * m_SettingsIniFile;

View File

@ -25,23 +25,23 @@ public:
const char * GetName ( void ) const { return m_Name.c_str(); } const char * GetName ( void ) const { return m_Name.c_str(); }
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int32_t Index, bool & Value ) const;
virtual bool Load ( int Index, uint32_t & Value ) const; virtual bool Load ( int32_t Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int32_t Index, bool & Value ) const;
virtual void LoadDefault ( int Index, uint32_t & Value ) const; virtual void LoadDefault ( int32_t Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int32_t Index, bool Value );
virtual void Save ( int Index, uint32_t Value ); virtual void Save ( int32_t Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int32_t Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int32_t Index );
private: private:
CSettingTypeSelectedDirectory(void); // Disable default constructor CSettingTypeSelectedDirectory(void); // Disable default constructor

View File

@ -23,23 +23,23 @@ public:
SettingType GetSettingType ( void ) const { return SettingType_BoolVariable; } SettingType GetSettingType ( void ) const { return SettingType_BoolVariable; }
//return the values //return the values
bool Load ( int Index, bool & Value ) const; bool Load ( int32_t Index, bool & Value ) const;
bool Load ( int Index, uint32_t & Value ) const; bool Load ( int32_t Index, uint32_t & Value ) const;
bool Load ( int Index, stdstr & Value ) const; bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
void LoadDefault ( int Index, bool & Value ) const; void LoadDefault ( int32_t Index, bool & Value ) const;
void LoadDefault ( int Index, uint32_t & Value ) const; void LoadDefault ( int32_t Index, uint32_t & Value ) const;
void LoadDefault ( int Index, stdstr & Value ) const; void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
void Save ( int Index, bool Value ); void Save ( int32_t Index, bool Value );
void Save ( int Index, uint32_t Value ); void Save ( int32_t Index, uint32_t Value );
void Save ( int Index, const stdstr & Value ); void Save ( int32_t Index, const stdstr & Value );
void Save ( int Index, const char * Value ); void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
void Delete ( int Index ); void Delete ( int32_t Index );
private: private:
CSettingTypeTempBool(void); // Disable default constructor CSettingTypeTempBool(void); // Disable default constructor

View File

@ -23,23 +23,23 @@ public:
SettingType GetSettingType ( void ) const { return SettingType_NumberVariable; } SettingType GetSettingType ( void ) const { return SettingType_NumberVariable; }
//return the values //return the values
bool Load ( int Index, bool & Value ) const; bool Load ( int32_t Index, bool & Value ) const;
bool Load ( int Index, uint32_t & Value ) const; bool Load ( int32_t Index, uint32_t & Value ) const;
bool Load ( int Index, stdstr & Value ) const; bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
void LoadDefault ( int Index, bool & Value ) const; void LoadDefault ( int32_t Index, bool & Value ) const;
void LoadDefault ( int Index, uint32_t & Value ) const; void LoadDefault ( int32_t Index, uint32_t & Value ) const;
void LoadDefault ( int Index, stdstr & Value ) const; void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
void Save ( int Index, bool Value ); void Save ( int32_t Index, bool Value );
void Save ( int Index, uint32_t Value ); void Save ( int32_t Index, uint32_t Value );
void Save ( int Index, const stdstr & Value ); void Save ( int32_t Index, const stdstr & Value );
void Save ( int Index, const char * Value ); void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
void Delete ( int Index ); void Delete ( int32_t Index );
private: private:
CSettingTypeTempNumber(void); // Disable default constructor CSettingTypeTempNumber(void); // Disable default constructor

View File

@ -23,23 +23,23 @@ public:
SettingType GetSettingType ( void ) const { return SettingType_StringVariable; } SettingType GetSettingType ( void ) const { return SettingType_StringVariable; }
//return the values //return the values
bool Load ( int Index, bool & Value ) const; bool Load ( int32_t Index, bool & Value ) const;
bool Load ( int Index, uint32_t & Value ) const; bool Load ( int32_t Index, uint32_t & Value ) const;
bool Load ( int Index, stdstr & Value ) const; bool Load ( int32_t Index, stdstr & Value ) const;
//return the default values //return the default values
void LoadDefault ( int Index, bool & Value ) const; void LoadDefault ( int32_t Index, bool & Value ) const;
void LoadDefault ( int Index, uint32_t & Value ) const; void LoadDefault ( int32_t Index, uint32_t & Value ) const;
void LoadDefault ( int Index, stdstr & Value ) const; void LoadDefault ( int32_t Index, stdstr & Value ) const;
//Update the settings //Update the settings
void Save ( int Index, bool Value ); void Save ( int32_t Index, bool Value );
void Save ( int Index, uint32_t Value ); void Save ( int32_t Index, uint32_t Value );
void Save ( int Index, const stdstr & Value ); void Save ( int32_t Index, const stdstr & Value );
void Save ( int Index, const char * Value ); void Save ( int32_t Index, const char * Value );
// Delete the setting // Delete the setting
void Delete ( int Index ); void Delete ( int32_t Index );
private: private:
CSettingTypeTempString(void); // Disable default constructor CSettingTypeTempString(void); // Disable default constructor

View File

@ -30,6 +30,7 @@
#include "SettingType/SettingsType-TempNumber.h" #include "SettingType/SettingsType-TempNumber.h"
#include "SettingType/SettingsType-TempBool.h" #include "SettingType/SettingsType-TempBool.h"
#include "Settings Class.h" #include "Settings Class.h"
#include "N64 System/N64 Types.h"
#include <Common/TraceDefs.h> #include <Common/TraceDefs.h>
CSettings * g_Settings = NULL; CSettings * g_Settings = NULL;
@ -419,7 +420,7 @@ const char * CSettings::GetSettingSz(CSettings * _this, SettingID Type, char * B
return Buffer; return Buffer;
} }
void CSettings::SetSetting(CSettings * _this, SettingID ID, unsigned int Value) void CSettings::SetSetting(CSettings * _this, SettingID ID, uint32_t Value)
{ {
_this->SaveDword(ID, Value); _this->SaveDword(ID, Value);
} }
@ -460,7 +461,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
{ {
_this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, Value)); _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, Value));
} }
else { else
{
_this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, DefaultID)); _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, DefaultID));
} }
break; break;
@ -469,7 +471,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
{ {
_this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, "")); _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, ""));
} }
else { else
{
_this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, DefaultID)); _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, DefaultID));
} }
break; break;
@ -490,7 +493,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
_this->AddHandler(RdbSetting, new CSettingTypeRomDatabase(Name.c_str(), (int)Value)); _this->AddHandler(RdbSetting, new CSettingTypeRomDatabase(Name.c_str(), (int)Value));
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), RdbSetting)); _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), RdbSetting));
} }
else { else
{
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID)); _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID));
} }
break; break;
@ -499,7 +503,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
{ {
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), "")); _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), ""));
} }
else { else
{
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID)); _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID));
} }
break; break;
@ -516,7 +521,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
{ {
_this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, (int)Value, true)); _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, (int)Value, true));
} }
else { else
{
_this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, (SettingID)Value, true)); _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, (SettingID)Value, true));
} }
break; break;
@ -525,7 +531,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
{ {
_this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, "", true)); _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, "", true));
} }
else { else
{
_this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, DefaultID, true)); _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, DefaultID, true));
} }
break; break;
@ -541,7 +548,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
{ {
_this->AddHandler(ID, new CSettingTypeRomDatabaseSetting(Category, DefaultStr, (int)Value, true)); _this->AddHandler(ID, new CSettingTypeRomDatabaseSetting(Category, DefaultStr, (int)Value, true));
} }
else { else
{
SettingID RdbSetting = (SettingID)_this->m_NextAutoSettingId; SettingID RdbSetting = (SettingID)_this->m_NextAutoSettingId;
_this->m_NextAutoSettingId += 1; _this->m_NextAutoSettingId += 1;
_this->AddHandler(RdbSetting, new CSettingTypeRomDatabaseSetting(Category, DefaultStr, DefaultID, true)); _this->AddHandler(RdbSetting, new CSettingTypeRomDatabaseSetting(Category, DefaultStr, DefaultID, true));
@ -589,7 +597,8 @@ bool CSettings::LoadBool(SettingID Type, bool & Value)
{ {
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
else { else
{
return FindInfo->second->Load(0, Value); return FindInfo->second->Load(0, Value);
} }
return false; return false;
@ -615,7 +624,8 @@ bool CSettings::LoadBoolIndex(SettingID Type, int index, bool & Value)
{ {
return FindInfo->second->Load(index, Value); return FindInfo->second->Load(index, Value);
} }
else { else
{
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
return false; return false;
@ -641,7 +651,8 @@ bool CSettings::LoadDword(SettingID Type, uint32_t & Value)
{ {
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
else { else
{
return FindInfo->second->Load(0, Value); return FindInfo->second->Load(0, Value);
} }
return false; return false;
@ -667,7 +678,8 @@ bool CSettings::LoadDwordIndex(SettingID Type, int index, uint32_t & Value)
{ {
return FindInfo->second->Load(index, Value); return FindInfo->second->Load(index, Value);
} }
else { else
{
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
return false; return false;
@ -693,7 +705,8 @@ bool CSettings::LoadStringVal(SettingID Type, stdstr & Value)
{ {
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
else { else
{
return FindInfo->second->Load(0, Value); return FindInfo->second->Load(0, Value);
} }
return false; return false;
@ -713,7 +726,8 @@ bool CSettings::LoadStringVal(SettingID Type, char * Buffer, int BufferSize)
{ {
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
else { else
{
stdstr Value; stdstr Value;
bRes = FindInfo->second->Load(0, Value); bRes = FindInfo->second->Load(0, Value);
int len = BufferSize; int len = BufferSize;
@ -746,7 +760,8 @@ bool CSettings::LoadStringIndex(SettingID Type, int index, stdstr & Value)
{ {
return FindInfo->second->Load(index, Value); return FindInfo->second->Load(index, Value);
} }
else { else
{
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
return false; return false;
@ -774,12 +789,14 @@ void CSettings::LoadDefaultBool(SettingID Type, bool & Value)
//if not found do nothing //if not found do nothing
UnknownSetting(Type); UnknownSetting(Type);
} }
else { else
{
if (FindInfo->second->IndexBasedSetting()) if (FindInfo->second->IndexBasedSetting())
{ {
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
else { else
{
FindInfo->second->LoadDefault(0, Value); FindInfo->second->LoadDefault(0, Value);
} }
} }
@ -811,12 +828,14 @@ void CSettings::LoadDefaultDword(SettingID Type, uint32_t & Value)
//if not found do nothing //if not found do nothing
UnknownSetting(Type); UnknownSetting(Type);
} }
else { else
{
if (FindInfo->second->IndexBasedSetting()) if (FindInfo->second->IndexBasedSetting())
{ {
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
else { else
{
FindInfo->second->LoadDefault(0, Value); FindInfo->second->LoadDefault(0, Value);
} }
} }
@ -848,12 +867,14 @@ void CSettings::LoadDefaultString(SettingID Type, stdstr & Value)
//if not found do nothing //if not found do nothing
UnknownSetting(Type); UnknownSetting(Type);
} }
else { else
{
if (FindInfo->second->IndexBasedSetting()) if (FindInfo->second->IndexBasedSetting())
{ {
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
else { else
{
FindInfo->second->LoadDefault(0, Value); FindInfo->second->LoadDefault(0, Value);
} }
} }
@ -893,7 +914,8 @@ void CSettings::SaveBool(SettingID Type, bool Value)
{ {
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
else { else
{
FindInfo->second->Save(0, Value); FindInfo->second->Save(0, Value);
} }
NotifyCallBacks(Type); NotifyCallBacks(Type);
@ -912,7 +934,8 @@ void CSettings::SaveBoolIndex(SettingID Type, int index, bool Value)
{ {
FindInfo->second->Save(index, Value); FindInfo->second->Save(index, Value);
} }
else { else
{
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
NotifyCallBacks(Type); NotifyCallBacks(Type);
@ -931,7 +954,8 @@ void CSettings::SaveDword(SettingID Type, uint32_t Value)
{ {
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
else { else
{
FindInfo->second->Save(0, Value); FindInfo->second->Save(0, Value);
} }
NotifyCallBacks(Type); NotifyCallBacks(Type);
@ -950,7 +974,8 @@ void CSettings::SaveDwordIndex(SettingID Type, int index, uint32_t Value)
{ {
FindInfo->second->Save(index, Value); FindInfo->second->Save(index, Value);
} }
else { else
{
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
NotifyCallBacks(Type); NotifyCallBacks(Type);
@ -969,7 +994,8 @@ void CSettings::SaveString(SettingID Type, const stdstr & Value)
{ {
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
else { else
{
FindInfo->second->Save(0, Value); FindInfo->second->Save(0, Value);
} }
NotifyCallBacks(Type); NotifyCallBacks(Type);
@ -987,7 +1013,8 @@ void CSettings::SaveString(SettingID Type, const char * Buffer)
{ {
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
else { else
{
FindInfo->second->Save(0, Buffer); FindInfo->second->Save(0, Buffer);
} }
NotifyCallBacks(Type); NotifyCallBacks(Type);
@ -1005,7 +1032,8 @@ void CSettings::SaveStringIndex(SettingID Type, int index, const char * Buffer)
{ {
FindInfo->second->Save(index, Buffer); FindInfo->second->Save(index, Buffer);
} }
else { else
{
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
NotifyCallBacks(Type); NotifyCallBacks(Type);
@ -1028,7 +1056,8 @@ void CSettings::DeleteSetting(SettingID Type)
{ {
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
else { else
{
FindInfo->second->Delete(0); FindInfo->second->Delete(0);
} }
NotifyCallBacks(Type); NotifyCallBacks(Type);
@ -1046,7 +1075,8 @@ void CSettings::DeleteSettingIndex(SettingID Type, int index)
{ {
FindInfo->second->Delete(index); FindInfo->second->Delete(index);
} }
else { else
{
g_Notify->BreakPoint(__FILEW__, __LINE__); g_Notify->BreakPoint(__FILEW__, __LINE__);
} }
NotifyCallBacks(Type); NotifyCallBacks(Type);
@ -1125,7 +1155,8 @@ void CSettings::RegisterChangeCB(SettingID Type, void * Data, SettingChangedFunc
} }
item->Next = new_item; item->Next = new_item;
} }
else { else
{
m_Callback.insert(SETTING_CALLBACK::value_type(Type, new_item)); m_Callback.insert(SETTING_CALLBACK::value_type(Type, new_item));
} }
} }
@ -1155,11 +1186,13 @@ void CSettings::UnregisterChangeCB(SettingID Type, void * Data, SettingChangedFu
m_Callback.erase(Callback); m_Callback.erase(Callback);
m_Callback.insert(SETTING_CALLBACK::value_type(Type, Next)); m_Callback.insert(SETTING_CALLBACK::value_type(Type, Next));
} }
else { else
{
m_Callback.erase(Callback); m_Callback.erase(Callback);
} }
} }
else { else
{
PrevItem->Next = item->Next; PrevItem->Next = item->Next;
} }
delete item; delete item;
@ -1170,7 +1203,8 @@ void CSettings::UnregisterChangeCB(SettingID Type, void * Data, SettingChangedFu
item = item->Next; item = item->Next;
} }
} }
else { else
{
UnknownSetting(Type); UnknownSetting(Type);
return; return;
} }

View File

@ -53,48 +53,48 @@ public:
//return the values //return the values
bool LoadBool ( SettingID Type ); bool LoadBool ( SettingID Type );
bool LoadBool ( SettingID Type, bool & Value ); bool LoadBool ( SettingID Type, bool & Value );
bool LoadBoolIndex ( SettingID Type, int index ); bool LoadBoolIndex ( SettingID Type, int32_t index );
bool LoadBoolIndex ( SettingID Type, int index , bool & Value ); bool LoadBoolIndex ( SettingID Type, int32_t index , bool & Value );
uint32_t LoadDword ( SettingID Type ); uint32_t LoadDword ( SettingID Type );
bool LoadDword ( SettingID Type, uint32_t & Value); bool LoadDword ( SettingID Type, uint32_t & Value );
uint32_t LoadDwordIndex ( SettingID Type, int index ); uint32_t LoadDwordIndex ( SettingID Type, int32_t index );
bool LoadDwordIndex ( SettingID Type, int index, uint32_t & Value); bool LoadDwordIndex ( SettingID Type, int32_t index, uint32_t & Value );
stdstr LoadStringVal ( SettingID Type ); stdstr LoadStringVal ( SettingID Type );
bool LoadStringVal (SettingID Type, stdstr & Value); bool LoadStringVal (SettingID Type, stdstr & Value);
bool LoadStringVal (SettingID Type, char * Buffer, int BufferSize); bool LoadStringVal (SettingID Type, char * Buffer, int32_t BufferSize );
stdstr LoadStringIndex ( SettingID Type, int index ); stdstr LoadStringIndex ( SettingID Type, int32_t index );
bool LoadStringIndex ( SettingID Type, int index, stdstr & Value ); bool LoadStringIndex ( SettingID Type, int32_t index, stdstr & Value );
bool LoadStringIndex ( SettingID Type, int index, char * Buffer, int BufferSize ); bool LoadStringIndex ( SettingID Type, int32_t index, char * Buffer, int32_t BufferSize );
//Load the default value for the setting //Load the default value for the setting
bool LoadDefaultBool ( SettingID Type ); bool LoadDefaultBool ( SettingID Type );
void LoadDefaultBool ( SettingID Type, bool & Value ); void LoadDefaultBool ( SettingID Type, bool & Value );
bool LoadDefaultBoolIndex ( SettingID Type, int index ); bool LoadDefaultBoolIndex ( SettingID Type, int32_t index );
void LoadDefaultBoolIndex ( SettingID Type, int index , bool & Value ); void LoadDefaultBoolIndex ( SettingID Type, int32_t index , bool & Value );
uint32_t LoadDefaultDword ( SettingID Type ); uint32_t LoadDefaultDword ( SettingID Type );
void LoadDefaultDword ( SettingID Type, uint32_t & Value); void LoadDefaultDword ( SettingID Type, uint32_t & Value);
uint32_t LoadDefaultDwordIndex ( SettingID Type, int index ); uint32_t LoadDefaultDwordIndex ( SettingID Type, int32_t index );
void LoadDefaultDwordIndex ( SettingID Type, int index, uint32_t & Value); void LoadDefaultDwordIndex ( SettingID Type, int32_t index, uint32_t & Value);
stdstr LoadDefaultString ( SettingID Type ); stdstr LoadDefaultString ( SettingID Type );
void LoadDefaultString ( SettingID Type, stdstr & Value ); void LoadDefaultString ( SettingID Type, stdstr & Value );
void LoadDefaultString ( SettingID Type, char * Buffer, int BufferSize ); void LoadDefaultString ( SettingID Type, char * Buffer, int32_t BufferSize );
stdstr LoadDefaultStringIndex ( SettingID Type, int index ); stdstr LoadDefaultStringIndex ( SettingID Type, int32_t index );
void LoadDefaultStringIndex ( SettingID Type, int index, stdstr & Value ); void LoadDefaultStringIndex ( SettingID Type, int32_t index, stdstr & Value );
void LoadDefaultStringIndex ( SettingID Type, int index, char * Buffer, int BufferSize ); void LoadDefaultStringIndex ( SettingID Type, int32_t index, char * Buffer, int32_t BufferSize );
//Update the settings //Update the settings
void SaveBool ( SettingID Type, bool Value ); void SaveBool ( SettingID Type, bool Value );
void SaveBoolIndex ( SettingID Type, int index, bool Value ); void SaveBoolIndex ( SettingID Type, int32_t index, bool Value );
void SaveDword ( SettingID Type, uint32_t Value ); void SaveDword ( SettingID Type, uint32_t Value );
void SaveDwordIndex ( SettingID Type, int index, uint32_t Value ); void SaveDwordIndex ( SettingID Type, int32_t index, uint32_t Value );
void SaveString ( SettingID Type, const stdstr & Value ); void SaveString ( SettingID Type, const stdstr & Value );
void SaveStringIndex ( SettingID Type, int index, const stdstr & Value ); void SaveStringIndex ( SettingID Type, int32_t index, const stdstr & Value );
void SaveString ( SettingID Type, const char * Buffer ); void SaveString ( SettingID Type, const char * Buffer );
void SaveStringIndex ( SettingID Type, int index, const char * Buffer ); void SaveStringIndex ( SettingID Type, int32_t index, const char * Buffer );
// Delete a setting // Delete a setting
void DeleteSetting ( SettingID Type ); void DeleteSetting ( SettingID Type );
void DeleteSettingIndex ( SettingID Type, int index ); void DeleteSettingIndex ( SettingID Type, int32_t index );
//Register Notification of change //Register Notification of change
void RegisterChangeCB ( SettingID Type, void * Data, SettingChangedFunc Func); void RegisterChangeCB ( SettingID Type, void * Data, SettingChangedFunc Func);
@ -107,8 +107,8 @@ public:
// static functions for plugins // static functions for plugins
static uint32_t GetSetting ( CSettings * _this, SettingID Type ); static uint32_t GetSetting ( CSettings * _this, SettingID Type );
static const char * GetSettingSz ( CSettings * _this, SettingID Type, char * Buffer, int BufferSize ); static const char * GetSettingSz ( CSettings * _this, SettingID Type, char * Buffer, int32_t BufferSize );
static void SetSetting ( CSettings * _this, SettingID ID, unsigned int Value ); static void SetSetting ( CSettings * _this, SettingID ID, uint32_t Value );
static void SetSettingSz ( CSettings * _this, SettingID ID, const char * Value ); static void SetSettingSz ( CSettings * _this, SettingID ID, const char * Value );
static void RegisterSetting ( CSettings * _this, SettingID ID, SettingID DefaultID, SettingDataType DataType, static void RegisterSetting ( CSettings * _this, SettingID ID, SettingID DefaultID, SettingDataType DataType,
SettingType Type, const char * Category, const char * DefaultStr, SettingType Type, const char * Category, const char * DefaultStr,
@ -121,7 +121,7 @@ private:
SETTING_MAP m_SettingInfo; SETTING_MAP m_SettingInfo;
SETTING_CALLBACK m_Callback; SETTING_CALLBACK m_Callback;
int m_NextAutoSettingId; int32_t m_NextAutoSettingId;
}; };
extern CSettings * g_Settings; extern CSettings * g_Settings;