hschumann2/TempleOS-Source-Code
0847
1 2/*progress1-progress4 are just global vars3shown on the wallpaper. I use them in debugging a lot.4 5If you set progress1_max-progress4_max,6then a progress bar will display.7 8If you set progress1_t0-progress4_t09then the elapsed time will display.10 11If you set progress1_tf-progress4_tf12then the estimated time will display.13*/14 15U0 Main1()16{17 "\nWith description.\n";18 PressAKey;19 progress1_max=200;20 StrCpy(progress1_desc,"Progress Demo"); //PROGRESS_DESC_LEN is max21 while (progress1++!=progress1_max)22 Sleep(20);23 ProgressBarsRst;24}25Main1;26 27U0 Main2()28{29 "\nWith description and elapsed time.\n";30 PressAKey;31 progress1_max=200;32 progress1_t0=tS;33 StrCpy(progress1_desc,"Progress Demo"); //PROGRESS_DESC_LEN is max34 while (progress1++!=progress1_max)35 Sleep(20);36 ProgressBarsRst;37}38Main2;39 40U0 Main3()41{42 "\nWith description, elapsed time and registry total time.\n";43 PressAKey;44 progress1_max=200;45 progress1_t0=tS;46 RegExe("DemoCompany/ProgressBars");47 StrCpy(progress1_desc,"Progress Demo"); //PROGRESS_DESC_LEN is max48 while (progress1++!=progress1_max)49 Sleep(20);50 ProgressBarsRst("DemoCompany/ProgressBars");51}52Main3;53 54U0 Main4()55{56 "\nNo description.\n";57 PressAKey;58 progress1_max=200;59 while (progress1++!=progress1_max)60 Sleep(20);61 ProgressBarsRst;62}63Main4;64 65 66"\nNow, from asm... It's handy for debugging.\n"67"Watch the progress on the wallpaper.\n";68WinBorder(ON);69PressAKey;70 71asm {72_PROGRESS_DEMO::73 MOV RCX,1200000074@@05: MOV U64 [&progress1],RCX75 CALL &Yield76 LOOP @@0577 MOV U64 [&progress1],RCX78 RET79}80_extern _PROGRESS_DEMO U0 AsmProgressDemo();81AsmProgressDemo;82 