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/popper.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/popper.cpp')
-rw-r--r-- | src/mame/drivers/popper.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/mame/drivers/popper.cpp b/src/mame/drivers/popper.cpp index a4ea15e8d2d..40ee2ae1cfb 100644 --- a/src/mame/drivers/popper.cpp +++ b/src/mame/drivers/popper.cpp @@ -54,8 +54,8 @@ class popper_state : public driver_device { public: - popper_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + popper_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_subcpu(*this, "subcpu"), m_screen(*this, "screen"), @@ -99,7 +99,7 @@ private: void main_map(address_map &map); void sub_map(address_map &map); - DECLARE_PALETTE_INIT(popper); + void popper_palette(palette_device &palette) const; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TILE_GET_INFO_MEMBER(layer0_tile_info); TILE_GET_INFO_MEMBER(layer1_tile_info); @@ -259,9 +259,9 @@ static const res_net_decode_info popper_decode_info = 0, 63, // R G B - { 0, 0, 0, }, // offsets - { 0, 3, 6, }, // shifts - { 0x07, 0x07, 0x03, } // masks + { 0, 0, 0 }, // offsets + { 0, 3, 6 }, // shifts + { 0x07, 0x07, 0x03 } // masks }; static const res_net_info popper_net_info = @@ -274,7 +274,7 @@ static const res_net_info popper_net_info = } }; -PALETTE_INIT_MEMBER( popper_state, popper ) +void popper_state::popper_palette(palette_device &palette) const { const uint8_t *prom = memregion("colors")->base(); std::vector<rgb_t> rgb; @@ -549,10 +549,9 @@ MACHINE_CONFIG_START(popper_state::popper) MCFG_SCREEN_UPDATE_DRIVER(popper_state, screen_update) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_popper) + GFXDECODE(config, m_gfxdecode, "palette", gfx_popper); - MCFG_PALETTE_ADD("palette", 64) - MCFG_PALETTE_INIT_OWNER(popper_state, popper) + PALETTE(config, "palette", FUNC(popper_state::popper_palette), 64); // audio hardware SPEAKER(config, "mono").front_center(); |