Previous 199869 Revisions Next

r26074 Saturday 9th November, 2013 at 16:57:12 UTC by Jürgen Buchmüller
Keep track of LOG newline status for type name printing.
[/branches/alto2/src/emu/cpu/alto2]alto2.c alto2.h

branches/alto2/src/emu/cpu/alto2/alto2.c
r26073r26074
3030#if   ALTO2_DEBUG
3131   m_log_types(LOG_ALL),
3232   m_log_level(9),
33   m_log_newline(false),
3334#endif
3435   m_ucode_config("program", ENDIANNESS_BIG, 32, 14, -2),
3536   m_const_config("constants", ENDIANNESS_BIG, 16, 8, -1),
r26073r26074
749750      return;
750751   if (level > m_log_level)
751752      return;
752   for (int i = 0; i < sizeof(type_name)/sizeof(type_name[0]); i++)
753      if (type & (1 << i))
754         debug_console_printf(machine(), "%-7s ", type_name[i]);
753   if (m_log_newline) {
754      // last line had a \n - print type name
755      for (int i = 0; i < sizeof(type_name)/sizeof(type_name[0]); i++)
756         if (type & (1 << i))
757            debug_console_printf(machine(), "%-7s ", type_name[i]);
758   }
755759   va_list ap;
756760   va_start(ap, format);
757761   debug_console_vprintf(machine(), format, ap);
758762   va_end(ap);
763   m_log_newline = format[strlen(format) - 1] == '\n';
759764}
760765#endif
761766
branches/alto2/src/emu/cpu/alto2/alto2.h
r26073r26074
274274   };
275275   int m_log_types;
276276   int m_log_level;
277   bool m_log_newline;
277278   void logprintf(int type, int level, const char* format, ...);
278279#   define   LOG(x) logprintf x
279280#else

Previous 199869 Revisions Next


© 1997-2024 The MAME Team