From 9b2821de3a1a3d7fd6ef7b7ae116c58f3402de96 Mon Sep 17 00:00:00 2001 From: riccardom Date: Fri, 3 Jun 2011 17:41:41 +0000 Subject: [PATCH] wx: Pause spu and emulation before loading a rom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit xrmx: kept only the hunk that pause and not the one that reenable the previous state, i think we should stay paused and the user should act to continue playing. Based on a patch from: Jan Bücken (nooris), #3301520 --- desmume/src/wx/wxMain.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/desmume/src/wx/wxMain.cpp b/desmume/src/wx/wxMain.cpp index 83bda723f..8343e512f 100644 --- a/desmume/src/wx/wxMain.cpp +++ b/desmume/src/wx/wxMain.cpp @@ -249,6 +249,9 @@ void DesmumeFrame::applyInput() void DesmumeFrame::LoadRom(wxCommandEvent& event) { + execute = false; + SPU_Pause(1); + wxFileDialog dialog(this,_T("Load Rom"),wxGetHomeDir(),_T(""),_T("*.nds"),wxFD_OPEN, wxDefaultPosition, wxDefaultSize); if(dialog.ShowModal() == wxID_OK) { history->AddFileToHistory(dialog.GetPath()); @@ -652,6 +655,9 @@ void DesmumeFrame::OnOpenRecent(wxCommandEvent &event) { int ret; size_t id = event.GetId()-wxID_FILE1; + execute = false; + SPU_Pause(1); + ret = NDS_LoadROM(history->GetHistoryFile(id).mb_str(), history->GetHistoryFile(id).mb_str()); if (ret > 0) { execute = true;