mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-24 18:28:44 +00:00
Add an option to eject the disc
This commit is contained in:
parent
3c770693a2
commit
e4faabb763
9 changed files with 24 additions and 3 deletions
|
@ -468,6 +468,12 @@ static void InsertDiscCallback(u64 userdata, s64 cyclesLate)
|
|||
s_disc_path_to_insert.clear();
|
||||
}
|
||||
|
||||
// Must only be called on the CPU thread
|
||||
void EjectDisc()
|
||||
{
|
||||
CoreTiming::ScheduleEvent(0, s_eject_disc);
|
||||
}
|
||||
|
||||
// Must only be called on the CPU thread
|
||||
void ChangeDisc(const std::string& new_path)
|
||||
{
|
||||
|
@ -477,10 +483,10 @@ void ChangeDisc(const std::string& new_path)
|
|||
return;
|
||||
}
|
||||
|
||||
s_disc_path_to_insert = new_path;
|
||||
CoreTiming::ScheduleEvent(0, s_eject_disc);
|
||||
CoreTiming::ScheduleEvent(SystemTimers::GetTicksPerSecond(), s_insert_disc);
|
||||
EjectDisc();
|
||||
|
||||
s_disc_path_to_insert = new_path;
|
||||
CoreTiming::ScheduleEvent(SystemTimers::GetTicksPerSecond(), s_insert_disc);
|
||||
Movie::SignalDiscChange(new_path);
|
||||
}
|
||||
|
||||
|
|
|
@ -113,6 +113,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base);
|
|||
|
||||
void SetDisc(std::unique_ptr<DiscIO::Volume> disc);
|
||||
bool IsDiscInside();
|
||||
void EjectDisc(); // Must only be called on the CPU thread
|
||||
void ChangeDisc(const std::string& new_path); // Must only be called on the CPU thread
|
||||
|
||||
// This function returns true and calls SConfig::SetRunningGameMetadata(Volume&, Partition&)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue