Exemplo n.º 1
0
void ChangeWindowMode(void) // TOGGLE FULLSCREEN - WINDOW
{
    DoClearScreenBuffer();

    bChangeWinMode = FALSE;
    bDoVSyncUpdate = TRUE;
}
Exemplo n.º 2
0
void ChangeDispOffsetsY(void)                          // Y CENTER
{
 int iT,iO=PreviousPSXDisplay.Range.y0;
 int iOldYOffset=PreviousPSXDisplay.DisplayModeNew.y;

// new

 if((PreviousPSXDisplay.DisplayModeNew.x+PSXDisplay.DisplayModeNew.y)>512)
  {
   int dy1=512-PreviousPSXDisplay.DisplayModeNew.x;
   int dy2=(PreviousPSXDisplay.DisplayModeNew.x+PSXDisplay.DisplayModeNew.y)-512;

   if(dy1>=dy2)
    {
     PreviousPSXDisplay.DisplayModeNew.y=-dy2;
    }
   else
    {
     PSXDisplay.DisplayPosition.y=0;
     PreviousPSXDisplay.DisplayModeNew.y=-dy1;
    }
  }
 else PreviousPSXDisplay.DisplayModeNew.y=0;

// eon

 if(PreviousPSXDisplay.DisplayModeNew.y!=iOldYOffset) // if old offset!=new offset: recalc height
  {
   PSXDisplay.Height = PSXDisplay.Range.y1 - 
                       PSXDisplay.Range.y0 +
                       PreviousPSXDisplay.DisplayModeNew.y;
   PSXDisplay.DisplayModeNew.y=PSXDisplay.Height*PSXDisplay.Double;
  }

//

 if(PSXDisplay.PAL) iT=48; else iT=28;

 if(PSXDisplay.Range.y0>=iT)
  {
   PreviousPSXDisplay.Range.y0=
    (short)((PSXDisplay.Range.y0-iT-4)*PSXDisplay.Double);
   if(PreviousPSXDisplay.Range.y0<0)
    PreviousPSXDisplay.Range.y0=0;
   PSXDisplay.DisplayModeNew.y+=
    PreviousPSXDisplay.Range.y0;
  }
 else 
  PreviousPSXDisplay.Range.y0=0;

 if(iO!=PreviousPSXDisplay.Range.y0)
  {
   DoClearScreenBuffer();
 }
}
Exemplo n.º 3
0
void ChangeDispOffsetsX(void) // X CENTER
{
    long lx, l;

    if (!PSXDisplay.Range.x1) return;

    l = PreviousPSXDisplay.DisplayMode.x;

    l *= (long) PSXDisplay.Range.x1;
    l /= 2560;
    lx = l;
    l &= 0xfffffff8;

    if (l == PreviousPSXDisplay.Range.y1) return; // abusing range.y1 for
    PreviousPSXDisplay.Range.y1 = (short) l; // storing last x range and test

    if (lx >= PreviousPSXDisplay.DisplayMode.x) {
        PreviousPSXDisplay.Range.x1 =
                (short) PreviousPSXDisplay.DisplayMode.x;
        PreviousPSXDisplay.Range.x0 = 0;
    } else {
        PreviousPSXDisplay.Range.x1 = (short) l;

        PreviousPSXDisplay.Range.x0 =
                (PSXDisplay.Range.x0 - 500) / 8;

        if (PreviousPSXDisplay.Range.x0 < 0)
            PreviousPSXDisplay.Range.x0 = 0;

        if ((PreviousPSXDisplay.Range.x0 + lx) >
                PreviousPSXDisplay.DisplayMode.x) {
            PreviousPSXDisplay.Range.x0 =
                    (short) (PreviousPSXDisplay.DisplayMode.x - lx);
            PreviousPSXDisplay.Range.x0 += 2; //???

            PreviousPSXDisplay.Range.x1 += (short) (lx - l);

#ifndef _WINDOWS
            PreviousPSXDisplay.Range.x1 -= 2; // makes linux stretching easier
#endif
        }

#ifndef _WINDOWS
        // some linux alignment security
        PreviousPSXDisplay.Range.x0 = PreviousPSXDisplay.Range.x0 >> 1;
        PreviousPSXDisplay.Range.x0 = PreviousPSXDisplay.Range.x0 << 1;
        PreviousPSXDisplay.Range.x1 = PreviousPSXDisplay.Range.x1 >> 1;
        PreviousPSXDisplay.Range.x1 = PreviousPSXDisplay.Range.x1 << 1;
#endif

        DoClearScreenBuffer();
    }

    bDoVSyncUpdate = TRUE;
}