comparison m68k_core.h @ 803:236a184bf6f0

Merge
author Michael Pavone <pavone@retrodev.com>
date Sun, 26 Jul 2015 16:51:03 -0700
parents cbf97d335444
children f2cd380adebe
comparison
equal deleted inserted replaced
802:6811f601008f 803:236a184bf6f0
9 #include <stdio.h> 9 #include <stdio.h>
10 #include "backend.h" 10 #include "backend.h"
11 //#include "68kinst.h" 11 //#include "68kinst.h"
12 struct m68kinst; 12 struct m68kinst;
13 13
14 #define NUM_MEM_AREAS 4 14 #define NUM_MEM_AREAS 8
15 #define NATIVE_MAP_CHUNKS (64*1024) 15 #define NATIVE_MAP_CHUNKS (64*1024)
16 #define NATIVE_CHUNK_SIZE ((16 * 1024 * 1024 / NATIVE_MAP_CHUNKS)/2) 16 #define NATIVE_CHUNK_SIZE ((16 * 1024 * 1024 / NATIVE_MAP_CHUNKS)/2)
17 #define MAX_NATIVE_SIZE 255 17 #define MAX_NATIVE_SIZE 255
18 18
19 typedef void (*start_fun)(uint8_t * addr, void * context); 19 typedef void (*start_fun)(uint8_t * addr, void * context);
32 code_ptr read_32; 32 code_ptr read_32;
33 code_ptr write_32_lowfirst; 33 code_ptr write_32_lowfirst;
34 code_ptr write_32_highfirst; 34 code_ptr write_32_highfirst;
35 code_ptr do_sync; 35 code_ptr do_sync;
36 code_ptr trap; 36 code_ptr trap;
37 code_ptr odd_address;
37 start_fun start_context; 38 start_fun start_context;
38 code_ptr retrans_stub; 39 code_ptr retrans_stub;
39 code_ptr native_addr; 40 code_ptr native_addr;
40 code_ptr native_addr_and_sync; 41 code_ptr native_addr_and_sync;
41 code_ptr get_sr; 42 code_ptr get_sr;
57 uint16_t *mem_pointers[NUM_MEM_AREAS]; 58 uint16_t *mem_pointers[NUM_MEM_AREAS];
58 void *video_context; 59 void *video_context;
59 uint16_t reserved; 60 uint16_t reserved;
60 61
61 native_map_slot *native_code_map; 62 native_map_slot *native_code_map;
62 void *options; 63 m68k_options *options;
63 uint8_t ram_code_flags[32/8];
64 void *system; 64 void *system;
65 uint8_t ram_code_flags[];
65 } m68k_context; 66 } m68k_context;
66 67
67 void translate_m68k(m68k_options * opts, struct m68kinst * inst); 68 void translate_m68k(m68k_options * opts, struct m68kinst * inst);
68 void translate_m68k_stream(uint32_t address, m68k_context * context); 69 void translate_m68k_stream(uint32_t address, m68k_context * context);
69 void start_68k_context(m68k_context * context, uint32_t address); 70 void start_68k_context(m68k_context * context, uint32_t address);
70 void init_m68k_opts(m68k_options * opts, memmap_chunk * memmap, uint32_t num_chunks); 71 void init_m68k_opts(m68k_options * opts, memmap_chunk * memmap, uint32_t num_chunks, uint32_t clock_divider);
71 void init_68k_context(m68k_context * context, native_map_slot * native_code_map, void * opts); 72 m68k_context * init_68k_context(m68k_options * opts);
72 void m68k_reset(m68k_context * context); 73 void m68k_reset(m68k_context * context);
73 void insert_breakpoint(m68k_context * context, uint32_t address, uint8_t * bp_handler); 74 void insert_breakpoint(m68k_context * context, uint32_t address, uint8_t * bp_handler);
74 void remove_breakpoint(m68k_context * context, uint32_t address); 75 void remove_breakpoint(m68k_context * context, uint32_t address);
75 m68k_context * m68k_handle_code_write(uint32_t address, m68k_context * context); 76 m68k_context * m68k_handle_code_write(uint32_t address, m68k_context * context);
76 uint32_t get_instruction_start(native_map_slot * native_code_map, uint32_t address); 77 uint32_t get_instruction_start(native_map_slot * native_code_map, uint32_t address);