Merge remote-tracking branch 'refs/remotes/project64/master'

Conflicts:
	Source/Project64/Multilanguage.h
	Source/Project64/Multilanguage/Language Class.cpp
This commit is contained in:
Samuel Yuan 2015-11-14 19:44:42 -05:00
commit 937625f0c6
53 changed files with 1856 additions and 1856 deletions

View File

@ -0,0 +1,139 @@
#include "stdafx.h"
#include <Common\Util.h>
void FixDirectories(void);
void FixLocale(void);
static void IncreaseThreadPriority(void);
static CTraceFileLog * g_LogFile = NULL;
void LogLevelChanged(CTraceFileLog * LogFile)
{
LogFile->SetTraceLevel((TraceLevel)g_Settings->LoadDword(Debugger_AppLogLevel));
}
void LogFlushChanged(CTraceFileLog * LogFile)
{
LogFile->SetFlushFile(g_Settings->LoadDword(Debugger_AppLogFlush) != 0);
}
void InitializeLog(void)
{
CPath LogFilePath(CPath::MODULE_DIRECTORY);
LogFilePath.AppendDirectory("Logs");
if (!LogFilePath.DirectoryExists())
{
LogFilePath.DirectoryCreate();
}
LogFilePath.SetNameExtension("Project64.log");
g_LogFile = new CTraceFileLog(LogFilePath, g_Settings->LoadDword(Debugger_AppLogFlush) != 0, Log_New, 500);
#ifdef VALIDATE_DEBUG
g_LogFile->SetTraceLevel((TraceLevel)(g_Settings->LoadDword(Debugger_AppLogLevel) | TraceValidate | TraceDebug));
#else
g_LogFile->SetTraceLevel((TraceLevel)g_Settings->LoadDword(Debugger_AppLogLevel));
#endif
AddTraceModule(g_LogFile);
g_Settings->RegisterChangeCB(Debugger_AppLogLevel, g_LogFile, (CSettings::SettingChangedFunc)LogLevelChanged);
g_Settings->RegisterChangeCB(Debugger_AppLogFlush, g_LogFile, (CSettings::SettingChangedFunc)LogFlushChanged);
}
void AppInit(CNotification * Notify)
{
try
{
g_Notify = Notify;
FixDirectories();
FixLocale();
stdstr_f AppName("Project64 %s", VER_FILE_VERSION_STR);
IncreaseThreadPriority();
g_Settings = new CSettings;
g_Settings->Initialize(AppName.c_str());
if (g_Settings->LoadBool(Setting_CheckEmuRunning) &&
pjutil::TerminatedExistingExe())
{
delete g_Settings;
g_Settings = new CSettings;
g_Settings->Initialize(AppName.c_str());
}
InitializeLog();
WriteTrace(TraceDebug, __FUNCTION__ ": Application Starting");
CMipsMemoryVM::ReserveMemory();
//Create the plugin container
WriteTrace(TraceDebug, __FUNCTION__ ": Create Plugins");
g_Plugins = new CPlugins(g_Settings->LoadStringVal(Directory_Plugin));
g_Lang = new CLanguage();
g_Lang->LoadCurrentStrings();
g_Notify->AppInitDone();
}
catch (...)
{
g_Notify->DisplayError(stdstr_f("Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__).ToUTF16().c_str());
}
}
void AppCleanup(void)
{
g_Settings->UnregisterChangeCB(Debugger_AppLogLevel, g_LogFile, (CSettings::SettingChangedFunc)LogLevelChanged);
g_Settings->UnregisterChangeCB(Debugger_AppLogFlush, g_LogFile, (CSettings::SettingChangedFunc)LogFlushChanged);
WriteTrace(TraceDebug, __FUNCTION__ ": cleaning up global objects");
if (g_Rom) { delete g_Rom; g_Rom = NULL; }
if (g_Plugins) { delete g_Plugins; g_Plugins = NULL; }
if (g_Settings) { delete g_Settings; g_Settings = NULL; }
if (g_Lang) { delete g_Lang; g_Lang = NULL; }
CMipsMemoryVM::FreeReservedMemory();
WriteTrace(TraceDebug, __FUNCTION__ ": Done");
CloseTrace();
}
void FixDirectories(void)
{
CPath Directory(CPath::MODULE_DIRECTORY);
Directory.AppendDirectory("Config");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
Directory.UpDirectory();
Directory.AppendDirectory("Logs");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
Directory.UpDirectory();
Directory.AppendDirectory("Save");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
Directory.UpDirectory();
Directory.AppendDirectory("Screenshots");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
Directory.UpDirectory();
Directory.AppendDirectory("textures");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
}
#include <windows.h>
void FixLocale(void)
{
char *lbuffer = new char[10];
if (GetLocaleInfoA(LOCALE_SYSTEM_DEFAULT, LOCALE_SABBREVLANGNAME, lbuffer, 10))
{
setlocale(LC_ALL, lbuffer);
}
delete[] lbuffer;
}
void IncreaseThreadPriority(void)
{
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
}

View File

@ -0,0 +1,6 @@
#pragma once
#include <Project64\User Interface\Notification Class.h>
void AppInit(CNotification * Notify);
void AppCleanup(void);

View File

@ -1 +1,16 @@
#pragma once
/****************************************************************************
* *
* Project 64 - A Nintendo 64 emulator. *
* http://www.pj64-emu.com/ *
* Copyright (C) 2012 Project64. All rights reserved. *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/
#pragma once
__interface CDebugger
{
virtual void TLBChanged(void) = 0;
};

View File

@ -11,521 +11,520 @@
#pragma once
enum LanguageStringID{
EMPTY_STRING = 0,
EMPTY_STRING = 0,
/*********************************************************************************
* Meta Information *
*********************************************************************************/
//About DLL
LANGUAGE_NAME = 1,
LANGUAGE_AUTHOR =2,
LANGUAGE_VERSION =3,
LANGUAGE_DATE =4,
/*********************************************************************************
* Meta Information *
*********************************************************************************/
//About DLL
LANGUAGE_NAME = 1,
LANGUAGE_AUTHOR = 2,
LANGUAGE_VERSION = 3,
LANGUAGE_DATE = 4,
//About DLL Dialog
INI_CURRENT_LANG =5,
INI_AUTHOR =6,
INI_VERSION =7,
INI_DATE =8,
INI_HOMEPAGE =9,
INI_CURRENT_RDB =10,
INI_CURRENT_CHT =11,
INI_CURRENT_RDX =12,
//About DLL Dialog
INI_CURRENT_LANG = 5,
INI_AUTHOR = 6,
INI_VERSION = 7,
INI_DATE = 8,
INI_HOMEPAGE = 9,
INI_CURRENT_RDB = 10,
INI_CURRENT_CHT = 11,
INI_CURRENT_RDX = 12,
//About INI title
INI_TITLE =20,
//About INI title
INI_TITLE = 20,
/*********************************************************************************
* Numbers *
*********************************************************************************/
NUMBER_0 =50,
NUMBER_1 = 51,
NUMBER_2 = 52,
NUMBER_3 = 53,
NUMBER_4 = 54,
NUMBER_5 = 55,
NUMBER_6 = 56,
NUMBER_7 = 57,
NUMBER_8 = 58,
NUMBER_9 = 59,
/*********************************************************************************
* Numbers *
*********************************************************************************/
NUMBER_0 = 50,
NUMBER_1 = 51,
NUMBER_2 = 52,
NUMBER_3 = 53,
NUMBER_4 = 54,
NUMBER_5 = 55,
NUMBER_6 = 56,
NUMBER_7 = 57,
NUMBER_8 = 58,
NUMBER_9 = 59,
/*********************************************************************************
* Menu *
*********************************************************************************/
//File Menu
MENU_FILE =100,
MENU_OPEN =101,
MENU_ROM_INFO =102,
MENU_START =103,
MENU_END =104,
MENU_CHOOSE_ROM =105,
MENU_REFRESH =106,
MENU_RECENT_ROM =107,
MENU_RECENT_DIR =108,
MENU_EXIT =109,
/*********************************************************************************
* Menu *
*********************************************************************************/
//File Menu
MENU_FILE = 100,
MENU_OPEN = 101,
MENU_ROM_INFO = 102,
MENU_START = 103,
MENU_END = 104,
MENU_CHOOSE_ROM = 105,
MENU_REFRESH = 106,
MENU_RECENT_ROM = 107,
MENU_RECENT_DIR = 108,
MENU_EXIT = 109,
//System Menu
MENU_SYSTEM =120,
MENU_RESET =121,
MENU_PAUSE =122,
MENU_BITMAP =123,
MENU_LIMIT_FPS =124,
MENU_SAVE =125,
MENU_SAVE_AS =126,
MENU_RESTORE =127,
MENU_LOAD =128,
MENU_CURRENT_SAVE =129,
MENU_CHEAT =130,
MENU_GS_BUTTON =131,
MENU_RESUME =132,
MENU_RESET_SOFT =133, //added in build 1.7.50
MENU_RESET_HARD =134, //added in build 1.7.50
//System Menu
MENU_SYSTEM = 120,
MENU_RESET = 121,
MENU_PAUSE = 122,
MENU_BITMAP = 123,
MENU_LIMIT_FPS = 124,
MENU_SAVE = 125,
MENU_SAVE_AS = 126,
MENU_RESTORE = 127,
MENU_LOAD = 128,
MENU_CURRENT_SAVE = 129,
MENU_CHEAT = 130,
MENU_GS_BUTTON = 131,
MENU_RESUME = 132,
MENU_RESET_SOFT = 133, //added in build 1.7.50
MENU_RESET_HARD = 134, //added in build 1.7.50
//Options Menu
MENU_OPTIONS = 140,
MENU_FULL_SCREEN= 141,
MENU_ON_TOP = 142,
MENU_CONFG_GFX = 143,
MENU_CONFG_AUDIO= 144,
MENU_CONFG_CTRL = 145,
MENU_CONFG_RSP = 146,
MENU_SHOW_CPU = 147,
MENU_SETTINGS = 148,
//Options Menu
MENU_OPTIONS = 140,
MENU_FULL_SCREEN = 141,
MENU_ON_TOP = 142,
MENU_CONFG_GFX = 143,
MENU_CONFG_AUDIO = 144,
MENU_CONFG_CTRL = 145,
MENU_CONFG_RSP = 146,
MENU_SHOW_CPU = 147,
MENU_SETTINGS = 148,
//Debugger Menu
MENU_DEBUGGER = 160,
//Debugger Menu
MENU_DEBUGGER = 160,
//Language Menu
MENU_LANGUAGE = 175,
//Language Menu
MENU_LANGUAGE = 175,
//Help Menu
MENU_HELP = 180,
MENU_ABOUT_INI = 181,
MENU_ABOUT_PJ64 = 182,
MENU_FORUM = 183,
MENU_HOMEPAGE = 184,
//Help Menu
MENU_HELP = 180,
MENU_ABOUT_INI = 181,
MENU_ABOUT_PJ64 = 182,
MENU_FORUM = 183,
MENU_HOMEPAGE = 184,
//Current Save Slot menu
MENU_SLOT_DEFAULT = 190,
MENU_SLOT_1 = 191,
MENU_SLOT_2 = 192,
MENU_SLOT_3 = 193,
MENU_SLOT_4 = 194,
MENU_SLOT_5 = 195,
MENU_SLOT_6 = 196,
MENU_SLOT_7 = 197,
MENU_SLOT_8 = 198,
MENU_SLOT_9 = 199,
MENU_SLOT_10 = 200,
MENU_SLOT_SAVE = 201,
//Current Save Slot menu
MENU_SLOT_DEFAULT = 190,
MENU_SLOT_1 = 191,
MENU_SLOT_2 = 192,
MENU_SLOT_3 = 193,
MENU_SLOT_4 = 194,
MENU_SLOT_5 = 195,
MENU_SLOT_6 = 196,
MENU_SLOT_7 = 197,
MENU_SLOT_8 = 198,
MENU_SLOT_9 = 199,
MENU_SLOT_10 = 200,
//Pop up Menu
POPUP_PLAY = 210,
POPUP_INFO = 211,
POPUP_SETTINGS = 212,
POPUP_CHEATS = 213,
POPUP_GFX_PLUGIN = 214,
//Pop up Menu
POPUP_PLAY = 210,
POPUP_INFO = 211,
POPUP_SETTINGS = 212,
POPUP_CHEATS = 213,
POPUP_GFX_PLUGIN = 214,
//selecting save slot
SAVE_SLOT_DEFAULT = 220,
SAVE_SLOT_1 = 221,
SAVE_SLOT_2 = 222,
SAVE_SLOT_3 = 223,
SAVE_SLOT_4 = 224,
SAVE_SLOT_5 = 225,
SAVE_SLOT_6 = 226,
SAVE_SLOT_7 = 227,
SAVE_SLOT_8 = 228,
SAVE_SLOT_9 = 229,
SAVE_SLOT_10 = 230,
//selecting save slot
SAVE_SLOT_DEFAULT = 220,
SAVE_SLOT_1 = 221,
SAVE_SLOT_2 = 222,
SAVE_SLOT_3 = 223,
SAVE_SLOT_4 = 224,
SAVE_SLOT_5 = 225,
SAVE_SLOT_6 = 226,
SAVE_SLOT_7 = 227,
SAVE_SLOT_8 = 228,
SAVE_SLOT_9 = 229,
SAVE_SLOT_10 = 230,
// Menu Descriptions (TODO: unused ? implement or remove)
MENUDES_OPEN = 250,
MENUDES_ROM_INFO = 251,
MENUDES_START = 252,
MENUDES_END = 253,
MENUDES_CHOOSE_ROM = 254,
MENUDES_REFRESH = 255,
MENUDES_EXIT = 256,
MENUDES_RESET = 257,
MENUDES_PAUSE = 258,
MENUDES_BITMAP = 259,
MENUDES_LIMIT_FPS = 260,
MENUDES_SAVE = 261,
MENUDES_SAVE_AS = 262,
MENUDES_RESTORE = 263,
MENUDES_LOAD = 264,
MENUDES_CHEAT = 265,
MENUDES_GS_BUTTON = 266,
MENUDES_FULL_SCREEN = 267,
MENUDES_ON_TOP = 268,
MENUDES_CONFG_GFX = 269,
MENUDES_CONFG_AUDIO = 270,
MENUDES_CONFG_CTRL = 271,
MENUDES_CONFG_RSP = 272,
MENUDES_SHOW_CPU = 273,
MENUDES_SETTINGS = 274,
MENUDES_USER_MAN = 275,
MENUDES_GAME_FAQ = 276,
MENUDES_ABOUT_INI = 277,
MENUDES_ABOUT_PJ64 = 278,
MENUDES_RECENT_ROM = 279,
MENUDES_RECENT_DIR = 280,
MENUDES_LANGUAGES = 281,
MENUDES_GAME_SLOT = 282,
MENUDES_PLAY_GAME = 283,
MENUDES_GAME_INFO = 284,
MENUDES_GAME_SETTINGS= 285,
MENUDES_GAME_CHEATS = 286,
// Menu Descriptions (TODO: unused ? implement or remove)
MENUDES_OPEN = 250,
MENUDES_ROM_INFO = 251,
MENUDES_START = 252,
MENUDES_END = 253,
MENUDES_CHOOSE_ROM = 254,
MENUDES_REFRESH = 255,
MENUDES_EXIT = 256,
MENUDES_RESET = 257,
MENUDES_PAUSE = 258,
MENUDES_BITMAP = 259,
MENUDES_LIMIT_FPS = 260,
MENUDES_SAVE = 261,
MENUDES_SAVE_AS = 262,
MENUDES_RESTORE = 263,
MENUDES_LOAD = 264,
MENUDES_CHEAT = 265,
MENUDES_GS_BUTTON = 266,
MENUDES_FULL_SCREEN = 267,
MENUDES_ON_TOP = 268,
MENUDES_CONFG_GFX = 269,
MENUDES_CONFG_AUDIO = 270,
MENUDES_CONFG_CTRL = 271,
MENUDES_CONFG_RSP = 272,
MENUDES_SHOW_CPU = 273,
MENUDES_SETTINGS = 274,
MENUDES_USER_MAN = 275,
MENUDES_GAME_FAQ = 276,
MENUDES_ABOUT_INI = 277,
MENUDES_ABOUT_PJ64 = 278,
MENUDES_RECENT_ROM = 279,
MENUDES_RECENT_DIR = 280,
MENUDES_LANGUAGES = 281,
MENUDES_GAME_SLOT = 282,
MENUDES_PLAY_GAME = 283,
MENUDES_GAME_INFO = 284,
MENUDES_GAME_SETTINGS = 285,
MENUDES_GAME_CHEATS = 286,
/*********************************************************************************
* Rom Browser *
*********************************************************************************/
//Rom Browser Fields
RB_FILENAME = 300,
RB_INTERNALNAME = 301,
RB_GOODNAME = 302,
RB_STATUS = 303,
RB_ROMSIZE = 304,
RB_NOTES_CORE = 305,
RB_NOTES_PLUGIN = 306,
RB_NOTES_USER = 307,
RB_CART_ID = 308,
RB_MANUFACTUER = 309,
RB_COUNTRY = 310,
RB_DEVELOPER = 311,
RB_CRC1 = 312,
RB_CRC2 = 313,
RB_CICCHIP = 314,
RB_RELEASE_DATE = 315,
RB_GENRE = 316,
RB_PLAYERS = 317,
RB_FORCE_FEEDBACK = 318,
RB_FILE_FORMAT = 319,
/*********************************************************************************
* Rom Browser *
*********************************************************************************/
//Rom Browser Fields
RB_FILENAME = 300,
RB_INTERNALNAME = 301,
RB_GOODNAME = 302,
RB_STATUS = 303,
RB_ROMSIZE = 304,
RB_NOTES_CORE = 305,
RB_NOTES_PLUGIN = 306,
RB_NOTES_USER = 307,
RB_CART_ID = 308,
RB_MANUFACTUER = 309,
RB_COUNTRY = 310,
RB_DEVELOPER = 311,
RB_CRC1 = 312,
RB_CRC2 = 313,
RB_CICCHIP = 314,
RB_RELEASE_DATE = 315,
RB_GENRE = 316,
RB_PLAYERS = 317,
RB_FORCE_FEEDBACK = 318,
RB_FILE_FORMAT = 319,
//Select Rom
SELECT_ROM_DIR = 320,
//Select Rom
SELECT_ROM_DIR = 320,
//Messages
RB_NOT_GOOD_FILE = 340,
//Messages
RB_NOT_GOOD_FILE = 340,
/*********************************************************************************
* Options *
*********************************************************************************/
//Options Title
OPTIONS_TITLE = 400,
/*********************************************************************************
* Options *
*********************************************************************************/
//Options Title
OPTIONS_TITLE = 400,
//Tabs
TAB_PLUGIN = 401,
TAB_DIRECTORY = 402,
TAB_OPTIONS = 403,
TAB_ROMSELECTION = 404,
TAB_ADVANCED = 405,
TAB_ROMSETTINGS = 406,
TAB_SHELLINTERGATION= 407,
TAB_ROMNOTES = 408,
TAB_SHORTCUTS = 409,
TAB_ROMSTATUS = 410,
TAB_RECOMPILER = 411, //Added in 1.7.0.50
//Tabs
TAB_PLUGIN = 401,
TAB_DIRECTORY = 402,
TAB_OPTIONS = 403,
TAB_ROMSELECTION = 404,
TAB_ADVANCED = 405,
TAB_ROMSETTINGS = 406,
TAB_SHELLINTERGATION = 407,
TAB_ROMNOTES = 408,
TAB_SHORTCUTS = 409,
TAB_ROMSTATUS = 410,
TAB_RECOMPILER = 411, //Added in 1.7.0.50
//Plugin Dialog
PLUG_ABOUT = 420,
PLUG_RSP = 421,
PLUG_GFX = 422,
PLUG_AUDIO = 423,
PLUG_CTRL = 424,
PLUG_HLE_GFX = 425,
PLUG_HLE_AUDIO = 426,
PLUG_DEFAULT = 427,
//Plugin Dialog
PLUG_ABOUT = 420,
PLUG_RSP = 421,
PLUG_GFX = 422,
PLUG_AUDIO = 423,
PLUG_CTRL = 424,
PLUG_HLE_GFX = 425,
PLUG_HLE_AUDIO = 426,
PLUG_DEFAULT = 427,
//Directory Dialog
DIR_PLUGIN = 440,
DIR_ROM = 441,
DIR_AUTO_SAVE = 442,
DIR_INSTANT_SAVE = 443,
DIR_SCREEN_SHOT = 444,
DIR_ROM_DEFAULT = 445,
DIR_SELECT_PLUGIN = 446,
DIR_SELECT_ROM = 447,
DIR_SELECT_AUTO = 448,
DIR_SELECT_INSTANT = 449,
DIR_SELECT_SCREEN = 450,
DIR_TEXTURE = 451,
DIR_SELECT_TEXTURE = 452,
//Directory Dialog
DIR_PLUGIN = 440,
DIR_ROM = 441,
DIR_AUTO_SAVE = 442,
DIR_INSTANT_SAVE = 443,
DIR_SCREEN_SHOT = 444,
DIR_ROM_DEFAULT = 445,
DIR_SELECT_PLUGIN = 446,
DIR_SELECT_ROM = 447,
DIR_SELECT_AUTO = 448,
DIR_SELECT_INSTANT = 449,
DIR_SELECT_SCREEN = 450,
DIR_TEXTURE = 451,
DIR_SELECT_TEXTURE = 452,
//Options (general) Tab
OPTION_AUTO_SLEEP =460,
OPTION_AUTO_FULLSCREEN =461,
OPTION_BASIC_MODE =462,
OPTION_REMEMBER_CHEAT =463,
OPTION_DISABLE_SS =464,
OPTION_DISPLAY_FR =465,
OPTION_CHANGE_FR =466,
OPTION_CHECK_RUNNING =467,
//Options (general) Tab
OPTION_AUTO_SLEEP = 460,
OPTION_AUTO_FULLSCREEN = 461,
OPTION_BASIC_MODE = 462,
OPTION_REMEMBER_CHEAT = 463,
OPTION_DISABLE_SS = 464,
OPTION_DISPLAY_FR = 465,
OPTION_CHANGE_FR = 466,
OPTION_CHECK_RUNNING = 467,
//Rom Browser Tab
RB_MAX_ROMS = 480,
RB_ROMS = 481,
RB_MAX_DIRS = 482,
RB_DIRS = 483,
RB_USE = 484,
RB_DIR_RECURSION = 485,
RB_AVALIABLE_FIELDS = 486,
RB_SHOW_FIELDS = 487,
RB_ADD = 488,
RB_REMOVE = 489,
RB_UP = 490,
RB_DOWN = 491,
RB_REFRESH = 492,
//Rom Browser Tab
RB_MAX_ROMS = 480,
RB_ROMS = 481,
RB_MAX_DIRS = 482,
RB_DIRS = 483,
RB_USE = 484,
RB_DIR_RECURSION = 485,
RB_AVALIABLE_FIELDS = 486,
RB_SHOW_FIELDS = 487,
RB_ADD = 488,
RB_REMOVE = 489,
RB_UP = 490,
RB_DOWN = 491,
RB_REFRESH = 492,
//Advanced Options
ADVANCE_INFO = 500,
ADVANCE_DEFAULTS = 501,
ADVANCE_CPU_STYLE = 502,
ADVANCE_SMCM = 503,
ADVANCE_MEM_SIZE = 504,
ADVANCE_ABL = 505,
ADVANCE_AUTO_START = 506,
ADVANCE_OVERWRITE = 507,
ADVANCE_COMPRESS = 508,
ADVANCE_DEBUGGER = 509,
ADVANCE_SMM_CACHE = 510,
ADVANCE_SMM_PIDMA = 511,
ADVANCE_SMM_VALIDATE= 512,
ADVANCE_SMM_PROTECT = 513,
ADVANCE_SMM_TLB = 514,
//Advanced Options
ADVANCE_INFO = 500,
ADVANCE_DEFAULTS = 501,
ADVANCE_CPU_STYLE = 502,
ADVANCE_SMCM = 503,
ADVANCE_MEM_SIZE = 504,
ADVANCE_ABL = 505,
ADVANCE_AUTO_START = 506,
ADVANCE_OVERWRITE = 507,
ADVANCE_COMPRESS = 508,
ADVANCE_DEBUGGER = 509,
ADVANCE_SMM_CACHE = 510,
ADVANCE_SMM_PIDMA = 511,
ADVANCE_SMM_VALIDATE = 512,
ADVANCE_SMM_PROTECT = 513,
ADVANCE_SMM_TLB = 514,
//Rom Options
ROM_CPU_STYLE = 520,
ROM_VIREFRESH = 521,
ROM_MEM_SIZE = 522,
ROM_ABL = 523,
ROM_SAVE_TYPE = 524,
ROM_COUNTER_FACTOR = 525,
ROM_LARGE_BUFFER = 526,
ROM_USE_TLB = 527,
ROM_REG_CACHE = 528,
ROM_DELAY_SI = 529,
ROM_FAST_SP = 530,
ROM_DEFAULT = 531,
ROM_AUDIO_SIGNAL = 532,
ROM_FIXED_AUDIO = 533,
ROM_FUNC_FIND = 534,
ROM_CUSTOM_SMM = 535,
ROM_SYNC_AUDIO = 536,
ROM_COUNTPERBYTE = 537,
ROM_32BIT = 538,
ROM_DELAY_DP = 539,
//Rom Options
ROM_CPU_STYLE = 520,
ROM_VIREFRESH = 521,
ROM_MEM_SIZE = 522,
ROM_ABL = 523,
ROM_SAVE_TYPE = 524,
ROM_COUNTER_FACTOR = 525,
ROM_LARGE_BUFFER = 526,
ROM_USE_TLB = 527,
ROM_REG_CACHE = 528,
ROM_DELAY_SI = 529,
ROM_FAST_SP = 530,
ROM_DEFAULT = 531,
ROM_AUDIO_SIGNAL = 532,
ROM_FIXED_AUDIO = 533,
ROM_FUNC_FIND = 534,
ROM_CUSTOM_SMM = 535,
ROM_SYNC_AUDIO = 536,
ROM_COUNTPERBYTE = 537,
ROM_32BIT = 538,
ROM_DELAY_DP = 539,
//Core Styles
CORE_INTERPTER = 540,
CORE_RECOMPILER = 541,
CORE_SYNC = 542,
//Core Styles
CORE_INTERPTER = 540,
CORE_RECOMPILER = 541,
CORE_SYNC = 542,
//Self Mod Methods
SMCM_NONE = 560,
SMCM_CACHE = 561,
SMCM_PROECTED = 562,
SMCM_CHECK_MEM = 563,
SMCM_CHANGE_MEM = 564,
SMCM_CHECK_ADV = 565,
SMCM_CACHE2 = 566,
//Self Mod Methods
SMCM_NONE = 560,
SMCM_CACHE = 561,
SMCM_PROECTED = 562,
SMCM_CHECK_MEM = 563,
SMCM_CHANGE_MEM = 564,
SMCM_CHECK_ADV = 565,
SMCM_CACHE2 = 566,
//Function Lookup memthod
FLM_PLOOKUP = 570,
FLM_VLOOKUP = 571,
FLM_CHANGEMEM = 572,
//Function Lookup memthod
FLM_PLOOKUP = 570,
FLM_VLOOKUP = 571,
FLM_CHANGEMEM = 572,
//RDRAM Size
RDRAM_4MB = 580,
RDRAM_8MB = 581,
//RDRAM Size
RDRAM_4MB = 580,
RDRAM_8MB = 581,
//Advanced Block Linking
ABL_ON = 600,
ABL_OFF = 601,
//Advanced Block Linking
ABL_ON = 600,
ABL_OFF = 601,
//Save Type
SAVE_FIRST_USED = 620,
SAVE_4K_EEPROM = 621,
SAVE_16K_EEPROM = 622,
SAVE_SRAM = 623,
SAVE_FLASHRAM = 624,
//Save Type
SAVE_FIRST_USED = 620,
SAVE_4K_EEPROM = 621,
SAVE_16K_EEPROM = 622,
SAVE_SRAM = 623,
SAVE_FLASHRAM = 624,
//Shell Integration Tab
SHELL_TEXT = 640,
//Shell Integration Tab
SHELL_TEXT = 640,
//Rom Notes
NOTE_STATUS = 660,
NOTE_CORE = 661,
NOTE_PLUGIN = 662,
//Rom Notes
NOTE_STATUS = 660,
NOTE_CORE = 661,
NOTE_PLUGIN = 662,
// Accelerator Selector
ACCEL_CPUSTATE_TITLE = 680,
ACCEL_MENUITEM_TITLE = 681,
ACCEL_CURRENTKEYS_TITLE = 682,
ACCEL_SELKEY_TITLE = 683,
ACCEL_ASSIGNEDTO_TITLE = 684,
ACCEL_ASSIGN_BTN = 685,
ACCEL_REMOVE_BTN = 686,
ACCEL_RESETALL_BTN = 687,
ACCEL_CPUSTATE_1 = 688,
ACCEL_CPUSTATE_2 = 689,
ACCEL_CPUSTATE_3 = 690,
ACCEL_CPUSTATE_4 = 691,
ACCEL_DETECTKEY = 692,
// Accelerator Selector
ACCEL_CPUSTATE_TITLE = 680,
ACCEL_MENUITEM_TITLE = 681,
ACCEL_CURRENTKEYS_TITLE = 682,
ACCEL_SELKEY_TITLE = 683,
ACCEL_ASSIGNEDTO_TITLE = 684,
ACCEL_ASSIGN_BTN = 685,
ACCEL_REMOVE_BTN = 686,
ACCEL_RESETALL_BTN = 687,
ACCEL_CPUSTATE_1 = 688,
ACCEL_CPUSTATE_2 = 689,
ACCEL_CPUSTATE_3 = 690,
ACCEL_CPUSTATE_4 = 691,
ACCEL_DETECTKEY = 692,
// Frame Rate Option
STR_FR_VIS = 700,
STR_FR_DLS = 701,
STR_FR_PERCENT = 702,
// Frame Rate Option
STR_FR_VIS = 700,
STR_FR_DLS = 701,
STR_FR_PERCENT = 702,
// Increase speed
STR_INSREASE_SPEED = 710,
STR_DECREASE_SPEED = 711,
// Increase speed
STR_INSREASE_SPEED = 710,
STR_DECREASE_SPEED = 711,
//Bottom page buttons
BOTTOM_RESET_PAGE = 720,
BOTTOM_RESET_ALL = 721,
BOTTOM_APPLY = 722,
BOTTOM_CLOSE = 723,
//Bottom page buttons
BOTTOM_RESET_PAGE = 720,
BOTTOM_RESET_ALL = 721,
BOTTOM_APPLY = 722,
BOTTOM_CLOSE = 723,
/*********************************************************************************
* ROM Information *
*********************************************************************************/
//Rom Info Title Title
INFO_TITLE = 800,
/*********************************************************************************
* ROM Information *
*********************************************************************************/
//Rom Info Title Title
INFO_TITLE = 800,
//Rom Info Text
INFO_ROM_NAME_TEXT = 801,
INFO_FILE_NAME_TEXT = 802,
INFO_LOCATION_TEXT = 803,
INFO_SIZE_TEXT = 804,
INFO_CART_ID_TEXT = 805,
INFO_MANUFACTURER_TEXT= 806,
INFO_COUNTRY_TEXT = 807,
INFO_CRC1_TEXT = 808,
INFO_CRC2_TEXT = 809,
INFO_CIC_CHIP_TEXT = 810,
INFO_MD5_TEXT = 811,
//Rom Info Text
INFO_ROM_NAME_TEXT = 801,
INFO_FILE_NAME_TEXT = 802,
INFO_LOCATION_TEXT = 803,
INFO_SIZE_TEXT = 804,
INFO_CART_ID_TEXT = 805,
INFO_MANUFACTURER_TEXT = 806,
INFO_COUNTRY_TEXT = 807,
INFO_CRC1_TEXT = 808,
INFO_CRC2_TEXT = 809,
INFO_CIC_CHIP_TEXT = 810,
INFO_MD5_TEXT = 811,
/*********************************************************************************
* Cheats *
*********************************************************************************/
//Cheat List
CHEAT_TITLE = 1000,
CHEAT_LIST_FRAME = 1001,
CHEAT_NOTES_FRAME = 1002,
CHEAT_MARK_ALL = 1003,
CHEAT_MARK_NONE = 1004,
/*********************************************************************************
* Cheats *
*********************************************************************************/
//Cheat List
CHEAT_TITLE = 1000,
CHEAT_LIST_FRAME = 1001,
CHEAT_NOTES_FRAME = 1002,
CHEAT_MARK_ALL = 1003,
CHEAT_MARK_NONE = 1004,
//Add Cheat
CHEAT_ADDCHEAT_FRAME =1005,
CHEAT_ADDCHEAT_NAME =1006,
CHEAT_ADDCHEAT_CODE = 1007,
CHEAT_ADDCHEAT_INSERT= 1008,
CHEAT_ADDCHEAT_CLEAR= 1009,
CHEAT_ADDCHEAT_NOTES= 1010,
CHEAT_ADD_TO_DB = 1011,
//Add Cheat
CHEAT_ADDCHEAT_FRAME = 1005,
CHEAT_ADDCHEAT_NAME = 1006,
CHEAT_ADDCHEAT_CODE = 1007,
CHEAT_ADDCHEAT_INSERT = 1008,
CHEAT_ADDCHEAT_CLEAR = 1009,
CHEAT_ADDCHEAT_NOTES = 1010,
CHEAT_ADD_TO_DB = 1011,
//Code extension
CHEAT_CODE_EXT_TITLE =1012,
CHEAT_CODE_EXT_TXT =1013,
CHEAT_OK =1014,
CHEAT_CANCEL =1015,
//Code extension
CHEAT_CODE_EXT_TITLE = 1012,
CHEAT_CODE_EXT_TXT = 1013,
CHEAT_OK = 1014,
CHEAT_CANCEL = 1015,
//Digital Value
CHEAT_QUANTITY_TITLE =1016,
CHEAT_CHOOSE_VALUE =1017,
CHEAT_VALUE =1018,
CHEAT_FROM =1019,
CHEAT_TO =1020,
CHEAT_NOTES =1021,
CHEAT_ADDCHEAT_ADD = 1022,
CHEAT_ADDCHEAT_NEW = 1023,
CHEAT_ADDCHEAT_CODEDES =1024,
CHEAT_ADDCHEAT_OPT =1025,
CHEAT_ADDCHEAT_OPTDES =1026,
//Digital Value
CHEAT_QUANTITY_TITLE = 1016,
CHEAT_CHOOSE_VALUE = 1017,
CHEAT_VALUE = 1018,
CHEAT_FROM = 1019,
CHEAT_TO = 1020,
CHEAT_NOTES = 1021,
CHEAT_ADDCHEAT_ADD = 1022,
CHEAT_ADDCHEAT_NEW = 1023,
CHEAT_ADDCHEAT_CODEDES = 1024,
CHEAT_ADDCHEAT_OPT = 1025,
CHEAT_ADDCHEAT_OPTDES = 1026,
//Edit Cheat
CHEAT_EDITCHEAT_WINDOW =1027,
CHEAT_EDITCHEAT_UPDATE =1028,
CHEAT_CHANGED_MSG =1029,
CHEAT_CHANGED_TITLE =1030,
//Edit Cheat
CHEAT_EDITCHEAT_WINDOW = 1027,
CHEAT_EDITCHEAT_UPDATE = 1028,
CHEAT_CHANGED_MSG = 1029,
CHEAT_CHANGED_TITLE = 1030,
//Cheat Popup Menu
CHEAT_ADDNEW =1040,
CHEAT_EDIT = 1041,
CHEAT_DELETE = 1042,
//Cheat Popup Menu
CHEAT_ADDNEW = 1040,
CHEAT_EDIT = 1041,
CHEAT_DELETE = 1042,
// short cut editor
STR_SHORTCUT_RESET_TITLE = 1100,
STR_SHORTCUT_RESET_TEXT = 1101,
STR_SHORTCUT_FILEMENU = 1102,
STR_SHORTCUT_SYSTEMMENU = 1103,
STR_SHORTCUT_OPTIONS = 1104,
STR_SHORTCUT_SAVESLOT = 1105,
// short cut editor
STR_SHORTCUT_RESET_TITLE = 1100,
STR_SHORTCUT_RESET_TEXT = 1101,
STR_SHORTCUT_FILEMENU = 1102,
STR_SHORTCUT_SYSTEMMENU = 1103,
STR_SHORTCUT_OPTIONS = 1104,
STR_SHORTCUT_SAVESLOT = 1105,
/*********************************************************************************
* Messages *
*********************************************************************************/
MSG_CPU_PAUSED = 2000,
MSG_CPU_RESUMED = 2001,
MSG_PERM_LOOP = 2002,
MSG_MEM_ALLOC_ERROR = 2003,
MSG_FAIL_INIT_GFX = 2004,
MSG_FAIL_INIT_AUDIO = 2005,
MSG_FAIL_INIT_RSP = 2006,
MSG_FAIL_INIT_CONTROL = 2007,
MSG_FAIL_LOAD_PLUGIN = 2008,
MSG_FAIL_LOAD_WORD = 2009,
MSG_FAIL_OPEN_SAVE = 2010,
MSG_FAIL_OPEN_EEPROM = 2011,
MSG_FAIL_OPEN_FLASH = 2012,
MSG_FAIL_OPEN_MEMPAK = 2013,
MSG_FAIL_OPEN_ZIP = 2014,
MSG_FAIL_OPEN_IMAGE = 2015,
MSG_FAIL_ZIP = 2016,
MSG_FAIL_IMAGE = 2017,
MSG_UNKNOWN_COUNTRY = 2018,
MSG_UNKNOWN_CIC_CHIP = 2019,
MSG_UNKNOWN_FILE_FORMAT= 2020,
MSG_UNKNOWN_MEM_ACTION = 2021,
MSG_UNHANDLED_OP = 2022,
MSG_NONMAPPED_SPACE = 2023,
MSG_SAVE_STATE_HEADER = 2024,
MSG_MSGBOX_TITLE =2025,
MSG_PIF2_ERROR = 2026,
MSG_PIF2_TITLE = 2027,
MSG_PLUGIN_CHANGE = 2028,
MSG_PLUGIN_CHANGE_TITLE= 2029,
MSG_EMULATION_ENDED = 2030,
MSG_EMULATION_STARTED = 2031,
MSG_UNABLED_LOAD_STATE = 2032,
MSG_LOADED_STATE = 2033,
MSG_SAVED_STATE = 2034,
MSG_SAVE_SLOT = 2035,
MSG_BYTESWAP =2036,
MSG_CHOOSE_IMAGE = 2037,
MSG_LOADED = 2038,
MSG_LOADING = 2039,
MSG_PLUGIN_NOT_INIT = 2040,
MSG_DEL_SURE = 2041,
MSG_DEL_TITLE = 2042,
MSG_CHEAT_NAME_IN_USE = 2043,
MSG_MAX_CHEATS = 2044,
MSG_PLUGIN_INIT = 2045, //Added in pj64 1.6
MSG_NO_SHORTCUT_SEL = 2046, //Added in pj64 1.6
MSG_NO_MENUITEM_SEL = 2047, //Added in pj64 1.6
MSG_MENUITEM_ASSIGNED = 2048, //Added in pj64 1.6
MSG_NO_SEL_SHORTCUT = 2049, //Added in pj64 1.6
MSG_WAITING_FOR_START = 2050, //Added in pj64 1.7
MSG_INVALID_EXE = 2051, //Added in pj64 1.7
MSG_INVALID_EXE_TITLE = 2052, //Added in pj64 1.7
MSG_7Z_FILE_NOT_FOUND = 2053, //Added in pj64 1.7
MSG_SET_LLE_GFX_TITLE = 2054, //Added in pj64 1.7
MSG_SET_LLE_GFX_MSG = 2055, //Added in pj64 1.7
MSG_SET_HLE_AUD_TITLE = 2056, //Added in pj64 1.7
MSG_SET_HLE_AUD_MSG = 2057, //Added in pj64 1.7
/*********************************************************************************
* Messages *
*********************************************************************************/
MSG_CPU_PAUSED = 2000,
MSG_CPU_RESUMED = 2001,
MSG_PERM_LOOP = 2002,
MSG_MEM_ALLOC_ERROR = 2003,
MSG_FAIL_INIT_GFX = 2004,
MSG_FAIL_INIT_AUDIO = 2005,
MSG_FAIL_INIT_RSP = 2006,
MSG_FAIL_INIT_CONTROL = 2007,
MSG_FAIL_LOAD_PLUGIN = 2008,
MSG_FAIL_LOAD_WORD = 2009,
MSG_FAIL_OPEN_SAVE = 2010,
MSG_FAIL_OPEN_EEPROM = 2011,
MSG_FAIL_OPEN_FLASH = 2012,
MSG_FAIL_OPEN_MEMPAK = 2013,
MSG_FAIL_OPEN_ZIP = 2014,
MSG_FAIL_OPEN_IMAGE = 2015,
MSG_FAIL_ZIP = 2016,
MSG_FAIL_IMAGE = 2017,
MSG_UNKNOWN_COUNTRY = 2018,
MSG_UNKNOWN_CIC_CHIP = 2019,
MSG_UNKNOWN_FILE_FORMAT = 2020,
MSG_UNKNOWN_MEM_ACTION = 2021,
MSG_UNHANDLED_OP = 2022,
MSG_NONMAPPED_SPACE = 2023,
MSG_SAVE_STATE_HEADER = 2024,
MSG_MSGBOX_TITLE = 2025,
MSG_PIF2_ERROR = 2026,
MSG_PIF2_TITLE = 2027,
MSG_PLUGIN_CHANGE = 2028,
MSG_PLUGIN_CHANGE_TITLE = 2029,
MSG_EMULATION_ENDED = 2030,
MSG_EMULATION_STARTED = 2031,
MSG_UNABLED_LOAD_STATE = 2032,
MSG_LOADED_STATE = 2033,
MSG_SAVED_STATE = 2034,
MSG_SAVE_SLOT = 2035,
MSG_BYTESWAP = 2036,
MSG_CHOOSE_IMAGE = 2037,
MSG_LOADED = 2038,
MSG_LOADING = 2039,
MSG_PLUGIN_NOT_INIT = 2040,
MSG_DEL_SURE = 2041,
MSG_DEL_TITLE = 2042,
MSG_CHEAT_NAME_IN_USE = 2043,
MSG_MAX_CHEATS = 2044,
MSG_PLUGIN_INIT = 2045, //Added in pj64 1.6
MSG_NO_SHORTCUT_SEL = 2046, //Added in pj64 1.6
MSG_NO_MENUITEM_SEL = 2047, //Added in pj64 1.6
MSG_MENUITEM_ASSIGNED = 2048, //Added in pj64 1.6
MSG_NO_SEL_SHORTCUT = 2049, //Added in pj64 1.6
MSG_WAITING_FOR_START = 2050, //Added in pj64 1.7
MSG_INVALID_EXE = 2051, //Added in pj64 1.7
MSG_INVALID_EXE_TITLE = 2052, //Added in pj64 1.7
MSG_7Z_FILE_NOT_FOUND = 2053, //Added in pj64 1.7
MSG_SET_LLE_GFX_TITLE = 2054, //Added in pj64 1.7
MSG_SET_LLE_GFX_MSG = 2055, //Added in pj64 1.7
MSG_SET_HLE_AUD_TITLE = 2056, //Added in pj64 1.7
MSG_SET_HLE_AUD_MSG = 2057, //Added in pj64 1.7
};
#include ".\\Multilanguage\Language Class.h"

File diff suppressed because it is too large Load Diff

View File

@ -14,8 +14,9 @@
#include <string> //stl string
#include <map> //stl map
#include <list> //stl list
#include <common/stdtypes.h>
typedef std::map<int, std::wstring, std::less<int> > LANG_STRINGS;
typedef std::map<int32_t, std::wstring, std::less<int32_t> > LANG_STRINGS;
typedef LANG_STRINGS::value_type LANG_STR;
struct LanguageFile
@ -29,14 +30,14 @@ typedef std::list<LanguageFile> LanguageList;
class CLanguage
{
public:
CLanguage ();
CLanguage();
const std::wstring & GetString ( LanguageStringID StringID );
LanguageList & GetLangList ( void );
void SetLanguage ( const wchar_t * LanguageName );
bool LoadCurrentStrings ( void );
bool IsCurrentLang ( LanguageFile & File );
bool IsLanguageLoaded ( void ) const { return m_LanguageLoaded; }
const std::wstring & GetString(LanguageStringID StringID);
LanguageList & GetLangList(void);
void SetLanguage(const wchar_t * LanguageName);
bool LoadCurrentStrings(void);
bool IsCurrentLang(LanguageFile & File);
bool IsLanguageLoaded(void) const { return m_LanguageLoaded; }
private:
CLanguage(const CLanguage&); // Disable copy constructor
@ -48,16 +49,16 @@ private:
LANG_STRINGS m_CurrentStrings, m_DefaultStrings;
LanguageList m_LanguageList;
std::wstring GetLangString ( const char * FileName, LanguageStringID ID );
LANG_STR GetNextLangString ( void * OpenFile );
void LoadDefaultStrings ( void );
std::wstring GetLangString(const char * FileName, LanguageStringID ID);
LANG_STR GetNextLangString(void * OpenFile);
void LoadDefaultStrings(void);
bool m_LanguageLoaded;
bool m_LanguageLoaded;
};
extern CLanguage * g_Lang;
inline const wchar_t * GS (LanguageStringID StringID)
inline const wchar_t * GS(LanguageStringID StringID)
{
return g_Lang->GetString(StringID).c_str();
}

View File

@ -13,13 +13,13 @@
class CLanguageSelector
{
public:
CLanguageSelector ();
CLanguageSelector();
void Select ( void );
void Select(void);
private:
CLanguageSelector(const CLanguageSelector&); // Disable copy constructor
CLanguageSelector& operator=(const CLanguageSelector&); // Disable assignment
static LRESULT CALLBACK LangSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK LangSelectProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
};

View File

@ -271,8 +271,8 @@ void CInterpreterCPU::ExecuteCPU()
const int32_t & bDoSomething = g_SystemEvents->DoSomething();
uint32_t CountPerOp = g_System->CountPerOp();
int32_t & NextTimer = *g_NextTimer;
__try
__try
{
while (!Done)
{
@ -301,24 +301,24 @@ void CInterpreterCPU::ExecuteCPU()
PROGRAM_COUNTER += 4;
break;
case JUMP:
{
bool CheckTimer = (JumpToLocation < PROGRAM_COUNTER || TestTimer);
PROGRAM_COUNTER = JumpToLocation;
R4300iOp::m_NextInstruction = NORMAL;
if (CheckTimer)
{
bool CheckTimer = (JumpToLocation < PROGRAM_COUNTER || TestTimer);
PROGRAM_COUNTER = JumpToLocation;
R4300iOp::m_NextInstruction = NORMAL;
if (CheckTimer)
TestTimer = false;
if (NextTimer < 0)
{
TestTimer = false;
if (NextTimer < 0)
{
g_SystemTimer->TimerDone();
}
if (bDoSomething)
{
g_SystemEvents->ExecuteEvents();
}
g_SystemTimer->TimerDone();
}
if (bDoSomething)
{
g_SystemEvents->ExecuteEvents();
}
}
break;
}
break;
case PERMLOOP_DELAY_DONE:
PROGRAM_COUNTER = JumpToLocation;
R4300iOp::m_NextInstruction = NORMAL;
@ -339,7 +339,8 @@ void CInterpreterCPU::ExecuteCPU()
R4300iOp::m_NextInstruction = NORMAL;
}
}
} __except( g_MMU->MemoryFilter( GetExceptionCode(), GetExceptionInformation()) )
}
__except (g_MMU->MemoryFilter(GetExceptionCode(), GetExceptionInformation()))
{
g_Notify->FatalError(GS(MSG_UNKNOWN_MEM_ACTION));
}
@ -355,7 +356,7 @@ void CInterpreterCPU::ExecuteOps(int32_t Cycles)
const int32_t & DoSomething = g_SystemEvents->DoSomething();
uint32_t CountPerOp = g_System->CountPerOp();
__try
__try
{
while (!Done)
{
@ -409,24 +410,24 @@ void CInterpreterCPU::ExecuteOps(int32_t Cycles)
PROGRAM_COUNTER += 4;
break;
case JUMP:
{
bool CheckTimer = (JumpToLocation < PROGRAM_COUNTER || TestTimer);
PROGRAM_COUNTER = JumpToLocation;
R4300iOp::m_NextInstruction = NORMAL;
if (CheckTimer)
{
bool CheckTimer = (JumpToLocation < PROGRAM_COUNTER || TestTimer);
PROGRAM_COUNTER = JumpToLocation;
R4300iOp::m_NextInstruction = NORMAL;
if (CheckTimer)
TestTimer = false;
if (*g_NextTimer < 0)
{
TestTimer = false;
if (*g_NextTimer < 0)
{
g_SystemTimer->TimerDone();
}
if (DoSomething)
{
g_SystemEvents->ExecuteEvents();
}
g_SystemTimer->TimerDone();
}
if (DoSomething)
{
g_SystemEvents->ExecuteEvents();
}
}
break;
}
break;
case PERMLOOP_DELAY_DONE:
PROGRAM_COUNTER = JumpToLocation;
R4300iOp::m_NextInstruction = NORMAL;
@ -448,8 +449,8 @@ void CInterpreterCPU::ExecuteOps(int32_t Cycles)
}
}
}
__except( g_MMU->MemoryFilter( GetExceptionCode(), GetExceptionInformation()) )
__except (g_MMU->MemoryFilter(GetExceptionCode(), GetExceptionInformation()))
{
g_Notify->FatalError(GS(MSG_UNKNOWN_MEM_ACTION));
}
}
}

