A bit of cleanup to Core Init/Stop, Frame, and Main. Cleanup XAudio2 to attempt to fix the crash on stop(didn't help :p). For some reason CFrame::DoStop is called twice.(might be the issue)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7353 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak 2011-03-15 23:09:12 +00:00
parent e77059d30c
commit 41c98f982e
31 changed files with 618 additions and 763 deletions

View File

@ -18,22 +18,30 @@
#include "AudioCommon.h" #include "AudioCommon.h"
#include "XAudio2Stream.h" #include "XAudio2Stream.h"
struct StreamingVoiceContext : public IXAudio2VoiceCallback const int NUM_BUFFERS = 3;
const int SAMPLES_PER_BUFFER = 96;
const int NUM_CHANNELS = 2;
const int BUFFER_SIZE = SAMPLES_PER_BUFFER * NUM_CHANNELS;
const int BUFFER_SIZE_BYTES = BUFFER_SIZE * sizeof(s16);
void StreamingVoiceContext::SubmitBuffer(PBYTE buf_data)
{ {
IXAudio2SourceVoice* pSourceVoice; XAUDIO2_BUFFER buf = {};
CMixer *m_mixer; buf.AudioBytes = BUFFER_SIZE_BYTES;
Common::Event *soundSyncEvent; buf.pContext = buf_data;
short *xaBuffer; buf.pAudioData = buf_data;
StreamingVoiceContext(IXAudio2 *pXAudio2, CMixer *pMixer, Common::Event *pSyncEvent) m_source_voice->SubmitSourceBuffer(&buf);
}
StreamingVoiceContext::StreamingVoiceContext(IXAudio2 *pXAudio2, CMixer *pMixer, Common::Event& pSyncEvent)
: m_mixer(pMixer)
, m_sound_sync_event(pSyncEvent)
, xaudio_buffer(new BYTE[NUM_BUFFERS * BUFFER_SIZE_BYTES]())
{ {
WAVEFORMATEXTENSIBLE wfx = {};
m_mixer = pMixer;
soundSyncEvent = pSyncEvent;
WAVEFORMATEXTENSIBLE wfx;
memset(&wfx, 0, sizeof(WAVEFORMATEXTENSIBLE));
wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
wfx.Format.nSamplesPerSec = m_mixer->GetSampleRate(); wfx.Format.nSamplesPerSec = m_mixer->GetSampleRate();
wfx.Format.nChannels = 2; wfx.Format.nChannels = 2;
@ -47,107 +55,82 @@ struct StreamingVoiceContext : public IXAudio2VoiceCallback
// create source voice // create source voice
HRESULT hr; HRESULT hr;
if(FAILED(hr = pXAudio2->CreateSourceVoice(&pSourceVoice, (WAVEFORMATEX*)&wfx, XAUDIO2_VOICE_NOSRC, 1.0f, this))) if (FAILED(hr = pXAudio2->CreateSourceVoice(&m_source_voice, &wfx.Format, XAUDIO2_VOICE_NOSRC, 1.0f, this)))
{
PanicAlertT("XAudio2 CreateSourceVoice failed: %#X", hr); PanicAlertT("XAudio2 CreateSourceVoice failed: %#X", hr);
return;
}
pSourceVoice->FlushSourceBuffers(); m_source_voice->Start();
pSourceVoice->Start();
xaBuffer = new s16[NUM_BUFFERS * BUFFER_SIZE];
memset(xaBuffer, 0, NUM_BUFFERS * BUFFER_SIZE_BYTES);
// start buffers with silence // start buffers with silence
for(int i=0; i < NUM_BUFFERS; i++) for (int i = 0; i != NUM_BUFFERS; ++i)
SubmitBuffer(xaudio_buffer.get() + (i * BUFFER_SIZE_BYTES));
}
StreamingVoiceContext::~StreamingVoiceContext()
{ {
XAUDIO2_BUFFER buf = {0}; if (m_source_voice)
buf.AudioBytes = BUFFER_SIZE_BYTES;
buf.pAudioData = (BYTE *) &xaBuffer[i * BUFFER_SIZE];
buf.pContext = (void *) buf.pAudioData;
pSourceVoice->SubmitSourceBuffer(&buf);
}
}
~StreamingVoiceContext()
{ {
IXAudio2SourceVoice* temp = pSourceVoice; m_source_voice->Stop();
pSourceVoice = NULL; m_source_voice->DestroyVoice();
temp->FlushSourceBuffers(); }
temp->DestroyVoice();
safe_delete_array(xaBuffer);
} }
void StreamingVoiceContext::Stop() { void StreamingVoiceContext::Stop()
if (pSourceVoice) {
pSourceVoice->Stop(); if (m_source_voice)
m_source_voice->Stop();
} }
void StreamingVoiceContext::Play() { void StreamingVoiceContext::Play()
if (pSourceVoice) {
pSourceVoice->Start(); if (m_source_voice)
m_source_voice->Start();
} }
STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) {} void StreamingVoiceContext::OnBufferEnd(void* context)
STDMETHOD_(void, OnVoiceProcessingPassStart) (UINT32) {} {
STDMETHOD_(void, OnVoiceProcessingPassEnd) () {}
STDMETHOD_(void, OnBufferStart) (void*) {}
STDMETHOD_(void, OnLoopEnd) (void*) {}
STDMETHOD_(void, OnStreamEnd) () {}
STDMETHOD_(void, OnBufferEnd) (void* context)
{ //
// buffer end callback; gets SAMPLES_PER_BUFFER samples for a new buffer // buffer end callback; gets SAMPLES_PER_BUFFER samples for a new buffer
//
if( !pSourceVoice || !context) return;
//soundSyncEvent->Wait(); //sync if (!m_source_voice || !context)
//soundSyncEvent->Spin(); //or tight sync return;
//if (!pSourceVoice) return; //m_sound_sync_event->Wait(); // sync
//m_sound_sync_event->Spin(); // or tight sync
m_mixer->Mix((short *)context, SAMPLES_PER_BUFFER); m_mixer->Mix(static_cast<short*>(context), SAMPLES_PER_BUFFER);
SubmitBuffer(static_cast<BYTE*>(context));
XAUDIO2_BUFFER buf = {0};
buf.AudioBytes = BUFFER_SIZE_BYTES;
buf.pAudioData = (byte*)context;
buf.pContext = context;
pSourceVoice->SubmitSourceBuffer(&buf);
} }
};
StreamingVoiceContext* pVoiceContext = 0;
bool XAudio2::Start() bool XAudio2::Start()
{ {
// XAudio2 init
CoInitializeEx(NULL, COINIT_MULTITHREADED);
HRESULT hr; HRESULT hr;
if(FAILED(hr = XAudio2Create(&pXAudio2, 0, XAUDIO2_ANY_PROCESSOR))) //callback dosent seem to run on a speecific cpu anyways
// callback dosent seem to run on a speecific cpu anyways
IXAudio2* xaudptr;
if (FAILED(hr = XAudio2Create(&xaudptr, 0, XAUDIO2_DEFAULT_PROCESSOR)))
{ {
PanicAlertT("XAudio2 init failed: %#X", hr); PanicAlertT("XAudio2 init failed: %#X", hr);
CoUninitialize(); Stop();
return false; return false;
} }
m_xaudio2 = std::unique_ptr<IXAudio2, Releaser>(xaudptr);
// XAudio2 master voice // XAudio2 master voice
// XAUDIO2_DEFAULT_CHANNELS instead of 2 for expansion? // XAUDIO2_DEFAULT_CHANNELS instead of 2 for expansion?
if(FAILED(hr = pXAudio2->CreateMasteringVoice(&pMasteringVoice, 2, m_mixer->GetSampleRate()))) if (FAILED(hr = m_xaudio2->CreateMasteringVoice(&m_mastering_voice, 2, m_mixer->GetSampleRate())))
{ {
PanicAlertT("XAudio2 master voice creation failed: %#X", hr); PanicAlertT("XAudio2 master voice creation failed: %#X", hr);
safe_release(pXAudio2); Stop();
CoUninitialize();
return false; return false;
} }
// Volume // Volume
if (pMasteringVoice) m_mastering_voice->SetVolume(m_volume);
pMasteringVoice->SetVolume(m_volume);
if (pXAudio2) m_voice_context = std::unique_ptr<StreamingVoiceContext>
pVoiceContext = new StreamingVoiceContext(pXAudio2, m_mixer, &soundSyncEvent); (new StreamingVoiceContext(m_xaudio2.get(), m_mixer, m_sound_sync_event));
return true; return true;
} }
@ -157,21 +140,19 @@ void XAudio2::SetVolume(int volume)
//linear 1- .01 //linear 1- .01
m_volume = (float)volume / 100.f; m_volume = (float)volume / 100.f;
if (pMasteringVoice) if (m_mastering_voice)
pMasteringVoice->SetVolume(m_volume); m_mastering_voice->SetVolume(m_volume);
} }
//XAUDIO2_PERFORMANCE_DATA perfData;
//int xi = 0;
void XAudio2::Update() void XAudio2::Update()
{ {
//soundSyncEvent.Set(); //m_sound_sync_event.Set();
//xi++; //static int xi = 0;
//if (xi == 100000) { //if (100000 == ++xi)
//{
// xi = 0; // xi = 0;
// XAUDIO2_PERFORMANCE_DATA perfData;
// pXAudio2->GetPerformanceData(&perfData); // pXAudio2->GetPerformanceData(&perfData);
// NOTICE_LOG(DSPHLE, "XAudio2 latency (samples): %i", perfData.CurrentLatencyInSamples); // NOTICE_LOG(DSPHLE, "XAudio2 latency (samples): %i", perfData.CurrentLatencyInSamples);
// NOTICE_LOG(DSPHLE, "XAudio2 total glitches: %i", perfData.GlitchesSinceEngineStarted); // NOTICE_LOG(DSPHLE, "XAudio2 total glitches: %i", perfData.GlitchesSinceEngineStarted);
@ -182,26 +163,26 @@ void XAudio2::Clear(bool mute)
{ {
m_muted = mute; m_muted = mute;
if (pVoiceContext) if (m_voice_context)
{ {
if (m_muted) if (m_muted)
pVoiceContext->Stop(); m_voice_context->Stop();
else else
pVoiceContext->Play(); m_voice_context->Play();
} }
} }
void XAudio2::Stop() void XAudio2::Stop()
{ {
//soundSyncEvent.Set(); //m_sound_sync_event.Set();
safe_delete(pVoiceContext); m_voice_context.reset();
pVoiceContext = NULL;
if(pMasteringVoice) if (m_mastering_voice)
pMasteringVoice->DestroyVoice(); {
m_mastering_voice->DestroyVoice();
safe_release(pXAudio2); m_mastering_voice = nullptr;
pMasteringVoice = NULL; }
CoUninitialize();
m_xaudio2.reset(); // release interface
} }

View File

@ -23,59 +23,89 @@
#ifdef _WIN32 #ifdef _WIN32
#include "Thread.h" #include "Thread.h"
#include <xaudio2.h> #include <xaudio2.h>
#include <memory>
const int NUM_BUFFERS = 3; struct StreamingVoiceContext : public IXAudio2VoiceCallback
const int SAMPLES_PER_BUFFER = 96; {
private:
CMixer* const m_mixer;
Common::Event& m_sound_sync_event;
IXAudio2SourceVoice* m_source_voice;
std::unique_ptr<BYTE[]> xaudio_buffer;
const int NUM_CHANNELS = 2; void SubmitBuffer(PBYTE buf_data);
const int BUFFER_SIZE = SAMPLES_PER_BUFFER * NUM_CHANNELS;
const int BUFFER_SIZE_BYTES = BUFFER_SIZE * sizeof(s16);
public:
StreamingVoiceContext(IXAudio2 *pXAudio2, CMixer *pMixer, Common::Event& pSyncEvent);
#ifndef safe_delete_array ~StreamingVoiceContext();
#define safe_delete_array(p) { if(p) { delete[] (p); (p)=NULL; } }
#endif
#ifndef safe_delete
#define safe_delete(a) if( (a) != NULL ) delete (a); (a) = NULL;
#endif
#ifndef safe_release
#define safe_release(p) { if(p) { (p)->Release(); (p)=NULL; } }
#endif
void StreamingVoiceContext::Stop();
void StreamingVoiceContext::Play();
STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) {}
STDMETHOD_(void, OnVoiceProcessingPassStart) (UINT32) {}
STDMETHOD_(void, OnVoiceProcessingPassEnd) () {}
STDMETHOD_(void, OnBufferStart) (void*) {}
STDMETHOD_(void, OnLoopEnd) (void*) {}
STDMETHOD_(void, OnStreamEnd) () {}
STDMETHOD_(void, OnBufferEnd) (void* context);
};
#endif #endif
class XAudio2 : public SoundStream class XAudio2 : public SoundStream
{ {
#ifdef _WIN32 #ifdef _WIN32
IXAudio2 *pXAudio2;
IXAudio2MasteringVoice *pMasteringVoice;
IXAudio2SourceVoice *pSourceVoice;
Common::Event soundSyncEvent; class Releaser
{
public:
template <typename R>
void operator()(R* ptr)
{
ptr->Release();
}
};
private:
std::unique_ptr<IXAudio2, Releaser> m_xaudio2;
std::unique_ptr<StreamingVoiceContext> m_voice_context;
IXAudio2MasteringVoice *m_mastering_voice;
Common::Event m_sound_sync_event;
float m_volume; float m_volume;
const bool m_cleanup_com;
bool Init();
public: public:
XAudio2(CMixer *mixer) XAudio2(CMixer *mixer)
: SoundStream(mixer), : SoundStream(mixer)
pXAudio2(0), , m_mastering_voice(nullptr)
pMasteringVoice(0), , m_volume(1.0f)
pSourceVoice(0), , m_cleanup_com(SUCCEEDED(CoInitializeEx(NULL, COINIT_MULTITHREADED)))
m_volume(1.0f) {} {}
virtual ~XAudio2() {} virtual ~XAudio2()
{
Stop();
if (m_cleanup_com)
CoUninitialize();
}
virtual bool Start(); virtual bool Start();
virtual void SetVolume(int volume);
virtual void Stop(); virtual void Stop();
virtual void Clear(bool mute);
static bool isValid() { return true; }
virtual bool usesMixer() const { return true; }
virtual void Update(); virtual void Update();
virtual void Clear(bool mute);
virtual void SetVolume(int volume);
virtual bool usesMixer() const { return true; }
static bool isValid() { return true; }
#else #else
public: public:
XAudio2(CMixer *mixer, void *hWnd = NULL) XAudio2(CMixer *mixer, void *hWnd = NULL)
: SoundStream(mixer) : SoundStream(mixer)

View File

@ -103,12 +103,12 @@ public:
: m_count(count), m_waiting(0) : m_count(count), m_waiting(0)
{} {}
// block until "count" threads call Wait() // block until "count" threads call Sync()
bool Wait() bool Sync()
{ {
std::unique_lock<std::mutex> lk(m_mutex); std::unique_lock<std::mutex> lk(m_mutex);
// TODO: broken when next round of Wait()s // TODO: broken when next round of Sync()s
// is entered before all waiting threads return from the notify_all // is entered before all waiting threads return from the notify_all
if (m_count == ++m_waiting) if (m_count == ++m_waiting)

View File

@ -80,9 +80,7 @@ volatile u32 DrawnFrame = 0;
u32 DrawnVideo = 0; u32 DrawnVideo = 0;
// Function forwarding // Function forwarding
void Callback_DSPLog(const TCHAR* _szMessage, int _v);
const char *Callback_ISOName(void); const char *Callback_ISOName(void);
void Callback_DSPInterrupt();
void Callback_WiimoteInterruptChannel(int _number, u16 _channelID, const void* _pData, u32 _Size); void Callback_WiimoteInterruptChannel(int _number, u16 _channelID, const void* _pData, u32 _Size);
// Function declarations // Function declarations
@ -97,13 +95,12 @@ void *g_pWindowHandle = NULL;
std::string g_stateFileName; std::string g_stateFileName;
std::thread g_EmuThread; std::thread g_EmuThread;
static std::thread cpuThread; static std::thread g_cpu_thread;
SCoreStartupParameter g_CoreStartupParameter; SCoreStartupParameter g_CoreStartupParameter;
// This event is set when the emuthread starts. // This event is set when the emuthread starts.
Common::Barrier emuThreadGoing(2); Common::Barrier emuThreadGoing(2);
Common::Barrier cpuRunloopQuit(2);
std::string GetStateFileName() { return g_stateFileName; } std::string GetStateFileName() { return g_stateFileName; }
void SetStateFileName(std::string val) { g_stateFileName = val; } void SetStateFileName(std::string val) { g_stateFileName = val; }
@ -124,19 +121,6 @@ bool PanicAlertToVideo(const char* text, bool yes_no)
return true; return true;
} }
void DisplayMessage(const std::string &message, int time_in_ms)
{
SCoreStartupParameter& _CoreParameter =
SConfig::GetInstance().m_LocalCoreStartupParameter;
g_video_backend->Video_AddMessage(message.c_str(), time_in_ms);
if (_CoreParameter.bRenderToMain &&
SConfig::GetInstance().m_InterfaceStatusbar) {
Host_UpdateStatusBar(message.c_str());
} else
Host_UpdateTitle(message.c_str());
}
void DisplayMessage(const char *message, int time_in_ms) void DisplayMessage(const char *message, int time_in_ms)
{ {
SCoreStartupParameter& _CoreParameter = SCoreStartupParameter& _CoreParameter =
@ -160,24 +144,19 @@ void *GetWindowHandle()
return g_pWindowHandle; return g_pWindowHandle;
} }
bool GetRealWiimote() bool IsRunning()
{
return g_bRealWiimote;
}
bool isRunning()
{ {
return (GetState() != CORE_UNINITIALIZED) || g_bHwInit; return (GetState() != CORE_UNINITIALIZED) || g_bHwInit;
} }
bool IsRunningInCurrentThread() bool IsRunningInCurrentThread()
{ {
return isRunning() && ((!cpuThread.joinable()) || cpuThread.get_id() == std::this_thread::get_id()); return IsRunning() && ((!g_cpu_thread.joinable()) || g_cpu_thread.get_id() == std::this_thread::get_id());
} }
bool IsCPUThread() bool IsCPUThread()
{ {
return ((!cpuThread.joinable()) || cpuThread.get_id() == std::this_thread::get_id()); return ((!g_cpu_thread.joinable()) || g_cpu_thread.get_id() == std::this_thread::get_id());
} }
// This is called from the GUI thread. See the booting call schedule in // This is called from the GUI thread. See the booting call schedule in
@ -200,7 +179,6 @@ bool Init()
INFO_LOG(OSREPORT, "CPU Thread separate = %s", INFO_LOG(OSREPORT, "CPU Thread separate = %s",
g_CoreStartupParameter.bCPUThread ? "Yes" : "No"); g_CoreStartupParameter.bCPUThread ? "Yes" : "No");
Host_SetWaitCursor(true);
Host_UpdateMainFrame(); // Disable any menus or buttons at boot Host_UpdateMainFrame(); // Disable any menus or buttons at boot
g_aspect_wide = _CoreParameter.bWii; g_aspect_wide = _CoreParameter.bWii;
@ -219,7 +197,6 @@ bool Init()
g_pWindowHandle = Host_GetRenderHandle(); g_pWindowHandle = Host_GetRenderHandle();
if (!g_video_backend->Initialize(g_pWindowHandle)) if (!g_video_backend->Initialize(g_pWindowHandle))
{ {
Host_SetWaitCursor(false);
return false; return false;
} }
@ -229,7 +206,6 @@ bool Init()
{ {
HW::Shutdown(); HW::Shutdown();
g_video_backend->Shutdown(); g_video_backend->Shutdown();
Host_SetWaitCursor(false);
return false; return false;
} }
Pad::Initialize(g_pWindowHandle); Pad::Initialize(g_pWindowHandle);
@ -252,9 +228,7 @@ bool Init()
g_EmuThread = std::thread(EmuThread); g_EmuThread = std::thread(EmuThread);
// Wait until the emu thread is running // Wait until the emu thread is running
emuThreadGoing.Wait(); emuThreadGoing.Sync();
Host_SetWaitCursor(false);
return true; return true;
} }
@ -262,17 +236,18 @@ bool Init()
// Called from GUI thread // Called from GUI thread
void Stop() // - Hammertime! void Stop() // - Hammertime!
{ {
if (PowerPC::GetState() == PowerPC::CPU_POWERDOWN)
return;
const SCoreStartupParameter& _CoreParameter = const SCoreStartupParameter& _CoreParameter =
SConfig::GetInstance().m_LocalCoreStartupParameter; SConfig::GetInstance().m_LocalCoreStartupParameter;
g_bStopping = true; g_bStopping = true;
g_video_backend->EmuStateChange(EMUSTATE_CHANGE_STOP); g_video_backend->EmuStateChange(EMUSTATE_CHANGE_STOP);
INFO_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutting down ----"); INFO_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutting down ----");
Host_SetWaitCursor(true); // hourglass!
if (PowerPC::GetState() == PowerPC::CPU_POWERDOWN)
return;
// Stop the CPU // Stop the CPU
INFO_LOG(CONSOLE, "%s", StopMessage(true, "Stop CPU").c_str()); INFO_LOG(CONSOLE, "%s", StopMessage(true, "Stop CPU").c_str());
PowerPC::Stop(); PowerPC::Stop();
@ -284,30 +259,23 @@ void Stop() // - Hammertime!
// Video_EnterLoop() should now exit so that EmuThread() // Video_EnterLoop() should now exit so that EmuThread()
// will continue concurrently with the rest of the commands // will continue concurrently with the rest of the commands
// in this function. We no longer rely on Postmessage. // in this function. We no longer rely on Postmessage.
INFO_LOG(CONSOLE, "%s", StopMessage(true, INFO_LOG(CONSOLE, "%s", StopMessage(true, "Wait for Video Loop to exit ...").c_str());
"Wait for Video Loop to exit ...").c_str());
g_video_backend->Video_ExitLoop();
// Wait until the CPU finishes exiting the main run loop g_video_backend->Video_ExitLoop();
cpuRunloopQuit.Wait();
} }
INFO_LOG(CONSOLE, "%s", StopMessage(true, "Stopping Emu thread ...").c_str());
g_EmuThread.join(); // Wait for emuthread to close.
INFO_LOG(CONSOLE, "%s", StopMessage(true, "Main Emu thread stopped").c_str());
// Clear on screen messages that haven't expired // Clear on screen messages that haven't expired
g_video_backend->Video_ClearMessages(); g_video_backend->Video_ClearMessages();
// Close the trace file // Close the trace file
Core::StopTrace(); Core::StopTrace();
// Update mouse pointer
Host_SetWaitCursor(false);
INFO_LOG(CONSOLE, "%s",
StopMessage(true, "Stopping Emu thread ...").c_str());
g_EmuThread.join(); // Wait for emuthread to close.
INFO_LOG(CONSOLE, "%s",
StopMessage(true, "Main thread stopped").c_str());
// Stop audio thread - Actually this does nothing when using HLE // Stop audio thread - Actually this does nothing when using HLE
// emulation, but stops the DSP Interpreter when using LLE emulation. // emulation, but stops the DSP Interpreter when using LLE emulation.
DSP::GetDSPEmulator()->DSP_StopSoundStream(); DSP::GetDSPEmulator()->DSP_StopSoundStream();
@ -326,6 +294,8 @@ void Stop() // - Hammertime!
SConfig::GetInstance().m_SYSCONF->Reload(); SConfig::GetInstance().m_SYSCONF->Reload();
INFO_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutdown complete ----"); INFO_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutdown complete ----");
g_bStopping = false;
} }
// Create the CPU thread, which is a CPU + Video thread in Single Core mode. // Create the CPU thread, which is a CPU + Video thread in Single Core mode.
@ -356,8 +326,6 @@ void CpuThread()
// Enter CPU run loop. When we leave it - we are done. // Enter CPU run loop. When we leave it - we are done.
CCPU::Run(); CCPU::Run();
cpuRunloopQuit.Wait();
return; return;
} }
@ -369,7 +337,7 @@ void EmuThread()
const SCoreStartupParameter& _CoreParameter = const SCoreStartupParameter& _CoreParameter =
SConfig::GetInstance().m_LocalCoreStartupParameter; SConfig::GetInstance().m_LocalCoreStartupParameter;
Common::SetCurrentThreadName("Emuthread - starting"); Common::SetCurrentThreadName("Emuthread - Starting");
if (_CoreParameter.bLockThreads) if (_CoreParameter.bLockThreads)
{ {
@ -379,8 +347,6 @@ void EmuThread()
Common::SetCurrentThreadAffinity(2); Common::SetCurrentThreadAffinity(2);
} }
emuThreadGoing.Wait();
DisplayMessage(cpu_info.brand_string, 8000); DisplayMessage(cpu_info.brand_string, 8000);
DisplayMessage(cpu_info.Summarize(), 8000); DisplayMessage(cpu_info.Summarize(), 8000);
DisplayMessage(_CoreParameter.m_strFilename, 3000); DisplayMessage(_CoreParameter.m_strFilename, 3000);
@ -396,23 +362,29 @@ void EmuThread()
else else
PowerPC::SetMode(PowerPC::MODE_INTERPRETER); PowerPC::SetMode(PowerPC::MODE_INTERPRETER);
// Spawn the CPU thread
_dbg_assert_(OSHLE, !cpuThread.joinable());
// ENTER THE VIDEO THREAD LOOP
if (_CoreParameter.bCPUThread)
{
g_video_backend->Video_Prepare();
// This thread, after creating the EmuWindow, spawns a CPU
// thread, and then takes over and becomes the video thread
cpuThread = std::thread(CpuThread);
Common::SetCurrentThreadName("Video thread");
// Update the window again because all stuff is initialized // Update the window again because all stuff is initialized
Host_UpdateDisasmDialog(); Host_UpdateDisasmDialog();
Host_UpdateMainFrame(); Host_UpdateMainFrame();
emuThreadGoing.Sync();
// ENTER THE VIDEO THREAD LOOP
if (_CoreParameter.bCPUThread)
{
// This thread, after creating the EmuWindow, spawns a CPU
// thread, and then takes over and becomes the video thread
Common::SetCurrentThreadName("Video thread");
g_video_backend->Video_Prepare();
// Spawn the CPU thread
g_cpu_thread = std::thread(CpuThread);
// become the GPU thread
g_video_backend->Video_EnterLoop(); g_video_backend->Video_EnterLoop();
// We have now exited the Video Loop
INFO_LOG(CONSOLE, "%s", StopMessage(false, "Video Loop Ended").c_str());
} }
else // SingleCore mode else // SingleCore mode
{ {
@ -421,44 +393,27 @@ void EmuThread()
// waiting for the program to terminate. Without this extra // waiting for the program to terminate. Without this extra
// thread, the video backend window hangs in single core mode // thread, the video backend window hangs in single core mode
// because noone is pumping messages. // because noone is pumping messages.
cpuThread = std::thread(CpuThread);
Common::SetCurrentThreadName("Emuthread - Idle"); Common::SetCurrentThreadName("Emuthread - Idle");
// Update the window again because all stuff is initialized // Spawn the CPU+GPU thread
Host_UpdateDisasmDialog(); g_cpu_thread = std::thread(CpuThread);
Host_UpdateMainFrame();
while (PowerPC::GetState() != PowerPC::CPU_POWERDOWN) while (PowerPC::GetState() != PowerPC::CPU_POWERDOWN)
{ {
g_video_backend->PeekMessages(); g_video_backend->PeekMessages();
Common::SleepCurrentThread(20); Common::SleepCurrentThread(20);
} }
// Wait for CpuThread to exit
INFO_LOG(CONSOLE, "%s", StopMessage(true,
"Stopping CPU-GPU thread ...").c_str());
cpuRunloopQuit.Wait();
INFO_LOG(CONSOLE, "%s", StopMessage(true,
"CPU thread stopped.").c_str());
} }
// We have now exited the Video Loop // Wait for g_cpu_thread to exit
INFO_LOG(CONSOLE, "%s", INFO_LOG(CONSOLE, "%s", StopMessage(true, "Stopping CPU-GPU thread ...").c_str());
StopMessage(false, "Stop() and Video Loop Ended").c_str());
// At this point, the CpuThread has already returned in SC mode. g_cpu_thread.join();
// But it may still be waiting in Dual Core mode.
if (cpuThread.joinable()) INFO_LOG(CONSOLE, "%s", StopMessage(true, "CPU thread stopped.").c_str());
{
// There is a CPU thread - join it.
cpuThread.join();
}
VolumeHandler::EjectVolume(); VolumeHandler::EjectVolume();
FileMon::Close(); FileMon::Close();
g_bStopping = false;
} }
// Set or get the running state // Set or get the running state
@ -496,43 +451,39 @@ EState GetState()
return CORE_UNINITIALIZED; return CORE_UNINITIALIZED;
} }
static inline std::string GenerateScreenshotName() static std::string GenerateScreenshotName()
{ {
int index = 1; const std::string& gameId = SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID();
std::string tempname, name; std::string path = File::GetUserPath(D_SCREENSHOTS_IDX) + gameId + DIR_SEP_CHR;
std::string gameId = SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID();
tempname = File::GetUserPath(D_SCREENSHOTS_IDX) + gameId + DIR_SEP_CHR;
if (!File::CreateFullPath(tempname)) if (!File::CreateFullPath(path))
{ {
// fallback to old-style screenshots, without folder. // fallback to old-style screenshots, without folder.
tempname = File::GetUserPath(D_SCREENSHOTS_IDX); path = File::GetUserPath(D_SCREENSHOTS_IDX);
} }
//append gameId, tempname only contains the folder here.
tempname += gameId;
do //append gameId, path only contains the folder here.
name = StringFromFormat("%s-%d.png", tempname.c_str(), index++); path += gameId;
while (File::Exists(name));
std::string name;
for (int i = 1; File::Exists(name = StringFromFormat("%s-%d.png", path.c_str(), i)); ++i)
{}
return name; return name;
} }
void ScreenShot(const std::string& name) void SaveScreenShot()
{ {
bool bPaused = (GetState() == CORE_PAUSE); const bool bPaused = (GetState() == CORE_PAUSE);
SetState(CORE_PAUSE); SetState(CORE_PAUSE);
g_video_backend->Video_Screenshot(name.c_str());
g_video_backend->Video_Screenshot(GenerateScreenshotName().c_str());
if (!bPaused) if (!bPaused)
SetState(CORE_RUN); SetState(CORE_RUN);
} }
void ScreenShot()
{
ScreenShot(GenerateScreenshotName());
}
// Apply Frame Limit and Display FPS info // Apply Frame Limit and Display FPS info
// This should only be called from VI // This should only be called from VI
void VideoThrottle() void VideoThrottle()
@ -630,25 +581,19 @@ void VideoThrottle()
// Executed from GPU thread // Executed from GPU thread
// reports if a frame should be skipped or not // reports if a frame should be skipped or not
// depending on the framelimit set // depending on the framelimit set
bool report_slow(int skipped) bool ShouldSkipFrame(int skipped)
{ {
u32 TargetFPS = (SConfig::GetInstance().m_Framelimit > 1) ? SConfig::GetInstance().m_Framelimit * 5 const u32 TargetFPS = (SConfig::GetInstance().m_Framelimit > 1)
? SConfig::GetInstance().m_Framelimit * 5
: VideoInterface::TargetRefreshRate; : VideoInterface::TargetRefreshRate;
u32 frames = Common::AtomicLoad(DrawnFrame); const u32 frames = Common::AtomicLoad(DrawnFrame);
bool fps_slow = (Timer.GetTimeDifference() < (frames + skipped) * 1000 / TargetFPS) ? false : true; const bool fps_slow = !(Timer.GetTimeDifference() < (frames + skipped) * 1000 / TargetFPS);
return fps_slow; return fps_slow;
} }
// --- Callbacks for backends / engine --- // --- Callbacks for backends / engine ---
// Callback_VideoLog
// WARNING - THIS IS EXECUTED FROM VIDEO THREAD
void Callback_VideoLog(const char *_szMessage)
{
INFO_LOG(VIDEO, "%s", _szMessage);
}
// Should be called from GPU thread when a frame is drawn // Should be called from GPU thread when a frame is drawn
void Callback_VideoCopiedToXFB(bool video_update) void Callback_VideoCopiedToXFB(bool video_update)
{ {
@ -657,36 +602,6 @@ void Callback_VideoCopiedToXFB(bool video_update)
Frame::FrameUpdate(); Frame::FrameUpdate();
} }
// Ask the host for the window size
void Callback_VideoGetWindowSize(int& x, int& y, int& width, int& height)
{
Host_GetRenderWindowSize(x, y, width, height);
}
// Suggest to the host that it sets the window to the given size.
// The host may or may not decide to do this depending on fullscreen or not.
// Sets width and height to the actual size of the window.
void Callback_VideoRequestWindowSize(int& width, int& height)
{
Host_RequestRenderWindowSize(width, height);
}
// Callback_DSPLog
// WARNING - THIS MAY BE EXECUTED FROM DSP THREAD
void Callback_DSPLog(const TCHAR* _szMessage, int _v)
{
GENERIC_LOG(LogTypes::AUDIO, (LogTypes::LOG_LEVELS)_v, "%s", _szMessage);
}
// Callback_DSPInterrupt
// WARNING - THIS MAY BE EXECUTED FROM DSP THREAD
void Callback_DSPInterrupt()
{
DSP::GenerateDSPInterruptFromDSPEmu(DSP::INT_DSP);
}
// Callback_ISOName: Let the DSP emulator get the game name // Callback_ISOName: Let the DSP emulator get the game name
// //
const char *Callback_ISOName() const char *Callback_ISOName()
@ -699,11 +614,4 @@ const char *Callback_ISOName()
return ""; return "";
} }
// Called from ANY thread!
// Pass the message on to the host
void Callback_CoreMessage(int Id)
{
Host_Message(Id);
}
} // Core } // Core

