From 54995edd3fe9b5e60fea32defc0f672df7085048 Mon Sep 17 00:00:00 2001 From: angelosa Date: Wed, 11 Oct 2017 17:56:42 +0200 Subject: stvvdp1.cpp: CEF bit gets reset when the framebuffers get swapped, fixes Twinkle Star Sprites Arcade Mode hang at least [Angelo Salese] --- src/devices/video/stvvdp1.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/devices/video/stvvdp1.cpp b/src/devices/video/stvvdp1.cpp index 8f8af33d22a..462da4cf0ba 100644 --- a/src/devices/video/stvvdp1.cpp +++ b/src/devices/video/stvvdp1.cpp @@ -258,6 +258,8 @@ void saturn_state::stv_vdp1_change_framebuffers( void ) { m_vdp1.framebuffer_current_display ^= 1; m_vdp1.framebuffer_current_draw ^= 1; + // "this bit is reset to 0 when the frame buffers are changed" + CEF_0; if ( VDP1_LOG ) logerror( "Changing framebuffers: %d - draw, %d - display\n", m_vdp1.framebuffer_current_draw, m_vdp1.framebuffer_current_display ); stv_prepare_framebuffers(); } @@ -1788,6 +1790,7 @@ void saturn_state::stv_vdp1_process_list( void ) /*Set CEF bit to 0*/ CEF_0; + // TODO: is there a while (spritecount<10000) // if its drawn this many sprites something is probably wrong or sega were crazy ;-) { int draw_this_sprite; @@ -1988,7 +1991,7 @@ void saturn_state::stv_vdp1_process_list( void ) break; default: - popmessage ("VDP1: Sprite List Illegal %02x, contact MAMEdev",stv2_current_sprite.CMDCTRL & 0xf); + popmessage ("VDP1: Sprite List Illegal %02x (%d), contact MAMEdev",stv2_current_sprite.CMDCTRL & 0xf,spritecount); m_vdp1.lopr = (position * 0x20) >> 3; //m_vdp1.copr = (position * 0x20) >> 3; // prematurely kill the VDP1 process if an illegal opcode is executed @@ -2003,10 +2006,11 @@ void saturn_state::stv_vdp1_process_list( void ) end: 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. */ // 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(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"); } @@ -2086,11 +2090,11 @@ void saturn_state::video_update_vdp1( void ) { case 0:/*Idle Mode*/ /*Set CEF bit to 0*/ - CEF_0; + //CEF_0; break; case 1:/*Draw by request*/ /*Set CEF bit to 0*/ - CEF_0; + //CEF_0; break; case 2:/*Automatic Draw*/ if ( framebuffer_changed || VDP1_LOG ) -- cgit v1.2.3