Advertisement
Guest User

MESS

a guest
Aug 9th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. //Instructions: Replace the vga_vblank function, with this one here.
  2.  
  3. static UINT8 vga_vblank(running_machine &machine)
  4. {
  5.     UINT8 res;
  6.     UINT16 vblank_start,vblank_end,vpos;
  7.  
  8.     /* calculate vblank start / end positions */
  9.     res = 0;
  10.     vblank_start = vga.crtc.vert_blank_start;
  11.     vblank_end = vga.crtc.vert_blank_start + vga.crtc.vert_blank_end - 1;
  12.     vpos = machine.primary_screen->vpos();
  13.  
  14.     /* check if we are under vblank period */
  15.     if(vblank_end > vga.crtc.vert_total)
  16.     {
  17.         vblank_end -= vga.crtc.vert_total;
  18.         if(vpos >= vblank_start || vpos < vblank_end)
  19.             res = 1;
  20.     }
  21.     else
  22.     {
  23.         if(vblank_end < vblank_start) //Needed for Fractint's 600 scanline tweaked modes. TODO: turn this into general logic
  24.         {
  25.             if(vpos >= vblank_start && vpos < vga.crtc.vert_total)
  26.                 res = 1;
  27.             else if(vpos < vblank_end)
  28.                 res = 1;
  29.         }
  30.         else
  31.         {
  32.             if(vpos >= vblank_start && vpos < vblank_end)
  33.                 res = 1;
  34.         }
  35.     }
  36.  
  37.     //popmessage("%d %d %d",vblank_start,vblank_end,vga.crtc.vert_total);
  38.  
  39.     return res;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement