Duckstation/src/pse/system.h

53 lines
958 B
C
Raw Normal View History

2019-09-09 07:01:26 +00:00
#pragma once
#include "types.h"
2019-09-14 10:28:47 +00:00
class ByteStream;
class StateWrapper;
2019-09-12 14:18:13 +00:00
class HostInterface;
2019-09-12 02:53:04 +00:00
namespace CPU
{
class Core;
}
class Bus;
class DMA;
2019-09-17 06:26:00 +00:00
class InterruptController;
2019-09-12 02:53:04 +00:00
class GPU;
2019-09-09 07:01:26 +00:00
class System
{
public:
2019-09-12 14:18:13 +00:00
System(HostInterface* host_interface);
2019-09-09 07:01:26 +00:00
~System();
2019-09-12 14:18:13 +00:00
HostInterface* GetHostInterface() const { return m_host_interface; }
u32 GetFrameNumber() const { return m_frame_number; }
void IncrementFrameNumber() { m_frame_number++; }
2019-09-09 07:01:26 +00:00
bool Initialize();
void Reset();
2019-09-14 10:28:47 +00:00
bool LoadState(ByteStream* state);
bool SaveState(ByteStream* state);
2019-09-09 07:01:26 +00:00
void RunFrame();
bool LoadEXE(const char* filename);
2019-09-17 04:25:25 +00:00
void SetSliceTicks(TickCount downcount);
2019-09-09 07:01:26 +00:00
private:
2019-09-14 10:28:47 +00:00
bool DoState(StateWrapper& sw);
2019-09-12 14:18:13 +00:00
HostInterface* m_host_interface;
2019-09-12 02:53:04 +00:00
std::unique_ptr<CPU::Core> m_cpu;
std::unique_ptr<Bus> m_bus;
std::unique_ptr<DMA> m_dma;
2019-09-17 06:26:00 +00:00
std::unique_ptr<InterruptController> m_interrupt_controller;
2019-09-12 02:53:04 +00:00
std::unique_ptr<GPU> m_gpu;
u32 m_frame_number = 1;
2019-09-09 07:01:26 +00:00
};