GB, GBA Audio: Increase max audio volume

This commit is contained in:
Vicki Pfau 2018-05-11 17:19:16 -07:00
parent 56e40b118c
commit dadcf40ee2
3 changed files with 5 additions and 4 deletions

View File

@ -55,6 +55,7 @@ Misc:
- GBA Savedata: Remove ability to disable realistic timing - GBA Savedata: Remove ability to disable realistic timing
- Qt: Add load alternate save option - Qt: Add load alternate save option
- GB Audio: Improved audio quality - GB Audio: Improved audio quality
- GB, GBA Audio: Increase max audio volume
0.6.3: (2017-04-14) 0.6.3: (2017-04-14)
Bugfixes: Bugfixes:

View File

@ -627,7 +627,7 @@ void GBAudioSamplePSG(struct GBAudio* audio, int16_t* left, int16_t* right) {
} }
} }
int dcOffset = audio->style == GB_AUDIO_GBA ? 0 : 0x1FC; int dcOffset = audio->style == GB_AUDIO_GBA ? 0 : 0x20A;
*left = (sampleLeft - dcOffset) * (1 + audio->volumeLeft); *left = (sampleLeft - dcOffset) * (1 + audio->volumeLeft);
*right = (sampleRight - dcOffset) * (1 + audio->volumeRight); *right = (sampleRight - dcOffset) * (1 + audio->volumeRight);
} }
@ -637,8 +637,8 @@ static void _sample(struct mTiming* timing, void* user, uint32_t cyclesLate) {
int16_t sampleLeft = 0; int16_t sampleLeft = 0;
int16_t sampleRight = 0; int16_t sampleRight = 0;
GBAudioSamplePSG(audio, &sampleLeft, &sampleRight); GBAudioSamplePSG(audio, &sampleLeft, &sampleRight);
sampleLeft = (sampleLeft * audio->masterVolume) >> 6; sampleLeft = (sampleLeft * audio->masterVolume * 9) >> 7;
sampleRight = (sampleRight * audio->masterVolume) >> 6; sampleRight = (sampleRight * audio->masterVolume * 9) >> 7;
mCoreSyncLockAudio(audio->p->sync); mCoreSyncLockAudio(audio->p->sync);
unsigned produced; unsigned produced;

View File

@ -253,7 +253,7 @@ static int _applyBias(struct GBAAudio* audio, int sample) {
} else if (sample < 0) { } else if (sample < 0) {
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) { static void _sample(struct mTiming* timing, void* user, uint32_t cyclesLate) {