apollo_kbd.cpp: Eliminate firstcpu usage (nw)

This commit is contained in:
AJR 2018-01-04 20:46:43 -05:00
parent 670a046319
commit be48503e92
2 changed files with 3 additions and 16 deletions

View File

@ -266,26 +266,13 @@ void apollo_kbd_device::device_reset()
cpu_context - return a string describing the current CPU context
***************************************************************************/
const char *apollo_kbd_device::cpu_context()
std::string apollo_kbd_device::cpu_context() const
{
static char statebuf[64]; /* string buffer containing state description */
device_t *cpu = machine().firstcpu;
osd_ticks_t t = osd_ticks();
int s = (t / osd_ticks_per_second()) % 3600;
int ms = (t / (osd_ticks_per_second() / 1000)) % 1000;
/* if we have an executing CPU, output data */
if (cpu != nullptr)
{
sprintf(statebuf, "%d.%03d %s pc=%08x - %s", s, ms, cpu->tag(),
cpu->safe_pcbase(), tag());
}
else
{
sprintf(statebuf, "%d.%03d", s, ms);
}
return statebuf;
return string_format("%d.%03d %s", s, ms, machine().describe_context());
}
//**************************************************************************

View File

@ -65,7 +65,7 @@ private:
TIMER_CALLBACK_MEMBER( kbd_scan_timer );
const char *cpu_context() ;
std::string cpu_context() const;
template <typename Format, typename... Params>
void logerror(Format &&fmt, Params &&... args) const;