[Project64] Get settngs to use std int

This commit is contained in:
zilmar 2015-10-25 21:50:28 +11:00
parent a2a8eccbca
commit 81fdcb9373
62 changed files with 4416 additions and 4322 deletions

View File

@ -0,0 +1,36 @@
#include "stdafx.h"
CriticalSection::CriticalSection()
{
m_cs = new CRITICAL_SECTION;
::InitializeCriticalSection((CRITICAL_SECTION *)m_cs);
}
CriticalSection::~CriticalSection(void)
{
::DeleteCriticalSection((CRITICAL_SECTION *)m_cs);
delete (CRITICAL_SECTION *)m_cs;
}
/**
* Enters a critical section of code.
* Prevents other threads from accessing the section between the enter and leave sections simultaneously.
* @note It is good practice to try and keep the critical section code as little as possible, so that
* other threads are not locked waiting for it.
*/
void CriticalSection::enter(void)
{
::EnterCriticalSection((CRITICAL_SECTION *)m_cs);
}
/**
* Leaves the critical section.
* Allows threads access to the critical code section again.
* @warning Note that an exception occurring with a critical section may not result in the expected leave being
* called. To ensure that your critical section is exception safe, ensure that you wrap the critical
* section in a try catch, and the catch calls the leave method.
*/
void CriticalSection::leave(void)
{
::LeaveCriticalSection((CRITICAL_SECTION *)m_cs);
}

View File

@ -26,14 +26,14 @@ CFile::~CFile()
} }
} }
CFile::CFile(LPCTSTR lpszFileName, ULONG nOpenFlags) : CFile::CFile(const char * lpszFileName, uint32_t nOpenFlags) :
m_hFile(INVALID_HANDLE_VALUE), m_hFile(INVALID_HANDLE_VALUE),
m_bCloseOnDelete(true) m_bCloseOnDelete(true)
{ {
Open(lpszFileName, nOpenFlags); Open(lpszFileName, nOpenFlags);
} }
bool CFile::Open(LPCTSTR lpszFileName, ULONG nOpenFlags) bool CFile::Open(const char * lpszFileName, uint32_t nOpenFlags)
{ {
if (!Close()) if (!Close())
{ {
@ -116,7 +116,7 @@ bool CFile::Close()
return bError; return bError;
} }
ULONG CFile::SeekToEnd ( void ) uint32_t CFile::SeekToEnd ( void )
{ {
return Seek(0, CFile::end); return Seek(0, CFile::end);
} }
@ -141,7 +141,7 @@ bool CFile::Flush()
return ::FlushFileBuffers(m_hFile) != 0; return ::FlushFileBuffers(m_hFile) != 0;
} }
bool CFile::Write(const void* lpBuf, ULONG nCount) bool CFile::Write(const void* lpBuf, uint32_t nCount)
{ {
if (nCount == 0) if (nCount == 0)
{ {
@ -162,7 +162,7 @@ bool CFile::Write(const void* lpBuf, ULONG nCount)
return true; return true;
} }
ULONG CFile::Read(void* lpBuf, ULONG nCount) uint32_t CFile::Read(void* lpBuf, uint32_t nCount)
{ {
if (nCount == 0) if (nCount == 0)
{ {
@ -188,19 +188,19 @@ long CFile::Seek(long lOff, SeekPosition nFrom)
return dwNew; return dwNew;
} }
ULONG CFile::GetPosition() const uint32_t CFile::GetPosition() const
{ {
return ::SetFilePointer(m_hFile, 0, NULL, FILE_CURRENT); return ::SetFilePointer(m_hFile, 0, NULL, FILE_CURRENT);
} }
bool CFile::SetLength(ULONG dwNewLen) bool CFile::SetLength(uint32_t dwNewLen)
{ {
Seek((LONG)dwNewLen, begin); Seek((LONG)dwNewLen, begin);
return ::SetEndOfFile(m_hFile) != 0; return ::SetEndOfFile(m_hFile) != 0;
} }
ULONG CFile::GetLength() const uint32_t CFile::GetLength() const
{ {
return GetFileSize(m_hFile,0); return GetFileSize(m_hFile,0);
} }
@ -209,4 +209,3 @@ bool CFile::SetEndOfFile()
{ {
return ::SetEndOfFile(m_hFile) != 0; return ::SetEndOfFile(m_hFile) != 0;
} }

View File

@ -239,7 +239,6 @@ void CIniFileBase::SaveCurrentSection ( void )
m_File.Seek(StartPos, CFileBase::begin); m_File.Seek(StartPos, CFileBase::begin);
} }
{ {
AUTO_PTR<char> LineData(NULL); AUTO_PTR<char> LineData(NULL);
int len = 0; int len = 0;
@ -584,7 +583,7 @@ stdstr CIniFileBase::GetString ( LPCWSTR lpSectionName, LPCWSTR lpKeyName, LPCW
#endif #endif
ULONG CIniFileBase::GetString ( LPCTSTR lpSectionName, LPCTSTR lpKeyName, LPCTSTR lpDefault, LPTSTR lpReturnedString, ULONG nSize ) uint32_t CIniFileBase::GetString ( LPCTSTR lpSectionName, LPCTSTR lpKeyName, LPCTSTR lpDefault, LPTSTR lpReturnedString, uint32_t nSize )
{ {
CGuard Guard(m_CS); CGuard Guard(m_CS);
@ -638,14 +637,14 @@ bool CIniFileBase::GetNumber ( LPCWSTR lpSectionName, LPCWSTR lpKeyName, ULONG n
} }
#endif #endif
ULONG CIniFileBase::GetNumber ( LPCSTR lpSectionName, LPCSTR lpKeyName, ULONG nDefault ) uint32_t CIniFileBase::GetNumber ( LPCSTR lpSectionName, LPCSTR lpKeyName, uint32_t nDefault )
{ {
ULONG Value; uint32_t Value;
GetNumber(lpSectionName,lpKeyName,nDefault,Value); GetNumber(lpSectionName,lpKeyName,nDefault,Value);
return Value; return Value;
} }
bool CIniFileBase::GetNumber ( LPCSTR lpSectionName, LPCSTR lpKeyName, ULONG nDefault, ULONG & Value ) bool CIniFileBase::GetNumber ( LPCSTR lpSectionName, LPCSTR lpKeyName, uint32_t nDefault, uint32_t & Value )
{ {
CGuard Guard(m_CS); CGuard Guard(m_CS);
@ -732,7 +731,7 @@ void CIniFileBase::SaveString ( LPCTSTR lpSectionName, LPCTSTR lpKeyName, LPCTS
} }
} }
void CIniFileBase::SaveNumber ( LPCTSTR lpSectionName, LPCTSTR lpKeyName, ULONG Value ) void CIniFileBase::SaveNumber ( LPCTSTR lpSectionName, LPCTSTR lpKeyName, uint32_t Value )
{ {
//translate the string to an ascii version and save as text //translate the string to an ascii version and save as text
SaveString(lpSectionName,lpKeyName,stdstr_f(_T("%d"),Value).c_str()); SaveString(lpSectionName,lpKeyName,stdstr_f(_T("%d"),Value).c_str());
@ -753,7 +752,6 @@ void CIniFileBase::SetAutoFlush (bool AutoFlush)
} }
} }
void CIniFileBase::GetKeyList ( LPCTSTR lpSectionName, strlist &List ) void CIniFileBase::GetKeyList ( LPCTSTR lpSectionName, strlist &List )
{ {
List.clear(); List.clear();
@ -837,7 +835,6 @@ void CIniFileBase::ClearSectionPosList( long FilePos )
} }
m_lastSectionSearch = FilePos; m_lastSectionSearch = FilePos;
} }
} }
void CIniFileBase::GetVectorOfSections( SectionList & sections) void CIniFileBase::GetVectorOfSections( SectionList & sections)

View File

@ -33,20 +33,19 @@ private:
long m_lastSectionSearch; // When Scanning for a section, what was the last scanned pos long m_lastSectionSearch; // When Scanning for a section, what was the last scanned pos
bool m_ReadOnly; bool m_ReadOnly;
bool m_InstantFlush; bool m_InstantFlush;
LPCSTR m_LineFeed; const char * m_LineFeed;
CriticalSection m_CS; CriticalSection m_CS;
FILELOC m_SectionsPos; FILELOC m_SectionsPos;
//void AddItemData ( LPCTSTR lpKeyName, LPCTSTR lpString); //void AddItemData ( const char * lpKeyName, const char * lpString);
//bool ChangeItemData ( LPCTSTR lpKeyName, LPCTSTR lpString ); //bool ChangeItemData ( const char * lpKeyName, const char * lpString );
//void DeleteItem ( LPCSTR lpKeyName ); //void DeleteItem ( const char * lpKeyName );
void fInsertSpaces ( int Pos, int NoOfSpaces ); void fInsertSpaces ( int Pos, int NoOfSpaces );
int GetStringFromFile ( char * & String, char * &Data, int & MaxDataSize, int & DataSize, int & ReadPos ); int GetStringFromFile ( char * & String, char * &Data, int & MaxDataSize, int & DataSize, int & ReadPos );
bool MoveToSectionNameData ( LPCSTR lpSectionName, bool ChangeCurrentSection ); bool MoveToSectionNameData(const char * lpSectionName, bool ChangeCurrentSection);
const char * CleanLine ( char * const Line ); const char * CleanLine ( char * const Line );
void ClearSectionPosList( long FilePos ); void ClearSectionPosList( long FilePos );
@ -56,34 +55,34 @@ protected:
void SaveCurrentSection ( void ); void SaveCurrentSection ( void );
public: public:
CIniFileBase( CFileBase & FileObject, LPCTSTR FileName ); CIniFileBase(CFileBase & FileObject, const char * FileName);
virtual ~CIniFileBase(void); virtual ~CIniFileBase(void);
bool IsEmpty(); bool IsEmpty();
bool IsFileOpen ( void ); bool IsFileOpen ( void );
bool DeleteSection ( LPCSTR lpSectionName ); bool DeleteSection(const char * lpSectionName);
bool GetString ( LPCSTR lpSectionName, LPCSTR lpKeyName, LPCSTR lpDefault, stdstr & Value ); bool GetString ( const char * lpSectionName, const char * lpKeyName, const char * lpDefault, stdstr & Value );
stdstr GetString ( LPCSTR lpSectionName, LPCSTR lpKeyName, LPCSTR lpDefault ); stdstr GetString ( const char * lpSectionName, const char * lpKeyName, const char * lpDefault );
ULONG GetString ( LPCSTR lpSectionName, LPCSTR lpKeyName, LPCSTR lpDefault, LPSTR lpReturnedString, ULONG nSize ); uint32_t GetString ( const char * lpSectionName, const char * lpKeyName, const char * lpDefault, char * lpReturnedString, uint32_t nSize );
ULONG GetNumber ( LPCSTR lpSectionName, LPCSTR lpKeyName, ULONG nDefault ); uint32_t GetNumber ( const char * lpSectionName, const char * lpKeyName, uint32_t nDefault );
bool GetNumber ( LPCSTR lpSectionName, LPCSTR lpKeyName, ULONG nDefault, ULONG & Value ); bool GetNumber ( const char * lpSectionName, const char * lpKeyName, uint32_t nDefault, uint32_t & Value );
#ifdef _UNICODE #ifdef _UNICODE
bool DeleteSection ( LPCWSTR lpSectionName ); bool DeleteSection ( LPCWSTR lpSectionName );
bool GetString ( LPCWSTR lpSectionName, LPCWSTR lpKeyName, LPCWSTR lpDefault, stdstr & Value ); bool GetString ( LPCWSTR lpSectionName, LPCWSTR lpKeyName, LPCWSTR lpDefault, stdstr & Value );
stdstr GetString ( LPCWSTR lpSectionName, LPCWSTR lpKeyName, LPCWSTR lpDefault ); stdstr GetString ( LPCWSTR lpSectionName, LPCWSTR lpKeyName, LPCWSTR lpDefault );
ULONG GetString ( LPCWSTR lpSectionName, LPCWSTR lpKeyName, LPCWSTR lpDefault, LPTSTR lpReturnedString, ULONG nSize ); uint32_t GetString ( LPCWSTR lpSectionName, LPCWSTR lpKeyName, LPCWSTR lpDefault, LPTSTR lpReturnedString, uint32_t nSize );
ULONG GetNumber ( LPCWSTR lpSectionName, LPCWSTR lpKeyName, ULONG nDefault ); uint32_t GetNumber ( LPCWSTR lpSectionName, LPCWSTR lpKeyName, uint32_t nDefault );
bool GetNumber ( LPCWSTR lpSectionName, LPCWSTR lpKeyName, ULONG nDefault, ULONG & Value ); bool GetNumber ( LPCWSTR lpSectionName, LPCWSTR lpKeyName, uint32_t nDefault, uint32_t & Value );
#endif #endif
virtual void SaveString ( LPCTSTR lpSectionName, LPCTSTR lpKeyName, LPCTSTR lpString ); virtual void SaveString ( const char * lpSectionName, const char * lpKeyName, const char * lpString );
virtual void SaveNumber ( LPCTSTR lpSectionName, LPCTSTR lpKeyName, ULONG Value ); virtual void SaveNumber ( const char * lpSectionName, const char * lpKeyName, uint32_t Value );
void SetAutoFlush (bool AutoFlush); void SetAutoFlush (bool AutoFlush);
void FlushChanges (void); void FlushChanges (void);
void GetKeyList ( LPCTSTR lpSectionName, strlist &List ); void GetKeyList ( const char * lpSectionName, strlist &List );
void GetKeyValueData ( LPCTSTR lpSectionName, KeyValueData & List ); void GetKeyValueData ( const char * lpSectionName, KeyValueData & List );
void GetVectorOfSections( SectionList & sections); void GetVectorOfSections( SectionList & sections);
const stdstr &GetFileName() {return m_FileName;} const stdstr &GetFileName() {return m_FileName;}
@ -94,15 +93,14 @@ class CIniFileT :
public CIniFileBase public CIniFileBase
{ {
public: public:
CIniFileT( LPCTSTR FileName ) : CIniFileT( const char * FileName ) :
CIniFileBase(m_FileObject,FileName) CIniFileBase(m_FileObject,FileName)
{ {
//Try to open file for reading //Try to open file for reading
OpenIniFile(); OpenIniFile();
} }
CIniFileT( LPCTSTR FileName, bool bCreate, bool bReadOnly) : CIniFileT( const char * FileName, bool bCreate, bool bReadOnly) :
CIniFileBase(m_FileObject,FileName) CIniFileBase(m_FileObject,FileName)
{ {
if(bReadOnly) if(bReadOnly)
@ -114,7 +112,6 @@ public:
//Try to open file for reading //Try to open file for reading
OpenIniFile(bCreate); OpenIniFile(bCreate);
} }
} }
virtual ~CIniFileT(void) virtual ~CIniFileT(void)
{ {

View File

@ -9,6 +9,8 @@
* * * *
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
#include <Common/stdtypes.h>
#include <Common/path.h>
CLanguage * g_Lang = NULL; CLanguage * g_Lang = NULL;
@ -505,7 +507,7 @@ void CLanguage::LoadCurrentStrings ( bool ShowSelectDialog )
{ {
if (ShowSelectDialog) if (ShowSelectDialog)
{ {
m_SelectedLanguage = g_Settings->LoadString(Setting_CurrentLanguage).ToUTF16(); m_SelectedLanguage = g_Settings->LoadStringVal(Setting_CurrentLanguage).ToUTF16();
} }
LanguageList LangList = GetLangList(); LanguageList LangList = GetLangList();
@ -543,7 +545,7 @@ void CLanguage::LoadCurrentStrings ( bool ShowSelectDialog )
} }
//Search for utf8 file marker //Search for utf8 file marker
BYTE utf_bom[3]; uint8_t utf_bom[3];
if (fread(&utf_bom, sizeof(utf_bom),1,file) != 1 || if (fread(&utf_bom, sizeof(utf_bom),1,file) != 1 ||
utf_bom[0] != 0xEF || utf_bom[0] != 0xEF ||
utf_bom[1] != 0xBB || utf_bom[1] != 0xBB ||
@ -721,7 +723,6 @@ LRESULT CALLBACK LangSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
BITMAP bmTL; BITMAP bmTL;
GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL); GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL);
if (hbmpBackgroundTop) if (hbmpBackgroundTop)
{ {
// int iHeight = bmTL.bmHeight; // int iHeight = bmTL.bmHeight;
@ -785,7 +786,6 @@ LRESULT CALLBACK LangSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
client.right += client.left; client.right += client.left;
client.bottom += client.top; client.bottom += client.top;
int nCaption = GetSystemMetrics(SM_CYCAPTION)*4; int nCaption = GetSystemMetrics(SM_CYCAPTION)*4;
LRESULT lResult = HTCLIENT; LRESULT lResult = HTCLIENT;
@ -828,7 +828,6 @@ LRESULT CALLBACK LangSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SelectObject(memdc, save); SelectObject(memdc, save);
DeleteDC(memdc); DeleteDC(memdc);
memdc = CreateCompatibleDC(ps.hdc); memdc = CreateCompatibleDC(ps.hdc);
save = SelectObject(memdc, hbmpBackgroundMiddle); save = SelectObject(memdc, hbmpBackgroundMiddle);
for (int x = bmTL_top.bmHeight; x < rcClient.bottom; x += bmTL_Middle.bmHeight) for (int x = bmTL_top.bmHeight; x < rcClient.bottom; x += bmTL_Middle.bmHeight)
@ -902,14 +901,14 @@ LanguageList & CLanguage::GetLangList (void)
return m_LanguageList; return m_LanguageList;
} }
CPath LanguageFiles(g_Settings->LoadString(Setting_LanguageDir),"*.pj.Lang"); CPath LanguageFiles(g_Settings->LoadStringVal(Setting_LanguageDir),"*.pj.Lang");
if (LanguageFiles.FindFirst()) if (LanguageFiles.FindFirst())
{ {
do do
{ {
LanguageFile File; //We temporally store the values in here to added to the list LanguageFile File; //We temporally store the values in here to added to the list
File.Filename = LanguageFiles; File.Filename = (std::string &)LanguageFiles;
File.LanguageName = GetLangString(LanguageFiles,LANGUAGE_NAME); File.LanguageName = GetLangString(LanguageFiles,LANGUAGE_NAME);
if (File.LanguageName.length() == 0) if (File.LanguageName.length() == 0)
@ -952,7 +951,7 @@ std::wstring CLanguage::GetLangString ( const char * FileName, LanguageStringID
} }
//Search for utf8 file marker //Search for utf8 file marker
BYTE utf_bom[3]; uint8_t utf_bom[3];
if (fread(&utf_bom, sizeof(utf_bom),1,file) != 1 || if (fread(&utf_bom, sizeof(utf_bom),1,file) != 1 ||
utf_bom[0] != 0xEF || utf_bom[0] != 0xEF ||
utf_bom[1] != 0xBB || utf_bom[1] != 0xBB ||

View File

@ -10,8 +10,6 @@
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include "..\support.h"
#pragma warning(disable:4786) #pragma warning(disable:4786)
#include <string> //stl string #include <string> //stl string
#include <map> //stl map #include <map> //stl map
@ -22,7 +20,7 @@ typedef LANG_STRINGS::value_type LANG_STR;
struct LanguageFile struct LanguageFile
{ {
stdstr Filename; std::string Filename;
std::wstring LanguageName; std::wstring LanguageName;
}; };
@ -56,7 +54,7 @@ private:
extern CLanguage * g_Lang; extern CLanguage * g_Lang;
inline LPCWSTR GS (LanguageStringID StringID) inline const wchar_t * GS (LanguageStringID StringID)
{ {
return g_Lang->GetString(StringID).c_str(); return g_Lang->GetString(StringID).c_str();
} }

View File

@ -81,7 +81,7 @@ void LoadLogOptions (LOG_OPTIONS * LogOptions, BOOL AlwaysFill)
HKEY hKeyResults = 0; HKEY hKeyResults = 0;
char String[200]; char String[200];
sprintf(String,"Software\\N64 Emulation\\%s\\Logging",g_Settings->LoadString(Setting_ApplicationName).c_str()); sprintf(String,"Software\\N64 Emulation\\%s\\Logging",g_Settings->LoadStringVal(Setting_ApplicationName).c_str());
lResult = RegOpenKeyEx( HKEY_CURRENT_USER,String,0,KEY_ALL_ACCESS, lResult = RegOpenKeyEx( HKEY_CURRENT_USER,String,0,KEY_ALL_ACCESS,
&hKeyResults); &hKeyResults);
@ -857,7 +857,7 @@ void SaveLogOptions (void)
DWORD Disposition = 0; DWORD Disposition = 0;
char String[200]; char String[200];
sprintf(String,"Software\\N64 Emulation\\%s\\Logging",g_Settings->LoadString(Setting_ApplicationName).c_str()); sprintf(String,"Software\\N64 Emulation\\%s\\Logging",g_Settings->LoadStringVal(Setting_ApplicationName).c_str());
lResult = RegCreateKeyEx( HKEY_CURRENT_USER,String,0,"", REG_OPTION_NON_VOLATILE, lResult = RegCreateKeyEx( HKEY_CURRENT_USER,String,0,"", REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS,NULL,&hKeyResults,&Disposition); KEY_ALL_ACCESS,NULL,&hKeyResults,&Disposition);

View File

@ -131,7 +131,7 @@ void CEeprom::EepromCommand ( BYTE * Command)
default: default:
if (g_Settings->LoadDword(Debugger_ShowPifErrors)) if (g_Settings->LoadDword(Debugger_ShowPifErrors))
{ {
g_Notify->DisplayError(L"Unknown EepromCommand %d",Command[2]); g_Notify->DisplayError(stdstr_f("Unknown EepromCommand %d",Command[2]).ToUTF16().c_str());
} }
} }
} }
@ -143,8 +143,8 @@ void CEeprom::LoadEeprom()
memset(m_EEPROM,0xFF,sizeof(m_EEPROM)); memset(m_EEPROM,0xFF,sizeof(m_EEPROM));
FileName.SetDriveDirectory( g_Settings->LoadString(Directory_NativeSave).c_str()); FileName.SetDriveDirectory( g_Settings->LoadStringVal(Directory_NativeSave).c_str());
FileName.SetName(g_Settings->LoadString(Game_GameName).c_str()); FileName.SetName(g_Settings->LoadStringVal(Game_GameName).c_str());
FileName.SetExtension("eep"); FileName.SetExtension("eep");
if (!FileName.DirectoryExists()) if (!FileName.DirectoryExists())

View File

@ -49,7 +49,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
{ {
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->DisplayError(L"DmaFromFlashram FlipBuffer to small (len: %d)",len); g_Notify->DisplayError(stdstr_f(__FUNCTION__ ": DmaFromFlashram FlipBuffer to small (len: %d)", len).ToUTF16().c_str());
} }
len = 0x10000; len = 0x10000;
} }
@ -57,7 +57,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
{ {
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->DisplayError(L"Unaligned flash ram read ???"); g_Notify->DisplayError(__FUNCTIONW__ L": Unaligned flash ram read ???");
} }
return; return;
} }
@ -84,7 +84,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
{ {
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->DisplayError(L"Reading m_FlashStatus not being handled correctly\nStart: %X len: %X",StartOffset,len); g_Notify->DisplayError(stdstr_f(__FUNCTION__ ": Reading m_FlashStatus not being handled correctly\nStart: %X len: %X", StartOffset, len).ToUTF16().c_str());
} }
} }
*((DWORD *)(dest)) = (DWORD)((m_FlashStatus >> 32) & 0xFFFFFFFF); *((DWORD *)(dest)) = (DWORD)((m_FlashStatus >> 32) & 0xFFFFFFFF);
@ -93,7 +93,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
default: default:
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->DisplayError(L"DmaFromFlashram Start: %X, Offset: %X len: %X",dest - g_MMU->Rdram(),StartOffset,len); g_Notify->DisplayError(stdstr_f(__FUNCTION__": Start: %X, Offset: %X len: %X",dest - g_MMU->Rdram(),StartOffset,len).ToUTF16().c_str());
} }
} }
} }
@ -108,7 +108,7 @@ void CFlashram::DmaToFlashram(BYTE * Source, int StartOffset, int len)
default: default:
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->DisplayError(L"DmaToFlashram Start: %X, Offset: %X len: %X",Source - g_MMU->Rdram(),StartOffset,len); g_Notify->DisplayError(stdstr_f(__FUNCTION__ ": Start: %X, Offset: %X len: %X", Source - g_MMU->Rdram(), StartOffset, len).ToUTF16().c_str());
} }
} }
} }
@ -122,7 +122,7 @@ DWORD CFlashram::ReadFromFlashStatus (DWORD PAddr)
default: default:
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->DisplayError(L"Reading from flash ram status (%X)",PAddr); g_Notify->DisplayError(stdstr_f(__FUNCTION__ ": PAddr (%X)", PAddr).ToUTF16().c_str());
} }
break; break;
} }
@ -133,8 +133,8 @@ bool CFlashram::LoadFlashram()
{ {
CPath FileName; CPath FileName;
FileName.SetDriveDirectory( g_Settings->LoadString(Directory_NativeSave).c_str()); FileName.SetDriveDirectory( g_Settings->LoadStringVal(Directory_NativeSave).c_str());
FileName.SetName(g_Settings->LoadString(Game_GameName).c_str()); FileName.SetName(g_Settings->LoadStringVal(Game_GameName).c_str());
FileName.SetExtension("fla"); FileName.SetExtension("fla");
if (!FileName.DirectoryExists()) if (!FileName.DirectoryExists())
@ -205,7 +205,7 @@ void CFlashram::WriteToFlashCommand(DWORD FlashRAM_Command)
} }
break; break;
default: default:
g_Notify->DisplayError(L"Writing %X to flash ram command register\nm_FlashFlag: %d",FlashRAM_Command,m_FlashFlag); g_Notify->DisplayError(stdstr_f("Writing %X to flash ram command register\nm_FlashFlag: %d",FlashRAM_Command,m_FlashFlag).ToUTF16().c_str());
} }
m_FlashFlag = FLASHRAM_MODE_NOPES; m_FlashFlag = FLASHRAM_MODE_NOPES;
break; break;
@ -234,7 +234,7 @@ void CFlashram::WriteToFlashCommand(DWORD FlashRAM_Command)
default: default:
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->DisplayError(L"Writing %X to flash ram command register",FlashRAM_Command); g_Notify->DisplayError(stdstr_f("Writing %X to flash ram command register",FlashRAM_Command).ToUTF16().c_str());
} }
} }
} }

View File

