ZealOS/src/Demo/Progress.ZC
TomAwezome 3a33e6baaf Rename CosmiC to ZealC.
Rename all .CC files to .ZC extension.
2021-12-11 06:21:22 -05:00

81 lines
1.8 KiB
HolyC
Executable file

/*$LK,"progress1",A="MN:progress1"$-$LK,"progress4",A="MN:progress4"$ are just global variables
shown on the wallpaper. Terry used them in debugging a lot.
If you set $LK,"progress1_max",A="MN:progress1_max"$-$LK,"progress4_max",A="MN:progress4_max"$,
then a progress bar will display.
If you set $LK,"progress1_t0",A="MN:progress1_t0"$-$LK,"progress4_t0",A="MN:progress4_t0"$
then the elapsed time will display.
If you set $LK,"progress1_tf",A="MN:progress1_tf"$-$LK,"progress4_tf",A="MN:progress4_tf"$
then the estimated time will display.
*/
U0 Main1()
{
"\nWith description.\n";
PressAKey;
progress1_max = 200;
StrCopy(progress1_desc, "Progress Demo"); //PROGRESS_DESC_LEN is max
while (progress1++ != progress1_max)
Sleep(20);
ProgressBarsReset;
}
Main1;
U0 Main2()
{
"\nWith description and elapsed time.\n";
PressAKey;
progress1_max = 200;
progress1_t0 = tS;
StrCopy(progress1_desc, "Progress Demo"); //PROGRESS_DESC_LEN is max
while (progress1++ != progress1_max)
Sleep(20);
ProgressBarsReset;
}
Main2;
U0 Main3()
{
"\nWith description, elapsed time and registry total time.\n";
PressAKey;
progress1_max = 200;
progress1_t0 = tS;
RegExe("DemoCompany/ProgressBars");
StrCopy(progress1_desc, "Progress Demo"); //PROGRESS_DESC_LEN is max
while (progress1++ != progress1_max)
Sleep(20);
ProgressBarsReset("DemoCompany/ProgressBars");
}
Main3;
U0 Main4()
{
"\nNo description.\n";
PressAKey;
progress1_max = 200;
while (progress1++ != progress1_max)
Sleep(20);
ProgressBarsReset;
}
Main4;
"\nNow, from asm... It's handy for debugging.\n"
"Watch the progress on the wallpaper.\n";
WinBorder(ON);
PressAKey;
asm {
_PROGRESS_DEMO::
MOV RCX, 12000000
@@05: MOV U64 [&progress1], RCX
CALL &Yield
LOOP @@05
MOV U64 [&progress1], RCX
RET
}
_extern _PROGRESS_DEMO U0 AsmProgressDemo();
AsmProgressDemo;