View File

@ -34,11 +34,11 @@
namespace Core namespace Core
{ {
void Callback_VideoLog(const char* _szMessage); // Get core parameters
// TODO: kill, use SConfig instead
extern SCoreStartupParameter g_CoreStartupParameter;
void Callback_VideoCopiedToXFB(bool video_update); void Callback_VideoCopiedToXFB(bool video_update);
void Callback_VideoGetWindowSize(int& x, int& y, int& width, int& height);
void Callback_VideoRequestWindowSize(int& width, int& height);
void Callback_CoreMessage(int Id);
enum EState enum EState
{ {
@ -48,37 +48,33 @@ void Callback_CoreMessage(int Id);
CORE_STOPPING CORE_STOPPING
}; };
// Init core
bool Init(); bool Init();
void Stop(); void Stop();
std::string StopMessage(bool, std::string); std::string StopMessage(bool, std::string);
bool isRunning(); bool IsRunning();
bool IsRunningInCurrentThread(); // this tells us whether we are running in the cpu thread. bool IsRunningInCurrentThread(); // this tells us whether we are running in the cpu thread.
bool IsCPUThread(); // this tells us whether we are the cpu thread. bool IsCPUThread(); // this tells us whether we are the cpu thread.
void SetState(EState _State); void SetState(EState _State);
EState GetState(); EState GetState();
void ScreenShot(const std::string& name); void SaveScreenShot();
void ScreenShot();
// Get core parameters kill use SConfig instead
extern SCoreStartupParameter g_CoreStartupParameter;
void Callback_WiimoteInterruptChannel(int _number, u16 _channelID, const void* _pData, u32 _Size); void Callback_WiimoteInterruptChannel(int _number, u16 _channelID, const void* _pData, u32 _Size);
void* GetWindowHandle(); void* GetWindowHandle();
bool GetRealWiimote();
extern bool bReadTrace;
extern bool bWriteTrace;
void StartTrace(bool write); void StartTrace(bool write);
void DisplayMessage(const std::string &message, int time_in_ms); // This displays messages in a user-visible way.
void DisplayMessage(const char *message, int time_in_ms); // This displays messages in a user-visible way. // This displays messages in a user-visible way.
void DisplayMessage(const char *message, int time_in_ms);
inline void DisplayMessage(const std::string &message, int time_in_ms)
{
DisplayMessage(message.c_str(), time_in_ms);
}
std::string GetStateFileName(); std::string GetStateFileName();
void SetStateFileName(std::string val); void SetStateFileName(std::string val);
@ -87,12 +83,11 @@ void Callback_CoreMessage(int Id);
void SetBlockStart(u32 addr); void SetBlockStart(u32 addr);
void StopTrace(); void StopTrace();
bool report_slow(int skipped); bool ShouldSkipFrame(int skipped);
void VideoThrottle(); void VideoThrottle();
// -----------------------------------------
#ifdef RERECORDING #ifdef RERECORDING
// -----------------
void FrameUpdate(); void FrameUpdate();
void FrameAdvance(); void FrameAdvance();
void FrameStepOnOff(); void FrameStepOnOff();
@ -100,10 +95,12 @@ void Callback_CoreMessage(int Id);
void RerecordingStart(); void RerecordingStart();
void RerecordingStop(); void RerecordingStop();
void WindBack(int Counter); void WindBack(int Counter);
extern int g_FrameCounter; extern int g_FrameCounter;
extern bool g_FrameStep; extern bool g_FrameStep;
#endif #endif
// ---------------------------
} // namespace } // namespace
#endif #endif

View File

@ -101,16 +101,14 @@ void STACKALIGN CheckGatherPipe()
void Write8(const u8 _iValue, const u32 _iAddress) void Write8(const u8 _iValue, const u32 _iAddress)
{ {
// LOG(GPFIFO, "GPFIFO #%x: 0x%02x",ProcessorInterface::Fifo_CPUWritePointer+m_gatherPipeCount, _iValue); // LOG(GPFIFO, "GPFIFO #%x: 0x%02x",ProcessorInterface::Fifo_CPUWritePointer+m_gatherPipeCount, _iValue);
m_gatherPipe[m_gatherPipeCount] = _iValue; FastWrite8(_iValue);
m_gatherPipeCount++;
CheckGatherPipe(); CheckGatherPipe();
} }
void Write16(const u16 _iValue, const u32 _iAddress) void Write16(const u16 _iValue, const u32 _iAddress)
{ {
// LOG(GPFIFO, "GPFIFO #%x: 0x%04x",ProcessorInterface::Fifo_CPUWritePointer+m_gatherPipeCount, _iValue); // LOG(GPFIFO, "GPFIFO #%x: 0x%04x",ProcessorInterface::Fifo_CPUWritePointer+m_gatherPipeCount, _iValue);
*(u16*)(&m_gatherPipe[m_gatherPipeCount]) = Common::swap16(_iValue); FastWrite16(_iValue);
m_gatherPipeCount += 2;
CheckGatherPipe(); CheckGatherPipe();
} }
@ -120,22 +118,20 @@ void Write32(const u32 _iValue, const u32 _iAddress)
// float floatvalue = *(float*)&_iValue; // float floatvalue = *(float*)&_iValue;
// LOG(GPFIFO, "GPFIFO #%x: 0x%08x / %f",ProcessorInterface::Fifo_CPUWritePointer+m_gatherPipeCount, _iValue, floatvalue); // LOG(GPFIFO, "GPFIFO #%x: 0x%08x / %f",ProcessorInterface::Fifo_CPUWritePointer+m_gatherPipeCount, _iValue, floatvalue);
//#endif //#endif
*(u32*)(&m_gatherPipe[m_gatherPipeCount]) = Common::swap32(_iValue); FastWrite32(_iValue);
m_gatherPipeCount += 4;
CheckGatherPipe(); CheckGatherPipe();
} }
void Write64(const u64 _iValue, const u32 _iAddress) void Write64(const u64 _iValue, const u32 _iAddress)
{ {
*(u64*)(&m_gatherPipe[m_gatherPipeCount]) = Common::swap64(_iValue); FastWrite64(_iValue);
m_gatherPipeCount += 8;
CheckGatherPipe(); CheckGatherPipe();
} }
void FastWrite8(const u8 _iValue) void FastWrite8(const u8 _iValue)
{ {
m_gatherPipe[m_gatherPipeCount] = _iValue; m_gatherPipe[m_gatherPipeCount] = _iValue;
m_gatherPipeCount++; ++m_gatherPipeCount;
} }
void FastWrite16(const u16 _iValue) void FastWrite16(const u16 _iValue)

