hschumann2/TempleOS-Source-Code
0847
1 2//This is the fastest you can update the whole scrn.3//See ::/Demo/Lectures/MiniGrLib.HC if this interests you.4 5F64 VGAPattern(I64 p)6{//This returns the time to update in seconds.7 F64 start=tS;8 I64 plane;9 for (plane=1;plane<0x10;plane<<=1) {10 OutU8(VGAP_IDX,VGAR_MAP_MASK);11 OutU8(VGAP_DATA,plane);12 MemSetI64(text.vga_alias,p,640*480/64);13 }14 return tS-start;15}16 17 18U0 GrDemo()19{20 I64 i;21 F64 t;22 CPURep;23 for (i=0;i<16;i++) {24 t=VGAPattern(0x5555555555555555);25 "$GREEN$Rate:$RED$%5.1f FPS$FG$"26 " [email protected]:$RED$%5.1f%%$FG$\n",1/t,100*t*30.0;27 t=VGAPattern(0x3333333333333333);28 "$GREEN$Rate:$RED$%5.1f FPS$FG$"29 " [email protected]:$RED$%5.1f%%$FG$\n",1/t,100*t*30.0;30 }31//<CTRL-ALT-v> will flush scrn VGA cache.32 VGAFlush;33}34 35GrDemo;36 