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/cc40.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/cc40.cpp')
-rw-r--r-- | src/mame/drivers/cc40.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/mame/drivers/cc40.cpp b/src/mame/drivers/cc40.cpp index c9a10c48f53..9440d942c8a 100644 --- a/src/mame/drivers/cc40.cpp +++ b/src/mame/drivers/cc40.cpp @@ -105,6 +105,15 @@ public: m_sysram[1] = nullptr; } + DECLARE_INPUT_CHANGED_MEMBER(sysram_size_changed); + + void cc40(machine_config &config); + +protected: + virtual void machine_reset() override; + virtual void machine_start() override; + +private: void postload(); void init_sysram(int chip, u16 size); void update_lcd_indicator(u8 y, u8 x, int state); @@ -123,18 +132,12 @@ public: DECLARE_READ8_MEMBER(keyboard_r); DECLARE_WRITE8_MEMBER(keyboard_w); - DECLARE_PALETTE_INIT(cc40); - DECLARE_INPUT_CHANGED_MEMBER(sysram_size_changed); + void cc40_palette(palette_device &palette) const; DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cc40_cartridge); HD44780_PIXEL_UPDATE(cc40_pixel_update); - void cc40(machine_config &config); - void main_map(address_map &map); -protected: - virtual void machine_reset() override; - virtual void machine_start() override; + void main_map(address_map &map); -private: required_device<tms70c20_device> m_maincpu; required_device<generic_slot_device> m_cart; required_ioport_array<8> m_key_matrix; @@ -190,7 +193,7 @@ DEVICE_IMAGE_LOAD_MEMBER(cc40_state, cc40_cartridge) ***************************************************************************/ -PALETTE_INIT_MEMBER(cc40_state, cc40) +void cc40_state::cc40_palette(palette_device &palette) const { palette.set_pen_color(0, rgb_t(138, 146, 148)); // background palette.set_pen_color(1, rgb_t(92, 83, 88)); // lcd pixel on @@ -604,8 +607,7 @@ MACHINE_CONFIG_START(cc40_state::cc40) MCFG_SCREEN_UPDATE_DEVICE("hd44780", hd44780_device, screen_update) MCFG_SCREEN_PALETTE("palette") - MCFG_PALETTE_ADD("palette", 3) - MCFG_PALETTE_INIT_OWNER(cc40_state, cc40) + PALETTE(config, "palette", FUNC(cc40_state::cc40_palette), 3); MCFG_HD44780_ADD("hd44780") MCFG_HD44780_LCD_SIZE(2, 16) // 2*16 internal |