Add a SoundOn flag to the nes core and hook to the sound on/off in sound config. the flag bypasses the apu.run function. the apu read/writes are still going, and seems to be TAS safe to do this
This commit is contained in:
parent
1f3a315926
commit
942a9e086a
|
@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
string game_name; //friendly name exposed to user and used as filename base
|
string game_name; //friendly name exposed to user and used as filename base
|
||||||
CartInfo cart; //the current cart prototype. should be moved into the board, perhaps
|
CartInfo cart; //the current cart prototype. should be moved into the board, perhaps
|
||||||
INESBoard board; //the board hardware that is currently driving things
|
INESBoard board; //the board hardware that is currently driving things
|
||||||
|
public bool SoundOn = true;
|
||||||
bool _irq_apu, _irq_cart;
|
bool _irq_apu, _irq_cart;
|
||||||
public bool irq_apu { get { return _irq_apu; } set { _irq_apu = value; sync_irq(); } }
|
public bool irq_apu { get { return _irq_apu; } set { _irq_apu = value; sync_irq(); } }
|
||||||
public bool irq_cart { get { return _irq_cart; } set { _irq_cart = value; sync_irq(); } }
|
public bool irq_cart { get { return _irq_cart; } set { _irq_cart = value; sync_irq(); } }
|
||||||
|
@ -113,7 +113,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
cpu_cycles -= todo;
|
cpu_cycles -= todo;
|
||||||
cpu_accumulate -= 48*todo;
|
cpu_accumulate -= 48*todo;
|
||||||
cpu.Execute(todo);
|
cpu.Execute(todo);
|
||||||
apu.Run(todo);
|
if (SoundOn)
|
||||||
|
apu.Run(todo);
|
||||||
ppu.PostCpuInstruction(todo);
|
ppu.PostCpuInstruction(todo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@ using BizHawk.Emulation.Sound;
|
||||||
using SlimDX.DirectSound;
|
using SlimDX.DirectSound;
|
||||||
using SlimDX.Multimedia;
|
using SlimDX.Multimedia;
|
||||||
|
|
||||||
|
using BizHawk.Emulation.Consoles.Nintendo;
|
||||||
|
|
||||||
namespace BizHawk.MultiClient
|
namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
public class Sound : IDisposable
|
public class Sound : IDisposable
|
||||||
|
@ -174,6 +176,15 @@ namespace BizHawk.MultiClient
|
||||||
DSoundBuffer.Volume = -5000;
|
DSoundBuffer.Volume = -5000;
|
||||||
else
|
else
|
||||||
DSoundBuffer.Volume = 0 - ((100 - Global.Config.SoundVolume) * 15);
|
DSoundBuffer.Volume = 0 - ((100 - Global.Config.SoundVolume) * 15);
|
||||||
|
|
||||||
|
if (Global.Emulator is NES)
|
||||||
|
{
|
||||||
|
NES n = Global.Emulator as NES;
|
||||||
|
if (Global.Config.SoundEnabled == false)
|
||||||
|
n.SoundOn = false;
|
||||||
|
else
|
||||||
|
n.SoundOn = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue