mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 22:56:52 +01:00
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:
parent
ede1c935f4
commit
72b1570e08
@ -506,17 +506,22 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
|
|||||||
// or CPU will disconnect WiiMote automatically
|
// or CPU will disconnect WiiMote automatically
|
||||||
// but don't send too many or it will jam the bus and cost extra CPU time
|
// 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
|
// 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++;
|
m_FreqDividerSync++;
|
||||||
if (m_FreqDividerSync >= 500) // Feel free to tweak it
|
if (m_FreqDividerSync >= 500) // Feel free to tweak it
|
||||||
{
|
{
|
||||||
m_FreqDividerSync = 0;
|
m_FreqDividerSync = 0;
|
||||||
|
for (unsigned int i = 0; i < m_WiiMotes.size(); i++)
|
||||||
|
{
|
||||||
|
if (m_WiiMotes[i].IsConnected() == 3)
|
||||||
|
{
|
||||||
SendEventNumberOfCompletedPackets();
|
SendEventNumberOfCompletedPackets();
|
||||||
memset(m_PacketCount, 0, sizeof(m_PacketCount));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -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()
|
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)
|
if (Num == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -980,10 +991,13 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventNumberOfCompletedPackets()
|
|||||||
pNumberOfCompletedPackets->NumberOfHandles = Num;
|
pNumberOfCompletedPackets->NumberOfHandles = Num;
|
||||||
|
|
||||||
u16 *pData = (u16 *)(Event.m_buffer + sizeof(SHCIEventNumberOfCompletedPackets));
|
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();
|
if (m_WiiMotes[i].IsConnected() != 3) continue;
|
||||||
pData[Num + i] = m_PacketCount[i];
|
pData[0] = m_WiiMotes[i].GetConnectionHandle();
|
||||||
|
pData[Num] = m_PacketCount[i];
|
||||||
|
m_PacketCount[i] = 0;
|
||||||
|
pData++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log
|
// 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)
|
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))
|
if (SendEventCommandStatus(HCI_CMD_INQUIRY))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1400,10 +1417,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandDisconnect(u8* _Input)
|
|||||||
|
|
||||||
SendEventDisconnect(pDiscon->con_handle, 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);
|
CWII_IPC_HLE_WiiMote* pWiimote = AccessWiiMote(pDiscon->con_handle);
|
||||||
if (pWiimote)
|
if (pWiimote)
|
||||||
pWiimote->EventDisconnect();
|
pWiimote->EventDisconnect();
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include "ConfigManager.h" // Core
|
#include "ConfigManager.h" // Core
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
#include "HW/DVDInterface.h"
|
#include "HW/DVDInterface.h"
|
||||||
|
#include "IPC_HLE/WII_IPC_HLE_Device_usb.h"
|
||||||
#include "State.h"
|
#include "State.h"
|
||||||
#include "VolumeHandler.h"
|
#include "VolumeHandler.h"
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ CPanel::CPanel(
|
|||||||
: wxPanel(parent, id)
|
: wxPanel(parent, id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
int abc = 0;
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
WXLRESULT CPanel::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
WXLRESULT CPanel::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
{
|
{
|
||||||
@ -157,6 +158,15 @@ int abc = 0;
|
|||||||
else
|
else
|
||||||
main_frame->bRenderToMain = true;
|
main_frame->bRenderToMain = true;
|
||||||
return 0;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,20 @@ const TCHAR m_szClassName[] = _T("DolphinEmuWnd");
|
|||||||
int g_winstyle;
|
int g_winstyle;
|
||||||
static volatile bool s_sizing;
|
static volatile bool s_sizing;
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
/* Invisible cursor option. In the lack of a predefined IDC_BLANK we make
|
||||||
|
an empty transparent cursor */
|
||||||
|
// ------------------
|
||||||
|
HCURSOR hCursor = NULL, hCursorBlank = NULL;
|
||||||
|
void CreateCursors(HINSTANCE hInstance)
|
||||||
|
{
|
||||||
|
BYTE ANDmaskCursor[] = { 0xff };
|
||||||
|
BYTE XORmaskCursor[] = { 0x00 };
|
||||||
|
hCursorBlank = CreateCursor(hInstance, 0,0, 1,1, ANDmaskCursor,XORmaskCursor);
|
||||||
|
|
||||||
|
hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||||
|
}
|
||||||
|
|
||||||
bool IsSizing()
|
bool IsSizing()
|
||||||
{
|
{
|
||||||
return s_sizing;
|
return s_sizing;
|
||||||
@ -123,8 +137,12 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_USER:
|
case WM_USER:
|
||||||
if (wParam == TOGGLE_FULLSCREEN)
|
if (wParam == WM_USER_STOP)
|
||||||
|
SetCursor((lParam) ? hCursor : hCursorBlank);
|
||||||
|
else if (wParam == TOGGLE_FULLSCREEN)
|
||||||
ToggleFullscreen(hWnd);
|
ToggleFullscreen(hWnd);
|
||||||
|
else if (wParam == WIIMOTE_DISCONNECT)
|
||||||
|
PostMessage(m_hMain, WM_USER, wParam, lParam);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_SYSCOMMAND:
|
case WM_SYSCOMMAND:
|
||||||
@ -159,6 +177,8 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T
|
|||||||
m_hInstance = hInstance;
|
m_hInstance = hInstance;
|
||||||
RegisterClassEx( &wndClass );
|
RegisterClassEx( &wndClass );
|
||||||
|
|
||||||
|
CreateCursors(m_hInstance);
|
||||||
|
|
||||||
if (g_Config.RenderToMainframe)
|
if (g_Config.RenderToMainframe)
|
||||||
{
|
{
|
||||||
m_hParent = m_hMain = parent;
|
m_hParent = m_hMain = parent;
|
||||||
|
@ -332,18 +332,19 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
and coordinate it with the other settings if nessesary */
|
and coordinate it with the other settings if nessesary */
|
||||||
case WM_USER:
|
case WM_USER:
|
||||||
if (wParam == WM_USER_STOP)
|
if (wParam == WM_USER_STOP)
|
||||||
|
SetCursor((lParam) ? hCursor : hCursorBlank);
|
||||||
|
else if (wParam == WM_USER_KEYDOWN)
|
||||||
{
|
{
|
||||||
if (lParam)
|
|
||||||
SetCursor(hCursor);
|
|
||||||
else
|
|
||||||
SetCursor(hCursorBlank);
|
|
||||||
}
|
|
||||||
if (wParam == WM_USER_KEYDOWN) {
|
|
||||||
OnKeyDown(lParam);
|
OnKeyDown(lParam);
|
||||||
FreeLookInput(wParam, lParam);
|
FreeLookInput(wParam, lParam);
|
||||||
}
|
}
|
||||||
if (wParam == TOGGLE_FULLSCREEN && !g_Config.RenderToMainframe)
|
else if (wParam == TOGGLE_FULLSCREEN)
|
||||||
|
{
|
||||||
|
if(!g_Config.RenderToMainframe)
|
||||||
ToggleFullscreen(m_hWnd);
|
ToggleFullscreen(m_hWnd);
|
||||||
|
}
|
||||||
|
else if (wParam == WIIMOTE_DISCONNECT)
|
||||||
|
PostMessage(m_hMain, WM_USER, wParam, lParam);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// This is called when we close the window when we render to a separate window
|
// This is called when we close the window when we render to a separate window
|
||||||
|
@ -191,15 +191,10 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
|||||||
only let it pass through Dolphin > Frame.cpp to determine if it should be on or off
|
only let it pass through Dolphin > Frame.cpp to determine if it should be on or off
|
||||||
and coordinate it with the other settings if nessesary */
|
and coordinate it with the other settings if nessesary */
|
||||||
case WM_USER:
|
case WM_USER:
|
||||||
/* I set wParam to 10 just in case there are other WM_USER events. If we want more
|
if (wParam == WM_USER_STOP)
|
||||||
WM_USER cases we would start making wParam or lParam cases */
|
SetCursor((lParam) ? hCursor : hCursorBlank);
|
||||||
if (wParam == 10)
|
else if (wParam == WIIMOTE_DISCONNECT)
|
||||||
{
|
PostMessage(m_hMain, WM_USER, wParam, lParam);
|
||||||
if (lParam)
|
|
||||||
SetCursor(hCursor);
|
|
||||||
else
|
|
||||||
SetCursor(hCursorBlank);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Post thes mouse events to the main window, it's nessesary becase in difference to the
|
/* Post thes mouse events to the main window, it's nessesary becase in difference to the
|
||||||
|
@ -311,6 +311,8 @@ void Shutdown()
|
|||||||
// Finally close SDL
|
// Finally close SDL
|
||||||
if (SDL_WasInit(0))
|
if (SDL_WasInit(0))
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
|
|
||||||
|
g_SearchDeviceDone = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start emulation
|
// Start emulation
|
||||||
@ -556,14 +558,6 @@ void InterruptChannel(int _number, u16 _channelID, const void* _pData, u32 _Size
|
|||||||
|
|
||||||
void ControlChannel(int _number, u16 _channelID, const void* _pData, u32 _Size)
|
void ControlChannel(int _number, u16 _channelID, const void* _pData, u32 _Size)
|
||||||
{
|
{
|
||||||
// Check for custom communication
|
|
||||||
if(_channelID == 99 && *(const u8*)_pData == WIIMOTE_DISCONNECT)
|
|
||||||
{
|
|
||||||
WARN_LOG(WIIMOTE, "Wiimote: #%i Disconnected", _number);
|
|
||||||
g_ReportingAuto[_number] = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_ID = _number;
|
g_ID = _number;
|
||||||
|
|
||||||
hid_packet* hidp = (hid_packet*)_pData;
|
hid_packet* hidp = (hid_packet*)_pData;
|
||||||
|
@ -333,6 +333,17 @@ void Wiimote_ControlChannel(int _number, u16 _channelID, const void* _pData, u32
|
|||||||
DEBUG_LOG(WIIMOTE, " Data: %s", Temp.c_str());
|
DEBUG_LOG(WIIMOTE, " Data: %s", Temp.c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Check for custom communication
|
||||||
|
if(_channelID == 99 && *(const u8*)_pData == WIIMOTE_DISCONNECT)
|
||||||
|
{
|
||||||
|
WiiMoteEmu::g_ReportingAuto[_number] = false;
|
||||||
|
WARN_LOG(WIIMOTE, "Wiimote: #%i Disconnected", _number);
|
||||||
|
#ifdef _WIN32
|
||||||
|
PostMessage(g_WiimoteInitialize.hWnd, WM_USER, WIIMOTE_DISCONNECT, _number);
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (WiiMoteEmu::WiiMapping[_number].Source <= 1)
|
if (WiiMoteEmu::WiiMapping[_number].Source <= 1)
|
||||||
WiiMoteEmu::ControlChannel(_number, _channelID, _pData, _Size);
|
WiiMoteEmu::ControlChannel(_number, _channelID, _pData, _Size);
|
||||||
#if HAVE_WIIUSE
|
#if HAVE_WIIUSE
|
||||||
|
@ -253,6 +253,7 @@ void Shutdown()
|
|||||||
|
|
||||||
// Remove the pointer to the initialize data
|
// Remove the pointer to the initialize data
|
||||||
g_PADInitialize = NULL;
|
g_PADInitialize = NULL;
|
||||||
|
g_SearchDeviceDone = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user