Skip to content
Permalink
Browse files
Merge pull request #11637 from AdmiralCurtiss/dvd-class
HW/DVD: Refactor DVDInterface and DVDThread to classes.
  • Loading branch information
lioncash committed Mar 10, 2023
2 parents 3ec32c5 + d31733c commit 00a6f8c
Show file tree
Hide file tree
Showing 20 changed files with 823 additions and 864 deletions.
@@ -44,6 +44,7 @@
#include "Core/PowerPC/PowerPC.h"
#include "Core/PowerPC/Profiler.h"
#include "Core/State.h"
#include "Core/System.h"

#include "DiscIO/Blob.h"
#include "DiscIO/Enums.h"
@@ -648,7 +649,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_ChangeDisc(J
{
const std::string path = GetJString(env, jFile);
__android_log_print(ANDROID_LOG_INFO, DOLPHIN_TAG, "Change Disc: %s", path.c_str());
Core::RunAsCPUThread([&path] { DVDInterface::ChangeDisc(path); });
Core::RunAsCPUThread([&path] { Core::System::GetInstance().GetDVDInterface().ChangeDisc(path); });
}

JNIEXPORT jobject JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetLogTypeNames(JNIEnv* env,
@@ -317,7 +317,7 @@ static const DiscIO::VolumeDisc* SetDisc(std::unique_ptr<DiscIO::VolumeDisc> dis
std::vector<std::string> auto_disc_change_paths = {})
{
const DiscIO::VolumeDisc* pointer = disc.get();
DVDInterface::SetDisc(std::move(disc), auto_disc_change_paths);
Core::System::GetInstance().GetDVDInterface().SetDisc(std::move(disc), auto_disc_change_paths);
return pointer;
}

@@ -344,7 +344,7 @@ bool CBoot::DVDReadDiscID(Core::System& system, const DiscIO::VolumeDisc& disc,

// Transition out of the DiscIdNotRead state (which the drive should be in at this point,
// on the assumption that this is only used for the first read)
DVDInterface::SetDriveState(DVDInterface::DriveState::ReadyNoReadsMade);
system.GetDVDInterface().SetDriveState(DVD::DriveState::ReadyNoReadsMade);
return true;
}

@@ -295,11 +295,11 @@ bool CBoot::EmulatedBS2_GC(Core::System& system, const Core::CPUThreadGuard& gua
// No known game uses a size other than the default.
if (streaming_size == 0)
streaming_size = 10;
DVDInterface::AudioBufferConfig(true, streaming_size);
system.GetDVDInterface().AudioBufferConfig(true, streaming_size);
}
else
{
DVDInterface::AudioBufferConfig(false, 0);
system.GetDVDInterface().AudioBufferConfig(false, 0);
}

const bool ntsc = DiscIO::IsNTSC(SConfig::GetInstance().m_region);
@@ -126,7 +126,7 @@ void SConfig::SetRunningGameMetadata(const IOS::ES::TMDReader& tmd, DiscIO::Plat
// (IOS HLE ES calls us with a TMDReader rather than a volume when launching
// a disc game, because ES has no reason to be accessing the disc directly.)
if (platform == DiscIO::Platform::WiiWAD ||
!DVDInterface::UpdateRunningGameMetadata(tmd_title_id))
!Core::System::GetInstance().GetDVDInterface().UpdateRunningGameMetadata(tmd_title_id))
{
// If not launching a disc game, just read everything from the TMD.
SetRunningGameMetadata(tmd.GetGameID(), tmd.GetGameTDBID(), tmd_title_id, tmd.GetTitleVersion(),

0 comments on commit 00a6f8c

Please sign in to comment.