comparison m68k_core.h @ 1082:2ec5e6eaf81d

Add support for specifying a reset handler in the M68K core. Adjust memory map initialization to handle extra field. Improved handling of out of bounds execution.
author Michael Pavone <pavone@retrodev.com>
date Thu, 06 Oct 2016 09:34:31 -0700
parents 784bc1e45e80
children a68274a25e2f
comparison
equal deleted inserted replaced
1081:89cc20cf1ad3 1082:2ec5e6eaf81d
59 uint32_t int_cycle; 59 uint32_t int_cycle;
60 uint32_t int_num; 60 uint32_t int_num;
61 uint32_t last_prefetch_address; 61 uint32_t last_prefetch_address;
62 uint16_t *mem_pointers[NUM_MEM_AREAS]; 62 uint16_t *mem_pointers[NUM_MEM_AREAS];
63 code_ptr resume_pc; 63 code_ptr resume_pc;
64 code_ptr reset_handler;
64 native_map_slot *native_code_map; 65 native_map_slot *native_code_map;
65 m68k_options *options; 66 m68k_options *options;
66 void *system; 67 void *system;
67 uint8_t int_pending; 68 uint8_t int_pending;
68 uint8_t should_return; 69 uint8_t should_return;
69 uint8_t ram_code_flags[]; 70 uint8_t ram_code_flags[];
70 } m68k_context; 71 } m68k_context;
71 72
73 typedef m68k_context *(*m68k_reset_handler)(m68k_context *context);
74
72 void translate_m68k(m68k_options * opts, struct m68kinst * inst); 75 void translate_m68k(m68k_options * opts, struct m68kinst * inst);
73 void translate_m68k_stream(uint32_t address, m68k_context * context); 76 void translate_m68k_stream(uint32_t address, m68k_context * context);
74 void start_68k_context(m68k_context * context, uint32_t address); 77 void start_68k_context(m68k_context * context, uint32_t address);
75 void resume_68k(m68k_context *context); 78 void resume_68k(m68k_context *context);
76 void init_m68k_opts(m68k_options * opts, memmap_chunk * memmap, uint32_t num_chunks, uint32_t clock_divider); 79 void init_m68k_opts(m68k_options * opts, memmap_chunk * memmap, uint32_t num_chunks, uint32_t clock_divider);
77 m68k_context * init_68k_context(m68k_options * opts); 80 m68k_context * init_68k_context(m68k_options * opts, m68k_reset_handler reset_handler);
78 void m68k_reset(m68k_context * context); 81 void m68k_reset(m68k_context * context);
79 void m68k_options_free(m68k_options *opts); 82 void m68k_options_free(m68k_options *opts);
80 void insert_breakpoint(m68k_context * context, uint32_t address, uint8_t * bp_handler); 83 void insert_breakpoint(m68k_context * context, uint32_t address, uint8_t * bp_handler);
81 void remove_breakpoint(m68k_context * context, uint32_t address); 84 void remove_breakpoint(m68k_context * context, uint32_t address);
82 m68k_context * m68k_handle_code_write(uint32_t address, m68k_context * context); 85 m68k_context * m68k_handle_code_write(uint32_t address, m68k_context * context);
83 uint32_t get_instruction_start(m68k_options *opts, native_map_slot * native_code_map, uint32_t address); 86 uint32_t get_instruction_start(m68k_options *opts, native_map_slot * native_code_map, uint32_t address);
84 uint16_t m68k_get_ir(m68k_context *context); 87 uint16_t m68k_get_ir(m68k_context *context);
88 void m68k_print_regs(m68k_context * context);
85 89
86 #endif //M68K_CORE_H_ 90 #endif //M68K_CORE_H_
87 91