diff options
Diffstat (limited to 'src/devices/video/vector.cpp')
| -rw-r--r-- | src/devices/video/vector.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/devices/video/vector.cpp b/src/devices/video/vector.cpp index aa0210eda28..9c0bb682d32 100644 --- a/src/devices/video/vector.cpp +++ b/src/devices/video/vector.cpp @@ -60,6 +60,10 @@ float vector_options::s_beam_width_max = 0.0f; float vector_options::s_beam_dot_size = 0.0f; float vector_options::s_beam_intensity_weight = 0.0f; +namespace { + vector_device::hook_callback s_hook_callback; +} + void vector_options::init(emu_options& options) { s_beam_width_min = options.beam_width_min(); @@ -147,6 +151,11 @@ void vector_device::clear_list(void) m_vector_index = 0; } +void vector_device::set_hook_callback(hook_callback callback) +{ + s_hook_callback = std::move(callback); +} + uint32_t vector_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { @@ -166,6 +175,12 @@ uint32_t vector_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma screen.container().empty(); screen.container().add_rect(0.0f, 0.0f, 1.0f, 1.0f, rgb_t(0xff,0x00,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_VECTORBUF(1)); + if (s_hook_callback) + { + hook_data begin = { hook_event::FRAME_BEGIN, 0, 0, 0, 0, rgb_t(0xff, 0x00, 0x00, 0x00), 0, visarea.width(), visarea.height() }; + s_hook_callback(machine(), begin); + } + for (int i = 0; i < m_vector_index; i++) { render_bounds coords; @@ -199,11 +214,34 @@ uint32_t vector_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma flags); } + if (s_hook_callback) + { + hook_data point_data = + { + (curpoint->intensity != 0) ? hook_event::LINE_TO : hook_event::MOVE_TO, + lastx, + lasty, + curpoint->x, + curpoint->y, + curpoint->col, + curpoint->intensity, + visarea.width(), + visarea.height() + }; + s_hook_callback(machine(), point_data); + } + lastx = curpoint->x; lasty = curpoint->y; curpoint++; } + if (s_hook_callback) + { + hook_data end = { hook_event::FRAME_END, 0, 0, 0, 0, rgb_t(0xff, 0x00, 0x00, 0x00), 0, visarea.width(), visarea.height() }; + s_hook_callback(machine(), end); + } + return 0; } |
