blob: c5c9756831322d9e60e05ba05d896cc0025ddfcd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
/***************************************************************************
device.h
Device interface functions.
***************************************************************************/
#pragma once
#ifndef __EMU_H__
#error Dont include this file directly; include emu.h instead.
#endif
#ifndef __DEVICE_IPP__
#define __DEVICE_IPP__
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
typedef device_delegate<void (u32)> clock_update_delegate;
//**************************************************************************
// MEMBER TEMPLATES
//**************************************************************************
template <typename Format, typename... Params>
inline void device_t::popmessage(Format &&fmt, Params &&... args) const
{
if (m_machine != nullptr)
m_machine->popmessage(std::forward<Format>(fmt), std::forward<Params>(args)...);
}
template <typename Format, typename... Params>
inline void device_t::logerror(Format &&fmt, Params &&... args) const
{
if (m_machine != nullptr && m_machine->allow_logging())
{
g_profiler.start(PROFILER_LOGERROR);
// dump to the buffer
m_string_buffer.clear();
m_string_buffer.seekp(0);
util::stream_format(m_string_buffer, "[%s] ", tag());
util::stream_format(m_string_buffer, std::forward<Format>(fmt), std::forward<Params>(args)...);
m_string_buffer.put('\0');
m_machine->strlog(&m_string_buffer.vec()[0]);
g_profiler.stop();
}
}
#endif // __DEVICE_IPP__
|