GBA DMA: Fix invalid audio DMA parameters

This commit is contained in:
Vicki Pfau 2020-02-15 13:43:50 -08:00
parent a3f42ff63d
commit 24a90e317f
2 changed files with 3 additions and 2 deletions

View File

@ -3,6 +3,7 @@ Emulation fixes:
- GB Serialize: Fix timing bug loading channel 4 timing - GB Serialize: Fix timing bug loading channel 4 timing
- GBA: Fix multiboot entry point while skipping BIOS - GBA: Fix multiboot entry point while skipping BIOS
- GBA BIOS: Fix undefined instruction HLE behavior - GBA BIOS: Fix undefined instruction HLE behavior
- GBA DMA: Fix invalid audio DMA parameters
- GBA Memory: Misaligned SRAM writes are ignored - GBA Memory: Misaligned SRAM writes are ignored
- GBA Serialize: Fix serializing DMA transfer register - GBA Serialize: Fix serializing DMA transfer register
- GBA Serialize: Fix audio DMA timing deserialization - GBA Serialize: Fix audio DMA timing deserialization

View File

@ -104,6 +104,8 @@ void GBAAudioResizeBuffer(struct GBAAudio* audio, size_t samples) {
} }
void GBAAudioScheduleFifoDma(struct GBAAudio* audio, int number, struct GBADMA* info) { 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) { switch (info->dest) {
case BASE_IO | REG_FIFO_A_LO: case BASE_IO | REG_FIFO_A_LO:
audio->chA.dmaSource = number; audio->chA.dmaSource = number;
@ -129,8 +131,6 @@ void GBAAudioScheduleFifoDma(struct GBAAudio* audio, int number, struct GBADMA*
audio->externalMixing = false; 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) { void GBAAudioWriteSOUND1CNT_LO(struct GBAAudio* audio, uint16_t value) {