Core Stop and Start: Fixed stop and start again by avoiding FreeLibrary() of the OpenGL plugin, and avoiding a crash in its ShutDown() function. You need to use SETUP_FREE_PLUGIN_ON_BOOT to compile with this option that works on my system. Also, I noticed that I don't need the SETUP_AVOID_CHILD_WINDOW_RENDERING_HANG anymore, I can now delete the g_EmuThread without having it hanging in its waiting function.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2356 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-02-22 04:24:53 +00:00
parent 5057d3b446
commit fc6a7c47d5
10 changed files with 98 additions and 45 deletions

View File

@ -44,7 +44,7 @@ IUCode* UCodeFactory(u32 _CRC, CMailHandler& _rMailHandler)
case 0xd73338cf: // IPL
case 0x42f64ac4: // Luigi (after fix)
case 0x4be6a5cb: // AC, Pikmin (after fix)
printf("JAC ucode chosen");
Console::Print("JAC ucode chosen\n");
return new CUCode_Jac(_rMailHandler);
case 0x3ad3b7ac: // Naruto3
@ -56,20 +56,20 @@ IUCode* UCodeFactory(u32 _CRC, CMailHandler& _rMailHandler)
case 0x07f88145: // bustamove, ikaruga, fzero, robotech battle cry, star soldier, soul calibur2,
// Zelda:OOT, Tony hawk, viewtiful joe
case 0xe2136399: // billy hatcher, dragonballz, mario party 5, TMNT, ava1080
printf("AX ucode chosen, yay!");
Console::Print("AX ucode chosen, yay!\n");
return new CUCode_AX(_rMailHandler);
case 0x6CA33A6D: // DK Jungle Beat
case 0x86840740: // zelda
case 0x56d36052: // mario
case 0x2fcdf1ec: // mariokart, zelda 4 swords
printf("Zelda ucode chosen");
Console::Print("Zelda ucode chosen\n");
return new CUCode_Zelda(_rMailHandler);
// WII CRCs
case 0x6c3f6f94: // zelda - PAL
case 0xd643001f: // mario galaxy - PAL
printf("Zelda Wii ucode chosen");
Console::Print("Zelda Wii ucode chosen\n");
return new CUCode_Zelda(_rMailHandler);
case 0x5ef56da3: // AX demo
@ -78,7 +78,7 @@ IUCode* UCodeFactory(u32 _CRC, CMailHandler& _rMailHandler)
case 0xadbc06bd: // Elebits
case 0xb7eb9a9c: // Wii Pikmin - JAP
case 0x4cc52064: // Bleach: Versus Crusade
printf("Wii - AXWii chosen");
Console::Print("Wii - AXWii chosen\n");
return new CUCode_AXWii(_rMailHandler, _CRC);
default:

View File

