Lua - event.oninputpoll - support Atari 7800

This commit is contained in:
adelikat 2013-11-17 00:06:21 +00:00
parent 5fb8ceb377
commit ce7743808f
3 changed files with 14 additions and 6 deletions

View File

@ -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")

View File

@ -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);

Binary file not shown.