diff --git a/reactos/drivers/video/displays/vga/main/enable.c b/reactos/drivers/video/displays/vga/main/enable.c index e5b0b12c4d1..50df4146e9f 100644 --- a/reactos/drivers/video/displays/vga/main/enable.c +++ b/reactos/drivers/video/displays/vga/main/enable.c @@ -6,12 +6,7 @@ * PROGRAMMERS: */ -#include "../vgaddi.h" -#include "../vgavideo/vgavideo.h" -#define NDEBUG -#include - -#define DBG_PREFIX "VGADDI: " +#include static BOOL VGAInitialized = FALSE; @@ -183,7 +178,7 @@ DrvEnableDriver(IN ULONG EngineVersion, IN ULONG SizeOfDED, OUT PDRVENABLEDATA DriveEnableData) { - /* EngDebugPrint("VGADDI", "DrvEnableDriver called...\n", 0); */ + DPRINT("DrvEnableDriver called...\n"); vgaPreCalc(); @@ -251,7 +246,7 @@ DrvEnablePDEV(IN DEVMODEW *DM, PDev = EngAllocMem(FL_ZERO_MEMORY, sizeof(PDEV), ALLOC_TAG); if (PDev == NULL) { - EngDebugPrint(DBG_PREFIX, "EngAllocMem failed for PDEV\n", 0); + DPRINT1("EngAllocMem failed for PDEV\n"); return NULL; } PDev->KMDriver = Driver; @@ -579,4 +574,13 @@ DrvGetModes(IN HANDLE Driver, return OutputSize; } +ULONG DbgPrint(PCCH Format,...) +{ + va_list ap; + va_start(ap, Format); + EngDebugPrint("VGADDI", (PCHAR)Format, ap); + va_end(ap); + return 0; +} + /* EOF */ diff --git a/reactos/drivers/video/displays/vga/objects/bitblt.c b/reactos/drivers/video/displays/vga/objects/bitblt.c index 27fa5ec01fa..27cd3f34780 100644 --- a/reactos/drivers/video/displays/vga/objects/bitblt.c +++ b/reactos/drivers/video/displays/vga/objects/bitblt.c @@ -6,13 +6,7 @@ * PROGRAMMERS: */ -#include "../vgaddi.h" -#include "../vgavideo/vgavideo.h" -#include "brush.h" -#include "bitblt.h" - -#define NDEBUG -#include +#include typedef BOOL (*PFN_VGABlt)(SURFOBJ*, SURFOBJ*, XLATEOBJ*, RECTL*, POINTL*); typedef BOOL (APIENTRY *PBLTRECTFUNC)(SURFOBJ* OutputObj, diff --git a/reactos/drivers/video/displays/vga/objects/copybits.c b/reactos/drivers/video/displays/vga/objects/copybits.c index 41add923517..719a638e17e 100644 --- a/reactos/drivers/video/displays/vga/objects/copybits.c +++ b/reactos/drivers/video/displays/vga/objects/copybits.c @@ -6,9 +6,7 @@ * PROGRAMMERS: */ -#include "../vgaddi.h" -#include "../vgavideo/vgavideo.h" -#include +#include BOOL APIENTRY DrvCopyBits( diff --git a/reactos/drivers/video/displays/vga/objects/lineto.c b/reactos/drivers/video/displays/vga/objects/lineto.c index 5a3918f63de..afffdfc54a0 100644 --- a/reactos/drivers/video/displays/vga/objects/lineto.c +++ b/reactos/drivers/video/displays/vga/objects/lineto.c @@ -6,8 +6,7 @@ * PROGRAMMERS: Copyright (C) 1998-2003 ReactOS Team */ -#include "../vgaddi.h" -#include "../vgavideo/vgavideo.h" +#include /* * Draw a line from top-left to bottom-right diff --git a/reactos/drivers/video/displays/vga/objects/offscreen.c b/reactos/drivers/video/displays/vga/objects/offscreen.c index 571fcffdf3c..864ae8c6cb4 100644 --- a/reactos/drivers/video/displays/vga/objects/offscreen.c +++ b/reactos/drivers/video/displays/vga/objects/offscreen.c @@ -8,9 +8,7 @@ /* INCLUDES ******************************************************************/ -#include "../vgaddi.h" -#include "../vgavideo/vgavideo.h" -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/drivers/video/displays/vga/objects/paint.c b/reactos/drivers/video/displays/vga/objects/paint.c index 2549ed449b1..416af2a0b60 100644 --- a/reactos/drivers/video/displays/vga/objects/paint.c +++ b/reactos/drivers/video/displays/vga/objects/paint.c @@ -6,11 +6,7 @@ * PROGRAMMERS: */ -#include "../vgaddi.h" -#include "../vgavideo/vgavideo.h" -#include "brush.h" - -#include +#include BOOL VGADDIFillSolid(SURFOBJ *Surface, RECTL Dimensions, ULONG iColor) { diff --git a/reactos/drivers/video/displays/vga/objects/pointer.c b/reactos/drivers/video/displays/vga/objects/pointer.c index bbe112b1626..698f8790fe0 100644 --- a/reactos/drivers/video/displays/vga/objects/pointer.c +++ b/reactos/drivers/video/displays/vga/objects/pointer.c @@ -8,11 +8,7 @@ /* INCLUDES ******************************************************************/ -#include "../vgaddi.h" -#include "../vgavideo/vgavideo.h" - -#define NDEBUG -#include +#include /* GLOBALS *******************************************************************/ diff --git a/reactos/drivers/video/displays/vga/objects/screen.c b/reactos/drivers/video/displays/vga/objects/screen.c index 1f5bb5534f4..ea5e8246245 100644 --- a/reactos/drivers/video/displays/vga/objects/screen.c +++ b/reactos/drivers/video/displays/vga/objects/screen.c @@ -6,8 +6,7 @@ * PROGRAMMERS: */ -#include "../vgaddi.h" -#include "../vgavideo/vgavideo.h" +#include static WORD PaletteBuffer[] = { 16, 0, // 16 entries, start with 0 @@ -125,8 +124,8 @@ BOOL DeinitVGA(PPDEV ppdev) 0, &ReturnedDataLength)) { - //DPRINT1("Failed to unmap video memory.\n"); - DbgBreakPoint(); + DPRINT1("Failed to unmap video memory.\n"); + EngDebugBreak(); return FALSE; } return TRUE; diff --git a/reactos/drivers/video/displays/vga/objects/transblt.c b/reactos/drivers/video/displays/vga/objects/transblt.c index e1dfe75291d..07cf6ff99f8 100644 --- a/reactos/drivers/video/displays/vga/objects/transblt.c +++ b/reactos/drivers/video/displays/vga/objects/transblt.c @@ -6,13 +6,7 @@ * PROGRAMMERS: */ -#include "../vgaddi.h" -#include "../vgavideo/vgavideo.h" -#include "brush.h" -#include "bitblt.h" - -#define NDEBUG -#include +#include BOOL APIENTRY DrvTransparentBlt( diff --git a/reactos/drivers/video/displays/vga/vgaddi.h b/reactos/drivers/video/displays/vga/vgaddi.h index 2c97972f9d9..3216da1978d 100644 --- a/reactos/drivers/video/displays/vga/vgaddi.h +++ b/reactos/drivers/video/displays/vga/vgaddi.h @@ -11,6 +11,17 @@ #include #include +#include "vgavideo/vgavideo.h" +#include "objects/brush.h" +#include "objects/bitblt.h" + +#ifndef NDEBUG +#define DPRINT DbgPrint +#else +#define DPRINT +#endif +#define DPRINT1 DbgPrint + /* FIXME - what a headers mess.... */ #define DDKAPI __stdcall @@ -19,10 +30,10 @@ #define DDKCDECLAPI __cdecl ULONG DbgPrint(PCCH Format,...); -VOID DDKAPI DbgBreakPoint(VOID); -VOID DDKAPI WRITE_PORT_UCHAR(IN PUCHAR Port, IN UCHAR Value); -VOID DDKAPI WRITE_REGISTER_UCHAR(IN PUCHAR Register, IN UCHAR Value); -UCHAR DDKAPI READ_REGISTER_UCHAR(IN PUCHAR Register); +VOID DDKAPI WRITE_PORT_UCHAR(IN PUCHAR Port, IN UCHAR Value); +VOID DDKAPI WRITE_PORT_USHORT(IN PUSHORT Port, IN USHORT Value); +VOID DDKAPI WRITE_REGISTER_UCHAR(IN PUCHAR Register, IN UCHAR Value); +UCHAR DDKAPI READ_REGISTER_UCHAR(IN PUCHAR Register); static __inline BOOLEAN RemoveEntryList( diff --git a/reactos/drivers/video/displays/vga/vgavideo/vgavideo.c b/reactos/drivers/video/displays/vga/vgavideo/vgavideo.c index 011c6b1d641..86083174ce0 100644 --- a/reactos/drivers/video/displays/vga/vgavideo/vgavideo.c +++ b/reactos/drivers/video/displays/vga/vgavideo/vgavideo.c @@ -6,25 +6,7 @@ * PROGRAMMERS: */ -#define _WINBASE_ -#define _WINDOWS_H -#include -#include -#include -#include -#include -#include -#include -#include -#include "vgavideo.h" - -#define DDKAPI __stdcall -#define DDKFASTAPI __fastcall -#define FASTCALL __fastcall -#define DDKCDECLAPI __cdecl - -VOID DDKAPI WRITE_PORT_UCHAR(IN PUCHAR Port, IN UCHAR Value); -VOID DDKAPI WRITE_PORT_USHORT(IN PUSHORT Port, IN USHORT Value); +#include UCHAR PreCalcReverseByte[256]; int maskbit[640]; @@ -40,9 +22,6 @@ static unsigned char leftMask; static int byteCounter; static unsigned char rightMask; -#define READ_REGISTER_UCHAR(p) (*((volatile UCHAR *)(p))) -#define WRITE_REGISTER_UCHAR(p,c) (*((volatile CHAR *)(p))) = (c) - UCHAR bytesPerPixel(ULONG Format) { /* This function is taken from /subsys/win32k/eng/surface.c @@ -460,7 +439,7 @@ void DIB_BltFromVGA(int x, int y, int w, int h, void *b, int Dest_lDelta) c1 = (vgaGetPixel(x + i, y + j) << 4) | (vgaGetPixel(x + i + 1, y + j)); c2 = ((PUCHAR)b)[(j * Dest_lDelta) + (i >> 1)]; if ((c1 & mask) != (c2 & mask)) - DbgBreakPoint(); + EngDebugBreak(); } } #endif /* VGA_VERIFY */