stvvdp1.cpp: fixed potential crash (nw)

This commit is contained in:
angelosa 2017-10-10 04:43:38 +02:00
parent 2a3bb94399
commit 5d6fa5152e
2 changed files with 7 additions and 2 deletions

View File

@ -247,7 +247,7 @@ void sega_scu_device::device_start()
save_item(NAME(m_dma[2].rup));
save_item(NAME(m_dma[2].wup));
m_hostcpu = machine().device<sh2_device>(m_hostcpu_tag);//machine().device(m_hostcpu_tag);
m_hostcpu = machine().device<sh2_device>(m_hostcpu_tag);
m_hostspace = &m_hostcpu->space(AS_PROGRAM);
m_dma_timer[0] = timer_alloc(DMALV0_ID);

View File

@ -904,6 +904,9 @@ void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcn
return;
}
if(x >= 1024 || y >= 512)
return;
if ( stv2_current_sprite.ispoly )
{
pix = stv2_current_sprite.CMDCOLR&0xffff;
@ -2001,7 +2004,9 @@ void saturn_state::stv_vdp1_process_list( void )
m_vdp1.copr = (position * 0x20) >> 3;
/* TODO: what's the exact formula? Guess it should be a mix between number of pixels written and actual command data fetched. */
machine().scheduler().timer_set(m_maincpu->cycles_to_attotime(spritecount*16), timer_expired_delegate(FUNC(saturn_state::vdp1_draw_end),this));
// if spritecount = 10000 don't send a vdp1 draw end
if(spritecount < 10000)
machine().scheduler().timer_set(m_maincpu->cycles_to_attotime(spritecount*16), timer_expired_delegate(FUNC(saturn_state::vdp1_draw_end),this));
if (VDP1_LOG) logerror ("End of list processing!\n");
}