From c86d30170a775e082ffc2bad73143019085442f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sat, 19 Sep 2020 13:39:47 +0200 Subject: [PATCH] Fix pokitto sound --- main_sdl.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/main_sdl.c b/main_sdl.c index f184212..4feb898 100644 --- a/main_sdl.c +++ b/main_sdl.c @@ -244,9 +244,7 @@ void SFG_enableMusic(uint8_t enable) void SFG_playSound(uint8_t soundIndex, uint8_t volume) { uint16_t pos = audioPos; - uint8_t volumeShift = 15 - volume / 16; - uint16_t baseLevel = AUDIO_ZERO - (0x8000 >> volumeShift); for (int i = 0; i < SFG_SFX_SAMPLE_COUNT; ++i) @@ -256,22 +254,6 @@ void SFG_playSound(uint8_t soundIndex, uint8_t volume) pos = (pos < SFG_SFX_SAMPLE_COUNT - 1) ? (pos + 1) : 0; } - -/* - int8_t volumeShift = volume / 16 - 7; // -7 to 8 - - uint16_t baseLevel = AUDIO_ZERO - (0x0001 << (volumeShift + 7)); - - for (int i = 0; i < SFG_SFX_SAMPLE_COUNT; ++i) - { - audioBuff[pos] = mixSamples(audioBuff[pos],baseLevel + - ((volumeShift >= 0) ? - (SFG_GET_SFX_SAMPLE(soundIndex,i) << volumeShift) : - (SFG_GET_SFX_SAMPLE(soundIndex,i) >> (-1 * volumeShift)))); - - pos = (pos < SFG_SFX_SAMPLE_COUNT - 1) ? (pos + 1) : 0; - } -*/ } int main(int argc, char *argv[])