summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/expro02.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/expro02.cpp')
-rw-r--r--src/mame/drivers/expro02.cpp58
1 files changed, 22 insertions, 36 deletions
diff --git a/src/mame/drivers/expro02.cpp b/src/mame/drivers/expro02.cpp
index d1b2dc0e6b2..bc078757484 100644
--- a/src/mame/drivers/expro02.cpp
+++ b/src/mame/drivers/expro02.cpp
@@ -222,8 +222,8 @@ TODO:
class expro02_state : public driver_device
{
public:
- expro02_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ expro02_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_palette(*this, "palette"),
m_screen(*this, "screen"),
@@ -262,7 +262,7 @@ private:
DECLARE_WRITE8_MEMBER(expro02_6295_bankswitch_w);
virtual void machine_start() override;
- DECLARE_PALETTE_INIT(expro02);
+ void expro02_palette(palette_device &palette) const;
uint32_t screen_update_backgrounds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -291,33 +291,28 @@ void expro02_state::machine_start()
membank("okibank")->configure_entries(0, 16, memregion("oki")->base(), 0x10000);
}
-PALETTE_INIT_MEMBER(expro02_state, expro02)
+void expro02_state::expro02_palette(palette_device &palette) const
{
- int i;
+ // first 2048 colors are dynamic
- /* first 2048 colors are dynamic */
-
- /* initialize 555 RGB lookup */
- for (i = 0; i < 32768; i++)
- palette.set_pen_color(2048 + i,pal5bit(i >> 5),pal5bit(i >> 10),pal5bit(i >> 0));
+ // initialize 555 RGB lookup
+ for (int i = 0; i < 32768; i++)
+ palette.set_pen_color(2048 + i, pal5bit(i >> 5), pal5bit(i >> 10), pal5bit(i >> 0));
}
uint32_t expro02_state::screen_update_backgrounds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// kaneko16_fill_bitmap(machine(),bitmap,cliprect);
- int y,x;
int count;
-
count = 0;
- for (y=0;y<256;y++)
+ for (int y = 0; y < 256; y++)
{
- uint16_t *dest = &bitmap.pix16(y);
-
- for (x=0;x<256;x++)
+ uint16_t *const dest = &bitmap.pix16(y);
+ for (int x = 0; x < 256; x++)
{
uint16_t dat = (m_bg_rgb555_pixram[count] & 0xfffe)>>1;
- dat+=2048;
+ dat += 2048;
// never seen to test
//if (!(m_bg_rgb555_pixram[count] & 0x0001))
@@ -336,36 +331,29 @@ uint32_t expro02_state::screen_update_backgrounds(screen_device &screen, bitmap_
}
count = 0;
- for (y=0;y<256;y++)
+ for (int y = 0; y < 256; y++)
{
- uint16_t *dest = &bitmap.pix16(y);
-
- for (x=0;x<256;x++)
+ uint16_t *const dest = &bitmap.pix16(y);
+ for (int x = 0; x < 256; x++)
{
- uint16_t dat = (m_fg_ind8_pixram[count]);
- dat &=0x7ff;
- if (!(m_paletteram[(dat&0x7ff)] & 0x0001))
+ uint16_t const dat = m_fg_ind8_pixram[count] & 0x7ff;
+ if (!(m_paletteram[dat] & 0x0001))
dest[x] = dat;
count++;
}
}
-
-
- int i;
-
screen.priority().fill(0, cliprect);
if (m_view2_0)
{
m_view2_0->kaneko16_prepare(bitmap, cliprect);
- for (i = 0; i < 8; i++)
- {
+ for (int i = 0; i < 8; i++)
m_view2_0->render_tilemap_chip(screen, bitmap, cliprect, i);
- }
}
+
return 0;
}
@@ -927,12 +915,10 @@ MACHINE_CONFIG_START(expro02_state::expro02)
MCFG_SCREEN_SIZE(256, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-32-1)
MCFG_SCREEN_UPDATE_DRIVER(expro02_state, screen_update)
- MCFG_SCREEN_PALETTE("palette")
+ MCFG_SCREEN_PALETTE(m_palette)
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_expro02)
- MCFG_PALETTE_ADD("palette", 2048 + 32768)
- MCFG_PALETTE_FORMAT(GGGGGRRRRRBBBBBx)
- MCFG_PALETTE_INIT_OWNER(expro02_state, expro02)
+ GFXDECODE(config, "gfxdecode", m_palette, gfx_expro02);
+ PALETTE(config, m_palette, FUNC(expro02_state::expro02_palette)).set_format(palette_device::GRBx_555, 2048 + 32768);
KANEKO_TMAP(config, m_view2_0);
m_view2_0->set_gfx_region(1);