diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/APU.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/APU.cs index f45b8719a1..2b755f983c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/APU.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/APU.cs @@ -22,11 +22,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { public static bool CFG_DECLICK = true; - public int Square1V = 376; - public int Square2V = 376; - public int TriangleV = 426; - public int NoiseV = 247; - public int DMCV = 167; + public int m_vol = 1; public int dmc_dma_countdown = -1; public bool call_from_write; @@ -53,11 +49,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES pulse[1] = new PulseUnit(this, 1); if (old != null) { - Square1V = old.Square1V; - Square2V = old.Square2V; - TriangleV = old.TriangleV; - NoiseV = old.NoiseV; - DMCV = old.DMCV; + m_vol = old.m_vol; } } @@ -1419,7 +1411,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES float output = pulse_out + tnd_out; // output = output * 2 - 1; // this needs to leave enough headroom for straying DC bias due to the DMC unit getting stuck outputs. smb3 is bad about that. - int mix = (int)(20000 * output); + int mix = (int)(20000 * output * (1 + m_vol/5)); dlist.Add(new Delta(sampleclock, mix - oldmix)); oldmix = mix; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs index bea02f1504..67617348eb 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs @@ -62,11 +62,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES private DisplayType _display_type = DisplayType.NTSC; //Sound config - public void SetSquare1(int v) { apu.Square1V = v; } - public void SetSquare2(int v) { apu.Square2V = v; } - public void SetTriangle(int v) { apu.TriangleV = v; } - public void SetNoise(int v) { apu.NoiseV = v; } - public void SetDMC(int v) { apu.DMCV = v; } + public void SetVol1(int v) { apu.m_vol = v; } /// /// for debugging only! diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.ISettable.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.ISettable.cs index 784b3b6fa5..40a8878a69 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.ISettable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.ISettable.cs @@ -39,11 +39,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES SetPalette(Settings.Palette); - apu.Square1V = Settings.Square1; - apu.Square2V = Settings.Square2; - apu.TriangleV = Settings.Triangle; - apu.NoiseV = Settings.Noise; - apu.DMCV = Settings.DMC; + apu.m_vol = Settings.APU_vol; return false; } @@ -157,11 +153,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public byte[,] Palette; - public int Square1 = 376; - public int Square2 = 376; - public int Triangle = 426; - public int Noise = 247; - public int DMC = 167; + public int APU_vol = 1; public NESSettings Clone() {