summaryrefslogtreecommitdiff
path: root/src/c4.c
diff options
context:
space:
mode:
authortwinaphex2018-12-28 00:32:13 +0100
committertwinaphex2018-12-28 00:32:13 +0100
commitc007afe6fd51827fade7aa15a0a798be8bd97839 (patch)
tree3b8aca538bec3b42ef9bd33549a15110c3a20e37 /src/c4.c
parent29db3cf00f552808b3f1dc5d11fcdbbefc659ec4 (diff)
downloadsnes9x2002-c007afe6fd51827fade7aa15a0a798be8bd97839.tar.gz
snes9x2002-c007afe6fd51827fade7aa15a0a798be8bd97839.tar.bz2
snes9x2002-c007afe6fd51827fade7aa15a0a798be8bd97839.zip
Start significantly refactoring this codebase so we can get it
to work with MSVC
Diffstat (limited to 'src/c4.c')
-rw-r--r--src/c4.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/c4.c b/src/c4.c
index 060b642..20f59c3 100644
--- a/src/c4.c
+++ b/src/c4.c
@@ -81,8 +81,6 @@
#include "c4.h"
//#include "memmap.h"
-START_EXTERN_C
-
short C4WFXVal;
short C4WFYVal;
short C4WFZVal;
@@ -169,24 +167,26 @@ const short C4_SinTable[256] =
short C4_Sin(short Angle)
{
+ int S;
if (Angle < 0)
{
if (Angle == -32768) return 0;
return -C4_Sin(-Angle);
}
- int S = C4_SinTable[Angle >> 8] + (C4_MulTable[Angle & 0xff] * C4_SinTable[0x40 + (Angle >> 8)] >> 15);
+ S = C4_SinTable[Angle >> 8] + (C4_MulTable[Angle & 0xff] * C4_SinTable[0x40 + (Angle >> 8)] >> 15);
if (S > 32767) S = 32767;
return (short) S;
}
short C4_Cos(short Angle)
{
+ int S;
if (Angle < 0)
{
if (Angle == -32768) return -32768;
Angle = -Angle;
}
- int S = C4_SinTable[0x40 + (Angle >> 8)] - (C4_MulTable[Angle & 0xff] * C4_SinTable[Angle >> 8] >> 15);
+ S = C4_SinTable[0x40 + (Angle >> 8)] - (C4_MulTable[Angle & 0xff] * C4_SinTable[Angle >> 8] >> 15);
if (S < -32768) S = -32767;
return (short) S;
}
@@ -426,6 +426,3 @@ void C4Op0D()
C41FXVal = (short) (C41FXVal * tanval * 0.98);
*/
}
-
-END_EXTERN_C
-