aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJoão Silva2017-06-18 15:47:55 +0100
committerJoão Silva2017-06-18 15:47:55 +0100
commit825afb62ef49645422497b9c9895ab9d92432371 (patch)
tree08fa588231488fa46ca8278d1666e7a17a47737b /source
parentd66c2f9506c54aa845e77dc2194f6b3dc3915a00 (diff)
downloadsnesemu-825afb62ef49645422497b9c9895ab9d92432371.tar.gz
snesemu-825afb62ef49645422497b9c9895ab9d92432371.tar.bz2
snesemu-825afb62ef49645422497b9c9895ab9d92432371.zip
Small APU fix.
Diffstat (limited to 'source')
-rw-r--r--source/apu.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/apu.c b/source/apu.c
index 521d9b3..dbbe8e0 100644
--- a/source/apu.c
+++ b/source/apu.c
@@ -8,7 +8,7 @@
#include "soundux.h"
#include "cpuexec.h"
-extern int32_t NoiseFreq [32];
+extern int32_t NoiseFreq[32];
bool S9xInitAPU()
{
@@ -17,10 +17,10 @@ bool S9xInitAPU()
if (!IAPU.RAM)
{
S9xDeinitAPU();
- return (false);
+ return false;
}
- return (true);
+ return true;
}
void S9xDeinitAPU()
@@ -246,7 +246,7 @@ void S9xSetAPUDSP(uint8_t byte)
case APU_P_LOW + 0x50:
case APU_P_LOW + 0x60:
case APU_P_LOW + 0x70:
- S9xSetSoundHertz(reg >> 4, ((byte + (APU.DSP [reg + 1] << 8)) & FREQUENCY_MASK) / 8);
+ S9xSetSoundHertz(reg >> 4, (((int16_t) byte + ((int16_t) APU.DSP [reg + 1] << 8)) & FREQUENCY_MASK) / 8);
break;
case APU_P_HIGH + 0x00:
case APU_P_HIGH + 0x10:
@@ -256,7 +256,7 @@ void S9xSetAPUDSP(uint8_t byte)
case APU_P_HIGH + 0x50:
case APU_P_HIGH + 0x60:
case APU_P_HIGH + 0x70:
- S9xSetSoundHertz(reg >> 4, (((byte << 8) + APU.DSP [reg - 1]) & FREQUENCY_MASK) * 8);
+ S9xSetSoundHertz(reg >> 4, ((((int16_t) byte << 8) + (int16_t) APU.DSP [reg - 1]) & FREQUENCY_MASK) * 8);
break;
case APU_ADSR1 + 0x00:
case APU_ADSR1 + 0x10: