Team Ai
Datasetpublic

hschumann2/TempleOS-Source-Code

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes847downloads
SunMoon.txt45 linesDownload Raw Back to Graphics
1 2/*gr.dc is the persistent layer.  You can access3it directly but two tasks accessing it simultaneously4with no DCAlias() will screw-up color and stuff.5*/6 7U0 SunMoon()8{9  I64 i,x,y,radius;10 11  AutoComplete; //AutoComplete Off12  WinBorder;    //No Border13  WinMax;       //Maximize window14  DocClear;     //Clear command-line text15  Fs->text_attr=BLACK<<4+WHITE; //Current CTask is Fs segment register.16 17  for (i=0;i<0x8000;i+=0x200) {18//Sun19    x=0.2*GR_WIDTH; y=0.5*GR_HEIGHT; radius=120;20    gr.dc->color=DKGRAY;21    GrCircle(gr.dc,x,y,radius);22    gr.dc->color=ROPF_DITHER+RED<<16+YELLOW;23    GrFloodFill(gr.dc,x,y);24 25    //Moon26    x=0.8*GR_WIDTH-i/0x200; y=0.5*GR_HEIGHT; radius=75;27    gr.dc->color=DKGRAY;28    GrCircle(gr.dc,x,y,radius);29//<CTRL-ALT-a> for the "pi" character.30    GrCircle(gr.dc,x+0.5*radius,y,1.2*radius,,pi-.31*pi,0.62*pi);31    gr.dc->color=ROPF_PROBABILITY_DITHER+LTGRAY<<16+BLACK;32    gr.dc->dither_probability_u16=i;    //U16 can be [0,65535]33    GrFloodFill(gr.dc,x+0.5*radius,y);34    gr.dc->dither_probability_u16=2*i;  //U16 can be [0,65535]35    GrFloodFill(gr.dc,x-0.75*radius,y);36 37    Refresh; //Typically 30 fps38    DCFill;39  }40 41  Fs->text_attr=WHITE<<4+BLUE;42}43 44SunMoon;45