Merge pull request #2064 from magcius/fix-tilt
WiimoteEmu: Add back the calibrated accel data to the EEPROM
This commit is contained in:
commit
39e121e551
|
@ -32,13 +32,14 @@ auto const PI = TAU / 2.0;
|
||||||
namespace WiimoteEmu
|
namespace WiimoteEmu
|
||||||
{
|
{
|
||||||
|
|
||||||
/* An example of a factory default first bytes of the Eeprom memory. There are differences between
|
|
||||||
different Wiimotes, my Wiimote had different neutral values for the accelerometer. */
|
|
||||||
static const u8 eeprom_data_0[] = {
|
static const u8 eeprom_data_0[] = {
|
||||||
// IR, maybe more
|
// IR, maybe more
|
||||||
// assuming last 2 bytes are checksum
|
// assuming last 2 bytes are checksum
|
||||||
0xA1, 0xAA, 0x8B, 0x99, 0xAE, 0x9E, 0x78, 0x30, 0xA7, /*0x74, 0xD3,*/ 0x00, 0x00, // messing up the checksum on purpose
|
0xA1, 0xAA, 0x8B, 0x99, 0xAE, 0x9E, 0x78, 0x30, 0xA7, /*0x74, 0xD3,*/ 0x00, 0x00, // messing up the checksum on purpose
|
||||||
0xA1, 0xAA, 0x8B, 0x99, 0xAE, 0x9E, 0x78, 0x30, 0xA7, /*0x74, 0xD3,*/ 0x00, 0x00,
|
0xA1, 0xAA, 0x8B, 0x99, 0xAE, 0x9E, 0x78, 0x30, 0xA7, /*0x74, 0xD3,*/ 0x00, 0x00,
|
||||||
|
// Accelerometer
|
||||||
|
ACCEL_ZERO_G, ACCEL_ZERO_G, ACCEL_ZERO_G, 0, ACCEL_ONE_G, ACCEL_ONE_G, ACCEL_ONE_G, 0, 0, 0,
|
||||||
|
ACCEL_ZERO_G, ACCEL_ZERO_G, ACCEL_ZERO_G, 0, ACCEL_ONE_G, ACCEL_ONE_G, ACCEL_ONE_G, 0, 0, 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u8 motion_plus_id[] = { 0x00, 0x00, 0xA6, 0x20, 0x00, 0x05 };
|
static const u8 motion_plus_id[] = { 0x00, 0x00, 0xA6, 0x20, 0x00, 0x05 };
|
||||||
|
|
|
@ -85,6 +85,13 @@ inline double trim(double a)
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
ACCEL_ZERO_G = 0x80,
|
||||||
|
ACCEL_ONE_G = 0x9A,
|
||||||
|
ACCEL_RANGE = (ACCEL_ONE_G - ACCEL_ZERO_G),
|
||||||
|
};
|
||||||
|
|
||||||
class Wiimote : public ControllerEmu
|
class Wiimote : public ControllerEmu
|
||||||
{
|
{
|
||||||
friend class WiimoteReal::Wiimote;
|
friend class WiimoteReal::Wiimote;
|
||||||
|
@ -106,13 +113,6 @@ public:
|
||||||
BUTTON_HOME = 0x8000,
|
BUTTON_HOME = 0x8000,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
ACCEL_ZERO_G = 0x80,
|
|
||||||
ACCEL_ONE_G = 0x9A,
|
|
||||||
ACCEL_RANGE = (ACCEL_ONE_G - ACCEL_ZERO_G),
|
|
||||||
};
|
|
||||||
|
|
||||||
Wiimote(const unsigned int index);
|
Wiimote(const unsigned int index);
|
||||||
std::string GetName() const override;
|
std::string GetName() const override;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue