diff options
Diffstat (limited to 'trans.c')
-rw-r--r-- | trans.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -1,10 +1,10 @@ /* Copyright 2013 Michael Pavone - This file is part of BlastEm. + This file is part of BlastEm. BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text. */ #include "68kinst.h" -#include "m68k_to_x86.h" +#include "m68k_core.h" #include "mem.h" #include <stdio.h> #include <stdlib.h> @@ -24,14 +24,15 @@ int main(int argc, char ** argv) unsigned short *filebuf; char disbuf[1024]; unsigned short * cur; - x86_68k_options opts; + m68k_options opts; m68k_context context; FILE * f = fopen(argv[1], "rb"); fseek(f, 0, SEEK_END); filesize = ftell(f); fseek(f, 0, SEEK_SET); - filebuf = malloc(filesize > 0x400000 ? filesize : 0x400000); - fread(filebuf, 2, filesize/2, f); + filebuf = malloc(0x400000); + memset(filebuf, 0, 0x400000); + fread(filebuf, 2, filesize/2 > 0x200000 ? 0x200000 : filesize/2, f); fclose(f); for(cur = filebuf; cur - filebuf < (filesize/2); ++cur) { @@ -43,14 +44,15 @@ int main(int argc, char ** argv) memmap[0].mask = 0xFFFFFF; memmap[0].flags = MMAP_READ; memmap[0].buffer = filebuf; - + memmap[1].start = 0xE00000; memmap[1].end = 0x1000000; memmap[1].mask = 0xFFFF; memmap[1].flags = MMAP_READ | MMAP_WRITE | MMAP_CODE; memmap[1].buffer = malloc(64 * 1024); - init_x86_68k_opts(&opts, memmap, 2); - init_68k_context(&context, opts.native_code_map, &opts); + memset(memmap[1].buffer, 0, 64 * 1024); + init_m68k_opts(&opts, memmap, 2); + init_68k_context(&context, opts.gen.native_code_map, &opts); context.mem_pointers[0] = memmap[0].buffer; context.mem_pointers[1] = memmap[1].buffer; context.target_cycle = context.sync_cycle = 0x80000000; |