mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Wiimote: More work, don't ask, no answer
nJoy: Maybe this could reactivate multi-pad? git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4729 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -243,6 +243,7 @@ void PitchAccelerometerToDegree(u8 _x, u8 _y, u8 _z, int &_Roll, int &_Pitch, in
|
||||
// IR data functions
|
||||
//******************************************************************************
|
||||
|
||||
/*
|
||||
// Calculate dot positions from the basic 10 byte IR data
|
||||
void IRData2DotsBasic(u8 *Data)
|
||||
{
|
||||
@ -260,7 +261,7 @@ void IRData2DotsBasic(u8 *Data)
|
||||
Dot[3].Rx = 1023 - (Data[8] | ((Data[7] & 0x03) << 8));
|
||||
Dot[3].Ry = Data[9] | ((Data[7] & 0x0c) << 6);
|
||||
|
||||
/* set each IR spot to visible if spot is in range */
|
||||
// set each IR spot to visible if spot is in range
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
if (Dot[i].Ry == 1023)
|
||||
@ -270,7 +271,7 @@ void IRData2DotsBasic(u8 *Data)
|
||||
else
|
||||
{
|
||||
Dot[i].Visible = 1;
|
||||
Dot[i].Size = 0; /* since we don't know the size, set it as 0 */
|
||||
Dot[i].Size = 0; // since we don't know the size, set it as 0
|
||||
}
|
||||
|
||||
// For now we let our virtual resolution be the same as the default one
|
||||
@ -281,8 +282,9 @@ void IRData2DotsBasic(u8 *Data)
|
||||
ReorderIRDots();
|
||||
IRData2Distance();
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
// Calculate dot positions from the extented 12 byte IR data
|
||||
void IRData2Dots(u8 *Data)
|
||||
{
|
||||
@ -297,7 +299,7 @@ void IRData2Dots(u8 *Data)
|
||||
|
||||
Dot[i].Size = Data[(3*i)+2] & 0x0f;
|
||||
|
||||
/* if in range set to visible */
|
||||
// if in range set to visible
|
||||
if (Dot[i].Ry == 1023)
|
||||
Dot[i].Visible = false;
|
||||
else
|
||||
@ -313,8 +315,9 @@ void IRData2Dots(u8 *Data)
|
||||
ReorderIRDots();
|
||||
IRData2Distance();
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
// Reorder the IR dots according to their x-axis value
|
||||
void ReorderIRDots()
|
||||
{
|
||||
@ -347,8 +350,9 @@ void ReorderIRDots()
|
||||
Dot[i].Order = order;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
// Calculate dot positions from the extented 12 byte IR data
|
||||
void IRData2Distance()
|
||||
{
|
||||
@ -371,15 +375,15 @@ void IRData2Distance()
|
||||
// Only one dot was visible, we can not calculate the distance
|
||||
if (i2 == 4) { g_Wiimote_kbd.IR.Distance = 0; return; }
|
||||
|
||||
/* For the emulated Wiimote the y distance is always zero so then the distance is the
|
||||
simple distance between the x dots, i.e. the sensor bar width */
|
||||
// For the emulated Wiimote the y distance is always zero so then the distance is the
|
||||
// simple distance between the x dots, i.e. the sensor bar width
|
||||
int xd = Dot[i2].X - Dot[i1].X;
|
||||
int yd = Dot[i2].Y - Dot[i1].Y;
|
||||
|
||||
// Save the distance
|
||||
g_Wiimote_kbd.IR.Distance = (int)sqrt((float)(xd*xd) + (float)(yd*yd));
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
//******************************************************************************
|
||||
// Classic Controller functions
|
||||
|
Reference in New Issue
Block a user