Changeset 1752 for trunk/src


Ignore:
Timestamp:
Nov 15, 1999, 8:01:30 PM (26 years ago)
Author:
hugh
Message:

Added io_init2 function
Fixed some bugs in the ColorFillCode

Location:
trunk/src/ddraw
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ddraw/OS2SURFACE.CPP

    r1746 r1752  
    12471247            // Yes => No Colorconversion is needed so point to the same buffer
    12481248            pDiveBuffer  = pFrameBuffer;
     1249            dwPitchDB = dwPitchFB;
    12491250          }
    12501251          else
     
    14161417  if(NULL!=lpDestRect)
    14171418  {
    1418     #ifdef DEBUG
    1419       dprintf(("DDRAW: Fill only Rect(%d,%d)(%d,%d)\n", lpDestRect->left, lpDestRect->top,
    1420                lpDestRect->right, lpDestRect->bottom));
    1421     #endif
     1419    dprintf(("DDRAW: Fill only Rect(%d,%d)(%d,%d)\n", lpDestRect->left, lpDestRect->top,
     1420             lpDestRect->right, lpDestRect->bottom));
    14221421    FillWidth  = lpDestRect->right - lpDestRect->left;
    14231422    FillHeight = lpDestRect->bottom - lpDestRect->top -1;
     
    14341433  }
    14351434  dprintf(("DDRAW: 0x%08X (%d/%d) at\n", pLine,FillWidth,FillHeight));
     1435
     1436  // Better safe then sorry
     1437  if(FillHeight<=0)
     1438    return(DD_OK);
    14361439
    14371440  if(pDiveBuffer!=pFrameBuffer)
     
    14881491      {
    14891492        if(8==lpDraw->GetScreenBpp())
    1490           dwFillColor = pPal16[dwFillColor];
    1491       }
    1492       dwColor = (dwFillColor<<16) + (dwFillColor);
     1493          dwColor = (pPal16[dwFillColor]<<16) + pPal16[dwFillColor];
     1494      }
     1495      else
     1496      {
     1497        dwColor = (dwFillColor<<16) + (dwFillColor);
     1498      }
    14931499      dprintf(("DDRAW: Fill with 0x%08X\n",dwColor));
    14941500      for(i=0,pColor = (DWORD*)pLine;i<(FillWidth/2);i++)
     
    15231529  } // end switch(dest->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)
    15241530
    1525 
     1531  // First Line has been Filled so FillHeight-1 are left by one
     1532  FillHeight--;
    15261533  pFillPos = pLine + dwPitchDB;
    1527   FillWidth = FillWidth*dwBytesPPDive;;
     1534  FillWidth = FillWidth*dwBytesPPDive;
     1535
    15281536  for( y=0;y<FillHeight;y++,pFillPos+=dwPitchDB)
    15291537  {
     
    15401548  if(pDiveBuffer!=pFrameBuffer)
    15411549  {
    1542     dprintf(("DDRAW: CC-Mode Fill FrameBuffer\n"));
     1550    dprintf(("DDRAW: CC-Mode Fill FrameBuffer %08X\n",pFrameBuffer));
    15431551
    15441552    if(NULL!=lpDestRect)
    15451553    {
     1554      dprintf(("DDRAW: Fill only Rect(%d,%d)(%d,%d)\n", lpDestRect->left, lpDestRect->top,
     1555               lpDestRect->right, lpDestRect->bottom));
    15461556      FillWidth  = lpDestRect->right - lpDestRect->left;
    15471557      FillHeight = lpDestRect->bottom - lpDestRect->top -1;
    15481558      pLine = pFrameBuffer +
    15491559              (lpDestRect->top*dwPitchFB) +
    1550               (lpDestRect->left*lpDraw->GetScreenBpp());
     1560              (lpDestRect->left*(lpDraw->GetScreenBpp()>>3));
    15511561    }
    15521562    else
    15531563    {
     1564      dprintf(("DDRAW: Fill all at addr "));
    15541565      FillWidth  = width;
    15551566      FillHeight = height -1;
    15561567      pLine = pFrameBuffer;
    15571568    }
     1569    dprintf(("DDRAW: 0x%08X width,height(%d/%d) \n", pLine,FillWidth,FillHeight));
    15581570
    15591571    // Colorconversion mode we must also fill the other buffer
     
    15641576        dwColor = (dwFillColor<<24) + (dwFillColor<<16) +
    15651577                  (dwFillColor<<8)  + (dwFillColor);
    1566         dprintf(("DDRAW: Fill with 0x%08X\n",dwColor));
     1578        dprintf(("DDRAW: Fill with %08X => 0x%08X\n",dwFillColor,dwColor));
    15671579        for(i=0,pColor = (DWORD*)pLine;i<(FillWidth/4);i++)
    15681580          pColor[i] = dwColor;
    15691581        if(FillWidth % 4)
    15701582        {
    1571            pFillPos = (char*) (&pColor[i-1]);
     1583          pFillPos = (char*) (&pColor[i-1]);
    15721584          for(i=0;i<FillWidth % 4;i++)
    15731585             pFillPos[i] = (UCHAR) dwColor;
     
    16001612        for(i=0,pColor = (DWORD*)pLine;i<FillWidth;i++)
    16011613          pColor[i] = dwColor;
    1602     }
     1614        break;
     1615      default:
     1616        dprintf(("DDRAW: Unsupported # of Bits %d",lpDraw->GetScreenBpp()));
     1617    }
     1618
     1619    // First Line has been Filled so FillHeight-1 are left by one
     1620    FillHeight--;
    16031621
    16041622    pFillPos = pLine + dwPitchFB;
    1605     FillWidth = FillWidth*lpDraw->GetScreenBpp();
     1623    FillWidth = FillWidth*(lpDraw->GetScreenBpp()>>3);
    16061624    for( y=0;y<FillHeight;y++,pFillPos+=dwPitchFB)
    16071625    {
  • trunk/src/ddraw/iccio1.asm

    r211 r1752  
    240240io_init1 ENDP
    241241
     242; void in_init(short)
     243PUBLIC  io_init2
     244  ALIGN  04H
     245io_init2  PROC
     246
     247  MOV  gdt, AX    ; store in ioentry address selector part
     248  XOR  EAX, EAX  ; EAX = 0
     249  MOV  DWORD PTR [ioentry], EAX ; clear ioentry offset part
     250        ; return code = 0 (in EAX)
     251
     252        ; now use this function to raise the IOPL
     253  MOV  EBX,13    ; special function code
     254  CALL  FWORD PTR [ioentry]  ; CALL intersegment indirect 16:32
     255
     256  XOR  EAX, EAX  ; return code = 0
     257  ret
     258io_init2  ENDP
     259
    242260  PUBLIC  io_exit1
    243261  ALIGN  04H
     
    264282io_exit1  ENDP
    265283
     284
     285
    266286; for diagnostic only
    267287
Note: See TracChangeset for help on using the changeset viewer.