mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-13 02:21:53 +00:00
Merge pull request #4648 from shenweip/patch-10
Add Switch UMD to Win32 menu.
This commit is contained in:
commit
40afbde9f6
@ -67,6 +67,8 @@
|
||||
#include "Core/HLE/sceUtility.h"
|
||||
#include "GPU/Common/PostShader.h"
|
||||
|
||||
#include "Core/HLE/sceUmd.h"
|
||||
|
||||
#ifdef THEMES
|
||||
#include "XPTheme.h"
|
||||
#endif
|
||||
@ -372,6 +374,7 @@ namespace MainWindow
|
||||
|
||||
void SetIngameMenuItemStates(const GlobalUIState state) {
|
||||
UINT menuEnable = state == UISTATE_INGAME ? MF_ENABLED : MF_GRAYED;
|
||||
UINT umdSwitchEnable = state == UISTATE_INGAME && getUMDReplacePermit()? MF_ENABLED : MF_GRAYED;
|
||||
|
||||
EnableMenuItem(menu, ID_FILE_SAVESTATEFILE, menuEnable);
|
||||
EnableMenuItem(menu, ID_FILE_LOADSTATEFILE, menuEnable);
|
||||
@ -380,6 +383,7 @@ namespace MainWindow
|
||||
EnableMenuItem(menu, ID_TOGGLE_PAUSE, menuEnable);
|
||||
EnableMenuItem(menu, ID_EMULATION_STOP, menuEnable);
|
||||
EnableMenuItem(menu, ID_EMULATION_RESET, menuEnable);
|
||||
EnableMenuItem(menu, ID_EMULATION_SWITCH_UMD, umdSwitchEnable);
|
||||
}
|
||||
|
||||
// These are used as an offset
|
||||
@ -547,7 +551,8 @@ namespace MainWindow
|
||||
// Emulation menu
|
||||
TranslateMenuItem(ID_TOGGLE_PAUSE, L"\tF8", "Pause");
|
||||
TranslateMenuItem(ID_EMULATION_STOP, L"\tCtrl+W");
|
||||
TranslateMenuItem(ID_EMULATION_RESET, L"\tCtrl+B");
|
||||
TranslateMenuItem(ID_EMULATION_RESET, L"\tCtrl+B");
|
||||
TranslateMenuItem(ID_EMULATION_SWITCH_UMD, L"\tCtrl+U", "Switch UMD");
|
||||
|
||||
// Debug menu
|
||||
TranslateMenuItem(ID_DEBUG_LOADMAPFILE);
|
||||
@ -849,6 +854,21 @@ namespace MainWindow
|
||||
}
|
||||
}
|
||||
|
||||
void UmdSwitchAction() {
|
||||
std::string fn;
|
||||
std::string filter = "PSP ROMs (*.iso *.cso *.pbp *.elf)|*.pbp;*.elf;*.iso;*.cso;*.prx|All files (*.*)|*.*||";
|
||||
|
||||
for (int i=0; i<(int)filter.length(); i++) {
|
||||
if (filter[i] == '|')
|
||||
filter[i] = '\0';
|
||||
}
|
||||
|
||||
if (W32Util::BrowseForFileName(true, GetHWND(), L"Switch Umd", 0, ConvertUTF8ToWString(filter).c_str(), L"*.pbp;*.elf;*.iso;*.cso;",fn)) {
|
||||
fn = ReplaceAll(fn, "\\", "/");
|
||||
__UmdReplace(fn);
|
||||
}
|
||||
}
|
||||
|
||||
LRESULT CALLBACK DisplayProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
|
||||
// Only apply a factor > 1 in windowed mode.
|
||||
int factor = !IsZoomed(GetHWND()) && !g_Config.bFullScreen && g_Config.iWindowWidth < (480 + 80) ? 2 : 1;
|
||||
@ -1150,6 +1170,9 @@ namespace MainWindow
|
||||
NativeMessageReceived("reset", "");
|
||||
Core_EnableStepping(false);
|
||||
break;
|
||||
case ID_EMULATION_SWITCH_UMD:
|
||||
UmdSwitchAction();
|
||||
break;
|
||||
|
||||
case ID_EMULATION_CHEATS:
|
||||
g_Config.bEnableCheats = !g_Config.bEnableCheats;
|
||||
|
@ -67,4 +67,5 @@ namespace MainWindow
|
||||
void ToggleDebugConsoleVisibility();
|
||||
void TranslateMenus();
|
||||
void setTexScalingMultiplier(int level);
|
||||
void UmdSwitchAction();
|
||||
}
|
||||
|
@ -389,6 +389,7 @@ BEGIN
|
||||
MENUITEM "Run", ID_TOGGLE_PAUSE
|
||||
MENUITEM "Stop", ID_EMULATION_STOP
|
||||
MENUITEM "Reset", ID_EMULATION_RESET
|
||||
MENUITEM "Switch UMD", ID_EMULATION_SWITCH_UMD
|
||||
END
|
||||
|
||||
POPUP "Debug"
|
||||
|
@ -297,6 +297,7 @@
|
||||
#define ID_OPTIONS_LANGUAGE 40141
|
||||
#define ID_MEMVIEW_COPYVALUE_16 40142
|
||||
#define ID_MEMVIEW_COPYVALUE_32 40143
|
||||
#define ID_EMULATION_SWITCH_UMD 40144
|
||||
|
||||
// Dummy option to let the buffered rendering hotkey cycle through all the options.
|
||||
#define ID_OPTIONS_BUFFEREDRENDERINGDUMMY 40500
|
||||
|
Loading…
x
Reference in New Issue
Block a user