diff --git a/Assets/dll/gpgx.wbx.zst b/Assets/dll/gpgx.wbx.zst index 81bff2bcf7..b454cab96f 100644 Binary files a/Assets/dll/gpgx.wbx.zst and b/Assets/dll/gpgx.wbx.zst differ diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IDebuggable.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IDebuggable.cs index b5cc096e8a..06215aabbf 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IDebuggable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IDebuggable.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Runtime.InteropServices; using BizHawk.Common; @@ -72,28 +72,28 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx private void InitMemCallbacks() { - ExecCallback = a => + ExecCallback = (addr, val) => { if (MemoryCallbacks.HasExecutes) { const uint flags = (uint)MemoryCallbackFlags.AccessExecute; - MemoryCallbacks.CallMemoryCallbacks(a, 0, flags, "M68K BUS"); + MemoryCallbacks.CallMemoryCallbacks(addr, val, flags, "M68K BUS"); } }; - ReadCallback = a => + ReadCallback = (addr, val) => { if (MemoryCallbacks.HasReads) { const uint flags = (uint)MemoryCallbackFlags.AccessRead; - MemoryCallbacks.CallMemoryCallbacks(a, 0, flags, "M68K BUS"); + MemoryCallbacks.CallMemoryCallbacks(addr, val, flags, "M68K BUS"); } }; - WriteCallback = a => + WriteCallback = (addr, val) => { if (MemoryCallbacks.HasWrites) { const uint flags = (uint)MemoryCallbackFlags.AccessWrite; - MemoryCallbacks.CallMemoryCallbacks(a, 0, flags, "M68K BUS"); + MemoryCallbacks.CallMemoryCallbacks(addr, val, flags, "M68K BUS"); } }; _memoryCallbacks.ActiveChanged += RefreshMemCallbacks; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/LibGPGX.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/LibGPGX.cs index 473a542535..50b6873177 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/LibGPGX.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/LibGPGX.cs @@ -194,7 +194,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx public abstract void gpgx_set_input_callback(input_cb cb); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void mem_cb(uint addr); + public delegate void mem_cb(uint addr, uint value); //value MUST be uint, since the value will be trimmed if the type is byte (8-bit) or ushort (16-bit) and the value read/written/executed is bigger than that (i.e 32 bits). [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void CDCallback(int addr, CDLog_AddrType addrtype, CDLog_Flags flags); diff --git a/waterbox/gpgx/cinterface/callbacks.h b/waterbox/gpgx/cinterface/callbacks.h index 4ee2e5ee78..3d3ec5f5f5 100644 --- a/waterbox/gpgx/cinterface/callbacks.h +++ b/waterbox/gpgx/cinterface/callbacks.h @@ -7,9 +7,9 @@ typedef ECL_ENTRY void (*CDCallback)(int32 addr, int32 addrtype, int32 flags); -extern ECL_ENTRY void (*biz_execcb)(unsigned addr); -extern ECL_ENTRY void (*biz_readcb)(unsigned addr); -extern ECL_ENTRY void (*biz_writecb)(unsigned addr); +extern ECL_ENTRY void (*biz_execcb)(unsigned addr, unsigned value); +extern ECL_ENTRY void (*biz_readcb)(unsigned addr, unsigned value); +extern ECL_ENTRY void (*biz_writecb)(unsigned addr, unsigned value); extern CDCallback biz_cdcb; extern ECL_ENTRY void (*cdd_readcallback)(int lba, void *dest, int subcode); diff --git a/waterbox/gpgx/cinterface/cinterface.c b/waterbox/gpgx/cinterface/cinterface.c index 2fae99f0a6..fef76bb88e 100644 --- a/waterbox/gpgx/cinterface/cinterface.c +++ b/waterbox/gpgx/cinterface/cinterface.c @@ -61,9 +61,9 @@ static uint8_t brm_format[0x40] = 0x52,0x41,0x4d,0x5f,0x43,0x41,0x52,0x54,0x52,0x49,0x44,0x47,0x45,0x5f,0x5f,0x5f }; -ECL_ENTRY void (*biz_execcb)(unsigned addr); -ECL_ENTRY void (*biz_readcb)(unsigned addr); -ECL_ENTRY void (*biz_writecb)(unsigned addr); +ECL_ENTRY void (*biz_execcb)(unsigned addr, unsigned int value); +ECL_ENTRY void (*biz_readcb)(unsigned addr, unsigned int value); +ECL_ENTRY void (*biz_writecb)(unsigned addr, unsigned int value); CDCallback biz_cdcb = NULL; ECL_ENTRY void (*cdd_readcallback)(int lba, void *dest, int subcode); uint8 *tempsram; @@ -790,7 +790,7 @@ void bk_cpu_hook(hook_type_t type, int width, unsigned int address, unsigned int case HOOK_M68K_E: { if (biz_execcb) - biz_execcb(address); + biz_execcb(address, value); if (biz_cdcb) { @@ -804,7 +804,7 @@ void bk_cpu_hook(hook_type_t type, int width, unsigned int address, unsigned int case HOOK_M68K_R: { if (biz_readcb) - biz_readcb(address); + biz_readcb(address, value); break; } @@ -812,7 +812,7 @@ void bk_cpu_hook(hook_type_t type, int width, unsigned int address, unsigned int case HOOK_M68K_W: { if (biz_writecb) - biz_writecb(address); + biz_writecb(address, value); break; } @@ -1035,7 +1035,7 @@ GPGX_EX void gpgx_reset(int hard) gen_reset(0); } -GPGX_EX void gpgx_set_mem_callback(ECL_ENTRY void (*read)(unsigned), ECL_ENTRY void (*write)(unsigned), ECL_ENTRY void (*exec)(unsigned)) +GPGX_EX void gpgx_set_mem_callback(ECL_ENTRY void (*read)(unsigned, unsigned), ECL_ENTRY void (*write)(unsigned, unsigned), ECL_ENTRY void (*exec)(unsigned, unsigned)) { biz_readcb = read; biz_writecb = write;