mirror of https://github.com/mgba-emu/mgba.git
GB Audio: Fix NR41 while disabled
This commit is contained in:
parent
13e5ded34e
commit
47324f8701
|
@ -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;
|
||||
|
|
|
@ -184,11 +184,8 @@ void GBIOWrite(struct GB* gb, unsigned address, uint8_t value) {
|
|||
}
|
||||
break;
|
||||
case REG_NR41:
|
||||
if (gb->audio.enable) {
|
||||
// NR41 is exempt, for some reason
|
||||
GBAudioWriteNR41(&gb->audio, value);
|
||||
} else {
|
||||
value = 0;
|
||||
}
|
||||
break;
|
||||
case REG_NR42:
|
||||
if (gb->audio.enable) {
|
||||
|
|
Loading…
Reference in New Issue