From 7cf23a2c4d20fe23133974e5a0595edd44fd49b4 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 11 Sep 2009 08:43:32 +0000 Subject: M4: Seems that s1_cos and s1_sin are either misnamed, or buggy ? svn-id: r44026 --- engines/m4/ws_sequence.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engines/m4/ws_sequence.cpp b/engines/m4/ws_sequence.cpp index e980d91675..4c806c9806 100644 --- a/engines/m4/ws_sequence.cpp +++ b/engines/m4/ws_sequence.cpp @@ -27,7 +27,7 @@ namespace M4 { -long sinCosTable[320] = { +static const long sinCosTable[320] = { 0, 1608, 3215, 4821, 6423, 8022, 9616, 11204, 12785, 14359, 15923, 17479, 19024, 20557, 22078, 23586, 25079, 26557, 28020, 29465, 30893, 32302, 33692, 35061, @@ -408,6 +408,9 @@ bool Sequence::s1_sin(Instruction &instruction) { else tempAngle &= 0xff; + // FIXME: Why use the cosTable in s1_sin() ? + // Note that sin(0) 0 and sinTable[0] = 0 but cos(0)=1, and indeed + // cosTable[0] = 65536, which is 1 considered as a fixed point. *instruction.argp[0] = -cosTable[tempAngle]; return true; @@ -422,6 +425,9 @@ bool Sequence::s1_cos(Instruction &instruction) { else tempAngle &= 0xff; + // FIXME: Why use the sinTable in s1_cos() ? + // Note that sin(0) 0 and sinTable[0] = 0 but cos(0)=1, and indeed + // cosTable[0] = 65536, which is 1 considered as a fixed point. *instruction.argp[0] = sinTable[tempAngle]; return true; -- cgit v1.2.3