View File

@ -11,18 +11,18 @@
#pragma once
class CInterpreterCPU :
private R4300iOp
private R4300iOp
{
public:
static void BuildCPU();
static void ExecuteCPU();
static void ExecuteOps(int Cycles);
static void InPermLoop();
static void BuildCPU();
static void ExecuteCPU();
static void ExecuteOps(int Cycles);
static void InPermLoop();
private:
CInterpreterCPU(); // Disable default constructor
CInterpreterCPU(const CInterpreterCPU&); // Disable copy constructor
CInterpreterCPU& operator=(const CInterpreterCPU&); // Disable assignment
CInterpreterCPU(); // Disable default constructor
CInterpreterCPU(const CInterpreterCPU&); // Disable copy constructor
CInterpreterCPU& operator=(const CInterpreterCPU&); // Disable assignment
static R4300iOp::Func * m_R4300i_Opcode;
static R4300iOp::Func * m_R4300i_Opcode;
};

View File

@ -26,7 +26,7 @@ bool DelaySlotEffectsCompare(uint32_t PC, uint32_t Reg1, uint32_t Reg2);
m_NextInstruction = JUMP;\
m_JumpToLocation = (*_PROGRAM_COUNTER);\
return;\
}
}
#define TLB_READ_EXCEPTION(Address) \
g_Reg->DoTLBReadMiss(m_NextInstruction == JUMP,Address);\

