/******************************Module*Header*******************************\ * Module Name: paint.c * * This module contains the hardware paint functions. * * Revision History: * * \**************************************************************************/ #include "driver.h" #if defined(HW_PAINT) || defined(HW_LINE) #include "wdport.h" #endif // HW_PAINT || HW_LINE #ifdef HW_PAINT VOID bPaintFullRect(PPDEV ppdev, RECTL *prcl, BRUSHOBJ *pbo, ULONG rop4); #if DBG VOID DebugBuffer( PUCHAR pBuf, ULONG sizl) { ULONG i; for(i=0; idhpdev; #ifdef HW_BITBLT scrnSurf = ppdev->pSurfObj; #else scrnSurf = pso; #endif // HW_BITBLT // Protect against a potentially NULL clip object. if (pco == NULL) return FALSE; rop4 = (gaMix[(mix >> 8) & 0x0F]) << 8; rop4 |= ((ULONG) gaMix[mix & 0x0F]); bRet = FALSE; switch (pco->iDComplexity) { case DC_RECT: if (pbo->iSolidColor != -1) { bPaintFullRect(ppdev, &(pco->rclBounds), pbo, rop4); bRet = TRUE; } break; case DC_COMPLEX: if ( (pbo->iSolidColor != -1) && (CLIPOBJ_cEnumStart(pco, TRUE, CT_RECTANGLES, CD_ANY, 0) != -1) ) { do { bMore = CLIPOBJ_bEnum(pco, sizeof(rectBuf), (PULONG)&rectBuf); for (i=0; ileft; ySrc = prcl->top; xDst = prcl->left; yDst = prcl->top; cxExt = prcl->right - xSrc; cyExt = prcl->bottom - ySrc; lDeltaScreen = ppdev->lDeltaScreen; iSolidColor = pbo->iSolidColor; SrcAddr = DstAddr = ySrc * lDeltaScreen + xSrc; ex_outpw(INDEX_CTRL, 0x1001); // select BitBlt registers // auto-increment disable // ex_outpw(ACCESS_PORT, BR_CTRL_1 | 0x100); // stop BitBlt WaitHW_Always; ex_outpw(ACCESS_PORT, BR_SRC_LOW | SrcAddr & 0xFFF); ex_outpw(ACCESS_PORT, BR_SRC_HIGH | (SrcAddr >> 12) & 0x1FF); ex_outpw(ACCESS_PORT, BR_DST_LOW | DstAddr & 0xFFF); ex_outpw(ACCESS_PORT, BR_DST_HIGH | (DstAddr >> 12) & 0x1FF); ex_outpw(ACCESS_PORT, BR_WIDTH | cxExt); ex_outpw(ACCESS_PORT, BR_HEIGHT | cyExt); ex_outpw(ACCESS_PORT, BR_ROW_PITCH | lDeltaScreen); ex_outpw(ACCESS_PORT, BR_FORE_CLR | iSolidColor); ex_outpw(ACCESS_PORT, BR_BACK_CLR | iSolidColor); ex_outpw(ACCESS_PORT, BR_MASK | 0xFF ); // enable all planes ex_outpw(ACCESS_PORT, BR_RAS_OP | (rop4 & 0x0F) << 8); // raster operation ex_outpw(ACCESS_PORT, BR_CTRL_2 | 0x02 // Do not interrupt when finish ); ex_outpw(ACCESS_PORT, BR_CTRL_1 | 0x0900 | 0x0008 // filled rectangle | ((TRUE) ? 0 : 0x400)); // direction INCREASE // Start BitBlt // Packed pixel mode // src: rect, dst: rest // src: screen, dst: screen WaitHW_BitmapSurf; #ifndef HW_BITBLT ex_outpw(INDEX_CTRL, 0x1000); // select System Control register // auto-increment disable #endif // not HW_BITBLT } // end bPaintFullRect #endif // HW_PAINT