@ -31,9 +31,9 @@ void LoadMempak (int Control)
stdstr MempakName; stdstr MempakName;
bool bFormatMempak = false; bool bFormatMempak = false;
MempakName.Format("%s_Cont_%d", g_Settings->LoadString(Game_GameName).c_str(), Control + 1); MempakName.Format("%s_Cont_%d", g_Settings->LoadStringVal(Game_GameName).c_str(), Control + 1);
FileName.SetDriveDirectory(g_Settings->LoadString(Directory_NativeSave).c_str()); FileName.SetDriveDirectory(g_Settings->LoadStringVal(Directory_NativeSave).c_str());
FileName.SetName(MempakName.c_str()); FileName.SetName(MempakName.c_str());
FileName.SetExtension("mpk"); FileName.SetExtension("mpk");

View File

@ -30,8 +30,8 @@ bool CSram::LoadSram()
{ {
CPath FileName; CPath FileName;
FileName.SetDriveDirectory( g_Settings->LoadString(Directory_NativeSave).c_str()); FileName.SetDriveDirectory( g_Settings->LoadStringVal(Directory_NativeSave).c_str());
FileName.SetName(g_Settings->LoadString(Game_GameName).c_str()); FileName.SetName(g_Settings->LoadStringVal(Game_GameName).c_str());
FileName.SetExtension("sra"); FileName.SetExtension("sra");
if (!FileName.DirectoryExists()) if (!FileName.DirectoryExists())

View File

@ -186,7 +186,7 @@ bool CN64System::RunFileImage ( const char * FileLoc )
//Mark the rom as loading //Mark the rom as loading
g_Settings->SaveBool(GameRunning_LoadingInProgress,true); g_Settings->SaveBool(GameRunning_LoadingInProgress,true);
g_Notify->RefreshMenu(); Notify().RefreshMenu();
//Try to load the passed N64 rom //Try to load the passed N64 rom
if (g_Rom == NULL) if (g_Rom == NULL)
@ -205,11 +205,11 @@ bool CN64System::RunFileImage ( const char * FileLoc )
g_System->RefreshGameSettings(); g_System->RefreshGameSettings();
WriteTrace(TraceDebug,__FUNCTION__ ": Add Recent Rom"); WriteTrace(TraceDebug,__FUNCTION__ ": Add Recent Rom");
g_Notify->AddRecentRom(FileLoc); Notify().AddRecentRom(FileLoc);
g_Notify->SetWindowCaption(g_Settings->LoadString(Game_GoodName).ToUTF16().c_str()); Notify().SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str());
g_Settings->SaveBool(GameRunning_LoadingInProgress, false); g_Settings->SaveBool(GameRunning_LoadingInProgress, false);
g_Notify->RefreshMenu(); Notify().RefreshMenu();
if (g_Settings->LoadDword(Setting_AutoStart) != 0) if (g_Settings->LoadDword(Setting_AutoStart) != 0)
{ {
@ -227,7 +227,7 @@ bool CN64System::RunFileImage ( const char * FileLoc )
delete g_Rom; delete g_Rom;
g_Rom = NULL; g_Rom = NULL;
g_Settings->SaveBool(GameRunning_LoadingInProgress,false); g_Settings->SaveBool(GameRunning_LoadingInProgress,false);
g_Notify->RefreshMenu(); Notify().RefreshMenu();
return false; return false;
} }
return true; return true;
@ -254,7 +254,7 @@ bool CN64System::EmulationStarting ( HANDLE hThread, DWORD ThreadId )
g_BaseSystem->m_CPU_ThreadID = ThreadId; g_BaseSystem->m_CPU_ThreadID = ThreadId;
WriteTrace(TraceDebug,__FUNCTION__ ": Setting up N64 system done"); WriteTrace(TraceDebug,__FUNCTION__ ": Setting up N64 system done");
g_Settings->SaveBool(GameRunning_LoadingInProgress,false); g_Settings->SaveBool(GameRunning_LoadingInProgress,false);
g_Notify->RefreshMenu(); Notify().RefreshMenu();
try try
{ {
WriteTrace(TraceDebug,__FUNCTION__ ": Game set to auto start, starting"); WriteTrace(TraceDebug,__FUNCTION__ ": Game set to auto start, starting");
@ -274,7 +274,7 @@ bool CN64System::EmulationStarting ( HANDLE hThread, DWORD ThreadId )
WriteTrace(TraceError,__FUNCTION__ ": SetActiveSystem failed"); WriteTrace(TraceError,__FUNCTION__ ": SetActiveSystem failed");
g_Notify->DisplayError(__FUNCTIONW__ L": Failed to Initialize N64 System"); g_Notify->DisplayError(__FUNCTIONW__ L": Failed to Initialize N64 System");
g_Settings->SaveBool(GameRunning_LoadingInProgress,false); g_Settings->SaveBool(GameRunning_LoadingInProgress,false);
g_Notify->RefreshMenu(); Notify().RefreshMenu();
bRes = false; bRes = false;
} }
return bRes; return bRes;
@ -286,7 +286,7 @@ void CN64System::StartEmulation2 ( bool NewThread )
{ {
WriteTrace(TraceDebug,__FUNCTION__ ": Starting"); WriteTrace(TraceDebug,__FUNCTION__ ": Starting");
g_Notify->HideRomBrowser(); Notify().HideRomBrowser();
if (bHaveDebugger()) if (bHaveDebugger())
{ {
@ -308,10 +308,10 @@ void CN64System::StartEmulation2 ( bool NewThread )
if (CpuType == CPU_SyncCores) if (CpuType == CPU_SyncCores)
{ {
g_Notify->DisplayMessage(5,L"Copy Plugins"); g_Notify->DisplayMessage(5,L"Copy Plugins");
g_Plugins->CopyPlugins(g_Settings->LoadString(Directory_PluginSync)); g_Plugins->CopyPlugins(g_Settings->LoadStringVal(Directory_PluginSync));
#if defined(WINDOWS_UI) #if defined(WINDOWS_UI)
m_SyncWindow = new CMainGui(false); m_SyncWindow = new CMainGui(false);
m_SyncPlugins = new CPlugins( g_Settings->LoadString(Directory_PluginSync) ); m_SyncPlugins = new CPlugins( g_Settings->LoadStringVal(Directory_PluginSync) );
m_SyncPlugins->SetRenderWindows(m_SyncWindow,m_SyncWindow); m_SyncPlugins->SetRenderWindows(m_SyncWindow,m_SyncWindow);
m_SyncCPU = new CN64System(m_SyncPlugins, true); m_SyncCPU = new CN64System(m_SyncPlugins, true);
@ -341,11 +341,11 @@ void CN64System::StartEmulation2 ( bool NewThread )
g_Settings->SaveBool(GameRunning_LoadingInProgress,false); g_Settings->SaveBool(GameRunning_LoadingInProgress,false);
g_Notify->DisplayError(MSG_PLUGIN_NOT_INIT); g_Notify->DisplayError(MSG_PLUGIN_NOT_INIT);
g_Notify->RefreshMenu(); Notify().RefreshMenu();
g_Notify->ShowRomBrowser(); Notify().ShowRomBrowser();
} }
g_Notify->MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop)); Notify().MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop));
ThreadInfo * Info = new ThreadInfo; ThreadInfo * Info = new ThreadInfo;
HANDLE * hThread = new HANDLE; HANDLE * hThread = new HANDLE;
@ -365,14 +365,14 @@ void CN64System::StartEmulation2 ( bool NewThread )
if (g_Settings->LoadBool(Setting_AutoFullscreen)) if (g_Settings->LoadBool(Setting_AutoFullscreen))
{ {
WriteTrace(TraceDebug,__FUNCTION__ " 15"); WriteTrace(TraceDebug,__FUNCTION__ " 15");
CIniFile RomIniFile(g_Settings->LoadString(SupportFile_RomDatabase).c_str()); CIniFile RomIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
stdstr Status = g_Settings->LoadString(Rdb_Status); stdstr Status = g_Settings->LoadStringVal(Rdb_Status);
char String[100]; char String[100];
RomIniFile.GetString("Rom Status",stdstr_f("%s.AutoFullScreen", Status.c_str()).c_str(),"true",String,sizeof(String)); RomIniFile.GetString("Rom Status",stdstr_f("%s.AutoFullScreen", Status.c_str()).c_str(),"true",String,sizeof(String));
if (_stricmp(String,"true") == 0) if (_stricmp(String,"true") == 0)
{ {
g_Notify->ChangeFullScreen(); Notify().ChangeFullScreen();
} }
} }
ExecuteCPU(); ExecuteCPU();
@ -427,7 +427,7 @@ void CN64System::CloseCpu()
for (int count = 0; count < 200; count ++ ) for (int count = 0; count < 200; count ++ )
{ {
Sleep(100); Sleep(100);
if (g_Notify->ProcessGuiMessages()) if (Notify().ProcessGuiMessages())
{ {
return; return;
} }
@ -475,13 +475,13 @@ void CN64System::Pause()
} }
ResetEvent(m_hPauseEvent); ResetEvent(m_hPauseEvent);
g_Settings->SaveBool(GameRunning_CPU_Paused,true); g_Settings->SaveBool(GameRunning_CPU_Paused,true);
g_Notify->RefreshMenu(); Notify().RefreshMenu();
g_Notify->DisplayMessage(5,MSG_CPU_PAUSED); g_Notify->DisplayMessage(5,MSG_CPU_PAUSED);
WaitForSingleObject(m_hPauseEvent, INFINITE); WaitForSingleObject(m_hPauseEvent, INFINITE);
ResetEvent(m_hPauseEvent); ResetEvent(m_hPauseEvent);
g_Settings->SaveBool(GameRunning_CPU_Paused,(DWORD)false); g_Settings->SaveBool(GameRunning_CPU_Paused,(DWORD)false);
g_Notify->RefreshMenu(); Notify().RefreshMenu();
g_Notify->DisplayMessage(5,MSG_CPU_RESUMED); Notify().DisplayMessage(5, MSG_CPU_RESUMED);
} }
stdstr CN64System::ChooseFileToOpen ( HWND hParent ) stdstr CN64System::ChooseFileToOpen ( HWND hParent )
@ -492,7 +492,7 @@ stdstr CN64System::ChooseFileToOpen ( HWND hParent )
memset(&FileName, 0, sizeof(FileName)); memset(&FileName, 0, sizeof(FileName));
memset(&openfilename, 0, sizeof(openfilename)); memset(&openfilename, 0, sizeof(openfilename));
strcpy(Directory,g_Settings->LoadString(Directory_Game).c_str()); strcpy(Directory,g_Settings->LoadStringVal(Directory_Game).c_str());
openfilename.lStructSize = sizeof( openfilename ); openfilename.lStructSize = sizeof( openfilename );
openfilename.hwndOwner = (HWND)hParent; openfilename.hwndOwner = (HWND)hParent;
@ -551,7 +551,7 @@ void CN64System::PluginReset()
} }
} }
} }
g_Notify->RefreshMenu(); Notify().RefreshMenu();
if (m_Recomp) if (m_Recomp)
{ {
m_Recomp->Reset(); m_Recomp->Reset();
@ -905,7 +905,7 @@ void CN64System::ExecuteCPU()
g_Notify->DisplayMessage(5,MSG_EMULATION_STARTED); g_Notify->DisplayMessage(5,MSG_EMULATION_STARTED);
m_EndEmulation = false; m_EndEmulation = false;
g_Notify->RefreshMenu(); Notify().RefreshMenu();
m_Plugins->RomOpened(); m_Plugins->RomOpened();
if (m_SyncCPU) if (m_SyncCPU)
@ -926,7 +926,7 @@ void CN64System::ExecuteCPU()
default: ExecuteInterpret(); break; default: ExecuteInterpret(); break;
} }
g_Settings->SaveBool(GameRunning_CPU_Running,(DWORD)false); g_Settings->SaveBool(GameRunning_CPU_Running,(DWORD)false);
g_Notify->WindowMode(); Notify().WindowMode();
m_Plugins->RomClosed(); m_Plugins->RomClosed();
if (m_SyncCPU) if (m_SyncCPU)
{ {
@ -1406,22 +1406,22 @@ bool CN64System::SaveState()
if ((m_Reg.STATUS_REGISTER & STATUS_EXL) != 0) { return false; } if ((m_Reg.STATUS_REGISTER & STATUS_EXL) != 0) { return false; }
//Get the file Name //Get the file Name
stdstr FileName, ExtraInfoFileName, CurrentSaveName = g_Settings->LoadString(GameRunning_InstantSaveFile); stdstr FileName, ExtraInfoFileName, CurrentSaveName = g_Settings->LoadStringVal(GameRunning_InstantSaveFile);
if (CurrentSaveName.empty()) if (CurrentSaveName.empty())
{ {
int Slot = g_Settings->LoadDword(Game_CurrentSaveState); int Slot = g_Settings->LoadDword(Game_CurrentSaveState);
if (Slot != 0) if (Slot != 0)
{ {
CurrentSaveName.Format("%s.pj%d",g_Settings->LoadString(Game_GoodName).c_str(), Slot); CurrentSaveName.Format("%s.pj%d",g_Settings->LoadStringVal(Game_GoodName).c_str(), Slot);
} }
else else
{ {
CurrentSaveName.Format("%s.pj",g_Settings->LoadString(Game_GoodName).c_str()); CurrentSaveName.Format("%s.pj",g_Settings->LoadStringVal(Game_GoodName).c_str());
} }
FileName.Format("%s%s",g_Settings->LoadString(Directory_InstantSave).c_str(),CurrentSaveName.c_str()); FileName.Format("%s%s",g_Settings->LoadStringVal(Directory_InstantSave).c_str(),CurrentSaveName.c_str());
stdstr_f ZipFileName("%s.zip",FileName.c_str()); stdstr_f ZipFileName("%s.zip",FileName.c_str());
//Make sure the target dir exists //Make sure the target dir exists
CreateDirectory(g_Settings->LoadString(Directory_InstantSave).c_str(),NULL); CreateDirectory(g_Settings->LoadStringVal(Directory_InstantSave).c_str(),NULL);
//delete any old save //delete any old save
DeleteFile(FileName.c_str()); DeleteFile(FileName.c_str());
DeleteFile(ZipFileName.c_str()); DeleteFile(ZipFileName.c_str());
@ -1541,15 +1541,15 @@ bool CN64System::SaveState()
CPath SavedFileName(FileName); CPath SavedFileName(FileName);
g_Notify->DisplayMessage(5,L"%s %s",SaveMessage.c_str(),SavedFileName.GetNameExtension().ToUTF16().c_str()); g_Notify->DisplayMessage(5,stdstr_f("%s %s",SaveMessage.c_str(),SavedFileName.GetNameExtension()).ToUTF16().c_str());
g_Notify->RefreshMenu(); Notify().RefreshMenu();
WriteTrace(TraceDebug,__FUNCTION__ ": Done"); WriteTrace(TraceDebug,__FUNCTION__ ": Done");
return true; return true;
} }
bool CN64System::LoadState() bool CN64System::LoadState()
{ {
stdstr InstantFileName = g_Settings->LoadString(GameRunning_InstantSaveFile); stdstr InstantFileName = g_Settings->LoadStringVal(GameRunning_InstantSaveFile);
if (!InstantFileName.empty()) if (!InstantFileName.empty())
{ {
bool Result = LoadState(InstantFileName.c_str()); bool Result = LoadState(InstantFileName.c_str());
@ -1558,14 +1558,14 @@ bool CN64System::LoadState()
} }
CPath FileName; CPath FileName;
FileName.SetDriveDirectory(g_Settings->LoadString(Directory_InstantSave).c_str()); FileName.SetDriveDirectory(g_Settings->LoadStringVal(Directory_InstantSave).c_str());
if (g_Settings->LoadDword(Game_CurrentSaveState) != 0) if (g_Settings->LoadDword(Game_CurrentSaveState) != 0)
{ {
FileName.SetNameExtension(stdstr_f("%s.pj%d",g_Settings->LoadString(Game_GoodName).c_str(),g_Settings->LoadDword(Game_CurrentSaveState)).c_str()); FileName.SetNameExtension(stdstr_f("%s.pj%d",g_Settings->LoadStringVal(Game_GoodName).c_str(),g_Settings->LoadDword(Game_CurrentSaveState)).c_str());
} }
else else
{ {
FileName.SetNameExtension(stdstr_f("%s.pj",g_Settings->LoadString(Game_GoodName).c_str()).c_str()); FileName.SetNameExtension(stdstr_f("%s.pj",g_Settings->LoadStringVal(Game_GoodName).c_str()).c_str());
} }
CPath ZipFileName; CPath ZipFileName;
@ -1582,11 +1582,11 @@ bool CN64System::LoadState()
//Use old file Name //Use old file Name
if (g_Settings->LoadDword(Game_CurrentSaveState) != 0) if (g_Settings->LoadDword(Game_CurrentSaveState) != 0)
{ {
FileName.SetNameExtension(stdstr_f("%s.pj%d",g_Settings->LoadString(Game_GameName).c_str(),g_Settings->LoadDword(Game_CurrentSaveState)).c_str()); FileName.SetNameExtension(stdstr_f("%s.pj%d",g_Settings->LoadStringVal(Game_GameName).c_str(),g_Settings->LoadDword(Game_CurrentSaveState)).c_str());
} }
else else
{ {
FileName.SetNameExtension(stdstr_f("%s.pj",g_Settings->LoadString(Game_GameName).c_str()).c_str()); FileName.SetNameExtension(stdstr_f("%s.pj",g_Settings->LoadStringVal(Game_GameName).c_str()).c_str());
} }
return LoadState(FileName); return LoadState(FileName);
} }
@ -1707,7 +1707,7 @@ bool CN64System::LoadState(LPCSTR FileName)
OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
if (hSaveFile == INVALID_HANDLE_VALUE) if (hSaveFile == INVALID_HANDLE_VALUE)
{ {
g_Notify->DisplayMessage(5,L"%s %s",GS(MSG_UNABLED_LOAD_STATE),FileNameStr.ToUTF16().c_str()); g_Notify->DisplayMessage(5,stdstr_f("%s %s",GS(MSG_UNABLED_LOAD_STATE),FileNameStr).ToUTF16().c_str());
return false; return false;
} }
@ -1835,11 +1835,16 @@ bool CN64System::LoadState(LPCSTR FileName)
} }
WriteTrace(TraceDebug,__FUNCTION__ ": 13"); WriteTrace(TraceDebug,__FUNCTION__ ": 13");
std::wstring LoadMsg = g_Lang->GetString(MSG_LOADED_STATE); std::wstring LoadMsg = g_Lang->GetString(MSG_LOADED_STATE);
g_Notify->DisplayMessage(5,L"%s %s",LoadMsg.c_str(),CPath(FileNameStr).GetNameExtension().ToUTF16().c_str()); g_Notify->DisplayMessage(5,stdstr_f("%s %s",LoadMsg.c_str(),CPath(FileNameStr).GetNameExtension()).ToUTF16().c_str());
WriteTrace(TraceDebug,__FUNCTION__ ": Done"); WriteTrace(TraceDebug,__FUNCTION__ ": Done");
return true; return true;
} }
void CN64System::DisplayRSPListCount()
{
g_Notify->DisplayMessage(0, stdstr_f("Dlist: %d Alist: %d Unknown: %d", m_DlistCount, m_AlistCount, m_UnknownCount).ToUTF16().c_str());
}
void CN64System::RunRSP() void CN64System::RunRSP()
{ {
WriteTraceF(TraceRSP, __FUNCTION__ ": Start (SP Status %X)",m_Reg.SP_STATUS_REG); WriteTraceF(TraceRSP, __FUNCTION__ ": Start (SP Status %X)",m_Reg.SP_STATUS_REG);
@ -1878,7 +1883,7 @@ void CN64System::RunRSP()
if (bShowDListAListCount()) if (bShowDListAListCount())
{ {
g_Notify->DisplayMessage(0,L"Dlist: %d Alist: %d Unknown: %d",m_DlistCount,m_AlistCount,m_UnknownCount); DisplayRSPListCount();
} }
if (bShowCPUPer()) if (bShowCPUPer())
{ {

View File

@ -104,6 +104,7 @@ private:
void StartEmulation2 ( bool NewThread ); void StartEmulation2 ( bool NewThread );
bool SetActiveSystem ( bool bActive = true ); bool SetActiveSystem ( bool bActive = true );
void InitRegisters ( bool bPostPif, CMipsMemory & MMU ); void InitRegisters ( bool bPostPif, CMipsMemory & MMU );
void DisplayRSPListCount();
//CPU Methods //CPU Methods
void ExecuteRecompiler(); void ExecuteRecompiler();

View File

@ -53,10 +53,10 @@ void CPlugins::PluginChanged ( CPlugins * _this )
{ {
return; return;
} }
bool bGfxChange = _stricmp(_this->m_GfxFile.c_str(),g_Settings->LoadString(Game_Plugin_Gfx).c_str()) != 0; bool bGfxChange = _stricmp(_this->m_GfxFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_Gfx).c_str()) != 0;
bool bAudioChange = _stricmp(_this->m_AudioFile.c_str(),g_Settings->LoadString(Game_Plugin_Audio).c_str()) != 0; bool bAudioChange = _stricmp(_this->m_AudioFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_Audio).c_str()) != 0;
bool bRspChange = _stricmp(_this->m_RSPFile.c_str(),g_Settings->LoadString(Game_Plugin_RSP).c_str()) != 0; bool bRspChange = _stricmp(_this->m_RSPFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_RSP).c_str()) != 0;
bool bContChange = _stricmp(_this->m_ControlFile.c_str(),g_Settings->LoadString(Game_Plugin_Controller).c_str()) != 0; bool bContChange = _stricmp(_this->m_ControlFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_Controller).c_str()) != 0;
if ( bGfxChange || bAudioChange || bRspChange || bContChange ) if ( bGfxChange || bAudioChange || bRspChange || bContChange )
{ {
@ -71,7 +71,7 @@ void CPlugins::PluginChanged ( CPlugins * _this )
else else
{ {
_this->Reset(NULL); _this->Reset(NULL);
g_Notify->RefreshMenu(); Notify().RefreshMenu();
} }
} }
} }
@ -83,7 +83,7 @@ static void LoadPlugin (SettingID PluginSettingID, SettingID PluginVerSettingID,
{ {
return; return;
} }
FileName = g_Settings->LoadString(PluginSettingID); FileName = g_Settings->LoadStringVal(PluginSettingID);
CPath PluginFileName(PluginDir,FileName.c_str()); CPath PluginFileName(PluginDir,FileName.c_str());
plugin = new plugin_type(); plugin = new plugin_type();
if (plugin) if (plugin)
@ -125,7 +125,7 @@ void CPlugins::CreatePlugins( void )
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->RefreshMenu(); Notify().RefreshMenu();
} }
} }
@ -273,10 +273,10 @@ bool CPlugins::Reset ( CN64System * System )
{ {
WriteTrace(TraceDebug,__FUNCTION__ ": Start"); WriteTrace(TraceDebug,__FUNCTION__ ": Start");
bool bGfxChange = _stricmp(m_GfxFile.c_str(),g_Settings->LoadString(Game_Plugin_Gfx).c_str()) != 0; bool bGfxChange = _stricmp(m_GfxFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_Gfx).c_str()) != 0;
bool bAudioChange = _stricmp(m_AudioFile.c_str(),g_Settings->LoadString(Game_Plugin_Audio).c_str()) != 0; bool bAudioChange = _stricmp(m_AudioFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_Audio).c_str()) != 0;
bool bRspChange = _stricmp(m_RSPFile.c_str(),g_Settings->LoadString(Game_Plugin_RSP).c_str()) != 0; bool bRspChange = _stricmp(m_RSPFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_RSP).c_str()) != 0;
bool bContChange = _stricmp(m_ControlFile.c_str(),g_Settings->LoadString(Game_Plugin_Controller).c_str()) != 0; bool bContChange = _stricmp(m_ControlFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_Controller).c_str()) != 0;
//if GFX and Audio has changed we also need to force reset of RSP //if GFX and Audio has changed we also need to force reset of RSP
if (bGfxChange || bAudioChange) if (bGfxChange || bAudioChange)
@ -382,8 +382,8 @@ void CPlugins::CreatePluginDir ( const stdstr & DstDir ) const {
bool CPlugins::CopyPlugins ( const stdstr & DstDir ) const bool CPlugins::CopyPlugins ( const stdstr & DstDir ) const
{ {
//Copy GFX Plugin //Copy GFX Plugin
CPath srcGfxPlugin(m_PluginDir.c_str(),g_Settings->LoadString(Game_Plugin_Gfx).c_str()); CPath srcGfxPlugin(m_PluginDir.c_str(),g_Settings->LoadStringVal(Game_Plugin_Gfx).c_str());
CPath dstGfxPlugin(DstDir.c_str(),g_Settings->LoadString(Game_Plugin_Gfx).c_str()); CPath dstGfxPlugin(DstDir.c_str(),g_Settings->LoadStringVal(Game_Plugin_Gfx).c_str());
if (CopyFile(srcGfxPlugin,dstGfxPlugin,false) == 0) if (CopyFile(srcGfxPlugin,dstGfxPlugin,false) == 0)
{ {
@ -395,8 +395,8 @@ bool CPlugins::CopyPlugins ( const stdstr & DstDir ) const
} }
//Copy m_Audio Plugin //Copy m_Audio Plugin
CPath srcAudioPlugin(m_PluginDir.c_str(),g_Settings->LoadString(Game_Plugin_Audio).c_str()); CPath srcAudioPlugin(m_PluginDir.c_str(),g_Settings->LoadStringVal(Game_Plugin_Audio).c_str());
CPath dstAudioPlugin(DstDir.c_str(), g_Settings->LoadString(Game_Plugin_Audio).c_str()); CPath dstAudioPlugin(DstDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Audio).c_str());
if (CopyFile(srcAudioPlugin,dstAudioPlugin,false) == 0) { if (CopyFile(srcAudioPlugin,dstAudioPlugin,false) == 0) {
if (GetLastError() == ERROR_PATH_NOT_FOUND) { dstAudioPlugin.CreateDirectory(); } if (GetLastError() == ERROR_PATH_NOT_FOUND) { dstAudioPlugin.CreateDirectory(); }
if (!CopyFile(srcAudioPlugin,dstAudioPlugin,false)) if (!CopyFile(srcAudioPlugin,dstAudioPlugin,false))
@ -406,8 +406,8 @@ bool CPlugins::CopyPlugins ( const stdstr & DstDir ) const
} }
//Copy RSP Plugin //Copy RSP Plugin
CPath srcRSPPlugin(m_PluginDir.c_str(), g_Settings->LoadString(Game_Plugin_RSP).c_str()); CPath srcRSPPlugin(m_PluginDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_RSP).c_str());
CPath dstRSPPlugin(DstDir.c_str(),g_Settings->LoadString(Game_Plugin_RSP).c_str()); CPath dstRSPPlugin(DstDir.c_str(),g_Settings->LoadStringVal(Game_Plugin_RSP).c_str());
if (CopyFile(srcRSPPlugin,dstRSPPlugin,false) == 0) { if (CopyFile(srcRSPPlugin,dstRSPPlugin,false) == 0) {
if (GetLastError() == ERROR_PATH_NOT_FOUND) { dstRSPPlugin.CreateDirectory(); } if (GetLastError() == ERROR_PATH_NOT_FOUND) { dstRSPPlugin.CreateDirectory(); }
if (!CopyFile(srcRSPPlugin,dstRSPPlugin,false)) if (!CopyFile(srcRSPPlugin,dstRSPPlugin,false))
@ -417,8 +417,8 @@ bool CPlugins::CopyPlugins ( const stdstr & DstDir ) const
} }
//Copy Controller Plugin //Copy Controller Plugin
CPath srcContPlugin(m_PluginDir.c_str(), g_Settings->LoadString(Game_Plugin_Controller).c_str()); CPath srcContPlugin(m_PluginDir.c_str(), g_Settings->LoadStringVal(Game_Plugin_Controller).c_str());
CPath dstContPlugin(DstDir.c_str(),g_Settings->LoadString(Game_Plugin_Controller).c_str()); CPath dstContPlugin(DstDir.c_str(),g_Settings->LoadStringVal(Game_Plugin_Controller).c_str());
if (!srcContPlugin.CopyTo(dstContPlugin)) if (!srcContPlugin.CopyTo(dstContPlugin))
{ {
if (GetLastError() == ERROR_PATH_NOT_FOUND) { dstContPlugin.CreateDirectory(); } if (GetLastError() == ERROR_PATH_NOT_FOUND) { dstContPlugin.CreateDirectory(); }

View File

@ -9,9 +9,10 @@
* * * *
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
#include <io.h>
CPluginList::CPluginList(bool bAutoFill /* = true */) : CPluginList::CPluginList(bool bAutoFill /* = true */) :
m_PluginDir(g_Settings->LoadString(Directory_Plugin),"") m_PluginDir(g_Settings->LoadStringVal(Directory_Plugin),"")
{ {
if (bAutoFill) if (bAutoFill)
{ {

View File

@ -10,11 +10,12 @@
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
#include "SettingsType-Application.h" #include "SettingsType-Application.h"
#include <Common/path.h>
bool CSettingTypeApplication::m_UseRegistry = false; bool CSettingTypeApplication::m_UseRegistry = false;
CIniFile * CSettingTypeApplication::m_SettingsIniFile = NULL; CIniFile * CSettingTypeApplication::m_SettingsIniFile = NULL;
CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, DWORD DefaultValue ) : CSettingTypeApplication::CSettingTypeApplication(const char * Section, const char * Name, uint32_t DefaultValue ) :
m_DefaultStr(""), m_DefaultStr(""),
m_DefaultValue(DefaultValue), m_DefaultValue(DefaultValue),
m_DefaultSetting(Default_Constant), m_DefaultSetting(Default_Constant),
@ -24,7 +25,7 @@ CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, DW
{ {
} }
CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, bool DefaultValue ) : CSettingTypeApplication::CSettingTypeApplication(const char * Section, const char * Name, bool DefaultValue ) :
m_DefaultStr(""), m_DefaultStr(""),
m_DefaultValue(DefaultValue), m_DefaultValue(DefaultValue),
m_DefaultSetting(Default_Constant), m_DefaultSetting(Default_Constant),
@ -34,7 +35,7 @@ CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, bo
{ {
} }
CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, LPCSTR DefaultValue ) : CSettingTypeApplication::CSettingTypeApplication(const char * Section, const char * Name, const char * DefaultValue ) :
m_DefaultStr(DefaultValue), m_DefaultStr(DefaultValue),
m_DefaultValue(0), m_DefaultValue(0),
m_DefaultSetting(Default_Constant), m_DefaultSetting(Default_Constant),
@ -44,7 +45,7 @@ CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, LP
{ {
} }
CSettingTypeApplication::CSettingTypeApplication(LPCSTR Section, LPCSTR Name, SettingID DefaultSetting ) : CSettingTypeApplication::CSettingTypeApplication(const char * Section, const char * Name, SettingID DefaultSetting ) :
m_DefaultStr(""), m_DefaultStr(""),
m_DefaultValue(0), m_DefaultValue(0),
m_DefaultSetting(DefaultSetting), m_DefaultSetting(DefaultSetting),
@ -58,7 +59,6 @@ CSettingTypeApplication::~CSettingTypeApplication()
{ {
} }
void CSettingTypeApplication::Initialize( const char * /*AppName*/ ) void CSettingTypeApplication::Initialize( const char * /*AppName*/ )
{ {
stdstr SettingsFile, OrigSettingsFile; stdstr SettingsFile, OrigSettingsFile;
@ -66,7 +66,7 @@ void CSettingTypeApplication::Initialize( const char * /*AppName*/ )
for (int i = 0; i < 100; i++) for (int i = 0; i < 100; i++)
{ {
OrigSettingsFile = SettingsFile; OrigSettingsFile = SettingsFile;
if (!g_Settings->LoadString(SupportFile_Settings,SettingsFile) && i > 0) if (!g_Settings->LoadStringVal(SupportFile_Settings,SettingsFile) && i > 0)
{ {
break; break;
} }
@ -115,7 +115,7 @@ bool CSettingTypeApplication::Load ( int /*Index*/, bool & Value ) const
if (!m_UseRegistry) if (!m_UseRegistry)
{ {
DWORD dwValue; uint32_t dwValue;
bRes = m_SettingsIniFile->GetNumber(SectionName(),m_KeyNameIdex.c_str(),Value,dwValue); bRes = m_SettingsIniFile->GetNumber(SectionName(),m_KeyNameIdex.c_str(),Value,dwValue);
if (bRes) if (bRes)
{ {
@ -137,7 +137,7 @@ bool CSettingTypeApplication::Load ( int /*Index*/, bool & Value ) const
return bRes; return bRes;
} }
bool CSettingTypeApplication::Load ( int /*Index*/, ULONG & Value ) const bool CSettingTypeApplication::Load ( int /*Index*/, uint32_t & Value ) const
{ {
bool bRes = false; bool bRes = false;
if (!m_UseRegistry) if (!m_UseRegistry)
@ -158,7 +158,7 @@ bool CSettingTypeApplication::Load ( int /*Index*/, ULONG & Value ) const
return bRes; return bRes;
} }
LPCSTR CSettingTypeApplication::SectionName ( void ) const const char * CSettingTypeApplication::SectionName ( void ) const
{ {
return m_Section.c_str(); return m_Section.c_str();
} }
@ -193,7 +193,7 @@ void CSettingTypeApplication::LoadDefault ( int /*Index*/, bool & Value ) cons
} }
} }
void CSettingTypeApplication::LoadDefault ( int /*Index*/, ULONG & Value ) const void CSettingTypeApplication::LoadDefault ( int /*Index*/, uint32_t & Value ) const
{ {
if (m_DefaultSetting != Default_None) if (m_DefaultSetting != Default_None)
{ {
@ -214,7 +214,7 @@ void CSettingTypeApplication::LoadDefault ( int /*Index*/, stdstr & Value ) cons
{ {
Value = m_DefaultStr; Value = m_DefaultStr;
} else { } else {
g_Settings->LoadString(m_DefaultSetting,Value); g_Settings->LoadStringVal(m_DefaultSetting,Value);
} }
} }
} }
@ -230,7 +230,7 @@ void CSettingTypeApplication::Save ( int /*Index*/, bool Value )
} }
} }
void CSettingTypeApplication::Save ( int /*Index*/, ULONG Value ) void CSettingTypeApplication::Save ( int /*Index*/, uint32_t Value )
{ {
if (!m_UseRegistry) if (!m_UseRegistry)
{ {
@ -260,7 +260,7 @@ void CSettingTypeApplication::Save ( int /*Index*/, const char * Value )
} }
} }
stdstr CSettingTypeApplication::FixSectionName(LPCSTR Section) stdstr CSettingTypeApplication::FixSectionName(const char * Section)
{ {
stdstr SectionName(Section); stdstr SectionName(Section);

View File

@ -10,30 +10,17 @@
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include <Common/Ini File Class.h>
#include "SettingsType-Base.h"
class CSettingTypeApplication : class CSettingTypeApplication :
public CSettingType public CSettingType
{ {
protected:
const LPCSTR m_DefaultStr;
const DWORD m_DefaultValue;
const SettingID m_DefaultSetting;
stdstr FixSectionName (LPCSTR Section);
static CIniFile * m_SettingsIniFile;
static bool m_UseRegistry;
const stdstr m_Section;
const stdstr m_KeyName;
mutable stdstr m_KeyNameIdex;
virtual LPCSTR SectionName ( void ) const;
public: public:
CSettingTypeApplication(LPCSTR Section, LPCSTR Name, LPCSTR DefaultValue ); CSettingTypeApplication(const char * Section, const char * Name, const char * DefaultValue );
CSettingTypeApplication(LPCSTR Section, LPCSTR Name, bool DefaultValue ); CSettingTypeApplication(const char * Section, const char * Name, bool DefaultValue );
CSettingTypeApplication(LPCSTR Section, LPCSTR Name, DWORD DefaultValue ); CSettingTypeApplication(const char * Section, const char * Name, uint32_t DefaultValue );
CSettingTypeApplication(LPCSTR Section, LPCSTR Name, SettingID DefaultSetting ); CSettingTypeApplication(const char * Section, const char * Name, SettingID DefaultSetting );
virtual ~CSettingTypeApplication(); virtual ~CSettingTypeApplication();
virtual bool IndexBasedSetting ( void ) const { return false; } virtual bool IndexBasedSetting ( void ) const { return false; }
@ -41,17 +28,17 @@ public:
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const; virtual void LoadDefault ( int Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
@ -63,6 +50,24 @@ public:
static void CleanUp ( void ); static void CleanUp ( void );
static void Flush ( void ); static void Flush ( void );
LPCSTR GetKeyName ( void) const { return m_KeyName.c_str(); } const char * GetKeyName ( void) const { return m_KeyName.c_str(); }
};
protected:
const char * m_DefaultStr;
const uint32_t m_DefaultValue;
const SettingID m_DefaultSetting;
stdstr FixSectionName (const char * Section);
static CIniFile * m_SettingsIniFile;
static bool m_UseRegistry;
const stdstr m_Section;
const stdstr m_KeyName;
mutable stdstr m_KeyNameIdex;
virtual const char * SectionName ( void ) const;
private:
CSettingTypeApplication(const CSettingTypeApplication&); // Disable copy constructor
CSettingTypeApplication& operator=(const CSettingTypeApplication&); // Disable assignment
};

View File

@ -12,23 +12,22 @@
#include "SettingsType-Application.h" #include "SettingsType-Application.h"
#include "SettingsType-ApplicationIndex.h" #include "SettingsType-ApplicationIndex.h"
CSettingTypeApplicationIndex::CSettingTypeApplicationIndex(const char * Section, const char * Name, uint32_t DefaultValue ) :
CSettingTypeApplicationIndex::CSettingTypeApplicationIndex(LPCSTR Section, LPCSTR Name, DWORD DefaultValue ) :
CSettingTypeApplication(Section,Name,DefaultValue) CSettingTypeApplication(Section,Name,DefaultValue)
{ {
} }
CSettingTypeApplicationIndex::CSettingTypeApplicationIndex(LPCSTR Section, LPCSTR Name, bool DefaultValue ) : CSettingTypeApplicationIndex::CSettingTypeApplicationIndex(const char * Section, const char * Name, bool DefaultValue ) :
CSettingTypeApplication(Section,Name,DefaultValue) CSettingTypeApplication(Section,Name,DefaultValue)
{ {
} }
CSettingTypeApplicationIndex::CSettingTypeApplicationIndex(LPCSTR Section, LPCSTR Name, LPCSTR DefaultValue ) : CSettingTypeApplicationIndex::CSettingTypeApplicationIndex(const char * Section, const char * Name, const char * DefaultValue ) :
CSettingTypeApplication(Section,Name,DefaultValue) CSettingTypeApplication(Section,Name,DefaultValue)
{ {
} }
CSettingTypeApplicationIndex::CSettingTypeApplicationIndex(LPCSTR Section, LPCSTR Name, SettingID DefaultSetting ) : CSettingTypeApplicationIndex::CSettingTypeApplicationIndex(const char * Section, const char * Name, SettingID DefaultSetting ) :
CSettingTypeApplication(Section,Name,DefaultSetting) CSettingTypeApplication(Section,Name,DefaultSetting)
{ {
} }
@ -43,7 +42,7 @@ bool CSettingTypeApplicationIndex::Load ( int Index, bool & Value ) const
return CSettingTypeApplication::Load(0,Value); return CSettingTypeApplication::Load(0,Value);
} }
bool CSettingTypeApplicationIndex::Load ( int Index, ULONG & Value ) const bool CSettingTypeApplicationIndex::Load ( int Index, uint32_t & Value ) const
{ {
m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index); m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
return CSettingTypeApplication::Load(0,Value); return CSettingTypeApplication::Load(0,Value);
@ -62,7 +61,7 @@ void CSettingTypeApplicationIndex::LoadDefault ( int Index, bool & Value ) con
CSettingTypeApplication::LoadDefault(0,Value); CSettingTypeApplication::LoadDefault(0,Value);
} }
void CSettingTypeApplicationIndex::LoadDefault ( int Index, ULONG & Value ) const void CSettingTypeApplicationIndex::LoadDefault ( int Index, uint32_t & Value ) const
{ {
m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index); m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
CSettingTypeApplication::LoadDefault(0,Value); CSettingTypeApplication::LoadDefault(0,Value);
@ -81,7 +80,7 @@ void CSettingTypeApplicationIndex::Save ( int Index, bool Value )
CSettingTypeApplication::Save(0,Value); CSettingTypeApplication::Save(0,Value);
} }
void CSettingTypeApplicationIndex::Save ( int Index, ULONG Value ) void CSettingTypeApplicationIndex::Save ( int Index, uint32_t Value )
{ {
m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index); m_KeyNameIdex.Format("%s %d",m_KeyName.c_str(),Index);
CSettingTypeApplication::Save(0,Value); CSettingTypeApplication::Save(0,Value);

View File

@ -13,33 +13,36 @@
class CSettingTypeApplicationIndex : class CSettingTypeApplicationIndex :
public CSettingTypeApplication public CSettingTypeApplication
{ {
public: public:
CSettingTypeApplicationIndex(LPCSTR Section, LPCSTR Name, LPCSTR DefaultValue ); CSettingTypeApplicationIndex(const char * Section, const char * Name, const char * DefaultValue );
CSettingTypeApplicationIndex(LPCSTR Section, LPCSTR Name, bool DefaultValue ); CSettingTypeApplicationIndex(const char * Section, const char * Name, bool DefaultValue );
CSettingTypeApplicationIndex(LPCSTR Section, LPCSTR Name, DWORD DefaultValue ); CSettingTypeApplicationIndex(const char * Section, const char * Name, uint32_t DefaultValue );
CSettingTypeApplicationIndex(LPCSTR Section, LPCSTR Name, SettingID DefaultSetting ); CSettingTypeApplicationIndex(const char * Section, const char * Name, SettingID DefaultSetting );
~CSettingTypeApplicationIndex(); ~CSettingTypeApplicationIndex();
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 ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const; virtual void LoadDefault ( int Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int Index );
};
private:
CSettingTypeApplicationIndex(void); // Disable default constructor
CSettingTypeApplicationIndex(const CSettingTypeApplicationIndex&); // Disable copy constructor
CSettingTypeApplicationIndex& operator=(const CSettingTypeApplicationIndex&); // Disable assignment
};

View File

@ -10,6 +10,8 @@
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include "../Settings.h"
enum SettingType { enum SettingType {
SettingType_Unknown = -1, SettingType_Unknown = -1,
SettingType_ConstString = 0, SettingType_ConstString = 0,
@ -38,22 +40,20 @@ public:
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const = 0; virtual bool Load ( int Index, bool & Value ) const = 0;
virtual bool Load ( int Index, ULONG & Value ) const = 0; virtual bool Load ( int Index, uint32_t & Value ) const = 0;
virtual bool Load ( int Index, stdstr & Value ) const = 0; virtual bool Load ( int 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 ( int Index, bool & Value ) const = 0;
virtual void LoadDefault ( int Index, ULONG & Value ) const = 0; virtual void LoadDefault ( int Index, uint32_t & Value ) const = 0;
virtual void LoadDefault ( int Index, stdstr & Value ) const = 0; virtual void LoadDefault ( int Index, stdstr & Value ) const = 0;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ) = 0; virtual void Save ( int Index, bool Value ) = 0;
virtual void Save ( int Index, ULONG Value ) = 0; virtual void Save ( int Index, uint32_t Value ) = 0;
virtual void Save ( int Index, const stdstr & Value ) = 0; virtual void Save ( int Index, const stdstr & Value ) = 0;
virtual void Save ( int Index, const char * Value ) = 0; virtual void Save ( int Index, const char * Value ) = 0;
// Delete the setting // Delete the setting
virtual void Delete ( int Index ) = 0; virtual void Delete ( int Index ) = 0;
}; };

View File

@ -11,10 +11,12 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsType-Cheats.h" #include "SettingsType-Cheats.h"
CIniFile * CSettingTypeCheats::m_CheatIniFile = NULL; CIniFile * CSettingTypeCheats::m_CheatIniFile = NULL;
stdstr * CSettingTypeCheats::m_SectionIdent = NULL; stdstr * CSettingTypeCheats::m_SectionIdent = NULL;
CSettingTypeCheats::CSettingTypeCheats(LPCSTR PostFix ) : CSettingTypeCheats::CSettingTypeCheats(const char * PostFix ) :
m_PostFix(PostFix) m_PostFix(PostFix)
{ {
} }
@ -25,10 +27,10 @@ CSettingTypeCheats::~CSettingTypeCheats ( void )
void CSettingTypeCheats::Initialize ( void ) void CSettingTypeCheats::Initialize ( void )
{ {
m_CheatIniFile = new CIniFile(g_Settings->LoadString(SupportFile_Cheats).c_str()); m_CheatIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Cheats).c_str());
m_CheatIniFile->SetAutoFlush(false); m_CheatIniFile->SetAutoFlush(false);
g_Settings->RegisterChangeCB(Game_IniKey,NULL,GameChanged); g_Settings->RegisterChangeCB(Game_IniKey,NULL,GameChanged);
m_SectionIdent = new stdstr(g_Settings->LoadString(Game_IniKey)); m_SectionIdent = new stdstr(g_Settings->LoadStringVal(Game_IniKey));
GameChanged(NULL); GameChanged(NULL);
} }
@ -57,15 +59,14 @@ void CSettingTypeCheats::FlushChanges( void )
void CSettingTypeCheats::GameChanged ( void * /*Data */ ) void CSettingTypeCheats::GameChanged ( void * /*Data */ )
{ {
*m_SectionIdent = g_Settings->LoadString(Game_IniKey); *m_SectionIdent = g_Settings->LoadStringVal(Game_IniKey);
} }
/*stdstr CSettingTypeCheats::FixName ( const char * Section, const char * Name )
/*stdstr CSettingTypeCheats::FixName ( LPCSTR Section, LPCSTR Name )
{ {
} }
LPCSTR CSettingTypeCheats::SectionName ( void ) const const char * CSettingTypeCheats::SectionName ( void ) const
{ {
return ""; return "";
} }
@ -81,7 +82,7 @@ bool CSettingTypeCheats::Load ( int /*Index*/, bool & /*Value*/ ) const
return false; return false;
} }
bool CSettingTypeCheats::Load ( int /*Index*/, ULONG & /*Value*/ ) const bool CSettingTypeCheats::Load ( int /*Index*/, uint32_t & /*Value*/ ) const
{ {
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
@ -103,7 +104,7 @@ void CSettingTypeCheats::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeCheats::LoadDefault ( int /*Index*/, ULONG & /*Value*/ ) const void CSettingTypeCheats::LoadDefault ( int /*Index*/, uint32_t & /*Value*/ ) const
{ {
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
@ -119,7 +120,7 @@ void CSettingTypeCheats::Save ( int /*Index*/, bool /*Value*/ )
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeCheats::Save ( int /*Index*/, ULONG /*Value*/ ) void CSettingTypeCheats::Save ( int /*Index*/, uint32_t /*Value*/ )
{ {
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }

View File

@ -10,18 +10,14 @@
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include "SettingsType-Base.h"
#include <Common/Ini File Class.h>
class CSettingTypeCheats : class CSettingTypeCheats :
public CSettingType public CSettingType
{ {
protected:
static CIniFile * m_CheatIniFile;
static stdstr * m_SectionIdent;
const LPCSTR m_PostFix;
static void GameChanged ( void * /*Data */ );
public: public:
CSettingTypeCheats(LPCSTR PostFix ); CSettingTypeCheats(const char * PostFix );
~CSettingTypeCheats(); ~CSettingTypeCheats();
virtual bool IndexBasedSetting ( void ) const { return true; } virtual bool IndexBasedSetting ( void ) const { return true; }
@ -29,17 +25,17 @@ public:
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const; virtual void LoadDefault ( int Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
@ -51,5 +47,14 @@ public:
static void CleanUp ( void ); static void CleanUp ( void );
static void FlushChanges ( void ); static void FlushChanges ( void );
}; protected:
static CIniFile * m_CheatIniFile;
static stdstr * m_SectionIdent;
const char * const m_PostFix;
static void GameChanged ( void * /*Data */ );
private:
CSettingTypeCheats(void); // Disable default constructor
CSettingTypeCheats(const CSettingTypeCheats&); // Disable copy constructor
CSettingTypeCheats& operator=(const CSettingTypeCheats&); // Disable assignment
};

View File

@ -16,17 +16,17 @@ bool CSettingTypeGame::m_RdbEditor = false;
bool CSettingTypeGame::m_EraseDefaults = true; bool CSettingTypeGame::m_EraseDefaults = true;
stdstr * CSettingTypeGame::m_SectionIdent = NULL; stdstr * CSettingTypeGame::m_SectionIdent = NULL;
CSettingTypeGame::CSettingTypeGame(LPCSTR Name, LPCSTR DefaultValue ) : CSettingTypeGame::CSettingTypeGame(const char * Name, const char * DefaultValue ) :
CSettingTypeApplication("",Name,DefaultValue) CSettingTypeApplication("",Name,DefaultValue)
{ {
} }
CSettingTypeGame::CSettingTypeGame(LPCSTR Name, DWORD DefaultValue ) : CSettingTypeGame::CSettingTypeGame(const char * Name, uint32_t DefaultValue ) :
CSettingTypeApplication("",Name,DefaultValue) CSettingTypeApplication("",Name,DefaultValue)
{ {
} }
CSettingTypeGame::CSettingTypeGame(LPCSTR Name, SettingID DefaultSetting ) : CSettingTypeGame::CSettingTypeGame(const char * Name, SettingID DefaultSetting ) :
CSettingTypeApplication("",Name,DefaultSetting) CSettingTypeApplication("",Name,DefaultSetting)
{ {
} }
@ -51,7 +51,7 @@ void CSettingTypeGame::CleanUp ( void )
} }
} }
LPCSTR CSettingTypeGame::SectionName ( void ) const const char * CSettingTypeGame::SectionName ( void ) const
{ {
return m_SectionIdent ? m_SectionIdent->c_str() : ""; return m_SectionIdent ? m_SectionIdent->c_str() : "";
} }
@ -60,7 +60,7 @@ void CSettingTypeGame::UpdateSettings ( void * /*Data */ )
{ {
m_RdbEditor = g_Settings->LoadBool(Setting_RdbEditor); m_RdbEditor = g_Settings->LoadBool(Setting_RdbEditor);
m_EraseDefaults = g_Settings->LoadBool(Setting_EraseGameDefaults); m_EraseDefaults = g_Settings->LoadBool(Setting_EraseGameDefaults);
stdstr SectionIdent = g_Settings->LoadString(Game_IniKey); stdstr SectionIdent = g_Settings->LoadStringVal(Game_IniKey);
if (m_SectionIdent == NULL) if (m_SectionIdent == NULL)
{ {
@ -72,7 +72,6 @@ void CSettingTypeGame::UpdateSettings ( void * /*Data */ )
g_Settings->SettingTypeChanged(SettingType_GameSetting); g_Settings->SettingTypeChanged(SettingType_GameSetting);
g_Settings->SettingTypeChanged(SettingType_RomDatabase); g_Settings->SettingTypeChanged(SettingType_RomDatabase);
} }
} }
bool CSettingTypeGame::Load ( int Index, bool & Value ) const bool CSettingTypeGame::Load ( int Index, bool & Value ) const
@ -89,7 +88,7 @@ bool CSettingTypeGame::Load ( int Index, bool & Value ) const
return CSettingTypeApplication::Load(Index,Value); return CSettingTypeApplication::Load(Index,Value);
} }
bool CSettingTypeGame::Load ( int Index, ULONG & Value ) const bool CSettingTypeGame::Load ( int Index, uint32_t & Value ) const
{ {
if (m_RdbEditor && g_Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase) if (m_RdbEditor && g_Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase)
{ {
@ -111,7 +110,7 @@ bool CSettingTypeGame::Load ( int Index, stdstr & Value ) const
{ {
return g_Settings->LoadStringIndex(m_DefaultSetting,Index,Value); return g_Settings->LoadStringIndex(m_DefaultSetting,Index,Value);
} else { } else {
return g_Settings->LoadString(m_DefaultSetting,Value); return g_Settings->LoadStringVal(m_DefaultSetting,Value);
} }
} }
return CSettingTypeApplication::Load(Index,Value); return CSettingTypeApplication::Load(Index,Value);
@ -133,7 +132,7 @@ void CSettingTypeGame::LoadDefault ( int Index, bool & Value ) const
} }
} }
void CSettingTypeGame::LoadDefault ( int Index, ULONG & Value ) const void CSettingTypeGame::LoadDefault ( int Index, uint32_t & Value ) const
{ {
if (m_RdbEditor && g_Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase) if (m_RdbEditor && g_Settings->GetSettingType(m_DefaultSetting) == SettingType_RomDatabase)
{ {
@ -189,11 +188,11 @@ void CSettingTypeGame::Save ( int Index, bool Value )
} }
} }
void CSettingTypeGame::Save ( int Index, ULONG Value ) void CSettingTypeGame::Save ( int Index, uint32_t Value )
{ {
if (m_EraseDefaults) if (m_EraseDefaults)
{ {
ULONG ulDefault; uint32_t ulDefault;
CSettingTypeGame::LoadDefault(Index,ulDefault); CSettingTypeGame::LoadDefault(Index,ulDefault);
if (ulDefault == Value) if (ulDefault == Value)
{ {

View File

@ -20,12 +20,12 @@ protected:
static void UpdateSettings ( void * /*Data */ ); static void UpdateSettings ( void * /*Data */ );
virtual LPCSTR SectionName ( void ) const; virtual const char * SectionName ( void ) const;
public: public:
CSettingTypeGame(LPCSTR Name, LPCSTR DefaultValue ); CSettingTypeGame(const char * Name, const char * DefaultValue );
CSettingTypeGame(LPCSTR Name, DWORD DefaultValue ); CSettingTypeGame(const char * Name, uint32_t DefaultValue );
CSettingTypeGame(LPCSTR Name, SettingID DefaultSetting ); CSettingTypeGame(const char * Name, SettingID DefaultSetting );
virtual ~CSettingTypeGame(); virtual ~CSettingTypeGame();
virtual bool IndexBasedSetting ( void ) const { return false; } virtual bool IndexBasedSetting ( void ) const { return false; }
@ -36,21 +36,25 @@ public:
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const; virtual void LoadDefault ( int Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int Index );
};
private:
CSettingTypeGame(void); // Disable default constructor
CSettingTypeGame(const CSettingTypeGame&); // Disable copy constructor
CSettingTypeGame& operator=(const CSettingTypeGame&); // Disable assignment
};

View File

@ -13,22 +13,21 @@
#include "SettingsType-GameSetting.h" #include "SettingsType-GameSetting.h"
#include "SettingsType-GameSettingIndex.h" #include "SettingsType-GameSettingIndex.h"
CSettingTypeGameIndex::CSettingTypeGameIndex(const char * PreIndex, const char * PostIndex, SettingID DefaultSetting ) :
CSettingTypeGameIndex::CSettingTypeGameIndex(LPCSTR PreIndex, LPCSTR PostIndex, SettingID DefaultSetting ) :
CSettingTypeGame("", DefaultSetting), CSettingTypeGame("", DefaultSetting),
m_PreIndex(PreIndex), m_PreIndex(PreIndex),
m_PostIndex(PostIndex) m_PostIndex(PostIndex)
{ {
} }
CSettingTypeGameIndex::CSettingTypeGameIndex(LPCSTR PreIndex, LPCSTR PostIndex, DWORD DefaultValue ) : CSettingTypeGameIndex::CSettingTypeGameIndex(const char * PreIndex, const char * PostIndex, uint32_t DefaultValue ) :
CSettingTypeGame("", DefaultValue), CSettingTypeGame("", DefaultValue),
m_PreIndex(PreIndex), m_PreIndex(PreIndex),
m_PostIndex(PostIndex) m_PostIndex(PostIndex)
{ {
} }
CSettingTypeGameIndex::CSettingTypeGameIndex(LPCSTR PreIndex, LPCSTR PostIndex, LPCSTR DefaultValue ) : CSettingTypeGameIndex::CSettingTypeGameIndex(const char * PreIndex, const char * PostIndex, const char * DefaultValue ) :
CSettingTypeGame("", DefaultValue), CSettingTypeGame("", DefaultValue),
m_PreIndex(PreIndex), m_PreIndex(PreIndex),
m_PostIndex(PostIndex) m_PostIndex(PostIndex)
@ -45,9 +44,9 @@ bool CSettingTypeGameIndex::Load ( int Index, bool & Value ) const
return CSettingTypeGame::Load(Index,Value); return CSettingTypeGame::Load(Index,Value);
} }
bool CSettingTypeGameIndex::Load ( int /*Index*/, ULONG & /*Value*/ ) const bool CSettingTypeGameIndex::Load ( int /*Index*/, uint32_t & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
@ -64,14 +63,14 @@ void CSettingTypeGameIndex::LoadDefault ( int Index, bool & Value ) const
CSettingTypeGame::LoadDefault(0,Value); CSettingTypeGame::LoadDefault(0,Value);
} }
void CSettingTypeGameIndex::LoadDefault ( int /*Index*/, ULONG & /*Value*/ ) const void CSettingTypeGameIndex::LoadDefault ( int /*Index*/, uint32_t & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeGameIndex::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const void CSettingTypeGameIndex::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
//Update the settings //Update the settings
@ -81,7 +80,7 @@ void CSettingTypeGameIndex::Save ( int Index, bool Value )
CSettingTypeGame::Save(Index,Value); CSettingTypeGame::Save(Index,Value);
} }
void CSettingTypeGameIndex::Save ( int Index, ULONG Value ) void CSettingTypeGameIndex::Save(int Index, uint32_t Value)
{ {
m_KeyNameIdex.Format("%s%d%s",m_PreIndex.c_str(),Index,m_PostIndex.c_str()); m_KeyNameIdex.Format("%s%d%s",m_PreIndex.c_str(),Index,m_PostIndex.c_str());
CSettingTypeGame::Save(0,Value); CSettingTypeGame::Save(0,Value);
@ -89,7 +88,7 @@ void CSettingTypeGameIndex::Save ( int Index, ULONG Value )
void CSettingTypeGameIndex::Save ( int /*Index*/, const stdstr & /*Value*/ ) void CSettingTypeGameIndex::Save ( int /*Index*/, const stdstr & /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeGameIndex::Save ( int Index, const char * Value ) void CSettingTypeGameIndex::Save ( int Index, const char * Value )

View File

@ -16,9 +16,9 @@ class CSettingTypeGameIndex :
stdstr m_PreIndex, m_PostIndex; stdstr m_PreIndex, m_PostIndex;
public: public:
CSettingTypeGameIndex(LPCSTR PreIndex, LPCSTR PostIndex, LPCSTR DefaultValue ); CSettingTypeGameIndex(const char * PreIndex, const char * PostIndex, const char * DefaultValue );
CSettingTypeGameIndex(LPCSTR PreIndex, LPCSTR PostIndex, DWORD DefaultValue ); CSettingTypeGameIndex(const char * PreIndex, const char * PostIndex, uint32_t DefaultValue );
CSettingTypeGameIndex(LPCSTR PreIndex, LPCSTR PostIndex, SettingID DefaultSetting ); CSettingTypeGameIndex(const char * PreIndex, const char * PostIndex, SettingID DefaultSetting );
~CSettingTypeGameIndex(); ~CSettingTypeGameIndex();
virtual bool IndexBasedSetting ( void ) const { return true; } virtual bool IndexBasedSetting ( void ) const { return true; }
@ -26,21 +26,25 @@ public:
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const; virtual void LoadDefault ( int Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int Index );
};
private:
CSettingTypeGameIndex(void); // Disable default constructor
CSettingTypeGameIndex(const CSettingTypeGameIndex&); // Disable copy constructor
CSettingTypeGameIndex& operator=(const CSettingTypeGameIndex&); // Disable assignment
};

View File

@ -11,13 +11,14 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsType-RomDatabase.h" #include "SettingsType-RomDatabase.h"
#include "SettingsType-RDBCpuType.h" #include "SettingsType-RDBCpuType.h"
#include "../../N64 System/N64 Types.h"
CSettingTypeRDBCpuType::CSettingTypeRDBCpuType(LPCSTR Name, SettingID DefaultSetting ) : CSettingTypeRDBCpuType::CSettingTypeRDBCpuType(const char * Name, SettingID DefaultSetting ) :
CSettingTypeRomDatabase(Name,DefaultSetting) CSettingTypeRomDatabase(Name,DefaultSetting)
{ {
} }
CSettingTypeRDBCpuType::CSettingTypeRDBCpuType(LPCSTR Name, int DefaultValue ) : CSettingTypeRDBCpuType::CSettingTypeRDBCpuType(const char * Name, int DefaultValue ) :
CSettingTypeRomDatabase(Name,DefaultValue) CSettingTypeRomDatabase(Name,DefaultValue)
{ {
} }
@ -28,11 +29,11 @@ CSettingTypeRDBCpuType::~CSettingTypeRDBCpuType()
bool CSettingTypeRDBCpuType::Load ( int /*Index*/, bool & /*Value*/ ) const bool CSettingTypeRDBCpuType::Load ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
bool CSettingTypeRDBCpuType::Load ( int Index, ULONG & Value ) const bool CSettingTypeRDBCpuType::Load ( int Index, uint32_t & Value ) const
{ {
stdstr strValue; stdstr strValue;
bool bRes = m_SettingsIniFile->GetString(m_SectionIdent->c_str(),m_KeyName.c_str(),m_DefaultStr,strValue); bool bRes = m_SettingsIniFile->GetString(m_SectionIdent->c_str(),m_KeyName.c_str(),m_DefaultStr,strValue);
@ -41,7 +42,7 @@ bool CSettingTypeRDBCpuType::Load ( int Index, ULONG & Value ) const
LoadDefault(Index,Value); LoadDefault(Index,Value);
return false; return false;
} }
LPCSTR String = strValue.c_str(); const char * String = strValue.c_str();
if (_stricmp(String,"Interpreter") == 0) { Value = CPU_Interpreter; } if (_stricmp(String,"Interpreter") == 0) { Value = CPU_Interpreter; }
else if (_stricmp(String,"Recompiler") == 0) { Value = CPU_Recompiler; } else if (_stricmp(String,"Recompiler") == 0) { Value = CPU_Recompiler; }
@ -51,24 +52,24 @@ bool CSettingTypeRDBCpuType::Load ( int Index, ULONG & Value ) const
LoadDefault(Index,Value); LoadDefault(Index,Value);
return false; return false;
} }
else { Notify().BreakPoint(__FILEW__,__LINE__); } else { g_Notify->BreakPoint(__FILEW__,__LINE__); }
return true; return true;
} }
bool CSettingTypeRDBCpuType::Load ( int /*Index*/, stdstr & /*Value*/ ) const bool CSettingTypeRDBCpuType::Load ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
//return the default values //return the default values
void CSettingTypeRDBCpuType::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const void CSettingTypeRDBCpuType::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRDBCpuType::LoadDefault ( int /*Index*/, ULONG & Value ) const void CSettingTypeRDBCpuType::LoadDefault ( int /*Index*/, uint32_t & Value ) const
{ {
if (m_DefaultSetting != Default_None) if (m_DefaultSetting != Default_None)
{ {
@ -83,18 +84,17 @@ void CSettingTypeRDBCpuType::LoadDefault ( int /*Index*/, ULONG & Value ) const
void CSettingTypeRDBCpuType::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const void CSettingTypeRDBCpuType::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
//Update the settings //Update the settings
void CSettingTypeRDBCpuType::Save ( int /*Index*/, bool /*Value*/ ) void CSettingTypeRDBCpuType::Save ( int /*Index*/, bool /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRDBCpuType::Save ( int /*Index*/, ULONG Value ) void CSettingTypeRDBCpuType::Save ( int /*Index*/, uint32_t Value )
{ {
stdstr strValue; stdstr strValue;
switch (Value) switch (Value)
{ {
@ -102,19 +102,19 @@ void CSettingTypeRDBCpuType::Save ( int /*Index*/, ULONG Value )
case CPU_Recompiler: strValue = "Recompiler"; break; case CPU_Recompiler: strValue = "Recompiler"; break;
case CPU_SyncCores: strValue = "SyncCores"; break; case CPU_SyncCores: strValue = "SyncCores"; break;
default: default:
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
m_SettingsIniFile->SaveString(m_SectionIdent->c_str(),m_KeyName.c_str(),strValue.c_str()); m_SettingsIniFile->SaveString(m_SectionIdent->c_str(),m_KeyName.c_str(),strValue.c_str());
} }
void CSettingTypeRDBCpuType::Save ( int /*Index*/, const stdstr & /*Value*/ ) void CSettingTypeRDBCpuType::Save ( int /*Index*/, const stdstr & /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRDBCpuType::Save ( int /*Index*/, const char * /*Value*/ ) void CSettingTypeRDBCpuType::Save ( int /*Index*/, const char * /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRDBCpuType::Delete( int /*Index*/ ) void CSettingTypeRDBCpuType::Delete( int /*Index*/ )

View File

@ -13,29 +13,32 @@
class CSettingTypeRDBCpuType : class CSettingTypeRDBCpuType :
public CSettingTypeRomDatabase public CSettingTypeRomDatabase
{ {
public: public:
CSettingTypeRDBCpuType(LPCSTR Name, SettingID DefaultSetting ); CSettingTypeRDBCpuType(const char * Name, SettingID DefaultSetting );
CSettingTypeRDBCpuType(LPCSTR Name, int DefaultValue ); CSettingTypeRDBCpuType(const char * Name, int DefaultValue );
~CSettingTypeRDBCpuType(); ~CSettingTypeRDBCpuType();
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const; virtual void LoadDefault ( int Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int Index );
};
private:
CSettingTypeRDBCpuType(void); // Disable default constructor
CSettingTypeRDBCpuType(const CSettingTypeRDBCpuType&); // Disable copy constructor
CSettingTypeRDBCpuType& operator=(const CSettingTypeRDBCpuType&); // Disable assignment
};

View File

@ -14,12 +14,12 @@
// == 8 ? 0x800000 : 0x400000 // == 8 ? 0x800000 : 0x400000
CSettingTypeRDBRDRamSize::CSettingTypeRDBRDRamSize(LPCSTR Name, SettingID DefaultSetting ) : CSettingTypeRDBRDRamSize::CSettingTypeRDBRDRamSize(const char * Name, SettingID DefaultSetting ) :
CSettingTypeRomDatabase(Name,DefaultSetting) CSettingTypeRomDatabase(Name,DefaultSetting)
{ {
} }
CSettingTypeRDBRDRamSize::CSettingTypeRDBRDRamSize(LPCSTR Name, int DefaultValue ) : CSettingTypeRDBRDRamSize::CSettingTypeRDBRDRamSize(const char * Name, int DefaultValue ) :
CSettingTypeRomDatabase(Name,DefaultValue) CSettingTypeRomDatabase(Name,DefaultValue)
{ {
} }
@ -30,13 +30,13 @@ CSettingTypeRDBRDRamSize::~CSettingTypeRDBRDRamSize()
bool CSettingTypeRDBRDRamSize::Load ( int /*Index*/, bool & /*Value*/ ) const bool CSettingTypeRDBRDRamSize::Load ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
bool CSettingTypeRDBRDRamSize::Load ( int Index, ULONG & Value ) const bool CSettingTypeRDBRDRamSize::Load ( int Index, uint32_t & Value ) const
{ {
ULONG ulValue; uint32_t ulValue;
bool bRes = m_SettingsIniFile->GetNumber(m_SectionIdent->c_str(),m_KeyName.c_str(),m_DefaultValue,ulValue); bool bRes = m_SettingsIniFile->GetNumber(m_SectionIdent->c_str(),m_KeyName.c_str(),m_DefaultValue,ulValue);
if (!bRes) if (!bRes)
{ {
@ -52,45 +52,45 @@ bool CSettingTypeRDBRDRamSize::Load ( int Index, ULONG & Value ) const
bool CSettingTypeRDBRDRamSize::Load ( int /*Index*/, stdstr & /*Value*/ ) const bool CSettingTypeRDBRDRamSize::Load ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
//return the default values //return the default values
void CSettingTypeRDBRDRamSize::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const void CSettingTypeRDBRDRamSize::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRDBRDRamSize::LoadDefault ( int /*Index*/, ULONG & Value ) const void CSettingTypeRDBRDRamSize::LoadDefault ( int /*Index*/, uint32_t & Value ) const
{ {
Value = m_DefaultValue; Value = m_DefaultValue;
} }
void CSettingTypeRDBRDRamSize::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const void CSettingTypeRDBRDRamSize::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
//Update the settings //Update the settings
void CSettingTypeRDBRDRamSize::Save ( int /*Index*/, bool /*Value*/ ) void CSettingTypeRDBRDRamSize::Save ( int /*Index*/, bool /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRDBRDRamSize::Save ( int /*Index*/, ULONG Value ) void CSettingTypeRDBRDRamSize::Save ( int /*Index*/, uint32_t Value )
{ {
m_SettingsIniFile->SaveNumber(m_SectionIdent->c_str(),m_KeyName.c_str(),Value == 0x800000 ? 8 : 4); m_SettingsIniFile->SaveNumber(m_SectionIdent->c_str(),m_KeyName.c_str(),Value == 0x800000 ? 8 : 4);
} }
void CSettingTypeRDBRDRamSize::Save ( int /*Index*/, const stdstr & /*Value*/ ) void CSettingTypeRDBRDRamSize::Save ( int /*Index*/, const stdstr & /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRDBRDRamSize::Save ( int /*Index*/, const char * /*Value*/ ) void CSettingTypeRDBRDRamSize::Save ( int /*Index*/, const char * /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRDBRDRamSize::Delete( int /*Index*/ ) void CSettingTypeRDBRDRamSize::Delete( int /*Index*/ )

View File

@ -13,29 +13,32 @@
class CSettingTypeRDBRDRamSize : class CSettingTypeRDBRDRamSize :
public CSettingTypeRomDatabase public CSettingTypeRomDatabase
{ {
public: public:
CSettingTypeRDBRDRamSize(LPCSTR Name, SettingID DefaultSetting ); CSettingTypeRDBRDRamSize(const char * Name, SettingID DefaultSetting );
CSettingTypeRDBRDRamSize(LPCSTR Name, int DefaultValue ); CSettingTypeRDBRDRamSize(const char * Name, int DefaultValue );
~CSettingTypeRDBRDRamSize(); ~CSettingTypeRDBRDRamSize();
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const; virtual void LoadDefault ( int Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int Index );
};
private:
CSettingTypeRDBRDRamSize(void); // Disable default constructor
CSettingTypeRDBRDRamSize(const CSettingTypeRDBRDRamSize&); // Disable copy constructor
CSettingTypeRDBRDRamSize& operator=(const CSettingTypeRDBRDRamSize&); // Disable assignment
};

View File

@ -11,13 +11,14 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsType-RomDatabase.h" #include "SettingsType-RomDatabase.h"
#include "SettingsType-RDBSaveChip.h" #include "SettingsType-RDBSaveChip.h"
#include "../../N64 System/N64 Types.h"
CSettingTypeRDBSaveChip::CSettingTypeRDBSaveChip(LPCSTR Name, SettingID DefaultSetting ) : CSettingTypeRDBSaveChip::CSettingTypeRDBSaveChip(const char * Name, SettingID DefaultSetting ) :
CSettingTypeRomDatabase(Name,DefaultSetting) CSettingTypeRomDatabase(Name,DefaultSetting)
{ {
} }
CSettingTypeRDBSaveChip::CSettingTypeRDBSaveChip(LPCSTR Name, int DefaultValue ) : CSettingTypeRDBSaveChip::CSettingTypeRDBSaveChip(const char * Name, int DefaultValue ) :
CSettingTypeRomDatabase(Name,DefaultValue) CSettingTypeRomDatabase(Name,DefaultValue)
{ {
} }
@ -28,11 +29,11 @@ CSettingTypeRDBSaveChip::CSettingTypeRDBSaveChip(LPCSTR Name, int DefaultValue )
bool CSettingTypeRDBSaveChip::Load ( int /*Index*/, bool & /*Value*/ ) const bool CSettingTypeRDBSaveChip::Load ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
bool CSettingTypeRDBSaveChip::Load ( int Index, ULONG & Value ) const bool CSettingTypeRDBSaveChip::Load ( int Index, uint32_t & Value ) const
{ {
stdstr strValue; stdstr strValue;
bool bRes = m_SettingsIniFile->GetString(m_SectionIdent->c_str(),m_KeyName.c_str(),m_DefaultStr,strValue); bool bRes = m_SettingsIniFile->GetString(m_SectionIdent->c_str(),m_KeyName.c_str(),m_DefaultStr,strValue);
@ -41,9 +42,9 @@ bool CSettingTypeRDBSaveChip::Load ( int Index, ULONG & Value ) const
LoadDefault(Index,Value); LoadDefault(Index,Value);
return false; return false;
} }
LPCSTR String = strValue.c_str(); const char * String = strValue.c_str();
if (_stricmp(String,"First Save Type") == 0) { Value = (ULONG)SaveChip_Auto; } if (_stricmp(String,"First Save Type") == 0) { Value = (uint32_t)SaveChip_Auto; }
else if (_stricmp(String,"4kbit Eeprom") == 0) { Value = SaveChip_Eeprom_4K; } else if (_stricmp(String,"4kbit Eeprom") == 0) { Value = SaveChip_Eeprom_4K; }
else if (_stricmp(String,"16kbit Eeprom") == 0) { Value = SaveChip_Eeprom_16K; } else if (_stricmp(String,"16kbit Eeprom") == 0) { Value = SaveChip_Eeprom_16K; }
else if (_stricmp(String,"Sram") == 0) { Value = SaveChip_Sram; } else if (_stricmp(String,"Sram") == 0) { Value = SaveChip_Sram; }
@ -53,7 +54,7 @@ bool CSettingTypeRDBSaveChip::Load ( int Index, ULONG & Value ) const
LoadDefault(Index,Value); LoadDefault(Index,Value);
return false; return false;
} else { } else {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
return true; return true;
@ -61,17 +62,17 @@ bool CSettingTypeRDBSaveChip::Load ( int Index, ULONG & Value ) const
bool CSettingTypeRDBSaveChip::Load ( int /*Index*/, stdstr & /*Value*/ ) const bool CSettingTypeRDBSaveChip::Load ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
//return the default values //return the default values
void CSettingTypeRDBSaveChip::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const void CSettingTypeRDBSaveChip::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRDBSaveChip::LoadDefault ( int /*Index*/, ULONG & Value ) const void CSettingTypeRDBSaveChip::LoadDefault ( int /*Index*/, uint32_t & Value ) const
{ {
if (m_DefaultSetting != Default_None) if (m_DefaultSetting != Default_None)
{ {
@ -86,16 +87,16 @@ void CSettingTypeRDBSaveChip::LoadDefault ( int /*Index*/, ULONG & Value ) cons
void CSettingTypeRDBSaveChip::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const void CSettingTypeRDBSaveChip::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
//Update the settings //Update the settings
void CSettingTypeRDBSaveChip::Save ( int /*Index*/, bool /*Value*/ ) void CSettingTypeRDBSaveChip::Save ( int /*Index*/, bool /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRDBSaveChip::Save ( int /*Index*/, ULONG Value ) void CSettingTypeRDBSaveChip::Save ( int /*Index*/, uint32_t Value )
{ {
switch (Value) switch (Value)
{ {
@ -105,18 +106,18 @@ void CSettingTypeRDBSaveChip::Save ( int /*Index*/, ULONG Value )
case SaveChip_Sram: m_SettingsIniFile->SaveString(m_SectionIdent->c_str(),m_KeyName.c_str(),"Sram"); break; case SaveChip_Sram: m_SettingsIniFile->SaveString(m_SectionIdent->c_str(),m_KeyName.c_str(),"Sram"); break;
case SaveChip_FlashRam: m_SettingsIniFile->SaveString(m_SectionIdent->c_str(),m_KeyName.c_str(),"FlashRam"); break; case SaveChip_FlashRam: m_SettingsIniFile->SaveString(m_SectionIdent->c_str(),m_KeyName.c_str(),"FlashRam"); break;
default: default:
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
} }
void CSettingTypeRDBSaveChip::Save ( int /*Index*/, const stdstr & /*Value*/ ) void CSettingTypeRDBSaveChip::Save ( int /*Index*/, const stdstr & /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRDBSaveChip::Save ( int /*Index*/, const char * /*Value*/ ) void CSettingTypeRDBSaveChip::Save ( int /*Index*/, const char * /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRDBSaveChip::Delete( int /*Index*/ ) void CSettingTypeRDBSaveChip::Delete( int /*Index*/ )

View File

@ -13,29 +13,32 @@
class CSettingTypeRDBSaveChip : class CSettingTypeRDBSaveChip :
public CSettingTypeRomDatabase public CSettingTypeRomDatabase
{ {
public: public:
CSettingTypeRDBSaveChip(LPCSTR Name, SettingID DefaultSetting ); CSettingTypeRDBSaveChip(const char * Name, SettingID DefaultSetting );
CSettingTypeRDBSaveChip(LPCSTR Name, int DefaultValue ); CSettingTypeRDBSaveChip(const char * Name, int DefaultValue );
~CSettingTypeRDBSaveChip(); ~CSettingTypeRDBSaveChip();
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const; virtual void LoadDefault ( int Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int Index );
};
private:
CSettingTypeRDBSaveChip(void); // Disable default constructor
CSettingTypeRDBSaveChip(const CSettingTypeRDBSaveChip&); // Disable copy constructor
CSettingTypeRDBSaveChip& operator=(const CSettingTypeRDBSaveChip&); // Disable assignment
};

View File

@ -11,7 +11,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsType-RelativePath.h" #include "SettingsType-RelativePath.h"
CSettingTypeRelativePath::CSettingTypeRelativePath(LPCSTR Path, LPCSTR FileName) CSettingTypeRelativePath::CSettingTypeRelativePath(const char * Path, const char * FileName)
{ {
m_FileName = CPath(CPath::MODULE_DIRECTORY,FileName); m_FileName = CPath(CPath::MODULE_DIRECTORY,FileName);
m_FileName.AppendDirectory(Path); m_FileName.AppendDirectory(Path);
@ -23,34 +23,34 @@ CSettingTypeRelativePath::~CSettingTypeRelativePath ( void )
bool CSettingTypeRelativePath::Load ( int /*Index*/, stdstr & value ) const bool CSettingTypeRelativePath::Load ( int /*Index*/, stdstr & value ) const
{ {
value = (LPCSTR)m_FileName; value = (const char *)m_FileName;
return true; return true;
} }
//return the default values //return the default values
void CSettingTypeRelativePath::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const void CSettingTypeRelativePath::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRelativePath::LoadDefault ( int /*Index*/, ULONG & /*Value*/ ) const void CSettingTypeRelativePath::LoadDefault ( int /*Index*/, uint32_t & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRelativePath::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const void CSettingTypeRelativePath::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRelativePath::Save ( int /*Index*/, bool /*Value*/ ) void CSettingTypeRelativePath::Save ( int /*Index*/, bool /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRelativePath::Save ( int /*Index*/, ULONG /*Value*/ ) void CSettingTypeRelativePath::Save ( int /*Index*/, uint32_t /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRelativePath::Save ( int /*Index*/, const stdstr & Value ) void CSettingTypeRelativePath::Save ( int /*Index*/, const stdstr & Value )
@ -65,5 +65,5 @@ void CSettingTypeRelativePath::Save ( int /*Index*/, const char * Value )
void CSettingTypeRelativePath::Delete ( int /*Index*/ ) void CSettingTypeRelativePath::Delete ( int /*Index*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }

View File

@ -9,6 +9,8 @@
* * * *
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include <Common/path.h>
#include "SettingsType-Base.h"
class CSettingTypeRelativePath : class CSettingTypeRelativePath :
public CSettingType public CSettingType
@ -16,7 +18,7 @@ class CSettingTypeRelativePath :
CPath m_FileName; CPath m_FileName;
public: public:
CSettingTypeRelativePath(LPCSTR Path, LPCSTR FileName); CSettingTypeRelativePath(const char * Path, const char * FileName);
~CSettingTypeRelativePath(); ~CSettingTypeRelativePath();
bool IndexBasedSetting ( void ) const { return false; } bool IndexBasedSetting ( void ) const { return false; }
@ -24,21 +26,25 @@ public:
//return the values //return the values
bool Load ( int /*Index*/, bool & /*Value*/ ) const { return false; }; bool Load ( int /*Index*/, bool & /*Value*/ ) const { return false; };
bool Load ( int /*Index*/, ULONG & /*Value*/ ) const { return false; }; bool Load ( int /*Index*/, uint32_t & /*Value*/ ) const { return false; };
bool Load ( int Index, stdstr & Value ) const; bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
void LoadDefault ( int Index, bool & Value ) const; void LoadDefault ( int Index, bool & Value ) const;
void LoadDefault ( int Index, ULONG & Value ) const; void LoadDefault ( int Index, uint32_t & Value ) const;
void LoadDefault ( int Index, stdstr & Value ) const; void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
void Save ( int Index, bool Value ); void Save ( int Index, bool Value );
void Save ( int Index, ULONG Value ); void Save ( int Index, uint32_t Value );
void Save ( int Index, const stdstr & Value ); void Save ( int Index, const stdstr & Value );
void Save ( int Index, const char * Value ); void Save ( int Index, const char * Value );
// Delete the setting // Delete the setting
void Delete ( int Index ); void Delete ( int Index );
};
private:
CSettingTypeRelativePath(void); // Disable default constructor
CSettingTypeRelativePath(const CSettingTypeRelativePath&); // Disable copy constructor
CSettingTypeRelativePath& operator=(const CSettingTypeRelativePath&); // Disable assignment
};

View File

@ -15,7 +15,7 @@ CIniFile * CSettingTypeRomDatabase::m_SettingsIniFile = NULL;
CIniFile * CSettingTypeRomDatabase::m_GlideIniFile = NULL; CIniFile * CSettingTypeRomDatabase::m_GlideIniFile = NULL;
stdstr * CSettingTypeRomDatabase::m_SectionIdent = NULL; stdstr * CSettingTypeRomDatabase::m_SectionIdent = NULL;
CSettingTypeRomDatabase::CSettingTypeRomDatabase(LPCSTR Name, int DefaultValue, bool DeleteOnDefault ) : CSettingTypeRomDatabase::CSettingTypeRomDatabase(const char * Name, int DefaultValue, bool DeleteOnDefault ) :
m_KeyName(StripNameSection(Name)), m_KeyName(StripNameSection(Name)),
m_DefaultStr(""), m_DefaultStr(""),
m_DefaultValue(DefaultValue), m_DefaultValue(DefaultValue),
@ -25,7 +25,7 @@ CSettingTypeRomDatabase::CSettingTypeRomDatabase(LPCSTR Name, int DefaultValue,
{ {
} }
CSettingTypeRomDatabase::CSettingTypeRomDatabase(LPCSTR Name, bool DefaultValue, bool DeleteOnDefault ) : CSettingTypeRomDatabase::CSettingTypeRomDatabase(const char * Name, bool DefaultValue, bool DeleteOnDefault ) :
m_KeyName(StripNameSection(Name)), m_KeyName(StripNameSection(Name)),
m_DefaultStr(""), m_DefaultStr(""),
m_DefaultValue(DefaultValue), m_DefaultValue(DefaultValue),
@ -35,7 +35,7 @@ CSettingTypeRomDatabase::CSettingTypeRomDatabase(LPCSTR Name, bool DefaultValue,
{ {
} }
CSettingTypeRomDatabase::CSettingTypeRomDatabase(LPCSTR Name, LPCSTR DefaultValue, bool DeleteOnDefault ) : CSettingTypeRomDatabase::CSettingTypeRomDatabase(const char * Name, const char * DefaultValue, bool DeleteOnDefault ) :
m_KeyName(StripNameSection(Name)), m_KeyName(StripNameSection(Name)),
m_DefaultStr(DefaultValue), m_DefaultStr(DefaultValue),
m_DefaultValue(0), m_DefaultValue(0),
@ -45,7 +45,7 @@ CSettingTypeRomDatabase::CSettingTypeRomDatabase(LPCSTR Name, LPCSTR DefaultValu
{ {
} }
CSettingTypeRomDatabase::CSettingTypeRomDatabase(LPCSTR Name, SettingID DefaultSetting, bool DeleteOnDefault ) : CSettingTypeRomDatabase::CSettingTypeRomDatabase(const char * Name, SettingID DefaultSetting, bool DeleteOnDefault ) :
m_KeyName(Name), m_KeyName(Name),
m_DefaultStr(""), m_DefaultStr(""),
m_DefaultValue(0), m_DefaultValue(0),
@ -61,12 +61,12 @@ CSettingTypeRomDatabase::~CSettingTypeRomDatabase()
void CSettingTypeRomDatabase::Initialize( void ) void CSettingTypeRomDatabase::Initialize( void )
{ {
m_SettingsIniFile = new CIniFile(g_Settings->LoadString(SupportFile_RomDatabase).c_str()); m_SettingsIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
m_GlideIniFile = new CIniFile(g_Settings->LoadString(SupportFile_Glide64RDB).c_str()); m_GlideIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Glide64RDB).c_str());
g_Settings->RegisterChangeCB(Game_IniKey,NULL,GameChanged); g_Settings->RegisterChangeCB(Game_IniKey,NULL,GameChanged);
m_SectionIdent = new stdstr(g_Settings->LoadString(Game_IniKey)); m_SectionIdent = new stdstr(g_Settings->LoadStringVal(Game_IniKey));
} }
void CSettingTypeRomDatabase::CleanUp( void ) void CSettingTypeRomDatabase::CleanUp( void )
@ -93,19 +93,19 @@ void CSettingTypeRomDatabase::GameChanged ( void * /*Data */ )
{ {
if (m_SectionIdent) if (m_SectionIdent)
{ {
*m_SectionIdent = g_Settings->LoadString(Game_IniKey); *m_SectionIdent = g_Settings->LoadStringVal(Game_IniKey);
} }
} }
bool CSettingTypeRomDatabase::Load ( int Index, bool & Value ) const bool CSettingTypeRomDatabase::Load ( int Index, bool & Value ) const
{ {
DWORD temp_value = Value; uint32_t temp_value = Value;
bool bRes = Load(Index,temp_value); bool bRes = Load(Index,temp_value);
Value = temp_value != 0; Value = temp_value != 0;
return bRes; return bRes;
} }
bool CSettingTypeRomDatabase::Load ( int Index, ULONG & Value ) const bool CSettingTypeRomDatabase::Load ( int Index, uint32_t & Value ) const
{ {
bool bRes = false; bool bRes = false;
if (m_GlideSetting) if (m_GlideSetting)
@ -146,7 +146,6 @@ bool CSettingTypeRomDatabase::Load ( int Index, stdstr & Value ) const
return bRes; return bRes;
} }
//return the default values //return the default values
void CSettingTypeRomDatabase::LoadDefault ( int /*Index*/, bool & Value ) const void CSettingTypeRomDatabase::LoadDefault ( int /*Index*/, bool & Value ) const
{ {
@ -161,7 +160,7 @@ void CSettingTypeRomDatabase::LoadDefault ( int /*Index*/, bool & Value ) const
} }
} }
void CSettingTypeRomDatabase::LoadDefault ( int /*Index*/, ULONG & Value ) const void CSettingTypeRomDatabase::LoadDefault ( int /*Index*/, uint32_t & Value ) const
{ {
if (m_DefaultSetting != Default_None) if (m_DefaultSetting != Default_None)
{ {
@ -182,12 +181,11 @@ void CSettingTypeRomDatabase::LoadDefault ( int /*Index*/, stdstr & Value ) cons
{ {
Value = m_DefaultStr; Value = m_DefaultStr;
} else { } else {
g_Settings->LoadString(m_DefaultSetting,Value); g_Settings->LoadStringVal(m_DefaultSetting,Value);
} }
} }
} }
//Update the settings //Update the settings
void CSettingTypeRomDatabase::Save ( int /*Index*/, bool Value ) void CSettingTypeRomDatabase::Save ( int /*Index*/, bool Value )
{ {
@ -197,7 +195,7 @@ void CSettingTypeRomDatabase::Save ( int /*Index*/, bool Value )
} }
if (m_DeleteOnDefault) if (m_DeleteOnDefault)
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
if (m_GlideSetting) if (m_GlideSetting)
{ {
@ -209,7 +207,7 @@ void CSettingTypeRomDatabase::Save ( int /*Index*/, bool Value )
} }
} }
void CSettingTypeRomDatabase::Save ( int Index, ULONG Value ) void CSettingTypeRomDatabase::Save ( int Index, uint32_t Value )
{ {
if (!g_Settings->LoadBool(Setting_RdbEditor)) if (!g_Settings->LoadBool(Setting_RdbEditor))
{ {
@ -217,7 +215,7 @@ void CSettingTypeRomDatabase::Save ( int Index, ULONG Value )
} }
if (m_DeleteOnDefault) if (m_DeleteOnDefault)
{ {
ULONG defaultValue = 0; uint32_t defaultValue = 0;
LoadDefault(Index,defaultValue); LoadDefault(Index,defaultValue);
if (defaultValue == Value) if (defaultValue == Value)
{ {
@ -283,7 +281,7 @@ void CSettingTypeRomDatabase::Delete ( int /*Index*/ )
} }
} }
bool CSettingTypeRomDatabase::IsGlideSetting (LPCSTR Name) bool CSettingTypeRomDatabase::IsGlideSetting (const char * Name)
{ {
if (_strnicmp(Name,"Glide64-",8) == 0) if (_strnicmp(Name,"Glide64-",8) == 0)
{ {
@ -292,7 +290,7 @@ bool CSettingTypeRomDatabase::IsGlideSetting (LPCSTR Name)
return false; return false;
} }
LPCSTR CSettingTypeRomDatabase::StripNameSection (LPCSTR Name) const char * CSettingTypeRomDatabase::StripNameSection (const char * Name)
{ {
if (_strnicmp(Name,"Glide64-",8) == 0) if (_strnicmp(Name,"Glide64-",8) == 0)
{ {

View File

@ -10,14 +10,17 @@
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include <Common/Ini File Class.h>
#include "SettingsType-Base.h"
class CSettingTypeRomDatabase : class CSettingTypeRomDatabase :
public CSettingType public CSettingType
{ {
public: public:
CSettingTypeRomDatabase(LPCSTR Name, LPCSTR DefaultValue, bool DeleteOnDefault = false ); CSettingTypeRomDatabase(const char * Name, const char * DefaultValue, bool DeleteOnDefault = false );
CSettingTypeRomDatabase(LPCSTR Name, bool DefaultValue, bool DeleteOnDefault = false ); CSettingTypeRomDatabase(const char * Name, bool DefaultValue, bool DeleteOnDefault = false );
CSettingTypeRomDatabase(LPCSTR Name, int DefaultValue, bool DeleteOnDefault = false ); CSettingTypeRomDatabase(const char * Name, int DefaultValue, bool DeleteOnDefault = false );
CSettingTypeRomDatabase(LPCSTR Name, SettingID DefaultSetting, bool DeleteOnDefault = false ); CSettingTypeRomDatabase(const char * Name, SettingID DefaultSetting, bool DeleteOnDefault = false );
virtual ~CSettingTypeRomDatabase(); virtual ~CSettingTypeRomDatabase();
@ -26,17 +29,17 @@ public:
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const; virtual void LoadDefault ( int Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
@ -49,12 +52,12 @@ public:
protected: protected:
static void GameChanged ( void * /*Data */ ); static void GameChanged ( void * /*Data */ );
static bool IsGlideSetting (LPCSTR Name); static bool IsGlideSetting (const char * Name);
static LPCSTR StripNameSection (LPCSTR Name); static const char * StripNameSection (const char * Name);
virtual LPCSTR Section ( void ) const { return m_SectionIdent->c_str(); } virtual const char * Section ( void ) const { return m_SectionIdent->c_str(); }
mutable stdstr m_KeyName; mutable stdstr m_KeyName;
const LPCSTR m_DefaultStr; const char *const m_DefaultStr;
const int m_DefaultValue; const int m_DefaultValue;
const SettingID m_DefaultSetting; const SettingID m_DefaultSetting;
const bool m_DeleteOnDefault; const bool m_DeleteOnDefault;
@ -63,5 +66,9 @@ protected:
static stdstr * m_SectionIdent; static stdstr * m_SectionIdent;
static CIniFile * m_SettingsIniFile; static CIniFile * m_SettingsIniFile;
static CIniFile * m_GlideIniFile; static CIniFile * m_GlideIniFile;
};
private:
CSettingTypeRomDatabase(); // Disable default constructor
CSettingTypeRomDatabase(const CSettingTypeRomDatabase&); // Disable copy constructor
CSettingTypeRomDatabase& operator=(const CSettingTypeRomDatabase&); // Disable assignment
};

View File

@ -12,28 +12,28 @@
#include "SettingsType-RomDatabase.h" #include "SettingsType-RomDatabase.h"
#include "SettingsType-RomDatabaseIndex.h" #include "SettingsType-RomDatabaseIndex.h"
CSettingTypeRomDatabaseIndex::CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, LPCSTR DefaultValue ) : CSettingTypeRomDatabaseIndex::CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, const char * DefaultValue ) :
CSettingTypeRomDatabase("",DefaultValue), CSettingTypeRomDatabase("",DefaultValue),
m_PreIndex(PreIndex), m_PreIndex(PreIndex),
m_PostIndex(PostIndex) m_PostIndex(PostIndex)
{ {
} }
CSettingTypeRomDatabaseIndex::CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, bool DefaultValue ) : CSettingTypeRomDatabaseIndex::CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, bool DefaultValue ) :
CSettingTypeRomDatabase("",DefaultValue), CSettingTypeRomDatabase("",DefaultValue),
m_PreIndex(PreIndex), m_PreIndex(PreIndex),
m_PostIndex(PostIndex) m_PostIndex(PostIndex)
{ {
} }
CSettingTypeRomDatabaseIndex::CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, int DefaultValue ) : CSettingTypeRomDatabaseIndex::CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, int DefaultValue ) :
CSettingTypeRomDatabase("",DefaultValue), CSettingTypeRomDatabase("",DefaultValue),
m_PreIndex(PreIndex), m_PreIndex(PreIndex),
m_PostIndex(PostIndex) m_PostIndex(PostIndex)
{ {
} }
CSettingTypeRomDatabaseIndex::CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, SettingID DefaultSetting ) : CSettingTypeRomDatabaseIndex::CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, SettingID DefaultSetting ) :
CSettingTypeRomDatabase("",DefaultSetting), CSettingTypeRomDatabase("",DefaultSetting),
m_PreIndex(PreIndex), m_PreIndex(PreIndex),
m_PostIndex(PostIndex) m_PostIndex(PostIndex)
@ -46,13 +46,13 @@ CSettingTypeRomDatabaseIndex::~CSettingTypeRomDatabaseIndex()
bool CSettingTypeRomDatabaseIndex::Load ( int /*Index*/, bool & /*Value*/ ) const bool CSettingTypeRomDatabaseIndex::Load ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
bool CSettingTypeRomDatabaseIndex::Load ( int /*Index*/, ULONG & /*Value*/ ) const bool CSettingTypeRomDatabaseIndex::Load ( int /*Index*/, uint32_t & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
@ -68,7 +68,7 @@ void CSettingTypeRomDatabaseIndex::LoadDefault ( int Index, bool & Value ) con
CSettingTypeRomDatabase::LoadDefault(0,Value); CSettingTypeRomDatabase::LoadDefault(0,Value);
} }
void CSettingTypeRomDatabaseIndex::LoadDefault ( int Index, ULONG & Value ) const void CSettingTypeRomDatabaseIndex::LoadDefault ( int Index, uint32_t & Value ) const
{ {
m_KeyName.Format("%s%d%s",m_PreIndex.c_str(),Index,m_PostIndex.c_str()); m_KeyName.Format("%s%d%s",m_PreIndex.c_str(),Index,m_PostIndex.c_str());
CSettingTypeRomDatabase::LoadDefault(0,Value); CSettingTypeRomDatabase::LoadDefault(0,Value);
@ -82,22 +82,22 @@ void CSettingTypeRomDatabaseIndex::LoadDefault ( int Index, stdstr & Value ) con
void CSettingTypeRomDatabaseIndex::Save ( int /*Index*/, bool /*Value*/ ) void CSettingTypeRomDatabaseIndex::Save ( int /*Index*/, bool /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRomDatabaseIndex::Save ( int /*Index*/, ULONG /*Value*/ ) void CSettingTypeRomDatabaseIndex::Save ( int /*Index*/, uint32_t /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRomDatabaseIndex::Save ( int /*Index*/, const stdstr & /*Value*/ ) void CSettingTypeRomDatabaseIndex::Save ( int /*Index*/, const stdstr & /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRomDatabaseIndex::Save ( int /*Index*/, const char * /*Value*/ ) void CSettingTypeRomDatabaseIndex::Save ( int /*Index*/, const char * /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeRomDatabaseIndex::Delete ( int /*Index*/ ) void CSettingTypeRomDatabaseIndex::Delete ( int /*Index*/ )

View File

@ -13,13 +13,11 @@
class CSettingTypeRomDatabaseIndex : class CSettingTypeRomDatabaseIndex :
public CSettingTypeRomDatabase public CSettingTypeRomDatabase
{ {
stdstr m_PreIndex, m_PostIndex;
public: public:
CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, LPCSTR DefaultValue ); CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, const char * DefaultValue );
CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, bool DefaultValue ); CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, bool DefaultValue );
CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, int DefaultValue ); CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, int DefaultValue );
CSettingTypeRomDatabaseIndex(LPCSTR PreIndex, LPCSTR PostIndex, SettingID DefaultSetting ); CSettingTypeRomDatabaseIndex(const char * PreIndex, const char * PostIndex, SettingID DefaultSetting );
virtual ~CSettingTypeRomDatabaseIndex(); virtual ~CSettingTypeRomDatabaseIndex();
@ -27,21 +25,27 @@ public:
//return the values //return the values
virtual bool Load ( int Index, bool & Value ) const; virtual bool Load ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const; virtual void LoadDefault ( int Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int Index );
};
private:
CSettingTypeRomDatabaseIndex(void); // Disable default constructor
CSettingTypeRomDatabaseIndex(const CSettingTypeRomDatabaseIndex&); // Disable copy constructor
CSettingTypeRomDatabaseIndex& operator=(const CSettingTypeRomDatabaseIndex&); // Disable assignment
stdstr m_PreIndex, m_PostIndex;
};

View File

@ -11,8 +11,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsType-SelectedDirectory.h" #include "SettingsType-SelectedDirectory.h"
CSettingTypeSelectedDirectory::CSettingTypeSelectedDirectory(const char * Name, SettingID InitialDir, SettingID SelectedDir, SettingID UseSelected ) :
CSettingTypeSelectedDirectory::CSettingTypeSelectedDirectory(LPCSTR Name, SettingID InitialDir, SettingID SelectedDir, SettingID UseSelected ) :
m_Name(Name), m_Name(Name),
m_InitialDir(InitialDir), m_InitialDir(InitialDir),
m_SelectedDir(SelectedDir), m_SelectedDir(SelectedDir),
@ -20,59 +19,58 @@ CSettingTypeSelectedDirectory::CSettingTypeSelectedDirectory(LPCSTR Name, Settin
{ {
} }
CSettingTypeSelectedDirectory::~CSettingTypeSelectedDirectory() CSettingTypeSelectedDirectory::~CSettingTypeSelectedDirectory()
{ {
} }
bool CSettingTypeSelectedDirectory::Load ( int /*Index*/, bool & /*Value*/ ) const bool CSettingTypeSelectedDirectory::Load ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
bool CSettingTypeSelectedDirectory::Load ( int /*Index*/, ULONG & /*Value*/ ) const bool CSettingTypeSelectedDirectory::Load ( int /*Index*/, uint32_t & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
bool CSettingTypeSelectedDirectory::Load ( int /*Index*/, stdstr & Value ) const bool CSettingTypeSelectedDirectory::Load ( int /*Index*/, stdstr & Value ) const
{ {
SettingID DirSettingId = g_Settings->LoadBool(m_UseSelected) ? m_SelectedDir : m_InitialDir; SettingID DirSettingId = g_Settings->LoadBool(m_UseSelected) ? m_SelectedDir : m_InitialDir;
return g_Settings->LoadString(DirSettingId, Value); return g_Settings->LoadStringVal(DirSettingId, Value);
} }
//return the default values //return the default values
void CSettingTypeSelectedDirectory::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const void CSettingTypeSelectedDirectory::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeSelectedDirectory::LoadDefault ( int /*Index*/, ULONG & /*Value*/ ) const void CSettingTypeSelectedDirectory::LoadDefault ( int /*Index*/, uint32_t & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeSelectedDirectory::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const void CSettingTypeSelectedDirectory::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
//Update the settings //Update the settings
void CSettingTypeSelectedDirectory::Save ( int /*Index*/, bool /*Value*/ ) void CSettingTypeSelectedDirectory::Save ( int /*Index*/, bool /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeSelectedDirectory::Save ( int /*Index*/, ULONG /*Value*/ ) void CSettingTypeSelectedDirectory::Save ( int /*Index*/, uint32_t /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeSelectedDirectory::Save ( int /*Index*/, const stdstr & /*Value*/ ) void CSettingTypeSelectedDirectory::Save ( int /*Index*/, const stdstr & /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeSelectedDirectory::Save ( int /*Index*/, const char * Value ) void CSettingTypeSelectedDirectory::Save ( int /*Index*/, const char * Value )
@ -83,5 +81,5 @@ void CSettingTypeSelectedDirectory::Save ( int /*Index*/, const char * Value )
void CSettingTypeSelectedDirectory::Delete( int /*Index*/ ) void CSettingTypeSelectedDirectory::Delete( int /*Index*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }

View File

@ -10,40 +10,46 @@
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include "SettingsType-Base.h"
class CSettingTypeSelectedDirectory : class CSettingTypeSelectedDirectory :
public CSettingType public CSettingType
{ {
std::string m_Name;
SettingID m_InitialDir;
SettingID m_SelectedDir;
SettingID m_UseSelected;
public: public:
CSettingTypeSelectedDirectory(LPCSTR Name, SettingID InitialDir, SettingID SelectedDir, SettingID UseSelected ); CSettingTypeSelectedDirectory(const char * Name, SettingID InitialDir, SettingID SelectedDir, SettingID UseSelected );
~CSettingTypeSelectedDirectory(); ~CSettingTypeSelectedDirectory();
virtual bool IndexBasedSetting ( void ) const { return false; } virtual bool IndexBasedSetting ( void ) const { return false; }
virtual SettingType GetSettingType ( void ) const { return SettingType_SelectedDirectory; } virtual SettingType GetSettingType ( void ) const { return SettingType_SelectedDirectory; }
LPCSTR 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 ( int Index, bool & Value ) const;
virtual bool Load ( int Index, ULONG & Value ) const; virtual bool Load ( int Index, uint32_t & Value ) const;
virtual bool Load ( int Index, stdstr & Value ) const; virtual bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
virtual void LoadDefault ( int Index, bool & Value ) const; virtual void LoadDefault ( int Index, bool & Value ) const;
virtual void LoadDefault ( int Index, ULONG & Value ) const; virtual void LoadDefault ( int Index, uint32_t & Value ) const;
virtual void LoadDefault ( int Index, stdstr & Value ) const; virtual void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
virtual void Save ( int Index, bool Value ); virtual void Save ( int Index, bool Value );
virtual void Save ( int Index, ULONG Value ); virtual void Save ( int Index, uint32_t Value );
virtual void Save ( int Index, const stdstr & Value ); virtual void Save ( int Index, const stdstr & Value );
virtual void Save ( int Index, const char * Value ); virtual void Save ( int Index, const char * Value );
// Delete the setting // Delete the setting
virtual void Delete ( int Index ); virtual void Delete ( int Index );
};
private:
CSettingTypeSelectedDirectory(void); // Disable default constructor
CSettingTypeSelectedDirectory(const CSettingTypeSelectedDirectory&); // Disable copy constructor
CSettingTypeSelectedDirectory& operator=(const CSettingTypeSelectedDirectory&); // Disable assignment
std::string m_Name;
SettingID m_InitialDir;
SettingID m_SelectedDir;
SettingID m_UseSelected;
};

View File

@ -26,32 +26,32 @@ bool CSettingTypeTempBool::Load ( int /*Index*/, bool & Value ) const
return true; return true;
} }
bool CSettingTypeTempBool::Load ( int /*Index*/, ULONG & /*Value*/ ) const bool CSettingTypeTempBool::Load ( int /*Index*/, uint32_t & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
bool CSettingTypeTempBool::Load ( int /*Index*/, stdstr & /*Value*/ ) const bool CSettingTypeTempBool::Load ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
//return the default values //return the default values
void CSettingTypeTempBool::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const void CSettingTypeTempBool::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempBool::LoadDefault ( int /*Index*/, ULONG & /*Value*/ ) const void CSettingTypeTempBool::LoadDefault ( int /*Index*/, uint32_t & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempBool::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const void CSettingTypeTempBool::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempBool::Save ( int /*Index*/, bool Value ) void CSettingTypeTempBool::Save ( int /*Index*/, bool Value )
@ -59,22 +59,22 @@ void CSettingTypeTempBool::Save ( int /*Index*/, bool Value )
m_value = Value; m_value = Value;
} }
void CSettingTypeTempBool::Save ( int /*Index*/, ULONG /*Value*/ ) void CSettingTypeTempBool::Save ( int /*Index*/, uint32_t /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempBool::Save ( int /*Index*/, const stdstr & /*Value*/ ) void CSettingTypeTempBool::Save ( int /*Index*/, const stdstr & /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempBool::Save ( int /*Index*/, const char * /*Value*/ ) void CSettingTypeTempBool::Save ( int /*Index*/, const char * /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempBool::Delete( int /*Index*/ ) void CSettingTypeTempBool::Delete( int /*Index*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }

View File

@ -10,11 +10,11 @@
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include "SettingsType-Base.h"
class CSettingTypeTempBool : class CSettingTypeTempBool :
public CSettingType public CSettingType
{ {
bool m_value;
public: public:
CSettingTypeTempBool(bool initialValue ); CSettingTypeTempBool(bool initialValue );
~CSettingTypeTempBool(); ~CSettingTypeTempBool();
@ -24,21 +24,27 @@ public:
//return the values //return the values
bool Load ( int Index, bool & Value ) const; bool Load ( int Index, bool & Value ) const;
bool Load ( int Index, ULONG & Value ) const; bool Load ( int Index, uint32_t & Value ) const;
bool Load ( int Index, stdstr & Value ) const; bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
void LoadDefault ( int Index, bool & Value ) const; void LoadDefault ( int Index, bool & Value ) const;
void LoadDefault ( int Index, ULONG & Value ) const; void LoadDefault ( int Index, uint32_t & Value ) const;
void LoadDefault ( int Index, stdstr & Value ) const; void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
void Save ( int Index, bool Value ); void Save ( int Index, bool Value );
void Save ( int Index, ULONG Value ); void Save ( int Index, uint32_t Value );
void Save ( int Index, const stdstr & Value ); void Save ( int Index, const stdstr & Value );
void Save ( int Index, const char * Value ); void Save ( int Index, const char * Value );
// Delete the setting // Delete the setting
void Delete ( int Index ); void Delete ( int Index );
};
private:
CSettingTypeTempBool(void); // Disable default constructor
CSettingTypeTempBool(const CSettingTypeTempBool&); // Disable copy constructor
CSettingTypeTempBool& operator=(const CSettingTypeTempBool&); // Disable assignment
bool m_value;
};

View File

@ -11,7 +11,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsType-TempNumber.h" #include "SettingsType-TempNumber.h"
CSettingTypeTempNumber::CSettingTypeTempNumber(ULONG initialValue) : CSettingTypeTempNumber::CSettingTypeTempNumber(uint32_t initialValue) :
m_value(initialValue) m_value(initialValue)
{ {
} }
@ -22,11 +22,11 @@ CSettingTypeTempNumber::~CSettingTypeTempNumber ( void )
bool CSettingTypeTempNumber::Load ( int /*Index*/, bool & /*Value*/ ) const bool CSettingTypeTempNumber::Load ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return true; return true;
} }
bool CSettingTypeTempNumber::Load ( int /*Index*/, ULONG & Value ) const bool CSettingTypeTempNumber::Load ( int /*Index*/, uint32_t & Value ) const
{ {
Value = m_value; Value = m_value;
return false; return false;
@ -34,47 +34,47 @@ bool CSettingTypeTempNumber::Load ( int /*Index*/, ULONG & Value ) const
bool CSettingTypeTempNumber::Load ( int /*Index*/, stdstr & /*Value*/ ) const bool CSettingTypeTempNumber::Load ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
//return the default values //return the default values
void CSettingTypeTempNumber::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const void CSettingTypeTempNumber::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempNumber::LoadDefault ( int /*Index*/, ULONG & /*Value*/ ) const void CSettingTypeTempNumber::LoadDefault ( int /*Index*/, uint32_t & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempNumber::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const void CSettingTypeTempNumber::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempNumber::Save ( int /*Index*/, bool /*Value*/ ) void CSettingTypeTempNumber::Save ( int /*Index*/, bool /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempNumber::Save ( int /*Index*/, ULONG Value ) void CSettingTypeTempNumber::Save ( int /*Index*/, uint32_t Value )
{ {
m_value = Value; m_value = Value;
} }
void CSettingTypeTempNumber::Save ( int /*Index*/, const stdstr & /*Value*/ ) void CSettingTypeTempNumber::Save ( int /*Index*/, const stdstr & /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempNumber::Save ( int /*Index*/, const char * /*Value*/ ) void CSettingTypeTempNumber::Save ( int /*Index*/, const char * /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempNumber::Delete( int /*Index*/ ) void CSettingTypeTempNumber::Delete( int /*Index*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }

View File

@ -10,14 +10,13 @@
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include "SettingsType-Base.h"
class CSettingTypeTempNumber : class CSettingTypeTempNumber :
public CSettingType public CSettingType
{ {
ULONG m_value;
public: public:
CSettingTypeTempNumber(ULONG initialValue); CSettingTypeTempNumber(uint32_t initialValue);
~CSettingTypeTempNumber(); ~CSettingTypeTempNumber();
bool IndexBasedSetting ( void ) const { return false; } bool IndexBasedSetting ( void ) const { return false; }
@ -25,21 +24,27 @@ public:
//return the values //return the values
bool Load ( int Index, bool & Value ) const; bool Load ( int Index, bool & Value ) const;
bool Load ( int Index, ULONG & Value ) const; bool Load ( int Index, uint32_t & Value ) const;
bool Load ( int Index, stdstr & Value ) const; bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
void LoadDefault ( int Index, bool & Value ) const; void LoadDefault ( int Index, bool & Value ) const;
void LoadDefault ( int Index, ULONG & Value ) const; void LoadDefault ( int Index, uint32_t & Value ) const;
void LoadDefault ( int Index, stdstr & Value ) const; void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
void Save ( int Index, bool Value ); void Save ( int Index, bool Value );
void Save ( int Index, ULONG Value ); void Save ( int Index, uint32_t Value );
void Save ( int Index, const stdstr & Value ); void Save ( int Index, const stdstr & Value );
void Save ( int Index, const char * Value ); void Save ( int Index, const char * Value );
// Delete the setting // Delete the setting
void Delete ( int Index ); void Delete ( int Index );
};
private:
CSettingTypeTempNumber(void); // Disable default constructor
CSettingTypeTempNumber(const CSettingTypeTempNumber&); // Disable copy constructor
CSettingTypeTempNumber& operator=(const CSettingTypeTempNumber&); // Disable assignment
uint32_t m_value;
};

View File

@ -11,7 +11,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "SettingsType-TempString.h" #include "SettingsType-TempString.h"
CSettingTypeTempString::CSettingTypeTempString(LPCSTR initialValue) : CSettingTypeTempString::CSettingTypeTempString(const char * initialValue) :
m_value(initialValue) m_value(initialValue)
{ {
} }
@ -20,16 +20,15 @@ CSettingTypeTempString::~CSettingTypeTempString ( void )
{ {
} }
bool CSettingTypeTempString::Load ( int /*Index*/, bool & /*Value*/ ) const bool CSettingTypeTempString::Load ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
bool CSettingTypeTempString::Load ( int /*Index*/, ULONG & /*Value*/ ) const bool CSettingTypeTempString::Load ( int /*Index*/, uint32_t & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
@ -42,27 +41,27 @@ bool CSettingTypeTempString::Load ( int /*Index*/, stdstr & Value ) const
//return the default values //return the default values
void CSettingTypeTempString::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const void CSettingTypeTempString::LoadDefault ( int /*Index*/, bool & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempString::LoadDefault ( int /*Index*/, ULONG & /*Value*/ ) const void CSettingTypeTempString::LoadDefault ( int /*Index*/, uint32_t & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempString::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const void CSettingTypeTempString::LoadDefault ( int /*Index*/, stdstr & /*Value*/ ) const
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempString::Save ( int /*Index*/, bool /*Value*/ ) void CSettingTypeTempString::Save ( int /*Index*/, bool /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempString::Save ( int /*Index*/, ULONG /*Value*/ ) void CSettingTypeTempString::Save ( int /*Index*/, uint32_t /*Value*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
void CSettingTypeTempString::Save ( int /*Index*/, const stdstr & Value ) void CSettingTypeTempString::Save ( int /*Index*/, const stdstr & Value )
@ -77,5 +76,5 @@ void CSettingTypeTempString::Save ( int /*Index*/, const char * Value )
void CSettingTypeTempString::Delete( int /*Index*/ ) void CSettingTypeTempString::Delete( int /*Index*/ )
{ {
Notify().BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }

View File

@ -10,14 +10,13 @@
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
#include "SettingsType-Base.h"
class CSettingTypeTempString : class CSettingTypeTempString :
public CSettingType public CSettingType
{ {
stdstr m_value;
public: public:
CSettingTypeTempString(LPCSTR initialValue); CSettingTypeTempString(const char * initialValue);
~CSettingTypeTempString(); ~CSettingTypeTempString();
bool IndexBasedSetting ( void ) const { return false; } bool IndexBasedSetting ( void ) const { return false; }
@ -25,21 +24,27 @@ public:
//return the values //return the values
bool Load ( int Index, bool & Value ) const; bool Load ( int Index, bool & Value ) const;
bool Load ( int Index, ULONG & Value ) const; bool Load ( int Index, uint32_t & Value ) const;
bool Load ( int Index, stdstr & Value ) const; bool Load ( int Index, stdstr & Value ) const;
//return the default values //return the default values
void LoadDefault ( int Index, bool & Value ) const; void LoadDefault ( int Index, bool & Value ) const;
void LoadDefault ( int Index, ULONG & Value ) const; void LoadDefault ( int Index, uint32_t & Value ) const;
void LoadDefault ( int Index, stdstr & Value ) const; void LoadDefault ( int Index, stdstr & Value ) const;
//Update the settings //Update the settings
void Save ( int Index, bool Value ); void Save ( int Index, bool Value );
void Save ( int Index, ULONG Value ); void Save ( int Index, uint32_t Value );
void Save ( int Index, const stdstr & Value ); void Save ( int Index, const stdstr & Value );
void Save ( int Index, const char * Value ); void Save ( int Index, const char * Value );
// Delete the setting // Delete the setting
void Delete ( int Index ); void Delete ( int Index );
};
private:
CSettingTypeTempString(void); // Disable default constructor
CSettingTypeTempString(const CSettingTypeTempString&); // Disable copy constructor
CSettingTypeTempString& operator=(const CSettingTypeTempString&); // Disable assignment
stdstr m_value;
};

View File

@ -29,6 +29,8 @@
#include "SettingType/SettingsType-TempString.h" #include "SettingType/SettingsType-TempString.h"
#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 <Common/TraceDefs.h>
CSettings * g_Settings = NULL; CSettings * g_Settings = NULL;
@ -51,7 +53,6 @@ CSettings::~CSettings()
for (SETTING_CALLBACK::iterator cb_iter = m_Callback.begin(); cb_iter != m_Callback.end(); cb_iter++) for (SETTING_CALLBACK::iterator cb_iter = m_Callback.begin(); cb_iter != m_Callback.end(); cb_iter++)
{ {
SETTING_CHANGED_CB * item = cb_iter->second; SETTING_CHANGED_CB * item = cb_iter->second;
while (item != NULL) while (item != NULL)
{ {
@ -82,7 +83,6 @@ void CSettings::AddHowToHandleSetting ()
//information - temp keys //information - temp keys
AddHandler(Info_ShortCutsChanged, new CSettingTypeTempBool(false)); AddHandler(Info_ShortCutsChanged, new CSettingTypeTempBool(false));
//Support Files //Support Files
AddHandler(SupportFile_Settings, new CSettingTypeApplicationPath("","ConfigFile",SupportFile_SettingsDefault)); AddHandler(SupportFile_Settings, new CSettingTypeApplicationPath("","ConfigFile",SupportFile_SettingsDefault));
AddHandler(SupportFile_SettingsDefault, new CSettingTypeRelativePath("Config","Project64.cfg")); AddHandler(SupportFile_SettingsDefault, new CSettingTypeRelativePath("Config","Project64.cfg"));
@ -107,18 +107,18 @@ void CSettings::AddHowToHandleSetting ()
//Settings location //Settings location
AddHandler(Setting_ApplicationName, new CSettingTypeTempString("")); AddHandler(Setting_ApplicationName, new CSettingTypeTempString(""));
AddHandler(Setting_UseFromRegistry, new CSettingTypeApplication("Settings","Use Registry",(DWORD)false)); AddHandler(Setting_UseFromRegistry, new CSettingTypeApplication("Settings","Use Registry",(uint32_t)false));
AddHandler(Setting_RdbEditor, new CSettingTypeApplication("","Rdb Editor", false)); AddHandler(Setting_RdbEditor, new CSettingTypeApplication("","Rdb Editor", false));
AddHandler(Setting_PluginPageFirst, new CSettingTypeApplication("","Plugin Page First", false)); AddHandler(Setting_PluginPageFirst, new CSettingTypeApplication("","Plugin Page First", false));
AddHandler(Setting_DisableScrSaver, new CSettingTypeApplication("","Disable Screen Saver",(DWORD)true)); AddHandler(Setting_DisableScrSaver, new CSettingTypeApplication("","Disable Screen Saver",(uint32_t)true));
AddHandler(Setting_AutoSleep, new CSettingTypeApplication("","Auto Sleep", (DWORD)true)); AddHandler(Setting_AutoSleep, new CSettingTypeApplication("","Auto Sleep", (uint32_t)true));
AddHandler(Setting_AutoStart, new CSettingTypeApplication("","Auto Start", (DWORD)true)); AddHandler(Setting_AutoStart, new CSettingTypeApplication("","Auto Start", (uint32_t)true));
AddHandler(Setting_AutoFullscreen, new CSettingTypeApplication("","Auto Full Screen", (DWORD)false)); AddHandler(Setting_AutoFullscreen, new CSettingTypeApplication("","Auto Full Screen", (uint32_t)false));
AddHandler(Setting_AutoZipInstantSave,new CSettingTypeApplication("","Auto Zip Saves", (DWORD)true)); AddHandler(Setting_AutoZipInstantSave,new CSettingTypeApplication("","Auto Zip Saves", (uint32_t)true));
AddHandler(Setting_EraseGameDefaults, new CSettingTypeApplication("","Erase on default", (DWORD)true)); AddHandler(Setting_EraseGameDefaults, new CSettingTypeApplication("","Erase on default", (uint32_t)true));
AddHandler(Setting_CheckEmuRunning, new CSettingTypeApplication("","Check Running", (DWORD)true)); AddHandler(Setting_CheckEmuRunning, new CSettingTypeApplication("","Check Running", (uint32_t)true));
AddHandler(Setting_RememberCheats, new CSettingTypeApplication("","Remember Cheats", (DWORD)false)); AddHandler(Setting_RememberCheats, new CSettingTypeApplication("","Remember Cheats", (uint32_t)false));
AddHandler(Setting_CurrentLanguage, new CSettingTypeApplication("","Current Language","")); AddHandler(Setting_CurrentLanguage, new CSettingTypeApplication("","Current Language",""));
AddHandler(Setting_LanguageDirDefault, new CSettingTypeRelativePath("Lang","")); AddHandler(Setting_LanguageDirDefault, new CSettingTypeRelativePath("Lang",""));
AddHandler(Setting_LanguageDir, new CSettingTypeApplicationPath("Directory","Lang",Setting_LanguageDirDefault)); AddHandler(Setting_LanguageDir, new CSettingTypeApplicationPath("Directory","Lang",Setting_LanguageDirDefault));
@ -186,7 +186,7 @@ void CSettings::AddHowToHandleSetting ()
AddHandler(Game_Plugin_RSP, new CSettingTypeGame("Plugin-RSP",Plugin_RSP_Current)); AddHandler(Game_Plugin_RSP, new CSettingTypeGame("Plugin-RSP",Plugin_RSP_Current));
AddHandler(Game_SaveChip, new CSettingTypeGame("SaveChip",Rdb_SaveChip)); AddHandler(Game_SaveChip, new CSettingTypeGame("SaveChip",Rdb_SaveChip));
AddHandler(Game_CpuType, new CSettingTypeGame("CpuType",Rdb_CpuType)); AddHandler(Game_CpuType, new CSettingTypeGame("CpuType",Rdb_CpuType));
AddHandler(Game_LastSaveSlot, new CSettingTypeGame("Last Used Save Slot",(DWORD)0)); AddHandler(Game_LastSaveSlot, new CSettingTypeGame("Last Used Save Slot",(uint32_t)0));
AddHandler(Game_FixedAudio, new CSettingTypeGame("Fixed Audio",Rdb_FixedAudio)); AddHandler(Game_FixedAudio, new CSettingTypeGame("Fixed Audio",Rdb_FixedAudio));
AddHandler(Game_RDRamSize, new CSettingTypeGame("RDRamSize",Rdb_RDRamSize)); AddHandler(Game_RDRamSize, new CSettingTypeGame("RDRamSize",Rdb_RDRamSize));
AddHandler(Game_CounterFactor, new CSettingTypeGame("Counter Factor",Rdb_CounterFactor)); AddHandler(Game_CounterFactor, new CSettingTypeGame("Counter Factor",Rdb_CounterFactor));
@ -218,21 +218,21 @@ void CSettings::AddHowToHandleSetting ()
AddHandler(Game_CRC_Recalc, new CSettingTypeGame("CRC-Recalc", Rdb_CRC_Recalc)); AddHandler(Game_CRC_Recalc, new CSettingTypeGame("CRC-Recalc", Rdb_CRC_Recalc));
//User Interface //User Interface
AddHandler(UserInterface_BasicMode, new CSettingTypeApplication("","Basic Mode", (DWORD)true)); AddHandler(UserInterface_BasicMode, new CSettingTypeApplication("","Basic Mode", (uint32_t)true));
AddHandler(UserInterface_ShowCPUPer, new CSettingTypeApplication("","Display CPU Usage", (DWORD)false)); AddHandler(UserInterface_ShowCPUPer, new CSettingTypeApplication("","Display CPU Usage", (uint32_t)false));
AddHandler(UserInterface_DisplayFrameRate, new CSettingTypeApplication("","Display Frame Rate", (DWORD)true)); AddHandler(UserInterface_DisplayFrameRate, new CSettingTypeApplication("","Display Frame Rate", (uint32_t)true));
AddHandler(UserInterface_InFullScreen, new CSettingTypeTempBool(false)); AddHandler(UserInterface_InFullScreen, new CSettingTypeTempBool(false));
AddHandler(UserInterface_FrameDisplayType, new CSettingTypeApplication("","Frame Rate Display Type", (DWORD)FR_VIs)); AddHandler(UserInterface_FrameDisplayType, new CSettingTypeApplication("","Frame Rate Display Type", (uint32_t)FR_VIs));
AddHandler(UserInterface_MainWindowTop, new CSettingTypeApplication("Main Window","Top" ,Default_None)); AddHandler(UserInterface_MainWindowTop, new CSettingTypeApplication("Main Window","Top" ,Default_None));
AddHandler(UserInterface_MainWindowLeft, new CSettingTypeApplication("Main Window","Left" ,Default_None)); AddHandler(UserInterface_MainWindowLeft, new CSettingTypeApplication("Main Window","Left" ,Default_None));
AddHandler(UserInterface_AlwaysOnTop, new CSettingTypeApplication("","Always on top", (DWORD)false)); AddHandler(UserInterface_AlwaysOnTop, new CSettingTypeApplication("","Always on top", (uint32_t)false));
AddHandler(RomBrowser_Enabled, new CSettingTypeApplication("Rom Browser","Rom Browser",true)); AddHandler(RomBrowser_Enabled, new CSettingTypeApplication("Rom Browser","Rom Browser",true));
AddHandler(RomBrowser_ColoumnsChanged, new CSettingTypeTempBool(false)); AddHandler(RomBrowser_ColoumnsChanged, new CSettingTypeTempBool(false));
AddHandler(RomBrowser_Top, new CSettingTypeApplication("Rom Browser","Top" ,Default_None)); AddHandler(RomBrowser_Top, new CSettingTypeApplication("Rom Browser","Top" ,Default_None));
AddHandler(RomBrowser_Left, new CSettingTypeApplication("Rom Browser","Left" ,Default_None)); AddHandler(RomBrowser_Left, new CSettingTypeApplication("Rom Browser","Left" ,Default_None));
AddHandler(RomBrowser_Width, new CSettingTypeApplication("Rom Browser","Width", (DWORD)640)); AddHandler(RomBrowser_Width, new CSettingTypeApplication("Rom Browser","Width", (uint32_t)640));
AddHandler(RomBrowser_Height, new CSettingTypeApplication("Rom Browser","Height", (DWORD)480)); AddHandler(RomBrowser_Height, new CSettingTypeApplication("Rom Browser","Height", (uint32_t)480));
AddHandler(RomBrowser_PosIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Pos","Field",Default_None)); AddHandler(RomBrowser_PosIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Pos","Field",Default_None));
AddHandler(RomBrowser_WidthIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Width","Field",Default_None)); AddHandler(RomBrowser_WidthIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Width","Field",Default_None));
AddHandler(RomBrowser_SortFieldIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Field", Default_None)); AddHandler(RomBrowser_SortFieldIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Field", Default_None));
@ -240,7 +240,7 @@ void CSettings::AddHowToHandleSetting ()
AddHandler(RomBrowser_Recursive, new CSettingTypeApplication("Rom Browser","Recursive", false)); AddHandler(RomBrowser_Recursive, new CSettingTypeApplication("Rom Browser","Recursive", false));
AddHandler(RomBrowser_Maximized, new CSettingTypeApplication("Rom Browser","Maximized", false)); AddHandler(RomBrowser_Maximized, new CSettingTypeApplication("Rom Browser","Maximized", false));
AddHandler(Directory_RecentGameDirCount, new CSettingTypeApplication("","Remembered Rom Dirs",(DWORD)10)); AddHandler(Directory_RecentGameDirCount, new CSettingTypeApplication("","Remembered Rom Dirs",(uint32_t)10));
AddHandler(Directory_RecentGameDirIndex, new CSettingTypeApplicationIndex("Recent Dir","Recent Dir",Default_None)); AddHandler(Directory_RecentGameDirIndex, new CSettingTypeApplicationIndex("Recent Dir","Recent Dir",Default_None));
//Directory_Game, //Directory_Game,
@ -292,7 +292,7 @@ void CSettings::AddHowToHandleSetting ()
AddHandler(GameRunning_LimitFPS, new CSettingTypeTempBool(true)); AddHandler(GameRunning_LimitFPS, new CSettingTypeTempBool(true));
AddHandler(GameRunning_ScreenHertz, new CSettingTypeTempNumber(60)); AddHandler(GameRunning_ScreenHertz, new CSettingTypeTempNumber(60));
AddHandler(File_RecentGameFileCount, new CSettingTypeApplication("","Remembered Rom Files",(DWORD)10)); AddHandler(File_RecentGameFileCount, new CSettingTypeApplication("","Remembered Rom Files",(uint32_t)10));
AddHandler(File_RecentGameFileIndex, new CSettingTypeApplicationIndex("Recent File","Recent Rom",Default_None)); AddHandler(File_RecentGameFileIndex, new CSettingTypeApplicationIndex("Recent File","Recent Rom",Default_None));
AddHandler(Debugger_Enabled, new CSettingTypeApplication("Debugger","Debugger",false)); AddHandler(Debugger_Enabled, new CSettingTypeApplication("Debugger","Debugger",false));
@ -304,9 +304,9 @@ void CSettings::AddHowToHandleSetting ()
AddHandler(Debugger_ShowRecompMemSize, new CSettingTypeApplication("Debugger","Show Recompiler Memory size",false)); AddHandler(Debugger_ShowRecompMemSize, new CSettingTypeApplication("Debugger","Show Recompiler Memory size",false));
AddHandler(Debugger_ShowDivByZero, new CSettingTypeApplication("Debugger","Show Div by zero",false)); AddHandler(Debugger_ShowDivByZero, new CSettingTypeApplication("Debugger","Show Div by zero",false));
AddHandler(Debugger_GenerateDebugLog, new CSettingTypeApplication("Debugger","Generate Debug Code",false)); AddHandler(Debugger_GenerateDebugLog, new CSettingTypeApplication("Debugger","Generate Debug Code",false));
AddHandler(Debugger_ProfileCode, new CSettingTypeApplication("Debugger","Profile Code", (DWORD)false)); AddHandler(Debugger_ProfileCode, new CSettingTypeApplication("Debugger","Profile Code",(uint32_t)false));
AddHandler(Debugger_AppLogLevel, new CSettingTypeApplication("Logging","Log Level",(DWORD)TraceError)); AddHandler(Debugger_AppLogLevel, new CSettingTypeApplication("Logging","Log Level",(uint32_t)TraceError));
AddHandler(Debugger_AppLogFlush, new CSettingTypeApplication("Logging","Log Auto Flush",(DWORD)false)); AddHandler(Debugger_AppLogFlush, new CSettingTypeApplication("Logging","Log Auto Flush",(uint32_t)false));
AddHandler(Debugger_GenerateLogFiles, new CSettingTypeApplication("Debugger","Generate Log Files", false)); AddHandler(Debugger_GenerateLogFiles, new CSettingTypeApplication("Debugger","Generate Log Files", false));
//Plugin //Plugin
@ -325,7 +325,7 @@ void CSettings::AddHowToHandleSetting ()
// cheats // cheats
AddHandler(Cheat_Entry, new CSettingTypeCheats("")); AddHandler(Cheat_Entry, new CSettingTypeCheats(""));
AddHandler(Cheat_Active, new CSettingTypeGameIndex("Cheat","",(DWORD)false)); AddHandler(Cheat_Active, new CSettingTypeGameIndex("Cheat","",(uint32_t)false));
AddHandler(Cheat_Extension, new CSettingTypeGameIndex("Cheat",".exten","??? - Not Set")); AddHandler(Cheat_Extension, new CSettingTypeGameIndex("Cheat",".exten","??? - Not Set"));
AddHandler(Cheat_Notes, new CSettingTypeCheats("_N")); AddHandler(Cheat_Notes, new CSettingTypeCheats("_N"));
AddHandler(Cheat_Options, new CSettingTypeCheats("_O")); AddHandler(Cheat_Options, new CSettingTypeCheats("_O"));
@ -333,7 +333,7 @@ void CSettings::AddHowToHandleSetting ()
AddHandler(Cheat_RangeNotes, new CSettingTypeCheats("_RN")); AddHandler(Cheat_RangeNotes, new CSettingTypeCheats("_RN"));
} }
DWORD CSettings::FindSetting ( CSettings * _this, char * Name ) uint32_t CSettings::FindSetting ( CSettings * _this, const char * Name )
{ {
for (SETTING_MAP::iterator iter = _this->m_SettingInfo.begin(); iter != _this->m_SettingInfo.end(); iter++) for (SETTING_MAP::iterator iter = _this->m_SettingInfo.begin(); iter != _this->m_SettingInfo.end(); iter++)
{ {
@ -375,7 +375,7 @@ void CSettings::FlushSettings ( CSettings * /*_this*/ )
CSettingTypeApplication::Flush(); CSettingTypeApplication::Flush();
} }
DWORD CSettings::GetSetting ( CSettings * _this, SettingID Type ) uint32_t CSettings::GetSetting ( CSettings * _this, SettingID Type )
{ {
return _this->LoadDword(Type); return _this->LoadDword(Type);
} }
@ -385,7 +385,7 @@ const char * CSettings::GetSettingSz ( CSettings * _this, SettingID Type, char *
if (Buffer && BufferSize > 0) if (Buffer && BufferSize > 0)
{ {
Buffer[0] = 0; Buffer[0] = 0;
_this->LoadString(Type, Buffer,BufferSize); _this->LoadStringVal(Type, Buffer,BufferSize);
} }
return Buffer; return Buffer;
} }
@ -402,7 +402,7 @@ void CSettings::SetSettingSz ( CSettings * _this, SettingID ID, const char * Val
void CSettings::RegisterSetting ( CSettings * _this, SettingID ID, SettingID DefaultID, SettingDataType DataType, void CSettings::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,
DWORD Value ) uint32_t Value )
{ {
switch (Type) switch (Type)
{ {
@ -583,14 +583,14 @@ bool CSettings::LoadBoolIndex( SettingID Type, int index , bool & Value )
return false; return false;
} }
DWORD CSettings::LoadDword ( SettingID Type ) uint32_t CSettings::LoadDword ( SettingID Type )
{ {
DWORD Value = 0; uint32_t Value = 0;
LoadDword(Type,Value); LoadDword(Type,Value);
return Value; return Value;
} }
bool CSettings::LoadDword ( SettingID Type, DWORD & Value) bool CSettings::LoadDword ( SettingID Type, uint32_t & Value)
{ {
SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); SETTING_HANDLER FindInfo = m_SettingInfo.find(Type);
if (FindInfo == m_SettingInfo.end()) if (FindInfo == m_SettingInfo.end())
@ -608,14 +608,14 @@ bool CSettings::LoadDword ( SettingID Type, DWORD & Value)
return false; return false;
} }
DWORD CSettings::LoadDwordIndex( SettingID Type, int index) uint32_t CSettings::LoadDwordIndex( SettingID Type, int index)
{ {
DWORD Value; uint32_t Value;
LoadDwordIndex(Type,index,Value); LoadDwordIndex(Type,index,Value);
return Value; return Value;
} }
bool CSettings::LoadDwordIndex( SettingID Type, int index, DWORD & Value) bool CSettings::LoadDwordIndex( SettingID Type, int index, uint32_t & Value)
{ {
SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); SETTING_HANDLER FindInfo = m_SettingInfo.find(Type);
if (FindInfo == m_SettingInfo.end()) if (FindInfo == m_SettingInfo.end())
@ -633,14 +633,14 @@ bool CSettings::LoadDwordIndex( SettingID Type, int index, DWORD & Value)
return false; return false;
} }
stdstr CSettings::LoadString ( SettingID Type ) stdstr CSettings::LoadStringVal ( SettingID Type )
{ {
stdstr Value; stdstr Value;
LoadString(Type,Value); LoadStringVal(Type,Value);
return Value; return Value;
} }
bool CSettings::LoadString ( SettingID Type, stdstr & Value ) bool CSettings::LoadStringVal ( SettingID Type, stdstr & Value )
{ {
SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); SETTING_HANDLER FindInfo = m_SettingInfo.find(Type);
if (FindInfo == m_SettingInfo.end()) if (FindInfo == m_SettingInfo.end())
@ -658,7 +658,7 @@ bool CSettings::LoadString ( SettingID Type, stdstr & Value )
return false; return false;
} }
bool CSettings::LoadString ( SettingID Type, char * Buffer, int BufferSize ) bool CSettings::LoadStringVal ( SettingID Type, char * Buffer, int BufferSize )
{ {
SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); SETTING_HANDLER FindInfo = m_SettingInfo.find(Type);
if (FindInfo == m_SettingInfo.end()) if (FindInfo == m_SettingInfo.end())
@ -751,14 +751,14 @@ void CSettings::LoadDefaultBoolIndex ( SettingID /*Type*/, int /*index*/, bool &
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
DWORD CSettings::LoadDefaultDword ( SettingID Type ) uint32_t CSettings::LoadDefaultDword ( SettingID Type )
{ {
DWORD Value = 0; uint32_t Value = 0;
LoadDefaultDword(Type,Value); LoadDefaultDword(Type,Value);
return Value; return Value;
} }
void CSettings::LoadDefaultDword ( SettingID Type, DWORD & Value) void CSettings::LoadDefaultDword ( SettingID Type, uint32_t & Value)
{ {
SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); SETTING_HANDLER FindInfo = m_SettingInfo.find(Type);
if (FindInfo == m_SettingInfo.end()) if (FindInfo == m_SettingInfo.end())
@ -775,13 +775,13 @@ void CSettings::LoadDefaultDword ( SettingID Type, DWORD & Value)
} }
} }
DWORD CSettings::LoadDefaultDwordIndex ( SettingID /*Type*/, int /*index*/ ) uint32_t CSettings::LoadDefaultDwordIndex ( SettingID /*Type*/, int /*index*/ )
{ {
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
return false; return false;
} }
void CSettings::LoadDefaultDwordIndex ( SettingID /*Type*/, int /*index*/, DWORD & /*Value*/) void CSettings::LoadDefaultDwordIndex ( SettingID /*Type*/, int /*index*/, uint32_t & /*Value*/)
{ {
g_Notify->BreakPoint(__FILEW__,__LINE__); g_Notify->BreakPoint(__FILEW__,__LINE__);
} }
@ -867,7 +867,7 @@ void CSettings::SaveBoolIndex( SettingID Type, int index, bool Value )
NotifyCallBacks(Type); NotifyCallBacks(Type);
} }
void CSettings::SaveDword ( SettingID Type, DWORD Value ) void CSettings::SaveDword ( SettingID Type, uint32_t Value )
{ {
SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); SETTING_HANDLER FindInfo = m_SettingInfo.find(Type);
if (FindInfo == m_SettingInfo.end()) if (FindInfo == m_SettingInfo.end())
@ -885,7 +885,7 @@ void CSettings::SaveDword ( SettingID Type, DWORD Value )
NotifyCallBacks(Type); NotifyCallBacks(Type);
} }
void CSettings::SaveDwordIndex ( SettingID Type, int index, DWORD Value ) void CSettings::SaveDwordIndex ( SettingID Type, int index, uint32_t Value )
{ {
SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); SETTING_HANDLER FindInfo = m_SettingInfo.find(Type);
if (FindInfo == m_SettingInfo.end()) if (FindInfo == m_SettingInfo.end())
@ -1011,7 +1011,6 @@ SettingType CSettings::GetSettingType ( SettingID Type )
bool CSettings::IndexBasedSetting ( SettingID Type ) bool CSettings::IndexBasedSetting ( SettingID Type )
{ {
SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); SETTING_HANDLER FindInfo = m_SettingInfo.find(Type);
if (FindInfo == m_SettingInfo.end()) if (FindInfo == m_SettingInfo.end())
{ {
@ -1020,7 +1019,6 @@ bool CSettings::IndexBasedSetting ( SettingID Type )
return FindInfo->second->IndexBasedSetting(); return FindInfo->second->IndexBasedSetting();
} }
void CSettings::SettingTypeChanged( SettingType Type ) void CSettings::SettingTypeChanged( SettingType Type )
{ {
for (SETTING_MAP::iterator iter = m_SettingInfo.begin(); iter != m_SettingInfo.end(); iter++) for (SETTING_MAP::iterator iter = m_SettingInfo.begin(); iter != m_SettingInfo.end(); iter++)
@ -1059,7 +1057,6 @@ void CSettings::RegisterChangeCB(SettingID Type,void * Data, SettingChangedFunc
new_item->Func = Func; new_item->Func = Func;
new_item->Next = NULL; new_item->Next = NULL;
SETTING_CALLBACK::iterator Callback = m_Callback.find(Type); SETTING_CALLBACK::iterator Callback = m_Callback.find(Type);
if (Callback != m_Callback.end()) if (Callback != m_Callback.end())
{ {

View File

@ -12,7 +12,8 @@
#include "SettingType/SettingsType-Base.h" #include "SettingType/SettingsType-Base.h"
enum SettingDataType { enum SettingDataType
{
Data_DWORD = 0, Data_DWORD = 0,
Data_String = 1, Data_String = 1,
Data_CPUTYPE = 2, Data_CPUTYPE = 2,
@ -22,7 +23,8 @@ enum SettingDataType {
Data_SaveChip = 6 Data_SaveChip = 6
}; };
class CSettings { class CSettings
{
public: public:
typedef void (* SettingChangedFunc)(void *); typedef void (* SettingChangedFunc)(void *);
@ -53,13 +55,13 @@ public:
bool LoadBool ( SettingID Type, bool & Value ); bool LoadBool ( SettingID Type, bool & Value );
bool LoadBoolIndex ( SettingID Type, int index ); bool LoadBoolIndex ( SettingID Type, int index );
bool LoadBoolIndex ( SettingID Type, int index , bool & Value ); bool LoadBoolIndex ( SettingID Type, int index , bool & Value );
DWORD LoadDword ( SettingID Type ); uint32_t LoadDword ( SettingID Type );
bool LoadDword ( SettingID Type, DWORD & Value); bool LoadDword ( SettingID Type, uint32_t & Value);
DWORD LoadDwordIndex ( SettingID Type, int index ); uint32_t LoadDwordIndex ( SettingID Type, int index );
bool LoadDwordIndex ( SettingID Type, int index, DWORD & Value); bool LoadDwordIndex ( SettingID Type, int index, uint32_t & Value);
stdstr LoadString ( SettingID Type ); stdstr LoadStringVal ( SettingID Type );
bool LoadString ( SettingID Type, stdstr & Value ); bool LoadStringVal (SettingID Type, stdstr & Value);
bool LoadString ( SettingID Type, char * Buffer, int BufferSize ); bool LoadStringVal (SettingID Type, char * Buffer, int BufferSize);
stdstr LoadStringIndex ( SettingID Type, int index ); stdstr LoadStringIndex ( SettingID Type, int index );
bool LoadStringIndex ( SettingID Type, int index, stdstr & Value ); bool LoadStringIndex ( SettingID Type, int index, stdstr & Value );
bool LoadStringIndex ( SettingID Type, int index, char * Buffer, int BufferSize ); bool LoadStringIndex ( SettingID Type, int index, char * Buffer, int BufferSize );
@ -69,10 +71,10 @@ public:
void LoadDefaultBool ( SettingID Type, bool & Value ); void LoadDefaultBool ( SettingID Type, bool & Value );
bool LoadDefaultBoolIndex ( SettingID Type, int index ); bool LoadDefaultBoolIndex ( SettingID Type, int index );
void LoadDefaultBoolIndex ( SettingID Type, int index , bool & Value ); void LoadDefaultBoolIndex ( SettingID Type, int index , bool & Value );
DWORD LoadDefaultDword ( SettingID Type ); uint32_t LoadDefaultDword ( SettingID Type );
void LoadDefaultDword ( SettingID Type, DWORD & Value); void LoadDefaultDword ( SettingID Type, uint32_t & Value);
DWORD LoadDefaultDwordIndex ( SettingID Type, int index ); uint32_t LoadDefaultDwordIndex ( SettingID Type, int index );
void LoadDefaultDwordIndex ( SettingID Type, int index, DWORD & Value); void LoadDefaultDwordIndex ( SettingID Type, int 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, int BufferSize );
@ -83,8 +85,8 @@ public:
//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, int index, bool Value );
void SaveDword ( SettingID Type, DWORD Value ); void SaveDword ( SettingID Type, uint32_t Value );
void SaveDwordIndex ( SettingID Type, int index, DWORD Value ); void SaveDwordIndex ( SettingID Type, int 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, int index, const stdstr & Value );
void SaveString ( SettingID Type, const char * Buffer ); void SaveString ( SettingID Type, const char * Buffer );
@ -104,14 +106,14 @@ public:
void SettingTypeChanged ( SettingType Type ); void SettingTypeChanged ( SettingType Type );
// static functions for plugins // static functions for plugins
static DWORD GetSetting ( CSettings * _this, SettingID Type ); static uint32_t GetSetting ( CSettings * _this, SettingID Type );
static LPCSTR GetSettingSz ( CSettings * _this, SettingID Type, char * Buffer, int BufferSize ); static const char * GetSettingSz ( CSettings * _this, SettingID Type, char * Buffer, int BufferSize );
static void SetSetting ( CSettings * _this, SettingID ID, unsigned int Value ); static void SetSetting ( CSettings * _this, SettingID ID, unsigned int 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,
DWORD Value ); uint32_t Value );
static DWORD FindSetting ( CSettings * _this, char * Name ); static uint32_t FindSetting ( CSettings * _this, const char * Name );
static void FlushSettings ( CSettings * _this ); static void FlushSettings ( CSettings * _this );
private: private:

View File

@ -197,7 +197,7 @@ DWORD CALLBACK AboutIniBoxProc (HWND hDlg, DWORD uMsg, DWORD wParam, DWORD /*lPa
} }
//RDB //RDB
CIniFile RdbIniFile(g_Settings->LoadString(SupportFile_RomDatabase).c_str()); CIniFile RdbIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
wcsncpy(String, RdbIniFile.GetString("Meta","Author","").ToUTF16().c_str(),sizeof(String) / sizeof(String[0])); wcsncpy(String, RdbIniFile.GetString("Meta","Author","").ToUTF16().c_str(),sizeof(String) / sizeof(String[0]));
if (wcslen(String) == 0) if (wcslen(String) == 0)
{ {
@ -223,7 +223,7 @@ DWORD CALLBACK AboutIniBoxProc (HWND hDlg, DWORD uMsg, DWORD wParam, DWORD /*lPa
//Cheat //Cheat
SetDlgItemTextW(hDlg,IDC_CHT,GS(INI_CURRENT_CHT)); SetDlgItemTextW(hDlg,IDC_CHT,GS(INI_CURRENT_CHT));
CIniFile CheatIniFile(g_Settings->LoadString(SupportFile_Cheats).c_str()); CIniFile CheatIniFile(g_Settings->LoadStringVal(SupportFile_Cheats).c_str());
wcsncpy(String, CheatIniFile.GetString("Meta","Author","").ToUTF16().c_str(),sizeof(String) / sizeof(String[0])); wcsncpy(String, CheatIniFile.GetString("Meta","Author","").ToUTF16().c_str(),sizeof(String) / sizeof(String[0]));
if (wcslen(String) == 0) if (wcslen(String) == 0)
{ {
@ -247,7 +247,7 @@ DWORD CALLBACK AboutIniBoxProc (HWND hDlg, DWORD uMsg, DWORD wParam, DWORD /*lPa
//Extended Info //Extended Info
SetDlgItemTextW(hDlg, IDC_RDX, GS(INI_CURRENT_RDX)); SetDlgItemTextW(hDlg, IDC_RDX, GS(INI_CURRENT_RDX));
CIniFile RdxIniFile(g_Settings->LoadString(SupportFile_ExtInfo).c_str()); CIniFile RdxIniFile(g_Settings->LoadStringVal(SupportFile_ExtInfo).c_str());
wcsncpy(String, RdxIniFile.GetString("Meta","Author","").ToUTF16().c_str(),sizeof(String) / sizeof(String[0])); wcsncpy(String, RdxIniFile.GetString("Meta","Author","").ToUTF16().c_str(),sizeof(String) / sizeof(String[0]));
if (wcslen(String) == 0) if (wcslen(String) == 0)
{ {
@ -547,8 +547,8 @@ LRESULT CALLBACK CMainGui::MainGui_Proc (HWND hWnd, DWORD uMsg, DWORD wParam, DW
int X = (GetSystemMetrics( SM_CXSCREEN ) - _this->Width()) / 2; int X = (GetSystemMetrics( SM_CXSCREEN ) - _this->Width()) / 2;
int Y = (GetSystemMetrics( SM_CYSCREEN ) - _this->Height()) / 2; int Y = (GetSystemMetrics( SM_CYSCREEN ) - _this->Height()) / 2;
g_Settings->LoadDword(UserInterface_MainWindowTop,(DWORD &)Y); g_Settings->LoadDword(UserInterface_MainWindowTop,(uint32_t &)Y);
g_Settings->LoadDword(UserInterface_MainWindowLeft,(DWORD &)X); g_Settings->LoadDword(UserInterface_MainWindowLeft, (uint32_t &)X);
_this->SetPos(X,Y); _this->SetPos(X,Y);
@ -777,7 +777,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc (HWND hWnd, DWORD uMsg, DWORD wParam, DW
{ {
if (!fActive && g_Settings->LoadBool(UserInterface_InFullScreen)) if (!fActive && g_Settings->LoadBool(UserInterface_InFullScreen))
{ {
g_Notify->WindowMode(); Notify().WindowMode();
if (bAutoSleep() && g_BaseSystem) if (bAutoSleep() && g_BaseSystem)
{ {
//System->ExternalEvent(PauseCPU_AppLostActiveDelayed ); //System->ExternalEvent(PauseCPU_AppLostActiveDelayed );
@ -846,7 +846,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc (HWND hWnd, DWORD uMsg, DWORD wParam, DW
CN64Rom Rom; CN64Rom Rom;
Rom.LoadN64Image(_this->CurrentedSelectedRom(),true); Rom.LoadN64Image(_this->CurrentedSelectedRom(),true);
Rom.SaveRomSettingID(true); Rom.SaveRomSettingID(true);
/*if (g_Settings->LoadString(ROM_MD5).length() == 0) { /*if (g_Settings->LoadStringVal(ROM_MD5).length() == 0) {
Rom.LoadN64Image(_this->CurrentedSelectedRom(),false); Rom.LoadN64Image(_this->CurrentedSelectedRom(),false);
g_Settings->SaveString(ROM_MD5,Rom.GetRomMD5().c_str()); g_Settings->SaveString(ROM_MD5,Rom.GetRomMD5().c_str());
g_Settings->SaveString(ROM_InternalName,Rom.GetRomName().c_str()); g_Settings->SaveString(ROM_InternalName,Rom.GetRomName().c_str());
@ -928,7 +928,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc (HWND hWnd, DWORD uMsg, DWORD wParam, DW
CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class"); CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class");
if (_this->m_bMainWindow) if (_this->m_bMainWindow)
{ {
g_Notify->WindowMode(); Notify().WindowMode();
} }
_this->m_hMainWindow = NULL; _this->m_hMainWindow = NULL;
WriteTrace(TraceDebug,__FUNCTION__ ": WM_DESTROY - 1"); WriteTrace(TraceDebug,__FUNCTION__ ": WM_DESTROY - 1");

View File

@ -124,7 +124,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
break; break;
case ID_SYSTEM_BITMAP: case ID_SYSTEM_BITMAP:
{ {
stdstr Dir(g_Settings->LoadString(Directory_SnapShot)); stdstr Dir(g_Settings->LoadStringVal(Directory_SnapShot));
WriteTraceF(TraceGfxPlugin,__FUNCTION__ ": CaptureScreen(%s): Starting",Dir.c_str()); WriteTraceF(TraceGfxPlugin,__FUNCTION__ ": CaptureScreen(%s): Starting",Dir.c_str());
g_Plugins->Gfx()->CaptureScreen(Dir.c_str()); g_Plugins->Gfx()->CaptureScreen(Dir.c_str());
WriteTrace(TraceGfxPlugin,__FUNCTION__ ": CaptureScreen: Done"); WriteTrace(TraceGfxPlugin,__FUNCTION__ ": CaptureScreen: Done");
@ -148,7 +148,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
memset(&SaveFile, 0, sizeof(SaveFile)); memset(&SaveFile, 0, sizeof(SaveFile));
memset(&openfilename, 0, sizeof(openfilename)); memset(&openfilename, 0, sizeof(openfilename));
g_Settings->LoadString(Directory_LastSave, Directory,sizeof(Directory)); g_Settings->LoadStringVal(Directory_LastSave, Directory,sizeof(Directory));
openfilename.lStructSize = sizeof( openfilename ); openfilename.lStructSize = sizeof( openfilename );
openfilename.hwndOwner = (HWND)hWnd; openfilename.hwndOwner = (HWND)hWnd;
@ -191,7 +191,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
memset(&SaveFile, 0, sizeof(SaveFile)); memset(&SaveFile, 0, sizeof(SaveFile));
memset(&openfilename, 0, sizeof(openfilename)); memset(&openfilename, 0, sizeof(openfilename));
g_Settings->LoadString(Directory_LastSave, Directory,sizeof(Directory)); g_Settings->LoadStringVal(Directory_LastSave, Directory,sizeof(Directory));
openfilename.lStructSize = sizeof( openfilename ); openfilename.lStructSize = sizeof( openfilename );
openfilename.hwndOwner = (HWND)hWnd; openfilename.hwndOwner = (HWND)hWnd;
@ -471,7 +471,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
case ID_DEBUGGER_INTERRUPT_PI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_PI); break; case ID_DEBUGGER_INTERRUPT_PI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_PI); break;
case ID_DEBUGGER_INTERRUPT_DP: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_DP); break; case ID_DEBUGGER_INTERRUPT_DP: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_DP); break;
case ID_CURRENT_SAVE_DEFAULT: case ID_CURRENT_SAVE_DEFAULT:
Notify().DisplayMessage(3,L"Save Slot (%s) selected",GetSaveSlotString(MenuID - ID_CURRENT_SAVE_DEFAULT).c_str()); Notify().DisplayMessage(3,stdstr_f("Save Slot (%s) selected",GetSaveSlotString(MenuID - ID_CURRENT_SAVE_DEFAULT).c_str()).ToUTF16().c_str());
g_Settings->SaveDword(Game_CurrentSaveState,(DWORD)(MenuID - ID_CURRENT_SAVE_DEFAULT)); g_Settings->SaveDword(Game_CurrentSaveState,(DWORD)(MenuID - ID_CURRENT_SAVE_DEFAULT));
break; break;
case ID_CURRENT_SAVE_1: case ID_CURRENT_SAVE_1:
@ -484,7 +484,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
case ID_CURRENT_SAVE_8: case ID_CURRENT_SAVE_8:
case ID_CURRENT_SAVE_9: case ID_CURRENT_SAVE_9:
case ID_CURRENT_SAVE_10: case ID_CURRENT_SAVE_10:
Notify().DisplayMessage(3,L"Save Slot (%s) selected",GetSaveSlotString((MenuID - ID_CURRENT_SAVE_1) + 1).c_str()); Notify().DisplayMessage(3,stdstr_f("Save Slot (%s) selected",GetSaveSlotString((MenuID - ID_CURRENT_SAVE_1) + 1)).ToUTF16().c_str());
g_Settings->SaveDword(Game_CurrentSaveState,(DWORD)((MenuID - ID_CURRENT_SAVE_1) + 1)); g_Settings->SaveDword(Game_CurrentSaveState,(DWORD)((MenuID - ID_CURRENT_SAVE_1) + 1));
break; break;
case ID_HELP_SUPPORTFORUM: ShellExecute(NULL, "open", "http://forum.pj64-emu.com/", NULL, NULL, SW_SHOWMAXIMIZED); break; case ID_HELP_SUPPORTFORUM: ShellExecute(NULL, "open", "http://forum.pj64-emu.com/", NULL, NULL, SW_SHOWMAXIMIZED); break;
@ -505,7 +505,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
stdstr Dir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex,Offset); stdstr Dir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex,Offset);
if (Dir.length() > 0) { if (Dir.length() > 0) {
g_Settings->SaveString(Directory_Game,Dir.c_str()); g_Settings->SaveString(Directory_Game,Dir.c_str());
g_Notify->AddRecentDir(Dir.c_str()); Notify().AddRecentDir(Dir.c_str());
_Gui->RefreshMenu(); _Gui->RefreshMenu();
if (_Gui->RomBrowserVisible()) { if (_Gui->RomBrowserVisible()) {
_Gui->RefreshRomBrowser(); _Gui->RefreshRomBrowser();
@ -601,8 +601,8 @@ std::wstring CMainMenu::GetSaveSlotString (int Slot)
stdstr LastSaveTime; stdstr LastSaveTime;
//check first save name //check first save name
stdstr _GoodName = g_Settings->LoadString(Game_GoodName); stdstr _GoodName = g_Settings->LoadStringVal(Game_GoodName);
stdstr _InstantSaveDirectory = g_Settings->LoadString(Directory_InstantSave); stdstr _InstantSaveDirectory = g_Settings->LoadStringVal(Directory_InstantSave);
stdstr CurrentSaveName; stdstr CurrentSaveName;
if (Slot != 0) if (Slot != 0)
{ {
@ -627,7 +627,7 @@ std::wstring CMainMenu::GetSaveSlotString (int Slot)
// Check old file name // Check old file name
if (LastSaveTime.empty()) if (LastSaveTime.empty())
{ {
stdstr _RomName = g_Settings->LoadString(Game_GameName); stdstr _RomName = g_Settings->LoadStringVal(Game_GameName);
if (Slot > 0) if (Slot > 0)
{ {
FileName.Format("%s%s.pj%d", _InstantSaveDirectory.c_str(), _RomName.c_str(),Slot); FileName.Format("%s%s.pj%d", _InstantSaveDirectory.c_str(), _RomName.c_str(),Slot);
@ -661,7 +661,7 @@ void CMainMenu::FillOutMenu ( HMENU hMenu )
bool inBasicMode = g_Settings->LoadBool(UserInterface_BasicMode); bool inBasicMode = g_Settings->LoadBool(UserInterface_BasicMode);
bool CPURunning = g_Settings->LoadBool(GameRunning_CPU_Running); bool CPURunning = g_Settings->LoadBool(GameRunning_CPU_Running);
bool RomLoading = g_Settings->LoadBool(GameRunning_LoadingInProgress); bool RomLoading = g_Settings->LoadBool(GameRunning_LoadingInProgress);
bool RomLoaded = g_Settings->LoadString(Game_GameName).length() > 0; bool RomLoaded = g_Settings->LoadStringVal(Game_GameName).length() > 0;
bool RomList = g_Settings->LoadBool(RomBrowser_Enabled) && !CPURunning; bool RomList = g_Settings->LoadBool(RomBrowser_Enabled) && !CPURunning;
CMenuShortCutKey::ACCESS_MODE AccessLevel = CMenuShortCutKey::GAME_NOT_RUNNING; CMenuShortCutKey::ACCESS_MODE AccessLevel = CMenuShortCutKey::GAME_NOT_RUNNING;

View File

@ -348,7 +348,7 @@ void CShortCuts::Load (bool InitialValues )
AddShortCut(ID_OPTIONS_CPU_USAGE, STR_SHORTCUT_OPTIONS, MENU_SHOW_CPU, CMenuShortCutKey::GAME_RUNNING ); AddShortCut(ID_OPTIONS_CPU_USAGE, STR_SHORTCUT_OPTIONS, MENU_SHOW_CPU, CMenuShortCutKey::GAME_RUNNING );
AddShortCut(ID_OPTIONS_SETTINGS, STR_SHORTCUT_OPTIONS, MENU_SETTINGS, CMenuShortCutKey::NOT_IN_FULLSCREEN ); AddShortCut(ID_OPTIONS_SETTINGS, STR_SHORTCUT_OPTIONS, MENU_SETTINGS, CMenuShortCutKey::NOT_IN_FULLSCREEN );
CPath ShortCutFile = g_Settings->LoadString(SupportFile_ShortCuts); CPath ShortCutFile = g_Settings->LoadStringVal(SupportFile_ShortCuts);
if (!ShortCutFile.Exists() || InitialValues) if (!ShortCutFile.Exists() || InitialValues)
{ {
m_ShortCuts.find(ID_FILE_OPEN_ROM)->second.AddShortCut('O',TRUE,false,false,CMenuShortCutKey::GAME_RUNNING); m_ShortCuts.find(ID_FILE_OPEN_ROM)->second.AddShortCut('O',TRUE,false,false,CMenuShortCutKey::GAME_RUNNING);
@ -416,7 +416,7 @@ void CShortCuts::Save( void )
{ {
CGuard CS(m_CS); CGuard CS(m_CS);
stdstr FileName = g_Settings->LoadString(SupportFile_ShortCuts); stdstr FileName = g_Settings->LoadStringVal(SupportFile_ShortCuts);
FILE *file = fopen(FileName.c_str(),"w"); FILE *file = fopen(FileName.c_str(),"w");
if (file == NULL) if (file == NULL)
{ {

View File

@ -158,7 +158,7 @@ void CNotification::SetWindowCaption (const wchar_t * Caption)
static const size_t TITLE_SIZE = 256; static const size_t TITLE_SIZE = 256;
wchar_t WinTitle[TITLE_SIZE]; wchar_t WinTitle[TITLE_SIZE];
_snwprintf(WinTitle, TITLE_SIZE, L"%s - %s", Caption, g_Settings->LoadString(Setting_ApplicationName).ToUTF16().c_str()); _snwprintf(WinTitle, TITLE_SIZE, L"%s - %s", Caption, g_Settings->LoadStringVal(Setting_ApplicationName).ToUTF16().c_str());
WinTitle[TITLE_SIZE - 1] = 0; WinTitle[TITLE_SIZE - 1] = 0;
#if defined(WINDOWS_UI) #if defined(WINDOWS_UI)
m_hWnd->Caption(WinTitle); m_hWnd->Caption(WinTitle);

View File

@ -17,10 +17,10 @@ CRomBrowser::CRomBrowser (HWND & MainWindow, HWND & StatusWindow ) :
{ {
if (g_Settings) if (g_Settings)
{ {
m_RomIniFile = new CIniFile(g_Settings->LoadString(SupportFile_RomDatabase).c_str()); m_RomIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
m_NotesIniFile = new CIniFile(g_Settings->LoadString(SupportFile_Notes).c_str()); m_NotesIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_Notes).c_str());
m_ExtIniFile = new CIniFile(g_Settings->LoadString(SupportFile_ExtInfo).c_str()); m_ExtIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_ExtInfo).c_str());
m_ZipIniFile = new CIniFile(g_Settings->LoadString(SupportFile_7zipCache).c_str()); m_ZipIniFile = new CIniFile(g_Settings->LoadStringVal(SupportFile_7zipCache).c_str());
} }
m_hRomList = 0; m_hRomList = 0;
@ -441,7 +441,7 @@ void CRomBrowser::FillRomExtensionInfo(ROM_INFO * pRomInfo)
} }
if (m_Fields[RB_Players].Pos() >= 0) if (m_Fields[RB_Players].Pos() >= 0)
{ {
m_ExtIniFile->GetNumber(Identifier,"Players",1,(DWORD &)pRomInfo->Players); m_ExtIniFile->GetNumber(Identifier,"Players",1,(uint32_t &)pRomInfo->Players);
} }
if (m_Fields[RB_ForceFeedback].Pos() >= 0) if (m_Fields[RB_ForceFeedback].Pos() >= 0)
{ {
@ -588,7 +588,7 @@ bool CRomBrowser::GetRomFileNames( strlist & FileList, const CPath & BaseDirecto
void CRomBrowser::NotificationCB ( LPCWSTR Status, CRomBrowser * /*_this*/ ) void CRomBrowser::NotificationCB ( LPCWSTR Status, CRomBrowser * /*_this*/ )
{ {
g_Notify->DisplayMessage(5,L"%s",Status); g_Notify->DisplayMessage(5,Status);
} }
@ -767,7 +767,7 @@ void CRomBrowser::FillRomList ( strlist & FileList, const CPath & BaseDirectory,
RomInfo.Country = *(RomData + 0x3D); RomInfo.Country = *(RomData + 0x3D);
RomInfo.CRC1 = *(DWORD *)(RomData + 0x10); RomInfo.CRC1 = *(DWORD *)(RomData + 0x10);
RomInfo.CRC2 = *(DWORD *)(RomData + 0x14); RomInfo.CRC2 = *(DWORD *)(RomData + 0x14);
m_ZipIniFile->GetNumber(SectionName.c_str(),stdstr_f("%s-Cic",FileName.c_str()).c_str(), (ULONG)-1,(DWORD &)RomInfo.CicChip); m_ZipIniFile->GetNumber(SectionName.c_str(),stdstr_f("%s-Cic",FileName.c_str()).c_str(), (ULONG)-1,(uint32_t &)RomInfo.CicChip);
WriteTrace(TraceDebug,__FUNCTION__ ": 16"); WriteTrace(TraceDebug,__FUNCTION__ ": 16");
FillRomExtensionInfo(&RomInfo); FillRomExtensionInfo(&RomInfo);
@ -979,7 +979,7 @@ void CRomBrowser::ByteSwapRomData (BYTE * Data, int DataLen)
} }
void CRomBrowser::LoadRomList (void) { void CRomBrowser::LoadRomList (void) {
stdstr FileName = g_Settings->LoadString(SupportFile_RomListCache); stdstr FileName = g_Settings->LoadStringVal(SupportFile_RomListCache);
//Open the cache file //Open the cache file
HANDLE hFile = CreateFile(FileName.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); HANDLE hFile = CreateFile(FileName.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
@ -1072,7 +1072,7 @@ void CRomBrowser::RefreshRomBrowserStatic (CRomBrowser * _this)
if (_this->m_hRomList == NULL) { return; } if (_this->m_hRomList == NULL) { return; }
//delete cache //delete cache
stdstr CacheFileName = g_Settings->LoadString(SupportFile_RomListCache); stdstr CacheFileName = g_Settings->LoadStringVal(SupportFile_RomListCache);
DeleteFile(CacheFileName.c_str()); DeleteFile(CacheFileName.c_str());
//clear all current items //clear all current items
@ -1085,7 +1085,7 @@ void CRomBrowser::RefreshRomBrowserStatic (CRomBrowser * _this)
Sleep(100); Sleep(100);
WriteTrace(TraceDebug,__FUNCTION__ " 3"); WriteTrace(TraceDebug,__FUNCTION__ " 3");
if (_this->m_WatchRomDir != g_Settings->LoadString(Directory_Game)) if (_this->m_WatchRomDir != g_Settings->LoadStringVal(Directory_Game))
{ {
WriteTrace(TraceDebug,__FUNCTION__ " 4"); WriteTrace(TraceDebug,__FUNCTION__ " 4");
_this->WatchThreadStop(); _this->WatchThreadStop();
@ -1095,7 +1095,7 @@ void CRomBrowser::RefreshRomBrowserStatic (CRomBrowser * _this)
} }
WriteTrace(TraceDebug,__FUNCTION__ " 7"); WriteTrace(TraceDebug,__FUNCTION__ " 7");
stdstr RomDir = g_Settings->LoadString(Directory_Game); stdstr RomDir = g_Settings->LoadStringVal(Directory_Game);
stdstr LastRom = g_Settings->LoadStringIndex(File_RecentGameFileIndex,0); stdstr LastRom = g_Settings->LoadStringIndex(File_RecentGameFileIndex,0);
WriteTrace(TraceDebug,__FUNCTION__ " 8"); WriteTrace(TraceDebug,__FUNCTION__ " 8");
@ -1586,7 +1586,7 @@ void CRomBrowser::SaveRomList ( strlist & FileList )
{ {
MD5 ListHash = RomListHash(FileList); MD5 ListHash = RomListHash(FileList);
stdstr FileName = g_Settings->LoadString(SupportFile_RomListCache); stdstr FileName = g_Settings->LoadStringVal(SupportFile_RomListCache);
HANDLE hFile = CreateFile(FileName.c_str(),GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); HANDLE hFile = CreateFile(FileName.c_str(),GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
DWORD dwWritten; DWORD dwWritten;
@ -1669,7 +1669,7 @@ void CRomBrowser::SelectRomDir(void)
BROWSEINFOW bi; BROWSEINFOW bi;
WriteTrace(TraceDebug,__FUNCTION__ " 1"); WriteTrace(TraceDebug,__FUNCTION__ " 1");
stdstr RomDir = g_Settings->LoadString(Directory_Game); stdstr RomDir = g_Settings->LoadStringVal(Directory_Game);
bi.hwndOwner = m_MainWindow; bi.hwndOwner = m_MainWindow;
bi.pidlRoot = NULL; bi.pidlRoot = NULL;
bi.pszDisplayName = SelectedDir; bi.pszDisplayName = SelectedDir;
@ -1695,7 +1695,7 @@ void CRomBrowser::SelectRomDir(void)
WriteTrace(TraceDebug,__FUNCTION__ " 6"); WriteTrace(TraceDebug,__FUNCTION__ " 6");
g_Settings->SaveString(Directory_Game,Directory); g_Settings->SaveString(Directory_Game,Directory);
WriteTrace(TraceDebug,__FUNCTION__ " 7"); WriteTrace(TraceDebug,__FUNCTION__ " 7");
g_Notify->AddRecentDir(Directory); Notify().AddRecentDir(Directory);
WriteTrace(TraceDebug,__FUNCTION__ " 8"); WriteTrace(TraceDebug,__FUNCTION__ " 8");
RefreshRomBrowser(); RefreshRomBrowser();
WriteTrace(TraceDebug,__FUNCTION__ " 9"); WriteTrace(TraceDebug,__FUNCTION__ " 9");
@ -1718,8 +1718,8 @@ void CRomBrowser::FixRomListWindow (void)
int Y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2; int Y = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
//Load the value from settings, if none is available, default to above //Load the value from settings, if none is available, default to above
g_Settings->LoadDword(RomBrowser_Top, (DWORD &)Y); g_Settings->LoadDword(RomBrowser_Top, (uint32_t &)Y);
g_Settings->LoadDword(RomBrowser_Left,(DWORD &)X); g_Settings->LoadDword(RomBrowser_Left, (uint32_t &)X);
SetWindowPos(m_MainWindow,NULL,X,Y,0,0,SWP_NOZORDER|SWP_NOSIZE); SetWindowPos(m_MainWindow,NULL,X,Y,0,0,SWP_NOZORDER|SWP_NOSIZE);
@ -1800,8 +1800,8 @@ void CRomBrowser::HideRomList (void)
GetWindowRect(m_MainWindow,&rect); GetWindowRect(m_MainWindow,&rect);
int X = (GetSystemMetrics( SM_CXSCREEN ) - (rect.right - rect.left)) / 2; int X = (GetSystemMetrics( SM_CXSCREEN ) - (rect.right - rect.left)) / 2;
int Y = (GetSystemMetrics( SM_CYSCREEN ) - (rect.bottom - rect.top)) / 2; int Y = (GetSystemMetrics( SM_CYSCREEN ) - (rect.bottom - rect.top)) / 2;
g_Settings->LoadDword(UserInterface_MainWindowTop,(DWORD &)Y); g_Settings->LoadDword(UserInterface_MainWindowTop,(uint32_t &)Y);
g_Settings->LoadDword(UserInterface_MainWindowLeft,(DWORD &)X); g_Settings->LoadDword(UserInterface_MainWindowLeft, (uint32_t &)X);
SetWindowPos(m_MainWindow,NULL,X,Y,0,0,SWP_NOZORDER|SWP_NOSIZE); SetWindowPos(m_MainWindow,NULL,X,Y,0,0,SWP_NOZORDER|SWP_NOSIZE);
//Mark the window as not visible //Mark the window as not visible
@ -1818,7 +1818,7 @@ bool CRomBrowser::RomDirNeedsRefresh ( void )
bool InWatchThread = (m_WatchThreadID == GetCurrentThreadId()); bool InWatchThread = (m_WatchThreadID == GetCurrentThreadId());
//Get Old MD5 of file names //Get Old MD5 of file names
stdstr FileName = g_Settings->LoadString(SupportFile_RomListCache); stdstr FileName = g_Settings->LoadStringVal(SupportFile_RomListCache);
HANDLE hFile = CreateFile(FileName.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); HANDLE hFile = CreateFile(FileName.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
if (hFile == INVALID_HANDLE_VALUE) if (hFile == INVALID_HANDLE_VALUE)
{ {
@ -1833,7 +1833,7 @@ bool CRomBrowser::RomDirNeedsRefresh ( void )
//Get Current MD5 of file names //Get Current MD5 of file names
strlist FileNames; strlist FileNames;
if (!GetRomFileNames(FileNames,CPath(g_Settings->LoadString(Directory_Game)),stdstr(""), InWatchThread )) if (!GetRomFileNames(FileNames,CPath(g_Settings->LoadStringVal(Directory_Game)),stdstr(""), InWatchThread ))
{ {
return false; return false;
} }
@ -1866,7 +1866,7 @@ void CRomBrowser::WatchRomDirChanged ( CRomBrowser * _this )
try try
{ {
WriteTrace(TraceDebug,__FUNCTION__ ": 1"); WriteTrace(TraceDebug,__FUNCTION__ ": 1");
_this->m_WatchRomDir = g_Settings->LoadString(Directory_Game); _this->m_WatchRomDir = g_Settings->LoadStringVal(Directory_Game);
WriteTrace(TraceDebug,__FUNCTION__ ": 2"); WriteTrace(TraceDebug,__FUNCTION__ ": 2");
if (_this->RomDirNeedsRefresh()) if (_this->RomDirNeedsRefresh())
{ {

View File

@ -13,14 +13,13 @@
#include <vector> #include <vector>
class CMainGui; class CMainGui;
class CNotification;
class CPlugins; class CPlugins;
class ROMBROWSER_FIELDS { class ROMBROWSER_FIELDS {
stdstr m_Name; stdstr m_Name;
size_t m_Pos, m_DefaultPos; size_t m_Pos, m_DefaultPos;
int m_ID; int m_ID;
ULONG m_ColWidth; uint32_t m_ColWidth;
LanguageStringID m_LangID; LanguageStringID m_LangID;
bool m_PosChanged; bool m_PosChanged;
@ -37,7 +36,7 @@ public:
{ {
if (!UseDefault) if (!UseDefault)
{ {
m_PosChanged = g_Settings->LoadDwordIndex(RomBrowser_PosIndex,m_ID,(ULONG &)m_Pos ); m_PosChanged = g_Settings->LoadDwordIndex(RomBrowser_PosIndex,m_ID,(uint32_t &)m_Pos );
g_Settings->LoadDwordIndex(RomBrowser_WidthIndex,m_ID,m_ColWidth); g_Settings->LoadDwordIndex(RomBrowser_WidthIndex,m_ID,m_ColWidth);
} }
} }

View File

@ -77,11 +77,11 @@ bool CSettingConfig::UpdateAdvanced ( bool AdvancedMode, HTREEITEM hItem )
LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{ {
stdstr ConfigRomTitle, GameIni(g_Settings->LoadString(Game_IniKey)); stdstr ConfigRomTitle, GameIni(g_Settings->LoadStringVal(Game_IniKey));
if (!GameIni.empty()) if (!GameIni.empty())
{ {
ConfigRomTitle.Format("Config: %s",g_Settings->LoadString(Game_GoodName).c_str()); ConfigRomTitle.Format("Config: %s",g_Settings->LoadStringVal(Game_GoodName).c_str());
} }
RECT rcSettingInfo; RECT rcSettingInfo;
@ -246,12 +246,12 @@ LRESULT CSettingConfig::OnClicked (WORD /*wNotifyCode*/, WORD wID, HWND , BOOL&
void CSettingConfig::ApplySettings( bool UpdateScreen ) void CSettingConfig::ApplySettings( bool UpdateScreen )
{ {
stdstr GameIni(g_Settings->LoadString(Game_IniKey)); stdstr GameIni(g_Settings->LoadStringVal(Game_IniKey));
if (!GameIni.empty()) if (!GameIni.empty())
{ {
stdstr GoodName; stdstr GoodName;
if (!g_Settings->LoadString(Game_GoodName,GoodName)) if (!g_Settings->LoadStringVal(Game_GoodName,GoodName))
{ {
g_Settings->SaveString(Game_GoodName,GoodName); g_Settings->SaveString(Game_GoodName,GoodName);
} }
@ -275,9 +275,9 @@ void CSettingConfig::ApplySettings( bool UpdateScreen )
} }
if (!g_Settings->LoadString(Game_IniKey).empty()) if (!g_Settings->LoadStringVal(Game_IniKey).empty())
{ {
stdstr GoodName = g_Settings->LoadString(Rdb_GoodName); stdstr GoodName = g_Settings->LoadStringVal(Rdb_GoodName);
if (GoodName.length() > 0) if (GoodName.length() > 0)
{ {
g_Settings->SaveString(Game_GoodName,GoodName); g_Settings->SaveString(Game_GoodName,GoodName);

View File

@ -168,15 +168,15 @@ void COptionsDirectoriesPage::UpdatePageSettings()
stdstr Directory; stdstr Directory;
m_InUpdateSettings = true; m_InUpdateSettings = true;
m_PluginDir.SetChanged(g_Settings->LoadString(Directory_PluginSelected,Directory)); m_PluginDir.SetChanged(g_Settings->LoadStringVal(Directory_PluginSelected,Directory));
m_PluginDir.SetWindowText(Directory.c_str()); m_PluginDir.SetWindowText(Directory.c_str());
m_AutoSaveDir.SetChanged(g_Settings->LoadString(Directory_NativeSaveSelected,Directory)); m_AutoSaveDir.SetChanged(g_Settings->LoadStringVal(Directory_NativeSaveSelected,Directory));
m_AutoSaveDir.SetWindowText(Directory.c_str()); m_AutoSaveDir.SetWindowText(Directory.c_str());
m_InstantSaveDir.SetChanged(g_Settings->LoadString(Directory_InstantSaveSelected,Directory)); m_InstantSaveDir.SetChanged(g_Settings->LoadStringVal(Directory_InstantSaveSelected,Directory));
m_InstantSaveDir.SetWindowText(Directory.c_str()); m_InstantSaveDir.SetWindowText(Directory.c_str());
m_ScreenShotDir.SetChanged(g_Settings->LoadString(Directory_SnapShotSelected,Directory)); m_ScreenShotDir.SetChanged(g_Settings->LoadStringVal(Directory_SnapShotSelected,Directory));
m_ScreenShotDir.SetWindowText(Directory.c_str()); m_ScreenShotDir.SetWindowText(Directory.c_str());
m_TextureDir.SetChanged(g_Settings->LoadString(Directory_TextureSelected,Directory)); m_TextureDir.SetChanged(g_Settings->LoadStringVal(Directory_TextureSelected,Directory));
m_TextureDir.SetWindowText(Directory.c_str()); m_TextureDir.SetWindowText(Directory.c_str());
bool UseSelected; bool UseSelected;

View File

@ -78,7 +78,7 @@ CGameGeneralPage::CGameGeneralPage (HWND hParent, const RECT & rcDispay )
ComboBox->AddItemW(GS(NUMBER_6), 6 ); ComboBox->AddItemW(GS(NUMBER_6), 6 );
} }
SetDlgItemText(IDC_GOOD_NAME,g_Settings->LoadString(Game_GoodName).c_str()); SetDlgItemText(IDC_GOOD_NAME,g_Settings->LoadStringVal(Game_GoodName).c_str());
CModifiedEditBox * TxtBox = AddModTextBox(GetDlgItem(IDC_VIREFRESH),Game_ViRefreshRate, false); CModifiedEditBox * TxtBox = AddModTextBox(GetDlgItem(IDC_VIREFRESH),Game_ViRefreshRate, false);
TxtBox->SetTextField(GetDlgItem(IDC_VIREFESH_TEXT)); TxtBox->SetTextField(GetDlgItem(IDC_VIREFESH_TEXT));

View File

@ -54,7 +54,7 @@ CGamePluginPage::CGamePluginPage (HWND hParent, const RECT & rcDispay )
void CGamePluginPage::AddPlugins (int ListId,SettingID Type, PLUGIN_TYPE PluginType ) void CGamePluginPage::AddPlugins (int ListId,SettingID Type, PLUGIN_TYPE PluginType )
{ {
stdstr Default; stdstr Default;
bool PluginSelected = g_Settings->LoadString(Type,Default); bool PluginSelected = g_Settings->LoadStringVal(Type,Default);
CModifiedComboBox * ComboBox; CModifiedComboBox * ComboBox;
ComboBox = AddModComboBox(GetDlgItem(ListId),Type); ComboBox = AddModComboBox(GetDlgItem(ListId),Type);
@ -183,7 +183,7 @@ void CGamePluginPage::UpdatePageSettings ( void )
CModifiedComboBox * ComboBox = cb_iter->second; CModifiedComboBox * ComboBox = cb_iter->second;
stdstr SelectedValue; stdstr SelectedValue;
bool PluginChanged = g_Settings->LoadString(cb_iter->first,SelectedValue); bool PluginChanged = g_Settings->LoadStringVal(cb_iter->first,SelectedValue);
ComboBox->SetChanged(PluginChanged); ComboBox->SetChanged(PluginChanged);
if (PluginChanged) if (PluginChanged)
{ {
@ -259,7 +259,7 @@ void CGamePluginPage::ApplyComboBoxes ( void )
if (Plugin) if (Plugin)
{ {
if (g_Settings->LoadString(cb_iter->first) != Plugin->FileName.c_str()) if (g_Settings->LoadStringVal(cb_iter->first) != Plugin->FileName.c_str())
{ {
g_Settings->SaveString(cb_iter->first,Plugin->FileName.c_str()); g_Settings->SaveString(cb_iter->first,Plugin->FileName.c_str());
} }

View File

@ -21,10 +21,10 @@ CGameStatusPage::CGameStatusPage (HWND hParent, const RECT & rcDispay )
return; return;
} }
CIniFile RomIniFile (g_Settings->LoadString(SupportFile_RomDatabase).c_str()); CIniFile RomIniFile (g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
strlist Keys; strlist Keys;
RomIniFile.GetKeyList("Rom Status",Keys); RomIniFile.GetKeyList("Rom Status",Keys);
stdstr Status = g_Settings->LoadString(Rdb_Status); stdstr Status = g_Settings->LoadStringVal(Rdb_Status);
CModifiedComboBoxTxt * ComboBox; CModifiedComboBoxTxt * ComboBox;
ComboBox = AddModComboBoxTxt(GetDlgItem(IDC_STATUS_TYPE),Rdb_Status); ComboBox = AddModComboBoxTxt(GetDlgItem(IDC_STATUS_TYPE),Rdb_Status);

View File

@ -52,7 +52,7 @@ COptionPluginPage::COptionPluginPage (HWND hParent, const RECT & rcDispay )
void COptionPluginPage::AddPlugins (int ListId,SettingID Type, PLUGIN_TYPE PluginType ) void COptionPluginPage::AddPlugins (int ListId,SettingID Type, PLUGIN_TYPE PluginType )
{ {
stdstr Default = g_Settings->LoadString(Type); stdstr Default = g_Settings->LoadStringVal(Type);
CModifiedComboBox * ComboBox; CModifiedComboBox * ComboBox;
ComboBox = AddModComboBox(GetDlgItem(ListId),Type); ComboBox = AddModComboBox(GetDlgItem(ListId),Type);
@ -175,7 +175,7 @@ void COptionPluginPage::UpdatePageSettings ( void )
CModifiedComboBox * ComboBox = cb_iter->second; CModifiedComboBox * ComboBox = cb_iter->second;
stdstr SelectedValue; stdstr SelectedValue;
ComboBox->SetChanged(g_Settings->LoadString(cb_iter->first,SelectedValue)); ComboBox->SetChanged(g_Settings->LoadStringVal(cb_iter->first,SelectedValue));
for (int i = 0, n = ComboBox->GetCount(); i < n; i++ ) for (int i = 0, n = ComboBox->GetCount(); i < n; i++ )
{ {
const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(i); const CPluginList::PLUGIN ** PluginPtr = (const CPluginList::PLUGIN **)ComboBox->GetItemDataPtr(i);

View File

@ -254,14 +254,14 @@ protected:
CModifiedComboBoxTxt * ComboBox = cbtxt_iter->second; CModifiedComboBoxTxt * ComboBox = cbtxt_iter->second;
stdstr SelectedValue; stdstr SelectedValue;
ComboBox->SetChanged(g_Settings->LoadString(cbtxt_iter->first,SelectedValue)); ComboBox->SetChanged(g_Settings->LoadStringVal(cbtxt_iter->first,SelectedValue));
ComboBox->SetDefault(SelectedValue); ComboBox->SetDefault(SelectedValue);
} }
for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter ++) for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter ++)
{ {
CModifiedComboBox * ComboBox = cb_iter->second; CModifiedComboBox * ComboBox = cb_iter->second;
DWORD SelectedValue; uint32_t SelectedValue;
ComboBox->SetChanged(g_Settings->LoadDword(cb_iter->first,SelectedValue)); ComboBox->SetChanged(g_Settings->LoadDword(cb_iter->first,SelectedValue));
ComboBox->SetDefault(SelectedValue); ComboBox->SetDefault(SelectedValue);
@ -278,10 +278,10 @@ protected:
if (TextBox->IsbString()) if (TextBox->IsbString())
{ {
stdstr SelectedValue; stdstr SelectedValue;
TextBox->SetChanged(g_Settings->LoadString(iter->first,SelectedValue)); TextBox->SetChanged(g_Settings->LoadStringVal(iter->first,SelectedValue));
TextBox->SetWindowText(SelectedValue.c_str()); TextBox->SetWindowText(SelectedValue.c_str());
} else { } else {
DWORD SelectedValue; uint32_t SelectedValue;
TextBox->SetChanged(g_Settings->LoadDword(iter->first,SelectedValue)); TextBox->SetChanged(g_Settings->LoadDword(iter->first,SelectedValue));
TextBox->SetWindowText(stdstr_f("%d",SelectedValue).c_str()); TextBox->SetWindowText(stdstr_f("%d",SelectedValue).c_str());
} }

View File

@ -229,7 +229,7 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
//Create the plugin container //Create the plugin container
WriteTrace(TraceDebug,__FUNCTION__ ": Create Plugins"); WriteTrace(TraceDebug,__FUNCTION__ ": Create Plugins");
g_Plugins = new CPlugins(g_Settings->LoadString(Directory_Plugin)); g_Plugins = new CPlugins(g_Settings->LoadStringVal(Directory_Plugin));
//Select the language //Select the language
g_Lang->LoadCurrentStrings(true); g_Lang->LoadCurrentStrings(true);