Fixed Issue 1928

Fixed Issue 1917
(Since wxWidgets is not allowed in core, so I moved the popup window to CFrame)

*Maybe* this could also fix Issue 1919?

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4780 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx
2010-01-03 23:05:52 +00:00
parent ede1c935f4
commit 72b1570e08
8 changed files with 87 additions and 42 deletions

View File

@ -506,15 +506,20 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
// or CPU will disconnect WiiMote automatically
// but don't send too many or it will jam the bus and cost extra CPU time
// TODO: Figure out the correct frequency to send this thing
if (m_HCIBuffer.m_address && !WII_IPCInterface::GetAddress() && m_WiiMotes[0].IsConnected())
if (m_HCIBuffer.m_address && !WII_IPCInterface::GetAddress())
{
m_FreqDividerSync++;
if (m_FreqDividerSync >= 500) // Feel free to tweak it
{
m_FreqDividerSync = 0;
SendEventNumberOfCompletedPackets();
memset(m_PacketCount, 0, sizeof(m_PacketCount));
return true;
for (unsigned int i = 0; i < m_WiiMotes.size(); i++)
{
if (m_WiiMotes[i].IsConnected() == 3)
{
SendEventNumberOfCompletedPackets();
return true;
}
}
}
}
@ -629,7 +634,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventInquiryResponse()
pInquiryResult->PayloadLength = (u8)(sizeof(SHCIEventInquiryResult) - 2 + (m_WiiMotes.size() * sizeof(hci_inquiry_response)));
pInquiryResult->num_responses = (u8)m_WiiMotes.size();
for (size_t i=0; i<m_WiiMotes.size(); i++)
for (size_t i=0; i < m_WiiMotes.size(); i++)
{
if (m_WiiMotes[i].IsConnected())
continue;
@ -968,7 +973,13 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventRoleChange(bdaddr_t _bd, bool
bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventNumberOfCompletedPackets()
{
int Num = m_WiiMotes.size();
int Num = 0;
for (unsigned int i = 0; i < m_WiiMotes.size(); i++)
{
if (m_WiiMotes[i].IsConnected() == 3)
Num++;
}
if (Num == NULL)
return false;
@ -980,10 +991,13 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventNumberOfCompletedPackets()
pNumberOfCompletedPackets->NumberOfHandles = Num;
u16 *pData = (u16 *)(Event.m_buffer + sizeof(SHCIEventNumberOfCompletedPackets));
for (int i = 0; i < Num; i++)
for (unsigned int i = 0; i < m_WiiMotes.size(); i++)
{
pData[i] = m_WiiMotes[i].GetConnectionHandle();
pData[Num + i] = m_PacketCount[i];
if (m_WiiMotes[i].IsConnected() != 3) continue;
pData[0] = m_WiiMotes[i].GetConnectionHandle();
pData[Num] = m_PacketCount[i];
m_PacketCount[i] = 0;
pData++;
}
// Log
@ -1325,6 +1339,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::ExecuteHCICommandMessage(const SHCICom
//
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandInquiry(u8* _Input)
{
// Inquiry should not be called normally
PanicAlert("HCI_CMD_INQUIRY is called, please report!");
if (SendEventCommandStatus(HCI_CMD_INQUIRY))
return;
@ -1399,10 +1416,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandDisconnect(u8* _Input)
DEBUG_LOG(WII_IPC_WIIMOTE, " Reason: 0x%02x", pDiscon->reason);
SendEventDisconnect(pDiscon->con_handle, pDiscon->reason);
PanicAlert("Wiimote (%i) has been disconnected by system due to idle time out.\n"
"Don't panic, this is quite a normal behavior for power saving.\n\n"
"To reconnect, Click \"Menu -> Tools -> Connect Wiimote\"", (pDiscon->con_handle & 0xFF) + 1);
CWII_IPC_HLE_WiiMote* pWiimote = AccessWiiMote(pDiscon->con_handle);
if (pWiimote)

View File

@ -43,6 +43,7 @@
#include "ConfigManager.h" // Core
#include "Core.h"
#include "HW/DVDInterface.h"
#include "IPC_HLE/WII_IPC_HLE_Device_usb.h"
#include "State.h"
#include "VolumeHandler.h"
@ -135,7 +136,7 @@ CPanel::CPanel(
: wxPanel(parent, id)
{
}
int abc = 0;
#ifdef _WIN32
WXLRESULT CPanel::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
@ -157,6 +158,15 @@ int abc = 0;
else
main_frame->bRenderToMain = true;
return 0;
case WIIMOTE_DISCONNECT:
// The Wiimote has been disconnect, we offer reconnect here
if(AskYesNo("Wiimote %i has been disconnected by system.\n"
"Maybe this game doesn't support multi-wiimote,\n"
"or maybe it is due to idle time out or other reason.\n\n"
"Do you want to reconnect immediately?", lParam + 1, "Confirm", wxYES_NO))
GetUsbPointer()->AccessWiiMote(lParam | 0x100)->Activate(true);
return 0;
}
break;
}