2020-12-19 22:32:55 -05:00
|
|
|
// Copyright 2020 Dolphin Emulator Project
|
2021-07-05 03:22:19 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2020-12-19 22:32:55 -05:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
2022-08-31 21:44:21 +02:00
|
|
|
class SoundStream;
|
2022-09-14 01:11:04 +02:00
|
|
|
struct Sram;
|
2022-08-31 21:44:21 +02:00
|
|
|
|
2022-09-09 04:13:43 +02:00
|
|
|
namespace AudioInterface
|
|
|
|
|
{
|
|
|
|
|
class AudioInterfaceState;
|
|
|
|
|
};
|
2022-11-23 21:35:21 +01:00
|
|
|
namespace CoreTiming
|
|
|
|
|
{
|
2022-11-26 09:29:46 +01:00
|
|
|
class CoreTimingManager;
|
2022-11-26 10:20:32 +01:00
|
|
|
}
|
2022-10-02 05:13:55 +02:00
|
|
|
namespace DSP
|
|
|
|
|
{
|
|
|
|
|
class DSPState;
|
|
|
|
|
}
|
2022-09-02 23:03:40 +02:00
|
|
|
namespace DVDInterface
|
|
|
|
|
{
|
|
|
|
|
class DVDInterfaceState;
|
|
|
|
|
}
|
2022-09-02 22:20:14 +02:00
|
|
|
namespace DVDThread
|
|
|
|
|
{
|
|
|
|
|
class DVDThreadState;
|
|
|
|
|
}
|
2022-10-06 01:10:46 +02:00
|
|
|
namespace ExpansionInterface
|
|
|
|
|
{
|
|
|
|
|
class ExpansionInterfaceState;
|
|
|
|
|
};
|
2022-10-13 04:22:36 +02:00
|
|
|
namespace MemoryInterface
|
|
|
|
|
{
|
|
|
|
|
class MemoryInterfaceState;
|
|
|
|
|
};
|
2022-10-06 22:08:20 +02:00
|
|
|
namespace SerialInterface
|
|
|
|
|
{
|
|
|
|
|
class SerialInterfaceState;
|
|
|
|
|
};
|
2022-10-04 02:24:01 +02:00
|
|
|
namespace VideoInterface
|
|
|
|
|
{
|
|
|
|
|
class VideoInterfaceState;
|
|
|
|
|
};
|
2022-09-02 22:20:14 +02:00
|
|
|
|
2020-12-19 22:32:55 -05:00
|
|
|
namespace Core
|
|
|
|
|
{
|
|
|
|
|
// Central class that encapsulates the running system.
|
|
|
|
|
class System
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
~System();
|
|
|
|
|
|
|
|
|
|
System(const System&) = delete;
|
|
|
|
|
System& operator=(const System&) = delete;
|
|
|
|
|
|
|
|
|
|
System(System&&) = delete;
|
|
|
|
|
System& operator=(System&&) = delete;
|
|
|
|
|
|
|
|
|
|
// Intermediate instance accessor until global state is eliminated.
|
|
|
|
|
static System& GetInstance()
|
|
|
|
|
{
|
|
|
|
|
static System instance;
|
|
|
|
|
return instance;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-07 03:50:18 +01:00
|
|
|
void Initialize();
|
|
|
|
|
|
|
|
|
|
bool IsDualCoreMode() const { return m_separate_cpu_and_gpu_threads; }
|
2022-01-07 04:37:07 +01:00
|
|
|
bool IsMMUMode() const { return m_mmu_enabled; }
|
2022-04-17 00:15:12 -07:00
|
|
|
bool IsPauseOnPanicMode() const { return m_pause_on_panic_enabled; }
|
2022-01-07 03:50:18 +01:00
|
|
|
|
2022-08-31 21:44:21 +02:00
|
|
|
SoundStream* GetSoundStream() const;
|
|
|
|
|
void SetSoundStream(std::unique_ptr<SoundStream> sound_stream);
|
|
|
|
|
bool IsSoundStreamRunning() const;
|
|
|
|
|
void SetSoundStreamRunning(bool running);
|
|
|
|
|
bool IsAudioDumpStarted() const;
|
|
|
|
|
void SetAudioDumpStarted(bool started);
|
|
|
|
|
|
2022-09-09 04:13:43 +02:00
|
|
|
AudioInterface::AudioInterfaceState& GetAudioInterfaceState() const;
|
2022-11-26 09:29:46 +01:00
|
|
|
CoreTiming::CoreTimingManager& GetCoreTiming() const;
|
2022-10-02 05:13:55 +02:00
|
|
|
DSP::DSPState& GetDSPState() const;
|
2022-09-02 23:03:40 +02:00
|
|
|
DVDInterface::DVDInterfaceState& GetDVDInterfaceState() const;
|
2022-09-02 22:20:14 +02:00
|
|
|
DVDThread::DVDThreadState& GetDVDThreadState() const;
|
2022-10-06 01:10:46 +02:00
|
|
|
ExpansionInterface::ExpansionInterfaceState& GetExpansionInterfaceState() const;
|
2022-10-13 04:22:36 +02:00
|
|
|
MemoryInterface::MemoryInterfaceState& GetMemoryInterfaceState() const;
|
2022-10-06 22:08:20 +02:00
|
|
|
SerialInterface::SerialInterfaceState& GetSerialInterfaceState() const;
|
2022-09-14 01:11:04 +02:00
|
|
|
Sram& GetSRAM() const;
|
2022-10-04 02:24:01 +02:00
|
|
|
VideoInterface::VideoInterfaceState& GetVideoInterfaceState() const;
|
2022-09-02 22:20:14 +02:00
|
|
|
|
2020-12-19 22:32:55 -05:00
|
|
|
private:
|
|
|
|
|
System();
|
|
|
|
|
|
|
|
|
|
struct Impl;
|
|
|
|
|
std::unique_ptr<Impl> m_impl;
|
2022-01-07 03:50:18 +01:00
|
|
|
|
|
|
|
|
bool m_separate_cpu_and_gpu_threads = false;
|
2022-01-07 04:37:07 +01:00
|
|
|
bool m_mmu_enabled = false;
|
2022-04-17 00:15:12 -07:00
|
|
|
bool m_pause_on_panic_enabled = false;
|
2020-12-19 22:32:55 -05:00
|
|
|
};
|
|
|
|
|
} // namespace Core
|