diff options
author | Vas Crabb <vas@vastheman.com> | 2018-12-29 05:53:50 +1100 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2018-12-29 05:53:50 +1100 |
commit | f1f0591f43f381123e8d9ec20c52eb7c0c332c79 (patch) | |
tree | 97c8dd30a6ea292c3189f372b8103a2e303c0b2d /src/mame/drivers/snookr10.cpp | |
parent | 65bfb2654f0c73235f114e9145c766245bed9790 (diff) |
Start cleaning up palette configuration:
* Basically, initialisers go in the constructor arguments, and things for setting format go in set_format.
* Initialisation patterns can be specified with an enum discriminator or with a FUNC and optionally a tag.
* Formats can be specified with an enum discriminator or a size and function pointer.
* You must always supply the number of entries when setting the format.
* When initislising with a paletter initialisation member, you can specify the entries and indirecte entries together.
* The palette_device now has a standard constructor, so use .set_entries if you are specifying entry count with no format/initialisation.
* Also killed an overload on delegates that wasn't being useful.
Diffstat (limited to 'src/mame/drivers/snookr10.cpp')
-rw-r--r-- | src/mame/drivers/snookr10.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mame/drivers/snookr10.cpp b/src/mame/drivers/snookr10.cpp index 76bc0052afe..dcd1516d651 100644 --- a/src/mame/drivers/snookr10.cpp +++ b/src/mame/drivers/snookr10.cpp @@ -1060,8 +1060,7 @@ MACHINE_CONFIG_START(snookr10_state::snookr10) MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_snookr10) - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_INIT_OWNER(snookr10_state, snookr10) + PALETTE(config, "palette", FUNC(snookr10_state::snookr10_palette), 256); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -1077,8 +1076,7 @@ MACHINE_CONFIG_START(snookr10_state::apple10) MCFG_DEVICE_MODIFY("maincpu") /* video hardware */ - MCFG_PALETTE_MODIFY("palette") - MCFG_PALETTE_INIT_OWNER(snookr10_state, apple10) + subdevice<palette_device>("palette")->set_init(FUNC(snookr10_state::apple10_palette)); MCFG_VIDEO_START_OVERRIDE(snookr10_state, apple10) MACHINE_CONFIG_END @@ -1099,8 +1097,7 @@ MACHINE_CONFIG_START(snookr10_state::crystalc) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(crystalc_map) - MCFG_PALETTE_MODIFY("palette") - MCFG_PALETTE_INIT_OWNER(snookr10_state, crystalc) + subdevice<palette_device>("palette")->set_init(FUNC(snookr10_state::crystalc_palette)); MCFG_VIDEO_START_OVERRIDE(snookr10_state, crystalc) MACHINE_CONFIG_END |