diff options
Diffstat (limited to 'src/mame/drivers/m63.cpp')
-rw-r--r-- | src/mame/drivers/m63.cpp | 102 |
1 files changed, 49 insertions, 53 deletions
diff --git a/src/mame/drivers/m63.cpp b/src/mame/drivers/m63.cpp index 6da1e777bd0..6c2016619e8 100644 --- a/src/mame/drivers/m63.cpp +++ b/src/mame/drivers/m63.cpp @@ -131,8 +131,8 @@ Dip locations verified for: class m63_state : public driver_device { public: - m63_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + m63_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_spriteram(*this, "spriteram"), m_scrollram(*this, "scrollram"), m_videoram2(*this, "videoram2"), @@ -212,7 +212,7 @@ private: DECLARE_MACHINE_START(m63); DECLARE_MACHINE_RESET(m63); DECLARE_VIDEO_START(m63); - DECLARE_PALETTE_INIT(m63); + void m63_palette(palette_device &palette) const; uint32_t screen_update_m63(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(snd_irq); INTERRUPT_GEN_MEMBER(vblank_irq); @@ -224,59 +224,58 @@ private: }; -PALETTE_INIT_MEMBER(m63_state,m63) +void m63_state::m63_palette(palette_device &palette) const { - const uint8_t *color_prom = memregion("proms")->base(); - int i; + uint8_t const *color_prom = memregion("proms")->base(); - for (i = 0; i < 256; i++) + for (int i = 0; i < 256; i++) { - int bit0, bit1, bit2, bit3, r, g, b; - - /* red component */ - bit0 = (color_prom[i] >> 0) & 0x01; - bit1 = (color_prom[i] >> 1) & 0x01; - bit2 = (color_prom[i] >> 2) & 0x01; - bit3 = (color_prom[i] >> 3) & 0x01; - r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - /* green component */ - bit0 = (color_prom[i + 256] >> 0) & 0x01; - bit1 = (color_prom[i + 256] >> 1) & 0x01; - bit2 = (color_prom[i + 256] >> 2) & 0x01; - bit3 = (color_prom[i + 256] >> 3) & 0x01; - g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - /* blue component */ - bit0 = (color_prom[i + 2*256] >> 0) & 0x01; - bit1 = (color_prom[i + 2*256] >> 1) & 0x01; - bit2 = (color_prom[i + 2*256] >> 2) & 0x01; - bit3 = (color_prom[i + 2*256] >> 3) & 0x01; - b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - palette.set_pen_color(i,rgb_t(r,g,b)); + int bit0, bit1, bit2, bit3; + + // red component + bit0 = BIT(color_prom[i], 0); + bit1 = BIT(color_prom[i], 1); + bit2 = BIT(color_prom[i], 2); + bit3 = BIT(color_prom[i], 3); + int const r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + // green component + bit0 = BIT(color_prom[i + 256], 0); + bit1 = BIT(color_prom[i + 256], 1); + bit2 = BIT(color_prom[i + 256], 2); + bit3 = BIT(color_prom[i + 256], 3); + int const g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + // blue component + bit0 = BIT(color_prom[i + 2*256], 0); + bit1 = BIT(color_prom[i + 2*256], 1); + bit2 = BIT(color_prom[i + 2*256], 2); + bit3 = BIT(color_prom[i + 2*256], 3); + int const b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + + palette.set_pen_color(i, rgb_t(r, g, b)); } color_prom += 3 * 256; - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { - int bit0, bit1, bit2, r, g, b; - - /* red component */ - bit0 = (color_prom[i] >> 0) & 0x01; - bit1 = (color_prom[i] >> 1) & 0x01; - bit2 = (color_prom[i] >> 2) & 0x01; - r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* green component */ - bit0 = (color_prom[i] >> 3) & 0x01; - bit1 = (color_prom[i] >> 4) & 0x01; - bit2 = (color_prom[i] >> 5) & 0x01; - g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - /* blue component */ - bit0 = (color_prom[i] >> 6) & 0x01; - bit1 = (color_prom[i] >> 7) & 0x01; - b = 0x4f * bit0 + 0xa8 * bit1; - - palette.set_pen_color(i+256,rgb_t(r,g,b)); + int bit0, bit1, bit2; + + // red component + bit0 = BIT(color_prom[i], 0); + bit1 = BIT(color_prom[i], 1); + bit2 = BIT(color_prom[i], 2); + int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + // green component + bit0 = BIT(color_prom[i], 3); + bit1 = BIT(color_prom[i], 4); + bit2 = BIT(color_prom[i], 5); + int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + // blue component + bit0 = BIT(color_prom[i], 6); + bit1 = BIT(color_prom[i], 7); + int const b = 0x4f * bit0 + 0xa8 * bit1; + + palette.set_pen_color(i + 256, rgb_t(r, g, b)); } } @@ -791,8 +790,7 @@ MACHINE_CONFIG_START(m63_state::m63) screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_m63); - PALETTE(config, m_palette, 256+4); - m_palette->set_init(FUNC(m63_state::palette_init_m63)); + PALETTE(config, m_palette, FUNC(m63_state::m63_palette), 256+4); MCFG_VIDEO_START_OVERRIDE(m63_state,m63) @@ -841,9 +839,7 @@ void m63_state::fghtbskt(machine_config &config) screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_fghtbskt); - PALETTE(config, m_palette, 256); - m_palette->set_prom_region("proms"); - m_palette->set_init("palette", FUNC(palette_device::palette_init_RRRRGGGGBBBB_proms)); + PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 256); MCFG_VIDEO_START_OVERRIDE(m63_state,m63) |