summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/huc6260.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/video/huc6260.cpp')
-rw-r--r--src/devices/video/huc6260.cpp35
1 files changed, 13 insertions, 22 deletions
diff --git a/src/devices/video/huc6260.cpp b/src/devices/video/huc6260.cpp
index 08ca9abc5d9..68078052ebc 100644
--- a/src/devices/video/huc6260.cpp
+++ b/src/devices/video/huc6260.cpp
@@ -51,19 +51,19 @@ void huc6260_device::palette_init()
DEFINE_DEVICE_TYPE(HUC6260, huc6260_device, "huc6260", "Hudson HuC6260 VCE")
-huc6260_device::huc6260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, HUC6260, tag, owner, clock),
- device_palette_interface(mconfig, *this),
- device_video_interface(mconfig, *this),
- m_next_pixel_data_cb(*this),
- m_time_til_next_event_cb(*this),
- m_vsync_changed_cb(*this),
- m_hsync_changed_cb(*this)
+huc6260_device::huc6260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, HUC6260, tag, owner, clock),
+ device_palette_interface(mconfig, *this),
+ device_video_interface(mconfig, *this),
+ m_next_pixel_data_cb(*this, 0),
+ m_time_til_next_event_cb(*this, 1),
+ m_vsync_changed_cb(*this),
+ m_hsync_changed_cb(*this)
{
}
-void huc6260_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(huc6260_device::update_events)
{
int vpos = screen().vpos();
int hpos = screen().hpos();
@@ -75,10 +75,9 @@ void huc6260_device::device_timer(emu_timer &timer, device_timer_id id, int para
{
if ( m_pixel_clock == 0 )
{
- g_profiler.start( PROFILER_VIDEO );
+ auto profile = g_profiler.start(PROFILER_VIDEO);
/* Get next pixel information */
m_pixel_data = m_next_pixel_data_cb();
- g_profiler.stop();
}
bitmap_line[ h ] = m_palette[ m_pixel_data ] | m_greyscales;
@@ -255,20 +254,12 @@ void huc6260_device::write(offs_t offset, uint8_t data)
void huc6260_device::device_start()
{
- m_timer = timer_alloc();
+ m_timer = timer_alloc(FUNC(huc6260_device::update_events), this);
m_bmp = std::make_unique<bitmap_ind16>(WPF, LPF);
- /* Resolve callbacks */
- m_hsync_changed_cb.resolve();
- m_vsync_changed_cb.resolve();
- m_next_pixel_data_cb.resolve();
- m_time_til_next_event_cb.resolve();
-
/* We want to have a valid screen and valid callbacks */
- assert( ! m_hsync_changed_cb.isnull() );
- assert( ! m_vsync_changed_cb.isnull() );
- assert( ! m_next_pixel_data_cb.isnull() );
- assert( ! m_time_til_next_event_cb.isnull() );
+ assert(!m_next_pixel_data_cb.isunset());
+ assert(!m_time_til_next_event_cb.isunset());
palette_init();