@ -73,11 +73,19 @@ ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &titl
// ---------------
ConfigDialog::~ConfigDialog()
{
Console::Print("ConfigDialog Closed\n");
}
void ConfigDialog::OnClose(wxCloseEvent& event)
{
// notice that we don't run wxEntryCleanup(); here so the dll will still be loaded
g_Config.Save();
Console::Print("OnClose\n");
// notice that we don't run wxEntryCleanup(); here so the dll will still be loaded
/* JP: Yes, it seems like Close() does not do that. It only runs EndModal() or something
similar to hide the window. And I don't understand the "Window deletion overview" on
the wxWidgets website. Destroy() doesn't run the destructor either. */
//wxEntryCleanup();
//EndModal(0);
// Allow wxWidgets to close and unload the window
@ -86,7 +94,13 @@ void ConfigDialog::OnClose(wxCloseEvent& event)
void ConfigDialog::CloseClick(wxCommandEvent& WXUNUSED (event))
{
Close();
Console::Print("CloseClick\n");
g_Config.Save();
wxEntryCleanup();
//Close();
}
///////////////////////////////

View File

@ -50,6 +50,7 @@
#include "XFBConvert.h"
#include "TextureConverter.h"
#include "OnScreenDisplay.h"
#include "Setup.h"
#include "VideoState.h"
///////////////////////////////////////////////
@ -96,8 +97,27 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
{
}
// This is used for the fuctions right below here, in DllConfig()
#if defined(HAVE_WX) && HAVE_WX
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
extern HINSTANCE g_hInstance;
#endif
void DllConfig(HWND _hParent)
{
#if defined(HAVE_WX) && HAVE_WX
// This is needed because now we use wxEntryCleanup() when closing the configuration window
if (!wxTheApp || !wxTheApp->CallOnInit())
{
wxSetInstance((HINSTANCE)g_hInstance);
int argc = 0;
char **argv = NULL;
wxEntryStart(argc, argv);
}
#endif
//Console::Open();
#if defined(_WIN32)
wxWindow *win = new wxWindow();
win->SetHWND((WXHWND)_hParent);
@ -205,6 +225,8 @@ void DllConfig(HWND _hParent)
void Initialize(void *init)
{
//Console::Open();
frameCount = 0;
SVideoInitialize *_pVideoInitialize = (SVideoInitialize*)init;
g_VideoInitialize = *(_pVideoInitialize); // Create a shortcut to _pVideoInitialize that can also update it
@ -276,20 +298,29 @@ void Video_Prepare(void)
void Shutdown(void)
{
Fifo_Shutdown();
TextureConverter::Shutdown();
VertexLoaderManager::Shutdown();
VertexShaderCache::Shutdown();
VertexShaderManager::Shutdown();
PixelShaderManager::Shutdown();
PixelShaderCache::Shutdown();
VertexManager::Shutdown();
TextureMngr::Shutdown();
OpcodeDecoder_Shutdown();
Renderer::Shutdown();
OpenGL_Shutdown();
Fifo_Shutdown();
TextureConverter::Shutdown();
VertexLoaderManager::Shutdown();
VertexShaderCache::Shutdown();
VertexShaderManager::Shutdown();
PixelShaderManager::Shutdown();
PixelShaderCache::Shutdown();
VertexManager::Shutdown();
// This cause some kind of crash, at least in the Release build and with this setup option
// If there wasn't so little explanations and comments in this code I would be more interested
// in trying to fix this function, now I'll just leave it like this, because it works
#ifndef SETUP_FREE_PLUGIN_ON_BOOT
TextureMngr::Shutdown();
#endif
OpcodeDecoder_Shutdown();
Renderer::Shutdown();
OpenGL_Shutdown();
}
//////////////////////////////////////////////////////////////////////////////////////////
// Enter and exit the video loop
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void Video_EnterLoop()
{
Fifo_EnterLoop(g_VideoInitialize);
@ -299,6 +330,8 @@ void Video_ExitLoop()
{
Fifo_ExitLoop();
}
/////////////////////////
void DebugLog(const char* _fmt, ...)
{

View File

@ -241,7 +241,7 @@ void Initialize(void *init)
{
// Debugging
#ifdef SHOW_PAD_STATUS
Console::Open(100);
Console::Open(110);
m_hConsole = Console::GetHwnd();
#endif
Console::Print("Initialize: %i\n", SDL_WasInit(0));
@ -483,6 +483,7 @@ void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
_pPADStatus->button |= PAD_TRIGGER_L;
_pPADStatus->triggerLeft = TriggerValue;
}
// no the digital L button is not pressed, but the analog left trigger is
else if(TriggerLeft > 0)
_pPADStatus->triggerLeft = TriggerLeft;
@ -492,6 +493,7 @@ void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
_pPADStatus->button |= PAD_TRIGGER_R;
_pPADStatus->triggerRight = TriggerValue;
}
// no the digital R button is not pressed, but the analog right trigger is
else if(TriggerRight > 0)
_pPADStatus->triggerRight = TriggerRight;
@ -561,20 +563,20 @@ void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
// Show the status of all connected pads
if ((LastPad == 0 && _numPAD == 0) || _numPAD < LastPad) Console::ClearScreen();
LastPad = _numPAD;
Console::ClearScreen();
Console::Print(
"Pad | Number:%i Enabled:%i Handle:%i\n"
"Trigger | StatusLeft:%04x StatusRight:%04x TriggerLeft:%04x TriggerRight:%04x TriggerValue:%i\n"
"Buttons | Overall:%i X:%i\n"
"Trigger | StatusL:%04x StatusR:%04x TriggerL:%04x TriggerR:%04x TriggerValue:%i\n"
"Buttons | Overall:%i A:%i X:%i\n"
"======================================================\n",
_numPAD, PadMapping[_numPAD].enabled, PadState[_numPAD].joy,
PadState[_numPAD].buttons[InputCommon::CTL_L_SHOULDER], PadState[_numPAD].buttons[InputCommon::CTL_R_SHOULDER], PadState[_numPAD].halfpress,
_pPADStatus->triggerLeft, _pPADStatus->triggerRight, TriggerLeft, TriggerRight, TriggerValue,
(PadMapping[_numPAD].triggertype ? "CTL_TRIGGER_XINPUT" : "CTL_TRIGGER_SDL"),
_pPADStatus->triggerLeft, _pPADStatus->triggerRight, TriggerLeft, TriggerRight, TriggerValue,
_pPADStatus->button, PadState[_numPAD].buttons[InputCommon::CTL_X_BUTTON]
_pPADStatus->button,
PadState[_numPAD].buttons[InputCommon::CTL_A_BUTTON],
PadState[_numPAD].buttons[InputCommon::CTL_X_BUTTON]
);
*/
}