From 2c2efc6fb819e929f3b4aca1128eda2061ee4028 Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Sun, 6 Oct 2024 14:21:40 -0700 Subject: [PATCH] Fix gpgx_swap_disc sig mismatch --- .../Consoles/Sega/gpgx64/GPGX.IEmulator.cs | 5 +---- src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs | 2 +- src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/LibGPGX.cs | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IEmulator.cs index 31245af3fd..d63373ba89 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IEmulator.cs @@ -22,8 +22,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx if (_cds != null) { - Console.WriteLine("======= GPGX.FrameAdvance"); - Console.WriteLine($"was: |{_discIndex}|{(_prevDiskPressed ? 'P' : '.')}{(_nextDiskPressed ? 'N' : '.')}|"); var prev = controller.IsPressed("Previous Disk"); var next = controller.IsPressed("Next Disk"); var newDisk = _discIndex; @@ -53,9 +51,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx if (newDisk != _discIndex) { _discIndex = newDisk; - Core.gpgx_swap_disc(_discIndex == -1 ? null : GetCDDataStruct(_cds[_discIndex])); + Core.gpgx_swap_disc(_discIndex == -1 ? null : GetCDDataStruct(_cds[_discIndex]), (sbyte)_discIndex); } - Console.WriteLine($"now: |{_discIndex}|{(_prevDiskPressed ? 'P' : '.')}{(_nextDiskPressed ? 'N' : '.')}|"); } // this shouldn't be needed, as nothing has changed diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs index 81d50c042d..9355947b80 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs @@ -89,7 +89,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx if (lp.Discs.Count > 0) { - if (lp.Discs.Count > 128) + if (lp.Discs.Count > sbyte.MaxValue) { throw new ArgumentException(paramName: nameof(lp), message: "Too many discs loaded at once!"); } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/LibGPGX.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/LibGPGX.cs index f315ec62de..59c21040c3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/LibGPGX.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/LibGPGX.cs @@ -351,7 +351,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx public abstract void gpgx_set_cdd_callback(cd_read_cb cddcb); [BizImport(CallingConvention.Cdecl, Compatibility = true)] - public abstract void gpgx_swap_disc([In] CDData toc); + public abstract void gpgx_swap_disc([In] CDData toc, sbyte discIndex); [StructLayout(LayoutKind.Sequential)] public struct VDPNameTable