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/astrcorp.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/astrcorp.cpp')
-rw-r--r-- | src/mame/drivers/astrcorp.cpp | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/mame/drivers/astrcorp.cpp b/src/mame/drivers/astrcorp.cpp index fd77b86e208..9ed45d4c9ba 100644 --- a/src/mame/drivers/astrcorp.cpp +++ b/src/mame/drivers/astrcorp.cpp @@ -51,8 +51,8 @@ To do: class astrocorp_state : public driver_device { public: - astrocorp_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + astrocorp_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_oki(*this, "oki"), m_gfxdecode(*this, "gfxdecode"), @@ -73,6 +73,10 @@ public: void init_showhanc(); void init_showhand(); +protected: + virtual void machine_start() override; + virtual void video_start() override; + private: // devices required_device<cpu_device> m_maincpu; @@ -90,6 +94,9 @@ private: bitmap_ind16 m_bitmap; uint16_t m_screen_enable; uint16_t m_draw_sprites; + + output_finder<7> m_lamps; + DECLARE_WRITE16_MEMBER(astrocorp_draw_sprites_w); DECLARE_WRITE16_MEMBER(astrocorp_eeprom_w); DECLARE_WRITE16_MEMBER(showhand_outputs_w); @@ -98,7 +105,6 @@ private: DECLARE_READ16_MEMBER(astrocorp_unk_r); DECLARE_WRITE16_MEMBER(astrocorp_sound_bank_w); DECLARE_WRITE16_MEMBER(skilldrp_sound_bank_w); - DECLARE_VIDEO_START(astrocorp); uint32_t screen_update_astrocorp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(skilldrp_scanline); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -107,17 +113,13 @@ private: void showhand_map(address_map &map); void skilldrp_map(address_map &map); void speeddrp_map(address_map &map); - - virtual void machine_start() override; - - output_finder<7> m_lamps; }; /*************************************************************************** Video ***************************************************************************/ -VIDEO_START_MEMBER(astrocorp_state,astrocorp) +void astrocorp_state::video_start() { m_screen->register_screen_bitmap(m_bitmap); @@ -542,13 +544,10 @@ MACHINE_CONFIG_START(astrocorp_state::showhand) // MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1) MCFG_SCREEN_RAW_PARAMS(ASTROCORP_PIXEL_CLOCK,ASTROCORP_HTOTAL,ASTROCORP_HBEND,320,ASTROCORP_VTOTAL,ASTROCORP_VBEND,ASTROCORP_VBSTART) MCFG_SCREEN_UPDATE_DRIVER(astrocorp_state, screen_update_astrocorp) - MCFG_SCREEN_PALETTE("palette") + MCFG_SCREEN_PALETTE(m_palette) - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_astrocorp) - MCFG_PALETTE_ADD("palette", 0x100) - MCFG_PALETTE_FORMAT(BBBBBGGGGGGRRRRR) - - MCFG_VIDEO_START_OVERRIDE(astrocorp_state,astrocorp) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_astrocorp); + PALETTE(config, m_palette).set_format(palette_device::BGR_565, 0x100); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -597,13 +596,10 @@ MACHINE_CONFIG_START(astrocorp_state::skilldrp) // MCFG_SCREEN_VISIBLE_AREA(0, 0x200-1, 0, 0xf0-1) MCFG_SCREEN_RAW_PARAMS(ASTROCORP_PIXEL_CLOCK,ASTROCORP_HTOTAL,ASTROCORP_HBEND,512,ASTROCORP_VTOTAL,ASTROCORP_VBEND,ASTROCORP_VBSTART) MCFG_SCREEN_UPDATE_DRIVER(astrocorp_state, screen_update_astrocorp) - MCFG_SCREEN_PALETTE("palette") - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_astrocorp) - MCFG_PALETTE_ADD("palette", 0x100) - MCFG_PALETTE_FORMAT(BBBBBGGGGGGRRRRR) + MCFG_SCREEN_PALETTE(m_palette) - MCFG_VIDEO_START_OVERRIDE(astrocorp_state,astrocorp) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_astrocorp); + PALETTE(config, m_palette).set_format(palette_device::BGR_565, 0x100); /* sound hardware */ SPEAKER(config, "mono").front_center(); |