win32: make printscreen save as suspend emulation

This commit is contained in:
zeromus 2011-08-14 18:54:07 +00:00
parent 8917c70613
commit b1bac119bb
3 changed files with 19 additions and 12 deletions

View File

@ -100,6 +100,8 @@ void HK_SearchCheats(int, bool justPressed)
}
void HK_QuickScreenShot(int param, bool justPressed)
{
bool unpause = NDS_Pause(false);
char buffer[MAX_PATH];
ZeroMemory(buffer, sizeof(buffer));
path.getpath(path.SCREENSHOTS, buffer);
@ -127,9 +129,13 @@ void HK_QuickScreenShot(int param, bool justPressed)
}
break;
}
if(unpause) NDS_UnPause(false);
}
void HK_PrintScreen(int param, bool justPressed)
{
if(!justPressed) return;
char outFilename[MAX_PATH];
OPENFILENAME ofn;

View File

@ -1978,10 +1978,11 @@ DWORD WINAPI run()
return 1;
}
void NDS_Pause(bool showMsg)
{
if (!paused)
//returns true if it just now paused
bool NDS_Pause(bool showMsg)
{
if(paused) return false;
emu_halt();
paused = TRUE;
SPU_Pause(1);
@ -1990,7 +1991,7 @@ void NDS_Pause(bool showMsg)
SetWindowText(MainWindow->getHWnd(), "Paused");
MainWindowToolbar->ChangeButtonBitmap(IDM_PAUSE, IDB_PLAY);
}
return true;
}
void NDS_UnPause(bool showMsg)

View File

@ -8,7 +8,7 @@ extern HMENU mainMenu; //Holds handle to the main DeSmuME menu
extern CToolBar* MainWindowToolbar;
extern volatile bool execute, paused;
void NDS_Pause(bool showMsg = true);
bool NDS_Pause(bool showMsg = true);
void NDS_UnPause(bool showMsg = true);
void LoadSaveStateInfo();
void Display();