diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/7800/Atari7800.cs b/BizHawk.Emulation.Cores/Consoles/Atari/7800/Atari7800.cs index 3b8a4a1083..3a9f581657 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/7800/Atari7800.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/7800/Atari7800.cs @@ -180,7 +180,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari7800 public Atari7800(CoreComm comm, GameInfo game, byte[] rom, byte[] ntsc_bios, byte[] pal_bios, byte[] highscoreBIOS, string GameDBfn) { CoreComm = comm; - + if (EMU7800.Win.GameProgramLibrary.EMU7800DB == null) { EMU7800.Win.GameProgramLibrary.EMU7800DB = new EMU7800.Win.GameProgramLibrary(new StreamReader(GameDBfn)); @@ -202,10 +202,11 @@ namespace BizHawk.Emulation.Cores.Atari.Atari7800 this.game = game; this.hsbios = highscoreBIOS; this.bios = GameInfo.MachineType == MachineType.A7800PAL ? pal_bios : ntsc_bios; - if (bios == null) - { - throw new InvalidDataException("The BIOS corresponding to the region of the game you loaded is required to run Atari 7800 games."); - } + if (bios == null) + { + throw new InvalidDataException("The BIOS corresponding to the region of the game you loaded is required to run Atari 7800 games."); + } + HardReset(); } @@ -231,6 +232,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari7800 logger); theMachine.Reset(); + theMachine.InputState.InputPollCallback = CoreComm.InputCallback.Call; ControlAdapter = new Atari7800Control(theMachine); if (ControlAdapter.ControlType.Name != "Atari 7800 ProLine Joystick Controller") diff --git a/EMU7800/Core/InputState.cs b/EMU7800/Core/InputState.cs index 3cffd7184b..f805b98b7b 100644 --- a/EMU7800/Core/InputState.cs +++ b/EMU7800/Core/InputState.cs @@ -97,9 +97,15 @@ namespace EMU7800.Core get { return _lagged; } } + public Action InputPollCallback { get; set; } + public void RaiseInput(int playerNo, MachineInput input, bool down) { - switch (input) + if (InputPollCallback != null) + { + InputPollCallback(); + } + switch (input) { case MachineInput.Fire: SetControllerActionState(playerNo, ControllerAction.Trigger, down); diff --git a/output/dll/EMU7800.dll b/output/dll/EMU7800.dll index 4cff727ab7..55128b7f0a 100644 Binary files a/output/dll/EMU7800.dll and b/output/dll/EMU7800.dll differ