diff options
Diffstat (limited to 'src/mame/machine')
-rw-r--r-- | src/mame/machine/nes.cpp | 13 | ||||
-rw-r--r-- | src/mame/machine/playch10.cpp | 3 | ||||
-rw-r--r-- | src/mame/machine/vsnes.cpp | 3 |
3 files changed, 4 insertions, 15 deletions
diff --git a/src/mame/machine/nes.cpp b/src/mame/machine/nes.cpp index 7b15384293e..d46c0ed286d 100644 --- a/src/mame/machine/nes.cpp +++ b/src/mame/machine/nes.cpp @@ -190,16 +190,3 @@ void nes_state::init_famicom() space.install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(nes_state::fc_in0_w), this)); space.install_read_handler(0x4017, 0x4017, read8_delegate(FUNC(nes_state::fc_in1_r), this)); } - -NESCTRL_BRIGHTPIXEL_CB(nes_state::bright_pixel) -{ - // get the pixel at the gun position - rgb_t pix = m_ppu->get_pixel(x, y); - - // check if the cursor is over a bright pixel - // FIXME: still a gross hack - if (pix.r() == 0xff && pix.b() == 0xff && pix.g() > 0x90) - return true; - else - return false; -} diff --git a/src/mame/machine/playch10.cpp b/src/mame/machine/playch10.cpp index e9fde5b157c..2c2c29a9ec3 100644 --- a/src/mame/machine/playch10.cpp +++ b/src/mame/machine/playch10.cpp @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Ernesto Corvi,Brad Oliver #include "emu.h" +#include "screen.h" #include "includes/playch10.h" #include "machine/nvram.h" @@ -225,7 +226,7 @@ READ8_MEMBER(playch10_state::pc10_in1_r) ret |= 0x08; /* get the pixel at the gun position */ - rgb_t pix = m_ppu->get_pixel(x, y); + rgb_t pix = m_ppu->screen().pixel(x, y); /* look at the screen and see if the cursor is over a bright pixel */ // FIXME: still a gross hack diff --git a/src/mame/machine/vsnes.cpp b/src/mame/machine/vsnes.cpp index d5c1b3c4094..f7595acba77 100644 --- a/src/mame/machine/vsnes.cpp +++ b/src/mame/machine/vsnes.cpp @@ -10,6 +10,7 @@ Nintendo VS UniSystem and DualSystem - (c) 1984 Nintendo of America ***************************************************************************/ #include "emu.h" +#include "screen.h" #include "video/ppu2c0x.h" #include "includes/vsnes.h" @@ -375,7 +376,7 @@ WRITE8_MEMBER(vsnes_state::gun_in0_w) uint8_t realy = (int)y; /* get the pixel at the gun position */ - rgb_t col = m_ppu1->get_pixel(x, realy); + rgb_t col = m_ppu1->screen().pixel(x, realy); uint8_t bright = col.brightness(); // todo, calculate how bright it is with pix.r * 0.3 + pix.g * 0.59 + pix.b * 0.11 ? // the mame calc above is uint8_t brightness() const { return (r() * 222 + g() * 707 + b() * 71) / 1000; } (from lib/util/palette.h) |