mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
GUI: Fixed some GUI related start/stop crashes
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4223 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
49601e0af2
commit
7e115dcb00
@ -69,7 +69,7 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLibrarianTool"
|
Name="VCLibrarianTool"
|
||||||
AdditionalDependencies="wsock32.lib"
|
AdditionalDependencies="wsock32.lib psapi.lib"
|
||||||
OutputFile="$(OutDir)/Common.lib"
|
OutputFile="$(OutDir)/Common.lib"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
@ -142,7 +142,7 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLibrarianTool"
|
Name="VCLibrarianTool"
|
||||||
AdditionalDependencies="wsock32.lib winmm.lib"
|
AdditionalDependencies="wsock32.lib winmm.lib psapi.lib"
|
||||||
OutputFile="$(OutDir)/Common.lib"
|
OutputFile="$(OutDir)/Common.lib"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
@ -215,7 +215,7 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLibrarianTool"
|
Name="VCLibrarianTool"
|
||||||
AdditionalDependencies="wsock32.lib"
|
AdditionalDependencies="wsock32.lib psapi.lib"
|
||||||
OutputFile="$(OutDir)/Common.lib"
|
OutputFile="$(OutDir)/Common.lib"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
@ -289,7 +289,7 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLibrarianTool"
|
Name="VCLibrarianTool"
|
||||||
AdditionalDependencies="winmm.lib"
|
AdditionalDependencies="winmm.lib psapi.lib"
|
||||||
OutputFile="$(OutDir)/Common.lib"
|
OutputFile="$(OutDir)/Common.lib"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
@ -359,7 +359,7 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLibrarianTool"
|
Name="VCLibrarianTool"
|
||||||
AdditionalDependencies="wsock32.lib"
|
AdditionalDependencies="wsock32.lib psapi.lib"
|
||||||
OutputFile="$(OutDir)/Common.lib"
|
OutputFile="$(OutDir)/Common.lib"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
@ -429,7 +429,7 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLibrarianTool"
|
Name="VCLibrarianTool"
|
||||||
AdditionalDependencies="wsock32.lib"
|
AdditionalDependencies="wsock32.lib psapi.lib"
|
||||||
OutputFile="$(OutDir)/Common.lib"
|
OutputFile="$(OutDir)/Common.lib"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
@ -17,9 +17,11 @@
|
|||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "MemoryUtil.h"
|
#include "MemoryUtil.h"
|
||||||
|
#include "StringUtil.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <psapi.h>
|
||||||
#elif __GNUC__
|
#elif __GNUC__
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -132,3 +134,28 @@ void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute)
|
|||||||
mprotect(ptr, size, allowExecute ? (PROT_READ | PROT_WRITE | PROT_EXEC) : PROT_WRITE | PROT_READ);
|
mprotect(ptr, size, allowExecute ? (PROT_READ | PROT_WRITE | PROT_EXEC) : PROT_WRITE | PROT_READ);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string MemUsage()
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
DWORD processID = GetCurrentProcessId();
|
||||||
|
HANDLE hProcess;
|
||||||
|
PROCESS_MEMORY_COUNTERS pmc;
|
||||||
|
std::string Ret;
|
||||||
|
|
||||||
|
// Print information about the memory usage of the process.
|
||||||
|
|
||||||
|
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID);
|
||||||
|
if (NULL == hProcess) return "MemUsage Error";
|
||||||
|
|
||||||
|
if (GetProcessMemoryInfo(hProcess, &pmc, sizeof(pmc)))
|
||||||
|
Ret = StringFromFormat("%s K", ThS(pmc.WorkingSetSize / 1024, true, 7).c_str());
|
||||||
|
|
||||||
|
CloseHandle(hProcess);
|
||||||
|
return Ret;
|
||||||
|
|
||||||
|
#else
|
||||||
|
return "";
|
||||||
|
#endif
|
||||||
|
}
|
@ -18,11 +18,14 @@
|
|||||||
#ifndef _MEMORYUTIL_H
|
#ifndef _MEMORYUTIL_H
|
||||||
#define _MEMORYUTIL_H
|
#define _MEMORYUTIL_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
void* AllocateExecutableMemory(size_t size, bool low = true);
|
void* AllocateExecutableMemory(size_t size, bool low = true);
|
||||||
void* AllocateMemoryPages(size_t size);
|
void* AllocateMemoryPages(size_t size);
|
||||||
void FreeMemoryPages(void* ptr, size_t size);
|
void FreeMemoryPages(void* ptr, size_t size);
|
||||||
void WriteProtectMemory(void* ptr, size_t size, bool executable = false);
|
void WriteProtectMemory(void* ptr, size_t size, bool executable = false);
|
||||||
void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute = false);
|
void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute = false);
|
||||||
|
std::string MemUsage();
|
||||||
|
|
||||||
inline int GetPageSize() { return 4096; }
|
inline int GetPageSize() { return 4096; }
|
||||||
|
|
||||||
|
@ -452,7 +452,7 @@ std::string ThS(int Integer, bool Unsigned, int Spaces)
|
|||||||
|
|
||||||
// Spaces
|
// Spaces
|
||||||
std::string Spc = "";
|
std::string Spc = "";
|
||||||
for (int i = 0; i < (Spaces - Sbuf.length()); i++) Spc += " ";
|
for (int i = 0; i < (int)(Spaces - Sbuf.length()); i++) Spc += " ";
|
||||||
return Spc + Sbuf;
|
return Spc + Sbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,15 @@
|
|||||||
namespace Common
|
namespace Common
|
||||||
{
|
{
|
||||||
|
|
||||||
|
int Thread::CurrentId()
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
return GetCurrentThreadId();
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
void InitThreading()
|
void InitThreading()
|
||||||
@ -81,14 +90,16 @@ Thread::~Thread()
|
|||||||
WaitForDeath();
|
WaitForDeath();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Thread::WaitForDeath(const int _Wait)
|
DWORD Thread::WaitForDeath(const int iWait)
|
||||||
{
|
{
|
||||||
if (m_hThread)
|
if (m_hThread)
|
||||||
{
|
{
|
||||||
WaitForSingleObject(m_hThread, _Wait);
|
DWORD Wait = WaitForSingleObject(m_hThread, iWait);
|
||||||
CloseHandle(m_hThread);
|
CloseHandle(m_hThread);
|
||||||
m_hThread = NULL;
|
m_hThread = NULL;
|
||||||
|
return Wait;
|
||||||
}
|
}
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Thread::SetAffinity(int mask)
|
void Thread::SetAffinity(int mask)
|
||||||
|
@ -105,9 +105,10 @@ public:
|
|||||||
|
|
||||||
void SetAffinity(int mask);
|
void SetAffinity(int mask);
|
||||||
static void SetCurrentThreadAffinity(int mask);
|
static void SetCurrentThreadAffinity(int mask);
|
||||||
#ifdef _WIN32
|
static int CurrentId();
|
||||||
|
#ifdef _WIN32
|
||||||
void SetPriority(int priority);
|
void SetPriority(int priority);
|
||||||
void WaitForDeath(const int _Wait = INFINITE);
|
DWORD WaitForDeath(const int iWait = INFINITE);
|
||||||
#else
|
#else
|
||||||
void WaitForDeath();
|
void WaitForDeath();
|
||||||
#endif
|
#endif
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "StringUtil.h"
|
#include "StringUtil.h"
|
||||||
#include "MathUtil.h"
|
#include "MathUtil.h"
|
||||||
|
#include "MemoryUtil.h"
|
||||||
|
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
@ -92,6 +93,7 @@ THREAD_RETURN EmuThread(void *pArg);
|
|||||||
|
|
||||||
void Stop();
|
void Stop();
|
||||||
|
|
||||||
|
bool g_bStopping = false;
|
||||||
bool g_bHwInit = false;
|
bool g_bHwInit = false;
|
||||||
bool g_bRealWiimote = false;
|
bool g_bRealWiimote = false;
|
||||||
HWND g_pWindowHandle = NULL;
|
HWND g_pWindowHandle = NULL;
|
||||||
@ -106,6 +108,14 @@ Common::Event gpuShutdownCall;
|
|||||||
|
|
||||||
|
|
||||||
// Display messages and return values
|
// Display messages and return values
|
||||||
|
|
||||||
|
// Formatted stop message
|
||||||
|
std::string StopMessage(bool bMainThread, std::string Message)
|
||||||
|
{
|
||||||
|
return StringFromFormat("Stop [%s %i]\t%s\t%s",
|
||||||
|
bMainThread ? "Main Thread" : "Video Thread", Common::Thread::CurrentId(), MemUsage().c_str(), Message.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool PanicAlertToVideo(const char* text, bool yes_no)
|
bool PanicAlertToVideo(const char* text, bool yes_no)
|
||||||
{
|
{
|
||||||
@ -207,11 +217,20 @@ bool Init()
|
|||||||
void Stop() // - Hammertime!
|
void Stop() // - Hammertime!
|
||||||
{
|
{
|
||||||
const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
const SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
|
g_bStopping = true;
|
||||||
|
|
||||||
|
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
|
||||||
|
Host_Message(AUDIO_DESTROY);
|
||||||
|
Host_Message(VIDEO_DESTROY);
|
||||||
|
|
||||||
Host_SetWaitCursor(true); // hourglass!
|
Host_SetWaitCursor(true); // hourglass!
|
||||||
if (PowerPC::GetState() == PowerPC::CPU_POWERDOWN)
|
if (PowerPC::GetState() == PowerPC::CPU_POWERDOWN)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
WARN_LOG(CONSOLE, "%s", StopMessage(true, "Stop CPU").c_str());
|
||||||
|
|
||||||
// Stop the CPU
|
// Stop the CPU
|
||||||
PowerPC::Stop();
|
PowerPC::Stop();
|
||||||
CCPU::StepOpcode(); // Kick it if it's waiting (code stepping wait loop)
|
CCPU::StepOpcode(); // Kick it if it's waiting (code stepping wait loop)
|
||||||
@ -226,7 +245,7 @@ void Stop() // - Hammertime!
|
|||||||
|
|
||||||
// If dual core mode, the CPU thread should immediately exit here.
|
// If dual core mode, the CPU thread should immediately exit here.
|
||||||
if (_CoreParameter.bUseDualCore) {
|
if (_CoreParameter.bUseDualCore) {
|
||||||
INFO_LOG(CONSOLE, "Stop [Main Thread]: Wait for Video Loop to exit...\n");
|
NOTICE_LOG(CONSOLE, "%s", StopMessage(true, "Wait for Video Loop to exit ...").c_str());
|
||||||
CPluginManager::GetInstance().GetVideo()->Video_ExitLoop();
|
CPluginManager::GetInstance().GetVideo()->Video_ExitLoop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,13 +254,29 @@ void Stop() // - Hammertime!
|
|||||||
|
|
||||||
// Close the trace file
|
// Close the trace file
|
||||||
Core::StopTrace();
|
Core::StopTrace();
|
||||||
NOTICE_LOG(BOOT, "Shutting down core");
|
WARN_LOG(CONSOLE, "%s", StopMessage(true, "Shutting down core").c_str());
|
||||||
|
|
||||||
// Update mouse pointer
|
// Update mouse pointer
|
||||||
Host_SetWaitCursor(false);
|
Host_SetWaitCursor(false);
|
||||||
|
|
||||||
|
WARN_LOG(CONSOLE, "%s", StopMessage(true, "Stopping Emu thread ...").c_str());
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
g_EmuThread->WaitForDeath(5000);
|
DWORD Wait = g_EmuThread->WaitForDeath(5000);
|
||||||
|
switch(Wait)
|
||||||
|
{
|
||||||
|
case WAIT_ABANDONED:
|
||||||
|
ERROR_LOG(CONSOLE, "%s", StopMessage(true, "Emu wait returned: WAIT_ABANDONED").c_str());
|
||||||
|
break;
|
||||||
|
case WAIT_OBJECT_0:
|
||||||
|
NOTICE_LOG(CONSOLE, "%s", StopMessage(true, "Emu wait returned: WAIT_OBJECT_0").c_str());
|
||||||
|
break;
|
||||||
|
case WAIT_TIMEOUT:
|
||||||
|
ERROR_LOG(CONSOLE, "%s", StopMessage(true, "Emu wait returned: WAIT_TIMEOUT").c_str());
|
||||||
|
break;
|
||||||
|
case WAIT_FAILED:
|
||||||
|
ERROR_LOG(CONSOLE, "%s", StopMessage(true, "Emu wait returned: WAIT_FAILED").c_str());
|
||||||
|
break;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
g_EmuThread->WaitForDeath();
|
g_EmuThread->WaitForDeath();
|
||||||
#endif
|
#endif
|
||||||
@ -469,17 +504,20 @@ THREAD_RETURN EmuThread(void *pArg)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
INFO_LOG(CONSOLE, "Stop [Video Thread]: Stop() and Video Loop Ended\n");
|
NOTICE_LOG(CONSOLE, "%s", StopMessage(false, "Stop() and Video Loop Ended").c_str());
|
||||||
INFO_LOG(CONSOLE, "Stop [Video Thread]: Shutting down HW and Plugins\n");
|
WARN_LOG(CONSOLE, "%s", StopMessage(false, "Shutting down HW").c_str());
|
||||||
|
|
||||||
// We have now exited the Video Loop and will shut down
|
// We have now exited the Video Loop and will shut down
|
||||||
|
|
||||||
// Write message
|
// Write message
|
||||||
if (g_pUpdateFPSDisplay != NULL)
|
if (g_pUpdateFPSDisplay != NULL) g_pUpdateFPSDisplay("Stopping...");
|
||||||
g_pUpdateFPSDisplay("Stopping...");
|
|
||||||
|
|
||||||
HW::Shutdown();
|
HW::Shutdown();
|
||||||
|
|
||||||
|
NOTICE_LOG(CONSOLE, "%s", StopMessage(false, "HW shutdown").c_str());
|
||||||
|
WARN_LOG(CONSOLE, "%s", StopMessage(false, "Shutting down plugins").c_str());
|
||||||
Plugins.ShutdownPlugins();
|
Plugins.ShutdownPlugins();
|
||||||
|
NOTICE_LOG(CONSOLE, "%s", StopMessage(false, "Plugins shutdown").c_str());
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
gpuShutdownCall.Set();
|
gpuShutdownCall.Set();
|
||||||
@ -495,9 +533,25 @@ THREAD_RETURN EmuThread(void *pArg)
|
|||||||
|
|
||||||
if (cpuThread)
|
if (cpuThread)
|
||||||
{
|
{
|
||||||
|
WARN_LOG(CONSOLE, "%s", StopMessage(true, "Stopping CPU thread ...").c_str());
|
||||||
// There is a CPU thread - join it.
|
// There is a CPU thread - join it.
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
cpuThread->WaitForDeath(3000);
|
DWORD Wait = cpuThread->WaitForDeath(3000);
|
||||||
|
switch(Wait)
|
||||||
|
{
|
||||||
|
case WAIT_ABANDONED:
|
||||||
|
ERROR_LOG(CONSOLE, "%s", StopMessage(true, "CPU wait returned: WAIT_ABANDONED").c_str());
|
||||||
|
break;
|
||||||
|
case WAIT_OBJECT_0:
|
||||||
|
NOTICE_LOG(CONSOLE, "%s", StopMessage(true, "CPU wait returned: WAIT_OBJECT_0").c_str());
|
||||||
|
break;
|
||||||
|
case WAIT_TIMEOUT:
|
||||||
|
ERROR_LOG(CONSOLE, "%s", StopMessage(true, "CPU wait returned: WAIT_TIMEOUT").c_str());
|
||||||
|
break;
|
||||||
|
case WAIT_FAILED:
|
||||||
|
ERROR_LOG(CONSOLE, "%s", StopMessage(true, "CPU wait returned: WAIT_FAILED").c_str());
|
||||||
|
break;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
cpuThread->WaitForDeath();
|
cpuThread->WaitForDeath();
|
||||||
#endif
|
#endif
|
||||||
@ -508,8 +562,10 @@ THREAD_RETURN EmuThread(void *pArg)
|
|||||||
|
|
||||||
// The hardware is uninitialized
|
// The hardware is uninitialized
|
||||||
g_bHwInit = false;
|
g_bHwInit = false;
|
||||||
|
g_bStopping = false;
|
||||||
INFO_LOG(MASTER_LOG, "EmuThread exited");
|
|
||||||
|
NOTICE_LOG(CONSOLE, "%s", StopMessage(true, "Main thread stopped").c_str());
|
||||||
|
NOTICE_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutdown complete ----");
|
||||||
|
|
||||||
Host_UpdateMainFrame();
|
Host_UpdateMainFrame();
|
||||||
|
|
||||||
@ -545,6 +601,8 @@ EState GetState()
|
|||||||
{
|
{
|
||||||
if (CCPU::IsStepping())
|
if (CCPU::IsStepping())
|
||||||
return CORE_PAUSE;
|
return CORE_PAUSE;
|
||||||
|
else if (g_bStopping)
|
||||||
|
return CORE_STOPPING;
|
||||||
else
|
else
|
||||||
return CORE_RUN;
|
return CORE_RUN;
|
||||||
}
|
}
|
||||||
@ -752,7 +810,7 @@ void Callback_VideoCopiedToXFB(bool video_update)
|
|||||||
|
|
||||||
|
|
||||||
// Callback_DSPLog
|
// Callback_DSPLog
|
||||||
// WARNING - THIS MAY EXECUTED FROM DSP THREAD
|
// WARNING - THIS MAY BE EXECUTED FROM DSP THREAD
|
||||||
void Callback_DSPLog(const TCHAR* _szMessage, int _v)
|
void Callback_DSPLog(const TCHAR* _szMessage, int _v)
|
||||||
{
|
{
|
||||||
GENERIC_LOG(LogTypes::AUDIO, (LogTypes::LOG_LEVELS)_v, _szMessage);
|
GENERIC_LOG(LogTypes::AUDIO, (LogTypes::LOG_LEVELS)_v, _szMessage);
|
||||||
@ -760,7 +818,7 @@ void Callback_VideoCopiedToXFB(bool video_update)
|
|||||||
|
|
||||||
|
|
||||||
// Callback_DSPInterrupt
|
// Callback_DSPInterrupt
|
||||||
// WARNING - THIS MAY EXECUTED FROM DSP THREAD
|
// WARNING - THIS MAY BE EXECUTED FROM DSP THREAD
|
||||||
void Callback_DSPInterrupt()
|
void Callback_DSPInterrupt()
|
||||||
{
|
{
|
||||||
DSP::GenerateDSPInterruptFromPlugin(DSP::INT_DSP);
|
DSP::GenerateDSPInterruptFromPlugin(DSP::INT_DSP);
|
||||||
@ -831,4 +889,4 @@ const SCoreStartupParameter& GetStartupParameter() {
|
|||||||
return SConfig::GetInstance().m_LocalCoreStartupParameter;
|
return SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of namespace Core
|
} // Core
|
||||||
|
@ -38,12 +38,15 @@ namespace Core
|
|||||||
CORE_UNINITIALIZED,
|
CORE_UNINITIALIZED,
|
||||||
CORE_PAUSE,
|
CORE_PAUSE,
|
||||||
CORE_RUN,
|
CORE_RUN,
|
||||||
|
CORE_STOPPING
|
||||||
};
|
};
|
||||||
|
|
||||||
// Init core
|
// Init core
|
||||||
bool Init();
|
bool Init();
|
||||||
void Stop();
|
void Stop();
|
||||||
|
|
||||||
|
std::string StopMessage(bool, std::string);
|
||||||
|
|
||||||
bool isRunning();
|
bool isRunning();
|
||||||
|
|
||||||
void SetState(EState _State);
|
void SetState(EState _State);
|
||||||
|
@ -30,6 +30,9 @@
|
|||||||
|
|
||||||
void PPCDebugInterface::disasm(unsigned int address, char *dest, int max_size)
|
void PPCDebugInterface::disasm(unsigned int address, char *dest, int max_size)
|
||||||
{
|
{
|
||||||
|
// Memory::ReadUnchecked_U32 seemed to crash on shutdown
|
||||||
|
if (PowerPC::GetState() == PowerPC::CPU_POWERDOWN) return;
|
||||||
|
|
||||||
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
||||||
{
|
{
|
||||||
if (Memory::IsRAMAddress(address, true))
|
if (Memory::IsRAMAddress(address, true))
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
// The host can be just a command line app that opens a window, or a full blown debugger
|
// The host can be just a command line app that opens a window, or a full blown debugger
|
||||||
// interface.
|
// interface.
|
||||||
|
|
||||||
|
void Host_Message(int Id);
|
||||||
void Host_UpdateMainFrame();
|
void Host_UpdateMainFrame();
|
||||||
void Host_UpdateDisasmDialog();
|
void Host_UpdateDisasmDialog();
|
||||||
void Host_UpdateLogDisplay();
|
void Host_UpdateLogDisplay();
|
||||||
|
@ -36,10 +36,12 @@
|
|||||||
#include "ConfigManager.h"
|
#include "ConfigManager.h"
|
||||||
#include "LogManager.h"
|
#include "LogManager.h"
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
|
#include "Host.h"
|
||||||
|
|
||||||
#include "FileSearch.h" // Common
|
#include "FileSearch.h" // Common
|
||||||
#include "FileUtil.h"
|
#include "FileUtil.h"
|
||||||
#include "StringUtil.h"
|
#include "StringUtil.h"
|
||||||
|
#include "MemoryUtil.h"
|
||||||
#include "Setup.h"
|
#include "Setup.h"
|
||||||
|
|
||||||
// Create the plugin manager class
|
// Create the plugin manager class
|
||||||
@ -182,9 +184,8 @@ void CPluginManager::ShutdownPlugins()
|
|||||||
if (m_dsp)
|
if (m_dsp)
|
||||||
{
|
{
|
||||||
m_dsp->Shutdown();
|
m_dsp->Shutdown();
|
||||||
// With this option, this is done on boot instead
|
FreeDSP();
|
||||||
delete m_dsp;
|
NOTICE_LOG(CONSOLE, "%s", Core::StopMessage(false, "Audio shutdown").c_str());
|
||||||
m_dsp = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,9 +194,8 @@ void CPluginManager::ShutdownVideoPlugin()
|
|||||||
if (m_video)
|
if (m_video)
|
||||||
{
|
{
|
||||||
m_video->Shutdown();
|
m_video->Shutdown();
|
||||||
// With this option, this is done on boot instead
|
FreeVideo();
|
||||||
delete m_video;
|
NOTICE_LOG(CONSOLE, "%s", Core::StopMessage(false, "Video shutdown").c_str());
|
||||||
m_video = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -443,12 +443,16 @@ Common::PluginVideo *CPluginManager::GetVideo()
|
|||||||
// the plugins in turn
|
// the plugins in turn
|
||||||
void CPluginManager::FreeVideo()
|
void CPluginManager::FreeVideo()
|
||||||
{
|
{
|
||||||
|
//Host_Message(VIDEO_DESTROY);
|
||||||
|
WARN_LOG(CONSOLE, "%s", Core::StopMessage(false, "Will unload video DLL").c_str());
|
||||||
delete m_video;
|
delete m_video;
|
||||||
m_video = NULL;
|
m_video = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPluginManager::FreeDSP()
|
void CPluginManager::FreeDSP()
|
||||||
{
|
{
|
||||||
|
//Host_Message(AUDIO_DESTROY);
|
||||||
|
WARN_LOG(CONSOLE, "%s", Core::StopMessage(false, "Will unload audio DLL").c_str());
|
||||||
delete m_dsp;
|
delete m_dsp;
|
||||||
m_dsp = NULL;
|
m_dsp = NULL;
|
||||||
}
|
}
|
||||||
|
@ -460,6 +460,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
|
|||||||
dc.SetTextForeground(_T("#000000"));
|
dc.SetTextForeground(_T("#000000"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If running
|
||||||
if (debugger->isAlive())
|
if (debugger->isAlive())
|
||||||
{
|
{
|
||||||
char dis[256];
|
char dis[256];
|
||||||
|
@ -123,8 +123,8 @@ EVT_MENU(IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu)
|
|||||||
|
|
||||||
// Menu tooltips
|
// Menu tooltips
|
||||||
//EVT_MENU_HIGHLIGHT_ALL( CCodeWindow::OnStatusBar)
|
//EVT_MENU_HIGHLIGHT_ALL( CCodeWindow::OnStatusBar)
|
||||||
/* Do this to to avoid that the ToolTips get stuck when only the wxMenu is changed
|
// Do this to to avoid that the ToolTips get stuck when only the wxMenu is changed
|
||||||
and not any wxMenuItem that is required by EVT_MENU_HIGHLIGHT_ALL */
|
// and not any wxMenuItem that is required by EVT_MENU_HIGHLIGHT_ALL
|
||||||
//EVT_UPDATE_UI(wxID_ANY, CCodeWindow::OnStatusBar_)
|
//EVT_UPDATE_UI(wxID_ANY, CCodeWindow::OnStatusBar_)
|
||||||
|
|
||||||
// Toolbar
|
// Toolbar
|
||||||
@ -136,25 +136,25 @@ EVT_MENU(IDM_SETPC, CCodeWindow::OnCodeStep)
|
|||||||
EVT_MENU(IDM_GOTOPC, CCodeWindow::OnCodeStep)
|
EVT_MENU(IDM_GOTOPC, CCodeWindow::OnCodeStep)
|
||||||
EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange)
|
EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange)
|
||||||
|
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange)
|
EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange)
|
||||||
EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange)
|
EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange)
|
||||||
EVT_LISTBOX(ID_CALLERSLIST, CCodeWindow::OnCallersListChange)
|
EVT_LISTBOX(ID_CALLERSLIST, CCodeWindow::OnCallersListChange)
|
||||||
EVT_LISTBOX(ID_CALLSLIST, CCodeWindow::OnCallsListChange)
|
EVT_LISTBOX(ID_CALLSLIST, CCodeWindow::OnCallsListChange)
|
||||||
|
|
||||||
EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage)
|
//EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage)
|
||||||
|
|
||||||
EVT_COMMAND(ID_CODEVIEW, wxEVT_CODEVIEW_CHANGE, CCodeWindow::OnCodeViewChange)
|
//EVT_COMMAND(ID_CODEVIEW, wxEVT_CODEVIEW_CHANGE, CCodeWindow::OnCodeViewChange)
|
||||||
|
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
// Class
|
// Class
|
||||||
CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, CFrame *ParentObject, wxWindow* parent,
|
CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, CFrame *parent,
|
||||||
wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name)
|
wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name)
|
||||||
: wxPanel(parent, id, position, size, style, name)
|
: wxPanel((wxWindow*)parent, id, position, size, style, name)
|
||||||
, Parent(ParentObject)
|
, Parent(parent)
|
||||||
|
, codeview(NULL)
|
||||||
, m_RegisterWindow(NULL)
|
, m_RegisterWindow(NULL)
|
||||||
, m_BreakpointWindow(NULL)
|
, m_BreakpointWindow(NULL)
|
||||||
, m_MemoryWindow(NULL)
|
, m_MemoryWindow(NULL)
|
||||||
@ -163,10 +163,6 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter
|
|||||||
InitBitmaps();
|
InitBitmaps();
|
||||||
|
|
||||||
CreateGUIControls(_LocalCoreStartupParameter);
|
CreateGUIControls(_LocalCoreStartupParameter);
|
||||||
// Create the toolbar
|
|
||||||
//RecreateToolbar();
|
|
||||||
// Update bitmap buttons
|
|
||||||
//UpdateButtonStates();
|
|
||||||
|
|
||||||
// Connect keyboard
|
// Connect keyboard
|
||||||
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN,
|
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN,
|
||||||
@ -201,6 +197,8 @@ void CCodeWindow::OnKeyDown(wxKeyEvent& event)
|
|||||||
|
|
||||||
void CCodeWindow::OnHostMessage(wxCommandEvent& event)
|
void CCodeWindow::OnHostMessage(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
|
||||||
switch (event.GetId())
|
switch (event.GetId())
|
||||||
{
|
{
|
||||||
case IDM_NOTIFYMAPLOADED:
|
case IDM_NOTIFYMAPLOADED:
|
||||||
@ -295,7 +293,6 @@ void CCodeWindow::JumpToAddress(u32 _Address)
|
|||||||
|
|
||||||
void CCodeWindow::OnCodeViewChange(wxCommandEvent &event)
|
void CCodeWindow::OnCodeViewChange(wxCommandEvent &event)
|
||||||
{
|
{
|
||||||
//PanicAlert("boo");
|
|
||||||
UpdateLists();
|
UpdateLists();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,6 +388,10 @@ void CCodeWindow::UpdateLists()
|
|||||||
|
|
||||||
void CCodeWindow::UpdateCallstack()
|
void CCodeWindow::UpdateCallstack()
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
//if (PowerPC::GetState() == PowerPC::CPU_POWERDOWN) return;
|
||||||
|
//if (Core::GetState() == Core::CORE_STOPPING) return;
|
||||||
|
|
||||||
callstack->Clear();
|
callstack->Clear();
|
||||||
|
|
||||||
std::vector<Dolphin_Debugger::CallstackEntry> stack;
|
std::vector<Dolphin_Debugger::CallstackEntry> stack;
|
||||||
@ -410,9 +411,7 @@ void CCodeWindow::UpdateCallstack()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter)
|
void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter)
|
||||||
{
|
{
|
||||||
//CreateMenu(_LocalCoreStartupParameter);
|
|
||||||
|
|
||||||
// Configure the code window
|
// Configure the code window
|
||||||
wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL);
|
||||||
wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL);
|
||||||
@ -679,13 +678,17 @@ void CCodeWindow::PopulateToolbar(wxAuiToolBar* toolBar)
|
|||||||
|
|
||||||
void CCodeWindow::Update()
|
void CCodeWindow::Update()
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!codeview) return;
|
||||||
|
|
||||||
codeview->Refresh();
|
codeview->Refresh();
|
||||||
UpdateCallstack();
|
UpdateCallstack();
|
||||||
UpdateButtonStates();
|
UpdateButtonStates();
|
||||||
|
|
||||||
/* DO NOT Automatically show the current PC position when a breakpoint is hit or
|
/* DO NOT Automatically show the current PC position when a breakpoint is hit or
|
||||||
when we pause SINCE THIS CAN BE CALLED AT OTHER TIMES TOO */
|
when we pause SINCE THIS CAN BE CALLED AT OTHER TIMES TOO */
|
||||||
// codeview->Center(PC);
|
//codeview->Center(PC);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCodeWindow::UpdateButtonStates()
|
void CCodeWindow::UpdateButtonStates()
|
||||||
|
@ -44,8 +44,8 @@ class CCodeWindow
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, CFrame *,
|
CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter,
|
||||||
wxWindow* parent,
|
CFrame * parent,
|
||||||
wxWindowID id = wxID_ANY,
|
wxWindowID id = wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
|
@ -386,6 +386,8 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
|
|||||||
|
|
||||||
void CCodeWindow::NotifyMapLoaded()
|
void CCodeWindow::NotifyMapLoaded()
|
||||||
{
|
{
|
||||||
|
if (!codeview) return;
|
||||||
|
|
||||||
g_symbolDB.FillInCallers();
|
g_symbolDB.FillInCallers();
|
||||||
//symbols->Show(false); // hide it for faster filling
|
//symbols->Show(false); // hide it for faster filling
|
||||||
symbols->Freeze(); // HyperIris: wx style fast filling
|
symbols->Freeze(); // HyperIris: wx style fast filling
|
||||||
@ -455,6 +457,7 @@ void CCodeWindow::OpenPages()
|
|||||||
}
|
}
|
||||||
void CCodeWindow::OnToggleWindow(wxCommandEvent& event)
|
void CCodeWindow::OnToggleWindow(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
|
event.Skip();
|
||||||
Parent->DoToggleWindow(event.GetId(), GetMenuBar()->IsChecked(event.GetId()));
|
Parent->DoToggleWindow(event.GetId(), GetMenuBar()->IsChecked(event.GetId()));
|
||||||
}
|
}
|
||||||
void CCodeWindow::OnToggleCodeWindow(bool _Show, int i)
|
void CCodeWindow::OnToggleCodeWindow(bool _Show, int i)
|
||||||
@ -552,108 +555,137 @@ Notice: This windows docking for plugin windows will produce several wx debuggin
|
|||||||
//Toggle Sound Debugging Window
|
//Toggle Sound Debugging Window
|
||||||
void CCodeWindow::OnToggleSoundWindow(bool _Show, int i)
|
void CCodeWindow::OnToggleSoundWindow(bool _Show, int i)
|
||||||
{
|
{
|
||||||
// ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener();
|
#ifdef _WIN32
|
||||||
|
// ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener();
|
||||||
|
|
||||||
if (_Show)
|
if (_Show)
|
||||||
{
|
{
|
||||||
if (Parent->GetNotebookCount() == 0) return;
|
if (Parent->GetNotebookCount() == 0) return;
|
||||||
if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0;
|
if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0;
|
||||||
#ifdef _WIN32
|
|
||||||
wxWindow *Win = Parent->GetWxWindow(wxT("Sound"));
|
wxWindow *Win = Parent->GetWxWindow(wxT("Sound"));
|
||||||
if (Win && Parent->GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) return;
|
if (Win && Parent->GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) return;
|
||||||
|
|
||||||
{
|
CPluginManager::GetInstance().OpenDebug(
|
||||||
#endif
|
Parent->GetHandle(),
|
||||||
//Console->Log(LogTypes::LNOTICE, StringFromFormat("OpenDebug\n").c_str());
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
||||||
CPluginManager::GetInstance().OpenDebug(
|
PLUGIN_TYPE_DSP, true // DSP, show
|
||||||
Parent->GetHandle(),
|
);
|
||||||
//GetHandle(),
|
|
||||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
|
||||||
PLUGIN_TYPE_DSP, true // DSP, show
|
|
||||||
);
|
|
||||||
#ifdef _WIN32
|
|
||||||
}
|
|
||||||
|
|
||||||
Win = Parent->GetWxWindow(wxT("Sound"));
|
Win = Parent->GetWxWindow(wxT("Sound"));
|
||||||
if (Win)
|
if (Win)
|
||||||
{
|
{
|
||||||
Win->SetName(wxT("Sound"));
|
Win->SetName(wxT("Sound"));
|
||||||
Win->Reparent(Parent);
|
Win->Reparent(Parent);
|
||||||
Parent->GetNotebookFromId(i)->AddPage(Win, wxT("Sound"), true, Parent->aNormalFile );
|
Win->SetId(IDM_SOUNDWINDOW);
|
||||||
//Console->Log(LogTypes::LNOTICE, StringFromFormat("AddPage\n").c_str());
|
Parent->GetNotebookFromId(i)->AddPage(Win, wxT("Sound"), true, Parent->aNormalFile);
|
||||||
//Parent->ListChildren();
|
|
||||||
//Console->Log(LogTypes::LNOTICE, StringFromFormat("OpenDebug: Win %i\n", FindWindowByName(wxT("Sound"))).c_str());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Console->Log(LogTypes::LNOTICE, StringFromFormat("OpenDebug: Win not found\n").c_str());
|
//Console->Log(LogTypes::LNOTICE, StringFromFormat("OpenDebug: Win not found\n").c_str());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else // hide
|
else
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
|
||||||
wxWindow *Win = Parent->GetWxWindow(wxT("Sound"));
|
wxWindow *Win = Parent->GetWxWindow(wxT("Sound"));
|
||||||
if (Win)
|
if (Win)
|
||||||
{
|
{
|
||||||
Parent->DoRemovePage(Win, false);
|
Parent->DoRemovePage(Win, false);
|
||||||
//Console->Log(LogTypes::LNOTICE, StringFromFormat("Sound removed from NB (Win %i)\n", FindWindowByName(wxT("Sound"))).c_str());
|
//Win->Reparent(NULL);
|
||||||
|
|
||||||
|
// Destroy
|
||||||
|
CPluginManager::GetInstance().OpenDebug(
|
||||||
|
GetHandle(),
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
||||||
|
PLUGIN_TYPE_DSP, false
|
||||||
|
);
|
||||||
|
|
||||||
|
//WARN_LOG(CONSOLE, "Sound removed from NB");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Console->Log(LogTypes::LNOTICE, StringFromFormat("Sound not found (Win %i)\n", FindWindowByName(wxT("Sound"))).c_str());
|
//WARN_LOG(CONSOLE, "Sound not found (Win %i)", FindWindowByName(wxT("Sound")));
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
// Close the sound dll that has an open debugger
|
|
||||||
|
#else
|
||||||
|
if (_Show)
|
||||||
|
{
|
||||||
|
CPluginManager::GetInstance().OpenDebug(
|
||||||
|
Parent->GetHandle(),
|
||||||
|
//GetHandle(),
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
||||||
|
PLUGIN_TYPE_DSP, true // DSP, show
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
CPluginManager::GetInstance().OpenDebug(
|
CPluginManager::GetInstance().OpenDebug(
|
||||||
GetHandle(),
|
GetHandle(),
|
||||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
||||||
PLUGIN_TYPE_DSP, false // DSP, hide
|
PLUGIN_TYPE_DSP, false // DSP, hide
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toggle Video Debugging Window
|
// Toggle Video Debugging Window
|
||||||
void CCodeWindow::OnToggleVideoWindow(bool _Show, int i)
|
void CCodeWindow::OnToggleVideoWindow(bool _Show, int i)
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
//GetMenuBar()->Check(event.GetId(), false); // Turn off
|
//GetMenuBar()->Check(event.GetId(), false); // Turn off
|
||||||
|
|
||||||
if (_Show)
|
if (_Show)
|
||||||
{
|
{
|
||||||
if (Parent->GetNotebookCount() == 0) return;
|
if (Parent->GetNotebookCount() == 0) return;
|
||||||
if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0;
|
if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0;
|
||||||
#ifdef _WIN32
|
|
||||||
wxWindow *Win = Parent->GetWxWindow(wxT("Video"));
|
wxWindow *Win = Parent->GetWxWindow(wxT("Video"));
|
||||||
|
Win->SetId(IDM_VIDEOWINDOW);
|
||||||
if (Win && Parent->GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) return;
|
if (Win && Parent->GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) return;
|
||||||
|
|
||||||
{
|
// Show and/or create the window
|
||||||
#endif
|
CPluginManager::GetInstance().OpenDebug(
|
||||||
// Show and/or create the window
|
Parent->GetHandle(),
|
||||||
CPluginManager::GetInstance().OpenDebug(
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
||||||
Parent->GetHandle(),
|
PLUGIN_TYPE_VIDEO, true // Video, show
|
||||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
);
|
||||||
PLUGIN_TYPE_VIDEO, true // Video, show
|
|
||||||
);
|
|
||||||
#ifdef _WIN32
|
|
||||||
}
|
|
||||||
|
|
||||||
Win = Parent->GetWxWindow(wxT("Video"));
|
Win = Parent->GetWxWindow(wxT("Video"));
|
||||||
if (Win) Parent->GetNotebookFromId(i)->AddPage(Win, wxT("Video"), true, Parent->aNormalFile );
|
if (Win) Parent->GetNotebookFromId(i)->AddPage(Win, wxT("Video"), true, Parent->aNormalFile );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else // hide
|
else // hide
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
|
||||||
wxWindow *Win = Parent->GetWxWindow(wxT("Video"));
|
wxWindow *Win = Parent->GetWxWindow(wxT("Video"));
|
||||||
Parent->DoRemovePage (Win, false);
|
if (Win)
|
||||||
#endif
|
{
|
||||||
// Close the video dll that has an open debugger
|
Parent->DoRemovePage (Win, false);
|
||||||
CPluginManager::GetInstance().OpenDebug(
|
Win->Reparent(NULL);
|
||||||
GetHandle(),
|
CPluginManager::GetInstance().OpenDebug(
|
||||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
GetHandle(),
|
||||||
PLUGIN_TYPE_VIDEO, false // Video, hide
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
||||||
);
|
PLUGIN_TYPE_VIDEO, false // Video, hide
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (_Show)
|
||||||
|
{
|
||||||
|
CPluginManager::GetInstance().OpenDebug(
|
||||||
|
Parent->GetHandle(),
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
||||||
|
PLUGIN_TYPE_VIDEO, true // Video, show
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CPluginManager::GetInstance().OpenDebug(
|
||||||
|
GetHandle(),
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
||||||
|
PLUGIN_TYPE_VIDEO, false // Video, hide
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ int abc = 0;
|
|||||||
// Stop
|
// Stop
|
||||||
case OPENGL_WM_USER_STOP:
|
case OPENGL_WM_USER_STOP:
|
||||||
main_frame->DoStop();
|
main_frame->DoStop();
|
||||||
return 0; // Don't bother letting wxWidgets process this at all
|
return 0;
|
||||||
|
|
||||||
case OPENGL_WM_USER_CREATE:
|
case OPENGL_WM_USER_CREATE:
|
||||||
// We don't have a local setting for bRenderToMain but we can detect it this way instead
|
// We don't have a local setting for bRenderToMain but we can detect it this way instead
|
||||||
@ -349,10 +349,10 @@ CFrame::CFrame(wxFrame* parent,
|
|||||||
// Debugger class
|
// Debugger class
|
||||||
if (UseDebugger)
|
if (UseDebugger)
|
||||||
{
|
{
|
||||||
g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, this, this, IDM_CODEWINDOW);
|
g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, this, IDM_CODEWINDOW);
|
||||||
g_pCodeWindow->Hide();
|
g_pCodeWindow->Hide();
|
||||||
g_pCodeWindow->Load();
|
g_pCodeWindow->Load();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create timer
|
// Create timer
|
||||||
#if wxUSE_TIMER
|
#if wxUSE_TIMER
|
||||||
@ -396,7 +396,7 @@ CFrame::CFrame(wxFrame* parent,
|
|||||||
TOOLBAR_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT | wxAUI_TB_OVERFLOW /*overflow visible*/;
|
TOOLBAR_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT | wxAUI_TB_OVERFLOW /*overflow visible*/;
|
||||||
wxBitmap aNormalFile = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
|
wxBitmap aNormalFile = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
|
||||||
|
|
||||||
if (UseDebugger)
|
if (g_pCodeWindow)
|
||||||
{
|
{
|
||||||
m_Mgr->AddPane(m_Panel, wxAuiPaneInfo().Name(wxT("Pane 0")).Caption(wxT("Pane 0")).Show());
|
m_Mgr->AddPane(m_Panel, wxAuiPaneInfo().Name(wxT("Pane 0")).Caption(wxT("Pane 0")).Show());
|
||||||
}
|
}
|
||||||
@ -407,7 +407,7 @@ CFrame::CFrame(wxFrame* parent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setup perspectives
|
// Setup perspectives
|
||||||
if (UseDebugger)
|
if (g_pCodeWindow)
|
||||||
{
|
{
|
||||||
m_Mgr->GetPane(wxT("Pane 0")).CenterPane().PaneBorder(false);
|
m_Mgr->GetPane(wxT("Pane 0")).CenterPane().PaneBorder(false);
|
||||||
AuiFullscreen = m_Mgr->SavePerspective();
|
AuiFullscreen = m_Mgr->SavePerspective();
|
||||||
@ -427,7 +427,7 @@ CFrame::CFrame(wxFrame* parent,
|
|||||||
CPluginManager::GetInstance().ScanForPlugins();
|
CPluginManager::GetInstance().ScanForPlugins();
|
||||||
|
|
||||||
// Setup perspectives
|
// Setup perspectives
|
||||||
if (UseDebugger)
|
if (g_pCodeWindow)
|
||||||
{
|
{
|
||||||
// Load perspective
|
// Load perspective
|
||||||
SaveLocal();
|
SaveLocal();
|
||||||
@ -441,7 +441,7 @@ CFrame::CFrame(wxFrame* parent,
|
|||||||
// Show window
|
// Show window
|
||||||
Show();
|
Show();
|
||||||
|
|
||||||
if (!UseDebugger)
|
if (!g_pCodeWindow)
|
||||||
{
|
{
|
||||||
SetSimplePaneSize();
|
SetSimplePaneSize();
|
||||||
if (SConfig::GetInstance().m_InterfaceLogWindow) DoToggleWindow(IDM_LOGWINDOW, true);
|
if (SConfig::GetInstance().m_InterfaceLogWindow) DoToggleWindow(IDM_LOGWINDOW, true);
|
||||||
@ -461,6 +461,10 @@ CFrame::CFrame(wxFrame* parent,
|
|||||||
// -------------------------
|
// -------------------------
|
||||||
// Connect event handlers
|
// Connect event handlers
|
||||||
|
|
||||||
|
wxTheApp->Connect(wxID_ANY, wxEVT_SIZE, // Keyboard
|
||||||
|
wxSizeEventHandler(CFrame::OnResizeAll),
|
||||||
|
(wxObject*)0, this);
|
||||||
|
|
||||||
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard
|
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard
|
||||||
wxKeyEventHandler(CFrame::OnKeyDown),
|
wxKeyEventHandler(CFrame::OnKeyDown),
|
||||||
(wxObject*)0, this);
|
(wxObject*)0, this);
|
||||||
@ -524,7 +528,7 @@ void CFrame::OnRestart(wxCommandEvent& WXUNUSED (event))
|
|||||||
char Str[MAX_PATH + 1];
|
char Str[MAX_PATH + 1];
|
||||||
DWORD Size = sizeof(Str)/sizeof(char);
|
DWORD Size = sizeof(Str)/sizeof(char);
|
||||||
DWORD n = GetModuleFileNameA(NULL, Str, Size);
|
DWORD n = GetModuleFileNameA(NULL, Str, Size);
|
||||||
ShellExecuteA(NULL, "open", PathToFilename(*new std::string(Str)).c_str(), UseDebugger ? "" : "-d", NULL, SW_SHOW);
|
ShellExecuteA(NULL, "open", PathToFilename(*new std::string(Str)).c_str(), g_pCodeWindow ? "" : "-d", NULL, SW_SHOW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Close(true);
|
Close(true);
|
||||||
@ -538,8 +542,8 @@ void CFrame::OnClose(wxCloseEvent& event)
|
|||||||
// Don't forget the skip or the window won't be destroyed
|
// Don't forget the skip or the window won't be destroyed
|
||||||
event.Skip();
|
event.Skip();
|
||||||
// Save GUI settings
|
// Save GUI settings
|
||||||
if (UseDebugger) g_pCodeWindow->Save();
|
if (g_pCodeWindow) g_pCodeWindow->Save();
|
||||||
if (UseDebugger) Save();
|
if (g_pCodeWindow) Save();
|
||||||
// Uninit
|
// Uninit
|
||||||
m_Mgr->UnInit();
|
m_Mgr->UnInit();
|
||||||
|
|
||||||
@ -575,6 +579,18 @@ void CFrame::PostUpdateUIEvent(wxUpdateUIEvent& event)
|
|||||||
if (g_pCodeWindow) wxPostEvent(g_pCodeWindow, event);
|
if (g_pCodeWindow) wxPostEvent(g_pCodeWindow, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CFrame::OnResize(wxSizeEvent& event)
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
|
||||||
|
DoMoveIcons(); // In FrameWiimote.cpp
|
||||||
|
}
|
||||||
|
void CFrame::OnResizeAll(wxSizeEvent& event)
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
//wxWindow * Win = (wxWindow*)event.GetEventObject();
|
||||||
|
//NOTICE_LOG(CONSOLE, "OnResizeAll: %i", (HWND)Win->GetHWND());
|
||||||
|
}
|
||||||
|
|
||||||
// Host messages
|
// Host messages
|
||||||
|
|
||||||
@ -590,10 +606,8 @@ WXLRESULT CFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
case SC_MONITORPOWER:
|
case SC_MONITORPOWER:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
// Let wxWidgets process it as normal
|
|
||||||
return wxFrame::MSWWindowProc(nMsg, wParam, lParam);
|
|
||||||
}
|
}
|
||||||
|
return wxFrame::MSWWindowProc(nMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -614,6 +628,37 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CFrame::OnCustomHostMessage(int Id)
|
||||||
|
{
|
||||||
|
wxWindow *Win;
|
||||||
|
|
||||||
|
switch(Id)
|
||||||
|
{
|
||||||
|
// Destroy windows
|
||||||
|
case AUDIO_DESTROY:
|
||||||
|
Win = GetWxWindow(wxT("Sound"));
|
||||||
|
if (Win)
|
||||||
|
{
|
||||||
|
DoRemovePage(Win, false);
|
||||||
|
|
||||||
|
CPluginManager::GetInstance().OpenDebug(
|
||||||
|
GetHandle(),
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
||||||
|
PLUGIN_TYPE_DSP, false
|
||||||
|
);
|
||||||
|
|
||||||
|
//Win->Reparent(NULL);
|
||||||
|
//g_pCodeWindow->OnToggleSoundWindow(false, 0);
|
||||||
|
GetMenuBar()->FindItem(IDM_SOUNDWINDOW)->Check(false);
|
||||||
|
NOTICE_LOG(CONSOLE, "%s", Core::StopMessage(true, "Sound debugging window closed").c_str());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VIDEO_DESTROY:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
|
void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
|
||||||
{
|
{
|
||||||
// Show all platforms and regions if...
|
// Show all platforms and regions if...
|
||||||
@ -790,9 +835,7 @@ void CFrame::Update()
|
|||||||
|
|
||||||
wxFrame * CFrame::CreateParentFrame(wxWindowID Id, const wxString& Title, wxWindow * Child)
|
wxFrame * CFrame::CreateParentFrame(wxWindowID Id, const wxString& Title, wxWindow * Child)
|
||||||
{
|
{
|
||||||
//NOTICE_LOG(CONSOLE, "CreateParentFrame: %i %s %i", Id, Title.mb_str(), Child->GetId())
|
wxFrame * Frame = new wxFrame(this, Id, Title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE);
|
||||||
|
|
||||||
wxFrame * Frame = new wxFrame(this, Id, Title);
|
|
||||||
|
|
||||||
Child->Reparent(Frame);
|
Child->Reparent(Frame);
|
||||||
Child->Show();
|
Child->Show();
|
||||||
@ -921,4 +964,26 @@ void CFrame::ListChildren()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Console->Log(LogTypes::LNOTICE, "--------------------------------------------------------------------\n");
|
Console->Log(LogTypes::LNOTICE, "--------------------------------------------------------------------\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void CFrame::ListTopWindows()
|
||||||
|
{
|
||||||
|
wxWindowList::const_iterator i;
|
||||||
|
int j = 0;
|
||||||
|
const wxWindowList::const_iterator end = wxTopLevelWindows.end();
|
||||||
|
|
||||||
|
for (i = wxTopLevelWindows.begin(); i != end; ++i)
|
||||||
|
{
|
||||||
|
wxTopLevelWindow * const Win = wx_static_cast(wxTopLevelWindow *, *i);
|
||||||
|
NOTICE_LOG(CONSOLE, "%i: %i %s", j, Win, Win->GetTitle().mb_str());
|
||||||
|
/*
|
||||||
|
if ( win->ShouldPreventAppExit() )
|
||||||
|
{
|
||||||
|
// there remains at least one important TLW, don't exit
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
NOTICE_LOG(CONSOLE, "\n");
|
||||||
}
|
}
|
@ -81,6 +81,7 @@ class CFrame : public wxFrame
|
|||||||
void PostUpdateUIEvent(wxUpdateUIEvent& event);
|
void PostUpdateUIEvent(wxUpdateUIEvent& event);
|
||||||
void StatusBarMessage(char * Text, ...);
|
void StatusBarMessage(char * Text, ...);
|
||||||
void ClearStatusBar();
|
void ClearStatusBar();
|
||||||
|
void OnCustomHostMessage(int Id);
|
||||||
|
|
||||||
// ---------------------------------------
|
// ---------------------------------------
|
||||||
// Wiimote leds
|
// Wiimote leds
|
||||||
@ -122,6 +123,8 @@ class CFrame : public wxFrame
|
|||||||
int Limit(int,int,int);
|
int Limit(int,int,int);
|
||||||
int PercentageToPixels(int,int);
|
int PercentageToPixels(int,int);
|
||||||
int PixelsToPercentage(int,int);
|
int PixelsToPercentage(int,int);
|
||||||
|
void ListChildren();
|
||||||
|
void ListTopWindows();
|
||||||
|
|
||||||
// Perspectives
|
// Perspectives
|
||||||
void AddRemoveBlankPage();
|
void AddRemoveBlankPage();
|
||||||
@ -131,7 +134,6 @@ class CFrame : public wxFrame
|
|||||||
void OnFloatWindow(wxCommandEvent& event);
|
void OnFloatWindow(wxCommandEvent& event);
|
||||||
void OnTab(wxAuiNotebookEvent& event);
|
void OnTab(wxAuiNotebookEvent& event);
|
||||||
int GetNootebookAffiliation(wxString Name);
|
int GetNootebookAffiliation(wxString Name);
|
||||||
void ListChildren();
|
|
||||||
void ClosePages();
|
void ClosePages();
|
||||||
void DoToggleWindow(int,bool);
|
void DoToggleWindow(int,bool);
|
||||||
void ShowAllNotebooks(bool Window = false);
|
void ShowAllNotebooks(bool Window = false);
|
||||||
@ -285,6 +287,7 @@ class CFrame : public wxFrame
|
|||||||
void OnToggleThrottle(wxCommandEvent& event);
|
void OnToggleThrottle(wxCommandEvent& event);
|
||||||
void OnManagerResize(wxAuiManagerEvent& event);
|
void OnManagerResize(wxAuiManagerEvent& event);
|
||||||
void OnResize(wxSizeEvent& event);
|
void OnResize(wxSizeEvent& event);
|
||||||
|
void OnResizeAll(wxSizeEvent& event);
|
||||||
void OnToggleToolbar(wxCommandEvent& event);
|
void OnToggleToolbar(wxCommandEvent& event);
|
||||||
void DoToggleToolbar(bool);
|
void DoToggleToolbar(bool);
|
||||||
void OnToggleStatusbar(wxCommandEvent& event);
|
void OnToggleStatusbar(wxCommandEvent& event);
|
||||||
|
@ -64,13 +64,6 @@ void CFrame::OnManagerResize(wxAuiManagerEvent& event)
|
|||||||
event.Skip();
|
event.Skip();
|
||||||
ResizeConsole();
|
ResizeConsole();
|
||||||
}
|
}
|
||||||
void CFrame::OnResize(wxSizeEvent& event)
|
|
||||||
{
|
|
||||||
event.Skip();
|
|
||||||
// fit frame content, not needed right now
|
|
||||||
//FitInside();
|
|
||||||
DoMoveIcons(); // In FrameWiimote.cpp
|
|
||||||
}
|
|
||||||
|
|
||||||
void CFrame::OnPaneClose(wxAuiManagerEvent& event)
|
void CFrame::OnPaneClose(wxAuiManagerEvent& event)
|
||||||
{
|
{
|
||||||
@ -127,7 +120,7 @@ void CFrame::ToggleLogWindow(bool bShow, int i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hide pane
|
// Hide pane
|
||||||
if (!UseDebugger) HidePane();
|
if (!g_pCodeWindow) HidePane();
|
||||||
|
|
||||||
// Make sure the check is updated (if wxw isn't calling this func)
|
// Make sure the check is updated (if wxw isn't calling this func)
|
||||||
//GetMenuBar()->FindItem(IDM_LOGWINDOW)->Check(Show);
|
//GetMenuBar()->FindItem(IDM_LOGWINDOW)->Check(Show);
|
||||||
@ -181,7 +174,7 @@ void CFrame::ToggleConsole(bool bShow, int i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hide pane
|
// Hide pane
|
||||||
if (!UseDebugger) HidePane();
|
if (!g_pCodeWindow) HidePane();
|
||||||
|
|
||||||
// Make sure the check is updated (if wxw isn't calling this func)
|
// Make sure the check is updated (if wxw isn't calling this func)
|
||||||
//GetMenuBar()->FindItem(IDM_CONSOLEWINDOW)->Check(Show);
|
//GetMenuBar()->FindItem(IDM_CONSOLEWINDOW)->Check(Show);
|
||||||
@ -209,11 +202,11 @@ void CFrame::DoToggleWindow(int Id, bool bShow)
|
|||||||
{
|
{
|
||||||
switch (Id)
|
switch (Id)
|
||||||
{
|
{
|
||||||
case IDM_LOGWINDOW: ToggleLogWindow(bShow, UseDebugger ? g_pCodeWindow->iLogWindow : 0); break;
|
case IDM_LOGWINDOW: ToggleLogWindow(bShow, g_pCodeWindow ? g_pCodeWindow->iLogWindow : 0); break;
|
||||||
case IDM_CONSOLEWINDOW: ToggleConsole(bShow, UseDebugger ? g_pCodeWindow->iConsoleWindow : 0); break;
|
case IDM_CONSOLEWINDOW: ToggleConsole(bShow, g_pCodeWindow ? g_pCodeWindow->iConsoleWindow : 0); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!UseDebugger) return;
|
if (!g_pCodeWindow) return;
|
||||||
|
|
||||||
switch (Id)
|
switch (Id)
|
||||||
{
|
{
|
||||||
@ -229,7 +222,7 @@ void CFrame::DoToggleWindow(int Id, bool bShow)
|
|||||||
void CFrame::OnNotebookPageChanged(wxAuiNotebookEvent& event)
|
void CFrame::OnNotebookPageChanged(wxAuiNotebookEvent& event)
|
||||||
{
|
{
|
||||||
event.Skip();
|
event.Skip();
|
||||||
if (!UseDebugger) return;
|
if (!g_pCodeWindow) return;
|
||||||
|
|
||||||
// Remove the blank page if any
|
// Remove the blank page if any
|
||||||
AddRemoveBlankPage();
|
AddRemoveBlankPage();
|
||||||
@ -270,11 +263,11 @@ void CFrame::OnFloatWindow(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
switch(event.GetId())
|
switch(event.GetId())
|
||||||
{
|
{
|
||||||
case IDM_FLOAT_LOGWINDOW: if (FindWindowById(IDM_LOGWINDOW)) DoUnfloatPage(IDM_LOGWINDOW); break;
|
case IDM_FLOAT_LOGWINDOW: if (FindWindowById(IDM_LOGWINDOW)) DoUnfloatPage(IDM_LOGWINDOW_PARENT); break;
|
||||||
case IDM_FLOAT_CONSOLEWINDOW: if (FindWindowById(IDM_CONSOLEWINDOW)) DoUnfloatPage(IDM_CONSOLEWINDOW); break;
|
case IDM_FLOAT_CONSOLEWINDOW: if (FindWindowById(IDM_CONSOLEWINDOW)) DoUnfloatPage(IDM_CONSOLEWINDOW_PARENT); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!UseDebugger) return;
|
if (!g_pCodeWindow) return;
|
||||||
|
|
||||||
switch(event.GetId())
|
switch(event.GetId())
|
||||||
{
|
{
|
||||||
@ -286,17 +279,17 @@ void CFrame::OnFloatWindow(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
switch(event.GetId())
|
switch(event.GetId())
|
||||||
{
|
{
|
||||||
case IDM_FLOAT_CODEWINDOW: if (FindWindowById(IDM_CODEWINDOW)) DoUnfloatPage(IDM_LOGWINDOW); break;
|
case IDM_FLOAT_CODEWINDOW: if (FindWindowById(IDM_CODEWINDOW)) DoUnfloatPage(IDM_LOGWINDOW_PARENT); break;
|
||||||
case IDM_FLOAT_REGISTERWINDOW: if (FindWindowById(IDM_REGISTERWINDOW)) DoUnfloatPage(IDM_REGISTERWINDOW); break;
|
case IDM_FLOAT_REGISTERWINDOW: if (FindWindowById(IDM_REGISTERWINDOW)) DoUnfloatPage(IDM_REGISTERWINDOW_PARENT); break;
|
||||||
case IDM_FLOAT_BREAKPOINTWINDOW: if (FindWindowById(IDM_BREAKPOINTWINDOW)) DoUnfloatPage(IDM_BREAKPOINTWINDOW); break;
|
case IDM_FLOAT_BREAKPOINTWINDOW: if (FindWindowById(IDM_BREAKPOINTWINDOW)) DoUnfloatPage(IDM_BREAKPOINTWINDOW_PARENT); break;
|
||||||
case IDM_FLOAT_MEMORYWINDOW: if (FindWindowById(IDM_MEMORYWINDOW)) DoUnfloatPage(IDM_MEMORYWINDOW); break;
|
case IDM_FLOAT_MEMORYWINDOW: if (FindWindowById(IDM_MEMORYWINDOW)) DoUnfloatPage(IDM_MEMORYWINDOW_PARENT); break;
|
||||||
case IDM_FLOAT_JITWINDOW: if (FindWindowById(IDM_JITWINDOW)) DoUnfloatPage(IDM_JITWINDOW); break;
|
case IDM_FLOAT_JITWINDOW: if (FindWindowById(IDM_JITWINDOW)) DoUnfloatPage(IDM_JITWINDOW_PARENT); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void CFrame::OnTab(wxAuiNotebookEvent& event)
|
void CFrame::OnTab(wxAuiNotebookEvent& event)
|
||||||
{
|
{
|
||||||
event.Skip();
|
event.Skip();
|
||||||
if (!UseDebugger) return;
|
if (!g_pCodeWindow) return;
|
||||||
|
|
||||||
// Create the popup menu
|
// Create the popup menu
|
||||||
wxMenu MenuPopup;
|
wxMenu MenuPopup;
|
||||||
@ -416,11 +409,12 @@ void CFrame::DoRemovePage(wxWindow * Win, bool _Hide)
|
|||||||
//wxASSERT(Win != NULL);
|
//wxASSERT(Win != NULL);
|
||||||
if (!Win) return;
|
if (!Win) return;
|
||||||
|
|
||||||
if (FindWindowById(WindowParentIdFromChildId(Win->GetId())))
|
if (Win->GetId() > 0 && FindWindowById(WindowParentIdFromChildId(Win->GetId())))
|
||||||
{
|
{
|
||||||
Win->Reparent(this);
|
Win->Reparent(this);
|
||||||
Win->Hide();
|
Win->Hide();
|
||||||
FindWindowById(WindowParentIdFromChildId(Win->GetId()))->Destroy();
|
FindWindowById(WindowParentIdFromChildId(Win->GetId()))->Destroy();
|
||||||
|
WARN_LOG(CONSOLE, "Floating window %i closed", Win->GetId());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -916,10 +910,10 @@ void CFrame::ReloadPanes()
|
|||||||
// Restore settings
|
// Restore settings
|
||||||
SConfig::GetInstance().m_InterfaceConsole = bConsole;
|
SConfig::GetInstance().m_InterfaceConsole = bConsole;
|
||||||
// Load GUI settings
|
// Load GUI settings
|
||||||
g_pCodeWindow->Load();
|
if (g_pCodeWindow) g_pCodeWindow->Load();
|
||||||
// Open notebook pages
|
// Open notebook pages
|
||||||
AddRemoveBlankPage();
|
AddRemoveBlankPage();
|
||||||
g_pCodeWindow->OpenPages();
|
if (g_pCodeWindow) g_pCodeWindow->OpenPages();
|
||||||
if (SConfig::GetInstance().m_InterfaceLogWindow) DoToggleWindow(IDM_LOGWINDOW, true);
|
if (SConfig::GetInstance().m_InterfaceLogWindow) DoToggleWindow(IDM_LOGWINDOW, true);
|
||||||
if (SConfig::GetInstance().m_InterfaceConsole) DoToggleWindow(IDM_CONSOLEWINDOW, true);
|
if (SConfig::GetInstance().m_InterfaceConsole) DoToggleWindow(IDM_CONSOLEWINDOW, true);
|
||||||
|
|
||||||
@ -1274,13 +1268,13 @@ wxAuiNotebook * CFrame::GetNotebookFromId(u32 NBId)
|
|||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
void CFrame::ShowAllNotebooks(bool Window)
|
void CFrame::ShowAllNotebooks(bool bShow)
|
||||||
{
|
{
|
||||||
for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
||||||
{
|
{
|
||||||
if (m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
if (m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
||||||
{
|
{
|
||||||
if (Window)
|
if (bShow)
|
||||||
m_Mgr->GetAllPanes().Item(i).Show();
|
m_Mgr->GetAllPanes().Item(i).Show();
|
||||||
else
|
else
|
||||||
m_Mgr->GetAllPanes().Item(i).window->Hide();
|
m_Mgr->GetAllPanes().Item(i).window->Hide();
|
||||||
|
@ -119,7 +119,7 @@ void CFrame::CreateMenu()
|
|||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
fileMenu->Append(IDM_BROWSE, _T("&Browse for ISOs..."));
|
fileMenu->Append(IDM_BROWSE, _T("&Browse for ISOs..."));
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
fileMenu->Append(IDM_RESTART, UseDebugger ? _T("Restart in regular mode") : _T("Restart in debugging mode"));
|
fileMenu->Append(IDM_RESTART, g_pCodeWindow ? _T("Restart in regular mode") : _T("Restart in debugging mode"));
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt+F4"));
|
fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt+F4"));
|
||||||
m_MenuBar->Append(fileMenu, _T("&File"));
|
m_MenuBar->Append(fileMenu, _T("&File"));
|
||||||
@ -174,7 +174,7 @@ void CFrame::CreateMenu()
|
|||||||
pOptionsMenu->Append(IDM_CONFIG_WIIMOTE_PLUGIN, _T("&Wiimote Settings"));
|
pOptionsMenu->Append(IDM_CONFIG_WIIMOTE_PLUGIN, _T("&Wiimote Settings"));
|
||||||
pOptionsMenu->AppendSeparator();
|
pOptionsMenu->AppendSeparator();
|
||||||
pOptionsMenu->Append(IDM_TOGGLE_FULLSCREEN, _T("&Fullscreen\tAlt+Enter"));
|
pOptionsMenu->Append(IDM_TOGGLE_FULLSCREEN, _T("&Fullscreen\tAlt+Enter"));
|
||||||
if (UseDebugger)
|
if (g_pCodeWindow)
|
||||||
{
|
{
|
||||||
pOptionsMenu->AppendSeparator();
|
pOptionsMenu->AppendSeparator();
|
||||||
g_pCodeWindow->CreateMenuOptions(NULL, pOptionsMenu);
|
g_pCodeWindow->CreateMenuOptions(NULL, pOptionsMenu);
|
||||||
@ -210,7 +210,7 @@ void CFrame::CreateMenu()
|
|||||||
viewMenu->Check(IDM_CONSOLEWINDOW, SConfig::GetInstance().m_InterfaceConsole);
|
viewMenu->Check(IDM_CONSOLEWINDOW, SConfig::GetInstance().m_InterfaceConsole);
|
||||||
viewMenu->AppendSeparator();
|
viewMenu->AppendSeparator();
|
||||||
|
|
||||||
if (UseDebugger)
|
if (g_pCodeWindow)
|
||||||
{
|
{
|
||||||
g_pCodeWindow->CreateMenuView(NULL, viewMenu);
|
g_pCodeWindow->CreateMenuView(NULL, viewMenu);
|
||||||
viewMenu->AppendSeparator();
|
viewMenu->AppendSeparator();
|
||||||
@ -234,7 +234,7 @@ void CFrame::CreateMenu()
|
|||||||
viewMenu->Append(IDM_PURGECACHE, _T("Purge Cache"));
|
viewMenu->Append(IDM_PURGECACHE, _T("Purge Cache"));
|
||||||
m_MenuBar->Append(viewMenu, _T("&View"));
|
m_MenuBar->Append(viewMenu, _T("&View"));
|
||||||
|
|
||||||
if (UseDebugger) g_pCodeWindow->CreateMenu(SConfig::GetInstance().m_LocalCoreStartupParameter, m_MenuBar);
|
if (g_pCodeWindow) g_pCodeWindow->CreateMenu(SConfig::GetInstance().m_LocalCoreStartupParameter, m_MenuBar);
|
||||||
|
|
||||||
// Help menu
|
// Help menu
|
||||||
wxMenu* helpMenu = new wxMenu;
|
wxMenu* helpMenu = new wxMenu;
|
||||||
@ -276,7 +276,7 @@ void CFrame::PopulateToolbar(wxAuiToolBar* ToolBar)
|
|||||||
ToolBar->AddTool(IDM_CONFIG_DSP_PLUGIN, _T("DSP"), m_Bitmaps[Toolbar_PluginDSP], _T("DSP settings"));
|
ToolBar->AddTool(IDM_CONFIG_DSP_PLUGIN, _T("DSP"), m_Bitmaps[Toolbar_PluginDSP], _T("DSP settings"));
|
||||||
ToolBar->AddTool(IDM_CONFIG_PAD_PLUGIN, _T("Pad"), m_Bitmaps[Toolbar_PluginPAD], _T("Pad settings"));
|
ToolBar->AddTool(IDM_CONFIG_PAD_PLUGIN, _T("Pad"), m_Bitmaps[Toolbar_PluginPAD], _T("Pad settings"));
|
||||||
ToolBar->AddTool(IDM_CONFIG_WIIMOTE_PLUGIN, _T("Wiimote"), m_Bitmaps[Toolbar_Wiimote], _T("Wiimote settings"));
|
ToolBar->AddTool(IDM_CONFIG_WIIMOTE_PLUGIN, _T("Wiimote"), m_Bitmaps[Toolbar_Wiimote], _T("Wiimote settings"));
|
||||||
if (!UseDebugger)
|
if (!g_pCodeWindow)
|
||||||
{
|
{
|
||||||
ToolBar->AddSeparator();
|
ToolBar->AddSeparator();
|
||||||
ToolBar->AddTool(IDM_HELPABOUT, _T("About"), m_Bitmaps[Toolbar_Help], _T("About Dolphin"));
|
ToolBar->AddTool(IDM_HELPABOUT, _T("About"), m_Bitmaps[Toolbar_Help], _T("About Dolphin"));
|
||||||
@ -313,7 +313,7 @@ void CFrame::RecreateToolbar()
|
|||||||
ToolbarPane().Top().
|
ToolbarPane().Top().
|
||||||
LeftDockable(false).RightDockable(false).Floatable(false));
|
LeftDockable(false).RightDockable(false).Floatable(false));
|
||||||
|
|
||||||
if (UseDebugger)
|
if (g_pCodeWindow)
|
||||||
{
|
{
|
||||||
m_ToolBarDebug = new wxAuiToolBar(this, ID_TOOLBAR_DEBUG, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE);
|
m_ToolBarDebug = new wxAuiToolBar(this, ID_TOOLBAR_DEBUG, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE);
|
||||||
g_pCodeWindow->PopulateToolbar(m_ToolBarDebug);
|
g_pCodeWindow->PopulateToolbar(m_ToolBarDebug);
|
||||||
@ -859,45 +859,45 @@ void CFrame::OnFrameSkip(wxCommandEvent& event)
|
|||||||
void CFrame::UpdateGUI()
|
void CFrame::UpdateGUI()
|
||||||
{
|
{
|
||||||
// Save status
|
// Save status
|
||||||
bool initialized = Core::isRunning();
|
bool Initialized = Core::isRunning();
|
||||||
bool running = Core::GetState() == Core::CORE_RUN;
|
bool Running = Core::GetState() == Core::CORE_RUN;
|
||||||
bool paused = Core::GetState() == Core::CORE_PAUSE;
|
bool Paused = Core::GetState() == Core::CORE_PAUSE;
|
||||||
|
|
||||||
// Make sure that we have a toolbar
|
// Make sure that we have a toolbar
|
||||||
if (m_ToolBar != NULL)
|
if (m_ToolBar != NULL)
|
||||||
{
|
{
|
||||||
// Enable/disable the Config and Stop buttons
|
// Enable/disable the Config and Stop buttons
|
||||||
//GetToolBar()->EnableTool(IDM_CONFIG_MAIN, !initialized);
|
//GetToolBar()->EnableTool(IDM_CONFIG_MAIN, !initialized);
|
||||||
m_ToolBar->EnableTool(wxID_OPEN, !initialized);
|
m_ToolBar->EnableTool(wxID_OPEN, !Initialized);
|
||||||
m_ToolBar->EnableTool(wxID_REFRESH, !initialized); // Don't allow refresh when we don't show the list
|
m_ToolBar->EnableTool(wxID_REFRESH, !Initialized); // Don't allow refresh when we don't show the list
|
||||||
m_ToolBar->EnableTool(IDM_STOP, running || paused);
|
m_ToolBar->EnableTool(IDM_STOP, Running || Paused);
|
||||||
m_ToolBar->EnableTool(IDM_SCREENSHOT, running || paused);
|
m_ToolBar->EnableTool(IDM_SCREENSHOT, Running || Paused);
|
||||||
}
|
}
|
||||||
|
|
||||||
// File
|
// File
|
||||||
GetMenuBar()->FindItem(wxID_OPEN)->Enable(!initialized);
|
GetMenuBar()->FindItem(wxID_OPEN)->Enable(!Initialized);
|
||||||
m_pSubMenuDrive->Enable(!initialized);
|
m_pSubMenuDrive->Enable(!Initialized);
|
||||||
GetMenuBar()->FindItem(wxID_REFRESH)->Enable(!initialized);
|
GetMenuBar()->FindItem(wxID_REFRESH)->Enable(!Initialized);
|
||||||
GetMenuBar()->FindItem(IDM_BROWSE)->Enable(!initialized);
|
GetMenuBar()->FindItem(IDM_BROWSE)->Enable(!Initialized);
|
||||||
|
|
||||||
// Emulation
|
// Emulation
|
||||||
GetMenuBar()->FindItem(IDM_STOP)->Enable(running || paused);
|
GetMenuBar()->FindItem(IDM_STOP)->Enable(Running || Paused);
|
||||||
GetMenuBar()->FindItem(IDM_RECORD)->Enable(!initialized);
|
GetMenuBar()->FindItem(IDM_RECORD)->Enable(!Initialized);
|
||||||
GetMenuBar()->FindItem(IDM_PLAYRECORD)->Enable(!initialized);
|
GetMenuBar()->FindItem(IDM_PLAYRECORD)->Enable(!Initialized);
|
||||||
GetMenuBar()->FindItem(IDM_FRAMESTEP)->Enable(running || paused);
|
GetMenuBar()->FindItem(IDM_FRAMESTEP)->Enable(Running || Paused);
|
||||||
GetMenuBar()->FindItem(IDM_SCREENSHOT)->Enable(running || paused);
|
GetMenuBar()->FindItem(IDM_SCREENSHOT)->Enable(Running || Paused);
|
||||||
m_pSubMenuLoad->Enable(initialized);
|
m_pSubMenuLoad->Enable(Initialized);
|
||||||
m_pSubMenuSave->Enable(initialized);
|
m_pSubMenuSave->Enable(Initialized);
|
||||||
|
|
||||||
// Let's enable it by default.
|
// Let's enable it by default.
|
||||||
//m_pSubMenuFrameSkipping->Enable(initialized);
|
//m_pSubMenuFrameSkipping->Enable(initialized);
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
GetMenuBar()->FindItem(IDM_CHANGEDISC)->Enable(initialized);
|
GetMenuBar()->FindItem(IDM_CHANGEDISC)->Enable(Initialized);
|
||||||
if (DiscIO::CNANDContentManager::Access().GetNANDLoader(FULL_WII_MENU_DIR).IsValid())
|
if (DiscIO::CNANDContentManager::Access().GetNANDLoader(FULL_WII_MENU_DIR).IsValid())
|
||||||
GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->Enable(!initialized);
|
GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->Enable(!Initialized);
|
||||||
|
|
||||||
if (running)
|
if (Running)
|
||||||
{
|
{
|
||||||
if (m_ToolBar != NULL)
|
if (m_ToolBar != NULL)
|
||||||
{
|
{
|
||||||
@ -919,12 +919,13 @@ void CFrame::UpdateGUI()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!initialized)
|
if (!Initialized)
|
||||||
{
|
{
|
||||||
if (m_GameListCtrl)
|
if (m_GameListCtrl)
|
||||||
{
|
{
|
||||||
if (!m_GameListCtrl->IsShown())
|
if (!m_GameListCtrl->IsShown())
|
||||||
{
|
{
|
||||||
|
m_GameListCtrl->Reparent(m_Panel);
|
||||||
m_GameListCtrl->Enable();
|
m_GameListCtrl->Enable();
|
||||||
m_GameListCtrl->Show();
|
m_GameListCtrl->Show();
|
||||||
sizerPanel->FitInside(m_Panel);
|
sizerPanel->FitInside(m_Panel);
|
||||||
@ -945,7 +946,7 @@ void CFrame::UpdateGUI()
|
|||||||
|
|
||||||
// Commit changes to toolbar
|
// Commit changes to toolbar
|
||||||
if (m_ToolBar != NULL) m_ToolBar->Realize();
|
if (m_ToolBar != NULL) m_ToolBar->Realize();
|
||||||
if (UseDebugger) g_pCodeWindow->Update();
|
if (g_pCodeWindow) g_pCodeWindow->Update();
|
||||||
// Commit changes to manager
|
// Commit changes to manager
|
||||||
m_Mgr->Update();
|
m_Mgr->Update();
|
||||||
}
|
}
|
||||||
@ -1005,13 +1006,13 @@ void CFrame::DoToggleToolbar(bool _show)
|
|||||||
if (_show)
|
if (_show)
|
||||||
{
|
{
|
||||||
m_Mgr->GetPane(wxT("TBMain")).Show();
|
m_Mgr->GetPane(wxT("TBMain")).Show();
|
||||||
if (UseDebugger) { m_Mgr->GetPane(wxT("TBDebug")).Show(); m_Mgr->GetPane(wxT("TBAui")).Show(); }
|
if (g_pCodeWindow) { m_Mgr->GetPane(wxT("TBDebug")).Show(); m_Mgr->GetPane(wxT("TBAui")).Show(); }
|
||||||
m_Mgr->Update();
|
m_Mgr->Update();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_Mgr->GetPane(wxT("TBMain")).Hide();
|
m_Mgr->GetPane(wxT("TBMain")).Hide();
|
||||||
if (UseDebugger) { m_Mgr->GetPane(wxT("TBDebug")).Hide(); m_Mgr->GetPane(wxT("TBAui")).Hide(); }
|
if (g_pCodeWindow) { m_Mgr->GetPane(wxT("TBDebug")).Hide(); m_Mgr->GetPane(wxT("TBAui")).Hide(); }
|
||||||
m_Mgr->Update();
|
m_Mgr->Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -371,7 +371,7 @@ bool DolphinApp::OnInit()
|
|||||||
}
|
}
|
||||||
/* If we have selected Automatic Start, start the default ISO, or if no default
|
/* If we have selected Automatic Start, start the default ISO, or if no default
|
||||||
ISO exists, start the last loaded ISO */
|
ISO exists, start the last loaded ISO */
|
||||||
else if (UseDebugger)
|
else if (main_frame->g_pCodeWindow)
|
||||||
{
|
{
|
||||||
if (main_frame->g_pCodeWindow->AutomaticStart())
|
if (main_frame->g_pCodeWindow->AutomaticStart())
|
||||||
{
|
{
|
||||||
@ -436,6 +436,11 @@ CFrame* DolphinApp::GetCFrame()
|
|||||||
return main_frame;
|
return main_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Host_Message(int Id)
|
||||||
|
{
|
||||||
|
main_frame->OnCustomHostMessage(Id);
|
||||||
|
}
|
||||||
|
|
||||||
// OK, this thread boundary is DANGEROUS on linux
|
// OK, this thread boundary is DANGEROUS on linux
|
||||||
// wxPostEvent / wxAddPendingEvent is the solution.
|
// wxPostEvent / wxAddPendingEvent is the solution.
|
||||||
void Host_NotifyMapLoaded()
|
void Host_NotifyMapLoaded()
|
||||||
|
@ -56,6 +56,7 @@ void Host_NotifyMapLoaded(){}
|
|||||||
|
|
||||||
void Host_ShowJitResults(unsigned int address){}
|
void Host_ShowJitResults(unsigned int address){}
|
||||||
|
|
||||||
|
void Host_Message(int Id){}
|
||||||
|
|
||||||
void Host_UpdateLogDisplay(){}
|
void Host_UpdateLogDisplay(){}
|
||||||
|
|
||||||
|
@ -18,8 +18,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Plugin communication. I place this here rather in Common.h since these messages are only received
|
/* Plugin communication. I place this here rather in Common.h to rebuild less if any of this is changed */
|
||||||
at one place, by the CPanel in Frame.cpp. That way I don't have to rebuild if any of this is changed */
|
|
||||||
// -----------------
|
// -----------------
|
||||||
enum PLUGIN_COMM
|
enum PLUGIN_COMM
|
||||||
{
|
{
|
||||||
@ -27,10 +26,12 @@ enum PLUGIN_COMM
|
|||||||
OPENGL_WM_USER_STOP = 10,
|
OPENGL_WM_USER_STOP = 10,
|
||||||
OPENGL_WM_USER_CREATE,
|
OPENGL_WM_USER_CREATE,
|
||||||
OPENGL_WM_USER_KEYDOWN,
|
OPENGL_WM_USER_KEYDOWN,
|
||||||
|
OPENGL_VIDEO_STOP,
|
||||||
|
VIDEO_DESTROY, // The video debugging window was destroyed
|
||||||
|
AUDIO_DESTROY, // The audio debugging window was destroyed
|
||||||
NJOY_RELOAD, // Reload nJoy if DirectInput has failed
|
NJOY_RELOAD, // Reload nJoy if DirectInput has failed
|
||||||
WIIMOTE_RECONNECT, // Reconnect the Wiimote if it has disconnected
|
WIIMOTE_RECONNECT, // Reconnect the Wiimote if it has disconnected
|
||||||
INPUT_FRAME_COUNTER, // Wind back the frame counter for rerecording
|
INPUT_FRAME_COUNTER // Wind back the frame counter for rerecording
|
||||||
OPENGL_VIDEO_STOP
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -89,6 +89,9 @@ DSPDebuggerHLE::DSPDebuggerHLE(wxWindow *parent, wxWindowID id, const wxString &
|
|||||||
, upd93(false)
|
, upd93(false)
|
||||||
, upd92(false)
|
, upd92(false)
|
||||||
{
|
{
|
||||||
|
// Confirm parenting
|
||||||
|
//this->Reparent(parent);
|
||||||
|
|
||||||
CreateGUIControls();
|
CreateGUIControls();
|
||||||
|
|
||||||
// load ini...
|
// load ini...
|
||||||
@ -144,17 +147,18 @@ DSPDebuggerHLE::DSPDebuggerHLE(wxWindow *parent, wxWindowID id, const wxString &
|
|||||||
|
|
||||||
DSPDebuggerHLE::~DSPDebuggerHLE()
|
DSPDebuggerHLE::~DSPDebuggerHLE()
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
// empty
|
// empty
|
||||||
IniFile file;
|
IniFile file;
|
||||||
file.Load(DEBUGGER_CONFIG_FILE);
|
file.Load(DEBUGGER_CONFIG_FILE);
|
||||||
this->Save(file);
|
this->Save(file);
|
||||||
file.Save(DEBUGGER_CONFIG_FILE);
|
file.Save(DEBUGGER_CONFIG_FILE);
|
||||||
|
*/
|
||||||
|
|
||||||
// Reset
|
// Reset
|
||||||
m_DebuggerFrame = NULL;
|
m_DebuggerFrame = NULL;
|
||||||
// Talk
|
// Talk
|
||||||
ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener();
|
NOTICE_LOG(CONSOLE, "Stop [Sound]\t\tDSPDebuggerHLE destroyed");
|
||||||
Console->Log(LogTypes::LNOTICE, StringFromFormat("Sound closed\n").c_str());
|
|
||||||
}
|
}
|
||||||
// ====================
|
// ====================
|
||||||
|
|
||||||
@ -162,15 +166,21 @@ DSPDebuggerHLE::~DSPDebuggerHLE()
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
// System functions
|
// System functions
|
||||||
// --------------
|
// --------------
|
||||||
void DSPDebuggerHLE::OnClose(wxCloseEvent& /*event*/)
|
void DSPDebuggerHLE::OnClose(wxCloseEvent& event)
|
||||||
{
|
{
|
||||||
// Save the window position when we hide the window to
|
//PanicAlert("OnClose");
|
||||||
|
//event.Skip();
|
||||||
|
|
||||||
|
// Save the window position
|
||||||
IniFile file;
|
IniFile file;
|
||||||
file.Load(DEBUGGER_CONFIG_FILE);
|
file.Load(DEBUGGER_CONFIG_FILE);
|
||||||
this->Save(file);
|
this->Save(file);
|
||||||
file.Save(DEBUGGER_CONFIG_FILE);
|
file.Save(DEBUGGER_CONFIG_FILE);
|
||||||
|
|
||||||
EndModal(0);
|
//EndModal(0);
|
||||||
|
//Close(true);
|
||||||
|
//Destroy();
|
||||||
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSPDebuggerHLE::OnUpdate(wxCommandEvent& /*event*/)
|
void DSPDebuggerHLE::OnUpdate(wxCommandEvent& /*event*/)
|
||||||
|
@ -157,6 +157,7 @@ if(m_DebuggerFrame->ScanMails)
|
|||||||
void CUCode_AX::SaveMail(bool Wii, u32 _uMail)
|
void CUCode_AX::SaveMail(bool Wii, u32 _uMail)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
|
if (!m_DebuggerFrame) return;
|
||||||
if(m_DebuggerFrame->ScanMails)
|
if(m_DebuggerFrame->ScanMails)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
@ -139,13 +139,17 @@ wxWindow* GetParentedWxWindow(HWND Parent)
|
|||||||
void DllDebugger(HWND _hParent, bool Show)
|
void DllDebugger(HWND _hParent, bool Show)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
if (!m_DebuggerFrame)
|
|
||||||
m_DebuggerFrame = new DSPDebuggerHLE(GetParentedWxWindow(_hParent));
|
|
||||||
|
|
||||||
if (Show)
|
if (Show)
|
||||||
|
{
|
||||||
|
if (!m_DebuggerFrame)
|
||||||
|
m_DebuggerFrame = new DSPDebuggerHLE(NULL);
|
||||||
|
//m_DebuggerFrame = new DSPDebuggerHLE(GetParentedWxWindow(_hParent));
|
||||||
m_DebuggerFrame->Show();
|
m_DebuggerFrame->Show();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
m_DebuggerFrame->Hide();
|
{
|
||||||
|
if (m_DebuggerFrame) m_DebuggerFrame->Close();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,6 +233,7 @@ void Shutdown()
|
|||||||
|
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
// Reset mails
|
// Reset mails
|
||||||
|
/*
|
||||||
if (m_DebuggerFrame)
|
if (m_DebuggerFrame)
|
||||||
{
|
{
|
||||||
sMailLog.clear();
|
sMailLog.clear();
|
||||||
@ -236,8 +241,8 @@ void Shutdown()
|
|||||||
m_DebuggerFrame->sMail.clear();
|
m_DebuggerFrame->sMail.clear();
|
||||||
m_DebuggerFrame->sMailEnd.clear();
|
m_DebuggerFrame->sMailEnd.clear();
|
||||||
}
|
}
|
||||||
#endif
|
*/
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoState(unsigned char **ptr, int mode)
|
void DoState(unsigned char **ptr, int mode)
|
||||||
|
@ -46,6 +46,7 @@ GFXDebuggerOGL::GFXDebuggerOGL(wxWindow *parent, wxWindowID id, const wxString &
|
|||||||
GFXDebuggerOGL::~GFXDebuggerOGL()
|
GFXDebuggerOGL::~GFXDebuggerOGL()
|
||||||
{
|
{
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
|
NOTICE_LOG(CONSOLE, "Stop [Video Thread]: Closing OpenGL debugging window");
|
||||||
}
|
}
|
||||||
|
|
||||||
void GFXDebuggerOGL::OnClose(wxCloseEvent& event)
|
void GFXDebuggerOGL::OnClose(wxCloseEvent& event)
|
||||||
|
@ -146,7 +146,7 @@ namespace EmuWindow
|
|||||||
{
|
{
|
||||||
|
|
||||||
HWND m_hWnd = NULL; // The new window that is created here
|
HWND m_hWnd = NULL; // The new window that is created here
|
||||||
HWND m_hParent = NULL; // The main CPanel or the main wxFrame
|
HWND m_hParent = NULL; // The main CPanel
|
||||||
|
|
||||||
HINSTANCE m_hInstance = NULL;
|
HINSTANCE m_hInstance = NULL;
|
||||||
WNDCLASSEX wndClass;
|
WNDCLASSEX wndClass;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user