diff --git a/CHANGES b/CHANGES index 1b40d2e19..625e74e84 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,7 @@ Emulation fixes: - GB Serialize: Fix timing bug loading channel 4 timing - GBA: Fix multiboot entry point while skipping BIOS - GBA BIOS: Fix undefined instruction HLE behavior + - GBA DMA: Fix invalid audio DMA parameters - GBA Memory: Misaligned SRAM writes are ignored - GBA Serialize: Fix serializing DMA transfer register - GBA Serialize: Fix audio DMA timing deserialization diff --git a/src/gba/audio.c b/src/gba/audio.c index d2650d6e8..72f49b7e3 100644 --- a/src/gba/audio.c +++ b/src/gba/audio.c @@ -104,6 +104,8 @@ void GBAAudioResizeBuffer(struct GBAAudio* audio, size_t samples) { } void GBAAudioScheduleFifoDma(struct GBAAudio* audio, int number, struct GBADMA* info) { + info->reg = GBADMARegisterSetDestControl(info->reg, GBA_DMA_FIXED); + info->reg = GBADMARegisterSetWidth(info->reg, 1); switch (info->dest) { case BASE_IO | REG_FIFO_A_LO: audio->chA.dmaSource = number; @@ -129,8 +131,6 @@ void GBAAudioScheduleFifoDma(struct GBAAudio* audio, int number, struct GBADMA* audio->externalMixing = false; } } - info->reg = GBADMARegisterSetDestControl(info->reg, GBA_DMA_FIXED); - info->reg = GBADMARegisterSetWidth(info->reg, 1); } void GBAAudioWriteSOUND1CNT_LO(struct GBAAudio* audio, uint16_t value) {