View File

@ -11,74 +11,74 @@
#pragma once
class R4300iOp32 :
public R4300iOp
public R4300iOp
{
public:
/************************* OpCode functions *************************/
static void JAL();
static void BEQ();
static void BNE();
static void BLEZ();
static void BGTZ();
static void ADDI();
static void ADDIU();
static void SLTI();
static void SLTIU();
static void ANDI();
static void ORI();
static void XORI();
static void LUI();
static void BEQL();
static void BNEL();
static void BLEZL();
static void BGTZL();
static void LB();
static void LH();
static void LWL();
static void LW();
static void LBU();
static void LHU();
static void LWR();
static void LWU();
static void LL();
/************************* OpCode functions *************************/
static void JAL();
static void BEQ();
static void BNE();
static void BLEZ();
static void BGTZ();
static void ADDI();
static void ADDIU();
static void SLTI();
static void SLTIU();
static void ANDI();
static void ORI();
static void XORI();
static void LUI();
static void BEQL();
static void BNEL();
static void BLEZL();
static void BGTZL();
static void LB();
static void LH();
static void LWL();
static void LW();
static void LBU();
static void LHU();
static void LWR();
static void LWU();
static void LL();
/********************** R4300i OpCodes: Special **********************/
static void SPECIAL_SLL();
static void SPECIAL_SRL();
static void SPECIAL_SRA();
static void SPECIAL_SLLV();
static void SPECIAL_SRLV();
static void SPECIAL_SRAV();
static void SPECIAL_JALR();
static void SPECIAL_ADD();
static void SPECIAL_ADDU();
static void SPECIAL_SUB();
static void SPECIAL_SUBU();
static void SPECIAL_AND();
static void SPECIAL_OR();
static void SPECIAL_NOR();
static void SPECIAL_SLT();
static void SPECIAL_SLTU();
static void SPECIAL_TEQ();
static void SPECIAL_DSRL32();
static void SPECIAL_DSRA32();
/********************** R4300i OpCodes: Special **********************/
static void SPECIAL_SLL();
static void SPECIAL_SRL();
static void SPECIAL_SRA();
static void SPECIAL_SLLV();
static void SPECIAL_SRLV();
static void SPECIAL_SRAV();
static void SPECIAL_JALR();
static void SPECIAL_ADD();
static void SPECIAL_ADDU();
static void SPECIAL_SUB();
static void SPECIAL_SUBU();
static void SPECIAL_AND();
static void SPECIAL_OR();
static void SPECIAL_NOR();
static void SPECIAL_SLT();
static void SPECIAL_SLTU();
static void SPECIAL_TEQ();
static void SPECIAL_DSRL32();
static void SPECIAL_DSRA32();
/********************** R4300i OpCodes: RegImm **********************/
static void REGIMM_BLTZ();
static void REGIMM_BGEZ();
static void REGIMM_BLTZL();
static void REGIMM_BGEZL();
static void REGIMM_BLTZAL();
static void REGIMM_BGEZAL();
/********************** R4300i OpCodes: RegImm **********************/
static void REGIMM_BLTZ();
static void REGIMM_BGEZ();
static void REGIMM_BLTZL();
static void REGIMM_BGEZL();
static void REGIMM_BLTZAL();
static void REGIMM_BGEZAL();
/************************** COP0 functions **************************/
static void COP0_MF();
static void COP0_MT();
/************************** COP0 functions **************************/
static void COP0_MF();
static void COP0_MT();
/************************** COP1 functions **************************/
static void COP1_MF();
static void COP1_CF();
static void COP1_DMT();
/************************** COP1 functions **************************/
static void COP1_MF();
static void COP1_CF();
static void COP1_DMT();
static Func* BuildInterpreter();
static Func* BuildInterpreter();
};

