Skip to content

Commit

Permalink
Win32: Add menu choice to open from memstick/PSP/GAME
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Mar 28, 2013
1 parent e7027b6 commit 6f7cc57
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
15 changes: 12 additions & 3 deletions Windows/WndMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ namespace MainWindow
return TRUE;
}

void BrowseAndBoot(void)
void BrowseAndBoot(std::string defaultPath)
{
std::string fn;
std::string fn = defaultPath;
std::string filter = "";

filter += "PSP";
Expand Down Expand Up @@ -282,7 +282,16 @@ namespace MainWindow
switch (wmId)
{
case ID_FILE_LOAD:
BrowseAndBoot();
BrowseAndBoot("");
break;

case ID_FILE_LOAD_MEMSTICK:
{
std::string memStickDir, flash0dir;
GetSysDirectories(memStickDir, flash0dir);
memStickDir += "PSP\\GAME";
BrowseAndBoot(memStickDir);
}
break;

case ID_FILE_REFRESHGAMELIST:
Expand Down
3 changes: 2 additions & 1 deletion Windows/WndMainWindow.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <windows.h>
#include <string>
#include <Core/Core.h>

namespace MainWindow
Expand All @@ -15,7 +16,7 @@ namespace MainWindow
HINSTANCE GetHInstance();
HWND GetDisplayHWND();
void SetPlaying(const char*text);
void BrowseAndBoot();
void BrowseAndBoot(std::string defaultPath);
void SetNextState(CoreState state);
void SaveStateActionFinished(bool result, void *userdata);
void _ViewFullScreen(HWND hWnd);
Expand Down
2 changes: 1 addition & 1 deletion Windows/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
EmuThread_Start(fileToStart);
}
if (g_Config.bBrowse)
MainWindow::BrowseAndBoot();
MainWindow::BrowseAndBoot("");

if (!hideLog)
SetForegroundWindow(hwndMain);
Expand Down
1 change: 1 addition & 0 deletions Windows/ppsspp.rc
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ BEGIN
POPUP "&File"
BEGIN
MENUITEM "&Open...", ID_FILE_LOAD
MENUITEM "&Open from MS:/PSP/GAME...", ID_FILE_LOAD_MEMSTICK
MENUITEM "&Close", ID_EMULATION_STOP
MENUITEM SEPARATOR
MENUITEM "Open &Memory Stick", ID_FILE_MEMSTICK
Expand Down
3 changes: 2 additions & 1 deletion Windows/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,15 @@
#define IDC_MEMCHECK 40140
#define ID_OPTIONS_USEMEDIAENGINE 40141
#define ID_FILE_MEMSTICK 40142
#define ID_FILE_LOAD_MEMSTICK 40143
#define IDC_STATIC -1

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 233
#define _APS_NEXT_COMMAND_VALUE 40143
#define _APS_NEXT_COMMAND_VALUE 40144
#define _APS_NEXT_CONTROL_VALUE 1163
#define _APS_NEXT_SYMED_VALUE 101
#endif
Expand Down

0 comments on commit 6f7cc57

Please sign in to comment.