NESHawk: Audio Slider

This commit is contained in:
alyosha-tas 2017-09-07 10:27:36 -04:00 committed by GitHub
parent e66e70534a
commit 7c1522cffe
3 changed files with 6 additions and 26 deletions

View File

@ -22,11 +22,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
{ {
public static bool CFG_DECLICK = true; public static bool CFG_DECLICK = true;
public int Square1V = 376; public int m_vol = 1;
public int Square2V = 376;
public int TriangleV = 426;
public int NoiseV = 247;
public int DMCV = 167;
public int dmc_dma_countdown = -1; public int dmc_dma_countdown = -1;
public bool call_from_write; public bool call_from_write;
@ -53,11 +49,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
pulse[1] = new PulseUnit(this, 1); pulse[1] = new PulseUnit(this, 1);
if (old != null) if (old != null)
{ {
Square1V = old.Square1V; m_vol = old.m_vol;
Square2V = old.Square2V;
TriangleV = old.TriangleV;
NoiseV = old.NoiseV;
DMCV = old.DMCV;
} }
} }
@ -1419,7 +1411,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
float output = pulse_out + tnd_out; float output = pulse_out + tnd_out;
// output = output * 2 - 1; // 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. // 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)); dlist.Add(new Delta(sampleclock, mix - oldmix));
oldmix = mix; oldmix = mix;

View File

@ -62,11 +62,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
private DisplayType _display_type = DisplayType.NTSC; private DisplayType _display_type = DisplayType.NTSC;
//Sound config //Sound config
public void SetSquare1(int v) { apu.Square1V = v; } public void SetVol1(int v) { apu.m_vol = 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; }
/// <summary> /// <summary>
/// for debugging only! /// for debugging only!

View File

@ -39,11 +39,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
SetPalette(Settings.Palette); SetPalette(Settings.Palette);
apu.Square1V = Settings.Square1; apu.m_vol = Settings.APU_vol;
apu.Square2V = Settings.Square2;
apu.TriangleV = Settings.Triangle;
apu.NoiseV = Settings.Noise;
apu.DMCV = Settings.DMC;
return false; return false;
} }
@ -157,11 +153,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
public byte[,] Palette; public byte[,] Palette;
public int Square1 = 376; public int APU_vol = 1;
public int Square2 = 376;
public int Triangle = 426;
public int Noise = 247;
public int DMC = 167;
public NESSettings Clone() public NESSettings Clone()
{ {