diff options
author | Mike Pavone <pavone@retrodev.com> | 2012-12-04 19:13:12 -0800 |
---|---|---|
committer | Mike Pavone <pavone@retrodev.com> | 2012-12-04 19:13:12 -0800 |
commit | 854a8a9abf29e5cab28871f7a81d0fd1e7474b3d (patch) | |
tree | 54651ed6d72de7191718ba8e26e015e2ee2720ef /m68k_to_x86.h | |
parent | e54fddc285255b26e7e0ca69db3efb009cfc9c15 (diff) |
M68K to x86 translation works for a limited subset of instructions and addressing modes
Diffstat (limited to 'm68k_to_x86.h')
-rw-r--r-- | m68k_to_x86.h | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/m68k_to_x86.h b/m68k_to_x86.h index c287d6f..5dc04fd 100644 --- a/m68k_to_x86.h +++ b/m68k_to_x86.h @@ -1,16 +1,46 @@ #include <stdint.h> +#include "68kinst.h" + +#define NUM_MEM_AREAS 4 +#define NATIVE_MAP_CHUNKS (32*1024) +#define NATIVE_CHUNK_SIZE ((16 * 1024 * 1024 / NATIVE_MAP_CHUNKS)/2) +#define INVALID_OFFSET 0xFFFF + +typedef struct { + uint8_t *base; + uint16_t *offsets; +} native_map_slot; + +typedef struct deferred_addr { + struct deferred_addr *next; + uint8_t *dest; + uint32_t address; +} deferred_addr; typedef struct { - uint32_t flags; - int8_t dregs[8]; - int8_t aregs[8]; + uint32_t flags; + int8_t dregs[8]; + int8_t aregs[8]; + native_map_slot *native_code_map; + deferred_addr *deferred; + } x86_68k_options; typedef struct { - uint8_t flags[5]; - uint8_t status; - uint16_t reserved; - uint32_t dregs[8]; - uint32_t aregs[8]; + uint8_t flags[5]; + uint8_t status; + uint16_t reserved; + uint32_t dregs[8]; + uint32_t aregs[8]; + uint32_t target_cycle; + uint32_t current_cycle; + uint16_t *mem_pointers[NUM_MEM_AREAS]; + native_map_slot *native_code_map; + void *options; } m68k_context; +uint8_t * translate_m68k(uint8_t * dst, m68kinst * inst, x86_68k_options * opts); +uint8_t * translate_m68k_stream(uint8_t * dst, uint8_t * dst_end, uint32_t address, m68k_context * context); +void start_68k_context(m68k_context * context, uint32_t address); +void init_x86_68k_opts(x86_68k_options * opts); +void init_68k_context(m68k_context * context, native_map_slot * native_code_map, void * opts); |