View File

@ -54,7 +54,7 @@ const int32_t R4300iOp::LWR_SHIFT[4] = { 24, 16, 8, 0 };
m_NextInstruction = JUMP;\
m_JumpToLocation = (*_PROGRAM_COUNTER);\
return;\
}
}
#define TLB_READ_EXCEPTION(Address) \
g_Reg->DoTLBReadMiss(m_NextInstruction == JUMP,Address);\
@ -902,7 +902,7 @@ void R4300iOp::LUI()
if (m_Opcode.rt == 29)
{
StackValue = _GPR[m_Opcode.rt].W[0];
}
}
#endif
}
@ -1866,7 +1866,7 @@ void R4300iOp::SPECIAL_OR()
if (m_Opcode.rd == 29)
{
StackValue = _GPR[m_Opcode.rd].W[0];
}
}
#endif
}
@ -2363,7 +2363,7 @@ __inline void Float_RoundToInteger32(int32_t * Dest, float * Source)
xmm = _mm_load_ss(Source);
*(Dest) = _mm_cvt_ss2si(xmm);
#endif
}
}
__inline void Float_RoundToInteger64(int64_t * Dest, float * Source)
{
@ -2381,7 +2381,7 @@ __inline void Float_RoundToInteger64(int64_t * Dest, float * Source)
xmm = _mm_load_ss(Source);
*(Dest) = _mm_cvtss_si64(xmm);
#endif
}
}
void R4300iOp::COP1_S_ADD()
{
@ -2436,7 +2436,7 @@ void R4300iOp::COP1_S_SQRT()
xmm = _mm_sqrt_ss(xmm);
*(Dest) = _mm_cvtss_f32(xmm);
#endif
}
}
void R4300iOp::COP1_S_ABS()
{
@ -2594,7 +2594,7 @@ __inline void Double_RoundToInteger32(uint32_t * Dest, double * Source)
xmm = _mm_load_sd(Source);
*(Dest) = _mm_cvtsd_si32(xmm);
#endif
}
}
__inline void Double_RoundToInteger64(uint64_t * Dest, double * Source)
{
@ -2612,7 +2612,7 @@ __inline void Double_RoundToInteger64(uint64_t * Dest, double * Source)
xmm = _mm_load_sd(Source);
*(Dest) = _mm_cvtsd_si64(xmm);
#endif
}
}
void R4300iOp::COP1_D_ADD()
{
@ -2825,7 +2825,7 @@ void R4300iOp::UnknownOpcode()
R4300iOpcodeName(m_Opcode.Hex, (*_PROGRAM_COUNTER))).ToUTF16().c_str());
g_System->m_EndEmulation = true;
g_Notify->BreakPoint(__FILEW__,__LINE__);
g_Notify->BreakPoint(__FILEW__, __LINE__);
#ifdef tofix
if (HaveDebugger && !inFullScreen)
{
@ -2839,6 +2839,6 @@ void R4300iOp::UnknownOpcode()
Enter_R4300i_Commands_Window ();
}
ExitThread(0);
}
}
#endif
}

View File

@ -375,6 +375,11 @@ void CN64System::StartEmulation(bool NewThread)
void CN64System::StartEmulationThread(ThreadInfo * Info)
{
if (g_Settings->LoadBool(Setting_CN64TimeCritical))
{
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_TIME_CRITICAL);
}
CoInitialize(NULL);
EmulationStarting(*Info->ThreadHandle, Info->ThreadID);
@ -2030,4 +2035,4 @@ void CN64System::TLB_Changed()
{
g_Debugger->TLBChanged();
}
}
}

