diff --git a/lib/wiiuse/dynamics.c b/lib/wiiuse/dynamics.c
index 76ac2028f..b2f88ccd7 100644
--- a/lib/wiiuse/dynamics.c
+++ b/lib/wiiuse/dynamics.c
@@ -64,7 +64,7 @@ void calculate_orientation(struct accel_t* ac, struct vec3b_t* accel, struct ori
*/
/* yaw - set to 0, IR will take care of it if it's enabled */
- orient->yaw = 0.0f;
+ //orient->yaw = 0.0f;
/* find out how much it has to move to be 1g */
xg = (float)ac->cal_g.x;
@@ -110,6 +110,12 @@ void calculate_orientation(struct accel_t* ac, struct vec3b_t* accel, struct ori
orient->a_pitch = y;
}
+ if (abs(accel->z - ac->cal_zero.z) <= ac->cal_g.z) {
+ z = RAD_TO_DEGREE(atan2f(x, y));
+
+ orient->yaw = z;
+ }
+
/* smooth the angles if enabled */
if (smooth) {
apply_smoothing(ac, orient, SMOOTH_ROLL);
diff --git a/lib/wiiuse/wiiuse/wiiuse.vcproj b/lib/wiiuse/wiiuse/wiiuse.vcproj
index 6f3826900..c1fccf385 100755
--- a/lib/wiiuse/wiiuse/wiiuse.vcproj
+++ b/lib/wiiuse/wiiuse/wiiuse.vcproj
@@ -201,10 +201,6 @@
RelativePath="..\io.h"
>
-
-
@@ -233,10 +229,6 @@
RelativePath="..\os.h"
>
-
-
diff --git a/lib/wiiuse/wiiuse_msvcstdint.h b/lib/wiiuse/wiiuse_msvcstdint.h
index c66fbb817..2a11a03e6 100644
--- a/lib/wiiuse/wiiuse_msvcstdint.h
+++ b/lib/wiiuse/wiiuse_msvcstdint.h
@@ -102,11 +102,17 @@ typedef uint64_t uint_least64_t;
// 7.18.1.3 Fastest minimum-width integer types
typedef int8_t int_fast8_t;
+// Redefinition with different type on VS 2012
+#if (_MSC_VER < 1700)
typedef int16_t int_fast16_t;
+#endif
typedef int32_t int_fast32_t;
typedef int64_t int_fast64_t;
typedef uint8_t uint_fast8_t;
+// Redefinition with different type on VS 2012
+#if (_MSC_VER < 1700)
typedef uint16_t uint_fast16_t;
+#endif
typedef uint32_t uint_fast32_t;
typedef uint64_t uint_fast64_t;