From 831a64c7de8fe692d7de2ff6b7d6265460f0d7f8 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 23 May 2020 23:46:52 -0500 Subject: [PATCH] fix layout of bsnes registers fetch payload (broken in 36be9e9fc760ed5f4d30407b0e89a10905cf4f0a). fixes #2040 --- .../Consoles/Nintendo/SNES/LibsnesApi.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs index 291a86583a..95c3ef0ac9 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs @@ -203,20 +203,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES public delegate void snes_trace_t(uint which, string msg); - [StructLayout(LayoutKind.Explicit)] + [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct CPURegs { - [FieldOffset(0)] public uint pc; - [FieldOffset(4)] public ushort a, x, y, z, s, d, vector; //7x - [FieldOffset(18)] public byte p, nothing; - [FieldOffset(20)] public uint aa, rd; - [FieldOffset(28)] public byte sp, dp, db, mdr; - [FieldOffset(32)] public ushort v, h; }