This commit is contained in:
Morilli 2021-12-03 22:15:08 +01:00
parent 0a4bbce3f2
commit 59d76294c9
1 changed files with 12 additions and 9 deletions

View File

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using BizHawk.Common;
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
@ -14,17 +14,20 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
int n = Core.gpgx_getregs(regs);
if (n > regs.Length)
throw new InvalidOperationException("A buffer overrun has occured!");
throw new InvalidOperationException("A buffer overrun has occured!");
var ret = new Dictionary<string, RegisterValue>();
for (int i = 0; i < n; i++)
using (_elf.EnterExit())
{
// el hacko
string name = Marshal.PtrToStringAnsi(regs[i].Name);
byte size = 32;
if (name.Contains("68K SR") || name.StartsWith("Z80"))
size = 16;
for (int i = 0; i < n; i++)
{
// el hacko
string name = Marshal.PtrToStringAnsi(regs[i].Name);
byte size = 32;
if (name.Contains("68K SR") || name.StartsWith("Z80"))
size = 16;
ret[name] = new RegisterValue((ulong)regs[i].Value, size);
ret[name] = new RegisterValue((ulong)regs[i].Value, size);
}
}
return ret;