GBA Audio: Force audio FIFOs to 32-bit

This commit is contained in:
Jeffrey Pfau 2015-04-06 02:34:21 -07:00
parent cda804656b
commit 1856b77cbc
4 changed files with 4 additions and 36 deletions

View File

@ -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:

View File

@ -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;

View File

@ -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);

View File

@ -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