remove wiimote led/speaker status from statusbar
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5187 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
1 parent
5fa18ae114
commit
e6efc4a611
16 files changed
+14
-727
No files matched your search
@@ -85,8 +85,6 @@ void SConfig::SaveSettings()
|
||||
ini.Set("Interface", "MainWindowPosY", m_LocalCoreStartupParameter.iPosY);
|
||||
ini.Set("Interface", "MainWindowWidth", m_LocalCoreStartupParameter.iWidth);
|
||||
ini.Set("Interface", "MainWindowHeight", m_LocalCoreStartupParameter.iHeight);
|
||||
ini.Set("Interface", "ShowWiimoteLeds", m_LocalCoreStartupParameter.bWiiLeds);
|
||||
ini.Set("Interface", "ShowWiimoteSpeakers", m_LocalCoreStartupParameter.bWiiSpeakers);
|
||||
ini.Set("Interface", "Language", m_InterfaceLanguage);
|
||||
ini.Set("Interface", "ShowToolbar", m_InterfaceToolbar);
|
||||
ini.Set("Interface", "ShowStatusbar", m_InterfaceStatusbar);
|
||||
@@ -197,8 +195,6 @@ void SConfig::LoadSettings()
|
||||
ini.Get("Interface", "MainWindowPosY", &m_LocalCoreStartupParameter.iPosY, 100);
|
||||
ini.Get("Interface", "MainWindowWidth", &m_LocalCoreStartupParameter.iWidth, 800);
|
||||
ini.Get("Interface", "MainWindowHeight", &m_LocalCoreStartupParameter.iHeight, 600);
|
||||
ini.Get("Interface", "ShowWiimoteLeds", &m_LocalCoreStartupParameter.bWiiLeds, false);
|
||||
ini.Get("Interface", "ShowWiimoteSpeakers", &m_LocalCoreStartupParameter.bWiiSpeakers, false);
|
||||
ini.Get("Interface", "Language", (int*)&m_InterfaceLanguage, 0);
|
||||
ini.Get("Interface", "ShowToolbar", &m_InterfaceToolbar, true);
|
||||
ini.Get("Interface", "ShowStatusbar", &m_InterfaceStatusbar, true);
|
||||
|
||||
@@ -47,7 +47,7 @@ SCoreStartupParameter::SCoreStartupParameter()
|
||||
bEnableCheats(false), bEnableIsoCache(false),
|
||||
bRunCompareServer(false), bRunCompareClient(false),
|
||||
iTLBHack(0), SelectedLanguage(0),
|
||||
bWii(false), bWiiLeds(false), bWiiSpeakers(false),
|
||||
bWii(false),
|
||||
bConfirmStop(false), bHideCursor(false),
|
||||
bAutoHideCursor(false), bUsePanicHandlers(true),
|
||||
iTheme(0),
|
||||
|
||||
@@ -73,8 +73,7 @@ struct SCoreStartupParameter
|
||||
|
||||
int SelectedLanguage;
|
||||
|
||||
// Wii settings
|
||||
bool bWii, bWiiLeds, bWiiSpeakers;
|
||||
bool bWii;
|
||||
|
||||
// Interface settings
|
||||
bool bConfirmStop, bHideCursor, bAutoHideCursor, bUsePanicHandlers;
|
||||
|
||||
@@ -53,8 +53,4 @@ void Host_UpdateStatusBar(const char* _pText, int Filed = 0);
|
||||
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
|
||||
@@ -146,75 +146,10 @@ bool CWII_IPC_HLE_WiiMote::LinkChannel()
|
||||
}
|
||||
|
||||
m_Connected = 3;
|
||||
UpdateStatus();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// ===================================================
|
||||
/* Send a status report to the status bar. */
|
||||
// ----------------
|
||||
void CWII_IPC_HLE_WiiMote::ShowStatus(const void* _pData)
|
||||
{
|
||||
// Check if it's enabled
|
||||
SCoreStartupParameter& StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||
bool LedsOn = StartUp.bWiiLeds;
|
||||
bool SpeakersOn = StartUp.bWiiSpeakers;
|
||||
|
||||
const u8* data = (const u8*)_pData;
|
||||
|
||||
// Get the last four bits with LED info
|
||||
if (LedsOn)
|
||||
{
|
||||
if (data[1] == 0x11)
|
||||
{
|
||||
int led_bits = (data[2] >> 4);
|
||||
Host_UpdateLeds(led_bits);
|
||||
}
|
||||
}
|
||||
|
||||
int speaker_bits = 0;
|
||||
|
||||
if (SpeakersOn)
|
||||
{
|
||||
u8 Bits = 0;
|
||||
switch (data[1])
|
||||
{
|
||||
case 0x14: // Enable and disable speakers
|
||||
if (data[2] == 0x02) // Off
|
||||
Bits = 0;
|
||||
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) // Unmute
|
||||
Bits = 1;
|
||||
else if (data[2] == 0x06) // Mute
|
||||
Bits = 0;
|
||||
Host_UpdateSpeakerStatus(1, Bits);
|
||||
break;
|
||||
// Write to speaker registry, or write sound
|
||||
case 0x16:
|
||||
case 0x18:
|
||||
// Turn on the activity light
|
||||
Host_UpdateSpeakerStatus(2, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Turn off the activity icon again
|
||||
void CWII_IPC_HLE_WiiMote::UpdateStatus()
|
||||
{
|
||||
// Check if it's enabled
|
||||
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bWiiSpeakers)
|
||||
return;
|
||||
Host_UpdateStatus();
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -335,13 +270,10 @@ void CWII_IPC_HLE_WiiMote::ExecuteL2capCmd(u8* _pData, u32 _Size)
|
||||
|
||||
case HID_CONTROL_CHANNEL:
|
||||
mote->Wiimote_ControlChannel(m_ConnectionHandle & 0xFF, pHeader->CID, pData, DataSize);
|
||||
// Call Wiimote Plugin
|
||||
break;
|
||||
|
||||
case HID_INTERRUPT_CHANNEL:
|
||||
ShowStatus(pData);
|
||||
mote->Wiimote_InterruptChannel(m_ConnectionHandle & 0xFF, pHeader->CID, pData, DataSize);
|
||||
// Call Wiimote Plugin
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -130,66 +130,33 @@ struct SL2CAP_CommandDisconnectionResponse // 0x07
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
class CBigEndianBuffer
|
||||
{
|
||||
public:
|
||||
CBigEndianBuffer(u8* pBuffer)
|
||||
: m_pBuffer(pBuffer)
|
||||
{
|
||||
}
|
||||
CBigEndianBuffer(u8* pBuffer) : m_pBuffer(pBuffer) {}
|
||||
|
||||
u8 Read8(u32 offset)
|
||||
{
|
||||
return m_pBuffer[offset];
|
||||
}
|
||||
u8 Read8(u32 offset) { return m_pBuffer[offset]; }
|
||||
u16 Read16(u32 offset) { return Common::swap16(*(u16*)&m_pBuffer[offset]); }
|
||||
u32 Read32(u32 offset) { return Common::swap32(*(u32*)&m_pBuffer[offset]); }
|
||||
|
||||
u16 Read16(u32 offset)
|
||||
{
|
||||
return Common::swap16(*(u16*)&m_pBuffer[offset]);
|
||||
}
|
||||
void Write8(u32 offset, u8 data) { m_pBuffer[offset] = data; }
|
||||
void Write16(u32 offset, u16 data) { *(u16*)&m_pBuffer[offset] = Common::swap16(data); }
|
||||
void Write32(u32 offset, u32 data) { *(u32*)&m_pBuffer[offset] = Common::swap32(data); }
|
||||
|
||||
u32 Read32(u32 offset)
|
||||
{
|
||||
return Common::swap32(*(u32*)&m_pBuffer[offset]);
|
||||
}
|
||||
|
||||
void Write8(u32 offset, u8 data)
|
||||
{
|
||||
m_pBuffer[offset] = data;
|
||||
}
|
||||
|
||||
void Write16(u32 offset, u16 data)
|
||||
{
|
||||
*(u16*)&m_pBuffer[offset] = Common::swap16(data);
|
||||
}
|
||||
|
||||
void Write32(u32 offset, u32 data)
|
||||
{
|
||||
*(u32*)&m_pBuffer[offset] = Common::swap32(data);
|
||||
}
|
||||
|
||||
u8* GetPointer(u32 offset)
|
||||
{
|
||||
return &m_pBuffer[offset];
|
||||
}
|
||||
u8* GetPointer(u32 offset) { return &m_pBuffer[offset]; }
|
||||
|
||||
private:
|
||||
|
||||
u8* m_pBuffer;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class CWII_IPC_HLE_WiiMote
|
||||
{
|
||||
public:
|
||||
|
||||
CWII_IPC_HLE_WiiMote(CWII_IPC_HLE_Device_usb_oh1_57e_305* _pHost, int _Number, bool ready = false);
|
||||
|
||||
virtual ~CWII_IPC_HLE_WiiMote()
|
||||
{}
|
||||
virtual ~CWII_IPC_HLE_WiiMote() {}
|
||||
|
||||
void DoState(PointerWrap &p);
|
||||
|
||||
@@ -200,8 +167,6 @@ public:
|
||||
bool LinkChannel();
|
||||
void ResetChannels();
|
||||
void Activate(bool ready);
|
||||
void ShowStatus(const void* _pData); // Show status
|
||||
void UpdateStatus(); // Update status
|
||||
void ExecuteL2capCmd(u8* _pData, u32 _Size); // From CPU
|
||||
void ReceiveL2capData(u16 scid, const void* _pData, u32 _Size); // From wiimote
|
||||
|
||||
@@ -220,7 +185,6 @@ public:
|
||||
const u8* GetLinkKey() const { return m_LinkKey; }
|
||||
|
||||
private:
|
||||
|
||||
// -1: inactive, 0: ready, 1: connecting 2: linking 3: connected & linked
|
||||
int m_Connected;
|
||||
|
||||
@@ -277,9 +241,7 @@ private:
|
||||
void ReceiveConfigurationResponse(u8 _Ident, u8* _pData, u32 _Size);
|
||||
|
||||
// some new ugly stuff
|
||||
//
|
||||
// should be inside the plugin
|
||||
//
|
||||
void HandleSDP(u16 _SCID, u8* _pData, u32 _Size);
|
||||
void SDPSendServiceSearchResponse(u16 _SCID, u16 _TransactionID, u8* _pServiceSearchPattern, u16 _MaximumServiceRecordCount);
|
||||
|
||||
|
||||
Reference in new issue
Block a user