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/alphatro.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/alphatro.cpp')
-rw-r--r-- | src/mame/drivers/alphatro.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mame/drivers/alphatro.cpp b/src/mame/drivers/alphatro.cpp index 815272e277c..d173a2928c9 100644 --- a/src/mame/drivers/alphatro.cpp +++ b/src/mame/drivers/alphatro.cpp @@ -78,6 +78,11 @@ public: DECLARE_INPUT_CHANGED_MEMBER(alphatro_break); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + private: enum { @@ -102,7 +107,7 @@ private: DECLARE_WRITE_LINE_MEMBER(txdata_callback); DECLARE_WRITE_LINE_MEMBER(hrq_w); DECLARE_WRITE_LINE_MEMBER(fdc_irq_w); - DECLARE_PALETTE_INIT(alphatro); + void alphatro_palette(palette_device &palette) const; TIMER_DEVICE_CALLBACK_MEMBER(timer_c); TIMER_DEVICE_CALLBACK_MEMBER(timer_p); MC6845_UPDATE_ROW(crtc_update_row); @@ -116,6 +121,7 @@ private: void cartbank_map(address_map &map); void monbank_map(address_map &map); void rombank_map(address_map &map); + void update_banking(); const bool m_is_ntsc; uint8_t *m_ram_ptr; @@ -127,10 +133,6 @@ private: u8 m_port_10, m_port_20, m_port_30, m_port_f0; bool m_cass_state; bool m_cassold, m_fdc_irq; - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - void update_banking(); required_region_ptr<u8> m_p_chargen; required_device<cpu_device> m_maincpu; required_device<mc6845_device> m_crtc; @@ -660,7 +662,7 @@ image_init_result alphatro_state::load_cart(device_image_interface &image, gener return image_init_result::PASS; } -PALETTE_INIT_MEMBER(alphatro_state, alphatro) +void alphatro_state::alphatro_palette(palette_device &palette) const { // RGB colours palette.set_pen_color(0, 0x00, 0x00, 0x00); @@ -741,9 +743,8 @@ MACHINE_CONFIG_START(alphatro_state::alphatro) screen.set_raw(16_MHz_XTAL, 1016, 0, 640, 314, 0, 240); screen.set_screen_update("crtc", FUNC(mc6845_device::screen_update)); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_alphatro) - MCFG_PALETTE_ADD("palette", 9) // 8 colours + amber - MCFG_PALETTE_INIT_OWNER(alphatro_state, alphatro) + GFXDECODE(config, "gfxdecode", m_palette, gfx_alphatro); + PALETTE(config, m_palette, FUNC(alphatro_state::alphatro_palette), 9); // 8 colours + amber /* sound hardware */ SPEAKER(config, "mono").front_center(); |