diff --git a/VBA.vcproj b/VBA.vcproj index da17ce4c..417b8f91 100644 --- a/VBA.vcproj +++ b/VBA.vcproj @@ -861,6 +861,10 @@ RelativePath=".\src\win32\AVIWrite.cpp" > + + @@ -1419,6 +1423,10 @@ RelativePath=".\src\win32\AVIWrite.h" > + + @@ -1816,13 +1824,6 @@ - - - - - - SetCheck(flashSize == 0x20000); } -void MainWnd::OnOptionsEmulatorUsebiosfile() -{ - if(!theApp.biosFileName.IsEmpty()) - theApp.useBiosFile = !theApp.useBiosFile; -} - -void MainWnd::OnUpdateOptionsEmulatorUsebiosfile(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck(theApp.useBiosFile); - pCmdUI->Enable(!theApp.biosFileName.IsEmpty()); -} - -void MainWnd::OnOptionsEmulatorSkipbios() -{ - theApp.skipBiosFile = !theApp.skipBiosFile; -} - -void MainWnd::OnUpdateOptionsEmulatorSkipbios(CCmdUI* pCmdUI) -{ - pCmdUI->SetCheck(theApp.skipBiosFile); -} - -void MainWnd::OnOptionsEmulatorSelectbiosfile() -{ - theApp.winCheckFullscreen(); - LPCTSTR exts[] = { "" }; - CString filter = winLoadFilter(IDS_FILTER_BIOS); - CString title = winResLoadString(IDS_SELECT_BIOS_FILE); - - FileDlg dlg(this, - theApp.biosFileName, - filter, - 0, - "BIOS", - exts, - "", - title, - false); - - if(dlg.DoModal() == IDOK) { - theApp.biosFileName = dlg.GetPathName(); - } -} - void MainWnd::OnOptionsEmulatorPngformat() { theApp.captureFormat = 0; @@ -2047,3 +2004,23 @@ void MainWnd::OnUpdateRenderapiD3dmotionblur(CCmdUI *pCmdUI) pCmdUI->Enable( FALSE ); #endif } + +void MainWnd::OnEmulatorBiosfiles() +{ + theApp.winCheckFullscreen(); + + BIOSDialog dlg; + dlg.m_enableBIOS_GBA = theApp.useBiosFileGBA ? TRUE : FALSE; + dlg.m_enableBIOS_GB = theApp.useBiosFileGB ? TRUE : FALSE; + dlg.m_skipLogo = theApp.skipBiosFile ? TRUE : FALSE; + dlg.m_pathGBA = theApp.biosFileNameGBA; + dlg.m_pathGB = theApp.biosFileNameGB; + + if( IDOK == dlg.DoModal() ) { + theApp.useBiosFileGBA = dlg.m_enableBIOS_GBA == TRUE; + theApp.useBiosFileGB = dlg.m_enableBIOS_GB == TRUE; + theApp.skipBiosFile = dlg.m_skipLogo == TRUE; + theApp.biosFileNameGBA = dlg.m_pathGBA; + theApp.biosFileNameGB = dlg.m_pathGB; + } +} diff --git a/src/win32/MainWndTools.cpp b/src/win32/MainWndTools.cpp index 25528ea1..2c31488f 100644 --- a/src/win32/MainWndTools.cpp +++ b/src/win32/MainWndTools.cpp @@ -220,7 +220,7 @@ void MainWnd::OnToolsDebugGdb() theApp.emulator = GBASystem; - CPUInit(theApp.biosFileName, theApp.useBiosFile ? true : false); + CPUInit(theApp.biosFileNameGBA, theApp.useBiosFileGBA ? true : false); CPUReset(); } } diff --git a/src/win32/VBA.cpp b/src/win32/VBA.cpp index 91eb7b24..e743dfe8 100644 --- a/src/win32/VBA.cpp +++ b/src/win32/VBA.cpp @@ -246,8 +246,11 @@ VBA::VBA() popup = NULL; cartridgeType = IMAGE_GBA; soundInitialized = false; - useBiosFile = false; + useBiosFileGBA = false; + useBiosFileGB = false; skipBiosFile = false; + biosFileNameGBA = _T(""); + biosFileNameGB = _T(""); active = true; paused = false; recentFreeze = false; @@ -1483,14 +1486,22 @@ void VBA::loadSettings() if(windowPositionY < 0) windowPositionY = 0; - useBiosFile = regQueryDwordValue("useBios", 0) ? true: false; + useBiosFileGBA = ( regQueryDwordValue("useBiosGBA", 0) == 1 ) ? true : false; + + useBiosFileGB = ( regQueryDwordValue("useBiosGB", 0) == 1 ) ? true : false; skipBiosFile = regQueryDwordValue("skipBios", 0) ? true : false; - buffer = regQueryStringValue("biosFile", ""); + buffer = regQueryStringValue("biosFileGBA", ""); if(!buffer.IsEmpty()) { - biosFileName = buffer; + biosFileNameGBA = buffer; + } + + buffer = regQueryStringValue("biosFileGB", ""); + + if(!buffer.IsEmpty()) { + biosFileNameGB = buffer; } int res = regQueryDwordValue("soundEnable", 0x30f); @@ -2536,12 +2547,17 @@ void VBA::saveSettings() regSetDwordValue("windowX", windowPositionX); regSetDwordValue("windowY", windowPositionY); - regSetDwordValue("useBios", useBiosFile); + regSetDwordValue("useBiosGBA", useBiosFileGBA); + + regSetDwordValue("useBiosGB", useBiosFileGB); regSetDwordValue("skipBios", skipBiosFile); - if(!biosFileName.IsEmpty()) - regSetStringValue("biosFile", biosFileName); + if(!biosFileNameGBA.IsEmpty()) + regSetStringValue("biosFileGBA", biosFileNameGBA); + + if(!biosFileNameGB.IsEmpty()) + regSetStringValue("biosFileGB", biosFileNameGB); regSetDwordValue("soundEnable", soundGetEnable() & 0x30f); diff --git a/src/win32/VBA.h b/src/win32/VBA.h index ca1661e7..d5f4884d 100644 --- a/src/win32/VBA.h +++ b/src/win32/VBA.h @@ -117,9 +117,11 @@ class VBA : public CWinApp IDisplay *display; IMAGE_TYPE cartridgeType; bool soundInitialized; - bool useBiosFile; + bool useBiosFileGBA; + bool useBiosFileGB; bool skipBiosFile; - CString biosFileName; + CString biosFileNameGBA; + CString biosFileNameGB; bool active; bool paused; CString recentFiles[10]; diff --git a/src/win32/VBA.rc b/src/win32/VBA.rc index c2180643..fa04adc6 100644 --- a/src/win32/VBA.rc +++ b/src/win32/VBA.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// German (Germany) resources +// English (U.S.) resources -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #endif //_WIN32 @@ -40,43 +40,6 @@ BEGIN CTEXT "bufferInfo",IDC_BUFFERINFO,12,72,144,12,0,WS_EX_DLGMODALFRAME END - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_OAL_CONFIG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 160 - TOPMARGIN, 7 - BOTTOMMARGIN, 107 - END -END -#endif // APSTUDIO_INVOKED - -#endif // German (Germany) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - IDD_SELECT_PLUGIN DIALOG 0, 0, 201, 120 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Select Filter Plugin" @@ -194,23 +157,23 @@ CAPTION "Directories" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN GROUPBOX "Gameboy Advance ROM Images",IDC_STATIC,6,6,210,42 - EDITTEXT IDC_ROM_PATH,12,18,198,12,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_ROM_PATH,12,18,198,12,ES_AUTOHSCROLL PUSHBUTTON "Browse...",IDC_ROM_DIR,12,30,90,12 PUSHBUTTON "Reset",IDC_ROM_DIR_RESET,120,30,90,12 GROUPBOX "Gameboy / Gameboy Color ROM Images",IDC_STATIC,6,48,210,42 - EDITTEXT IDC_GBROM_PATH,12,60,198,12,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_GBROM_PATH,12,60,198,12,ES_AUTOHSCROLL PUSHBUTTON "Browse...",IDC_GBROM_DIR,12,72,90,12 PUSHBUTTON "Reset",IDC_GBROM_DIR_RESET,120,72,84,12 GROUPBOX "Gameboy Internal Battery Saves",IDC_STATIC,6,90,210,42 - EDITTEXT IDC_BATTERY_PATH,12,102,198,12,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_BATTERY_PATH,12,102,198,12,ES_AUTOHSCROLL PUSHBUTTON "Browse...",IDC_BATTERY_DIR,12,114,90,12 PUSHBUTTON "Reset",IDC_BATTERY_DIR_RESET,120,114,90,12 GROUPBOX "VisualBoyAdvance Save Games",IDC_STATIC,6,132,210,42 - EDITTEXT IDC_SAVE_PATH,12,144,198,12,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_SAVE_PATH,12,144,198,12,ES_AUTOHSCROLL PUSHBUTTON "Browse...",IDC_SAVE_DIR,12,156,90,12 PUSHBUTTON "Reset",IDC_SAVE_DIR_RESET,120,156,90,12 GROUPBOX "Screenshots",IDC_STATIC,6,174,210,42 - EDITTEXT IDC_CAPTURE_PATH,12,186,198,12,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_CAPTURE_PATH,12,186,198,12,ES_AUTOHSCROLL PUSHBUTTON "Browse...",IDC_CAPTURE_DIR,12,198,90,12 PUSHBUTTON "Reset",IDC_CAPTURE_DIR_RESET,120,198,90,12 DEFPUSHBUTTON "OK",IDOK,120,234,90,12 @@ -1133,6 +1096,25 @@ BEGIN EDITTEXT IDC_COMMENT,84,24,180,12,ES_AUTOHSCROLL END +IDD_BIOS DIALOGEX 0, 0, 220, 126 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "BIOS Files" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,84,102,60,18 + PUSHBUTTON "Cancel",IDCANCEL,150,102,60,18 + GROUPBOX "Game Boy mono",IDC_STATIC,6,6,210,30 + GROUPBOX "Game Boy Advance",IDC_STATIC,6,48,210,30 + EDITTEXT IDC_GB_BIOS_PATH,12,18,180,12,ES_AUTOHSCROLL + EDITTEXT IDC_GBA_BIOS_PATH,12,60,180,12,ES_AUTOHSCROLL + GROUPBOX "Options",IDC_STATIC,6,90,72,30 + CONTROL "Skip boot logo",IDC_SKIP_BOOT_LOGO,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,12,102,60,12 + CONTROL "Enable",IDC_ENABLE_GB_BIOS,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,174,6,36,8 + CONTROL "Enable",IDC_ENABLE_GBA_BIOS,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,174,48,36,8 + PUSHBUTTON "...",IDC_SELECT_GB_BIOS_PATH,192,18,18,12 + PUSHBUTTON "...",IDC_SELECT_GBA_BIOS_PATH,192,60,18,12 +END + ///////////////////////////////////////////////////////////////////////////// // @@ -1142,6 +1124,14 @@ END #ifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO BEGIN + IDD_OAL_CONFIG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 160 + TOPMARGIN, 7 + BOTTOMMARGIN, 107 + END + IDD_OPENDLG, DIALOG BEGIN RIGHTMARGIN, 165 @@ -1474,6 +1464,14 @@ BEGIN TOPMARGIN, 7 BOTTOMMARGIN, 105 END + + IDD_BIOS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 213 + TOPMARGIN, 7 + BOTTOMMARGIN, 119 + END END #endif // APSTUDIO_INVOKED @@ -1786,6 +1784,7 @@ BEGIN BEGIN MENUITEM "&Associate...", ID_OPTIONS_EMULATOR_ASSOCIATE MENUITEM "&Directories...", ID_OPTIONS_EMULATOR_DIRECTORIES + MENUITEM "BIOS Files...", ID_EMULATOR_BIOSFILES POPUP "&Priority" BEGIN MENUITEM "&Highest", ID_OPTIONS_PRIORITY_HIGHEST @@ -1820,10 +1819,6 @@ BEGIN MENUITEM "Flash 128 KB", ID_OPTIONS_EMULATOR_SAVETYPE_FLASH1M END MENUITEM SEPARATOR - MENUITEM "&Use BIOS file", ID_OPTIONS_EMULATOR_USEBIOSFILE - MENUITEM "Skip BIOS", ID_OPTIONS_EMULATOR_SKIPBIOS - MENUITEM "S&elect BIOS file...", ID_OPTIONS_EMULATOR_SELECTBIOSFILE - MENUITEM SEPARATOR POPUP "Screenshot &Format" BEGIN MENUITEM "&PNG", ID_OPTIONS_EMULATOR_PNGFORMAT @@ -2084,7 +2079,6 @@ STRINGTABLE BEGIN IDS_SELECT_SAVE_DIR "Select Save Directory:" IDS_SELECT_CAPTURE_DIR "Select Capture directory:" - IDS_SELECT_BIOS_FILE "Select BIOS file" IDS_RESET "Reset" IDS_AUTOFIRE_A_DISABLED "autofire A disabled" IDS_AUTOFIRE_A "autofire A" @@ -2126,7 +2120,6 @@ BEGIN IDS_FAILED_TO_LOAD_LIBRARY "Failed to load library %s" IDS_FAILED_TO_GET_LOCINFO "Failed to get locale information" IDS_SELECT_CHEAT_LIST_NAME "Select cheat list name" - IDS_FILTER_BIOS "Gameboy Advance BIOS_*.BIN;*.AGB;*.GBA;*.BIOS;*.ZIP;*.Z;*.7Z;*.GZ__" IDS_FILTER_ROM "All Gameboy _*.BIN;*.AGB;*.GBA;*.MB;*.ELF;*.GB;*.SGB;*.CGB;*.GBC;*.ZIP;*.7Z;*.Z;*.GZ_Gameboy Advance_*.BIN;*.AGB;*.GBA_Gameboy_*.GB;*.SGB_Gameboy Color_*.CGB;*.GBC__" IDS_FILTER_SGM "VisualBoyAdvance Save Game_*.SGM__" IDS_FILTER_CHEAT_LIST "VisualBoyAdvance Cheat List_*.CLT__" diff --git a/src/win32/resource.h b/src/win32/resource.h index 45fee8b5..7644e8af 100644 --- a/src/win32/resource.h +++ b/src/win32/resource.h @@ -98,6 +98,7 @@ #define IDD_SELECT 159 #define IDD_SELECT_PLUGIN 159 #define IDD_OAL_CONFIG 160 +#define IDD_BIOS 161 #define IDC_R0 1000 #define IDC_EDIT_UP 1000 #define IDC_R1 1001 @@ -512,6 +513,13 @@ #define IDC_DEVICE 1269 #define IDC_SLIDER_BUFFERCOUNT 1270 #define IDC_BUFFERINFO 1271 +#define IDC_GB_BIOS_PATH 1272 +#define IDC_GBA_BIOS_PATH 1273 +#define IDC_SKIP_BOOT_LOGO 1274 +#define IDC_ENABLE_GB_BIOS 1275 +#define IDC_ENABLE_GBA_BIOS 1276 +#define IDC_SELECT_GB_BIOS_PATH 1277 +#define IDC_SELECT_GBA_BIOS_PATH 1278 #define IDS_OAL_NODEVICE 2000 #define IDS_OAL_NODLL 2001 #define IDS_AVI_CANNOT_CREATE_AVI 2002 @@ -824,14 +832,15 @@ #define ID_OPTIONS_SPEED 40353 #define ID_RENDERAPI_MOTIONBLUR 40354 #define ID_RENDERAPI_D3DMOTIONBLUR 40355 +#define ID_EMULATOR_BIOSFILES 40356 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 161 -#define _APS_NEXT_COMMAND_VALUE 40356 -#define _APS_NEXT_CONTROL_VALUE 1272 +#define _APS_NEXT_RESOURCE_VALUE 162 +#define _APS_NEXT_COMMAND_VALUE 40357 +#define _APS_NEXT_CONTROL_VALUE 1278 #define _APS_NEXT_SYMED_VALUE 103 #endif #endif