Emulated Wiimote: Fixed the Nunchuck calibration, for recording playback for example

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2317 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-02-20 13:14:23 +00:00
parent 489816dce7
commit e0593b1041
6 changed files with 163 additions and 124 deletions

View File

@ -72,7 +72,7 @@ bool g_EmulatedWiiMoteInitialized = false;
bool g_WiimoteUnexpectedDisconnect = false;
// Settings
accel_cal g_accel;
accel_cal g_wm;
nu_cal g_nu;
// Debugging
@ -755,9 +755,9 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
// -------------------------
// Show the number of g forces on the axes
float Gx = WiiMoteEmu::AccelerometerToG((float)data[4], (float)g_accel.cal_zero.x, (float)g_accel.cal_g.x);
float Gy = WiiMoteEmu::AccelerometerToG((float)data[5], (float)g_accel.cal_zero.y, (float)g_accel.cal_g.y);
float Gz = WiiMoteEmu::AccelerometerToG((float)data[6], (float)g_accel.cal_zero.z, (float)g_accel.cal_g.z);
float Gx = WiiMoteEmu::AccelerometerToG((float)data[4], (float)g_wm.cal_zero.x, (float)g_wm.cal_g.x);
float Gy = WiiMoteEmu::AccelerometerToG((float)data[5], (float)g_wm.cal_zero.y, (float)g_wm.cal_g.y);
float Gz = WiiMoteEmu::AccelerometerToG((float)data[6], (float)g_wm.cal_zero.z, (float)g_wm.cal_g.z);
std::string GForce = StringFromFormat("%s %s %s",
((int)Gx >= 0) ? StringFromFormat(" %i", (int)Gx).c_str() : StringFromFormat("%i", (int)Gx).c_str(),
((int)Gy >= 0) ? StringFromFormat(" %i", (int)Gy).c_str() : StringFromFormat("%i", (int)Gy).c_str(),