NetPlay: Allow manual adjustments to the pad buffer size. Hacked in all the functions that will be needed for wiimote support (not functional yet). Rumble is sent to the correct gamepad during netplay. Stop button works better. Games no longer hang on disconnect.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5434 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak committed 2010-05-05 04:31:21 +00:00
1 parent 6c934f7951
commit ec11685a66
15 files changed
+380 -830

No files matched your search

+1 -1
View File
@@ -417,7 +417,7 @@ u32 CEXIIPL::GetGCTime()
#else
// hack in some netplay stuff
u64 ltime = GetNetGCTime();
u64 ltime = NetPlay_GetGCTime();
if (0 == ltime)
ltime = Common::Timer::GetLocalTimeSinceJan1970();
+1 -1
View File
@@ -32,7 +32,7 @@ public:
void DoState(PointerWrap &p);
static u32 GetGCTime();
static u32 GetNetGCTime();
static u32 NetPlay_GetGCTime();
static void Descrambler(u8* data, u32 size);
@@ -134,7 +134,7 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low)
u32 netValues[2] = {0};
int NetPlay = 2;
#if defined(HAVE_WX) && HAVE_WX
NetPlay = GetNetInput(ISIDevice::m_iDeviceNumber, PadStatus, netValues);
NetPlay = NetPlay_GetInput(ISIDevice::m_iDeviceNumber, PadStatus, netValues);
#endif
if (NetPlay != 2)
@@ -271,8 +271,13 @@ void CSIDevice_GCController::SendCommand(u32 _Cmd, u8 _Poll)
{
unsigned int uType = command.Parameter1; // 0 = stop, 1 = rumble, 2 = stop hard
unsigned int uStrength = command.Parameter2;
if (pad->PAD_Rumble)
pad->PAD_Rumble(ISIDevice::m_iDeviceNumber, uType, uStrength);
// get the correct pad number that should rumble locally when using netplay
const u8 numPAD = NetPlay_GetPadNum(ISIDevice::m_iDeviceNumber);
if (numPAD < 4)
if (pad->PAD_Rumble)
pad->PAD_Rumble(numPAD, uType, uStrength);
if (!_Poll)
{
@@ -102,7 +102,8 @@ public:
virtual int RunBuffer(u8* _pBuffer, int _iLength);
// Send and Receive pad input from network
static int GetNetInput(u8 numPAD, SPADStatus, u32 *PADStatus);
static int NetPlay_GetInput(u8 numPAD, SPADStatus, u32 *PADStatus);
static u8 NetPlay_GetPadNum(u8 numPAD);
// Return true on new data
virtual bool GetData(u32& _Hi, u32& _Low);
@@ -494,6 +494,7 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
{
if (m_WiiMotes[i].IsConnected() == 3 && m_FreqDividerMote == 150 / (i + 1))
{
NetPlay_WiimoteUpdate(i);
CPluginManager::GetInstance().GetWiimote(0)->Wiimote_Update(i);
return true;
}
@@ -95,6 +95,8 @@ public:
void DoState(PointerWrap &p);
void NetPlay_WiimoteUpdate(int _number);
private:
enum
@@ -258,6 +258,8 @@ void CWII_IPC_HLE_WiiMote::ExecuteL2capCmd(u8* _pData, u32 _Size)
_dbg_assert_msg_(WII_IPC_WIIMOTE, DoesChannelExist(pHeader->CID), "L2CAP: SendACLPacket to unknown channel %i", pHeader->CID);
CChannelMap::iterator itr= m_Channel.find(pHeader->CID);
const int number = NetPlay_GetWiimoteNum(m_ConnectionHandle & 0xFF);
Common::PluginWiimote* mote = CPluginManager::GetInstance().GetWiimote(0);
if (itr != m_Channel.end())
{
@@ -269,11 +271,13 @@ void CWII_IPC_HLE_WiiMote::ExecuteL2capCmd(u8* _pData, u32 _Size)
break;
case HID_CONTROL_CHANNEL:
mote->Wiimote_ControlChannel(m_ConnectionHandle & 0xFF, pHeader->CID, pData, DataSize);
if (number < 4)
mote->Wiimote_ControlChannel(number, pHeader->CID, pData, DataSize);
break;
case HID_INTERRUPT_CHANNEL:
mote->Wiimote_InterruptChannel(m_ConnectionHandle & 0xFF, pHeader->CID, pData, DataSize);
if (number < 4)
mote->Wiimote_InterruptChannel(number, pHeader->CID, pData, DataSize);
break;
default:
@@ -854,6 +858,9 @@ void CWII_IPC_HLE_WiiMote::SendCommandToACL(u8 _Ident, u8 _Code, u8 _CommandLeng
// ---------------------------------------------------
void CWII_IPC_HLE_WiiMote::ReceiveL2capData(u16 scid, const void* _pData, u32 _Size)
{
if (NetPlay_WiimoteInput(m_ConnectionHandle & 0xFF, scid, _pData, _Size))
return;
// Allocate DataFrame
u8 DataFrame[1024];
u32 Offset = 0;
@@ -170,6 +170,9 @@ public:
void ExecuteL2capCmd(u8* _pData, u32 _Size); // From CPU
void ReceiveL2capData(u16 scid, const void* _pData, u32 _Size); // From wiimote
int NetPlay_GetWiimoteNum(int _number);
bool NetPlay_WiimoteInput(int _number, u16 _channelID, const void* _pData, u32& _Size);
void EventConnectionAccepted();
void EventDisconnect();
bool EventPagingChanged(u8 _pageMode);