View File

@ -347,7 +347,7 @@ static const MemoryView views[] =
}; };
static const int num_views = sizeof(views) / sizeof(MemoryView); static const int num_views = sizeof(views) / sizeof(MemoryView);
bool Init() void Init()
{ {
bool wii = SConfig::GetInstance().m_LocalCoreStartupParameter.bWii; bool wii = SConfig::GetInstance().m_LocalCoreStartupParameter.bWii;
bFakeVMEM = SConfig::GetInstance().m_LocalCoreStartupParameter.iTLBHack == 1; bFakeVMEM = SConfig::GetInstance().m_LocalCoreStartupParameter.iTLBHack == 1;
@ -366,7 +366,6 @@ bool Init()
INFO_LOG(MEMMAP, "Memory system initialized. RAM at %p (mirrors at 0 @ %p, 0x80000000 @ %p , 0xC0000000 @ %p)", INFO_LOG(MEMMAP, "Memory system initialized. RAM at %p (mirrors at 0 @ %p, 0x80000000 @ %p , 0xC0000000 @ %p)",
m_pRAM, m_pPhysicalRAM, m_pVirtualCachedRAM, m_pVirtualUncachedRAM); m_pRAM, m_pPhysicalRAM, m_pVirtualCachedRAM, m_pVirtualUncachedRAM);
m_IsInitialized = true; m_IsInitialized = true;
return true;
} }
void DoState(PointerWrap &p) void DoState(PointerWrap &p)
@ -379,7 +378,7 @@ void DoState(PointerWrap &p)
p.DoArray(m_pEXRAM, EXRAM_SIZE); p.DoArray(m_pEXRAM, EXRAM_SIZE);
} }
bool Shutdown() void Shutdown()
{ {
m_IsInitialized = false; m_IsInitialized = false;
u32 flags = 0; u32 flags = 0;
@ -389,7 +388,6 @@ bool Shutdown()
g_arena.ReleaseSpace(); g_arena.ReleaseSpace();
base = NULL; base = NULL;
INFO_LOG(MEMMAP, "Memory system shut down."); INFO_LOG(MEMMAP, "Memory system shut down.");
return true;
} }
void Clear() void Clear()

