diff --git a/BizHawk.Emulation/Consoles/Nintendo/GBA/LibMeteor.cs b/BizHawk.Emulation/Consoles/Nintendo/GBA/LibMeteor.cs index b0a4d749df..957396ae12 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/GBA/LibMeteor.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/GBA/LibMeteor.cs @@ -12,10 +12,10 @@ namespace BizHawk.Emulation.Consoles.Nintendo.GBA public static class LibMeteor { /// - /// reset the emulation core + /// power cycle the emulation core /// [DllImport("libmeteor.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern void libmeteor_reset(); + public static extern void libmeteor_hardreset(); /// /// signal that you are removing data from the sound buffer. @@ -85,16 +85,16 @@ namespace BizHawk.Emulation.Consoles.Nintendo.GBA [Flags] public enum Buttons : ushort { - BTN_A = 0x001, - BTN_B = 0x002, - BTN_SELECT = 0x004, - BTN_START = 0x008, - BTN_RIGHT = 0x010, - BTN_LEFT = 0x020, - BTN_UP = 0x040, - BTN_DOWN = 0x080, - BTN_R = 0x100, - BTN_L = 0x200 + BTN_A = 0x001, + BTN_B = 0x002, + BTN_SELECT = 0x004, + BTN_START = 0x008, + BTN_RIGHT = 0x010, + BTN_LEFT = 0x020, + BTN_UP = 0x040, + BTN_DOWN = 0x080, + BTN_R = 0x100, + BTN_L = 0x200 } /// diff --git a/BizHawk.Emulation/Consoles/Nintendo/GBA/Meteor.cs b/BizHawk.Emulation/Consoles/Nintendo/GBA/Meteor.cs index 92b085620b..c042116a5d 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/GBA/Meteor.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/GBA/Meteor.cs @@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo.GBA Name = "GBA Controller", BoolButtons = { - "Up", "Down", "Left", "Right", "Select", "Start", "B", "A", "L", "R"//, "Reset", "Power", + "Up", "Down", "Left", "Right", "Select", "Start", "B", "A", "L", "R", "Power" } }; public ControllerDefinition ControllerDefinition { get { return GBAController; } } @@ -26,7 +26,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo.GBA if (bios.Length != 16384) throw new Exception("GBA bios must be exactly 16384 bytes!"); Init(); - LibMeteor.libmeteor_reset(); + LibMeteor.libmeteor_hardreset(); LibMeteor.libmeteor_loadbios(bios, (uint)bios.Length); LibMeteor.libmeteor_loadrom(rom, (uint)rom.Length); @@ -37,6 +37,9 @@ namespace BizHawk.Emulation.Consoles.Nintendo.GBA { Controller.UpdateControls(Frame++); IsLagFrame = true; + + if (Controller["Power"]) + LibMeteor.libmeteor_hardreset(); if (!coredead) LibMeteor.libmeteor_frameadvance(); if (IsLagFrame) diff --git a/BizHawk.MultiClient/output/dll/libmeteor.dll b/BizHawk.MultiClient/output/dll/libmeteor.dll index 6e99f0c5af..26024bf318 100644 Binary files a/BizHawk.MultiClient/output/dll/libmeteor.dll and b/BizHawk.MultiClient/output/dll/libmeteor.dll differ diff --git a/libmeteor/cinterface.cpp b/libmeteor/cinterface.cpp index 63fa55f354..1df9438806 100644 --- a/libmeteor/cinterface.cpp +++ b/libmeteor/cinterface.cpp @@ -42,9 +42,9 @@ EXPORT void libmeteor_setkeycallback(uint16_t (*callback)()) keycallback = callback; } -EXPORT void libmeteor_reset() +EXPORT void libmeteor_hardreset() { - AMeteor::Reset(AMeteor::UNIT_ALL ^ AMeteor::UNIT_MEMORY_BIOS); + AMeteor::Reset(AMeteor::UNIT_ALL ^ (AMeteor::UNIT_MEMORY_BIOS | AMeteor::UNIT_MEMORY_ROM)); } uint32_t *videobuff;