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/apple2e.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/apple2e.cpp')
-rw-r--r-- | src/mame/drivers/apple2e.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp index 59b6c9d361e..814e8b335a4 100644 --- a/src/mame/drivers/apple2e.cpp +++ b/src/mame/drivers/apple2e.cpp @@ -204,12 +204,11 @@ Address bus A0-A11 is Y0-Y11 class apple2e_state : public driver_device { public: - apple2e_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + apple2e_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, A2_CPU_TAG), m_screen(*this, "screen"), m_scantimer(*this, "scantimer"), - m_palette(*this, "palette"), m_ram(*this, RAM_TAG), m_rom(*this, "maincpu"), m_cecbanks(*this, "cecexp"), @@ -252,7 +251,6 @@ public: required_device<cpu_device> m_maincpu; required_device<screen_device> m_screen; required_device<timer_device> m_scantimer; - required_device<palette_device> m_palette; required_device<ram_device> m_ram; required_memory_region m_rom; optional_memory_region m_cecbanks; @@ -290,7 +288,6 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - DECLARE_PALETTE_INIT(apple2); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(ram0000_r); @@ -1041,11 +1038,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(apple2e_state::apple2_interrupt) } } -PALETTE_INIT_MEMBER(apple2e_state, apple2) -{ - m_video->palette_init_apple2(palette); -} - uint32_t apple2e_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bool old_page2 = m_video->m_page2; @@ -3977,10 +3969,7 @@ MACHINE_CONFIG_START(apple2e_state::apple2e) SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(1021800*14, (65*7)*2, 0, (40*7)*2, 262, 0, 192); m_screen->set_screen_update(FUNC(apple2e_state::screen_update)); - m_screen->set_palette("palette"); - - PALETTE(config, m_palette, 16); - m_palette->set_init(DEVICE_SELF, FUNC(apple2e_state::palette_init_apple2)); + m_screen->set_palette(m_video); /* sound hardware */ SPEAKER(config, "mono").front_center(); |