nJoy and SerialInterface: Fixed the crashes with MAXPADS more than 1, the downside is that it doesn't work well one the second boot

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1980 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-01-22 11:18:46 +00:00
parent 189285f071
commit e332e18ce6
9 changed files with 281 additions and 156 deletions

View File

@ -241,6 +241,8 @@ void Initialize(void *init)
// Debugging
//Console::Open();
//Console::Print("Initialize: %i\n", SDL_WasInit(0));
SPADInitialize _PADInitialize = *(SPADInitialize*)init;
emulator_running = true;
#ifdef _DEBUG
@ -348,6 +350,8 @@ int Search_Devices()
Called from: The Dolphin Core, ConfigBox::OnClose() */
void Shutdown()
{
//Console::Print("Shutdown: %i\n", SDL_WasInit(0));
if (PadMapping[0].enabled && SDL_JoystickOpened(PadMapping[0].ID))
SDL_JoystickClose(joystate[0].joy);
if (PadMapping[1].enabled && SDL_JoystickOpened(PadMapping[1].ID))
@ -364,6 +368,7 @@ void Shutdown()
#endif
delete [] joyinfo;
joyinfo = NULL;
emulator_running = false;