diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NESControllers.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NESControllers.cs index 81a01869f2..765eadc234 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NESControllers.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NESControllers.cs @@ -18,6 +18,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES #region interfaces and such + /// + /// callback type for PPU to tell if there's light for a lightgun to detect + /// + /// x coordinate on screen + /// y coordinate on screen + /// true if there is light + public delegate bool LightgunDelegate(int x, int y); + /// /// stores information about the strobe lines controlled by $4016 /// @@ -137,7 +145,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ControlDefUnMerger RightU; ControllerDefinition Definition; - public NesDeck(INesPort Left, INesPort Right, Func PPUCallback) + public NesDeck(INesPort Left, INesPort Right, LightgunDelegate PPUCallback) { this.Left = Left; this.Right = Right; @@ -547,7 +555,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // Dummy interface to indicate zapper behavior, used as a means of type checking for zapper functionality public interface IZapper { - Func PPUCallback { get; set; } + LightgunDelegate PPUCallback { get; set; } } public class Zapper : INesPort, IFamicomExpansion, IZapper @@ -555,7 +563,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES /// /// returns true if light was detected at the ppu coordinates specified /// - public Func PPUCallback { get; set; } + public LightgunDelegate PPUCallback { get; set; } static ControllerDefinition Definition = new ControllerDefinition { @@ -605,7 +613,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES /// /// returns true if light was detected at the ppu coordinates specified /// PPUCallback { get; set; } + public LightgunDelegate PPUCallback { get; set; } bool resetting = false; uint latchedvalue = 0; @@ -684,7 +692,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES ControllerDefinition Definition; - public FamicomDeck(IFamicomExpansion ExpSlot, Func PPUCallback) + public FamicomDeck(IFamicomExpansion ExpSlot, LightgunDelegate PPUCallback) { Player3 = ExpSlot; List cdum; @@ -1224,7 +1232,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES return (NESControlSettings)MemberwiseClone(); } - public IControllerDeck Instantiate(Func PPUCallback) + public IControllerDeck Instantiate(LightgunDelegate PPUCallback) { if (Famicom) {