diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-03-19 19:07:39 +0100 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-03-19 19:07:39 +0100 |
commit | 59d107bfb0ae6b5f8d683890010885ff35050ff6 (patch) | |
tree | d683f9b2021d87ba571d7f017bcecbeb5fd38775 /src/wx | |
parent | 5a061bc63830e85858264ff684a8008fa17e18b4 (diff) |
make ROM path not be hardcoded.
Diffstat (limited to 'src/wx')
-rw-r--r-- | src/wx/main.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wx/main.cpp b/src/wx/main.cpp index b31af1d..987491b 100644 --- a/src/wx/main.cpp +++ b/src/wx/main.cpp @@ -86,11 +86,18 @@ MainFrame::MainFrame() sdlrend = SDL_CreateRenderer(sdlwin, -1, SDL_RENDERER_ACCELERATED); // SDL_RENDERER_PRESENTVSYNC sdltex = SDL_CreateTexture(sdlrend, SDL_PIXELFORMAT_RGBA32, SDL_TEXTUREACCESS_STREAMING, 256, 384); + + NDS::Init(); } void MainFrame::OnOpenROM(wxCommandEvent& event) { - NDS::Init(); + wxFileDialog opener(this, _("Open ROM"), "", "", "DS ROM (*.nds)|*.nds;*.srl|Any file|*.*", wxFD_OPEN|wxFD_FILE_MUST_EXIST); + if (opener.ShowModal() == wxID_CANCEL) + return; + + wxString filename = opener.GetPath(); + NDS::LoadROM(filename.mb_str(), true); emuthread->EmuStatus = 1; emumutex->Lock(); |