diff --git a/src/emu/drawgfxm.h b/src/emu/drawgfxm.h index 8f79412527e..e95fcc800e0 100644 --- a/src/emu/drawgfxm.h +++ b/src/emu/drawgfxm.h @@ -701,7 +701,10 @@ do { \ /* compute final pixel in Y and exit if we are entirely clipped */ \ destendy = desty + dstheight - 1; \ if (desty > cliprect->max_y || destendy < cliprect->min_y) \ + { \ + profiler_mark_end(); \ return; \ + } \ \ /* apply top clip */ \ srcy = 0; \ diff --git a/src/emu/profiler.c b/src/emu/profiler.c index a4f6fb9c45c..a54867e547f 100644 --- a/src/emu/profiler.c +++ b/src/emu/profiler.c @@ -62,7 +62,7 @@ void _profiler_mark_start(int type) /* fail if we overflow */ if (index > ARRAY_LENGTH(global_profiler.filo)) - fatalerror("Profiler FILO overflow\n"); + fatalerror("Profiler FILO overflow (type = %d)\n", type); /* if we're nested, stop the previous entry */ if (index > 0) @@ -162,7 +162,7 @@ astring *_profiler_get_text(running_machine *machine, astring *string) total = computed; astring_reset(string); if (total == 0 || normalize == 0) - return string; + goto out; /* loop over all types and generate the string */ for (curtype = 0; curtype < PROFILER_TOTAL; curtype++) @@ -209,8 +209,6 @@ astring *_profiler_get_text(running_machine *machine, astring *string) astring_catprintf(string, "%d CPU switches\n", switches / (int) ARRAY_LENGTH(global_profiler.data)); } - profiler_mark_end(); - /* advance to the next dataset and reset it to 0 */ global_profiler.dataindex = (global_profiler.dataindex + 1) % ARRAY_LENGTH(global_profiler.data); memset(&global_profiler.data[global_profiler.dataindex], 0, sizeof(global_profiler.data[global_profiler.dataindex])); @@ -219,5 +217,8 @@ astring *_profiler_get_text(running_machine *machine, astring *string) if (global_profiler.dataindex == 0) global_profiler.dataready = TRUE; +out: + profiler_mark_end(); + return string; } diff --git a/src/mame/video/taito_b.c b/src/mame/video/taito_b.c index 671b4be27f2..f57cda4cb46 100644 --- a/src/mame/video/taito_b.c +++ b/src/mame/video/taito_b.c @@ -503,7 +503,11 @@ profiler_mark_start(PROFILER_USER1); if (video_control & 0x08) { - if (priority) return; + if (priority) + { + profiler_mark_end(); + return; + } if (video_control & 0x10) /*flip screen*/ {