changeset 1776:d5118d6f9c75 mame_interp

Hopefully fix 68K serialization/deserialization with Musashi
author Michael Pavone <pavone@retrodev.com>
date Wed, 13 Mar 2019 19:13:46 -0700
parents a9fc826c6a9d
children 5358a7126b96
files m68k_core.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/m68k_core.c	Wed Mar 13 18:57:11 2019 -0700
+++ b/m68k_core.c	Wed Mar 13 19:13:46 2019 -0700
@@ -1302,6 +1302,7 @@
 	{
 		save_int32(buf, context->aregs[i]);
 	}
+#ifdef USE_NATIVE
 	save_int32(buf, pc);
 	uint16_t sr = context->status << 3;
 	for (int flag = 4; flag >= 0; flag--) {
@@ -1309,6 +1310,11 @@
 		sr |= context->flags[flag] != 0;
 	}
 	save_int16(buf, sr);
+#else
+	m68000_base_device *device = (m68000_base_device *)context;
+	save_int32(buf, device->pc);
+	save_int16(buf, m68ki_get_sr(device));
+#endif
 	save_int32(buf, context->current_cycle);
 	save_int32(buf, context->int_cycle);
 	save_int8(buf, context->int_num);
@@ -1327,6 +1333,7 @@
 	{
 		context->aregs[i] = load_int32(buf);
 	}
+#ifdef USE_NATIVE
 	//hack until both PC and IR registers are represented properly
 	context->last_prefetch_address = load_int32(buf);
 	uint16_t sr = load_int16(buf);
@@ -1336,6 +1343,11 @@
 		context->flags[flag] = sr & 1;
 		sr >>= 1;
 	}
+#else
+	m68000_base_device *device = vcontext;
+	device->pc = load_int32(buf);
+	m68ki_set_sr_noint_nosp(device, load_int16(buf));
+#endif
 	context->current_cycle = load_int32(buf);
 	context->int_cycle = load_int32(buf);
 	context->int_num = load_int8(buf);