From 9702298962eccc89ded30901f8b219f3e7f948dc Mon Sep 17 00:00:00 2001 From: João Silva Date: Sat, 14 Jan 2017 23:52:37 +0000 Subject: Copied some apu.c optimizations from snes9x2002. --- source/apu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/apu.c b/source/apu.c index 1ee1013..91453e6 100644 --- a/source/apu.c +++ b/source/apu.c @@ -274,7 +274,7 @@ void S9xSetAPUDSP(uint8_t byte) case APU_P_LOW + 0x60: case APU_P_LOW + 0x70: S9xSetSoundHertz(reg >> 4, - ((byte + (APU.DSP [reg + 1] << 8)) & FREQUENCY_MASK) * 8); + (((byte + (APU.DSP [reg + 1] << 8)) & FREQUENCY_MASK) * 32000) >> 12); break; case APU_P_HIGH + 0x00: @@ -297,8 +297,6 @@ void S9xSetAPUDSP(uint8_t byte) case APU_SRCN + 0x50: case APU_SRCN + 0x60: case APU_SRCN + 0x70: - if (byte != APU.DSP [reg]) - S9xSetSoundSample(reg >> 4, byte); break; case APU_ADSR1 + 0x00: @@ -621,7 +619,7 @@ uint8_t S9xGetAPUDSP() case APU_ENVX + 0x50: case APU_ENVX + 0x60: case APU_ENVX + 0x70: - return ((uint8_t) S9xGetEnvelopeHeight(reg >> 4)); + return 0; case APU_ENDX: break; -- cgit v1.2.3