nes: fix missing sound after hard reset
This commit is contained in:
parent
e06a9218b8
commit
089379711a
|
@ -34,10 +34,18 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
public bool EnableDMC = true;
|
public bool EnableDMC = true;
|
||||||
|
|
||||||
NES nes;
|
NES nes;
|
||||||
public APU(NES nes)
|
public APU(NES nes, APU old = null)
|
||||||
{
|
{
|
||||||
this.nes = nes;
|
this.nes = nes;
|
||||||
dmc = new DMCUnit(this);
|
dmc = new DMCUnit(this);
|
||||||
|
if (old != null)
|
||||||
|
{
|
||||||
|
EnableSquare1 = old.EnableSquare1;
|
||||||
|
EnableSquare2 = old.EnableSquare2;
|
||||||
|
EnableTriangle = old.EnableTriangle;
|
||||||
|
EnableNoise = old.EnableNoise;
|
||||||
|
EnableDMC = old.EnableDMC;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int[] DMC_RATE_NTSC = { 428, 380, 340, 320, 286, 254, 226, 214, 190, 160, 142, 128, 106, 84, 72, 54 };
|
static int[] DMC_RATE_NTSC = { 428, 380, 340, 320, 286, 254, 226, 214, 190, 160, 142, 128, 106, 84, 72, 54 };
|
||||||
|
|
|
@ -130,7 +130,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
ports[0] = new JoypadPortDevice(this, 0);
|
ports[0] = new JoypadPortDevice(this, 0);
|
||||||
ports[1] = new JoypadPortDevice(this, 1);
|
ports[1] = new JoypadPortDevice(this, 1);
|
||||||
|
|
||||||
apu = new APU(this);
|
apu = new APU(this, apu);
|
||||||
// don't replace the magicSoundProvider on reset, as it's not needed
|
// don't replace the magicSoundProvider on reset, as it's not needed
|
||||||
// if (magicSoundProvider != null) magicSoundProvider.Dispose();
|
// if (magicSoundProvider != null) magicSoundProvider.Dispose();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue