diff --git a/makefile b/makefile index 22731329c50..6a8b34a944d 100644 --- a/makefile +++ b/makefile @@ -184,6 +184,9 @@ endif # uncomment next line to build a debug version # DEBUG = 1 +# uncomment next line to disable some debug-related hotspots/slowdowns (e.g. for profiling) +# FASTDEBUG = 1 + # uncomment next line to include the internal profiler # PROFILER = 1 @@ -443,6 +446,9 @@ ifneq ($(BUILD_JPEGLIB),1) DEFS += -DUSE_SYSTEM_JPEGLIB endif +ifdef FASTDEBUG +DEFS += -DMAME_DEBUG_FAST +endif #------------------------------------------------- diff --git a/src/emu/emucore.h b/src/emu/emucore.h index 8a5f71c7313..7c5f2343a0e 100644 --- a/src/emu/emucore.h +++ b/src/emu/emucore.h @@ -357,7 +357,7 @@ void report_bad_device_cast(const device_t *dev, const std::type_info &src_type, template inline _Dest downcast(_Source *src) { -#ifdef MAME_DEBUG +#if defined(MAME_DEBUG) && !defined(MAME_DEBUG_FAST) try { if (dynamic_cast<_Dest>(src) != src) { @@ -378,7 +378,7 @@ inline _Dest downcast(_Source *src) template inline _Dest downcast(_Source &src) { -#ifdef MAME_DEBUG +#if defined(MAME_DEBUG) && !defined(MAME_DEBUG_FAST) try { if (&dynamic_cast<_Dest>(src) != &src) { diff --git a/src/emu/schedule.c b/src/emu/schedule.c index cd34a0b7700..5781db2caf9 100644 --- a/src/emu/schedule.c +++ b/src/emu/schedule.c @@ -480,7 +480,9 @@ void device_scheduler::timeslice() attoseconds_t delta = target.attoseconds - exec->m_localtime.attoseconds; if (delta < 0 && target.seconds > exec->m_localtime.seconds) delta += ATTOSECONDS_PER_SECOND; +#ifndef MAME_DEBUG_FAST assert(delta == (target - exec->m_localtime).as_attoseconds()); +#endif // if we have enough for at least 1 cycle, do the math if (delta >= exec->m_attoseconds_per_cycle) diff --git a/src/osd/windows/windows.mak b/src/osd/windows/windows.mak index 1c3b0b77596..efe4c567b1b 100644 --- a/src/osd/windows/windows.mak +++ b/src/osd/windows/windows.mak @@ -144,7 +144,12 @@ endif # enable basic run-time checks in non-optimized build ifeq ($(OPTIMIZE),0) +ifndef FASTDEBUG CCOMFLAGS += /RTC1 +else +# disable the stack check since it has quite a speed impact +CCOMFLAGS += /RTCu +endif endif ifdef MSVC_ANALYSIS