diff options
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | m68k_core_x86.c | 8 | ||||
-rw-r--r-- | runtime.S | 16 | ||||
-rw-r--r-- | runtime_32.S | 17 |
4 files changed, 12 insertions, 39 deletions
@@ -45,11 +45,11 @@ endif TRANSOBJS=gen.o backend.o mem.o M68KOBJS=68kinst.o m68k_core.o ifeq ($(CPU),x86_64) -M68KOBJS+= runtime.o m68k_core_x86.o +M68KOBJS+= m68k_core_x86.o TRANSOBJS+= gen_x86.o backend_x86.o else ifeq ($(CPU),i686) -M68KOBJS+= runtime_32.o m68k_core_x86.o +M68KOBJS+= m68k_core_x86.o TRANSOBJS+= gen_x86.o backend_x86.o endif endif @@ -61,10 +61,12 @@ CONFIGOBJS=config.o tern.o util.o MAINOBJS=blastem.o debug.o gdb_remote.o vdp.o render_sdl.o io.o $(CONFIGOBJS) gst.o $(M68KOBJS) $(TRANSOBJS) $(AUDIOOBJS) ifeq ($(CPU),x86_64) -CFLAGS+=-DX86_64 +CFLAGS+=-DX86_64 -m64 +LDFLAGS+=-m64 else ifeq ($(CPU),i686) -CFLAGS+=-DX86_32 +CFLAGS+=-DX86_32 -m32 +LDFLAGS+=-m32 endif endif diff --git a/m68k_core_x86.c b/m68k_core_x86.c index 62588b7..5c459b0 100644 --- a/m68k_core_x86.c +++ b/m68k_core_x86.c @@ -1363,8 +1363,12 @@ void translate_m68k_invalid(m68k_options *opts, m68kinst *inst) retn(code); return; } - mov_ir(code, inst->address, opts->gen.scratch1, SZ_D); - call(code, (code_ptr)m68k_invalid); + mov_ir(code, (int64_t)stderr, RDI, SZ_PTR); + mov_ir(code, (int64_t)"Invalid instruction at %X\n", RSI, SZ_PTR); + mov_ir(code, inst->address, RDX, SZ_D); + call_args_abi(code, (code_ptr)fprintf, 3, RDI, RSI, RDX); + mov_ir(code, 1, RDI, SZ_D); + call_args(code, (code_ptr)exit, 1, RDI); } void translate_m68k_abcd_sbcd(m68k_options *opts, m68kinst *inst, host_ea *src_op, host_ea *dst_op) diff --git a/runtime.S b/runtime.S deleted file mode 100644 index 5595eb1..0000000 --- a/runtime.S +++ /dev/null @@ -1,16 +0,0 @@ - - -invalid_msg: - .asciz "Invalid instruction at %X\n" - - .global m68k_invalid -m68k_invalid: - lea invalid_msg(%rip), %rdi - mov %ecx, %esi - xor %rax, %rax - call printf - mov $1, %rdi - call exit - - - diff --git a/runtime_32.S b/runtime_32.S deleted file mode 100644 index 50117f1..0000000 --- a/runtime_32.S +++ /dev/null @@ -1,17 +0,0 @@ - - -invalid_msg: - .asciz "Invalid instruction at %X\n" - - .global m68k_invalid -m68k_invalid: - push %ecx - push invalid_msg - xor %eax, %eax - call printf - push $1 - call exit - - - - |