3c7a0d999a43d805d86fc3106093841ac83ab480
1 // FIXME: Make these variables so we can also use modes like 800x600
10 typedef struct { int quot
, rem
; } div_t;
12 int maskbit
[640], y80
[480], xconv
[640], bit8
[640], startmasks
[8], endmasks
[8];
19 #define GRAPHICS 0x3ce
24 typedef struct _VideoMode
{
25 unsigned short VidSeg
;
27 unsigned char Feature
;
29 unsigned char Crtc
[25];
31 unsigned char Attrib
[21];
35 VOID
vgaPutPixel(INT x
, INT y
, UCHAR c
);
36 VOID
vgaPutByte(INT x
, INT y
, UCHAR c
);
37 VOID
vgaGetByte(ULONG offset
,
40 INT
vgaGetPixel(INT x
, INT y
);
41 BOOL
vgaHLine(INT x
, INT y
, INT len
, UCHAR c
);
42 BOOL
vgaVLine(INT x
, INT y
, INT len
, UCHAR c
);
44 BOOL
VGADDIIntersectRect(PRECTL prcDst
, PRECTL prcSrc1
, PRECTL prcSrc2
);
46 #define SEQ_I 0x3C4 /* Sequencer Index */
47 #define SEQ_D 0x3C5 /* Sequencer Data Register */
49 #define GRA_I 0x3CE /* Graphics Controller Index */
50 #define GRA_D 0x3CF /* Graphics Controller Data Register */
52 #define LowByte(w) (*((unsigned char *)&(w) + 0))
53 #define HighByte(w) (*((unsigned char *)&(w) + 1))
55 #define ASSIGNVP4(x, y, vp) vp = vidmem /* VBUF */ + (((x) + (y)*SCREEN_X) >> 3);
56 #define ASSIGNMK4(x, y, mask) mask = 0x80 >> ((x) & 7);
58 static unsigned char saved_SEQ_mask
; /* 0x02 */
59 static unsigned char saved_GC_eSR
; /* 0x01 */
60 static unsigned char saved_GC_fun
; /* 0x03 */
61 static unsigned char saved_GC_rmap
; /* 0x04 */
62 static unsigned char saved_GC_mode
; /* 0x05 */
63 static unsigned char saved_GC_mask
; /* 0x08 */
64 static unsigned char leftMask
;
65 static int byteCounter
;
66 static unsigned char rightMask
;
68 void get_masks(int x
, int w
);