GB Audio: Fix NR41 while disabled
Jeffrey Pfau jeffrey@endrift.com
Sat, 13 Feb 2016 00:56:22 -0800
2 files changed,
3 insertions(+),
7 deletions(-)
M
src/gb/audio.c
→
src/gb/audio.c
@@ -376,7 +376,7 @@ GBAudioWriteNR31(audio, 0);
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 @@ audio->p->memory.io[REG_NR31] = 0;
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;
M
src/gb/io.c
→
src/gb/io.c
@@ -184,11 +184,8 @@ value = 0;
} 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) {