Remove WX stuff from core (boo!)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1461 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
736409632e
commit
6bf333c893
|
@ -53,4 +53,8 @@ void Host_UpdateStatusBar(const char* _pText);
|
|||
void Host_SysMessage(const char *fmt, ...);
|
||||
void Host_SetWiiMoteConnectionState(int _State);
|
||||
|
||||
void Host_UpdateLeds(int bits);
|
||||
void Host_UpdateSpeakerStatus(int index, int bits);
|
||||
void Host_UpdateStatus();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -24,13 +24,9 @@
|
|||
#include "../Host.h"
|
||||
#include "../Core.h"
|
||||
|
||||
#include "../../DolphinWX/Src/Frame.h" // DolphinWX, for the wiimote status
|
||||
|
||||
#include "l2cap.h" // Local
|
||||
#include "WiiMote_HID_Attr.h"
|
||||
|
||||
extern CFrame* main_frame; // for the status report
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma pack(push, 1)
|
||||
#endif
|
||||
|
@ -391,80 +387,64 @@ void CWII_IPC_HLE_WiiMote::ShowStatus(const void* _pData)
|
|||
// Check if it's enabled
|
||||
bool LedsOn = Core::g_CoreStartupParameter.bWiiLeds;
|
||||
bool SpeakersOn = Core::g_CoreStartupParameter.bWiiSpeakers;
|
||||
if(! (LedsOn || SpeakersOn) ) return;
|
||||
|
||||
const u8* data = (const u8*)_pData;
|
||||
|
||||
if(data[1] == 0x11 || data[1] == 0x14 || data[1] == 0x16
|
||||
|| data[1] == 0x19)
|
||||
{
|
||||
//std::string Temp = ArrayToString(data, sizeof(data));
|
||||
//LOGV(CONSOLE, 0, "Data: %s", Temp.c_str());
|
||||
}
|
||||
|
||||
// Get the last four bits with LED info
|
||||
u8 Bits;
|
||||
if(data[1] == 0x11 && LedsOn)
|
||||
if (LedsOn)
|
||||
{
|
||||
Bits = (data[2] >> 4);
|
||||
|
||||
// Convert it to a simpler byte format
|
||||
main_frame->g_Leds[0] = Bits >> 0;
|
||||
main_frame->g_Leds[1] = Bits >> 1;
|
||||
main_frame->g_Leds[2] = Bits >> 2;
|
||||
main_frame->g_Leds[3] = Bits >> 3;
|
||||
|
||||
main_frame->UpdateLeds();
|
||||
if (data[1] == 0x11)
|
||||
{
|
||||
int led_bits = (data[2] >> 4);
|
||||
Host_UpdateLeds(led_bits);
|
||||
}
|
||||
}
|
||||
|
||||
if(data[1] == 0x14 && SpeakersOn) // Enable and disable speakers
|
||||
{
|
||||
int speaker_bits = 0;
|
||||
|
||||
if (SpeakersOn) {
|
||||
u8 Bits = 0;
|
||||
switch (data[1]) { // Enable and disable speakers
|
||||
case 0x14:
|
||||
// Get the value
|
||||
if(data[2] == 0x02) Bits = 0;
|
||||
else if(data[2] == 0x06) Bits = 1;
|
||||
main_frame->g_Speakers[0] = Bits;
|
||||
main_frame->UpdateSpeakers();
|
||||
}
|
||||
if (data[2] == 0x02)
|
||||
Bits = 0;
|
||||
else if (data[2] == 0x06)
|
||||
Bits = 1;
|
||||
Host_UpdateSpeakerStatus(0, Bits);
|
||||
break;
|
||||
|
||||
if(data[1] == 0x19 && SpeakersOn) // Mute and unmute
|
||||
{
|
||||
case 0x19: // Mute and unmute
|
||||
// Get the value
|
||||
if(data[2] == 0x02) Bits = 0;
|
||||
else if(data[2] == 0x06) Bits = 1;
|
||||
main_frame->g_Speakers[1] = Bits;
|
||||
main_frame->UpdateSpeakers();
|
||||
}
|
||||
if (data[2] == 0x02)
|
||||
Bits = 0;
|
||||
else if (data[2] == 0x06)
|
||||
Bits = 1;
|
||||
Host_UpdateSpeakerStatus(0, Bits);
|
||||
break;
|
||||
|
||||
if(data[1] == 0x16 && SpeakersOn) // Write to speaker registry
|
||||
case 0x16:
|
||||
if (data[1] == 0x16) // Write to speaker registry
|
||||
{
|
||||
// Don't care what it does, call all activity
|
||||
main_frame->g_Speakers[2] = 1;
|
||||
main_frame->UpdateSpeakers();
|
||||
Host_UpdateSpeakerStatus(0, 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// Turn off the activity icon again
|
||||
void CWII_IPC_HLE_WiiMote::UpdateStatus()
|
||||
{
|
||||
// Check if it's enabled
|
||||
if(!Core::g_CoreStartupParameter.bWiiSpeakers) return;
|
||||
if (!Core::g_CoreStartupParameter.bWiiSpeakers)
|
||||
return;
|
||||
Host_UpdateStatus();
|
||||
}
|
||||
|
||||
std::string Tmp = ArrayToString(main_frame->g_Speakers, sizeof(main_frame->g_Speakers));
|
||||
std::string Tmp2 = ArrayToString(main_frame->g_Speakers_, sizeof(main_frame->g_Speakers_));
|
||||
LOGV(CONSOLE, 0, "Tmp: %s", Tmp.c_str());
|
||||
LOGV(CONSOLE, 0, "Tmp2: %s", Tmp2.c_str());
|
||||
// Don't do a lot of CreateBitmap() if we don't need to
|
||||
if(memcmp(main_frame->g_Speakers_, main_frame->g_Speakers,
|
||||
sizeof(main_frame->g_Speakers)))
|
||||
{
|
||||
main_frame->g_Speakers[2] = 0;
|
||||
main_frame->UpdateSpeakers();
|
||||
memcpy(main_frame->g_Speakers_, main_frame->g_Speakers, sizeof(main_frame->g_Speakers));
|
||||
}
|
||||
}
|
||||
// ================
|
||||
|
||||
|
||||
void CWII_IPC_HLE_WiiMote::SignalChannel(u8* _pData, u32 _Size)
|
||||
{
|
||||
while (_Size >= sizeof(SL2CAP_Command))
|
||||
|
|
|
@ -351,6 +351,37 @@ void Host_UpdateBreakPointView()
|
|||
}
|
||||
|
||||
|
||||
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;
|
||||
main_frame->g_Leds[2] = led_bits >> 2;
|
||||
main_frame->g_Leds[3] = led_bits >> 3;
|
||||
|
||||
main_frame->UpdateLeds();
|
||||
}
|
||||
|
||||
void Host_UpdateSpeakerStatus(int index, int speaker_bits) {
|
||||
main_frame->g_Speakers[index] = speaker_bits;
|
||||
main_frame->UpdateSpeakers();
|
||||
}
|
||||
|
||||
void Host_UpdateStatus() {
|
||||
// UGLINESS
|
||||
std::string Tmp = ArrayToString(main_frame->g_Speakers, sizeof(main_frame->g_Speakers));
|
||||
std::string Tmp2 = ArrayToString(main_frame->g_Speakers_, sizeof(main_frame->g_Speakers_));
|
||||
LOGV(CONSOLE, 0, "Tmp: %s", Tmp.c_str());
|
||||
LOGV(CONSOLE, 0, "Tmp2: %s", Tmp2.c_str());
|
||||
// Don't do a lot of CreateBitmap() if we don't need to
|
||||
if(memcmp(main_frame->g_Speakers_, main_frame->g_Speakers,
|
||||
sizeof(main_frame->g_Speakers)))
|
||||
{
|
||||
main_frame->g_Speakers[2] = 0;
|
||||
main_frame->UpdateSpeakers();
|
||||
memcpy(main_frame->g_Speakers_, main_frame->g_Speakers, sizeof(main_frame->g_Speakers));
|
||||
}
|
||||
}
|
||||
|
||||
void Host_UpdateMemoryView()
|
||||
{}
|
||||
|
||||
|
|
Loading…
Reference in New Issue