comparison trans.c @ 744:fc68992cf18d

Merge windows branch with latest changes
author Michael Pavone <pavone@retrodev.com>
date Thu, 28 May 2015 21:19:55 -0700
parents 3f065c20423c
children 124a58fdcf3a
comparison
equal deleted inserted replaced
743:cf78cb045fa4 744:fc68992cf18d
23 long filesize; 23 long filesize;
24 unsigned short *filebuf; 24 unsigned short *filebuf;
25 char disbuf[1024]; 25 char disbuf[1024];
26 unsigned short * cur; 26 unsigned short * cur;
27 m68k_options opts; 27 m68k_options opts;
28 m68k_context context;
29 FILE * f = fopen(argv[1], "rb"); 28 FILE * f = fopen(argv[1], "rb");
30 fseek(f, 0, SEEK_END); 29 fseek(f, 0, SEEK_END);
31 filesize = ftell(f); 30 filesize = ftell(f);
32 fseek(f, 0, SEEK_SET); 31 fseek(f, 0, SEEK_SET);
33 filebuf = malloc(0x400000); 32 filebuf = malloc(0x400000);
49 memmap[1].end = 0x1000000; 48 memmap[1].end = 0x1000000;
50 memmap[1].mask = 0xFFFF; 49 memmap[1].mask = 0xFFFF;
51 memmap[1].flags = MMAP_READ | MMAP_WRITE | MMAP_CODE; 50 memmap[1].flags = MMAP_READ | MMAP_WRITE | MMAP_CODE;
52 memmap[1].buffer = malloc(64 * 1024); 51 memmap[1].buffer = malloc(64 * 1024);
53 memset(memmap[1].buffer, 0, 64 * 1024); 52 memset(memmap[1].buffer, 0, 64 * 1024);
54 init_m68k_opts(&opts, memmap, 2); 53 init_m68k_opts(&opts, memmap, 2, 1);
55 init_68k_context(&context, opts.gen.native_code_map, &opts); 54 m68k_context * context = init_68k_context(&opts);
56 context.mem_pointers[0] = memmap[0].buffer; 55 context->mem_pointers[0] = memmap[0].buffer;
57 context.mem_pointers[1] = memmap[1].buffer; 56 context->mem_pointers[1] = memmap[1].buffer;
58 context.target_cycle = context.sync_cycle = 0x80000000; 57 context->target_cycle = context->sync_cycle = 0x80000000;
59 uint32_t address; 58 uint32_t address;
60 address = filebuf[2] << 16 | filebuf[3]; 59 address = filebuf[2] << 16 | filebuf[3];
61 translate_m68k_stream(address, &context); 60 translate_m68k_stream(address, context);
62 m68k_reset(&context); 61 m68k_reset(context);
63 return 0; 62 return 0;
64 } 63 }
65 64