Ejemplo n.º 1
0
static void DISPDIB_Show(LPBITMAPINFOHEADER lpbi,LPSTR lpBits,WORD uFlags)
{
    int Xofs,Yofs,Width=lpbi->biWidth,Height=lpbi->biHeight,Delta;
    int Pitch = (Width + 3) & ~3;
    unsigned int sPitch,sWidth,sHeight;
    LPSTR surf = DOSMEM_MapDosToLinear(0xa0000);

    if (VGA_GetMode(&sHeight,&sWidth,NULL)) return;
    sPitch=320;

    Delta=(Height<0)*2-1;
    Height*=-Delta; Pitch*=Delta;

    if (uFlags&DISPLAYDIB_NOCENTER) {
        Xofs=0; Yofs=0;
    } else {
        Xofs=(sWidth-Width)/2;
        Yofs=(sHeight-Height)/2;
    }
    surf += (Yofs*sPitch)+Xofs;
    if (Pitch<0) lpBits-=Pitch*(Height-1);
    for (; Height; Height--,lpBits+=Pitch,surf+=sPitch) {
        memcpy(surf,lpBits,Width);
    }

    VGA_Poll(0);
}
Ejemplo n.º 2
0
void DOSVM_Int33Message(UINT message,WPARAM wParam,LPARAM lParam)
{
  WORD mask = 0;
  unsigned Height, Width, SX=1, SY=1;

  if (!VGA_GetMode(&Height,&Width,NULL)) {
    /* may need to do some coordinate scaling */
    if (Width)
      SX = 640/Width;
    if (!SX) SX=1;
  }

  switch (message) {
  case WM_MOUSEMOVE:
    mask |= 0x01;
    break;
  case WM_LBUTTONDOWN:
  case WM_LBUTTONDBLCLK:
    mask |= 0x02;
    break;
  case WM_LBUTTONUP:
    mask |= 0x04;
    break;
  case WM_RBUTTONDOWN:
  case WM_RBUTTONDBLCLK:
    mask |= 0x08;
    break;
  case WM_RBUTTONUP:
    mask |= 0x10;
    break;
  case WM_MBUTTONDOWN:
  case WM_MBUTTONDBLCLK:
    mask |= 0x20;
    break;
  case WM_MBUTTONUP:
    mask |= 0x40;
    break;
  }

  QueueMouseRelay(LOWORD(lParam) * SX,
                 HIWORD(lParam) * SY,
                 mask);
}