home *** CD-ROM | disk | FTP | other *** search
- /*
-
- Written by: Robert C. Pendleton
-
- Placed in the public domain by the author.
-
- */
-
- #include <dos.h>
- #include <conio.h>
- #include <stdio.h>
- #include <memory.h>
- #include "ptypes.h"
- #include "vesa.h"
-
- //---------------------------------------------------
-
- static uint8 _huge *screen = (uint8 *) 0xA0000000L;
- vesaInfo info;
- vesaModeInfo modeInfo;
-
- //---------------------------------------------------
-
- void
- main()
- {
- int16 oldMode;
- uint8 _huge *scrnAddr;
- int16 i;
- int16 j;
- uint32 pixel;
- uint32 pixels[] =
- {
- 0x00000000l,
- 0x01010101l,
- 0x02020202l,
- 0x03030303l,
- 0x04040404l,
- 0x05050505l,
- 0x06060606l,
- 0x07070707l,
- 0x08080808l
- };
-
-
- getVesaMode(&oldMode);
-
- setVesaMode(g320x200);
- setVesaScanLineLength(1024);
-
- setVGAColor(0, 0xf0, 0xf0, 0xf0);
- setVGAColor(1, 0x00, 0x00, 0xff);
- setVGAColor(2, 0x00, 0xff, 0x00);
- setVGAColor(3, 0x00, 0xff, 0xff);
- setVGAColor(4, 0xff, 0x00, 0x00);
- setVGAColor(5, 0xff, 0x00, 0xff);
- setVGAColor(6, 0xff, 0xff, 0x00);
- setVGAColor(7, 0xff, 0xff, 0xff);
- setVGAColor(8, 0x3c, 0x3c, 0x3c);
-
-
- top:
- for(i = 0; i < 16; i++)
- {
- setVesaWinAAddr(i);
- memset(screen, i%8, 0x8000);
- memset(screen + 0x8000l, i%8, 0x8000);
- }
-
- for(i = 0; i < 640; i += 10)
- {
- setVesaDisplayStart(0, i);
- }
-
- for(i = 0; i < 16; i++)
- {
- setVesaWinAAddr(i);
- scrnAddr = screen;
- for(j = 0; j < 64; j++)
- {
- *(scrnAddr + 0) = 8;
- *(scrnAddr + 32) = 8;
- *(scrnAddr + 64) = 8;
- *(scrnAddr + 96) = 8;
- *(scrnAddr + 128) = 8;
- *(scrnAddr + 160) = 8;
- *(scrnAddr + 192) = 8;
- *(scrnAddr + 224) = 8;
- *(scrnAddr + 256) = 8;
- *(scrnAddr + 288) = 8;
- *(scrnAddr + 320) = 8;
-
- scrnAddr += 1024;
- }
- }
-
- for(i = 0; i < 1024; i += 8)
- {
- setVesaDisplayStart(i, 0);
- }
-
- setVesaDisplayStart(0, 0);
- if(!_kbhit())goto top;
- while(!_kbhit());_getch();
- setVesaMode(oldMode);
- }
-