summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2010-09-15 12:30:56 +0000
committerskidau <skidau@gmail.com>2010-09-15 12:30:56 +0000
commita3b59f684575086f233233fbae04fb7eabfd1f46 (patch)
tree6b005fe205ee1360f61f7882b54f7b24bb6f0c33 /Source/Core
parent73adab0ce1f5e6f9648e4c7107ec4c33c46edb54 (diff)
Change Disc functionality:
* Fixed the "Change disc..." command. The filename of the disc was being lost between functions. * Split the ChangeDisc function into two functions: EjectDisc and InsertDisc * Moved the "Change disc..." command to the File menu. * Removed some log messages that caused the debug build to crash when loaded with release build plug-ins. Fixes issue 3036. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6206 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Src/OpenCL.cpp1
-rw-r--r--Source/Core/Core/Src/HW/DVDInterface.cpp50
-rw-r--r--Source/Core/DolphinWX/Src/FrameTools.cpp2
3 files changed, 23 insertions, 30 deletions
diff --git a/Source/Core/Common/Src/OpenCL.cpp b/Source/Core/Common/Src/OpenCL.cpp
index 8fad808f18..2d7b684074 100644
--- a/Source/Core/Common/Src/OpenCL.cpp
+++ b/Source/Core/Common/Src/OpenCL.cpp
@@ -122,7 +122,6 @@ bool Initialize()
return false;
}
- NOTICE_LOG(COMMON, "Initialized OpenCL!");
g_bInitialized = true;
return true;
#else
diff --git a/Source/Core/Core/Src/HW/DVDInterface.cpp b/Source/Core/Core/Src/HW/DVDInterface.cpp
index b37f2a5237..e64645051e 100644
--- a/Source/Core/Core/Src/HW/DVDInterface.cpp
+++ b/Source/Core/Core/Src/HW/DVDInterface.cpp
@@ -208,8 +208,10 @@ static unsigned char media_buffer[0x40];
// (both requests can happen at the same time, audio takes precedence)
Common::CriticalSection dvdread_section;
-static int changeDisc;
-void ChangeDiscCallback(u64 userdata, int cyclesLate);
+static int ejectDisc;
+void EjectDiscCallback(u64 userdata, int cyclesLate);
+static int insertDisc;
+void InsertDiscCallback(u64 userdata, int cyclesLate);
void UpdateInterrupts();
void GenerateDIInterrupt(DI_InterruptType _DVDInterrupt);
@@ -253,7 +255,8 @@ void Init()
AudioPos = 0;
AudioLength = 0;
- changeDisc = CoreTiming::RegisterEvent("ChangeDisc", ChangeDiscCallback);
+ ejectDisc = CoreTiming::RegisterEvent("EjectDisc", EjectDiscCallback);
+ insertDisc = CoreTiming::RegisterEvent("InsertDisc", InsertDiscCallback);
}
void Shutdown()
@@ -274,44 +277,35 @@ bool IsDiscInside()
// We want this in the "backend", NOT the gui
// any !empty string will be deleted to ensure
// that the userdata string exists when called
-void ChangeDiscCallback(u64 userdata, int cyclesLate)
+void EjectDiscCallback(u64 userdata, int cyclesLate)
{
- std::string FileName((const char*)userdata);
+ // Empty the drive
SetDiscInside(false);
SetLidOpen();
+ VolumeHandler::EjectVolume();
+}
+void InsertDiscCallback(u64 userdata, int cyclesLate)
+{
std::string& SavedFileName = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strFilename;
+ std::string *_FileName = (std::string *)userdata;
- if (FileName.empty())
- {
- // Empty the drive
- VolumeHandler::EjectVolume();
- }
- else
+ if (!VolumeHandler::SetVolumeName(*_FileName))
{
- if (VolumeHandler::SetVolumeName(FileName))
- {
- // Save the new ISO file name
- SavedFileName = FileName;
- }
- else
- {
- PanicAlert("Invalid file \n %s", FileName.c_str());
-
- // Put back the old one
- VolumeHandler::SetVolumeName(SavedFileName);
- }
+ // Put back the old one
+ VolumeHandler::SetVolumeName(SavedFileName);
+ PanicAlert("Invalid file");
}
-
SetLidOpen(false);
SetDiscInside(VolumeHandler::IsValid());
+ delete _FileName;
}
-void ChangeDisc(const char* _FileName)
+void ChangeDisc(const char* _newFileName)
{
- const char* NoDisc = "";
- CoreTiming::ScheduleEvent_Threadsafe(0, changeDisc, (u64)NoDisc);
- CoreTiming::ScheduleEvent_Threadsafe(500000000, changeDisc, (u64)_FileName);
+ std::string* _FileName = new std::string(_newFileName);
+ CoreTiming::ScheduleEvent_Threadsafe(0, ejectDisc);
+ CoreTiming::ScheduleEvent_Threadsafe(500000000, insertDisc, (u64)_FileName);
}
void SetLidOpen(bool _bOpen)
diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp
index 8d718ae44f..f64be6e570 100644
--- a/Source/Core/DolphinWX/Src/FrameTools.cpp
+++ b/Source/Core/DolphinWX/Src/FrameTools.cpp
@@ -105,6 +105,7 @@ void CFrame::CreateMenu()
// file menu
wxMenu* fileMenu = new wxMenu;
fileMenu->Append(wxID_OPEN, _T("&Open...\tCtrl+O"));
+ fileMenu->Append(IDM_CHANGEDISC, _T("Change &Disc..."));
wxMenu *externalDrive = new wxMenu;
fileMenu->Append(IDM_DRIVES, _T("&Boot from DVD Drive..."), externalDrive);
@@ -135,7 +136,6 @@ void CFrame::CreateMenu()
emulationMenu->Append(IDM_PLAYRECORD, _T("P&lay Recording..."));
emulationMenu->Append(IDM_RECORDEXPORT, _T("Export Recording..."));
emulationMenu->AppendSeparator();
- emulationMenu->Append(IDM_CHANGEDISC, _T("Change &Disc"));
emulationMenu->Append(IDM_FRAMESTEP, _T("&Frame Stepping"), wxEmptyString, wxITEM_CHECK);