code cleanup and try o make language work better

This commit is contained in:
zilmar 2015-03-04 20:36:08 +11:00
parent a347b829d1
commit 71cc6def7b
52 changed files with 2077 additions and 1635 deletions

View File

@ -709,7 +709,13 @@ public:
return (int)::SendMessage(m_hWnd, LB_ADDSTRING, 0, (LPARAM)lpszItem);
}
int DeleteString(UINT nIndex)
int AddStringW(LPCWSTR lpszItem)
{
ATLASSERT(::IsWindow(m_hWnd));
return (int)::SendMessageW(m_hWnd, LB_ADDSTRING, 0, (LPARAM)lpszItem);
}
int DeleteString(UINT nIndex)
{
ATLASSERT(::IsWindow(m_hWnd));
return (int)::SendMessage(m_hWnd, LB_DELETESTRING, nIndex, 0L);
@ -721,6 +727,12 @@ public:
return (int)::SendMessage(m_hWnd, LB_INSERTSTRING, nIndex, (LPARAM)lpszItem);
}
int InsertStringW(int nIndex, LPCWSTR lpszItem)
{
ATLASSERT(::IsWindow(m_hWnd));
return (int)::SendMessageW(m_hWnd, LB_INSERTSTRING, nIndex, (LPARAM)lpszItem);
}
#ifndef _WIN32_WCE
int Dir(UINT attr, LPCTSTR lpszWildCard)
{
@ -1085,7 +1097,13 @@ public:
return (int)::SendMessage(m_hWnd, CB_ADDSTRING, 0, (LPARAM)lpszString);
}
int DeleteString(UINT nIndex)
int AddStringW(LPCWSTR lpszString)
{
ATLASSERT(::IsWindow(m_hWnd));
return (int)::SendMessageW(m_hWnd, CB_ADDSTRING, 0, (LPARAM)lpszString);
}
int DeleteString(UINT nIndex)
{
ATLASSERT(::IsWindow(m_hWnd));
return (int)::SendMessage(m_hWnd, CB_DELETESTRING, nIndex, 0L);
@ -4410,7 +4428,25 @@ public:
return (HTREEITEM)::SendMessage(m_hWnd, TVM_INSERTITEM, 0, (LPARAM)&tvis);
}
BOOL DeleteItem(HTREEITEM hItem)
HTREEITEM InsertItemW(UINT nMask, LPCWSTR lpszItem, int nImage,
int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam,
HTREEITEM hParent, HTREEITEM hInsertAfter)
{
ATLASSERT(::IsWindow(m_hWnd));
TVINSERTSTRUCTW tvis = { 0 };
tvis.hParent = hParent;
tvis.hInsertAfter = hInsertAfter;
tvis.item.mask = nMask;
tvis.item.pszText = (LPWSTR) lpszItem;
tvis.item.iImage = nImage;
tvis.item.iSelectedImage = nSelectedImage;
tvis.item.state = nState;
tvis.item.stateMask = nStateMask;
tvis.item.lParam = lParam;
return (HTREEITEM)::SendMessageW(m_hWnd, TVM_INSERTITEMW, 0, (LPARAM)&tvis);
}
BOOL DeleteItem(HTREEITEM hItem)
{
ATLASSERT(::IsWindow(m_hWnd));
return (BOOL)::SendMessage(m_hWnd, TVM_DELETEITEM, 0, (LPARAM)hItem);

View File

@ -10,460 +10,459 @@
****************************************************************************/
#include "stdafx.h"
CLanguage * _Lang = NULL;
CLanguage * g_Lang = NULL;
void CLanguage::LoadDefaultStrings (void)
{
#define DEF_STR(ID,str) m_DefaultStrings.insert(LANG_STRINGS::value_type(ID,str))
DEF_STR(EMPTY_STRING, "" );
DEF_STR(INI_CURRENT_LANG, "Current Language" );
DEF_STR(INI_AUTHOR, "Author" );
DEF_STR(INI_VERSION, "Version" );
DEF_STR(INI_DATE, "Date" );
DEF_STR(INI_HOMEPAGE, "Visit Home Page" );
DEF_STR(INI_CURRENT_RDB, "ROM Database (.RDB)" );
DEF_STR(INI_CURRENT_CHT, "Cheat Code file (.CHT)" );
DEF_STR(INI_CURRENT_RDX, "Extended Rom Info (.RDX)");
DEF_STR(INI_TITLE, "About INI Files" );
DEF_STR(EMPTY_STRING, L"" );
DEF_STR(INI_CURRENT_LANG, L"Current Language" );
DEF_STR(INI_AUTHOR, L"Author" );
DEF_STR(INI_VERSION, L"Version" );
DEF_STR(INI_DATE, L"Date" );
DEF_STR(INI_HOMEPAGE, L"Visit Home Page" );
DEF_STR(INI_CURRENT_RDB, L"ROM Database (.RDB)" );
DEF_STR(INI_CURRENT_CHT, L"Cheat Code file (.CHT)" );
DEF_STR(INI_CURRENT_RDX, L"Extended Rom Info (.RDX)");
DEF_STR(INI_TITLE, L"About INI Files" );
DEF_STR(LANGUAGE_NAME, "" );
DEF_STR(LANGUAGE_AUTHOR, "" );
DEF_STR(LANGUAGE_VERSION, "" );
DEF_STR(LANGUAGE_DATE, "" );
DEF_STR(LANGUAGE_NAME, L"" );
DEF_STR(LANGUAGE_AUTHOR, L"" );
DEF_STR(LANGUAGE_VERSION, L"" );
DEF_STR(LANGUAGE_DATE, L"" );
/*********************************************************************************
* Numbers *
*********************************************************************************/
DEF_STR(NUMBER_0, "0" );
DEF_STR(NUMBER_1, "1" );
DEF_STR(NUMBER_2, "2" );
DEF_STR(NUMBER_3, "3" );
DEF_STR(NUMBER_4, "4" ),
DEF_STR(NUMBER_5, "5" );
DEF_STR(NUMBER_6, "6" );
DEF_STR(NUMBER_7, "7" );
DEF_STR(NUMBER_8, "8" );
DEF_STR(NUMBER_9, "9" );
DEF_STR(NUMBER_0, L"0" );
DEF_STR(NUMBER_1, L"1" );
DEF_STR(NUMBER_2, L"2" );
DEF_STR(NUMBER_3, L"3" );
DEF_STR(NUMBER_4, L"4" ),
DEF_STR(NUMBER_5, L"5" );
DEF_STR(NUMBER_6, L"6" );
DEF_STR(NUMBER_7, L"7" );
DEF_STR(NUMBER_8, L"8" );
DEF_STR(NUMBER_9, L"9" );
DEF_STR(MENU_FILE, "&File" );
DEF_STR(MENU_OPEN, "&Open Rom" );
DEF_STR(MENU_ROM_INFO, "Rom &Info...." );
DEF_STR(MENU_START, "Start Emulation" );
DEF_STR(MENU_END, "&End Emulation" );
DEF_STR(MENU_CHOOSE_ROM, "Choose Rom Directory..." );
DEF_STR(MENU_REFRESH, "Refresh Rom List" );
DEF_STR(MENU_RECENT_ROM, "Recent Rom" );
DEF_STR(MENU_RECENT_DIR, "Recent Rom Directories" );
DEF_STR(MENU_EXIT, "E&xit" );
DEF_STR(MENU_SYSTEM, "&System" );
DEF_STR(MENU_RESET, "&Reset" );
DEF_STR(MENU_RESET_SOFT, "&Soft Reset" );
DEF_STR(MENU_RESET_HARD, "&Hard Reset" );
DEF_STR(MENU_RESET, "&Reset" );
DEF_STR(MENU_PAUSE, "&Pause" );
DEF_STR(MENU_RESUME, "R&esume" );
DEF_STR(MENU_BITMAP, "Generate Bitmap" );
DEF_STR(MENU_LIMIT_FPS, "Limit FPS" );
DEF_STR(MENU_SAVE, "&Save" );
DEF_STR(MENU_SAVE_AS, "Save As..." );
DEF_STR(MENU_RESTORE, "&Restore" );
DEF_STR(MENU_LOAD, "Load..." );
DEF_STR(MENU_CURRENT_SAVE,"Current Save S&tate" );
DEF_STR(MENU_SLOT_DEFAULT,"Default" );
DEF_STR(MENU_SLOT_1, "Slot 1" );
DEF_STR(MENU_SLOT_2, "Slot 2" );
DEF_STR(MENU_SLOT_3, "Slot 3" );
DEF_STR(MENU_SLOT_4, "Slot 4" );
DEF_STR(MENU_SLOT_5, "Slot 5" );
DEF_STR(MENU_SLOT_6, "Slot 6" );
DEF_STR(MENU_SLOT_7, "Slot 7" );
DEF_STR(MENU_SLOT_8, "Slot 8" );
DEF_STR(MENU_SLOT_9, "Slot 9" );
DEF_STR(MENU_SLOT_10, "Slot 10" );
DEF_STR(MENU_CHEAT, "Cheats..." );
DEF_STR(MENU_GS_BUTTON, "GS Button" );
DEF_STR(MENU_OPTIONS, "&Options" );
DEF_STR(MENU_FULL_SCREEN, "&Full Screen" );
DEF_STR(MENU_ON_TOP, "&Always On &Top" );
DEF_STR(MENU_CONFG_GFX, "Configure Graphics Plugin..." );
DEF_STR(MENU_CONFG_AUDIO, "Configure Audio Plugin..." );
DEF_STR(MENU_CONFG_CTRL, "Configure Controller Plugin..." );
DEF_STR(MENU_CONFG_RSP, "Configure RSP Plugin..." );
DEF_STR(MENU_SHOW_CPU, "Show CPU usage %" );
DEF_STR(MENU_SETTINGS, "&Settings..." );
DEF_STR(MENU_DEBUGGER, "&Debugger" );
DEF_STR(MENU_LANGUAGE, "&Language" );
DEF_STR(MENU_HELP, "&Help" );
DEF_STR(MENU_ABOUT_INI, "About &INI Files" );
DEF_STR(MENU_ABOUT_PJ64, "&About Project 64" );
DEF_STR(MENU_FILE, L"&File" );
DEF_STR(MENU_OPEN, L"&Open Rom" );
DEF_STR(MENU_ROM_INFO, L"Rom &Info...." );
DEF_STR(MENU_START, L"Start Emulation" );
DEF_STR(MENU_END, L"&End Emulation" );
DEF_STR(MENU_CHOOSE_ROM, L"Choose Rom Directory..." );
DEF_STR(MENU_REFRESH, L"Refresh Rom List" );
DEF_STR(MENU_RECENT_ROM, L"Recent Rom" );
DEF_STR(MENU_RECENT_DIR, L"Recent Rom Directories" );
DEF_STR(MENU_EXIT, L"E&xit" );
DEF_STR(MENU_SYSTEM, L"&System" );
DEF_STR(MENU_RESET, L"&Reset" );
DEF_STR(MENU_RESET_SOFT, L"&Soft Reset" );
DEF_STR(MENU_RESET_HARD, L"&Hard Reset" );
DEF_STR(MENU_RESET, L"&Reset" );
DEF_STR(MENU_PAUSE, L"&Pause" );
DEF_STR(MENU_RESUME, L"R&esume" );
DEF_STR(MENU_BITMAP, L"Generate Bitmap" );
DEF_STR(MENU_LIMIT_FPS, L"Limit FPS" );
DEF_STR(MENU_SAVE, L"&Save" );
DEF_STR(MENU_SAVE_AS, L"Save As..." );
DEF_STR(MENU_RESTORE, L"&Restore" );
DEF_STR(MENU_LOAD, L"Load..." );
DEF_STR(MENU_CURRENT_SAVE,L"Current Save S&tate" );
DEF_STR(MENU_SLOT_DEFAULT,L"Default" );
DEF_STR(MENU_SLOT_1, L"Slot 1" );
DEF_STR(MENU_SLOT_2, L"Slot 2" );
DEF_STR(MENU_SLOT_3, L"Slot 3" );
DEF_STR(MENU_SLOT_4, L"Slot 4" );
DEF_STR(MENU_SLOT_5, L"Slot 5" );
DEF_STR(MENU_SLOT_6, L"Slot 6" );
DEF_STR(MENU_SLOT_7, L"Slot 7" );
DEF_STR(MENU_SLOT_8, L"Slot 8" );
DEF_STR(MENU_SLOT_9, L"Slot 9" );
DEF_STR(MENU_SLOT_10, L"Slot 10" );
DEF_STR(MENU_CHEAT, L"Cheats..." );
DEF_STR(MENU_GS_BUTTON, L"GS Button" );
DEF_STR(MENU_OPTIONS, L"&Options" );
DEF_STR(MENU_FULL_SCREEN, L"&Full Screen" );
DEF_STR(MENU_ON_TOP, L"&Always On &Top" );
DEF_STR(MENU_CONFG_GFX, L"Configure Graphics Plugin..." );
DEF_STR(MENU_CONFG_AUDIO, L"Configure Audio Plugin..." );
DEF_STR(MENU_CONFG_CTRL, L"Configure Controller Plugin..." );
DEF_STR(MENU_CONFG_RSP, L"Configure RSP Plugin..." );
DEF_STR(MENU_SHOW_CPU, L"Show CPU usage %" );
DEF_STR(MENU_SETTINGS, L"&Settings..." );
DEF_STR(MENU_DEBUGGER, L"&Debugger" );
DEF_STR(MENU_LANGUAGE, L"&Language" );
DEF_STR(MENU_HELP, L"&Help" );
DEF_STR(MENU_ABOUT_INI, L"About &INI Files" );
DEF_STR(MENU_ABOUT_PJ64, L"&About Project 64" );
//Alternate Name to save Slot
DEF_STR(SAVE_SLOT_DEFAULT,"Save Slot - Default" );
DEF_STR(SAVE_SLOT_1, "Save Slot - 1" );
DEF_STR(SAVE_SLOT_2, "Save Slot - 2" );
DEF_STR(SAVE_SLOT_3, "Save Slot - 3" );
DEF_STR(SAVE_SLOT_4, "Save Slot - 4" );
DEF_STR(SAVE_SLOT_5, "Save Slot - 5" );
DEF_STR(SAVE_SLOT_6, "Save Slot - 6" );
DEF_STR(SAVE_SLOT_7, "Save Slot - 7" );
DEF_STR(SAVE_SLOT_8, "Save Slot - 8" );
DEF_STR(SAVE_SLOT_9, "Save Slot - 9" );
DEF_STR(SAVE_SLOT_10, "Save Slot - 10" );
DEF_STR(SAVE_SLOT_DEFAULT,L"Save Slot - Default" );
DEF_STR(SAVE_SLOT_1, L"Save Slot - 1" );
DEF_STR(SAVE_SLOT_2, L"Save Slot - 2" );
DEF_STR(SAVE_SLOT_3, L"Save Slot - 3" );
DEF_STR(SAVE_SLOT_4, L"Save Slot - 4" );
DEF_STR(SAVE_SLOT_5, L"Save Slot - 5" );
DEF_STR(SAVE_SLOT_6, L"Save Slot - 6" );
DEF_STR(SAVE_SLOT_7, L"Save Slot - 7" );
DEF_STR(SAVE_SLOT_8, L"Save Slot - 8" );
DEF_STR(SAVE_SLOT_9, L"Save Slot - 9" );
DEF_STR(SAVE_SLOT_10, L"Save Slot - 10" );
//Pop up Menu
DEF_STR(POPUP_PLAY, "Play Game" );
DEF_STR(POPUP_INFO, "Rom Information" );
DEF_STR(POPUP_SETTINGS, "Edit Game Settings" );
DEF_STR(POPUP_CHEATS, "Edit Cheats" );
DEF_STR(POPUP_GFX_PLUGIN,"GFX Plugin" );
DEF_STR(POPUP_PLAY, L"Play Game" );
DEF_STR(POPUP_INFO, L"Rom Information" );
DEF_STR(POPUP_SETTINGS, L"Edit Game Settings" );
DEF_STR(POPUP_CHEATS, L"Edit Cheats" );
DEF_STR(POPUP_GFX_PLUGIN,L"GFX Plugin" );
/*********************************************************************************
* Rom Browser *
*********************************************************************************/
//Rom Browser Fields
DEF_STR(RB_FILENAME, "File Name" );
DEF_STR(RB_INTERNALNAME, "Internal Name" );
DEF_STR(RB_GOODNAME, "Good Name" );
DEF_STR(RB_STATUS, "Status" );
DEF_STR(RB_ROMSIZE, "Rom Size" );
DEF_STR(RB_NOTES_CORE, "Notes (Core)" );
DEF_STR(RB_NOTES_PLUGIN, "Notes (default plugins)" );
DEF_STR(RB_NOTES_USER, "Notes (User)" );
DEF_STR(RB_CART_ID, "Cartridge ID" );
DEF_STR(RB_MANUFACTUER, "Manufacturer" );
DEF_STR(RB_COUNTRY, "Country" );
DEF_STR(RB_DEVELOPER, "Developer" );
DEF_STR(RB_CRC1, "CRC1" );
DEF_STR(RB_CRC2, "CRC2" );
DEF_STR(RB_CICCHIP, "CIC Chip" );
DEF_STR(RB_RELEASE_DATE, "Release Date" );
DEF_STR(RB_GENRE, "Genre" );
DEF_STR(RB_PLAYERS, "Players" );
DEF_STR(RB_FORCE_FEEDBACK,"Force Feedback" );
DEF_STR(RB_FILE_FORMAT, "File Format" );
DEF_STR(RB_FILENAME, L"File Name" );
DEF_STR(RB_INTERNALNAME, L"Internal Name" );
DEF_STR(RB_GOODNAME, L"Good Name" );
DEF_STR(RB_STATUS, L"Status" );
DEF_STR(RB_ROMSIZE, L"Rom Size" );
DEF_STR(RB_NOTES_CORE, L"Notes (Core)" );
DEF_STR(RB_NOTES_PLUGIN, L"Notes (default plugins)" );
DEF_STR(RB_NOTES_USER, L"Notes (User)" );
DEF_STR(RB_CART_ID, L"Cartridge ID" );
DEF_STR(RB_MANUFACTUER, L"Manufacturer" );
DEF_STR(RB_COUNTRY, L"Country" );
DEF_STR(RB_DEVELOPER, L"Developer" );
DEF_STR(RB_CRC1, L"CRC1" );
DEF_STR(RB_CRC2, L"CRC2" );
DEF_STR(RB_CICCHIP, L"CIC Chip" );
DEF_STR(RB_RELEASE_DATE, L"Release Date" );
DEF_STR(RB_GENRE, L"Genre" );
DEF_STR(RB_PLAYERS, L"Players" );
DEF_STR(RB_FORCE_FEEDBACK,L"Force Feedback" );
DEF_STR(RB_FILE_FORMAT, L"File Format" );
//Select Rom
DEF_STR(SELECT_ROM_DIR, "Select current Rom Directory" );
DEF_STR(SELECT_ROM_DIR, L"Select current Rom Directory" );
//Messages
DEF_STR(RB_NOT_GOOD_FILE,"Bad ROM? Use GoodN64 & check for updated INI" );
DEF_STR(RB_NOT_GOOD_FILE,"Bad ROM? Use GoodN64 & check for updated INI" );
DEF_STR(RB_NOT_GOOD_FILE,L"Bad ROM? Use GoodN64 & check for updated INI" );
/*********************************************************************************
* Options *
*********************************************************************************/
//Options Title
DEF_STR(OPTIONS_TITLE,"Settings");
DEF_STR(OPTIONS_TITLE,L"Settings");
//Tabs
DEF_STR(TAB_PLUGIN, "Plugins");
DEF_STR(TAB_DIRECTORY, "Directories");
DEF_STR(TAB_OPTIONS, "Options");
DEF_STR(TAB_ROMSELECTION,"Rom Selection");
DEF_STR(TAB_ADVANCED, "Advanced");
DEF_STR(TAB_ROMSETTINGS, "General Settings");
DEF_STR(TAB_ROMNOTES, "Notes");
DEF_STR(TAB_SHELLINTERGATION,"Shell Integration");
DEF_STR(TAB_SHORTCUTS, "Keyboard Shortcuts");
DEF_STR(TAB_ROMSTATUS, "Status");
DEF_STR(TAB_RECOMPILER, "Recompiler");
DEF_STR(TAB_PLUGIN, L"Plugins");
DEF_STR(TAB_DIRECTORY, L"Directories");
DEF_STR(TAB_OPTIONS, L"Options");
DEF_STR(TAB_ROMSELECTION,L"Rom Selection");
DEF_STR(TAB_ADVANCED, L"Advanced");
DEF_STR(TAB_ROMSETTINGS, L"General Settings");
DEF_STR(TAB_ROMNOTES, L"Notes");
DEF_STR(TAB_SHELLINTERGATION,L"Shell Integration");
DEF_STR(TAB_SHORTCUTS, L"Keyboard Shortcuts");
DEF_STR(TAB_ROMSTATUS, L"Status");
DEF_STR(TAB_RECOMPILER, L"Recompiler");
//Plugin Dialog
DEF_STR(PLUG_ABOUT, "About");
DEF_STR(PLUG_RSP, " Reality Signal Processor plugin: ");
DEF_STR(PLUG_GFX, " Video (graphics) plugin: ");
DEF_STR(PLUG_AUDIO, " Audio (sound) plugin: ");
DEF_STR(PLUG_CTRL, " Input (controller) plugin: ");
DEF_STR(PLUG_HLE_GFX, "Use High Level GFX?");
DEF_STR(PLUG_HLE_AUDIO,"Use High Level Audio?");
DEF_STR(PLUG_DEFAULT, "** Use System Plugin **");
DEF_STR(PLUG_ABOUT, L"About");
DEF_STR(PLUG_RSP, L" Reality Signal Processor plugin: ");
DEF_STR(PLUG_GFX, L" Video (graphics) plugin: ");
DEF_STR(PLUG_AUDIO, L" Audio (sound) plugin: ");
DEF_STR(PLUG_CTRL, L" Input (controller) plugin: ");
DEF_STR(PLUG_HLE_GFX, L"Use High Level GFX?");
DEF_STR(PLUG_HLE_AUDIO,L"Use High Level Audio?");
DEF_STR(PLUG_DEFAULT, L"** Use System Plugin **");
//Directory Dialog
DEF_STR(DIR_PLUGIN, " Plugin Directoy: ");
DEF_STR(DIR_ROM, " Rom Directory: ");
DEF_STR(DIR_AUTO_SAVE, " N64 Auto saves: ");
DEF_STR(DIR_INSTANT_SAVE, " Instant saves: ");
DEF_STR(DIR_SCREEN_SHOT, " Screen Shots: ");
DEF_STR(DIR_ROM_DEFAULT, "Last folder that a rom was open from.");
DEF_STR(DIR_SELECT_PLUGIN, "Select plugin directory");
DEF_STR(DIR_SELECT_ROM, "Select rom directory");
DEF_STR(DIR_SELECT_AUTO, "Select automatic save directory");
DEF_STR(DIR_SELECT_INSTANT,"Select instant save directory");
DEF_STR(DIR_SELECT_SCREEN, "Select snap shot directory");
DEF_STR(DIR_TEXTURE, " Texture Directory: ");
DEF_STR(DIR_SELECT_TEXTURE, "Select texture pack directory");
DEF_STR(DIR_PLUGIN, L" Plugin Directoy: ");
DEF_STR(DIR_ROM, L" Rom Directory: ");
DEF_STR(DIR_AUTO_SAVE, L" N64 Auto saves: ");
DEF_STR(DIR_INSTANT_SAVE, L" Instant saves: ");
DEF_STR(DIR_SCREEN_SHOT, L" Screen Shots: ");
DEF_STR(DIR_ROM_DEFAULT, L"Last folder that a rom was open from.");
DEF_STR(DIR_SELECT_PLUGIN, L"Select plugin directory");
DEF_STR(DIR_SELECT_ROM, L"Select rom directory");
DEF_STR(DIR_SELECT_AUTO, L"Select automatic save directory");
DEF_STR(DIR_SELECT_INSTANT,L"Select instant save directory");
DEF_STR(DIR_SELECT_SCREEN, L"Select snap shot directory");
DEF_STR(DIR_TEXTURE, L" Texture Directory: ");
DEF_STR(DIR_SELECT_TEXTURE, L"Select texture pack directory");
//Options (general) Tab
DEF_STR(OPTION_AUTO_SLEEP, "Pause emulation when window is not active?");
DEF_STR(OPTION_AUTO_FULLSCREEN, "On loading a ROM go to full screen");
DEF_STR(OPTION_BASIC_MODE, "Hide Advanced Settings");
DEF_STR(OPTION_REMEMBER_CHEAT, "Remember selected cheats");
DEF_STR(OPTION_DISABLE_SS, "Disable Screen Saver when running rom");
DEF_STR(OPTION_DISPLAY_FR, "Display Frame Rate");
DEF_STR(OPTION_CHANGE_FR, "Change Frame Rate Display Type");
DEF_STR(OPTION_AUTO_SLEEP, L"Pause emulation when window is not active?");
DEF_STR(OPTION_AUTO_FULLSCREEN, L"On loading a ROM go to full screen");
DEF_STR(OPTION_BASIC_MODE, L"Hide Advanced Settings");
DEF_STR(OPTION_REMEMBER_CHEAT, L"Remember selected cheats");
DEF_STR(OPTION_DISABLE_SS, L"Disable Screen Saver when running rom");
DEF_STR(OPTION_DISPLAY_FR, L"Display Frame Rate");
DEF_STR(OPTION_CHANGE_FR, L"Change Frame Rate Display Type");
//Rom Browser Tab
DEF_STR(RB_MAX_ROMS, "Max # of Roms Remembered (Max 10):");
DEF_STR(RB_ROMS, "roms");
DEF_STR(RB_MAX_DIRS, "Max # of Rom Dirs Remembered (Max 10):");
DEF_STR(RB_DIRS, "dirs");
DEF_STR(RB_USE, "Use Rom Browser");
DEF_STR(RB_DIR_RECURSION, "Use Directory recursion");
DEF_STR(RB_AVALIABLE_FIELDS, "Available fields:");
DEF_STR(RB_SHOW_FIELDS, "Show fields in this order:");
DEF_STR(RB_ADD, "Add ->");
DEF_STR(RB_REMOVE, "<- Remove");
DEF_STR(RB_UP, "Up");
DEF_STR(RB_DOWN, "Down");
DEF_STR(RB_REFRESH, "Automatically refresh browser");
DEF_STR(RB_MAX_ROMS, L"Max # of Roms Remembered (Max 10):");
DEF_STR(RB_ROMS, L"roms");
DEF_STR(RB_MAX_DIRS, L"Max # of Rom Dirs Remembered (Max 10):");
DEF_STR(RB_DIRS, L"dirs");
DEF_STR(RB_USE, L"Use Rom Browser");
DEF_STR(RB_DIR_RECURSION, L"Use Directory recursion");
DEF_STR(RB_AVALIABLE_FIELDS, L"Available fields:");
DEF_STR(RB_SHOW_FIELDS, L"Show fields in this order:");
DEF_STR(RB_ADD, L"Add ->");
DEF_STR(RB_REMOVE, L"<- Remove");
DEF_STR(RB_UP, L"Up");
DEF_STR(RB_DOWN, L"Down");
DEF_STR(RB_REFRESH, L"Automatically refresh browser");
//Advanced Options
DEF_STR(ADVANCE_INFO, "Most of these changes will not take effect till a new rom is opened or current rom is reset.");
DEF_STR(ADVANCE_DEFAULTS, "Core Defaults");
DEF_STR(ADVANCE_CPU_STYLE, "CPU core style:");
DEF_STR(ADVANCE_SMCM, "Self-mod code method:");
DEF_STR(ADVANCE_MEM_SIZE, "Default Memory Size:");
DEF_STR(ADVANCE_ABL, "Advanced Block Linking:");
DEF_STR(ADVANCE_AUTO_START, "Start Emulation when rom is opened?");
DEF_STR(ADVANCE_OVERWRITE, "Always overwrite default settings with ones from ini?");
DEF_STR(ADVANCE_COMPRESS, "Automatically compress instant saves");
DEF_STR(ADVANCE_DEBUGGER, "Enable Debugger");
DEF_STR(ADVANCE_SMM_CACHE, "Cache");
DEF_STR(ADVANCE_SMM_PIDMA, "PI DMA");
DEF_STR(ADVANCE_SMM_VALIDATE,"Start Changed");
DEF_STR(ADVANCE_SMM_PROTECT, "Protect Memory");
DEF_STR(ADVANCE_SMM_TLB, "TLB Unmapping");
DEF_STR(ADVANCE_INFO, L"Most of these changes will not take effect till a new rom is opened or current rom is reset.");
DEF_STR(ADVANCE_DEFAULTS, L"Core Defaults");
DEF_STR(ADVANCE_CPU_STYLE, L"CPU core style:");
DEF_STR(ADVANCE_SMCM, L"Self-mod code method:");
DEF_STR(ADVANCE_MEM_SIZE, L"Default Memory Size:");
DEF_STR(ADVANCE_ABL, L"Advanced Block Linking:");
DEF_STR(ADVANCE_AUTO_START, L"Start Emulation when rom is opened?");
DEF_STR(ADVANCE_OVERWRITE, L"Always overwrite default settings with ones from ini?");
DEF_STR(ADVANCE_COMPRESS, L"Automatically compress instant saves");
DEF_STR(ADVANCE_DEBUGGER, L"Enable Debugger");
DEF_STR(ADVANCE_SMM_CACHE, L"Cache");
DEF_STR(ADVANCE_SMM_PIDMA, L"PI DMA");
DEF_STR(ADVANCE_SMM_VALIDATE,L"Start Changed");
DEF_STR(ADVANCE_SMM_PROTECT, L"Protect Memory");
DEF_STR(ADVANCE_SMM_TLB, L"TLB Unmapping");
//Rom Options
DEF_STR(ROM_CPU_STYLE, "CPU core style:");
DEF_STR(ROM_MEM_SIZE, "Memory Size:");
DEF_STR(ROM_ABL, "Advanced Block Linking:");
DEF_STR(ROM_SAVE_TYPE, "Default Save type:");
DEF_STR(ROM_COUNTER_FACTOR, "Counter Factor:");
DEF_STR(ROM_LARGE_BUFFER, "Larger Compile Buffer");
DEF_STR(ROM_USE_TLB, "Use TLB");
DEF_STR(ROM_REG_CACHE, "Register caching");
DEF_STR(ROM_DELAY_SI, "Delay SI Interrupt");
DEF_STR(ROM_SP_HACK, "SP Hack");
DEF_STR(ROM_DEFAULT, "Default");
DEF_STR(ROM_AUDIO_SIGNAL, "RSP Audio Signal");
DEF_STR(ROM_FIXED_AUDIO, "Fixed Audio Timing");
DEF_STR(ROM_FUNC_FIND, "Function lookup method:");
DEF_STR(ROM_CUSTOM_SMM, "Custom Self Mod Method");
DEF_STR(ROM_SYNC_AUDIO, "Sync using Audio");
DEF_STR(ROM_CPU_STYLE, L"CPU core style:");
DEF_STR(ROM_MEM_SIZE, L"Memory Size:");
DEF_STR(ROM_ABL, L"Advanced Block Linking:");
DEF_STR(ROM_SAVE_TYPE, L"Default Save type:");
DEF_STR(ROM_COUNTER_FACTOR, L"Counter Factor:");
DEF_STR(ROM_LARGE_BUFFER, L"Larger Compile Buffer");
DEF_STR(ROM_USE_TLB, L"Use TLB");
DEF_STR(ROM_REG_CACHE, L"Register caching");
DEF_STR(ROM_DELAY_SI, L"Delay SI Interrupt");
DEF_STR(ROM_SP_HACK, L"SP Hack");
DEF_STR(ROM_DEFAULT, L"Default");
DEF_STR(ROM_AUDIO_SIGNAL, L"RSP Audio Signal");
DEF_STR(ROM_FIXED_AUDIO, L"Fixed Audio Timing");
DEF_STR(ROM_FUNC_FIND, L"Function lookup method:");
DEF_STR(ROM_CUSTOM_SMM, L"Custom Self Mod Method");
DEF_STR(ROM_SYNC_AUDIO, L"Sync using Audio");
//Core Styles
DEF_STR(CORE_INTERPTER, "Interpreter");
DEF_STR(CORE_RECOMPILER, "Recompiler");
DEF_STR(CORE_SYNC, "Synchronise Cores");
DEF_STR(CORE_INTERPTER, L"Interpreter");
DEF_STR(CORE_RECOMPILER, L"Recompiler");
DEF_STR(CORE_SYNC, L"Synchronise Cores");
//Self Mod Methods
DEF_STR(SMCM_NONE, "None");
DEF_STR(SMCM_CACHE, "Cache");
DEF_STR(SMCM_PROECTED, "Protect Memory");
DEF_STR(SMCM_CHECK_MEM, "Check Memory & Cache");
DEF_STR(SMCM_CHANGE_MEM, "Change Memory & Cache");
DEF_STR(SMCM_CHECK_ADV, "Check Memory Advance");
DEF_STR(SMCM_CACHE2, "Clear Code on Cache");
DEF_STR(SMCM_NONE, L"None");
DEF_STR(SMCM_CACHE, L"Cache");
DEF_STR(SMCM_PROECTED, L"Protect Memory");
DEF_STR(SMCM_CHECK_MEM, L"Check Memory & Cache");
DEF_STR(SMCM_CHANGE_MEM, L"Change Memory & Cache");
DEF_STR(SMCM_CHECK_ADV, L"Check Memory Advance");
DEF_STR(SMCM_CACHE2, L"Clear Code on Cache");
//Function Lookup memthod
DEF_STR(FLM_PLOOKUP, "Physical Lookup Table");
DEF_STR(FLM_VLOOKUP, "Virtual Lookup Table");
DEF_STR(FLM_CHANGEMEM, "Change Memory");
DEF_STR(FLM_PLOOKUP, L"Physical Lookup Table");
DEF_STR(FLM_VLOOKUP, L"Virtual Lookup Table");
DEF_STR(FLM_CHANGEMEM, L"Change Memory");
//RDRAM Size
DEF_STR(RDRAM_4MB, "4 MB");
DEF_STR(RDRAM_8MB, "8 MB");
DEF_STR(RDRAM_4MB, L"4 MB");
DEF_STR(RDRAM_8MB, L"8 MB");
//Advanced Block Linking
DEF_STR(ABL_ON, "On");
DEF_STR(ABL_OFF, "Off");
DEF_STR(ABL_ON, L"On");
DEF_STR(ABL_OFF, L"Off");
//Save Type
DEF_STR(SAVE_FIRST_USED, "Use First Used Save Type");
DEF_STR(SAVE_4K_EEPROM, "4kbit Eeprom");
DEF_STR(SAVE_16K_EEPROM, "16kbit Eeprom");
DEF_STR(SAVE_SRAM, "32kbytes SRAM");
DEF_STR(SAVE_FLASHRAM, "Flashram");
DEF_STR(SAVE_FIRST_USED, L"Use First Used Save Type");
DEF_STR(SAVE_4K_EEPROM, L"4kbit Eeprom");
DEF_STR(SAVE_16K_EEPROM, L"16kbit Eeprom");
DEF_STR(SAVE_SRAM, L"32kbytes SRAM");
DEF_STR(SAVE_FLASHRAM, L"Flashram");
//Shell Intergration Tab
DEF_STR(SHELL_TEXT, "File extension association:");
DEF_STR(SHELL_TEXT, L"File extension association:");
//Rom Notes
DEF_STR(NOTE_STATUS, "Rom Status:");
DEF_STR(NOTE_CORE, "Core Note:");
DEF_STR(NOTE_PLUGIN, "Plugin Note:");
DEF_STR(NOTE_STATUS, L"Rom Status:");
DEF_STR(NOTE_CORE, L"Core Note:");
DEF_STR(NOTE_PLUGIN, L"Plugin Note:");
// Accelerator Selector
DEF_STR(ACCEL_CPUSTATE_TITLE, "CPU State:");
DEF_STR(ACCEL_MENUITEM_TITLE, "Menu Item:");
DEF_STR(ACCEL_CURRENTKEYS_TITLE, "Current Keys:");
DEF_STR(ACCEL_SELKEY_TITLE, "Select New Shortcut Key:");
DEF_STR(ACCEL_ASSIGNEDTO_TITLE, "Currently Assigned To:");
DEF_STR(ACCEL_ASSIGN_BTN, "Assign");
DEF_STR(ACCEL_REMOVE_BTN, "Remove");
DEF_STR(ACCEL_RESETALL_BTN, "Reset All");
DEF_STR(ACCEL_CPUSTATE_1, "Game not playing");
DEF_STR(ACCEL_CPUSTATE_2, "Game playing");
DEF_STR(ACCEL_CPUSTATE_3, "Game playing (windowed)");
DEF_STR(ACCEL_CPUSTATE_4, "Game playing (Fullscreen)");
DEF_STR(ACCEL_CPUSTATE_TITLE, L"CPU State:");
DEF_STR(ACCEL_MENUITEM_TITLE, L"Menu Item:");
DEF_STR(ACCEL_CURRENTKEYS_TITLE, L"Current Keys:");
DEF_STR(ACCEL_SELKEY_TITLE, L"Select New Shortcut Key:");
DEF_STR(ACCEL_ASSIGNEDTO_TITLE, L"Currently Assigned To:");
DEF_STR(ACCEL_ASSIGN_BTN, L"Assign");
DEF_STR(ACCEL_REMOVE_BTN, L"Remove");
DEF_STR(ACCEL_RESETALL_BTN, L"Reset All");
DEF_STR(ACCEL_CPUSTATE_1, L"Game not playing");
DEF_STR(ACCEL_CPUSTATE_2, L"Game playing");
DEF_STR(ACCEL_CPUSTATE_3, L"Game playing (windowed)");
DEF_STR(ACCEL_CPUSTATE_4, L"Game playing (Fullscreen)");
// Frame Rate Option
DEF_STR(STR_FR_VIS, "Vertical Interupts per second");
DEF_STR(STR_FR_DLS, "Display Lists per second");
DEF_STR(STR_FR_PERCENT, "Percent of Speed");
DEF_STR(STR_FR_VIS, L"Vertical Interupts per second");
DEF_STR(STR_FR_DLS, L"Display Lists per second");
DEF_STR(STR_FR_PERCENT, L"Percent of Speed");
// Increase speed
DEF_STR(STR_INSREASE_SPEED, "Increase Game Speed");
DEF_STR(STR_DECREASE_SPEED, "Decrease Game Speed");
DEF_STR(STR_INSREASE_SPEED, L"Increase Game Speed");
DEF_STR(STR_DECREASE_SPEED, L"Decrease Game Speed");
/*********************************************************************************
* ROM Information *
*********************************************************************************/
//Rom Info Title Title
DEF_STR(INFO_TITLE, "Rom Information");
DEF_STR(INFO_TITLE, L"Rom Information");
//Rom Info Text
DEF_STR(INFO_ROM_NAME_TEXT, "ROM Name:");
DEF_STR(INFO_FILE_NAME_TEXT, "File Name:");
DEF_STR(INFO_LOCATION_TEXT, "Location:");
DEF_STR(INFO_SIZE_TEXT, "Rom Size:");
DEF_STR(INFO_CART_ID_TEXT, "Cartridge ID:");
DEF_STR(INFO_MANUFACTURER_TEXT, "Manufacturer:");
DEF_STR(INFO_COUNTRY_TEXT, "Country:");
DEF_STR(INFO_CRC1_TEXT, "CRC1:");
DEF_STR(INFO_CRC2_TEXT, "CRC2:");
DEF_STR(INFO_CIC_CHIP_TEXT, "CIC Chip:");
DEF_STR(INFO_MD5_TEXT, "MD5:");
DEF_STR(INFO_ROM_NAME_TEXT, L"ROM Name:");
DEF_STR(INFO_FILE_NAME_TEXT, L"File Name:");
DEF_STR(INFO_LOCATION_TEXT, L"Location:");
DEF_STR(INFO_SIZE_TEXT, L"Rom Size:");
DEF_STR(INFO_CART_ID_TEXT, L"Cartridge ID:");
DEF_STR(INFO_MANUFACTURER_TEXT, L"Manufacturer:");
DEF_STR(INFO_COUNTRY_TEXT, L"Country:");
DEF_STR(INFO_CRC1_TEXT, L"CRC1:");
DEF_STR(INFO_CRC2_TEXT, L"CRC2:");
DEF_STR(INFO_CIC_CHIP_TEXT, L"CIC Chip:");
DEF_STR(INFO_MD5_TEXT, L"MD5:");
/*********************************************************************************
* Cheats *
*********************************************************************************/
//Cheat List
DEF_STR(CHEAT_TITLE, "Cheats");
DEF_STR(CHEAT_LIST_FRAME, "Cheats:");
DEF_STR(CHEAT_NOTES_FRAME, " Notes: ");
DEF_STR(CHEAT_MARK_ALL, "Mark All");
DEF_STR(CHEAT_MARK_NONE, "Unmark All");
DEF_STR(CHEAT_TITLE, L"Cheats");
DEF_STR(CHEAT_LIST_FRAME, L"Cheats:");
DEF_STR(CHEAT_NOTES_FRAME, L" Notes: ");
DEF_STR(CHEAT_MARK_ALL, L"Mark All");
DEF_STR(CHEAT_MARK_NONE, L"Unmark All");
//Add Cheat
DEF_STR(CHEAT_ADDCHEAT_FRAME, "Add Cheat");
DEF_STR(CHEAT_ADDCHEAT_NAME, "Name:");
DEF_STR(CHEAT_ADDCHEAT_CODE, "Code:");
DEF_STR(CHEAT_ADDCHEAT_INSERT, "Insert");
DEF_STR(CHEAT_ADDCHEAT_CLEAR, "Clear");
DEF_STR(CHEAT_ADDCHEAT_NOTES, " Cheat Notes: ");
DEF_STR(CHEAT_ADD_TO_DB, "Add to DB");
DEF_STR(CHEAT_ADDCHEAT_ADD, "Add Cheat");
DEF_STR(CHEAT_ADDCHEAT_NEW, "New Cheat");
DEF_STR(CHEAT_ADDCHEAT_CODEDES,"<address> <value>");
DEF_STR(CHEAT_ADDCHEAT_OPT, "Options:");
DEF_STR(CHEAT_ADDCHEAT_OPTDES, "<value> <label>");
DEF_STR(CHEAT_ADDCHEAT_FRAME, L"Add Cheat");
DEF_STR(CHEAT_ADDCHEAT_NAME, L"Name:");
DEF_STR(CHEAT_ADDCHEAT_CODE, L"Code:");
DEF_STR(CHEAT_ADDCHEAT_INSERT, L"Insert");
DEF_STR(CHEAT_ADDCHEAT_CLEAR, L"Clear");
DEF_STR(CHEAT_ADDCHEAT_NOTES, L" Cheat Notes: ");
DEF_STR(CHEAT_ADD_TO_DB, L"Add to DB");
DEF_STR(CHEAT_ADDCHEAT_ADD, L"Add Cheat");
DEF_STR(CHEAT_ADDCHEAT_NEW, L"New Cheat");
DEF_STR(CHEAT_ADDCHEAT_CODEDES,L"<address> <value>");
DEF_STR(CHEAT_ADDCHEAT_OPT, L"Options:");
DEF_STR(CHEAT_ADDCHEAT_OPTDES, L"<value> <label>");
//Code extension
DEF_STR(CHEAT_CODE_EXT_TITLE, "Code Extensions");
DEF_STR(CHEAT_CODE_EXT_TXT, "Please choose a value to be used for:");
DEF_STR(CHEAT_OK, "OK");
DEF_STR(CHEAT_CANCEL, "Cancel");
DEF_STR(CHEAT_CODE_EXT_TITLE, L"Code Extensions");
DEF_STR(CHEAT_CODE_EXT_TXT, L"Please choose a value to be used for:");
DEF_STR(CHEAT_OK, L"OK");
DEF_STR(CHEAT_CANCEL, L"Cancel");
//Digital Value
DEF_STR(CHEAT_QUANTITY_TITLE, "Quantity Digit");
DEF_STR(CHEAT_CHOOSE_VALUE, "Please choose a value for:");
DEF_STR(CHEAT_VALUE, "&Value");
DEF_STR(CHEAT_FROM, "from");
DEF_STR(CHEAT_TO, "to");
DEF_STR(CHEAT_NOTES, "&Notes:");
DEF_STR(CHEAT_QUANTITY_TITLE, L"Quantity Digit");
DEF_STR(CHEAT_CHOOSE_VALUE, L"Please choose a value for:");
DEF_STR(CHEAT_VALUE, L"&Value");
DEF_STR(CHEAT_FROM, L"from");
DEF_STR(CHEAT_TO, L"to");
DEF_STR(CHEAT_NOTES, L"&Notes:");
//Edit Cheat
DEF_STR(CHEAT_EDITCHEAT_WINDOW,"Edit Cheat");
DEF_STR(CHEAT_EDITCHEAT_UPDATE,"Update Cheat");
DEF_STR(CHEAT_CHANGED_MSG, "Cheat has been changed do you want to update?");
DEF_STR(CHEAT_CHANGED_TITLE, "Cheat Updated");
DEF_STR(CHEAT_EDITCHEAT_WINDOW,L"Edit Cheat");
DEF_STR(CHEAT_EDITCHEAT_UPDATE,L"Update Cheat");
DEF_STR(CHEAT_CHANGED_MSG, L"Cheat has been changed do you want to update?");
DEF_STR(CHEAT_CHANGED_TITLE, L"Cheat Updated");
//Cheat Popup Menu
DEF_STR(CHEAT_ADDNEW, "Add New Cheat...");
DEF_STR(CHEAT_EDIT, "Edit");
DEF_STR(CHEAT_DELETE, "Delete");
DEF_STR(CHEAT_ADDNEW, L"Add New Cheat...");
DEF_STR(CHEAT_EDIT, L"Edit");
DEF_STR(CHEAT_DELETE, L"Delete");
// short cut editor
DEF_STR(STR_SHORTCUT_RESET_TITLE, "Reset Short Cuts");
DEF_STR(STR_SHORTCUT_RESET_TEXT, "Are you sure you want to reset the short cuts?\n\nThis action cannot be undone.");
DEF_STR(STR_SHORTCUT_FILEMENU, "File Menu");
DEF_STR(STR_SHORTCUT_SYSTEMMENU, "System Menu");
DEF_STR(STR_SHORTCUT_OPTIONS, "Options");
DEF_STR(STR_SHORTCUT_SAVESLOT, "Save Slots");
DEF_STR(STR_SHORTCUT_RESET_TITLE, L"Reset Short Cuts");
DEF_STR(STR_SHORTCUT_RESET_TEXT, L"Are you sure you want to reset the short cuts?\n\nThis action cannot be undone.");
DEF_STR(STR_SHORTCUT_FILEMENU, L"File Menu");
DEF_STR(STR_SHORTCUT_SYSTEMMENU, L"System Menu");
DEF_STR(STR_SHORTCUT_OPTIONS, L"Options");
DEF_STR(STR_SHORTCUT_SAVESLOT, L"Save Slots");
/*********************************************************************************
* Messages *
*********************************************************************************/
DEF_STR(MSG_CPU_PAUSED, "*** CPU PAUSED ***");
DEF_STR(MSG_CPU_RESUMED, "CPU Resumed");
DEF_STR(MSG_PERM_LOOP, "In a permanent loop that cannot be exited. \nEmulation will now stop. \n\nVerify ROM and ROM Settings.");
DEF_STR(MSG_MEM_ALLOC_ERROR, "Failed to allocate Memory");
DEF_STR(MSG_FAIL_INIT_GFX, "The default or selected video plugin is missing or invalid.\n\nYou need to go into Settings and select a video (graphics) plugin.\nCheck that you have at least one compatible plugin file in your plugin folder.");
DEF_STR(MSG_FAIL_INIT_AUDIO, "The default or selected audio plugin is missing or invalid.\n\nYou need to go into Settings and select a audio (sound) plugin.\nCheck that you have at least one compatible plugin file in your plugin folder.");
DEF_STR(MSG_FAIL_INIT_RSP, "The default or selected RSP plugin is missing or invalid. \n\nYou need to go into Settings and select an RSP plugin.\nCheck that you have at least one compatible plugin file in your plugin folder.");
DEF_STR(MSG_FAIL_INIT_CONTROL, "The default or selected input plugin is missing or invalid. \n\nYou need to go into Settings and select a video (graphics) plugin.\nCheck that you have at least one compatible plugin file in your plugin folder.");
DEF_STR(MSG_FAIL_LOAD_PLUGIN, "Failed to load plugin:");
DEF_STR(MSG_FAIL_LOAD_WORD, "Failed to load word\n\nVerify ROM and ROM Settings.");
DEF_STR(MSG_FAIL_OPEN_SAVE, "Failed to open Save File");
DEF_STR(MSG_FAIL_OPEN_EEPROM, "Failed to open Eeprom");
DEF_STR(MSG_FAIL_OPEN_FLASH, "Failed to open Flashram");
DEF_STR(MSG_FAIL_OPEN_MEMPAK, "Failed to open mempak");
DEF_STR(MSG_FAIL_OPEN_ZIP, "Attempt to open zip file failed. \n\nProbably a corrupt zip file - try unzipping ROM manually.");
DEF_STR(MSG_FAIL_OPEN_IMAGE, "Attempt to open file failed.");
DEF_STR(MSG_FAIL_ZIP, "Error occured when trying to open zip file.");
DEF_STR(MSG_FAIL_IMAGE, "File loaded does not appear to be a valid Nintendo64 ROM. \n\nVerify your ROMs with GoodN64.");
DEF_STR(MSG_UNKNOWN_COUNTRY, "Unknown country");
DEF_STR(MSG_UNKNOWN_CIC_CHIP, "Unknown Cic Chip");
DEF_STR(MSG_UNKNOWN_FILE_FORMAT,"Unknown file format");
DEF_STR(MSG_UNKNOWN_MEM_ACTION, "Unknown memory action\n\nEmulation stop");
DEF_STR(MSG_UNHANDLED_OP, "Unhandled R4300i OpCode at");
DEF_STR(MSG_NONMAPPED_SPACE, "Executing from non-mapped space.\n\nVerify ROM and ROM Settings.");
DEF_STR(MSG_SAVE_STATE_HEADER, "State save does not appear to match the running ROM. \n\nState saves must be saved & loaded between 100% identical ROMs, \nin particular the REGION and VERSION need to be the same. \nLoading this state is likely to cause the game and/or emulator to crash. \n\nAre you sure you want to continue loading?");
DEF_STR(MSG_MSGBOX_TITLE, "Error");
DEF_STR(MSG_PIF2_ERROR, "Copyright sequence not found in LUT. Game will no longer function.");
DEF_STR(MSG_PIF2_TITLE, "Copy Protection Failure");
DEF_STR(MSG_PLUGIN_CHANGE, "Changing a plugin requires Project64 to reset a running ROM. \nIf you don't want to lose your place, answer No and make a state save first. \n\nChange plugins and restart game now?");
DEF_STR(MSG_PLUGIN_CHANGE_TITLE,"Change Plugins");
DEF_STR(MSG_EMULATION_ENDED, "Emulation ended");
DEF_STR(MSG_EMULATION_STARTED, "Emulation started");
DEF_STR(MSG_UNABLED_LOAD_STATE, "Unable to load save state");
DEF_STR(MSG_LOADED_STATE, "Loaded save state");
DEF_STR(MSG_SAVED_STATE, "Saved current state to");
DEF_STR(MSG_SAVE_SLOT, "Save state slot");
DEF_STR(MSG_BYTESWAP, "Byte swapping image");
DEF_STR(MSG_CHOOSE_IMAGE, "Choosing N64 image");
DEF_STR(MSG_LOADED, "Loaded");
DEF_STR(MSG_LOADING, "Loading image");
DEF_STR(MSG_PLUGIN_NOT_INIT, "Cannot open a rom because plugins have not successfully initialised");
DEF_STR(MSG_DEL_SURE, "Are you sure you really want to delete this?");
DEF_STR(MSG_DEL_TITLE, "Delete Cheat");
DEF_STR(MSG_CHEAT_NAME_IN_USE, "Cheat Name is already in use");
DEF_STR(MSG_MAX_CHEATS, "You Have reached the Maximum amount of cheats for this rom");
DEF_STR(MSG_PLUGIN_INIT, "Plug-in Initializing");
DEF_STR(MSG_NO_SHORTCUT_SEL, "You have not selected a virtual key to assign to the menu item");
DEF_STR(MSG_NO_MENUITEM_SEL, "You need to select a menu item to assign this key to");
DEF_STR(MSG_MENUITEM_ASSIGNED, "Short cut has already been assigned to another menu item");
DEF_STR(MSG_NO_SEL_SHORTCUT, "No shortcut has been selected to be removed");
DEF_STR(MENU_FORUM, "Support &Forum");
DEF_STR(MENU_HOMEPAGE, "&Homepage");
DEF_STR(MSG_WAITING_FOR_START, "Rom Loaded. Waiting for emulation to start.");
DEF_STR(MSG_INVALID_EXE, "project64 beta is for members only.\n\nif you have an account at pj64.net, you should not be seeing this error!!\nplease contact us on the site");
DEF_STR(MSG_INVALID_EXE_TITLE, "Program Error");
DEF_STR(MSG_7Z_FILE_NOT_FOUND, "Failed to find filename in 7z file");
DEF_STR(MSG_SET_LLE_GFX_TITLE, "Use Low Level Graphics");
DEF_STR(MSG_SET_LLE_GFX_MSG, "Low Level Graphics are not for general use!!!\nIt is advisable that you only use this for testing, not for playing any games with\n\nChange to LLE GFX?");
DEF_STR(MSG_SET_HLE_AUD_TITLE, "Use High Level Audio");
DEF_STR(MSG_SET_HLE_AUD_MSG, "High level Audio requires a 3rd party plugin!!!\nIf you do not use a 3rd party plugin that supports high level audio then you will hear no sound.\n\nUse high level audio?");
DEF_STR(MSG_CPU_PAUSED, L"*** CPU PAUSED ***");
DEF_STR(MSG_CPU_RESUMED, L"CPU Resumed");
DEF_STR(MSG_PERM_LOOP, L"In a permanent loop that cannot be exited. \nEmulation will now stop. \n\nVerify ROM and ROM Settings.");
DEF_STR(MSG_MEM_ALLOC_ERROR, L"Failed to allocate Memory");
DEF_STR(MSG_FAIL_INIT_GFX, L"The default or selected video plugin is missing or invalid.\n\nYou need to go into Settings and select a video (graphics) plugin.\nCheck that you have at least one compatible plugin file in your plugin folder.");
DEF_STR(MSG_FAIL_INIT_AUDIO, L"The default or selected audio plugin is missing or invalid.\n\nYou need to go into Settings and select a audio (sound) plugin.\nCheck that you have at least one compatible plugin file in your plugin folder.");
DEF_STR(MSG_FAIL_INIT_RSP, L"The default or selected RSP plugin is missing or invalid. \n\nYou need to go into Settings and select an RSP plugin.\nCheck that you have at least one compatible plugin file in your plugin folder.");
DEF_STR(MSG_FAIL_INIT_CONTROL, L"The default or selected input plugin is missing or invalid. \n\nYou need to go into Settings and select a video (graphics) plugin.\nCheck that you have at least one compatible plugin file in your plugin folder.");
DEF_STR(MSG_FAIL_LOAD_PLUGIN, L"Failed to load plugin:");
DEF_STR(MSG_FAIL_LOAD_WORD, L"Failed to load word\n\nVerify ROM and ROM Settings.");
DEF_STR(MSG_FAIL_OPEN_SAVE, L"Failed to open Save File");
DEF_STR(MSG_FAIL_OPEN_EEPROM, L"Failed to open Eeprom");
DEF_STR(MSG_FAIL_OPEN_FLASH, L"Failed to open Flashram");
DEF_STR(MSG_FAIL_OPEN_MEMPAK, L"Failed to open mempak");
DEF_STR(MSG_FAIL_OPEN_ZIP, L"Attempt to open zip file failed. \n\nProbably a corrupt zip file - try unzipping ROM manually.");
DEF_STR(MSG_FAIL_OPEN_IMAGE, L"Attempt to open file failed.");
DEF_STR(MSG_FAIL_ZIP, L"Error occured when trying to open zip file.");
DEF_STR(MSG_FAIL_IMAGE, L"File loaded does not appear to be a valid Nintendo64 ROM. \n\nVerify your ROMs with GoodN64.");
DEF_STR(MSG_UNKNOWN_COUNTRY, L"Unknown country");
DEF_STR(MSG_UNKNOWN_CIC_CHIP, L"Unknown Cic Chip");
DEF_STR(MSG_UNKNOWN_FILE_FORMAT,L"Unknown file format");
DEF_STR(MSG_UNKNOWN_MEM_ACTION, L"Unknown memory action\n\nEmulation stop");
DEF_STR(MSG_UNHANDLED_OP, L"Unhandled R4300i OpCode at");
DEF_STR(MSG_NONMAPPED_SPACE, L"Executing from non-mapped space.\n\nVerify ROM and ROM Settings.");
DEF_STR(MSG_SAVE_STATE_HEADER, L"State save does not appear to match the running ROM. \n\nState saves must be saved & loaded between 100% identical ROMs, \nin particular the REGION and VERSION need to be the same. \nLoading this state is likely to cause the game and/or emulator to crash. \n\nAre you sure you want to continue loading?");
DEF_STR(MSG_MSGBOX_TITLE, L"Error");
DEF_STR(MSG_PIF2_ERROR, L"Copyright sequence not found in LUT. Game will no longer function.");
DEF_STR(MSG_PIF2_TITLE, L"Copy Protection Failure");
DEF_STR(MSG_PLUGIN_CHANGE, L"Changing a plugin requires Project64 to reset a running ROM. \nIf you don't want to lose your place, answer No and make a state save first. \n\nChange plugins and restart game now?");
DEF_STR(MSG_PLUGIN_CHANGE_TITLE,L"Change Plugins");
DEF_STR(MSG_EMULATION_ENDED, L"Emulation ended");
DEF_STR(MSG_EMULATION_STARTED, L"Emulation started");
DEF_STR(MSG_UNABLED_LOAD_STATE, L"Unable to load save state");
DEF_STR(MSG_LOADED_STATE, L"Loaded save state");
DEF_STR(MSG_SAVED_STATE, L"Saved current state to");
DEF_STR(MSG_SAVE_SLOT, L"Save state slot");
DEF_STR(MSG_BYTESWAP, L"Byte swapping image");
DEF_STR(MSG_CHOOSE_IMAGE, L"Choosing N64 image");
DEF_STR(MSG_LOADED, L"Loaded");
DEF_STR(MSG_LOADING, L"Loading image");
DEF_STR(MSG_PLUGIN_NOT_INIT, L"Cannot open a rom because plugins have not successfully initialised");
DEF_STR(MSG_DEL_SURE, L"Are you sure you really want to delete this?");
DEF_STR(MSG_DEL_TITLE, L"Delete Cheat");
DEF_STR(MSG_CHEAT_NAME_IN_USE, L"Cheat Name is already in use");
DEF_STR(MSG_MAX_CHEATS, L"You Have reached the Maximum amount of cheats for this rom");
DEF_STR(MSG_PLUGIN_INIT, L"Plug-in Initializing");
DEF_STR(MSG_NO_SHORTCUT_SEL, L"You have not selected a virtual key to assign to the menu item");
DEF_STR(MSG_NO_MENUITEM_SEL, L"You need to select a menu item to assign this key to");
DEF_STR(MSG_MENUITEM_ASSIGNED, L"Short cut has already been assigned to another menu item");
DEF_STR(MSG_NO_SEL_SHORTCUT, L"No shortcut has been selected to be removed");
DEF_STR(MENU_FORUM, L"Support &Forum");
DEF_STR(MENU_HOMEPAGE, L"&Homepage");
DEF_STR(MSG_WAITING_FOR_START, L"Rom Loaded. Waiting for emulation to start.");
DEF_STR(MSG_INVALID_EXE, L"project64 beta is for members only.\n\nif you have an account at pj64.net, you should not be seeing this error!!\nplease contact us on the site");
DEF_STR(MSG_INVALID_EXE_TITLE, L"Program Error");
DEF_STR(MSG_7Z_FILE_NOT_FOUND, L"Failed to find filename in 7z file");
DEF_STR(MSG_SET_LLE_GFX_TITLE, L"Use Low Level Graphics");
DEF_STR(MSG_SET_LLE_GFX_MSG, L"Low Level Graphics are not for general use!!!\nIt is advisable that you only use this for testing, not for playing any games with\n\nChange to LLE GFX?");
DEF_STR(MSG_SET_HLE_AUD_TITLE, L"Use High Level Audio");
DEF_STR(MSG_SET_HLE_AUD_MSG, L"High level Audio requires a 3rd party plugin!!!\nIf you do not use a 3rd party plugin that supports high level audio then you will hear no sound.\n\nUse high level audio?");
}
LRESULT CALLBACK LangSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
CLanguage::CLanguage() :
m_emptyString("")
m_emptyString(L"")
{
LoadDefaultStrings();
}
@ -472,7 +471,7 @@ void CLanguage::LoadCurrentStrings ( bool ShowSelectDialog )
{
if (ShowSelectDialog)
{
m_SelectedLanguage = g_Settings->LoadString(Setting_CurrentLanguage);
m_SelectedLanguage = g_Settings->LoadString(Setting_CurrentLanguage).ToUTF16();
}
LanguageList LangList = GetLangList();
@ -482,8 +481,9 @@ void CLanguage::LoadCurrentStrings ( bool ShowSelectDialog )
m_CurrentStrings.clear();
//Find the file name of the current language
for (LanguageList::iterator Language = LangList.begin(); Language != LangList.end(); Language++) {
if (_Lang->IsCurrentLang(*Language))
for (LanguageList::iterator Language = LangList.begin(); Language != LangList.end(); Language++)
{
if (g_Lang->IsCurrentLang(*Language))
{
Filename = Language->Filename;
break;
@ -622,7 +622,8 @@ DWORD CALLBACK LangSelectOkProc (HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lPar
return CallWindowProc(pfnWndLangSelectOkProc, hWnd, uMsg, wParam, lParam);
}
LRESULT CALLBACK LangSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
LRESULT CALLBACK LangSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static HBITMAP hbmpBackgroundTop = NULL;
static HBITMAP hbmpBackgroundBottom = NULL;
static HBITMAP hbmpBackgroundMiddle = NULL;
@ -639,8 +640,9 @@ LRESULT CALLBACK LangSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (LangList.size() == 0) { EndDialog(hDlg,0); }
for (LanguageList::iterator Language = LangList.begin(); Language != LangList.end(); Language++)
{
int index = SendMessage(GetDlgItem(hDlg,IDC_LANG_SEL),CB_ADDSTRING,0,(WPARAM)Language->LanguageName.c_str());
if (_stricmp(Language->LanguageName.c_str(),"English") == 0) {
int index = SendMessageW(GetDlgItem(hDlg,IDC_LANG_SEL),CB_ADDSTRING,0,(WPARAM)Language->LanguageName.c_str());
if (_wcsicmp(Language->LanguageName.c_str(),L"English") == 0)
{
SendMessage(GetDlgItem(hDlg,IDC_LANG_SEL),CB_SETCURSEL,index,0);
}
}
@ -813,14 +815,17 @@ LRESULT CALLBACK LangSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
if (hTextFont)
{
::DeleteObject(hTextFont);
}
{
int Index = SendMessage(GetDlgItem(hDlg,IDC_LANG_SEL),CB_GETCURSEL,0,0);
if (Index >= 0) {
char String[255];
SendMessage(GetDlgItem(hDlg,IDC_LANG_SEL),CB_GETLBTEXT,Index,(LPARAM)String);
if (Index >= 0)
{
wchar_t String[255];
SendMessageW(GetDlgItem(hDlg,IDC_LANG_SEL),CB_GETLBTEXT,Index,(LPARAM)String);
lngClass->SetLanguage(String);
}
}
@ -845,7 +850,8 @@ LanguageList & CLanguage::GetLangList (void)
CPath LanguageFiles(g_Settings->LoadString(Setting_LanguageDir),"*.pj.Lang");
if (LanguageFiles.FindFirst())
{
do {
do
{
LanguageFile File; //We temporally store the values in here to added to the list
File.LanguageName = GetLangString(LanguageFiles,LANGUAGE_NAME);
@ -858,39 +864,42 @@ LanguageList & CLanguage::GetLangList (void)
return m_LanguageList;
}
const stdstr &CLanguage::GetString (LanguageStringID StringID)
const std::wstring & CLanguage::GetString (LanguageStringID StringID)
{
LANG_STRINGS::iterator CurrentString = m_CurrentStrings.find(StringID);
if (CurrentString != m_CurrentStrings.end()) {
if (CurrentString != m_CurrentStrings.end())
{
return CurrentString->second;
}
LANG_STRINGS::iterator DefString = m_DefaultStrings.find(StringID);
if (DefString != m_DefaultStrings.end()) {
if (DefString != m_DefaultStrings.end())
{
return DefString->second;
}
#ifdef _DEBUG
_asm int 3
g_Notify->BreakPoint(__FILE__,__LINE__);
#endif
return m_emptyString;
}
stdstr CLanguage::GetLangString ( const char * FileName, LanguageStringID ID )
std::wstring CLanguage::GetLangString ( const char * FileName, LanguageStringID ID )
{
FILE *file = fopen(FileName, "rb");
if (file == NULL) { return stdstr(""); }
if (file == NULL) { return L""; }
//String;
while(!feof(file))
{
LANG_STR String = GetNextLangString(file);
if (String.first == ID) {
if (String.first == ID)
{
fclose(file);
return String.second;
}
}
fclose(file);
return stdstr("");
return L"";
}
LANG_STR CLanguage::GetNextLangString (void * OpenFile)
@ -904,35 +913,38 @@ LANG_STR CLanguage::GetNextLangString (void * OpenFile)
//Search for token #
while(token!='#' && !feof(file)) { fread(&token, 1, 1, file); }
if(feof(file)){ return LANG_STR(0,""); }
if(feof(file)){ return LANG_STR(0,L""); }
//get StringID after token
fscanf(file, "%d", &StringID);
//Search for token #
while(token!='#' && !feof(file)) { fread(&token, 1, 1, file); }
if(feof(file)){ StringID = EMPTY_STRING; return LANG_STR(0,""); }
if(feof(file)){ StringID = EMPTY_STRING; return LANG_STR(0,L""); }
//Search for start of string '"'
//Search for start of string '"'
while(token!='"' && !feof(file)) { fread(&token, 1, 1, file); }
if(feof(file)){ StringID = EMPTY_STRING; return LANG_STR(0,""); }
if(feof(file)){ StringID = EMPTY_STRING; return LANG_STR(0,L""); }
int pos = 0;
fread(&token, 1, 1, file);
while(token!='"' && !feof(file)){
while(token!='"' && !feof(file))
{
szString[pos++] = token;
fread(&token, 1, 1, file);
if (pos == MAX_STRING_LEN - 2) { token = '"'; }
}
szString[pos++] = 0;
return LANG_STR(StringID,szString);
return LANG_STR(StringID,stdstr(szString).ToUTF16());
}
void CLanguage::SetLanguage ( char * LanguageName )
void CLanguage::SetLanguage ( const wchar_t * LanguageName )
{
m_SelectedLanguage = LanguageName;
LoadCurrentStrings(false);
g_Settings->SaveString(Setting_CurrentLanguage,LanguageName);
stdstr Language;
Language.FromUTF16(LanguageName);
g_Settings->SaveString(Setting_CurrentLanguage,Language);
}
bool CLanguage::IsCurrentLang( LanguageFile & File )

View File

@ -17,44 +17,45 @@
#include <map> //stl map
#include <list> //stl list
typedef std::map<int, stdstr, std::less<int> > LANG_STRINGS;
typedef std::map<int, std::wstring, std::less<int> > LANG_STRINGS;
typedef LANG_STRINGS::value_type LANG_STR;
typedef struct {
stdstr Filename;
stdstr LanguageName;
std::wstring LanguageName;
} LanguageFile;
typedef std::list<LanguageFile> LanguageList;
typedef std::list<LanguageFile> LanguageList;
class CLanguage
{
public:
CLanguage ( );
const stdstr & GetString ( LanguageStringID StringID );
LanguageList & GetLangList ( void );
void SetLanguage ( char * LanguageName );
void LoadCurrentStrings ( bool ShowSelectDialog );
bool IsCurrentLang ( LanguageFile & File );
CLanguage ();
const std::wstring & GetString ( LanguageStringID StringID );
LanguageList & GetLangList ( void );
void SetLanguage ( const wchar_t * LanguageName );
void LoadCurrentStrings ( bool ShowSelectDialog );
bool IsCurrentLang ( LanguageFile & File );
private:
CLanguage(const CLanguage&); // Disable copy constructor
CLanguage& operator=(const CLanguage&); // Disable assignment
stdstr m_SelectedLanguage;
const stdstr m_emptyString;
std::wstring m_SelectedLanguage;
const std::wstring m_emptyString;
LANG_STRINGS m_CurrentStrings, m_DefaultStrings;
LanguageList m_LanguageList;
stdstr 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 );
};
extern CLanguage * _Lang;
extern CLanguage * g_Lang;
inline LPCSTR GS (LanguageStringID StringID)
inline LPCWSTR GS (LanguageStringID StringID)
{
return _Lang->GetString(StringID).c_str();
return g_Lang->GetString(StringID).c_str();
}

View File

@ -634,7 +634,7 @@ void CCheats::RefreshCheatManager(void)
stdstr CCheats::GetDlgItemStr (HWND hDlg, int nIDDlgItem)
{
HWND hDlgItem = GetDlgItem((HWND)hDlg,nIDDlgItem);
HWND hDlgItem = GetDlgItem(hDlg,nIDDlgItem);
int length = SendMessage(hDlgItem, WM_GETTEXTLENGTH, 0, 0);
if (length == 0)
{
@ -682,14 +682,14 @@ bool CCheats::CheatChanged (HWND hDlg)
{
return false;
}
int Result = MessageBox((HWND)hDlg,GS(CHEAT_CHANGED_MSG),GS(CHEAT_CHANGED_TITLE),MB_YESNOCANCEL);
int Result = MessageBoxW(hDlg,GS(CHEAT_CHANGED_MSG),GS(CHEAT_CHANGED_TITLE),MB_YESNOCANCEL);
if (Result == IDCANCEL)
{
return true;
}
if (Result == IDYES)
{
SendMessage((HWND)hDlg,WM_COMMAND, MAKELPARAM(IDC_ADD, 0), (LPARAM)GetDlgItem((HWND)hDlg,IDC_ADD));
SendMessage(hDlg,WM_COMMAND, MAKELPARAM(IDC_ADD, 0), (LPARAM)GetDlgItem(hDlg,IDC_ADD));
}
return false;
}
@ -702,98 +702,113 @@ void CCheats::RecordCheatValues ( HWND hDlg )
m_EditNotes = GetDlgItemStr(hDlg,IDC_NOTES);
}
int CALLBACK CCheats::CheatAddProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lParam) {
switch (uMsg) {
int CALLBACK CCheats::CheatAddProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
{
CCheats * _this = (CCheats *)lParam;
SetProp((HWND)hDlg,"Class",_this);
SetProp(hDlg,"Class",_this);
SetWindowText((HWND)hDlg,GS(CHEAT_ADDCHEAT_FRAME));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_NAME),GS(CHEAT_ADDCHEAT_NAME));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_CODE),GS(CHEAT_ADDCHEAT_CODE));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_LABEL_OPTIONS),GS(CHEAT_ADDCHEAT_OPT));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_CODE_DES),GS(CHEAT_ADDCHEAT_CODEDES));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_LABEL_OPTIONS_FORMAT),GS(CHEAT_ADDCHEAT_OPTDES));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_CHEATNOTES),GS(CHEAT_ADDCHEAT_NOTES));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_NEWCHEAT),GS(CHEAT_ADDCHEAT_NEW));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_ADD),GS(CHEAT_ADDCHEAT_ADD));
SetProp((HWND)hDlg,"validcodes",false);
SetWindowTextW(hDlg,GS(CHEAT_ADDCHEAT_FRAME));
SetWindowTextW(GetDlgItem(hDlg,IDC_NAME),GS(CHEAT_ADDCHEAT_NAME));
SetWindowTextW(GetDlgItem(hDlg,IDC_CODE),GS(CHEAT_ADDCHEAT_CODE));
SetWindowTextW(GetDlgItem(hDlg,IDC_LABEL_OPTIONS),GS(CHEAT_ADDCHEAT_OPT));
SetWindowTextW(GetDlgItem(hDlg,IDC_CODE_DES),GS(CHEAT_ADDCHEAT_CODEDES));
SetWindowTextW(GetDlgItem(hDlg,IDC_LABEL_OPTIONS_FORMAT),GS(CHEAT_ADDCHEAT_OPTDES));
SetWindowTextW(GetDlgItem(hDlg,IDC_CHEATNOTES),GS(CHEAT_ADDCHEAT_NOTES));
SetWindowTextW(GetDlgItem(hDlg,IDC_NEWCHEAT),GS(CHEAT_ADDCHEAT_NEW));
SetWindowTextW(GetDlgItem(hDlg,IDC_ADD),GS(CHEAT_ADDCHEAT_ADD));
SetProp(hDlg,"validcodes",false);
_this->RecordCheatValues(hDlg);
}
break;
case WM_COMMAND:
{
switch (LOWORD(wParam)) {
switch (LOWORD(wParam))
{
case IDC_CODE_NAME:
if (HIWORD(wParam) == EN_CHANGE) {
if (HIWORD(wParam) == EN_CHANGE)
{
bool validcodes,validoptions, nooptions;
int CodeFormat;
ReadCodeString(hDlg,validcodes,validoptions,nooptions,CodeFormat);
if (!nooptions) {
if (!nooptions)
{
ReadOptionsString(hDlg,validcodes,validoptions,nooptions,CodeFormat);
}
if (validcodes && (validoptions || nooptions) && SendDlgItemMessage((HWND)hDlg,IDC_CODE_NAME,EM_LINELENGTH,0,0) > 0){
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), true);
if (validcodes && (validoptions || nooptions) && SendDlgItemMessage(hDlg,IDC_CODE_NAME,EM_LINELENGTH,0,0) > 0)
{
EnableWindow(GetDlgItem(hDlg, IDC_ADD), true);
}
else {
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), false);
else
{
EnableWindow(GetDlgItem(hDlg, IDC_ADD), false);
}
}
break;
case IDC_CHEAT_CODES:
if (HIWORD(wParam) == EN_CHANGE) {
if (HIWORD(wParam) == EN_CHANGE)
{
bool validcodes,validoptions, nooptions;
int CodeFormat;
ReadCodeString(hDlg,validcodes,validoptions,nooptions,CodeFormat);
//GetDlgItemText(hDlg, IDC_CHEAT_CODES, str, 1024);
if ((CodeFormat > 0) && !IsWindowEnabled(GetDlgItem((HWND)hDlg, IDC_LABEL_OPTIONS)) ) {
EnableWindow(GetDlgItem((HWND)hDlg, IDC_LABEL_OPTIONS), true);
EnableWindow(GetDlgItem((HWND)hDlg, IDC_LABEL_OPTIONS_FORMAT), true);
EnableWindow(GetDlgItem((HWND)hDlg, IDC_CHEAT_OPTIONS), true);
if ((CodeFormat > 0) && !IsWindowEnabled(GetDlgItem(hDlg, IDC_LABEL_OPTIONS)) )
{
EnableWindow(GetDlgItem(hDlg, IDC_LABEL_OPTIONS), true);
EnableWindow(GetDlgItem(hDlg, IDC_LABEL_OPTIONS_FORMAT), true);
EnableWindow(GetDlgItem(hDlg, IDC_CHEAT_OPTIONS), true);
}
if ((CodeFormat <= 0) && IsWindowEnabled(GetDlgItem((HWND)hDlg, IDC_LABEL_OPTIONS)) ) {
EnableWindow(GetDlgItem((HWND)hDlg, IDC_LABEL_OPTIONS), false);
EnableWindow(GetDlgItem((HWND)hDlg, IDC_LABEL_OPTIONS_FORMAT), false);
EnableWindow(GetDlgItem((HWND)hDlg, IDC_CHEAT_OPTIONS), false);
if ((CodeFormat <= 0) && IsWindowEnabled(GetDlgItem(hDlg, IDC_LABEL_OPTIONS)) )
{
EnableWindow(GetDlgItem(hDlg, IDC_LABEL_OPTIONS), false);
EnableWindow(GetDlgItem(hDlg, IDC_LABEL_OPTIONS_FORMAT), false);
EnableWindow(GetDlgItem(hDlg, IDC_CHEAT_OPTIONS), false);
}
if (!nooptions) {
if (!nooptions)
{
ReadOptionsString(hDlg,validcodes,validoptions,nooptions,CodeFormat);
}
if (validcodes && (validoptions || nooptions) && SendDlgItemMessage((HWND)hDlg,IDC_CODE_NAME,EM_LINELENGTH,0,0) > 0){
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), true);
if (validcodes && (validoptions || nooptions) && SendDlgItemMessage(hDlg,IDC_CODE_NAME,EM_LINELENGTH,0,0) > 0)
{
EnableWindow(GetDlgItem(hDlg, IDC_ADD), true);
}
else {
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), false);
else
{
EnableWindow(GetDlgItem(hDlg, IDC_ADD), false);
}
}
break;
case IDC_CHEAT_OPTIONS:
if (HIWORD(wParam) == EN_CHANGE) {
if (HIWORD(wParam) == EN_CHANGE)
{
bool validcodes,validoptions, nooptions;
int CodeFormat;
ReadOptionsString(hDlg,validcodes,validoptions,nooptions,CodeFormat);
if (validcodes && (validoptions || nooptions) && SendDlgItemMessage((HWND)hDlg,IDC_CODE_NAME,EM_LINELENGTH,0,0) > 0){
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), true);
if (validcodes && (validoptions || nooptions) && SendDlgItemMessage(hDlg,IDC_CODE_NAME,EM_LINELENGTH,0,0) > 0)
{
EnableWindow(GetDlgItem(hDlg, IDC_ADD), true);
}
else {
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), false);
else
{
EnableWindow(GetDlgItem(hDlg, IDC_ADD), false);
}
}
break;
case IDC_ADD:
{
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class");
CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
stdstr NewCheatName = GetDlgItemStr(hDlg,IDC_CODE_NAME);
int i = 0;
for (i = 0; i < MaxCheats; i ++) {
for (i = 0; i < MaxCheats; i ++)
{
if (_this->m_EditCheat == i)
{
continue;
@ -807,13 +822,15 @@ int CALLBACK CCheats::CheatAddProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lPa
}
break;
}
if (_stricmp(CheatName.c_str(),NewCheatName.c_str()) == 0) {
if (_stricmp(CheatName.c_str(),NewCheatName.c_str()) == 0)
{
g_Notify->DisplayError(GS(MSG_CHEAT_NAME_IN_USE));
SetFocus(GetDlgItem((HWND)hDlg,IDC_CODE_NAME));
SetFocus(GetDlgItem(hDlg,IDC_CODE_NAME));
return true;
}
}
if (_this->m_EditCheat < 0 && i == MaxCheats) {
if (_this->m_EditCheat < 0 && i == MaxCheats)
{
g_Notify->DisplayError(GS(MSG_MAX_CHEATS));
return true;
}
@ -834,20 +851,20 @@ int CALLBACK CCheats::CheatAddProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lPa
break;
case IDC_NEWCHEAT:
{
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class");
CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
if (_this->CheatChanged(hDlg))
{
break;
}
_this->m_EditCheat = -1;
SetDlgItemText((HWND)hDlg,IDC_CODE_NAME,"");
SetDlgItemText((HWND)hDlg,IDC_CHEAT_CODES,"");
SetDlgItemText((HWND)hDlg,IDC_CHEAT_OPTIONS,"");
SetDlgItemText((HWND)hDlg,IDC_NOTES,"");
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), false);
EnableWindow(GetDlgItem((HWND)hDlg, IDC_CHEAT_OPTIONS), false);
SetDlgItemText((HWND)hDlg,IDC_ADD,GS(CHEAT_ADDNEW));
SetDlgItemText(hDlg,IDC_CODE_NAME,"");
SetDlgItemText(hDlg,IDC_CHEAT_CODES,"");
SetDlgItemText(hDlg,IDC_CHEAT_OPTIONS,"");
SetDlgItemText(hDlg,IDC_NOTES,"");
EnableWindow(GetDlgItem(hDlg, IDC_ADD), false);
EnableWindow(GetDlgItem(hDlg, IDC_CHEAT_OPTIONS), false);
SetDlgItemTextW(hDlg,IDC_ADD,GS(CHEAT_ADDNEW));
_this->RecordCheatValues(hDlg);
}
break;
@ -856,7 +873,7 @@ int CALLBACK CCheats::CheatAddProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lPa
break;
case WM_EDITCHEAT:
{
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class");
CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
_this->m_EditCheat = wParam;
if (_this->m_EditCheat < 0)
{
@ -875,58 +892,66 @@ int CALLBACK CCheats::CheatAddProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lPa
int len = strrchr(String,'"') - strchr(String,'"') - 1;
stdstr CheatName(strchr(String,'"') + 1);
CheatName.resize(len);
SetDlgItemText((HWND)hDlg,IDC_CODE_NAME,CheatName.c_str());
SetDlgItemText(hDlg,IDC_CODE_NAME,CheatName.c_str());
//Add Gameshark codes to screen
LPCSTR ReadPos = strrchr(String,'"') + 2;
stdstr Buffer;
do {
do
{
char * End = strchr((char *)ReadPos,',');
if (End)
{
Buffer.append(ReadPos,End - ReadPos);
} else {
}
else
{
Buffer.append(ReadPos);
}
ReadPos = strchr(ReadPos,',');
if (ReadPos != NULL) {
if (ReadPos != NULL)
{
Buffer.append("\r\n");
ReadPos += 1;
}
} while (ReadPos);
SetDlgItemText((HWND)hDlg,IDC_CHEAT_CODES,Buffer.c_str());
SetDlgItemText(hDlg,IDC_CHEAT_CODES,Buffer.c_str());
//Add option values to screen
stdstr CheatOptionStr = g_Settings->LoadStringIndex(Cheat_Options,_this->m_EditCheat);
ReadPos = strchr(CheatOptionStr.c_str(),'$');
Buffer.erase();
if (ReadPos) {
if (ReadPos)
{
ReadPos += 1;
do {
do
{
char * End = strchr((char *)ReadPos,',');
if (End)
{
Buffer.append(ReadPos,End - ReadPos);
} else {
}
else
{
Buffer.append(ReadPos);
}
ReadPos = strchr(ReadPos,'$');
if (ReadPos != NULL) {
if (ReadPos != NULL)
{
Buffer.append("\r\n");
ReadPos += 1;
}
} while (ReadPos);
}
SetDlgItemText((HWND)hDlg,IDC_CHEAT_OPTIONS,Buffer.c_str());
SetDlgItemText(hDlg,IDC_CHEAT_OPTIONS,Buffer.c_str());
//Add cheat Notes
stdstr CheatNotesStr = g_Settings->LoadStringIndex(Cheat_Notes,_this->m_EditCheat);
SetDlgItemText((HWND)hDlg,IDC_NOTES,CheatNotesStr.c_str());
SetDlgItemText(hDlg,IDC_NOTES,CheatNotesStr.c_str());
SendMessage((HWND)hDlg,WM_COMMAND, MAKELPARAM(IDC_CHEAT_CODES, EN_CHANGE), (LPARAM)GetDlgItem((HWND)hDlg,IDC_CHEAT_CODES));
SetDlgItemText((HWND)hDlg,IDC_ADD,GS(CHEAT_EDITCHEAT_UPDATE));
SendMessage(hDlg,WM_COMMAND, MAKELPARAM(IDC_CHEAT_CODES, EN_CHANGE), (LPARAM)GetDlgItem(hDlg,IDC_CHEAT_CODES));
SetDlgItemTextW(hDlg,IDC_ADD,GS(CHEAT_EDITCHEAT_UPDATE));
_this->RecordCheatValues(hDlg);
}
@ -938,28 +963,29 @@ int CALLBACK CCheats::CheatAddProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lPa
}
int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lParam) {
switch (uMsg) {
switch (uMsg)
{
case WM_INITDIALOG:
{
CCheats * _this = (CCheats *)lParam;
SetProp((HWND)hDlg,"Class",_this);
SetProp(hDlg,"Class",_this);
DWORD Style;
RECT rcList;
RECT rcButton;
SetWindowText(GetDlgItem((HWND)hDlg,IDC_CHEATSFRAME),GS(CHEAT_LIST_FRAME));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_NOTESFRAME),GS(CHEAT_NOTES_FRAME));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_UNMARK),GS(CHEAT_MARK_NONE));
SetWindowTextW(GetDlgItem(hDlg,IDC_CHEATSFRAME),GS(CHEAT_LIST_FRAME));
SetWindowTextW(GetDlgItem(hDlg,IDC_NOTESFRAME),GS(CHEAT_NOTES_FRAME));
SetWindowTextW(GetDlgItem(hDlg,IDC_UNMARK),GS(CHEAT_MARK_NONE));
GetWindowRect(GetDlgItem((HWND)hDlg, IDC_CHEATSFRAME), &rcList);
GetWindowRect(GetDlgItem((HWND)hDlg, IDC_UNMARK), &rcButton);
GetWindowRect(GetDlgItem(hDlg, IDC_CHEATSFRAME), &rcList);
GetWindowRect(GetDlgItem(hDlg, IDC_UNMARK), &rcButton);
_this->m_hCheatTree = (HWND)CreateWindowEx(WS_EX_CLIENTEDGE,WC_TREEVIEW,"",
WS_CHILD | WS_BORDER | WS_VISIBLE | WS_VSCROLL | TVS_HASLINES |
TVS_HASBUTTONS | TVS_LINESATROOT | TVS_DISABLEDRAGDROP |WS_TABSTOP|
TVS_FULLROWSELECT, 8, 15, rcList.right-rcList.left-16,
rcButton.top-rcList.top-22, (HWND)hDlg, (HMENU)IDC_MYTREE, GetModuleHandle(NULL), NULL);
rcButton.top-rcList.top-22, hDlg, (HMENU)IDC_MYTREE, GetModuleHandle(NULL), NULL);
Style = GetWindowLong((HWND)_this->m_hCheatTree,GWL_STYLE);
SetWindowLong((HWND)_this->m_hCheatTree,GWL_STYLE,TVS_CHECKBOXES |TVS_SHOWSELALWAYS| Style);
@ -980,9 +1006,10 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
break;
case WM_COMMAND:
{
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class");
CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
switch (LOWORD(wParam)) {
switch (LOWORD(wParam))
{
case ID_POPUP_ADDNEWCHEAT:
//DialogBox(hInst, MAKEINTRESOURCE(IDD_Cheats_Add),hDlg,(DLGPROC)CheatAddProc);
break;
@ -993,7 +1020,7 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
{
TVITEM item;
int Response = MessageBox((HWND)hDlg,GS(MSG_DEL_SURE),GS(MSG_DEL_TITLE),MB_YESNO|MB_ICONQUESTION);
int Response = MessageBoxW(hDlg,GS(MSG_DEL_SURE),GS(MSG_DEL_TITLE),MB_YESNO|MB_ICONQUESTION);
if (Response != IDYES) { break; }
//Delete selected cheat
@ -1015,7 +1042,7 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
break;
case WM_NOTIFY:
{
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class");
CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
if (_this->m_DeleteingEntries)
{
@ -1046,9 +1073,9 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
GetCursorPos(&Mouse);
MenuSetText((HMENU)hPopupMenu, 0, GS(CHEAT_ADDNEW), NULL);
MenuSetText((HMENU)hPopupMenu, 1, GS(CHEAT_EDIT), NULL);
MenuSetText((HMENU)hPopupMenu, 3, GS(CHEAT_DELETE), NULL);
MenuSetText(hPopupMenu, 0, GS(CHEAT_ADDNEW), NULL);
MenuSetText(hPopupMenu, 1, GS(CHEAT_EDIT), NULL);
MenuSetText(hPopupMenu, 3, GS(CHEAT_DELETE), NULL);
if (_this->m_hSelectedItem == NULL ||
TreeView_GetChild((HWND)_this->m_hCheatTree,_this->m_hSelectedItem) != NULL)
@ -1057,7 +1084,7 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
DeleteMenu(hPopupMenu,2,MF_BYPOSITION);
DeleteMenu(hPopupMenu,1,MF_BYPOSITION);
}
TrackPopupMenu((HMENU)hPopupMenu, 0, Mouse.x, Mouse.y, 0,(HWND)hDlg, NULL);
TrackPopupMenu(hPopupMenu, 0, Mouse.x, Mouse.y, 0,hDlg, NULL);
DestroyMenu(hMenu);
}
if ((lpnmh->code == NM_CLICK) && (lpnmh->idFrom == IDC_MYTREE))
@ -1090,7 +1117,7 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
stdstr CheatExtension;
if (!g_Settings->LoadStringIndex(Cheat_Extension,item.lParam,CheatExtension))
{
SendMessage((HWND)hDlg, UM_CHANGECODEEXTENSION, 0, (LPARAM)ht.hItem);
SendMessage(hDlg, UM_CHANGECODEEXTENSION, 0, (LPARAM)ht.hItem);
TV_SetCheckState(_this->m_hCheatTree,(HWND)ht.hItem,TV_STATE_CLEAR);
break;
}
@ -1129,7 +1156,7 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
if(TVHT_ONITEMLABEL & ht.flags)
{
PostMessage((HWND)hDlg, UM_CHANGECODEEXTENSION, 0, (LPARAM)ht.hItem);
PostMessage(hDlg, UM_CHANGECODEEXTENSION, 0, (LPARAM)ht.hItem);
}
}
if ((lpnmh->code == TVN_SELCHANGED) && (lpnmh->idFrom == IDC_MYTREE)) {
@ -1144,20 +1171,20 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
TreeView_GetItem((HWND)_this->m_hCheatTree,&item);
stdstr Notes(g_Settings->LoadStringIndex(Cheat_Notes,item.lParam));
SetDlgItemText((HWND)hDlg,IDC_NOTES,Notes.c_str());
SetDlgItemText(hDlg,IDC_NOTES,Notes.c_str());
if (_this->m_AddCheat)
{
SendMessage((HWND)_this->m_AddCheat,WM_EDITCHEAT,item.lParam,0); //edit cheat
}
} else {
SetDlgItemText((HWND)hDlg,IDC_NOTES,"");
SetDlgItemText(hDlg,IDC_NOTES,"");
}
}
}
break;
case UM_CHANGECODEEXTENSION:
{
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class");
CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
;
//Get the selected item
_this->m_hSelectedItem = (HWND)lParam;
@ -1173,12 +1200,12 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
stdstr Options;
if (g_Settings->LoadStringIndex(Cheat_Options,item.lParam,Options) && Options.length() > 0)
{
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_CodeEx),(HWND)hDlg,(DLGPROC)CheatsCodeExProc,(LPARAM)_this);
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_CodeEx),hDlg,(DLGPROC)CheatsCodeExProc,(LPARAM)_this);
} else {
stdstr Range;
if (g_Settings->LoadStringIndex(Cheat_Range,item.lParam,Range) && Range.length() > 0)
{
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_Range),(HWND)hDlg,(DLGPROC)CheatsCodeQuantProc,(LPARAM)_this);
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_Range),hDlg,(DLGPROC)CheatsCodeQuantProc,(LPARAM)_this);
}
}
@ -1207,7 +1234,7 @@ int CALLBACK CCheats::CheatsCodeExProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
case WM_INITDIALOG:
{
CCheats * _this = (CCheats *)lParam;
SetProp((HWND)hDlg,"Class",_this);
SetProp(hDlg,"Class",_this);
//Find the cheat Number of the option being selected
TVITEM item;
@ -1217,11 +1244,11 @@ int CALLBACK CCheats::CheatsCodeExProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
stdstr CheatName = _this->GetCheatName(item.lParam,false);
//Set up language support for dialog
SetWindowText((HWND)hDlg, GS(CHEAT_CODE_EXT_TITLE));
SetDlgItemText((HWND)hDlg,IDC_NOTE, GS(CHEAT_CODE_EXT_TXT));
SetDlgItemText((HWND)hDlg,IDOK, GS(CHEAT_OK));
SetDlgItemText((HWND)hDlg,IDCANCEL, GS(CHEAT_CANCEL));
SetDlgItemText((HWND)hDlg,IDC_CHEAT_NAME,CheatName.c_str());
SetWindowTextW(hDlg, GS(CHEAT_CODE_EXT_TITLE));
SetDlgItemTextW(hDlg,IDC_NOTE, GS(CHEAT_CODE_EXT_TXT));
SetDlgItemTextW(hDlg,IDOK, GS(CHEAT_OK));
SetDlgItemTextW(hDlg,IDCANCEL, GS(CHEAT_CANCEL));
SetDlgItemText(hDlg,IDC_CHEAT_NAME,CheatName.c_str());
//Read through and add all options to the list box
stdstr Options(g_Settings->LoadStringIndex(Cheat_Options,item.lParam));
@ -1232,9 +1259,9 @@ int CALLBACK CCheats::CheatsCodeExProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
int len = NextComma == NULL ? strlen(ReadPos) : NextComma - ReadPos;
stdstr CheatExt(ReadPos);
CheatExt.resize(len);
int index = SendMessage(GetDlgItem((HWND)hDlg,IDC_CHEAT_LIST),LB_ADDSTRING,0,(LPARAM)CheatExt.c_str());
int index = SendMessage(GetDlgItem(hDlg,IDC_CHEAT_LIST),LB_ADDSTRING,0,(LPARAM)CheatExt.c_str());
if (CheatExt == CurrentExt) {
SendMessage(GetDlgItem((HWND)hDlg,IDC_CHEAT_LIST),LB_SETCURSEL,index,0);
SendMessage(GetDlgItem(hDlg,IDC_CHEAT_LIST),LB_SETCURSEL,index,0);
}
//Move to next entry or end
ReadPos = NextComma ? NextComma + 1 : ReadPos + strlen(ReadPos);
@ -1244,11 +1271,11 @@ int CALLBACK CCheats::CheatsCodeExProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_CHEAT_LIST:
if (HIWORD(wParam) == LBN_DBLCLK) { PostMessage((HWND)hDlg,WM_COMMAND,IDOK,0); break; }
if (HIWORD(wParam) == LBN_DBLCLK) { PostMessage(hDlg,WM_COMMAND,IDOK,0); break; }
break;
case IDOK:
{
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class");
CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
//Find the cheat Number of the option being selected
TVITEM item;
@ -1258,19 +1285,19 @@ int CALLBACK CCheats::CheatsCodeExProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
//Get the selected cheat extension
char CheatExten[300];
int index = SendMessage(GetDlgItem((HWND)hDlg,IDC_CHEAT_LIST),LB_GETCURSEL,0,0);
int index = SendMessage(GetDlgItem(hDlg,IDC_CHEAT_LIST),LB_GETCURSEL,0,0);
if (index < 0) { index = 0; }
SendMessage(GetDlgItem((HWND)hDlg,IDC_CHEAT_LIST),LB_GETTEXT,index,(LPARAM)CheatExten);
SendMessage(GetDlgItem(hDlg,IDC_CHEAT_LIST),LB_GETTEXT,index,(LPARAM)CheatExten);
g_Settings->SaveStringIndex(Cheat_Extension,item.lParam,CheatExten);
_this->m_CheatSelectionChanged = true;
}
RemoveProp((HWND)hDlg,"Class");
EndDialog((HWND)hDlg,0);
RemoveProp(hDlg,"Class");
EndDialog(hDlg,0);
break;
case IDCANCEL:
RemoveProp((HWND)hDlg,"Class");
EndDialog((HWND)hDlg,0);
RemoveProp(hDlg,"Class");
EndDialog(hDlg,0);
break;
}
default:
@ -1286,7 +1313,7 @@ int CALLBACK CCheats::CheatsCodeQuantProc (HWND hDlg,DWORD uMsg,DWORD wParam, DW
case WM_INITDIALOG:
{
CCheats * _this = (CCheats *)lParam;
SetProp((HWND)hDlg,"Class",_this);
SetProp(hDlg,"Class",_this);
//Find the cheat Number of the option being selected
TVITEM item;
@ -1299,13 +1326,13 @@ int CALLBACK CCheats::CheatsCodeQuantProc (HWND hDlg,DWORD uMsg,DWORD wParam, DW
stdstr Value(g_Settings->LoadStringIndex(Cheat_Extension,item.lParam));
//Set up language support for dialog
SetWindowText((HWND)hDlg, GS(CHEAT_CODE_EXT_TITLE));
SetDlgItemText((HWND)hDlg, IDC_DIGITAL_TEXT, GS(CHEAT_CHOOSE_VALUE));
SetDlgItemText((HWND)hDlg, IDC_VALUE_TEXT, GS(CHEAT_VALUE));
SetDlgItemText((HWND)hDlg, IDC_NOTES_TEXT, GS(CHEAT_NOTES));
SetDlgItemText((HWND)hDlg,IDC_NOTES,RangeNote.c_str());
SetDlgItemText((HWND)hDlg,IDC_CHEAT_NAME,CheatName.c_str());
SetDlgItemText((HWND)hDlg,IDC_VALUE,Value.c_str());
SetWindowTextW(hDlg, GS(CHEAT_CODE_EXT_TITLE));
SetDlgItemTextW(hDlg, IDC_DIGITAL_TEXT, GS(CHEAT_CHOOSE_VALUE));
SetDlgItemTextW(hDlg, IDC_VALUE_TEXT, GS(CHEAT_VALUE));
SetDlgItemTextW(hDlg, IDC_NOTES_TEXT, GS(CHEAT_NOTES));
SetDlgItemText(hDlg,IDC_NOTES,RangeNote.c_str());
SetDlgItemText(hDlg,IDC_CHEAT_NAME,CheatName.c_str());
SetDlgItemText(hDlg,IDC_VALUE,Value.c_str());
Start = (WORD)(Range.c_str()[0] == '$'?AsciiToHex(&Range.c_str()[1]):atol(Range.c_str()));
const char * ReadPos = strrchr(Range.c_str(),'-');
@ -1317,7 +1344,7 @@ int CALLBACK CCheats::CheatsCodeQuantProc (HWND hDlg,DWORD uMsg,DWORD wParam, DW
char Text[500];
sprintf(Text,"%s $%X %s $%X",GS(CHEAT_FROM),Start,GS(CHEAT_TO),Stop);
SetDlgItemText((HWND)hDlg,IDC_RANGE,Text);
SetDlgItemText(hDlg,IDC_RANGE,Text);
}
break;
case WM_COMMAND:
@ -1326,25 +1353,25 @@ int CALLBACK CCheats::CheatsCodeQuantProc (HWND hDlg,DWORD uMsg,DWORD wParam, DW
if (HIWORD(wParam) == EN_UPDATE) {
TCHAR szTmp[10], szTmp2[10];
DWORD Value;
GetDlgItemText((HWND)hDlg,IDC_VALUE,szTmp,sizeof(szTmp));
GetDlgItemText(hDlg,IDC_VALUE,szTmp,sizeof(szTmp));
Value = szTmp[0] =='$'?AsciiToHex(&szTmp[1]):AsciiToHex(szTmp);
if (Value > Stop) { Value = Stop; }
if (Value < Start) { Value = Start; }
sprintf(szTmp2,"$%X",Value);
if (strcmp(szTmp,szTmp2) != 0) {
SetDlgItemText((HWND)hDlg,IDC_VALUE,szTmp2);
SetDlgItemText(hDlg,IDC_VALUE,szTmp2);
if (SelStop == 0) { SelStop = (WORD)strlen(szTmp2); SelStart = SelStop; }
SendDlgItemMessage((HWND)hDlg,IDC_VALUE,EM_SETSEL,(WPARAM)SelStart,(LPARAM)SelStop);
SendDlgItemMessage(hDlg,IDC_VALUE,EM_SETSEL,(WPARAM)SelStart,(LPARAM)SelStop);
} else {
WORD NewSelStart, NewSelStop;
SendDlgItemMessage((HWND)hDlg,IDC_VALUE,EM_GETSEL,(WPARAM)&NewSelStart,(LPARAM)&NewSelStop);
SendDlgItemMessage(hDlg,IDC_VALUE,EM_GETSEL,(WPARAM)&NewSelStart,(LPARAM)&NewSelStop);
if (NewSelStart != 0) { SelStart = NewSelStart; SelStop = NewSelStop; }
}
}
break;
case IDOK:
{
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class");
CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
//Find the cheat Number of the option being selected
TVITEM item;
@ -1356,7 +1383,7 @@ int CALLBACK CCheats::CheatsCodeQuantProc (HWND hDlg,DWORD uMsg,DWORD wParam, DW
TCHAR CheatExten[300], szTmp[10];
DWORD Value;
GetDlgItemText((HWND)hDlg,IDC_VALUE,szTmp,sizeof(szTmp));
GetDlgItemText(hDlg,IDC_VALUE,szTmp,sizeof(szTmp));
Value = szTmp[0] =='$'?AsciiToHex(&szTmp[1]):AsciiToHex(szTmp);
if (Value > Stop) { Value = Stop; }
if (Value < Start) { Value = Start; }
@ -1365,12 +1392,12 @@ int CALLBACK CCheats::CheatsCodeQuantProc (HWND hDlg,DWORD uMsg,DWORD wParam, DW
g_Settings->SaveStringIndex(Cheat_Extension, item.lParam,CheatExten);
_this->m_CheatSelectionChanged = true;
}
RemoveProp((HWND)hDlg,"Class");
EndDialog((HWND)hDlg,0);
RemoveProp(hDlg,"Class");
EndDialog(hDlg,0);
break;
case IDCANCEL:
RemoveProp((HWND)hDlg,"Class");
EndDialog((HWND)hDlg,0);
RemoveProp(hDlg,"Class");
EndDialog(hDlg,0);
break;
}
default:
@ -1393,15 +1420,15 @@ int CALLBACK CCheats::ManageCheatsProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
case WM_INITDIALOG:
{
CCheats * _this = (CCheats *)lParam;
SetProp((HWND)hDlg,"Class",_this);
SetProp(hDlg,"Class",_this);
_this->m_Window = hDlg;
WINDOWPLACEMENT WndPlac;
WndPlac.length = sizeof(WndPlac);
GetWindowPlacement((HWND)hDlg, &WndPlac);
GetWindowPlacement(hDlg, &WndPlac);
SetWindowText((HWND)hDlg, GS(CHEAT_TITLE));
_this->m_hSelectCheat = (HWND)CreateDialogParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_List),(HWND)hDlg,(DLGPROC)CheatListProc,(LPARAM)_this);
SetWindowTextW(hDlg, GS(CHEAT_TITLE));
_this->m_hSelectCheat = (HWND)CreateDialogParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_List),hDlg,(DLGPROC)CheatListProc,(LPARAM)_this);
SetWindowPos((HWND)_this->m_hSelectCheat,HWND_TOP, 5, 8, 0, 0, SWP_NOSIZE);
ShowWindow((HWND)_this->m_hSelectCheat,SW_SHOW);
@ -1415,11 +1442,11 @@ int CALLBACK CCheats::ManageCheatsProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
_this->m_DialogState = CONTRACTED;
WndPlac.rcNormalPosition.right = WndPlac.rcNormalPosition.left + _this->m_MinSizeDlg;
SetWindowPlacement((HWND)hDlg, &WndPlac);
SetWindowPlacement(hDlg, &WndPlac);
ShowWindow(GetDlgItem((HWND)hDlg, IDC_STATE),SW_HIDE);
ShowWindow(GetDlgItem(hDlg, IDC_STATE),SW_HIDE);
} else {
_this->m_AddCheat = (HWND)CreateDialogParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_Add),(HWND)hDlg,(DLGPROC)CheatAddProc,(LPARAM)_this);
_this->m_AddCheat = (HWND)CreateDialogParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_Add),hDlg,(DLGPROC)CheatAddProc,(LPARAM)_this);
SetWindowPos((HWND)_this->m_AddCheat, HWND_TOP, (rc->right - rc->left)/2, 8, 0, 0, SWP_NOSIZE);
ShowWindow((HWND)_this->m_AddCheat,SW_HIDE);
@ -1432,19 +1459,19 @@ int CALLBACK CCheats::ManageCheatsProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
_this->m_DialogState = CONTRACTED;
WndPlac.rcNormalPosition.right = WndPlac.rcNormalPosition.left + _this->m_MinSizeDlg;
SetWindowPlacement((HWND)hDlg, &WndPlac);
SetWindowPlacement(hDlg, &WndPlac);
GetClientRect((HWND)hDlg, rc);
HWND hStateButton = GetDlgItem((HWND)hDlg, IDC_STATE);
GetClientRect(hDlg, rc);
HWND hStateButton = GetDlgItem(hDlg, IDC_STATE);
SetWindowPos(hStateButton, HWND_TOP, (rc->right - rc->left) - 16, 0, 16, rc->bottom - rc->top, 0);
HANDLE hIcon = LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_RIGHT),IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR );
SendDlgItemMessage((HWND)hDlg, IDC_STATE, BM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM) (HANDLE) hIcon);
SendDlgItemMessage(hDlg, IDC_STATE, BM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM) (HANDLE) hIcon);
}
//re-center cheat window
RECT rcDlg, rcParent;
GetWindowRect((HWND)hDlg, &rcDlg);
GetWindowRect(GetParent((HWND)hDlg), &rcParent);
GetWindowRect(hDlg, &rcDlg);
GetWindowRect(GetParent(hDlg), &rcParent);
int DlgWidth = rcDlg.right - rcDlg.left;
int DlgHeight = rcDlg.bottom - rcDlg.top;
@ -1452,7 +1479,7 @@ int CALLBACK CCheats::ManageCheatsProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
int X = (((rcParent.right - rcParent.left) - DlgWidth) / 2) + rcParent.left;
int Y = (((rcParent.bottom - rcParent.top) - DlgHeight) / 2) + rcParent.top;
SetWindowPos((HWND)hDlg,NULL,X,Y,0,0,SWP_NOZORDER|SWP_NOSIZE);
SetWindowPos(hDlg,NULL,X,Y,0,0,SWP_NOZORDER|SWP_NOSIZE);
_this->RefreshCheatManager();
}
@ -1461,36 +1488,36 @@ int CALLBACK CCheats::ManageCheatsProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
switch (LOWORD(wParam)) {
case IDCANCEL:
{
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class");
CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
if (_this->m_AddCheat) {
DestroyWindow((HWND)_this->m_AddCheat);
_this->m_AddCheat = NULL;
}
_this->m_Window = NULL;
}
RemoveProp((HWND)hDlg,"Class");
EndDialog((HWND)hDlg,0);
RemoveProp(hDlg,"Class");
EndDialog(hDlg,0);
break;
case IDC_STATE:
{
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class");
CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
WINDOWPLACEMENT WndPlac;
WndPlac.length = sizeof(WndPlac);
GetWindowPlacement((HWND)hDlg, &WndPlac);
GetWindowPlacement(hDlg, &WndPlac);
if (_this->m_DialogState == CONTRACTED)
{
_this->m_DialogState = EXPANDED;
WndPlac.rcNormalPosition.right = WndPlac.rcNormalPosition.left + _this->m_MaxSizeDlg;
SetWindowPlacement((HWND)hDlg, &WndPlac);
SetWindowPlacement(hDlg, &WndPlac);
RECT clientrect;
GetClientRect((HWND)hDlg, &clientrect);
HWND hStateButton = GetDlgItem((HWND)hDlg, IDC_STATE);
GetClientRect(hDlg, &clientrect);
HWND hStateButton = GetDlgItem(hDlg, IDC_STATE);
SetWindowPos(hStateButton, HWND_TOP, (clientrect.right - clientrect.left) - 16, 0, 16, clientrect.bottom - clientrect.top, 0);
HANDLE hIcon = LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_LEFT),IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR );
SendDlgItemMessage((HWND)hDlg, IDC_STATE, BM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM) (HANDLE) hIcon);
SendDlgItemMessage(hDlg, IDC_STATE, BM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM) (HANDLE) hIcon);
ShowWindow((HWND)_this->m_AddCheat,SW_SHOW);
}
@ -1498,14 +1525,14 @@ int CALLBACK CCheats::ManageCheatsProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
{
_this->m_DialogState = CONTRACTED;
WndPlac.rcNormalPosition.right = WndPlac.rcNormalPosition.left + _this->m_MinSizeDlg;
SetWindowPlacement((HWND)hDlg, &WndPlac);
SetWindowPlacement(hDlg, &WndPlac);
HANDLE hIcon = LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_RIGHT),IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR );
SendDlgItemMessage((HWND)hDlg, IDC_STATE, BM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM) (HANDLE) hIcon);
SendDlgItemMessage(hDlg, IDC_STATE, BM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM) (HANDLE) hIcon);
RECT clientrect;
GetClientRect((HWND)hDlg, &clientrect);
HWND hStateButton = GetDlgItem((HWND)hDlg, IDC_STATE);
GetClientRect(hDlg, &clientrect);
HWND hStateButton = GetDlgItem(hDlg, IDC_STATE);
SetWindowPos(hStateButton, HWND_TOP, (clientrect.right - clientrect.left) - 16, 0, 16, clientrect.bottom - clientrect.top, 0);
ShowWindow((HWND)_this->m_AddCheat,SW_HIDE);
@ -1561,11 +1588,12 @@ int CCheats::TV_GetCheckState(HWND hwndTreeView, HWND hItem)
return ((int)(tvItem.state >> 12) -1);
}
void CCheats::MenuSetText ( HMENU hMenu, int MenuPos, const char * Title, char * ShotCut) {
MENUITEMINFO MenuInfo;
char String[256];
void CCheats::MenuSetText ( HMENU hMenu, int MenuPos, const wchar_t * Title, const wchar_t * ShotCut)
{
MENUITEMINFOW MenuInfo;
wchar_t String[256];
if (Title == NULL || strlen(Title) == 0) { return; }
if (Title == NULL || wcslen(Title) == 0) { return; }
memset(&MenuInfo, 0, sizeof(MENUITEMINFO));
MenuInfo.cbSize = sizeof(MENUITEMINFO);
@ -1575,11 +1603,11 @@ void CCheats::MenuSetText ( HMENU hMenu, int MenuPos, const char * Title, char *
MenuInfo.dwTypeData = String;
MenuInfo.cch = 256;
GetMenuItemInfo((HMENU)hMenu,MenuPos,true,&MenuInfo);
strcpy(String,Title);
if (strchr(String,'\t') != NULL) { *(strchr(String,'\t')) = '\0'; }
if (ShotCut) { sprintf(String,"%s\t%s",String,ShotCut); }
SetMenuItemInfo((HMENU)hMenu,MenuPos,true,&MenuInfo);
GetMenuItemInfoW(hMenu,MenuPos,true,&MenuInfo);
wcscpy(String,Title);
if (wcschr(String,'\t') != NULL) { *(wcschr(String,'\t')) = '\0'; }
if (ShotCut) { _swprintf(String,L"%s\t%s",String,ShotCut); }
SetMenuItemInfoW(hMenu,MenuPos,true,&MenuInfo);
}
void CCheats::DeleteCheat(int Index)
@ -1729,7 +1757,7 @@ stdstr CCheats::ReadCodeString (HWND hDlg, bool &validcodes, bool &validoptions,
char codestring[2048];
memset(codestring, '\0', sizeof(codestring));
numlines = SendDlgItemMessage((HWND)hDlg, IDC_CHEAT_CODES, EM_GETLINECOUNT, 0, 0);
numlines = SendDlgItemMessage(hDlg, IDC_CHEAT_CODES, EM_GETLINECOUNT, 0, 0);
if (numlines == 0) { validcodes = false; }
for (linecount=0; linecount<numlines; linecount++) //read line after line (bypassing limitation GetDlgItemText)
@ -1738,7 +1766,7 @@ stdstr CCheats::ReadCodeString (HWND hDlg, bool &validcodes, bool &validoptions,
//str[0] = sizeof(str) > 255?255:sizeof(str);
*(LPWORD)str = sizeof(str);
len = SendDlgItemMessage((HWND)hDlg, IDC_CHEAT_CODES, EM_GETLINE, (WPARAM)linecount, (LPARAM)(LPCSTR)str);
len = SendDlgItemMessage(hDlg, IDC_CHEAT_CODES, EM_GETLINE, (WPARAM)linecount, (LPARAM)(LPCSTR)str);
str[len] = 0;
if (len <= 0) { continue; }
@ -1803,14 +1831,14 @@ stdstr CCheats::ReadOptionsString(HWND hDlg, bool &/*validcodes*/, bool &validop
char optionsstring[2048];
memset(optionsstring, '\0', sizeof(optionsstring));
numlines = SendDlgItemMessage((HWND)hDlg, IDC_CHEAT_OPTIONS, EM_GETLINECOUNT, 0, 0);
numlines = SendDlgItemMessage(hDlg, IDC_CHEAT_OPTIONS, EM_GETLINECOUNT, 0, 0);
for (linecount=0; linecount<numlines; linecount++) //read line after line (bypassing limitation GetDlgItemText)
{
memset(str,0,sizeof(str));
//str[0] = sizeof(str) > 255?255:sizeof(str);
*(LPWORD)str = sizeof(str);
len = SendDlgItemMessage((HWND)hDlg, IDC_CHEAT_OPTIONS, EM_GETLINE, (WPARAM)linecount, (LPARAM)(LPCSTR)str);
len = SendDlgItemMessage(hDlg, IDC_CHEAT_OPTIONS, EM_GETLINE, (WPARAM)linecount, (LPARAM)(LPCSTR)str);
str[len] = 0;
if (len > 0) {

View File

@ -84,7 +84,7 @@ private:
static bool TV_SetCheckState(HWND hwndTreeView, HWND hItem, TV_CHECK_STATE state);
static int TV_GetCheckState(HWND hwndTreeView, HWND hItem);
static DWORD AsciiToHex ( const char * HexValue );
static void MenuSetText ( HMENU hMenu, int MenuPos, const char * Title, char * ShotCut );
static void MenuSetText ( HMENU hMenu, int MenuPos, const wchar_t * Title, const wchar_t * ShotCut );
//UI Functions

View File

@ -89,7 +89,7 @@ LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/,
GetDlgItemText(IDC_FILENAME,FileName,sizeof(FileName));
if (strlen(FileName) == 0)
{
g_Notify->DisplayError("Please Choose target file");
g_Notify->DisplayError(L"Please Choose target file");
::SetFocus(GetDlgItem(IDC_FILENAME));
return false;
}
@ -182,12 +182,12 @@ LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/,
// case WM_INITDIALOG:
// {
// CDumpMemory * _this = (CDumpMemory *)lParam;
// SetProp((HWND)hDlg,"Class",_this);
// SetProp(hDlg,"Class",_this);
// _this->m_Window = hDlg;
// SetDlgItemText((HWND)hDlg,IDC_E_START_ADDR,stdstr("0x%X",m_StartAddress).c_str());
// SetDlgItemText((HWND)hDlg,IDC_E_END_ADDR,stdstr("0x%X",m_EndAddress).c_str());
// SetDlgItemText((HWND)hDlg,IDC_E_ALT_PC,"0x80000000");
// HWND hFormatList = GetDlgItem((HWND)hDlg,IDC_FORMAT);
// SetDlgItemText(hDlg,IDC_E_START_ADDR,stdstr("0x%X",m_StartAddress).c_str());
// SetDlgItemText(hDlg,IDC_E_END_ADDR,stdstr("0x%X",m_EndAddress).c_str());
// SetDlgItemText(hDlg,IDC_E_ALT_PC,"0x80000000");
// HWND hFormatList = GetDlgItem(hDlg,IDC_FORMAT);
// int pos = SendMessage(hFormatList,CB_ADDSTRING,(WPARAM)0,(LPARAM)"TEXT - Disassembly + PC");
// SendMessage(hFormatList,CB_SETITEMDATA,(WPARAM)pos,(LPARAM)DisassemblyWithPC);
// SendMessage(hFormatList,CB_SETCURSEL,(WPARAM)0,(LPARAM)0);
@ -200,35 +200,35 @@ LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/,
// case IDC_E_END_ADDR:
// case IDC_E_ALT_PC:
// if (HIWORD(wParam) == EN_UPDATE) {
// CDumpMemory * _this = (CDumpMemory *)GetProp((HWND)hDlg,"Class");
// CDumpMemory * _this = (CDumpMemory *)GetProp(hDlg,"Class");
// TCHAR szTmp[20], szTmp2[20];
// DWORD Value;
// GetDlgItemText((HWND)hDlg,LOWORD(wParam),szTmp,sizeof(szTmp));
// GetDlgItemText(hDlg,LOWORD(wParam),szTmp,sizeof(szTmp));
// Value = szTmp[1] =='x'?AsciiToHex(&szTmp[2]):AsciiToHex(szTmp);
// //if (Value > Stop) { Value = Stop; }
// //if (Value < Start) { Value = Start; }
// sprintf(szTmp2,"0x%X",Value);
// if (strcmp(szTmp,szTmp2) != 0) {
// SetDlgItemText((HWND)hDlg,LOWORD(wParam),szTmp2);
// SetDlgItemText(hDlg,LOWORD(wParam),szTmp2);
// if (_this->SelStop == 0) { _this->SelStop = strlen(szTmp2); _this->SelStart = _this->SelStop; }
// SendDlgItemMessage((HWND)hDlg,LOWORD(wParam),EM_SETSEL,(WPARAM)_this->SelStart,(LPARAM)_this->SelStop);
// SendDlgItemMessage(hDlg,LOWORD(wParam),EM_SETSEL,(WPARAM)_this->SelStart,(LPARAM)_this->SelStop);
// } else {
// WORD NewSelStart, NewSelStop;
// SendDlgItemMessage((HWND)hDlg,LOWORD(wParam),EM_GETSEL,(WPARAM)&NewSelStart,(LPARAM)&NewSelStop);
// SendDlgItemMessage(hDlg,LOWORD(wParam),EM_GETSEL,(WPARAM)&NewSelStart,(LPARAM)&NewSelStop);
// if (NewSelStart != 0) { _this->SelStart = NewSelStart; _this->SelStop = NewSelStop; }
// }
// }
// break;
// case IDC_BTN_CHOOSE_FILE:
// {
// CDumpMemory * _this = (CDumpMemory *)GetProp((HWND)hDlg,"Class");
// CDumpMemory * _this = (CDumpMemory *)GetProp(hDlg,"Class");
// OPENFILENAME openfilename;
// char FileName[_MAX_PATH],Directory[_MAX_PATH];
// memset(&FileName, 0, sizeof(FileName));
// memset(&openfilename, 0, sizeof(openfilename));
// strcpy(Directory,g_Settings->LoadString(ApplicationDir).c_str());
// openfilename.lStructSize = sizeof( openfilename );
// openfilename.hwndOwner = (HWND)hDlg;
// openfilename.hwndOwner = hDlg;
// openfilename.lpstrFilter = "Text file (*.txt)\0*.txt;\0All files (*.*)\0*.*\0";
// openfilename.lpstrFile = FileName;
// openfilename.lpstrInitialDir = Directory;
@ -242,55 +242,55 @@ LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/,
// {
// strcat(FileName,".txt");
// }
// SetDlgItemText((HWND)hDlg,IDC_FILENAME,FileName);
// SetDlgItemText(hDlg,IDC_FILENAME,FileName);
// }
// }
// break;
// case IDCANCEL:
// RemoveProp((HWND)hDlg,"Class");
// EndDialog((HWND)hDlg,0);
// RemoveProp(hDlg,"Class");
// EndDialog(hDlg,0);
// break;
// case IDOK:
// {
// CDumpMemory * _this = (CDumpMemory *)GetProp((HWND)hDlg,"Class");
// CDumpMemory * _this = (CDumpMemory *)GetProp(hDlg,"Class");
// TCHAR szTmp[20], FileName[MAX_PATH];
// int CurrentFormatSel = SendDlgItemMessage((HWND)hDlg,IDC_FORMAT,CB_GETCURSEL,0,0);
// DumpFormat Format = (DumpFormat)SendDlgItemMessage((HWND)hDlg,IDC_FORMAT,CB_GETITEMDATA,CurrentFormatSel,0);
// GetDlgItemText((HWND)hDlg,IDC_E_START_ADDR,szTmp,sizeof(szTmp));
// int CurrentFormatSel = SendDlgItemMessage(hDlg,IDC_FORMAT,CB_GETCURSEL,0,0);
// DumpFormat Format = (DumpFormat)SendDlgItemMessage(hDlg,IDC_FORMAT,CB_GETITEMDATA,CurrentFormatSel,0);
// GetDlgItemText(hDlg,IDC_E_START_ADDR,szTmp,sizeof(szTmp));
// DWORD StartPC = szTmp[1] =='x'?AsciiToHex(&szTmp[2]):AsciiToHex(szTmp);
// GetDlgItemText((HWND)hDlg,IDC_E_END_ADDR,szTmp,sizeof(szTmp));
// GetDlgItemText(hDlg,IDC_E_END_ADDR,szTmp,sizeof(szTmp));
// DWORD EndPC = szTmp[1] =='x'?AsciiToHex(&szTmp[2]):AsciiToHex(szTmp);
// GetDlgItemText((HWND)hDlg,IDC_E_ALT_PC,szTmp,sizeof(szTmp));
// GetDlgItemText(hDlg,IDC_E_ALT_PC,szTmp,sizeof(szTmp));
// DWORD DumpPC = szTmp[1] =='x'?AsciiToHex(&szTmp[2]):AsciiToHex(szTmp);
// GetDlgItemText((HWND)hDlg,IDC_FILENAME,FileName,sizeof(FileName));
// GetDlgItemText(hDlg,IDC_FILENAME,FileName,sizeof(FileName));
// if (strlen(FileName) == 0)
// {
// g_Notify->DisplayError("Please Choose target file");
// SetFocus(GetDlgItem((HWND)hDlg,IDC_FILENAME));
// g_Notify->DisplayError(L"Please Choose target file");
// SetFocus(GetDlgItem(hDlg,IDC_FILENAME));
// return false;
// }
// if (SendDlgItemMessage((HWND)hDlg,IDC_USE_ALT_PC,BM_GETSTATE, 0,0) != BST_CHECKED)
// if (SendDlgItemMessage(hDlg,IDC_USE_ALT_PC,BM_GETSTATE, 0,0) != BST_CHECKED)
// {
// DumpPC = _this->g_MMU->SystemRegisters()->PROGRAM_COUNTER;
// }
// //disable buttons
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_E_START_ADDR),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_E_END_ADDR),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_E_ALT_PC),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_USE_ALT_PC),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_FILENAME),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_BTN_CHOOSE_FILE),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_FORMAT),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDOK),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDCANCEL),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_E_START_ADDR),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_E_END_ADDR),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_E_ALT_PC),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_USE_ALT_PC),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_FILENAME),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_BTN_CHOOSE_FILE),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_FORMAT),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDOK),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDCANCEL),FALSE);
// if (!_this->DumpMemory(FileName,Format,StartPC,EndPC,DumpPC))
// {
// //enable buttons
// return false;
// }
// }
// RemoveProp((HWND)hDlg,"Class");
// EndDialog((HWND)hDlg,0);
// RemoveProp(hDlg,"Class");
// EndDialog(hDlg,0);
// break;
// }
// break;
@ -309,7 +309,7 @@ bool CDumpMemory::DumpMemory ( LPCSTR FileName,DumpFormat Format, DWORD StartPC,
CLog LogFile;
if (!LogFile.Open(FileName))
{
g_Notify->DisplayError("Failed to open\n%s",FileName);
g_Notify->DisplayError(L"Failed to open\n%s",FileName);
return false;
}
LogFile.SetFlush(false);
@ -393,13 +393,13 @@ bool CDumpMemory::DumpMemory ( LPCSTR FileName,DumpFormat Format, DWORD StartPC,
// case WM_INITDIALOG:
// {
// CDumpMemory * _this = (CDumpMemory *)lParam;
// SetProp((HWND)hDlg,"Class",_this);
// SetProp(hDlg,"Class",_this);
// _this->m_Window = hDlg;
// SetDlgItemText((HWND)hDlg,IDC_E_START_ADDR,stdstr("0x%X",m_StartAddress).c_str());
// SetDlgItemText((HWND)hDlg,IDC_E_END_ADDR,stdstr("0x%X",m_EndAddress).c_str());
// SetDlgItemText((HWND)hDlg,IDC_E_ALT_PC,"0x80000000");
// SetDlgItemText(hDlg,IDC_E_START_ADDR,stdstr("0x%X",m_StartAddress).c_str());
// SetDlgItemText(hDlg,IDC_E_END_ADDR,stdstr("0x%X",m_EndAddress).c_str());
// SetDlgItemText(hDlg,IDC_E_ALT_PC,"0x80000000");
//
// HWND hFormatList = GetDlgItem((HWND)hDlg,IDC_FORMAT);
// HWND hFormatList = GetDlgItem(hDlg,IDC_FORMAT);
// int pos = SendMessage(hFormatList,CB_ADDSTRING,(WPARAM)0,(LPARAM)"TEXT - Disassembly + PC");
// SendMessage(hFormatList,CB_SETITEMDATA,(WPARAM)pos,(LPARAM)DisassemblyWithPC);
// SendMessage(hFormatList,CB_SETCURSEL,(WPARAM)0,(LPARAM)0);
@ -413,30 +413,30 @@ bool CDumpMemory::DumpMemory ( LPCSTR FileName,DumpFormat Format, DWORD StartPC,
// case IDC_E_END_ADDR:
// case IDC_E_ALT_PC:
// if (HIWORD(wParam) == EN_UPDATE) {
// CDumpMemory * _this = (CDumpMemory *)GetProp((HWND)hDlg,"Class");
// CDumpMemory * _this = (CDumpMemory *)GetProp(hDlg,"Class");
//
// TCHAR szTmp[20], szTmp2[20];
// DWORD Value;
//
// GetDlgItemText((HWND)hDlg,LOWORD(wParam),szTmp,sizeof(szTmp));
// GetDlgItemText(hDlg,LOWORD(wParam),szTmp,sizeof(szTmp));
// Value = szTmp[1] =='x'?AsciiToHex(&szTmp[2]):AsciiToHex(szTmp);
// //if (Value > Stop) { Value = Stop; }
// //if (Value < Start) { Value = Start; }
// sprintf(szTmp2,"0x%X",Value);
// if (strcmp(szTmp,szTmp2) != 0) {
// SetDlgItemText((HWND)hDlg,LOWORD(wParam),szTmp2);
// SetDlgItemText(hDlg,LOWORD(wParam),szTmp2);
// if (_this->SelStop == 0) { _this->SelStop = strlen(szTmp2); _this->SelStart = _this->SelStop; }
// SendDlgItemMessage((HWND)hDlg,LOWORD(wParam),EM_SETSEL,(WPARAM)_this->SelStart,(LPARAM)_this->SelStop);
// SendDlgItemMessage(hDlg,LOWORD(wParam),EM_SETSEL,(WPARAM)_this->SelStart,(LPARAM)_this->SelStop);
// } else {
// WORD NewSelStart, NewSelStop;
// SendDlgItemMessage((HWND)hDlg,LOWORD(wParam),EM_GETSEL,(WPARAM)&NewSelStart,(LPARAM)&NewSelStop);
// SendDlgItemMessage(hDlg,LOWORD(wParam),EM_GETSEL,(WPARAM)&NewSelStart,(LPARAM)&NewSelStop);
// if (NewSelStart != 0) { _this->SelStart = NewSelStart; _this->SelStop = NewSelStop; }
// }
// }
// break;
// case IDC_BTN_CHOOSE_FILE:
// {
// CDumpMemory * _this = (CDumpMemory *)GetProp((HWND)hDlg,"Class");
// CDumpMemory * _this = (CDumpMemory *)GetProp(hDlg,"Class");
//
// OPENFILENAME openfilename;
// char FileName[_MAX_PATH],Directory[_MAX_PATH];
@ -447,7 +447,7 @@ bool CDumpMemory::DumpMemory ( LPCSTR FileName,DumpFormat Format, DWORD StartPC,
// strcpy(Directory,g_Settings->LoadString(ApplicationDir).c_str());
//
// openfilename.lStructSize = sizeof( openfilename );
// openfilename.hwndOwner = (HWND)hDlg;
// openfilename.hwndOwner = hDlg;
// openfilename.lpstrFilter = "Text file (*.txt)\0*.txt;\0All files (*.*)\0*.*\0";
// openfilename.lpstrFile = FileName;
// openfilename.lpstrInitialDir = Directory;
@ -463,59 +463,59 @@ bool CDumpMemory::DumpMemory ( LPCSTR FileName,DumpFormat Format, DWORD StartPC,
// {
// strcat(FileName,".txt");
// }
// SetDlgItemText((HWND)hDlg,IDC_FILENAME,FileName);
// SetDlgItemText(hDlg,IDC_FILENAME,FileName);
// }
// }
// break;
// case IDCANCEL:
// RemoveProp((HWND)hDlg,"Class");
// EndDialog((HWND)hDlg,0);
// RemoveProp(hDlg,"Class");
// EndDialog(hDlg,0);
// break;
// case IDOK:
// {
// CDumpMemory * _this = (CDumpMemory *)GetProp((HWND)hDlg,"Class");
// CDumpMemory * _this = (CDumpMemory *)GetProp(hDlg,"Class");
// TCHAR szTmp[20], FileName[MAX_PATH];
//
// int CurrentFormatSel = SendDlgItemMessage((HWND)hDlg,IDC_FORMAT,CB_GETCURSEL,0,0);
// DumpFormat Format = (DumpFormat)SendDlgItemMessage((HWND)hDlg,IDC_FORMAT,CB_GETITEMDATA,CurrentFormatSel,0);
// int CurrentFormatSel = SendDlgItemMessage(hDlg,IDC_FORMAT,CB_GETCURSEL,0,0);
// DumpFormat Format = (DumpFormat)SendDlgItemMessage(hDlg,IDC_FORMAT,CB_GETITEMDATA,CurrentFormatSel,0);
//
// GetDlgItemText((HWND)hDlg,IDC_E_START_ADDR,szTmp,sizeof(szTmp));
// GetDlgItemText(hDlg,IDC_E_START_ADDR,szTmp,sizeof(szTmp));
// DWORD StartPC = szTmp[1] =='x'?AsciiToHex(&szTmp[2]):AsciiToHex(szTmp);
// GetDlgItemText((HWND)hDlg,IDC_E_END_ADDR,szTmp,sizeof(szTmp));
// GetDlgItemText(hDlg,IDC_E_END_ADDR,szTmp,sizeof(szTmp));
// DWORD EndPC = szTmp[1] =='x'?AsciiToHex(&szTmp[2]):AsciiToHex(szTmp);
// GetDlgItemText((HWND)hDlg,IDC_E_ALT_PC,szTmp,sizeof(szTmp));
// GetDlgItemText(hDlg,IDC_E_ALT_PC,szTmp,sizeof(szTmp));
// DWORD DumpPC = szTmp[1] =='x'?AsciiToHex(&szTmp[2]):AsciiToHex(szTmp);
// GetDlgItemText((HWND)hDlg,IDC_FILENAME,FileName,sizeof(FileName));
// GetDlgItemText(hDlg,IDC_FILENAME,FileName,sizeof(FileName));
//
// if (strlen(FileName) == 0)
// {
// g_Notify->DisplayError("Please Choose target file");
// SetFocus(GetDlgItem((HWND)hDlg,IDC_FILENAME));
// g_Notify->DisplayError(L"Please Choose target file");
// SetFocus(GetDlgItem(hDlg,IDC_FILENAME));
// return false;
// }
//
// if (SendDlgItemMessage((HWND)hDlg,IDC_USE_ALT_PC,BM_GETSTATE, 0,0) != BST_CHECKED)
// if (SendDlgItemMessage(hDlg,IDC_USE_ALT_PC,BM_GETSTATE, 0,0) != BST_CHECKED)
// {
// DumpPC = _this->g_MMU->SystemRegisters()->PROGRAM_COUNTER;
// }
// //disable buttons
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_E_START_ADDR),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_E_END_ADDR),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_E_ALT_PC),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_USE_ALT_PC),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_FILENAME),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_BTN_CHOOSE_FILE),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDC_FORMAT),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDOK),FALSE);
// EnableWindow(GetDlgItem((HWND)hDlg,IDCANCEL),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_E_START_ADDR),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_E_END_ADDR),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_E_ALT_PC),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_USE_ALT_PC),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_FILENAME),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_BTN_CHOOSE_FILE),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDC_FORMAT),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDOK),FALSE);
// EnableWindow(GetDlgItem(hDlg,IDCANCEL),FALSE);
// if (!_this->DumpMemory(FileName,Format,StartPC,EndPC,DumpPC))
// {
// //enable buttons
// return false;
// }
// }
// RemoveProp((HWND)hDlg,"Class");
// EndDialog((HWND)hDlg,0);
// RemoveProp(hDlg,"Class");
// EndDialog(hDlg,0);
// break;
// }
// break;
@ -534,7 +534,7 @@ bool CDumpMemory::DumpMemory ( LPCSTR FileName,DumpFormat Format, DWORD StartPC,
// CLog LogFile(FileName);
// if (!LogFile.IsOpen())
// {
// g_Notify->DisplayError("Failed to open\n%s",FileName);
// g_Notify->DisplayError(L"Failed to open\n%s",FileName);
// return false;
// }
//

View File

@ -21,7 +21,7 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) {
OPCODE Command;
if (!g_MMU->LW_VAddr(PC + 4, Command.Hex)) {
//g_Notify->DisplayError("Failed to load word 2");
//g_Notify->DisplayError(L"Failed to load word 2");
//ExitThread(0);
return TRUE;
}
@ -78,7 +78,7 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) {
default:
if (g_Settings->LoadBool(Debugger_Enabled))
{
g_Notify->DisplayError("Does %s effect Delay slot at %X?",R4300iOpcodeName(Command.Hex,PC+4), PC);
g_Notify->DisplayError(L"Does %s effect Delay slot at %X?",R4300iOpcodeName(Command.Hex,PC+4), PC);
}
return TRUE;
}
@ -101,14 +101,14 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) {
default:
if (g_Settings->LoadBool(Debugger_Enabled))
{
g_Notify->DisplayError("Does %s effect Delay slot at %X?\n6",R4300iOpcodeName(Command.Hex,PC+4), PC);
g_Notify->DisplayError(L"Does %s effect Delay slot at %X?\n6",R4300iOpcodeName(Command.Hex,PC+4), PC);
}
return TRUE;
}
} else {
if (g_Settings->LoadBool(Debugger_Enabled))
{
g_Notify->DisplayError("Does %s effect Delay slot at %X?\n7",R4300iOpcodeName(Command.Hex,PC+4), PC);
g_Notify->DisplayError(L"Does %s effect Delay slot at %X?\n7",R4300iOpcodeName(Command.Hex,PC+4), PC);
}
return TRUE;
}
@ -131,7 +131,7 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) {
default:
if (g_Settings->LoadBool(Debugger_Enabled))
{
g_Notify->DisplayError("Does %s effect Delay slot at %X?",R4300iOpcodeName(Command.Hex,PC+4), PC);
g_Notify->DisplayError(L"Does %s effect Delay slot at %X?",R4300iOpcodeName(Command.Hex,PC+4), PC);
}
return TRUE;
}
@ -174,7 +174,7 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) {
default:
if (g_Settings->LoadBool(Debugger_Enabled))
{
g_Notify->DisplayError("Does %s effect Delay slot at %X?",R4300iOpcodeName(Command.Hex,PC+4), PC);
g_Notify->DisplayError(L"Does %s effect Delay slot at %X?",R4300iOpcodeName(Command.Hex,PC+4), PC);
}
return TRUE;
}

View File

@ -843,7 +843,7 @@ void R4300iOp32::LB (void) {
if (m_Opcode.rt == 0) { return; }
if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) {
if (bShowTLBMisses()) {
g_Notify->DisplayError("LB TLB: %X",Address);
g_Notify->DisplayError(L"LB TLB: %X",Address);
}
TLB_READ_EXCEPTION(Address);
} else {
@ -856,7 +856,7 @@ void R4300iOp32::LH (void) {
if ((Address & 1) != 0) { ADDRESS_ERROR_EXCEPTION(Address,TRUE); }
if (!g_MMU->LH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0])) {
if (bShowTLBMisses()) {
g_Notify->DisplayError("LH TLB: %X",Address);
g_Notify->DisplayError(L"LH TLB: %X",Address);
}
TLB_READ_EXCEPTION(Address);
} else {
@ -873,7 +873,7 @@ void R4300iOp32::LWL (void) {
if (!g_MMU->LW_VAddr((Address & ~3),Value))
{
if (bShowTLBMisses()) {
g_Notify->DisplayError("LWL TLB: %X",Address);
g_Notify->DisplayError(L"LWL TLB: %X",Address);
}
TLB_READ_EXCEPTION(Address);
return;
@ -896,7 +896,7 @@ void R4300iOp32::LW (void) {
if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) {
if (bShowTLBMisses()) {
g_Notify->DisplayError("LW TLB: %X",Address);
g_Notify->DisplayError(L"LW TLB: %X",Address);
}
TLB_READ_EXCEPTION(Address);
} else {
@ -908,7 +908,7 @@ void R4300iOp32::LBU (void) {
DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;
if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) {
if (bShowTLBMisses()) {
g_Notify->DisplayError("LBU TLB: %X",Address);
g_Notify->DisplayError(L"LBU TLB: %X",Address);
}
TLB_READ_EXCEPTION(Address);
} else {
@ -921,7 +921,7 @@ void R4300iOp32::LHU (void) {
if ((Address & 1) != 0) { ADDRESS_ERROR_EXCEPTION(Address,TRUE); }
if (!g_MMU->LH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0])) {
if (bShowTLBMisses()) {
g_Notify->DisplayError("LHU TLB: %X",Address);
g_Notify->DisplayError(L"LHU TLB: %X",Address);
}
TLB_READ_EXCEPTION(Address);
} else {
@ -940,7 +940,7 @@ void R4300iOp32::LWR (void) {
g_Notify->BreakPoint(__FILE__,__LINE__);
if (bShowTLBMisses())
{
g_Notify->DisplayError("LWR TLB: %X",Address);
g_Notify->DisplayError(L"LWR TLB: %X",Address);
}
return;
}
@ -956,7 +956,7 @@ void R4300iOp32::LWU (void) {
if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) {
if (bShowTLBMisses()) {
g_Notify->DisplayError("LWU TLB: %X",Address);
g_Notify->DisplayError(L"LWU TLB: %X",Address);
}
TLB_READ_EXCEPTION(Address);
} else {
@ -973,7 +973,7 @@ void R4300iOp32::LL (void) {
if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) {
if (bShowTLBMisses()) {
g_Notify->DisplayError("LL TLB: %X",Address);
g_Notify->DisplayError(L"LL TLB: %X",Address);
}
TLB_READ_EXCEPTION(Address);
} else {
@ -1067,7 +1067,7 @@ void R4300iOp32::SPECIAL_SLTU (void) {
void R4300iOp32::SPECIAL_TEQ (void) {
if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0] && g_Settings->LoadBool(Debugger_Enabled))
{
g_Notify->DisplayError("Should trap this ???");
g_Notify->DisplayError(L"Should trap this ???");
}
}
@ -1246,7 +1246,7 @@ void R4300iOp32::COP0_MT (void) {
}
if ((_CP0[m_Opcode.rd] & 0x18) != 0 && g_Settings->LoadBool(Debugger_Enabled))
{
g_Notify->DisplayError("Left kernel mode ??");
g_Notify->DisplayError(L"Left kernel mode ??");
}
g_Reg->CheckInterrupts();
break;
@ -1254,7 +1254,7 @@ void R4300iOp32::COP0_MT (void) {
_CP0[m_Opcode.rd] &= 0xFFFFCFF;
if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 && g_Settings->LoadBool(Debugger_Enabled) )
{
g_Notify->DisplayError("Set IP0 or IP1");
g_Notify->DisplayError(L"Set IP0 or IP1");
}
break;
default:
@ -1272,7 +1272,7 @@ void R4300iOp32::COP1_CF (void) {
TEST_COP1_USABLE_EXCEPTION
if (m_Opcode.fs != 31 && m_Opcode.fs != 0)
{
if (g_Settings->LoadBool(Debugger_Enabled)) { g_Notify->DisplayError("CFC1 what register are you writing to ?"); }
if (g_Settings->LoadBool(Debugger_Enabled)) { g_Notify->DisplayError(L"CFC1 what register are you writing to ?"); }
return;
}
_GPR[m_Opcode.rt].W[0] = (int)_FPCR[m_Opcode.fs];

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@ void CDMA::OnFirstDMA (void) {
case CIC_NUS_6103: *(DWORD *)&((g_MMU->Rdram())[0x318]) = g_MMU->RdramSize(); break;
case CIC_NUS_6105: *(DWORD *)&((g_MMU->Rdram())[0x3F0]) = g_MMU->RdramSize(); break;
case CIC_NUS_6106: *(DWORD *)&((g_MMU->Rdram())[0x318]) = g_MMU->RdramSize(); break;
default: g_Notify->DisplayError("Unhandled CicChip(%d) in first DMA",g_Rom->CicChipID());
default: g_Notify->DisplayError(L"Unhandled CicChip(%d) in first DMA",g_Rom->CicChipID());
}
}
@ -33,7 +33,7 @@ void CDMA::PI_DMA_READ (void) {
if ( g_Reg->PI_DRAM_ADDR_REG + g_Reg->PI_RD_LEN_REG + 1 > g_MMU->RdramSize())
{
if (bHaveDebugger()) { g_Notify->DisplayError("PI_DMA_READ not in Memory"); }
if (bHaveDebugger()) { g_Notify->DisplayError(L"PI_DMA_READ not in Memory"); }
g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY;
g_Reg->MI_INTR_REG |= MI_INTR_PI;
g_Reg->CheckInterrupts();
@ -67,7 +67,7 @@ void CDMA::PI_DMA_READ (void) {
}
if (g_System->m_SaveUsing == SaveChip_FlashRam)
{
g_Notify->DisplayError("**** FLashRam DMA Read address %X *****",g_Reg->PI_CART_ADDR_REG);
g_Notify->DisplayError(L"**** FLashRam DMA Read address %X *****",g_Reg->PI_CART_ADDR_REG);
g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY;
g_Reg->MI_INTR_REG |= MI_INTR_PI;
g_Reg->CheckInterrupts();
@ -75,7 +75,7 @@ void CDMA::PI_DMA_READ (void) {
}
if (bHaveDebugger())
{
g_Notify->DisplayError("PI_DMA_READ where are you dmaing to ?");
g_Notify->DisplayError(L"PI_DMA_READ where are you dmaing to ?");
}
g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY;
g_Reg->MI_INTR_REG |= MI_INTR_PI;
@ -95,7 +95,7 @@ void CDMA::PI_DMA_WRITE (void)
g_Reg->PI_STATUS_REG |= PI_STATUS_DMA_BUSY;
if ( g_Reg->PI_DRAM_ADDR_REG + PI_WR_LEN_REG > g_MMU->RdramSize())
{
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("PI_DMA_WRITE not in Memory"); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"PI_DMA_WRITE not in Memory"); }
g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY;
g_Reg->MI_INTR_REG |= MI_INTR_PI;
g_Reg->CheckInterrupts();
@ -175,7 +175,7 @@ void CDMA::PI_DMA_WRITE (void)
return;
}
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("PI_DMA_WRITE not in ROM"); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"PI_DMA_WRITE not in ROM"); }
g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY;
g_Reg->MI_INTR_REG |= MI_INTR_PI;
g_Reg->CheckInterrupts();
@ -189,7 +189,7 @@ void CDMA::SP_DMA_READ (void) {
{
if (bHaveDebugger())
{
g_Notify->DisplayError(__FUNCTION__ "\nSP_DRAM_ADDR_REG not in RDRam space");
g_Notify->DisplayError(__FUNCTIONW__ L"\nSP_DRAM_ADDR_REG not in RDRam space");
}
g_Reg->SP_DMA_BUSY_REG = 0;
g_Reg->SP_STATUS_REG &= ~SP_STATUS_DMA_BUSY;
@ -200,7 +200,7 @@ void CDMA::SP_DMA_READ (void) {
{
if (bHaveDebugger())
{
g_Notify->DisplayError(__FUNCTION__ "\ncould not fit copy in memory segement");
g_Notify->DisplayError(__FUNCTIONW__ L"\ncould not fit copy in memory segement");
}
return;
}
@ -222,7 +222,7 @@ void CDMA::SP_DMA_WRITE (void)
{
if (bHaveDebugger())
{
g_Notify->DisplayError("SP DMA WRITE\nSP_DRAM_ADDR_REG not in RDRam space");
g_Notify->DisplayError(L"SP DMA WRITE\nSP_DRAM_ADDR_REG not in RDRam space");
}
return;
}
@ -231,7 +231,7 @@ void CDMA::SP_DMA_WRITE (void)
{
if (bHaveDebugger())
{
g_Notify->DisplayError("SP DMA WRITE\ncould not fit copy in memory segement");
g_Notify->DisplayError(L"SP DMA WRITE\ncould not fit copy in memory segement");
}
return;
}

View File

@ -59,13 +59,13 @@ void CEeprom::EepromCommand ( BYTE * Command) {
}
break;
case 4: // Read from Eeprom
if (Command[0] != 2 && bHaveDebugger()) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); }
if (Command[1] != 8 && bHaveDebugger()) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); }
if (Command[0] != 2 && bHaveDebugger()) { g_Notify->DisplayError(L"What am I meant to do with this Eeprom Command"); }
if (Command[1] != 8 && bHaveDebugger()) { g_Notify->DisplayError(L"What am I meant to do with this Eeprom Command"); }
ReadFrom(&Command[4],Command[3]);
break;
case 5: //Write to Eeprom
if (Command[0] != 10 && bHaveDebugger()) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); }
if (Command[1] != 1 && bHaveDebugger()) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); }
if (Command[0] != 10 && bHaveDebugger()) { g_Notify->DisplayError(L"What am I meant to do with this Eeprom Command"); }
if (Command[1] != 1 && bHaveDebugger()) { g_Notify->DisplayError(L"What am I meant to do with this Eeprom Command"); }
WriteTo(&Command[4],Command[3]);
break;
case 6: //RTC Status query
@ -101,10 +101,10 @@ void CEeprom::EepromCommand ( BYTE * Command) {
break;
case 8:
//Write RTC, unimplemented
if (g_Settings->LoadDword(Debugger_ShowPifErrors)) { g_Notify->DisplayError("Write RTC, unimplemented"); }
if (g_Settings->LoadDword(Debugger_ShowPifErrors)) { g_Notify->DisplayError(L"Write RTC, unimplemented"); }
break;
default:
if (g_Settings->LoadDword(Debugger_ShowPifErrors)) { g_Notify->DisplayError("Unknown EepromCommand %d",Command[2]); }
if (g_Settings->LoadDword(Debugger_ShowPifErrors)) { g_Notify->DisplayError(L"Unknown EepromCommand %d",Command[2]); }
}
}

View File

@ -41,7 +41,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
{
if (bHaveDebugger())
{
g_Notify->DisplayError("DmaFromFlashram FlipBuffer to small (len: %d)",len);
g_Notify->DisplayError(L"DmaFromFlashram FlipBuffer to small (len: %d)",len);
}
len = 0x10000;
}
@ -49,7 +49,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
{
if (bHaveDebugger())
{
g_Notify->DisplayError("Unaligned flash ram read ???");
g_Notify->DisplayError(L"Unaligned flash ram read ???");
}
return;
}
@ -80,7 +80,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
{
if (bHaveDebugger())
{
g_Notify->DisplayError("Reading m_FlashStatus not being handled correctly\nStart: %X len: %X",StartOffset,len);
g_Notify->DisplayError(L"Reading m_FlashStatus not being handled correctly\nStart: %X len: %X",StartOffset,len);
}
}
*((DWORD *)(dest)) = (DWORD)((m_FlashStatus >> 32) & 0xFFFFFFFF);
@ -89,7 +89,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
default:
if (bHaveDebugger())
{
g_Notify->DisplayError("DmaFromFlashram Start: %X, Offset: %X len: %X",dest - g_MMU->Rdram(),StartOffset,len);
g_Notify->DisplayError(L"DmaFromFlashram Start: %X, Offset: %X len: %X",dest - g_MMU->Rdram(),StartOffset,len);
}
}
}
@ -102,7 +102,7 @@ void CFlashram::DmaToFlashram(BYTE * Source, int StartOffset, int len) {
default:
if (bHaveDebugger())
{
g_Notify->DisplayError("DmaToFlashram Start: %X, Offset: %X len: %X",Source - g_MMU->Rdram(),StartOffset,len);
g_Notify->DisplayError(L"DmaToFlashram Start: %X, Offset: %X len: %X",Source - g_MMU->Rdram(),StartOffset,len);
}
}
}
@ -115,7 +115,7 @@ DWORD CFlashram::ReadFromFlashStatus (DWORD PAddr)
default:
if (bHaveDebugger())
{
g_Notify->DisplayError("Reading from flash ram status (%X)",PAddr);
g_Notify->DisplayError(L"Reading from flash ram status (%X)",PAddr);
}
break;
}
@ -193,7 +193,7 @@ void CFlashram::WriteToFlashCommand(DWORD FlashRAM_Command) {
}
break;
default:
g_Notify->DisplayError("Writing %X to flash ram command register\nm_FlashFlag: %d",FlashRAM_Command,m_FlashFlag);
g_Notify->DisplayError(L"Writing %X to flash ram command register\nm_FlashFlag: %d",FlashRAM_Command,m_FlashFlag);
}
m_FlashFlag = FLASHRAM_MODE_NOPES;
break;
@ -222,7 +222,7 @@ void CFlashram::WriteToFlashCommand(DWORD FlashRAM_Command) {
default:
if (bHaveDebugger())
{
g_Notify->DisplayError("Writing %X to flash ram command register",FlashRAM_Command);
g_Notify->DisplayError(L"Writing %X to flash ram command register",FlashRAM_Command);
}
}
}

View File

@ -483,7 +483,7 @@ void CMipsMemoryVM::Compile_LB ( x86Reg Reg, DWORD VAddr, BOOL SignExtend) {
if (!TranslateVaddr(VAddr,PAddr)) {
MoveConstToX86reg(0,Reg);
CPU_Message("Compile_LB\nFailed to translate address %X",VAddr);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_LB\nFailed to translate address %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_LB\nFailed to translate address %X",VAddr); }
return;
}
@ -506,7 +506,7 @@ void CMipsMemoryVM::Compile_LB ( x86Reg Reg, DWORD VAddr, BOOL SignExtend) {
break;
default:
MoveConstToX86reg(0,Reg);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_LB\nFailed to compile address: %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_LB\nFailed to compile address: %X",VAddr); }
}
}
@ -539,7 +539,7 @@ void CMipsMemoryVM::Compile_LH ( x86Reg Reg, DWORD VAddr, BOOL SignExtend) {
if (!TranslateVaddr(VAddr, PAddr)) {
MoveConstToX86reg(0,Reg);
CPU_Message("Compile_LH\nFailed to translate address %X",VAddr);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_LH\nFailed to translate address %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_LH\nFailed to translate address %X",VAddr); }
return;
}
@ -562,7 +562,7 @@ void CMipsMemoryVM::Compile_LH ( x86Reg Reg, DWORD VAddr, BOOL SignExtend) {
break;
default:
MoveConstToX86reg(0,Reg);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_LHU\nFailed to compile address: %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_LHU\nFailed to compile address: %X",VAddr); }
}
}
@ -620,7 +620,7 @@ void CMipsMemoryVM::Compile_LW (x86Reg Reg, DWORD VAddr ) {
case 0x04080000: MoveVariableToX86reg(&g_Reg->SP_PC_REG,"SP_PC_REG",Reg); break;
default:
MoveConstToX86reg(0,Reg);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTION__ "\nFailed to translate address: %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTIONW__ L"\nFailed to translate address: %X",VAddr); }
}
break;
case 0x04100000:
@ -643,7 +643,7 @@ void CMipsMemoryVM::Compile_LW (x86Reg Reg, DWORD VAddr ) {
case 0x0430000C: MoveVariableToX86reg(&g_Reg->MI_INTR_MASK_REG,"MI_INTR_MASK_REG",Reg); break;
default:
MoveConstToX86reg(0,Reg);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTION__ "\nFailed to translate address: %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTIONW__ L"\nFailed to translate address: %X",VAddr); }
}
break;
case 0x04400000:
@ -660,7 +660,7 @@ void CMipsMemoryVM::Compile_LW (x86Reg Reg, DWORD VAddr ) {
break;
default:
MoveConstToX86reg(0,Reg);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTION__ "\nFailed to translate address: %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTIONW__ L"\nFailed to translate address: %X",VAddr); }
}
break;
case 0x04500000: /* AI registers */
@ -704,7 +704,7 @@ void CMipsMemoryVM::Compile_LW (x86Reg Reg, DWORD VAddr ) {
break;
default:
MoveConstToX86reg(0,Reg);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTION__ "\nFailed to translate address: %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTIONW__ L"\nFailed to translate address: %X",VAddr); }
}
break;
case 0x04600000:
@ -720,7 +720,7 @@ void CMipsMemoryVM::Compile_LW (x86Reg Reg, DWORD VAddr ) {
case 0x04600030: MoveVariableToX86reg(&g_Reg->PI_BSD_DOM2_RLS_REG,"PI_BSD_DOM2_RLS_REG",Reg); break;
default:
MoveConstToX86reg(0,Reg);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTION__ "\nFailed to translate address: %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTIONW__ L"\nFailed to translate address: %X",VAddr); }
}
break;
case 0x04700000:
@ -729,7 +729,7 @@ void CMipsMemoryVM::Compile_LW (x86Reg Reg, DWORD VAddr ) {
case 0x04700010: MoveVariableToX86reg(&g_Reg->RI_REFRESH_REG,"RI_REFRESH_REG",Reg); break;
default:
MoveConstToX86reg(0,Reg);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTION__ "\nFailed to translate address: %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTIONW__ L"\nFailed to translate address: %X",VAddr); }
}
break;
case 0x04800000:
@ -737,7 +737,7 @@ void CMipsMemoryVM::Compile_LW (x86Reg Reg, DWORD VAddr ) {
case 0x04800018: MoveVariableToX86reg(&g_Reg->SI_STATUS_REG,"SI_STATUS_REG",Reg); break;
default:
MoveConstToX86reg(0,Reg);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTION__ "\nFailed to translate address: %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTIONW__ L"\nFailed to translate address: %X",VAddr); }
}
break;
case 0x1FC00000:
@ -754,7 +754,7 @@ void CMipsMemoryVM::Compile_LW (x86Reg Reg, DWORD VAddr ) {
MoveConstToX86reg(((PAddr & 0xFFFF) << 16) | (PAddr & 0xFFFF),Reg);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) {
CPU_Message(__FUNCTION__ "\nFailed to translate address: %X",VAddr);
g_Notify->DisplayError(__FUNCTION__ "\nFailed to translate address: %X",VAddr);
g_Notify->DisplayError(__FUNCTIONW__ L"\nFailed to translate address: %X",VAddr);
}
}
}
@ -780,7 +780,7 @@ void CMipsMemoryVM::Compile_SB_Const ( BYTE Value, DWORD VAddr ) {
if (!TranslateVaddr(VAddr, PAddr)) {
CPU_Message("Compile_SB\nFailed to translate address %X",VAddr);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SB\nFailed to translate address %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SB\nFailed to translate address %X",VAddr); }
return;
}
@ -797,7 +797,7 @@ void CMipsMemoryVM::Compile_SB_Const ( BYTE Value, DWORD VAddr ) {
MoveConstByteToVariable(Value,PAddr + m_RDRAM,VarName);
break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SB_Const\ntrying to store %X in %X?",Value,VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SB_Const\ntrying to store %X in %X?",Value,VAddr); }
}
}
@ -822,7 +822,7 @@ void CMipsMemoryVM::Compile_SB_Register ( x86Reg Reg, DWORD VAddr ) {
if (!TranslateVaddr(VAddr, PAddr)) {
CPU_Message("Compile_SB\nFailed to translate address %X",VAddr);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SB\nFailed to translate address %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SB\nFailed to translate address %X",VAddr); }
return;
}
@ -839,7 +839,7 @@ void CMipsMemoryVM::Compile_SB_Register ( x86Reg Reg, DWORD VAddr ) {
MoveX86regByteToVariable(Reg,PAddr + m_RDRAM,VarName);
break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SB_Register\ntrying to store in %X?",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SB_Register\ntrying to store in %X?",VAddr); }
}
}
@ -862,7 +862,7 @@ void CMipsMemoryVM::Compile_SH_Const ( WORD Value, DWORD VAddr ) {
if (!TranslateVaddr(VAddr, PAddr)) {
CPU_Message("Compile_SH\nFailed to translate address %X",VAddr);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SH\nFailed to translate address %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SH\nFailed to translate address %X",VAddr); }
return;
}
@ -879,7 +879,7 @@ void CMipsMemoryVM::Compile_SH_Const ( WORD Value, DWORD VAddr ) {
MoveConstHalfToVariable(Value,PAddr + m_RDRAM,VarName);
break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTION__ "\ntrying to store %X in %X?",Value,VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTIONW__ L"\ntrying to store %X in %X?",Value,VAddr); }
}
}
@ -904,7 +904,7 @@ void CMipsMemoryVM::Compile_SH_Register ( x86Reg Reg, DWORD VAddr ) {
if (!TranslateVaddr(VAddr, PAddr)) {
CPU_Message("Compile_SH\nFailed to translate address %X",VAddr);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SH\nFailed to translate address %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SH\nFailed to translate address %X",VAddr); }
return;
}
@ -921,7 +921,7 @@ void CMipsMemoryVM::Compile_SH_Register ( x86Reg Reg, DWORD VAddr ) {
MoveX86regHalfToVariable(Reg,PAddr + m_RDRAM,VarName);
break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTION__ "\ntrying to store in %X?",PAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(__FUNCTIONW__ L"\ntrying to store in %X?",PAddr); }
}
}
@ -945,7 +945,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
if (!TranslateVaddr(VAddr, PAddr)) {
CPU_Message("Compile_SW\nFailed to translate address %X",VAddr);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW\nFailed to translate address %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW\nFailed to translate address %X",VAddr); }
return;
}
@ -980,7 +980,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
case 0x03F8000C: break;
case 0x03F80014: break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
}
break;
case 0x04000000:
@ -1016,7 +1016,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
case 0x0404001C: MoveConstToVariable(0,&g_Reg->SP_SEMAPHORE_REG,"SP_SEMAPHORE_REG"); break;
case 0x04080000: MoveConstToVariable(Value & 0xFFC,&g_Reg->SP_PC_REG,"SP_PC_REG"); break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
}
break;
case 0x04100000:
@ -1031,7 +1031,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
AfterCallDirect(m_RegWorkingSet);
break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
}
break;
case 0x04300000:
@ -1087,7 +1087,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
}
break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
}
break;
case 0x04400000:
@ -1139,7 +1139,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
case 0x04400030: MoveConstToVariable(Value,&g_Reg->VI_X_SCALE_REG,"VI_X_SCALE_REG"); break;
case 0x04400034: MoveConstToVariable(Value,&g_Reg->VI_Y_SCALE_REG,"VI_Y_SCALE_REG"); break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
}
break;
case 0x04500000: /* AI registers */
@ -1176,7 +1176,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
default:
sprintf(VarName,"m_RDRAM + %X",PAddr);
MoveConstToVariable(Value,PAddr + m_RDRAM,VarName);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
}
break;
case 0x04600000:
@ -1211,7 +1211,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
case 0x0460001C: MoveConstToVariable((Value & 0xFF),&g_Reg->PI_BSD_DOM1_PGS_REG,"PI_BSD_DOM1_PGS_REG"); break;
case 0x04600020: MoveConstToVariable((Value & 0xFF),&g_Reg->PI_BSD_DOM1_RLS_REG,"PI_BSD_DOM1_RLS_REG"); break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
}
break;
case 0x04700000:
@ -1221,7 +1221,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
case 0x04700008: MoveConstToVariable(Value,&g_Reg->RI_CURRENT_LOAD_REG,"RI_CURRENT_LOAD_REG"); break;
case 0x0470000C: MoveConstToVariable(Value,&g_Reg->RI_SELECT_REG,"RI_SELECT_REG"); break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
}
break;
case 0x04800000:
@ -1256,11 +1256,11 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
AfterCallDirect(m_RegWorkingSet);
break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
}
break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Const\ntrying to store %X in %X?",Value,VAddr); }
}
}
@ -1287,7 +1287,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
if (!TranslateVaddr(VAddr, PAddr)) {
CPU_Message("Compile_SW_Register\nFailed to translate address %X",VAddr);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Register\nFailed to translate address %X",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Register\nFailed to translate address %X",VAddr); }
return;
}
@ -1341,7 +1341,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
MoveX86regToVariable(Reg,PAddr + m_RDRAM,VarName);
} else {
CPU_Message(" Should be moving %s in to %X ?!?",x86_Name(Reg),VAddr);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Register\ntrying to store at %X?",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Register\ntrying to store at %X?",VAddr); }
}
}
break;
@ -1375,7 +1375,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
break;
default:
CPU_Message(" Should be moving %s in to %X ?!?",x86_Name(Reg),VAddr);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Register\ntrying to store at %X?",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Register\ntrying to store at %X?",VAddr); }
}
break;
case 0x04400000:
@ -1431,7 +1431,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
case 0x04400034: MoveX86regToVariable(Reg,&g_Reg->VI_Y_SCALE_REG,"VI_Y_SCALE_REG"); break;
default:
CPU_Message(" Should be moving %s in to %X ?!?",x86_Name(Reg),VAddr);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Register\ntrying to store at %X?",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Register\ntrying to store at %X?",VAddr); }
}
break;
case 0x04500000: /* AI registers */
@ -1472,7 +1472,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
default:
sprintf(VarName,"m_RDRAM + %X",PAddr);
MoveX86regToVariable(Reg,PAddr + m_RDRAM,VarName);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Register\ntrying to store at %X?",VAddr); } }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Register\ntrying to store at %X?",VAddr); } }
break;
case 0x04600000:
switch (PAddr) {
@ -1493,7 +1493,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
AfterCallDirect(m_RegWorkingSet);
break;
case 0x04600010:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Register\ntrying to store at %X?",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Register\ntrying to store at %X?",VAddr); }
AndConstToVariable((DWORD)~MI_INTR_PI,&g_Reg->MI_INTR_REG,"MI_INTR_REG");
BeforeCallDirect(m_RegWorkingSet);
MoveConstToX86reg((DWORD)g_Reg,x86_ECX);
@ -1518,14 +1518,14 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
break;
default:
CPU_Message(" Should be moving %s in to %X ?!?",x86_Name(Reg),VAddr);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Register\ntrying to store at %X?",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Register\ntrying to store at %X?",VAddr); }
}
break;
case 0x04700000:
switch (PAddr) {
case 0x04700010: MoveX86regToVariable(Reg,&g_Reg->RI_REFRESH_REG,"RI_REFRESH_REG"); break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Register\ntrying to store at %X?",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Register\ntrying to store at %X?",VAddr); }
}
break;
case 0x04800000:
@ -1554,7 +1554,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
AfterCallDirect(m_RegWorkingSet);
break;
default:
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Register\ntrying to store at %X?",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Register\ntrying to store at %X?",VAddr); }
}
break;
case 0x1FC00000:
@ -1563,7 +1563,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
break;
default:
CPU_Message(" Should be moving %s in to %X ?!?",x86_Name(Reg),VAddr);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError("Compile_SW_Register\ntrying to store in %X?",VAddr); }
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(L"Compile_SW_Register\ntrying to store in %X?",VAddr); }
}
}
@ -1739,7 +1739,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0xB6:
if (!LB_NonMemory(MemAddress,(DWORD *)Reg,FALSE)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
g_Notify->DisplayError("Failed to load byte\n\nMIPS Address: %X\nX86 Address",
g_Notify->DisplayError(L"Failed to load byte\n\nMIPS Address: %X\nX86 Address",
(char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip);
}
@ -1749,7 +1749,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0xB7:
if (!LH_NonMemory(MemAddress,(DWORD *)Reg,FALSE)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
g_Notify->DisplayError("Failed to load half word\n\nMIPS Address: %X\nX86 Address",
g_Notify->DisplayError(L"Failed to load half word\n\nMIPS Address: %X\nX86 Address",
(char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip);
}
@ -1759,7 +1759,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0xBE:
if (!LB_NonMemory(MemAddress,Reg,TRUE)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
g_Notify->DisplayError("Failed to load byte\n\nMIPS Address: %X\nX86 Address",
g_Notify->DisplayError(L"Failed to load byte\n\nMIPS Address: %X\nX86 Address",
(char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip);
}
@ -1769,7 +1769,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0xBF:
if (!LH_NonMemory(MemAddress,Reg,TRUE)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
g_Notify->DisplayError("Failed to load half word\n\nMIPS Address: %X\nX86 Address",
g_Notify->DisplayError(L"Failed to load half word\n\nMIPS Address: %X\nX86 Address",
(char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip);
}
@ -1786,7 +1786,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0x8B:
if (!LH_NonMemory(MemAddress,Reg,FALSE)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
g_Notify->DisplayError("Failed to half word\n\nMIPS Address: %X\nX86 Address",
g_Notify->DisplayError(L"Failed to half word\n\nMIPS Address: %X\nX86 Address",
(char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip);
}
@ -1796,7 +1796,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0x89:
if (!SH_NonMemory(MemAddress,*(WORD *)Reg)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
g_Notify->DisplayError("Failed to store half word\n\nMIPS Address: %X\nX86 Address",MemAddress,
g_Notify->DisplayError(L"Failed to store half word\n\nMIPS Address: %X\nX86 Address",MemAddress,
*(unsigned char *)lpEP->ContextRecord->Eip);
}
}
@ -1810,7 +1810,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
}
if (!SH_NonMemory(MemAddress,*(WORD *)ReadPos)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
g_Notify->DisplayError("Failed to store half word\n\nMIPS Address: %X\nX86 Address",MemAddress,
g_Notify->DisplayError(L"Failed to store half word\n\nMIPS Address: %X\nX86 Address",MemAddress,
*(unsigned char *)lpEP->ContextRecord->Eip);
}
}
@ -1824,7 +1824,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0x88:
if (!SB_NonMemory(MemAddress,*(BYTE *)Reg)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
g_Notify->DisplayError("Failed to store byte\n\nMIPS Address: %X\nX86 Address",
g_Notify->DisplayError(L"Failed to store byte\n\nMIPS Address: %X\nX86 Address",
(char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip);
}
@ -1834,7 +1834,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0x8A:
if (!LB_NonMemory(MemAddress,Reg,FALSE)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
g_Notify->DisplayError("Failed to load byte\n\nMIPS Address: %X\nX86 Address",
g_Notify->DisplayError(L"Failed to load byte\n\nMIPS Address: %X\nX86 Address",
(char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip);
}
@ -1844,7 +1844,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0x8B:
if (!LW_NonMemory(MemAddress,Reg)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
g_Notify->DisplayError("Failed to load word\n\nMIPS Address: %X\nX86 Address",
g_Notify->DisplayError(L"Failed to load word\n\nMIPS Address: %X\nX86 Address",
(char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip);
}
@ -1854,7 +1854,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0x89:
if (!SW_NonMemory(MemAddress,*(DWORD *)Reg)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
g_Notify->DisplayError("Failed to store word\n\nMIPS Address: %X\nX86 Address",MemAddress,
g_Notify->DisplayError(L"Failed to store word\n\nMIPS Address: %X\nX86 Address",MemAddress,
*(unsigned char *)lpEP->ContextRecord->Eip);
}
}
@ -1868,7 +1868,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
}
if (!SB_NonMemory(MemAddress,*(BYTE *)ReadPos)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
g_Notify->DisplayError("Failed to store byte\n\nMIPS Address: %X\nX86 Address",MemAddress,
g_Notify->DisplayError(L"Failed to store byte\n\nMIPS Address: %X\nX86 Address",MemAddress,
*(unsigned char *)lpEP->ContextRecord->Eip);
}
}
@ -1882,7 +1882,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
}
if (!SW_NonMemory(MemAddress,*(DWORD *)ReadPos)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) {
g_Notify->DisplayError("Failed to store word\n\nMIPS Address: %X\nX86 Address",MemAddress,
g_Notify->DisplayError(L"Failed to store word\n\nMIPS Address: %X\nX86 Address",MemAddress,
*(unsigned char *)lpEP->ContextRecord->Eip);
}
}
@ -2196,7 +2196,7 @@ int CMipsMemoryVM::SB_NonMemory ( DWORD PAddr, BYTE Value ) {
VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,PAGE_READWRITE, &OldProtect);
*(BYTE *)(m_RDRAM+PAddr) = Value;
VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,OldProtect, &OldProtect);
g_Notify->DisplayError("FrameBufferWrite");
g_Notify->DisplayError(L"FrameBufferWrite");
if (FrameBufferWrite) { FrameBufferWrite(PAddr,1); }
break;
}
@ -2234,7 +2234,7 @@ int CMipsMemoryVM::SH_NonMemory ( DWORD PAddr, WORD Value ) {
if (FrameBufferWrite) { FrameBufferWrite(PAddr & ~0xFFF,2); }
//*(WORD *)(m_RDRAM+PAddr) = 0xFFFF;
//VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,PAGE_NOACCESS, &OldProtect);
g_Notify->DisplayError("PAddr = %x",PAddr);
g_Notify->DisplayError(L"PAddr = %x",PAddr);
break;
}
#endif
@ -2285,7 +2285,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,PAGE_READWRITE, &OldProtect);
*(DWORD *)(m_RDRAM+PAddr) = Value;
VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,OldProtect, &OldProtect);
g_Notify->DisplayError("FrameBufferWrite %X",PAddr);
g_Notify->DisplayError(L"FrameBufferWrite %X",PAddr);
if (FrameBufferWrite) { FrameBufferWrite(PAddr,4); }
break;
}
@ -2344,7 +2344,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
g_Reg->m_RspIntrReg &= ~MI_INTR_SP;
g_Reg->CheckInterrupts();
}
if ( ( Value & SP_SET_INTR ) != 0) { g_Notify->DisplayError("SP_SET_INTR"); }
if ( ( Value & SP_SET_INTR ) != 0) { g_Notify->DisplayError(L"SP_SET_INTR"); }
if ( ( Value & SP_CLR_SSTEP ) != 0) {
g_Reg->SP_STATUS_REG &= ~SP_STATUS_SSTEP;
}
@ -2425,10 +2425,10 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
}
#ifdef tofix
if (ShowUnhandledMemory) {
//if ( ( Value & DPC_CLR_TMEM_CTR ) != 0) { g_Notify->DisplayError("RSP: DPC_STATUS_REG: DPC_CLR_TMEM_CTR"); }
//if ( ( Value & DPC_CLR_PIPE_CTR ) != 0) { g_Notify->DisplayError("RSP: DPC_STATUS_REG: DPC_CLR_PIPE_CTR"); }
//if ( ( Value & DPC_CLR_CMD_CTR ) != 0) { g_Notify->DisplayError("RSP: DPC_STATUS_REG: DPC_CLR_CMD_CTR"); }
//if ( ( Value & DPC_CLR_CLOCK_CTR ) != 0) { g_Notify->DisplayError("RSP: DPC_STATUS_REG: DPC_CLR_CLOCK_CTR"); }
//if ( ( Value & DPC_CLR_TMEM_CTR ) != 0) { g_Notify->DisplayError(L"RSP: DPC_STATUS_REG: DPC_CLR_TMEM_CTR"); }
//if ( ( Value & DPC_CLR_PIPE_CTR ) != 0) { g_Notify->DisplayError(L"RSP: DPC_STATUS_REG: DPC_CLR_PIPE_CTR"); }
//if ( ( Value & DPC_CLR_CMD_CTR ) != 0) { g_Notify->DisplayError(L"RSP: DPC_STATUS_REG: DPC_CLR_CMD_CTR"); }
//if ( ( Value & DPC_CLR_CLOCK_CTR ) != 0) { g_Notify->DisplayError(L"RSP: DPC_STATUS_REG: DPC_CLR_CLOCK_CTR"); }
}
#endif
break;
@ -2557,7 +2557,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
PI_DMA_WRITE();
break;
case 0x04600010:
//if ((Value & PI_SET_RESET) != 0 ) { g_Notify->DisplayError("reset Controller"); }
//if ((Value & PI_SET_RESET) != 0 ) { g_Notify->DisplayError(L"reset Controller"); }
if ((Value & PI_CLR_INTR) != 0 ) {
g_Reg->MI_INTR_REG &= ~MI_INTR_PI;
g_Reg->CheckInterrupts();
@ -4169,7 +4169,7 @@ void CMipsMemoryVM::ChangeSpStatus (void)
g_Reg->m_RspIntrReg &= ~MI_INTR_SP;
g_Reg->CheckInterrupts();
}
if ( ( RegModValue & SP_SET_INTR ) != 0 && bHaveDebugger()) { g_Notify->DisplayError("SP_SET_INTR"); }
if ( ( RegModValue & SP_SET_INTR ) != 0 && bHaveDebugger()) { g_Notify->DisplayError(L"SP_SET_INTR"); }
if ( ( RegModValue & SP_CLR_SSTEP ) != 0)
{
g_Reg->SP_STATUS_REG &= ~SP_STATUS_SSTEP;

View File

@ -117,7 +117,7 @@ void CPifRam::PifRamRead (void)
CurPos += m_PifRam[CurPos] + (m_PifRam[CurPos + 1] & 0x3F) + 1;
Channel += 1;
} else {
if (bShowPifRamErrors()) { g_Notify->DisplayError("Unknown Command in PifRamRead(%X)",m_PifRam[CurPos]); }
if (bShowPifRamErrors()) { g_Notify->DisplayError(L"Unknown Command in PifRamRead(%X)",m_PifRam[CurPos]); }
CurPos = 0x40;
}
break;
@ -173,7 +173,7 @@ void CPifRam::PifRamWrite (void) {
memset(m_PifRam,0,0x40);
break;
default:
if (bShowPifRamErrors()) { g_Notify->DisplayError("Unkown PifRam control: %d",m_PifRam[0x3F]); }
if (bShowPifRamErrors()) { g_Notify->DisplayError(L"Unkown PifRam control: %d",m_PifRam[0x3F]); }
}
return;
}
@ -200,13 +200,13 @@ void CPifRam::PifRamWrite (void) {
} else {
if (bShowPifRamErrors())
{
g_Notify->DisplayError("Command on channel 5?");
g_Notify->DisplayError(L"Command on channel 5?");
}
}
CurPos += m_PifRam[CurPos] + (m_PifRam[CurPos + 1] & 0x3F) + 1;
Channel += 1;
} else {
if (bShowPifRamErrors()) { g_Notify->DisplayError("Unknown Command in PifRamWrite(%X)",m_PifRam[CurPos]); }
if (bShowPifRamErrors()) { g_Notify->DisplayError(L"Unknown Command in PifRamWrite(%X)",m_PifRam[CurPos]); }
CurPos = 0x40;
}
break;
@ -226,7 +226,7 @@ void CPifRam::SI_DMA_READ (void)
{
if (bShowPifRamErrors())
{
g_Notify->DisplayError("SI DMA\nSI_DRAM_ADDR_REG not in RDRam space");
g_Notify->DisplayError(L"SI DMA\nSI_DRAM_ADDR_REG not in RDRam space");
}
return;
}
@ -316,7 +316,7 @@ void CPifRam::SI_DMA_WRITE (void)
{
if (bShowPifRamErrors())
{
g_Notify->DisplayError("SI DMA\nSI_DRAM_ADDR_REG not in RDRam space");
g_Notify->DisplayError(L"SI DMA\nSI_DRAM_ADDR_REG not in RDRam space");
}
return;
}
@ -411,8 +411,8 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command)
if ((Command[1] & 0x80) != 0) { break; }
if (bShowPifRamErrors())
{
if (Command[0] != 1) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); }
if (Command[1] != 3) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); }
if (Command[0] != 1) { g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); }
if (Command[1] != 3) { g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); }
}
if (Controllers[Control].Present == TRUE) {
Command[3] = 0x05;
@ -430,8 +430,8 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command)
case 0x01: // read controller
if (bShowPifRamErrors())
{
if (Command[0] != 1) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); }
if (Command[1] != 4) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); }
if (Command[0] != 1) { g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); }
if (Command[1] != 4) { g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); }
}
if (Controllers[Control].Present == FALSE) {
Command[1] |= 0x80;
@ -441,8 +441,8 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command)
if (LogOptions.LogControllerPak) { LogControllerPakData("Read: Before Gettting Results"); }
if (bShowPifRamErrors())
{
if (Command[0] != 3) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); }
if (Command[1] != 33) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); }
if (Command[0] != 3) { g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); }
if (Command[1] != 33) { g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); }
}
if (Controllers[Control].Present == TRUE) {
DWORD address = ((Command[3] << 8) | Command[4]);
@ -467,8 +467,8 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command)
if (LogOptions.LogControllerPak) { LogControllerPakData("Write: Before Processing"); }
if (bShowPifRamErrors())
{
if (Command[0] != 35) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); }
if (Command[1] != 1) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); }
if (Command[0] != 35) { g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); }
if (Command[1] != 1) { g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); }
}
if (Controllers[Control].Present == TRUE) {
DWORD address = ((Command[3] << 8) | Command[4]);
@ -488,7 +488,7 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command)
if (LogOptions.LogControllerPak) { LogControllerPakData("Write: After Processing"); }
break;
default:
if (bShowPifRamErrors()) { g_Notify->DisplayError("Unknown ControllerCommand %d",Command[2]); }
if (bShowPifRamErrors()) { g_Notify->DisplayError(L"Unknown ControllerCommand %d",Command[2]); }
}
}
@ -501,8 +501,8 @@ void CPifRam::ReadControllerCommand (int Control, BYTE * Command) {
{
if (bShowPifRamErrors())
{
if (Command[0] != 1) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); }
if (Command[1] != 4) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); }
if (Command[0] != 1) { g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); }
if (Command[1] != 4) { g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); }
}
*(DWORD *)&Command[3] = g_BaseSystem->GetButtons(Control);
}

View File

@ -309,12 +309,12 @@ void CRegisters::DoAddressError ( BOOL DelaySlot, DWORD BadVaddr, BOOL FromRead)
{
if (bHaveDebugger())
{
g_Notify->DisplayError("AddressError");
g_Notify->DisplayError(L"AddressError");
if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) {
g_Notify->DisplayError("EXL set in AddressError Exception");
g_Notify->DisplayError(L"EXL set in AddressError Exception");
}
if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) {
g_Notify->DisplayError("ERL set in AddressError Exception");
g_Notify->DisplayError(L"ERL set in AddressError Exception");
}
}
@ -353,10 +353,10 @@ void CRegisters::DoBreakException ( BOOL DelaySlot)
if (bHaveDebugger())
{
if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) {
g_Notify->DisplayError("EXL set in Break Exception");
g_Notify->DisplayError(L"EXL set in Break Exception");
}
if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) {
g_Notify->DisplayError("ERL set in Break Exception");
g_Notify->DisplayError(L"ERL set in Break Exception");
}
}
@ -376,10 +376,10 @@ void CRegisters::DoCopUnusableException ( BOOL DelaySlot, int Coprocessor )
if (bHaveDebugger())
{
if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) {
g_Notify->DisplayError("EXL set in Break Exception");
g_Notify->DisplayError(L"EXL set in Break Exception");
}
if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) {
g_Notify->DisplayError("ERL set in Break Exception");
g_Notify->DisplayError(L"ERL set in Break Exception");
}
}
@ -441,7 +441,7 @@ void CRegisters::DoTLBReadMiss ( BOOL DelaySlot, DWORD BadVaddr )
} else {
if (bHaveDebugger())
{
g_Notify->DisplayError("TLBMiss - EXL Set\nBadVaddr = %X\nAddress Defined: %s",BadVaddr,g_TLB->AddressDefined(BadVaddr)?"TRUE":"FALSE");
g_Notify->DisplayError(L"TLBMiss - EXL Set\nBadVaddr = %X\nAddress Defined: %s",BadVaddr,g_TLB->AddressDefined(BadVaddr)?"TRUE":"FALSE");
}
m_PROGRAM_COUNTER = 0x80000180;
}
@ -452,10 +452,10 @@ void CRegisters::DoSysCallException ( BOOL DelaySlot)
if (bHaveDebugger())
{
if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) {
g_Notify->DisplayError("EXL set in SysCall Exception");
g_Notify->DisplayError(L"EXL set in SysCall Exception");
}
if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) {
g_Notify->DisplayError("ERL set in SysCall Exception");
g_Notify->DisplayError(L"ERL set in SysCall Exception");
}
}

View File

@ -201,7 +201,7 @@ bool CN64System::RunFileImage ( const char * FileLoc )
WriteTrace(TraceDebug,__FUNCTION__ ": Add Recent Rom");
g_Notify->AddRecentRom(FileLoc);
g_Notify->SetWindowCaption(g_Settings->LoadString(Game_GoodName).c_str());
g_Notify->SetWindowCaption(g_Settings->LoadString(Game_GoodName).ToUTF16().c_str());
if (g_Settings->LoadDword(Setting_AutoStart) != 0)
{
@ -262,7 +262,7 @@ bool CN64System::EmulationStarting ( HANDLE hThread, DWORD ThreadId )
}
} else {
WriteTrace(TraceError,__FUNCTION__ ": SetActiveSystem failed");
g_Notify->DisplayError(__FUNCTION__ ": Failed to Initialize N64 System");
g_Notify->DisplayError(__FUNCTIONW__ L": Failed to Initialize N64 System");
g_Settings->SaveBool(GameRunning_LoadingInProgress,false);
g_Notify->RefreshMenu();
bRes = false;
@ -297,7 +297,7 @@ void CN64System::StartEmulation2 ( bool NewThread )
if (CpuType == CPU_SyncCores)
{
g_Notify->DisplayMessage(5,"Copy Plugins");
g_Notify->DisplayMessage(5,L"Copy Plugins");
g_Plugins->CopyPlugins(g_Settings->LoadString(Directory_PluginSync));
m_SyncWindow = new CMainGui(false);
m_SyncPlugins = new CPlugins( g_Settings->LoadString(Directory_PluginSync) );
@ -1308,7 +1308,7 @@ void CN64System::DumpSyncErrors (CN64System * SecondCPU) {
}
}
g_Notify->DisplayError("Sync Error");
g_Notify->DisplayError(L"Sync Error");
g_Notify->BreakPoint(__FILE__,__LINE__);
// AddEvent(CloseCPU);
}
@ -1442,11 +1442,11 @@ bool CN64System::SaveState(void)
}
m_Reg.MI_INTR_REG = MiInterReg;
g_Settings->SaveString(GameRunning_InstantSaveFile,"");
stdstr SaveMessage = _Lang->GetString(MSG_SAVED_STATE);
std::wstring SaveMessage = g_Lang->GetString(MSG_SAVED_STATE);
CPath SavedFileName(FileName);
g_Notify->DisplayMessage(5,"%s %s",SaveMessage.c_str(),SavedFileName.GetNameExtension().c_str());
g_Notify->DisplayMessage(5,L"%s %s",SaveMessage.c_str(),SavedFileName.GetNameExtension().c_str());
g_Notify->RefreshMenu();
WriteTrace(TraceDebug,__FUNCTION__ ": Done");
return true;
@ -1513,36 +1513,42 @@ bool CN64System::LoadState(LPCSTR FileName) {
port = unzGoToFirstFile(file);
}
DWORD Value;
while (port == UNZ_OK) {
while (port == UNZ_OK)
{
unz_file_info info;
char zname[132];
unzGetCurrentFileInfo(file, &info, zname, 128, NULL,0, NULL,0);
if (unzLocateFile(file, zname, 1) != UNZ_OK ) {
if (unzLocateFile(file, zname, 1) != UNZ_OK )
{
unzClose(file);
port = -1;
continue;
}
if( unzOpenCurrentFile(file) != UNZ_OK ) {
if( unzOpenCurrentFile(file) != UNZ_OK )
{
unzClose(file);
port = -1;
continue;
}
unzReadCurrentFile(file,&Value,4);
if (Value != 0x23D8A6C8 && Value != 0x56D2CD23) {
if (Value != 0x23D8A6C8 && Value != 0x56D2CD23)
{
unzCloseCurrentFile(file);
port = unzGoToNextFile(file);
continue;
}
if (!LoadedZipFile && Value == 0x23D8A6C8 && port == UNZ_OK) {
if (!LoadedZipFile && Value == 0x23D8A6C8 && port == UNZ_OK)
{
unzReadCurrentFile(file,&SaveRDRAMSize,sizeof(SaveRDRAMSize));
//Check header
BYTE LoadHeader[64];
unzReadCurrentFile(file,LoadHeader,0x40);
if (memcmp(LoadHeader,g_Rom->GetRomAddress(),0x40) != 0) {
if (memcmp(LoadHeader,g_Rom->GetRomAddress(),0x40) != 0)
{
//if (inFullScreen) { return FALSE; }
int result = MessageBox(NULL,GS(MSG_SAVE_STATE_HEADER),GS(MSG_MSGBOX_TITLE),
int result = MessageBoxW(NULL,GS(MSG_SAVE_STATE_HEADER),GS(MSG_MSGBOX_TITLE),
MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2);
if (result == IDNO) { return FALSE; }
}
@ -1578,7 +1584,8 @@ bool CN64System::LoadState(LPCSTR FileName) {
LoadedZipFile = true;
continue;
}
if (LoadedZipFile && Value == 0x56D2CD23 && port == UNZ_OK) {
if (LoadedZipFile && Value == 0x56D2CD23 && port == UNZ_OK)
{
m_SystemTimer.LoadData(file);
}
unzCloseCurrentFile(file);
@ -1586,11 +1593,13 @@ bool CN64System::LoadState(LPCSTR FileName) {
}
unzClose(file);
}
if (!LoadedZipFile) {
if (!LoadedZipFile)
{
HANDLE hSaveFile = CreateFile(FileNameStr.c_str(),GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ,NULL,
OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
if (hSaveFile == INVALID_HANDLE_VALUE) {
g_Notify->DisplayMessage(5,"%s %s",GS(MSG_UNABLED_LOAD_STATE),FileNameStr.c_str());
if (hSaveFile == INVALID_HANDLE_VALUE)
{
g_Notify->DisplayMessage(5,L"%s %s",GS(MSG_UNABLED_LOAD_STATE),FileNameStr.c_str());
return false;
}
SetFilePointer(hSaveFile,0,NULL,FILE_BEGIN);
@ -1600,9 +1609,10 @@ bool CN64System::LoadState(LPCSTR FileName) {
//Check header
BYTE LoadHeader[64];
ReadFile( hSaveFile,LoadHeader,0x40,&dwRead,NULL);
if (memcmp(LoadHeader,g_Rom->GetRomAddress(),0x40) != 0) {
if (memcmp(LoadHeader,g_Rom->GetRomAddress(),0x40) != 0)
{
//if (inFullScreen) { return FALSE; }
int result = MessageBox(NULL,GS(MSG_SAVE_STATE_HEADER),GS(MSG_MSGBOX_TITLE),
int result = MessageBoxW(NULL,GS(MSG_SAVE_STATE_HEADER),GS(MSG_MSGBOX_TITLE),
MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2);
if (result == IDNO) { return FALSE; }
}
@ -1637,7 +1647,8 @@ bool CN64System::LoadState(LPCSTR FileName) {
}
//Fix Random Register
while ((int)m_Reg.RANDOM_REGISTER < (int)m_Reg.WIRED_REGISTER) {
while ((int)m_Reg.RANDOM_REGISTER < (int)m_Reg.WIRED_REGISTER)
{
m_Reg.RANDOM_REGISTER += 32 - m_Reg.WIRED_REGISTER;
}
//Fix up timer
@ -1666,7 +1677,8 @@ bool CN64System::LoadState(LPCSTR FileName) {
#endif
if (bFastSP() && m_Recomp) { m_Recomp->ResetMemoryStackPos(); }
if (g_Settings->LoadDword(Game_CpuType) == CPU_SyncCores) {
if (g_Settings->LoadDword(Game_CpuType) == CPU_SyncCores)
{
if (m_SyncCPU)
{
for (int i = 0; i < (sizeof(m_LastSuccessSyncPC)/sizeof(m_LastSuccessSyncPC[0])); i++) {
@ -1679,8 +1691,8 @@ bool CN64System::LoadState(LPCSTR FileName) {
}
}
WriteTrace(TraceDebug,__FUNCTION__ ": 13");
stdstr LoadMsg = _Lang->GetString(MSG_LOADED_STATE);
g_Notify->DisplayMessage(5,"%s %s",LoadMsg.c_str(),CPath(FileNameStr).GetNameExtension().c_str());
std::wstring LoadMsg = g_Lang->GetString(MSG_LOADED_STATE);
g_Notify->DisplayMessage(5,L"%s %s",LoadMsg.c_str(),CPath(FileNameStr).GetNameExtension().c_str());
WriteTrace(TraceDebug,__FUNCTION__ ": Done");
return true;
}
@ -1688,8 +1700,10 @@ bool CN64System::LoadState(LPCSTR FileName) {
void CN64System::RunRSP ( void )
{
WriteTraceF(TraceRSP, __FUNCTION__ ": Start (SP Status %X)",m_Reg.SP_STATUS_REG);
if ( ( m_Reg.SP_STATUS_REG & SP_STATUS_HALT ) == 0) {
if ( ( m_Reg.SP_STATUS_REG & SP_STATUS_BROKE ) == 0 ) {
if ( ( m_Reg.SP_STATUS_REG & SP_STATUS_HALT ) == 0)
{
if ( ( m_Reg.SP_STATUS_REG & SP_STATUS_BROKE ) == 0 )
{
SPECIAL_TIMERS CPU_UsageAddr = Timer_None/*, ProfileAddr = Timer_None*/;
DWORD Task = 0;
@ -1719,7 +1733,7 @@ void CN64System::RunRSP ( void )
}
if (bShowDListAListCount()) {
g_Notify->DisplayMessage(0,"Dlist: %d Alist: %d Unknown: %d",m_DlistCount,m_AlistCount,m_UnknownCount);
g_Notify->DisplayMessage(0,L"Dlist: %d Alist: %d Unknown: %d",m_DlistCount,m_AlistCount,m_UnknownCount);
}
if (bShowCPUPer())
{
@ -1739,7 +1753,7 @@ void CN64System::RunRSP ( void )
WriteTrace(TraceRSP, __FUNCTION__ ": do cycles - Done");
} __except( g_MMU->MemoryFilter( GetExceptionCode(), GetExceptionInformation()) ) {
WriteTrace(TraceError, __FUNCTION__ ": exception generated");
g_Notify->FatalError(__FUNCTION__ "\nUnknown memory action\n\nEmulation stop");
g_Notify->FatalError(__FUNCTIONW__ L"\nUnknown memory action\n\nEmulation stop");
}
if (Task == 1 && bDelayDP() && ((m_Reg.m_GfxIntrReg & MI_INTR_DP) != 0))

View File

@ -74,7 +74,7 @@ bool CN64Rom::AllocateAndLoadN64Image ( const char * FileLoc, bool LoadBootCodeO
TotalRead += dwRead;
//Show Message of how much % wise of the rom has been loaded
g_Notify->DisplayMessage(0,"%s: %.2f%c",GS(MSG_LOADED),((float)TotalRead/(float)RomFileSize) * 100.0f,'%');
g_Notify->DisplayMessage(0,L"%s: %.2f%c",GS(MSG_LOADED),((float)TotalRead/(float)RomFileSize) * 100.0f,'%');
}
dwRead = TotalRead;
@ -157,7 +157,7 @@ bool CN64Rom::AllocateAndLoadZipImage ( const char * FileLoc, bool LoadBootCodeO
TotalRead += dwRead;
//Show Message of how much % wise of the rom has been loaded
g_Notify->DisplayMessage(5,"%s: %.2f%c",GS(MSG_LOADED),((float)TotalRead/(float)RomFileSize) * 100.0f,'%');
g_Notify->DisplayMessage(5,L"%s: %.2f%c",GS(MSG_LOADED),((float)TotalRead/(float)RomFileSize) * 100.0f,'%');
}
dwRead = TotalRead + 4;
@ -165,7 +165,7 @@ bool CN64Rom::AllocateAndLoadZipImage ( const char * FileLoc, bool LoadBootCodeO
VirtualFree(Image,0,MEM_RELEASE);
unzCloseCurrentFile(file);
SetError(MSG_FAIL_ZIP);
g_Notify->DisplayMessage(1,"");
g_Notify->DisplayMessage(1,L"");
break;
}
@ -181,7 +181,7 @@ bool CN64Rom::AllocateAndLoadZipImage ( const char * FileLoc, bool LoadBootCodeO
//Protect the memory so that it can not be written to.
DWORD OldProtect;
VirtualProtect(m_ROMImage,m_RomFileSize,PAGE_READONLY,&OldProtect);
g_Notify->DisplayMessage(1,"");
g_Notify->DisplayMessage(1,L"");
}
unzCloseCurrentFile(file);
if (FoundRom == FALSE) {
@ -219,7 +219,7 @@ void CN64Rom::ByteSwapRom (void) {
break;
case 0x80371240: break;
default:
g_Notify->DisplayError("ByteSwapRom: %X",m_ROMImage[0]);
g_Notify->DisplayError(L"ByteSwapRom: %X",m_ROMImage[0]);
}
}
@ -245,7 +245,7 @@ void CN64Rom::CalculateCicChip ( void )
case 0x000000D6D5BE5580: m_CicChip = CIC_NUS_6106; break;
default:
if (bHaveDebugger())
g_Notify->DisplayError("Unknown CIC checksum:\n%I64d.", CRC);
g_Notify->DisplayError(L"Unknown CIC checksum:\n%I64d.", CRC);
m_CicChip = CIC_UNKNOWN; break;
}
@ -264,7 +264,7 @@ bool CN64Rom::IsValidRomImage ( BYTE Test[4] ) {
void CN64Rom::NotificationCB ( LPCSTR Status, CN64Rom * /*_this*/ )
{
g_Notify->DisplayMessage(5,"%s",Status);
g_Notify->DisplayMessage(5,L"%s",Status);
}
bool CN64Rom::LoadN64Image ( const char * FileLoc, bool LoadBootCodeOnly ) {
@ -306,7 +306,7 @@ bool CN64Rom::LoadN64Image ( const char * FileLoc, bool LoadBootCodeOnly ) {
}
//Get the size of the rom and try to allocate the memory needed.
DWORD RomFileSize = f->Size;
DWORD RomFileSize = (DWORD)f->Size;
//if loading boot code then just load the first 0x1000 bytes
if (LoadBootCodeOnly) { RomFileSize = 0x1000; }

View File

@ -95,7 +95,7 @@ void CProfiling::ShowCPU_Usage (void) {
TotalTime = CPU + Alist + Dlist + Idle;
g_Notify->DisplayMessage(0,"r4300i: %0.1f%c GFX: %0.1f%c Alist: %0.1f%c Idle: %0.1f%c",
g_Notify->DisplayMessage(0,L"r4300i: %0.1f%c GFX: %0.1f%c Alist: %0.1f%c Idle: %0.1f%c",
(float)(((double)CPU / (double)TotalTime) * 100),'%',
(float)(((double)Dlist / (double)TotalTime) * 100),'%',
(float)(((double)Alist / (double)TotalTime) * 100),'%',

View File

@ -1373,7 +1373,7 @@ void CCodeSection::AddParent(CCodeSection * Parent )
} else if (Parent->m_JumpSection == this) {
m_RegEnter = Parent->m_Jump.RegSet;
} else {
g_Notify->DisplayError("How are these sections joined?????");
g_Notify->DisplayError(L"How are these sections joined?????");
}
m_RegWorkingSet = m_RegEnter;
} else {
@ -1948,7 +1948,7 @@ bool CCodeSection::InheritParentInfo ( void )
case CRegInfo::STATE_MAPPED_32_ZERO:
case CRegInfo::STATE_MAPPED_32_SIGN:
if (GetMipsRegMapLo(i2) != RegSet->GetMipsRegMapLo(i2)) {
//DisplayError("Parent: %d",Parent->SectionID);
//DisplayError(L"Parent: %d",Parent->SectionID);
NeedSync = true;
}
break;

View File

@ -226,7 +226,7 @@ bool LoopAnalysis::CheckLoopRegisterUsage( CCodeSection * Section)
g_Notify->BreakPoint(__FILE__,__LINE__);
#ifdef tofix
if (m_Command.Hex == 0x00000001) { break; }
g_Notify->DisplayError("Unhandled R4300i OpCode in FillSectionInfo 5\n%s",
g_Notify->DisplayError(L"Unhandled R4300i OpCode in FillSectionInfo 5\n%s",
R4300iOpcodeName(m_Command.Hex,m_PC));
#endif
m_NextInstruction = END_BLOCK;
@ -346,7 +346,7 @@ bool LoopAnalysis::CheckLoopRegisterUsage( CCodeSection * Section)
g_Notify->BreakPoint(__FILE__,__LINE__);
#ifdef tofix
if (m_Command.Hex == 0x0407000D) { break; }
g_Notify->DisplayError("Unhandled R4300i OpCode in FillSectionInfo 4\n%s",
g_Notify->DisplayError(L"Unhandled R4300i OpCode in FillSectionInfo 4\n%s",
R4300iOpcodeName(m_Command.Hex,m_PC));
m_NextInstruction = END_BLOCK;
m_PC -= 4;
@ -511,13 +511,13 @@ bool LoopAnalysis::CheckLoopRegisterUsage( CCodeSection * Section)
case R4300i_COP0_CO_TLBP: break;
case R4300i_COP0_CO_ERET: m_NextInstruction = END_BLOCK; break;
default:
g_Notify->DisplayError("Unhandled R4300i OpCode in FillSectionInfo\n%s",
g_Notify->DisplayError(L"Unhandled R4300i OpCode in FillSectionInfo\n%s",
R4300iOpcodeName(m_Command.Hex,m_PC));
m_NextInstruction = END_BLOCK;
m_PC -= 4;
}
} else {
g_Notify->DisplayError("Unhandled R4300i OpCode in FillSectionInfo 3\n%s",
g_Notify->DisplayError(L"Unhandled R4300i OpCode in FillSectionInfo 3\n%s",
R4300iOpcodeName(m_Command.Hex,m_PC));
m_NextInstruction = END_BLOCK;
m_PC -= 4;
@ -594,7 +594,7 @@ bool LoopAnalysis::CheckLoopRegisterUsage( CCodeSection * Section)
case R4300i_COP1_W: break;
case R4300i_COP1_L: break;
default:
g_Notify->DisplayError("Unhandled R4300i OpCode in FillSectionInfo 2\n%s",
g_Notify->DisplayError(L"Unhandled R4300i OpCode in FillSectionInfo 2\n%s",
R4300iOpcodeName(m_Command.Hex,m_PC));
m_NextInstruction = END_BLOCK;
m_PC -= 4;
@ -689,7 +689,7 @@ bool LoopAnalysis::CheckLoopRegisterUsage( CCodeSection * Section)
if (m_Command.Hex == 0xF1F3F5F7) { break; }
if (m_Command.Hex == 0xC1200000) { break; }
if (m_Command.Hex == 0x4C5A5353) { break; }
g_Notify->DisplayError("Unhandled R4300i OpCode in FillSectionInfo 1\n%s\n%X",
g_Notify->DisplayError(L"Unhandled R4300i OpCode in FillSectionInfo 1\n%s\n%X",
R4300iOpcodeName(m_Command.Hex,m_PC),m_Command.Hex);
}

View File

@ -102,7 +102,7 @@ void CRecompiler::RecompilerMain_VirtualTable ( void )
m_Registers.DoTLBReadMiss(false,PC);
if (!g_TransVaddr->ValidVaddr(PC))
{
g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PC);
g_Notify->DisplayError(L"Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PC);
return;
}
continue;
@ -167,7 +167,7 @@ void CRecompiler::RecompilerMain_VirtualTable_validate ( void )
NextInstruction = NORMAL;
if (!g_TLB->ValidVaddr(PROGRAM_COUNTER))
{
g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
g_Notify->DisplayError(L"Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
return;
}
continue;
@ -227,7 +227,7 @@ void CRecompiler::RecompilerMain_VirtualTable_validate ( void )
NextInstruction = NORMAL;
if (!g_TLB->ValidVaddr(PROGRAM_COUNTER))
{
g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
g_Notify->DisplayError(L"Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
return;
}
}
@ -250,7 +250,7 @@ void CRecompiler::RecompilerMain_VirtualTable_validate ( void )
NextInstruction = NORMAL;
if (!g_MMU->ValidVaddr(PROGRAM_COUNTER))
{
g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
g_Notify->DisplayError(L"Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
return;
}
}
@ -374,7 +374,7 @@ void CRecompiler::RecompilerMain_Lookup( void )
DoTLBMiss(NextInstruction == DELAY_SLOT,PROGRAM_COUNTER);
NextInstruction = NORMAL;
if (!TranslateVaddr(PROGRAM_COUNTER, &Addr)) {
g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
g_Notify->DisplayError(L"Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
return;
}
}
@ -521,7 +521,7 @@ void CRecompiler::RecompilerMain_Lookup_TLB( void )
m_Registers.DoTLBReadMiss(false,PROGRAM_COUNTER);
if (!g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr))
{
g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
g_Notify->DisplayError(L"Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
m_EndEmulation = true;
}
continue;
@ -621,7 +621,7 @@ void CRecompiler::RecompilerMain_Lookup_validate_TLB( void )
m_Registers.DoTLBReadMiss(false,PROGRAM_COUNTER);
if (!g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr))
{
g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
g_Notify->DisplayError(L"Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
m_EndEmulation = true;
}
continue;
@ -718,7 +718,7 @@ void CRecompiler::RecompilerMain_ChangeMemory ( void )
DoTLBMiss(NextInstruction == DELAY_SLOT,PROGRAM_COUNTER);
NextInstruction = NORMAL;
if (!TranslateVaddr(PROGRAM_COUNTER, &Addr)) {
g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
g_Notify->DisplayError(L"Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER);
ExitThread(0);
}
}
@ -730,7 +730,7 @@ void CRecompiler::RecompilerMain_ChangeMemory ( void )
__try {
Value = (DWORD)(*(DelaySlotTable + (Addr >> 12)));
} __except(EXCEPTION_EXECUTE_HANDLER) {
g_Notify->DisplayError("Executing Delay Slot from non maped space\nPROGRAM_COUNTER = 0x%X",PROGRAM_COUNTER);
g_Notify->DisplayError(L"Executing Delay Slot from non maped space\nPROGRAM_COUNTER = 0x%X",PROGRAM_COUNTER);
ExitThread(0);
}
if ( (Value >> 16) == 0x7C7C) {

View File

@ -88,5 +88,5 @@ void CRecompMemory::ShowMemUsed()
DWORD TotalAvaliable = m_RecompSize / 0x100000;
g_Notify->DisplayMessage(0,"Memory used: %d mb %-3d kb %-3d bytes Total Available: %d mb",MB,KB,Size, TotalAvaliable);
g_Notify->DisplayMessage(0,L"Memory used: %d mb %-3d kb %-3d bytes Total Available: %d mb",MB,KB,Size, TotalAvaliable);
}

View File

@ -80,7 +80,7 @@ void CRecompilerOps::Compile_Branch (CRecompilerOps::BranchFunction CompareFunc,
}
break;
default:
if (bHaveDebugger()) { g_Notify->DisplayError("Unknown branch type"); }
if (bHaveDebugger()) { g_Notify->DisplayError(L"Unknown branch type"); }
}
} else {
EffectDelaySlot = true;
@ -298,7 +298,7 @@ void CRecompilerOps::Compile_Branch (CRecompilerOps::BranchFunction CompareFunc,
} else {
if (bHaveDebugger())
{
g_Notify->DisplayError("WTF\n\nBranch\nNextInstruction = %X", m_NextInstruction);
g_Notify->DisplayError(L"WTF\n\nBranch\nNextInstruction = %X", m_NextInstruction);
}
}
}
@ -419,7 +419,7 @@ void CRecompilerOps::Compile_BranchLikely (BranchFunction CompareFunc, BOOL Link
m_Section->GenerateSectionLinkage();
m_NextInstruction = END_BLOCK;
} else if (bHaveDebugger()) {
g_Notify->DisplayError("WTF\n\nBranchLikely\nNextInstruction = %X", m_NextInstruction);
g_Notify->DisplayError(L"WTF\n\nBranchLikely\nNextInstruction = %X", m_NextInstruction);
}
}
@ -1342,7 +1342,7 @@ void CRecompilerOps::J (void) {
m_Section->GenerateSectionLinkage();
m_NextInstruction = END_BLOCK;
} else if (bHaveDebugger()) {
g_Notify->DisplayError("WTF\n\nJ\nNextInstruction = %X", m_NextInstruction);
g_Notify->DisplayError(L"WTF\n\nJ\nNextInstruction = %X", m_NextInstruction);
}
}
@ -1746,7 +1746,7 @@ void CRecompilerOps::CACHE (void){
default:
if (bHaveDebugger())
{
g_Notify->DisplayError("cache: %d",m_Opcode.rt);
g_Notify->DisplayError(L"cache: %d",m_Opcode.rt);
}
}
}
@ -1941,7 +1941,7 @@ void CRecompilerOps::SPECIAL_JR (void) {
}
m_NextInstruction = END_BLOCK;
} else if (bHaveDebugger()) {
g_Notify->DisplayError("WTF\n\nBranch\nNextInstruction = %X", m_NextInstruction);
g_Notify->DisplayError(L"WTF\n\nBranch\nNextInstruction = %X", m_NextInstruction);
}
}
@ -2004,7 +2004,7 @@ void CRecompilerOps::SPECIAL_JALR (void)
}
m_NextInstruction = END_BLOCK;
} else if (bHaveDebugger()) {
g_Notify->DisplayError("WTF\n\nBranch\nNextInstruction = %X", m_NextInstruction);
g_Notify->DisplayError(L"WTF\n\nBranch\nNextInstruction = %X", m_NextInstruction);
}
}
@ -2889,7 +2889,7 @@ void CRecompilerOps::SPECIAL_XOR (void) {
if (IsConst(m_Opcode.rt) && IsConst(m_Opcode.rs)) {
if (IsMapped(m_Opcode.rd)) { UnMap_GPR(m_Opcode.rd, FALSE); }
if (Is64Bit(m_Opcode.rt) || Is64Bit(m_Opcode.rs)) {
if (bHaveDebugger()) { g_Notify->DisplayError("XOR 1"); }
if (bHaveDebugger()) { g_Notify->DisplayError(L"XOR 1"); }
CRecompilerOps::UnknownOpcode();
} else {
m_RegWorkingSet.SetMipsRegState(m_Opcode.rd,CRegInfo::STATE_CONST_32_SIGN);
@ -3114,7 +3114,7 @@ void CRecompilerOps::SPECIAL_SLT (void) {
if (IsKnown(m_Opcode.rt) && IsKnown(m_Opcode.rs)) {
if (IsConst(m_Opcode.rt) && IsConst(m_Opcode.rs)) {
if (Is64Bit(m_Opcode.rt) || Is64Bit(m_Opcode.rs)) {
g_Notify->DisplayError("1");
g_Notify->DisplayError(L"1");
CRecompilerOps::UnknownOpcode();
} else {
if (IsMapped(m_Opcode.rd)) { UnMap_GPR(m_Opcode.rd, FALSE); }
@ -3347,7 +3347,7 @@ void CRecompilerOps::SPECIAL_SLTU (void) {
if (IsKnown(m_Opcode.rt) && IsKnown(m_Opcode.rs)) {
if (IsConst(m_Opcode.rt) && IsConst(m_Opcode.rs)) {
if (Is64Bit(m_Opcode.rt) || Is64Bit(m_Opcode.rs)) {
g_Notify->DisplayError("1");
g_Notify->DisplayError(L"1");
CRecompilerOps::UnknownOpcode();
} else {
if (IsMapped(m_Opcode.rd)) { UnMap_GPR(m_Opcode.rd, FALSE); }
@ -4039,7 +4039,7 @@ void CRecompilerOps::COP0_MT (void) {
case 13: //cause
if (IsConst(m_Opcode.rt)) {
AndConstToVariable(0xFFFFCFF,&_CP0[m_Opcode.rd], CRegName::Cop0[m_Opcode.rd]);
if ((GetMipsRegLo(m_Opcode.rt) & 0x300) != 0 && bHaveDebugger() ){ g_Notify->DisplayError("Set IP0 or IP1"); }
if ((GetMipsRegLo(m_Opcode.rt) & 0x300) != 0 && bHaveDebugger() ){ g_Notify->DisplayError(L"Set IP0 or IP1"); }
} else {
UnknownOpcode();
return;

View File

@ -161,7 +161,7 @@ void CRegInfo::FixRoundModel(FPU_ROUND RoundMethod )
case RoundDown: OrConstToX86Reg(0x0400, reg); break;
case RoundUp: OrConstToX86Reg(0x0800, reg); break;
default:
g_Notify->DisplayError("Unknown Rounding model");
g_Notify->DisplayError(L"Unknown Rounding model");
}
}
MoveX86regToVariable(reg, &m_fpuControl, "m_fpuControl");
@ -193,7 +193,7 @@ void CRegInfo::ChangeFPURegFormat (int Reg, FPU_STATE OldFormat, FPU_STATE NewFo
if (bHaveDebugger())
{
g_Notify->DisplayError("ChangeFormat: Register not on stack!!");
g_Notify->DisplayError(L"ChangeFormat: Register not on stack!!");
}
}
@ -206,8 +206,8 @@ void CRegInfo::Load_FPR_ToTop ( int Reg, int RegToLoad, FPU_STATE Format)
CPU_Message("CurrentRoundingModel: %s FpuRoundingModel(StackTopPos()): %s",RoundingModelName(GetRoundingModel()),RoundingModelName(FpuRoundingModel(StackTopPos())));
int i;
if (RegToLoad < 0) { g_Notify->DisplayError("Load_FPR_ToTop\nRegToLoad < 0 ???"); return; }
if (Reg < 0) { g_Notify->DisplayError("Load_FPR_ToTop\nReg < 0 ???"); return; }
if (RegToLoad < 0) { g_Notify->DisplayError(L"Load_FPR_ToTop\nRegToLoad < 0 ???"); return; }
if (Reg < 0) { g_Notify->DisplayError(L"Load_FPR_ToTop\nReg < 0 ???"); return; }
if (Format == FPU_Double || Format == FPU_Qword) {
UnMap_FPR(Reg + 1,TRUE);
@ -337,7 +337,7 @@ void CRegInfo::Load_FPR_ToTop ( int Reg, int RegToLoad, FPU_STATE Format)
fpuLoadQwordFromX86Reg(&StackTopPos(),TempReg);
break;
default:
if (bHaveDebugger()) { g_Notify->DisplayError("Load_FPR_ToTop\nUnkown format to load %d",Format); }
if (bHaveDebugger()) { g_Notify->DisplayError(L"Load_FPR_ToTop\nUnkown format to load %d",Format); }
}
SetX86Protected(TempReg,FALSE);
FpuRoundingModel(StackTopPos()) = RoundDefault;
@ -516,7 +516,7 @@ CRegInfo::x86Reg CRegInfo::Map_MemoryStack ( x86Reg Reg, bool bMapRegister, bool
Reg = FreeX86Reg();
if (Reg == x86_Unknown)
{
g_Notify->DisplayError("Map_MemoryStack\n\nOut of registers");
g_Notify->DisplayError(L"Map_MemoryStack\n\nOut of registers");
g_Notify->BreakPoint(__FILE__,__LINE__);
}
SetX86Mapped(Reg,CRegInfo::Stack_Mapped);
@ -562,7 +562,7 @@ void CRegInfo::Map_GPR_32bit (int MipsReg, bool SignValue, int MipsRegToLoad)
{
Reg = FreeX86Reg();
if (Reg < 0) {
if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_32bit\n\nOut of registers"); }
if (bHaveDebugger()) { g_Notify->DisplayError(L"Map_GPR_32bit\n\nOut of registers"); }
g_Notify->BreakPoint(__FILE__,__LINE__);
return;
}
@ -616,7 +616,7 @@ void CRegInfo::Map_GPR_64bit ( int MipsReg, int MipsRegToLoad)
int count;
if (MipsReg == 0) {
if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_32bit\n\nWhy are you trying to map reg 0"); }
if (bHaveDebugger()) { g_Notify->DisplayError(L"Map_GPR_32bit\n\nWhy are you trying to map reg 0"); }
return;
}
@ -625,13 +625,13 @@ void CRegInfo::Map_GPR_64bit ( int MipsReg, int MipsRegToLoad)
x86Hi = FreeX86Reg();
if (x86Hi < 0)
{
if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_64bit\n\nOut of registers"); }
if (bHaveDebugger()) { g_Notify->DisplayError(L"Map_GPR_64bit\n\nOut of registers"); }
return;
}
SetX86Protected(x86Hi,TRUE);
x86lo = FreeX86Reg();
if (x86lo < 0) { g_Notify->DisplayError("Map_GPR_64bit\n\nOut of registers"); return; }
if (x86lo < 0) { g_Notify->DisplayError(L"Map_GPR_64bit\n\nOut of registers"); return; }
SetX86Protected(x86lo,TRUE);
CPU_Message(" regcache: allocate %s to hi word of %s",x86_Name(x86Hi),CRegName::GPR[MipsReg]);
@ -971,7 +971,7 @@ void CRegInfo::UnMap_FPR (int Reg, int WriteBackValue )
fpuStoreQwordFromX86Reg(&StackTopPos(),TempReg, TRUE);
break;
default:
if (bHaveDebugger()) { g_Notify->DisplayError(__FUNCTION__ "\nUnknown format to load %d",x86fpu_State[StackTopPos()]); }
if (bHaveDebugger()) { g_Notify->DisplayError(__FUNCTIONW__ L"\nUnknown format to load %d",x86fpu_State[StackTopPos()]); }
}
SetX86Protected(TempReg,FALSE);
FpuRoundingModel(RegPos) = RoundDefault;
@ -993,7 +993,7 @@ void CRegInfo::UnMap_GPR (DWORD Reg, bool WriteBackValue)
{
if (Reg == 0)
{
if (bHaveDebugger()) { g_Notify->DisplayError(__FUNCTION__ "\n\nWhy are you trying to unmap reg 0"); }
if (bHaveDebugger()) { g_Notify->DisplayError(__FUNCTIONW__ L"\n\nWhy are you trying to unmap reg 0"); }
return;
}

View File

@ -50,91 +50,91 @@ DWORD CALLBACK RomInfoProc (HWND hDlg, DWORD uMsg, DWORD wParam, DWORD lParam) {
case WM_INITDIALOG:
{
//record class for future usage
SetProp((HWND)hDlg,"this",(RomInformation *)lParam);
SetProp(hDlg,"this",(RomInformation *)lParam);
RomInformation * _this = (RomInformation *)lParam;
SetWindowText((HWND)hDlg, GS(INFO_TITLE));
SetDlgItemText((HWND)hDlg, IDC_ROM_NAME, GS(INFO_ROM_NAME_TEXT));
SetDlgItemText((HWND)hDlg, IDC_FILE_NAME, GS(INFO_FILE_NAME_TEXT));
SetDlgItemText((HWND)hDlg, IDC_LOCATION, GS(INFO_LOCATION_TEXT));
SetDlgItemText((HWND)hDlg, IDC_ROM_MD5, GS(INFO_MD5_TEXT));
SetDlgItemText((HWND)hDlg, IDC_ROM_SIZE, GS(INFO_SIZE_TEXT));
SetDlgItemText((HWND)hDlg, IDC_CART_ID, GS(INFO_CART_ID_TEXT));
SetDlgItemText((HWND)hDlg, IDC_MANUFACTURER, GS(INFO_MANUFACTURER_TEXT));
SetDlgItemText((HWND)hDlg, IDC_COUNTRY, GS(INFO_COUNTRY_TEXT));
SetDlgItemText((HWND)hDlg, IDC_CRC1, GS(INFO_CRC1_TEXT));
SetDlgItemText((HWND)hDlg, IDC_CRC2, GS(INFO_CRC2_TEXT));
SetDlgItemText((HWND)hDlg, IDC_CIC_CHIP, GS(INFO_CIC_CHIP_TEXT));
SetWindowTextW(hDlg, GS(INFO_TITLE));
SetDlgItemTextW(hDlg, IDC_ROM_NAME, GS(INFO_ROM_NAME_TEXT));
SetDlgItemTextW(hDlg, IDC_FILE_NAME, GS(INFO_FILE_NAME_TEXT));
SetDlgItemTextW(hDlg, IDC_LOCATION, GS(INFO_LOCATION_TEXT));
SetDlgItemTextW(hDlg, IDC_ROM_MD5, GS(INFO_MD5_TEXT));
SetDlgItemTextW(hDlg, IDC_ROM_SIZE, GS(INFO_SIZE_TEXT));
SetDlgItemTextW(hDlg, IDC_CART_ID, GS(INFO_CART_ID_TEXT));
SetDlgItemTextW(hDlg, IDC_MANUFACTURER, GS(INFO_MANUFACTURER_TEXT));
SetDlgItemTextW(hDlg, IDC_COUNTRY, GS(INFO_COUNTRY_TEXT));
SetDlgItemTextW(hDlg, IDC_CRC1, GS(INFO_CRC1_TEXT));
SetDlgItemTextW(hDlg, IDC_CRC2, GS(INFO_CRC2_TEXT));
SetDlgItemTextW(hDlg, IDC_CIC_CHIP, GS(INFO_CIC_CHIP_TEXT));
SetDlgItemText((HWND)hDlg,IDC_INFO_ROMNAME,_this->m_pRomInfo->GetRomName().c_str());
SetDlgItemText(hDlg,IDC_INFO_ROMNAME,_this->m_pRomInfo->GetRomName().c_str());
char path[_MAX_PATH], drive[_MAX_DRIVE],dir[_MAX_DIR], fname[_MAX_FNAME],ext[_MAX_EXT];
_splitpath(_this->m_pRomInfo->GetFileName().c_str(), drive, dir, fname, ext);
_makepath(path, drive, dir, "", "");
SetDlgItemText((HWND)hDlg,IDC_INFO_FILENAME,fname);
SetDlgItemText((HWND)hDlg,IDC_INFO_LOCATION,path);
SetDlgItemText(hDlg,IDC_INFO_FILENAME,fname);
SetDlgItemText(hDlg,IDC_INFO_LOCATION,path);
SetDlgItemText((HWND)hDlg,IDC_INFO_MD5,_this->m_pRomInfo->GetRomMD5().c_str());
SetDlgItemText(hDlg,IDC_INFO_MD5,_this->m_pRomInfo->GetRomMD5().c_str());
char String[255] = " ";
sprintf(&String[1],"%.1f MBit",(float)_this->m_pRomInfo->GetRomSize()/0x20000);
SetDlgItemText((HWND)hDlg,IDC_INFO_ROMSIZE,String);
SetDlgItemText(hDlg,IDC_INFO_ROMSIZE,String);
BYTE * RomHeader = _this->m_pRomInfo->GetRomAddress();
String[1] = RomHeader[0x3F];
String[2] = RomHeader[0x3E];
String[3] = '\0';
SetDlgItemText((HWND)hDlg,IDC_INFO_CARTID,String);
SetDlgItemText(hDlg,IDC_INFO_CARTID,String);
switch (RomHeader[0x38]) {
case 'N': SetDlgItemText((HWND)hDlg,IDC_INFO_MANUFACTURER," Nintendo"); break;
case 0: SetDlgItemText((HWND)hDlg,IDC_INFO_MANUFACTURER," None"); break;
default: SetDlgItemText((HWND)hDlg,IDC_INFO_MANUFACTURER," (Unknown)"); break;
case 'N': SetDlgItemText(hDlg,IDC_INFO_MANUFACTURER," Nintendo"); break;
case 0: SetDlgItemText(hDlg,IDC_INFO_MANUFACTURER," None"); break;
default: SetDlgItemText(hDlg,IDC_INFO_MANUFACTURER," (Unknown)"); break;
}
switch (RomHeader[0x3D]) {
case NTSC_BETA: SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY," Beta"); break;
case X_NTSC: SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY," NTSC"); break;
case Germany: SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY," Germany"); break;
case USA: SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY," America"); break;
case french: SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY," France"); break;
case Italian: SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY," Italy"); break;
case Japan: SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY," Japan"); break;
case Europe: SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY," Europe"); break;
case Spanish: SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY," Spain"); break;
case Australia: SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY," Australia"); break;
case X_PAL: SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY," PAL"); break;
case Y_PAL: SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY," PAL"); break;
case 0: SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY," None"); break;
case NTSC_BETA: SetDlgItemText(hDlg,IDC_INFO_COUNTRY," Beta"); break;
case X_NTSC: SetDlgItemText(hDlg,IDC_INFO_COUNTRY," NTSC"); break;
case Germany: SetDlgItemText(hDlg,IDC_INFO_COUNTRY," Germany"); break;
case USA: SetDlgItemText(hDlg,IDC_INFO_COUNTRY," America"); break;
case french: SetDlgItemText(hDlg,IDC_INFO_COUNTRY," France"); break;
case Italian: SetDlgItemText(hDlg,IDC_INFO_COUNTRY," Italy"); break;
case Japan: SetDlgItemText(hDlg,IDC_INFO_COUNTRY," Japan"); break;
case Europe: SetDlgItemText(hDlg,IDC_INFO_COUNTRY," Europe"); break;
case Spanish: SetDlgItemText(hDlg,IDC_INFO_COUNTRY," Spain"); break;
case Australia: SetDlgItemText(hDlg,IDC_INFO_COUNTRY," Australia"); break;
case X_PAL: SetDlgItemText(hDlg,IDC_INFO_COUNTRY," PAL"); break;
case Y_PAL: SetDlgItemText(hDlg,IDC_INFO_COUNTRY," PAL"); break;
case 0: SetDlgItemText(hDlg,IDC_INFO_COUNTRY," None"); break;
default:
sprintf(&String[1]," Unknown %c (%02X)",RomHeader[0x3D],RomHeader[0x3D]);
SetDlgItemText((HWND)hDlg,IDC_INFO_COUNTRY,String);
SetDlgItemText(hDlg,IDC_INFO_COUNTRY,String);
}
sprintf(&String[1],"0x%08X",*(DWORD *)(RomHeader + 0x10));
SetDlgItemText((HWND)hDlg,IDC_INFO_CRC1,String);
SetDlgItemText(hDlg,IDC_INFO_CRC1,String);
sprintf(&String[1],"0x%08X",*(DWORD *)(RomHeader + 0x14));
SetDlgItemText((HWND)hDlg,IDC_INFO_CRC2,String);
SetDlgItemText(hDlg,IDC_INFO_CRC2,String);
if (_this->m_pRomInfo->CicChipID() == CIC_UNKNOWN) {
sprintf(&String[1],"Unknown");
} else {
sprintf(&String[1],"CIC-NUS-610%d",_this->m_pRomInfo->CicChipID());
}
SetDlgItemText((HWND)hDlg,IDC_INFO_CIC,String);
SetDlgItemText(hDlg,IDC_INFO_CIC,String);
}
break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDCANCEL:
RemoveProp((HWND)hDlg,"this");
EndDialog((HWND)hDlg,0);
RemoveProp(hDlg,"this");
EndDialog(hDlg,0);
break;
case IDC_CLOSE_BUTTON:
RemoveProp((HWND)hDlg,"this");
EndDialog((HWND)hDlg,0);
RemoveProp(hDlg,"this");
EndDialog(hDlg,0);
break;
}
default:

View File

@ -22,7 +22,7 @@ CSpeedLimitor::CSpeedLimitor(void)
TIMECAPS Caps;
timeGetDevCaps(&Caps, sizeof(Caps));
if (timeBeginPeriod(Caps.wPeriodMin) == TIMERR_NOCANDO) {
g_Notify->DisplayError("Error during timer begin");
g_Notify->DisplayError(L"Error during timer begin");
}
}

View File

@ -35,16 +35,18 @@ CFramePerSecond::~CFramePerSecond()
g_Settings->UnregisterChangeCB(GameRunning_ScreenHertz,this,(CSettings::SettingChangedFunc)ScreenHertzChanged);
}
void CFramePerSecond::Reset (bool ClearDisplay) {
void CFramePerSecond::Reset (bool ClearDisplay)
{
CurrentFrame = 0;
LastFrame = 0;
for (int count = 0; count < NoOfFrames; count ++) {
for (int count = 0; count < NoOfFrames; count ++)
{
Frames[count] = 0;
}
if (ClearDisplay)
{
g_Notify->DisplayMessage2("");
g_Notify->DisplayMessage2(L"");
return;
}
@ -70,45 +72,60 @@ void CFramePerSecond::UpdateViCounter ( void )
CurrentFrame += 1;
}
void CFramePerSecond::DisplayViCounter(DWORD FrameRate) {
void CFramePerSecond::DisplayViCounter(DWORD FrameRate)
{
if (m_iFrameRateType == FR_VIs)
{
if (FrameRate != 0) {
g_Notify->DisplayMessage2("VI/s: %d.00", FrameRate);
} else {
if (CurrentFrame > (NoOfFrames << 3)) {
if (FrameRate != 0)
{
g_Notify->DisplayMessage2(L"VI/s: %d.00", FrameRate);
}
else
{
if (CurrentFrame > (NoOfFrames << 3))
{
__int64 Total;
Total = 0;
for (int count = 0; count < NoOfFrames; count ++) {
for (int count = 0; count < NoOfFrames; count ++)
{
Total += Frames[count];
}
g_Notify->DisplayMessage2("VI/s: %.2f", Frequency/ ((double)Total / (NoOfFrames << 3)));
} else {
g_Notify->DisplayMessage2("VI/s: -.--");
g_Notify->DisplayMessage2(L"VI/s: %.2f", Frequency/ ((double)Total / (NoOfFrames << 3)));
}
else
{
g_Notify->DisplayMessage2(L"VI/s: -.--");
}
}
}
if (m_iFrameRateType == FR_PERCENT)
{
float Percent;
if (FrameRate != 0) {
if (FrameRate != 0)
{
Percent = ((float)FrameRate) / m_ScreenHertz;
} else {
if (CurrentFrame > (NoOfFrames << 3)) {
}
else
{
if (CurrentFrame > (NoOfFrames << 3))
{
__int64 Total;
Total = 0;
for (int count = 0; count < NoOfFrames; count ++) {
for (int count = 0; count < NoOfFrames; count ++)
{
Total += Frames[count];
}
Percent = ((float)(Frequency/ ((double)Total / (NoOfFrames << 3)))) / m_ScreenHertz;
} else {
g_Notify->DisplayMessage2("");
}
else
{
g_Notify->DisplayMessage2(L"");
return;
}
}
g_Notify->DisplayMessage2("%.1f %%",Percent * 100);
g_Notify->DisplayMessage2(L"%.1f %%",Percent * 100);
}
}
@ -146,7 +163,7 @@ void CFramePerSecond::DisplayDlCounter(DWORD FrameRate) {
return;
}
if (FrameRate != 0) {
g_Notify->DisplayMessage2("DL/s: %d.00", FrameRate);
g_Notify->DisplayMessage2(L"DL/s: %d.00", FrameRate);
} else {
if (CurrentFrame > (NoOfFrames << 2)) {
__int64 Total;
@ -155,9 +172,9 @@ void CFramePerSecond::DisplayDlCounter(DWORD FrameRate) {
for (int count = 0; count < NoOfFrames; count ++) {
Total += Frames[count];
}
g_Notify->DisplayMessage2("DL/s: %.1f", Frequency/ ((double)Total / (NoOfFrames << 2)));
g_Notify->DisplayMessage2(L"DL/s: %.1f", Frequency/ ((double)Total / (NoOfFrames << 2)));
} else {
g_Notify->DisplayMessage2("DL/s: -.--");
g_Notify->DisplayMessage2(L"DL/s: -.--");
}
}
}

View File

@ -67,7 +67,7 @@ CMainGui::~CMainGui (void)
}
if (m_hMainWindow)
{
DestroyWindow((HWND)m_hMainWindow);
DestroyWindow(m_hMainWindow);
}
WriteTrace(TraceDebug,__FUNCTION__ ": Done");
}
@ -121,38 +121,45 @@ void RomBrowserRecursiveChanged (CMainGui * Gui)
Gui->HighLightLastRom();
}
void CMainGui::ChangeWinSize (long width, long height) {
void CMainGui::ChangeWinSize (long width, long height)
{
CGuard Guard(m_CS);
WINDOWPLACEMENT wndpl;
RECT rc1, swrect;
wndpl.length = sizeof(wndpl);
GetWindowPlacement( (HWND)m_hMainWindow, &wndpl);
GetWindowPlacement( m_hMainWindow, &wndpl);
if ( (HWND)m_hStatusWnd != NULL ) {
if ( (HWND)m_hStatusWnd != NULL )
{
GetClientRect( (HWND)m_hStatusWnd, &swrect );
SetRect( &rc1, 0, 0, width, height + swrect.bottom );
} else {
}
else
{
SetRect( &rc1, 0, 0, width, height );
}
AdjustWindowRectEx( &rc1,GetWindowLong( (HWND)m_hMainWindow, GWL_STYLE ),
GetMenu( (HWND)m_hMainWindow ) != NULL, GetWindowLong( (HWND)m_hMainWindow, GWL_EXSTYLE ) );
AdjustWindowRectEx( &rc1,GetWindowLong( m_hMainWindow, GWL_STYLE ),
GetMenu( m_hMainWindow ) != NULL, GetWindowLong( m_hMainWindow, GWL_EXSTYLE ) );
MoveWindow( (HWND)m_hMainWindow, wndpl.rcNormalPosition.left, wndpl.rcNormalPosition.top,
MoveWindow( m_hMainWindow, wndpl.rcNormalPosition.left, wndpl.rcNormalPosition.top,
rc1.right - rc1.left, rc1.bottom - rc1.top, TRUE );
}
void CMainGui::AboutBox (void) {
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_About), (HWND)m_hMainWindow, (DLGPROC)AboutBoxProc,(LPARAM)this);
void CMainGui::AboutBox (void)
{
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_About), m_hMainWindow, (DLGPROC)AboutBoxProc,(LPARAM)this);
}
void CMainGui::AboutIniBox (void) {
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_About_Ini), (HWND)m_hMainWindow, (DLGPROC)AboutIniBoxProc,(LPARAM)this);
void CMainGui::AboutIniBox (void)
{
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_About_Ini), m_hMainWindow, (DLGPROC)AboutIniBoxProc,(LPARAM)this);
}
DWORD CALLBACK AboutIniBoxProc (HWND WndHandle, DWORD uMsg, DWORD wParam, DWORD /*lParam*/) {
DWORD CALLBACK AboutIniBoxProc (HWND WndHandle, DWORD uMsg, DWORD wParam, DWORD /*lParam*/)
{
static char RDBHomePage[300], CHTHomePage[300], RDXHomePage[300];
switch (uMsg) {
@ -161,16 +168,17 @@ DWORD CALLBACK AboutIniBoxProc (HWND WndHandle, DWORD uMsg, DWORD wParam, DWORD
HWND hDlg = (HWND)WndHandle;
char String[200],String2[200];
SetWindowText(hDlg, GS(INI_TITLE));
SetWindowTextW(hDlg, GS(INI_TITLE));
//Language
SetDlgItemText(hDlg,IDC_LAN,GS(INI_CURRENT_LANG));
SetDlgItemTextW(hDlg,IDC_LAN,GS(INI_CURRENT_LANG));
sprintf(String,"%s: %s",GS(INI_AUTHOR),GS(LANGUAGE_AUTHOR));
SetDlgItemText(hDlg,IDC_LAN_AUTHOR,String);
sprintf(String,"%s: %s",GS(INI_VERSION),GS(LANGUAGE_VERSION));
SetDlgItemText(hDlg,IDC_LAN_VERSION,String);
sprintf(String,"%s: %s",GS(INI_DATE),GS(LANGUAGE_DATE));
SetDlgItemText(hDlg,IDC_LAN_DATE,String);
if (strlen(GS(LANGUAGE_NAME)) == 0) {
if (wcslen(GS(LANGUAGE_NAME)) == 0)
{
EnableWindow(GetDlgItem(hDlg,IDC_LAN),FALSE);
EnableWindow(GetDlgItem(hDlg,IDC_LAN_AUTHOR),FALSE);
EnableWindow(GetDlgItem(hDlg,IDC_LAN_VERSION),FALSE);
@ -179,9 +187,10 @@ DWORD CALLBACK AboutIniBoxProc (HWND WndHandle, DWORD uMsg, DWORD wParam, DWORD
//RDB
stdstr IniFile = g_Settings->LoadString(SupportFile_RomDatabase).c_str();
SetDlgItemText(hDlg,IDC_RDB,GS(INI_CURRENT_RDB));
SetDlgItemTextW(hDlg,IDC_RDB,GS(INI_CURRENT_RDB));
GetPrivateProfileString("Meta","Author","",String,sizeof(String),IniFile.c_str());
if (strlen(String) == 0) {
if (strlen(String) == 0)
{
EnableWindow(GetDlgItem(hDlg,IDC_RDB),FALSE);
EnableWindow(GetDlgItem(hDlg,IDC_RDB_AUTHOR),FALSE);
EnableWindow(GetDlgItem(hDlg,IDC_RDB_VERSION),FALSE);
@ -197,13 +206,13 @@ DWORD CALLBACK AboutIniBoxProc (HWND WndHandle, DWORD uMsg, DWORD wParam, DWORD
sprintf(String2,"%s: %s",GS(INI_DATE),String);
SetDlgItemText(hDlg,IDC_RDB_DATE,String2);
GetPrivateProfileString("Meta","Homepage","",RDBHomePage,sizeof(RDBHomePage),IniFile.c_str());
SetDlgItemText(hDlg,IDC_RDB_HOME,GS(INI_HOMEPAGE));
SetDlgItemTextW(hDlg,IDC_RDB_HOME,GS(INI_HOMEPAGE));
if (strlen(RDBHomePage) == 0) {
EnableWindow(GetDlgItem(hDlg,IDC_RDB_HOME),FALSE);
}
//Cheat
SetDlgItemText(hDlg,IDC_CHT,GS(INI_CURRENT_CHT));
SetDlgItemTextW(hDlg,IDC_CHT,GS(INI_CURRENT_CHT));
IniFile = g_Settings->LoadString(SupportFile_Cheats).c_str();
GetPrivateProfileString("Meta","Author","",String,sizeof(String),IniFile.c_str());
if (strlen(String) == 0) {
@ -222,16 +231,18 @@ DWORD CALLBACK AboutIniBoxProc (HWND WndHandle, DWORD uMsg, DWORD wParam, DWORD
sprintf(String2,"%s: %s",GS(INI_DATE),String);
SetDlgItemText(hDlg,IDC_CHT_DATE,String2);
GetPrivateProfileString("Meta","Homepage","",CHTHomePage,sizeof(CHTHomePage),IniFile.c_str());
SetDlgItemText(hDlg,IDC_CHT_HOME,GS(INI_HOMEPAGE));
if (strlen(CHTHomePage) == 0) {
SetDlgItemTextW(hDlg,IDC_CHT_HOME,GS(INI_HOMEPAGE));
if (strlen(CHTHomePage) == 0)
{
EnableWindow(GetDlgItem(hDlg,IDC_CHT_HOME),FALSE);
}
//Extended Info
SetDlgItemText(hDlg,IDC_RDX,GS(INI_CURRENT_RDX));
SetDlgItemTextW(hDlg,IDC_RDX,GS(INI_CURRENT_RDX));
IniFile = g_Settings->LoadString(SupportFile_ExtInfo).c_str();;
GetPrivateProfileString("Meta","Author","",String,sizeof(String),IniFile.c_str());
if (strlen(String) == 0) {
if (strlen(String) == 0)
{
EnableWindow(GetDlgItem(hDlg,IDC_RDX),FALSE);
EnableWindow(GetDlgItem(hDlg,IDC_RDX_AUTHOR),FALSE);
EnableWindow(GetDlgItem(hDlg,IDC_RDX_VERSION),FALSE);
@ -247,14 +258,16 @@ DWORD CALLBACK AboutIniBoxProc (HWND WndHandle, DWORD uMsg, DWORD wParam, DWORD
sprintf(String2,"%s: %s",GS(INI_DATE),String);
SetDlgItemText(hDlg,IDC_RDX_DATE,String2);
GetPrivateProfileString("Meta","Homepage","",RDXHomePage,sizeof(CHTHomePage),IniFile.c_str());
SetDlgItemText(hDlg,IDC_RDX_HOME,GS(INI_HOMEPAGE));
if (strlen(RDXHomePage) == 0) {
SetDlgItemTextW(hDlg,IDC_RDX_HOME,GS(INI_HOMEPAGE));
if (strlen(RDXHomePage) == 0)
{
EnableWindow(GetDlgItem(hDlg,IDC_RDX_HOME),FALSE);
}
}
break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
switch (LOWORD(wParam))
{
case IDC_RDB_HOME: ShellExecute(NULL,"open",RDBHomePage,NULL,NULL,SW_SHOWNORMAL); break;
case IDC_CHT_HOME: ShellExecute(NULL,"open",CHTHomePage,NULL,NULL,SW_SHOWNORMAL); break;
case IDC_RDX_HOME: ShellExecute(NULL,"open",RDXHomePage,NULL,NULL,SW_SHOWNORMAL); break;
@ -278,7 +291,7 @@ bool CMainGui::ResetPlugins (CPlugins * plugins, CN64System * System)
bool bRes = true;
if (info.hEvent)
{
PostMessage((HWND)m_hMainWindow,WM_RESET_PLUGIN,(WPARAM)&bRes,(LPARAM)&info);
PostMessage(m_hMainWindow,WM_RESET_PLUGIN,(WPARAM)&bRes,(LPARAM)&info);
#ifdef _DEBUG
DWORD dwRes = WaitForSingleObject(info.hEvent,INFINITE);
#else
@ -286,30 +299,35 @@ bool CMainGui::ResetPlugins (CPlugins * plugins, CN64System * System)
#endif
dwRes = dwRes;
CloseHandle(info.hEvent);
} else {
}
else
{
WriteTrace(TraceError,__FUNCTION__ ": Failed to create event");
bRes = false;
}
return bRes;
}
void CMainGui::BringToTop (void) {
void CMainGui::BringToTop (void)
{
CGuard Guard(m_CS);
SetForegroundWindow((HWND)m_hMainWindow);
SetForegroundWindow(m_hMainWindow);
SetFocus(GetDesktopWindow());
Sleep(100);
SetFocus((HWND)m_hMainWindow);
SetFocus(m_hMainWindow);
}
void CMainGui::MakeWindowOnTop (bool OnTop) {
void CMainGui::MakeWindowOnTop (bool OnTop)
{
CGuard Guard(m_CS);
SetWindowPos((HWND)m_hMainWindow,OnTop ? HWND_TOPMOST : HWND_NOTOPMOST,0,0,0,0,
SetWindowPos(m_hMainWindow,OnTop ? HWND_TOPMOST : HWND_NOTOPMOST,0,0,0,0,
SWP_NOMOVE|SWP_NOSIZE|SWP_NOREDRAW);
}
void CMainGui::Caption (LPCSTR Caption) {
void CMainGui::Caption (LPCWSTR Caption)
{
CGuard Guard(m_CS);
SetWindowText((HWND)m_hMainWindow,Caption);
SetWindowTextW(m_hMainWindow,Caption);
}
void CMainGui::Create (const char * WindowTitle)
@ -322,7 +340,7 @@ void CMainGui::Create (const char * WindowTitle)
}
void CMainGui::CreateStatusBar (void) {
m_hStatusWnd = (HWND)CreateStatusWindow( WS_CHILD | WS_VISIBLE, "", (HWND)m_hMainWindow, StatusBarID );
m_hStatusWnd = (HWND)CreateStatusWindow( WS_CHILD | WS_VISIBLE, "", m_hMainWindow, StatusBarID );
SendMessage( (HWND)m_hStatusWnd, SB_SETTEXT, 0, (LPARAM)"" );
}
@ -372,7 +390,7 @@ bool CMainGui::ProcessGuiMessages (void) {
void CMainGui::Resize (DWORD /*fwSizeType*/, WORD nWidth, WORD nHeight) {
RECT clrect, swrect;
GetClientRect( (HWND)m_hMainWindow, &clrect );
GetClientRect( m_hMainWindow, &clrect );
GetClientRect( (HWND)m_hStatusWnd, &swrect );
int Parts[2];
@ -390,7 +408,7 @@ void CMainGui::Show (bool Visible)
CGuard Guard(m_CS);
if (m_hMainWindow)
{
ShowWindow((HWND)m_hMainWindow,Visible?SW_SHOW:SW_HIDE);
ShowWindow(m_hMainWindow,Visible?SW_SHOW:SW_HIDE);
if (Visible && RomBrowserVisible())
{
RomBrowserToTop();
@ -402,14 +420,14 @@ void CMainGui::Show (bool Visible)
void CMainGui::EnterLogOptions (void)
{
::EnterLogOptions((HWND)m_hMainWindow);
::EnterLogOptions(m_hMainWindow);
}
int CMainGui::Height (void) {
if (!m_hMainWindow) { return 0; }
RECT rect;
GetWindowRect((HWND)m_hMainWindow,&rect);
GetWindowRect(m_hMainWindow,&rect);
return rect.bottom - rect.top;
}
@ -418,13 +436,13 @@ int CMainGui::Width (void)
if (!m_hMainWindow) { return 0; }
RECT rect;
GetWindowRect((HWND)m_hMainWindow,&rect);
GetWindowRect(m_hMainWindow,&rect);
return rect.right - rect.left;
}
void CMainGui::SetPos (int X, int Y)
{
SetWindowPos((HWND)m_hMainWindow,NULL,X,Y,0,0,SWP_NOZORDER|SWP_NOSIZE);
SetWindowPos(m_hMainWindow,NULL,X,Y,0,0,SWP_NOZORDER|SWP_NOSIZE);
}
void CMainGui::SetWindowMenu (CBaseMenu * Menu)
@ -440,7 +458,7 @@ void CMainGui::SetWindowMenu (CBaseMenu * Menu)
if (hMenu)
{
SetMenu((HWND)m_hMainWindow,hMenu);
SetMenu(m_hMainWindow,hMenu);
}
m_AttachingMenu = false;
@ -864,7 +882,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (HWND hWnd, DWORD uMsg, DWORD wParam, DWOR
break;
}
Rom.SaveRomSettingID(true);
g_Notify->DisplayMessage(0,"");
g_Notify->DisplayMessage(0,L"");
BYTE * RomHeader = Rom.GetRomAddress();
WriteTrace(TraceGfxPlugin,__FUNCTION__ ": OnRomBrowserMenuItem - Starting");
g_Plugins->Gfx()->OnRomBrowserMenuItem(LOWORD(wParam),hWnd,RomHeader);

View File

@ -60,7 +60,7 @@ public:
void Show ( bool ShowWindow ); //Show or Hide the current window
void MakeWindowOnTop ( bool OnTop );
void BringToTop ( void );
void Caption ( LPCSTR Caption ); //Set the caption of the window
void Caption ( LPCWSTR Caption ); //Set the caption of the window
void SaveWindowLoc ( void );
//Menu Function

View File

@ -299,7 +299,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
if (g_Settings->LoadBool(UserInterface_ShowCPUPer))
{
g_Settings->SaveBool(UserInterface_ShowCPUPer,false);
g_Notify->DisplayMessage(0,"");
g_Notify->DisplayMessage(0,L"");
} else {
g_Settings->SaveBool(UserInterface_ShowCPUPer,true);
}
@ -326,11 +326,11 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
g_Settings->SaveBool(Debugger_ShowPifErrors,!g_Settings->LoadBool(Debugger_ShowPifErrors));
break;
case ID_DEBUG_SHOW_DLIST_COUNT:
g_Notify->DisplayMessage(0,"");
g_Notify->DisplayMessage(0,L"");
g_Settings->SaveBool(Debugger_ShowDListAListCount,!g_Settings->LoadBool(Debugger_ShowDListAListCount));
break;
case ID_DEBUG_SHOW_RECOMP_MEM_SIZE:
g_Notify->DisplayMessage(0,"");
g_Notify->DisplayMessage(0,L"");
g_Settings->SaveBool(Debugger_ShowRecompMemSize,!g_Settings->LoadBool(Debugger_ShowRecompMemSize));
break;
case ID_DEBUG_SHOW_DIV_BY_ZERO:
@ -465,7 +465,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
case ID_DEBUGGER_INTERRUPT_PI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_PI); break;
case ID_DEBUGGER_INTERRUPT_DP: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_DP); break;
case ID_CURRENT_SAVE_DEFAULT:
Notify().DisplayMessage(3,"Save Slot (%s) selected",GetSaveSlotString(MenuID - ID_CURRENT_SAVE_DEFAULT).c_str());
Notify().DisplayMessage(3,L"Save Slot (%s) selected",GetSaveSlotString(MenuID - ID_CURRENT_SAVE_DEFAULT).c_str());
g_Settings->SaveDword(Game_CurrentSaveState,(DWORD)(MenuID - ID_CURRENT_SAVE_DEFAULT));
break;
case ID_CURRENT_SAVE_1:
@ -478,7 +478,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
case ID_CURRENT_SAVE_8:
case ID_CURRENT_SAVE_9:
case ID_CURRENT_SAVE_10:
Notify().DisplayMessage(3,"Save Slot (%s) selected",GetSaveSlotString((MenuID - ID_CURRENT_SAVE_1) + 1).c_str());
Notify().DisplayMessage(3,L"Save Slot (%s) selected",GetSaveSlotString((MenuID - ID_CURRENT_SAVE_1) + 1).c_str());
g_Settings->SaveDword(Game_CurrentSaveState,(DWORD)((MenuID - ID_CURRENT_SAVE_1) + 1));
break;
case ID_HELP_SUPPORTFORUM: ShellExecute(NULL, "open", "http://forum.pj64-emu.com/", NULL, NULL, SW_SHOWMAXIMIZED); break;
@ -507,19 +507,19 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
}
}
if (MenuID >= ID_LANG_START && MenuID < ID_LANG_END) {
MENUITEMINFO menuinfo;
char String[300];
MENUITEMINFOW menuinfo;
wchar_t String[300];
menuinfo.cbSize = sizeof(MENUITEMINFO);
menuinfo.fMask = MIIM_TYPE;
menuinfo.fType = MFT_STRING;
menuinfo.dwTypeData = String;
menuinfo.cch = sizeof(String);
GetMenuItemInfo((HMENU)m_MenuHandle,MenuID,FALSE,&menuinfo);
GetMenuItemInfoW((HMENU)m_MenuHandle,MenuID,FALSE,&menuinfo);
//See if the language has changed, if not do nothing
//Set the language
_Lang->SetLanguage(String);
g_Lang->SetLanguage(String);
_Gui->ResetRomBrowserColomuns();
break;
}
@ -572,9 +572,9 @@ stdstr CMainMenu::GetFileLastMod (stdstr FileName)
return LastMod;
}
stdstr CMainMenu::GetSaveSlotString (int Slot)
std::wstring CMainMenu::GetSaveSlotString (int Slot)
{
stdstr SlotName;
std::wstring SlotName;
switch (Slot)
{
case 0: SlotName = GS(MENU_SLOT_DEFAULT); break;
@ -637,10 +637,11 @@ stdstr CMainMenu::GetSaveSlotString (int Slot)
}
}
return stdstr_f("%s%s",SlotName.c_str(),LastSaveTime.c_str()) ;
return stdstr_f("%s%s",SlotName.c_str(),LastSaveTime.c_str()).ToUTF16();
}
void CMainMenu::FillOutMenu ( HMENU hMenu ) {
void CMainMenu::FillOutMenu ( HMENU hMenu )
{
CGuard Guard(m_CS);
MENU_ITEM Item;
@ -659,18 +660,18 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
CMenuShortCutKey::GAME_RUNNING_FULLSCREEN :
CMenuShortCutKey::GAME_RUNNING_WINDOW;
}
//Get the system information to make the menu
LanguageList LangList = _Lang->GetLangList();
LanguageList LangList = g_Lang->GetLangList();
MenuItemList LangMenu;
int Offset = 0;
for (LanguageList::iterator Language = LangList.begin(); Language != LangList.end(); Language++) {
Item.Reset(ID_LANG_START + Offset++,EMPTY_STRING,NULL,NULL,Language->LanguageName.c_str());
if (_Lang->IsCurrentLang(*Language))
for (LanguageList::iterator Language = LangList.begin(); Language != LangList.end(); Language++)
{
Item.Reset(ID_LANG_START + Offset++,EMPTY_STRING,EMPTY_STDSTR,NULL,Language->LanguageName.c_str());
if (g_Lang->IsCurrentLang(*Language))
{
Item.ItemTicked = true;
Item.SetItemTicked(true);
}
LangMenu.push_back(Item);
}
@ -679,14 +680,15 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
MenuItemList RecentRomMenu;
DWORD count, RomsToRemember = g_Settings->LoadDword(File_RecentGameFileCount);
for (count = 0; count < RomsToRemember; count++) {
for (count = 0; count < RomsToRemember; count++)
{
stdstr LastRom = g_Settings->LoadStringIndex(File_RecentGameFileIndex,count);
if (LastRom.empty())
{
break;
}
stdstr_f MenuString("&%d %s",(count + 1) % 10,LastRom.c_str());
RecentRomMenu.push_back(MENU_ITEM(ID_RECENT_ROM_START + count,EMPTY_STRING,EMPTY_STDSTR,NULL,MenuString.c_str()));
RecentRomMenu.push_back(MENU_ITEM(ID_RECENT_ROM_START + count,EMPTY_STRING,EMPTY_STDSTR,NULL,MenuString.ToUTF16().c_str()));
}
@ -704,7 +706,7 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
}
stdstr_f MenuString("&%d %s",(count + 1) % 10,LastDir.c_str());
RecentDirMenu.push_back(MENU_ITEM(ID_RECENT_DIR_START + count,EMPTY_STRING,EMPTY_STDSTR,NULL,MenuString.c_str()));
RecentDirMenu.push_back(MENU_ITEM(ID_RECENT_DIR_START + count,EMPTY_STRING,EMPTY_STDSTR,NULL,MenuString.ToUTF16().c_str()));
}
/* File Menu
@ -712,22 +714,24 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
MenuItemList FileMenu;
Item.Reset(ID_FILE_OPEN_ROM, MENU_OPEN, m_ShortCuts.ShortCutString(ID_FILE_OPEN_ROM,AccessLevel));
FileMenu.push_back(Item);
if (!inBasicMode) {
if (!inBasicMode)
{
Item.Reset(ID_FILE_ROM_INFO, MENU_ROM_INFO,m_ShortCuts.ShortCutString(ID_FILE_ROM_INFO,AccessLevel));
Item.ItemEnabled = RomLoaded;
Item.SetItemEnabled(RomLoaded);
FileMenu.push_back(Item);
FileMenu.push_back(MENU_ITEM(SPLITER ));
Item.Reset(ID_FILE_STARTEMULATION,MENU_START, m_ShortCuts.ShortCutString(ID_FILE_STARTEMULATION,AccessLevel) );
Item.ItemEnabled = RomLoaded && !CPURunning;
Item.SetItemEnabled(RomLoaded && !CPURunning);
FileMenu.push_back(Item);
}
Item.Reset(ID_FILE_ENDEMULATION, MENU_END, m_ShortCuts.ShortCutString(ID_FILE_ENDEMULATION,AccessLevel) );
Item.ItemEnabled = CPURunning;
Item.SetItemEnabled(CPURunning);
FileMenu.push_back(Item);
FileMenu.push_back(MENU_ITEM(SPLITER ));
Item.Reset(SUB_MENU, MENU_LANGUAGE, EMPTY_STDSTR, &LangMenu );
FileMenu.push_back(Item);
if (RomList) {
if (RomList)
{
FileMenu.push_back(MENU_ITEM(SPLITER ));
Item.Reset(ID_FILE_ROMDIRECTORY, MENU_CHOOSE_ROM,m_ShortCuts.ShortCutString(ID_FILE_ROMDIRECTORY,AccessLevel) );
FileMenu.push_back(Item);
@ -735,22 +739,28 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
FileMenu.push_back(Item);
}
if (!inBasicMode && RomList) {
if (!inBasicMode && RomList)
{
FileMenu.push_back(MENU_ITEM(SPLITER ));
Item.Reset(SUB_MENU, MENU_RECENT_ROM,EMPTY_STDSTR, &RecentRomMenu);
if (RecentRomMenu.size() == 0) {
if (RecentRomMenu.size() == 0)
{
RecentRomMenu.push_back(MENU_ITEM(SPLITER));
Item.ItemEnabled = false;
Item.SetItemEnabled(false);
}
FileMenu.push_back(Item);
Item.Reset(SUB_MENU, MENU_RECENT_DIR,EMPTY_STDSTR, &RecentDirMenu);
if (RecentDirMenu.size() == 0) {
if (RecentDirMenu.size() == 0)
{
RecentDirMenu.push_back(MENU_ITEM(SPLITER));
Item.ItemEnabled = false;
Item.SetItemEnabled(false);
}
FileMenu.push_back(Item);
} else {
if (RecentRomMenu.size() != 0) {
}
else
{
if (RecentRomMenu.size() != 0)
{
FileMenu.push_back(MENU_ITEM(SPLITER ));
for (MenuItemList::iterator MenuItem = RecentRomMenu.begin(); MenuItem != RecentRomMenu.end(); MenuItem++)
{
@ -766,38 +776,38 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
MenuItemList CurrentSaveMenu;
DWORD _CurrentSaveState = g_Settings->LoadDword(Game_CurrentSaveState);
Item.Reset(ID_CURRENT_SAVE_DEFAULT, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_DEFAULT,AccessLevel),NULL,GetSaveSlotString(0));
if (_CurrentSaveState == 0) { Item.ItemTicked = true; }
if (_CurrentSaveState == 0) { Item.SetItemTicked(true); }
CurrentSaveMenu.push_back(Item);
CurrentSaveMenu.push_back(MENU_ITEM(SPLITER));
Item.Reset(ID_CURRENT_SAVE_1, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_1,AccessLevel),NULL,GetSaveSlotString(1));
if (_CurrentSaveState == 1) { Item.ItemTicked = true; }
if (_CurrentSaveState == 1) { Item.SetItemTicked(true); }
CurrentSaveMenu.push_back(Item);
Item.Reset(ID_CURRENT_SAVE_2, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_2,AccessLevel),NULL,GetSaveSlotString(2));
if (_CurrentSaveState == 2) { Item.ItemTicked = true; }
if (_CurrentSaveState == 2) { Item.SetItemTicked(true); }
CurrentSaveMenu.push_back(Item);
Item.Reset(ID_CURRENT_SAVE_3, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_3,AccessLevel),NULL,GetSaveSlotString(3));
if (_CurrentSaveState == 3) { Item.ItemTicked = true; }
if (_CurrentSaveState == 3) { Item.SetItemTicked(true); }
CurrentSaveMenu.push_back(Item);
Item.Reset(ID_CURRENT_SAVE_4, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_4,AccessLevel),NULL,GetSaveSlotString(4));
if (_CurrentSaveState == 4) { Item.ItemTicked = true; }
if (_CurrentSaveState == 4) { Item.SetItemTicked(true); }
CurrentSaveMenu.push_back(Item);
Item.Reset(ID_CURRENT_SAVE_5, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_5,AccessLevel),NULL,GetSaveSlotString(5));
if (_CurrentSaveState == 5) { Item.ItemTicked = true; }
if (_CurrentSaveState == 5) { Item.SetItemTicked(true); }
CurrentSaveMenu.push_back(Item);
Item.Reset(ID_CURRENT_SAVE_6, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_6,AccessLevel),NULL,GetSaveSlotString(6));
if (_CurrentSaveState == 6) { Item.ItemTicked = true; }
if (_CurrentSaveState == 6) { Item.SetItemTicked(true); }
CurrentSaveMenu.push_back(Item);
Item.Reset(ID_CURRENT_SAVE_7, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_7,AccessLevel),NULL,GetSaveSlotString(7));
if (_CurrentSaveState == 7) { Item.ItemTicked = true; }
if (_CurrentSaveState == 7) { Item.SetItemTicked(true); }
CurrentSaveMenu.push_back(Item);
Item.Reset(ID_CURRENT_SAVE_8, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_8,AccessLevel),NULL,GetSaveSlotString(8));
if (_CurrentSaveState == 8) { Item.ItemTicked = true; }
if (_CurrentSaveState == 8) { Item.SetItemTicked(true); }
CurrentSaveMenu.push_back(Item);
Item.Reset(ID_CURRENT_SAVE_9, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_9,AccessLevel),NULL,GetSaveSlotString(9));
if (_CurrentSaveState == 9) { Item.ItemTicked = true; }
if (_CurrentSaveState == 9) { Item.SetItemTicked(true); }
CurrentSaveMenu.push_back(Item);
Item.Reset(ID_CURRENT_SAVE_10, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_10,AccessLevel),NULL,GetSaveSlotString(10));
if (_CurrentSaveState == 10) { Item.ItemTicked = true; }
if (_CurrentSaveState == 10) { Item.SetItemTicked(true); }
CurrentSaveMenu.push_back(Item);
/* System Menu
@ -807,30 +817,38 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
if (inBasicMode)
{
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_RESET_SOFT, MENU_RESET, m_ShortCuts.ShortCutString(ID_SYSTEM_RESET_SOFT,AccessLevel) ));
} else {
}
else
{
ResetMenu.push_back(MENU_ITEM(ID_SYSTEM_RESET_SOFT, MENU_RESET_SOFT, m_ShortCuts.ShortCutString(ID_SYSTEM_RESET_SOFT,AccessLevel) ));
ResetMenu.push_back(MENU_ITEM(ID_SYSTEM_RESET_HARD, MENU_RESET_HARD, m_ShortCuts.ShortCutString(ID_SYSTEM_RESET_HARD,AccessLevel)));
SystemMenu.push_back(MENU_ITEM(SUB_MENU,MENU_RESET,EMPTY_STDSTR,&ResetMenu));
}
if (g_Settings->LoadBool(GameRunning_CPU_Paused)) {
if (g_Settings->LoadBool(GameRunning_CPU_Paused))
{
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_PAUSE, MENU_RESUME, m_ShortCuts.ShortCutString(ID_SYSTEM_PAUSE,AccessLevel)));
} else {
}
else
{
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_PAUSE, MENU_PAUSE, m_ShortCuts.ShortCutString(ID_SYSTEM_PAUSE,AccessLevel)));
}
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_BITMAP, MENU_BITMAP, m_ShortCuts.ShortCutString(ID_SYSTEM_BITMAP,AccessLevel)));
SystemMenu.push_back(MENU_ITEM(SPLITER ));
if (!inBasicMode) {
if (!inBasicMode)
{
Item.Reset(ID_SYSTEM_LIMITFPS, MENU_LIMIT_FPS,m_ShortCuts.ShortCutString(ID_SYSTEM_LIMITFPS,AccessLevel) );
if (g_Settings->LoadBool(GameRunning_LimitFPS)) { Item.ItemTicked = true; }
if (g_Settings->LoadBool(GameRunning_LimitFPS)) { Item.SetItemTicked(true); }
SystemMenu.push_back(Item);
SystemMenu.push_back(MENU_ITEM(SPLITER ));
}
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_SAVE, MENU_SAVE, m_ShortCuts.ShortCutString(ID_SYSTEM_SAVE,AccessLevel)));
if (!inBasicMode) {
if (!inBasicMode)
{
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_SAVEAS, MENU_SAVE_AS, m_ShortCuts.ShortCutString(ID_SYSTEM_SAVEAS,AccessLevel)));
}
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_RESTORE, MENU_RESTORE, m_ShortCuts.ShortCutString(ID_SYSTEM_RESTORE,AccessLevel)));
if (!inBasicMode) {
if (!inBasicMode)
{
SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_LOAD, MENU_LOAD, m_ShortCuts.ShortCutString(ID_SYSTEM_LOAD,AccessLevel)));
}
SystemMenu.push_back(MENU_ITEM(SPLITER ));
@ -843,46 +861,54 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
****************/
MenuItemList OptionMenu;
Item.Reset(ID_OPTIONS_FULLSCREEN, MENU_FULL_SCREEN,m_ShortCuts.ShortCutString(ID_OPTIONS_FULLSCREEN,AccessLevel) );
Item.ItemEnabled = CPURunning;
if (g_Plugins->Gfx() && g_Plugins->Gfx()->ChangeWindow == NULL) {
Item.ItemEnabled = false;
Item.SetItemEnabled(CPURunning);
if (g_Plugins->Gfx() && g_Plugins->Gfx()->ChangeWindow == NULL)
{
Item.SetItemEnabled(false);
}
OptionMenu.push_back(Item);
if (!inBasicMode) {
if (!inBasicMode)
{
Item.Reset(ID_OPTIONS_ALWAYSONTOP, MENU_ON_TOP,m_ShortCuts.ShortCutString(ID_OPTIONS_ALWAYSONTOP,AccessLevel) );
if (g_Settings->LoadDword(UserInterface_AlwaysOnTop)) { Item.ItemTicked = true; }
Item.ItemEnabled = CPURunning;
if (g_Settings->LoadDword(UserInterface_AlwaysOnTop)) { Item.SetItemTicked(true); }
Item.SetItemEnabled(CPURunning);
OptionMenu.push_back(Item);
}
OptionMenu.push_back(MENU_ITEM(SPLITER ));
OptionMenu.push_back(MENU_ITEM(SPLITER));
Item.Reset(ID_OPTIONS_CONFIG_GFX, MENU_CONFG_GFX,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_GFX,AccessLevel));
if (g_Plugins->Gfx() == NULL || g_Plugins->Gfx()->DllConfig == NULL) {
Item.ItemEnabled = false;
if (g_Plugins->Gfx() == NULL || g_Plugins->Gfx()->DllConfig == NULL)
{
Item.SetItemEnabled(false);
}
OptionMenu.push_back(Item);
Item.Reset(ID_OPTIONS_CONFIG_AUDIO, MENU_CONFG_AUDIO,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_AUDIO,AccessLevel));
if (g_Plugins->Audio() == NULL || g_Plugins->Audio()->DllConfig == NULL) {
Item.ItemEnabled = false;
if (g_Plugins->Audio() == NULL || g_Plugins->Audio()->DllConfig == NULL)
{
Item.SetItemEnabled(false);
}
OptionMenu.push_back(Item);
if (!inBasicMode) {
if (!inBasicMode)
{
Item.Reset(ID_OPTIONS_CONFIG_RSP, MENU_CONFG_RSP,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_RSP,AccessLevel));
if (g_Plugins->RSP() == NULL || g_Plugins->RSP()->DllConfig == NULL) {
Item.ItemEnabled = false;
if (g_Plugins->RSP() == NULL || g_Plugins->RSP()->DllConfig == NULL)
{
Item.SetItemEnabled(false);
}
OptionMenu.push_back(Item);
}
Item.Reset(ID_OPTIONS_CONFIG_CONT, MENU_CONFG_CTRL,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_CONT,AccessLevel));
if (g_Plugins->Control() == NULL || g_Plugins->Control()->DllConfig == NULL) {
Item.ItemEnabled = false;
if (g_Plugins->Control() == NULL || g_Plugins->Control()->DllConfig == NULL)
{
Item.SetItemEnabled(false);
}
OptionMenu.push_back(Item);
OptionMenu.push_back(MENU_ITEM(SPLITER ));
if (!inBasicMode) {
OptionMenu.push_back(MENU_ITEM(SPLITER));
if (!inBasicMode)
{
Item.Reset(ID_OPTIONS_CPU_USAGE, MENU_SHOW_CPU,m_ShortCuts.ShortCutString(ID_OPTIONS_CPU_USAGE,AccessLevel) );
if (g_Settings->LoadDword(UserInterface_ShowCPUPer)) { Item.ItemTicked = true; }
if (g_Settings->LoadDword(UserInterface_ShowCPUPer)) { Item.SetItemTicked(true); }
OptionMenu.push_back(Item);
}
OptionMenu.push_back(MENU_ITEM(ID_OPTIONS_SETTINGS, MENU_SETTINGS,m_ShortCuts.ShortCutString(ID_OPTIONS_SETTINGS,AccessLevel) ));
@ -892,14 +918,14 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
MenuItemList DebugProfileMenu;
if (bHaveDebugger())
{
Item.Reset(ID_PROFILE_PROFILE,EMPTY_STRING,EMPTY_STDSTR,NULL,"Profile Code" );
if (g_Settings->LoadBool(Debugger_ProfileCode)) { Item.ItemTicked = true; }
Item.Reset(ID_PROFILE_PROFILE,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Profile Code" );
if (g_Settings->LoadBool(Debugger_ProfileCode)) { Item.SetItemTicked(true); }
DebugProfileMenu.push_back(Item);
Item.Reset(ID_PROFILE_RESETCOUNTER,EMPTY_STRING,EMPTY_STDSTR,NULL,"Reset Counters" );
if (!CPURunning) { Item.ItemEnabled = false; }
Item.Reset(ID_PROFILE_RESETCOUNTER,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Reset Counters" );
if (!CPURunning) { Item.SetItemEnabled(false); }
DebugProfileMenu.push_back(Item);
Item.Reset(ID_PROFILE_GENERATELOG,EMPTY_STRING,EMPTY_STDSTR,NULL,"Generate Log File" );
if (!CPURunning) { Item.ItemEnabled = false; }
Item.Reset(ID_PROFILE_GENERATELOG,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Generate Log File" );
if (!CPURunning) { Item.SetItemEnabled(false); }
DebugProfileMenu.push_back(Item);
}
@ -912,53 +938,55 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
MenuItemList DebugMemoryMenu;
MenuItemList DebugInterrupt;
MenuItemList DebugNotificationMenu;
if (bHaveDebugger()) {
if (bHaveDebugger())
{
/* Debug - Interrupt
*******************/
Item.Reset(ID_DEBUGGER_INTERRUPT_SP,EMPTY_STRING,EMPTY_STDSTR,NULL,"SP Interrupt" );
Item.ItemEnabled = CPURunning;
Item.Reset(ID_DEBUGGER_INTERRUPT_SP,EMPTY_STRING,EMPTY_STDSTR,NULL,L"SP Interrupt" );
Item.SetItemEnabled(CPURunning);
DebugInterrupt.push_back(Item);
Item.Reset(ID_DEBUGGER_INTERRUPT_SI,EMPTY_STRING,EMPTY_STDSTR,NULL,"SI Interrupt" );
Item.ItemEnabled = CPURunning;
Item.Reset(ID_DEBUGGER_INTERRUPT_SI,EMPTY_STRING,EMPTY_STDSTR,NULL,L"SI Interrupt" );
Item.SetItemEnabled(CPURunning);
DebugInterrupt.push_back(Item);
Item.Reset(ID_DEBUGGER_INTERRUPT_AI,EMPTY_STRING,EMPTY_STDSTR,NULL,"AI Interrupt" );
Item.ItemEnabled = CPURunning;
Item.Reset(ID_DEBUGGER_INTERRUPT_AI,EMPTY_STRING,EMPTY_STDSTR,NULL,L"AI Interrupt" );
Item.SetItemEnabled(CPURunning);
DebugInterrupt.push_back(Item);
Item.Reset(ID_DEBUGGER_INTERRUPT_VI,EMPTY_STRING,EMPTY_STDSTR,NULL,"VI Interrupt" );
Item.ItemEnabled = CPURunning;
Item.Reset(ID_DEBUGGER_INTERRUPT_VI,EMPTY_STRING,EMPTY_STDSTR,NULL,L"VI Interrupt" );
Item.SetItemEnabled(CPURunning);
DebugInterrupt.push_back(Item);
Item.Reset(ID_DEBUGGER_INTERRUPT_PI,EMPTY_STRING,EMPTY_STDSTR,NULL,"PI Interrupt" );
Item.ItemEnabled = CPURunning;
Item.Reset(ID_DEBUGGER_INTERRUPT_PI,EMPTY_STRING,EMPTY_STDSTR,NULL,L"PI Interrupt" );
Item.SetItemEnabled(CPURunning);
DebugInterrupt.push_back(Item);
Item.Reset(ID_DEBUGGER_INTERRUPT_DP,EMPTY_STRING,EMPTY_STDSTR,NULL,"DP Interrupt" );
Item.ItemEnabled = CPURunning;
Item.Reset(ID_DEBUGGER_INTERRUPT_DP,EMPTY_STRING,EMPTY_STDSTR,NULL,L"DP Interrupt" );
Item.SetItemEnabled(CPURunning);
DebugInterrupt.push_back(Item);
/* Debug - R4300i
*******************/
Item.Reset(ID_DEBUGGER_LOGOPTIONS,EMPTY_STRING,EMPTY_STDSTR,NULL,"R4300i &Commands..." );
Item.ItemEnabled = false;
Item.Reset(ID_DEBUGGER_LOGOPTIONS,EMPTY_STRING,EMPTY_STDSTR,NULL,L"R4300i &Commands..." );
Item.SetItemEnabled(false);
DebugR4300Menu.push_back(Item);
Item.Reset(ID_DEBUGGER_R4300REGISTERS,EMPTY_STRING,EMPTY_STDSTR,NULL,"R4300i &Registers..." );
Item.ItemEnabled = true;
Item.Reset(ID_DEBUGGER_R4300REGISTERS,EMPTY_STRING,EMPTY_STDSTR,NULL,L"R4300i &Registers..." );
Item.SetItemEnabled(true);
DebugR4300Menu.push_back(Item);
Item.Reset(ID_DEBUG_DISABLE_GAMEFIX,EMPTY_STRING,EMPTY_STDSTR,NULL,"Disable Game Fixes" );
if (g_Settings->LoadBool(Debugger_DisableGameFixes)) {
Item.ItemTicked = true;
Item.Reset(ID_DEBUG_DISABLE_GAMEFIX,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Disable Game Fixes" );
if (g_Settings->LoadBool(Debugger_DisableGameFixes))
{
Item.SetItemTicked(true);
}
DebugR4300Menu.push_back(Item);
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugInterrupt,"&Generate Interrupt");
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugInterrupt,L"&Generate Interrupt");
DebugR4300Menu.push_back(Item);
/* Debug - Memory
****************/
Item.Reset(ID_DEBUGGER_MEMORY,EMPTY_STRING,EMPTY_STDSTR,NULL,"View..." );
Item.Reset(ID_DEBUGGER_MEMORY,EMPTY_STRING,EMPTY_STDSTR,NULL,L"View..." );
DebugMemoryMenu.push_back(Item);
Item.Reset(ID_DEBUGGER_SEARCHMEMORY,EMPTY_STRING,EMPTY_STDSTR,NULL,"Search..." );
Item.Reset(ID_DEBUGGER_SEARCHMEMORY,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Search..." );
DebugMemoryMenu.push_back(Item);
Item.Reset(ID_DEBUGGER_DUMPMEMORY,EMPTY_STRING,EMPTY_STDSTR,NULL,"Dump..." );
Item.Reset(ID_DEBUGGER_DUMPMEMORY,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Dump..." );
DebugMemoryMenu.push_back(Item);
Item.Reset(ID_DEBUGGER_TLBENTRIES,EMPTY_STRING,EMPTY_STDSTR,NULL,"TLB Entries..." );
Item.Reset(ID_DEBUGGER_TLBENTRIES,EMPTY_STRING,EMPTY_STDSTR,NULL,L"TLB Entries..." );
DebugMemoryMenu.push_back(Item);
/* Debug - App logging
@ -966,60 +994,60 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
{
DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel);
Item.Reset(ID_DEBUGGER_APPLOG_ERRORS,EMPTY_STRING,EMPTY_STDSTR,NULL,"Error Messages" );
if ((LogLevel & TraceError) != 0) { Item.ItemTicked = true; }
Item.Reset(ID_DEBUGGER_APPLOG_ERRORS,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Error Messages" );
if ((LogLevel & TraceError) != 0) { Item.SetItemTicked(true); }
DebugAppLoggingMenu.push_back(Item);
Item.Reset(ID_DEBUGGER_APPLOG_SETTINGS,EMPTY_STRING,EMPTY_STDSTR,NULL,"Settings" );
if ((LogLevel & TraceSettings) != 0) { Item.ItemTicked = true; }
Item.Reset(ID_DEBUGGER_APPLOG_SETTINGS,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Settings" );
if ((LogLevel & TraceSettings) != 0) { Item.SetItemTicked(true); }
DebugAppLoggingMenu.push_back(Item);
Item.Reset(ID_DEBUGGER_APPLOG_RECOMPILER,EMPTY_STRING,EMPTY_STDSTR,NULL,"Recompiler" );
if ((LogLevel & TraceRecompiler) != 0) { Item.ItemTicked = true; }
Item.Reset(ID_DEBUGGER_APPLOG_RECOMPILER,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Recompiler" );
if ((LogLevel & TraceRecompiler) != 0) { Item.SetItemTicked(true); }
DebugAppLoggingMenu.push_back(Item);
Item.Reset(ID_DEBUGGER_APPLOG_RSP,EMPTY_STRING,EMPTY_STDSTR,NULL,"RSP" );
if ((LogLevel & TraceRSP) != 0) { Item.ItemTicked = true; }
Item.Reset(ID_DEBUGGER_APPLOG_RSP,EMPTY_STRING,EMPTY_STDSTR,NULL,L"RSP" );
if ((LogLevel & TraceRSP) != 0) { Item.SetItemTicked(true); }
DebugAppLoggingMenu.push_back(Item);
Item.Reset(ID_DEBUGGER_APPLOG_TLB,EMPTY_STRING,EMPTY_STDSTR,NULL,"TLB" );
if ((LogLevel & TraceTLB) != 0) { Item.ItemTicked = true; }
Item.Reset(ID_DEBUGGER_APPLOG_TLB,EMPTY_STRING,EMPTY_STDSTR,NULL,L"TLB" );
if ((LogLevel & TraceTLB) != 0) { Item.SetItemTicked(true); }
DebugAppLoggingMenu.push_back(Item);
Item.Reset(ID_DEBUGGER_APPLOG_GFX_PLUGIN,EMPTY_STRING,EMPTY_STDSTR,NULL,"Gfx Plugin" );
if ((LogLevel & TraceGfxPlugin) != 0) { Item.ItemTicked = true; }
Item.Reset(ID_DEBUGGER_APPLOG_GFX_PLUGIN,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Gfx Plugin" );
if ((LogLevel & TraceGfxPlugin) != 0) { Item.SetItemTicked(true); }
DebugAppLoggingMenu.push_back(Item);
Item.Reset(ID_DEBUGGER_APPLOG_AUDIO_EMU,EMPTY_STRING,EMPTY_STDSTR,NULL,"Audio Emulation" );
if ((LogLevel & TraceAudio) != 0) { Item.ItemTicked = true; }
Item.Reset(ID_DEBUGGER_APPLOG_AUDIO_EMU,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Audio Emulation" );
if ((LogLevel & TraceAudio) != 0) { Item.SetItemTicked(true); }
DebugAppLoggingMenu.push_back(Item);
Item.Reset(ID_DEBUGGER_APPLOG_DEBUG,EMPTY_STRING,EMPTY_STDSTR,NULL,"Debug Messages" );
if ((LogLevel & TraceDebug) != 0) { Item.ItemTicked = true; }
Item.Reset(ID_DEBUGGER_APPLOG_DEBUG,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Debug Messages" );
if ((LogLevel & TraceDebug) != 0) { Item.SetItemTicked(true); }
DebugAppLoggingMenu.push_back(Item);
DebugAppLoggingMenu.push_back(MENU_ITEM(SPLITER ));
Item.Reset(ID_DEBUGGER_APPLOG_FLUSH,EMPTY_STRING,EMPTY_STDSTR,NULL,"Auto flush file" );
if (g_Settings->LoadBool(Debugger_AppLogFlush)) { Item.ItemTicked = true; }
Item.Reset(ID_DEBUGGER_APPLOG_FLUSH,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Auto flush file" );
if (g_Settings->LoadBool(Debugger_AppLogFlush)) { Item.SetItemTicked(true); }
DebugAppLoggingMenu.push_back(Item);
}
/* Debug - Logging
*******************/
Item.Reset(ID_DEBUGGER_LOGOPTIONS,EMPTY_STRING,EMPTY_STDSTR,NULL,"Log Options..." );
Item.Reset(ID_DEBUGGER_LOGOPTIONS,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Log Options..." );
DebugLoggingMenu.push_back(Item);
Item.Reset(ID_DEBUGGER_GENERATELOG,EMPTY_STRING,EMPTY_STDSTR,NULL,"Generate Log" );
if (g_Settings->LoadBool(Debugger_GenerateDebugLog)) { Item.ItemTicked = true; }
Item.Reset(ID_DEBUGGER_GENERATELOG,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Generate Log" );
if (g_Settings->LoadBool(Debugger_GenerateDebugLog)) { Item.SetItemTicked(true); }
DebugLoggingMenu.push_back(Item);
/* Debugger Main Menu
****************/
Item.Reset(ID_DEBUGGER_BREAKPOINTS, EMPTY_STRING,EMPTY_STDSTR, NULL,"Breakpoint...");
Item.ItemEnabled = CPURunning;
Item.Reset(ID_DEBUGGER_BREAKPOINTS, EMPTY_STRING,EMPTY_STDSTR, NULL,L"Breakpoint...");
Item.SetItemEnabled(CPURunning);
DebugMenu.push_back(Item);
DebugMenu.push_back(MENU_ITEM(SPLITER));
@ -1027,7 +1055,7 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
*******************/
if (g_Plugins->RSP() != NULL && IsMenu((HMENU)g_Plugins->RSP()->GetDebugMenu()))
{
Item.Reset(ID_PLUGIN_MENU,EMPTY_STRING,NULL,g_Plugins->RSP()->GetDebugMenu(),"&RSP" );
Item.Reset(ID_PLUGIN_MENU,EMPTY_STRING,NULL,g_Plugins->RSP()->GetDebugMenu(),L"&RSP" );
DebugMenu.push_back(Item);
}
@ -1035,61 +1063,65 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
*******************/
if (g_Plugins->Gfx() != NULL && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu()))
{
Item.Reset(ID_PLUGIN_MENU,EMPTY_STRING,NULL,g_Plugins->Gfx()->GetDebugMenu(),"&RDP" );
Item.Reset(ID_PLUGIN_MENU,EMPTY_STRING,NULL,g_Plugins->Gfx()->GetDebugMenu(),L"&RDP" );
DebugMenu.push_back(Item);
}
/* Notification Menu
*******************/
Item.Reset(ID_DEBUG_SHOW_UNHANDLED_MEM,EMPTY_STRING,EMPTY_STDSTR,NULL,"On Unhandled Memory Actions" );
Item.Reset(ID_DEBUG_SHOW_UNHANDLED_MEM,EMPTY_STRING,EMPTY_STDSTR,NULL,L"On Unhandled Memory Actions" );
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) {
Item.ItemTicked = true;
Item.SetItemTicked(true);
}
DebugNotificationMenu.push_back(Item);
Item.Reset(ID_DEBUG_SHOW_PIF_ERRORS,EMPTY_STRING,EMPTY_STDSTR,NULL,"On PIF Errors" );
Item.Reset(ID_DEBUG_SHOW_PIF_ERRORS,EMPTY_STRING,EMPTY_STDSTR,NULL,L"On PIF Errors" );
if (g_Settings->LoadBool(Debugger_ShowPifErrors)) {
Item.ItemTicked = true;
Item.SetItemTicked(true);
}
DebugNotificationMenu.push_back(Item);
Item.Reset(ID_DEBUG_SHOW_DIV_BY_ZERO,EMPTY_STRING,EMPTY_STDSTR,NULL,"On Div By Zero" );
Item.Reset(ID_DEBUG_SHOW_DIV_BY_ZERO,EMPTY_STRING,EMPTY_STDSTR,NULL,L"On Div By Zero" );
if (g_Settings->LoadBool(Debugger_ShowDivByZero)) {
Item.ItemTicked = true;
Item.SetItemTicked(true);
}
DebugNotificationMenu.push_back(Item);
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugR4300Menu,"&R4300i");
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugR4300Menu,L"&R4300i");
DebugMenu.push_back(Item);
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugMemoryMenu,"Memory");
Item.ItemEnabled = CPURunning;
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugMemoryMenu,L"Memory");
Item.SetItemEnabled(CPURunning);
DebugMenu.push_back(Item);
DebugMenu.push_back(MENU_ITEM(SPLITER));
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugProfileMenu,"Profile");
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugProfileMenu,L"Profile");
DebugMenu.push_back(Item);
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugAppLoggingMenu,"App Logging");
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugAppLoggingMenu,L"App Logging");
DebugMenu.push_back(Item);
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugLoggingMenu,"Logging");
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugLoggingMenu,L"Logging");
DebugMenu.push_back(Item);
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugNotificationMenu,"Notification");
Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugNotificationMenu,L"Notification");
DebugMenu.push_back(Item);
DebugMenu.push_back(MENU_ITEM(SPLITER));
Item.Reset(ID_DEBUG_SHOW_TLB_MISSES,EMPTY_STRING,EMPTY_STDSTR,NULL,"Show TLB Misses" );
if (g_Settings->LoadBool(Debugger_ShowTLBMisses)) {
Item.ItemTicked = true;
Item.Reset(ID_DEBUG_SHOW_TLB_MISSES,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Show TLB Misses" );
if (g_Settings->LoadBool(Debugger_ShowTLBMisses))
{
Item.SetItemTicked(true);
}
Item.Reset(ID_DEBUG_SHOW_DLIST_COUNT,EMPTY_STRING,EMPTY_STDSTR,NULL,"Display Alist/Dlist Count" );
if (g_Settings->LoadBool(Debugger_ShowDListAListCount)) {
Item.ItemTicked = true;
Item.Reset(ID_DEBUG_SHOW_DLIST_COUNT,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Display Alist/Dlist Count" );
if (g_Settings->LoadBool(Debugger_ShowDListAListCount))
{
Item.SetItemTicked(true);
}
DebugMenu.push_back(Item);
Item.Reset(ID_DEBUG_SHOW_RECOMP_MEM_SIZE,EMPTY_STRING,EMPTY_STDSTR,NULL,"Display Recompiler Code Buffer Size" );
if (g_Settings->LoadBool(Debugger_ShowRecompMemSize)) {
Item.ItemTicked = true;
Item.Reset(ID_DEBUG_SHOW_RECOMP_MEM_SIZE,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Display Recompiler Code Buffer Size" );
if (g_Settings->LoadBool(Debugger_ShowRecompMemSize))
{
Item.SetItemTicked(true);
}
DebugMenu.push_back(Item);
DebugMenu.push_back(MENU_ITEM(SPLITER));
Item.Reset(ID_DEBUG_GENERATE_LOG_FILES,EMPTY_STRING,EMPTY_STDSTR,NULL,"Generate Log Files" );
if (g_Settings->LoadBool(Debugger_GenerateLogFiles)) {
Item.ItemTicked = true;
Item.Reset(ID_DEBUG_GENERATE_LOG_FILES,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Generate Log Files" );
if (g_Settings->LoadBool(Debugger_GenerateLogFiles))
{
Item.SetItemTicked(true);
}
DebugMenu.push_back(Item);
}
@ -1101,7 +1133,8 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
HelpMenu.push_back(MENU_ITEM(ID_HELP_SUPPORTFORUM, MENU_FORUM ));
HelpMenu.push_back(MENU_ITEM(ID_HELP_HOMEPAGE, MENU_HOMEPAGE ));
HelpMenu.push_back(MENU_ITEM(SPLITER ));
if (!inBasicMode) {
if (!inBasicMode)
{
HelpMenu.push_back(MENU_ITEM(ID_HELP_ABOUTSETTINGFILES, MENU_ABOUT_INI ));
}
HelpMenu.push_back(MENU_ITEM(ID_HELP_ABOUT, MENU_ABOUT_PJ64 ));
@ -1110,31 +1143,35 @@ void CMainMenu::FillOutMenu ( HMENU hMenu ) {
***********************/
MenuItemList MainTitleMenu;
Item.Reset(SUB_MENU, MENU_FILE, EMPTY_STDSTR, &FileMenu);
if (RomLoading) { Item.ItemEnabled = false; }
if (RomLoading) { Item.SetItemEnabled(false); }
MainTitleMenu.push_back(Item);
if (CPURunning) {
if (CPURunning)
{
Item.Reset(SUB_MENU, MENU_SYSTEM, EMPTY_STDSTR, &SystemMenu);
if (RomLoading) { Item.ItemEnabled = false; }
if (RomLoading) { Item.SetItemEnabled(false); }
MainTitleMenu.push_back(Item);
}
Item.Reset(SUB_MENU, MENU_OPTIONS, EMPTY_STDSTR, &OptionMenu);
if (RomLoading) { Item.ItemEnabled = false; }
if (RomLoading) { Item.SetItemEnabled(false); }
MainTitleMenu.push_back(Item);
if (!inBasicMode) {
if (bHaveDebugger()) {
if (!inBasicMode)
{
if (bHaveDebugger())
{
Item.Reset(SUB_MENU, MENU_DEBUGGER, EMPTY_STDSTR, &DebugMenu);
if (RomLoading) { Item.ItemEnabled = false; }
if (RomLoading) { Item.SetItemEnabled(false); }
MainTitleMenu.push_back(Item);
}
}
Item.Reset(SUB_MENU, MENU_HELP, EMPTY_STDSTR, &HelpMenu);
if (RomLoading) { Item.ItemEnabled = false; }
if (RomLoading) { Item.SetItemEnabled(false); }
MainTitleMenu.push_back(Item);
AddMenu(hMenu,MainTitleMenu);
}
void CMainMenu::RebuildAccelerators(void) {
void CMainMenu::RebuildAccelerators(void)
{
CGuard Guard(m_CS);
//Delete the old accel list

View File

@ -66,9 +66,9 @@ class CMainMenu :
void FillOutMenu ( HMENU hMenu );
//stdstr ShortCutString(MSC_MAP & ShortCuts, int MenuID, CMenuShortCutKey::ACCESS_MODE AccessLevel);
stdstr GetSaveSlotString ( int Slot );
std::wstring GetSaveSlotString ( int Slot );
stdstr GetFileLastMod ( stdstr FileName );
void RebuildAccelerators ( void );
void RebuildAccelerators ( void );
static void SettingsChanged (CMainMenu * _this );
public:

View File

@ -9,30 +9,37 @@ bool CBaseMenu::AddMenu(HMENU hMenu, MenuItemList Items ) {
if (Items.begin() == Items.end()) { return false; }
UINT ItemID, uFlags;
stdstr Text;
stdstr String;
for (MenuItemList::iterator MenuItem = Items.begin(); MenuItem != Items.end(); MenuItem++) {
ItemID = MenuItem->ID;
std::wstring Text, String;
for (MenuItemList::iterator MenuItem = Items.begin(); MenuItem != Items.end(); MenuItem++)
{
ItemID = MenuItem->ID();
uFlags = MF_STRING;
Text = _Lang->GetString(MenuItem->Title).c_str();
Text = g_Lang->GetString(MenuItem->Title()).c_str();
if (MenuItem->Title == EMPTY_STRING && MenuItem->ManualString.length() > 0) {
Text = MenuItem->ManualString;
if (MenuItem->Title() == EMPTY_STRING && MenuItem->ManualString().length() > 0)
{
Text = MenuItem->ManualString();
}
if (ItemID == SPLITER) {
if (ItemID == SPLITER)
{
uFlags |= MF_SEPARATOR;
}
if (MenuItem->ItemTicked) {
if (MenuItem->ItemTicked())
{
uFlags |= MFS_CHECKED;
}
if (MenuItem->ItemEnabled) {
if (MenuItem->ItemEnabled())
{
uFlags |= MFS_ENABLED;
} else {
}
else
{
uFlags |= MFS_DISABLED;
}
MenuItemList * SubMenu = (MenuItemList *)MenuItem->SubMenu;
if (ItemID == SUB_MENU && HIWORD(SubMenu) != 0 && (SubMenu->begin() != SubMenu->end())) {
MenuItemList * SubMenu = (MenuItemList *)MenuItem->SubMenu();
if (ItemID == SUB_MENU && HIWORD(SubMenu) != 0 && (SubMenu->begin() != SubMenu->end()))
{
ItemID = (UINT)CreatePopupMenu();
uFlags |= MF_POPUP;
@ -41,37 +48,25 @@ bool CBaseMenu::AddMenu(HMENU hMenu, MenuItemList Items ) {
if (ItemID == ID_PLUGIN_MENU)
{
ItemID = (UINT)MenuItem->SubMenu;
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);
SetMenuItemInfo((HMENU)ItemID, (DWORD)MenuItem->SubMenu(), FALSE,&lpmii);
}
if (MenuItem->ShotCut.empty() == false) {
if (MenuItem->ShotCut().empty() == false)
{
String = Text;
String += "\t";
String += MenuItem->ShotCut;
String += L"\t";
String += MenuItem->ShotCut();
Text = String;
}
AppendMenu((HMENU)hMenu,uFlags,ItemID,Text.c_str());
}
AppendMenuW(hMenu,uFlags,ItemID,Text.c_str());
}
return true;
}
/*void MENU_SHORT_CUT::RemoveItem ( MENU_SHORT_CUT_KEY * ShortCut )
{
for (SHORTCUT_KEY_LIST::iterator item = m_AccelList.begin(); item != m_AccelList.end(); item++) {
if (ShortCut == &*item) {
m_AccelList.erase(item);
return;
}
}
}*/

View File

@ -12,41 +12,58 @@
#include <list>
enum Menu_ID {
enum Menu_ID
{
//ControlID
SPLITER, SUB_MENU, NO_ID, ID_PLUGIN_MENU,
};
const stdstr EMPTY_STDSTR = "";
const std::wstring EMPTY_STDSTR = L"";
class MENU_ITEM {
class MENU_ITEM
{
public:
MENU_ITEM (void) {
MENU_ITEM (void)
{
Reset(NO_ID);
}
MENU_ITEM ( int ID, LanguageStringID Title = EMPTY_STRING, const stdstr & ShotCut = EMPTY_STDSTR,
void * SubMenu = NULL, const stdstr & ManualString = EMPTY_STDSTR)
MENU_ITEM ( int ID, LanguageStringID Title = EMPTY_STRING, const std::wstring & ShotCut = EMPTY_STDSTR,
void * SubMenu = NULL, const std::wstring & ManualString = EMPTY_STDSTR)
{
Reset(ID,Title,ShotCut,SubMenu,ManualString);
}
void Reset ( int ID, LanguageStringID Title = EMPTY_STRING, const stdstr & ShotCut2 = EMPTY_STDSTR,
void * SubMenu = NULL, const stdstr & ManualString = EMPTY_STDSTR)
void Reset ( int ID, LanguageStringID Title = EMPTY_STRING, const std::wstring & ShotCut2 = EMPTY_STDSTR,
void * SubMenu = NULL, const std::wstring & ManualString = EMPTY_STDSTR)
{
this->ID = ID;
this->Title = Title;
this->ShotCut = ShotCut2;
this->SubMenu = SubMenu;
this->ManualString = ManualString;
this->ItemTicked = false;
this->ItemEnabled = true;
this->m_ID = ID;
this->m_Title = Title;
this->m_ShotCut = ShotCut2;
this->m_SubMenu = SubMenu;
this->m_ManualString = ManualString;
this->m_ItemTicked = false;
this->m_ItemEnabled = true;
}
int ID;
LanguageStringID Title;
stdstr ShotCut;
void * SubMenu;
stdstr ManualString;
bool ItemTicked;
bool ItemEnabled;
int ID() const { return m_ID; }
LanguageStringID Title() const { return m_Title; }
const std::wstring & ShotCut() const { return m_ShotCut; }
void * SubMenu() const { return m_SubMenu; }
const std::wstring & ManualString() const { return m_ManualString; }
bool ItemTicked() const { return m_ItemTicked; }
bool ItemEnabled() const { return m_ItemEnabled; }
void SetItemTicked(bool ItemTicked) { m_ItemTicked = ItemTicked; }
void SetItemEnabled(bool ItemEnabled) { m_ItemEnabled = ItemEnabled; }
private:
int m_ID;
LanguageStringID m_Title;
std::wstring m_ShotCut;
void * m_SubMenu;
std::wstring m_ManualString;
bool m_ItemTicked;
bool m_ItemEnabled;
};
typedef std::list<MENU_ITEM> MenuItemList;

View File

@ -249,12 +249,12 @@ CShortCuts::~CShortCuts()
{
}
stdstr CShortCuts::ShortCutString( int MenuID, CMenuShortCutKey::ACCESS_MODE AccessLevel )
std::wstring CShortCuts::ShortCutString( int MenuID, CMenuShortCutKey::ACCESS_MODE AccessLevel )
{
CGuard CS(m_CS);
MSC_MAP::iterator MenuItem = m_ShortCuts.find(MenuID);
if (MenuItem == m_ShortCuts.end()) { return ""; }
if (MenuItem == m_ShortCuts.end()) { return L""; }
const SHORTCUT_KEY_LIST & ShortCutList = MenuItem->second.GetAccelItems();
for (SHORTCUT_KEY_LIST::const_iterator item = ShortCutList.begin(); item != ShortCutList.end(); item++)
@ -268,9 +268,9 @@ stdstr CShortCuts::ShortCutString( int MenuID, CMenuShortCutKey::ACCESS_MODE Acc
{
continue;
}
return item->Name();
return item->Name().ToUTF16();
}
return "";
return L"";
}
LanguageStringID CShortCuts::GetMenuItemName( WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE Access )

View File

@ -101,10 +101,10 @@ public:
CShortCuts ( void );
~CShortCuts ( void );
stdstr ShortCutString ( int MenuID, ACCESS_MODE AccessLevel );
LangStr GetMenuItemName ( WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE Access );
HACCEL GetAcceleratorTable ( void );
MSC_MAP &GetShortCuts ( void ) { return m_ShortCuts; }
std::wstring ShortCutString ( int MenuID, ACCESS_MODE AccessLevel );
LangStr GetMenuItemName ( WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE Access );
HACCEL GetAcceleratorTable ( void );
MSC_MAP & GetShortCuts ( void ) { return m_ShortCuts; }
void Load ( bool InitialValues = false );
void Save ( void );

View File

@ -43,35 +43,42 @@ void CNotification::WindowMode ( void ) const
InsideFunc = false;
}
void CNotification::DisplayError ( const char * Message, ... ) const {
void CNotification::DisplayError ( const wchar_t * Message, ... ) const
{
va_list ap;
va_start( ap, Message );
DisplayError (Message,ap);
}
void CNotification::DisplayError ( const char * Message, va_list ap ) const {
void CNotification::DisplayError ( const wchar_t * Message, va_list ap ) const
{
if (this == NULL) { return; }
char Msg[1000];
wchar_t Msg[1000];
_vsnprintf( Msg,sizeof(Msg) - 1,Message, ap );
_vsnwprintf( Msg,sizeof(Msg) - 1,Message, ap );
va_end( ap );
WriteTrace(TraceError,Msg);
stdstr TraceMessage;
TraceMessage.FromUTF16(Msg);
WriteTrace(TraceError,TraceMessage.c_str());
WindowMode();
HWND Parent = NULL;
if (m_hWnd) { Parent = reinterpret_cast<HWND>(m_hWnd->GetHandle()); }
MessageBox(Parent,Msg,GS(MSG_MSGBOX_TITLE),MB_OK|MB_ICONERROR|MB_SETFOREGROUND);
if (m_hWnd)
{
Parent = m_hWnd->GetHandle();
}
MessageBoxW(Parent,Msg,GS(MSG_MSGBOX_TITLE),MB_OK|MB_ICONERROR|MB_SETFOREGROUND);
}
void CNotification::DisplayMessage ( int DisplayTime, const char * Message, ... ) const
void CNotification::DisplayMessage ( int DisplayTime, const wchar_t * Message, ... ) const
{
va_list ap;
va_start( ap, Message );
DisplayMessage (DisplayTime, Message,ap);
}
void CNotification::DisplayMessage ( int DisplayTime, const char * Message, va_list ap ) const
void CNotification::DisplayMessage ( int DisplayTime, const wchar_t * Message, va_list ap ) const
{
if (!m_hWnd) { return; }
@ -92,39 +99,48 @@ void CNotification::DisplayMessage ( int DisplayTime, const char * Message, va_
}
}
char Msg[1000];
wchar_t Msg[1000];
_vsnprintf( Msg,sizeof(Msg) - 1,Message, ap );
_vsnwprintf( Msg,sizeof(Msg) - 1,Message, ap );
va_end( ap );
stdstr PluginMessage;
PluginMessage.FromUTF16(Msg);
if (InFullScreen())
{
if (m_gfxPlugin && m_gfxPlugin->DrawStatus)
{
WriteTrace(TraceGfxPlugin,__FUNCTION__ ": DrawStatus - Starting");
m_gfxPlugin->DrawStatus(Msg,FALSE);
m_gfxPlugin->DrawStatus(PluginMessage.c_str(),FALSE);
WriteTrace(TraceGfxPlugin,__FUNCTION__ ": DrawStatus - Done");
}
} else {
m_hWnd->SetStatusText(0,Msg);
}
else
{
m_hWnd->SetStatusText(0,PluginMessage.c_str());
}
}
void CNotification::DisplayMessage2 ( const char * Message, ... ) const {
void CNotification::DisplayMessage2 ( const wchar_t * Message, ... ) const
{
va_list ap;
va_start( ap, Message );
DisplayMessage2 (Message,ap);
}
void CNotification::DisplayMessage2 ( const char * Message, va_list ap ) const {
void CNotification::DisplayMessage2 ( const wchar_t * Message, va_list ap ) const
{
if (!m_hWnd) { return; }
char Msg[1000];
_vsnprintf( Msg,sizeof(Msg) - 1 ,Message, ap );
wchar_t Msg[1000];
_vsnwprintf( Msg,sizeof(Msg) - 1 ,Message, ap );
va_end( ap );
m_hWnd->SetStatusText(1,Msg);
stdstr DisplayMessage;
DisplayMessage.FromUTF16(Msg);
m_hWnd->SetStatusText(1,DisplayMessage.c_str());
}
void CNotification::SetGfxPlugin( CGfxPlugin * Plugin )
@ -132,29 +148,32 @@ void CNotification::SetGfxPlugin( CGfxPlugin * Plugin )
m_gfxPlugin = Plugin;
}
void CNotification::SetWindowCaption (const char * Caption) {
char WinTitle[256];
_snprintf( WinTitle, sizeof(WinTitle), "%s - %s", Caption, g_Settings->LoadString(Setting_ApplicationName).c_str());
void CNotification::SetWindowCaption (const wchar_t * Caption)
{
wchar_t WinTitle[256];
_snwprintf( WinTitle, sizeof(WinTitle), L"%s - %s", Caption, g_Settings->LoadString(Setting_ApplicationName).c_str());
WinTitle[sizeof(WinTitle) - 1] = 0;
m_hWnd->Caption(WinTitle);
}
void CNotification::FatalError ( const char * Message, ... ) const {
char Msg[1000];
void CNotification::FatalError ( const wchar_t * Message, ... ) const
{
wchar_t Msg[1000];
va_list ap;
WindowMode();
va_start( ap, Message );
_vsnprintf( Msg,sizeof(Msg) - 1,Message, ap );
_vsnwprintf( Msg,(sizeof(Msg) / sizeof(Msg[0])) - 1, Message, ap );
va_end( ap );
HWND Parent = NULL;
if (m_hWnd) { Parent = reinterpret_cast<HWND>(m_hWnd->GetHandle()); }
MessageBox(Parent,Msg,"Error",MB_OK|MB_ICONERROR|MB_SETFOREGROUND);
MessageBoxW(Parent,Msg,L"Error",MB_OK|MB_ICONERROR|MB_SETFOREGROUND);
ExitThread(0);
}
void CNotification::AddRecentDir ( const char * RomDir ) {
void CNotification::AddRecentDir ( const char * RomDir )
{
//Validate the passed string
if (HIWORD(RomDir) == NULL) { return; }
@ -195,7 +214,8 @@ void CNotification::AddRecentDir ( const char * RomDir ) {
}
}
void CNotification::AddRecentRom ( const char * ImagePath ) {
void CNotification::AddRecentRom ( const char * ImagePath )
{
if (HIWORD(ImagePath) == NULL) { return; }
//Get Information about the stored rom list
@ -235,31 +255,37 @@ void CNotification::AddRecentRom ( const char * ImagePath ) {
}
}
void CNotification::RefreshMenu ( void ) {
void CNotification::RefreshMenu ( void )
{
if (m_hWnd == NULL) { return; }
m_hWnd->RefreshMenu();
}
void CNotification::HideRomBrowser ( void ) {
void CNotification::HideRomBrowser ( void )
{
if (m_hWnd == NULL) { return; }
m_hWnd->HideRomList();
}
void CNotification::ShowRomBrowser ( void ) {
void CNotification::ShowRomBrowser ( void )
{
if (m_hWnd == NULL) { return; }
if (g_Settings->LoadDword(RomBrowser_Enabled)) {
if (g_Settings->LoadDword(RomBrowser_Enabled))
{
//Display the rom browser
m_hWnd->ShowRomList();
m_hWnd->HighLightLastRom();
}
}
void CNotification::BringToTop ( void ) {
void CNotification::BringToTop ( void )
{
if (m_hWnd == NULL) { return; }
m_hWnd->BringToTop();
}
void CNotification::MakeWindowOnTop ( bool OnTop ) {
void CNotification::MakeWindowOnTop ( bool OnTop )
{
if (m_hWnd == NULL) { return; }
m_hWnd->MakeWindowOnTop(OnTop);
}
@ -280,15 +306,19 @@ void CNotification::BreakPoint ( const char * File, const int LineNumber )
{
if (g_Settings->LoadBool(Debugger_Enabled))
{
DisplayError("Break point found at\n%s\n%d",File, LineNumber);
DisplayError(L"Break point found at\n%s\n%d",File, LineNumber);
if (IsDebuggerPresent() != 0)
{
DebugBreak();
} else {
}
else
{
g_BaseSystem->CloseCpu();
}
} else {
DisplayError("Fatal Error: Stopping emulation");
}
else
{
DisplayError(L"Fatal Error: Stopping emulation");
g_BaseSystem->CloseCpu();
}
}

View File

@ -24,24 +24,24 @@ public:
void WindowMode ( void ) const;
//Error Messages
void DisplayError ( const char * Message, ... ) const;
void DisplayError ( const char * Message, va_list ap ) const;
void DisplayError ( LanguageStringID StringID ) const { stdstr str = _Lang->GetString(StringID); DisplayError(str.c_str()); }
void FatalError ( const char * Message, ... ) const;
void FatalError ( const char * Message, va_list ap ) const;
void FatalError ( LanguageStringID StringID ) const { stdstr str = _Lang->GetString(StringID); FatalError(str.c_str()); }
void DisplayError ( const wchar_t * Message, ... ) const;
void DisplayError ( const wchar_t * Message, va_list ap ) const;
void DisplayError ( LanguageStringID StringID ) const { std::wstring str = g_Lang->GetString(StringID); DisplayError(str.c_str()); }
void FatalError ( const wchar_t * Message, ... ) const;
void FatalError ( const wchar_t * Message, va_list ap ) const;
void FatalError ( LanguageStringID StringID ) const { std::wstring str = g_Lang->GetString(StringID); FatalError(str.c_str()); }
//User Feedback
void DisplayMessage ( int DisplayTime, const char * Message, ... ) const;
void DisplayMessage ( int DisplayTime, const char * Message, va_list ap ) const;
void DisplayMessage ( int DisplayTime, const wchar_t * Message, ... ) const;
void DisplayMessage ( int DisplayTime, const wchar_t * Message, va_list ap ) const;
void DisplayMessage ( int DisplayTime, LanguageStringID StringID ) const
{
stdstr str = _Lang->GetString(StringID);
DisplayMessage(DisplayTime,"%s",str.c_str());
std::wstring str = g_Lang->GetString(StringID);
DisplayMessage(DisplayTime,L"%s",str.c_str());
}
void DisplayMessage2 ( const char * Message, ... ) const;
void DisplayMessage2 ( const char * Message, va_list ap ) const;
void SetWindowCaption ( const char * Caption );
void DisplayMessage2 ( const wchar_t * Message, ... ) const;
void DisplayMessage2 ( const wchar_t * Message, va_list ap ) const;
void SetWindowCaption ( const wchar_t * Caption );
//Remember roms loaded and Rom Dir selected
void AddRecentDir ( const char * RomDir );
@ -66,7 +66,7 @@ private:
CMainGui * m_hWnd;
CGfxPlugin * m_gfxPlugin;
mutable time_t m_NextMsg;
mutable time_t m_NextMsg;
};
CNotification & Notify ( void );

View File

@ -385,8 +385,12 @@ void CRomBrowser::DeallocateBrushs (void) {
}
}
void CRomBrowser::FillRomExtensionInfo(ROM_INFO * pRomInfo) {
//Initialize the structure
void CRomBrowser::FillRomExtensionInfo(ROM_INFO * pRomInfo)
{
stdstr NoGoodName;
NoGoodName.FromUTF16(GS(RB_NOT_GOOD_FILE));
//Initialize the structure
pRomInfo->UserNotes[0] = 0;
pRomInfo->Developer[0] = 0;
pRomInfo->ReleaseDate[0] = 0;
@ -394,7 +398,7 @@ void CRomBrowser::FillRomExtensionInfo(ROM_INFO * pRomInfo) {
pRomInfo->Players = 1;
pRomInfo->CoreNotes[0] = 0;
pRomInfo->PluginNotes[0] = 0;
strcpy(pRomInfo->GoodName,GS(RB_NOT_GOOD_FILE));
strcpy(pRomInfo->GoodName,NoGoodName.c_str());
strcpy(pRomInfo->Status,"Unknown");
//Get File Identifier
@ -546,7 +550,7 @@ bool CRomBrowser::GetRomFileNames( strlist & FileList, const CPath & BaseDirecto
void CRomBrowser::NotificationCB ( LPCSTR Status, CRomBrowser * /*_this*/ )
{
g_Notify->DisplayMessage(5,"%s",Status);
g_Notify->DisplayMessage(5,L"%s",Status);
}
@ -958,11 +962,12 @@ void CRomBrowser::LoadRomList (void) {
RomList_SortList();
}
void CRomBrowser::MenuSetText ( HMENU hMenu, int MenuPos, const char * Title, char * ShotCut) {
MENUITEMINFO MenuInfo;
char String[256];
void CRomBrowser::MenuSetText ( HMENU hMenu, int MenuPos, const wchar_t * Title, char * ShotCut)
{
MENUITEMINFOW MenuInfo;
wchar_t String[256];
if (Title == NULL || strlen(Title) == 0) { return; }
if (Title == NULL || wcslen(Title) == 0) { return; }
memset(&MenuInfo, 0, sizeof(MENUITEMINFO));
MenuInfo.cbSize = sizeof(MENUITEMINFO);
@ -972,14 +977,15 @@ void CRomBrowser::MenuSetText ( HMENU hMenu, int MenuPos, const char * Title, ch
MenuInfo.dwTypeData = String;
MenuInfo.cch = 256;
GetMenuItemInfo((HMENU)hMenu,MenuPos,TRUE,&MenuInfo);
strcpy(String,Title);
if (strchr(String,'\t') != NULL) { *(strchr(String,'\t')) = '\0'; }
if (ShotCut) { sprintf(String,"%s\t%s",String,ShotCut); }
SetMenuItemInfo((HMENU)hMenu,MenuPos,TRUE,&MenuInfo);
GetMenuItemInfoW(hMenu,MenuPos,TRUE,&MenuInfo);
wcscpy(String,Title);
if (wcschr(String,'\t') != NULL) { *(wcschr(String,'\t')) = '\0'; }
if (ShotCut) { swprintf(String,sizeof(String) / sizeof(String[0]),L"%s\t%s",String,ShotCut); }
SetMenuItemInfoW(hMenu,MenuPos,TRUE,&MenuInfo);
}
void CRomBrowser::RefreshRomBrowser (void) {
void CRomBrowser::RefreshRomBrowser (void)
{
DWORD ThreadID;
if (m_RefreshThread)
@ -1041,10 +1047,8 @@ void CRomBrowser::RefreshRomBrowserStatic (CRomBrowser * _this)
}
}
void CRomBrowser::ResetRomBrowserColomuns (void) {
void CRomBrowser::ResetRomBrowserColomuns (void)
{
size_t Coloumn, index;
LV_COLUMN lvColumn;
char szString[300];
@ -1054,7 +1058,8 @@ void CRomBrowser::ResetRomBrowserColomuns (void) {
//Remove all current coloumns
memset(&lvColumn,0,sizeof(lvColumn));
lvColumn.mask = LVCF_FMT;
while (ListView_GetColumn((HWND)m_hRomList,0,&lvColumn)) {
while (ListView_GetColumn((HWND)m_hRomList,0,&lvColumn))
{
ListView_DeleteColumn((HWND)m_hRomList,0);
}
@ -1063,22 +1068,29 @@ void CRomBrowser::ResetRomBrowserColomuns (void) {
lvColumn.fmt = LVCFMT_LEFT;
lvColumn.pszText = szString;
for (Coloumn = 0; Coloumn < m_Fields.size(); Coloumn ++) {
for (index = 0; index < m_Fields.size(); index ++) {
for (Coloumn = 0; Coloumn < m_Fields.size(); Coloumn ++)
{
for (index = 0; index < m_Fields.size(); index ++)
{
if (m_Fields[index].Pos() == Coloumn) { break; }
}
if (index == m_Fields.size() || m_Fields[index].Pos() != Coloumn) {
if (index == m_Fields.size() || m_Fields[index].Pos() != Coloumn)
{
m_FieldType[Coloumn] = -1;
break;
}
stdstr title;
title.FromUTF16(GS(m_Fields[index].LangID()));
m_FieldType[Coloumn] = m_Fields[index].ID();
lvColumn.cx = m_Fields[index].ColWidth();
strncpy(szString, GS(m_Fields[index].LangID()), sizeof(szString));
ListView_InsertColumn((HWND)m_hRomList, Coloumn, &lvColumn);
strncpy(szString, title.c_str(), sizeof(szString));
ListView_InsertColumn(m_hRomList, Coloumn, &lvColumn);
}
}
void CRomBrowser::ResizeRomList (WORD nWidth, WORD nHeight) {
void CRomBrowser::ResizeRomList (WORD nWidth, WORD nHeight)
{
if (RomBrowserVisible())
{
if (g_Settings->LoadDword(RomBrowser_Maximized) == 0 && nHeight != 0)
@ -1092,7 +1104,8 @@ void CRomBrowser::ResizeRomList (WORD nWidth, WORD nHeight) {
g_Settings->SaveDword(RomBrowser_Height,nHeight);
}
}
if (IsWindow((HWND)m_StatusWindow)) {
if (IsWindow((HWND)m_StatusWindow))
{
RECT rc;
GetWindowRect((HWND)m_StatusWindow, &rc);
@ -1102,23 +1115,27 @@ void CRomBrowser::ResizeRomList (WORD nWidth, WORD nHeight) {
}
}
bool CRomBrowser::RomBrowserVisible (void) {
bool CRomBrowser::RomBrowserVisible (void)
{
if (!IsWindow((HWND)m_hRomList)) { return false; }
if (!IsWindowVisible((HWND)m_hRomList)) { return false; }
if (!m_Visible) { return false; }
return true;
}
void CRomBrowser::RomBrowserToTop(void) {
void CRomBrowser::RomBrowserToTop(void)
{
BringWindowToTop((HWND)m_hRomList);
SetFocus((HWND)m_hRomList);
}
void CRomBrowser::RomBrowserMaximize(bool Mazimize) {
void CRomBrowser::RomBrowserMaximize(bool Mazimize)
{
g_Settings->SaveDword(RomBrowser_Maximized,(DWORD)Mazimize);
}
bool CRomBrowser::RomListDrawItem(int idCtrl, DWORD lParam) {
bool CRomBrowser::RomListDrawItem(int idCtrl, DWORD lParam)
{
if (idCtrl != IDC_ROMLIST) { return false; }
LPDRAWITEMSTRUCT ditem = (LPDRAWITEMSTRUCT)lParam;
@ -1145,10 +1162,13 @@ bool CRomBrowser::RomListDrawItem(int idCtrl, DWORD lParam) {
{
return true;
}
if (bSelected) {
if (bSelected)
{
hBrush = (HBRUSH)pRomInfo->SelColorBrush;
SetTextColor(ditem->hDC,pRomInfo->SelTextColor);
} else {
}
else
{
hBrush = (HBRUSH)(COLOR_WINDOW + 1);
SetTextColor(ditem->hDC,pRomInfo->TextColor);
}
@ -1164,7 +1184,8 @@ bool CRomBrowser::RomListDrawItem(int idCtrl, DWORD lParam) {
memset(&lvc,0,sizeof(lvc));
lvc.mask = LVCF_FMT | LVCF_WIDTH;
for(nColumn = 1; ListView_GetColumn((HWND)m_hRomList,nColumn,&lvc); nColumn += 1) {
for(nColumn = 1; ListView_GetColumn((HWND)m_hRomList,nColumn,&lvc); nColumn += 1)
{
rcItem.left = rcItem.right;
rcItem.right += lvc.cx;
@ -1176,13 +1197,13 @@ bool CRomBrowser::RomListDrawItem(int idCtrl, DWORD lParam) {
return true;
}
bool CRomBrowser::RomListNotify(int idCtrl, DWORD pnmh) {
bool CRomBrowser::RomListNotify(int idCtrl, DWORD pnmh)
{
if (idCtrl != IDC_ROMLIST) { return false; }
if (!RomBrowserVisible()) { return false; }
// ListView_SetItemState((HWND)m_hRomList,index,LVIS_SELECTED | LVIS_FOCUSED,LVIS_SELECTED | LVIS_FOCUSED);
switch (((LPNMHDR)pnmh)->code) {
switch (((LPNMHDR)pnmh)->code)
{
case LVN_COLUMNCLICK: RomList_ColoumnSortList(pnmh); break;
case NM_RETURN: RomList_OpenRom(pnmh); break;
case NM_DBLCLK: RomList_OpenRom(pnmh); break;
@ -1203,20 +1224,26 @@ bool CRomBrowser::RomListNotify(int idCtrl, DWORD pnmh) {
return true;
}
void CRomBrowser::RomList_ColoumnSortList(DWORD pnmh) {
void CRomBrowser::RomList_ColoumnSortList(DWORD pnmh)
{
LPNMLISTVIEW pnmv = (LPNMLISTVIEW)pnmh;
size_t index;
for (index = 0; index < m_Fields.size(); index++) {
for (index = 0; index < m_Fields.size(); index++)
{
if (m_Fields[index].Pos() == (size_t)pnmv->iSubItem) { break; }
}
if (m_Fields.size() == index) { return; }
if (_stricmp(g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex,0).c_str(),m_Fields[index].Name()) == 0) {
if (_stricmp(g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex,0).c_str(),m_Fields[index].Name()) == 0)
{
g_Settings->SaveBoolIndex(RomBrowser_SortAscendingIndex,0,!g_Settings->LoadBoolIndex(RomBrowser_SortAscendingIndex,0));
} else {
}
else
{
int count;
for (count = NoOfSortKeys; count > 0; count --) {
for (count = NoOfSortKeys; count > 0; count --)
{
g_Settings->SaveStringIndex(RomBrowser_SortFieldIndex,count,g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex,count - 1).c_str());
g_Settings->SaveBoolIndex(RomBrowser_SortAscendingIndex,count,g_Settings->LoadBoolIndex(RomBrowser_SortAscendingIndex, count - 1));
}
@ -1226,7 +1253,8 @@ void CRomBrowser::RomList_ColoumnSortList(DWORD pnmh) {
RomList_SortList();
}
int CALLBACK CRomBrowser::RomList_CompareItems(DWORD lParam1, DWORD lParam2, DWORD lParamSort) {
int CALLBACK CRomBrowser::RomList_CompareItems(DWORD lParam1, DWORD lParam2, DWORD lParamSort)
{
SORT_FIELD * SortFieldInfo = (SORT_FIELD *)lParamSort;
CRomBrowser * _this = SortFieldInfo->_this;
if (lParam1 < 0 || lParam1 >= _this->m_RomInfo.size())
@ -1241,7 +1269,8 @@ int CALLBACK CRomBrowser::RomList_CompareItems(DWORD lParam1, DWORD lParam2, DWO
ROM_INFO * pRomInfo2 = &_this->m_RomInfo[SortFieldInfo->KeyAscend?lParam2:lParam1];
int result;
switch (SortFieldInfo->Key) {
switch (SortFieldInfo->Key)
{
case RB_FileName: result = (int)lstrcmpi(pRomInfo1->FileName, pRomInfo2->FileName); break;
case RB_InternalName: result = (int)lstrcmpi(pRomInfo1->InternalName, pRomInfo2->InternalName); break;
case RB_GoodName: result = (int)lstrcmpi(pRomInfo1->GoodName, pRomInfo2->GoodName); break;
@ -1267,7 +1296,8 @@ int CALLBACK CRomBrowser::RomList_CompareItems(DWORD lParam1, DWORD lParam2, DWO
return result;
}
void CRomBrowser::RomList_GetDispInfo(DWORD pnmh) {
void CRomBrowser::RomList_GetDispInfo(DWORD pnmh)
{
LV_DISPINFO * lpdi = (LV_DISPINFO *)pnmh;
if (lpdi->item.lParam < 0 || lpdi->item.lParam >= (LPARAM)m_RomInfo.size())
{
@ -1292,14 +1322,16 @@ void CRomBrowser::RomList_GetDispInfo(DWORD pnmh) {
case RB_RomSize: sprintf(lpdi->item.pszText,"%.1f MBit",(float)pRomInfo->RomSize/0x20000); break;
case RB_CartridgeID: strncpy(lpdi->item.pszText, pRomInfo->CartID, lpdi->item.cchTextMax); break;
case RB_Manufacturer:
switch (pRomInfo->Manufacturer) {
switch (pRomInfo->Manufacturer)
{
case 'N':strncpy(lpdi->item.pszText, "Nintendo", lpdi->item.cchTextMax); break;
case 0: strncpy(lpdi->item.pszText, "None", lpdi->item.cchTextMax); break;
default: sprintf(lpdi->item.pszText, "(Unknown %c (%X))", pRomInfo->Manufacturer,pRomInfo->Manufacturer); break;
}
break;
case RB_Country:
switch (pRomInfo->Country) {
switch (pRomInfo->Country)
{
case '7': strncpy(lpdi->item.pszText, "Beta", lpdi->item.cchTextMax); break;
case 'A': strncpy(lpdi->item.pszText, "NTSC", lpdi->item.cchTextMax); break;
case 'D': strncpy(lpdi->item.pszText, "Germany", lpdi->item.cchTextMax); break;
@ -1319,9 +1351,12 @@ void CRomBrowser::RomList_GetDispInfo(DWORD pnmh) {
case RB_Crc1: sprintf(lpdi->item.pszText,"0x%08X",pRomInfo->CRC1); break;
case RB_Crc2: sprintf(lpdi->item.pszText,"0x%08X",pRomInfo->CRC2); break;
case RB_CICChip:
if (pRomInfo->CicChip < 0) {
if (pRomInfo->CicChip < 0)
{
sprintf(lpdi->item.pszText,"Unknown CIC Chip");
} else {
}
else
{
sprintf(lpdi->item.pszText,"CIC-NUS-610%d",pRomInfo->CicChip);
}
break;
@ -1332,7 +1367,8 @@ void CRomBrowser::RomList_GetDispInfo(DWORD pnmh) {
case RB_Players: sprintf(lpdi->item.pszText,"%d",pRomInfo->Players); break;
case RB_ForceFeedback: strncpy(lpdi->item.pszText, pRomInfo->ForceFeedback, lpdi->item.cchTextMax); break;
case RB_FileFormat:
switch (pRomInfo->FileFormat) {
switch (pRomInfo->FileFormat)
{
case Format_Uncompressed: strncpy(lpdi->item.pszText, "Uncompressed", lpdi->item.cchTextMax); break;
case Format_Zip: strncpy(lpdi->item.pszText, "Zip", lpdi->item.cchTextMax); break;
case Format_7zip: strncpy(lpdi->item.pszText, "7zip", lpdi->item.cchTextMax); break;
@ -1344,7 +1380,8 @@ void CRomBrowser::RomList_GetDispInfo(DWORD pnmh) {
if (lpdi->item.pszText == NULL || strlen(lpdi->item.pszText) == 0) { strcpy(lpdi->item.pszText, " "); }
}
void CRomBrowser::RomList_OpenRom(DWORD /*pnmh*/) {
void CRomBrowser::RomList_OpenRom(DWORD /*pnmh*/)
{
ROM_INFO * pRomInfo;
LV_ITEM lvItem;
LONG iItem;
@ -1371,7 +1408,8 @@ void CRomBrowser::RomList_PopupMenu(DWORD /*pnmh*/)
{
LONG iItem = ListView_GetNextItem((HWND)m_hRomList, -1, LVNI_SELECTED);
m_SelectedRom = "";
if (iItem != -1) {
if (iItem != -1)
{
LV_ITEM lvItem;
memset(&lvItem, 0, sizeof(LV_ITEM));
lvItem.mask = LVIF_PARAM;
@ -1400,33 +1438,36 @@ void CRomBrowser::RomList_PopupMenu(DWORD /*pnmh*/)
MenuSetText(hPopupMenu, 8, GS(POPUP_SETTINGS), NULL);
MenuSetText(hPopupMenu, 9, GS(POPUP_CHEATS), NULL);
if (m_SelectedRom.size() == 0) {
DeleteMenu((HMENU)hPopupMenu,9,MF_BYPOSITION);
DeleteMenu((HMENU)hPopupMenu,8,MF_BYPOSITION);
DeleteMenu((HMENU)hPopupMenu,7,MF_BYPOSITION);
DeleteMenu((HMENU)hPopupMenu,6,MF_BYPOSITION);
DeleteMenu((HMENU)hPopupMenu,5,MF_BYPOSITION);
DeleteMenu((HMENU)hPopupMenu,4,MF_BYPOSITION);
DeleteMenu((HMENU)hPopupMenu,1,MF_BYPOSITION);
DeleteMenu((HMENU)hPopupMenu,0,MF_BYPOSITION);
} else {
if (m_SelectedRom.size() == 0)
{
DeleteMenu(hPopupMenu,9,MF_BYPOSITION);
DeleteMenu(hPopupMenu,8,MF_BYPOSITION);
DeleteMenu(hPopupMenu,7,MF_BYPOSITION);
DeleteMenu(hPopupMenu,6,MF_BYPOSITION);
DeleteMenu(hPopupMenu,5,MF_BYPOSITION);
DeleteMenu(hPopupMenu,4,MF_BYPOSITION);
DeleteMenu(hPopupMenu,1,MF_BYPOSITION);
DeleteMenu(hPopupMenu,0,MF_BYPOSITION);
}
else
{
bool inBasicMode = g_Settings->LoadDword(UserInterface_BasicMode) != 0;
bool CheatsRemembered = g_Settings->LoadDword(Setting_RememberCheats) != 0;
if (!CheatsRemembered) { DeleteMenu((HMENU)hPopupMenu,9,MF_BYPOSITION); }
if (inBasicMode) { DeleteMenu((HMENU)hPopupMenu,8,MF_BYPOSITION); }
if (inBasicMode && !CheatsRemembered) { DeleteMenu((HMENU)hPopupMenu,7,MF_BYPOSITION); }
DeleteMenu((HMENU)hPopupMenu,6,MF_BYPOSITION);
if (!CheatsRemembered) { DeleteMenu(hPopupMenu,9,MF_BYPOSITION); }
if (inBasicMode) { DeleteMenu(hPopupMenu,8,MF_BYPOSITION); }
if (inBasicMode && !CheatsRemembered) { DeleteMenu(hPopupMenu,7,MF_BYPOSITION); }
DeleteMenu(hPopupMenu,6,MF_BYPOSITION);
if (!inBasicMode && g_Plugins && g_Plugins->Gfx() && g_Plugins->Gfx()->GetRomBrowserMenu != NULL)
{
HMENU GfxMenu = (HMENU)g_Plugins->Gfx()->GetRomBrowserMenu();
if (GfxMenu)
{
MENUITEMINFO lpmii;
InsertMenu ((HMENU)hPopupMenu, 6, MF_POPUP|MF_BYPOSITION, (DWORD)GfxMenu, GS(POPUP_GFX_PLUGIN));
InsertMenuW(hPopupMenu, 6, MF_POPUP|MF_BYPOSITION, (DWORD)GfxMenu, GS(POPUP_GFX_PLUGIN));
lpmii.cbSize = sizeof(MENUITEMINFO);
lpmii.fMask = MIIM_STATE;
lpmii.fState = 0;
SetMenuItemInfo((HMENU)hPopupMenu, (DWORD)GfxMenu, MF_BYCOMMAND,&lpmii);
SetMenuItemInfo(hPopupMenu, (DWORD)GfxMenu, MF_BYCOMMAND,&lpmii);
}
}
}
@ -1436,18 +1477,21 @@ void CRomBrowser::RomList_PopupMenu(DWORD /*pnmh*/)
GetCursorPos(&Mouse);
//Show the menu
TrackPopupMenu((HMENU)hPopupMenu, 0, Mouse.x, Mouse.y, 0,(HWND)m_MainWindow, NULL);
TrackPopupMenu(hPopupMenu, 0, Mouse.x, Mouse.y, 0,(HWND)m_MainWindow, NULL);
DestroyMenu(hMenu);
}
void CRomBrowser::RomList_SortList(void) {
void CRomBrowser::RomList_SortList(void)
{
SORT_FIELD SortFieldInfo;
for (int count = NoOfSortKeys; count >= 0; count --) {
for (int count = NoOfSortKeys; count >= 0; count --)
{
stdstr SortFieldName = g_Settings->LoadStringIndex(RomBrowser_SortFieldIndex,count);
size_t index;
for (index = 0; index < m_Fields.size(); index++) {
for (index = 0; index < m_Fields.size(); index++)
{
if (_stricmp(m_Fields[index].Name(),SortFieldName.c_str()) == 0) { break; }
}
if (index >= m_Fields.size()) { continue; }
@ -1482,7 +1526,8 @@ void CRomBrowser::SaveRomList ( strlist & FileList )
WriteFile(hFile,&Entries,sizeof(Entries),&dwWritten,NULL);
//Write Every Entry
for (int count = 0; count < Entries; count++) {
for (int count = 0; count < Entries; count++)
{
ROM_INFO * RomInfo = &m_RomInfo[count];
WriteFile(hFile,RomInfo,RomInfoSize,&dwWritten,NULL);
}
@ -1491,7 +1536,8 @@ void CRomBrowser::SaveRomList ( strlist & FileList )
CloseHandle(hFile);
}
void CRomBrowser::SaveRomListColoumnInfo(void) {
void CRomBrowser::SaveRomListColoumnInfo(void)
{
WriteTrace(TraceDebug,__FUNCTION__ ": Start");
// if (!RomBrowserVisible()) { return; }
if (g_Settings == NULL) { return; }
@ -1501,7 +1547,8 @@ void CRomBrowser::SaveRomListColoumnInfo(void) {
memset(&lvColumn,0,sizeof(lvColumn));
lvColumn.mask = LVCF_WIDTH;
for (size_t Coloumn = 0;ListView_GetColumn((HWND)m_hRomList,Coloumn,&lvColumn); Coloumn++) {
for (size_t Coloumn = 0;ListView_GetColumn((HWND)m_hRomList,Coloumn,&lvColumn); Coloumn++)
{
size_t index;
bool bFound = false;
for (index = 0; index < m_Fields.size(); index++)
@ -1545,24 +1592,30 @@ void CRomBrowser::SelectRomDir(void)
LPITEMIDLIST pidl;
BROWSEINFO bi;
stdstr WindowTitle;
WindowTitle.FromUTF16(GS(SELECT_ROM_DIR));
WriteTrace(TraceDebug,__FUNCTION__ " 1");
stdstr RomDir = g_Settings->LoadString(Directory_Game);
bi.hwndOwner = (HWND)m_MainWindow;
bi.pidlRoot = NULL;
bi.pszDisplayName = SelectedDir;
bi.lpszTitle = GS(SELECT_ROM_DIR);
bi.lpszTitle = WindowTitle.c_str();
bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
bi.lpfn = (BFFCALLBACK)SelectRomDirCallBack;
bi.lParam = (DWORD)RomDir.c_str();
WriteTrace(TraceDebug,__FUNCTION__ " 2");
if ((pidl = SHBrowseForFolder(&bi)) != NULL) {
if ((pidl = SHBrowseForFolder(&bi)) != NULL)
{
WriteTrace(TraceDebug,__FUNCTION__ " 3");
char Directory[_MAX_PATH];
if (SHGetPathFromIDList(pidl, Directory)) {
if (SHGetPathFromIDList(pidl, Directory))
{
int len = strlen(Directory);
WriteTrace(TraceDebug,__FUNCTION__ " 4");
if (Directory[len - 1] != '\\') {
if (Directory[len - 1] != '\\')
{
strcat(Directory,"\\");
}
WriteTrace(TraceDebug,__FUNCTION__ " 5");
@ -1648,7 +1701,8 @@ void CRomBrowser::ShowRomList (void)
m_ShowingRomBrowser = false;
}
void CRomBrowser::HideRomList (void) {
void CRomBrowser::HideRomList (void)
{
if (!RomBrowserVisible()) { return; }
ShowWindow((HWND)m_MainWindow,SW_HIDE);

View File

@ -163,7 +163,7 @@ class CRomBrowser
static int GetCicChipID ( BYTE * RomData );
bool LoadDataFromRomFile ( char * FileName, BYTE * Data,int DataLen, int * RomSize, FILE_FORMAT & FileFormat );
void LoadRomList ( void );
void MenuSetText ( HMENU hMenu, int MenuPos, const char * Title, char * ShotCut);
void MenuSetText ( HMENU hMenu, int MenuPos, const wchar_t * Title, char * ShotCut);
void SaveRomList ( strlist & FileList );
void RomList_ColoumnSortList ( DWORD pnmh );
void RomList_GetDispInfo ( DWORD pnmh );

View File

@ -53,7 +53,7 @@ bool CSettingConfig::UpdateAdvanced ( bool AdvancedMode, HTREEITEM hItem )
}
if (AdvancedMode && Page == m_GeneralOptionsPage)
{
m_PagesTreeList.InsertItem(TVIF_TEXT | TVIF_PARAM,GS(m_AdvancedPage->PageTitle()),0,0,0,0,(ULONG)m_AdvancedPage,hItem,TVI_FIRST);
m_PagesTreeList.InsertItemW(TVIF_TEXT | TVIF_PARAM,GS(m_AdvancedPage->PageTitle()),0,0,0,0,(ULONG)m_AdvancedPage,hItem,TVI_FIRST);
return true;
}
if (UpdateAdvanced(AdvancedMode,m_PagesTreeList.GetChildItem(hItem)))
@ -85,15 +85,19 @@ LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
if (g_Settings->LoadBool(Setting_RdbEditor))
{
SetWindowText(stdstr_f("%s ** RDB Edit Mode **",ConfigRomTitle.c_str()).c_str());
} else {
}
else
{
SetWindowText(ConfigRomTitle.c_str());
}
} else {
}
else
{
if (g_Settings->LoadBool(Setting_RdbEditor))
{
SetWindowText(stdstr_f("%s ** RDB Edit Mode **",GS(OPTIONS_TITLE)).c_str());
} else {
SetWindowText(GS(OPTIONS_TITLE));
::SetWindowTextW(m_hWnd, GS(OPTIONS_TITLE));
}
if (g_Settings->LoadBool(Setting_PluginPageFirst))
@ -131,7 +135,7 @@ LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
//Game Settings
if (!GameIni.empty())
{
CConfigSettingSection * GameSettings = new CConfigSettingSection(ConfigRomTitle.c_str());
CConfigSettingSection * GameSettings = new CConfigSettingSection(ConfigRomTitle.ToUTF16().c_str());
GameSettings->AddPage(new CGameGeneralPage(this->m_hWnd,rcSettingInfo ));
GameSettings->AddPage(new CGameRecompilePage(this->m_hWnd,rcSettingInfo ));
GameSettings->AddPage(new CGamePluginPage(this->m_hWnd,rcSettingInfo ));
@ -162,14 +166,14 @@ LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
}
if (i == 0)
{
hSectionItem = m_PagesTreeList.InsertItem(TVIF_TEXT | TVIF_PARAM,Section->GetPageTitle(),0,0,0,0,(ULONG)Page,TVI_ROOT,TVI_LAST);
hSectionItem = m_PagesTreeList.InsertItemW(TVIF_TEXT | TVIF_PARAM,Section->GetPageTitle(),0,0,0,0,(ULONG)Page,TVI_ROOT,TVI_LAST);
continue;
}
if (hSectionItem == NULL)
{
continue;
}
m_PagesTreeList.InsertItem(TVIF_TEXT | TVIF_PARAM,GS(Page->PageTitle()),0,0,0,0,(ULONG)Page,hSectionItem,TVI_LAST);
m_PagesTreeList.InsertItemW(TVIF_TEXT | TVIF_PARAM,GS(Page->PageTitle()),0,0,0,0,(ULONG)Page,hSectionItem,TVI_LAST);
}
if (bFirstItem && hSectionItem != NULL)
{

View File

@ -28,9 +28,9 @@ CAdvancedOptionsPage::CAdvancedOptionsPage (HWND hParent, const RECT & rcDispay
ComboBox = AddModComboBox(GetDlgItem(IDC_FRAME_DISPLAY_TYPE),UserInterface_FrameDisplayType);
if (ComboBox)
{
ComboBox->AddItem(GS(STR_FR_VIS), FR_VIs );
ComboBox->AddItem(GS(STR_FR_DLS), FR_DLs );
ComboBox->AddItem(GS(STR_FR_PERCENT), FR_PERCENT );
ComboBox->AddItemW(GS(STR_FR_VIS), FR_VIs );
ComboBox->AddItemW(GS(STR_FR_DLS), FR_DLs );
ComboBox->AddItemW(GS(STR_FR_PERCENT), FR_PERCENT );
}
UpdatePageSettings();

View File

@ -45,11 +45,11 @@ COptionsDirectoriesPage::COptionsDirectoriesPage (HWND hParent, const RECT & rcD
m_TextureSelected.Attach(GetDlgItem(IDC_TEXTURE_OTHER));
//Set Text language for the dialog box
m_PluginGroup.SetWindowText(GS(DIR_PLUGIN));
m_AutoSaveGroup.SetWindowText(GS(DIR_AUTO_SAVE));
m_InstantSaveGroup.SetWindowText(GS(DIR_INSTANT_SAVE));
m_ScreenShotGroup.SetWindowText(GS(DIR_SCREEN_SHOT));
m_TextureGroup.SetWindowText(GS(DIR_TEXTURE));
::SetWindowTextW(m_PluginGroup.m_hWnd, GS(DIR_PLUGIN));
::SetWindowTextW(m_AutoSaveGroup.m_hWnd, GS(DIR_AUTO_SAVE));
::SetWindowTextW(m_InstantSaveGroup.m_hWnd, GS(DIR_INSTANT_SAVE));
::SetWindowTextW(m_ScreenShotGroup.m_hWnd, GS(DIR_SCREEN_SHOT));
::SetWindowTextW(m_TextureGroup.m_hWnd, GS(DIR_TEXTURE));
UpdatePageSettings();
}
@ -72,9 +72,9 @@ int CALLBACK COptionsDirectoriesPage::SelectDirCallBack (HWND hwnd,DWORD uMsg,DW
void COptionsDirectoriesPage::SelectDirectory( LanguageStringID Title, CModifiedEditBox & EditBox, CModifiedButton & Default, CModifiedButton & selected )
{
char Buffer[MAX_PATH], Directory[MAX_PATH];
wchar_t Buffer[MAX_PATH], Directory[MAX_PATH];
LPITEMIDLIST pidl;
BROWSEINFO bi;
BROWSEINFOW bi;
stdstr InitialDir = EditBox.GetWindowText();
@ -85,11 +85,12 @@ void COptionsDirectoriesPage::SelectDirectory( LanguageStringID Title, CModified
bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
bi.lpfn = (BFFCALLBACK)SelectDirCallBack;
bi.lParam = (DWORD)InitialDir.c_str();
if ((pidl = SHBrowseForFolder(&bi)) != NULL)
if ((pidl = SHBrowseForFolderW(&bi)) != NULL)
{
if (SHGetPathFromIDList(pidl, Directory))
if (SHGetPathFromIDListW(pidl, Directory))
{
CPath SelectedDir(Directory,"");
stdstr path;
CPath SelectedDir(path.FromUTF16(Directory),"");
EditBox.SetChanged(true);
EditBox.SetWindowText(SelectedDir);
Default.SetChanged(true);

View File

@ -32,31 +32,31 @@ CGameGeneralPage::CGameGeneralPage (HWND hParent, const RECT & rcDispay )
if (ComboBox)
{
ComboBox->SetTextField(GetDlgItem(IDC_MEMORY_SIZE_TEXT));
ComboBox->AddItem(GS(RDRAM_4MB), 0x400000 );
ComboBox->AddItem(GS(RDRAM_8MB), 0x800000 );
ComboBox->AddItemW(GS(RDRAM_4MB), 0x400000 );
ComboBox->AddItemW(GS(RDRAM_8MB), 0x800000 );
}
ComboBox = AddModComboBox(GetDlgItem(IDC_SAVE_TYPE),Game_SaveChip);
if (ComboBox)
{
ComboBox->SetTextField(GetDlgItem(IDC_SAVE_TYPE_TEXT));
ComboBox->AddItem(GS(SAVE_FIRST_USED), (WPARAM)SaveChip_Auto );
ComboBox->AddItem(GS(SAVE_4K_EEPROM), SaveChip_Eeprom_4K );
ComboBox->AddItem(GS(SAVE_16K_EEPROM), SaveChip_Eeprom_16K );
ComboBox->AddItem(GS(SAVE_SRAM), SaveChip_Sram );
ComboBox->AddItem(GS(SAVE_FLASHRAM), SaveChip_FlashRam );
ComboBox->AddItemW(GS(SAVE_FIRST_USED), (WPARAM)SaveChip_Auto );
ComboBox->AddItemW(GS(SAVE_4K_EEPROM), SaveChip_Eeprom_4K );
ComboBox->AddItemW(GS(SAVE_16K_EEPROM), SaveChip_Eeprom_16K );
ComboBox->AddItemW(GS(SAVE_SRAM), SaveChip_Sram );
ComboBox->AddItemW(GS(SAVE_FLASHRAM), SaveChip_FlashRam );
}
ComboBox = AddModComboBox(GetDlgItem(IDC_COUNTFACT),Game_CounterFactor);
if (ComboBox)
{
ComboBox->SetTextField(GetDlgItem(IDC_COUNTFACT_TEXT));
ComboBox->AddItem(GS(NUMBER_1), 1 );
ComboBox->AddItem(GS(NUMBER_2), 2 );
ComboBox->AddItem(GS(NUMBER_3), 3 );
ComboBox->AddItem(GS(NUMBER_4), 4 );
ComboBox->AddItem(GS(NUMBER_5), 5 );
ComboBox->AddItem(GS(NUMBER_6), 6 );
ComboBox->AddItemW(GS(NUMBER_1), 1 );
ComboBox->AddItemW(GS(NUMBER_2), 2 );
ComboBox->AddItemW(GS(NUMBER_3), 3 );
ComboBox->AddItemW(GS(NUMBER_4), 4 );
ComboBox->AddItemW(GS(NUMBER_5), 5 );
ComboBox->AddItemW(GS(NUMBER_6), 6 );
}
SetDlgItemText(IDC_GOOD_NAME,g_Settings->LoadString(Game_GoodName).c_str());

View File

@ -20,18 +20,18 @@ CGamePluginPage::CGamePluginPage (HWND hParent, const RECT & rcDispay )
}
//Set the text for all gui Items
SetDlgItemText(RSP_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(GFX_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(AUDIO_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(CONT_ABOUT,GS(PLUG_ABOUT));
SetDlgItemTextW(m_hWnd, RSP_ABOUT,GS(PLUG_ABOUT));
SetDlgItemTextW(m_hWnd, GFX_ABOUT,GS(PLUG_ABOUT));
SetDlgItemTextW(m_hWnd, AUDIO_ABOUT,GS(PLUG_ABOUT));
SetDlgItemTextW(m_hWnd, CONT_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(IDC_RSP_NAME,GS(PLUG_RSP));
SetDlgItemText(IDC_GFX_NAME,GS(PLUG_GFX));
SetDlgItemText(IDC_AUDIO_NAME,GS(PLUG_AUDIO));
SetDlgItemText(IDC_CONT_NAME,GS(PLUG_CTRL));
SetDlgItemTextW(m_hWnd, IDC_RSP_NAME,GS(PLUG_RSP));
SetDlgItemTextW(m_hWnd, IDC_GFX_NAME,GS(PLUG_GFX));
SetDlgItemTextW(m_hWnd, IDC_AUDIO_NAME,GS(PLUG_AUDIO));
SetDlgItemTextW(m_hWnd, IDC_CONT_NAME,GS(PLUG_CTRL));
SetDlgItemText(IDC_HLE_GFX,GS(PLUG_HLE_GFX));
SetDlgItemText(IDC_HLE_AUDIO,GS(PLUG_HLE_AUDIO));
SetDlgItemTextW(m_hWnd, IDC_HLE_GFX,GS(PLUG_HLE_GFX));
SetDlgItemTextW(m_hWnd, IDC_HLE_AUDIO,GS(PLUG_HLE_AUDIO));
m_GfxGroup.Attach(GetDlgItem(IDC_GFX_NAME));
m_AudioGroup.Attach(GetDlgItem(IDC_AUDIO_NAME));
@ -60,7 +60,7 @@ void CGamePluginPage::AddPlugins (int ListId,SettingID Type, PLUGIN_TYPE PluginT
{
ComboBox->SetDefault(NULL);
}
ComboBox->AddItem(GS(PLUG_DEFAULT), NULL);
ComboBox->AddItemW(GS(PLUG_DEFAULT), NULL);
for (int i = 0, n = m_PluginList.GetPluginCount(); i < n; i++ )
{
@ -309,7 +309,7 @@ void CGamePluginPage::HleGfxChanged ( UINT /*Code*/, int id, HWND /*ctl*/ )
}
if ((Button->GetCheck() & BST_CHECKED) == 0)
{
int res = MessageBox(GS(MSG_SET_LLE_GFX_MSG),GS(MSG_SET_LLE_GFX_TITLE),MB_YESNO|MB_ICONWARNING);
int res = MessageBoxW(m_hWnd, GS(MSG_SET_LLE_GFX_MSG),GS(MSG_SET_LLE_GFX_TITLE),MB_YESNO|MB_ICONWARNING);
if (res != IDYES)
{
Button->SetCheck(BST_CHECKED);
@ -333,7 +333,7 @@ void CGamePluginPage::HleAudioChanged ( UINT /*Code*/, int id, HWND /*ctl*/ )
}
if ((Button->GetCheck() & BST_CHECKED) != 0)
{
int res = MessageBox(GS(MSG_SET_HLE_AUD_MSG),GS(MSG_SET_HLE_AUD_TITLE),MB_ICONWARNING|MB_YESNO);
int res = MessageBoxW(m_hWnd, GS(MSG_SET_HLE_AUD_MSG),GS(MSG_SET_HLE_AUD_TITLE),MB_ICONWARNING|MB_YESNO);
if (res != IDYES)
{
Button->SetCheck(BST_UNCHECKED);

View File

@ -36,19 +36,19 @@ CGameRecompilePage::CGameRecompilePage (HWND hParent, const RECT & rcDispay )
ComboBox = AddModComboBox(GetDlgItem(IDC_CPU_TYPE),Game_CpuType);
if (ComboBox)
{
ComboBox->AddItem(GS(CORE_RECOMPILER), CPU_Recompiler);
ComboBox->AddItem(GS(CORE_INTERPTER), CPU_Interpreter);
ComboBox->AddItemW(GS(CORE_RECOMPILER), CPU_Recompiler);
ComboBox->AddItemW(GS(CORE_INTERPTER), CPU_Interpreter);
if (g_Settings->LoadBool(Debugger_Enabled))
{
ComboBox->AddItem(GS(CORE_SYNC), CPU_SyncCores);
ComboBox->AddItemW(GS(CORE_SYNC), CPU_SyncCores);
}
}
ComboBox = AddModComboBox(GetDlgItem(IDC_FUNCFIND),Game_FuncLookupMode);
if (ComboBox)
{
ComboBox->AddItem(GS(FLM_PLOOKUP), FuncFind_PhysicalLookup);
ComboBox->AddItem(GS(FLM_VLOOKUP), FuncFind_VirtualLookup);
ComboBox->AddItemW(GS(FLM_PLOOKUP), FuncFind_PhysicalLookup);
ComboBox->AddItemW(GS(FLM_VLOOKUP), FuncFind_VirtualLookup);
//ComboBox->AddItem(GS(FLM_CHANGEMEM), FuncFind_ChangeMemory);
}
UpdatePageSettings();

View File

@ -20,16 +20,16 @@ COptionsGameBrowserPage::COptionsGameBrowserPage (HWND hParent, const RECT & rcD
return;
}
SetDlgItemText(IDC_ROMSEL_TEXT2,GS(RB_ROMS));
SetDlgItemText(IDC_ROMSEL_TEXT4,GS(RB_DIRS));
SetDlgItemText(IDC_USE_ROMBROWSER,GS(RB_USE));
SetDlgItemText(IDC_RECURSION,GS(RB_DIR_RECURSION));
SetDlgItemText(IDC_ROMSEL_TEXT5,GS(RB_AVALIABLE_FIELDS));
SetDlgItemText(IDC_ROMSEL_TEXT6,GS(RB_SHOW_FIELDS));
SetDlgItemText(IDC_ADD,GS(RB_ADD));
SetDlgItemText(IDC_REMOVE,GS(RB_REMOVE));
SetDlgItemText(IDC_UP,GS(RB_UP));
SetDlgItemText(IDC_DOWN,GS(RB_DOWN));
SetDlgItemTextW(m_hWnd, IDC_ROMSEL_TEXT2,GS(RB_ROMS));
SetDlgItemTextW(m_hWnd, IDC_ROMSEL_TEXT4,GS(RB_DIRS));
SetDlgItemTextW(m_hWnd, IDC_USE_ROMBROWSER,GS(RB_USE));
SetDlgItemTextW(m_hWnd, IDC_RECURSION,GS(RB_DIR_RECURSION));
SetDlgItemTextW(m_hWnd, IDC_ROMSEL_TEXT5,GS(RB_AVALIABLE_FIELDS));
SetDlgItemTextW(m_hWnd, IDC_ROMSEL_TEXT6,GS(RB_SHOW_FIELDS));
SetDlgItemTextW(m_hWnd, IDC_ADD,GS(RB_ADD));
SetDlgItemTextW(m_hWnd, IDC_REMOVE,GS(RB_REMOVE));
SetDlgItemTextW(m_hWnd, IDC_UP,GS(RB_UP));
SetDlgItemTextW(m_hWnd, IDC_DOWN,GS(RB_DOWN));
AddModCheckBox(GetDlgItem(IDC_USE_ROMBROWSER),RomBrowser_Enabled);
AddModCheckBox(GetDlgItem(IDC_RECURSION),RomBrowser_Recursive);
@ -57,12 +57,12 @@ void COptionsGameBrowserPage::UpdateFieldList ( const ROMBROWSER_FIELDS_LIST & F
int Pos = Fields[i].Pos();
if (Pos < 0)
{
m_Avaliable.SetItemData(m_Avaliable.AddString(GS(Fields[i].LangID())),i);
m_Avaliable.SetItemData(m_Avaliable.AddStringW(GS(Fields[i].LangID())),i);
continue;
}
int listCount = m_Using.GetCount();
if (Pos > listCount) { Pos = listCount; }
m_Using.SetItemData(m_Using.InsertString(Pos,GS(Fields[i].LangID())),i);
m_Using.SetItemData(m_Using.InsertStringW(Pos,GS(Fields[i].LangID())),i);
}
}
@ -110,7 +110,7 @@ void COptionsGameBrowserPage::AddFieldClicked ( UINT /*Code*/, int /*id*/, HWND
m_Avaliable.SetCurSel(index);
//Add to list
index = m_Using.AddString(GS(m_Fields[i].LangID()));
index = m_Using.AddStringW(GS(m_Fields[i].LangID()));
m_Using.SetItemData(index,i);
m_Using.SetCurSel(index);
@ -156,7 +156,7 @@ void COptionsGameBrowserPage::MoveFieldUpClicked ( UINT /*Code*/, int /*id*/, HW
int i = m_Using.GetItemData(index);
m_Using.DeleteString(index);
index = m_Using.InsertString(index - 1,GS(m_Fields[i].LangID()));
index = m_Using.InsertStringW(index - 1,GS(m_Fields[i].LangID()));
m_Using.SetItemData(index,i);
m_Using.SetCurSel(index);
@ -175,7 +175,7 @@ void COptionsGameBrowserPage::MoveFieldDownClicked ( UINT /*Code*/, int /*id*/,
int i = m_Using.GetItemData(index);
m_Using.DeleteString(index);
index = m_Using.InsertString(index + 1,GS(m_Fields[i].LangID()));
index = m_Using.InsertStringW(index + 1,GS(m_Fields[i].LangID()));
m_Using.SetItemData(index,i);
m_Using.SetCurSel(index);

View File

@ -19,13 +19,13 @@ COptionsShortCutsPage::COptionsShortCutsPage (HWND hParent, const RECT & rcDispa
return;
}
SetDlgItemText(IDC_S_CPU_STATE,GS(ACCEL_CPUSTATE_TITLE));
SetDlgItemText(IDC_MENU_ITEM_TEXT,GS(ACCEL_MENUITEM_TITLE));
SetDlgItemText(IDC_S_CURRENT_KEYS,GS(ACCEL_CURRENTKEYS_TITLE));
SetDlgItemText(IDC_S_SELECT_SHORT,GS(ACCEL_SELKEY_TITLE));
SetDlgItemText(IDC_S_CURRENT_ASSIGN,GS(ACCEL_ASSIGNEDTO_TITLE));
SetDlgItemText(IDC_ASSIGN,GS(ACCEL_ASSIGN_BTN));
SetDlgItemText(IDC_REMOVE,GS(ACCEL_REMOVE_BTN));
SetDlgItemTextW(m_hWnd, IDC_S_CPU_STATE,GS(ACCEL_CPUSTATE_TITLE));
SetDlgItemTextW(m_hWnd, IDC_MENU_ITEM_TEXT,GS(ACCEL_MENUITEM_TITLE));
SetDlgItemTextW(m_hWnd, IDC_S_CURRENT_KEYS,GS(ACCEL_CURRENTKEYS_TITLE));
SetDlgItemTextW(m_hWnd, IDC_S_SELECT_SHORT,GS(ACCEL_SELKEY_TITLE));
SetDlgItemTextW(m_hWnd, IDC_S_CURRENT_ASSIGN,GS(ACCEL_ASSIGNEDTO_TITLE));
SetDlgItemTextW(m_hWnd, IDC_ASSIGN,GS(ACCEL_ASSIGN_BTN));
SetDlgItemTextW(m_hWnd, IDC_REMOVE,GS(ACCEL_REMOVE_BTN));
m_CreateNewShortCut.AttachToDlgItem(m_hWnd,IDC_S_SELECT_SHORT);
m_CpuState.Attach(GetDlgItem(IDC_C_CPU_STATE));
@ -35,9 +35,9 @@ COptionsShortCutsPage::COptionsShortCutsPage (HWND hParent, const RECT & rcDispa
m_MenuItems.ModifyStyle(0,TVS_SHOWSELALWAYS);
m_CpuState.SetItemData(m_CpuState.AddString(GS(ACCEL_CPUSTATE_1)),CMenuShortCutKey::GAME_NOT_RUNNING);
m_CpuState.SetItemData(m_CpuState.AddString(GS(ACCEL_CPUSTATE_3)),CMenuShortCutKey::GAME_RUNNING_WINDOW);
m_CpuState.SetItemData(m_CpuState.AddString(GS(ACCEL_CPUSTATE_4)),CMenuShortCutKey::GAME_RUNNING_FULLSCREEN);
m_CpuState.SetItemData(m_CpuState.AddStringW(GS(ACCEL_CPUSTATE_1)),CMenuShortCutKey::GAME_NOT_RUNNING);
m_CpuState.SetItemData(m_CpuState.AddStringW(GS(ACCEL_CPUSTATE_3)),CMenuShortCutKey::GAME_RUNNING_WINDOW);
m_CpuState.SetItemData(m_CpuState.AddStringW(GS(ACCEL_CPUSTATE_4)),CMenuShortCutKey::GAME_RUNNING_FULLSCREEN);
m_CpuState.SetCurSel(0);
int VirtualKeyListSize;
@ -99,11 +99,11 @@ void COptionsShortCutsPage::OnCpuStateChanged(UINT /*Code*/, int /*id*/, HWND /*
if (hParent == NULL)
{
hParent = m_MenuItems.InsertItem(TVIF_TEXT | TVIF_PARAM,GS(Item->second.Section()),0,0,0,0,
Item->second.Section(),TVI_ROOT,TVI_LAST);
hParent = m_MenuItems.InsertItemW(TVIF_TEXT | TVIF_PARAM,GS(Item->second.Section()),0,0,0,0, Item->second.Section(),TVI_ROOT,TVI_LAST);
}
stdstr str = GS(Item->second.Title());
stdstr str;
str.FromUTF16(GS(Item->second.Title()));
str.Replace("&","");
str.Replace("...","");
@ -223,7 +223,8 @@ void COptionsShortCutsPage::OnShortCutChanged ( UINT /*Code*/, int /*id*/, HWND
ACCESS_MODE AccessLevel = (ACCESS_MODE)m_CpuState.GetItemData(m_CpuState.GetCurSel());
stdstr str = GS(m_ShortCuts.GetMenuItemName(key,bCtrl,bAlt,bShift,AccessLevel));
stdstr str;
str.FromUTF16(GS(m_ShortCuts.GetMenuItemName(key,bCtrl,bAlt,bShift,AccessLevel)));
if (str.length() > 0)
{
str.resize(std::remove(str.begin(), str.end(), '&') - str.begin());

View File

@ -19,18 +19,18 @@ COptionPluginPage::COptionPluginPage (HWND hParent, const RECT & rcDispay )
}
//Set the text for all gui Items
SetDlgItemText(RSP_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(GFX_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(AUDIO_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(CONT_ABOUT,GS(PLUG_ABOUT));
SetDlgItemTextW(m_hWnd, RSP_ABOUT,GS(PLUG_ABOUT));
SetDlgItemTextW(m_hWnd, GFX_ABOUT,GS(PLUG_ABOUT));
SetDlgItemTextW(m_hWnd, AUDIO_ABOUT,GS(PLUG_ABOUT));
SetDlgItemTextW(m_hWnd, CONT_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(IDC_RSP_NAME,GS(PLUG_RSP));
SetDlgItemText(IDC_GFX_NAME,GS(PLUG_GFX));
SetDlgItemText(IDC_AUDIO_NAME,GS(PLUG_AUDIO));
SetDlgItemText(IDC_CONT_NAME,GS(PLUG_CTRL));
SetDlgItemTextW(m_hWnd, IDC_RSP_NAME,GS(PLUG_RSP));
SetDlgItemTextW(m_hWnd, IDC_GFX_NAME,GS(PLUG_GFX));
SetDlgItemTextW(m_hWnd, IDC_AUDIO_NAME,GS(PLUG_AUDIO));
SetDlgItemTextW(m_hWnd, IDC_CONT_NAME,GS(PLUG_CTRL));
SetDlgItemText(IDC_HLE_GFX,GS(PLUG_HLE_GFX));
SetDlgItemText(IDC_HLE_AUDIO,GS(PLUG_HLE_AUDIO));
SetDlgItemTextW(m_hWnd, IDC_HLE_GFX,GS(PLUG_HLE_GFX));
SetDlgItemTextW(m_hWnd, IDC_HLE_AUDIO,GS(PLUG_HLE_AUDIO));
m_GfxGroup.Attach(GetDlgItem(IDC_GFX_NAME));
m_AudioGroup.Attach(GetDlgItem(IDC_AUDIO_NAME));
@ -295,7 +295,7 @@ void COptionPluginPage::HleGfxChanged ( UINT /*Code*/, int id, HWND /*ctl*/ )
}
if ((Button->GetCheck() & BST_CHECKED) == 0)
{
int res = MessageBox(GS(MSG_SET_LLE_GFX_MSG),GS(MSG_SET_LLE_GFX_TITLE),MB_YESNO|MB_ICONWARNING);
int res = MessageBoxW(m_hWnd, GS(MSG_SET_LLE_GFX_MSG),GS(MSG_SET_LLE_GFX_TITLE),MB_YESNO|MB_ICONWARNING);
if (res != IDYES)
{
Button->SetCheck(BST_CHECKED);
@ -319,7 +319,7 @@ void COptionPluginPage::HleAudioChanged ( UINT /*Code*/, int id, HWND /*ctl*/ )
}
if ((Button->GetCheck() & BST_CHECKED) != 0)
{
int res = MessageBox(GS(MSG_SET_HLE_AUD_MSG),GS(MSG_SET_HLE_AUD_TITLE),MB_ICONWARNING|MB_YESNO);
int res = MessageBoxW(m_hWnd, GS(MSG_SET_HLE_AUD_MSG),GS(MSG_SET_HLE_AUD_TITLE),MB_ICONWARNING|MB_YESNO);
if (res != IDYES)
{
Button->SetCheck(BST_UNCHECKED);

View File

@ -11,7 +11,7 @@
#include "stdafx.h"
#include "Settings Page.h"
CConfigSettingSection::CConfigSettingSection( LPCSTR PageTitle ) :
CConfigSettingSection::CConfigSettingSection( LPCWSTR PageTitle ) :
m_PageTitle(PageTitle)
{
}

View File

@ -539,13 +539,13 @@ typedef std::vector<CSettingsPage *> SETTING_PAGES;
class CConfigSettingSection
{
SETTING_PAGES m_Pages;
stdstr m_PageTitle;
std::wstring m_PageTitle;
public:
CConfigSettingSection ( LPCSTR PageTitle );
CConfigSettingSection ( LPCWSTR PageTitle );
~CConfigSettingSection();
LPCTSTR GetPageTitle ( void ) const { return m_PageTitle.c_str(); }
LPCWSTR GetPageTitle ( void ) const { return m_PageTitle.c_str(); }
void AddPage ( CSettingsPage * Page );
int GetPageCount ( void ) const { return m_Pages.size(); }
CSettingsPage * GetPage ( int PageNo );

View File

@ -59,7 +59,20 @@ public:
return indx;
}
void SetReset ( bool Reset )
int AddItemW (LPCWSTR strItem, const TParam & lParam)
{
int indx = AddStringW(strItem);
TParam * Value = new TParam(lParam);
SetItemData(indx,(DWORD_PTR)(Value));
m_ParamList.push_back(Value);
if ((m_AllwaysSelected && GetCount() == 1) || m_defaultValue == lParam)
{
SetCurSel(indx);
}
return indx;
}
void SetReset ( bool Reset )
{
m_Reset = Reset;
if (m_Reset)

View File

@ -186,7 +186,7 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
try
{
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL );
_Lang = new CLanguage();
g_Lang = new CLanguage();
g_Settings = new CSettings;
g_Settings->Initilize(AppName());
@ -211,7 +211,7 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
g_Plugins = new CPlugins(g_Settings->LoadString(Directory_Plugin));
//Select the language
_Lang->LoadCurrentStrings(true);
g_Lang->LoadCurrentStrings(true);
//Create the main window with Menu
WriteTrace(TraceDebug,__FUNCTION__ ": Create Main Window");
@ -224,11 +224,14 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
g_Plugins->SetRenderWindows(&MainWindow,&HiddenWindow);
g_Notify->SetMainWindow(&MainWindow);
if (__argc > 1) {
if (__argc > 1)
{
WriteTraceF(TraceDebug,__FUNCTION__ ": Cmd line found \"%s\"",__argv[1]);
MainWindow.Show(true); //Show the main window
CN64System::RunFileImage(__argv[1]);
} else {
}
else
{
if (g_Settings->LoadDword(RomBrowser_Enabled))
{
WriteTrace(TraceDebug,__FUNCTION__ ": Show Rom Browser");
@ -268,7 +271,7 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
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 (_Lang) { delete _Lang; _Lang = NULL; }
if (g_Lang) { delete g_Lang; g_Lang = NULL; }
CMipsMemoryVM::FreeReservedMemory();