diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs index 4f958d08f5..0e44c462c9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs @@ -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!"); diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGXControlConverter.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGXControlConverter.cs index dfdf408bde..90bc98ddb2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGXControlConverter.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGXControlConverter.cs @@ -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]) diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/LibGPGX.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/LibGPGX.cs index 994e9e9070..cb498b52c9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/LibGPGX.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/LibGPGX.cs @@ -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) { diff --git a/genplus-gx/cinterface/cinterface.c b/genplus-gx/cinterface/cinterface.c index d1764998be..dc7eb30943 100644 --- a/genplus-gx/cinterface/cinterface.c +++ b/genplus-gx/cinterface/cinterface.c @@ -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); +} diff --git a/output/dll/libgenplusgx.dll b/output/dll/libgenplusgx.dll index dc2f4fe098..c3791d9d43 100644 Binary files a/output/dll/libgenplusgx.dll and b/output/dll/libgenplusgx.dll differ