all repos — mgba @ 47324f87016d611a74b701dad756fb45ebd197aa

mGBA Game Boy Advance Emulator

GB Audio: Fix NR41 while disabled
Jeffrey Pfau jeffrey@endrift.com
Sat, 13 Feb 2016 00:56:22 -0800
commit

47324f87016d611a74b701dad756fb45ebd197aa

parent

13e5ded34e8a8d38a55602afb708aec261f20af0

2 files changed, 3 insertions(+), 7 deletions(-)

jump to
M src/gb/audio.csrc/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.csrc/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) {