Previous 199869 Revisions Next

r21319 Friday 22nd February, 2013 at 15:48:09 UTC by Angelo Salese
First batch of real HW tests: added proper vblank firing
[src/emu/video]stvvdp2.c

trunk/src/emu/video/stvvdp2.c
r21318r21319
59335933   return res/divider;
59345934}
59355935
5936/* TODO: hblank position and hblank firing doesn't really match HW behaviour. */
59365937UINT8 saturn_state::get_hblank( void )
59375938{
59385939   const rectangle &visarea = machine().primary_screen->visible_area();
r21318r21319
59495950   int cur_v,vblank;
59505951   cur_v = machine().primary_screen->vpos();
59515952
5952   vblank = (m_vdp2.pal) ? 288 : 240;
5953   vblank = get_vblank_start_position() * get_ystep_count();
59535954
5954   if((STV_VDP2_LSMD & 3) == 3)
5955      vblank<<=1;
5956
59575955   if (cur_v >= vblank)
59585956      return 1;
59595957
r21318r21319
59735971
59745972int saturn_state::get_vblank_start_position( void )
59755973{
5974   /* TODO: test says that second setting happens at 241, might need further investigation ... */
5975   const int d_vres[4] = { 224, 240, 256, 256 };
5976   int vres_mask;
59765977   int vblank_line;
59775978
5978   vblank_line = (m_vdp2.pal) ? 288 : 240;
5979   vres_mask = (m_vdp2.pal << 1)|1; //PAL uses mask 3, NTSC uses mask 1
5980   vblank_line = d_vres[STV_VDP2_VRES & vres_mask];
59795981
59805982   return vblank_line;
59815983}
r21318r21319
60396041   if((STV_VDP2_LSMD & 3) == 3)
60406042      return (vcount & ~1) | (machine().primary_screen->frame_number() & 1);
60416043
6042   return (vcount << 1); // Non-interlace
6044   /* docs says << 1, but according to HW tests it's a typo. */
6045   return (vcount & 0x1ff); // Non-interlace
60436046}
60446047
60456048void saturn_state::stv_vdp2_state_save_postload( void )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team