Fix pokitto sound

This commit is contained in:
Miloslav Číž 2020-09-19 13:39:47 +02:00
parent d06ce1c684
commit c86d30170a
1 changed files with 0 additions and 18 deletions

View File

@ -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[])