comparison trans.c @ 1507:2455662378ed mame_interp

Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
author Michael Pavone <pavone@retrodev.com>
date Sat, 30 Dec 2017 18:27:06 -0800
parents 5b90d7669eee
children 374a5ae694e8
comparison
equal deleted inserted replaced
1506:ded16f3d7eb4 1507:2455662378ed
17 17
18 void render_infobox(char * title, char * buf) 18 void render_infobox(char * title, char * buf)
19 { 19 {
20 } 20 }
21 21
22 uint64_t total_cycles;
23
22 m68k_context * sync_components(m68k_context * context, uint32_t address) 24 m68k_context * sync_components(m68k_context * context, uint32_t address)
23 { 25 {
24 if (context->current_cycle > 0x80000000) { 26 if (context->current_cycle > 0x80000000) {
25 context->current_cycle -= 0x80000000; 27 context->current_cycle -= 0x80000000;
28 total_cycles += 0x80000000;
26 } 29 }
27 if (context->status & M68K_STATUS_TRACE || context->trace_pending) { 30 if (context->status & M68K_STATUS_TRACE || context->trace_pending) {
28 context->target_cycle = context->current_cycle; 31 context->target_cycle = context->current_cycle;
29 } 32 }
30 return context; 33 return context;
31 } 34 }
32 35
33 m68k_context *reset_handler(m68k_context *context) 36 m68k_context *reset_handler(m68k_context *context)
34 { 37 {
35 m68k_print_regs(context); 38 m68k_print_regs(context);
39 total_cycles += context->current_cycle;
40 printf("%ld cycles\n", total_cycles);
36 exit(0); 41 exit(0);
37 //unreachable 42 //unreachable
38 return context; 43 return context;
39 } 44 }
40 45
68 memmap[1].end = 0x1000000; 73 memmap[1].end = 0x1000000;
69 memmap[1].mask = 0xFFFF; 74 memmap[1].mask = 0xFFFF;
70 memmap[1].flags = MMAP_READ | MMAP_WRITE | MMAP_CODE; 75 memmap[1].flags = MMAP_READ | MMAP_WRITE | MMAP_CODE;
71 memmap[1].buffer = malloc(64 * 1024); 76 memmap[1].buffer = malloc(64 * 1024);
72 memset(memmap[1].buffer, 0, 64 * 1024); 77 memset(memmap[1].buffer, 0, 64 * 1024);
73 init_m68k_opts(&opts, memmap, 2, 1); 78 init_m68k_opts(&opts, memmap, 2, 7);
74 m68k_context * context = init_68k_context(&opts, reset_handler); 79 m68k_context * context = init_68k_context(&opts, reset_handler);
75 context->mem_pointers[0] = memmap[0].buffer; 80 context->mem_pointers[0] = memmap[0].buffer;
76 context->mem_pointers[1] = memmap[1].buffer; 81 context->mem_pointers[1] = memmap[1].buffer;
77 context->target_cycle = context->sync_cycle = 0x80000000; 82 context->target_cycle = context->sync_cycle = 0x80000000;
83 /*
78 uint32_t address; 84 uint32_t address;
79 address = filebuf[2] << 16 | filebuf[3]; 85 address = filebuf[2] << 16 | filebuf[3];
80 translate_m68k_stream(address, context); 86 translate_m68k_stream(address, context);*/
81 m68k_reset(context); 87 m68k_reset(context);
82 return 0; 88 return 0;
83 } 89 }
84 90