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); 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)); ATLASSERT(::IsWindow(m_hWnd));
return (int)::SendMessage(m_hWnd, LB_DELETESTRING, nIndex, 0L); return (int)::SendMessage(m_hWnd, LB_DELETESTRING, nIndex, 0L);
@ -721,6 +727,12 @@ public:
return (int)::SendMessage(m_hWnd, LB_INSERTSTRING, nIndex, (LPARAM)lpszItem); 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 #ifndef _WIN32_WCE
int Dir(UINT attr, LPCTSTR lpszWildCard) int Dir(UINT attr, LPCTSTR lpszWildCard)
{ {
@ -1085,7 +1097,13 @@ public:
return (int)::SendMessage(m_hWnd, CB_ADDSTRING, 0, (LPARAM)lpszString); 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)); ATLASSERT(::IsWindow(m_hWnd));
return (int)::SendMessage(m_hWnd, CB_DELETESTRING, nIndex, 0L); return (int)::SendMessage(m_hWnd, CB_DELETESTRING, nIndex, 0L);
@ -4410,7 +4428,25 @@ public:
return (HTREEITEM)::SendMessage(m_hWnd, TVM_INSERTITEM, 0, (LPARAM)&tvis); 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)); ATLASSERT(::IsWindow(m_hWnd));
return (BOOL)::SendMessage(m_hWnd, TVM_DELETEITEM, 0, (LPARAM)hItem); return (BOOL)::SendMessage(m_hWnd, TVM_DELETEITEM, 0, (LPARAM)hItem);

View File

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

View File

