GBA Audio: Implement missing flags on SOUNDCNT_X register

This commit is contained in:
Jeffrey Pfau 2015-10-26 20:31:22 -07:00
parent b8b7ec0b12
commit a93b21e886
3 changed files with 9 additions and 0 deletions

View File

@ -20,6 +20,7 @@ Misc:
- SDL: Allow GBASDLAudio to be used without a thread context
- All: Improved PowerPC support
- All: Fix some undefined behavior warnings
- GBA Audio: Implement missing flags on SOUNDCNT_X register
0.3.1: (2015-10-24)
Bugfixes:

View File

@ -283,6 +283,12 @@ int32_t GBAAudioProcessEvents(struct GBAAudio* audio, int32_t cycles) {
}
}
}
audio->p->memory.io[REG_SOUNDCNT_X >> 1] &= ~0x000F;
audio->p->memory.io[REG_SOUNDCNT_X >> 1] |= audio->playingCh1;
audio->p->memory.io[REG_SOUNDCNT_X >> 1] |= audio->playingCh2 << 1;
audio->p->memory.io[REG_SOUNDCNT_X >> 1] |= audio->playingCh3 << 2;
audio->p->memory.io[REG_SOUNDCNT_X >> 1] |= audio->playingCh4 << 2;
}
audio->nextSample -= audio->eventDiff;

View File

@ -351,6 +351,8 @@ void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
break;
case REG_SOUNDCNT_X:
GBAAudioWriteSOUNDCNT_X(&gba->audio, value);
value &= 0xFFFF;
value |= gba->memory.io[REG_SOUNDCNT_X >> 1] & 0xF;
break;
case REG_SOUNDBIAS:
GBAAudioWriteSOUNDBIAS(&gba->audio, value);