mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-04-27 08:35:42 -04:00
71 lines
1.4 KiB
C++
71 lines
1.4 KiB
C++
#pragma once
|
|
#include "types.h"
|
|
#include <memory>
|
|
|
|
class ByteStream;
|
|
class StateWrapper;
|
|
|
|
class HostInterface;
|
|
|
|
namespace CPU
|
|
{
|
|
class Core;
|
|
}
|
|
|
|
class Bus;
|
|
class DMA;
|
|
class InterruptController;
|
|
class GPU;
|
|
class CDROM;
|
|
class Pad;
|
|
class PadDevice;
|
|
class Timers;
|
|
class SPU;
|
|
|
|
class System
|
|
{
|
|
public:
|
|
System(HostInterface* host_interface);
|
|
~System();
|
|
|
|
HostInterface* GetHostInterface() const { return m_host_interface; }
|
|
|
|
u32 GetFrameNumber() const { return m_frame_number; }
|
|
void IncrementFrameNumber() { m_frame_number++; }
|
|
|
|
bool Initialize();
|
|
void Reset();
|
|
|
|
bool LoadState(ByteStream* state);
|
|
bool SaveState(ByteStream* state);
|
|
|
|
void RunFrame();
|
|
|
|
bool LoadEXE(const char* filename);
|
|
bool SetExpansionROM(const char* filename);
|
|
|
|
void SetDowncount(TickCount downcount);
|
|
void Synchronize();
|
|
|
|
void SetPadDevice(u32 slot, std::shared_ptr<PadDevice> dev);
|
|
|
|
bool HasMedia() const;
|
|
bool InsertMedia(const char* path);
|
|
void RemoveMedia();
|
|
|
|
private:
|
|
bool DoState(StateWrapper& sw);
|
|
|
|
HostInterface* m_host_interface;
|
|
std::unique_ptr<CPU::Core> m_cpu;
|
|
std::unique_ptr<Bus> m_bus;
|
|
std::unique_ptr<DMA> m_dma;
|
|
std::unique_ptr<InterruptController> m_interrupt_controller;
|
|
std::unique_ptr<GPU> m_gpu;
|
|
std::unique_ptr<CDROM> m_cdrom;
|
|
std::unique_ptr<Pad> m_pad;
|
|
std::unique_ptr<Timers> m_timers;
|
|
std::unique_ptr<SPU> m_spu;
|
|
u32 m_frame_number = 1;
|
|
};
|