Added Open Rom and Close Rom hotkeys (functions are #IFDEF WIN32). Win32 - removed accel keys for Open/Close ROM. Res.rc cleanup.

This commit is contained in:
adelikat 2008-11-11 04:09:08 +00:00
parent 67774c1322
commit 8ac6fa1256
6 changed files with 67 additions and 42 deletions

View File

@ -25,7 +25,8 @@
extern int maxconbskip;
extern int ffbskip;
extern void LoadNewGamey(HWND hParent, const char *initialdir);
extern void CloseGame();
static int fullscreen = 0;
// Flag that indicates whether Game Genie is enabled or not.

View File

@ -79,8 +79,10 @@ static struct
//{ EMUCMD_MOVIE_SLOT_9, SCAN_9 | CMD_KEY_ALT, },
//{ EMUCMD_MOVIE_RECORD, SCAN_F5 | CMD_KEY_ALT, },
//{ EMUCMD_MOVIE_REPLAY, SCAN_F7 | CMD_KEY_ALT, },
{ EMUCMD_MOVIE_PLAY_FROM_BEGINNING, SCAN_R | CMD_KEY_SHIFT },
{ EMUCMD_SCRIPT_RELOAD, SCAN_L | CMD_KEY_SHIFT },
{ EMUCMD_MOVIE_PLAY_FROM_BEGINNING, SCAN_R | CMD_KEY_SHIFT },
{ EMUCMD_SCRIPT_RELOAD, SCAN_L | CMD_KEY_SHIFT },
{ EMUCMD_OPENROM, SCAN_O | CMD_KEY_CTRL },
{ EMUCMD_CLOSEROM, SCAN_W | CMD_KEY_CTRL },
};
#define NUM_DEFAULT_MAPPINGS (sizeof(DefaultCommandMapping)/sizeof(DefaultCommandMapping[0]))

View File

@ -39,8 +39,8 @@ FCEUMENU MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&Open... Ctrl+O", MENU_OPEN_FILE
MENUITEM "&Close Ctrl+W", MENU_CLOSE_FILE
MENUITEM "&Open...", MENU_OPEN_FILE
MENUITEM "&Close", MENU_CLOSE_FILE
MENUITEM "&Recent", MENU_RECENT_FILES
MENUITEM SEPARATOR
MENUITEM "Load State From...", MENU_LOAD_STATE
@ -59,7 +59,7 @@ BEGIN
MENUITEM "Run Lua Script...", ID_FILE_RUNLUASCRIPT
MENUITEM "Stop Lua Script", ID_FILE_STOPLUASCRIPT
MENUITEM SEPARATOR
MENUITEM "E&xit Alt+F4", MENU_EXIT
MENUITEM "E&xit\tAlt+F4", MENU_EXIT
END
POPUP "&NES"
BEGIN
@ -172,31 +172,31 @@ TASEDITMENU MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New Project Ctrl+N", ID_FILE_NEWPROJECT
MENUITEM "&Open Project... Ctrl+O", ID_FILE_OPENPROJECT
MENUITEM "&Save Project Ctrl+S", ID_FILE_SAVEPROJECT
MENUITEM "Save Project As... Ctrl+Shift+S", ID_FILE_SAVEPROJECTAS
MENUITEM "&New Project\tCtrl+N", ID_FILE_NEWPROJECT
MENUITEM "&Open Project...\tCtrl+O", ID_FILE_OPENPROJECT
MENUITEM "&Save ProjectCtrl+S", ID_FILE_SAVEPROJECT
MENUITEM "Save Project As...\tCtrl+Shift+S", ID_FILE_SAVEPROJECTAS
MENUITEM SEPARATOR
MENUITEM "Import FM2", ID_FILE_IMPORTFM2
MENUITEM "Export to FM2", ID_FILE_EXPORTFM2
MENUITEM SEPARATOR
MENUITEM "Close Ctrl+W", ID_TASEDIT_FILE_CLOSE
MENUITEM "Close\tCtrl+W", ID_TASEDIT_FILE_CLOSE
END
POPUP "Edit"
BEGIN
MENUITEM "Select All", ID_EDIT_SELECTALL
MENUITEM SEPARATOR
MENUITEM "Cut Ctrl+X", ID_TASEDIT_CUT
MENUITEM "Copy Ctrl+C", ID_TASEDIT_COPY
MENUITEM "Paste Ctrl+V", ID_TASEDIT_PASTE
MENUITEM "Paste to New Ctrl+Shift+V", ID_TASEDIT_PASTETONEW
MENUITEM "Delete Ctrl+Delete", ID_TASEDIT_DELETE
MENUITEM "Cut\tCtrl+X", ID_TASEDIT_CUT
MENUITEM "Copy\tCtrl+C", ID_TASEDIT_COPY
MENUITEM "Paste\tCtrl+V", ID_TASEDIT_PASTE
MENUITEM "Paste to New\tCtrl+Shift+V", ID_TASEDIT_PASTETONEW
MENUITEM "Delete\tCtrl+Delete", ID_TASEDIT_DELETE
MENUITEM SEPARATOR
MENUITEM "Add Marker", ID_EDIT_ADDMARKER
MENUITEM "Remove Marker", ID_EDIT_REMOVEMARKER
MENUITEM SEPARATOR
MENUITEM "Truncate Ctrl+T", ID_EDIT_TRUNCATE
MENUITEM "Branch Ctrl+B", ID_EDIT_BRANCH
MENUITEM "Truncate\tCtrl+T", ID_EDIT_TRUNCATE
MENUITEM "Branch\tCtrl+B", ID_EDIT_BRANCH
END
MENUITEM "View", ID_VIEW
POPUP "Help"
@ -219,11 +219,11 @@ BEGIN
MENUITEM "&PPU Memory", MENU_MV_FILE_DUMP_PPU
END
MENUITEM SEPARATOR
MENUITEM "Close", ID_MEMWVIEW_FILE_CLOSE
MENUITEM "Close\tAlt+F4", ID_MEMWVIEW_FILE_CLOSE
END
POPUP "&Edit"
BEGIN
MENUITEM "Undo Ctrl+Z", MENU_MV_EDIT_UNDO
MENUITEM "Undo\tCtrl+Z", MENU_MV_EDIT_UNDO
MENUITEM SEPARATOR
MENUITEM "Copy", MENU_MV_EDIT_COPY
MENUITEM "Paste", MENU_MV_EDIT_PASTE

