public NesDeck(INesPort Left, INesPort Right, LightgunDelegate PPUCallback) { this.Left = Left; this.Right = Right; Definition = ControllerDefinitionMerger.GetMerged(new[] { Left.GetDefinition(), Right.GetDefinition() }, out var cdum); LeftU = cdum[0]; RightU = cdum[1]; // apply hacks // if this list gets very long, then something should be changed // if it stays short, then no problem if (Left is FourScore) { (Left as FourScore).RightPort = false; } if (Right is FourScore) { (Right as FourScore).RightPort = true; } if (Left is IZapper) { (Left as IZapper).PPUCallback = PPUCallback; } if (Right is IZapper) { (Right as IZapper).PPUCallback = PPUCallback; } }
public NesDeck(INesPort left, INesPort right, LightgunDelegate ppuCallback) { _left = left; _right = right; ControllerDef = ControllerDefinitionMerger.GetMerged( "NES Controller", new[] { left.ControllerDefFragment, right.ControllerDefFragment }, out var cdum); _leftU = cdum[0]; _rightU = cdum[1]; // apply hacks // if this list gets very long, then something should be changed // if it stays short, then no problem if (left is FourScore leftScore) { leftScore.RightPort = false; } if (right is FourScore rightScore) { rightScore.RightPort = true; } if (left is IZapper leftZapper) { leftZapper.PPUCallback = ppuCallback; } if (right is IZapper rightZapper) { rightZapper.PPUCallback = ppuCallback; } }
public FamicomDeck(IFamicomExpansion ExpSlot, LightgunDelegate PPUCallback) { Player3 = ExpSlot; Definition = ControllerDefinitionMerger.GetMerged( new[] { Player1.GetDefinition(), Player2.GetDefinition(), Player3.GetDefinition() }, out var cdum); Definition.BoolButtons.Add("P2 Microphone"); Player1U = cdum[0]; Player2U = cdum[1]; Player3U = cdum[2]; // hack if (Player3 is Zapper) { (Player3 as Zapper).PPUCallback = PPUCallback; } }
public IControllerDeck Instantiate(LightgunDelegate PPUCallback) { if (Famicom) { IFamicomExpansion exp = (IFamicomExpansion)Activator.CreateInstance(FamicomExpansions[FamicomExpPort]); IControllerDeck ret = new FamicomDeck(exp, PPUCallback); return(ret); } else { INesPort left = (INesPort)Activator.CreateInstance(NesPortDevices[NesLeftPort]); INesPort right = (INesPort)Activator.CreateInstance(NesPortDevices[NesRightPort]); IControllerDeck ret = new NesDeck(left, right, PPUCallback); return(ret); } }
public FamicomDeck(IFamicomExpansion expSlot, LightgunDelegate ppuCallback) { _player3 = expSlot; _definition = ControllerDefinitionMerger.GetMerged( new[] { _player1.GetDefinition(), _player2.GetDefinition(), _player3.GetDefinition() }, out var cdum); _definition.BoolButtons.Add("P2 Microphone"); _player1U = cdum[0]; _player2U = cdum[1]; _player3U = cdum[2]; // hack if (_player3 is Zapper zapper) { zapper.PPUCallback = ppuCallback; } }