diff m68k_core_x86.c @ 792:724bbec47f86

Use a new fatal_error function instead of calling fprintf and exit for fatal errors. This new function more gracefully handles the case in which BlastEm was not started from a terminal or disconnected from ther terminal (Windows).
author Michael Pavone <pavone@retrodev.com>
date Sat, 25 Jul 2015 18:22:07 -0700
parents 483f7e7926a6
children 841e44c5af83
line wrap: on
line diff
--- a/m68k_core_x86.c	Sat Jul 25 18:19:00 2015 -0700
+++ b/m68k_core_x86.c	Sat Jul 25 18:22:07 2015 -0700
@@ -9,6 +9,7 @@
 #include "68kinst.h"
 #include "mem.h"
 #include "backend.h"
+#include "util.h"
 #include <stdio.h>
 #include <stddef.h>
 #include <stdlib.h>
@@ -507,8 +508,7 @@
 		return;
 	default:
 		m68k_disasm(inst, disasm_buf);
-		printf("%X: %s\naddress mode %d not implemented (%s)\n", inst->address, disasm_buf, op->addr_mode, dst ? "dst" : "src");
-		exit(1);
+		fatal_error("%X: %s\naddress mode %d not implemented (%s)\n", inst->address, disasm_buf, op->addr_mode, dst ? "dst" : "src");
 	}
 	if (!dst && inst->dst.addr_mode == MODE_AREG && inst->extra.size == OPSIZE_WORD) {
 		if (ea->mode == MODE_REG_DIRECT) {
@@ -684,8 +684,7 @@
 		break;
 	default:
 		m68k_disasm(inst, disasm_buf);
-		printf("%X: %s\naddress mode %d not implemented (move dst)\n", inst->address, disasm_buf, inst->dst.addr_mode);
-		exit(1);
+		fatal_error("%X: %s\naddress mode %d not implemented (move dst)\n", inst->address, disasm_buf, inst->dst.addr_mode);
 	}
 
 	if (inst->dst.addr_mode != MODE_AREG) {