HW/DVD: Rename DVDThreadManager to DVDThread.
This commit is contained in:
parent
25e883280a
commit
d31733ce64
|
@ -36,13 +36,13 @@
|
|||
|
||||
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);
|
||||
|
||||
|
@ -58,20 +58,20 @@ void DVDThreadManager::Start()
|
|||
StartDVDThread();
|
||||
}
|
||||
|
||||
void DVDThreadManager::StartDVDThread()
|
||||
void DVDThread::StartDVDThread()
|
||||
{
|
||||
ASSERT(!m_dvd_thread.joinable());
|
||||
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();
|
||||
m_disc.reset();
|
||||
}
|
||||
|
||||
void DVDThreadManager::StopDVDThread()
|
||||
void DVDThread::StopDVDThread()
|
||||
{
|
||||
ASSERT(m_dvd_thread.joinable());
|
||||
|
||||
|
@ -84,7 +84,7 @@ void DVDThreadManager::StopDVDThread()
|
|||
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
|
||||
// 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.
|
||||
}
|
||||
|
||||
void DVDThreadManager::SetDisc(std::unique_ptr<DiscIO::Volume> disc)
|
||||
void DVDThread::SetDisc(std::unique_ptr<DiscIO::Volume> disc)
|
||||
{
|
||||
WaitUntilIdle();
|
||||
m_disc = std::move(disc);
|
||||
}
|
||||
|
||||
bool DVDThreadManager::HasDisc() const
|
||||
bool DVDThread::HasDisc() const
|
||||
{
|
||||
return m_disc != nullptr;
|
||||
}
|
||||
|
||||
bool DVDThreadManager::HasWiiHashes() const
|
||||
bool DVDThread::HasWiiHashes() const
|
||||
{
|
||||
// HasWiiHashes is thread-safe, so calling WaitUntilIdle isn't necessary.
|
||||
return m_disc->HasWiiHashes();
|
||||
}
|
||||
|
||||
DiscIO::Platform DVDThreadManager::GetDiscType() const
|
||||
DiscIO::Platform DVDThread::GetDiscType() const
|
||||
{
|
||||
// GetVolumeType is thread-safe, so calling WaitUntilIdle isn't necessary.
|
||||
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.
|
||||
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();
|
||||
return m_disc->GetTMD(partition);
|
||||
}
|
||||
|
||||
IOS::ES::TicketReader DVDThreadManager::GetTicket(const DiscIO::Partition& partition)
|
||||
IOS::ES::TicketReader DVDThread::GetTicket(const DiscIO::Partition& partition)
|
||||
{
|
||||
WaitUntilIdle();
|
||||
return m_disc->GetTicket(partition);
|
||||
}
|
||||
|
||||
bool DVDThreadManager::IsInsertedDiscRunning()
|
||||
bool DVDThread::IsInsertedDiscRunning()
|
||||
{
|
||||
if (!m_disc)
|
||||
return false;
|
||||
|
@ -179,8 +179,8 @@ bool DVDThreadManager::IsInsertedDiscRunning()
|
|||
return SConfig::GetInstance().GetGameID() == m_disc->GetGameID();
|
||||
}
|
||||
|
||||
bool DVDThreadManager::UpdateRunningGameMetadata(const DiscIO::Partition& partition,
|
||||
std::optional<u64> title_id)
|
||||
bool DVDThread::UpdateRunningGameMetadata(const DiscIO::Partition& partition,
|
||||
std::optional<u64> title_id)
|
||||
{
|
||||
if (!m_disc)
|
||||
return false;
|
||||
|
@ -198,7 +198,7 @@ bool DVDThreadManager::UpdateRunningGameMetadata(const DiscIO::Partition& partit
|
|||
return true;
|
||||
}
|
||||
|
||||
void DVDThreadManager::WaitUntilIdle()
|
||||
void DVDThread::WaitUntilIdle()
|
||||
{
|
||||
ASSERT(Core::IsCPUThread());
|
||||
|
||||
|
@ -209,23 +209,23 @@ void DVDThreadManager::WaitUntilIdle()
|
|||
StartDVDThread();
|
||||
}
|
||||
|
||||
void DVDThreadManager::StartRead(u64 dvd_offset, u32 length, const DiscIO::Partition& partition,
|
||||
DVD::ReplyType reply_type, s64 ticks_until_completion)
|
||||
void DVDThread::StartRead(u64 dvd_offset, u32 length, const DiscIO::Partition& partition,
|
||||
DVD::ReplyType reply_type, s64 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,
|
||||
const DiscIO::Partition& partition,
|
||||
DVD::ReplyType reply_type, s64 ticks_until_completion)
|
||||
void DVDThread::StartReadToEmulatedRAM(u32 output_address, u64 dvd_offset, u32 length,
|
||||
const DiscIO::Partition& partition,
|
||||
DVD::ReplyType reply_type, s64 ticks_until_completion)
|
||||
{
|
||||
StartReadInternal(true, output_address, dvd_offset, length, partition, reply_type,
|
||||
ticks_until_completion);
|
||||
}
|
||||
|
||||
void DVDThreadManager::StartReadInternal(bool copy_to_ram, u32 output_address, u64 dvd_offset,
|
||||
u32 length, const DiscIO::Partition& partition,
|
||||
DVD::ReplyType reply_type, s64 ticks_until_completion)
|
||||
void DVDThread::StartReadInternal(bool copy_to_ram, u32 output_address, u64 dvd_offset, u32 length,
|
||||
const DiscIO::Partition& partition, DVD::ReplyType reply_type,
|
||||
s64 ticks_until_completion)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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 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);
|
||||
}
|
||||
|
||||
void DVDThreadManager::DVDThreadMain()
|
||||
void DVDThread::DVDThreadMain()
|
||||
{
|
||||
Common::SetCurrentThreadName("DVD thread");
|
||||
|
||||
|
|
|
@ -50,15 +50,15 @@ namespace DVD
|
|||
{
|
||||
enum class ReplyType : u32;
|
||||
|
||||
class DVDThreadManager
|
||||
class DVDThread
|
||||
{
|
||||
public:
|
||||
explicit DVDThreadManager(Core::System& system);
|
||||
DVDThreadManager(const DVDThreadManager&) = delete;
|
||||
DVDThreadManager(DVDThreadManager&&) = delete;
|
||||
DVDThreadManager& operator=(const DVDThreadManager&) = delete;
|
||||
DVDThreadManager& operator=(DVDThreadManager&&) = delete;
|
||||
~DVDThreadManager();
|
||||
explicit DVDThread(Core::System& system);
|
||||
DVDThread(const DVDThread&) = delete;
|
||||
DVDThread(DVDThread&&) = delete;
|
||||
DVDThread& operator=(const DVDThread&) = delete;
|
||||
DVDThread& operator=(DVDThread&&) = delete;
|
||||
~DVDThread();
|
||||
|
||||
void Start();
|
||||
void Stop();
|
||||
|
|
|
@ -51,7 +51,7 @@ struct System::Impl
|
|||
CPU::CPUManager m_cpu;
|
||||
DSP::DSPManager m_dsp;
|
||||
DVD::DVDInterface m_dvd_interface;
|
||||
DVD::DVDThreadManager m_dvd_thread;
|
||||
DVD::DVDThread m_dvd_thread;
|
||||
ExpansionInterface::ExpansionInterfaceState m_expansion_interface_state;
|
||||
Fifo::FifoManager m_fifo;
|
||||
GeometryShaderManager m_geometry_shader_manager;
|
||||
|
@ -143,7 +143,7 @@ DVD::DVDInterface& System::GetDVDInterface() const
|
|||
return m_impl->m_dvd_interface;
|
||||
}
|
||||
|
||||
DVD::DVDThreadManager& System::GetDVDThread() const
|
||||
DVD::DVDThread& System::GetDVDThread() const
|
||||
{
|
||||
return m_impl->m_dvd_thread;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ class DSPManager;
|
|||
namespace DVD
|
||||
{
|
||||
class DVDInterface;
|
||||
class DVDThreadManager;
|
||||
class DVDThread;
|
||||
} // namespace DVD
|
||||
namespace ExpansionInterface
|
||||
{
|
||||
|
@ -125,7 +125,7 @@ public:
|
|||
CommandProcessor::CommandProcessorManager& GetCommandProcessor() const;
|
||||
DSP::DSPManager& GetDSP() const;
|
||||
DVD::DVDInterface& GetDVDInterface() const;
|
||||
DVD::DVDThreadManager& GetDVDThread() const;
|
||||
DVD::DVDThread& GetDVDThread() const;
|
||||
ExpansionInterface::ExpansionInterfaceState& GetExpansionInterfaceState() const;
|
||||
Fifo::FifoManager& GetFifo() const;
|
||||
GeometryShaderManager& GetGeometryShaderManager() const;
|
||||
|
|
Loading…
Reference in New Issue