comparison m68k_core.h @ 2676:7e86ec94c899

Implement breakpoints in new 68K core
author Michael Pavone <pavone@retrodev.com>
date Sat, 15 Mar 2025 23:15:05 -0700
parents d74d3998482c
children
comparison
equal deleted inserted replaced
2675:dbff641a33df 2676:7e86ec94c899
71 uint32_t num_movem; 71 uint32_t num_movem;
72 uint32_t movem_storage; 72 uint32_t movem_storage;
73 code_word prologue_start; 73 code_word prologue_start;
74 } m68k_options; 74 } m68k_options;
75 75
76 typedef void (*m68k_debug_handler)(m68k_context *context, uint32_t pc);
77
78 typedef struct {
79 m68k_debug_handler handler;
80 uint32_t address;
81 } m68k_breakpoint;
82
83 typedef struct { 76 typedef struct {
84 uint32_t start; 77 uint32_t start;
85 uint32_t end; 78 uint32_t end;
86 uint8_t check_change; 79 uint8_t check_change;
87 } m68k_watchpoint; 80 } m68k_watchpoint;
110 code_ptr reset_handler; 103 code_ptr reset_handler;
111 m68k_options *opts; 104 m68k_options *opts;
112 void *system; 105 void *system;
113 void *host_sp_entry; 106 void *host_sp_entry;
114 void *stack_storage[M68K_STACK_STORAGE]; 107 void *stack_storage[M68K_STACK_STORAGE];
115 m68k_breakpoint *breakpoints; 108 breakpoint *breakpoints;
116 uint32_t num_breakpoints; 109 uint32_t num_breakpoints;
117 uint32_t bp_storage; 110 uint32_t bp_storage;
118 uint32_t watchpoint_min; 111 uint32_t watchpoint_min;
119 uint32_t watchpoint_max; 112 uint32_t watchpoint_max;
120 m68k_watchpoint *watchpoints; 113 m68k_watchpoint *watchpoints;
139 void resume_68k(m68k_context *context); 132 void resume_68k(m68k_context *context);
140 void init_m68k_opts(m68k_options * opts, memmap_chunk * memmap, uint32_t num_chunks, uint32_t clock_divider, sync_fun sync_components, int_ack_fun int_ack); 133 void init_m68k_opts(m68k_options * opts, memmap_chunk * memmap, uint32_t num_chunks, uint32_t clock_divider, sync_fun sync_components, int_ack_fun int_ack);
141 m68k_context * init_68k_context(m68k_options * opts, m68k_reset_handler reset_handler); 134 m68k_context * init_68k_context(m68k_options * opts, m68k_reset_handler reset_handler);
142 void m68k_reset(m68k_context * context); 135 void m68k_reset(m68k_context * context);
143 void m68k_options_free(m68k_options *opts); 136 void m68k_options_free(m68k_options *opts);
144 void insert_breakpoint(m68k_context * context, uint32_t address, m68k_debug_handler bp_handler); 137 void insert_breakpoint(m68k_context * context, uint32_t address, debug_handler bp_handler);
145 void remove_breakpoint(m68k_context * context, uint32_t address); 138 void remove_breakpoint(m68k_context * context, uint32_t address);
146 void m68k_add_watchpoint(m68k_context *context, uint32_t address, uint32_t size); 139 void m68k_add_watchpoint(m68k_context *context, uint32_t address, uint32_t size);
147 void m68k_remove_watchpoint(m68k_context *context, uint32_t address, uint32_t size); 140 void m68k_remove_watchpoint(m68k_context *context, uint32_t address, uint32_t size);
148 m68k_context * m68k_handle_code_write(uint32_t address, m68k_context * context); 141 m68k_context * m68k_handle_code_write(uint32_t address, m68k_context * context);
149 uint32_t get_instruction_start(m68k_options *opts, uint32_t address); 142 uint32_t get_instruction_start(m68k_options *opts, uint32_t address);