diff options
Diffstat (limited to 'src/mame/drivers/cntsteer.cpp')
-rw-r--r-- | src/mame/drivers/cntsteer.cpp | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/mame/drivers/cntsteer.cpp b/src/mame/drivers/cntsteer.cpp index d65e10d470a..5e79d57521d 100644 --- a/src/mame/drivers/cntsteer.cpp +++ b/src/mame/drivers/cntsteer.cpp @@ -114,7 +114,7 @@ public: DECLARE_MACHINE_START(zerotrgt); DECLARE_MACHINE_RESET(zerotrgt); DECLARE_VIDEO_START(zerotrgt); - DECLARE_PALETTE_INIT(zerotrgt); + void zerotrgt_palette(palette_device &palette) const; uint32_t screen_update_cntsteer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_zerotrgt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(subcpu_vblank_irq); @@ -132,31 +132,30 @@ public: }; -PALETTE_INIT_MEMBER(cntsteer_state,zerotrgt) +void cntsteer_state::zerotrgt_palette(palette_device &palette) const { const uint8_t *color_prom = memregion("proms")->base(); - int i; - for (i = 0; i < palette.entries(); i++) + for (int i = 0; i < palette.entries(); i++) { - int bit0, bit1, bit2, r, g, b; + int bit0, bit1, bit2; - /* red component */ + // red component bit0 = (color_prom[i] >> 0) & 0x01; bit1 = (color_prom[i] >> 1) & 0x01; bit2 = (color_prom[i] >> 2) & 0x01; - g = (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2); - /* green component */ + int const g = (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2); + // green component bit0 = (color_prom[i] >> 4) & 0x01; bit1 = (color_prom[i] >> 5) & 0x01; bit2 = (color_prom[i] >> 6) & 0x01; - r = (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2); - /* blue component */ + int const r = (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2); + // blue component bit0 = (color_prom[i + 256] >> 0) & 0x01; bit1 = (color_prom[i + 256] >> 1) & 0x01; bit2 = (color_prom[i + 256] >> 2) & 0x01; - b = (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2); + int const b = (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2); - palette.set_pen_color(i, rgb_t(r,g,b)); + palette.set_pen_color(i, rgb_t(r, g, b)); } } @@ -951,8 +950,8 @@ MACHINE_CONFIG_START(cntsteer_state::cntsteer) MCFG_QUANTUM_PERFECT_CPU("maincpu") MCFG_QUANTUM_PERFECT_CPU("subcpu") - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_cntsteer) - MCFG_PALETTE_ADD("palette", 256) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_cntsteer); + PALETTE(config, m_palette).set_entries(256); // MCFG_PALETTE_INIT_OWNER(cntsteer_state,zerotrgt) MCFG_VIDEO_START_OVERRIDE(cntsteer_state,cntsteer) @@ -998,13 +997,12 @@ MACHINE_CONFIG_START(cntsteer_state::zerotrgt) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) MCFG_SCREEN_UPDATE_DRIVER(cntsteer_state, screen_update_zerotrgt) - MCFG_SCREEN_PALETTE("palette") + MCFG_SCREEN_PALETTE(m_palette) MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) // ? - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_zerotrgt) - MCFG_PALETTE_ADD("palette", 256) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_zerotrgt); + PALETTE(config, m_palette, FUNC(cntsteer_state::zerotrgt_palette), 256); - MCFG_PALETTE_INIT_OWNER(cntsteer_state,zerotrgt) MCFG_VIDEO_START_OVERRIDE(cntsteer_state,zerotrgt) /* sound hardware */ |