@ -17,44 +17,45 @@
#include <map> //stl map #include <map> //stl map
#include <list> //stl list #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 LANG_STRINGS::value_type LANG_STR;
typedef struct { typedef struct {
stdstr Filename; stdstr Filename;
stdstr LanguageName; std::wstring LanguageName;
} LanguageFile; } LanguageFile;
typedef std::list<LanguageFile> LanguageList; typedef std::list<LanguageFile> LanguageList;
class CLanguage class CLanguage
{ {
public: public:
CLanguage ( ); CLanguage ();
const stdstr & GetString ( LanguageStringID StringID );
LanguageList & GetLangList ( void ); const std::wstring & GetString ( LanguageStringID StringID );
void SetLanguage ( char * LanguageName ); LanguageList & GetLangList ( void );
void LoadCurrentStrings ( bool ShowSelectDialog ); void SetLanguage ( const wchar_t * LanguageName );
bool IsCurrentLang ( LanguageFile & File ); void LoadCurrentStrings ( bool ShowSelectDialog );
bool IsCurrentLang ( LanguageFile & File );
private: private:
CLanguage(const CLanguage&); // Disable copy constructor CLanguage(const CLanguage&); // Disable copy constructor
CLanguage& operator=(const CLanguage&); // Disable assignment CLanguage& operator=(const CLanguage&); // Disable assignment
stdstr m_SelectedLanguage; std::wstring m_SelectedLanguage;
const stdstr m_emptyString; const std::wstring m_emptyString;
LANG_STRINGS m_CurrentStrings, m_DefaultStrings; LANG_STRINGS m_CurrentStrings, m_DefaultStrings;
LanguageList m_LanguageList; LanguageList m_LanguageList;
stdstr GetLangString ( const char * FileName, LanguageStringID ID ); std::wstring GetLangString ( const char * FileName, LanguageStringID ID );
LANG_STR GetNextLangString ( void * OpenFile ); LANG_STR GetNextLangString ( void * OpenFile );
void LoadDefaultStrings ( void ); 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) 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); int length = SendMessage(hDlgItem, WM_GETTEXTLENGTH, 0, 0);
if (length == 0) if (length == 0)
{ {
@ -682,14 +682,14 @@ bool CCheats::CheatChanged (HWND hDlg)
{ {
return false; 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) if (Result == IDCANCEL)
{ {
return true; return true;
} }
if (Result == IDYES) 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; return false;
} }
@ -702,98 +702,113 @@ void CCheats::RecordCheatValues ( HWND hDlg )
m_EditNotes = GetDlgItemStr(hDlg,IDC_NOTES); m_EditNotes = GetDlgItemStr(hDlg,IDC_NOTES);
} }
int CALLBACK CCheats::CheatAddProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lParam) { int CALLBACK CCheats::CheatAddProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lParam)
switch (uMsg) { {
switch (uMsg)
{
case WM_INITDIALOG: case WM_INITDIALOG:
{ {
CCheats * _this = (CCheats *)lParam; CCheats * _this = (CCheats *)lParam;
SetProp((HWND)hDlg,"Class",_this); SetProp(hDlg,"Class",_this);
SetWindowText((HWND)hDlg,GS(CHEAT_ADDCHEAT_FRAME)); SetWindowTextW(hDlg,GS(CHEAT_ADDCHEAT_FRAME));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_NAME),GS(CHEAT_ADDCHEAT_NAME)); SetWindowTextW(GetDlgItem(hDlg,IDC_NAME),GS(CHEAT_ADDCHEAT_NAME));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_CODE),GS(CHEAT_ADDCHEAT_CODE)); SetWindowTextW(GetDlgItem(hDlg,IDC_CODE),GS(CHEAT_ADDCHEAT_CODE));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_LABEL_OPTIONS),GS(CHEAT_ADDCHEAT_OPT)); SetWindowTextW(GetDlgItem(hDlg,IDC_LABEL_OPTIONS),GS(CHEAT_ADDCHEAT_OPT));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_CODE_DES),GS(CHEAT_ADDCHEAT_CODEDES)); SetWindowTextW(GetDlgItem(hDlg,IDC_CODE_DES),GS(CHEAT_ADDCHEAT_CODEDES));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_LABEL_OPTIONS_FORMAT),GS(CHEAT_ADDCHEAT_OPTDES)); SetWindowTextW(GetDlgItem(hDlg,IDC_LABEL_OPTIONS_FORMAT),GS(CHEAT_ADDCHEAT_OPTDES));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_CHEATNOTES),GS(CHEAT_ADDCHEAT_NOTES)); SetWindowTextW(GetDlgItem(hDlg,IDC_CHEATNOTES),GS(CHEAT_ADDCHEAT_NOTES));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_NEWCHEAT),GS(CHEAT_ADDCHEAT_NEW)); SetWindowTextW(GetDlgItem(hDlg,IDC_NEWCHEAT),GS(CHEAT_ADDCHEAT_NEW));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_ADD),GS(CHEAT_ADDCHEAT_ADD)); SetWindowTextW(GetDlgItem(hDlg,IDC_ADD),GS(CHEAT_ADDCHEAT_ADD));
SetProp((HWND)hDlg,"validcodes",false); SetProp(hDlg,"validcodes",false);
_this->RecordCheatValues(hDlg); _this->RecordCheatValues(hDlg);
} }
break; break;
case WM_COMMAND: case WM_COMMAND:
{ {
switch (LOWORD(wParam)) { switch (LOWORD(wParam))
{
case IDC_CODE_NAME: case IDC_CODE_NAME:
if (HIWORD(wParam) == EN_CHANGE) { if (HIWORD(wParam) == EN_CHANGE)
{
bool validcodes,validoptions, nooptions; bool validcodes,validoptions, nooptions;
int CodeFormat; int CodeFormat;
ReadCodeString(hDlg,validcodes,validoptions,nooptions,CodeFormat); ReadCodeString(hDlg,validcodes,validoptions,nooptions,CodeFormat);
if (!nooptions) { if (!nooptions)
{
ReadOptionsString(hDlg,validcodes,validoptions,nooptions,CodeFormat); ReadOptionsString(hDlg,validcodes,validoptions,nooptions,CodeFormat);
} }
if (validcodes && (validoptions || nooptions) && SendDlgItemMessage((HWND)hDlg,IDC_CODE_NAME,EM_LINELENGTH,0,0) > 0){ if (validcodes && (validoptions || nooptions) && SendDlgItemMessage(hDlg,IDC_CODE_NAME,EM_LINELENGTH,0,0) > 0)
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), true); {
EnableWindow(GetDlgItem(hDlg, IDC_ADD), true);
} }
else { else
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), false); {
EnableWindow(GetDlgItem(hDlg, IDC_ADD), false);
} }
} }
break; break;
case IDC_CHEAT_CODES: case IDC_CHEAT_CODES:
if (HIWORD(wParam) == EN_CHANGE) { if (HIWORD(wParam) == EN_CHANGE)
{
bool validcodes,validoptions, nooptions; bool validcodes,validoptions, nooptions;
int CodeFormat; int CodeFormat;
ReadCodeString(hDlg,validcodes,validoptions,nooptions,CodeFormat); ReadCodeString(hDlg,validcodes,validoptions,nooptions,CodeFormat);
//GetDlgItemText(hDlg, IDC_CHEAT_CODES, str, 1024); if ((CodeFormat > 0) && !IsWindowEnabled(GetDlgItem(hDlg, IDC_LABEL_OPTIONS)) )
if ((CodeFormat > 0) && !IsWindowEnabled(GetDlgItem((HWND)hDlg, IDC_LABEL_OPTIONS)) ) { {
EnableWindow(GetDlgItem((HWND)hDlg, IDC_LABEL_OPTIONS), true); EnableWindow(GetDlgItem(hDlg, IDC_LABEL_OPTIONS), true);
EnableWindow(GetDlgItem((HWND)hDlg, IDC_LABEL_OPTIONS_FORMAT), true); EnableWindow(GetDlgItem(hDlg, IDC_LABEL_OPTIONS_FORMAT), true);
EnableWindow(GetDlgItem((HWND)hDlg, IDC_CHEAT_OPTIONS), true); EnableWindow(GetDlgItem(hDlg, IDC_CHEAT_OPTIONS), true);
} }
if ((CodeFormat <= 0) && IsWindowEnabled(GetDlgItem((HWND)hDlg, IDC_LABEL_OPTIONS)) ) { if ((CodeFormat <= 0) && IsWindowEnabled(GetDlgItem(hDlg, IDC_LABEL_OPTIONS)) )
EnableWindow(GetDlgItem((HWND)hDlg, IDC_LABEL_OPTIONS), false); {
EnableWindow(GetDlgItem((HWND)hDlg, IDC_LABEL_OPTIONS_FORMAT), false); EnableWindow(GetDlgItem(hDlg, IDC_LABEL_OPTIONS), false);
EnableWindow(GetDlgItem((HWND)hDlg, IDC_CHEAT_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); ReadOptionsString(hDlg,validcodes,validoptions,nooptions,CodeFormat);
} }
if (validcodes && (validoptions || nooptions) && SendDlgItemMessage((HWND)hDlg,IDC_CODE_NAME,EM_LINELENGTH,0,0) > 0){ if (validcodes && (validoptions || nooptions) && SendDlgItemMessage(hDlg,IDC_CODE_NAME,EM_LINELENGTH,0,0) > 0)
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), true); {
EnableWindow(GetDlgItem(hDlg, IDC_ADD), true);
} }
else { else
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), false); {
EnableWindow(GetDlgItem(hDlg, IDC_ADD), false);
} }
} }
break; break;
case IDC_CHEAT_OPTIONS: case IDC_CHEAT_OPTIONS:
if (HIWORD(wParam) == EN_CHANGE) { if (HIWORD(wParam) == EN_CHANGE)
{
bool validcodes,validoptions, nooptions; bool validcodes,validoptions, nooptions;
int CodeFormat; int CodeFormat;
ReadOptionsString(hDlg,validcodes,validoptions,nooptions,CodeFormat); ReadOptionsString(hDlg,validcodes,validoptions,nooptions,CodeFormat);
if (validcodes && (validoptions || nooptions) && SendDlgItemMessage((HWND)hDlg,IDC_CODE_NAME,EM_LINELENGTH,0,0) > 0){ if (validcodes && (validoptions || nooptions) && SendDlgItemMessage(hDlg,IDC_CODE_NAME,EM_LINELENGTH,0,0) > 0)
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), true); {
EnableWindow(GetDlgItem(hDlg, IDC_ADD), true);
} }
else { else
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), false); {
EnableWindow(GetDlgItem(hDlg, IDC_ADD), false);
} }
} }
break; break;
case IDC_ADD: case IDC_ADD:
{ {
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class"); CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
stdstr NewCheatName = GetDlgItemStr(hDlg,IDC_CODE_NAME); stdstr NewCheatName = GetDlgItemStr(hDlg,IDC_CODE_NAME);
int i = 0; int i = 0;
for (i = 0; i < MaxCheats; i ++) { for (i = 0; i < MaxCheats; i ++)
{
if (_this->m_EditCheat == i) if (_this->m_EditCheat == i)
{ {
continue; continue;
@ -807,13 +822,15 @@ int CALLBACK CCheats::CheatAddProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lPa
} }
break; 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)); g_Notify->DisplayError(GS(MSG_CHEAT_NAME_IN_USE));
SetFocus(GetDlgItem((HWND)hDlg,IDC_CODE_NAME)); SetFocus(GetDlgItem(hDlg,IDC_CODE_NAME));
return true; return true;
} }
} }
if (_this->m_EditCheat < 0 && i == MaxCheats) { if (_this->m_EditCheat < 0 && i == MaxCheats)
{
g_Notify->DisplayError(GS(MSG_MAX_CHEATS)); g_Notify->DisplayError(GS(MSG_MAX_CHEATS));
return true; return true;
} }
@ -834,20 +851,20 @@ int CALLBACK CCheats::CheatAddProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lPa
break; break;
case IDC_NEWCHEAT: case IDC_NEWCHEAT:
{ {
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class"); CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
if (_this->CheatChanged(hDlg)) if (_this->CheatChanged(hDlg))
{ {
break; break;
} }
_this->m_EditCheat = -1; _this->m_EditCheat = -1;
SetDlgItemText((HWND)hDlg,IDC_CODE_NAME,""); SetDlgItemText(hDlg,IDC_CODE_NAME,"");
SetDlgItemText((HWND)hDlg,IDC_CHEAT_CODES,""); SetDlgItemText(hDlg,IDC_CHEAT_CODES,"");
SetDlgItemText((HWND)hDlg,IDC_CHEAT_OPTIONS,""); SetDlgItemText(hDlg,IDC_CHEAT_OPTIONS,"");
SetDlgItemText((HWND)hDlg,IDC_NOTES,""); SetDlgItemText(hDlg,IDC_NOTES,"");
EnableWindow(GetDlgItem((HWND)hDlg, IDC_ADD), false); EnableWindow(GetDlgItem(hDlg, IDC_ADD), false);
EnableWindow(GetDlgItem((HWND)hDlg, IDC_CHEAT_OPTIONS), false); EnableWindow(GetDlgItem(hDlg, IDC_CHEAT_OPTIONS), false);
SetDlgItemText((HWND)hDlg,IDC_ADD,GS(CHEAT_ADDNEW)); SetDlgItemTextW(hDlg,IDC_ADD,GS(CHEAT_ADDNEW));
_this->RecordCheatValues(hDlg); _this->RecordCheatValues(hDlg);
} }
break; break;
@ -856,7 +873,7 @@ int CALLBACK CCheats::CheatAddProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lPa
break; break;
case WM_EDITCHEAT: case WM_EDITCHEAT:
{ {
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class"); CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
_this->m_EditCheat = wParam; _this->m_EditCheat = wParam;
if (_this->m_EditCheat < 0) 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; int len = strrchr(String,'"') - strchr(String,'"') - 1;
stdstr CheatName(strchr(String,'"') + 1); stdstr CheatName(strchr(String,'"') + 1);
CheatName.resize(len); 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 //Add Gameshark codes to screen
LPCSTR ReadPos = strrchr(String,'"') + 2; LPCSTR ReadPos = strrchr(String,'"') + 2;
stdstr Buffer; stdstr Buffer;
do { do
{
char * End = strchr((char *)ReadPos,','); char * End = strchr((char *)ReadPos,',');
if (End) if (End)
{ {
Buffer.append(ReadPos,End - ReadPos); Buffer.append(ReadPos,End - ReadPos);
} else { }
else
{
Buffer.append(ReadPos); Buffer.append(ReadPos);
} }
ReadPos = strchr(ReadPos,','); ReadPos = strchr(ReadPos,',');
if (ReadPos != NULL) { if (ReadPos != NULL)
{
Buffer.append("\r\n"); Buffer.append("\r\n");
ReadPos += 1; ReadPos += 1;
} }
} while (ReadPos); } while (ReadPos);
SetDlgItemText((HWND)hDlg,IDC_CHEAT_CODES,Buffer.c_str()); SetDlgItemText(hDlg,IDC_CHEAT_CODES,Buffer.c_str());
//Add option values to screen //Add option values to screen
stdstr CheatOptionStr = g_Settings->LoadStringIndex(Cheat_Options,_this->m_EditCheat); stdstr CheatOptionStr = g_Settings->LoadStringIndex(Cheat_Options,_this->m_EditCheat);
ReadPos = strchr(CheatOptionStr.c_str(),'$'); ReadPos = strchr(CheatOptionStr.c_str(),'$');
Buffer.erase(); Buffer.erase();
if (ReadPos) { if (ReadPos)
{
ReadPos += 1; ReadPos += 1;
do { do
{
char * End = strchr((char *)ReadPos,','); char * End = strchr((char *)ReadPos,',');
if (End) if (End)
{ {
Buffer.append(ReadPos,End - ReadPos); Buffer.append(ReadPos,End - ReadPos);
} else { }
else
{
Buffer.append(ReadPos); Buffer.append(ReadPos);
} }
ReadPos = strchr(ReadPos,'$'); ReadPos = strchr(ReadPos,'$');
if (ReadPos != NULL) { if (ReadPos != NULL)
{
Buffer.append("\r\n"); Buffer.append("\r\n");
ReadPos += 1; ReadPos += 1;
} }
} while (ReadPos); } while (ReadPos);
} }
SetDlgItemText((HWND)hDlg,IDC_CHEAT_OPTIONS,Buffer.c_str()); SetDlgItemText(hDlg,IDC_CHEAT_OPTIONS,Buffer.c_str());
//Add cheat Notes //Add cheat Notes
stdstr CheatNotesStr = g_Settings->LoadStringIndex(Cheat_Notes,_this->m_EditCheat); 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)); SendMessage(hDlg,WM_COMMAND, MAKELPARAM(IDC_CHEAT_CODES, EN_CHANGE), (LPARAM)GetDlgItem(hDlg,IDC_CHEAT_CODES));
SetDlgItemText((HWND)hDlg,IDC_ADD,GS(CHEAT_EDITCHEAT_UPDATE)); SetDlgItemTextW(hDlg,IDC_ADD,GS(CHEAT_EDITCHEAT_UPDATE));
_this->RecordCheatValues(hDlg); _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) { int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lParam) {
switch (uMsg) { switch (uMsg)
{
case WM_INITDIALOG: case WM_INITDIALOG:
{ {
CCheats * _this = (CCheats *)lParam; CCheats * _this = (CCheats *)lParam;
SetProp((HWND)hDlg,"Class",_this); SetProp(hDlg,"Class",_this);
DWORD Style; DWORD Style;
RECT rcList; RECT rcList;
RECT rcButton; RECT rcButton;
SetWindowText(GetDlgItem((HWND)hDlg,IDC_CHEATSFRAME),GS(CHEAT_LIST_FRAME)); SetWindowTextW(GetDlgItem(hDlg,IDC_CHEATSFRAME),GS(CHEAT_LIST_FRAME));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_NOTESFRAME),GS(CHEAT_NOTES_FRAME)); SetWindowTextW(GetDlgItem(hDlg,IDC_NOTESFRAME),GS(CHEAT_NOTES_FRAME));
SetWindowText(GetDlgItem((HWND)hDlg,IDC_UNMARK),GS(CHEAT_MARK_NONE)); SetWindowTextW(GetDlgItem(hDlg,IDC_UNMARK),GS(CHEAT_MARK_NONE));
GetWindowRect(GetDlgItem((HWND)hDlg, IDC_CHEATSFRAME), &rcList); GetWindowRect(GetDlgItem(hDlg, IDC_CHEATSFRAME), &rcList);
GetWindowRect(GetDlgItem((HWND)hDlg, IDC_UNMARK), &rcButton); GetWindowRect(GetDlgItem(hDlg, IDC_UNMARK), &rcButton);
_this->m_hCheatTree = (HWND)CreateWindowEx(WS_EX_CLIENTEDGE,WC_TREEVIEW,"", _this->m_hCheatTree = (HWND)CreateWindowEx(WS_EX_CLIENTEDGE,WC_TREEVIEW,"",
WS_CHILD | WS_BORDER | WS_VISIBLE | WS_VSCROLL | TVS_HASLINES | WS_CHILD | WS_BORDER | WS_VISIBLE | WS_VSCROLL | TVS_HASLINES |
TVS_HASBUTTONS | TVS_LINESATROOT | TVS_DISABLEDRAGDROP |WS_TABSTOP| TVS_HASBUTTONS | TVS_LINESATROOT | TVS_DISABLEDRAGDROP |WS_TABSTOP|
TVS_FULLROWSELECT, 8, 15, rcList.right-rcList.left-16, 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); Style = GetWindowLong((HWND)_this->m_hCheatTree,GWL_STYLE);
SetWindowLong((HWND)_this->m_hCheatTree,GWL_STYLE,TVS_CHECKBOXES |TVS_SHOWSELALWAYS| 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; break;
case WM_COMMAND: 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: case ID_POPUP_ADDNEWCHEAT:
//DialogBox(hInst, MAKEINTRESOURCE(IDD_Cheats_Add),hDlg,(DLGPROC)CheatAddProc); //DialogBox(hInst, MAKEINTRESOURCE(IDD_Cheats_Add),hDlg,(DLGPROC)CheatAddProc);
break; break;
@ -993,7 +1020,7 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
{ {
TVITEM item; 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; } if (Response != IDYES) { break; }
//Delete selected cheat //Delete selected cheat
@ -1015,7 +1042,7 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
break; break;
case WM_NOTIFY: case WM_NOTIFY:
{ {
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class"); CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
if (_this->m_DeleteingEntries) if (_this->m_DeleteingEntries)
{ {
@ -1046,9 +1073,9 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
GetCursorPos(&Mouse); GetCursorPos(&Mouse);
MenuSetText((HMENU)hPopupMenu, 0, GS(CHEAT_ADDNEW), NULL); MenuSetText(hPopupMenu, 0, GS(CHEAT_ADDNEW), NULL);
MenuSetText((HMENU)hPopupMenu, 1, GS(CHEAT_EDIT), NULL); MenuSetText(hPopupMenu, 1, GS(CHEAT_EDIT), NULL);
MenuSetText((HMENU)hPopupMenu, 3, GS(CHEAT_DELETE), NULL); MenuSetText(hPopupMenu, 3, GS(CHEAT_DELETE), NULL);
if (_this->m_hSelectedItem == NULL || if (_this->m_hSelectedItem == NULL ||
TreeView_GetChild((HWND)_this->m_hCheatTree,_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,2,MF_BYPOSITION);
DeleteMenu(hPopupMenu,1,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); DestroyMenu(hMenu);
} }
if ((lpnmh->code == NM_CLICK) && (lpnmh->idFrom == IDC_MYTREE)) 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; stdstr CheatExtension;
if (!g_Settings->LoadStringIndex(Cheat_Extension,item.lParam,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); TV_SetCheckState(_this->m_hCheatTree,(HWND)ht.hItem,TV_STATE_CLEAR);
break; break;
} }
@ -1129,7 +1156,7 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
if(TVHT_ONITEMLABEL & ht.flags) 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)) { 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); TreeView_GetItem((HWND)_this->m_hCheatTree,&item);
stdstr Notes(g_Settings->LoadStringIndex(Cheat_Notes,item.lParam)); 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) if (_this->m_AddCheat)
{ {
SendMessage((HWND)_this->m_AddCheat,WM_EDITCHEAT,item.lParam,0); //edit cheat SendMessage((HWND)_this->m_AddCheat,WM_EDITCHEAT,item.lParam,0); //edit cheat
} }
} else { } else {
SetDlgItemText((HWND)hDlg,IDC_NOTES,""); SetDlgItemText(hDlg,IDC_NOTES,"");
} }
} }
} }
break; break;
case UM_CHANGECODEEXTENSION: case UM_CHANGECODEEXTENSION:
{ {
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class"); CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
; ;
//Get the selected item //Get the selected item
_this->m_hSelectedItem = (HWND)lParam; _this->m_hSelectedItem = (HWND)lParam;
@ -1173,12 +1200,12 @@ int CALLBACK CCheats::CheatListProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lP
stdstr Options; stdstr Options;
if (g_Settings->LoadStringIndex(Cheat_Options,item.lParam,Options) && Options.length() > 0) 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 { } else {
stdstr Range; stdstr Range;
if (g_Settings->LoadStringIndex(Cheat_Range,item.lParam,Range) && Range.length() > 0) 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: case WM_INITDIALOG:
{ {
CCheats * _this = (CCheats *)lParam; CCheats * _this = (CCheats *)lParam;
SetProp((HWND)hDlg,"Class",_this); SetProp(hDlg,"Class",_this);
//Find the cheat Number of the option being selected //Find the cheat Number of the option being selected
TVITEM item; TVITEM item;
@ -1217,11 +1244,11 @@ int CALLBACK CCheats::CheatsCodeExProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
stdstr CheatName = _this->GetCheatName(item.lParam,false); stdstr CheatName = _this->GetCheatName(item.lParam,false);
//Set up language support for dialog //Set up language support for dialog
SetWindowText((HWND)hDlg, GS(CHEAT_CODE_EXT_TITLE)); SetWindowTextW(hDlg, GS(CHEAT_CODE_EXT_TITLE));
SetDlgItemText((HWND)hDlg,IDC_NOTE, GS(CHEAT_CODE_EXT_TXT)); SetDlgItemTextW(hDlg,IDC_NOTE, GS(CHEAT_CODE_EXT_TXT));
SetDlgItemText((HWND)hDlg,IDOK, GS(CHEAT_OK)); SetDlgItemTextW(hDlg,IDOK, GS(CHEAT_OK));
SetDlgItemText((HWND)hDlg,IDCANCEL, GS(CHEAT_CANCEL)); SetDlgItemTextW(hDlg,IDCANCEL, GS(CHEAT_CANCEL));
SetDlgItemText((HWND)hDlg,IDC_CHEAT_NAME,CheatName.c_str()); SetDlgItemText(hDlg,IDC_CHEAT_NAME,CheatName.c_str());
//Read through and add all options to the list box //Read through and add all options to the list box
stdstr Options(g_Settings->LoadStringIndex(Cheat_Options,item.lParam)); 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; int len = NextComma == NULL ? strlen(ReadPos) : NextComma - ReadPos;
stdstr CheatExt(ReadPos); stdstr CheatExt(ReadPos);
CheatExt.resize(len); 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) { 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 //Move to next entry or end
ReadPos = NextComma ? NextComma + 1 : ReadPos + strlen(ReadPos); 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: case WM_COMMAND:
switch (LOWORD(wParam)) { switch (LOWORD(wParam)) {
case IDC_CHEAT_LIST: 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; break;
case IDOK: case IDOK:
{ {
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class"); CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
//Find the cheat Number of the option being selected //Find the cheat Number of the option being selected
TVITEM item; TVITEM item;
@ -1258,19 +1285,19 @@ int CALLBACK CCheats::CheatsCodeExProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
//Get the selected cheat extension //Get the selected cheat extension
char CheatExten[300]; 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; } 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); g_Settings->SaveStringIndex(Cheat_Extension,item.lParam,CheatExten);
_this->m_CheatSelectionChanged = true; _this->m_CheatSelectionChanged = true;
} }
RemoveProp((HWND)hDlg,"Class"); RemoveProp(hDlg,"Class");
EndDialog((HWND)hDlg,0); EndDialog(hDlg,0);
break; break;
case IDCANCEL: case IDCANCEL:
RemoveProp((HWND)hDlg,"Class"); RemoveProp(hDlg,"Class");
EndDialog((HWND)hDlg,0); EndDialog(hDlg,0);
break; break;
} }
default: default:
@ -1286,7 +1313,7 @@ int CALLBACK CCheats::CheatsCodeQuantProc (HWND hDlg,DWORD uMsg,DWORD wParam, DW
case WM_INITDIALOG: case WM_INITDIALOG:
{ {
CCheats * _this = (CCheats *)lParam; CCheats * _this = (CCheats *)lParam;
SetProp((HWND)hDlg,"Class",_this); SetProp(hDlg,"Class",_this);
//Find the cheat Number of the option being selected //Find the cheat Number of the option being selected
TVITEM item; 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)); stdstr Value(g_Settings->LoadStringIndex(Cheat_Extension,item.lParam));
//Set up language support for dialog //Set up language support for dialog
SetWindowText((HWND)hDlg, GS(CHEAT_CODE_EXT_TITLE)); SetWindowTextW(hDlg, GS(CHEAT_CODE_EXT_TITLE));
SetDlgItemText((HWND)hDlg, IDC_DIGITAL_TEXT, GS(CHEAT_CHOOSE_VALUE)); SetDlgItemTextW(hDlg, IDC_DIGITAL_TEXT, GS(CHEAT_CHOOSE_VALUE));
SetDlgItemText((HWND)hDlg, IDC_VALUE_TEXT, GS(CHEAT_VALUE)); SetDlgItemTextW(hDlg, IDC_VALUE_TEXT, GS(CHEAT_VALUE));
SetDlgItemText((HWND)hDlg, IDC_NOTES_TEXT, GS(CHEAT_NOTES)); SetDlgItemTextW(hDlg, IDC_NOTES_TEXT, GS(CHEAT_NOTES));
SetDlgItemText((HWND)hDlg,IDC_NOTES,RangeNote.c_str()); SetDlgItemText(hDlg,IDC_NOTES,RangeNote.c_str());
SetDlgItemText((HWND)hDlg,IDC_CHEAT_NAME,CheatName.c_str()); SetDlgItemText(hDlg,IDC_CHEAT_NAME,CheatName.c_str());
SetDlgItemText((HWND)hDlg,IDC_VALUE,Value.c_str()); SetDlgItemText(hDlg,IDC_VALUE,Value.c_str());
Start = (WORD)(Range.c_str()[0] == '$'?AsciiToHex(&Range.c_str()[1]):atol(Range.c_str())); Start = (WORD)(Range.c_str()[0] == '$'?AsciiToHex(&Range.c_str()[1]):atol(Range.c_str()));
const char * ReadPos = strrchr(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]; char Text[500];
sprintf(Text,"%s $%X %s $%X",GS(CHEAT_FROM),Start,GS(CHEAT_TO),Stop); 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; break;
case WM_COMMAND: case WM_COMMAND:
@ -1326,25 +1353,25 @@ int CALLBACK CCheats::CheatsCodeQuantProc (HWND hDlg,DWORD uMsg,DWORD wParam, DW
if (HIWORD(wParam) == EN_UPDATE) { if (HIWORD(wParam) == EN_UPDATE) {
TCHAR szTmp[10], szTmp2[10]; TCHAR szTmp[10], szTmp2[10];
DWORD Value; 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); Value = szTmp[0] =='$'?AsciiToHex(&szTmp[1]):AsciiToHex(szTmp);
if (Value > Stop) { Value = Stop; } if (Value > Stop) { Value = Stop; }
if (Value < Start) { Value = Start; } if (Value < Start) { Value = Start; }
sprintf(szTmp2,"$%X",Value); sprintf(szTmp2,"$%X",Value);
if (strcmp(szTmp,szTmp2) != 0) { 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; } 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 { } else {
WORD NewSelStart, NewSelStop; 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; } if (NewSelStart != 0) { SelStart = NewSelStart; SelStop = NewSelStop; }
} }
} }
break; break;
case IDOK: case IDOK:
{ {
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class"); CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
//Find the cheat Number of the option being selected //Find the cheat Number of the option being selected
TVITEM item; TVITEM item;
@ -1356,7 +1383,7 @@ int CALLBACK CCheats::CheatsCodeQuantProc (HWND hDlg,DWORD uMsg,DWORD wParam, DW
TCHAR CheatExten[300], szTmp[10]; TCHAR CheatExten[300], szTmp[10];
DWORD Value; 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); Value = szTmp[0] =='$'?AsciiToHex(&szTmp[1]):AsciiToHex(szTmp);
if (Value > Stop) { Value = Stop; } if (Value > Stop) { Value = Stop; }
if (Value < Start) { Value = Start; } 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); g_Settings->SaveStringIndex(Cheat_Extension, item.lParam,CheatExten);
_this->m_CheatSelectionChanged = true; _this->m_CheatSelectionChanged = true;
} }
RemoveProp((HWND)hDlg,"Class"); RemoveProp(hDlg,"Class");
EndDialog((HWND)hDlg,0); EndDialog(hDlg,0);
break; break;
case IDCANCEL: case IDCANCEL:
RemoveProp((HWND)hDlg,"Class"); RemoveProp(hDlg,"Class");
EndDialog((HWND)hDlg,0); EndDialog(hDlg,0);
break; break;
} }
default: default:
@ -1393,15 +1420,15 @@ int CALLBACK CCheats::ManageCheatsProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
case WM_INITDIALOG: case WM_INITDIALOG:
{ {
CCheats * _this = (CCheats *)lParam; CCheats * _this = (CCheats *)lParam;
SetProp((HWND)hDlg,"Class",_this); SetProp(hDlg,"Class",_this);
_this->m_Window = hDlg; _this->m_Window = hDlg;
WINDOWPLACEMENT WndPlac; WINDOWPLACEMENT WndPlac;
WndPlac.length = sizeof(WndPlac); WndPlac.length = sizeof(WndPlac);
GetWindowPlacement((HWND)hDlg, &WndPlac); GetWindowPlacement(hDlg, &WndPlac);
SetWindowText((HWND)hDlg, GS(CHEAT_TITLE)); SetWindowTextW(hDlg, GS(CHEAT_TITLE));
_this->m_hSelectCheat = (HWND)CreateDialogParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_List),(HWND)hDlg,(DLGPROC)CheatListProc,(LPARAM)_this); _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); SetWindowPos((HWND)_this->m_hSelectCheat,HWND_TOP, 5, 8, 0, 0, SWP_NOSIZE);
ShowWindow((HWND)_this->m_hSelectCheat,SW_SHOW); 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; _this->m_DialogState = CONTRACTED;
WndPlac.rcNormalPosition.right = WndPlac.rcNormalPosition.left + _this->m_MinSizeDlg; 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 { } 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); SetWindowPos((HWND)_this->m_AddCheat, HWND_TOP, (rc->right - rc->left)/2, 8, 0, 0, SWP_NOSIZE);
ShowWindow((HWND)_this->m_AddCheat,SW_HIDE); 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; _this->m_DialogState = CONTRACTED;
WndPlac.rcNormalPosition.right = WndPlac.rcNormalPosition.left + _this->m_MinSizeDlg; WndPlac.rcNormalPosition.right = WndPlac.rcNormalPosition.left + _this->m_MinSizeDlg;
SetWindowPlacement((HWND)hDlg, &WndPlac); SetWindowPlacement(hDlg, &WndPlac);
GetClientRect((HWND)hDlg, rc); GetClientRect(hDlg, rc);
HWND hStateButton = GetDlgItem((HWND)hDlg, IDC_STATE); HWND hStateButton = GetDlgItem(hDlg, IDC_STATE);
SetWindowPos(hStateButton, HWND_TOP, (rc->right - rc->left) - 16, 0, 16, rc->bottom - rc->top, 0); 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 ); 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 //re-center cheat window
RECT rcDlg, rcParent; RECT rcDlg, rcParent;
GetWindowRect((HWND)hDlg, &rcDlg); GetWindowRect(hDlg, &rcDlg);
GetWindowRect(GetParent((HWND)hDlg), &rcParent); GetWindowRect(GetParent(hDlg), &rcParent);
int DlgWidth = rcDlg.right - rcDlg.left; int DlgWidth = rcDlg.right - rcDlg.left;
int DlgHeight = rcDlg.bottom - rcDlg.top; 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 X = (((rcParent.right - rcParent.left) - DlgWidth) / 2) + rcParent.left;
int Y = (((rcParent.bottom - rcParent.top) - DlgHeight) / 2) + rcParent.top; 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(); _this->RefreshCheatManager();
} }
@ -1461,36 +1488,36 @@ int CALLBACK CCheats::ManageCheatsProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD
switch (LOWORD(wParam)) { switch (LOWORD(wParam)) {
case IDCANCEL: case IDCANCEL:
{ {
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class"); CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
if (_this->m_AddCheat) { if (_this->m_AddCheat) {
DestroyWindow((HWND)_this->m_AddCheat); DestroyWindow((HWND)_this->m_AddCheat);
_this->m_AddCheat = NULL; _this->m_AddCheat = NULL;
} }
_this->m_Window = NULL; _this->m_Window = NULL;
} }
RemoveProp((HWND)hDlg,"Class"); RemoveProp(hDlg,"Class");
EndDialog((HWND)hDlg,0); EndDialog(hDlg,0);
break; break;
case IDC_STATE: case IDC_STATE:
{ {
CCheats * _this = (CCheats *)GetProp((HWND)hDlg,"Class"); CCheats * _this = (CCheats *)GetProp(hDlg,"Class");
WINDOWPLACEMENT WndPlac; WINDOWPLACEMENT WndPlac;
WndPlac.length = sizeof(WndPlac); WndPlac.length = sizeof(WndPlac);
GetWindowPlacement((HWND)hDlg, &WndPlac); GetWindowPlacement(hDlg, &WndPlac);
if (_this->m_DialogState == CONTRACTED) if (_this->m_DialogState == CONTRACTED)
{ {
_this->m_DialogState = EXPANDED; _this->m_DialogState = EXPANDED;
WndPlac.rcNormalPosition.right = WndPlac.rcNormalPosition.left + _this->m_MaxSizeDlg; WndPlac.rcNormalPosition.right = WndPlac.rcNormalPosition.left + _this->m_MaxSizeDlg;
SetWindowPlacement((HWND)hDlg, &WndPlac); SetWindowPlacement(hDlg, &WndPlac);
RECT clientrect; RECT clientrect;
GetClientRect((HWND)hDlg, &clientrect); GetClientRect(hDlg, &clientrect);
HWND hStateButton = GetDlgItem((HWND)hDlg, IDC_STATE); HWND hStateButton = GetDlgItem(hDlg, IDC_STATE);
SetWindowPos(hStateButton, HWND_TOP, (clientrect.right - clientrect.left) - 16, 0, 16, clientrect.bottom - clientrect.top, 0); 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 ); 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); 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; _this->m_DialogState = CONTRACTED;
WndPlac.rcNormalPosition.right = WndPlac.rcNormalPosition.left + _this->m_MinSizeDlg; 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 ); 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; RECT clientrect;
GetClientRect((HWND)hDlg, &clientrect); GetClientRect(hDlg, &clientrect);
HWND hStateButton = GetDlgItem((HWND)hDlg, IDC_STATE); HWND hStateButton = GetDlgItem(hDlg, IDC_STATE);
SetWindowPos(hStateButton, HWND_TOP, (clientrect.right - clientrect.left) - 16, 0, 16, clientrect.bottom - clientrect.top, 0); SetWindowPos(hStateButton, HWND_TOP, (clientrect.right - clientrect.left) - 16, 0, 16, clientrect.bottom - clientrect.top, 0);
ShowWindow((HWND)_this->m_AddCheat,SW_HIDE); 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); return ((int)(tvItem.state >> 12) -1);
} }
void CCheats::MenuSetText ( HMENU hMenu, int MenuPos, const char * Title, char * ShotCut) { void CCheats::MenuSetText ( HMENU hMenu, int MenuPos, const wchar_t * Title, const wchar_t * ShotCut)
MENUITEMINFO MenuInfo; {
char String[256]; 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)); memset(&MenuInfo, 0, sizeof(MENUITEMINFO));
MenuInfo.cbSize = 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.dwTypeData = String;
MenuInfo.cch = 256; MenuInfo.cch = 256;
GetMenuItemInfo((HMENU)hMenu,MenuPos,true,&MenuInfo); GetMenuItemInfoW(hMenu,MenuPos,true,&MenuInfo);
strcpy(String,Title); wcscpy(String,Title);
if (strchr(String,'\t') != NULL) { *(strchr(String,'\t')) = '\0'; } if (wcschr(String,'\t') != NULL) { *(wcschr(String,'\t')) = '\0'; }
if (ShotCut) { sprintf(String,"%s\t%s",String,ShotCut); } if (ShotCut) { _swprintf(String,L"%s\t%s",String,ShotCut); }
SetMenuItemInfo((HMENU)hMenu,MenuPos,true,&MenuInfo); SetMenuItemInfoW(hMenu,MenuPos,true,&MenuInfo);
} }
void CCheats::DeleteCheat(int Index) void CCheats::DeleteCheat(int Index)
@ -1729,7 +1757,7 @@ stdstr CCheats::ReadCodeString (HWND hDlg, bool &validcodes, bool &validoptions,
char codestring[2048]; char codestring[2048];
memset(codestring, '\0', sizeof(codestring)); 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; } if (numlines == 0) { validcodes = false; }
for (linecount=0; linecount<numlines; linecount++) //read line after line (bypassing limitation GetDlgItemText) 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); //str[0] = sizeof(str) > 255?255:sizeof(str);
*(LPWORD)str = 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; str[len] = 0;
if (len <= 0) { continue; } if (len <= 0) { continue; }
@ -1803,14 +1831,14 @@ stdstr CCheats::ReadOptionsString(HWND hDlg, bool &/*validcodes*/, bool &validop
char optionsstring[2048]; char optionsstring[2048];
memset(optionsstring, '\0', sizeof(optionsstring)); 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) for (linecount=0; linecount<numlines; linecount++) //read line after line (bypassing limitation GetDlgItemText)
{ {
memset(str,0,sizeof(str)); memset(str,0,sizeof(str));
//str[0] = sizeof(str) > 255?255:sizeof(str); //str[0] = sizeof(str) > 255?255:sizeof(str);
*(LPWORD)str = 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; str[len] = 0;
if (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 bool TV_SetCheckState(HWND hwndTreeView, HWND hItem, TV_CHECK_STATE state);
static int TV_GetCheckState(HWND hwndTreeView, HWND hItem); static int TV_GetCheckState(HWND hwndTreeView, HWND hItem);
static DWORD AsciiToHex ( const char * HexValue ); 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 //UI Functions

View File

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

View File

@ -21,7 +21,7 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) {
OPCODE Command; OPCODE Command;
if (!g_MMU->LW_VAddr(PC + 4, Command.Hex)) { 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); //ExitThread(0);
return TRUE; return TRUE;
} }
@ -78,7 +78,7 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) {
default: default:
if (g_Settings->LoadBool(Debugger_Enabled)) 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; return TRUE;
} }
@ -101,14 +101,14 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) {
default: default:
if (g_Settings->LoadBool(Debugger_Enabled)) 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; return TRUE;
} }
} else { } else {
if (g_Settings->LoadBool(Debugger_Enabled)) 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; return TRUE;
} }
@ -131,7 +131,7 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) {
default: default:
if (g_Settings->LoadBool(Debugger_Enabled)) 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; return TRUE;
} }
@ -174,7 +174,7 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) {
default: default:
if (g_Settings->LoadBool(Debugger_Enabled)) 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; return TRUE;
} }

