In case there is driver init available, we update palettes after it (nw)

This commit is contained in:
Miodrag Milanovic 2014-03-02 08:50:18 +00:00
parent bc57e5824a
commit bb07cb9a41
2 changed files with 11 additions and 0 deletions

View File

@ -226,8 +226,17 @@ void driver_device::device_start()
// call the game-specific init
if (m_system->driver_init != NULL)
{
(*m_system->driver_init)(machine());
// update palettes to allow changes in driver_init
palette_device_iterator pal_deviter(*this);
for (palette_device *palette = pal_deviter.first(); palette != NULL; palette = pal_deviter.next())
{
palette->update();
}
}
// finish image devices init process
image_postdevice_init(machine());

View File

@ -388,6 +388,8 @@ public:
void palette_init_BBBBBGGGGGRRRRR(palette_device &palette);
void palette_init_RRRRRGGGGGGBBBBB(palette_device &palette);
// helper to update palette when data changed
void update() { if (!m_init.isnull()) m_init(*this); }
protected:
// device-level overrides
virtual void device_validity_check(validity_checker &valid) const;