Mesen-X/Core/Console.h

60 lines
1.1 KiB
C
Raw Normal View History

#pragma once
2014-06-14 11:27:55 -04:00
#include "stdafx.h"
#include "CPU.h"
#include "PPU.h"
#include "APU.h"
2014-06-14 11:27:55 -04:00
#include "BaseMapper.h"
#include "MemoryManager.h"
2014-06-21 15:43:41 -04:00
#include "ControlManager.h"
2014-06-14 11:27:55 -04:00
2014-06-21 19:03:13 -04:00
enum EmulationFlags
{
LimitFPS = 0x01,
};
2014-06-14 11:27:55 -04:00
class Console
{
private:
2014-06-21 19:03:13 -04:00
static uint32_t Flags;
2014-06-23 16:38:01 -04:00
static uint32_t CurrentFPS;
2014-06-21 19:03:13 -04:00
2014-06-14 11:27:55 -04:00
unique_ptr<CPU> _cpu;
2014-06-15 21:45:36 -04:00
unique_ptr<PPU> _ppu;
unique_ptr<APU> _apu;
shared_ptr<BaseMapper> _mapper;
2014-06-21 15:43:41 -04:00
unique_ptr<ControlManager> _controlManager;
unique_ptr<MemoryManager> _memoryManager;
2014-06-14 11:27:55 -04:00
2014-06-22 08:38:42 -04:00
wstring _romFilename;
bool _stop = false;
bool _reset = false;
2014-06-25 21:52:37 -04:00
wstring _loadStateFilename;
wstring _saveStateFilename;
void SaveState();
void LoadState();
void ResetComponents(bool softReset);
2014-06-14 11:27:55 -04:00
public:
Console(wstring filename);
2014-06-14 11:27:55 -04:00
~Console();
void Run();
void Stop();
2014-06-14 11:27:55 -04:00
void Reset();
2014-06-21 19:03:13 -04:00
2014-06-22 08:38:42 -04:00
bool RunTest(uint8_t* expectedResult);
void SaveTestResult();
2014-06-25 21:52:37 -04:00
void SaveState(wstring filename);
bool LoadState(wstring filename);
2014-06-25 21:52:37 -04:00
2014-06-21 19:03:13 -04:00
static bool CheckFlag(int flag);
static void SetFlags(int flags);
static void ClearFlags(int flags);
2014-06-23 16:38:01 -04:00
static uint32_t GetFPS();
2014-06-14 11:27:55 -04:00
};