ADDED "Quick Open ROM..." menu entry
This commit is contained in:
parent
89212b8e38
commit
805315a8d1
|
@ -418,6 +418,7 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
|
||||||
ON_WM_ENTERSIZEMOVE()
|
ON_WM_ENTERSIZEMOVE()
|
||||||
ON_COMMAND(ID_AUDIO_CORE_SETTINGS, &MainWnd::OnAudioCoreSettings)
|
ON_COMMAND(ID_AUDIO_CORE_SETTINGS, &MainWnd::OnAudioCoreSettings)
|
||||||
ON_UPDATE_COMMAND_UI(ID_AUDIO_CORE_SETTINGS, &MainWnd::OnUpdateAudioCoreSettings)
|
ON_UPDATE_COMMAND_UI(ID_AUDIO_CORE_SETTINGS, &MainWnd::OnUpdateAudioCoreSettings)
|
||||||
|
ON_COMMAND(ID_FILE_QUICKOPENROM, &MainWnd::OnFileQuickopenrom)
|
||||||
END_MESSAGE_MAP()
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
|
||||||
|
@ -1027,32 +1028,30 @@ bool MainWnd::fileOpenSelect( int system )
|
||||||
{
|
{
|
||||||
theApp.dir = _T("");
|
theApp.dir = _T("");
|
||||||
CString initialDir;
|
CString initialDir;
|
||||||
int selectedFilter = 0;
|
|
||||||
LPCTSTR exts[] = { _T(""), _T(""), _T(""), _T("") };
|
LPCTSTR exts[] = { _T(""), _T(""), _T(""), _T("") };
|
||||||
CString filter;
|
CString filter;
|
||||||
CString title;
|
CString title;
|
||||||
|
|
||||||
switch( system )
|
switch( system )
|
||||||
{
|
{
|
||||||
|
case 100:
|
||||||
|
// Quick Open File
|
||||||
|
initialDir = regQueryStringValue( _T("QuickOpenFileLastDir"), _T(".") );
|
||||||
|
filter = winLoadFilter( IDS_FILTER_ALLROM );
|
||||||
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
// GBA
|
// GBA
|
||||||
initialDir = regQueryStringValue( _T("romdir"), _T(".") );
|
initialDir = regQueryStringValue( _T("romdir"), _T(".") );
|
||||||
selectedFilter = regQueryDwordValue( _T("selectedFilter"), 0);
|
|
||||||
if( (selectedFilter < 0) || (selectedFilter > 2) ) {
|
|
||||||
selectedFilter = 0;
|
|
||||||
}
|
|
||||||
filter = winLoadFilter( IDS_FILTER_GBAROM );
|
filter = winLoadFilter( IDS_FILTER_GBAROM );
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
// GBC
|
// GBC
|
||||||
initialDir = regQueryStringValue( _T("gbcromdir"), _T(".") );
|
initialDir = regQueryStringValue( _T("gbcromdir"), _T(".") );
|
||||||
// TODO: memorize selected filter for GBC as well
|
|
||||||
filter = winLoadFilter( IDS_FILTER_GBCROM );
|
filter = winLoadFilter( IDS_FILTER_GBCROM );
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
// GB
|
// GB
|
||||||
initialDir = regQueryStringValue( _T("gbromdir"), _T(".") );
|
initialDir = regQueryStringValue( _T("gbromdir"), _T(".") );
|
||||||
// TODO: memorize selected filter for GB as well
|
|
||||||
filter = winLoadFilter( IDS_FILTER_GBROM );
|
filter = winLoadFilter( IDS_FILTER_GBROM );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1077,19 +1076,18 @@ bool MainWnd::fileOpenSelect( int system )
|
||||||
theApp.szFile = _T("");
|
theApp.szFile = _T("");
|
||||||
|
|
||||||
|
|
||||||
FileDlg dlg( this, _T(""), filter, selectedFilter, _T(""), exts, theApp.dir, title, false);
|
FileDlg dlg( this, _T(""), filter, 0, _T(""), exts, theApp.dir, title, false);
|
||||||
|
|
||||||
if( dlg.DoModal() == IDOK ) {
|
if( dlg.DoModal() == IDOK ) {
|
||||||
if( system == 0 ) {
|
|
||||||
regSetDwordValue( _T("selectedFilter"), dlg.m_ofn.nFilterIndex );
|
|
||||||
}
|
|
||||||
theApp.szFile = dlg.GetPathName();
|
theApp.szFile = dlg.GetPathName();
|
||||||
theApp.dir = theApp.szFile.Left( dlg.m_ofn.nFileOffset );
|
theApp.dir = theApp.szFile.Left( dlg.m_ofn.nFileOffset );
|
||||||
if( (theApp.dir.GetLength() > 3) && (theApp.dir[theApp.dir.GetLength()-1] == _T('\\')) ) {
|
if( (theApp.dir.GetLength() > 3) && (theApp.dir[theApp.dir.GetLength()-1] == _T('\\')) ) {
|
||||||
theApp.dir = theApp.dir.Left( theApp.dir.GetLength() - 1 );
|
theApp.dir = theApp.dir.Left( theApp.dir.GetLength() - 1 );
|
||||||
}
|
}
|
||||||
SetCurrentDirectory( theApp.dir );
|
SetCurrentDirectory( theApp.dir );
|
||||||
regSetStringValue( _T("lastDir"), theApp.dir );
|
if( system == 100 ) {
|
||||||
|
regSetStringValue( _T("QuickOpenFileLastDir"), theApp.dir );
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -78,6 +78,7 @@ protected:
|
||||||
afx_msg void OnClose();
|
afx_msg void OnClose();
|
||||||
afx_msg void OnHelpAbout();
|
afx_msg void OnHelpAbout();
|
||||||
afx_msg void OnHelpFaq();
|
afx_msg void OnHelpFaq();
|
||||||
|
afx_msg void OnFileQuickopenrom();
|
||||||
afx_msg void OnFileOpenGBA();
|
afx_msg void OnFileOpenGBA();
|
||||||
afx_msg void OnFileOpenGBC();
|
afx_msg void OnFileOpenGBC();
|
||||||
afx_msg void OnFileOpenGB();
|
afx_msg void OnFileOpenGB();
|
||||||
|
|
|
@ -41,6 +41,13 @@ extern void remoteCleanUp();
|
||||||
extern void InterframeCleanup();
|
extern void InterframeCleanup();
|
||||||
|
|
||||||
|
|
||||||
|
void MainWnd::OnFileQuickopenrom()
|
||||||
|
{
|
||||||
|
if( fileOpenSelect( 100 ) ) {
|
||||||
|
FileRun();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWnd::OnFileOpenGBA()
|
void MainWnd::OnFileOpenGBA()
|
||||||
{
|
{
|
||||||
if( fileOpenSelect( 0 ) ) {
|
if( fileOpenSelect( 0 ) ) {
|
||||||
|
|
|
@ -1611,9 +1611,19 @@ IDR_MENU MENU
|
||||||
BEGIN
|
BEGIN
|
||||||
POPUP "&File"
|
POPUP "&File"
|
||||||
BEGIN
|
BEGIN
|
||||||
|
MENUITEM "Quick Open ROM...", ID_FILE_QUICKOPENROM
|
||||||
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Open GBA...", ID_FILE_OPEN_GBA
|
MENUITEM "Open GBA...", ID_FILE_OPEN_GBA
|
||||||
MENUITEM "Open GBC...", ID_FILE_OPEN_GBC
|
MENUITEM "Open GBC...", ID_FILE_OPEN_GBC
|
||||||
MENUITEM "Open GB...", ID_FILE_OPEN_GB
|
MENUITEM "Open GB...", ID_FILE_OPEN_GB
|
||||||
|
MENUITEM "Close", ID_FILE_CLOSE
|
||||||
|
MENUITEM SEPARATOR
|
||||||
|
POPUP "Recent"
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "&Reset", ID_FILE_RECENT_RESET
|
||||||
|
MENUITEM "&Freeze", ID_FILE_RECENT_FREEZE
|
||||||
|
MENUITEM SEPARATOR
|
||||||
|
END
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Load...", ID_FILE_LOAD
|
MENUITEM "Load...", ID_FILE_LOAD
|
||||||
MENUITEM "Save...", ID_FILE_SAVE
|
MENUITEM "Save...", ID_FILE_SAVE
|
||||||
|
@ -1653,13 +1663,6 @@ BEGIN
|
||||||
MENUITEM "Pause", ID_FILE_PAUSE
|
MENUITEM "Pause", ID_FILE_PAUSE
|
||||||
MENUITEM "Reset", ID_FILE_RESET
|
MENUITEM "Reset", ID_FILE_RESET
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
POPUP "Recent"
|
|
||||||
BEGIN
|
|
||||||
MENUITEM "&Reset", ID_FILE_RECENT_RESET
|
|
||||||
MENUITEM "&Freeze", ID_FILE_RECENT_FREEZE
|
|
||||||
MENUITEM SEPARATOR
|
|
||||||
END
|
|
||||||
MENUITEM SEPARATOR
|
|
||||||
POPUP "Import"
|
POPUP "Import"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "&Battery file...", ID_FILE_IMPORT_BATTERYFILE
|
MENUITEM "&Battery file...", ID_FILE_IMPORT_BATTERYFILE
|
||||||
|
@ -1676,8 +1679,6 @@ BEGIN
|
||||||
MENUITEM "ROM Information...", ID_FILE_ROMINFORMATION
|
MENUITEM "ROM Information...", ID_FILE_ROMINFORMATION
|
||||||
MENUITEM "Toggle Fullscreen", ID_FILE_TOGGLEMENU
|
MENUITEM "Toggle Fullscreen", ID_FILE_TOGGLEMENU
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Close", ID_FILE_CLOSE
|
|
||||||
MENUITEM SEPARATOR
|
|
||||||
MENUITEM "Exit", ID_FILE_EXIT
|
MENUITEM "Exit", ID_FILE_EXIT
|
||||||
END
|
END
|
||||||
POPUP "&Options"
|
POPUP "&Options"
|
||||||
|
@ -2216,6 +2217,7 @@ BEGIN
|
||||||
IDS_TOOLTIP_ENHANCE_SOUND "Enable the following sound enhancements."
|
IDS_TOOLTIP_ENHANCE_SOUND "Enable the following sound enhancements."
|
||||||
IDS_TOOLTIP_SURROUND "Inverts the phase of some channels, making it sound as if sound is coming from behind."
|
IDS_TOOLTIP_SURROUND "Inverts the phase of some channels, making it sound as if sound is coming from behind."
|
||||||
IDS_TOOLTIP_DECLICKING "When enabled, clicks are reduced by using GBA sound hardware. Note that clicks are normal for GB and GBC sound hardware."
|
IDS_TOOLTIP_DECLICKING "When enabled, clicks are reduced by using GBA sound hardware. Note that clicks are normal for GB and GBC sound hardware."
|
||||||
|
IDS_FILTER_ALLROM "All ROMs (*.GBA;*.AGB;*.BIN;*.ELF;*.MB;*.GBC;*.CGB;*.GB;*.SGB;*.ZIP;*.7Z;*.Z;*.GZ)_*.GBA;*.AGB;*.BIN;*.ELF;*.MB;*.GBC;*.CGB;*.GB;*.SGB;*.ZIP;*.7Z;*.Z;*.GZ_All Files (*.*)_*.*__"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
#define IDS_TOOLTIP_ENHANCE_SOUND 43
|
#define IDS_TOOLTIP_ENHANCE_SOUND 43
|
||||||
#define IDS_TOOLTIP_SURROUND 44
|
#define IDS_TOOLTIP_SURROUND 44
|
||||||
#define IDS_TOOLTIP_DECLICKING 45
|
#define IDS_TOOLTIP_DECLICKING 45
|
||||||
#define IDS_FILTER_COMPRESSED_FILES 46
|
#define IDS_FILTER_ALLROM 46
|
||||||
#define IDI_MAINICON 101
|
#define IDI_MAINICON 101
|
||||||
#define IDD_REGISTERS 102
|
#define IDD_REGISTERS 102
|
||||||
#define IDD_DEBUG 103
|
#define IDD_DEBUG 103
|
||||||
|
@ -866,13 +866,14 @@
|
||||||
#define ID_OUTPUTAPI_XAUDIO2CONFIG 40364
|
#define ID_OUTPUTAPI_XAUDIO2CONFIG 40364
|
||||||
#define ID_AUDIO_CORE_SETTINGS 40365
|
#define ID_AUDIO_CORE_SETTINGS 40365
|
||||||
#define ID_FILE_OPEN_GBA 40366
|
#define ID_FILE_OPEN_GBA 40366
|
||||||
|
#define ID_FILE_QUICKOPENROM 40367
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 165
|
#define _APS_NEXT_RESOURCE_VALUE 165
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40367
|
#define _APS_NEXT_COMMAND_VALUE 40368
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1297
|
#define _APS_NEXT_CONTROL_VALUE 1297
|
||||||
#define _APS_NEXT_SYMED_VALUE 103
|
#define _APS_NEXT_SYMED_VALUE 103
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue