(nw) initialisation order matters (fix many Konami crashes)

This commit is contained in:
Vas Crabb 2019-10-26 13:11:28 +11:00
parent 02e64d7112
commit c8ba66d4af
5 changed files with 19 additions and 20 deletions

View File

@ -153,6 +153,9 @@ void k051316_device::device_start()
if (!palette().device().started())
throw device_missing_dependencies();
// bind callbacks
m_k051316_cb.resolve();
decode_gfx();
gfx(0)->set_colors(palette().entries() / gfx(0)->depth());
@ -168,9 +171,6 @@ void k051316_device::device_start()
else
m_tmap->set_transparent_pen(0);
// bind callbacks
m_k051316_cb.resolve();
save_item(NAME(m_ram));
save_item(NAME(m_ctrlram));
save_item(NAME(m_wrap));

View File

@ -181,6 +181,9 @@ void k051960_device::device_start()
if (!palette().device().started())
throw device_missing_dependencies();
// bind callbacks
m_k051960_cb.resolve();
// allocate scanline timer and start at first scanline
m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k051960_device::scanline_callback), this));
m_scanline_timer->adjust(screen().time_until_pos(0));
@ -193,9 +196,6 @@ void k051960_device::device_start()
m_ram = make_unique_clear<uint8_t[]>(0x400);
// bind callbacks
m_k051960_cb.resolve();
// resolve callbacks
m_irq_handler.resolve_safe();
m_firq_handler.resolve_safe();

View File

@ -216,6 +216,13 @@ void k052109_device::device_start()
screen().register_vblank_callback(vblank_state_delegate(&k052109_device::vblank_callback, this));
}
// resolve callbacks
m_k052109_cb.resolve();
m_irq_handler.resolve_safe();
m_firq_handler.resolve_safe();
m_nmi_handler.resolve_safe();
decode_gfx();
gfx(0)->set_colors(palette().entries() / gfx(0)->depth());
@ -239,14 +246,6 @@ void k052109_device::device_start()
m_tilemap[1]->set_transparent_pen(0);
m_tilemap[2]->set_transparent_pen(0);
// bind callbacks
m_k052109_cb.resolve();
// resolve callbacks
m_irq_handler.resolve_safe();
m_firq_handler.resolve_safe();
m_nmi_handler.resolve_safe();
save_pointer(NAME(m_ram), 0x6000);
save_item(NAME(m_rmrd_line));
save_item(NAME(m_romsubbank));

View File

@ -122,6 +122,9 @@ void k05324x_device::device_start()
if (!palette().device().started())
throw device_missing_dependencies();
// bind callbacks
m_k05324x_cb.resolve();
/* decode the graphics */
decode_gfx();
gfx(0)->set_colors(palette().entries() / gfx(0)->depth());
@ -135,9 +138,6 @@ void k05324x_device::device_start()
m_ram = make_unique_clear<uint16_t[]>(m_ramsize / 2);
m_buffer = make_unique_clear<uint16_t[]>(m_ramsize / 2);
// bind callbacks
m_k05324x_cb.resolve();
save_pointer(NAME(m_ram), m_ramsize / 2);
save_pointer(NAME(m_buffer), m_ramsize / 2);
save_item(NAME(m_rombank));

View File

@ -336,6 +336,9 @@ void k056832_device::device_start()
if (!palette().device().started())
throw device_missing_dependencies();
// bind callbacks
m_k056832_cb.resolve();
memset(m_regs, 0x00, sizeof(m_regs) );
memset(m_regsb, 0x00, sizeof(m_regsb) );
@ -347,9 +350,6 @@ void k056832_device::device_start()
create_tilemaps();
finalize_init();
// bind callbacks
m_k056832_cb.resolve();
}
/*****************************************************************************