diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-03-29 18:59:20 +0200 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-03-29 18:59:20 +0200 |
commit | 4e7dc60d37ddb3f0fb6df1556f7afe4d1a5df679 (patch) | |
tree | 1458128609a5d6deaba935ee6c9f59493ad18bea /src/wx/main.h | |
parent | c0734352ab824d3b2c28336ae12ce21f2b40a606 (diff) |
* clean up code
* working-ish run/pause/reset
* proper closing/cleanup
* ability to run BIOS alone
Diffstat (limited to 'src/wx/main.h')
-rw-r--r-- | src/wx/main.h | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/src/wx/main.h b/src/wx/main.h index 32fe2e0..ef27194 100644 --- a/src/wx/main.h +++ b/src/wx/main.h @@ -51,24 +51,14 @@ class MainFrame : public wxFrame public: MainFrame(); - SDL_Window* sdlwin; - SDL_Renderer* sdlrend; - SDL_Texture* sdltex; - SDL_Joystick* joy; SDL_JoystickID joyid; - u8 axismask; - - wxMutex* texmutex; - void* texpixels; - int texstride; - int emustatus; EmuThread* emuthread; - wxMutex* emustatuschangemutex; - wxCondition* emustatuschange; - wxMutex* emustopmutex; - wxCondition* emustop; + + wxString rompath; + + void CloseFromOutside(); private: wxDECLARE_EVENT_TABLE(); @@ -77,12 +67,13 @@ private: void OnCloseFromMenu(wxCommandEvent& event); void OnOpenROM(wxCommandEvent& event); + void OnRun(wxCommandEvent& event); + void OnPause(wxCommandEvent& event); + void OnReset(wxCommandEvent& event); + void OnInputConfig(wxCommandEvent& event); void ProcessSDLEvents(); - - void OnPaint(wxPaintEvent& event); - void OnIdle(wxIdleEvent& event); }; class EmuThread : public wxThread @@ -91,10 +82,13 @@ public: EmuThread(MainFrame* parent); ~EmuThread(); - void EmuRun() { emustatus = 1; } - void EmuPause() { emustatus = 2; } + void EmuRun() { emustatus = 1; emupaused = false; SDL_RaiseWindow(sdlwin); } + void EmuPause() { emustatus = 2; while (!emupaused); } void EmuExit() { emustatus = 0; } + bool EmuIsRunning() { return (emustatus == 1) || (emustatus == 2); } + bool EmuIsPaused() { return (emustatus == 2) && emupaused; } + protected: virtual ExitCode Entry(); void ProcessEvents(); @@ -108,10 +102,10 @@ protected: void* texpixels; int texstride; - int joyid; u32 axismask; int emustatus; + volatile bool emupaused; }; #endif // WX_MAIN_H |