Wiimote: Fixed the speaker status bar status, the status is [Green] [Blue] [Green] that means [On/Off] [Muted/Unmuted] [Activity]

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2142 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-02-08 12:27:04 +00:00
parent e926bc61d1
commit ca0e807db6
6 changed files with 36 additions and 29 deletions

View File

@ -400,33 +400,32 @@ void CWII_IPC_HLE_WiiMote::ShowStatus(const void* _pData)
int speaker_bits = 0;
if (SpeakersOn) {
if (SpeakersOn)
{
u8 Bits = 0;
switch (data[1]) { // Enable and disable speakers
case 0x14:
// Get the value
if (data[2] == 0x02)
switch (data[1])
{
case 0x14: // Enable and disable speakers
if (data[2] == 0x02) // Off
Bits = 0;
else if (data[2] == 0x06)
else if (data[2] == 0x06) // On
Bits = 1;
Host_UpdateSpeakerStatus(0, Bits);
break;
case 0x19: // Mute and unmute
// Get the value
if (data[2] == 0x02)
Bits = 0;
else if (data[2] == 0x06)
if (data[2] == 0x02) // Unmute
Bits = 1;
Host_UpdateSpeakerStatus(0, Bits);
else if (data[2] == 0x06) // Mute
Bits = 0;
Host_UpdateSpeakerStatus(1, Bits);
break;
// Write to speaker registry, or write sound
case 0x16:
if (data[1] == 0x16) // Write to speaker registry
{
// Don't care what it does, call all activity
Host_UpdateSpeakerStatus(0, 1);
}
case 0x18:
// Turn on the activity light
Host_UpdateSpeakerStatus(2, 1);
break;
}
}

View File

@ -306,7 +306,7 @@ wxBitmap CFrame::CreateBitmapForSpeakers(int BitmapType, bool On)
switch(BitmapType)
{
case 0:
case 0: // Speaker on
{
// Set outline and fill colors
dc.SetPen(On ? *wxMEDIUM_GREY_PEN : *wxMEDIUM_GREY_PEN);
@ -317,7 +317,7 @@ wxBitmap CFrame::CreateBitmapForSpeakers(int BitmapType, bool On)
dc.SelectObject(wxNullBitmap);
return bitmap;
}
case 1:
case 1: // Speaker unmuted
{
// Set outline and fill colors
dc.SetPen(On ? *wxMEDIUM_GREY_PEN : *wxMEDIUM_GREY_PEN);
@ -328,7 +328,7 @@ wxBitmap CFrame::CreateBitmapForSpeakers(int BitmapType, bool On)
dc.SelectObject(wxNullBitmap);
return bitmap;
}
case 2:
case 2: // Speaker activity
{
// Set outline and fill colors
dc.SetPen(On ? *wxMEDIUM_GREY_PEN : *wxMEDIUM_GREY_PEN);

View File

@ -385,7 +385,8 @@ void Host_UpdateBreakPointView()
/////////////////////////////////////////////////////////////
/* Update Wiimote status bar */
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void Host_UpdateLeds(int led_bits) {
void Host_UpdateLeds(int led_bits)
{
// Convert it to a simpler byte format
main_frame->g_Leds[0] = led_bits >> 0;
main_frame->g_Leds[1] = led_bits >> 1;
@ -395,7 +396,8 @@ void Host_UpdateLeds(int led_bits) {
main_frame->UpdateLeds();
}
void Host_UpdateSpeakerStatus(int index, int speaker_bits) {
void Host_UpdateSpeakerStatus(int index, int speaker_bits)
{
main_frame->g_Speakers[index] = speaker_bits;
main_frame->UpdateSpeakers();
}
@ -411,6 +413,7 @@ void Host_UpdateStatus()
if(memcmp(main_frame->g_Speakers_, main_frame->g_Speakers,
sizeof(main_frame->g_Speakers)))
{
// Turn off the activity light again
main_frame->g_Speakers[2] = 0;
main_frame->UpdateSpeakers();
memcpy(main_frame->g_Speakers_, main_frame->g_Speakers, sizeof(main_frame->g_Speakers));