mirror of https://github.com/mgba-emu/mgba.git
GBA Audio: Force audio FIFOs to 32-bit
This commit is contained in:
parent
cda804656b
commit
1856b77cbc
1
CHANGES
1
CHANGES
|
@ -11,6 +11,7 @@ Bugfixes:
|
|||
- GBA Audio: FIFOs should not poll DMAs that are not scheduled for audio
|
||||
- Qt: Fix "QOpenGLContext::swapBuffers() called with non-exposed window" warning
|
||||
- ARM7: Fix SWI and IRQ timings
|
||||
- GBA Audio: Force audio FIFOs to 32-bit
|
||||
|
||||
0.2.0: (2015-04-03)
|
||||
Features:
|
||||
|
|
|
@ -487,30 +487,6 @@ void GBAAudioWriteFIFO(struct GBAAudio* audio, int address, uint32_t value) {
|
|||
}
|
||||
}
|
||||
|
||||
void GBAAudioWriteFIFO16(struct GBAAudio* audio, int address, uint16_t value) {
|
||||
struct CircleBuffer* fifo;
|
||||
switch (address) {
|
||||
case REG_FIFO_A_LO:
|
||||
case REG_FIFO_A_HI:
|
||||
fifo = &audio->chA.fifo;
|
||||
break;
|
||||
case REG_FIFO_B_LO:
|
||||
case REG_FIFO_B_HI:
|
||||
fifo = &audio->chB.fifo;
|
||||
break;
|
||||
default:
|
||||
GBALog(audio->p, GBA_LOG_ERROR, "Bad FIFO write to address 0x%03x", address);
|
||||
return;
|
||||
}
|
||||
int i;
|
||||
for (i = 0; i < 2; ++i) {
|
||||
while (!CircleBufferWrite8(fifo, value >> (8 * i))) {
|
||||
int8_t dummy;
|
||||
CircleBufferRead8(fifo, &dummy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GBAAudioSampleFIFO(struct GBAAudio* audio, int fifoId, int32_t cycles) {
|
||||
struct GBAAudioFIFO* channel;
|
||||
if (fifoId == 0) {
|
||||
|
@ -526,6 +502,7 @@ void GBAAudioSampleFIFO(struct GBAAudio* audio, int fifoId, int32_t cycles) {
|
|||
if (GBADMARegisterGetTiming(dma->reg) == DMA_TIMING_CUSTOM) {
|
||||
dma->nextCount = 4;
|
||||
dma->nextEvent = 0;
|
||||
dma->reg = GBADMARegisterSetWidth(dma->reg, 1);
|
||||
GBAMemoryUpdateDMAs(audio->p, -cycles);
|
||||
} else {
|
||||
channel->dmaSource = 0;
|
||||
|
|
|
@ -272,7 +272,6 @@ void GBAAudioWriteSOUNDCNT_X(struct GBAAudio* audio, uint16_t value);
|
|||
void GBAAudioWriteSOUNDBIAS(struct GBAAudio* audio, uint16_t value);
|
||||
|
||||
void GBAAudioWriteWaveRAM(struct GBAAudio* audio, int address, uint32_t value);
|
||||
void GBAAudioWriteFIFO16(struct GBAAudio* audio, int address, uint16_t value);
|
||||
void GBAAudioWriteFIFO(struct GBAAudio* audio, int address, uint32_t value);
|
||||
void GBAAudioSampleFIFO(struct GBAAudio* audio, int fifoId, int32_t cycles);
|
||||
|
||||
|
|
13
src/gba/io.c
13
src/gba/io.c
|
@ -366,23 +366,14 @@ void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
|
|||
GBAIOWrite32(gba, address - 2, gba->memory.io[(address >> 1) - 1] | (value << 16));
|
||||
break;
|
||||
|
||||
// TODO: Confirm this behavior on real hardware
|
||||
case REG_FIFO_A_LO:
|
||||
case REG_FIFO_B_LO:
|
||||
if (gba->performingDMA) {
|
||||
GBAAudioWriteFIFO16(&gba->audio, address, value);
|
||||
} else {
|
||||
GBAIOWrite32(gba, address, (gba->memory.io[(address >> 1) + 1] << 16) | value);
|
||||
}
|
||||
GBAIOWrite32(gba, address, (gba->memory.io[(address >> 1) + 1] << 16) | value);
|
||||
break;
|
||||
|
||||
case REG_FIFO_A_HI:
|
||||
case REG_FIFO_B_HI:
|
||||
if (gba->performingDMA) {
|
||||
GBAAudioWriteFIFO16(&gba->audio, address, value);
|
||||
} else {
|
||||
GBAIOWrite32(gba, address - 2, gba->memory.io[(address >> 1) - 1] | (value << 16));
|
||||
}
|
||||
GBAIOWrite32(gba, address - 2, gba->memory.io[(address >> 1) - 1] | (value << 16));
|
||||
break;
|
||||
|
||||
// DMA
|
||||
|
|
Loading…
Reference in New Issue