-#include <ddk/ntddk.h>
-#include <ddk/ntddvdeo.h>
-#include <ddk/winddi.h>
+#define _WINBASE_
+#define _WINDOWS_H
+#include <stdarg.h>
+#include <windef.h>
+#include <guiddef.h>
+#include <wingdi.h>
+#include <winddi.h>
+#include <winioctl.h>
+#include <ntddvdeo.h>
#include <stdlib.h>
#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);
+
UCHAR PreCalcReverseByte[256];
int maskbit[640];
int y80[480];
#define READ_REGISTER_UCHAR(p) (*((volatile UCHAR *)(p)))
#define WRITE_REGISTER_UCHAR(p,c) (*((volatile CHAR *)(p))) = (c)
-INT abs(INT nm)
-{
- if(nm<0)
- {
- return nm * -1;
- } else
- {
- return nm;
- }
-}
-
-div_t div(int num, int denom)
-{
- div_t r;
- if (num > 0 && denom < 0) {
- num = -num;
- denom = -denom;
- }
- r.quot = num / denom;
- r.rem = num % denom;
- if (num < 0 && denom > 0)
- {
- if (r.rem > 0)
- {
- r.quot++;
- r.rem -= denom;
- }
- }
- return r;
-}
/*int mod(int num, int denom)
{
UCHAR a;
ULONG pre1;
ULONG orgpre1, orgx, midpre1;
- ULONG ileftpix, imidpix, irightpix;
+ LONG ileftpix, imidpix, irightpix;
orgx = x;
BOOL vgaVLine(INT x, INT y, INT len, UCHAR c)
{
- ULONG offset, i;
+ INT offset, i;
UCHAR a;
offset = xconv[x]+y80[y];
ULONG left = x >> 3;
ULONG shift = x - (x & ~0x7);
UCHAR pixel, nextpixel;
- ULONG rightcount;
- ULONG i, j;
- ULONG stride = w >> 3;
+ LONG rightcount;
+ INT i, j;
+ LONG stride = w >> 3;
/* Calculate the number of rightmost bytes not in a dword block. */
if (w >= 8)
/* Reset the destination. */
for (j = 0; j < h; j++)
{
- memset(b + (j * Dest_lDelta), 0, abs(Dest_lDelta));
+ memset((PVOID)((ULONG_PTR)b + (j * Dest_lDelta)), 0, abs(Dest_lDelta));
}
for (plane = 0; plane < 4; plane++)
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;
- ULONG x2 = x + w;
- ULONG y2 = y + h;
+ LONG i, j;
+ LONG x2 = x + w;
+ LONG y2 = y + h;
ULONG offset;
UCHAR a;
int i, j, dib_shift;
bpX = b;
- dib = bdib + y * dibw + (x / 2);
+ dib = (unsigned char *)bdib + y * dibw + (x / 2);
for (i=w; i>0; i--) {
int i, j, dib_shift, dib_and;
bpX = b;
- dib = bdib + y * dibw + (x / 2);
+ dib = (unsigned char *)bdib + y * dibw + (x / 2);
for (i=w; i>0; i--) {