View File

@ -83,8 +83,8 @@ enum
// Init and Shutdown // Init and Shutdown
bool IsInitialized(); bool IsInitialized();
bool Init(); void Init();
bool Shutdown(); void Shutdown();
void DoState(PointerWrap &p); void DoState(PointerWrap &p);
void Clear(); void Clear();

View File

@ -45,7 +45,6 @@ void Host_NotifyMapLoaded();
void Host_RefreshDSPDebuggerWindow(); void Host_RefreshDSPDebuggerWindow();
void Host_RequestRenderWindowSize(int width, int height); void Host_RequestRenderWindowSize(int width, int height);
void Host_SetStartupDebuggingParameters(); void Host_SetStartupDebuggingParameters();
void Host_SetWaitCursor(bool enable);
void Host_SetWiiMoteConnectionState(int _State); void Host_SetWiiMoteConnectionState(int _State);
void Host_ShowJitResults(unsigned int address); void Host_ShowJitResults(unsigned int address);
void Host_SysMessage(const char *fmt, ...); void Host_SysMessage(const char *fmt, ...);

View File

@ -139,7 +139,7 @@ void FrameSkipping()
std::lock_guard<std::mutex> lk(cs_frameSkip); std::lock_guard<std::mutex> lk(cs_frameSkip);
g_frameSkipCounter++; g_frameSkipCounter++;
if (g_frameSkipCounter > g_framesToSkip || Core::report_slow(g_frameSkipCounter) == false) if (g_frameSkipCounter > g_framesToSkip || Core::ShouldSkipFrame(g_frameSkipCounter) == false)
g_frameSkipCounter = 0; g_frameSkipCounter = 0;
g_video_backend->Video_SetRendering(!g_frameSkipCounter); g_video_backend->Video_SetRendering(!g_frameSkipCounter);
@ -200,7 +200,7 @@ bool BeginRecordingInput(int controllers)
if(File::Exists(g_recordFile)) if(File::Exists(g_recordFile))
File::Delete(g_recordFile); File::Delete(g_recordFile);
if (Core::isRunning()) if (Core::IsRunning())
{ {
const std::string stateFilename = g_recordFile + ".sav"; const std::string stateFilename = g_recordFile + ".sav";
if(File::Exists(stateFilename)) if(File::Exists(stateFilename))

View File

@ -151,12 +151,9 @@ CPanel::CPanel(
case WIIMOTE_DISCONNECT: case WIIMOTE_DISCONNECT:
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
{ {
if (main_frame->bNoWiimoteMsg) const int wiimote_idx = lParam;
main_frame->bNoWiimoteMsg = false; const int wiimote_num = wiimote_idx + 1;
else
{
int wiimote_idx = lParam;
int wiimote_num = wiimote_idx + 1;
//Auto reconnect if option is turned on. //Auto reconnect if option is turned on.
//TODO: Make this only auto reconnect wiimotes that have the option activated. //TODO: Make this only auto reconnect wiimotes that have the option activated.
SConfig::GetInstance().LoadSettingsWii();//Make sure we are using the newest settings. SConfig::GetInstance().LoadSettingsWii();//Make sure we are using the newest settings.
@ -182,7 +179,6 @@ CPanel::CPanel(
} }
} }
} }
}
break; break;
default: default:
// By default let wxWidgets do what it normally does with this event // By default let wxWidgets do what it normally does with this event
@ -341,7 +337,6 @@ CFrame::CFrame(wxFrame* parent,
long style) long style)
: CRenderFrame(parent, id, title, pos, size, style) : CRenderFrame(parent, id, title, pos, size, style)
, g_pCodeWindow(NULL), g_NetPlaySetupDiag(NULL), g_CheatsWindow(NULL) , g_pCodeWindow(NULL), g_NetPlaySetupDiag(NULL), g_CheatsWindow(NULL)
, bRenderToMain(false), bNoWiimoteMsg(false)
, m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL) , m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL)
, m_GameListCtrl(NULL), m_Panel(NULL) , m_GameListCtrl(NULL), m_Panel(NULL)
, m_RenderFrame(NULL), m_RenderParent(NULL) , m_RenderFrame(NULL), m_RenderParent(NULL)
@ -602,22 +597,10 @@ void CFrame::OnResize(wxSizeEvent& event)
#ifdef _WIN32 #ifdef _WIN32
WXLRESULT CFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) WXLRESULT CFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{ {
switch (nMsg) if (WM_SYSCOMMAND == nMsg && (SC_SCREENSAVE == wParam || SC_MONITORPOWER == wParam))
{
case WM_SYSCOMMAND:
switch (wParam & 0xFFF0)
{
case SC_SCREENSAVE:
case SC_MONITORPOWER:
break;
default:
return wxFrame::MSWWindowProc(nMsg, wParam, lParam);
}
break;
default:
return wxFrame::MSWWindowProc(nMsg, wParam, lParam);
}
return 0; return 0;
else
return wxFrame::MSWWindowProc(nMsg, wParam, lParam);
} }
#endif #endif
@ -887,7 +870,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
DoStop(); DoStop();
// Screenshot hotkey // Screenshot hotkey
else if (IsHotkey(event, HK_SCREENSHOT)) else if (IsHotkey(event, HK_SCREENSHOT))
Core::ScreenShot(); Core::SaveScreenShot();
// Wiimote connect and disconnect hotkeys // Wiimote connect and disconnect hotkeys
else if (IsHotkey(event, HK_WIIMOTE1_CONNECT)) else if (IsHotkey(event, HK_WIIMOTE1_CONNECT))
WiimoteId = 0; WiimoteId = 0;

