# HG changeset patch # User Michael Pavone # Date 1393231142 28800 # Node ID 5af986d2b9da3bfa2d1c57422304637af1dbf01b # Parent 474270dbff155880c19c39cee3783588aa4c3e16 Start work on refactoring some of the backend code to allow more sharing between M68K and Z80 cores and possibly also between x86 and the ARM backend when it exists diff -r 474270dbff15 -r 5af986d2b9da m68k_to_x86.c --- a/m68k_to_x86.c Sun Feb 23 22:17:43 2014 -0800 +++ b/m68k_to_x86.c Mon Feb 24 00:39:02 2014 -0800 @@ -4345,13 +4345,6 @@ start_68k_context(context, address); } -typedef enum { - READ_16, - READ_8, - WRITE_16, - WRITE_8 -} ftype; - uint8_t * gen_mem_fun(x86_68k_options * opts, memmap_chunk * memmap, uint32_t num_chunks, ftype fun_type) { uint8_t * dst = opts->cur_code; diff -r 474270dbff15 -r 5af986d2b9da x86_backend.h --- a/x86_backend.h Sun Feb 23 22:17:43 2014 -0800 +++ b/x86_backend.h Mon Feb 24 00:39:02 2014 -0800 @@ -1,6 +1,6 @@ /* 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. */ #ifndef X86_BACKEND_H_ @@ -30,6 +30,30 @@ uint32_t address; } deferred_addr; +typedef enum { + READ_16, + READ_8, + WRITE_16, + WRITE_8 +} ftype; + +typedef struct { + uint32_t flags; + native_map_slot *native_code_map; + deferred_addr *deferred; + uint8_t *cur_code; + uint8_t *code_end; + uint8_t **ram_inst_sizes; + FILE *address_log; + uint8_t *save_context; + uint8_t *load_context; + uint8_t *handle_cycle_limit; + uint8_t *handle_cycle_limit_int; + uint8_t context_reg; + uint8_t scratch1; + uint8_t scratch2; +} cpu_options; + #define MMAP_READ 0x01 #define MMAP_WRITE 0x02