mc6845: screen reconfig callback (nw)

This commit is contained in:
cracyc 2015-10-26 14:37:48 -05:00
parent cd4e564600
commit feee200452
2 changed files with 15 additions and 0 deletions

View File

@ -536,6 +536,9 @@ void mc6845_device::recompute_parameters(bool postload)
if ( m_screen != NULL )
m_screen->configure(horiz_pix_total, vert_pix_total, visarea, refresh);
if(!m_reconfigure_cb.isnull())
m_reconfigure_cb(horiz_pix_total, vert_pix_total, visarea, refresh);
m_has_valid_parameters = true;
}
else
@ -549,6 +552,7 @@ void mc6845_device::recompute_parameters(bool postload)
m_hsync_off_pos = hsync_off_pos;
m_vsync_on_pos = vsync_on_pos;
m_vsync_off_pos = vsync_off_pos;
m_line_counter = 0;
}
}
@ -667,6 +671,7 @@ void mc6845_device::handle_line_timer()
if ( m_line_counter == m_vert_disp )
{
m_line_enable_ff = false;
m_current_disp_addr = m_disp_start_addr;
}
/* Check if VSYNC should be enabled */
@ -1005,6 +1010,7 @@ void mc6845_device::device_start()
m_out_vsync_cb.resolve_safe();
/* bind delegates */
m_reconfigure_cb.bind_relative_to(*owner());
m_begin_update_cb.bind_relative_to(*owner());
m_update_row_cb.bind_relative_to(*owner());
m_end_update_cb.bind_relative_to(*owner());

View File

@ -39,6 +39,9 @@
#define MCFG_MC6845_CHAR_WIDTH(_pixels) \
mc6845_device::set_char_width(*device, _pixels);
#define MCFG_MC6845_RECONFIGURE_CB(_class, _method) \
mc6845_device::set_reconfigure_callback(*device, mc6845_reconfigure_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
#define MCFG_MC6845_BEGIN_UPDATE_CB(_class, _method) \
mc6845_device::set_begin_update_callback(*device, mc6845_begin_update_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
@ -65,6 +68,9 @@
/* callback definitions */
typedef device_delegate<void (int width, int height, const rectangle &visarea, attoseconds_t frame_period)> mc6845_reconfigure_delegate;
#define MC6845_RECONFIGURE(name) void name(int width, int height, const rectangle &visarea, attoseconds_t frame_period)
typedef device_delegate<void (bitmap_rgb32 &bitmap, const rectangle &cliprect)> mc6845_begin_update_delegate;
#define MC6845_BEGIN_UPDATE(name) void name(bitmap_rgb32 &bitmap, const rectangle &cliprect)
@ -110,6 +116,7 @@ public:
}
static void set_char_width(device_t &device, int pixels) { downcast<mc6845_device &>(device).m_hpixels_per_column = pixels; }
static void set_reconfigure_callback(device_t &device, mc6845_reconfigure_delegate callback) { downcast<mc6845_device &>(device).m_reconfigure_cb = callback; }
static void set_begin_update_callback(device_t &device, mc6845_begin_update_delegate callback) { downcast<mc6845_device &>(device).m_begin_update_cb = callback; }
static void set_update_row_callback(device_t &device, mc6845_update_row_delegate callback) { downcast<mc6845_device &>(device).m_update_row_cb = callback; }
static void set_end_update_callback(device_t &device, mc6845_end_update_delegate callback) { downcast<mc6845_device &>(device).m_end_update_cb = callback; }
@ -286,6 +293,8 @@ protected:
int m_hpixels_per_column; /* number of pixels per video memory address */
mc6845_reconfigure_delegate m_reconfigure_cb;
/* if specified, this gets called before any pixel update,
optionally return a pointer that will be passed to the
update and tear down callbacks */