diff --git a/reactos/drivers/dd/vga/display/objects/bitblt.c b/reactos/drivers/dd/vga/display/objects/bitblt.c index 9dfa3bbeba8..15bcb5496d4 100644 --- a/reactos/drivers/dd/vga/display/objects/bitblt.c +++ b/reactos/drivers/dd/vga/display/objects/bitblt.c @@ -38,6 +38,8 @@ static BOOL FASTCALL VGADDI_IntersectRect(PRECTL prcDst, PRECTL prcSrc1, PRECTL return(FALSE); } +void DIB_BltToVGA_Fixed(int x, int y, int w, int h, void *b, int Source_lDelta, int mod); + BOOL DIBtoVGA(SURFOBJ *Dest, SURFOBJ *Source, XLATEOBJ *ColorTranslation, RECTL *DestRect, POINTL *SourcePoint) @@ -51,7 +53,7 @@ DIBtoVGA(SURFOBJ *Dest, SURFOBJ *Source, XLATEOBJ *ColorTranslation, { DIB_BltToVGA(DestRect->left, DestRect->top, dx, dy, Source->pvScan0 + SourcePoint->y * Source->lDelta + (SourcePoint->x >> 1), - Source->lDelta); + Source->lDelta, SourcePoint->x % 2); } else { @@ -390,7 +392,7 @@ DrvBitBlt(SURFOBJ *Dest, unsigned i; POINTL Pt; ULONG Direction; - + switch (rop4) { case BLACKNESS: diff --git a/reactos/drivers/dd/vga/display/objects/copybits.c b/reactos/drivers/dd/vga/display/objects/copybits.c index 242a9ef3199..d3c03c5aedb 100644 --- a/reactos/drivers/dd/vga/display/objects/copybits.c +++ b/reactos/drivers/dd/vga/display/objects/copybits.c @@ -1,39 +1,40 @@ -#include "../vgaddi.h" -#include "../vgavideo/vgavideo.h" - -#define DBG -#include - -BOOL STDCALL -DrvCopyBits(OUT PSURFOBJ DestObj, - IN PSURFOBJ SourceObj, - IN PCLIPOBJ ClipObj, - IN PXLATEOBJ XLateObj, - IN PRECTL DestRectL, - IN PPOINTL SrcPointL) -{ - BOOL Done = FALSE; - - if (STYPE_BITMAP == DestObj->iType && BMF_4BPP == DestObj->iBitmapFormat && - STYPE_DEVICE == SourceObj->iType) - { - /* Screen to 4 BPP DIB */ - DIB_BltFromVGA(SrcPointL->x, SrcPointL->y, - DestRectL->right - DestRectL->left, - DestRectL->bottom - DestRectL->top, - DestObj->pvScan0, DestObj->lDelta); - Done = TRUE; - } - else if (STYPE_DEVICE == DestObj->iType && - STYPE_BITMAP == SourceObj->iType && BMF_4BPP == SourceObj->iBitmapFormat) - { - /* 4 BPP DIB to Screen */ - DIB_BltToVGA(DestRectL->left, DestRectL->top, - DestRectL->right - DestRectL->left, - DestRectL->bottom - DestRectL->top, - SourceObj->pvScan0, SourceObj->lDelta); - Done = TRUE; - } - - return Done; -} +#include "../vgaddi.h" +#include "../vgavideo/vgavideo.h" + +#define DBG +#include + +BOOL STDCALL +DrvCopyBits(OUT PSURFOBJ DestObj, + IN PSURFOBJ SourceObj, + IN PCLIPOBJ ClipObj, + IN PXLATEOBJ XLateObj, + IN PRECTL DestRectL, + IN PPOINTL SrcPointL) +{ + BOOL Done = FALSE; + + if (STYPE_BITMAP == DestObj->iType && BMF_4BPP == DestObj->iBitmapFormat && + STYPE_DEVICE == SourceObj->iType) + { + /* Screen to 4 BPP DIB */ + DIB_BltFromVGA(SrcPointL->x, SrcPointL->y, + DestRectL->right - DestRectL->left, + DestRectL->bottom - DestRectL->top, + DestObj->pvScan0, DestObj->lDelta); + Done = TRUE; + } + else if (STYPE_DEVICE == DestObj->iType && + STYPE_BITMAP == SourceObj->iType && BMF_4BPP == SourceObj->iBitmapFormat) + { + /* 4 BPP DIB to Screen */ + DIB_BltToVGA(DestRectL->left, DestRectL->top, + DestRectL->right - DestRectL->left, + DestRectL->bottom - DestRectL->top, + SourceObj->pvScan0, SourceObj->lDelta, + 0); + Done = TRUE; + } + + return Done; +} diff --git a/reactos/drivers/dd/vga/display/vgavideo/vgavideo.c b/reactos/drivers/dd/vga/display/vgavideo/vgavideo.c index 89696f9519b..5af41d05b72 100644 --- a/reactos/drivers/dd/vga/display/vgavideo/vgavideo.c +++ b/reactos/drivers/dd/vga/display/vgavideo/vgavideo.c @@ -528,7 +528,7 @@ void DIB_BltFromVGA(int x, int y, int w, int h, void *b, int Dest_lDelta) #endif /* DIB blt to the VGA. */ -void DIB_BltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta) +void DIB_BltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta, int StartMod) { PBYTE pb, opb = b; ULONG i, j; @@ -545,7 +545,7 @@ void DIB_BltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta) WRITE_PORT_UCHAR((PUCHAR)GRA_I, 0x08); // set the mask WRITE_PORT_UCHAR((PUCHAR)GRA_D, maskbit[i]); - if (0 == ((i - x) % 2)) + if (StartMod == ((i - x) % 2)) { for (j = y; j < y2; j++) { @@ -566,13 +566,14 @@ void DIB_BltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta) } } - if (0 != ((i - x) % 2)) + if (StartMod != ((i - x) % 2)) { opb++; } } } + /* DIB blt to the VGA. */ void DIB_BltToVGAWithXlate(int x, int y, int w, int h, void *b, int Source_lDelta, PXLATEOBJ Xlate) {