diff --git a/Source/Core/AudioCommon/Src/SoundStream.h b/Source/Core/AudioCommon/Src/SoundStream.h index e07d41078d..165d58afc5 100644 --- a/Source/Core/AudioCommon/Src/SoundStream.h +++ b/Source/Core/AudioCommon/Src/SoundStream.h @@ -35,7 +35,7 @@ protected: bool m_muted; public: - SoundStream(CMixer *mixer) : m_mixer(mixer), threadData(0), m_muted(false) {} + SoundStream(CMixer *mixer) : m_mixer(mixer), threadData(0), m_logAudio(false), m_muted(false) {} virtual ~SoundStream() { delete m_mixer;} static bool isValid() { return false; } diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 69f889dc79..f6f7264b0c 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -59,10 +59,6 @@ #include "State.h" #include "OnFrame.h" -#ifndef _WIN32 -#define WINAPI -#endif - namespace Core { @@ -153,46 +149,45 @@ bool isRunning() } -// This is called from the GUI thread. See the booting call schedule in BootManager.cpp - +// This is called from the GUI thread. See the booting call schedule in +// BootManager.cpp bool Init() { if (g_EmuThread != NULL) { - PanicAlert("ERROR: Emu Thread already running. Report this bug."); + PanicAlert("Emu Thread already running"); return false; } - Common::InitThreading(); - // Get a handle to the current instance of the plugin manager CPluginManager &pManager = CPluginManager::GetInstance(); SCoreStartupParameter &_CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter; + Common::InitThreading(); + g_CoreStartupParameter = _CoreParameter; // FIXME DEBUG_LOG(BOOT, dump_params()); Host_SetWaitCursor(true); - // Start the thread again - _dbg_assert_(HLE, g_EmuThread == NULL); - - // Check that all plugins exist, potentially call LoadLibrary() for unloaded plugins + // Load all needed plugins if (!pManager.InitPlugins()) return false; emuThreadGoing.Init(); - // This will execute EmuThread() further down in this file + + // Start the emu thread g_EmuThread = new Common::Thread(EmuThread, NULL); - + + // Wait until the emu thread is running emuThreadGoing.MsgWait(); emuThreadGoing.Shutdown(); - // All right, the event is set and killed. We are now running. Host_SetWaitCursor(false); return true; } -// Called from GUI thread or VI thread (why VI??? That must be bad. Window close? TODO: Investigate.) +// Called from GUI thread or VI thread (why VI??? That must be bad. Window +// close? TODO: Investigate.) void Stop() // - Hammertime! { const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter; @@ -201,7 +196,8 @@ void Stop() // - Hammertime! WARN_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutting down ----"); - // This must be done a while before freeing the dll to not crash wx around MSWWindowProc and DefWindowProc, will investigate further + // This must be done a while before freeing the dll to not crash wx around + // MSWWindowProc and DefWindowProc, will investigate further Host_Message(AUDIO_DESTROY); Host_Message(VIDEO_DESTROY); @@ -216,8 +212,9 @@ void Stop() // - Hammertime! if (_CoreParameter.bCPUThread) { - // Video_EnterLoop() should now exit so that EmuThread() will continue concurrently with the rest - // of the commands in this function. We no longer rely on Postmessage. + // Video_EnterLoop() should now exit so that EmuThread() will continue + // concurrently with the rest of the commands in this function. We no + // longer rely on Postmessage. NOTICE_LOG(CONSOLE, "%s", StopMessage(true, "Wait for Video Loop to exit ...").c_str()); CPluginManager::GetInstance().GetVideo()->Video_ExitLoop(); diff --git a/Source/Core/Core/Src/HW/GPFifo.cpp b/Source/Core/Core/Src/HW/GPFifo.cpp index 2df3bee922..560110e005 100644 --- a/Source/Core/Core/Src/HW/GPFifo.cpp +++ b/Source/Core/Core/Src/HW/GPFifo.cpp @@ -77,7 +77,7 @@ void STACKALIGN CheckGatherPipe() m_gatherPipeCount -= GATHER_PIPE_SIZE; // HyperIris: dunno why, but I use memcpy. TODO: See if a custom copy can be faster, like 4x MOVAPD - memcpy(m_gatherPipe, m_gatherPipe + GATHER_PIPE_SIZE, m_gatherPipeCount); + memmove(m_gatherPipe, m_gatherPipe + GATHER_PIPE_SIZE, m_gatherPipeCount); // increase the CPUWritePointer if (ProcessorInterface::Fifo_CPUWritePointer == ProcessorInterface::Fifo_CPUEnd) diff --git a/Source/Core/DiscIO/Src/FileMonitor.cpp b/Source/Core/DiscIO/Src/FileMonitor.cpp index 0a68d71ffc..906af283c2 100644 --- a/Source/Core/DiscIO/Src/FileMonitor.cpp +++ b/Source/Core/DiscIO/Src/FileMonitor.cpp @@ -38,18 +38,13 @@ namespace FileMon { -// ----------- -// Declarations and definitions - DiscIO::IVolume *OpenISO; DiscIO::IFileSystem *pFileSystem = NULL; std::vector GCFiles; -std::string ISOFile, CurrentFile; +std::string ISOFile = "", CurrentFile = ""; bool FileAccess = true; -// ----------- // Filtered files - bool ShowSound(std::string FileName) { std::string Ending; @@ -72,9 +67,7 @@ bool ShowSound(std::string FileName) } -// ----------- // Read the GC file system - void ReadGC(std::string FileName) { GCFiles.clear(); @@ -89,9 +82,7 @@ void ReadGC(std::string FileName) FileAccess = true; } -// ----------- // Check if we should play this file - void CheckFile(std::string File, int Size) { // Don't do anything if the log is unselected @@ -114,7 +105,7 @@ void CheckFile(std::string File, int Size) CurrentFile = File; } -// ----------- + // Find the GC filename void FindFilename(u64 offset) { @@ -133,15 +124,13 @@ void FindFilename(u64 offset) return; } - // File - if (!pFileSystem->GetFileName(offset)) return; - std::string File = std::string(pFileSystem->GetFileName(offset)); + const char *fname = pFileSystem->GetFileName(offset); + // There's something wrong with the paths - if (File.length() == 512) return; - - int Size = (int)pFileSystem->GetFileSize(File.c_str()); - - CheckFile(File, Size); + if (!fname || (strlen(fname) == 512)) + return; + + CheckFile(fname, pFileSystem->GetFileSize(fname)); } diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index afab7f8a54..aa027358fa 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -50,7 +50,6 @@ #include // wxWidgets -// ---------- // Resources extern "C" { @@ -74,9 +73,9 @@ extern "C" { }; -// --------------- -// Windows functions. Setting the cursor with wxSetCursor() did not work in this instance. -// Probably because it's somehow reset from the WndProc() in the child window +// Windows functions. Setting the cursor with wxSetCursor() did not work in +// this instance. Probably because it's somehow reset from the WndProc() in +// the child window #ifdef _WIN32 // Declare a blank icon and one that will be the normal cursor HCURSOR hCursor = NULL, hCursorBlank = NULL; @@ -194,7 +193,6 @@ CPanel::CPanel( } #endif -//----------------- // event tables // Notice that wxID_HELP will be processed for the 'About' menu and the toolbar // help button.