all repos — mgba @ b6f3a2929d9fe2a7ca31a0f2d420031898196216

mGBA Game Boy Advance Emulator

GB, GBA Audio: Adjust mixdown
Vicki Pfau vi@endrift.com
Fri, 21 Sep 2018 17:59:37 -0700
commit

b6f3a2929d9fe2a7ca31a0f2d420031898196216

parent

6e7c250b19f63c4bdc02acd29170c0fb0d9013eb

2 files changed, 12 insertions(+), 12 deletions(-)

jump to
M src/gb/audio.csrc/gb/audio.c

@@ -576,47 +576,47 @@ }

} void GBAudioSamplePSG(struct GBAudio* audio, int16_t* left, int16_t* right) { - int dcOffset = audio->style == GB_AUDIO_GBA ? 0 : 0x8; + int dcOffset = audio->style == GB_AUDIO_GBA ? 0 : -0x8; int sampleLeft = dcOffset; int sampleRight = dcOffset; if (audio->playingCh1 && !audio->forceDisableCh[0]) { if (audio->ch1Left) { - sampleLeft -= audio->ch1.sample; + sampleLeft += audio->ch1.sample; } if (audio->ch1Right) { - sampleRight -= audio->ch1.sample; + sampleRight += audio->ch1.sample; } } if (audio->playingCh2 && !audio->forceDisableCh[1]) { if (audio->ch2Left) { - sampleLeft -= audio->ch2.sample; + sampleLeft += audio->ch2.sample; } if (audio->ch2Right) { - sampleRight -= audio->ch2.sample; + sampleRight += audio->ch2.sample; } } if (audio->playingCh3 && !audio->forceDisableCh[2]) { if (audio->ch3Left) { - sampleLeft -= audio->ch3.sample; + sampleLeft += audio->ch3.sample; } if (audio->ch3Right) { - sampleRight -= audio->ch3.sample; + sampleRight += audio->ch3.sample; } } if (audio->playingCh4 && !audio->forceDisableCh[3]) { if (audio->ch4Left) { - sampleLeft -= audio->ch4.sample; + sampleLeft += audio->ch4.sample; } if (audio->ch4Right) { - sampleRight -= audio->ch4.sample; + sampleRight += audio->ch4.sample; } }

@@ -632,8 +632,8 @@ struct GBAudio* audio = user;

int16_t sampleLeft = 0; int16_t sampleRight = 0; GBAudioSamplePSG(audio, &sampleLeft, &sampleRight); - sampleLeft = (sampleLeft * audio->masterVolume * 9) >> 7; - sampleRight = (sampleRight * audio->masterVolume * 9) >> 7; + sampleLeft = (sampleLeft * audio->masterVolume * 6) >> 7; + sampleRight = (sampleRight * audio->masterVolume * 6) >> 7; mCoreSyncLockAudio(audio->p->sync); unsigned produced;
M src/gba/audio.csrc/gba/audio.c

@@ -253,7 +253,7 @@ sample = 0x3FF;

} else if (sample < 0) { sample = 0; } - return ((sample - GBARegisterSOUNDBIASGetBias(audio->soundbias)) * audio->masterVolume) >> 2; + return ((sample - GBARegisterSOUNDBIASGetBias(audio->soundbias)) * audio->masterVolume * 3) >> 4; } static void _sample(struct mTiming* timing, void* user, uint32_t cyclesLate) {