diff options
Diffstat (limited to 'src/devices/bus')
-rw-r--r-- | src/devices/bus/nes_ctrl/zapper.cpp | 14 | ||||
-rw-r--r-- | src/devices/bus/sms_ctrl/lphaser.cpp | 1 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/devices/bus/nes_ctrl/zapper.cpp b/src/devices/bus/nes_ctrl/zapper.cpp index 195ed891300..746246a8c76 100644 --- a/src/devices/bus/nes_ctrl/zapper.cpp +++ b/src/devices/bus/nes_ctrl/zapper.cpp @@ -82,9 +82,21 @@ void nes_zapper_device::device_reset() uint8_t nes_zapper_device::read_bit34() { uint8_t ret = m_trigger->read(); + int x = m_lightx->read(); + int y = m_lighty->read(); + + // update the screen if necessary + if (!screen().vblank()) + { + int vpos = screen().vpos(); + int hpos = screen().hpos(); + + if (vpos > y || (vpos == y && hpos >= x)) + screen().update_now(); + } // get the pixel at the gun position - rgb_t pix = screen().pixel(m_lightx->read(), m_lighty->read()); + rgb_t pix = screen().pixel(x, y); // check if the cursor is over a bright pixel // FIXME: still a gross hack diff --git a/src/devices/bus/sms_ctrl/lphaser.cpp b/src/devices/bus/sms_ctrl/lphaser.cpp index a728930f50e..261f6b13504 100644 --- a/src/devices/bus/sms_ctrl/lphaser.cpp +++ b/src/devices/bus/sms_ctrl/lphaser.cpp @@ -231,6 +231,7 @@ int sms_light_phaser_device::bright_aim_area( emu_timer *timer, int lgun_x, int /* brightness of the lightgray color in the frame drawn by Light Phaser games */ const uint8_t sensor_min_brightness = 0x7f; + screen().update_now(); color = screen().pixel(beam_x, beam_y); /* reference: http://www.w3.org/TR/AERT#color-contrast */ |