View File

@ -843,7 +843,7 @@ void R4300iOp32::LB (void) {
if (m_Opcode.rt == 0) { return; } if (m_Opcode.rt == 0) { return; }
if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) { if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) {
if (bShowTLBMisses()) { if (bShowTLBMisses()) {
g_Notify->DisplayError("LB TLB: %X",Address); g_Notify->DisplayError(L"LB TLB: %X",Address);
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} else { } else {
@ -856,7 +856,7 @@ void R4300iOp32::LH (void) {
if ((Address & 1) != 0) { ADDRESS_ERROR_EXCEPTION(Address,TRUE); } if ((Address & 1) != 0) { ADDRESS_ERROR_EXCEPTION(Address,TRUE); }
if (!g_MMU->LH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0])) { if (!g_MMU->LH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0])) {
if (bShowTLBMisses()) { if (bShowTLBMisses()) {
g_Notify->DisplayError("LH TLB: %X",Address); g_Notify->DisplayError(L"LH TLB: %X",Address);
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} else { } else {
@ -873,7 +873,7 @@ void R4300iOp32::LWL (void) {
if (!g_MMU->LW_VAddr((Address & ~3),Value)) if (!g_MMU->LW_VAddr((Address & ~3),Value))
{ {
if (bShowTLBMisses()) { if (bShowTLBMisses()) {
g_Notify->DisplayError("LWL TLB: %X",Address); g_Notify->DisplayError(L"LWL TLB: %X",Address);
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
return; return;
@ -896,7 +896,7 @@ void R4300iOp32::LW (void) {
if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) { if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) {
if (bShowTLBMisses()) { if (bShowTLBMisses()) {
g_Notify->DisplayError("LW TLB: %X",Address); g_Notify->DisplayError(L"LW TLB: %X",Address);
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} else { } else {
@ -908,7 +908,7 @@ void R4300iOp32::LBU (void) {
DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; 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 (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) {
if (bShowTLBMisses()) { if (bShowTLBMisses()) {
g_Notify->DisplayError("LBU TLB: %X",Address); g_Notify->DisplayError(L"LBU TLB: %X",Address);
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} else { } else {
@ -921,7 +921,7 @@ void R4300iOp32::LHU (void) {
if ((Address & 1) != 0) { ADDRESS_ERROR_EXCEPTION(Address,TRUE); } if ((Address & 1) != 0) { ADDRESS_ERROR_EXCEPTION(Address,TRUE); }
if (!g_MMU->LH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0])) { if (!g_MMU->LH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0])) {
if (bShowTLBMisses()) { if (bShowTLBMisses()) {
g_Notify->DisplayError("LHU TLB: %X",Address); g_Notify->DisplayError(L"LHU TLB: %X",Address);
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} else { } else {
@ -940,7 +940,7 @@ void R4300iOp32::LWR (void) {
g_Notify->BreakPoint(__FILE__,__LINE__); g_Notify->BreakPoint(__FILE__,__LINE__);
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError("LWR TLB: %X",Address); g_Notify->DisplayError(L"LWR TLB: %X",Address);
} }
return; return;
} }
@ -956,7 +956,7 @@ void R4300iOp32::LWU (void) {
if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) { if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) {
if (bShowTLBMisses()) { if (bShowTLBMisses()) {
g_Notify->DisplayError("LWU TLB: %X",Address); g_Notify->DisplayError(L"LWU TLB: %X",Address);
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} else { } else {
@ -973,7 +973,7 @@ void R4300iOp32::LL (void) {
if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) { if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) {
if (bShowTLBMisses()) { if (bShowTLBMisses()) {
g_Notify->DisplayError("LL TLB: %X",Address); g_Notify->DisplayError(L"LL TLB: %X",Address);
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} else { } else {
@ -1067,7 +1067,7 @@ void R4300iOp32::SPECIAL_SLTU (void) {
void R4300iOp32::SPECIAL_TEQ (void) { void R4300iOp32::SPECIAL_TEQ (void) {
if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0] && g_Settings->LoadBool(Debugger_Enabled)) 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)) 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(); g_Reg->CheckInterrupts();
break; break;
@ -1254,7 +1254,7 @@ void R4300iOp32::COP0_MT (void) {
_CP0[m_Opcode.rd] &= 0xFFFFCFF; _CP0[m_Opcode.rd] &= 0xFFFFCFF;
if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 && g_Settings->LoadBool(Debugger_Enabled) ) 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; break;
default: default:
@ -1272,7 +1272,7 @@ void R4300iOp32::COP1_CF (void) {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION
if (m_Opcode.fs != 31 && m_Opcode.fs != 0) 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; return;
} }
_GPR[m_Opcode.rt].W[0] = (int)_FPCR[m_Opcode.fs]; _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_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_6105: *(DWORD *)&((g_MMU->Rdram())[0x3F0]) = g_MMU->RdramSize(); break;
case CIC_NUS_6106: *(DWORD *)&((g_MMU->Rdram())[0x318]) = 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 ( 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->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY;
g_Reg->MI_INTR_REG |= MI_INTR_PI; g_Reg->MI_INTR_REG |= MI_INTR_PI;
g_Reg->CheckInterrupts(); g_Reg->CheckInterrupts();
@ -67,7 +67,7 @@ void CDMA::PI_DMA_READ (void) {
} }
if (g_System->m_SaveUsing == SaveChip_FlashRam) 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->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY;
g_Reg->MI_INTR_REG |= MI_INTR_PI; g_Reg->MI_INTR_REG |= MI_INTR_PI;
g_Reg->CheckInterrupts(); g_Reg->CheckInterrupts();
@ -75,7 +75,7 @@ void CDMA::PI_DMA_READ (void) {
} }
if (bHaveDebugger()) 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->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY;
g_Reg->MI_INTR_REG |= MI_INTR_PI; 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; 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_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->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY;
g_Reg->MI_INTR_REG |= MI_INTR_PI; g_Reg->MI_INTR_REG |= MI_INTR_PI;
g_Reg->CheckInterrupts(); g_Reg->CheckInterrupts();
@ -175,7 +175,7 @@ void CDMA::PI_DMA_WRITE (void)
return; 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->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY;
g_Reg->MI_INTR_REG |= MI_INTR_PI; g_Reg->MI_INTR_REG |= MI_INTR_PI;
g_Reg->CheckInterrupts(); g_Reg->CheckInterrupts();
@ -189,7 +189,7 @@ void CDMA::SP_DMA_READ (void) {
{ {
if (bHaveDebugger()) 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_DMA_BUSY_REG = 0;
g_Reg->SP_STATUS_REG &= ~SP_STATUS_DMA_BUSY; g_Reg->SP_STATUS_REG &= ~SP_STATUS_DMA_BUSY;
@ -200,7 +200,7 @@ void CDMA::SP_DMA_READ (void) {
{ {
if (bHaveDebugger()) 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; return;
} }
@ -222,7 +222,7 @@ void CDMA::SP_DMA_WRITE (void)
{ {
if (bHaveDebugger()) 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; return;
} }
@ -231,7 +231,7 @@ void CDMA::SP_DMA_WRITE (void)
{ {
if (bHaveDebugger()) 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; return;
} }

View File

@ -59,13 +59,13 @@ void CEeprom::EepromCommand ( BYTE * Command) {
} }
break; break;
case 4: // Read from Eeprom 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[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("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]); ReadFrom(&Command[4],Command[3]);
break; break;
case 5: //Write to Eeprom 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[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("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]); WriteTo(&Command[4],Command[3]);
break; break;
case 6: //RTC Status query case 6: //RTC Status query
@ -101,10 +101,10 @@ void CEeprom::EepromCommand ( BYTE * Command) {
break; break;
case 8: case 8:
//Write RTC, unimplemented //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; break;
default: 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()) 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; len = 0x10000;
} }
@ -49,7 +49,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
{ {
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->DisplayError("Unaligned flash ram read ???"); g_Notify->DisplayError(L"Unaligned flash ram read ???");
} }
return; return;
} }
@ -80,7 +80,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
{ {
if (bHaveDebugger()) 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); *((DWORD *)(dest)) = (DWORD)((m_FlashStatus >> 32) & 0xFFFFFFFF);
@ -89,7 +89,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len)
default: default:
if (bHaveDebugger()) 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: default:
if (bHaveDebugger()) 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: default:
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->DisplayError("Reading from flash ram status (%X)",PAddr); g_Notify->DisplayError(L"Reading from flash ram status (%X)",PAddr);
} }
break; break;
} }
@ -193,7 +193,7 @@ void CFlashram::WriteToFlashCommand(DWORD FlashRAM_Command) {
} }
break; break;
default: 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; m_FlashFlag = FLASHRAM_MODE_NOPES;
break; break;
@ -222,7 +222,7 @@ void CFlashram::WriteToFlashCommand(DWORD FlashRAM_Command) {
default: default:
if (bHaveDebugger()) 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)) { if (!TranslateVaddr(VAddr,PAddr)) {
MoveConstToX86reg(0,Reg); MoveConstToX86reg(0,Reg);
CPU_Message("Compile_LB\nFailed to translate address %X",VAddr); 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; return;
} }
@ -506,7 +506,7 @@ void CMipsMemoryVM::Compile_LB ( x86Reg Reg, DWORD VAddr, BOOL SignExtend) {
break; break;
default: default:
MoveConstToX86reg(0,Reg); 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)) { if (!TranslateVaddr(VAddr, PAddr)) {
MoveConstToX86reg(0,Reg); MoveConstToX86reg(0,Reg);
CPU_Message("Compile_LH\nFailed to translate address %X",VAddr); 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; return;
} }
@ -562,7 +562,7 @@ void CMipsMemoryVM::Compile_LH ( x86Reg Reg, DWORD VAddr, BOOL SignExtend) {
break; break;
default: default:
MoveConstToX86reg(0,Reg); 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; case 0x04080000: MoveVariableToX86reg(&g_Reg->SP_PC_REG,"SP_PC_REG",Reg); break;
default: default:
MoveConstToX86reg(0,Reg); 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; break;
case 0x04100000: 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; case 0x0430000C: MoveVariableToX86reg(&g_Reg->MI_INTR_MASK_REG,"MI_INTR_MASK_REG",Reg); break;
default: default:
MoveConstToX86reg(0,Reg); 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; break;
case 0x04400000: case 0x04400000:
@ -660,7 +660,7 @@ void CMipsMemoryVM::Compile_LW (x86Reg Reg, DWORD VAddr ) {
break; break;
default: default:
MoveConstToX86reg(0,Reg); 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; break;
case 0x04500000: /* AI registers */ case 0x04500000: /* AI registers */
@ -704,7 +704,7 @@ void CMipsMemoryVM::Compile_LW (x86Reg Reg, DWORD VAddr ) {
break; break;
default: default:
MoveConstToX86reg(0,Reg); 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; break;
case 0x04600000: 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; case 0x04600030: MoveVariableToX86reg(&g_Reg->PI_BSD_DOM2_RLS_REG,"PI_BSD_DOM2_RLS_REG",Reg); break;
default: default:
MoveConstToX86reg(0,Reg); 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; break;
case 0x04700000: 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; case 0x04700010: MoveVariableToX86reg(&g_Reg->RI_REFRESH_REG,"RI_REFRESH_REG",Reg); break;
default: default:
MoveConstToX86reg(0,Reg); 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; break;
case 0x04800000: 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; case 0x04800018: MoveVariableToX86reg(&g_Reg->SI_STATUS_REG,"SI_STATUS_REG",Reg); break;
default: default:
MoveConstToX86reg(0,Reg); 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; break;
case 0x1FC00000: case 0x1FC00000:
@ -754,7 +754,7 @@ void CMipsMemoryVM::Compile_LW (x86Reg Reg, DWORD VAddr ) {
MoveConstToX86reg(((PAddr & 0xFFFF) << 16) | (PAddr & 0xFFFF),Reg); MoveConstToX86reg(((PAddr & 0xFFFF) << 16) | (PAddr & 0xFFFF),Reg);
if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) {
CPU_Message(__FUNCTION__ "\nFailed to translate address: %X",VAddr); 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)) { if (!TranslateVaddr(VAddr, PAddr)) {
CPU_Message("Compile_SB\nFailed to translate address %X",VAddr); 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; return;
} }
@ -797,7 +797,7 @@ void CMipsMemoryVM::Compile_SB_Const ( BYTE Value, DWORD VAddr ) {
MoveConstByteToVariable(Value,PAddr + m_RDRAM,VarName); MoveConstByteToVariable(Value,PAddr + m_RDRAM,VarName);
break; break;
default: 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)) { if (!TranslateVaddr(VAddr, PAddr)) {
CPU_Message("Compile_SB\nFailed to translate address %X",VAddr); 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; return;
} }
@ -839,7 +839,7 @@ void CMipsMemoryVM::Compile_SB_Register ( x86Reg Reg, DWORD VAddr ) {
MoveX86regByteToVariable(Reg,PAddr + m_RDRAM,VarName); MoveX86regByteToVariable(Reg,PAddr + m_RDRAM,VarName);
break; break;
default: 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)) { if (!TranslateVaddr(VAddr, PAddr)) {
CPU_Message("Compile_SH\nFailed to translate address %X",VAddr); 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; return;
} }
@ -879,7 +879,7 @@ void CMipsMemoryVM::Compile_SH_Const ( WORD Value, DWORD VAddr ) {
MoveConstHalfToVariable(Value,PAddr + m_RDRAM,VarName); MoveConstHalfToVariable(Value,PAddr + m_RDRAM,VarName);
break; break;
default: 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)) { if (!TranslateVaddr(VAddr, PAddr)) {
CPU_Message("Compile_SH\nFailed to translate address %X",VAddr); 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; return;
} }
@ -921,7 +921,7 @@ void CMipsMemoryVM::Compile_SH_Register ( x86Reg Reg, DWORD VAddr ) {
MoveX86regHalfToVariable(Reg,PAddr + m_RDRAM,VarName); MoveX86regHalfToVariable(Reg,PAddr + m_RDRAM,VarName);
break; break;
default: 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)) { if (!TranslateVaddr(VAddr, PAddr)) {
CPU_Message("Compile_SW\nFailed to translate address %X",VAddr); 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; return;
} }
@ -980,7 +980,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
case 0x03F8000C: break; case 0x03F8000C: break;
case 0x03F80014: break; case 0x03F80014: break;
default: 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; break;
case 0x04000000: 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 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; case 0x04080000: MoveConstToVariable(Value & 0xFFC,&g_Reg->SP_PC_REG,"SP_PC_REG"); break;
default: 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; break;
case 0x04100000: case 0x04100000:
@ -1031,7 +1031,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
break; break;
default: 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; break;
case 0x04300000: case 0x04300000:
@ -1087,7 +1087,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
} }
break; break;
default: 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; break;
case 0x04400000: 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 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; case 0x04400034: MoveConstToVariable(Value,&g_Reg->VI_Y_SCALE_REG,"VI_Y_SCALE_REG"); break;
default: 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; break;
case 0x04500000: /* AI registers */ case 0x04500000: /* AI registers */
@ -1176,7 +1176,7 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
default: default:
sprintf(VarName,"m_RDRAM + %X",PAddr); sprintf(VarName,"m_RDRAM + %X",PAddr);
MoveConstToVariable(Value,PAddr + m_RDRAM,VarName); 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; break;
case 0x04600000: 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 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; case 0x04600020: MoveConstToVariable((Value & 0xFF),&g_Reg->PI_BSD_DOM1_RLS_REG,"PI_BSD_DOM1_RLS_REG"); break;
default: 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; break;
case 0x04700000: 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 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; case 0x0470000C: MoveConstToVariable(Value,&g_Reg->RI_SELECT_REG,"RI_SELECT_REG"); break;
default: 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; break;
case 0x04800000: case 0x04800000:
@ -1256,11 +1256,11 @@ void CMipsMemoryVM::Compile_SW_Const ( DWORD Value, DWORD VAddr ) {
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
break; break;
default: 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; break;
default: 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)) { if (!TranslateVaddr(VAddr, PAddr)) {
CPU_Message("Compile_SW_Register\nFailed to translate address %X",VAddr); 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; return;
} }
@ -1341,7 +1341,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
MoveX86regToVariable(Reg,PAddr + m_RDRAM,VarName); MoveX86regToVariable(Reg,PAddr + m_RDRAM,VarName);
} else { } else {
CPU_Message(" Should be moving %s in to %X ?!?",x86_Name(Reg),VAddr); 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; break;
@ -1375,7 +1375,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
break; break;
default: default:
CPU_Message(" Should be moving %s in to %X ?!?",x86_Name(Reg),VAddr); 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; break;
case 0x04400000: 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; case 0x04400034: MoveX86regToVariable(Reg,&g_Reg->VI_Y_SCALE_REG,"VI_Y_SCALE_REG"); break;
default: default:
CPU_Message(" Should be moving %s in to %X ?!?",x86_Name(Reg),VAddr); 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; break;
case 0x04500000: /* AI registers */ case 0x04500000: /* AI registers */
@ -1472,7 +1472,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
default: default:
sprintf(VarName,"m_RDRAM + %X",PAddr); sprintf(VarName,"m_RDRAM + %X",PAddr);
MoveX86regToVariable(Reg,PAddr + m_RDRAM,VarName); 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; break;
case 0x04600000: case 0x04600000:
switch (PAddr) { switch (PAddr) {
@ -1493,7 +1493,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
break; break;
case 0x04600010: 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"); AndConstToVariable((DWORD)~MI_INTR_PI,&g_Reg->MI_INTR_REG,"MI_INTR_REG");
BeforeCallDirect(m_RegWorkingSet); BeforeCallDirect(m_RegWorkingSet);
MoveConstToX86reg((DWORD)g_Reg,x86_ECX); MoveConstToX86reg((DWORD)g_Reg,x86_ECX);
@ -1518,14 +1518,14 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
break; break;
default: default:
CPU_Message(" Should be moving %s in to %X ?!?",x86_Name(Reg),VAddr); 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; break;
case 0x04700000: case 0x04700000:
switch (PAddr) { switch (PAddr) {
case 0x04700010: MoveX86regToVariable(Reg,&g_Reg->RI_REFRESH_REG,"RI_REFRESH_REG"); break; case 0x04700010: MoveX86regToVariable(Reg,&g_Reg->RI_REFRESH_REG,"RI_REFRESH_REG"); break;
default: 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; break;
case 0x04800000: case 0x04800000:
@ -1554,7 +1554,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
break; break;
default: 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; break;
case 0x1FC00000: case 0x1FC00000:
@ -1563,7 +1563,7 @@ void CMipsMemoryVM::Compile_SW_Register (x86Reg Reg, DWORD VAddr )
break; break;
default: default:
CPU_Message(" Should be moving %s in to %X ?!?",x86_Name(Reg),VAddr); 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: case 0xB6:
if (!LB_NonMemory(MemAddress,(DWORD *)Reg,FALSE)) { if (!LB_NonMemory(MemAddress,(DWORD *)Reg,FALSE)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { 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, (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip); *(unsigned char *)lpEP->ContextRecord->Eip);
} }
@ -1749,7 +1749,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0xB7: case 0xB7:
if (!LH_NonMemory(MemAddress,(DWORD *)Reg,FALSE)) { if (!LH_NonMemory(MemAddress,(DWORD *)Reg,FALSE)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { 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, (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip); *(unsigned char *)lpEP->ContextRecord->Eip);
} }
@ -1759,7 +1759,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0xBE: case 0xBE:
if (!LB_NonMemory(MemAddress,Reg,TRUE)) { if (!LB_NonMemory(MemAddress,Reg,TRUE)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { 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, (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip); *(unsigned char *)lpEP->ContextRecord->Eip);
} }
@ -1769,7 +1769,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0xBF: case 0xBF:
if (!LH_NonMemory(MemAddress,Reg,TRUE)) { if (!LH_NonMemory(MemAddress,Reg,TRUE)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { 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, (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip); *(unsigned char *)lpEP->ContextRecord->Eip);
} }
@ -1786,7 +1786,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0x8B: case 0x8B:
if (!LH_NonMemory(MemAddress,Reg,FALSE)) { if (!LH_NonMemory(MemAddress,Reg,FALSE)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { 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, (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip); *(unsigned char *)lpEP->ContextRecord->Eip);
} }
@ -1796,7 +1796,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0x89: case 0x89:
if (!SH_NonMemory(MemAddress,*(WORD *)Reg)) { if (!SH_NonMemory(MemAddress,*(WORD *)Reg)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { 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); *(unsigned char *)lpEP->ContextRecord->Eip);
} }
} }
@ -1810,7 +1810,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
} }
if (!SH_NonMemory(MemAddress,*(WORD *)ReadPos)) { if (!SH_NonMemory(MemAddress,*(WORD *)ReadPos)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { 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); *(unsigned char *)lpEP->ContextRecord->Eip);
} }
} }
@ -1824,7 +1824,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0x88: case 0x88:
if (!SB_NonMemory(MemAddress,*(BYTE *)Reg)) { if (!SB_NonMemory(MemAddress,*(BYTE *)Reg)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { 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, (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip); *(unsigned char *)lpEP->ContextRecord->Eip);
} }
@ -1834,7 +1834,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0x8A: case 0x8A:
if (!LB_NonMemory(MemAddress,Reg,FALSE)) { if (!LB_NonMemory(MemAddress,Reg,FALSE)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { 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, (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip); *(unsigned char *)lpEP->ContextRecord->Eip);
} }
@ -1844,7 +1844,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0x8B: case 0x8B:
if (!LW_NonMemory(MemAddress,Reg)) { if (!LW_NonMemory(MemAddress,Reg)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { 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, (char *)exRec.ExceptionInformation[1] - (char *)m_RDRAM,
*(unsigned char *)lpEP->ContextRecord->Eip); *(unsigned char *)lpEP->ContextRecord->Eip);
} }
@ -1854,7 +1854,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
case 0x89: case 0x89:
if (!SW_NonMemory(MemAddress,*(DWORD *)Reg)) { if (!SW_NonMemory(MemAddress,*(DWORD *)Reg)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { 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); *(unsigned char *)lpEP->ContextRecord->Eip);
} }
} }
@ -1868,7 +1868,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
} }
if (!SB_NonMemory(MemAddress,*(BYTE *)ReadPos)) { if (!SB_NonMemory(MemAddress,*(BYTE *)ReadPos)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { 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); *(unsigned char *)lpEP->ContextRecord->Eip);
} }
} }
@ -1882,7 +1882,7 @@ int CMipsMemoryVM::MemoryFilter( DWORD dwExptCode, void * lpExceptionPointer )
} }
if (!SW_NonMemory(MemAddress,*(DWORD *)ReadPos)) { if (!SW_NonMemory(MemAddress,*(DWORD *)ReadPos)) {
if (g_Settings->LoadDword(Debugger_ShowUnhandledMemory)) { 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); *(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); VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,PAGE_READWRITE, &OldProtect);
*(BYTE *)(m_RDRAM+PAddr) = Value; *(BYTE *)(m_RDRAM+PAddr) = Value;
VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,OldProtect, &OldProtect); VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,OldProtect, &OldProtect);
g_Notify->DisplayError("FrameBufferWrite"); g_Notify->DisplayError(L"FrameBufferWrite");
if (FrameBufferWrite) { FrameBufferWrite(PAddr,1); } if (FrameBufferWrite) { FrameBufferWrite(PAddr,1); }
break; break;
} }
@ -2234,7 +2234,7 @@ int CMipsMemoryVM::SH_NonMemory ( DWORD PAddr, WORD Value ) {
if (FrameBufferWrite) { FrameBufferWrite(PAddr & ~0xFFF,2); } if (FrameBufferWrite) { FrameBufferWrite(PAddr & ~0xFFF,2); }
//*(WORD *)(m_RDRAM+PAddr) = 0xFFFF; //*(WORD *)(m_RDRAM+PAddr) = 0xFFFF;
//VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,PAGE_NOACCESS, &OldProtect); //VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,PAGE_NOACCESS, &OldProtect);
g_Notify->DisplayError("PAddr = %x",PAddr); g_Notify->DisplayError(L"PAddr = %x",PAddr);
break; break;
} }
#endif #endif
@ -2285,7 +2285,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,PAGE_READWRITE, &OldProtect); VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,PAGE_READWRITE, &OldProtect);
*(DWORD *)(m_RDRAM+PAddr) = Value; *(DWORD *)(m_RDRAM+PAddr) = Value;
VirtualProtect(m_RDRAM+(PAddr & ~0xFFF),0xFFC,OldProtect, &OldProtect); 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); } if (FrameBufferWrite) { FrameBufferWrite(PAddr,4); }
break; break;
} }
@ -2344,7 +2344,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
g_Reg->m_RspIntrReg &= ~MI_INTR_SP; g_Reg->m_RspIntrReg &= ~MI_INTR_SP;
g_Reg->CheckInterrupts(); 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) { if ( ( Value & SP_CLR_SSTEP ) != 0) {
g_Reg->SP_STATUS_REG &= ~SP_STATUS_SSTEP; g_Reg->SP_STATUS_REG &= ~SP_STATUS_SSTEP;
} }
@ -2425,10 +2425,10 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
} }
#ifdef tofix #ifdef tofix
if (ShowUnhandledMemory) { if (ShowUnhandledMemory) {
//if ( ( Value & DPC_CLR_TMEM_CTR ) != 0) { g_Notify->DisplayError("RSP: DPC_STATUS_REG: DPC_CLR_TMEM_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("RSP: DPC_STATUS_REG: DPC_CLR_PIPE_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("RSP: DPC_STATUS_REG: DPC_CLR_CMD_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("RSP: DPC_STATUS_REG: DPC_CLR_CLOCK_CTR"); } //if ( ( Value & DPC_CLR_CLOCK_CTR ) != 0) { g_Notify->DisplayError(L"RSP: DPC_STATUS_REG: DPC_CLR_CLOCK_CTR"); }
} }
#endif #endif
break; break;
@ -2557,7 +2557,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) {
PI_DMA_WRITE(); PI_DMA_WRITE();
break; break;
case 0x04600010: 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 ) { if ((Value & PI_CLR_INTR) != 0 ) {
g_Reg->MI_INTR_REG &= ~MI_INTR_PI; g_Reg->MI_INTR_REG &= ~MI_INTR_PI;
g_Reg->CheckInterrupts(); g_Reg->CheckInterrupts();
@ -4169,7 +4169,7 @@ void CMipsMemoryVM::ChangeSpStatus (void)
g_Reg->m_RspIntrReg &= ~MI_INTR_SP; g_Reg->m_RspIntrReg &= ~MI_INTR_SP;
g_Reg->CheckInterrupts(); 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) if ( ( RegModValue & SP_CLR_SSTEP ) != 0)
{ {
g_Reg->SP_STATUS_REG &= ~SP_STATUS_SSTEP; 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; CurPos += m_PifRam[CurPos] + (m_PifRam[CurPos + 1] & 0x3F) + 1;
Channel += 1; Channel += 1;
} else { } 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; CurPos = 0x40;
} }
break; break;
@ -173,7 +173,7 @@ void CPifRam::PifRamWrite (void) {
memset(m_PifRam,0,0x40); memset(m_PifRam,0,0x40);
break; break;
default: 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; return;
} }
@ -200,13 +200,13 @@ void CPifRam::PifRamWrite (void) {
} else { } else {
if (bShowPifRamErrors()) 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; CurPos += m_PifRam[CurPos] + (m_PifRam[CurPos + 1] & 0x3F) + 1;
Channel += 1; Channel += 1;
} else { } 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; CurPos = 0x40;
} }
break; break;
@ -226,7 +226,7 @@ void CPifRam::SI_DMA_READ (void)
{ {
if (bShowPifRamErrors()) 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; return;
} }
@ -316,7 +316,7 @@ void CPifRam::SI_DMA_WRITE (void)
{ {
if (bShowPifRamErrors()) 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; return;
} }
@ -411,8 +411,8 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command)
if ((Command[1] & 0x80) != 0) { break; } if ((Command[1] & 0x80) != 0) { break; }
if (bShowPifRamErrors()) if (bShowPifRamErrors())
{ {
if (Command[0] != 1) { 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("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) { if (Controllers[Control].Present == TRUE) {
Command[3] = 0x05; Command[3] = 0x05;
@ -430,8 +430,8 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command)
case 0x01: // read controller case 0x01: // read controller
if (bShowPifRamErrors()) if (bShowPifRamErrors())
{ {
if (Command[0] != 1) { 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("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) { if (Controllers[Control].Present == FALSE) {
Command[1] |= 0x80; Command[1] |= 0x80;
@ -441,8 +441,8 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command)
if (LogOptions.LogControllerPak) { LogControllerPakData("Read: Before Gettting Results"); } if (LogOptions.LogControllerPak) { LogControllerPakData("Read: Before Gettting Results"); }
if (bShowPifRamErrors()) if (bShowPifRamErrors())
{ {
if (Command[0] != 3) { 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("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) { if (Controllers[Control].Present == TRUE) {
DWORD address = ((Command[3] << 8) | Command[4]); 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 (LogOptions.LogControllerPak) { LogControllerPakData("Write: Before Processing"); }
if (bShowPifRamErrors()) if (bShowPifRamErrors())
{ {
if (Command[0] != 35) { 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("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) { if (Controllers[Control].Present == TRUE) {
DWORD address = ((Command[3] << 8) | Command[4]); 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"); } if (LogOptions.LogControllerPak) { LogControllerPakData("Write: After Processing"); }
break; break;
default: 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 (bShowPifRamErrors())
{ {
if (Command[0] != 1) { 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("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); *(DWORD *)&Command[3] = g_BaseSystem->GetButtons(Control);
} }

View File

@ -309,12 +309,12 @@ void CRegisters::DoAddressError ( BOOL DelaySlot, DWORD BadVaddr, BOOL FromRead)
{ {
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->DisplayError("AddressError"); g_Notify->DisplayError(L"AddressError");
if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) { 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 ) { 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 (bHaveDebugger())
{ {
if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) { 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 ) { 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 (bHaveDebugger())
{ {
if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) { 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 ) { 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 { } else {
if (bHaveDebugger()) 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; m_PROGRAM_COUNTER = 0x80000180;
} }
@ -452,10 +452,10 @@ void CRegisters::DoSysCallException ( BOOL DelaySlot)
if (bHaveDebugger()) if (bHaveDebugger())
{ {
if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) { 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 ) { 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"); WriteTrace(TraceDebug,__FUNCTION__ ": Add Recent Rom");
g_Notify->AddRecentRom(FileLoc); 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) if (g_Settings->LoadDword(Setting_AutoStart) != 0)
{ {
@ -262,7 +262,7 @@ bool CN64System::EmulationStarting ( HANDLE hThread, DWORD ThreadId )
} }
} else { } else {
WriteTrace(TraceError,__FUNCTION__ ": SetActiveSystem failed"); 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_Settings->SaveBool(GameRunning_LoadingInProgress,false);
g_Notify->RefreshMenu(); g_Notify->RefreshMenu();
bRes = false; bRes = false;
@ -297,7 +297,7 @@ void CN64System::StartEmulation2 ( bool NewThread )
if (CpuType == CPU_SyncCores) 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)); g_Plugins->CopyPlugins(g_Settings->LoadString(Directory_PluginSync));
m_SyncWindow = new CMainGui(false); m_SyncWindow = new CMainGui(false);
m_SyncPlugins = new CPlugins( g_Settings->LoadString(Directory_PluginSync) ); m_SyncPlugins = new CPlugins( g_Settings->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__); g_Notify->BreakPoint(__FILE__,__LINE__);
// AddEvent(CloseCPU); // AddEvent(CloseCPU);
} }
@ -1442,11 +1442,11 @@ bool CN64System::SaveState(void)
} }
m_Reg.MI_INTR_REG = MiInterReg; m_Reg.MI_INTR_REG = MiInterReg;
g_Settings->SaveString(GameRunning_InstantSaveFile,""); g_Settings->SaveString(GameRunning_InstantSaveFile,"");
stdstr SaveMessage = _Lang->GetString(MSG_SAVED_STATE); std::wstring SaveMessage = g_Lang->GetString(MSG_SAVED_STATE);
CPath SavedFileName(FileName); 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(); g_Notify->RefreshMenu();
WriteTrace(TraceDebug,__FUNCTION__ ": Done"); WriteTrace(TraceDebug,__FUNCTION__ ": Done");
return true; return true;
@ -1513,36 +1513,42 @@ bool CN64System::LoadState(LPCSTR FileName) {
port = unzGoToFirstFile(file); port = unzGoToFirstFile(file);
} }
DWORD Value; DWORD Value;
while (port == UNZ_OK) { while (port == UNZ_OK)
{
unz_file_info info; unz_file_info info;
char zname[132]; char zname[132];
unzGetCurrentFileInfo(file, &info, zname, 128, NULL,0, NULL,0); 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); unzClose(file);
port = -1; port = -1;
continue; continue;
} }
if( unzOpenCurrentFile(file) != UNZ_OK ) { if( unzOpenCurrentFile(file) != UNZ_OK )
{
unzClose(file); unzClose(file);
port = -1; port = -1;
continue; continue;
} }
unzReadCurrentFile(file,&Value,4); unzReadCurrentFile(file,&Value,4);
if (Value != 0x23D8A6C8 && Value != 0x56D2CD23) { if (Value != 0x23D8A6C8 && Value != 0x56D2CD23)
{
unzCloseCurrentFile(file); unzCloseCurrentFile(file);
port = unzGoToNextFile(file); port = unzGoToNextFile(file);
continue; continue;
} }
if (!LoadedZipFile && Value == 0x23D8A6C8 && port == UNZ_OK) { if (!LoadedZipFile && Value == 0x23D8A6C8 && port == UNZ_OK)
{
unzReadCurrentFile(file,&SaveRDRAMSize,sizeof(SaveRDRAMSize)); unzReadCurrentFile(file,&SaveRDRAMSize,sizeof(SaveRDRAMSize));
//Check header //Check header
BYTE LoadHeader[64]; BYTE LoadHeader[64];
unzReadCurrentFile(file,LoadHeader,0x40); unzReadCurrentFile(file,LoadHeader,0x40);
if (memcmp(LoadHeader,g_Rom->GetRomAddress(),0x40) != 0) { if (memcmp(LoadHeader,g_Rom->GetRomAddress(),0x40) != 0)
{
//if (inFullScreen) { return FALSE; } //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); MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2);
if (result == IDNO) { return FALSE; } if (result == IDNO) { return FALSE; }
} }
@ -1578,7 +1584,8 @@ bool CN64System::LoadState(LPCSTR FileName) {
LoadedZipFile = true; LoadedZipFile = true;
continue; continue;
} }
if (LoadedZipFile && Value == 0x56D2CD23 && port == UNZ_OK) { if (LoadedZipFile && Value == 0x56D2CD23 && port == UNZ_OK)
{
m_SystemTimer.LoadData(file); m_SystemTimer.LoadData(file);
} }
unzCloseCurrentFile(file); unzCloseCurrentFile(file);
@ -1586,11 +1593,13 @@ bool CN64System::LoadState(LPCSTR FileName) {
} }
unzClose(file); unzClose(file);
} }
if (!LoadedZipFile) { if (!LoadedZipFile)
{
HANDLE hSaveFile = CreateFile(FileNameStr.c_str(),GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ,NULL, HANDLE hSaveFile = CreateFile(FileNameStr.c_str(),GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ,NULL,
OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
if (hSaveFile == INVALID_HANDLE_VALUE) { if (hSaveFile == INVALID_HANDLE_VALUE)
g_Notify->DisplayMessage(5,"%s %s",GS(MSG_UNABLED_LOAD_STATE),FileNameStr.c_str()); {
g_Notify->DisplayMessage(5,L"%s %s",GS(MSG_UNABLED_LOAD_STATE),FileNameStr.c_str());
return false; return false;
} }
SetFilePointer(hSaveFile,0,NULL,FILE_BEGIN); SetFilePointer(hSaveFile,0,NULL,FILE_BEGIN);
@ -1600,9 +1609,10 @@ bool CN64System::LoadState(LPCSTR FileName) {
//Check header //Check header
BYTE LoadHeader[64]; BYTE LoadHeader[64];
ReadFile( hSaveFile,LoadHeader,0x40,&dwRead,NULL); 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; } //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); MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2);
if (result == IDNO) { return FALSE; } if (result == IDNO) { return FALSE; }
} }
@ -1637,7 +1647,8 @@ bool CN64System::LoadState(LPCSTR FileName) {
} }
//Fix Random Register //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; m_Reg.RANDOM_REGISTER += 32 - m_Reg.WIRED_REGISTER;
} }
//Fix up timer //Fix up timer
@ -1666,7 +1677,8 @@ bool CN64System::LoadState(LPCSTR FileName) {
#endif #endif
if (bFastSP() && m_Recomp) { m_Recomp->ResetMemoryStackPos(); } 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) if (m_SyncCPU)
{ {
for (int i = 0; i < (sizeof(m_LastSuccessSyncPC)/sizeof(m_LastSuccessSyncPC[0])); i++) { 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"); WriteTrace(TraceDebug,__FUNCTION__ ": 13");
stdstr LoadMsg = _Lang->GetString(MSG_LOADED_STATE); std::wstring LoadMsg = g_Lang->GetString(MSG_LOADED_STATE);
g_Notify->DisplayMessage(5,"%s %s",LoadMsg.c_str(),CPath(FileNameStr).GetNameExtension().c_str()); g_Notify->DisplayMessage(5,L"%s %s",LoadMsg.c_str(),CPath(FileNameStr).GetNameExtension().c_str());
WriteTrace(TraceDebug,__FUNCTION__ ": Done"); WriteTrace(TraceDebug,__FUNCTION__ ": Done");
return true; return true;
} }
@ -1688,8 +1700,10 @@ bool CN64System::LoadState(LPCSTR FileName) {
void CN64System::RunRSP ( void ) void CN64System::RunRSP ( void )
{ {
WriteTraceF(TraceRSP, __FUNCTION__ ": Start (SP Status %X)",m_Reg.SP_STATUS_REG); 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_HALT ) == 0)
if ( ( m_Reg.SP_STATUS_REG & SP_STATUS_BROKE ) == 0 ) { {
if ( ( m_Reg.SP_STATUS_REG & SP_STATUS_BROKE ) == 0 )
{
SPECIAL_TIMERS CPU_UsageAddr = Timer_None/*, ProfileAddr = Timer_None*/; SPECIAL_TIMERS CPU_UsageAddr = Timer_None/*, ProfileAddr = Timer_None*/;
DWORD Task = 0; DWORD Task = 0;
@ -1719,7 +1733,7 @@ void CN64System::RunRSP ( void )
} }
if (bShowDListAListCount()) { 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()) if (bShowCPUPer())
{ {
@ -1739,7 +1753,7 @@ void CN64System::RunRSP ( void )
WriteTrace(TraceRSP, __FUNCTION__ ": do cycles - Done"); WriteTrace(TraceRSP, __FUNCTION__ ": do cycles - Done");
} __except( g_MMU->MemoryFilter( GetExceptionCode(), GetExceptionInformation()) ) { } __except( g_MMU->MemoryFilter( GetExceptionCode(), GetExceptionInformation()) ) {
WriteTrace(TraceError, __FUNCTION__ ": exception generated"); 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)) 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; TotalRead += dwRead;
//Show Message of how much % wise of the rom has been loaded //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; dwRead = TotalRead;
@ -157,7 +157,7 @@ bool CN64Rom::AllocateAndLoadZipImage ( const char * FileLoc, bool LoadBootCodeO
TotalRead += dwRead; TotalRead += dwRead;
//Show Message of how much % wise of the rom has been loaded //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; dwRead = TotalRead + 4;
@ -165,7 +165,7 @@ bool CN64Rom::AllocateAndLoadZipImage ( const char * FileLoc, bool LoadBootCodeO
VirtualFree(Image,0,MEM_RELEASE); VirtualFree(Image,0,MEM_RELEASE);
unzCloseCurrentFile(file); unzCloseCurrentFile(file);
SetError(MSG_FAIL_ZIP); SetError(MSG_FAIL_ZIP);
g_Notify->DisplayMessage(1,""); g_Notify->DisplayMessage(1,L"");
break; break;
} }
@ -181,7 +181,7 @@ bool CN64Rom::AllocateAndLoadZipImage ( const char * FileLoc, bool LoadBootCodeO
//Protect the memory so that it can not be written to. //Protect the memory so that it can not be written to.
DWORD OldProtect; DWORD OldProtect;
VirtualProtect(m_ROMImage,m_RomFileSize,PAGE_READONLY,&OldProtect); VirtualProtect(m_ROMImage,m_RomFileSize,PAGE_READONLY,&OldProtect);
g_Notify->DisplayMessage(1,""); g_Notify->DisplayMessage(1,L"");
} }
unzCloseCurrentFile(file); unzCloseCurrentFile(file);
if (FoundRom == FALSE) { if (FoundRom == FALSE) {
@ -219,7 +219,7 @@ void CN64Rom::ByteSwapRom (void) {
break; break;
case 0x80371240: break; case 0x80371240: break;
default: 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; case 0x000000D6D5BE5580: m_CicChip = CIC_NUS_6106; break;
default: default:
if (bHaveDebugger()) 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; m_CicChip = CIC_UNKNOWN; break;
} }
@ -264,7 +264,7 @@ bool CN64Rom::IsValidRomImage ( BYTE Test[4] ) {
void CN64Rom::NotificationCB ( LPCSTR Status, CN64Rom * /*_this*/ ) 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 ) { 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. //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 loading boot code then just load the first 0x1000 bytes
if (LoadBootCodeOnly) { RomFileSize = 0x1000; } if (LoadBootCodeOnly) { RomFileSize = 0x1000; }

View File

@ -95,7 +95,7 @@ void CProfiling::ShowCPU_Usage (void) {
TotalTime = CPU + Alist + Dlist + Idle; 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)CPU / (double)TotalTime) * 100),'%',
(float)(((double)Dlist / (double)TotalTime) * 100),'%', (float)(((double)Dlist / (double)TotalTime) * 100),'%',
(float)(((double)Alist / (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) { } else if (Parent->m_JumpSection == this) {
m_RegEnter = Parent->m_Jump.RegSet; m_RegEnter = Parent->m_Jump.RegSet;
} else { } else {
g_Notify->DisplayError("How are these sections joined?????"); g_Notify->DisplayError(L"How are these sections joined?????");
} }
m_RegWorkingSet = m_RegEnter; m_RegWorkingSet = m_RegEnter;
} else { } else {
@ -1948,7 +1948,7 @@ bool CCodeSection::InheritParentInfo ( void )
case CRegInfo::STATE_MAPPED_32_ZERO: case CRegInfo::STATE_MAPPED_32_ZERO:
case CRegInfo::STATE_MAPPED_32_SIGN: case CRegInfo::STATE_MAPPED_32_SIGN:
if (GetMipsRegMapLo(i2) != RegSet->GetMipsRegMapLo(i2)) { if (GetMipsRegMapLo(i2) != RegSet->GetMipsRegMapLo(i2)) {
//DisplayError("Parent: %d",Parent->SectionID); //DisplayError(L"Parent: %d",Parent->SectionID);
NeedSync = true; NeedSync = true;
} }
break; break;

View File

@ -226,7 +226,7 @@ bool LoopAnalysis::CheckLoopRegisterUsage( CCodeSection * Section)
g_Notify->BreakPoint(__FILE__,__LINE__); g_Notify->BreakPoint(__FILE__,__LINE__);
#ifdef tofix #ifdef tofix
if (m_Command.Hex == 0x00000001) { break; } 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)); R4300iOpcodeName(m_Command.Hex,m_PC));
#endif #endif
m_NextInstruction = END_BLOCK; m_NextInstruction = END_BLOCK;
@ -346,7 +346,7 @@ bool LoopAnalysis::CheckLoopRegisterUsage( CCodeSection * Section)
g_Notify->BreakPoint(__FILE__,__LINE__); g_Notify->BreakPoint(__FILE__,__LINE__);
#ifdef tofix #ifdef tofix
if (m_Command.Hex == 0x0407000D) { break; } 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)); R4300iOpcodeName(m_Command.Hex,m_PC));
m_NextInstruction = END_BLOCK; m_NextInstruction = END_BLOCK;
m_PC -= 4; m_PC -= 4;
@ -511,13 +511,13 @@ bool LoopAnalysis::CheckLoopRegisterUsage( CCodeSection * Section)
case R4300i_COP0_CO_TLBP: break; case R4300i_COP0_CO_TLBP: break;
case R4300i_COP0_CO_ERET: m_NextInstruction = END_BLOCK; break; case R4300i_COP0_CO_ERET: m_NextInstruction = END_BLOCK; break;
default: 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)); R4300iOpcodeName(m_Command.Hex,m_PC));
m_NextInstruction = END_BLOCK; m_NextInstruction = END_BLOCK;
m_PC -= 4; m_PC -= 4;
} }
} else { } 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)); R4300iOpcodeName(m_Command.Hex,m_PC));
m_NextInstruction = END_BLOCK; m_NextInstruction = END_BLOCK;
m_PC -= 4; m_PC -= 4;
@ -594,7 +594,7 @@ bool LoopAnalysis::CheckLoopRegisterUsage( CCodeSection * Section)
case R4300i_COP1_W: break; case R4300i_COP1_W: break;
case R4300i_COP1_L: break; case R4300i_COP1_L: break;
default: 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)); R4300iOpcodeName(m_Command.Hex,m_PC));
m_NextInstruction = END_BLOCK; m_NextInstruction = END_BLOCK;
m_PC -= 4; m_PC -= 4;
@ -689,7 +689,7 @@ bool LoopAnalysis::CheckLoopRegisterUsage( CCodeSection * Section)
if (m_Command.Hex == 0xF1F3F5F7) { break; } if (m_Command.Hex == 0xF1F3F5F7) { break; }
if (m_Command.Hex == 0xC1200000) { break; } if (m_Command.Hex == 0xC1200000) { break; }
if (m_Command.Hex == 0x4C5A5353) { 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); 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); m_Registers.DoTLBReadMiss(false,PC);
if (!g_TransVaddr->ValidVaddr(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; return;
} }
continue; continue;
@ -167,7 +167,7 @@ void CRecompiler::RecompilerMain_VirtualTable_validate ( void )
NextInstruction = NORMAL; NextInstruction = NORMAL;
if (!g_TLB->ValidVaddr(PROGRAM_COUNTER)) 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; return;
} }
continue; continue;
@ -227,7 +227,7 @@ void CRecompiler::RecompilerMain_VirtualTable_validate ( void )
NextInstruction = NORMAL; NextInstruction = NORMAL;
if (!g_TLB->ValidVaddr(PROGRAM_COUNTER)) 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; return;
} }
} }
@ -250,7 +250,7 @@ void CRecompiler::RecompilerMain_VirtualTable_validate ( void )
NextInstruction = NORMAL; NextInstruction = NORMAL;
if (!g_MMU->ValidVaddr(PROGRAM_COUNTER)) 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; return;
} }
} }
@ -374,7 +374,7 @@ void CRecompiler::RecompilerMain_Lookup( void )
DoTLBMiss(NextInstruction == DELAY_SLOT,PROGRAM_COUNTER); DoTLBMiss(NextInstruction == DELAY_SLOT,PROGRAM_COUNTER);
NextInstruction = NORMAL; NextInstruction = NORMAL;
if (!TranslateVaddr(PROGRAM_COUNTER, &Addr)) { 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; return;
} }
} }
@ -521,7 +521,7 @@ void CRecompiler::RecompilerMain_Lookup_TLB( void )
m_Registers.DoTLBReadMiss(false,PROGRAM_COUNTER); m_Registers.DoTLBReadMiss(false,PROGRAM_COUNTER);
if (!g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr)) 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; m_EndEmulation = true;
} }
continue; continue;
@ -621,7 +621,7 @@ void CRecompiler::RecompilerMain_Lookup_validate_TLB( void )
m_Registers.DoTLBReadMiss(false,PROGRAM_COUNTER); m_Registers.DoTLBReadMiss(false,PROGRAM_COUNTER);
if (!g_TransVaddr->TranslateVaddr(PROGRAM_COUNTER, PhysicalAddr)) 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; m_EndEmulation = true;
} }
continue; continue;
@ -718,7 +718,7 @@ void CRecompiler::RecompilerMain_ChangeMemory ( void )
DoTLBMiss(NextInstruction == DELAY_SLOT,PROGRAM_COUNTER); DoTLBMiss(NextInstruction == DELAY_SLOT,PROGRAM_COUNTER);
NextInstruction = NORMAL; NextInstruction = NORMAL;
if (!TranslateVaddr(PROGRAM_COUNTER, &Addr)) { 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); ExitThread(0);
} }
} }
@ -730,7 +730,7 @@ void CRecompiler::RecompilerMain_ChangeMemory ( void )
__try { __try {
Value = (DWORD)(*(DelaySlotTable + (Addr >> 12))); Value = (DWORD)(*(DelaySlotTable + (Addr >> 12)));
} __except(EXCEPTION_EXECUTE_HANDLER) { } __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); ExitThread(0);
} }
if ( (Value >> 16) == 0x7C7C) { if ( (Value >> 16) == 0x7C7C) {

View File

@ -88,5 +88,5 @@ void CRecompMemory::ShowMemUsed()
DWORD TotalAvaliable = m_RecompSize / 0x100000; 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; break;
default: default:
if (bHaveDebugger()) { g_Notify->DisplayError("Unknown branch type"); } if (bHaveDebugger()) { g_Notify->DisplayError(L"Unknown branch type"); }
} }
} else { } else {
EffectDelaySlot = true; EffectDelaySlot = true;
@ -298,7 +298,7 @@ void CRecompilerOps::Compile_Branch (CRecompilerOps::BranchFunction CompareFunc,
} else { } else {
if (bHaveDebugger()) 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_Section->GenerateSectionLinkage();
m_NextInstruction = END_BLOCK; m_NextInstruction = END_BLOCK;
} else if (bHaveDebugger()) { } 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_Section->GenerateSectionLinkage();
m_NextInstruction = END_BLOCK; m_NextInstruction = END_BLOCK;
} else if (bHaveDebugger()) { } 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: default:
if (bHaveDebugger()) 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; m_NextInstruction = END_BLOCK;
} else if (bHaveDebugger()) { } 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; m_NextInstruction = END_BLOCK;
} else if (bHaveDebugger()) { } 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 (IsConst(m_Opcode.rt) && IsConst(m_Opcode.rs)) {
if (IsMapped(m_Opcode.rd)) { UnMap_GPR(m_Opcode.rd, FALSE); } if (IsMapped(m_Opcode.rd)) { UnMap_GPR(m_Opcode.rd, FALSE); }
if (Is64Bit(m_Opcode.rt) || Is64Bit(m_Opcode.rs)) { 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(); CRecompilerOps::UnknownOpcode();
} else { } else {
m_RegWorkingSet.SetMipsRegState(m_Opcode.rd,CRegInfo::STATE_CONST_32_SIGN); 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 (IsKnown(m_Opcode.rt) && IsKnown(m_Opcode.rs)) {
if (IsConst(m_Opcode.rt) && IsConst(m_Opcode.rs)) { if (IsConst(m_Opcode.rt) && IsConst(m_Opcode.rs)) {
if (Is64Bit(m_Opcode.rt) || Is64Bit(m_Opcode.rs)) { if (Is64Bit(m_Opcode.rt) || Is64Bit(m_Opcode.rs)) {
g_Notify->DisplayError("1"); g_Notify->DisplayError(L"1");
CRecompilerOps::UnknownOpcode(); CRecompilerOps::UnknownOpcode();
} else { } else {
if (IsMapped(m_Opcode.rd)) { UnMap_GPR(m_Opcode.rd, FALSE); } 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 (IsKnown(m_Opcode.rt) && IsKnown(m_Opcode.rs)) {
if (IsConst(m_Opcode.rt) && IsConst(m_Opcode.rs)) { if (IsConst(m_Opcode.rt) && IsConst(m_Opcode.rs)) {
if (Is64Bit(m_Opcode.rt) || Is64Bit(m_Opcode.rs)) { if (Is64Bit(m_Opcode.rt) || Is64Bit(m_Opcode.rs)) {
g_Notify->DisplayError("1"); g_Notify->DisplayError(L"1");
CRecompilerOps::UnknownOpcode(); CRecompilerOps::UnknownOpcode();
} else { } else {
if (IsMapped(m_Opcode.rd)) { UnMap_GPR(m_Opcode.rd, FALSE); } if (IsMapped(m_Opcode.rd)) { UnMap_GPR(m_Opcode.rd, FALSE); }
@ -4039,7 +4039,7 @@ void CRecompilerOps::COP0_MT (void) {
case 13: //cause case 13: //cause
if (IsConst(m_Opcode.rt)) { if (IsConst(m_Opcode.rt)) {
AndConstToVariable(0xFFFFCFF,&_CP0[m_Opcode.rd], CRegName::Cop0[m_Opcode.rd]); 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 { } else {
UnknownOpcode(); UnknownOpcode();
return; return;

View File

@ -161,7 +161,7 @@ void CRegInfo::FixRoundModel(FPU_ROUND RoundMethod )
case RoundDown: OrConstToX86Reg(0x0400, reg); break; case RoundDown: OrConstToX86Reg(0x0400, reg); break;
case RoundUp: OrConstToX86Reg(0x0800, reg); break; case RoundUp: OrConstToX86Reg(0x0800, reg); break;
default: default:
g_Notify->DisplayError("Unknown Rounding model"); g_Notify->DisplayError(L"Unknown Rounding model");
} }
} }
MoveX86regToVariable(reg, &m_fpuControl, "m_fpuControl"); MoveX86regToVariable(reg, &m_fpuControl, "m_fpuControl");
@ -193,7 +193,7 @@ void CRegInfo::ChangeFPURegFormat (int Reg, FPU_STATE OldFormat, FPU_STATE NewFo
if (bHaveDebugger()) 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()))); CPU_Message("CurrentRoundingModel: %s FpuRoundingModel(StackTopPos()): %s",RoundingModelName(GetRoundingModel()),RoundingModelName(FpuRoundingModel(StackTopPos())));
int i; int i;
if (RegToLoad < 0) { g_Notify->DisplayError("Load_FPR_ToTop\nRegToLoad < 0 ???"); return; } if (RegToLoad < 0) { g_Notify->DisplayError(L"Load_FPR_ToTop\nRegToLoad < 0 ???"); return; }
if (Reg < 0) { g_Notify->DisplayError("Load_FPR_ToTop\nReg < 0 ???"); return; } if (Reg < 0) { g_Notify->DisplayError(L"Load_FPR_ToTop\nReg < 0 ???"); return; }
if (Format == FPU_Double || Format == FPU_Qword) { if (Format == FPU_Double || Format == FPU_Qword) {
UnMap_FPR(Reg + 1,TRUE); UnMap_FPR(Reg + 1,TRUE);
@ -337,7 +337,7 @@ void CRegInfo::Load_FPR_ToTop ( int Reg, int RegToLoad, FPU_STATE Format)
fpuLoadQwordFromX86Reg(&StackTopPos(),TempReg); fpuLoadQwordFromX86Reg(&StackTopPos(),TempReg);
break; break;
default: 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); SetX86Protected(TempReg,FALSE);
FpuRoundingModel(StackTopPos()) = RoundDefault; FpuRoundingModel(StackTopPos()) = RoundDefault;
@ -516,7 +516,7 @@ CRegInfo::x86Reg CRegInfo::Map_MemoryStack ( x86Reg Reg, bool bMapRegister, bool
Reg = FreeX86Reg(); Reg = FreeX86Reg();
if (Reg == x86_Unknown) 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__); g_Notify->BreakPoint(__FILE__,__LINE__);
} }
SetX86Mapped(Reg,CRegInfo::Stack_Mapped); SetX86Mapped(Reg,CRegInfo::Stack_Mapped);
@ -562,7 +562,7 @@ void CRegInfo::Map_GPR_32bit (int MipsReg, bool SignValue, int MipsRegToLoad)
{ {
Reg = FreeX86Reg(); Reg = FreeX86Reg();
if (Reg < 0) { 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__); g_Notify->BreakPoint(__FILE__,__LINE__);
return; return;
} }
@ -616,7 +616,7 @@ void CRegInfo::Map_GPR_64bit ( int MipsReg, int MipsRegToLoad)
int count; int count;
if (MipsReg == 0) { 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; return;
} }
@ -625,13 +625,13 @@ void CRegInfo::Map_GPR_64bit ( int MipsReg, int MipsRegToLoad)
x86Hi = FreeX86Reg(); x86Hi = FreeX86Reg();
if (x86Hi < 0) 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; return;
} }
SetX86Protected(x86Hi,TRUE); SetX86Protected(x86Hi,TRUE);
x86lo = FreeX86Reg(); 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); SetX86Protected(x86lo,TRUE);
CPU_Message(" regcache: allocate %s to hi word of %s",x86_Name(x86Hi),CRegName::GPR[MipsReg]); 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); fpuStoreQwordFromX86Reg(&StackTopPos(),TempReg, TRUE);
break; break;
default: 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); SetX86Protected(TempReg,FALSE);
FpuRoundingModel(RegPos) = RoundDefault; FpuRoundingModel(RegPos) = RoundDefault;
@ -993,7 +993,7 @@ void CRegInfo::UnMap_GPR (DWORD Reg, bool WriteBackValue)
{ {
if (Reg == 0) 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; return;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,30 +9,37 @@ bool CBaseMenu::AddMenu(HMENU hMenu, MenuItemList Items ) {
if (Items.begin() == Items.end()) { return false; } if (Items.begin() == Items.end()) { return false; }
UINT ItemID, uFlags; UINT ItemID, uFlags;
stdstr Text; std::wstring Text, String;
stdstr String; for (MenuItemList::iterator MenuItem = Items.begin(); MenuItem != Items.end(); MenuItem++)
for (MenuItemList::iterator MenuItem = Items.begin(); MenuItem != Items.end(); MenuItem++) { {
ItemID = MenuItem->ID; ItemID = MenuItem->ID();
uFlags = MF_STRING; 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) { if (MenuItem->Title() == EMPTY_STRING && MenuItem->ManualString().length() > 0)
Text = MenuItem->ManualString; {
Text = MenuItem->ManualString();
} }
if (ItemID == SPLITER) { if (ItemID == SPLITER)
{
uFlags |= MF_SEPARATOR; uFlags |= MF_SEPARATOR;
} }
if (MenuItem->ItemTicked) { if (MenuItem->ItemTicked())
{
uFlags |= MFS_CHECKED; uFlags |= MFS_CHECKED;
} }
if (MenuItem->ItemEnabled) { if (MenuItem->ItemEnabled())
{
uFlags |= MFS_ENABLED; uFlags |= MFS_ENABLED;
} else { }
else
{
uFlags |= MFS_DISABLED; uFlags |= MFS_DISABLED;
} }
MenuItemList * SubMenu = (MenuItemList *)MenuItem->SubMenu; MenuItemList * SubMenu = (MenuItemList *)MenuItem->SubMenu();
if (ItemID == SUB_MENU && HIWORD(SubMenu) != 0 && (SubMenu->begin() != SubMenu->end())) { if (ItemID == SUB_MENU && HIWORD(SubMenu) != 0 && (SubMenu->begin() != SubMenu->end()))
{
ItemID = (UINT)CreatePopupMenu(); ItemID = (UINT)CreatePopupMenu();
uFlags |= MF_POPUP; uFlags |= MF_POPUP;
@ -41,37 +48,25 @@ bool CBaseMenu::AddMenu(HMENU hMenu, MenuItemList Items ) {
if (ItemID == ID_PLUGIN_MENU) if (ItemID == ID_PLUGIN_MENU)
{ {
ItemID = (UINT)MenuItem->SubMenu; ItemID = (UINT)MenuItem->SubMenu();
uFlags |= MF_POPUP; uFlags |= MF_POPUP;
MENUITEMINFO lpmii; MENUITEMINFO lpmii;
lpmii.cbSize = sizeof(MENUITEMINFO); lpmii.cbSize = sizeof(MENUITEMINFO);
lpmii.fMask = MIIM_STATE; lpmii.fMask = MIIM_STATE;
lpmii.fState = 0; 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 = Text;
String += "\t"; String += L"\t";
String += MenuItem->ShotCut; String += MenuItem->ShotCut();
Text = String; Text = String;
} }
AppendMenu((HMENU)hMenu,uFlags,ItemID,Text.c_str()); AppendMenuW(hMenu,uFlags,ItemID,Text.c_str());
} }
return true; 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> #include <list>
enum Menu_ID { enum Menu_ID
{
//ControlID //ControlID
SPLITER, SUB_MENU, NO_ID, ID_PLUGIN_MENU, 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: public:
MENU_ITEM (void) { MENU_ITEM (void)
{
Reset(NO_ID); Reset(NO_ID);
} }
MENU_ITEM ( int ID, LanguageStringID Title = EMPTY_STRING, const stdstr & ShotCut = EMPTY_STDSTR, MENU_ITEM ( int ID, LanguageStringID Title = EMPTY_STRING, const std::wstring & ShotCut = EMPTY_STDSTR,
void * SubMenu = NULL, const stdstr & ManualString = EMPTY_STDSTR) void * SubMenu = NULL, const std::wstring & ManualString = EMPTY_STDSTR)
{ {
Reset(ID,Title,ShotCut,SubMenu,ManualString); Reset(ID,Title,ShotCut,SubMenu,ManualString);
} }
void Reset ( int ID, LanguageStringID Title = EMPTY_STRING, const stdstr & ShotCut2 = EMPTY_STDSTR, void Reset ( int ID, LanguageStringID Title = EMPTY_STRING, const std::wstring & ShotCut2 = EMPTY_STDSTR,
void * SubMenu = NULL, const stdstr & ManualString = EMPTY_STDSTR) void * SubMenu = NULL, const std::wstring & ManualString = EMPTY_STDSTR)
{ {
this->ID = ID; this->m_ID = ID;
this->Title = Title; this->m_Title = Title;
this->ShotCut = ShotCut2; this->m_ShotCut = ShotCut2;
this->SubMenu = SubMenu; this->m_SubMenu = SubMenu;
this->ManualString = ManualString; this->m_ManualString = ManualString;
this->ItemTicked = false; this->m_ItemTicked = false;
this->ItemEnabled = true; this->m_ItemEnabled = true;
} }
int ID;
LanguageStringID Title; int ID() const { return m_ID; }
stdstr ShotCut; LanguageStringID Title() const { return m_Title; }
void * SubMenu; const std::wstring & ShotCut() const { return m_ShotCut; }
stdstr ManualString; void * SubMenu() const { return m_SubMenu; }
bool ItemTicked; const std::wstring & ManualString() const { return m_ManualString; }
bool ItemEnabled; 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; 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); CGuard CS(m_CS);
MSC_MAP::iterator MenuItem = m_ShortCuts.find(MenuID); 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(); const SHORTCUT_KEY_LIST & ShortCutList = MenuItem->second.GetAccelItems();
for (SHORTCUT_KEY_LIST::const_iterator item = ShortCutList.begin(); item != ShortCutList.end(); item++) 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; 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 ) 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 );
~CShortCuts ( void ); ~CShortCuts ( void );
stdstr ShortCutString ( int MenuID, ACCESS_MODE AccessLevel ); std::wstring ShortCutString ( int MenuID, ACCESS_MODE AccessLevel );
LangStr GetMenuItemName ( WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE Access ); LangStr GetMenuItemName ( WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE Access );
HACCEL GetAcceleratorTable ( void ); HACCEL GetAcceleratorTable ( void );
MSC_MAP &GetShortCuts ( void ) { return m_ShortCuts; } MSC_MAP & GetShortCuts ( void ) { return m_ShortCuts; }
void Load ( bool InitialValues = false ); void Load ( bool InitialValues = false );
void Save ( void ); void Save ( void );

View File

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

View File

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

View File

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

View File

@ -163,7 +163,7 @@ class CRomBrowser
static int GetCicChipID ( BYTE * RomData ); static int GetCicChipID ( BYTE * RomData );
bool LoadDataFromRomFile ( char * FileName, BYTE * Data,int DataLen, int * RomSize, FILE_FORMAT & FileFormat ); bool LoadDataFromRomFile ( char * FileName, BYTE * Data,int DataLen, int * RomSize, FILE_FORMAT & FileFormat );
void LoadRomList ( void ); 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 SaveRomList ( strlist & FileList );
void RomList_ColoumnSortList ( DWORD pnmh ); void RomList_ColoumnSortList ( DWORD pnmh );
void RomList_GetDispInfo ( 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) 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; return true;
} }
if (UpdateAdvanced(AdvancedMode,m_PagesTreeList.GetChildItem(hItem))) 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)) if (g_Settings->LoadBool(Setting_RdbEditor))
{ {
SetWindowText(stdstr_f("%s ** RDB Edit Mode **",ConfigRomTitle.c_str()).c_str()); SetWindowText(stdstr_f("%s ** RDB Edit Mode **",ConfigRomTitle.c_str()).c_str());
} else { }
else
{
SetWindowText(ConfigRomTitle.c_str()); SetWindowText(ConfigRomTitle.c_str());
} }
} else { }
else
{
if (g_Settings->LoadBool(Setting_RdbEditor)) if (g_Settings->LoadBool(Setting_RdbEditor))
{ {
SetWindowText(stdstr_f("%s ** RDB Edit Mode **",GS(OPTIONS_TITLE)).c_str()); SetWindowText(stdstr_f("%s ** RDB Edit Mode **",GS(OPTIONS_TITLE)).c_str());
} else { } else {
SetWindowText(GS(OPTIONS_TITLE)); ::SetWindowTextW(m_hWnd, GS(OPTIONS_TITLE));
} }
if (g_Settings->LoadBool(Setting_PluginPageFirst)) if (g_Settings->LoadBool(Setting_PluginPageFirst))
@ -131,7 +135,7 @@ LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
//Game Settings //Game Settings
if (!GameIni.empty()) 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 CGameGeneralPage(this->m_hWnd,rcSettingInfo ));
GameSettings->AddPage(new CGameRecompilePage(this->m_hWnd,rcSettingInfo )); GameSettings->AddPage(new CGameRecompilePage(this->m_hWnd,rcSettingInfo ));
GameSettings->AddPage(new CGamePluginPage(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) 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; continue;
} }
if (hSectionItem == NULL) if (hSectionItem == NULL)
{ {
continue; 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) 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); ComboBox = AddModComboBox(GetDlgItem(IDC_FRAME_DISPLAY_TYPE),UserInterface_FrameDisplayType);
if (ComboBox) if (ComboBox)
{ {
ComboBox->AddItem(GS(STR_FR_VIS), FR_VIs ); ComboBox->AddItemW(GS(STR_FR_VIS), FR_VIs );
ComboBox->AddItem(GS(STR_FR_DLS), FR_DLs ); ComboBox->AddItemW(GS(STR_FR_DLS), FR_DLs );
ComboBox->AddItem(GS(STR_FR_PERCENT), FR_PERCENT ); ComboBox->AddItemW(GS(STR_FR_PERCENT), FR_PERCENT );
} }
UpdatePageSettings(); UpdatePageSettings();

View File

@ -45,11 +45,11 @@ COptionsDirectoriesPage::COptionsDirectoriesPage (HWND hParent, const RECT & rcD
m_TextureSelected.Attach(GetDlgItem(IDC_TEXTURE_OTHER)); m_TextureSelected.Attach(GetDlgItem(IDC_TEXTURE_OTHER));
//Set Text language for the dialog box //Set Text language for the dialog box
m_PluginGroup.SetWindowText(GS(DIR_PLUGIN)); ::SetWindowTextW(m_PluginGroup.m_hWnd, GS(DIR_PLUGIN));
m_AutoSaveGroup.SetWindowText(GS(DIR_AUTO_SAVE)); ::SetWindowTextW(m_AutoSaveGroup.m_hWnd, GS(DIR_AUTO_SAVE));
m_InstantSaveGroup.SetWindowText(GS(DIR_INSTANT_SAVE)); ::SetWindowTextW(m_InstantSaveGroup.m_hWnd, GS(DIR_INSTANT_SAVE));
m_ScreenShotGroup.SetWindowText(GS(DIR_SCREEN_SHOT)); ::SetWindowTextW(m_ScreenShotGroup.m_hWnd, GS(DIR_SCREEN_SHOT));
m_TextureGroup.SetWindowText(GS(DIR_TEXTURE)); ::SetWindowTextW(m_TextureGroup.m_hWnd, GS(DIR_TEXTURE));
UpdatePageSettings(); 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 ) 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; LPITEMIDLIST pidl;
BROWSEINFO bi; BROWSEINFOW bi;
stdstr InitialDir = EditBox.GetWindowText(); stdstr InitialDir = EditBox.GetWindowText();
@ -85,11 +85,12 @@ void COptionsDirectoriesPage::SelectDirectory( LanguageStringID Title, CModified
bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS; bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
bi.lpfn = (BFFCALLBACK)SelectDirCallBack; bi.lpfn = (BFFCALLBACK)SelectDirCallBack;
bi.lParam = (DWORD)InitialDir.c_str(); 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.SetChanged(true);
EditBox.SetWindowText(SelectedDir); EditBox.SetWindowText(SelectedDir);
Default.SetChanged(true); Default.SetChanged(true);

View File

@ -32,31 +32,31 @@ CGameGeneralPage::CGameGeneralPage (HWND hParent, const RECT & rcDispay )
if (ComboBox) if (ComboBox)
{ {
ComboBox->SetTextField(GetDlgItem(IDC_MEMORY_SIZE_TEXT)); ComboBox->SetTextField(GetDlgItem(IDC_MEMORY_SIZE_TEXT));
ComboBox->AddItem(GS(RDRAM_4MB), 0x400000 ); ComboBox->AddItemW(GS(RDRAM_4MB), 0x400000 );
ComboBox->AddItem(GS(RDRAM_8MB), 0x800000 ); ComboBox->AddItemW(GS(RDRAM_8MB), 0x800000 );
} }
ComboBox = AddModComboBox(GetDlgItem(IDC_SAVE_TYPE),Game_SaveChip); ComboBox = AddModComboBox(GetDlgItem(IDC_SAVE_TYPE),Game_SaveChip);
if (ComboBox) if (ComboBox)
{ {
ComboBox->SetTextField(GetDlgItem(IDC_SAVE_TYPE_TEXT)); ComboBox->SetTextField(GetDlgItem(IDC_SAVE_TYPE_TEXT));
ComboBox->AddItem(GS(SAVE_FIRST_USED), (WPARAM)SaveChip_Auto ); ComboBox->AddItemW(GS(SAVE_FIRST_USED), (WPARAM)SaveChip_Auto );
ComboBox->AddItem(GS(SAVE_4K_EEPROM), SaveChip_Eeprom_4K ); ComboBox->AddItemW(GS(SAVE_4K_EEPROM), SaveChip_Eeprom_4K );
ComboBox->AddItem(GS(SAVE_16K_EEPROM), SaveChip_Eeprom_16K ); ComboBox->AddItemW(GS(SAVE_16K_EEPROM), SaveChip_Eeprom_16K );
ComboBox->AddItem(GS(SAVE_SRAM), SaveChip_Sram ); ComboBox->AddItemW(GS(SAVE_SRAM), SaveChip_Sram );
ComboBox->AddItem(GS(SAVE_FLASHRAM), SaveChip_FlashRam ); ComboBox->AddItemW(GS(SAVE_FLASHRAM), SaveChip_FlashRam );
} }
ComboBox = AddModComboBox(GetDlgItem(IDC_COUNTFACT),Game_CounterFactor); ComboBox = AddModComboBox(GetDlgItem(IDC_COUNTFACT),Game_CounterFactor);
if (ComboBox) if (ComboBox)
{ {
ComboBox->SetTextField(GetDlgItem(IDC_COUNTFACT_TEXT)); ComboBox->SetTextField(GetDlgItem(IDC_COUNTFACT_TEXT));
ComboBox->AddItem(GS(NUMBER_1), 1 ); ComboBox->AddItemW(GS(NUMBER_1), 1 );
ComboBox->AddItem(GS(NUMBER_2), 2 ); ComboBox->AddItemW(GS(NUMBER_2), 2 );
ComboBox->AddItem(GS(NUMBER_3), 3 ); ComboBox->AddItemW(GS(NUMBER_3), 3 );
ComboBox->AddItem(GS(NUMBER_4), 4 ); ComboBox->AddItemW(GS(NUMBER_4), 4 );
ComboBox->AddItem(GS(NUMBER_5), 5 ); ComboBox->AddItemW(GS(NUMBER_5), 5 );
ComboBox->AddItem(GS(NUMBER_6), 6 ); ComboBox->AddItemW(GS(NUMBER_6), 6 );
} }
SetDlgItemText(IDC_GOOD_NAME,g_Settings->LoadString(Game_GoodName).c_str()); SetDlgItemText(IDC_GOOD_NAME,g_Settings->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 //Set the text for all gui Items
SetDlgItemText(RSP_ABOUT,GS(PLUG_ABOUT)); SetDlgItemTextW(m_hWnd, RSP_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(GFX_ABOUT,GS(PLUG_ABOUT)); SetDlgItemTextW(m_hWnd, GFX_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(AUDIO_ABOUT,GS(PLUG_ABOUT)); SetDlgItemTextW(m_hWnd, AUDIO_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(CONT_ABOUT,GS(PLUG_ABOUT)); SetDlgItemTextW(m_hWnd, CONT_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(IDC_RSP_NAME,GS(PLUG_RSP)); SetDlgItemTextW(m_hWnd, IDC_RSP_NAME,GS(PLUG_RSP));
SetDlgItemText(IDC_GFX_NAME,GS(PLUG_GFX)); SetDlgItemTextW(m_hWnd, IDC_GFX_NAME,GS(PLUG_GFX));
SetDlgItemText(IDC_AUDIO_NAME,GS(PLUG_AUDIO)); SetDlgItemTextW(m_hWnd, IDC_AUDIO_NAME,GS(PLUG_AUDIO));
SetDlgItemText(IDC_CONT_NAME,GS(PLUG_CTRL)); SetDlgItemTextW(m_hWnd, IDC_CONT_NAME,GS(PLUG_CTRL));
SetDlgItemText(IDC_HLE_GFX,GS(PLUG_HLE_GFX)); SetDlgItemTextW(m_hWnd, IDC_HLE_GFX,GS(PLUG_HLE_GFX));
SetDlgItemText(IDC_HLE_AUDIO,GS(PLUG_HLE_AUDIO)); SetDlgItemTextW(m_hWnd, IDC_HLE_AUDIO,GS(PLUG_HLE_AUDIO));
m_GfxGroup.Attach(GetDlgItem(IDC_GFX_NAME)); m_GfxGroup.Attach(GetDlgItem(IDC_GFX_NAME));
m_AudioGroup.Attach(GetDlgItem(IDC_AUDIO_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->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++ ) 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) 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) if (res != IDYES)
{ {
Button->SetCheck(BST_CHECKED); Button->SetCheck(BST_CHECKED);
@ -333,7 +333,7 @@ void CGamePluginPage::HleAudioChanged ( UINT /*Code*/, int id, HWND /*ctl*/ )
} }
if ((Button->GetCheck() & BST_CHECKED) != 0) 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) if (res != IDYES)
{ {
Button->SetCheck(BST_UNCHECKED); 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); ComboBox = AddModComboBox(GetDlgItem(IDC_CPU_TYPE),Game_CpuType);
if (ComboBox) if (ComboBox)
{ {
ComboBox->AddItem(GS(CORE_RECOMPILER), CPU_Recompiler); ComboBox->AddItemW(GS(CORE_RECOMPILER), CPU_Recompiler);
ComboBox->AddItem(GS(CORE_INTERPTER), CPU_Interpreter); ComboBox->AddItemW(GS(CORE_INTERPTER), CPU_Interpreter);
if (g_Settings->LoadBool(Debugger_Enabled)) 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); ComboBox = AddModComboBox(GetDlgItem(IDC_FUNCFIND),Game_FuncLookupMode);
if (ComboBox) if (ComboBox)
{ {
ComboBox->AddItem(GS(FLM_PLOOKUP), FuncFind_PhysicalLookup); ComboBox->AddItemW(GS(FLM_PLOOKUP), FuncFind_PhysicalLookup);
ComboBox->AddItem(GS(FLM_VLOOKUP), FuncFind_VirtualLookup); ComboBox->AddItemW(GS(FLM_VLOOKUP), FuncFind_VirtualLookup);
//ComboBox->AddItem(GS(FLM_CHANGEMEM), FuncFind_ChangeMemory); //ComboBox->AddItem(GS(FLM_CHANGEMEM), FuncFind_ChangeMemory);
} }
UpdatePageSettings(); UpdatePageSettings();

View File

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

View File

@ -19,13 +19,13 @@ COptionsShortCutsPage::COptionsShortCutsPage (HWND hParent, const RECT & rcDispa
return; return;
} }
SetDlgItemText(IDC_S_CPU_STATE,GS(ACCEL_CPUSTATE_TITLE)); SetDlgItemTextW(m_hWnd, IDC_S_CPU_STATE,GS(ACCEL_CPUSTATE_TITLE));
SetDlgItemText(IDC_MENU_ITEM_TEXT,GS(ACCEL_MENUITEM_TITLE)); SetDlgItemTextW(m_hWnd, IDC_MENU_ITEM_TEXT,GS(ACCEL_MENUITEM_TITLE));
SetDlgItemText(IDC_S_CURRENT_KEYS,GS(ACCEL_CURRENTKEYS_TITLE)); SetDlgItemTextW(m_hWnd, IDC_S_CURRENT_KEYS,GS(ACCEL_CURRENTKEYS_TITLE));
SetDlgItemText(IDC_S_SELECT_SHORT,GS(ACCEL_SELKEY_TITLE)); SetDlgItemTextW(m_hWnd, IDC_S_SELECT_SHORT,GS(ACCEL_SELKEY_TITLE));
SetDlgItemText(IDC_S_CURRENT_ASSIGN,GS(ACCEL_ASSIGNEDTO_TITLE)); SetDlgItemTextW(m_hWnd, IDC_S_CURRENT_ASSIGN,GS(ACCEL_ASSIGNEDTO_TITLE));
SetDlgItemText(IDC_ASSIGN,GS(ACCEL_ASSIGN_BTN)); SetDlgItemTextW(m_hWnd, IDC_ASSIGN,GS(ACCEL_ASSIGN_BTN));
SetDlgItemText(IDC_REMOVE,GS(ACCEL_REMOVE_BTN)); SetDlgItemTextW(m_hWnd, IDC_REMOVE,GS(ACCEL_REMOVE_BTN));
m_CreateNewShortCut.AttachToDlgItem(m_hWnd,IDC_S_SELECT_SHORT); m_CreateNewShortCut.AttachToDlgItem(m_hWnd,IDC_S_SELECT_SHORT);
m_CpuState.Attach(GetDlgItem(IDC_C_CPU_STATE)); 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_MenuItems.ModifyStyle(0,TVS_SHOWSELALWAYS);
m_CpuState.SetItemData(m_CpuState.AddString(GS(ACCEL_CPUSTATE_1)),CMenuShortCutKey::GAME_NOT_RUNNING); m_CpuState.SetItemData(m_CpuState.AddStringW(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.AddStringW(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_4)),CMenuShortCutKey::GAME_RUNNING_FULLSCREEN);
m_CpuState.SetCurSel(0); m_CpuState.SetCurSel(0);
int VirtualKeyListSize; int VirtualKeyListSize;
@ -99,11 +99,11 @@ void COptionsShortCutsPage::OnCpuStateChanged(UINT /*Code*/, int /*id*/, HWND /*
if (hParent == NULL) if (hParent == NULL)
{ {
hParent = m_MenuItems.InsertItem(TVIF_TEXT | TVIF_PARAM,GS(Item->second.Section()),0,0,0,0, hParent = m_MenuItems.InsertItemW(TVIF_TEXT | TVIF_PARAM,GS(Item->second.Section()),0,0,0,0, Item->second.Section(),TVI_ROOT,TVI_LAST);
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("&","");
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()); 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) if (str.length() > 0)
{ {
str.resize(std::remove(str.begin(), str.end(), '&') - str.begin()); 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 //Set the text for all gui Items
SetDlgItemText(RSP_ABOUT,GS(PLUG_ABOUT)); SetDlgItemTextW(m_hWnd, RSP_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(GFX_ABOUT,GS(PLUG_ABOUT)); SetDlgItemTextW(m_hWnd, GFX_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(AUDIO_ABOUT,GS(PLUG_ABOUT)); SetDlgItemTextW(m_hWnd, AUDIO_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(CONT_ABOUT,GS(PLUG_ABOUT)); SetDlgItemTextW(m_hWnd, CONT_ABOUT,GS(PLUG_ABOUT));
SetDlgItemText(IDC_RSP_NAME,GS(PLUG_RSP)); SetDlgItemTextW(m_hWnd, IDC_RSP_NAME,GS(PLUG_RSP));
SetDlgItemText(IDC_GFX_NAME,GS(PLUG_GFX)); SetDlgItemTextW(m_hWnd, IDC_GFX_NAME,GS(PLUG_GFX));
SetDlgItemText(IDC_AUDIO_NAME,GS(PLUG_AUDIO)); SetDlgItemTextW(m_hWnd, IDC_AUDIO_NAME,GS(PLUG_AUDIO));
SetDlgItemText(IDC_CONT_NAME,GS(PLUG_CTRL)); SetDlgItemTextW(m_hWnd, IDC_CONT_NAME,GS(PLUG_CTRL));
SetDlgItemText(IDC_HLE_GFX,GS(PLUG_HLE_GFX)); SetDlgItemTextW(m_hWnd, IDC_HLE_GFX,GS(PLUG_HLE_GFX));
SetDlgItemText(IDC_HLE_AUDIO,GS(PLUG_HLE_AUDIO)); SetDlgItemTextW(m_hWnd, IDC_HLE_AUDIO,GS(PLUG_HLE_AUDIO));
m_GfxGroup.Attach(GetDlgItem(IDC_GFX_NAME)); m_GfxGroup.Attach(GetDlgItem(IDC_GFX_NAME));
m_AudioGroup.Attach(GetDlgItem(IDC_AUDIO_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) 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) if (res != IDYES)
{ {
Button->SetCheck(BST_CHECKED); Button->SetCheck(BST_CHECKED);
@ -319,7 +319,7 @@ void COptionPluginPage::HleAudioChanged ( UINT /*Code*/, int id, HWND /*ctl*/ )
} }
if ((Button->GetCheck() & BST_CHECKED) != 0) 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) if (res != IDYES)
{ {
Button->SetCheck(BST_UNCHECKED); Button->SetCheck(BST_UNCHECKED);

View File

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

View File

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

View File

@ -59,7 +59,20 @@ public:
return indx; 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; m_Reset = Reset;
if (m_Reset) if (m_Reset)

View File

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