Issue #735: Add sound channel toggling on mgba

This commit is contained in:
nattthebear 2016-11-27 17:33:05 -05:00
parent 995c5f907c
commit f67cb3c64f
4 changed files with 37 additions and 0 deletions

View File

@ -115,5 +115,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
[DllImport(dll, CallingConvention = cc)]
public static extern void BizSetLayerMask(IntPtr ctx, Layers mask);
[Flags]
public enum Sounds : int
{
CH0 = 1,
CH1 = 2,
CH2 = 4,
CH3 = 8,
CHA = 16,
CHB = 32
}
[DllImport(dll, CallingConvention = cc)]
public static extern void BizSetSoundMask(IntPtr ctx, Sounds mask);
}
}

View File

@ -476,6 +476,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
if (o.DisplayBG3) mask |= LibmGBA.Layers.BG3;
if (o.DisplayOBJ) mask |= LibmGBA.Layers.OBJ;
LibmGBA.BizSetLayerMask(_core, mask);
LibmGBA.Sounds smask = 0;
if (o.PlayCh0) smask |= LibmGBA.Sounds.CH0;
if (o.PlayCh1) smask |= LibmGBA.Sounds.CH1;
if (o.PlayCh2) smask |= LibmGBA.Sounds.CH2;
if (o.PlayCh3) smask |= LibmGBA.Sounds.CH3;
if (o.PlayChA) smask |= LibmGBA.Sounds.CHA;
if (o.PlayChB) smask |= LibmGBA.Sounds.CHB;
LibmGBA.BizSetSoundMask(_core, smask);
_settings = o;
return false;
}
@ -495,6 +505,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
[DefaultValue(true)]
public bool DisplayOBJ { get; set; }
[DefaultValue(true)]
public bool PlayCh0 { get; set; }
[DefaultValue(true)]
public bool PlayCh1 { get; set; }
[DefaultValue(true)]
public bool PlayCh2 { get; set; }
[DefaultValue(true)]
public bool PlayCh3 { get; set; }
[DefaultValue(true)]
public bool PlayChA { get; set; }
[DefaultValue(true)]
public bool PlayChB { get; set; }
public Settings Clone()
{
return (Settings)MemberwiseClone();

Binary file not shown.

Binary file not shown.