comparison trans.c @ 567:8e395210f50f

Refactor gen_x86 to use an interface more like gen_arm and to remove the need for the caller to decide whether an 8-bit or 32-bit displacement is needed in the rdisp functions. Update m68k_to_x86 to use the new version of the gen_x86 functions and do some minor refactoring there in the process
author Michael Pavone <pavone@retrodev.com>
date Sun, 02 Mar 2014 14:45:36 -0800
parents 140af5509ce7
children 9b7fcf748be0
comparison
equal deleted inserted replaced
566:624dd5106060 567:8e395210f50f
1 /* 1 /*
2 Copyright 2013 Michael Pavone 2 Copyright 2013 Michael Pavone
3 This file is part of BlastEm. 3 This file is part of BlastEm.
4 BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text. 4 BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text.
5 */ 5 */
6 #include "68kinst.h" 6 #include "68kinst.h"
7 #include "m68k_to_x86.h" 7 #include "m68k_to_x86.h"
8 #include "mem.h" 8 #include "mem.h"
41 memset(memmap, 0, sizeof(memmap_chunk)*2); 41 memset(memmap, 0, sizeof(memmap_chunk)*2);
42 memmap[0].end = 0x400000; 42 memmap[0].end = 0x400000;
43 memmap[0].mask = 0xFFFFFF; 43 memmap[0].mask = 0xFFFFFF;
44 memmap[0].flags = MMAP_READ; 44 memmap[0].flags = MMAP_READ;
45 memmap[0].buffer = filebuf; 45 memmap[0].buffer = filebuf;
46 46
47 memmap[1].start = 0xE00000; 47 memmap[1].start = 0xE00000;
48 memmap[1].end = 0x1000000; 48 memmap[1].end = 0x1000000;
49 memmap[1].mask = 0xFFFF; 49 memmap[1].mask = 0xFFFF;
50 memmap[1].flags = MMAP_READ | MMAP_WRITE | MMAP_CODE; 50 memmap[1].flags = MMAP_READ | MMAP_WRITE | MMAP_CODE;
51 memmap[1].buffer = malloc(64 * 1024); 51 memmap[1].buffer = malloc(64 * 1024);
52 init_x86_68k_opts(&opts, memmap, 2); 52 init_x86_68k_opts(&opts, memmap, 2);
53 init_68k_context(&context, opts.native_code_map, &opts); 53 init_68k_context(&context, opts.gen.native_code_map, &opts);
54 context.mem_pointers[0] = memmap[0].buffer; 54 context.mem_pointers[0] = memmap[0].buffer;
55 context.mem_pointers[1] = memmap[1].buffer; 55 context.mem_pointers[1] = memmap[1].buffer;
56 context.target_cycle = context.sync_cycle = 0x80000000; 56 context.target_cycle = context.sync_cycle = 0x80000000;
57 uint32_t address; 57 uint32_t address;
58 address = filebuf[2] << 16 | filebuf[3]; 58 address = filebuf[2] << 16 | filebuf[3];