2010-05-01 19:10:35 +00:00
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
|
|
|
#include "NetPlay.h"
|
|
|
|
#include "NetWindow.h"
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// for wiimote
|
|
|
|
#include "IPC_HLE/WII_IPC_HLE_Device_usb.h"
|
|
|
|
#include "IPC_HLE/WII_IPC_HLE_WiiMote.h"
|
|
|
|
// for gcpad
|
|
|
|
#include "HW/SI_DeviceGCController.h"
|
|
|
|
// for gctime
|
|
|
|
#include "HW/EXI_DeviceIPL.h"
|
|
|
|
// to start/stop game
|
2010-05-01 21:27:48 +00:00
|
|
|
#include "Frame.h"
|
2010-06-06 03:52:11 +00:00
|
|
|
// for wiimote/ OSD messages
|
2010-05-05 04:31:21 +00:00
|
|
|
#include "Core.h"
|
2010-05-01 21:27:48 +00:00
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
Common::CriticalSection crit_netplay_ptr;
|
|
|
|
static NetPlay* netplay_ptr = NULL;
|
2010-05-01 19:10:35 +00:00
|
|
|
extern CFrame* main_frame;
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
#define RPT_SIZE_HACK (1 << 16)
|
|
|
|
|
2010-05-01 19:10:35 +00:00
|
|
|
DEFINE_EVENT_TYPE(wxEVT_THREAD)
|
|
|
|
|
2011-01-27 20:47:58 +00:00
|
|
|
void NetPlayThreadFunc(NetPlay* np)
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
2011-01-27 20:47:58 +00:00
|
|
|
np->Entry();
|
2010-05-01 19:10:35 +00:00
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// called from ---GUI--- thread
|
|
|
|
NetPlay::NetPlay()
|
|
|
|
: m_is_running(false), m_do_loop(true)
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
2010-05-05 04:31:21 +00:00
|
|
|
m_target_buffer_size = 20;
|
|
|
|
ClearBuffers();
|
2010-05-01 19:10:35 +00:00
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
void NetPlay_Enable(NetPlay* const np)
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
2010-05-05 04:31:21 +00:00
|
|
|
CritLocker crit(::crit_netplay_ptr); // probably safe without a lock
|
|
|
|
::netplay_ptr = np;
|
2010-05-01 19:10:35 +00:00
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
void NetPlay_Disable()
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
2010-05-05 04:31:21 +00:00
|
|
|
CritLocker crit(::crit_netplay_ptr);
|
|
|
|
::netplay_ptr = NULL;
|
2010-05-01 19:10:35 +00:00
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// called from ---GUI--- thread
|
|
|
|
NetPlay::~NetPlay()
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
2010-05-05 04:31:21 +00:00
|
|
|
CritLocker crit(crit_netplay_ptr);
|
|
|
|
::netplay_ptr = NULL;
|
2010-06-06 03:52:11 +00:00
|
|
|
|
|
|
|
// not perfect
|
|
|
|
if (m_is_running)
|
|
|
|
StopGame();
|
2010-05-01 19:10:35 +00:00
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
NetPlay::Player::Player()
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
2010-05-05 04:31:21 +00:00
|
|
|
memset(pad_map, -1, sizeof(pad_map));
|
2010-05-01 19:10:35 +00:00
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// called from ---NETPLAY--- thread
|
2010-05-01 19:10:35 +00:00
|
|
|
void NetPlay::UpdateGUI()
|
|
|
|
{
|
|
|
|
if (m_dialog)
|
|
|
|
{
|
|
|
|
wxCommandEvent evt(wxEVT_THREAD, 1);
|
2010-05-02 21:12:51 +00:00
|
|
|
m_dialog->GetEventHandler()->AddPendingEvent(evt);
|
2010-05-01 19:10:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// called from ---NETPLAY--- thread
|
2010-05-02 23:01:50 +00:00
|
|
|
void NetPlay::AppendChatGUI(const std::string& msg)
|
|
|
|
{
|
|
|
|
if (m_dialog)
|
|
|
|
{
|
|
|
|
m_dialog->chat_msgs.Push(msg);
|
|
|
|
// silly
|
|
|
|
UpdateGUI();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// called from ---GUI--- thread
|
2010-05-02 23:01:50 +00:00
|
|
|
std::string NetPlay::Player::ToString() const
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
|
|
|
std::ostringstream ss;
|
2010-05-02 23:01:50 +00:00
|
|
|
ss << name << '[' << (char)(pid+'0') << "] : " << revision << " |";
|
2010-05-01 19:10:35 +00:00
|
|
|
for (unsigned int i=0; i<4; ++i)
|
2010-05-02 23:01:50 +00:00
|
|
|
ss << (pad_map[i]>=0 ? (char)(pad_map[i]+'1') : '-');
|
2010-05-01 19:10:35 +00:00
|
|
|
ss << '|';
|
|
|
|
return ss.str();
|
|
|
|
}
|
|
|
|
|
|
|
|
NetPad::NetPad()
|
|
|
|
{
|
|
|
|
nHi = 0x00808080;
|
|
|
|
nLo = 0x80800000;
|
|
|
|
}
|
|
|
|
|
|
|
|
NetPad::NetPad(const SPADStatus* const pad_status)
|
|
|
|
{
|
|
|
|
nHi = (u32)((u8)pad_status->stickY);
|
|
|
|
nHi |= (u32)((u8)pad_status->stickX << 8);
|
|
|
|
nHi |= (u32)((u16)pad_status->button << 16);
|
|
|
|
nHi |= 0x00800000;
|
|
|
|
nLo = (u8)pad_status->triggerRight;
|
|
|
|
nLo |= (u32)((u8)pad_status->triggerLeft << 8);
|
|
|
|
nLo |= (u32)((u8)pad_status->substickY << 16);
|
|
|
|
nLo |= (u32)((u8)pad_status->substickX << 24);
|
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// called from ---NETPLAY--- thread
|
|
|
|
void NetPlay::ClearBuffers()
|
|
|
|
{
|
2010-11-16 01:55:29 +00:00
|
|
|
// clear pad buffers, Clear method isn't thread safe
|
2010-05-05 04:31:21 +00:00
|
|
|
for (unsigned int i=0; i<4; ++i)
|
|
|
|
{
|
2010-11-16 01:55:29 +00:00
|
|
|
while (m_pad_buffer[i].Size())
|
|
|
|
m_pad_buffer[i].Pop();
|
|
|
|
|
|
|
|
while (m_wiimote_buffer[i].Size())
|
|
|
|
m_wiimote_buffer[i].Pop();
|
|
|
|
|
2010-06-06 03:52:11 +00:00
|
|
|
m_wiimote_input[i].clear();
|
2010-05-05 04:31:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// called from ---CPU--- thread
|
|
|
|
bool NetPlay::GetNetPads(const u8 pad_nb, const SPADStatus* const pad_status, NetPad* const netvalues)
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
2010-05-05 04:31:21 +00:00
|
|
|
m_crit.players.Enter(); // lock players
|
2010-05-01 19:10:35 +00:00
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// in game mapping for this local pad
|
|
|
|
unsigned int in_game_num = m_local_player->pad_map[pad_nb];
|
2010-05-01 19:10:35 +00:00
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// does this local pad map in game?
|
|
|
|
if (in_game_num < 4)
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
|
|
|
NetPad np(pad_status);
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// adjust the buffer either up or down
|
2010-11-16 01:55:29 +00:00
|
|
|
// inserting multiple padstates or dropping states
|
|
|
|
while (m_pad_buffer[in_game_num].Size() <= m_target_buffer_size)
|
2010-05-05 04:31:21 +00:00
|
|
|
{
|
|
|
|
// add to buffer
|
2010-11-16 01:55:29 +00:00
|
|
|
m_pad_buffer[in_game_num].Push(np);
|
2010-05-01 19:10:35 +00:00
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// send
|
|
|
|
SendPadState(pad_nb, np);
|
|
|
|
}
|
2010-05-01 19:10:35 +00:00
|
|
|
}
|
2010-05-02 23:01:50 +00:00
|
|
|
|
|
|
|
m_crit.players.Leave();
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
//Common::Timer bufftimer;
|
|
|
|
//bufftimer.Start();
|
2010-05-02 23:01:50 +00:00
|
|
|
|
2010-05-01 19:10:35 +00:00
|
|
|
// get padstate from buffer and send to game
|
2010-11-16 01:55:29 +00:00
|
|
|
while (!m_pad_buffer[pad_nb].Pop(*netvalues))
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
|
|
|
// wait for receiving thread to push some data
|
2010-05-02 04:24:49 +00:00
|
|
|
Common::SleepCurrentThread(1);
|
2010-11-16 01:55:29 +00:00
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
if (false == m_is_running)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// TODO: check the time of bufftimer here,
|
|
|
|
// if it gets pretty high, ask the user if they want to disconnect
|
|
|
|
|
2010-05-01 19:10:35 +00:00
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
//u64 hangtime = bufftimer.GetTimeElapsed();
|
|
|
|
//if (hangtime > 10)
|
|
|
|
//{
|
|
|
|
// std::ostringstream ss;
|
|
|
|
// ss << "Pad " << (int)pad_nb << ": Had to wait " << hangtime << "ms for pad data. (increase pad Buffer maybe)";
|
|
|
|
// Core::DisplayMessage(ss.str(), 1000);
|
|
|
|
//}
|
2010-05-01 19:10:35 +00:00
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
return true;
|
|
|
|
}
|
2010-05-01 19:10:35 +00:00
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// called from ---CPU--- thread
|
|
|
|
void NetPlay::WiimoteInput(int _number, u16 _channelID, const void* _pData, u32 _Size)
|
|
|
|
{
|
|
|
|
//// in game mapping for this local wiimote
|
2010-06-06 03:52:11 +00:00
|
|
|
unsigned int in_game_num = m_local_player->pad_map[_number]; // just using gc pad_map for now
|
2010-05-02 23:01:50 +00:00
|
|
|
|
2010-06-06 03:52:11 +00:00
|
|
|
// does this local pad map in game?
|
|
|
|
if (in_game_num < 4)
|
2010-11-16 01:55:29 +00:00
|
|
|
{
|
2010-06-06 03:52:11 +00:00
|
|
|
m_wiimote_input[_number].resize(m_wiimote_input[_number].size() + 1);
|
|
|
|
m_wiimote_input[_number].back().assign((char*)_pData, (char*)_pData + _Size);
|
|
|
|
m_wiimote_input[_number].back().channel = _channelID;
|
|
|
|
}
|
2010-05-02 23:01:50 +00:00
|
|
|
|
2010-06-06 03:52:11 +00:00
|
|
|
m_crit.players.Leave();
|
2010-05-01 19:10:35 +00:00
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// called from ---CPU--- thread
|
|
|
|
void NetPlay::WiimoteUpdate(int _number)
|
2010-05-02 23:01:50 +00:00
|
|
|
{
|
2010-06-06 03:52:11 +00:00
|
|
|
m_crit.players.Enter(); // lock players
|
|
|
|
|
|
|
|
// in game mapping for this local wiimote
|
|
|
|
unsigned int in_game_num = m_local_player->pad_map[_number]; // just using gc pad_map for now
|
|
|
|
|
|
|
|
// does this local pad map in game?
|
|
|
|
if (in_game_num < 4)
|
|
|
|
{
|
2010-11-16 01:55:29 +00:00
|
|
|
m_wiimote_buffer[in_game_num].Push(m_wiimote_input[_number]);
|
2010-06-06 03:52:11 +00:00
|
|
|
|
|
|
|
// TODO: send it
|
|
|
|
|
|
|
|
m_wiimote_input[_number].clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
m_crit.players.Leave();
|
|
|
|
|
2010-11-16 01:55:29 +00:00
|
|
|
if (0 == m_wiimote_buffer[_number].Size())
|
2010-06-06 03:52:11 +00:00
|
|
|
{
|
|
|
|
//PanicAlert("PANIC");
|
2010-05-05 04:31:21 +00:00
|
|
|
return;
|
2010-06-06 03:52:11 +00:00
|
|
|
}
|
2010-05-02 23:01:50 +00:00
|
|
|
|
2010-11-16 01:55:29 +00:00
|
|
|
NetWiimote nw;
|
|
|
|
m_wiimote_buffer[_number].Pop(nw);
|
2010-05-02 23:01:50 +00:00
|
|
|
|
2010-06-06 03:52:11 +00:00
|
|
|
NetWiimote::const_iterator
|
|
|
|
i = nw.begin(), e = nw.end();
|
|
|
|
for ( ; i!=e; ++i)
|
|
|
|
Core::Callback_WiimoteInterruptChannel(_number, i->channel, &(*i)[0], (u32)i->size() + RPT_SIZE_HACK);
|
2010-05-02 23:01:50 +00:00
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// called from ---GUI--- thread
|
2010-05-02 23:01:50 +00:00
|
|
|
bool NetPlay::StartGame(const std::string &path)
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
|
|
|
if (m_is_running)
|
|
|
|
{
|
2011-01-13 02:05:58 +00:00
|
|
|
PanicAlertT("Game is already running!");
|
2010-05-01 19:10:35 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2010-05-02 23:01:50 +00:00
|
|
|
AppendChatGUI(" -- STARTING GAME -- ");
|
|
|
|
|
2010-05-01 19:10:35 +00:00
|
|
|
m_is_running = true;
|
2010-05-05 04:31:21 +00:00
|
|
|
NetPlay_Enable(this);
|
2010-05-01 19:10:35 +00:00
|
|
|
|
2010-11-16 01:55:29 +00:00
|
|
|
ClearBuffers();
|
|
|
|
|
2010-05-01 19:10:35 +00:00
|
|
|
// boot game
|
|
|
|
::main_frame->BootGame(path);
|
|
|
|
|
2010-06-06 03:52:11 +00:00
|
|
|
// temporary
|
|
|
|
NetWiimote nw;
|
|
|
|
for (unsigned int i = 0; i<4; ++i)
|
|
|
|
for (unsigned int f = 0; f<2; ++f)
|
2010-11-16 01:55:29 +00:00
|
|
|
m_wiimote_buffer[i].Push(nw);
|
2010-06-06 03:52:11 +00:00
|
|
|
|
2010-05-01 19:10:35 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// called from ---GUI--- thread and ---NETPLAY--- thread (client side)
|
2010-05-02 23:01:50 +00:00
|
|
|
bool NetPlay::StopGame()
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
2010-05-05 04:31:21 +00:00
|
|
|
CritLocker game_lock(m_crit.game); // lock game state
|
2010-05-01 19:10:35 +00:00
|
|
|
|
2010-05-02 23:01:50 +00:00
|
|
|
if (false == m_is_running)
|
|
|
|
{
|
2011-01-13 02:05:58 +00:00
|
|
|
PanicAlertT("Game isn't running!");
|
2010-05-02 23:01:50 +00:00
|
|
|
return false;
|
|
|
|
}
|
2010-05-01 19:10:35 +00:00
|
|
|
|
2010-05-02 23:01:50 +00:00
|
|
|
AppendChatGUI(" -- STOPPING GAME -- ");
|
2010-05-01 19:10:35 +00:00
|
|
|
|
2010-05-02 23:01:50 +00:00
|
|
|
m_is_running = false;
|
2010-05-05 04:31:21 +00:00
|
|
|
NetPlay_Disable();
|
2010-05-01 19:10:35 +00:00
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// stop game
|
|
|
|
::main_frame->DoStop();
|
2010-05-01 19:10:35 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// called from ---CPU--- thread
|
|
|
|
u8 NetPlay::GetPadNum(u8 numPAD)
|
2010-05-02 23:01:50 +00:00
|
|
|
{
|
2010-05-05 04:31:21 +00:00
|
|
|
// TODO: i don't like that this loop is running everytime there is rumble
|
|
|
|
unsigned int i = 0;
|
|
|
|
for (; i<4; ++i)
|
|
|
|
if (numPAD == m_local_player->pad_map[i])
|
|
|
|
break;
|
2010-05-02 23:01:50 +00:00
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
return i;
|
2010-05-02 23:01:50 +00:00
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// stuff hacked into dolphin
|
|
|
|
|
|
|
|
// called from ---CPU--- thread
|
2010-05-01 19:10:35 +00:00
|
|
|
// Actual Core function which is called on every frame
|
2010-11-16 01:55:29 +00:00
|
|
|
bool CSIDevice_GCController::NetPlay_GetInput(u8 numPAD, SPADStatus PadStatus, u32 *PADStatus)
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
2010-05-05 04:31:21 +00:00
|
|
|
CritLocker crit(::crit_netplay_ptr);
|
|
|
|
|
|
|
|
if (::netplay_ptr)
|
2010-11-16 01:55:29 +00:00
|
|
|
return netplay_ptr->GetNetPads(numPAD, &PadStatus, (NetPad*)PADStatus);
|
2010-05-01 19:10:35 +00:00
|
|
|
else
|
2010-11-16 01:55:29 +00:00
|
|
|
return false;
|
2010-05-01 19:10:35 +00:00
|
|
|
}
|
|
|
|
|
2010-05-05 04:31:21 +00:00
|
|
|
// called from ---CPU--- thread
|
2010-05-01 19:10:35 +00:00
|
|
|
// so all players' games get the same time
|
2010-05-05 04:31:21 +00:00
|
|
|
u32 CEXIIPL::NetPlay_GetGCTime()
|
2010-05-01 19:10:35 +00:00
|
|
|
{
|
2010-05-05 04:31:21 +00:00
|
|
|
CritLocker crit(::crit_netplay_ptr);
|
|
|
|
|
|
|
|
if (::netplay_ptr)
|
2010-05-01 19:10:35 +00:00
|
|
|
return 1272737767; // watev
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
2010-05-05 04:31:21 +00:00
|
|
|
|
|
|
|
// called from ---CPU--- thread
|
|
|
|
// return the local pad num that should rumble given a ingame pad num
|
|
|
|
u8 CSIDevice_GCController::NetPlay_GetPadNum(u8 numPAD)
|
|
|
|
{
|
|
|
|
CritLocker crit(::crit_netplay_ptr);
|
|
|
|
|
|
|
|
if (::netplay_ptr)
|
|
|
|
return ::netplay_ptr->GetPadNum(numPAD);
|
|
|
|
else
|
|
|
|
return numPAD;
|
|
|
|
}
|
|
|
|
|
|
|
|
// called from ---CPU--- thread
|
|
|
|
// wiimote update / used for frame counting
|
2010-06-22 08:30:33 +00:00
|
|
|
//void CWII_IPC_HLE_Device_usb_oh1_57e_305::NetPlay_WiimoteUpdate(int _number)
|
|
|
|
void CWII_IPC_HLE_Device_usb_oh1_57e_305::NetPlay_WiimoteUpdate(int)
|
2010-05-05 04:31:21 +00:00
|
|
|
{
|
2010-06-06 03:52:11 +00:00
|
|
|
//CritLocker crit(::crit_netplay_ptr);
|
2010-05-05 04:31:21 +00:00
|
|
|
|
2010-06-06 03:52:11 +00:00
|
|
|
//if (::netplay_ptr)
|
|
|
|
// ::netplay_ptr->WiimoteUpdate(_number);
|
2010-05-05 04:31:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// called from ---CPU--- thread
|
|
|
|
//
|
|
|
|
int CWII_IPC_HLE_WiiMote::NetPlay_GetWiimoteNum(int _number)
|
|
|
|
{
|
2010-06-06 03:52:11 +00:00
|
|
|
//CritLocker crit(::crit_netplay_ptr);
|
2010-05-05 04:31:21 +00:00
|
|
|
|
2010-06-06 03:52:11 +00:00
|
|
|
//if (::netplay_ptr)
|
|
|
|
// return ::netplay_ptr->GetPadNum(_number); // just using gcpad mapping for now
|
|
|
|
//else
|
2010-05-05 04:31:21 +00:00
|
|
|
return _number;
|
|
|
|
}
|
|
|
|
|
|
|
|
// called from ---CPU--- thread
|
|
|
|
// intercept wiimote input callback
|
2010-06-22 08:30:33 +00:00
|
|
|
//bool CWII_IPC_HLE_WiiMote::NetPlay_WiimoteInput(int _number, u16 _channelID, const void* _pData, u32& _Size)
|
|
|
|
bool CWII_IPC_HLE_WiiMote::NetPlay_WiimoteInput(int, u16, const void*, u32&)
|
2010-05-05 04:31:21 +00:00
|
|
|
{
|
|
|
|
CritLocker crit(::crit_netplay_ptr);
|
|
|
|
|
|
|
|
if (::netplay_ptr)
|
2010-06-06 03:52:11 +00:00
|
|
|
//{
|
|
|
|
// if (_Size >= RPT_SIZE_HACK)
|
|
|
|
// {
|
|
|
|
// _Size -= RPT_SIZE_HACK;
|
|
|
|
// return false;
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// ::netplay_ptr->WiimoteInput(_number, _channelID, _pData, _Size);
|
|
|
|
// // don't use this packet
|
2010-05-05 04:31:21 +00:00
|
|
|
return true;
|
2010-06-06 03:52:11 +00:00
|
|
|
// }
|
|
|
|
//}
|
2010-05-05 04:31:21 +00:00
|
|
|
else
|
|
|
|
return false;
|
|
|
|
}
|