diff sms.c @ 1773:0a26f3657295 mame_interp

Remove MAME Z80 core in favor of my new Z80 core
author Michael Pavone <pavone@retrodev.com>
date Tue, 12 Mar 2019 21:59:52 -0700
parents 8fe162bdb038
children 49f65d240299
line wrap: on
line diff
--- a/sms.c	Tue Mar 12 21:58:53 2019 -0700
+++ b/sms.c	Tue Mar 12 21:59:52 2019 -0700
@@ -9,7 +9,7 @@
 #include "saves.h"
 #include "bindings.h"
 
-#ifdef NEW_CORE
+#ifndef USE_NATIVE
 #define Z80_CYCLE cycles
 #define Z80_OPTS opts
 #define z80_handle_code_write(...)
@@ -70,7 +70,7 @@
 {
 	uint32_t vint = vdp_next_vint(sms->vdp);
 	uint32_t hint = vdp_next_hint(sms->vdp);
-#ifdef NEW_CORE
+#ifndef USE_NATIVE
 	sms->z80->int_cycle = vint < hint ? vint : hint;
 	z80_sync_cycle(sms->z80, sms->z80->sync_cycle);
 #else
@@ -357,7 +357,7 @@
 	sms_context *sms = (sms_context *)system;
 	char *statepath = get_slot_name(system, slot, "state");
 	uint8_t ret;
-#if !defined(NEW_CORE) && defined(USE_NATIVE)
+#ifdef USE_NATIVE
 	if (!sms->z80->native_pc) {
 		ret = get_modification_time(statepath) != 0;
 		if (ret) {
@@ -391,11 +391,9 @@
 			system->enter_debugger = 0;
 			zdebugger(sms->z80, sms->z80->pc);
 		}
-#endif
-#ifdef NEW_CORE
+		if (sms->z80->nmi_start == CYCLE_NEVER) {
+#else
 		if (sms->z80->nmi_cycle == CYCLE_NEVER) {
-#else
-		if (sms->z80->nmi_start == CYCLE_NEVER) {
 #endif
 			uint32_t nmi = vdp_next_nmi(sms->vdp);
 			if (nmi != CYCLE_NEVER) {
@@ -476,7 +474,7 @@
 {
 	sms_context *sms = (sms_context *)system;
 	z80_assert_reset(sms->z80, sms->z80->Z80_CYCLE);
-#if !defined(NEW_CORE) && defined(USE_NATIVE)
+#ifdef USE_NATIVE
 	sms->z80->target_cycle = sms->z80->sync_cycle = sms->z80->current_cycle;
 #endif
 }
@@ -501,10 +499,8 @@
 	sms_context *sms = (sms_context *)system;
 	sms->should_return = 1;
 #ifdef USE_NATIVE
-#ifndef NEW_CORE
 	sms->z80->target_cycle = sms->z80->sync_cycle = sms->z80->Z80_CYCLE;
 #endif
-#endif
 }
 
 static void inc_debug_mode(system_header *system)