Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
3 changes: 2 additions & 1 deletion Source/Android/jni/MainAndroid.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/Boot/Boot.cpp
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/Boot/Boot_BS2Emu.cpp
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/ConfigManager.cpp
Expand Up @@ -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(),
Expand Down

0 comments on commit 00a6f8c

Please sign in to comment.