blob: a066f39ca465ad42603d83df72bbd63aacad0e8c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
#include <stdint.h>
#include "68kinst.h"
#define NUM_MEM_AREAS 4
#define NATIVE_MAP_CHUNKS (64*1024)
#define NATIVE_CHUNK_SIZE ((16 * 1024 * 1024 / NATIVE_MAP_CHUNKS)/2)
#define INVALID_OFFSET 0xFFFFFFFF
typedef struct {
uint8_t *base;
int32_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];
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[9];
uint32_t target_cycle; //cycle at which the next synchronization or interrupt occurs
uint32_t current_cycle;
uint32_t sync_cycle;
uint32_t int_cycle;
uint32_t int_num;
uint16_t *mem_pointers[NUM_MEM_AREAS];
void *next_context;
uint16_t value;
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);
void m68k_reset(m68k_context * context);
|