comparison m68k_to_x86.h @ 82:6331ddec228f

Initial stab at interrupt support. Make native code offsets bigger so I don't have to worry about overflowing the offset. Implement neg and not (untested).
author Mike Pavone <pavone@retrodev.com>
date Wed, 26 Dec 2012 11:09:04 -0800
parents 8da611e69b32
children 3d3966c254b2
comparison
equal deleted inserted replaced
81:6d231dbe75ab 82:6331ddec228f
2 #include "68kinst.h" 2 #include "68kinst.h"
3 3
4 #define NUM_MEM_AREAS 4 4 #define NUM_MEM_AREAS 4
5 #define NATIVE_MAP_CHUNKS (32*1024) 5 #define NATIVE_MAP_CHUNKS (32*1024)
6 #define NATIVE_CHUNK_SIZE ((16 * 1024 * 1024 / NATIVE_MAP_CHUNKS)/2) 6 #define NATIVE_CHUNK_SIZE ((16 * 1024 * 1024 / NATIVE_MAP_CHUNKS)/2)
7 #define INVALID_OFFSET 0xFFFF 7 #define INVALID_OFFSET 0xFFFFFFFF
8 8
9 typedef struct { 9 typedef struct {
10 uint8_t *base; 10 uint8_t *base;
11 uint16_t *offsets; 11 int32_t *offsets;
12 } native_map_slot; 12 } native_map_slot;
13 13
14 typedef struct deferred_addr { 14 typedef struct deferred_addr {
15 struct deferred_addr *next; 15 struct deferred_addr *next;
16 uint8_t *dest; 16 uint8_t *dest;
33 uint32_t dregs[8]; 33 uint32_t dregs[8];
34 uint32_t aregs[9]; 34 uint32_t aregs[9];
35 uint32_t target_cycle; //cycle at which the next synchronization or interrupt occurs 35 uint32_t target_cycle; //cycle at which the next synchronization or interrupt occurs
36 uint32_t current_cycle; 36 uint32_t current_cycle;
37 uint32_t sync_cycle; 37 uint32_t sync_cycle;
38 uint32_t int_cycle;
39 uint32_t int_num;
38 uint16_t *mem_pointers[NUM_MEM_AREAS]; 40 uint16_t *mem_pointers[NUM_MEM_AREAS];
39 void *next_context; 41 void *next_context;
40 uint16_t value; 42 uint16_t value;
43
41 native_map_slot *native_code_map; 44 native_map_slot *native_code_map;
42 void *options; 45 void *options;
43 } m68k_context; 46 } m68k_context;
44 47
45 uint8_t * translate_m68k(uint8_t * dst, m68kinst * inst, x86_68k_options * opts); 48 uint8_t * translate_m68k(uint8_t * dst, m68kinst * inst, x86_68k_options * opts);