trunk/src/emu/machine.c
| r32035 | r32036 | |
| 361 | 361 | // perform a soft reset -- this takes us to the running phase |
| 362 | 362 | soft_reset(); |
| 363 | 363 | |
| 364 | #ifdef MAME_DEBUG |
| 365 | g_tagmap_finds = 0; |
| 366 | if (strcmp(config().m_gamedrv.name, "___empty") != 0) |
| 367 | g_tagmap_counter_enabled = true; |
| 368 | #endif |
| 369 | |
| 364 | 370 | // run the CPUs until a reset or exit |
| 365 | 371 | m_hard_reset_pending = false; |
| 366 | 372 | while ((!m_hard_reset_pending && !m_exit_pending) || m_saveload_schedule != SLS_NONE) |
| r32035 | r32036 | |
| 430 | 436 | error = MAMERR_FATALERROR; |
| 431 | 437 | } |
| 432 | 438 | |
| 439 | #ifdef MAME_DEBUG |
| 440 | if (g_tagmap_counter_enabled) |
| 441 | { |
| 442 | g_tagmap_counter_enabled = false; |
| 443 | if (*(options().command()) == 0) |
| 444 | osd_printf_info("%d tagmap lookups\n", g_tagmap_finds); |
| 445 | } |
| 446 | #endif |
| 447 | |
| 433 | 448 | // make sure our phase is set properly before cleaning up, |
| 434 | 449 | // in case we got here via exception |
| 435 | 450 | m_current_phase = MACHINE_PHASE_EXIT; |
trunk/src/lib/util/tagmap.h
| r32035 | r32036 | |
| 35 | 35 | |
| 36 | 36 | #ifdef MAME_DEBUG |
| 37 | 37 | extern INT32 g_tagmap_finds; |
| 38 | extern bool g_tagmap_counter_enabled; |
| 38 | 39 | #endif |
| 39 | 40 | |
| 40 | 41 | //************************************************************************** |
| r32035 | r32036 | |
| 134 | 135 | _ElementType find(const char *tag, UINT32 fullhash) const |
| 135 | 136 | { |
| 136 | 137 | #ifdef MAME_DEBUG |
| 137 | | atomic_increment32(&g_tagmap_finds); |
| 138 | if (g_tagmap_counter_enabled) |
| 139 | atomic_increment32(&g_tagmap_finds); |
| 138 | 140 | #endif |
| 139 | 141 | for (entry_t *entry = m_table[fullhash % ARRAY_LENGTH(m_table)]; entry != NULL; entry = entry->next()) |
| 140 | 142 | if (entry->fullhash() == fullhash && entry->tag() == tag) |
| r32035 | r32036 | |
| 146 | 148 | _ElementType find_hash_only(const char *tag) const |
| 147 | 149 | { |
| 148 | 150 | #ifdef MAME_DEBUG |
| 149 | | atomic_increment32(&g_tagmap_finds); |
| 151 | if (g_tagmap_counter_enabled) |
| 152 | atomic_increment32(&g_tagmap_finds); |
| 150 | 153 | #endif |
| 151 | 154 | UINT32 fullhash = hash(tag); |
| 152 | 155 | for (entry_t *entry = m_table[fullhash % ARRAY_LENGTH(m_table)]; entry != NULL; entry = entry->next()) |