home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l350 / 3.ddi / EXAMPLES / MSC / PVIDEO2.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-11  |  704 b   |  37 lines

  1. /* 
  2. PVIDEO2.C -- protected mode program to poke video display memory 
  3.             1 million times using selector 001Ch
  4. */ 
  5.  
  6. #include <stdlib.h> 
  7. #include <stdio.h> 
  8. #include <dos.h>
  9. #include <pharlap.h>
  10.  
  11. #define MAX 1000000L
  12.  
  13. int main()
  14.     FARPTR pVid;
  15.     FARPTR fp;
  16.     long i; 
  17.  
  18. //
  19. // Construct a FAR pointer to video memory using selector 001Ch, which
  20. // 386|DOS-Extender maintains and updates automatically when the video
  21. // mode is changed.
  22. //
  23.     FP_SET(pVid, 0, SS_SCREEN);
  24.  
  25.  //
  26.  // Poke video memory MAX times
  27.  //
  28.     for (i=MAX; i--; ) 
  29.     {
  30.     FP_SET(fp, FP_OFF(pVid) + (i%2000)*2, FP_SEL(pVid));
  31.     PokeFarWord(fp, (USHORT)i);
  32.     }
  33.  
  34.     return 0; 
  35.