hos/video.h

67 lines
1.4 KiB
C

//video.h
// 08/18/03 Josh Holtrop
void video_init();
void video_horiz(int y, int x1, int x2, dword color);
void video_vert(int x, int y1, int y2, dword color);
void video_rect(int x1, int y1, int x2, int y2, dword color);
void video_rectf(int x1, int y1, int x2, int y2, dword color);
inline void video_pset(int x, int y, dword color);
void video_psetp(int pixel, dword color);
#define checkBoundsx(x) (x<0 ? x=0 : (x>=video_mode.XResolution ? x=video_mode.XResolution-1 : 0))
#define checkBoundsy(x) (x<0 ? x=0 : (x>=video_mode.YResolution ? x=video_mode.YResolution-1 : 0))
typedef struct{
word ModeAttributes;
byte WinAAttributes;
byte WinBAttributes;
word WinGranularity;
word WinSize;
word WinASegment;
word WinBSegment;
dword WinFuncPtr;
word BytesPerScanLine;
word XResolution;
word YResolution;
byte XCharSize;
byte YCharSize;
byte NumberOfPlanes;
byte BitsPerPixel;
byte NumberOfBanks;
byte MemoryModel;
byte BankSize;
byte NumberOfImagePages;
byte Reserved1;
byte RedMaskSize;
byte RedFieldPosition;
byte GreenMaskSize;
byte GreenFieldPosition;
byte BlueMaskSize;
byte BlueFieldPosition;
byte RsvdMaskSize;
byte RsvdFieldPosition;
byte DirectColorModeInfo;
dword PhysBasePtr;
dword OffScreenMemOffset;
word OffScreenMemSize;
byte Reserved[206];
} ModeInfoBlock;
ModeInfoBlock video_mode;
byte *vid_ptr24;
word *vid_ptr16;
dword *vid_ptr32;