mame: add reset

This commit is contained in:
feos 2023-10-25 20:30:32 +03:00
parent edcd2cd548
commit 7ac9bc26cd
2 changed files with 9 additions and 1 deletions

View File

@ -71,6 +71,8 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
}
}
MAMEController.BoolButtons.Add("Reset");
_buttonFields = buttonFieldList.ToArray();
_analogFields = analogFieldList.ToArray();
_fieldPtrs = fieldPtrList.ToArray();
@ -81,6 +83,11 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
private void SendInput(IController controller)
{
if (controller.IsPressed("Reset"))
{
_core.mame_lua_execute(MAMELuaCommand.Reset);
}
for (var i = 0; i < _buttonFields.Length; i++)
{
_fieldInputs[i] = controller.IsPressed(_buttonFields[i]) ? 1 : 0;

View File

@ -204,7 +204,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
, "-update_in_pause" // ^ including frame-advancing
, "-rompath", "" // mame doesn't load roms from full paths, only from dirs to scan
, "-joystick_contradictory" // allow L+R/U+D on digital joystick
, "-nvram_directory", "" // path to nvram from
, "-nvram_directory", "" // path to nvram
, "-artpath", "" // path to artwork
, "-diff_directory", "" // path to hdd diffs
, "-cfg_directory", "" // path to config
@ -326,6 +326,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
public const string Step = "emu.step()";
public const string Pause = "emu.pause()";
public const string Unpause = "emu.unpause()";
public const string Reset = "manager.machine:soft_reset()";
public const string Exit = "manager.machine:exit()";
// getters