diff options
Diffstat (limited to 'src/mame/drivers/roul.cpp')
-rw-r--r-- | src/mame/drivers/roul.cpp | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/src/mame/drivers/roul.cpp b/src/mame/drivers/roul.cpp index 32318e15658..1857d4bb465 100644 --- a/src/mame/drivers/roul.cpp +++ b/src/mame/drivers/roul.cpp @@ -87,13 +87,17 @@ public: void roul(machine_config &config); +protected: + virtual void machine_start() override { m_lamps.resolve(); } + virtual void video_start() override; + private: DECLARE_READ8_MEMBER(blitter_status_r); DECLARE_WRITE8_MEMBER(blitter_cmd_w); DECLARE_WRITE8_MEMBER(sound_latch_w); DECLARE_WRITE8_MEMBER(ball_w); - DECLARE_PALETTE_INIT(roul); + void roul_palette(palette_device &palette) const; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void roul_cpu_io_map(address_map &map); @@ -101,9 +105,6 @@ private: void sound_cpu_io_map(address_map &map); void sound_map(address_map &map); - virtual void machine_start() override { m_lamps.resolve(); } - virtual void video_start() override; - required_device<cpu_device> m_maincpu; required_device<cpu_device> m_soundcpu; required_device<generic_latch_8_device> m_soundlatch; @@ -118,29 +119,29 @@ private: #define VIDEOBUF_SIZE 256*256 -PALETTE_INIT_MEMBER(roul_state, roul) +void roul_state::roul_palette(palette_device &palette) const { - const uint8_t *color_prom = memregion("proms")->base(); - int bit6, bit7, bit0, bit1, r, g, b; - int i; - - for (i = 0; i < 0x20; ++i) + uint8_t const *const color_prom = memregion("proms")->base(); + for (int i = 0; i < 0x20; ++i) { - bit7 = (color_prom[0] >> 7) & 0x01; - bit6 = (color_prom[0] >> 6) & 0x01; - - bit0 = (color_prom[0] >> 0) & 0x01; - bit1 = (color_prom[0] >> 1) & 0x01; - b = 0x0e * bit6 + 0x1f * bit7 + 0x43 * bit0 + 0x8f * bit1; - bit0 = (color_prom[0] >> 2) & 0x01; - bit1 = (color_prom[0] >> 3) & 0x01; - g = 0x0e * bit6 + 0x1f * bit7 + 0x43 * bit0 + 0x8f * bit1; - bit0 = (color_prom[0] >> 4) & 0x01; - bit1 = (color_prom[0] >> 5) & 0x01; - r = 0x0e * bit6 + 0x1f * bit7 + 0x43 * bit0 + 0x8f * bit1; + int bit0, bit1; + + int const bit7 = BIT(color_prom[i], 7); + int const bit6 = BIT(color_prom[i], 6); + + bit0 = BIT(color_prom[i], 0); + bit1 = BIT(color_prom[i], 1); + int const b = 0x0e * bit6 + 0x1f * bit7 + 0x43 * bit0 + 0x8f * bit1; + + bit0 = BIT(color_prom[i], 2); + bit1 = BIT(color_prom[i], 3); + int const g = 0x0e * bit6 + 0x1f * bit7 + 0x43 * bit0 + 0x8f * bit1; + + bit0 = BIT(color_prom[i], 4); + bit1 = BIT(color_prom[i], 5); + int const r = 0x0e * bit6 + 0x1f * bit7 + 0x43 * bit0 + 0x8f * bit1; palette.set_pen_color(i, rgb_t(r, g, b)); - color_prom++; } } @@ -323,7 +324,6 @@ MACHINE_CONFIG_START(roul_state::roul) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -334,8 +334,7 @@ MACHINE_CONFIG_START(roul_state::roul) MCFG_SCREEN_PALETTE("palette") MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) - MCFG_PALETTE_ADD("palette", 0x100) - MCFG_PALETTE_INIT_OWNER(roul_state, roul) + PALETTE(config, "palette", FUNC(roul_state::roul_palette), 0x100); SPEAKER(config, "mono").front_center(); |