View File

@ -116,12 +116,11 @@ class CFrame : public CRenderFrame
CCodeWindow* g_pCodeWindow; CCodeWindow* g_pCodeWindow;
NetPlaySetupDiag* g_NetPlaySetupDiag; NetPlaySetupDiag* g_NetPlaySetupDiag;
wxCheatsWindow* g_CheatsWindow; wxCheatsWindow* g_CheatsWindow;
void InitBitmaps(); void InitBitmaps();
void DoPause(); void DoPause();
void DoStop(); void DoStop();
void DoRecordingSave(); void DoRecordingSave();
bool bRenderToMain;
bool bNoWiimoteMsg;
void UpdateGUI(); void UpdateGUI();
void UpdateGameList(); void UpdateGameList();
void ToggleLogWindow(bool bShow); void ToggleLogWindow(bool bShow);
@ -140,12 +139,13 @@ class CFrame : public CRenderFrame
void ToggleDisplayMode (bool bFullscreen); void ToggleDisplayMode (bool bFullscreen);
static void ConnectWiimote(int wm_idx, bool connect); static void ConnectWiimote(int wm_idx, bool connect);
std::recursive_mutex keystate_lock;
const CGameListCtrl *GetGameListCtrl() const; const CGameListCtrl *GetGameListCtrl() const;
#ifdef __WXGTK__ #ifdef __WXGTK__
Common::Event panic_event; Common::Event panic_event;
bool bPanicResult; bool bPanicResult;
std::recursive_mutex keystate_lock; std::mutex keystate_lock;
#endif #endif
#if defined(HAVE_XRANDR) && HAVE_XRANDR #if defined(HAVE_XRANDR) && HAVE_XRANDR

