DS Audio: Defer mixer updates until needed

This commit is contained in:
Vicki Pfau 2021-09-05 13:58:14 -07:00
parent 5730b50ecb
commit 517dfe12ee
2 changed files with 2 additions and 1 deletions

View File

@ -29,6 +29,7 @@ Bugfixes:
- DS Memory: Fix crash when overflowing misaligned WRAM jump - DS Memory: Fix crash when overflowing misaligned WRAM jump
Misc: Misc:
- ARM: Add F-block instruction decoding - ARM: Add F-block instruction decoding
- DS Audio: Defer mixer updates until needed
- DS GX: Clean up and unify texture mapping - DS GX: Clean up and unify texture mapping
- DS Core: Add symbol loading - DS Core: Add symbol loading
- DS Video: Simplify VRAM mapping - DS Video: Simplify VRAM mapping

View File

@ -276,7 +276,6 @@ static void _updateChannel(struct mTiming* timing, void* user, uint32_t cyclesLa
} }
ch->sample = (0xFFFF * ch->high) - 0x8000; ch->sample = (0xFFFF * ch->high) - 0x8000;
} }
_updateMixer(ch->p);
if (ch->format == 3 && ch->index < 14) { if (ch->format == 3 && ch->index < 14) {
int32_t period = ch->period; int32_t period = ch->period;
if (ch->high) { if (ch->high) {
@ -323,6 +322,7 @@ static int _applyBias(struct DSAudio* audio, int sample) {
static void _sample(struct mTiming* timing, void* user, uint32_t cyclesLate) { static void _sample(struct mTiming* timing, void* user, uint32_t cyclesLate) {
struct DSAudio* audio = user; struct DSAudio* audio = user;
_updateMixer(audio);
int16_t sampleLeft = _applyBias(audio, audio->sampleLeft); int16_t sampleLeft = _applyBias(audio, audio->sampleLeft);
int16_t sampleRight = _applyBias(audio, audio->sampleRight); int16_t sampleRight = _applyBias(audio, audio->sampleRight);