mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Wiimote: Reset variables on Shutdown(). I think this makes DoesChannelExist(scid) in the Core to return false.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2116 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -236,6 +236,19 @@ void UpdateEeprom()
|
||||
WiiMoteEmu::g_Eeprom[22], WiiMoteEmu::g_Eeprom[23], WiiMoteEmu::g_Eeprom[27]);
|
||||
}
|
||||
|
||||
// Set initial values
|
||||
void ResetVariables()
|
||||
{
|
||||
u8 g_Leds = 0x0; // 4 bits
|
||||
u8 g_Speaker = 0x0; // 1 = on
|
||||
u8 g_SpeakerVoice = 0x0; // 1 = on
|
||||
u8 g_IR = 0x0; // 1 = on
|
||||
|
||||
g_ReportingMode = 0;
|
||||
g_ReportingChannel = 0;
|
||||
|
||||
g_EmulatedWiiMoteInitialized = false;
|
||||
}
|
||||
|
||||
// ===================================================
|
||||
/* Write initial values to Eeprom and registers. */
|
||||
@ -244,6 +257,9 @@ void Initialize()
|
||||
{
|
||||
if (g_EmulatedWiiMoteInitialized) return;
|
||||
|
||||
// Reset variables
|
||||
ResetVariables();
|
||||
|
||||
// Write default Eeprom data
|
||||
memset(g_Eeprom, 0, WIIMOTE_EEPROM_SIZE);
|
||||
memcpy(g_Eeprom, EepromData_0, sizeof(EepromData_0));
|
||||
@ -297,10 +313,12 @@ void DoState(void* ptr, int mode)
|
||||
//TODO: implement
|
||||
}
|
||||
|
||||
/* We don't need to do anything here. All values will be reset as FreeLibrary() is called
|
||||
when we stop a game */
|
||||
/* This is not needed if we call FreeLibrary() when we stop a game, but if it's not called we need to reset
|
||||
these variables. */
|
||||
void Shutdown(void)
|
||||
{}
|
||||
{
|
||||
ResetVariables();
|
||||
}
|
||||
|
||||
|
||||
// ===================================================
|
||||
|
Reference in New Issue
Block a user