Mesen-X/Core/Console.h
2014-06-29 16:51:58 -04:00

59 lines
1.1 KiB
C++

#pragma once
#include "stdafx.h"
#include "CPU.h"
#include "PPU.h"
#include "APU.h"
#include "BaseMapper.h"
#include "MemoryManager.h"
#include "ControlManager.h"
enum EmulationFlags
{
LimitFPS = 0x01,
};
class Console
{
private:
static uint32_t Flags;
static uint32_t CurrentFPS;
unique_ptr<CPU> _cpu;
unique_ptr<PPU> _ppu;
unique_ptr<APU> _apu;
shared_ptr<BaseMapper> _mapper;
unique_ptr<ControlManager> _controlManager;
unique_ptr<MemoryManager> _memoryManager;
wstring _romFilename;
bool _stop = false;
bool _reset = false;
wstring _loadStateFilename;
wstring _saveStateFilename;
void SaveState();
void LoadState();
void ResetComponents(bool softReset);
public:
Console(wstring filename);
~Console();
void Run();
void Stop();
void Reset();
bool RunTest(uint8_t* expectedResult);
void SaveTestResult();
void SaveState(wstring filename);
bool LoadState(wstring filename);
static bool CheckFlag(int flag);
static void SetFlags(int flags);
static void ClearFlags(int flags);
static uint32_t GetFPS();
};