View File

@ -922,6 +922,8 @@ void CFrame::StartGame(const std::string& filename)
m_RenderFrame->Show(); m_RenderFrame->Show();
} }
wxBeginBusyCursor();
if (!BootManager::BootCore(filename)) if (!BootManager::BootCore(filename))
{ {
// Destroy the renderer frame when not rendering to main // Destroy the renderer frame when not rendering to main
@ -971,6 +973,8 @@ void CFrame::StartGame(const std::string& filename)
wxSizeEventHandler(CFrame::OnRenderParentResize), wxSizeEventHandler(CFrame::OnRenderParentResize),
(wxObject*)0, this); (wxObject*)0, this);
} }
wxEndBusyCursor();
} }
void CFrame::OnBootDrive(wxCommandEvent& event) void CFrame::OnBootDrive(wxCommandEvent& event)
@ -978,7 +982,6 @@ void CFrame::OnBootDrive(wxCommandEvent& event)
BootGame(drives[event.GetId()-IDM_DRIVE1]); BootGame(drives[event.GetId()-IDM_DRIVE1]);
} }
// Refresh the file list and browse for a favorites directory // Refresh the file list and browse for a favorites directory
void CFrame::OnRefresh(wxCommandEvent& WXUNUSED (event)) void CFrame::OnRefresh(wxCommandEvent& WXUNUSED (event))
{ {
@ -994,7 +997,7 @@ void CFrame::OnBrowse(wxCommandEvent& WXUNUSED (event))
// Create screenshot // Create screenshot
void CFrame::OnScreenshot(wxCommandEvent& WXUNUSED (event)) void CFrame::OnScreenshot(wxCommandEvent& WXUNUSED (event))
{ {
Core::ScreenShot(); Core::SaveScreenShot();
} }
// Pause the emulation // Pause the emulation
@ -1048,7 +1051,9 @@ void CFrame::DoStop()
if(Frame::IsPlayingInput() || Frame::IsRecordingInput()) if(Frame::IsPlayingInput() || Frame::IsRecordingInput())
Frame::EndPlayInput(false); Frame::EndPlayInput(false);
wxBeginBusyCursor();
BootManager::Stop(); BootManager::Stop();
wxEndBusyCursor();
#if defined(HAVE_XDG_SCREENSAVER) && HAVE_XDG_SCREENSAVER #if defined(HAVE_XDG_SCREENSAVER) && HAVE_XDG_SCREENSAVER
X11Utils::InhibitScreensaver(X11Utils::XDisplayFromHandle(GetHandle()), X11Utils::InhibitScreensaver(X11Utils::XDisplayFromHandle(GetHandle()),
@ -1353,7 +1358,7 @@ void CFrame::OnLoadWiiMenu(wxCommandEvent& event)
void CFrame::ConnectWiimote(int wm_idx, bool connect) void CFrame::ConnectWiimote(int wm_idx, bool connect)
{ {
if (Core::isRunning() && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) if (Core::IsRunning() && SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
{ {
GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->Activate(connect); GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->Activate(connect);
wxString msg(wxString::Format(wxT("Wiimote %i %s"), wm_idx + 1, wxString msg(wxString::Format(wxT("Wiimote %i %s"), wm_idx + 1,
@ -1461,7 +1466,7 @@ 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;

View File

@ -51,10 +51,6 @@
IMPLEMENT_APP(DolphinApp) IMPLEMENT_APP(DolphinApp)
BEGIN_EVENT_TABLE(DolphinApp, wxApp)
EVT_TIMER(wxID_ANY, DolphinApp::AfterInit)
END_EVENT_TABLE()
#include <wx/stdpaths.h> #include <wx/stdpaths.h>
bool wxMsgAlert(const char*, const char*, bool, int); bool wxMsgAlert(const char*, const char*, bool, int);
std::string wxStringTranslator(const char *); std::string wxStringTranslator(const char *);
@ -325,12 +321,6 @@ bool DolphinApp::OnInit()
SetTopWindow(main_frame); SetTopWindow(main_frame);
main_frame->SetMinSize(wxSize(400, 300)); main_frame->SetMinSize(wxSize(400, 300));
// Postpone final actions until event handler is running.
// Updating the game list makes use of wxProgressDialog which may
// only be run after OnInit() when the event handler is running.
m_afterinit = new wxTimer(this, wxID_ANY);
m_afterinit->Start(1, wxTIMER_ONE_SHOT);
return true; return true;
} }
@ -339,15 +329,12 @@ void DolphinApp::MacOpenFile(const wxString &fileName)
FileToLoad = fileName; FileToLoad = fileName;
LoadFile = true; LoadFile = true;
if (m_afterinit == NULL) if (IsMainLoopRunning())
main_frame->BootGame(std::string(FileToLoad.mb_str())); main_frame->BootGame(std::string(FileToLoad.mb_str()));
} }
void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event)) int DolphinApp::MainLoop()
{ {
delete m_afterinit;
m_afterinit = NULL;
if (!BatchMode) if (!BatchMode)
main_frame->UpdateGameList(); main_frame->UpdateGameList();
@ -375,6 +362,8 @@ void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event))
} }
} }
} }
return wxApp::MainLoop();
} }
void DolphinApp::InitLanguageSupport() void DolphinApp::InitLanguageSupport()
@ -582,7 +571,7 @@ void Host_UpdateBreakPointView()
bool Host_GetKeyState(int keycode) bool Host_GetKeyState(int keycode)
{ {
#ifdef _WIN32 #ifdef _WIN32
return GetAsyncKeyState(keycode); return (0 != GetAsyncKeyState(keycode));
#elif defined __WXGTK__ #elif defined __WXGTK__
std::unique_lock<std::recursive_mutex> lk(main_frame->keystate_lock, std::try_to_lock); std::unique_lock<std::recursive_mutex> lk(main_frame->keystate_lock, std::try_to_lock);
if (!lk.owns_lock()) if (!lk.owns_lock())
@ -627,14 +616,6 @@ void Host_SetStartupDebuggingParameters()
StartUp.bEnableDebugging = main_frame->g_pCodeWindow ? true : false; // RUNNING_DEBUG StartUp.bEnableDebugging = main_frame->g_pCodeWindow ? true : false; // RUNNING_DEBUG
} }
void Host_SetWaitCursor(bool enable)
{
if (enable)
wxBeginBusyCursor();
else
wxEndBusyCursor();
}
void Host_UpdateStatusBar(const char* _pText, int Field) void Host_UpdateStatusBar(const char* _pText, int Field)
{ {
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATESTATUSBAR); wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATESTATUSBAR);

