diff options
author | twinaphex | 2018-12-28 00:32:13 +0100 |
---|---|---|
committer | twinaphex | 2018-12-28 00:32:13 +0100 |
commit | c007afe6fd51827fade7aa15a0a798be8bd97839 (patch) | |
tree | 3b8aca538bec3b42ef9bd33549a15110c3a20e37 /src/c4.c | |
parent | 29db3cf00f552808b3f1dc5d11fcdbbefc659ec4 (diff) | |
download | snes9x2002-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.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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
-
|