View File

@ -588,6 +588,16 @@ void FCEUD_HideMenuToggle(void)
ToggleHideMenu();
}
void CloseGame()
{
if (GameInfo)
{
FCEUI_CloseGame();
KillMemView();
updateGameDependentMenus(GameInfo != 0);
}
}
void ALoad(char *nameo, char* innerFilename)
{
if(FCEUI_LoadGameVirtual(nameo, 1))
@ -1107,33 +1117,24 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
FCEUI_VSUniCoin();
break;
case MENU_MEMORY_WATCH:
CreateMemWatch();
break;
case ACCEL_CTRL_O:
case MENU_OPEN_FILE:
// User selected the Open File menu => Show the file selection dialog
LoadNewGamey(hWnd, 0);
break;
case ACCEL_CTRL_W:
case MENU_CLOSE_FILE:
// User selected the Close File menu => Close the game if necessary
if(GameInfo)
{
FCEUI_CloseGame();
KillMemView();
updateGameDependentMenus(GameInfo != 0);
}
CloseGame();
break;
case MENU_CONVERT_MOVIE:
ConvertFCM(hWnd);
break;
case MENU_SAVE_STATE:
// Save state as menu was selected
FCEUD_SaveStateAs();

View File

@ -592,6 +592,8 @@ static void LaunchHex(void);
static void LaunchTraceLogger(void);
static void LaunchCodeDataLogger(void);
static void FA_SkipLag(void);
static void OpenRom(void);
static void CloseRom(void);
struct EMUCMDTABLE FCEUI_CommandTable[]=
{
@ -722,17 +724,19 @@ struct EMUCMDTABLE FCEUI_CommandTable[]=
{ EMUCMD_MISC_USE_INPUT_PRESET_1, EMUCMDTYPE_MISC, CommandUsePreset, 0, 0, "Use Input Preset 1", 0 },
{ EMUCMD_MISC_USE_INPUT_PRESET_2, EMUCMDTYPE_MISC, CommandUsePreset, 0, 0, "Use Input Preset 2", 0 },
{ EMUCMD_MISC_USE_INPUT_PRESET_3, EMUCMDTYPE_MISC, CommandUsePreset, 0, 0, "Use Input Preset 3", 0 },
{ EMUCMD_MISC_DISPLAY_BG_TOGGLE, EMUCMDTYPE_MISC, BackgroundDisplayToggle, 0, 0, "Toggle Background Display", 0 },
{ EMUCMD_MISC_DISPLAY_OBJ_TOGGLE, EMUCMDTYPE_MISC, ObjectDisplayToggle, 0, 0, "Toggle Object Display", 0 },
{ EMUCMD_MISC_DISPLAY_LAGCOUNTER_TOGGLE, EMUCMDTYPE_MISC, LagCounterToggle, 0, 0, "Lag Counter Toggle", 0 },
{ EMUCMD_MISC_LAGCOUNTER_RESET, EMUCMDTYPE_MISC, LagCounterReset, 0, 0, "Lag Counter Reset", 0},
{ EMUCMD_TOOL_OPENMEMORYWATCH, EMUCMDTYPE_TOOL, LaunchMemoryWatch, 0, 0, "Open Memory Watch", 0},
{ EMUCMD_TOOL_OPENDEBUGGER, EMUCMDTYPE_TOOL, LaunchDebugger, 0, 0, "Open Debugger", 0},
{ EMUCMD_TOOL_OPENHEX, EMUCMDTYPE_TOOL, LaunchHex, 0, 0, "Open Hex Editor", 0},
{ EMUCMD_TOOL_OPENPPU, EMUCMDTYPE_TOOL, LaunchPPU, 0, 0, "Open PPU Viewer", 0},
{ EMUCMD_TOOL_OPENTRACELOGGER, EMUCMDTYPE_TOOL, LaunchTraceLogger, 0, 0, "Open Trace Logger", 0},
{ EMUCMD_TOOL_OPENCDLOGGER, EMUCMDTYPE_TOOL, LaunchCodeDataLogger, 0, 0, "Open Code/Data Logger", 0},
{ EMUCMD_FRAMEADV_SKIPLAG, EMUCMDTYPE_MISC, FA_SkipLag, 0, 0, "Frame Adv.-Skip Lag", 0}
{ EMUCMD_MISC_DISPLAY_BG_TOGGLE, EMUCMDTYPE_MISC, BackgroundDisplayToggle, 0, 0, "Toggle Background Display", 0 },
{ EMUCMD_MISC_DISPLAY_OBJ_TOGGLE, EMUCMDTYPE_MISC, ObjectDisplayToggle, 0, 0, "Toggle Object Display", 0 },
{ EMUCMD_MISC_DISPLAY_LAGCOUNTER_TOGGLE,EMUCMDTYPE_MISC, LagCounterToggle, 0, 0, "Lag Counter Toggle", 0 },
{ EMUCMD_MISC_LAGCOUNTER_RESET, EMUCMDTYPE_MISC, LagCounterReset, 0, 0, "Lag Counter Reset", 0},
{ EMUCMD_TOOL_OPENMEMORYWATCH, EMUCMDTYPE_TOOL, LaunchMemoryWatch,0, 0, "Open Memory Watch", 0},
{ EMUCMD_TOOL_OPENDEBUGGER, EMUCMDTYPE_TOOL, LaunchDebugger, 0, 0, "Open Debugger", 0},
{ EMUCMD_TOOL_OPENHEX, EMUCMDTYPE_TOOL, LaunchHex, 0, 0, "Open Hex Editor", 0},
{ EMUCMD_TOOL_OPENPPU, EMUCMDTYPE_TOOL, LaunchPPU, 0, 0, "Open PPU Viewer", 0},
{ EMUCMD_TOOL_OPENTRACELOGGER, EMUCMDTYPE_TOOL, LaunchTraceLogger, 0, 0, "Open Trace Logger", 0},
{ EMUCMD_TOOL_OPENCDLOGGER, EMUCMDTYPE_TOOL, LaunchCodeDataLogger, 0, 0, "Open Code/Data Logger", 0},
{ EMUCMD_FRAMEADV_SKIPLAG, EMUCMDTYPE_MISC, FA_SkipLag, 0, 0, "Frame Adv.-Skip Lag", 0},
{ EMUCMD_OPENROM, EMUCMDTYPE_TOOL, OpenRom, 0, 0, "Open ROM", 0},
{ EMUCMD_CLOSEROM, EMUCMDTYPE_TOOL, CloseRom, 0, 0, "Close ROM", 0}
};
#define NUM_EMU_CMDS (sizeof(FCEUI_CommandTable)/sizeof(FCEUI_CommandTable[0]))
@ -921,3 +925,18 @@ static void FA_SkipLag(void)
{
frameAdvanceLagSkip ^= 1;
}
static void OpenRom(void)
{
#ifdef WIN32
extern HWND hAppWnd;
LoadNewGamey(hAppWnd, 0);
#endif
}
static void CloseRom(void)
{
#ifdef WIN32
CloseGame();
#endif
}

View File

@ -237,6 +237,8 @@ enum EMUCMD
EMUCMD_TOOL_OPENTRACELOGGER,
EMUCMD_TOOL_OPENCDLOGGER,
EMUCMD_FRAMEADV_SKIPLAG,
EMUCMD_OPENROM,
EMUCMD_CLOSEROM,
EMUCMD_MAX
};