View File

@ -35,15 +35,12 @@ private:
void InitLanguageSupport(); void InitLanguageSupport();
void MacOpenFile(const wxString &fileName); void MacOpenFile(const wxString &fileName);
DECLARE_EVENT_TABLE()
wxTimer *m_afterinit;
bool BatchMode; bool BatchMode;
bool LoadFile; bool LoadFile;
wxString FileToLoad; wxString FileToLoad;
wxLocale *m_locale; wxLocale *m_locale;
void AfterInit(wxTimerEvent& WXUNUSED(event)); int MainLoop();
}; };
DECLARE_APP(DolphinApp); DECLARE_APP(DolphinApp);

View File

@ -146,7 +146,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
// If a game from the game list is running, show the game specific config; show the default config otherwise // If a game from the game list is running, show the game specific config; show the default config otherwise
cur_profile = 0; cur_profile = 0;
if (Core::isRunning()) if (Core::IsRunning())
{ {
// Search which ISO has been started // Search which ISO has been started
for (long index = GameListCtrl->GetNextItem(-1); index != -1; index = GameListCtrl->GetNextItem(index)) for (long index = GameListCtrl->GetNextItem(-1); index != -1; index = GameListCtrl->GetNextItem(index))
@ -196,7 +196,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
profile_cb->Select(cur_profile); profile_cb->Select(cur_profile);
_connect_macro_(profile_cb, VideoConfigDiag::Event_OnProfileChange, wxEVT_COMMAND_CHOICE_SELECTED, this); _connect_macro_(profile_cb, VideoConfigDiag::Event_OnProfileChange, wxEVT_COMMAND_CHOICE_SELECTED, this);
profile_cb->Enable(!Core::isRunning()); profile_cb->Enable(!Core::IsRunning());
// adapter // for D3D only // adapter // for D3D only
if (vconfig.backend_info.Adapters.size()) if (vconfig.backend_info.Adapters.size())
@ -545,7 +545,7 @@ void VideoConfigDiag::OnUpdateUI(wxUpdateUIEvent& ev)
// If emulation hasn't started, yet, always update g_Config. // If emulation hasn't started, yet, always update g_Config.
// Otherwise only update it if we're editing the currently running game's profile // Otherwise only update it if we're editing the currently running game's profile
if (!Core::isRunning()) if (!Core::IsRunning())
{ {
g_Config = vconfig; g_Config = vconfig;
} }

View File

@ -24,6 +24,7 @@
#include "RenderBase.h" #include "RenderBase.h"
#include "VideoBackendBase.h" #include "VideoBackendBase.h"
#include "Core.h" #include "Core.h"
#include "Host.h"
namespace EmuWindow namespace EmuWindow
{ {
@ -190,7 +191,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
if (m_hParent == NULL) if (m_hParent == NULL)
{ {
// Stop the game // Stop the game
PostMessage(m_hParent, WM_USER, WM_USER_STOP, 0); //PostMessage(m_hParent, WM_USER, WM_USER_STOP, 0);
} }
break; break;
@ -319,7 +320,7 @@ HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title)
// 3. Request window sizes which actually make the client area map to a common resolution // 3. Request window sizes which actually make the client area map to a common resolution
HWND Ret; HWND Ret;
int x=0, y=0, width=640, height=480; int x=0, y=0, width=640, height=480;
Core::Callback_VideoGetWindowSize(x, y, width, height); Host_GetRenderWindowSize(x, y, width, height);
// TODO: Don't show if fullscreen // TODO: Don't show if fullscreen
Ret = OpenWindow(hParent, hInstance, width, height, title); Ret = OpenWindow(hParent, hInstance, width, height, title);

View File

@ -213,7 +213,7 @@ bool FifoCommandRunnable()
"* Some other sort of bug\n\n" "* Some other sort of bug\n\n"
"Dolphin will now likely crash or hang. Enjoy." , cmd_byte); "Dolphin will now likely crash or hang. Enjoy." , cmd_byte);
Host_SysMessage(szTemp); Host_SysMessage(szTemp);
Core::Callback_VideoLog(szTemp); INFO_LOG(VIDEO, "%s", szTemp);
{ {
SCPFifoStruct &fifo = CommandProcessor::fifo; SCPFifoStruct &fifo = CommandProcessor::fifo;
@ -238,7 +238,7 @@ bool FifoCommandRunnable()
,fifo.bFF_Breakpoint ? "true" : "false"); ,fifo.bFF_Breakpoint ? "true" : "false");
Host_SysMessage(szTmp); Host_SysMessage(szTmp);
Core::Callback_VideoLog(szTmp); INFO_LOG(VIDEO, "%s", szTmp);
} }
} }
break; break;

View File

@ -35,6 +35,7 @@
#include "Fifo.h" #include "Fifo.h"
#include "Timer.h" #include "Timer.h"
#include "StringUtil.h" #include "StringUtil.h"
#include "Host.h"
#include <cmath> #include <cmath>
#include <string> #include <string>
@ -318,6 +319,19 @@ void Renderer::CalculateXYScale(const TargetRectangle& dst_rect)
} }
} }
void Renderer::SetWindowSize(int width, int height)
{
if (width < 1)
width = 1;
if (height < 1)
height = 1;
// Scale the window size by the EFB scale.
CalculateTargetScale(width, height, width, height);
Host_RequestRenderWindowSize(width, height);
}
void UpdateViewport() void UpdateViewport()
{ {
g_renderer->UpdateViewport(); g_renderer->UpdateViewport();

View File

@ -84,6 +84,8 @@ public:
static float GetXFBScaleX() { return xScale; } static float GetXFBScaleX() { return xScale; }
static float GetXFBScaleY() { return yScale; } static float GetXFBScaleY() { return yScale; }
static void SetWindowSize(int width, int height);
// EFB coordinate conversion functions // EFB coordinate conversion functions
// Use this to convert a whole native EFB rect to backbuffer coordinates // Use this to convert a whole native EFB rect to backbuffer coordinates

View File

@ -41,6 +41,7 @@
#include "Core.h" #include "Core.h"
#include "OnFrame.h" #include "OnFrame.h"
#include "Television.h" #include "Television.h"
#include "Host.h"
namespace DX11 namespace DX11
{ {
@ -321,7 +322,7 @@ Renderer::Renderer()
int x, y, w_temp, h_temp; int x, y, w_temp, h_temp;
s_blendMode = 0; s_blendMode = 0;
Core::Callback_VideoGetWindowSize(x, y, w_temp, h_temp); Host_GetRenderWindowSize(x, y, w_temp, h_temp);
D3D::Create(EmuWindow::GetWnd()); D3D::Create(EmuWindow::GetWnd());
@ -445,19 +446,6 @@ bool Renderer::CheckForResize()
return false; return false;
} }
void Renderer::SetWindowSize(int width, int height)
{
if (width < 1)
width = 1;
if (height < 1)
height = 1;
// Scale the window size by the EFB scale.
CalculateTargetScale(width, height, width, height);
Core::Callback_VideoRequestWindowSize(width, height);
}
bool Renderer::SetScissorRect() bool Renderer::SetScissorRect()
{ {
TargetRectangle rc; TargetRectangle rc;

View File

@ -51,7 +51,6 @@ public:
bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc); bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc);
static bool CheckForResize(); static bool CheckForResize();
static void SetWindowSize(int width, int height);
void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4); void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4);
void SetPSConstant4fv(unsigned int const_number, const float *f); void SetPSConstant4fv(unsigned int const_number, const float *f);

