2014-06-12 21:48:04 -04:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include "Renderer.h"
|
2014-06-22 22:15:35 -04:00
|
|
|
#include "SoundManager.h"
|
2014-06-20 21:48:55 -04:00
|
|
|
#include "../Core/Console.h"
|
2014-06-12 21:48:04 -04:00
|
|
|
|
|
|
|
namespace NES {
|
|
|
|
class MainWindow
|
|
|
|
{
|
|
|
|
private:
|
2014-06-20 21:48:55 -04:00
|
|
|
static MainWindow *Instance;
|
2014-06-12 21:48:04 -04:00
|
|
|
HINSTANCE _hInstance;
|
|
|
|
HWND _hWnd;
|
|
|
|
int _nCmdShow;
|
2014-06-23 19:02:09 -04:00
|
|
|
unique_ptr<Renderer> _renderer;
|
|
|
|
unique_ptr<SoundManager> _soundManager;
|
2014-06-20 21:48:55 -04:00
|
|
|
unique_ptr<Console> _console;
|
2014-06-21 19:03:13 -04:00
|
|
|
unique_ptr<thread> _emuThread;
|
2014-06-23 13:52:53 -04:00
|
|
|
wstring _currentROM;
|
2014-06-12 21:48:04 -04:00
|
|
|
|
2014-06-23 13:52:53 -04:00
|
|
|
private:
|
2014-06-12 21:48:04 -04:00
|
|
|
bool Initialize();
|
|
|
|
HRESULT InitWindow();
|
|
|
|
static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
|
|
|
static INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
|
|
|
|
|
2014-06-22 08:38:42 -04:00
|
|
|
static MainWindow* GetInstance() { return MainWindow::Instance; }
|
|
|
|
|
|
|
|
void SaveTestResult();
|
|
|
|
void RunTests();
|
2014-06-26 20:55:22 -04:00
|
|
|
|
|
|
|
vector<wstring> GetFolders(wstring rootFolder);
|
|
|
|
vector<wstring> GetFilesInFolder(wstring folder, wstring mask, bool recursive);
|
2014-06-12 21:48:04 -04:00
|
|
|
|
2014-06-21 19:03:13 -04:00
|
|
|
void LimitFPS_Click();
|
2014-06-23 20:00:51 -04:00
|
|
|
void ShowFPS_Click();
|
2014-06-21 19:03:13 -04:00
|
|
|
|
2014-06-23 13:52:53 -04:00
|
|
|
void SetMenuEnabled(int resourceID, bool enabled);
|
|
|
|
|
|
|
|
bool IsMenuChecked(int resourceID);
|
|
|
|
bool SetMenuCheck(int resourceID, bool checked);
|
2014-06-21 19:03:13 -04:00
|
|
|
bool ToggleMenuCheck(int resourceID);
|
|
|
|
|
2014-06-23 13:52:53 -04:00
|
|
|
wstring SelectROM();
|
|
|
|
void Start(wstring romFilename);
|
|
|
|
void Reset();
|
|
|
|
void Stop(bool powerOff);
|
|
|
|
|
|
|
|
void InitializeOptions();
|
|
|
|
|
2014-06-12 21:48:04 -04:00
|
|
|
public:
|
2014-06-20 21:48:55 -04:00
|
|
|
MainWindow(HINSTANCE hInstance, int nCmdShow) : _hInstance(hInstance), _nCmdShow(nCmdShow)
|
|
|
|
{
|
|
|
|
MainWindow::Instance = this;
|
|
|
|
}
|
2014-06-23 13:52:53 -04:00
|
|
|
|
2014-06-12 21:48:04 -04:00
|
|
|
int Run();
|
|
|
|
};
|
|
|
|
}
|