#pragma once #include "stdafx.h" #include "../Utilities/VirtualFile.h" #include "../Utilities/SimpleLock.h" class Cpu; class Ppu; class Spc; class BaseCartridge; class MemoryManager; class InternalRegisters; class ControlManager; class DmaController; class Debugger; class DebugHud; class SoundMixer; class VideoRenderer; class VideoDecoder; class NotificationManager; enum class MemoryOperationType; class Console : public std::enable_shared_from_this { private: shared_ptr _cpu; shared_ptr _ppu; shared_ptr _spc; shared_ptr _memoryManager; shared_ptr _cart; shared_ptr _internalRegisters; shared_ptr _controlManager; shared_ptr _dmaController; shared_ptr _debugger; shared_ptr _notificationManager; shared_ptr _soundMixer; shared_ptr _videoRenderer; shared_ptr _videoDecoder; shared_ptr _debugHud; SimpleLock _runLock; SimpleLock _debuggerLock; atomic _stopFlag; public: void Initialize(); void Release(); void Run(); void Stop(); void LoadRom(VirtualFile romFile, VirtualFile patchFile); shared_ptr GetSoundMixer(); shared_ptr GetVideoRenderer(); shared_ptr GetVideoDecoder(); shared_ptr GetNotificationManager(); shared_ptr GetDebugHud(); shared_ptr GetCpu(); shared_ptr GetPpu(); shared_ptr GetSpc(); shared_ptr GetCartridge(); shared_ptr GetMemoryManager(); shared_ptr GetInternalRegisters(); shared_ptr GetControlManager(); shared_ptr GetDmaController(); shared_ptr GetDebugger(bool autoStart = true); bool IsRunning(); void ProcessCpuRead(uint32_t addr, uint8_t value, MemoryOperationType type); void ProcessCpuWrite(uint32_t addr, uint8_t value, MemoryOperationType type); };