trunk/src/emu/cpu/arm7/arm7drc.inc
r241784 | r241785 | |
41 | 41 | DEBUGGING |
42 | 42 | ***************************************************************************/ |
43 | 43 | |
44 | | #define LOG_NATIVE (0) |
45 | | |
46 | 44 | #define SINGLE_INSTRUCTION_MODE (0) |
47 | 45 | |
48 | 46 | /*************************************************************************** |
r241784 | r241785 | |
153 | 151 | m_impstate.cache = cache; |
154 | 152 | |
155 | 153 | /* initialize the UML generator */ |
156 | | if (LOG_NATIVE) |
157 | | flags |= DRCUML_OPTION_LOG_NATIVE; |
158 | 154 | m_impstate.drcuml = new drcuml_state(*this, *cache, flags, 1, 32, 1); |
159 | 155 | |
160 | 156 | /* add symbols for our stuff */ |
r241784 | r241785 | |
352 | 348 | /* get a description of this sequence */ |
353 | 349 | // TODO FIXME |
354 | 350 | const opcode_desc *desclist = NULL; //m_impstate.drcfe->describe_code(pc); // TODO |
355 | | // if (drcuml->logging() || LOG_NATIVE) |
| 351 | // if (drcuml->logging() || drcuml->logging_native()) |
356 | 352 | // log_opcode_desc(drcuml, desclist, 0); |
357 | 353 | |
358 | 354 | /* if we get an error back, flush the cache and try again */ |
trunk/src/emu/cpu/drcuml.h
r241784 | r241785 | |
22 | 22 | //************************************************************************** |
23 | 23 | |
24 | 24 | // these options are passed into drcuml_alloc() and control global behaviors |
25 | | const UINT32 DRCUML_OPTION_LOG_NATIVE = 0x0004; // tell the back-end to generate a native disassembly of each block |
26 | 25 | |
27 | 26 | |
28 | 27 | |
r241784 | r241785 | |
148 | 147 | virtual void generate(drcuml_block &block, const uml::instruction *instlist, UINT32 numinst) = 0; |
149 | 148 | virtual bool hash_exists(UINT32 mode, UINT32 pc) = 0; |
150 | 149 | virtual void get_info(drcbe_info &info) = 0; |
| 150 | virtual bool logging() const { return false; } |
151 | 151 | |
152 | 152 | protected: |
153 | 153 | // internal state |
r241784 | r241785 | |
195 | 195 | bool logging() const { return (m_umllog != NULL); } |
196 | 196 | void log_printf(const char *format, ...) ATTR_PRINTF(2,3); |
197 | 197 | void log_flush() { if (logging()) fflush(m_umllog); } |
| 198 | bool logging_native() const { return m_beintf.logging(); } |
198 | 199 | |
199 | 200 | private: |
200 | 201 | // symbol class |
trunk/src/emu/cpu/mips/mips3drc.c
r241784 | r241785 | |
275 | 275 | |
276 | 276 | /* get a description of this sequence */ |
277 | 277 | desclist = m_drcfe->describe_code(pc); |
278 | | if (drcuml->logging() || LOG_NATIVE) |
| 278 | if (drcuml->logging() || drcuml->logging_native()) |
279 | 279 | log_opcode_desc(drcuml, desclist, 0); |
280 | 280 | |
281 | 281 | /* if we get an error back, flush the cache and try again */ |
r241784 | r241785 | |
3264 | 3264 | char buffer[100]; |
3265 | 3265 | |
3266 | 3266 | /* disassemle the current instruction and output it to the log */ |
3267 | | if (drcuml->logging() || LOG_NATIVE) |
| 3267 | if (drcuml->logging() || drcuml->logging_native()) |
3268 | 3268 | { |
3269 | 3269 | if (desclist->flags & OPFLAG_VIRTUAL_NOOP) |
3270 | 3270 | strcpy(buffer, "<virtual nop>"); |
trunk/src/emu/cpu/powerpc/ppcdrc.c
r241784 | r241785 | |
368 | 368 | |
369 | 369 | /* get a description of this sequence */ |
370 | 370 | desclist = m_drcfe->describe_code(pc); |
371 | | if (m_drcuml->logging() || LOG_NATIVE) |
| 371 | if (m_drcuml->logging() || m_drcuml->logging_native()) |
372 | 372 | log_opcode_desc(m_drcuml, desclist, 0); |
373 | 373 | |
374 | 374 | bool succeeded = false; |
r241784 | r241785 | |
3895 | 3895 | char buffer[100]; |
3896 | 3896 | |
3897 | 3897 | /* disassemle the current instruction and output it to the log */ |
3898 | | if (drcuml->logging() || LOG_NATIVE) |
| 3898 | if (drcuml->logging() || drcuml->logging_native()) |
3899 | 3899 | { |
3900 | 3900 | if (desclist->flags & OPFLAG_VIRTUAL_NOOP) |
3901 | 3901 | strcpy(buffer, "<virtual nop>"); |
trunk/src/emu/cpu/rsp/rsp.c
r241784 | r241785 | |
121 | 121 | , m_program_config("program", ENDIANNESS_BIG, 32, 32) |
122 | 122 | , m_cache(CACHE_SIZE + sizeof(internal_rsp_state)) |
123 | 123 | , m_drcuml(NULL) |
124 | | // , m_drcuml(*this, m_cache, ( RSP_LOG_NATIVE ? DRCUML_OPTION_LOG_NATIVE : 0 ), 8, 32, 2) |
| 124 | // , m_drcuml(*this, m_cache, 0, 8, 32, 2) |
125 | 125 | , m_drcfe(NULL) |
126 | 126 | , m_drcoptions(0) |
127 | 127 | , m_cache_dirty(TRUE) |
r241784 | r241785 | |
432 | 432 | |
433 | 433 | /* initialize the UML generator */ |
434 | 434 | UINT32 drc_flags = 0; |
435 | | if (RSP_LOG_NATIVE) |
436 | | { |
437 | | drc_flags |= DRCUML_OPTION_LOG_NATIVE; |
438 | | } |
439 | 435 | m_drcuml = auto_alloc(machine(), drcuml_state(*this, m_cache, drc_flags, 8, 32, 2)); |
440 | 436 | |
441 | 437 | /* add symbols for our stuff */ |
trunk/src/emu/cpu/sh2/sh2.c
r241784 | r241785 | |
115 | 115 | DEBUGGING |
116 | 116 | ***************************************************************************/ |
117 | 117 | |
118 | | #define LOG_NATIVE (0) // log native assembly |
119 | | |
120 | 118 | #define DISABLE_FAST_REGISTERS (0) // set to 1 to turn off usage of register caching |
121 | 119 | #define SINGLE_INSTRUCTION_MODE (0) |
122 | 120 | |
r241784 | r241785 | |
169 | 167 | , m_cpu_type(CPU_TYPE_SH2) |
170 | 168 | , m_cache(CACHE_SIZE + sizeof(internal_sh2_state)) |
171 | 169 | , m_drcuml(NULL) |
172 | | // , m_drcuml(*this, m_cache, ( LOG_NATIVE ? DRCUML_OPTION_LOG_NATIVE : 0 ), 1, 32, 1) |
| 170 | // , m_drcuml(*this, m_cache, 0, 1, 32, 1) |
173 | 171 | , m_drcfe(NULL) |
174 | 172 | , m_drcoptions(0) |
175 | 173 | , m_sh2_state(NULL) |
r241784 | r241785 | |
206 | 204 | , m_cpu_type(cpu_type) |
207 | 205 | , m_cache(CACHE_SIZE + sizeof(internal_sh2_state)) |
208 | 206 | , m_drcuml(NULL) |
209 | | // , m_drcuml(*this, m_cache, ( LOG_NATIVE ? DRCUML_OPTION_LOG_NATIVE : 0 ), 1, 32, 1) |
| 207 | // , m_drcuml(*this, m_cache, 0, 1, 32, 1) |
210 | 208 | , m_drcfe(NULL) |
211 | 209 | , m_drcoptions(0) |
212 | 210 | , m_sh2_state(NULL) |
r241784 | r241785 | |
2560 | 2558 | |
2561 | 2559 | /* initialize the UML generator */ |
2562 | 2560 | UINT32 flags = 0; |
2563 | | if (LOG_NATIVE) |
2564 | | flags |= DRCUML_OPTION_LOG_NATIVE; |
2565 | 2561 | m_drcuml = auto_alloc(machine(), drcuml_state(*this, m_cache, flags, 1, 32, 1)); |
2566 | 2562 | |
2567 | 2563 | /* add symbols for our stuff */ |
trunk/src/emu/cpu/sh2/sh2drc.c
r241784 | r241785 | |
675 | 675 | |
676 | 676 | /* get a description of this sequence */ |
677 | 677 | desclist = m_drcfe->describe_code(pc); |
678 | | if (drcuml->logging() || LOG_NATIVE) |
| 678 | if (drcuml->logging() || drcuml->logging_native()) |
679 | 679 | log_opcode_desc(drcuml, desclist, 0); |
680 | 680 | |
681 | 681 | bool succeeded = false; |
r241784 | r241785 | |
1174 | 1174 | char buffer[100]; |
1175 | 1175 | |
1176 | 1176 | /* disassemle the current instruction and output it to the log */ |
1177 | | if (drcuml->logging() || LOG_NATIVE) |
| 1177 | if (drcuml->logging() || drcuml->logging_native()) |
1178 | 1178 | { |
1179 | 1179 | if (desclist->flags & OPFLAG_VIRTUAL_NOOP) |
1180 | 1180 | strcpy(buffer, "<virtual nop>"); |
trunk/src/emu/emuopts.c
r241784 | r241785 | |
158 | 158 | { OPTION_DRC, "1", OPTION_BOOLEAN, "enable DRC cpu core if available" }, |
159 | 159 | { OPTION_DRC_USE_C, "0", OPTION_BOOLEAN, "force DRC use C backend" }, |
160 | 160 | { OPTION_DRC_LOG_UML, "0", OPTION_BOOLEAN, "write DRC UML disassembly log" }, |
| 161 | { OPTION_DRC_LOG_NATIVE, "0", OPTION_BOOLEAN, "write DRC native disassembly log" }, |
161 | 162 | { OPTION_BIOS, NULL, OPTION_STRING, "select the system BIOS to use" }, |
162 | 163 | { OPTION_CHEAT ";c", "0", OPTION_BOOLEAN, "enable cheat subsystem" }, |
163 | 164 | { OPTION_SKIP_GAMEINFO, "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" }, |
trunk/src/emu/emuopts.h
r241784 | r241785 | |
161 | 161 | #define OPTION_DRC "drc" |
162 | 162 | #define OPTION_DRC_USE_C "drc_use_c" |
163 | 163 | #define OPTION_DRC_LOG_UML "drc_log_uml" |
| 164 | #define OPTION_DRC_LOG_NATIVE "drc_log_native" |
164 | 165 | #define OPTION_BIOS "bios" |
165 | 166 | #define OPTION_CHEAT "cheat" |
166 | 167 | #define OPTION_SKIP_GAMEINFO "skip_gameinfo" |
r241784 | r241785 | |
322 | 323 | bool drc() const { return bool_value(OPTION_DRC); } |
323 | 324 | bool drc_use_c() const { return bool_value(OPTION_DRC_USE_C); } |
324 | 325 | bool drc_log_uml() const { return bool_value(OPTION_DRC_LOG_UML); } |
| 326 | bool drc_log_native() const { return bool_value(OPTION_DRC_LOG_NATIVE); } |
325 | 327 | const char *bios() const { return value(OPTION_BIOS); } |
326 | 328 | bool cheat() const { return bool_value(OPTION_CHEAT); } |
327 | 329 | bool skip_gameinfo() const { return bool_value(OPTION_SKIP_GAMEINFO); } |