View File

@ -30,6 +30,7 @@
#include "VertexLoaderManager.h" #include "VertexLoaderManager.h"
#include "VertexShaderManager.h" #include "VertexShaderManager.h"
#include "Core.h" #include "Core.h"
#include "Host.h"
#include "Debugger/DebuggerPanel.h" #include "Debugger/DebuggerPanel.h"
#include "DLCache.h" #include "DLCache.h"
@ -204,7 +205,7 @@ void VideoBackend::Video_Prepare()
DLCache::Init(); DLCache::Init();
// Tell the host that the window is ready // Tell the host that the window is ready
Core::Callback_CoreMessage(WM_USER_CREATE); Host_Message(WM_USER_CREATE);
} }
void VideoBackend::Shutdown() void VideoBackend::Shutdown()

View File

@ -26,6 +26,7 @@
#include "Thread.h" #include "Thread.h"
#include "Timer.h" #include "Timer.h"
#include "Statistics.h" #include "Statistics.h"
#include "Host.h"
#include "VideoConfig.h" #include "VideoConfig.h"
#include "main.h" #include "main.h"
@ -258,7 +259,7 @@ Renderer::Renderer()
// Multisample Anti-aliasing hasn't been implemented yet use supersamling instead // Multisample Anti-aliasing hasn't been implemented yet use supersamling instead
int backbuffer_ms_mode = 0; int backbuffer_ms_mode = 0;
Core::Callback_VideoGetWindowSize(x, y, w_temp, h_temp); Host_GetRenderWindowSize(x, y, w_temp, h_temp);
for (fullScreenRes = 0; fullScreenRes < (int)D3D::GetAdapter(g_ActiveConfig.iAdapter).resolutions.size(); fullScreenRes++) for (fullScreenRes = 0; fullScreenRes < (int)D3D::GetAdapter(g_ActiveConfig.iAdapter).resolutions.size(); fullScreenRes++)
{ {
@ -425,19 +426,6 @@ bool Renderer::CheckForResize()
return false; return false;
} }
void Renderer::SetWindowSize(int width, int height)
{
if (width < 1)
width = 1;
if (height < 1)
height = 1;
// Scale the window size by the EFB scale.
CalculateTargetScale(width, height, width, height);
Core::Callback_VideoRequestWindowSize(width, height);
}
bool Renderer::SetScissorRect() bool Renderer::SetScissorRect()
{ {
TargetRectangle rc; TargetRectangle rc;

View File

@ -47,7 +47,6 @@ public:
bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc); bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc);
static bool CheckForResize(); static bool CheckForResize();
static void SetWindowSize(int width, int height);
void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4); void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4);
void SetPSConstant4fv(unsigned int const_number, const float *f); void SetPSConstant4fv(unsigned int const_number, const float *f);

View File

@ -53,6 +53,7 @@
#include "DLCache.h" #include "DLCache.h"
#include "IniFile.h" #include "IniFile.h"
#include "Core.h" #include "Core.h"
#include "Host.h"
#include "ConfigManager.h" #include "ConfigManager.h"
#include "VideoBackend.h" #include "VideoBackend.h"
@ -185,7 +186,7 @@ void VideoBackend::Video_Prepare()
DLCache::Init(); DLCache::Init();
// Notify the core that the video backend is ready // Notify the core that the video backend is ready
Core::Callback_CoreMessage(WM_USER_CREATE); Host_Message(WM_USER_CREATE);
} }
void VideoBackend::Shutdown() void VideoBackend::Shutdown()

View File

@ -296,7 +296,7 @@ void XEventThread()
case ClientMessage: case ClientMessage:
if ((unsigned long) event.xclient.data.l[0] == if ((unsigned long) event.xclient.data.l[0] ==
XInternAtom(GLWin.evdpy, "WM_DELETE_WINDOW", False)) XInternAtom(GLWin.evdpy, "WM_DELETE_WINDOW", False))
Core::Callback_CoreMessage(WM_USER_STOP); Host_Message(WM_USER_STOP);
if ((unsigned long) event.xclient.data.l[0] == if ((unsigned long) event.xclient.data.l[0] ==
XInternAtom(GLWin.evdpy, "RESIZE", False)) XInternAtom(GLWin.evdpy, "RESIZE", False))
XMoveResizeWindow(GLWin.evdpy, GLWin.win, XMoveResizeWindow(GLWin.evdpy, GLWin.win,
@ -317,7 +317,7 @@ void XEventThread()
bool OpenGL_Create(void *&window_handle) bool OpenGL_Create(void *&window_handle)
{ {
int _tx, _ty, _twidth, _theight; int _tx, _ty, _twidth, _theight;
Core::Callback_VideoGetWindowSize(_tx, _ty, _twidth, _theight); Host_GetRenderWindowSize(_tx, _ty, _twidth, _theight);
// Control window size and picture scaling // Control window size and picture scaling
s_backbuffer_width = _twidth; s_backbuffer_width = _twidth;
@ -519,7 +519,7 @@ bool OpenGL_MakeCurrent()
return wglMakeCurrent(hDC, hRC) ? true : false; return wglMakeCurrent(hDC, hRC) ? true : false;
#elif defined(HAVE_X11) && HAVE_X11 #elif defined(HAVE_X11) && HAVE_X11
#if defined(HAVE_WX) && (HAVE_WX) #if defined(HAVE_WX) && (HAVE_WX)
Core::Callback_VideoGetWindowSize(GLWin.x, GLWin.y, Host_GetRenderWindowSize(GLWin.x, GLWin.y,
(int&)GLWin.width, (int&)GLWin.height); (int&)GLWin.width, (int&)GLWin.height);
XMoveResizeWindow(GLWin.dpy, GLWin.win, GLWin.x, GLWin.y, XMoveResizeWindow(GLWin.dpy, GLWin.win, GLWin.x, GLWin.y,
GLWin.width, GLWin.height); GLWin.width, GLWin.height);

View File

@ -59,6 +59,7 @@
#include "Debugger.h" #include "Debugger.h"
#include "Core.h" #include "Core.h"
#include "OnFrame.h" #include "OnFrame.h"
#include "Host.h"
#include "main.h" // Local #include "main.h" // Local
#ifdef _WIN32 #ifdef _WIN32
@ -1613,17 +1614,4 @@ bool Renderer::SaveScreenshot(const std::string &filename, const TargetRectangle
return result; return result;
} }
void Renderer::SetWindowSize(int width, int height)
{
if (width < 1)
width = 1;
if (height < 1)
height = 1;
// Scale the window size by the EFB scale.
CalculateTargetScale(width, height, width, height);
Core::Callback_VideoRequestWindowSize(width, height);
}
} }

View File

@ -49,8 +49,6 @@ public:
bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc); bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc);
void SetWindowSize(int width, int height);
void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4); void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4);
void SetPSConstant4fv(unsigned int const_number, const float *f); void SetPSConstant4fv(unsigned int const_number, const float *f);
void SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float *f); void SetMultiPSConstant4fv(unsigned int const_number, unsigned int count, const float *f);

View File

@ -92,6 +92,7 @@ Make AA apply instantly during gameplay if possible
#include "DLCache.h" #include "DLCache.h"
#include "FramebufferManager.h" #include "FramebufferManager.h"
#include "Core.h" #include "Core.h"
#include "Host.h"
#include "VideoState.h" #include "VideoState.h"
#include "VideoBackend.h" #include "VideoBackend.h"
@ -211,7 +212,7 @@ void VideoBackend::Video_Prepare()
DLCache::Init(); DLCache::Init();
// Notify the core that the video backend is ready // Notify the core that the video backend is ready
Core::Callback_CoreMessage(WM_USER_CREATE); Host_Message(WM_USER_CREATE);
} }
void VideoBackend::Shutdown() void VideoBackend::Shutdown()

View File

@ -69,7 +69,7 @@ bool VideoBackend::Initialize(void *&window_handle)
if (!OpenGL_Create(window_handle)) if (!OpenGL_Create(window_handle))
{ {
Core::Callback_VideoLog("SWRenderer::Create failed\n"); INFO_LOG(VIDEO, "%s", "SWRenderer::Create failed\n");
return false; return false;
} }