HW/DVD: Rename DVDThreadManager to DVDThread.
This commit is contained in:
parent
25e883280a
commit
d31733ce64
|
@ -36,13 +36,13 @@
|
||||||
|
|
||||||
namespace DVD
|
namespace DVD
|
||||||
{
|
{
|
||||||
DVDThreadManager::DVDThreadManager(Core::System& system) : m_system(system)
|
DVDThread::DVDThread(Core::System& system) : m_system(system)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
DVDThreadManager::~DVDThreadManager() = default;
|
DVDThread::~DVDThread() = default;
|
||||||
|
|
||||||
void DVDThreadManager::Start()
|
void DVDThread::Start()
|
||||||
{
|
{
|
||||||
m_finish_read = m_system.GetCoreTiming().RegisterEvent("FinishReadDVDThread", GlobalFinishRead);
|
m_finish_read = m_system.GetCoreTiming().RegisterEvent("FinishReadDVDThread", GlobalFinishRead);
|
||||||
|
|
||||||
|
@ -58,20 +58,20 @@ void DVDThreadManager::Start()
|
||||||
StartDVDThread();
|
StartDVDThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DVDThreadManager::StartDVDThread()
|
void DVDThread::StartDVDThread()
|
||||||
{
|
{
|
||||||
ASSERT(!m_dvd_thread.joinable());
|
ASSERT(!m_dvd_thread.joinable());
|
||||||
m_dvd_thread_exiting.Clear();
|
m_dvd_thread_exiting.Clear();
|
||||||
m_dvd_thread = std::thread(&DVDThreadManager::DVDThreadMain, this);
|
m_dvd_thread = std::thread(&DVDThread::DVDThreadMain, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DVDThreadManager::Stop()
|
void DVDThread::Stop()
|
||||||
{
|
{
|
||||||
StopDVDThread();
|
StopDVDThread();
|
||||||
m_disc.reset();
|
m_disc.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DVDThreadManager::StopDVDThread()
|
void DVDThread::StopDVDThread()
|
||||||
{
|
{
|
||||||
ASSERT(m_dvd_thread.joinable());
|
ASSERT(m_dvd_thread.joinable());
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ void DVDThreadManager::StopDVDThread()
|
||||||
m_dvd_thread.join();
|
m_dvd_thread.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DVDThreadManager::DoState(PointerWrap& p)
|
void DVDThread::DoState(PointerWrap& p)
|
||||||
{
|
{
|
||||||
// By waiting for the DVD thread to be done working, we ensure
|
// By waiting for the DVD thread to be done working, we ensure
|
||||||
// that request_queue will be empty and that the DVD thread
|
// that request_queue will be empty and that the DVD thread
|
||||||
|
@ -128,48 +128,48 @@ void DVDThreadManager::DoState(PointerWrap& p)
|
||||||
// was made. Handling that properly may be more effort than it's worth.
|
// was made. Handling that properly may be more effort than it's worth.
|
||||||
}
|
}
|
||||||
|
|
||||||
void DVDThreadManager::SetDisc(std::unique_ptr<DiscIO::Volume> disc)
|
void DVDThread::SetDisc(std::unique_ptr<DiscIO::Volume> disc)
|
||||||
{
|
{
|
||||||
WaitUntilIdle();
|
WaitUntilIdle();
|
||||||
m_disc = std::move(disc);
|
m_disc = std::move(disc);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DVDThreadManager::HasDisc() const
|
bool DVDThread::HasDisc() const
|
||||||
{
|
{
|
||||||
return m_disc != nullptr;
|
return m_disc != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DVDThreadManager::HasWiiHashes() const
|
bool DVDThread::HasWiiHashes() const
|
||||||
{
|
{
|
||||||
// HasWiiHashes is thread-safe, so calling WaitUntilIdle isn't necessary.
|
// HasWiiHashes is thread-safe, so calling WaitUntilIdle isn't necessary.
|
||||||
return m_disc->HasWiiHashes();
|
return m_disc->HasWiiHashes();
|
||||||
}
|
}
|
||||||
|
|
||||||
DiscIO::Platform DVDThreadManager::GetDiscType() const
|
DiscIO::Platform DVDThread::GetDiscType() const
|
||||||
{
|
{
|
||||||
// GetVolumeType is thread-safe, so calling WaitUntilIdle isn't necessary.
|
// GetVolumeType is thread-safe, so calling WaitUntilIdle isn't necessary.
|
||||||
return m_disc->GetVolumeType();
|
return m_disc->GetVolumeType();
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 DVDThreadManager::PartitionOffsetToRawOffset(u64 offset, const DiscIO::Partition& partition)
|
u64 DVDThread::PartitionOffsetToRawOffset(u64 offset, const DiscIO::Partition& partition)
|
||||||
{
|
{
|
||||||
// PartitionOffsetToRawOffset is thread-safe, so calling WaitUntilIdle isn't necessary.
|
// PartitionOffsetToRawOffset is thread-safe, so calling WaitUntilIdle isn't necessary.
|
||||||
return m_disc->PartitionOffsetToRawOffset(offset, partition);
|
return m_disc->PartitionOffsetToRawOffset(offset, partition);
|
||||||
}
|
}
|
||||||
|
|
||||||
IOS::ES::TMDReader DVDThreadManager::GetTMD(const DiscIO::Partition& partition)
|
IOS::ES::TMDReader DVDThread::GetTMD(const DiscIO::Partition& partition)
|
||||||
{
|
{
|
||||||
WaitUntilIdle();
|
WaitUntilIdle();
|
||||||
return m_disc->GetTMD(partition);
|
return m_disc->GetTMD(partition);
|
||||||
}
|
}
|
||||||
|
|
||||||
IOS::ES::TicketReader DVDThreadManager::GetTicket(const DiscIO::Partition& partition)
|
IOS::ES::TicketReader DVDThread::GetTicket(const DiscIO::Partition& partition)
|
||||||
{
|
{
|
||||||
WaitUntilIdle();
|
WaitUntilIdle();
|
||||||
return m_disc->GetTicket(partition);
|
return m_disc->GetTicket(partition);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DVDThreadManager::IsInsertedDiscRunning()
|
bool DVDThread::IsInsertedDiscRunning()
|
||||||
{
|
{
|
||||||
if (!m_disc)
|
if (!m_disc)
|
||||||
return false;
|
return false;
|
||||||
|
@ -179,7 +179,7 @@ bool DVDThreadManager::IsInsertedDiscRunning()
|
||||||
return SConfig::GetInstance().GetGameID() == m_disc->GetGameID();
|
return SConfig::GetInstance().GetGameID() == m_disc->GetGameID();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DVDThreadManager::UpdateRunningGameMetadata(const DiscIO::Partition& partition,
|
bool DVDThread::UpdateRunningGameMetadata(const DiscIO::Partition& partition,
|
||||||
std::optional<u64> title_id)
|
std::optional<u64> title_id)
|
||||||
{
|
{
|
||||||
if (!m_disc)
|
if (!m_disc)
|
||||||
|
@ -198,7 +198,7 @@ bool DVDThreadManager::UpdateRunningGameMetadata(const DiscIO::Partition& partit
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DVDThreadManager::WaitUntilIdle()
|
void DVDThread::WaitUntilIdle()
|
||||||
{
|
{
|
||||||
ASSERT(Core::IsCPUThread());
|
ASSERT(Core::IsCPUThread());
|
||||||
|
|
||||||
|
@ -209,13 +209,13 @@ void DVDThreadManager::WaitUntilIdle()
|
||||||
StartDVDThread();
|
StartDVDThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DVDThreadManager::StartRead(u64 dvd_offset, u32 length, const DiscIO::Partition& partition,
|
void DVDThread::StartRead(u64 dvd_offset, u32 length, const DiscIO::Partition& partition,
|
||||||
DVD::ReplyType reply_type, s64 ticks_until_completion)
|
DVD::ReplyType reply_type, s64 ticks_until_completion)
|
||||||
{
|
{
|
||||||
StartReadInternal(false, 0, dvd_offset, length, partition, reply_type, ticks_until_completion);
|
StartReadInternal(false, 0, dvd_offset, length, partition, reply_type, ticks_until_completion);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DVDThreadManager::StartReadToEmulatedRAM(u32 output_address, u64 dvd_offset, u32 length,
|
void DVDThread::StartReadToEmulatedRAM(u32 output_address, u64 dvd_offset, u32 length,
|
||||||
const DiscIO::Partition& partition,
|
const DiscIO::Partition& partition,
|
||||||
DVD::ReplyType reply_type, s64 ticks_until_completion)
|
DVD::ReplyType reply_type, s64 ticks_until_completion)
|
||||||
{
|
{
|
||||||
|
@ -223,9 +223,9 @@ void DVDThreadManager::StartReadToEmulatedRAM(u32 output_address, u64 dvd_offset
|
||||||
ticks_until_completion);
|
ticks_until_completion);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DVDThreadManager::StartReadInternal(bool copy_to_ram, u32 output_address, u64 dvd_offset,
|
void DVDThread::StartReadInternal(bool copy_to_ram, u32 output_address, u64 dvd_offset, u32 length,
|
||||||
u32 length, const DiscIO::Partition& partition,
|
const DiscIO::Partition& partition, DVD::ReplyType reply_type,
|
||||||
DVD::ReplyType reply_type, s64 ticks_until_completion)
|
s64 ticks_until_completion)
|
||||||
{
|
{
|
||||||
ASSERT(Core::IsCPUThread());
|
ASSERT(Core::IsCPUThread());
|
||||||
|
|
||||||
|
@ -252,12 +252,12 @@ void DVDThreadManager::StartReadInternal(bool copy_to_ram, u32 output_address, u
|
||||||
core_timing.ScheduleEvent(ticks_until_completion, m_finish_read, id);
|
core_timing.ScheduleEvent(ticks_until_completion, m_finish_read, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DVDThreadManager::GlobalFinishRead(Core::System& system, u64 id, s64 cycles_late)
|
void DVDThread::GlobalFinishRead(Core::System& system, u64 id, s64 cycles_late)
|
||||||
{
|
{
|
||||||
system.GetDVDThread().FinishRead(id, cycles_late);
|
system.GetDVDThread().FinishRead(id, cycles_late);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DVDThreadManager::FinishRead(u64 id, s64 cycles_late)
|
void DVDThread::FinishRead(u64 id, s64 cycles_late)
|
||||||
{
|
{
|
||||||
// We can't simply pop result_queue and always get the ReadResult
|
// We can't simply pop result_queue and always get the ReadResult
|
||||||
// we want, because the DVD thread may add ReadResults to the queue
|
// we want, because the DVD thread may add ReadResults to the queue
|
||||||
|
@ -328,7 +328,7 @@ void DVDThreadManager::FinishRead(u64 id, s64 cycles_late)
|
||||||
dvd_interface.FinishExecutingCommand(request.reply_type, interrupt, cycles_late, buffer);
|
dvd_interface.FinishExecutingCommand(request.reply_type, interrupt, cycles_late, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DVDThreadManager::DVDThreadMain()
|
void DVDThread::DVDThreadMain()
|
||||||
{
|
{
|
||||||
Common::SetCurrentThreadName("DVD thread");
|
Common::SetCurrentThreadName("DVD thread");
|
||||||
|
|
||||||
|
|
|
@ -50,15 +50,15 @@ namespace DVD
|
||||||
{
|
{
|
||||||
enum class ReplyType : u32;
|
enum class ReplyType : u32;
|
||||||
|
|
||||||
class DVDThreadManager
|
class DVDThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit DVDThreadManager(Core::System& system);
|
explicit DVDThread(Core::System& system);
|
||||||
DVDThreadManager(const DVDThreadManager&) = delete;
|
DVDThread(const DVDThread&) = delete;
|
||||||
DVDThreadManager(DVDThreadManager&&) = delete;
|
DVDThread(DVDThread&&) = delete;
|
||||||
DVDThreadManager& operator=(const DVDThreadManager&) = delete;
|
DVDThread& operator=(const DVDThread&) = delete;
|
||||||
DVDThreadManager& operator=(DVDThreadManager&&) = delete;
|
DVDThread& operator=(DVDThread&&) = delete;
|
||||||
~DVDThreadManager();
|
~DVDThread();
|
||||||
|
|
||||||
void Start();
|
void Start();
|
||||||
void Stop();
|
void Stop();
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct System::Impl
|
||||||
CPU::CPUManager m_cpu;
|
CPU::CPUManager m_cpu;
|
||||||
DSP::DSPManager m_dsp;
|
DSP::DSPManager m_dsp;
|
||||||
DVD::DVDInterface m_dvd_interface;
|
DVD::DVDInterface m_dvd_interface;
|
||||||
DVD::DVDThreadManager m_dvd_thread;
|
DVD::DVDThread m_dvd_thread;
|
||||||
ExpansionInterface::ExpansionInterfaceState m_expansion_interface_state;
|
ExpansionInterface::ExpansionInterfaceState m_expansion_interface_state;
|
||||||
Fifo::FifoManager m_fifo;
|
Fifo::FifoManager m_fifo;
|
||||||
GeometryShaderManager m_geometry_shader_manager;
|
GeometryShaderManager m_geometry_shader_manager;
|
||||||
|
@ -143,7 +143,7 @@ DVD::DVDInterface& System::GetDVDInterface() const
|
||||||
return m_impl->m_dvd_interface;
|
return m_impl->m_dvd_interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
DVD::DVDThreadManager& System::GetDVDThread() const
|
DVD::DVDThread& System::GetDVDThread() const
|
||||||
{
|
{
|
||||||
return m_impl->m_dvd_thread;
|
return m_impl->m_dvd_thread;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ class DSPManager;
|
||||||
namespace DVD
|
namespace DVD
|
||||||
{
|
{
|
||||||
class DVDInterface;
|
class DVDInterface;
|
||||||
class DVDThreadManager;
|
class DVDThread;
|
||||||
} // namespace DVD
|
} // namespace DVD
|
||||||
namespace ExpansionInterface
|
namespace ExpansionInterface
|
||||||
{
|
{
|
||||||
|
@ -125,7 +125,7 @@ public:
|
||||||
CommandProcessor::CommandProcessorManager& GetCommandProcessor() const;
|
CommandProcessor::CommandProcessorManager& GetCommandProcessor() const;
|
||||||
DSP::DSPManager& GetDSP() const;
|
DSP::DSPManager& GetDSP() const;
|
||||||
DVD::DVDInterface& GetDVDInterface() const;
|
DVD::DVDInterface& GetDVDInterface() const;
|
||||||
DVD::DVDThreadManager& GetDVDThread() const;
|
DVD::DVDThread& GetDVDThread() const;
|
||||||
ExpansionInterface::ExpansionInterfaceState& GetExpansionInterfaceState() const;
|
ExpansionInterface::ExpansionInterfaceState& GetExpansionInterfaceState() const;
|
||||||
Fifo::FifoManager& GetFifo() const;
|
Fifo::FifoManager& GetFifo() const;
|
||||||
GeometryShaderManager& GetGeometryShaderManager() const;
|
GeometryShaderManager& GetGeometryShaderManager() const;
|
||||||
|
|
Loading…
Reference in New Issue