aboutsummaryrefslogtreecommitdiff
path: root/source/dsp1emu.c
diff options
context:
space:
mode:
authorJoão Silva2017-01-29 04:55:23 +0000
committerJoão Silva2017-01-29 04:55:23 +0000
commit0e59b999fa976de2d00490f552a1ff0a27d40f63 (patch)
treeadce7b06d1acc25f52c6e10616451bba02f9f7a5 /source/dsp1emu.c
parent813fc89d37d1d8c8d2fa090a28f74aa0fdcea5df (diff)
downloadsnes9x2005-0e59b999fa976de2d00490f552a1ff0a27d40f63.tar.gz
snes9x2005-0e59b999fa976de2d00490f552a1ff0a27d40f63.tar.bz2
snes9x2005-0e59b999fa976de2d00490f552a1ff0a27d40f63.zip
Converted most types to stdint-style (fixing a few in the process).
Diffstat (limited to 'source/dsp1emu.c')
-rw-r--r--source/dsp1emu.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/dsp1emu.c b/source/dsp1emu.c
index 3999d5d..a2767b0 100644
--- a/source/dsp1emu.c
+++ b/source/dsp1emu.c
@@ -172,7 +172,7 @@ double Atan(double x)
void InitDSP(void)
{
#ifdef __OPT__
- unsigned int i;
+ uint32_t i;
for (i = 0; i < INCR; i++)
{
CosTable2[i] = (cos((double)(2 * PI * i / INCR)));
@@ -349,8 +349,8 @@ int16_t DSP1_Sin(int16_t Angle)
if (Angle == -32768) return 0;
return -DSP1_Sin(-Angle);
}
- int S = DSP1_SinTable[Angle >> 8] + (DSP1_MulTable[Angle & 0xff] *
- DSP1_SinTable[0x40 + (Angle >> 8)] >> 15);
+ int32_t S = DSP1_SinTable[Angle >> 8] + (DSP1_MulTable[Angle & 0xff] *
+ DSP1_SinTable[0x40 + (Angle >> 8)] >> 15);
if (S > 32767) S = 32767;
return (int16_t) S;
}
@@ -362,8 +362,8 @@ int16_t DSP1_Cos(int16_t Angle)
if (Angle == -32768) return -32768;
Angle = -Angle;
}
- int S = DSP1_SinTable[0x40 + (Angle >> 8)] - (DSP1_MulTable[Angle & 0xff] *
- DSP1_SinTable[Angle >> 8] >> 15);
+ int32_t S = DSP1_SinTable[0x40 + (Angle >> 8)] - (DSP1_MulTable[Angle & 0xff] *
+ DSP1_SinTable[Angle >> 8] >> 15);
if (S < -32768) S = -32767;
return (int16_t) S;
}
@@ -394,7 +394,7 @@ void DSP1_Normalize(int16_t m, int16_t* Coefficient, int16_t* Exponent)
*Exponent -= e;
}
-void DSP1_NormalizeDouble(int Product, int16_t* Coefficient, int16_t* Exponent)
+void DSP1_NormalizeDouble(int32_t Product, int16_t* Coefficient, int16_t* Exponent)
{
int16_t n = Product & 0x7fff;
int16_t m = Product >> 15;
@@ -671,8 +671,8 @@ double ObjPX2;
double ObjPY2;
double ObjPZ2;
double DivideOp06;
-int Temp;
-int tanval2;
+int32_t Temp;
+int32_t tanval2;
#ifdef __OPT06__
void DSPOp06()
@@ -1091,7 +1091,7 @@ int16_t Op08X, Op08Y, Op08Z, Op08Ll, Op08Lh;
void DSPOp08()
{
- int Op08Size = (Op08X * Op08X + Op08Y * Op08Y + Op08Z * Op08Z) << 1;
+ int32_t Op08Size = (Op08X * Op08X + Op08Y * Op08Y + Op08Z * Op08Z) << 1;
Op08Ll = Op08Size & 0xffff;
Op08Lh = (Op08Size >> 16) & 0xffff;
@@ -1121,7 +1121,7 @@ int16_t Op28R;
void DSPOp28()
{
- int Radius = Op28X * Op28X + Op28Y * Op28Y + Op28Z * Op28Z;
+ int32_t Radius = Op28X * Op28X + Op28Y * Op28Y + Op28Z * Op28Z;
if (Radius == 0) Op28R = 0;
else