diff --git a/BizHawk.Client.Common/RomLoader.cs b/BizHawk.Client.Common/RomLoader.cs index e555dd6e04..f46d7c3c5b 100644 --- a/BizHawk.Client.Common/RomLoader.cs +++ b/BizHawk.Client.Common/RomLoader.cs @@ -220,7 +220,7 @@ namespace BizHawk.Client.Common { case "GEN": var genesis = new GPGX( - nextComm, null, disc, "GEN", GetCoreSettings()); + nextComm, null, disc, "GEN", GetCoreSyncSettings()); nextEmulator = genesis; break; case "SAT": diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs index 9bc4f63fb0..561deef8d2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs @@ -47,7 +47,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx Xea1p, Activator, Teamplayer, - Wayplay + Wayplay, + Mouse }; public GPGX(CoreComm NextComm, byte[] romfile, DiscSystem.Disc CD, string romextension, object SyncSettings) @@ -64,7 +65,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx try { - this.SyncSettings = (GPGXSyncSettings)SyncSettings ?? GPGXSyncSettings.GetDefaults(); + this._SyncSettings = (GPGXSyncSettings)SyncSettings ?? GPGXSyncSettings.GetDefaults(); CoreComm = NextComm; if (AttachedCore != null) @@ -82,7 +83,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx LibGPGX.INPUT_SYSTEM system_a = LibGPGX.INPUT_SYSTEM.SYSTEM_NONE; LibGPGX.INPUT_SYSTEM system_b = LibGPGX.INPUT_SYSTEM.SYSTEM_NONE; - switch (this.SyncSettings.ControlType) + switch (this._SyncSettings.ControlType) { case ControlType.None: default: @@ -109,10 +110,14 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx system_a = LibGPGX.INPUT_SYSTEM.SYSTEM_WAYPLAY; system_b = LibGPGX.INPUT_SYSTEM.SYSTEM_WAYPLAY; break; + case ControlType.Mouse: + system_a = LibGPGX.INPUT_SYSTEM.SYSTEM_MD_GAMEPAD; + system_b = LibGPGX.INPUT_SYSTEM.SYSTEM_MOUSE; + break; } - if (!LibGPGX.gpgx_init(romextension, LoadCallback, this.SyncSettings.UseSixButton, system_a, system_b, this.SyncSettings.Region)) + if (!LibGPGX.gpgx_init(romextension, LoadCallback, this._SyncSettings.UseSixButton, system_a, system_b, this._SyncSettings.Region)) throw new Exception("gpgx_init() failed"); { @@ -728,17 +733,17 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx #region Settings - GPGXSyncSettings SyncSettings; + GPGXSyncSettings _SyncSettings; public object GetSettings() { return null; } - public object GetSyncSettings() { return SyncSettings.Clone(); } + public object GetSyncSettings() { return _SyncSettings.Clone(); } public bool PutSettings(object o) { return false; } public bool PutSyncSettings(object o) { bool ret; var n = (GPGXSyncSettings)o; - ret = GPGXSyncSettings.NeedsReboot(SyncSettings, n); - SyncSettings = n; + ret = GPGXSyncSettings.NeedsReboot(_SyncSettings, n); + _SyncSettings = n; return ret; } diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGXControlConverter.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGXControlConverter.cs index b51efc5716..0db5822e46 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGXControlConverter.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGXControlConverter.cs @@ -53,12 +53,13 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx static CName[] Mouse = { - new CName("Left", LibGPGX.INPUT_KEYS.INPUT_MOUSE_LEFT), - new CName("Center", LibGPGX.INPUT_KEYS.INPUT_MOUSE_CENTER), - new CName("Right", LibGPGX.INPUT_KEYS.INPUT_MOUSE_RIGHT), + new CName("Left Button", LibGPGX.INPUT_KEYS.INPUT_MOUSE_LEFT), + new CName("Center Button", LibGPGX.INPUT_KEYS.INPUT_MOUSE_CENTER), + new CName("Right Button", LibGPGX.INPUT_KEYS.INPUT_MOUSE_RIGHT), + new CName("Start Button", LibGPGX.INPUT_KEYS.INPUT_MOUSE_START), }; - static ControllerDefinition.FloatRange FullShort = new ControllerDefinition.FloatRange(-32767, 0, 32767); + static ControllerDefinition.FloatRange MouseRange = new ControllerDefinition.FloatRange(-512, 0, 511); LibGPGX.InputData target = null; IController source = null; @@ -88,8 +89,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx string NY = string.Format("P{0} Y", player); ControllerDef.FloatControls.Add(NX); ControllerDef.FloatControls.Add(NY); - ControllerDef.FloatRanges.Add(FullShort); - ControllerDef.FloatRanges.Add(FullShort); + ControllerDef.FloatRanges.Add(MouseRange); + ControllerDef.FloatRanges.Add(MouseRange); Converts.Add(delegate() { target.analog[(2 * idx) + 0] = (short)source.GetFloat(NX); diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/LibGPGX.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/LibGPGX.cs index de77cf4b8d..45f735bb92 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/LibGPGX.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/LibGPGX.cs @@ -146,6 +146,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx INPUT_BUTTON1 = 0x0010, /* Mega Mouse specific bitmask */ + INPUT_MOUSE_START = 0x0080, INPUT_MOUSE_CENTER = 0x0040, INPUT_MOUSE_RIGHT = 0x0020, INPUT_MOUSE_LEFT = 0x0010,