mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
cleanup + some eolz
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5842 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1,29 +1,29 @@
|
||||
#include "UDPNunchuk.h"
|
||||
#include "UDPWrapper.h"
|
||||
#include "UDPWiimote.h"
|
||||
|
||||
#include "UDPNunchuk.h"
|
||||
#include "UDPWrapper.h"
|
||||
#include "UDPWiimote.h"
|
||||
|
||||
#define NUNCHUK_C 0x02
|
||||
#define NUNCHUK_Z 0x01
|
||||
|
||||
#define NUNCHUK_Z 0x01
|
||||
|
||||
namespace WiimoteEmu
|
||||
{
|
||||
|
||||
void UDPNunchuk::GetState( u8* const data, const bool focus )
|
||||
{
|
||||
Nunchuk::GetState(data,focus);
|
||||
if (!(wrp->inst)) return;
|
||||
|
||||
wm_extension* const ncdata = (wm_extension*)data;
|
||||
u8 mask;
|
||||
float x,y;
|
||||
wrp->inst->getNunchuck(x,y,mask);
|
||||
if (mask&UDPWM_NC) ncdata->bt&=~NUNCHUK_C;
|
||||
if (mask&UDPWM_NZ) ncdata->bt&=~NUNCHUK_Z;
|
||||
if ((ncdata->jx==0x80)&&(ncdata->jy==0x80))
|
||||
{
|
||||
ncdata->jx=u8(0x80+x*127);
|
||||
ncdata->jy=u8(0x80+y*127);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
void UDPNunchuk::GetState( u8* const data, const bool focus )
|
||||
{
|
||||
Nunchuk::GetState(data, focus);
|
||||
if (!(wrp->inst)) return;
|
||||
|
||||
wm_extension* const ncdata = (wm_extension*)data;
|
||||
u8 mask;
|
||||
float x, y;
|
||||
wrp->inst->getNunchuck(x, y, mask);
|
||||
if (mask&UDPWM_NC) ncdata->bt&=~NUNCHUK_C;
|
||||
if (mask&UDPWM_NZ) ncdata->bt&=~NUNCHUK_Z;
|
||||
if ((ncdata->jx==0x80)&&(ncdata->jy==0x80))
|
||||
{
|
||||
ncdata->jx=u8(0x80+x*127);
|
||||
ncdata->jy=u8(0x80+y*127);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user