From 825afb62ef49645422497b9c9895ab9d92432371 Mon Sep 17 00:00:00 2001 From: João Silva Date: Sun, 18 Jun 2017 15:47:55 +0100 Subject: Small APU fix. --- source/apu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source') 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: -- cgit v1.2.3