summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/wswan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/wswan.cpp')
-rw-r--r--src/mame/drivers/wswan.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/mame/drivers/wswan.cpp b/src/mame/drivers/wswan.cpp
index b7eb1eeb4c5..424afbf473f 100644
--- a/src/mame/drivers/wswan.cpp
+++ b/src/mame/drivers/wswan.cpp
@@ -90,22 +90,22 @@ static GFXDECODE_START( gfx_wswan )
GFXDECODE_END
/* WonderSwan can display 16 shades of grey */
-PALETTE_INIT_MEMBER(wswan_state, wswan)
+void wswan_state::wswan_palette(palette_device &palette) const
{
for (int i = 0; i < 16; i++)
{
- uint8_t shade = i * (256 / 16);
+ uint8_t const shade = i * (256 / 16);
palette.set_pen_color(15 - i, shade, shade, shade);
}
}
-PALETTE_INIT_MEMBER(wscolor_state, wscolor)
+void wscolor_state::wscolor_palette(palette_device &palette) const
{
for (int i = 0; i < 4096; i++)
{
- int r = (i & 0x0f00) >> 8;
- int g = (i & 0x00f0) >> 4;
- int b = i & 0x000f;
+ int const r = (i & 0x0f00) >> 8;
+ int const g = (i & 0x00f0) >> 4;
+ int const b = i & 0x000f;
palette.set_pen_color(i, r << 4, g << 4, b << 4);
}
}
@@ -144,8 +144,7 @@ MACHINE_CONFIG_START(wswan_state::wswan)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_wswan)
- MCFG_PALETTE_ADD("palette", 16)
- MCFG_PALETTE_INIT_OWNER(wswan_state, wswan)
+ PALETTE(config, "palette", FUNC(wswan_state::wswan_palette), 16);
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
@@ -173,9 +172,9 @@ MACHINE_CONFIG_START(wscolor_state::wscolor)
m_vdp->set_vdp_type(VDP_TYPE_WSC);
- MCFG_PALETTE_MODIFY("palette")
- MCFG_PALETTE_ENTRIES(4096)
- MCFG_PALETTE_INIT_OWNER(wscolor_state, wscolor)
+ auto &palette(*subdevice<palette_device>("palette"));
+ palette.set_entries(4096);
+ palette.set_init(FUNC(wscolor_state::wscolor_palette));
/* software lists */
MCFG_DEVICE_REMOVE("cart_list")