Win32 - Add hotkeys for Ram Search and Ram Watch dialogs

This commit is contained in:
adelikat 2009-11-01 02:20:31 +00:00
parent f028e0d9bd
commit f2b59bac4d
3 changed files with 40 additions and 4 deletions

View File

@ -136,6 +136,8 @@ bool rightClickEnabled = true; //If set to false, the right click context menu
void ChangeMenuItemText(int menuitem, string text); //Alters a menu item name
void ChangeContextMenuItemText(int menuitem, string text, HMENU menu); //Alters a context menu item name
void SaveMovieAs(); //Gets a filename for Save Movie As...
void OpenRamSearch();
void OpenRamWatch();
//Recent Menu Strings ------------------------------------
char *recent_files[] = { 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 };
@ -1710,8 +1712,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
case ID_RAM_SEARCH:
if(!RamSearchHWnd)
{
reset_address_info();
RamSearchHWnd = CreateDialog(fceu_hInstance, MAKEINTRESOURCE(IDD_RAMSEARCH), hWnd, (DLGPROC) RamSearchProc);
OpenRamSearch();
}
else
SetForegroundWindow(RamSearchHWnd);
@ -1720,7 +1721,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
case ID_RAM_WATCH:
if(!RamWatchHWnd)
{
RamWatchHWnd = CreateDialog(fceu_hInstance, MAKEINTRESOURCE(IDD_RAMWATCH), hWnd, (DLGPROC) RamWatchProc);
OpenRamWatch();
}
else
SetForegroundWindow(RamWatchHWnd);
@ -2646,4 +2647,15 @@ void SaveMovieAs()
tempName.append(".fm2"); //If not, make it .fm2
FCEUI_CreateMovieFile(tempName);
}
}
void OpenRamSearch()
{
reset_address_info();
RamSearchHWnd = CreateDialog(fceu_hInstance, MAKEINTRESOURCE(IDD_RAMSEARCH), MainhWnd, (DLGPROC) RamSearchProc);
}
void OpenRamWatch()
{
RamWatchHWnd = CreateDialog(fceu_hInstance, MAKEINTRESOURCE(IDD_RAMWATCH), MainhWnd, (DLGPROC) RamWatchProc);
}

View File

@ -601,6 +601,8 @@ static void LaunchPPU(void);
static void LaunchHex(void);
static void LaunchTraceLogger(void);
static void LaunchCodeDataLogger(void);
static void LaunchRamWatch(void);
static void LaunchRamSearch(void);
static void FA_SkipLag(void);
static void OpenRom(void);
static void CloseRom(void);
@ -720,7 +722,9 @@ struct EMUCMDTABLE FCEUI_CommandTable[]=
{ EMUCMD_CLOSEROM, EMUCMDTYPE_TOOL, CloseRom, 0, 0, "Close ROM", 0},
{ EMUCMD_MISC_DISPLAY_MOVIESUBTITLES, EMUCMDTYPE_MISC, MovieSubtitleToggle,0,0,"Toggle Movie Subtitles", 0},
{ EMUCMD_MISC_UNDOREDOSAVESTATE, EMUCMDTYPE_MISC, UndoRedoSavestate, 0,0,"Undo/Redo Savestate", 0},
{ EMUCMD_MISC_TOGGLEFULLSCREEN, EMUCMDTYPE_MISC, ToggleFullscreen, 0, 0, "Toggle Fullscreen", 0}
{ EMUCMD_MISC_TOGGLEFULLSCREEN, EMUCMDTYPE_MISC, ToggleFullscreen, 0, 0, "Toggle Fullscreen", 0},
{ EMUCMD_TOOL_OPENRAMWATCH, EMUCMDTYPE_TOOL, LaunchRamWatch, 0, 0, "Open Ram Watch", 0},
{ EMUCMD_TOOL_OPENRAMSEARCH, EMUCMDTYPE_TOOL, LaunchRamSearch, 0, 0, "Open Ram Search", 0},
};
#define NUM_EMU_CMDS (sizeof(FCEUI_CommandTable)/sizeof(FCEUI_CommandTable[0]))
@ -905,6 +909,24 @@ static void LaunchCheats(void)
#endif
}
static void LaunchRamWatch(void)
{
#ifdef WIN32
extern void OpenRamWatch(); //adelikat: Blah blah hacky, I know
OpenRamWatch();
#endif
}
static void LaunchRamSearch(void)
{
#ifdef WIN32
extern void OpenRamSearch();
OpenRamSearch();
#endif
}
static void FA_SkipLag(void)
{
frameAdvanceLagSkip ^= 1;

View File

@ -219,6 +219,8 @@ enum EMUCMD
EMUCMD_MISC_DISPLAY_MOVIESUBTITLES,
EMUCMD_MISC_UNDOREDOSAVESTATE,
EMUCMD_MISC_TOGGLEFULLSCREEN,
EMUCMD_TOOL_OPENRAMWATCH,
EMUCMD_TOOL_OPENRAMSEARCH,
EMUCMD_MAX
};