gpgx: add "Reset" and "Power" buttons
This commit is contained in:
parent
e2a9932249
commit
253ba4ccda
|
@ -290,6 +290,11 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
// TODO: use render and rendersound
|
||||
public void FrameAdvance(bool render, bool rendersound = true)
|
||||
{
|
||||
if (Controller["Reset"])
|
||||
LibGPGX.gpgx_reset(false);
|
||||
if (Controller["Power"])
|
||||
LibGPGX.gpgx_reset(true);
|
||||
|
||||
// do we really have to get each time? nothing has changed
|
||||
if (!LibGPGX.gpgx_get_control(input))
|
||||
throw new Exception("gpgx_get_control() failed!");
|
||||
|
|
|
@ -109,6 +109,9 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
|
||||
ControllerDef = new ControllerDefinition();
|
||||
|
||||
ControllerDef.BoolButtons.Add("Power");
|
||||
ControllerDef.BoolButtons.Add("Reset");
|
||||
|
||||
for (int i = 0; i < LibGPGX.MAX_DEVICES; i++)
|
||||
{
|
||||
switch (input.dev[i])
|
||||
|
|
|
@ -60,6 +60,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
[DllImport("libgenplusgx.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void gpgx_sram_commitwrite();
|
||||
|
||||
[DllImport("libgenplusgx.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void gpgx_reset(bool hard);
|
||||
|
||||
public static bool gpgx_get_control(InputData dest)
|
||||
{
|
||||
|
|
|
@ -417,4 +417,10 @@ GPGX_EX int gpgx_init(const char *feromextension, int (*feload_archive_cb)(const
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
GPGX_EX void gpgx_reset(int hard)
|
||||
{
|
||||
if (hard)
|
||||
system_reset();
|
||||
else
|
||||
gen_reset(0);
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue