Previous 199869 Revisions Next

r32036 Tuesday 9th September, 2014 at 20:29:57 UTC by Oliver Stöneberg
do not start tagmap lookup counting until everything is initialized / tagmap lookups are now properly shown for each execution when running multiple sets from built-in UI instead of only when exiting MAME completely (nw)
[src/emu]clifront.c machine.c
[src/lib/util]tagmap.c tagmap.h

trunk/src/emu/clifront.c
r32035r32036
292292
293293   _7z_file_cache_clear();
294294
295#ifdef MAME_DEBUG
296   // TODO: this will only be printed when the executable is exited and not when selecting a new set via the internal UI - it needs to be placed somewhere else where it can be printed and reset after each run (check Average Speed location)
297   if (*(m_options.command()) == 0)
298      osd_printf_info("%d tagmap lookups\n", g_tagmap_finds);
299#endif
300
301295   return m_result;
302296}
303297
trunk/src/emu/machine.c
r32035r32036
361361      // perform a soft reset -- this takes us to the running phase
362362      soft_reset();
363363
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
364370      // run the CPUs until a reset or exit
365371      m_hard_reset_pending = false;
366372      while ((!m_hard_reset_pending && !m_exit_pending) || m_saveload_schedule != SLS_NONE)
r32035r32036
430436      error = MAMERR_FATALERROR;
431437   }
432438
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
433448   // make sure our phase is set properly before cleaning up,
434449   // in case we got here via exception
435450   m_current_phase = MACHINE_PHASE_EXIT;
trunk/src/lib/util/tagmap.c
r32035r32036
1212
1313#ifdef MAME_DEBUG
1414INT32 g_tagmap_finds = 0;
15bool g_tagmap_counter_enabled = false;
1516#endif
trunk/src/lib/util/tagmap.h
r32035r32036
3535
3636#ifdef MAME_DEBUG
3737extern INT32 g_tagmap_finds;
38extern bool g_tagmap_counter_enabled;
3839#endif
3940
4041//**************************************************************************
r32035r32036
134135   _ElementType find(const char *tag, UINT32 fullhash) const
135136   {
136137#ifdef MAME_DEBUG
137      atomic_increment32(&g_tagmap_finds);
138      if (g_tagmap_counter_enabled)
139         atomic_increment32(&g_tagmap_finds);
138140#endif
139141      for (entry_t *entry = m_table[fullhash % ARRAY_LENGTH(m_table)]; entry != NULL; entry = entry->next())
140142         if (entry->fullhash() == fullhash && entry->tag() == tag)
r32035r32036
146148   _ElementType find_hash_only(const char *tag) const
147149   {
148150#ifdef MAME_DEBUG
149      atomic_increment32(&g_tagmap_finds);
151      if (g_tagmap_counter_enabled)
152         atomic_increment32(&g_tagmap_finds);
150153#endif
151154      UINT32 fullhash = hash(tag);
152155      for (entry_t *entry = m_table[fullhash % ARRAY_LENGTH(m_table)]; entry != NULL; entry = entry->next())

Previous 199869 Revisions Next


© 1997-2024 The MAME Team