|
@@ -130,17 +130,42 @@ F32 Platform::getRandom()
|
|
|
return sgPlatRandom.randF();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+#if defined(i386) || defined(__x86_64__)
|
|
|
+
|
|
|
U32 Platform::getMathControlState()
|
|
|
{
|
|
|
- return 0;
|
|
|
+ U16 cw;
|
|
|
+ asm("fstcw %0" : "=m" (cw) :);
|
|
|
+ return cw;
|
|
|
+}
|
|
|
+
|
|
|
+void Platform::setMathControlState(U32 state)
|
|
|
+{
|
|
|
+ U16 cw = state;
|
|
|
+ asm("fldcw %0" : : "m" (cw));
|
|
|
}
|
|
|
|
|
|
void Platform::setMathControlStateKnown()
|
|
|
{
|
|
|
-
|
|
|
+ U16 cw = 0x27F;
|
|
|
+ asm("fldcw %0" : : "m" (cw));
|
|
|
+}
|
|
|
+
|
|
|
+#else
|
|
|
+
|
|
|
+U32 Platform::getMathControlState()
|
|
|
+{
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
void Platform::setMathControlState(U32 state)
|
|
|
{
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
+void Platform::setMathControlStateKnown()
|
|
|
+{
|
|
|
+}
|
|
|
+
|
|
|
+#endif
|
|
|
+
|