GB Audio: Fix NR41 while disabled

This commit is contained in:
Jeffrey Pfau 2016-02-13 00:56:22 -08:00
parent 13e5ded34e
commit 47324f8701
2 changed files with 3 additions and 7 deletions

View File

@ -376,7 +376,7 @@ void GBAudioWriteNR52(struct GBAudio* audio, uint8_t value) {
GBAudioWriteNR32(audio, 0);
GBAudioWriteNR33(audio, 0);
GBAudioWriteNR34(audio, 0);
GBAudioWriteNR41(audio, 0);
// Don't write to NR41
GBAudioWriteNR42(audio, 0);
GBAudioWriteNR43(audio, 0);
GBAudioWriteNR44(audio, 0);
@ -397,7 +397,6 @@ void GBAudioWriteNR52(struct GBAudio* audio, uint8_t value) {
audio->p->memory.io[REG_NR32] = 0;
audio->p->memory.io[REG_NR33] = 0;
audio->p->memory.io[REG_NR34] = 0;
audio->p->memory.io[REG_NR41] = 0;
audio->p->memory.io[REG_NR42] = 0;
audio->p->memory.io[REG_NR43] = 0;
audio->p->memory.io[REG_NR44] = 0;

View File

@ -184,11 +184,8 @@ void GBIOWrite(struct GB* gb, unsigned address, uint8_t value) {
}
break;
case REG_NR41:
if (gb->audio.enable) {
GBAudioWriteNR41(&gb->audio, value);
} else {
value = 0;
}
// NR41 is exempt, for some reason
GBAudioWriteNR41(&gb->audio, value);
break;
case REG_NR42:
if (gb->audio.enable) {