From 0c1e3eaa3b4f4952283fc1e2e950b77498f2a160 Mon Sep 17 00:00:00 2001 From: goyuken Date: Sat, 20 Dec 2014 03:48:01 +0000 Subject: [PATCH] gpgx: fix regs --- BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs index e15b310254..d732229515 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs @@ -629,7 +629,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx MemoryDomains = new MemoryDomainList(mm, 0); } - // TODO: are any of these registers not 16 bit? public IDictionary GetCpuFlagsAndRegisters() { LibGPGX.RegisterInfo[] regs = new LibGPGX.RegisterInfo[LibGPGX.gpgx_getmaxnumregs()]; @@ -639,7 +638,15 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx throw new InvalidOperationException("A buffer overrun has occured!"); var ret = new Dictionary(); for (int i = 0; i < n; i++) - ret[Marshal.PtrToStringAnsi(regs[i].Name)] = (ushort)regs[i].Value; + { + // el hacko + string name = Marshal.PtrToStringAnsi(regs[i].Name); + byte size = 32; + if (name.Contains("68K SR") || name.StartsWith("Z80")) + size = 16; + ret[Marshal.PtrToStringAnsi(regs[i].Name)] = + new Register { BitSize = size, Value = (ulong)regs[i].Value }; + } return ret; }