-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDGFX2.H
More file actions
66 lines (54 loc) · 1.85 KB
/
DGFX2.H
File metadata and controls
66 lines (54 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef __Dgfx2_H__
#define __Dgfx2_H__
/*
This is the second version of droolgfx, this time more flexible and
slightly more C++.
Works only in a 256 color linearly buffered mode, overall number of
pixels mus be dividable by 4 (SetScr and MoveScr).
Compile under Watcom C++ in 386 flat memory model.
Amit Moskovich, 12.3.98.
*/
#define VgaBuffer ((char *)0xA0000)
const int ScreenX=320;
const int ScreenY=200;
void SetScreenMode(char ModeNumber);
void PutPixel(long X, long Y, char Color, char* Buffer);
void SetScr(char* Buffer, char Color);
void MoveScr(char* Buffer1, char* Buffer2);
void BlurScreen(char* Buffer, char* TempBuffer);
void SwapChar(char* A, char* B);
void GetRgb(char Color, char* R, char* G, char* B);
void SetRgb(char Color, char R, char G, char B);
void Gradient(char Color1, char Color2, char R1, char G1, char B1, char R2, char G2, char B2);
void DisplayPalette(char* Buffer);
void SetScreenMode(char ModeNumber);
#pragma aux SetScreenMode=\
"mov ah,0 "\
"int 10h "\
parm [al] modify [ah];
void SetScreen(char* Buffer, char Color); // edi=Buffer, bl=Color.
#pragma aux SetScreen=\
"mov eax,ScreenX "\
"mov ecx,ScreenY "\
"mul ecx "\
"shr eax,2 "\
"mov ecx,eax "/* ecx=ScreenY*ScreenX/4 */\
"mov al,bl "\
"mov ah,bl "\
"rol eax,16 "\
"mov al,bl "\
"mov ah,bl "/* fill eax's 4 bytes with bl */\
"cld "\
"rep stosd "\
parm [edi] [bl] modify [eax ecx edx];
void MoveScreen(char* Buffer1, char* Buffer2); // esi=Buffer1, edi=Buffer2.
#pragma aux MoveScreen=\
"mov eax,ScreenX "\
"mov ecx,ScreenY "\
"mul ecx "\
"mov ecx,eax "\
"shr ecx,2 "/* ecx=ScreenX*ScreenY/4 */\
"cld "\
"rep movsd "\
parm [esi] [edi] modify [eax ecx edx];
#endif