Mercurial > repos > blastem
comparison m68k_to_x86.c @ 559:6b248602ab84
blastem builds and almost works on OS X now
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 17 Jun 2014 01:50:29 -0400 |
parents | dc9f178085a0 |
children | f9431cb3a39c |
comparison
equal
deleted
inserted
replaced
558:dc9f178085a0 | 559:6b248602ab84 |
---|---|
37 | 37 |
38 char disasm_buf[1024]; | 38 char disasm_buf[1024]; |
39 | 39 |
40 m68k_context * sync_components(m68k_context * context, uint32_t address); | 40 m68k_context * sync_components(m68k_context * context, uint32_t address); |
41 | 41 |
42 void m68k_invalid(); | 42 extern void bcd_add() asm("bcd_add"); |
43 void bcd_add(); | 43 extern void bcd_sub() asm("bcd_sub"); |
44 void bcd_sub(); | 44 |
45 void m68k_invalid(uint32_t address, m68k_context * context) | |
46 { | |
47 printf("Invalid instruction at %X\n", address); | |
48 exit(1); | |
49 } | |
45 | 50 |
46 code_ptr cycles(code_ptr dst, uint32_t num) | 51 code_ptr cycles(code_ptr dst, uint32_t num) |
47 { | 52 { |
48 dst = add_ir(dst, num, CYCLES, SZ_D); | 53 dst = add_ir(dst, num, CYCLES, SZ_D); |
49 return dst; | 54 return dst; |
2862 return translate_m68k_movep(dst, inst, opts); | 2867 return translate_m68k_movep(dst, inst, opts); |
2863 } else if(inst->op == M68K_INVALID) { | 2868 } else if(inst->op == M68K_INVALID) { |
2864 if (inst->src.params.immed == 0x7100) { | 2869 if (inst->src.params.immed == 0x7100) { |
2865 return retn(dst); | 2870 return retn(dst); |
2866 } | 2871 } |
2867 dst = mov_ir(dst, inst->address, SCRATCH1, SZ_D); | 2872 dst = mov_ir(dst, inst->address, SCRATCH2, SZ_D); |
2873 #ifdef X86_32 | |
2874 dst = push_r(dst, CONTEXT); | |
2875 dst = push_r(dst, SCRATCH2); | |
2876 #endif | |
2868 return call(dst, (code_ptr)m68k_invalid); | 2877 return call(dst, (code_ptr)m68k_invalid); |
2869 } else if(inst->op == M68K_CMP) { | 2878 } else if(inst->op == M68K_CMP) { |
2870 return translate_m68k_cmp(dst, inst, opts); | 2879 return translate_m68k_cmp(dst, inst, opts); |
2871 } | 2880 } |
2872 x86_ea src_op, dst_op; | 2881 x86_ea src_op, dst_op; |