mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Some small clean up + fixes to make valgrind happy
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4991 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -35,7 +35,7 @@ protected:
|
|||||||
bool m_muted;
|
bool m_muted;
|
||||||
|
|
||||||
public:
|
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;}
|
virtual ~SoundStream() { delete m_mixer;}
|
||||||
|
|
||||||
static bool isValid() { return false; }
|
static bool isValid() { return false; }
|
||||||
|
@ -59,10 +59,6 @@
|
|||||||
#include "State.h"
|
#include "State.h"
|
||||||
#include "OnFrame.h"
|
#include "OnFrame.h"
|
||||||
|
|
||||||
#ifndef _WIN32
|
|
||||||
#define WINAPI
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Core
|
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()
|
bool Init()
|
||||||
{
|
{
|
||||||
if (g_EmuThread != NULL)
|
if (g_EmuThread != NULL)
|
||||||
{
|
{
|
||||||
PanicAlert("ERROR: Emu Thread already running. Report this bug.");
|
PanicAlert("Emu Thread already running");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::InitThreading();
|
|
||||||
|
|
||||||
// Get a handle to the current instance of the plugin manager
|
// Get a handle to the current instance of the plugin manager
|
||||||
CPluginManager &pManager = CPluginManager::GetInstance();
|
CPluginManager &pManager = CPluginManager::GetInstance();
|
||||||
SCoreStartupParameter &_CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
SCoreStartupParameter &_CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
|
|
||||||
|
Common::InitThreading();
|
||||||
|
|
||||||
g_CoreStartupParameter = _CoreParameter;
|
g_CoreStartupParameter = _CoreParameter;
|
||||||
// FIXME DEBUG_LOG(BOOT, dump_params());
|
// FIXME DEBUG_LOG(BOOT, dump_params());
|
||||||
Host_SetWaitCursor(true);
|
Host_SetWaitCursor(true);
|
||||||
|
|
||||||
// Start the thread again
|
// Load all needed plugins
|
||||||
_dbg_assert_(HLE, g_EmuThread == NULL);
|
|
||||||
|
|
||||||
// Check that all plugins exist, potentially call LoadLibrary() for unloaded plugins
|
|
||||||
if (!pManager.InitPlugins())
|
if (!pManager.InitPlugins())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
emuThreadGoing.Init();
|
emuThreadGoing.Init();
|
||||||
// This will execute EmuThread() further down in this file
|
|
||||||
|
// Start the emu thread
|
||||||
g_EmuThread = new Common::Thread(EmuThread, NULL);
|
g_EmuThread = new Common::Thread(EmuThread, NULL);
|
||||||
|
|
||||||
|
// Wait until the emu thread is running
|
||||||
emuThreadGoing.MsgWait();
|
emuThreadGoing.MsgWait();
|
||||||
emuThreadGoing.Shutdown();
|
emuThreadGoing.Shutdown();
|
||||||
|
|
||||||
// All right, the event is set and killed. We are now running.
|
|
||||||
Host_SetWaitCursor(false);
|
Host_SetWaitCursor(false);
|
||||||
return true;
|
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!
|
void Stop() // - Hammertime!
|
||||||
{
|
{
|
||||||
const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
@ -201,7 +196,8 @@ void Stop() // - Hammertime!
|
|||||||
|
|
||||||
WARN_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutting down ----");
|
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(AUDIO_DESTROY);
|
||||||
Host_Message(VIDEO_DESTROY);
|
Host_Message(VIDEO_DESTROY);
|
||||||
|
|
||||||
@ -216,8 +212,9 @@ void Stop() // - Hammertime!
|
|||||||
|
|
||||||
if (_CoreParameter.bCPUThread)
|
if (_CoreParameter.bCPUThread)
|
||||||
{
|
{
|
||||||
// Video_EnterLoop() should now exit so that EmuThread() will continue concurrently with the rest
|
// Video_EnterLoop() should now exit so that EmuThread() will continue
|
||||||
// of the commands in this function. We no longer rely on Postmessage.
|
// 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());
|
NOTICE_LOG(CONSOLE, "%s", StopMessage(true, "Wait for Video Loop to exit ...").c_str());
|
||||||
CPluginManager::GetInstance().GetVideo()->Video_ExitLoop();
|
CPluginManager::GetInstance().GetVideo()->Video_ExitLoop();
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ void STACKALIGN CheckGatherPipe()
|
|||||||
m_gatherPipeCount -= GATHER_PIPE_SIZE;
|
m_gatherPipeCount -= GATHER_PIPE_SIZE;
|
||||||
|
|
||||||
// HyperIris: dunno why, but I use memcpy. TODO: See if a custom copy can be faster, like 4x MOVAPD
|
// 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
|
// increase the CPUWritePointer
|
||||||
if (ProcessorInterface::Fifo_CPUWritePointer == ProcessorInterface::Fifo_CPUEnd)
|
if (ProcessorInterface::Fifo_CPUWritePointer == ProcessorInterface::Fifo_CPUEnd)
|
||||||
|
@ -38,18 +38,13 @@
|
|||||||
namespace FileMon
|
namespace FileMon
|
||||||
{
|
{
|
||||||
|
|
||||||
// -----------
|
|
||||||
// Declarations and definitions
|
|
||||||
|
|
||||||
DiscIO::IVolume *OpenISO;
|
DiscIO::IVolume *OpenISO;
|
||||||
DiscIO::IFileSystem *pFileSystem = NULL;
|
DiscIO::IFileSystem *pFileSystem = NULL;
|
||||||
std::vector<const DiscIO::SFileInfo *> GCFiles;
|
std::vector<const DiscIO::SFileInfo *> GCFiles;
|
||||||
std::string ISOFile, CurrentFile;
|
std::string ISOFile = "", CurrentFile = "";
|
||||||
bool FileAccess = true;
|
bool FileAccess = true;
|
||||||
|
|
||||||
// -----------
|
|
||||||
// Filtered files
|
// Filtered files
|
||||||
|
|
||||||
bool ShowSound(std::string FileName)
|
bool ShowSound(std::string FileName)
|
||||||
{
|
{
|
||||||
std::string Ending;
|
std::string Ending;
|
||||||
@ -72,9 +67,7 @@ bool ShowSound(std::string FileName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -----------
|
|
||||||
// Read the GC file system
|
// Read the GC file system
|
||||||
|
|
||||||
void ReadGC(std::string FileName)
|
void ReadGC(std::string FileName)
|
||||||
{
|
{
|
||||||
GCFiles.clear();
|
GCFiles.clear();
|
||||||
@ -89,9 +82,7 @@ void ReadGC(std::string FileName)
|
|||||||
FileAccess = true;
|
FileAccess = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------
|
|
||||||
// Check if we should play this file
|
// Check if we should play this file
|
||||||
|
|
||||||
void CheckFile(std::string File, int Size)
|
void CheckFile(std::string File, int Size)
|
||||||
{
|
{
|
||||||
// Don't do anything if the log is unselected
|
// Don't do anything if the log is unselected
|
||||||
@ -114,7 +105,7 @@ void CheckFile(std::string File, int Size)
|
|||||||
CurrentFile = File;
|
CurrentFile = File;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------
|
|
||||||
// Find the GC filename
|
// Find the GC filename
|
||||||
void FindFilename(u64 offset)
|
void FindFilename(u64 offset)
|
||||||
{
|
{
|
||||||
@ -133,15 +124,13 @@ void FindFilename(u64 offset)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// File
|
const char *fname = pFileSystem->GetFileName(offset);
|
||||||
if (!pFileSystem->GetFileName(offset)) return;
|
|
||||||
std::string File = std::string(pFileSystem->GetFileName(offset));
|
|
||||||
// There's something wrong with the paths
|
// There's something wrong with the paths
|
||||||
if (File.length() == 512) return;
|
if (!fname || (strlen(fname) == 512))
|
||||||
|
return;
|
||||||
|
|
||||||
int Size = (int)pFileSystem->GetFileSize(File.c_str());
|
CheckFile(fname, pFileSystem->GetFileSize(fname));
|
||||||
|
|
||||||
CheckFile(File, Size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,7 +50,6 @@
|
|||||||
|
|
||||||
#include <wx/datetime.h> // wxWidgets
|
#include <wx/datetime.h> // wxWidgets
|
||||||
|
|
||||||
// ----------
|
|
||||||
// Resources
|
// Resources
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -74,9 +73,9 @@ extern "C" {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// ---------------
|
// Windows functions. Setting the cursor with wxSetCursor() did not work in
|
||||||
// Windows functions. Setting the cursor with wxSetCursor() did not work in this instance.
|
// this instance. Probably because it's somehow reset from the WndProc() in
|
||||||
// Probably because it's somehow reset from the WndProc() in the child window
|
// the child window
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Declare a blank icon and one that will be the normal cursor
|
// Declare a blank icon and one that will be the normal cursor
|
||||||
HCURSOR hCursor = NULL, hCursorBlank = NULL;
|
HCURSOR hCursor = NULL, hCursorBlank = NULL;
|
||||||
@ -194,7 +193,6 @@ CPanel::CPanel(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//-----------------
|
|
||||||
// event tables
|
// event tables
|
||||||
// Notice that wxID_HELP will be processed for the 'About' menu and the toolbar
|
// Notice that wxID_HELP will be processed for the 'About' menu and the toolbar
|
||||||
// help button.
|
// help button.
|
||||||
|
Reference in New Issue
Block a user