Added UDPWii support to the new plugin. Hopefully I didn't made a mess... Nunchuck support not implemented yet. I want to make it a separate extension.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5835 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
dapetcu21
2010-07-05 10:46:32 +00:00
parent fccacd7f62
commit ca827b9930
16 changed files with 715 additions and 18 deletions

View File

@ -25,6 +25,8 @@
#define WIIMOTE_MINUS 0x1000
#define WIIMOTE_HOME 0x8000
#include "UDPTLayer.h" //this must be included after the buttons
namespace WiimoteEmu
{
@ -274,6 +276,9 @@ Wiimote::Wiimote( const unsigned int index )
// swing
//groups.push_back( m_swing = new Force( "Swing" ) );
//udp
groups.push_back( m_udp = new UDPWrapper( m_index , "UDP Wiimote" ) );
// shake
groups.push_back( m_shake = new Buttons( "Shake" ) );
m_shake->controls.push_back( new ControlGroup::Input( "X" ) );
@ -388,7 +393,7 @@ void Wiimote::Update()
m_buttons->GetState( &m_status.buttons, button_bitmasks );
m_dpad->GetState( &m_status.buttons, is_sideways ? dpad_sideways_bitmasks : dpad_bitmasks );
}
UDPTLayer::GetButtons( m_udp, &m_status.buttons );
// check if there is a read data request
if (m_read_requests.size())
{
@ -481,7 +486,7 @@ void Wiimote::Update()
// ----SHAKE----
if (is_focus)
EmulateShake(data + rpt.accel, m_shake, m_shake_step);
UDPTLayer::GetAcceleration( m_udp, (wm_accel*)&data[rpt.accel], (accel_cal*)&m_eeprom[0x16]);
}
// ----ir----
@ -491,6 +496,7 @@ void Wiimote::Update()
if (is_focus)
m_ir->GetState(&xx, &yy, &zz, true);
UDPTLayer::GetIR( m_udp, &xx, &yy, &zz);
xx *= (-256 * 0.95f);
xx += 512;
@ -779,3 +785,4 @@ void Wiimote::Register::Write( size_t address, void* src, size_t length )
}