Mercurial > repos > blastem
comparison m68k_core.h @ 2054:8ee7ecbf3f21 segacd
Implement enough of Sega CD gate array and Sub CPU to pass Sik's Mode 1 test ROM
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 18 Jan 2022 00:03:50 -0800 |
parents | 8b2ef428d1aa |
children | 8554751f17b5 |
comparison
equal
deleted
inserted
replaced
2053:3414a4423de1 | 2054:8ee7ecbf3f21 |
---|---|
23 #define INT_PENDING_NONE 255 | 23 #define INT_PENDING_NONE 255 |
24 | 24 |
25 #define M68K_STATUS_TRACE 0x80 | 25 #define M68K_STATUS_TRACE 0x80 |
26 | 26 |
27 typedef void (*start_fun)(uint8_t * addr, void * context); | 27 typedef void (*start_fun)(uint8_t * addr, void * context); |
28 typedef struct m68k_context m68k_context; | |
29 typedef m68k_context *(*sync_fun)(m68k_context * context, uint32_t address); | |
28 | 30 |
29 typedef struct { | 31 typedef struct { |
30 code_ptr impl; | 32 code_ptr impl; |
31 uint16_t reglist; | 33 uint16_t reglist; |
32 uint8_t reg_to_mem; | 34 uint8_t reg_to_mem; |
57 code_ptr native_addr_and_sync; | 59 code_ptr native_addr_and_sync; |
58 code_ptr get_sr; | 60 code_ptr get_sr; |
59 code_ptr set_sr; | 61 code_ptr set_sr; |
60 code_ptr set_ccr; | 62 code_ptr set_ccr; |
61 code_ptr bp_stub; | 63 code_ptr bp_stub; |
64 sync_fun sync_components; | |
62 code_info extra_code; | 65 code_info extra_code; |
63 movem_fun *big_movem; | 66 movem_fun *big_movem; |
64 uint32_t num_movem; | 67 uint32_t num_movem; |
65 uint32_t movem_storage; | 68 uint32_t movem_storage; |
66 code_word prologue_start; | 69 code_word prologue_start; |
67 } m68k_options; | 70 } m68k_options; |
68 | 71 |
69 typedef struct m68k_context m68k_context; | |
70 typedef void (*m68k_debug_handler)(m68k_context *context, uint32_t pc); | 72 typedef void (*m68k_debug_handler)(m68k_context *context, uint32_t pc); |
71 | 73 |
72 typedef struct { | 74 typedef struct { |
73 m68k_debug_handler handler; | 75 m68k_debug_handler handler; |
74 uint32_t address; | 76 uint32_t address; |
104 | 106 |
105 | 107 |
106 void translate_m68k_stream(uint32_t address, m68k_context * context); | 108 void translate_m68k_stream(uint32_t address, m68k_context * context); |
107 void start_68k_context(m68k_context * context, uint32_t address); | 109 void start_68k_context(m68k_context * context, uint32_t address); |
108 void resume_68k(m68k_context *context); | 110 void resume_68k(m68k_context *context); |
109 void init_m68k_opts(m68k_options * opts, memmap_chunk * memmap, uint32_t num_chunks, uint32_t clock_divider); | 111 void init_m68k_opts(m68k_options * opts, memmap_chunk * memmap, uint32_t num_chunks, uint32_t clock_divider, sync_fun sync_components); |
110 m68k_context * init_68k_context(m68k_options * opts, m68k_reset_handler reset_handler); | 112 m68k_context * init_68k_context(m68k_options * opts, m68k_reset_handler reset_handler); |
111 void m68k_reset(m68k_context * context); | 113 void m68k_reset(m68k_context * context); |
112 void m68k_options_free(m68k_options *opts); | 114 void m68k_options_free(m68k_options *opts); |
113 void insert_breakpoint(m68k_context * context, uint32_t address, m68k_debug_handler bp_handler); | 115 void insert_breakpoint(m68k_context * context, uint32_t address, m68k_debug_handler bp_handler); |
114 void remove_breakpoint(m68k_context * context, uint32_t address); | 116 void remove_breakpoint(m68k_context * context, uint32_t address); |