View File

@ -182,7 +182,11 @@ void CAudioPlugin::DacrateChanged(SYSTEM_TYPE Type)
void CAudioPlugin::AudioThread(CAudioPlugin * _this) {
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
for (;;)
if (g_Settings->LoadBool(Setting_CN64TimeCritical))
{
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_HIGHEST);
}
for (;;)
{
_this->AiUpdate(true);
}

View File

@ -145,6 +145,10 @@
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath=".\AppInit.cpp"
>
</File>
<File
RelativePath=".\Logging.cpp"
>
@ -797,6 +801,10 @@
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath=".\AppInit.h"
>
</File>
<File
RelativePath=".\Logging.h"
>

View File

@ -44,6 +44,7 @@
</Manifest>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="AppInit.cpp" />
<ClCompile Include="logging.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="Multilanguage\LanguageSelector.cpp" />
@ -178,6 +179,7 @@
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="AppInit.h" />
<ClInclude Include="Logging.h" />
<ClInclude Include="Multilanguage.h" />
<ClInclude Include="Multilanguage\LanguageSelector.h" />

View File

@ -426,6 +426,9 @@
<ClCompile Include="Settings\Logging Settings.cpp">
<Filter>Source Files\N64 System Source</Filter>
</ClCompile>
<ClCompile Include="AppInit.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="User Interface\Icons\left.ico">
@ -845,5 +848,8 @@
<ClInclude Include="Settings\Logging Settings.h">
<Filter>Header Files\Settings Headers</Filter>
</ClInclude>
<ClInclude Include="AppInit.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -9,8 +9,9 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "Debug Settings.h"
int CDebugSettings::m_RefCount = 0;
int CDebugSettings::m_RefCount = 0;
bool CDebugSettings::m_bHaveDebugger = false;
bool CDebugSettings::m_bLogX86Code = false;
@ -20,35 +21,35 @@ bool CDebugSettings::m_Registered = false;
CDebugSettings::CDebugSettings()
{
m_RefCount += 1;
if (!m_Registered && g_Settings)
{
m_Registered = true;
g_Settings->RegisterChangeCB(Debugger_Enabled,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->RegisterChangeCB(Debugger_GenerateLogFiles,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->RegisterChangeCB(Debugger_ShowTLBMisses,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->RegisterChangeCB(Debugger_ShowDivByZero,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
RefreshSettings();
}
m_RefCount += 1;
if (!m_Registered && g_Settings)
{
m_Registered = true;
g_Settings->RegisterChangeCB(Debugger_Enabled, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->RegisterChangeCB(Debugger_GenerateLogFiles, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->RegisterChangeCB(Debugger_ShowTLBMisses, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->RegisterChangeCB(Debugger_ShowDivByZero, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
RefreshSettings();
}
}
CDebugSettings::~CDebugSettings()
{
m_RefCount -= 1;
if (m_RefCount == 0 && g_Settings)
{
g_Settings->UnregisterChangeCB(Debugger_Enabled,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->UnregisterChangeCB(Debugger_GenerateLogFiles,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->UnregisterChangeCB(Debugger_ShowTLBMisses,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->UnregisterChangeCB(Debugger_ShowDivByZero,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
}
m_RefCount -= 1;
if (m_RefCount == 0 && g_Settings)
{
g_Settings->UnregisterChangeCB(Debugger_Enabled, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->UnregisterChangeCB(Debugger_GenerateLogFiles, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->UnregisterChangeCB(Debugger_ShowTLBMisses, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->UnregisterChangeCB(Debugger_ShowDivByZero, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
}
}
void CDebugSettings::RefreshSettings()
{
m_bHaveDebugger = g_Settings->LoadBool(Debugger_Enabled);
m_bLogX86Code = m_bHaveDebugger && g_Settings->LoadBool(Debugger_GenerateLogFiles);
m_bShowTLBMisses = m_bHaveDebugger && g_Settings->LoadBool(Debugger_ShowTLBMisses);
m_bShowDivByZero = m_bHaveDebugger && g_Settings->LoadBool(Debugger_ShowDivByZero);
}
m_bHaveDebugger = g_Settings->LoadBool(Debugger_Enabled);
m_bLogX86Code = m_bHaveDebugger && g_Settings->LoadBool(Debugger_GenerateLogFiles);
m_bShowTLBMisses = m_bHaveDebugger && g_Settings->LoadBool(Debugger_ShowTLBMisses);
m_bShowDivByZero = m_bHaveDebugger && g_Settings->LoadBool(Debugger_ShowDivByZero);
}

View File

@ -10,33 +10,33 @@
****************************************************************************/
#pragma once
#include <N64 System/N64 Types.h>
#include <Project64\N64 System\N64 Types.h>
class CDebugSettings
{
public:
CDebugSettings();
virtual ~CDebugSettings();
CDebugSettings();
virtual ~CDebugSettings();
static inline bool bHaveDebugger ( void ) { return m_bHaveDebugger; }
static inline bool bLogX86Code ( void ) { return m_bLogX86Code; }
static inline bool bShowTLBMisses ( void ) { return m_bShowTLBMisses; }
static inline bool bShowDivByZero ( void ) { return m_bShowDivByZero; }
static inline bool bHaveDebugger(void) { return m_bHaveDebugger; }
static inline bool bLogX86Code(void) { return m_bLogX86Code; }
static inline bool bShowTLBMisses(void) { return m_bShowTLBMisses; }
static inline bool bShowDivByZero(void) { return m_bShowDivByZero; }
private:
static void StaticRefreshSettings (CDebugSettings * _this)
{
_this->RefreshSettings();
}
static void StaticRefreshSettings(CDebugSettings * _this)
{
_this->RefreshSettings();
}
void RefreshSettings ( void );
void RefreshSettings(void);
//Settings that can be changed on the fly
static bool m_bHaveDebugger;
static bool m_bLogX86Code;
static bool m_bShowTLBMisses;
static bool m_bShowDivByZero;
//Settings that can be changed on the fly
static bool m_bHaveDebugger;
static bool m_bLogX86Code;
static bool m_bShowTLBMisses;
static bool m_bShowDivByZero;
static int m_RefCount;
static bool m_Registered;
static int32_t m_RefCount;
static bool m_Registered;
};

View File

@ -9,67 +9,70 @@
* *
****************************************************************************/
#include "stdafx.h"
#include <Project64\N64 System\System Globals.h>
#include <Project64\N64 System\N64 Class.h>
#include "Game Settings.h"
bool CGameSettings::m_bSMM_StoreInstruc;
bool CGameSettings::m_bSMM_Protect;
bool CGameSettings::m_bSMM_StoreInstruc;
bool CGameSettings::m_bSMM_Protect;
bool CGameSettings::m_bSMM_ValidFunc;
bool CGameSettings::m_bSMM_PIDMA;
bool CGameSettings::m_bSMM_TLB;
bool CGameSettings::m_bSMM_PIDMA;
bool CGameSettings::m_bSMM_TLB;
bool CGameSettings::m_bUseTlb;
DWORD CGameSettings::m_CountPerOp = 2;
DWORD CGameSettings::m_ViRefreshRate = 1500;
DWORD CGameSettings::m_AiCountPerBytes = 500;
uint32_t CGameSettings::m_CountPerOp = 2;
uint32_t CGameSettings::m_ViRefreshRate = 1500;
uint32_t CGameSettings::m_AiCountPerBytes = 500;
bool CGameSettings::m_DelayDP = false;
bool CGameSettings::m_DelaySI = false;
DWORD CGameSettings::m_RdramSize = 0;
bool CGameSettings::m_bFixedAudio = true;
bool CGameSettings::m_bSyncingToAudio = true;
bool CGameSettings::m_bSyncToAudio = true;
uint32_t CGameSettings::m_RdramSize = 0;
bool CGameSettings::m_bFixedAudio = true;
bool CGameSettings::m_bSyncingToAudio = true;
bool CGameSettings::m_bSyncToAudio = true;
bool CGameSettings::m_bFastSP = true;
bool CGameSettings::m_b32Bit = true;
bool CGameSettings::m_RspAudioSignal;
bool CGameSettings::m_bRomInMemory;
bool CGameSettings::m_RegCaching;
bool CGameSettings::m_bLinkBlocks;
DWORD CGameSettings::m_LookUpMode; //FUNC_LOOKUP_METHOD
uint32_t CGameSettings::m_LookUpMode; //FUNC_LOOKUP_METHOD
SYSTEM_TYPE CGameSettings::m_SystemType = SYSTEM_NTSC;
CPU_TYPE CGameSettings::m_CpuType = CPU_Recompiler;
void CGameSettings::RefreshGameSettings()
{
m_bSMM_StoreInstruc = false /*g_Settings->LoadBool(Game_SMM_StoreInstruc)*/;
m_bSMM_Protect = g_Settings->LoadBool(Game_SMM_Protect);
m_bSMM_ValidFunc = g_Settings->LoadBool(Game_SMM_ValidFunc);
m_bSMM_PIDMA = g_Settings->LoadBool(Game_SMM_PIDMA);
m_bSMM_TLB = g_Settings->LoadBool(Game_SMM_TLB);
m_bUseTlb = g_Settings->LoadBool(Game_UseTlb);
m_ViRefreshRate = g_Settings->LoadDword(Game_ViRefreshRate);
m_AiCountPerBytes = g_Settings->LoadDword(Game_AiCountPerBytes);
m_CountPerOp = g_Settings->LoadDword(Game_CounterFactor);
m_RdramSize = g_Settings->LoadDword(Game_RDRamSize);
m_DelaySI = g_Settings->LoadBool(Game_DelaySI);
m_DelayDP = g_Settings->LoadBool(Game_DelayDP);
m_bFixedAudio = g_Settings->LoadBool(Game_FixedAudio);
m_bSyncToAudio = m_bFixedAudio ? g_Settings->LoadBool(Game_SyncViaAudio) : false;
m_b32Bit = g_Settings->LoadBool(Game_32Bit);
m_bFastSP = g_Settings->LoadBool(Game_FastSP);
m_RspAudioSignal = g_Settings->LoadBool(Game_RspAudioSignal);
m_bRomInMemory = g_Settings->LoadBool(Game_LoadRomToMemory);
m_RegCaching = g_Settings->LoadBool(Game_RegCache);
m_bLinkBlocks = g_Settings->LoadBool(Game_BlockLinking);
m_LookUpMode = g_Settings->LoadDword(Game_FuncLookupMode);
m_SystemType = (SYSTEM_TYPE)g_Settings->LoadDword(Game_SystemType);
m_CpuType = (CPU_TYPE)g_Settings->LoadDword(Game_CpuType);
m_bSMM_StoreInstruc = false /*g_Settings->LoadBool(Game_SMM_StoreInstruc)*/;
m_bSMM_Protect = g_Settings->LoadBool(Game_SMM_Protect);
m_bSMM_ValidFunc = g_Settings->LoadBool(Game_SMM_ValidFunc);
m_bSMM_PIDMA = g_Settings->LoadBool(Game_SMM_PIDMA);
m_bSMM_TLB = g_Settings->LoadBool(Game_SMM_TLB);
m_bUseTlb = g_Settings->LoadBool(Game_UseTlb);
m_ViRefreshRate = g_Settings->LoadDword(Game_ViRefreshRate);
m_AiCountPerBytes = g_Settings->LoadDword(Game_AiCountPerBytes);
m_CountPerOp = g_Settings->LoadDword(Game_CounterFactor);
m_RdramSize = g_Settings->LoadDword(Game_RDRamSize);
m_DelaySI = g_Settings->LoadBool(Game_DelaySI);
m_DelayDP = g_Settings->LoadBool(Game_DelayDP);
m_bFixedAudio = g_Settings->LoadBool(Game_FixedAudio);
m_bSyncToAudio = m_bFixedAudio ? g_Settings->LoadBool(Game_SyncViaAudio) : false;
m_b32Bit = g_Settings->LoadBool(Game_32Bit);
m_bFastSP = g_Settings->LoadBool(Game_FastSP);
m_RspAudioSignal = g_Settings->LoadBool(Game_RspAudioSignal);
m_bRomInMemory = g_Settings->LoadBool(Game_LoadRomToMemory);
m_RegCaching = g_Settings->LoadBool(Game_RegCache);
m_bLinkBlocks = g_Settings->LoadBool(Game_BlockLinking);
m_LookUpMode = g_Settings->LoadDword(Game_FuncLookupMode);
m_SystemType = (SYSTEM_TYPE)g_Settings->LoadDword(Game_SystemType);
m_CpuType = (CPU_TYPE)g_Settings->LoadDword(Game_CpuType);
m_bSyncingToAudio = m_bSyncToAudio;
if (m_CountPerOp == 0)
{
m_CountPerOp = 2;
}
m_bSyncingToAudio = m_bSyncToAudio;
if (m_CountPerOp == 0)
{
m_CountPerOp = 2;
}
}
void CGameSettings::SpeedChanged (int SpeedLimit )
void CGameSettings::SpeedChanged(int SpeedLimit)
{
int FullSpeed = g_System->m_SystemType == SYSTEM_PAL ? 50 : 60;
m_bSyncingToAudio = SpeedLimit == FullSpeed ? m_bSyncToAudio : false;
}
int FullSpeed = g_System->m_SystemType == SYSTEM_PAL ? 50 : 60;
m_bSyncingToAudio = SpeedLimit == FullSpeed ? m_bSyncToAudio : false;
}

View File

@ -10,64 +10,64 @@
****************************************************************************/
#pragma once
#include <N64 System/N64 Types.h>
#include <Project64\N64 System\N64 Types.h>
class CGameSettings
{
public:
void RefreshGameSettings ( void );
void RefreshGameSettings(void);
inline static bool bRomInMemory ( void ) { return m_bRomInMemory; }
inline static bool bRegCaching ( void ) { return m_RegCaching; }
inline static bool bLinkBlocks ( void ) { return m_bLinkBlocks; }
inline static FUNC_LOOKUP_METHOD LookUpMode ( void ) { return (FUNC_LOOKUP_METHOD)m_LookUpMode; }
inline static bool bUseTlb ( void ) { return m_bUseTlb; }
inline static DWORD CountPerOp ( void ) { return m_CountPerOp; }
inline static DWORD ViRefreshRate ( void ) { return m_ViRefreshRate; }
inline static DWORD AiCountPerBytes ( void ) { return m_AiCountPerBytes; }
inline static bool bDelayDP ( void ) { return m_DelayDP; }
inline static bool bDelaySI ( void ) { return m_DelaySI; }
inline static DWORD RdramSize ( void ) { return m_RdramSize; }
inline static bool bFixedAudio ( void ) { return m_bFixedAudio; }
inline static bool bSyncToAudio ( void ) { return m_bSyncingToAudio; }
inline static bool bFastSP ( void ) { return m_bFastSP; }
inline static bool b32BitCore ( void ) { return m_b32Bit; }
inline static bool RspAudioSignal ( void ) { return m_RspAudioSignal; }
inline static bool bSMM_StoreInstruc ( void ) { return m_bSMM_StoreInstruc; }
inline static bool bSMM_Protect ( void ) { return m_bSMM_Protect; }
inline static bool bSMM_ValidFunc ( void ) { return m_bSMM_ValidFunc; }
inline static bool bSMM_PIDMA ( void ) { return m_bSMM_PIDMA; }
inline static bool bSMM_TLB ( void ) { return m_bSMM_TLB; }
inline static SYSTEM_TYPE SystemType ( void ) { return m_SystemType; }
inline static CPU_TYPE CpuType ( void ) { return m_CpuType; }
inline static bool bRomInMemory(void) { return m_bRomInMemory; }
inline static bool bRegCaching(void) { return m_RegCaching; }
inline static bool bLinkBlocks(void) { return m_bLinkBlocks; }
inline static FUNC_LOOKUP_METHOD LookUpMode(void) { return (FUNC_LOOKUP_METHOD)m_LookUpMode; }
inline static bool bUseTlb(void) { return m_bUseTlb; }
inline static uint32_t CountPerOp(void) { return m_CountPerOp; }
inline static uint32_t ViRefreshRate(void) { return m_ViRefreshRate; }
inline static uint32_t AiCountPerBytes(void) { return m_AiCountPerBytes; }
inline static bool bDelayDP(void) { return m_DelayDP; }
inline static bool bDelaySI(void) { return m_DelaySI; }
inline static uint32_t RdramSize(void) { return m_RdramSize; }
inline static bool bFixedAudio(void) { return m_bFixedAudio; }
inline static bool bSyncToAudio(void) { return m_bSyncingToAudio; }
inline static bool bFastSP(void) { return m_bFastSP; }
inline static bool b32BitCore(void) { return m_b32Bit; }
inline static bool RspAudioSignal(void) { return m_RspAudioSignal; }
inline static bool bSMM_StoreInstruc(void) { return m_bSMM_StoreInstruc; }
inline static bool bSMM_Protect(void) { return m_bSMM_Protect; }
inline static bool bSMM_ValidFunc(void) { return m_bSMM_ValidFunc; }
inline static bool bSMM_PIDMA(void) { return m_bSMM_PIDMA; }
inline static bool bSMM_TLB(void) { return m_bSMM_TLB; }
inline static SYSTEM_TYPE SystemType(void) { return m_SystemType; }
inline static CPU_TYPE CpuType(void) { return m_CpuType; }
protected:
static void SpeedChanged (int SpeedLimit );
static void SpeedChanged(int32_t SpeedLimit);
private:
//Settings that can be changed on the fly
static bool m_bRomInMemory;
static bool m_RegCaching;
static bool m_bLinkBlocks;
static DWORD m_LookUpMode; //FUNC_LOOKUP_METHOD
static bool m_bUseTlb;
static DWORD m_CountPerOp;
static DWORD m_ViRefreshRate;
static DWORD m_AiCountPerBytes;
static bool m_DelayDP;
static bool m_DelaySI;
static DWORD m_RdramSize;
static bool m_bFixedAudio;
static bool m_bSyncingToAudio;
static bool m_bSyncToAudio;
static bool m_bFastSP;
static bool m_b32Bit;
static bool m_RspAudioSignal;
static bool m_bSMM_StoreInstruc;
static bool m_bSMM_Protect;
static bool m_bSMM_ValidFunc;
static bool m_bSMM_PIDMA;
static bool m_bSMM_TLB;
static SYSTEM_TYPE m_SystemType;
static CPU_TYPE m_CpuType;
//Settings that can be changed on the fly
static bool m_bRomInMemory;
static bool m_RegCaching;
static bool m_bLinkBlocks;
static uint32_t m_LookUpMode; //FUNC_LOOKUP_METHOD
static bool m_bUseTlb;
static uint32_t m_CountPerOp;
static uint32_t m_ViRefreshRate;
static uint32_t m_AiCountPerBytes;
static bool m_DelayDP;
static bool m_DelaySI;
static uint32_t m_RdramSize;
static bool m_bFixedAudio;
static bool m_bSyncingToAudio;
static bool m_bSyncToAudio;
static bool m_bFastSP;
static bool m_b32Bit;
static bool m_RspAudioSignal;
static bool m_bSMM_StoreInstruc;
static bool m_bSMM_Protect;
static bool m_bSMM_ValidFunc;
static bool m_bSMM_PIDMA;
static bool m_bSMM_TLB;
static SYSTEM_TYPE m_SystemType;
static CPU_TYPE m_CpuType;
};

View File

@ -9,57 +9,58 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "N64System Settings.h"
int CN64SystemSettings::m_RefCount = 0;
int32_t CN64SystemSettings::m_RefCount = 0;
bool CN64SystemSettings::m_bShowCPUPer;
bool CN64SystemSettings::m_bProfiling;
bool CN64SystemSettings::m_bBasicMode;
bool CN64SystemSettings::m_bLimitFPS;
bool CN64SystemSettings::m_bShowCPUPer;
bool CN64SystemSettings::m_bProfiling;
bool CN64SystemSettings::m_bBasicMode;
bool CN64SystemSettings::m_bLimitFPS;
bool CN64SystemSettings::m_bShowDListAListCount;
bool CN64SystemSettings::m_bDisplayFrameRate;
CN64SystemSettings::CN64SystemSettings()
{
m_RefCount += 1;
if (m_RefCount == 1)
{
g_Settings->RegisterChangeCB(UserInterface_BasicMode,NULL,RefreshSettings);
g_Settings->RegisterChangeCB(UserInterface_ShowCPUPer,NULL,RefreshSettings);
g_Settings->RegisterChangeCB(UserInterface_DisplayFrameRate,NULL,RefreshSettings);
m_RefCount += 1;
if (m_RefCount == 1)
{
g_Settings->RegisterChangeCB(UserInterface_BasicMode, NULL, RefreshSettings);
g_Settings->RegisterChangeCB(UserInterface_ShowCPUPer, NULL, RefreshSettings);
g_Settings->RegisterChangeCB(UserInterface_DisplayFrameRate, NULL, RefreshSettings);
g_Settings->RegisterChangeCB(Debugger_ProfileCode,NULL,RefreshSettings);
g_Settings->RegisterChangeCB(Debugger_ShowDListAListCount,NULL,RefreshSettings);
g_Settings->RegisterChangeCB(Debugger_ProfileCode, NULL, RefreshSettings);
g_Settings->RegisterChangeCB(Debugger_ShowDListAListCount, NULL, RefreshSettings);
g_Settings->RegisterChangeCB(GameRunning_LimitFPS,NULL,RefreshSettings);
g_Settings->RegisterChangeCB(GameRunning_LimitFPS, NULL, RefreshSettings);
RefreshSettings(NULL);
}
RefreshSettings(NULL);
}
}
CN64SystemSettings::~CN64SystemSettings()
{
m_RefCount -= 1;
if (m_RefCount == 0)
{
g_Settings->UnregisterChangeCB(UserInterface_BasicMode,NULL,RefreshSettings);
g_Settings->UnregisterChangeCB(UserInterface_DisplayFrameRate,NULL,RefreshSettings);
g_Settings->UnregisterChangeCB(UserInterface_ShowCPUPer,NULL,RefreshSettings);
m_RefCount -= 1;
if (m_RefCount == 0)
{
g_Settings->UnregisterChangeCB(UserInterface_BasicMode, NULL, RefreshSettings);
g_Settings->UnregisterChangeCB(UserInterface_DisplayFrameRate, NULL, RefreshSettings);
g_Settings->UnregisterChangeCB(UserInterface_ShowCPUPer, NULL, RefreshSettings);
g_Settings->UnregisterChangeCB(Debugger_ProfileCode,NULL,RefreshSettings);
g_Settings->UnregisterChangeCB(Debugger_ShowDListAListCount,NULL,RefreshSettings);
g_Settings->UnregisterChangeCB(Debugger_ProfileCode, NULL, RefreshSettings);
g_Settings->UnregisterChangeCB(Debugger_ShowDListAListCount, NULL, RefreshSettings);
g_Settings->UnregisterChangeCB(GameRunning_LimitFPS,NULL,RefreshSettings);
}
g_Settings->UnregisterChangeCB(GameRunning_LimitFPS, NULL, RefreshSettings);
}
}
void CN64SystemSettings::RefreshSettings(void *)
{
m_bBasicMode = g_Settings->LoadBool(UserInterface_BasicMode);
m_bDisplayFrameRate = g_Settings->LoadBool(UserInterface_DisplayFrameRate);
m_bBasicMode = g_Settings->LoadBool(UserInterface_BasicMode);
m_bDisplayFrameRate = g_Settings->LoadBool(UserInterface_DisplayFrameRate);
m_bShowCPUPer = g_Settings->LoadBool(UserInterface_ShowCPUPer);
m_bProfiling = g_Settings->LoadBool(Debugger_ProfileCode);
m_bShowDListAListCount = g_Settings->LoadBool(Debugger_ShowDListAListCount);
m_bLimitFPS = g_Settings->LoadBool(GameRunning_LimitFPS);
}
m_bShowCPUPer = g_Settings->LoadBool(UserInterface_ShowCPUPer);
m_bProfiling = g_Settings->LoadBool(Debugger_ProfileCode);
m_bShowDListAListCount = g_Settings->LoadBool(Debugger_ShowDListAListCount);
m_bLimitFPS = g_Settings->LoadBool(GameRunning_LimitFPS);
}

View File

@ -13,26 +13,25 @@
class CN64SystemSettings
{
protected:
CN64SystemSettings();
virtual ~CN64SystemSettings();
inline static bool bBasicMode ( void ) { return m_bBasicMode; }
inline static bool bDisplayFrameRate ( void ) { return m_bDisplayFrameRate; }
inline static bool bShowCPUPer ( void ) { return m_bShowCPUPer; }
inline static bool bProfiling ( void ) { return m_bProfiling; }
inline static bool bShowDListAListCount ( void ) { return m_bShowDListAListCount; }
inline static bool bLimitFPS ( void ) { return m_bLimitFPS; }
CN64SystemSettings();
virtual ~CN64SystemSettings();
inline static bool bBasicMode(void) { return m_bBasicMode; }
inline static bool bDisplayFrameRate(void) { return m_bDisplayFrameRate; }
inline static bool bShowCPUPer(void) { return m_bShowCPUPer; }
inline static bool bProfiling(void) { return m_bProfiling; }
inline static bool bShowDListAListCount(void) { return m_bShowDListAListCount; }
inline static bool bLimitFPS(void) { return m_bLimitFPS; }
private:
static void RefreshSettings ( void * );
static bool m_bShowCPUPer;
static bool m_bProfiling;
static bool m_bBasicMode;
static bool m_bLimitFPS;
static bool m_bShowDListAListCount;
static bool m_bDisplayFrameRate;
static void RefreshSettings(void *);
static int m_RefCount;
static bool m_bShowCPUPer;
static bool m_bProfiling;
static bool m_bBasicMode;
static bool m_bLimitFPS;
static bool m_bShowDListAListCount;
static bool m_bDisplayFrameRate;
static int32_t m_RefCount;
};

View File

@ -18,19 +18,19 @@ CNotificationSettings::CNotificationSettings()
CNotificationSettings::~CNotificationSettings()
{
if (g_Settings)
{
g_Settings->UnregisterChangeCB(UserInterface_InFullScreen,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
}
if (g_Settings)
{
g_Settings->UnregisterChangeCB(UserInterface_InFullScreen, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
}
}
void CNotificationSettings::RegisterNotifications()
{
g_Settings->RegisterChangeCB(UserInterface_InFullScreen, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
RefreshSettings();
g_Settings->RegisterChangeCB(UserInterface_InFullScreen, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
RefreshSettings();
}
void CNotificationSettings::RefreshSettings()
{
m_bInFullScreen = g_Settings->LoadBool(UserInterface_InFullScreen);
}
m_bInFullScreen = g_Settings->LoadBool(UserInterface_InFullScreen);
}

View File

@ -12,19 +12,19 @@
class CNotificationSettings
{
static void StaticRefreshSettings (CNotificationSettings * _this)
{
_this->RefreshSettings();
}
static void StaticRefreshSettings(CNotificationSettings * _this)
{
_this->RefreshSettings();
}
void RefreshSettings ( void );
void RefreshSettings(void);
static bool m_bInFullScreen;
static bool m_bInFullScreen;
protected:
CNotificationSettings();
virtual ~CNotificationSettings();
CNotificationSettings();
virtual ~CNotificationSettings();
void RegisterNotifications (void);
inline bool InFullScreen ( void ) const { return m_bInFullScreen; }
void RegisterNotifications(void);
inline bool InFullScreen(void) const { return m_bInFullScreen; }
};

View File

@ -9,36 +9,37 @@
* *
****************************************************************************/
#include "stdafx.h"
#include "Recompiler Settings.h"
int CRecompilerSettings::m_RefCount = 0;
int CRecompilerSettings::m_RefCount = 0;
bool CRecompilerSettings::m_bShowRecompMemSize;
bool CRecompilerSettings::m_bProfiling;
bool CRecompilerSettings::m_bProfiling;
CRecompilerSettings::CRecompilerSettings()
{
m_RefCount += 1;
if (m_RefCount == 1)
{
g_Settings->RegisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->RegisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
RefreshSettings();
}
m_RefCount += 1;
if (m_RefCount == 1)
{
g_Settings->RegisterChangeCB(Debugger_ShowRecompMemSize, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->RegisterChangeCB(Debugger_ProfileCode, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
RefreshSettings();
}
}
CRecompilerSettings::~CRecompilerSettings()
{
m_RefCount -= 1;
if (m_RefCount == 0)
{
g_Settings->UnregisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->UnregisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings);
}
m_RefCount -= 1;
if (m_RefCount == 0)
{
g_Settings->UnregisterChangeCB(Debugger_ShowRecompMemSize, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
g_Settings->UnregisterChangeCB(Debugger_ProfileCode, this, (CSettings::SettingChangedFunc)StaticRefreshSettings);
}
}
void CRecompilerSettings::RefreshSettings()
{
m_bShowRecompMemSize = g_Settings->LoadBool(Debugger_ShowRecompMemSize);
m_bProfiling = g_Settings->LoadBool(Debugger_ProfileCode);
}
m_bShowRecompMemSize = g_Settings->LoadBool(Debugger_ShowRecompMemSize);
m_bProfiling = g_Settings->LoadBool(Debugger_ProfileCode);
}

View File

@ -10,30 +10,29 @@
****************************************************************************/
#pragma once
#include <N64 System/N64 Types.h>
#include <Project64\N64 System\N64 Types.h>
class CRecompilerSettings
class CRecompilerSettings
{
public:
CRecompilerSettings();
virtual ~CRecompilerSettings();
CRecompilerSettings();
virtual ~CRecompilerSettings();
static bool bShowRecompMemSize ( void ) { return m_bShowRecompMemSize; }
static bool bShowRecompMemSize(void) { return m_bShowRecompMemSize; }
static bool bProfiling ( void ) { return m_bProfiling; }
static bool bProfiling(void) { return m_bProfiling; }
private:
static void StaticRefreshSettings (CRecompilerSettings * _this)
{
_this->RefreshSettings();
}
static void StaticRefreshSettings(CRecompilerSettings * _this)
{
_this->RefreshSettings();
}
void RefreshSettings ( void );
void RefreshSettings(void);
//Settings that can be changed on the fly
static bool m_bShowRecompMemSize;
static bool m_bProfiling;
//Settings that can be changed on the fly
static bool m_bShowRecompMemSize;
static bool m_bProfiling;
static int m_RefCount;
static int32_t m_RefCount;
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -30,6 +30,7 @@
#include "SettingType/SettingsType-TempNumber.h"
#include "SettingType/SettingsType-TempBool.h"
#include "Settings Class.h"
#include "N64 System/N64 Types.h"
#include <Common/TraceDefs.h>
CSettings * g_Settings = NULL;
@ -109,6 +110,7 @@ void CSettings::AddHowToHandleSetting()
AddHandler(Setting_ApplicationName, new CSettingTypeTempString(""));
AddHandler(Setting_UseFromRegistry, new CSettingTypeApplication("Settings", "Use Registry", (uint32_t)false));
AddHandler(Setting_RdbEditor, new CSettingTypeApplication("", "Rdb Editor", false));
AddHandler(Setting_CN64TimeCritical,new CSettingTypeApplication("","CN64TimeCritical",false));
AddHandler(Setting_PluginPageFirst, new CSettingTypeApplication("", "Plugin Page First", false));
AddHandler(Setting_DisableScrSaver, new CSettingTypeApplication("", "Disable Screen Saver", (uint32_t)true));
AddHandler(Setting_AutoSleep, new CSettingTypeApplication("", "Auto Sleep", (uint32_t)true));
@ -418,7 +420,7 @@ const char * CSettings::GetSettingSz(CSettings * _this, SettingID Type, char * B
return Buffer;
}
void CSettings::SetSetting(CSettings * _this, SettingID ID, unsigned int Value)
void CSettings::SetSetting(CSettings * _this, SettingID ID, uint32_t Value)
{
_this->SaveDword(ID, Value);
}
@ -459,7 +461,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
{
_this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, Value));
}
else {
else
{
_this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, DefaultID));
}
break;
@ -468,7 +471,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
{
_this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, ""));
}
else {
else
{
_this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, DefaultID));
}
break;
@ -489,7 +493,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
_this->AddHandler(RdbSetting, new CSettingTypeRomDatabase(Name.c_str(), (int)Value));
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), RdbSetting));
}
else {
else
{
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID));
}
break;
@ -498,7 +503,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
{
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), ""));
}
else {
else
{
_this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID));
}
break;
@ -515,7 +521,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
{
_this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, (int)Value, true));
}
else {
else
{
_this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, (SettingID)Value, true));
}
break;
@ -524,7 +531,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
{
_this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, "", true));
}
else {
else
{
_this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, DefaultID, true));
}
break;
@ -540,7 +548,8 @@ void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID Defau
{
_this->AddHandler(ID, new CSettingTypeRomDatabaseSetting(Category, DefaultStr, (int)Value, true));
}
else {
else
{
SettingID RdbSetting = (SettingID)_this->m_NextAutoSettingId;
_this->m_NextAutoSettingId += 1;
_this->AddHandler(RdbSetting, new CSettingTypeRomDatabaseSetting(Category, DefaultStr, DefaultID, true));
@ -588,7 +597,8 @@ bool CSettings::LoadBool(SettingID Type, bool & Value)
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
else {
else
{
return FindInfo->second->Load(0, Value);
}
return false;
@ -614,7 +624,8 @@ bool CSettings::LoadBoolIndex(SettingID Type, int index, bool & Value)
{
return FindInfo->second->Load(index, Value);
}
else {
else
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
return false;
@ -640,7 +651,8 @@ bool CSettings::LoadDword(SettingID Type, uint32_t & Value)
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
else {
else
{
return FindInfo->second->Load(0, Value);
}
return false;
@ -666,7 +678,8 @@ bool CSettings::LoadDwordIndex(SettingID Type, int index, uint32_t & Value)
{
return FindInfo->second->Load(index, Value);
}
else {
else
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
return false;
@ -692,7 +705,8 @@ bool CSettings::LoadStringVal(SettingID Type, stdstr & Value)
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
else {
else
{
return FindInfo->second->Load(0, Value);
}
return false;
@ -712,7 +726,8 @@ bool CSettings::LoadStringVal(SettingID Type, char * Buffer, int BufferSize)
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
else {
else
{
stdstr Value;
bRes = FindInfo->second->Load(0, Value);
int len = BufferSize;
@ -745,7 +760,8 @@ bool CSettings::LoadStringIndex(SettingID Type, int index, stdstr & Value)
{
return FindInfo->second->Load(index, Value);
}
else {
else
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
return false;
@ -773,12 +789,14 @@ void CSettings::LoadDefaultBool(SettingID Type, bool & Value)
//if not found do nothing
UnknownSetting(Type);
}
else {
else
{
if (FindInfo->second->IndexBasedSetting())
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
else {
else
{
FindInfo->second->LoadDefault(0, Value);
}
}
@ -810,12 +828,14 @@ void CSettings::LoadDefaultDword(SettingID Type, uint32_t & Value)
//if not found do nothing
UnknownSetting(Type);
}
else {
else
{
if (FindInfo->second->IndexBasedSetting())
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
else {
else
{
FindInfo->second->LoadDefault(0, Value);
}
}
@ -847,12 +867,14 @@ void CSettings::LoadDefaultString(SettingID Type, stdstr & Value)
//if not found do nothing
UnknownSetting(Type);
}
else {
else
{
if (FindInfo->second->IndexBasedSetting())
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
else {
else
{
FindInfo->second->LoadDefault(0, Value);
}
}
@ -892,7 +914,8 @@ void CSettings::SaveBool(SettingID Type, bool Value)
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
else {
else
{
FindInfo->second->Save(0, Value);
}
NotifyCallBacks(Type);
@ -911,7 +934,8 @@ void CSettings::SaveBoolIndex(SettingID Type, int index, bool Value)
{
FindInfo->second->Save(index, Value);
}
else {
else
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
NotifyCallBacks(Type);
@ -930,7 +954,8 @@ void CSettings::SaveDword(SettingID Type, uint32_t Value)
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
else {
else
{
FindInfo->second->Save(0, Value);
}
NotifyCallBacks(Type);
@ -949,7 +974,8 @@ void CSettings::SaveDwordIndex(SettingID Type, int index, uint32_t Value)
{
FindInfo->second->Save(index, Value);
}
else {
else
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
NotifyCallBacks(Type);
@ -968,7 +994,8 @@ void CSettings::SaveString(SettingID Type, const stdstr & Value)
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
else {
else
{
FindInfo->second->Save(0, Value);
}
NotifyCallBacks(Type);
@ -986,7 +1013,8 @@ void CSettings::SaveString(SettingID Type, const char * Buffer)
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
else {
else
{
FindInfo->second->Save(0, Buffer);
}
NotifyCallBacks(Type);
@ -1004,7 +1032,8 @@ void CSettings::SaveStringIndex(SettingID Type, int index, const char * Buffer)
{
FindInfo->second->Save(index, Buffer);
}
else {
else
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
NotifyCallBacks(Type);
@ -1027,7 +1056,8 @@ void CSettings::DeleteSetting(SettingID Type)
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
else {
else
{
FindInfo->second->Delete(0);
}
NotifyCallBacks(Type);
@ -1045,7 +1075,8 @@ void CSettings::DeleteSettingIndex(SettingID Type, int index)
{
FindInfo->second->Delete(index);
}
else {
else
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
NotifyCallBacks(Type);
@ -1124,7 +1155,8 @@ void CSettings::RegisterChangeCB(SettingID Type, void * Data, SettingChangedFunc
}
item->Next = new_item;
}
else {
else
{
m_Callback.insert(SETTING_CALLBACK::value_type(Type, new_item));
}
}
@ -1154,11 +1186,13 @@ void CSettings::UnregisterChangeCB(SettingID Type, void * Data, SettingChangedFu
m_Callback.erase(Callback);
m_Callback.insert(SETTING_CALLBACK::value_type(Type, Next));
}
else {
else
{
m_Callback.erase(Callback);
}
}
else {
else
{
PrevItem->Next = item->Next;
}
delete item;
@ -1169,7 +1203,8 @@ void CSettings::UnregisterChangeCB(SettingID Type, void * Data, SettingChangedFu
item = item->Next;
}
}
else {
else
{
UnknownSetting(Type);
return;
}
@ -1178,4 +1213,4 @@ void CSettings::UnregisterChangeCB(SettingID Type, void * Data, SettingChangedFu
{
g_Notify->BreakPoint(__FILEW__, __LINE__);
}
}
}

View File

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

View File

@ -48,6 +48,7 @@ enum SettingID
Setting_ApplicationName,
Setting_UseFromRegistry,
Setting_RdbEditor,
Setting_CN64TimeCritical,
Setting_PluginPageFirst,
Setting_DisableScrSaver,
Setting_AutoSleep,

View File

@ -1,72 +1,72 @@
#include "stdafx.h"
CBaseMenu::CBaseMenu () :
m_MenuHandle((HMENU)CreateMenu())
CBaseMenu::CBaseMenu() :
m_MenuHandle((HMENU)CreateMenu())
{
}
bool CBaseMenu::AddMenu(HMENU hMenu, MenuItemList Items ) {
if (Items.begin() == Items.end()) { return false; }
bool CBaseMenu::AddMenu(HMENU hMenu, MenuItemList Items)
{
if (Items.begin() == Items.end()) { return false; }
UINT ItemID, uFlags;
std::wstring Text, String;
for (MenuItemList::iterator MenuItem = Items.begin(); MenuItem != Items.end(); MenuItem++)
UINT ItemID, uFlags;
std::wstring Text, String;
for (MenuItemList::iterator MenuItem = Items.begin(); MenuItem != Items.end(); MenuItem++)
{
ItemID = MenuItem->ID();
uFlags = MF_STRING;
Text = g_Lang->GetString(MenuItem->Title()).c_str();
ItemID = MenuItem->ID();
uFlags = MF_STRING;
Text = g_Lang->GetString(MenuItem->Title()).c_str();
if (MenuItem->Title() == EMPTY_STRING && MenuItem->ManualString().length() > 0)
if (MenuItem->Title() == EMPTY_STRING && MenuItem->ManualString().length() > 0)
{
Text = MenuItem->ManualString();
}
if (ItemID == SPLITER)
Text = MenuItem->ManualString();
}
if (ItemID == SPLITER)
{
uFlags |= MF_SEPARATOR;
}
if (MenuItem->ItemTicked())
uFlags |= MF_SEPARATOR;
}
if (MenuItem->ItemTicked())
{
uFlags |= MFS_CHECKED;
}
if (MenuItem->ItemEnabled())
uFlags |= MFS_CHECKED;
}
if (MenuItem->ItemEnabled())
{
uFlags |= MFS_ENABLED;
}
else
uFlags |= MFS_ENABLED;
}
else
{
uFlags |= MFS_DISABLED;
}
MenuItemList * SubMenu = (MenuItemList *)MenuItem->SubMenu();
if (ItemID == SUB_MENU && HIWORD(SubMenu) != 0 && (SubMenu->begin() != SubMenu->end()))
{
ItemID = (UINT)CreatePopupMenu();
uFlags |= MF_POPUP;
uFlags |= MFS_DISABLED;
}
AddMenu((HMENU)ItemID,*SubMenu);
}
if (ItemID == ID_PLUGIN_MENU)
{
ItemID = (UINT)MenuItem->SubMenu();
uFlags |= MF_POPUP;
MENUITEMINFO lpmii;
lpmii.cbSize = sizeof(MENUITEMINFO);
lpmii.fMask = MIIM_STATE;
lpmii.fState = 0;
SetMenuItemInfo((HMENU)ItemID, (DWORD)MenuItem->SubMenu(), FALSE,&lpmii);
}
if (MenuItem->ShortCut().empty() == false)
MenuItemList * SubMenu = (MenuItemList *)MenuItem->SubMenu();
if (ItemID == SUB_MENU && HIWORD(SubMenu) != 0 && (SubMenu->begin() != SubMenu->end()))
{
String = Text;
String += L"\t";
String += MenuItem->ShortCut();
Text = String;
}
AppendMenuW(hMenu,uFlags,ItemID,Text.c_str());
}
return true;
}
ItemID = (UINT)CreatePopupMenu();
uFlags |= MF_POPUP;
AddMenu((HMENU)ItemID, *SubMenu);
}
if (ItemID == ID_PLUGIN_MENU)
{
ItemID = (UINT)MenuItem->SubMenu();
uFlags |= MF_POPUP;
MENUITEMINFO lpmii;
lpmii.cbSize = sizeof(MENUITEMINFO);
lpmii.fMask = MIIM_STATE;
lpmii.fState = 0;
SetMenuItemInfo((HMENU)ItemID, (DWORD)MenuItem->SubMenu(), FALSE, &lpmii);
}
if (MenuItem->ShortCut().empty() == false)
{
String = Text;
String += L"\t";
String += MenuItem->ShortCut();
Text = String;
}
AppendMenuW(hMenu, uFlags, ItemID, Text.c_str());
}
return true;
}

View File

@ -545,8 +545,13 @@ void CRomBrowser::NotificationCB(LPCWSTR Status, CRomBrowser * /*_this*/)
g_Notify->DisplayMessage(5, Status);
}
static const char* ROM_extensions[] = {
"zip", "7z", "v64", "z64", "n64", "rom", "jap", "pal", "usa", "eur", "bin",
};
void CRomBrowser::AddFileNameToList(strlist & FileList, const stdstr & Directory, CPath & File)
{
uint8_t i;
if (FileList.size() > 3000)
{
return;
@ -555,14 +560,16 @@ void CRomBrowser::AddFileNameToList(strlist & FileList, const stdstr & Directory
stdstr Drive, Dir, Name, Extension;
File.GetComponents(NULL, &Dir, &Name, &Extension);
Extension.ToLower();
if (Extension == "zip" || Extension == "7z" || Extension == "v64" || Extension == "z64" ||
Extension == "n64" || Extension == "rom" || Extension == "jap" || Extension == "pal" ||
Extension == "usa" || Extension == "eur" || Extension == "bin")
{
stdstr FileName = Directory + Name + Extension;
FileName.ToLower();
FileList.push_back(FileName);
}
for (i = 0; i < sizeof(ROM_extensions) / sizeof(ROM_extensions[0]); i++)
{
if (Extension == ROM_extensions[i])
{
stdstr FileName = Directory + Name + Extension;
FileName.ToLower();
FileList.push_back(FileName);
break;
}
}
}
void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, const stdstr & Directory, const char * lpLastRom)
@ -579,6 +586,10 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
do
{
uint8_t ext_ID;
int8_t new_list_entry = 0;
const uint8_t exts = sizeof(ROM_extensions) / sizeof(ROM_extensions[0]);
//TODO: Fix exception on Windows XP (Visual Studio 2010+)
//WriteTraceF(TraceDebug,__FUNCTION__ ": 2 %s m_StopRefresh = %d",(LPCSTR)SearchPath,m_StopRefresh);
if (m_StopRefresh) { break; }
@ -598,13 +609,20 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
stdstr Extension = SearchPath.GetExtension();
Extension.ToLower();
if (Extension == "zip" || Extension == "v64" || Extension == "z64" || Extension == "n64" ||
Extension == "rom" || Extension == "jap" || Extension == "pal" || Extension == "usa" ||
Extension == "eur" || Extension == "bin")
{
AddRomToList(SearchPath, lpLastRom);
continue;
}
for (ext_ID = 0; ext_ID < exts; ext_ID++)
{
if (Extension == ROM_extensions[ext_ID] && Extension != "7z")
{
new_list_entry = 1;
break;
}
}
if (new_list_entry)
{
AddRomToList(SearchPath, lpLastRom);
continue;
}
if (Extension == "7z")
{
try
@ -641,11 +659,7 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
_splitpath(FileName.c_str(), drive2, dir2, FileName2, ext2);
WriteTraceF(TraceDebug, __FUNCTION__ ": 6 %s", ext2);
if (_stricmp(ext2, ".v64") != 0 && _stricmp(ext2, ".z64") != 0 &&
_stricmp(ext2, ".n64") != 0 && _stricmp(ext2, ".rom") != 0 &&
_stricmp(ext2, ".jap") != 0 && _stricmp(ext2, ".pal") != 0 &&
_stricmp(ext2, ".usa") != 0 && _stricmp(ext2, ".eur") != 0 &&
_stricmp(ext2, ".bin") == 0)
if (_stricmp(ext2, ".bin") == 0)
{
continue;
}

View File

@ -1,254 +1,28 @@
#include "stdafx.h"
#include <Project64\AppInit.h>
#include "Multilanguage\LanguageSelector.h"
#include <Tlhelp32.h>
CTraceFileLog * LogFile = NULL;
void LogLevelChanged (CTraceFileLog * LogFile)
{
LogFile->SetTraceLevel((TraceLevel)g_Settings->LoadDword(Debugger_AppLogLevel));
}
void LogFlushChanged (CTraceFileLog * LogFile)
{
LogFile->SetFlushFile(g_Settings->LoadDword(Debugger_AppLogFlush) != 0);
}
void InitializeLog ( void)
{
CPath LogFilePath(CPath::MODULE_DIRECTORY);
LogFilePath.AppendDirectory("Logs");
if (!LogFilePath.DirectoryExists())
{
LogFilePath.DirectoryCreate();
}
LogFilePath.SetNameExtension("Project64.log");
LogFile = new CTraceFileLog(LogFilePath, g_Settings->LoadDword(Debugger_AppLogFlush) != 0, Log_New,500);
#ifdef VALIDATE_DEBUG
LogFile->SetTraceLevel((TraceLevel)(g_Settings->LoadDword(Debugger_AppLogLevel) | TraceValidate | TraceDebug));
#else
LogFile->SetTraceLevel((TraceLevel)g_Settings->LoadDword(Debugger_AppLogLevel));
#endif
AddTraceModule(LogFile);
g_Settings->RegisterChangeCB(Debugger_AppLogLevel,LogFile,(CSettings::SettingChangedFunc)LogLevelChanged);
g_Settings->RegisterChangeCB(Debugger_AppLogFlush,LogFile,(CSettings::SettingChangedFunc)LogFlushChanged);
}
/*bool ChangeDirPermission ( const CPath & Dir)
{
if (Dir.DirectoryExists())
{
HANDLE hDir = CreateFile(Dir,READ_CONTROL|WRITE_DAC,0,NULL,OPEN_EXISTING,FILE_FLAG_BACKUP_SEMANTICS,NULL);
if (hDir != INVALID_HANDLE_VALUE)
{
ACL * pOldDACL = NULL;
PSECURITY_DESCRIPTOR pSD = NULL;
if (GetSecurityInfo(hDir,SE_FILE_OBJECT,DACL_SECURITY_INFORMATION,NULL,NULL,&pOldDACL,NULL,&pSD) == ERROR_SUCCESS)
{
bool bAdd = true;
PEXPLICIT_ACCESS_W pListOfExplictEntries;
ULONG cCountOfExplicitEntries;
if (GetExplicitEntriesFromAclW(pOldDACL,&cCountOfExplicitEntries,&pListOfExplictEntries) == ERROR_SUCCESS)
{
for (int i = 0; i < cCountOfExplicitEntries; i ++)
{
EXPLICIT_ACCESS_W &ea = pListOfExplictEntries[i];
if (ea.grfAccessMode != GRANT_ACCESS) { continue; }
if (ea.grfAccessPermissions != GENERIC_ALL) { continue; }
if ((ea.grfInheritance & (CONTAINER_INHERIT_ACE|OBJECT_INHERIT_ACE)) != (CONTAINER_INHERIT_ACE|OBJECT_INHERIT_ACE)) { continue; }
if (ea.Trustee.TrusteeType == TRUSTEE_IS_SID)
{
}
bAdd = false;
}
}
if (bAdd)
{
EXPLICIT_ACCESS ea = {0};
ea.grfAccessMode = GRANT_ACCESS;
ea.grfAccessPermissions = GENERIC_ALL;
ea.grfInheritance = CONTAINER_INHERIT_ACE|OBJECT_INHERIT_ACE;
ea.Trustee.TrusteeType = TRUSTEE_IS_GROUP;
ea.Trustee.TrusteeForm = TRUSTEE_IS_NAME;
ea.Trustee.ptstrName = TEXT("Users");
ACL * pNewDACL = NULL;
SetEntriesInAcl(1,&ea,pOldDACL,&pNewDACL);
SetSecurityInfo(hDir,SE_FILE_OBJECT,DACL_SECURITY_INFORMATION,NULL,NULL,pNewDACL,NULL);
LocalFree(pNewDACL);
}
LocalFree(pSD);
}
CloseHandle(hDir);
}
}
return true;
}*/
void FixDirectories ( void )
{
CPath Directory(CPath::MODULE_DIRECTORY);
Directory.AppendDirectory("Config");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
Directory.UpDirectory();
Directory.AppendDirectory("Logs");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
Directory.UpDirectory();
Directory.AppendDirectory("Save");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
Directory.UpDirectory();
Directory.AppendDirectory("Screenshots");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
Directory.UpDirectory();
Directory.AppendDirectory("textures");
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
}
bool TerminatedExistingEmu()
{
bool bTerminated = false;
bool AskedUser = false;
DWORD pid = GetCurrentProcessId();
HANDLE nSearch = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if(nSearch != INVALID_HANDLE_VALUE)
{
PROCESSENTRY32 lppe;
memset(&lppe, 0, sizeof(PROCESSENTRY32));
lppe.dwSize = sizeof(PROCESSENTRY32);
stdstr ModuleName = CPath(CPath::MODULE_FILE).GetNameExtension();
if (Process32First(nSearch, &lppe))
{
do
{
if(_stricmp(lppe.szExeFile, ModuleName.c_str()) != 0 ||
lppe.th32ProcessID == pid)
{
continue;
}
if (!AskedUser)
{
AskedUser = true;
int res = MessageBox(NULL,stdstr_f("Project64.exe currently running\n\nTerminate pid %d now?",lppe.th32ProcessID).c_str(),"Terminate project64",MB_YESNO|MB_ICONEXCLAMATION);
if (res != IDYES)
{
break;
}
}
HANDLE hHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, lppe.th32ProcessID);
if(hHandle != NULL)
{
if (TerminateProcess(hHandle, 0))
{
bTerminated = true;
} else {
MessageBox(NULL,stdstr_f("Failed to terminate pid %d",lppe.th32ProcessID).c_str(),"Terminate project64 failed!",MB_YESNO|MB_ICONEXCLAMATION);
}
CloseHandle(hHandle);
}
} while (Process32Next(nSearch, &lppe));
}
CloseHandle(nSearch);
}
return bTerminated;
}
const char * AppName ( void )
{
static stdstr Name;
if (Name.empty())
{
Name = stdstr_f("Project64 %s", VER_FILE_VERSION_STR);
}
return Name.c_str();
}
#ifndef WINDOWS_UI
int main(int argc, char* argv[])
{
while (argc > 0)
{
puts(argv[--argc]);
}
putchar('\n');
fprintf(
stderr,
"Cross-platform (graphical/terminal?) UI not yet implemented.\n"
);
return 0;
}
#else
int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpszArgs*/, int /*nWinMode*/)
{
FixDirectories();
char *lbuffer = new char[10];
if (GetLocaleInfoA(LOCALE_SYSTEM_DEFAULT, LOCALE_SABBREVLANGNAME, lbuffer, 10))
setlocale(LC_ALL, lbuffer);
delete[] lbuffer;
CoInitialize(NULL);
try
{
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL );
g_Settings = new CSettings;
g_Settings->Initialize(AppName());
if (g_Settings->LoadBool(Setting_CheckEmuRunning) &&
TerminatedExistingEmu())
{
delete g_Settings;
g_Settings = new CSettings;
g_Settings->Initialize(AppName());
}
InitializeLog();
WriteTrace(TraceDebug,__FUNCTION__ ": Application Starting");
CMipsMemoryVM::ReserveMemory();
g_Notify = &Notify();
//Create the plugin container
WriteTrace(TraceDebug,__FUNCTION__ ": Create Plugins");
g_Plugins = new CPlugins(g_Settings->LoadStringVal(Directory_Plugin));
//Select the language
g_Lang = new CLanguage();
if (!g_Lang->LoadCurrentStrings())
{
CLanguageSelector().Select();
}
CoInitialize(NULL);
AppInit(&Notify());
if (!g_Lang->IsLanguageLoaded())
{
CLanguageSelector().Select();
}
//Create the main window with Menu
WriteTrace(TraceDebug,__FUNCTION__ ": Create Main Window");
stdstr WinTitle(AppName());
WinTitle.Format("Project64 %s", VER_FILE_VERSION_STR);
CMainGui MainWindow(true,WinTitle.c_str()), HiddenWindow(false);
WriteTrace(TraceDebug, __FUNCTION__ ": Create Main Window");
CMainGui MainWindow(true, stdstr_f("Project64 %s", VER_FILE_VERSION_STR).c_str()), HiddenWindow(false);
CMainMenu MainMenu(&MainWindow);
g_Plugins->SetRenderWindows(&MainWindow,&HiddenWindow);
Notify().SetMainWindow(&MainWindow);
g_Plugins->SetRenderWindows(&MainWindow, &HiddenWindow);
Notify().SetMainWindow(&MainWindow);
if (__argc > 1)
{
WriteTraceF(TraceDebug,__FUNCTION__ ": Cmd line found \"%s\"",__argv[1]);
WriteTraceF(TraceDebug, __FUNCTION__ ": Cmd line found \"%s\"", __argv[1]);
MainWindow.Show(true); //Show the main window
CN64System::RunFileImage(__argv[1]);
}
@ -256,21 +30,22 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
{
if (g_Settings->LoadDword(RomBrowser_Enabled))
{
WriteTrace(TraceDebug,__FUNCTION__ ": Show Rom Browser");
WriteTrace(TraceDebug, __FUNCTION__ ": Show Rom Browser");
//Display the rom browser
MainWindow.ShowRomList();
MainWindow.Show(true); //Show the main window
MainWindow.HighLightLastRom();
} else {
WriteTrace(TraceDebug,__FUNCTION__ ": Show Main Window");
}
else {
WriteTrace(TraceDebug, __FUNCTION__ ": Show Main Window");
MainWindow.Show(true); //Show the main window
}
}
//Process Messages till program is closed
WriteTrace(TraceDebug,__FUNCTION__ ": Entering Message Loop");
WriteTrace(TraceDebug, __FUNCTION__ ": Entering Message Loop");
MainWindow.ProcessAllMessages();
WriteTrace(TraceDebug,__FUNCTION__ ": Message Loop Finished");
WriteTrace(TraceDebug, __FUNCTION__ ": Message Loop Finished");
if (g_BaseSystem)
{
@ -278,28 +53,14 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
delete g_BaseSystem;
g_BaseSystem = NULL;
}
WriteTrace(TraceDebug,__FUNCTION__ ": System Closed");
g_Settings->UnregisterChangeCB(Debugger_AppLogLevel,LogFile,(CSettings::SettingChangedFunc)LogLevelChanged);
g_Settings->UnregisterChangeCB(Debugger_AppLogFlush,LogFile,(CSettings::SettingChangedFunc)LogFlushChanged);
WriteTrace(TraceDebug, __FUNCTION__ ": System Closed");
}
catch(...)
catch (...)
{
WriteTraceF(TraceError,__FUNCTION__ ": Exception caught (File: \"%s\" Line: %d)",__FILE__,__LINE__);
MessageBox(NULL,stdstr_f("Exception caught\nFile: %s\nLine: %d",__FILE__,__LINE__).c_str(),"Exception",MB_OK);
WriteTraceF(TraceError, __FUNCTION__ ": Exception caught (File: \"%s\" Line: %d)", __FILE__, __LINE__);
MessageBox(NULL, stdstr_f("Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__).c_str(), "Exception", MB_OK);
}
WriteTrace(TraceDebug,__FUNCTION__ ": cleaning up global objects");
if (g_Rom) { delete g_Rom; g_Rom = NULL; }
if (g_Plugins) { delete g_Plugins; g_Plugins = NULL; }
if (g_Settings) { delete g_Settings; g_Settings = NULL; }
if (g_Lang) { delete g_Lang; g_Lang = NULL; }
CMipsMemoryVM::FreeReservedMemory();
CoUninitialize();
WriteTrace(TraceDebug,__FUNCTION__ ": Done");
CloseTrace();
AppCleanup();
CoUninitialize();
return true;
}
#endif
}