GB, GBA Audio: Increase max audio volume
Vicki Pfau vi@endrift.com
Fri, 11 May 2018 17:19:16 -0700
3 files changed,
5 insertions(+),
4 deletions(-)
M
src/gb/audio.c
→
src/gb/audio.c
@@ -627,7 +627,7 @@ sampleRight += audio->ch4.sample;
} } - int dcOffset = audio->style == GB_AUDIO_GBA ? 0 : 0x1FC; + int dcOffset = audio->style == GB_AUDIO_GBA ? 0 : 0x20A; *left = (sampleLeft - dcOffset) * (1 + audio->volumeLeft); *right = (sampleRight - dcOffset) * (1 + audio->volumeRight); }@@ -637,8 +637,8 @@ struct GBAudio* audio = user;
int16_t sampleLeft = 0; int16_t sampleRight = 0; GBAudioSamplePSG(audio, &sampleLeft, &sampleRight); - sampleLeft = (sampleLeft * audio->masterVolume) >> 6; - sampleRight = (sampleRight * audio->masterVolume) >> 6; + sampleLeft = (sampleLeft * audio->masterVolume * 9) >> 7; + sampleRight = (sampleRight * audio->masterVolume * 9) >> 7; mCoreSyncLockAudio(audio->p->sync); unsigned produced;
M
src/gba/audio.c
→
src/gba/audio.c
@@ -253,7 +253,7 @@ sample = 0x3FF;
} else if (sample < 0) { sample = 0; } - return ((sample - GBARegisterSOUNDBIASGetBias(audio->soundbias)) * audio->masterVolume) >> 3; + return ((sample - GBARegisterSOUNDBIASGetBias(audio->soundbias)) * audio->masterVolume) >> 2; } static void _sample(struct mTiming* timing, void* user, uint32_t cyclesLate) {