diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 114c43ced..4e3ff555a 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -2331,8 +2331,59 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM { case WM_ENTERMENULOOP: //Update menu items that needs to be updated dynamically { + //Check if AVI is recording EnableMenuItem(mainMenu, IDM_FILE_RECORDAVI, MF_BYCOMMAND | (!DRV_AviIsRecording()) ? MF_ENABLED : MF_GRAYED); EnableMenuItem(mainMenu, IDM_FILE_STOPAVI, MF_BYCOMMAND | (DRV_AviIsRecording()) ? MF_ENABLED : MF_GRAYED); + + //Menu items dependent on a ROM oaded + EnableMenuItem(mainMenu, IDM_STATE_SAVE, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); + EnableMenuItem(mainMenu, IDM_STATE_LOAD, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); + EnableMenuItem(mainMenu, IDM_PRINTSCREEN, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); + EnableMenuItem(mainMenu, IDM_QUICK_PRINTSCREEN, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); + EnableMenuItem(mainMenu, IDM_FILE_RECORDAVI, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); + EnableMenuItem(mainMenu, IDM_FILE_STOPAVI, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); + EnableMenuItem(mainMenu, IDM_RESET, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); + EnableMenuItem(mainMenu, IDM_SHUT_UP, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); + EnableMenuItem(mainMenu, IDM_CHEATS_LIST, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); + EnableMenuItem(mainMenu, IDM_CHEATS_SEARCH, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); + + //Update savestate slot items based on ROM loaded + for (int x = 0; x < 10; x++) + { + EnableMenuItem(mainMenu, IDM_STATE_SAVE_F1+x, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); + EnableMenuItem(mainMenu, IDM_STATE_LOAD_F1+x, MF_BYCOMMAND | (romloaded) ? MF_ENABLED : MF_GRAYED); + } + + //Updated Checked menu items + + //Pause + MainWindow->checkMenu(IDM_PAUSE, MF_BYCOMMAND | ((paused)?MF_CHECKED:MF_UNCHECKED)); + //Screen rotation + MainWindow->checkMenu(IDC_ROTATE0, MF_BYCOMMAND | ((GPU_rotation==0)?MF_CHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(IDC_ROTATE90, MF_BYCOMMAND | ((GPU_rotation==90)?MF_CHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(IDC_ROTATE180, MF_BYCOMMAND | ((GPU_rotation==180)?MF_CHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(IDC_ROTATE270, MF_BYCOMMAND | ((GPU_rotation==270)?MF_CHECKED:MF_UNCHECKED)); + + //Window Size + MainWindow->checkMenu(IDC_WINDOW1X, MF_BYCOMMAND | ((windowSize==1)?MF_CHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(IDC_WINDOW1_5X, MF_BYCOMMAND |((windowSize==-1)?MF_CHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(IDC_WINDOW2X, MF_BYCOMMAND | ((windowSize==2)?MF_CHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(IDC_WINDOW3X, MF_BYCOMMAND | ((windowSize==3)?MF_CHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(IDC_WINDOW4X, MF_BYCOMMAND | ((windowSize==4)?MF_CHECKED:MF_UNCHECKED)); + + //Screen Separation + MainWindow->checkMenu(IDM_SCREENSEP_NONE, MF_BYCOMMAND | ((ScreenGap==0)? MF_CHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(IDM_SCREENSEP_BORDER, MF_BYCOMMAND | ((ScreenGap==5)? MF_CHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(IDM_SCREENSEP_NDSGAP, MF_BYCOMMAND | ((ScreenGap==64)?MF_CHECKED:MF_UNCHECKED)); + + //Counters + MainWindow->checkMenu(ID_VIEW_FRAMECOUNTER, MF_BYCOMMAND | ((frameCounterDisplay)?MF_CHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(ID_VIEW_DISPLAYFPS, MF_BYCOMMAND | ((FpsDisplay)?MF_CHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(ID_VIEW_DISPLAYINPUT, MF_BYCOMMAND | ((ShowInputDisplay)?MF_CHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(ID_VIEW_DISPLAYLAG, MF_BYCOMMAND | ((ShowLagFrameCounter)?MF_CHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(ID_VIEW_DISPLAYMICROPHONE, MF_BYCOMMAND | ((ShowMicrophone)?MF_UNCHECKED:MF_UNCHECKED)); + MainWindow->checkMenu(ID_VIEW_HUDEDITOR, MF_BYCOMMAND | ((HudEditorMode)?MF_CHECKED:MF_UNCHECKED)); + return 0; } /*case WM_EXITMENULOOP: diff --git a/desmume/src/windows/resources.rc b/desmume/src/windows/resources.rc index 0a0587563..7060e8f12 100644 --- a/desmume/src/windows/resources.rc +++ b/desmume/src/windows/resources.rc @@ -248,7 +248,7 @@ MENU_PRINCIPAL MENU MENUITEM "&Pause", IDM_PAUSE MENUITEM "&Reset", IDM_RESET MENUITEM SEPARATOR - MENUITEM "Shut Up", IDM_SHUT_UP + MENUITEM "Clear Sound", IDM_SHUT_UP MENUITEM SEPARATOR MENUITEM "GBA &slot", IDM_GBASLOT POPUP "&Cheats" @@ -2152,7 +2152,7 @@ CAPTION "OAM Fremviser" FONT 8, "MS Sans Serif", 0, 0, 1 { COMBOBOX IDC_SCR_SELECT, 4, 4, 90, 14, WS_TABSTOP | WS_TABSTOP | CBS_DROPDOWNLIST - SCROLLBAR IDC_SCROLLER, 48, 20, 20, 14, NOT WS_VISIBLE + SCROLLBAR IDC_SCROLLER, 48, 20, 20, 14, NOT WS_VISIBLE | NOT WS_VISIBLE LTEXT "Mode :", IDC_STATIC, 4, 36, 45, 8, SS_LEFT LTEXT "Tile :", IDC_STATIC, 4, 46, 45, 8, SS_LEFT LTEXT "Palette :", IDC_STATIC, 4, 56, 45, 8, SS_LEFT @@ -2188,7 +2188,7 @@ CAPTION "OAM Viewer" FONT 8, "MS Sans Serif", 0, 0, 1 { COMBOBOX IDC_SCR_SELECT, 4, 4, 90, 14, WS_TABSTOP | WS_TABSTOP | CBS_DROPDOWNLIST - SCROLLBAR IDC_SCROLLER, 48, 20, 20, 14, NOT WS_VISIBLE + SCROLLBAR IDC_SCROLLER, 48, 20, 20, 14, NOT WS_VISIBLE | NOT WS_VISIBLE LTEXT "Mode :", IDC_STATIC, 4, 36, 45, 8, SS_LEFT LTEXT "Tile :", IDC_STATIC, 4, 46, 45, 8, SS_LEFT LTEXT "Palette :", IDC_STATIC, 4, 56, 45, 8, SS_LEFT @@ -2224,7 +2224,7 @@ CAPTION "OAM Viewer" FONT 8, "MS Sans Serif", 0, 0, 1 { COMBOBOX IDC_SCR_SELECT, 4, 4, 90, 14, WS_TABSTOP | WS_TABSTOP | CBS_DROPDOWNLIST - SCROLLBAR IDC_SCROLLER, 48, 20, 20, 14, NOT WS_VISIBLE + SCROLLBAR IDC_SCROLLER, 48, 20, 20, 14, NOT WS_VISIBLE | NOT WS_VISIBLE LTEXT "Mode :", IDC_STATIC, 4, 36, 45, 8, SS_LEFT LTEXT "Tile :", IDC_STATIC, 4, 46, 45, 8, SS_LEFT LTEXT "Palette :", IDC_STATIC, 4, 56, 45, 8, SS_LEFT @@ -2261,7 +2261,7 @@ FONT 8, "MS Sans Serif", 0, 0, 1 { COMBOBOX IDC_PAL_SELECT, 15, 3, 90, 14, WS_TABSTOP | WS_TABSTOP | CBS_DROPDOWN LTEXT "Pal : 0", IDC_PALNUM, 3, 21, 25, 8, SS_LEFT - SCROLLBAR IDC_SCROLLER, 30, 18, 20, 14, NOT WS_VISIBLE + SCROLLBAR IDC_SCROLLER, 30, 18, 20, 14, NOT WS_VISIBLE | NOT WS_VISIBLE PUSHBUTTON "&Luk", IDC_FERMER, 35, 169, 50, 14, BS_PUSHBUTTON AUTOCHECKBOX "&Auto-update", IDC_AUTO_UPDATE, 13, 150, 54, 14, BS_AUTOCHECKBOX EDITTEXT IDC_AUTO_UPDATE_SECS, 68, 151, 12, 14, WS_DISABLED | ES_AUTOHSCROLL | ES_READONLY @@ -2279,7 +2279,7 @@ FONT 8, "MS Sans Serif", 0, 0, 1 { COMBOBOX IDC_PAL_SELECT, 15, 3, 90, 14, WS_TABSTOP | WS_TABSTOP | CBS_DROPDOWN LTEXT "Pal : 0", IDC_PALNUM, 3, 21, 25, 8, SS_LEFT - SCROLLBAR IDC_SCROLLER, 30, 18, 20, 14, NOT WS_VISIBLE + SCROLLBAR IDC_SCROLLER, 30, 18, 20, 14, NOT WS_VISIBLE | NOT WS_VISIBLE PUSHBUTTON "&Close", IDC_FERMER, 35, 169, 50, 14, BS_PUSHBUTTON AUTOCHECKBOX "&Auto-update", IDC_AUTO_UPDATE, 13, 150, 54, 14, BS_AUTOCHECKBOX EDITTEXT IDC_AUTO_UPDATE_SECS, 68, 151, 12, 14, WS_DISABLED | ES_AUTOHSCROLL | ES_READONLY @@ -2297,7 +2297,7 @@ FONT 8, "MS Sans Serif", 0, 0, 1 { COMBOBOX IDC_PAL_SELECT, 15, 3, 90, 14, WS_TABSTOP | WS_TABSTOP | CBS_DROPDOWN LTEXT "Pal : 0", IDC_PALNUM, 3, 21, 25, 8, SS_LEFT - SCROLLBAR IDC_SCROLLER, 30, 18, 20, 14, NOT WS_VISIBLE + SCROLLBAR IDC_SCROLLER, 30, 18, 20, 14, NOT WS_VISIBLE | NOT WS_VISIBLE AUTOCHECKBOX "Auto-update", IDC_AUTO_UPDATE, 60, 18, 75, 14, BS_AUTOCHECKBOX PUSHBUTTON "&Fermer", IDC_FERMER, 35, 169, 50, 14, BS_PUSHBUTTON AUTOCHECKBOX "&Auto-update", IDC_AUTO_UPDATE2, 13, 150, 54, 14, BS_AUTOCHECKBOX @@ -2356,7 +2356,7 @@ FONT 8, "MS Sans Serif", 0, 0, 1 { COMBOBOX IDC_PAL_SELECT, 4, 13, 90, 14, WS_TABSTOP | WS_TABSTOP | CBS_DROPDOWN LTEXT "Pal : 0", IDC_PALNUM, 4, 31, 25, 8, SS_LEFT - SCROLLBAR IDC_SCROLLER, 30, 28, 20, 14, NOT WS_VISIBLE + SCROLLBAR IDC_SCROLLER, 30, 28, 20, 14, NOT WS_VISIBLE | NOT WS_VISIBLE COMBOBOX IDC_MEM_SELECT, 4, 50, 90, 14, WS_TABSTOP | WS_TABSTOP | CBS_DROPDOWN AUTORADIOBUTTON "Bitmap", IDC_BITMAP, 4, 68, 35, 10, WS_GROUP | WS_TABSTOP | BS_AUTORADIOBUTTON AUTORADIOBUTTON "256 Farver", IDC_256COUL, 4, 80, 55, 10, WS_TABSTOP | BS_AUTORADIOBUTTON @@ -2381,7 +2381,7 @@ FONT 8, "MS Sans Serif", 0, 0, 1 { COMBOBOX IDC_PAL_SELECT, 4, 13, 90, 14, WS_TABSTOP | WS_TABSTOP | CBS_DROPDOWN LTEXT "Pal : 0", IDC_PALNUM, 4, 31, 25, 8, SS_LEFT - SCROLLBAR IDC_SCROLLER, 30, 28, 20, 14, NOT WS_VISIBLE + SCROLLBAR IDC_SCROLLER, 30, 28, 20, 14, NOT WS_VISIBLE | NOT WS_VISIBLE COMBOBOX IDC_MEM_SELECT, 4, 50, 90, 14, WS_TABSTOP | WS_TABSTOP | CBS_DROPDOWN AUTORADIOBUTTON "Bitmap", IDC_BITMAP, 4, 68, 35, 10, WS_GROUP | WS_TABSTOP | BS_AUTORADIOBUTTON AUTORADIOBUTTON "256 colors", IDC_256COUL, 4, 80, 55, 10, WS_TABSTOP | BS_AUTORADIOBUTTON @@ -2406,7 +2406,7 @@ FONT 8, "MS Sans Serif", 0, 0, 1 { COMBOBOX IDC_PAL_SELECT, 4, 13, 90, 14, WS_TABSTOP | WS_TABSTOP | CBS_DROPDOWN LTEXT "Pal : 0", IDC_PALNUM, 4, 31, 25, 8, SS_LEFT - SCROLLBAR IDC_SCROLLER, 30, 28, 20, 14, NOT WS_VISIBLE + SCROLLBAR IDC_SCROLLER, 30, 28, 20, 14, NOT WS_VISIBLE | NOT WS_VISIBLE COMBOBOX IDC_MEM_SELECT, 4, 50, 90, 14, WS_TABSTOP | WS_TABSTOP | CBS_DROPDOWN AUTORADIOBUTTON "Bitmap", IDC_BITMAP, 4, 68, 35, 10, WS_GROUP | WS_TABSTOP | BS_AUTORADIOBUTTON AUTORADIOBUTTON "256 couleurs", IDC_256COUL, 4, 80, 55, 10, WS_TABSTOP | BS_AUTORADIOBUTTON