TempleOSCDV5.01.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:48:15 +02:00
1 parent f6eacf7744
commit 320c7ee98a
219 files changed
+5211 -4853

No files matched your search

+27 -20
View File
@@ -1,14 +1,14 @@
//Place this file in /Home and change
//anything you want.
U0 InsTime()
U0 TimeIns()
{
CDate cdt;
cdt=Now;
"$$IV,1$$----%D %T----$$IV,0$$\n",cdt,cdt;
}
U0 InsFileLink()
U0 FileLinkIns()
{
U8 *st=PopUpPickFile;
st[0]=':'; //This is my personal code, not production. LOL
@@ -16,7 +16,7 @@ U0 InsFileLink()
Free(st);
}
U0 InsDirLinks()
U0 DirLinksIns()
{
CDirEntry *tmpde,*tmpde1;
U8 *st=PopUpPickDir,*st2;
@@ -128,40 +128,47 @@ Bool MyPutKey(I64 ch,I64 sc)
return TRUE;
case SC_F5:
if (sc&SCF_KEY_DESC)
KeyDescSet("Edit/God Offering");
KeyDescSet("Cmd /GodOffer");
else
GodOffer;
return TRUE;
case SC_F6:
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /Ins Misc");
KeyDescSet("Cmd /TOSIns");
else
TOSInsMisc;
TOSIns;
} else {
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /Ins Datetime");
KeyDescSet("Cmd /TimeIns");
else
InsTime;
TimeIns;
}
return TRUE;
case SC_F7:
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /God Misc");
else
GodMisc;
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /NISTGodIns2");
else
NISTGodIns2;
} else {
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /GodIns");
else
GodIns;
}
return TRUE;
case SC_F8:
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /Ins Dir Links");
KeyDescSet("Cmd /DirLinksIns");
else
InsDirLinks;
DirLinksIns;
} else {
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /Ins File Link");
KeyDescSet("Cmd /FileLinkIns");
else
InsFileLink;
FileLinkIns;
}
return TRUE;
}
@@ -180,7 +187,7 @@ Bool MyPutKey(I64 ch,I64 sc)
return TRUE;
case 'h':
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /Tile Horizontally");
KeyDescSet("Cmd /WinTileHorz");
else
WinTileHorz;
return TRUE;
@@ -192,7 +199,7 @@ Bool MyPutKey(I64 ch,I64 sc)
return TRUE;
case 'm':
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /Maximize");
KeyDescSet("Cmd /WinMax");
else {
WinBorder;
WinMax;
@@ -200,13 +207,13 @@ Bool MyPutKey(I64 ch,I64 sc)
return TRUE;
case 'v':
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /Tile Vertically");
KeyDescSet("Cmd /WinTileVert");
else
WinTileVert;
return TRUE;
case 'V':
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /Frame Grabber Toggle");
KeyDescSet("Cmd /FrameGrabberToggle");
else
FrameGrabberToggle;
return TRUE;
+2 -9
View File
@@ -3,21 +3,14 @@ Cd(__DIR__);;
//If these are not present in /Home, it uses the version in the root dir. You
//can make your own, modified, version of these files in your /Home directory.
#include "~/HomeLocalize"
#include "/Adam/Opt/Boot/MakeBoot"
#include "/Adam/Opt/Utils/MakeUtils"
#include "~/HomeWrappers"
MapFileLoad("::/Kernel/Kernel");
MapFileLoad("::/Compiler/Compiler");
#include "::/Apps/Psalmody/Load"
#include "~/TOSCfg"
#include "~/TOSMisc"
#include "~/TOSToHtml"
#include "~/TOSDistro"
#include "~/TOSBlog"
#include "~/TOSHolySpirit"
#include "~/TOS/MakeTOS"
#include "~/HomeKeyPlugIns"
#include "~/HomeWrappers"
#include "~/HomeSys"
Cd("..");;
+1 -1
View File
@@ -21,7 +21,7 @@ U0 Tmp()
Del("C:/Home/DoDistro.HC.Z");
Del("D:/Home/DoDistro.HC.Z");
OnceDrv('C',"\"\n\nRun TOSStaffIns;\n\n\n\";");
OnceDrv('D',"\"\n\nRun TOSStaffIns;\n\n\n\";");
OnceDrv('D',""); //This command uses cached Registry file.
if (PressAKey!=CH_SHIFT_ESC)
Reboot; //Too dangerous for amateurs until reboot.
}
+3 -3
View File
@@ -1,8 +1,8 @@
$MA,"Cd ",LM="Cd;Dir;\n"$$MA,"DrvC ",LM="Drv('C');\n"$$MA,"DrvD ",LM="Drv('D');\n"$$MA,"/ ",LM="Cd(\"/\");Dir;\n"$$MA,"Home ",LM="Cd(\"/Home\");Dir;\n"$$MA,"ChgDskT ",LM="ChgDsk('T');\n"$$MA,"MergeD ",LM="S2T(\"C:/*\",\"+r+S\");Merge(\"C:/*;!*/LineRep*\",\"D:/*;!*/LineRep*\",\"+r+d\");\n"$$MA,"MergeT ",LM="S2T(\"C:/*\",\"+r+S\");Merge(\"C:/*;!*/LineRep*\",\"T:/*;!*/LineRep*\",\"+r+d\");\n"$$MA,"D:/Wb ",LM="Cd(\"D:/Wb\");Dir;\n"$
$MA,"MakeC ",LM="TOSBootHDIns('C');\n"$$MA+PU,"BootC ",LM="BootRAM(\"C:/Kernel.BIN.C\");"$$MA,"Regen ",LM="TOSRegen;\n"$$MA,"PreBack ",LM="PreBackUp;\n"$$MA,"MakeD ",LM="TOSBootHDIns('D');\n"$$MA+PU,"BootD ",LM="BootRAM(\"D:/Kernel.BIN.C\");"$$MA,"CopyDrv ",LM="TOSPromptAndCopyDrv;\n"$$MA,"MakeWeb ",LM="MakeWebSitePartial;\n"$
$MA,"Cd ",LM="Cd;Dir;\n"$$MA,"DrvC ",LM="Drv('C');\n"$$MA,"DrvD ",LM="Drv('D');\n"$$MA,"/ ",LM="Cd(\"/\");Dir;\n"$$MA,"TOS ",LM="Cd(\"/Home/TOS\");Dir;\n"$$MA,"Home ",LM="Cd(\"/Home\");Dir;\n"$$MA,"ChgDskT ",LM="ChgDsk('T');\n"$$MA,"MergeD ",LM="S2T(\"C:/*\",\"+r+S\");Merge(\"C:/*;!*/LineRep*\",\"D:/*;!*/LineRep*\",\"+r+d\");\n"$$MA,"MergeT ",LM="S2T(\"C:/*\",\"+r+S\");Merge(\"C:/*;!*/LineRep*\",\"T:/*;!*/LineRep*\",\"+r+d\");\n"$$MA,"D:/Wb ",LM="Cd(\"D:/Wb\");Dir;\n"$
$MA,"MakeC ",LM="TOSBootHDIns('C');\n"$$MA+PU,"BootC ",LM="BootRAM(\"C:/Kernel.BIN.C\");"$$MA,"Regen ",LM="TOSRegen;\n"$$MA,"PreRegen",LM="TOSPreRegen;\n"$$MA,"MakeD ",LM="TOSBootHDIns('D');\n"$$MA+PU,"BootD ",LM="BootRAM(\"D:/Kernel.BIN.C\");"$$MA,"CopyDrv ",LM="TOSPmtAndCopyDrv;\n"$$MA,"MakeWeb ",LM="FreshenBlog;\n"$
$MA,"Kernel ",LM="Cd(\"/Kernel\");Dir;\n"$$MA,"Compiler",LM="Cd(\"/Compiler\");Dir;\n"$$MA,"BlkDev ",LM="Cd(\"/Kernel/BlkDev\");Dir;\n"$$MA,"Mem ",LM="Cd(\"/Kernel/Mem\");Dir;\n"$$MA,"Serial ",LM="Cd(\"/Kernel/SerialDev\");Dir;\n"$$MA,"Bin ",LM="Cd(\"/Home/Sup1/Sup1Bin\");Dir;\n"$$MA,"HDAudio ",LM="Cd(\"/Home/Sup1/Sup1HDAudio\");Dir;\n"$$MA,"Examples",LM="Cd(\"/Home/Sup1/Sup1HDAudio/Examples\");Dir;\n"$$MA,"Dist ",LM="Cd(\"/Home/Sup1/Sup1Distro\");Dir;\n"$
$MA,"Adam ",LM="Cd(\"/Adam\");Dir;\n"$$MA,"AutoComp",LM="Cd(\"/Adam/AutoComplete\");Dir;\n"$$MA,"Ctrls ",LM="Cd(\"/Adam/Ctrls\");Dir;\n"$$MA,"ABlkDev ",LM="Cd(\"/Adam/ABlkDev\");Dir;\n"$$MA,"DolDoc ",LM="Cd(\"/Adam/DolDoc\");Dir;\n"$$MA,"Gr ",LM="Cd(\"/Adam/Gr\");Dir;\n"$$MA,"God ",LM="Cd(\"/Adam/God\");Dir;\n"$$MA,"Snd ",LM="Cd(\"/Adam/Snd\");Dir;\n"$$MA,"Boot ",LM="Cd(\"/Adam/Opt/Boot\");Dir;\n"$$MA,"Utils ",LM="Cd(\"/Adam/Opt/Utils\");Dir;\n"$
$LK+X,"ChangeLg",A="FI:::/Doc/ChangeLog.DD"$$MA,"Blog ",LM="Blog;\n"$$MA,"EdGod ",LM="Ed(\"D:/Home/God.DD\");\n"$$MA,"BlogDir ",LM="Cd(\"/Home/Web/TAD/BlogDir\");Dir;\n"$$MA,"Partial ",LM="MakeWebSitePartial;\n"$$MA,"CodeWalk",LM="CodeWalkThru;\n"$$MA,"TOSTheme",LM="TempleOSTheme;\n"$$MA,"Videos ",LM="Cd(\"/Home/Sup1/Sup1Videos\");Dir;\n"$
$LK+X,"ChgLog ",A="FI:::/Doc/ChgLog.DD"$$MA,"Blog ",LM="Blog;\n"$$MA,"EdGod ",LM="Ed(\"D:/Home/God.DD\");\n"$$MA,"BlogDir ",LM="Cd(\"/Home/Web/TAD/BlogDir\");Dir;\n"$$MA,"Partial ",LM="FreshenBlog;\n"$$MA,"CodeWalk",LM="CodeWalkThru;\n"$$MA,"TOSTheme",LM="TOSTheme;\n"$$MA,"Videos ",LM="Cd(\"/Home/Sup1/Sup1Videos\");Dir;\n"$
$MA,"Web ",LM="Cd(\"/Home/Web\");Dir;\n"$$MA,"TAD ",LM="Cd(\"/Home/Web/TAD\");Dir;\n"$$MA,"DLC ",LM="Cd(\"/Home/Web/DLC\");Dir;\n"$$MA,"AppStore",LM="Cd(\"/Home/Web/AppStore\");Dir;\n"$$MA,"Sup1 ",LM="Cd(\"/Home/Sup1\");Dir;\n"$$MA,"Blog ",LM="Cd(\"/Home/Sup1/Sup1Blog\");Dir;\n"$$MA,"Code ",LM="Cd(\"/Home/Sup1/Sup1CodeScraps\");Dir;\n"$$MA,"Games ",LM="Cd(\"/Home/Sup1/Sup1Games\");Dir;\n"$$MA,"Graphics",LM="Cd(\"/Home/Sup1/Sup1Graphics\");Dir;\n"$$MA,"Utils ",LM="Cd(\"/Home/Sup1/Sup1Utils\");Dir;\n"$
$MA,"Apps ",LM="Cd(\"/Apps\");Dir;\n"$$MA,"Budget ",LM="Cd(\"/Apps/Budget\");Dir;\n"$$MA,"GrModels",LM="Cd(\"/Apps/GrModels\");Dir;\n"$$MA,"KeepAway",LM="Cd(\"/Apps/KeepAway\");Dir;\n"$$MA,"Logic ",LM="Cd(\"/Apps/Logic\");Dir;\n"$$MA,"Psalmody",LM="Cd(\"/Apps/Psalmody\");Dir;\n"$$MA,"Span ",LM="Cd(\"/Apps/Span\");Dir;\n"$$MA,"Strut ",LM="Cd(\"/Apps/Strut\");Dir;\n"$$MA,"TimeClk ",LM="Cd(\"/Apps/TimeClock\");Dir;\n"$
$MA,"Titan ",LM="Cd(\"/Apps/Titanium\");Dir;\n"$$MA,"ToTheFrt",LM="Cd(\"/Apps/ToTheFront\");Dir;\n"$$MA,"Vocab ",LM="Cd(\"/Apps/Vocabulary\");Dir;\n"$$MA,"XCaliber",LM="Cd(\"/Apps/X-Caliber\");Dir;\n"$$MA,"Books1 ",LM="Cd(\"/Home/Books1\");Dir;\n"$$MA,"Books2 ",LM="Cd(\"/Home/Books2\");Dir;\n"$$MA,"Hymns ",LM="Cd(\"/Home/Sup1/Sup1Hymns\");Dir;\n"$$MA,"Songs ",LM="Cd(\"/Home/Sup1/Sup1Songs\");Dir;\n"$
+5 -10
View File
@@ -1,4 +1,5 @@
$WW,1$$FG,5$$TX+CX,"TODO"$$FG$
* $LK,"::/Apps/X-Caliber/X-Caliber.HC"$
* Add asteroid harbor defense.
* Afterburner thruster.
@@ -10,27 +11,21 @@ $WW,1$$FG,5$$TX+CX,"TODO"$$FG$
* Helicopters.
* Anti-Aircraft.
* Make registry files more robust.
* $MA-X+PU,"64-Bit Device Memory",LM="F(\"mem64_ptr\");View;"$ is not implemented.
* $LK,"::/Demo/RandDemo.HC"$ is kinda crappy.
* Cursor in $LK,"~/TOSToHtml.HC"$.
* Cursor in $LK,"~/TOS/TOSToHtml.HC"$.
* Investigate why packet loss $LK,"Training Sleep(1)",A="FF:::/Adam/Training.HC,Sleep(1)"$.
* Naming standard with regard to "MAX_".
* Add AVL or red/black binary tree library support. We have fixed-size stack. Auto-balancing binary tree is very needed. I've done everything myself. I don't want to ruin a perfect record. I'm in no hurry.
* $LK,"SpriteEd",A="FI:::/Adam/Gr/SpriteEd.HC"$ shift pts, Ctrl pt for ellipse/polygon w,h is off when rotated.
* Get rid of $LK,"JobQue",A="MN:JobQue"$() and use just $LK,"Spawn",A="MN:Spawn"$()? Not sure about this, probably.
* God said this is bad. $LK,"FL:::/Adam/DolDoc/DocFind.HC,41"$
* Backward <SHIFT-F3> is broken?
* $LK,"Find",A="MN:Find"$() search sprite text?
* Cannot include ':' in $LK,"Document Links",A="FF:::/Adam/DolDoc/DocLink.HC,AD"$ search string.
* $$DA fixed width string: <Del> or <BACKSPACE> permanently shortens.
@@ -442,7 +437,7 @@ $FG,5$$TX+CX,"Misc Notes"$$FG$
Erik van der Karbargenbok: $LK,"TempleBot",A="PI:~/Sup1/Sup1Bin/TempleBot"$.
Intel CEO's name: Brian Krzanich
>$FG,2$lspci -v$FG$
Size:$TX,"17354KB",D="DD_TEMPLEOSCD_K_SIZE"$
Size:$TX,"17378KB",D="DD_TEMPLEOSCD_K_SIZE"$
$FG,5$$TX+CX,"My Web Bookmarks"$$FG$$WW,0$
$TX,"My FireFox Bookmarks",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/Bookmarks"$
+15 -12
View File
@@ -2,9 +2,9 @@ $TR-UL,"Adam"$
$ID,2$$TR,"SysMsgFlags"$
$ID,2$sys_msg_flags[0]=0xFF;
$ID,-2$$TR,"SysRegVer"$
$ID,2$registry_version=5.000;
$ID,2$registry_version=5.010;
$ID,-2$$TR,"InsReg"$
$ID,2$#help_index "Misc/Install Registration"
$ID,2$#help_index "Registry/Install Registration"
MemSet(&ins_reg,0,sizeof(CInsReg));
ins_reg.registered=1;
ins_reg.host_os=2;
@@ -24,12 +24,12 @@ HashPublic("INS_REG_MACHINE_NUM",HTT_DEFINE_STR);
$ID,-2$$ID,-2$$TR-UL,"TempleOS"$
$ID,2$$TR,"EagleDive"$
$ID,2$F64 best_score=147.6932;
$ID,-2$$TR,"TOSGodOffer"$
$ID,2$I64 tos_gus_gwen=22;
$ID,-2$$TR,"TOSVideos"$
$ID,2$I64 tos_code_walk_thru=105;
$ID,-2$$TR,"DiningStars"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"CircleTrace"$
$ID,2$F64 best_score=4.9425;
$ID,-2$$TR,"TOSNIST"$
$ID,2$I64 tos_nist_offset=-8049;
$ID,-2$$TR,"BlackDiamond"$
$ID,2$I64 best_score=1;
$ID,-2$$TR,"DunGen"$
@@ -52,20 +52,23 @@ $ID,-2$$TR,"BomberGolf"$
$ID,2$I64 best_score=175;
$ID,-2$$TR,"OSTestSuite"$
$ID,2$progress1_tf=0.000;progress2_tf=0.000;
progress3_tf=0.000;progress4_tf=220.470;
progress3_tf=0.000;progress4_tf=228.734;
$ID,-2$$TR,"Titanium"$
$ID,2$I64 best_score=16469;
$ID,-2$$TR,"XCaliber"$
$ID,2$I64 best_score=90;
I64 msg_flags=3;
I64 msg_flags=2;
$ID,-2$$TR,"Talons"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"CircleTrace"$
$ID,2$F64 best_score=4.9425;
$ID,-2$$TR,"TOSRegen"$
$ID,2$progress1_tf=0.000;progress2_tf=0.000;
progress3_tf=0.000;progress4_tf=174.320;
progress3_tf=0.000;progress4_tf=192.371;
$ID,-2$$ID,-2$$TR,"Once"$
$ID,2$$TR,"Adam"$
$ID,2$$ID,-2$$TR,"User"$
$ID,2$$ID,-2$$ID,-2$
$ID,2$$ID,-2$$ID,-2$$TR,"DemoCompany"$
$ID,2$$TR,"Game1"$
$ID,2$F64 best_score=1735.08564;
$TR,"SimpleVal"$
$ID,2$1236;
$ID,-2$$ID,-2$$ID,-2$
+13
View File
@@ -0,0 +1,13 @@
Cd(__DIR__);;
#include "TOSExt"
#include "TOSCfg"
#include "TOSMisc"
#include "TOSToHtml"
#include "TOSDistro"
#include "TOSBlog"
#include "TOSNIST"
#include "TOSHolySpirit"
#include "TOSIns"
Cd("..");;
@@ -1,18 +1,19 @@
U8 *BlogLocalDir(CDate cdt=0)
{
#help_index "Misc/Blog"
public U8 *BlogLocalDir(CDate cdt=0)
{//MAlloc dirname of blog for date.
static U8 dir[STR_LEN];
CDateStruct ds;
if (!cdt) cdt=Now+local_time_offset;
Date2Struct(&ds,cdt);
StrPrint(dir,BLOG_LOCAL_BASE "/%d%Z",
ds.year,ds.mon-1,"ST_MONTHS");
StrPrint(dir,BLOG_LOCAL_BASE "/%d%Z",ds.year,ds.mon-1,"ST_MONTHS");
if (!FileFind(dir,,FUF_JUST_DIRS))
MkDir(dir);
return dir;
}
U8 *BlogLocalFile(CDate cdt=0)
{
public U8 *BlogLocalFile(CDate cdt=0)
{//MAlloc filename of blog for date.
static U8 file[STR_LEN];
CDateStruct ds;
if (!cdt) cdt=Now+local_time_offset;
@@ -22,8 +23,8 @@ U8 *BlogLocalFile(CDate cdt=0)
return file;
}
U8 *BlogWebDir(CDate cdt=0)
{
public U8 *BlogWebDir(CDate cdt=0)
{//MAlloc D:/Wb/dirname of blog for date.
static U8 dir[STR_LEN];
CDateStruct ds;
if (!cdt) cdt=Now+local_time_offset;
@@ -33,8 +34,8 @@ U8 *BlogWebDir(CDate cdt=0)
return dir;
}
U8 *BlogWebFile(CDate cdt=0)
{
public U8 *BlogWebFile(CDate cdt=0)
{//MAlloc D:/Wb/filename of blog for date.
static U8 file[STR_LEN];
CDateStruct ds;
if (!cdt) cdt=Now+local_time_offset;
@@ -45,15 +46,15 @@ U8 *BlogWebFile(CDate cdt=0)
}
public U8 *FileNameNumNext(U8 *files_find_mask,U8 *fmt)
{
{//Cnt files in a mask. Create next filename.
CDirEntry *tmpde=FilesFind(files_find_mask);
U8 *res=MStrPrint(fmt,FileCnt(tmpde));
DirTreeDel(tmpde);
return res;
}
U0 BlogDCImgWrite(CDC *dc,CDate cdt=0)
{
public U0 BlogDCImgWrite(CDC *dc,CDate cdt=0)
{//Add dc to blog as BMP file.
U8 file_mask[STR_LEN],file_name[STR_LEN],*st1,*st2;
if (!cdt) cdt=Now+local_time_offset;
StrPrint(file_mask,"%s/Img*",BlogLocalDir(cdt));
@@ -67,9 +68,9 @@ U0 BlogDCImgWrite(CDC *dc,CDate cdt=0)
Free(st2);
}
U0 BlogScrnShot()
{
Bool old_cursor=DocCursor;
public U0 BlogScrnShot()
{//Add scrn shot to blog as BMP file.
Bool old_cursor=DocCursor,old_silent;
CDC *dc1,*dc2;
U8 *old_fp_draw_ms=gr.fp_draw_ms;
gr.fp_draw_ms=NULL;
@@ -81,15 +82,18 @@ U0 BlogScrnShot()
DCDel(dc1);
DCDel(dc2);
DocCursor(old_cursor);
old_silent=Silent;
FreshenBlog;
Silent(old_silent);
}
public U0 MakeWebSitePartial()
{
public U0 FreshenBlog()
{//Regen html files for D:/Home/Web.
MkDir("D:/Wb");
MkDir("D:/Wb/Home");
MkDir("D:/Wb/Home/Web");
MkDir("D:/Wb/Home/Web/TAD");
MkDir("D:/Wb/Home/Web/TAD/BlogDir");
MkDir("D:/Wb/Home/Web/" INS_REG_PERSONAL_INITIALS);
MkDir("D:/Wb/Home/Web/" INS_REG_PERSONAL_INITIALS "/BlogDir");
FreshenWebDir("/Home/Web");
FreshenWebDir("/Home/Web/" INS_REG_PERSONAL_INITIALS);
@@ -97,8 +101,8 @@ public U0 MakeWebSitePartial()
Drv('C');
}
public U0 Blog(Bool ALT_F6=TRUE)
{
public U0 Blog(Bool god_misc2=FALSE)
{//Make entry in blog.
if (!FileFind(BlogLocalFile,,FUF_JUST_FILES))
Copy("~/Web/" INS_REG_PERSONAL_INITIALS "/DailyBlogHeader.DD.Z",
BlogLocalFile);
@@ -106,7 +110,9 @@ public U0 Blog(Bool ALT_F6=TRUE)
WinBorder;
WinMax;
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN|SCF_CTRL);
if (ALT_F6) {
if (god_misc2)
Msg(MSG_KEY_DOWN_UP,0,SC_F7|SCF_SHIFT|SCF_ALT);
else {
Msg(MSG_KEY_DOWN_UP,0,SC_F6|SCF_ALT);
Msg(MSG_KEY_DOWN_UP,'\n',0);
}
@@ -1,4 +1,4 @@
#help_index "TOS"
#help_index "Misc/TOS/Cfg"
#define PERSONAL_WEB "http:/" "/www.templeos.org/Wb"
#define BLOG_BASE "/Home/Web/"\
@@ -9,24 +9,24 @@
#define BLOG_WEB_BASE PERSONAL_WEB BLOG_BASE
#define SLOP BLK_SIZE
U0 TOSBootRescueDrv1()
U0 TOSDbgDistro1()
{
CBinFile *bfh=mem_boot_base-sizeof(CBinFile);
bfh(I64)+=bfh->file_size-1;
DefinePrint("TOS_BOOT_RESCUE_DRV","0x%X",
DefinePrint("TOS_DBG_DISTRO","0x%X",
CeilI64(SYS_KERNEL_END+SLOP,BLK_SIZE));
DefinePrint("TOS_BOOT_RESCUE_DRV_END", "0x%X",FloorI64(
DefinePrint("TOS_DBG_DISTRO_END", "0x%X",FloorI64(
(BOOT_RAM_LIMIT-(BOOT_STK_SIZE+DVD_BOOT_LOADER_SIZE))>>4<<4-
(bfh(I64)-SYS_KERNEL_END)-SLOP,BLK_SIZE));
DefinePrint("CFG_BOOT_RESCUE_DRV_FILE","\"/Tmp/BootRescueDrv.BIN.Z\"");
} TOSBootRescueDrv1;
DefinePrint("CFG_DBG_DISTRO_FILE","\"/Tmp/DbgDistro.BIN.Z\"");
} TOSDbgDistro1;
U0 TOSBootRescueDrv2()
U0 TOSDbgDistro2()
{
DefinePrint("CFG_BOOT_RESCUE_DRV","\"a0x%X\n0x%X\n\"",TOS_BOOT_RESCUE_DRV,
(TOS_BOOT_RESCUE_DRV_END-TOS_BOOT_RESCUE_DRV)/BLK_SIZE);
DefinePrint("CFG_BOOT_RESCUE_DRV_START","\"0x%X\"",TOS_BOOT_RESCUE_DRV);
} TOSBootRescueDrv2;
DefinePrint("CFG_DBG_DISTRO","\"a0x%X\n0x%X\n\"",TOS_DBG_DISTRO,
(TOS_DBG_DISTRO_END-TOS_DBG_DISTRO)/BLK_SIZE);
DefinePrint("CFG_DBG_DISTRO_START","\"0x%X\"",TOS_DBG_DISTRO);
} TOSDbgDistro2;
U0 TOSInit()
{
@@ -62,8 +62,8 @@ U0 TOSInit()
#define TOS_CFG "\n" CFG_RAM_DRVS CFG_DVD_DRVS CFG_HARD_DRVS "\n"\
CFG_DSK_CACHE CFG_OPTS
#define TOS_DVD_CFG "TB\n0x20000\nT \n\n\nStaffMode\nAutoMountIDE\nCT\n"
#define TOS_DVD_DBG_CFG "A" CFG_BOOT_RESCUE_DRV\
#define TOS_DVD_DBG_CFG "A" CFG_DBG_DISTRO\
"B\nScale2Mem(2048,0x40000)\n\n\n"\
"NoMP\nTextMode\nDontProbe\nBootRescueDrv\n"\
"C:" CFG_BOOT_RESCUE_DRV_FILE "\n"\
CFG_BOOT_RESCUE_DRV_START "\n\n"
"NoMP\nTextMode\nDontProbe\nDbgDistro\n"\
"C:" CFG_DBG_DISTRO_FILE "\n"\
CFG_DBG_DISTRO_START "\n\n"
@@ -1,6 +1,6 @@
//The CFG defines are $LK,"~/TOSCfg.HC",A="FI:::/Demo/AcctExample/TOSCfg.HC"$.
//The CFG defines are $LK,"~/TOS/TOSCfg.HC",A="FI:::/Demo/AcctExample/TOS/TOSCfg.HC"$.
#help_index "TOS"
#help_index "Misc/TOS/Distro"
#define MAKE_STD 1
#define MAKE_STD_RS 0
@@ -13,8 +13,8 @@
#define MAKE_DBG 0
#define MAKE_STAFF 1
U8 TOSGetDrv()
{
public U8 TOSGetDrv()
{//Pmt for drv let.
I64 res;
"Drive (%s):",TOS_HDS;
res=Let2Let(GetChar);
@@ -22,8 +22,8 @@ U8 TOSGetDrv()
return res;
}
U0 TOSBootHDIns(U8 drv_let=0)
{
public U0 TOSBootHDIns(U8 drv_let=0)
{//Make Compiler and Kernel. Reinstall Kernel.
drv_let=Let2Let(drv_let);
In(TOS_CFG);
BootHDIns(drv_let);
@@ -31,8 +31,8 @@ U0 TOSBootHDIns(U8 drv_let=0)
BootMHDIns(drv_let);
}
U0 TOSCopyDrv(U8 src,U8 dst)
{
public U0 TOSCopyDrv(U8 src,U8 dst)
{//Fmt dst and copy entire drv.
U8 buf_s[STR_LEN],buf_d[STR_LEN];
src=Let2Let(src);
dst=Let2Let(dst);
@@ -48,9 +48,9 @@ U0 TOSCopyDrv(U8 src,U8 dst)
TOSBootHDIns(dst);
}
U0 TOSPromptAndCopyDrv()
{
I64 src,dst;
public U0 TOSPmtAndCopyDrv()
{//Pmt for drv lets. Then, Fmt dst and copy entire drv.
I64 src,dst;
"$$RED$$\nCopy Src Drive:\n$$FG$$";
src=TOSGetDrv;
"$$RED$$\nCopy Dst Drive:\n$$FG$$";
@@ -58,7 +58,7 @@ U0 TOSPromptAndCopyDrv()
TOSCopyDrv(src,dst);
}
public U0 CopySongs(U8 threshold='7')
U0 DistroSongsPrep(U8 threshold='7')
{
CDoc *doc;
CDocEntry *doc_e;
@@ -79,10 +79,13 @@ public U0 CopySongs(U8 threshold='7')
U0 DistroPrep()
{
AOnceFlush; //Don't want in Registry
OnceFlush;
Del("/Home/Demo*");
DelTree("/Home/*Tmp.DD.Z");
if (FileFind("/Home/Sup1/Sup1Hymns"))
CopySongs;
DistroSongsPrep;
DelTree("/Tmp");
MkDir("/Tmp");
@@ -102,13 +105,13 @@ U0 DistroPrep()
Del("/Demo/AcctExample/Test*");
Copy("/Home/Web/index.DD.Z",
"/Demo/ToHtmlToTXTDemo/DemoInPage.DD.Z");
if (FileFind("/Home/Sup1/Sup1Utils/SortHeaders.HC.Z"))
ExeFile("/Home/Sup1/Sup1Utils/SortHeaders.HC.Z");
if (FileFind("~/Sup1/Sup1Utils/SortHeaders.HC.Z"))
ExeFile("~/Sup1/Sup1Utils/SortHeaders.HC.Z");
if (FileFind("/Home/Sup1/Sup1Blog/YouTube.DD.Z"))
Sort("/Home/Sup1/Sup1Blog/YouTube.DD.Z",,2);
if (FileFind("~/Sup1/Sup1Blog/YouTube.DD.Z"))
Sort("~/Sup1/Sup1Blog/YouTube.DD.Z",,2);
//Once in a while, do $LK,"~/Sup1/Sup1Utils/DblSpaceScan.HC"$.
//Once in a while, do ~/Sup1/Sup1Utils/DblSpaceScan.HC.
CursorRem("/*");
DelTree("/Demo/*.BI*");
@@ -117,11 +120,11 @@ U0 DistroPrep()
Move(ACD_DEF_FILENAME,ACD_DEF_FILENAME_Z);
}
U0 MakeBootRescueDrvFile()
U0 DbgDistroFilePrep()
{
CBlkDev *bd;
if (!Let2Drv('A',FALSE)) {
In(CFG_BOOT_RESCUE_DRV "\n");
In(CFG_DBG_DISTRO "\n");
Mount;
}
bd=Let2BlkDev('A');
@@ -148,7 +151,7 @@ U0 MakeBootRescueDrvFile()
Copy("C:/Adam/AMem.HC.Z", "A:/Adam");
Copy("C:/Adam/TaskRep.HC.Z", "A:/Adam");
FileWrite("C:" CFG_BOOT_RESCUE_DRV_FILE,
FileWrite("C:" CFG_DBG_DISTRO_FILE,
bd->RAM_dsk,(bd->max_blk+1)<<BLK_SIZE_BITS);
}
@@ -193,8 +196,8 @@ I64 MakeLineRepFile()
DistroPrep;
Cd("C:/");
DelTree("B:/TOS");
CopyTree("C:/Home","B:/TOS");
DelTree("B:/TOS/TOS");
CopyTree("C:/Home","B:/TOS/TOS");
DelTree("C:/Home");
DocMax;
@@ -202,7 +205,7 @@ I64 MakeLineRepFile()
res=LineRep;
if (doc=DocPut) {
st=StrNew(doc->filename.name);
StrCpy(doc->filename.name,"B:/TOS/Web/LineRep.DD.Z");
StrCpy(doc->filename.name,"B:/TOS/TOS/Web/LineRep.DD.Z");
DocWrite(doc);
StrCpy(doc->filename.name,st);
Free(st);
@@ -213,8 +216,8 @@ I64 MakeLineRepFile()
LineRep("C:/Compiler/*","-S+$$")+
LineRep("C:/Kernel/*");
DocClear;
CopyTree("B:/TOS","C:/Home");
DelTree("B:/TOS");
CopyTree("B:/TOS/TOS","C:/Home");
DelTree("B:/TOS/TOS");
doc=DocRead("C:/Adam/ADefine.HC.Z");
DocTreeFind(doc,"LineRep",&tree_branch,&start_indent,&end_indent);
@@ -253,7 +256,7 @@ U0 MakeStaffDistro()
ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOS_STAFF_SIZE",
"Download $TX,"TempleOS V5.00",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1fMB)",
"Download $TX,"TempleOS V5.01",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1fMB)",
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
Drv('C');
}
@@ -262,7 +265,7 @@ U0 DbgDistroPrep()
{
Drv('C');
DistroPrep;
MakeBootRescueDrvFile;
DbgDistroFilePrep;
In(TOS_DVD_DBG_CFG);
BootDVDIns('C');
Fmt('B',,FALSE,FSt_REDSEA);
@@ -280,7 +283,7 @@ U0 MakeDbgDistro()
ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOS_DBG_SIZE",
"Download $TX,"TempleOS V5.00",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1fMB)",
"Download $TX,"TempleOS V5.01",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1fMB)",
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
Drv('C');
}
@@ -306,7 +309,7 @@ U0 MakeStdDistro()
ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOSCD_SIZE",
"Download $TX,"TempleOS V5.00",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
"Download $TX,"TempleOS V5.01",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
Drv('C');
}
@@ -315,7 +318,7 @@ U0 MakeStdRedSeaDistro()
StdDistroPrep;
RedSeaISO(TOS_ISO_C_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOSCD_RS_SIZE",
"Download $TX,"TempleOS V5.00",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1fMB)",
"Download $TX,"TempleOS V5.01",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1fMB)",
0.1*(10*Size(TOS_ISO_C_NAME,"+s")/1024/1024));
Drv('C');
}
@@ -348,7 +351,7 @@ U0 MakeUltraDistro()
ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOS_ULTRA_SIZE",
"Download $TX,"TempleOS V5.00",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2fMB)",
"Download $TX,"TempleOS V5.01",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2fMB)",
0.01*(100*Size(TOS_ISO_NAME,"+s")/1024/1024));
Drv('C');
}
@@ -357,7 +360,7 @@ U0 MakeUltraRedSeaDistro()
UltraDistroPrep;
RedSeaISO(TOS_ISO_C_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOS_ULTRA_RS_SIZE",
"Download $TX,"TempleOS V5.00",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2fMB)",
"Download $TX,"TempleOS V5.01",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2fMB)",
0.01*(100*Size(TOS_ISO_C_NAME,"+s")/1024/1024));
Drv('C');
}
@@ -367,28 +370,28 @@ U0 UpdateISODocDefines()
try {
#if MAKE_STD
DefinePrint("DD_TEMPLEOSCD_SIZE",
"Download $TX,"TempleOS V5.00",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
"Download $TX,"TempleOS V5.01",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
0.1*(10*Size("D:/Wb/TempleOSCD.ISO","+s")/1024/1024));
DefinePrint("DD_TEMPLEOSCD_K_SIZE",
"%dKB",Size("D:/Wb/TempleOSCD.ISO","+s")/1024);
#endif
#if MAKE_STD_RS
DefinePrint("DD_TEMPLEOSCD_RS_SIZE",
"Download $TX,"TempleOS V5.00",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1fMB)",
"Download $TX,"TempleOS V5.01",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1fMB)",
0.1*(10*Size("D:/Wb/TempleOSCDRS.ISO","+s")/1024/1024));
DefinePrint("DD_TEMPLEOSCD_RS_K_SIZE",
"%dKB",Size("D:/Wb/TempleOSCDRS.ISO","+s")/1024);
#endif
#if MAKE_ULTRA
DefinePrint("DD_TEMPLEOS_ULTRA_SIZE",
"Download $TX,"TempleOS V5.00",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2fMB)",
"Download $TX,"TempleOS V5.01",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2fMB)",
0.01*(100*Size("D:/Wb/TempleOSUltra.ISO","+s")/1024/1024));
DefinePrint("DD_TEMPLEOS_ULTRA_K_SIZE",
"%dKB",Size("D:/Wb/TempleOSUltra.ISO","+s")/1024);
#endif
#if MAKE_ULTRA_RS
DefinePrint("DD_TEMPLEOS_ULTRA_RS_SIZE",
"Download $TX,"TempleOS V5.00",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2fMB)",
"Download $TX,"TempleOS V5.01",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2fMB)",
0.01*(100*Size("D:/Wb/TempleOSUltraRS.ISO","+s")/1024/1024));
DefinePrint("DD_TEMPLEOS_ULTRA_RS_K_SIZE",
"%dKB",Size("D:/Wb/TempleOSUltraRS.ISO","+s")/1024);
@@ -399,32 +402,54 @@ U0 UpdateISODocDefines()
UpdateISODocDefines;
I64 tos_progress;
F64 tos_progress_t0;
U0 TOSProgress(U8 *st)
{
U8 buf[STR_LEN];
progress4=tos_progress;
progress3_max=1;
*progress4_desc=0;
progress4_max=13+MAKE_STD+MAKE_STD_RS+MAKE_ULTRA+MAKE_ULTRA_RS+MAKE_SUP1+
MAKE_WEB+MAKE_BOOKS1+MAKE_BOOKS2+MAKE_DBG+MAKE_STAFF;
progress4_t0=tos_progress_t0;
StrPrint(buf,"%d. %s",++progress4,st);
"$$PURPLE$$$$TX+CX,\"%s\"$$$$FG$$\n",buf;
StrCpy(progress3_desc,buf);
tos_progress=progress4;
}
U0 TOSProfanity()
I64 TOSProfanity()
{
Profanity(,"D:/Wb/*;"
I64 res;
if (res=Profanity(,"D:/Wb/*;"
"!*/Misc/PCIDevices.DD*;!*/Misc/Bible.TXT*;"
"!*/Books?/*;!*/Sup1/Sup1Words/*;!*/Sup1/Sup1Blog/Profanity.DD*;"
"!*/Sup1/Sup1Blog/NumBible.TXT*;!*/God/Vocab.DD*"
);
"!*/Sup1/Sup1Blog/NumBible.TXT*;!*/God/Vocab.DD*")) {
while (PressAKey!=CH_SHIFT_ESC) {
ProgressBarsRst;
if (Profanity(,"C:/Home/*;"
"!*/Misc/PCIDevices.DD*;!*/Misc/Bible.TXT*;"
"!*/Books?/*;!*/Sup1/Sup1Words/*;!*/Sup1/Sup1Blog/Profanity.DD*;"
"!*/Sup1/Sup1Blog/NumBible.TXT*;!*/God/Vocab.DD*")) {
"\n\nEdit profanity and press $FG,2$ESC$FG$.\n";
if (!View)
break;
DocBottom;
} else
break;
}
}
return res;
}
public U0 TOSRegen()
U0 TOSRegen3()
{
I64 slash_home=0;
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
progress3_max=1;
progress4=-1;
*progress4_desc=0;
progress4_max=12+MAKE_STD+MAKE_STD_RS+MAKE_ULTRA+MAKE_ULTRA_RS+MAKE_SUP1+
MAKE_WEB+MAKE_BOOKS1+MAKE_BOOKS2+MAKE_DBG+MAKE_STAFF;
progress4_t0=tS;
tos_progress=-1;
tos_progress_t0=tS;
RegExe("TempleOS/TOSRegen");
TOSProgress("ChkDsk All");
@@ -518,28 +543,47 @@ public U0 TOSRegen()
MakeSymFiles;
DocClear;
TOSProgress("Make WebSite");
MakeWebSite;
TOSProgress("Freshen WebSite");
FreshenSite;
DocClear;
TOSProgress("Check WebSite for Profanity");
if (TOSProfanity)
throw;
TOSProgress("Find /Home");
slash_home=F2("/Home","-i+la");
TOSProgress("ChkDsk All");
Drv('C');
ChkAll;
TOSProgress("Done");
SettingsPop;
"Elapsed Time:%5.3f\n",tS-progress4_t0;
"F2(\"/Home\") Cnt\t:%d\n",slash_home;
"Elapsed Time\t:%5.3fs\n",tS-progress4_t0;
ProgressBarsRst("TempleOS/TOSRegen");
}
public U0 PreBackUp()
{
public U0 TOSPreRegen()
{//Copy bookmarks and bins from D:/Home/Sup1 to C:/Home/Sup1
Copy("D:/Home/Sup1/Sup1Blog/Bookmarks.html","C:/Home/Sup1/Sup1Blog");
Del("C:/Home/Sup1/Sup1Bin/*");
Copy("D:/Home/Sup1/Sup1Bin/*","C:/Home/Sup1/Sup1Bin");
Copy("D:/Home/Sup1/Sup1Bin/God*","C:/Linux");
}
U0 TOSRegen2()
{
TOSChgLog; //$LK,"::/Doc/ChgLog.DD"$ datetime matches Kernel $LK,"sys_compile_time",A="MN:sys_compile_time"$.
TOSBootHDIns('C');
Once("TOSRegen3;");
BootRAM("C:/Kernel/" KERNEL_BIN_C); //Boot new Kernel and Compiler.
}
public U0 TOSRegen()
{//Generate distro ISO's and website image, D:/Wb.
TOSBootHDIns('C');
Once("TOSRegen2;");
BootRAM("C:/Kernel/" KERNEL_BIN_C); //Boot to load $LK,"TOS_CFG",A="PF:::/Demo/AcctExample/TOS/TOSCfg.HC,TOS_CFG"$.
}
+263
View File
@@ -0,0 +1,263 @@
#help_index "Misc/TOS/God;God/TOS"
#define NIST_TIME_OFFSET (tos_nist_offset-local_time_offset/CDATE_FREQ)
#define NIST_TIME_TO_SWITCH 3
#define GSRC_NIST_BEACON 0
#define GSRC_HOTBITS 1
#define GSRC_ANU_NIST 2
#define GSRC_RANDOM_ORG 3
#define GSRC_RANDOM_NUMBERS_INFO 4
#define GSRC_PASSWORD 5
#define GSRC_GENERATE_DATA 6
#define GSRC_VIRTUAL_NOTARY 7
#define GSRC_TIMER 8
#define GBP_SHORT 0
#define GBP_MEDIUM 1
#define GBP_LONG 2
class CRandExtDec5Form
{
I64 timestamp;
U8 rnd0[512] fmtstr "$$DA-P,A=\"5 Decimal Digits from Hex:%s\"$$\n";
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert;
};
class CHexWordForm
{
I64 timestamp;
U8 rnd0[512] fmtstr "$$DA-P,A=\"Hex Word Indices#0:%s\"$$\n";
U8 rnd1[512] fmtstr "$$DA-P,A=\"Hex Word Indices#1:%s\"$$\n";
U8 rnd2[512] fmtstr "$$DA-P,A=\"Hex Word Indices#2:%s\"$$\n";
U8 rnd3[512] fmtstr "$$DA-P,A=\"Hex Word Indices#3:%s\"$$\n";
U8 rnd4[512] fmtstr "$$DA-P,A=\"Hex Word Indices#4:%s\"$$\n";
U8 rnd5[512] fmtstr "$$DA-P,A=\"Hex Word Indices#5:%s\"$$\n";
U8 rnd6[512] fmtstr "$$DA-P,A=\"Hex Word Indices#6:%s\"$$\n";
U8 rnd7[512] fmtstr "$$DA-P,A=\"Hex Word Indices#7:%s\"$$\n";
U8 rnd8[512] fmtstr "$$DA-P,A=\"Hex Word Indices#8:%s\"$$\n";
U8 rnd9[512] fmtstr "$$DA-P,A=\"Hex Word Indices#9:%s\"$$\n";
U8 rndA[512] fmtstr "$$DA-P,A=\"Hex Word Indices#A:%s\"$$\n";
U8 rndB[512] fmtstr "$$DA-P,A=\"Hex Word Indices#B:%s\"$$\n";
I64 cert;
};
class CNISTBeaconHexWordForm
{
I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n";
U8 rnd0[512] fmtstr "$$DA-P,A=\"Hex Word Indices#0:%s\"$$\n";
U8 rnd1[512] fmtstr "$$DA-P,A=\"Hex Word Indices#1:%s\"$$\n";
U8 rnd2[512] fmtstr "$$DA-P,A=\"Hex Word Indices#2:%s\"$$\n";
U8 rnd3[512] fmtstr "$$DA-P,A=\"Hex Word Indices#3:%s\"$$\n";
U8 rnd4[512] fmtstr "$$DA-P,A=\"Hex Word Indices#4:%s\"$$\n";
U8 rnd5[512] fmtstr "$$DA-P,A=\"Hex Word Indices#5:%s\"$$\n";
U8 rnd6[512] fmtstr "$$DA-P,A=\"Hex Word Indices#6:%s\"$$\n";
U8 rnd7[512] fmtstr "$$DA-P,A=\"Hex Word Indices#7:%s\"$$\n";
U8 rnd8[512] fmtstr "$$DA-P,A=\"Hex Word Indices#8:%s\"$$\n";
U8 rnd9[512] fmtstr "$$DA-P,A=\"Hex Word Indices#9:%s\"$$\n";
U8 rndA[512] fmtstr "$$DA-P,A=\"Hex Word Indices#A:%s\"$$\n";
U8 rndB[512] fmtstr "$$DA-P,A=\"Hex Word Indices#B:%s\"$$\n";
I64 cert;
};
class CRandHex5Form
{
I64 timestamp;
U8 rnd0[512] fmtstr "$$DA-P-TRM,LEN=5,"
"A=\"Line (5-Digit Hex):%5s\"$$\n";
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert;
};
class CRandHex8Form
{
I64 timestamp;
U8 rnd0[512] fmtstr "$$DA-P-TRM,LEN=8,"
"A=\"Line (8-Digit Hex):%8s\"$$\n";
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert;
};
class CMoviesForm
{
I64 timestamp;
U8 rnd0[512] fmtstr "$$DA-P,"
"A=\"Movie #1-100 (2 Decimal Digits from Hex):%s\"$$\n";
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert;
};
class CPaintings100Form
{
I64 timestamp;
U8 rnd0[512] fmtstr "$$DA-P,"
"A=\"Painting #00-99 (2 Decimal Digits from Hex):%s\"$$\n";
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert;
};
class CPaintings1000Form
{
I64 timestamp;
U8 rnd0[512] fmtstr "$$DA-P,"
"A=\"Painting #000-999 (3 Decimal Digits from Hex):%s\"$$\n";
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert;
};
class CMetallicaForm
{
I64 timestamp;
U8 rnd0[512] fmtstr "$$DA-P,"
"A=\"Song #1-99 (2 Decimal Digits from Hex):%s\"$$\n";
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert;
};
class CCertRandDec5Form
{
I64 timestamp;
U8 rnd0[512] fmtstr "$$DA-P,A=\"Line (Dec):%s\"$$\n";
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert fmtstr "$$DA,A=\"Certificate:%d\"$$\n";
};
class CGodVideoForm
{
U8 title[STR_LEN] fmtstr "$$DA-P,A=\"Title:%s\"$$\n";
U8 serial[STR_LEN] fmtstr "$$DA-P-TRM,LEN=11,A=\"SerialNum:%11s\"$$\n";
I64 min fmtstr "$$DA,A=\"Minutes:%d\"$$\n";
I64 sec fmtstr "$$DA,A=\"Seconds:%d\"$$\n";
};
class CWebBibleForm
{
U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Tag Text:%s\"$$\n";
U8 special[STR_LEN] fmtstr "$$DA-P,A=\"Bible Passage:%s\"$$\n";
I64 min;
I64 sec;
};
class CYouTubeForm
{
U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Title:%s\"$$\n";
U8 special[STR_LEN] fmtstr "$$DA-P-TRM,LEN=11,A=\"SerialNum:%11s\"$$\n";
I64 min fmtstr "$$DA,A=\"Minutes:%d\"$$\n";
I64 sec fmtstr "$$DA,A=\"Seconds:%d\"$$\n";
};
class CImgurForm
{
U8 tag[STR_LEN];
U8 special[STR_LEN] fmtstr "$$DA-P,A=\"SerialNum:%s\"$$\n";
I64 min fmtstr "$$DA,A=\"Width :%d\"$$\n";
I64 sec fmtstr "$$DA,A=\"Height :%d\"$$\n";
};
class CWikipediaForm
{
U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Tag Text:%s\"$$\n";
U8 special[STR_LEN] fmtstr "$$DA-P,A=\"Index :%s\"$$\n";
I64 min;
I64 sec;
};
class CWebBookMarkForm
{
U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Tag Text:%s\"$$\n";
U8 special[STR_LEN];
I64 min;
I64 sec;
};
extern U0 FreshenBlog();
extern U0 GodBooksPassageU32(U32 rand_u32,U8 *files_find_mask,
U8 *file_mask="*",I64 len=512,I64 verbosity=GBP_MEDIUM);
extern I64 GodHeaderIns(U8 *type=NULL);
extern U0 GodVideo(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename);
extern U0 GodWebIdx(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename)
extern U0 GodWordBatch(CHexWordForm *gm);
extern U0 TOSBookLines(U8 *book_filename,I64 book_lines,U8 *st,I64 num_lines,
I64 radix,Bool modulo,Bool plus_one);
extern U0 TOSGodDoodle(I64 god_src,CNISTBeaconHexWordForm *gm=NULL);
+640
View File
@@ -0,0 +1,640 @@
#help_index "Misc/TOS/God;God/TOS"
U8 *URLPercentSpaces(U8 *src)
{
U8 buf[2048],*dst=buf;
while (*src) {
if (*src==CH_SPACE) {
*dst++='%';
*dst++='2';
*dst++='0';
src++;
} else
*dst++=*src++;
}
*dst=0;
return StrNew(buf);
}
U8 *URLPlusSpaces(U8 *src)
{
U8 buf[2048],*dst=buf;
while (*src) {
if (*src==CH_SPACE) {
*dst++='+';
src++;
} else
*dst++=*src++;
}
*dst=0;
return StrNew(buf);
}
I64 ExtDecFromHex(U8 *st,I64 digits)
{
I64 res=0,ch;
while (digits) {
if (!(ch=*st++))
break;
if ('0'<=ch<='9') {
res=10*res+ch-'0';
digits--;
}
}
return res;
}
U0 TOSBookLines(U8 *book_filename,I64 book_lines,U8 *st,I64 num_lines,
I64 radix,Bool modulo,Bool plus_one)
{//Radix<0 means extract N dec digits from hex.
CDoc *doc_out,*doc_in;
CDocEntry *doc_e;
I64 i,start;
U8 *verse;
if (*st && (doc_out=DocPut)) {
if (radix<0)
i=ExtDecFromHex(st,-radix);
else
i=Str2I64(st,radix);
if (radix<0)
DocPrint(doc_out,"'%s'-->(Taking first %d decimal digits)",st,-radix);
else if (radix==16)
DocPrint(doc_out,"0x%s-->",st);
if (modulo) {
DocPrint(doc_out,"(%d remainder when divided by %d)",
i,book_lines-(num_lines-1));
start=i%(book_lines-(num_lines-1));
} else {
if (radix>=0 || plus_one)
DocPrint(doc_out,"%d",i);
start=i;
}
if (plus_one) {
start++;
DocPrint(doc_out,"+1");
}
DocPrint(doc_out,"-->Line:%d\n",start);
if (StrMatch("NumBible",book_filename)) {
verse=BibleLine2Verse(start);
DocPrint(doc_out,"$TX,"KingJamesBible",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/NumBible.TXT"$ (%s)\n\nGod says...\n$$RED$$",verse);
Free(verse);
}
doc_in=DocNew;
BookLines(doc_in,start,num_lines,book_filename);
while (TRUE) {//Del leading blanks
doc_e=doc_in->head.next;
if (doc_e==doc_in)
break;
else {
if (doc_e->type_u8==DOCT_NEW_LINE)
DocEntryDel(doc_in,doc_e);
else
break;
}
}
while (TRUE) {//Del trailing blanks
doc_e=doc_in->cur_entry->last;
if (doc_e==doc_in)
break;
else {
if (doc_e->type_u8==DOCT_NEW_LINE)
DocEntryDel(doc_in,doc_e);
else
break;
}
}
DocPrint(doc_in,"$$FG$$\n");
DocInsDoc(doc_out,doc_in);
DocDel(doc_in);
}
}
public U0 GodBooksPassageU32(U32 rand_u32,U8 *files_find_mask,
U8 *file_mask="*",I64 len=512,I64 verbosity=GBP_MEDIUM)
{//Make God pick a book passage. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.DD"$
CDirEntry *tmpde=FilesFind(files_find_mask,
FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT),
*tmpde1,*tmpde2,**tmpde3;
I64 i=0;
U8 *st,*st2=NULL;
tmpde3=&tmpde2;
tmpde2=NULL;
while (tmpde) {
tmpde1=tmpde->next;
if (WildMatch(tmpde->full_name,file_mask)) {
*tmpde3=tmpde;
tmpde3=&tmpde->next;
} else
DirEntryDel(tmpde);
tmpde=tmpde1;
}
*tmpde3=NULL;
if (tmpde=tmpde2) {
while (tmpde) {
st=FileRead(tmpde->full_name);
tmpde->user_data=StrLen(st);
if (verbosity==GBP_LONG)
"%08X-",i;
if (tmpde->user_data>=len)
i+=tmpde->user_data+1-len;
if (verbosity==GBP_LONG)
"%08X:$$LK,\"%s\",A=\"FI:%s\"$$\n",
i-1,tmpde->full_name+2,tmpde->full_name;
Free(st);
tmpde=tmpde->next;
}
if (verbosity==GBP_LONG)
'\n';
if (verbosity>=GBP_MEDIUM)
"%08X*%08X",rand_u32,i;
i*=rand_u32;
if (verbosity>=GBP_MEDIUM)
"=%08X.%08X\n",i.u32[1],i.u32[0];
i=i.u32[1];
tmpde=tmpde2;
while (tmpde) {
if (!st2 && tmpde->user_data>=len) {
i-=tmpde->user_data+1-len;
if (i<0) {
st=FileRead(tmpde->full_name);
st2=st+(tmpde->user_data+1-len)+i;
st2[len]=0;
"%s\nGod says...\n$$RED$$%s$$FG$$\n",tmpde->full_name,st2;
Free(st);
}
}
tmpde=tmpde->next;
}
DirTreeDel(tmpde2);
}
}
U8 *FileDblRead(U8 *filename,I64 line)
{//FileDbl's are DolDoc files with 2-line entries.
U8 *res=NULL;
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
if (DocLineNumGoTo(doc,line-1) && doc->cur_entry->type_u8==DOCT_TEXT)
res=StrNew(doc->cur_entry->tag);
DocDel(doc);
return res;
}
U8 *FileDblWrite(U8 *filename,I64 line,U8 *st)
{//FileDbl's are DolDoc files with 2-line entries.
U8 *res=NULL;
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
if (DocLineNumGoTo(doc,line-1)) {
if (doc->cur_entry->type_u8==DOCT_TEXT) {
Free(doc->cur_entry->tag);
doc->cur_entry->tag=StrNew(st);
} else
DocPrint(doc,"%s",st);
DocTop(doc);
DocWrite(doc);
}
DocDel(doc);
return res;
}
U0 GodVideo(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename)
{
U8 *st,*st2;
CGodVideoForm *gvf=CAlloc(sizeof(CGodVideoForm));
I64 i=ExtDecFromHex(rnd,digits);
if (!i) i=Round(10`digits);
if (st=FileDblRead(filename,i*2)) {
StrCpy(gvf->title,st);
Free(st);
if (!(st=FileDblRead(filename,i*2+1))||!*st) {
Free(st);
if (DocForm(gvf) && *gvf->serial) {
if (gvf->min || gvf->sec)
st=MStrPrint("%s&hl=enUS&start=%d",
gvf->serial,gvf->min*60+gvf->sec);
else
st=StrNew(gvf->serial);
FileDblWrite(filename,i*2+1,st);
} else
st=NULL;
}
"'%s'-->(Taking first %d decimal digits) #%02d\n",rnd,digits,i;
if (StrIMatch("Metallica",filename)) {
st2=URLPlusSpaces(gvf->title+3);
"God's response:\n"
"$$TX,\"%s\",HTML=\"%s\"$$\n"
"$$TX,\"%s (Lyrics)\","
"HTML=\"http://lmgtfy.com/?q=Metallica+lyrics+%s\"$$\n",
title,webpage,gvf->title,st2;
Free(st2);
} else
"God's response:\n"
"$$TX,\"%s\",HTML=\"%s\"$$\n"
"#%s\n",title,webpage,gvf->title;
if (st) {
"$$HC,\"<object width=\\\"640\\\" height=\\\"520\\\">"
"<param name=\\\"movie\\\" "
"value=\\\"http://www.youtube.com/v/%s\\\"></param><param "
"name=\\\"allowscriptaccess\\\" "
"value=\\\"always\\\"></param><embed "
"src=\\\"http://www.youtube.com/v/%s\\\" "
"type=\\\"application/x-shockwave-flash\\\" "
"allowscriptaccess=\\\"always\\\" "
"width=\\\"640\\\" height=\\\"520\\\">"
"</embed></object>\"$$\n",st,st;
Free(st);
}
}
Free(gvf);
}
U0 GodWebIdx(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename)
{
U8 *st1,*st2;
I64 i=ExtDecFromHex(rnd,digits);
if (!i) i=Round(10`digits);
"'%s'-->(Taking first %d decimal digits) #%02d\n",rnd,digits,i;
st1=FileDblRead(filename,i*2);
st2=FileDblRead(filename,i*2+1);
"God's response:\n";
"$$TX,\"%s\",HTML=\"%s\"$$\n",title,webpage;
PutFileLink(filename);
if (!st1)
"\n$$RED$$God does not want to comment.$$FG$$\n";
else
"\n$$RED$$$$TX,\"%s\",HTML=\"%s\"$$$$FG$$\n",st1,st2;
Free(st1);
Free(st2);
}
U0 GodWordBatch(CHexWordForm *gm)
{//Insert batch of words from rand hex.
I64 i=0;
CDirEntry *tmpde,*tmpde1;
FifoU8Flush(god.fifo);
GodHexIns(gm->rnd0);
GodHexIns(gm->rnd1);
GodHexIns(gm->rnd2);
GodHexIns(gm->rnd3);
GodHexIns(gm->rnd4);
GodHexIns(gm->rnd5);
GodHexIns(gm->rnd6);
GodHexIns(gm->rnd7);
GodHexIns(gm->rnd8);
GodHexIns(gm->rnd9);
GodHexIns(gm->rndA);
GodHexIns(gm->rndB);
tmpde=tmpde1=FilesFind(god.word_file_mask,god.word_fuf_flags);
while (tmpde) {
PutFileLink(tmpde->full_name);
'\n';
tmpde=tmpde->next;
}
DirTreeDel(tmpde1);
"\n$$RED$$";
if (*gm->rnd0)
"%s\n",gm->rnd0;
if (*gm->rnd1)
"%s\n",gm->rnd1;
if (*gm->rnd2)
"%s\n",gm->rnd2;
if (*gm->rnd3)
"%s\n",gm->rnd3;
if (*gm->rnd4)
"%s\n",gm->rnd4;
if (*gm->rnd5)
"%s\n",gm->rnd5;
if (*gm->rnd6)
"%s\n",gm->rnd6;
if (*gm->rnd7)
"%s\n",gm->rnd7;
if (*gm->rnd8)
"%s\n",gm->rnd8;
if (*gm->rnd9)
"%s\n",gm->rnd9;
if (*gm->rndA)
"%s\n",gm->rndA;
if (*gm->rndB)
"%s\n",gm->rndB;
'\n';
while (FifoU8Cnt(god.fifo)>20) {
"%02d: ",i++;
GodWord(20,TRUE);
}
FifoU8Flush(god.fifo);
"$$FG$$\n";
}
U0 TOSGodDoodle(I64 god_src,CNISTBeaconHexWordForm *gm=NULL)
{
CDC *dc;
Bool old_silent;
U8 *elems,*hex=CAlloc(sizeof(CNISTBeaconHexWordForm.rnd0)*12);
if (gm) {
StrPrint(hex,"%s%s",gm->rnd0,gm->rnd1);
if (god_src==GSRC_NIST_BEACON) {
gm->timestamp=FloorI64(CDate2Unix(Now),60);
if (DocForm(gm(CNISTBeaconHexWordForm *)))
NISTBeaconURL(gm->timestamp);
else
goto gd_done;
}
CatPrint(hex,"%s%s",gm->rnd2,gm->rnd3);
if (god_src==GSRC_NIST_BEACON) {
gm->timestamp=FloorI64(CDate2Unix(Now),60);
if (DocForm(gm(CNISTBeaconHexWordForm *)))
NISTBeaconURL(gm->timestamp);
else
goto gd_done;
}
CatPrint(hex,"%s%s",gm->rnd4,gm->rnd5);
if (god_src==GSRC_NIST_BEACON) {
gm->timestamp=FloorI64(CDate2Unix(Now),60);
if (DocForm(gm(CNISTBeaconHexWordForm *)))
NISTBeaconURL(gm->timestamp);
else
goto gd_done;
}
CatPrint(hex,"%s%s",gm->rnd6,gm->rnd7);
if (god_src==GSRC_NIST_BEACON) {
gm->timestamp=FloorI64(CDate2Unix(Now),60);
if (DocForm(gm(CNISTBeaconHexWordForm *)))
NISTBeaconURL(gm->timestamp);
else
goto gd_done;
}
CatPrint(hex,"%s%s",gm->rnd8,gm->rnd9);
if (god_src==GSRC_NIST_BEACON) {
gm->timestamp=FloorI64(CDate2Unix(Now),60);
if (DocForm(gm(CNISTBeaconHexWordForm *)))
NISTBeaconURL(gm->timestamp);
else
goto gd_done;
}
CatPrint(hex,"%s%s",gm->rndA,gm->rndB);
}
if (elems=GodDoodleSprite(hex)) {
dc=Sprite2DC(elems);
BlogDCImgWrite(dc);
DCDel(dc);
Free(elems);
old_silent=Silent;
FreshenBlog;
Silent(old_silent);
}
gd_done:
Free(hex);
}
I64 GodHeaderIns(U8 *type=NULL)
{
CDateStruct ds;
I64 res;
if (type) {//If NISTBeacon
res=FloorI64(CDate2Unix(Now+2*60*CDATE_FREQ),60);
Date2Struct(&ds,Unix2CDate(res)+local_time_offset+30*CDATE_FREQ);
"Response of %s at %02d:%02d Timestamp:%d.\n\n",type,ds.hour,ds.min,res;
In("%c//Response of %s at %02d:%02d Timestamp:%d.\n\n",
CH_ESC,type,ds.hour,ds.min,res);
}
"$$TX,\"Guidelines for Talking with God.\","
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
return res;
}
U0 TimerGodIns()
{
U8 buf[STR_LEN];
GodHeaderIns;
FifoU8Flush(god.fifo);
GodBitsIns(GOD_GOOD_BITS,KbdMsEvtTime>>GOD_BAD_BITS);
switch (PopUpPickLst("Hex5Bible\0Hex8Books\0Doodle\0Movie\0Painting100\0"
"Painting1000\0Metallica\0")) {
case:
StrPrint(buf,"%05X",GodBits(5*4));
"$$TX,\"How this random Bible passage was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/Passage.html\"$$\n";
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
buf,20,16,TRUE,TRUE);
break;
case:
GodBooksPassageU32(GodBits(32),"~/*","C:/Home/Books?/*",,GBP_SHORT);
break;
case:
TOSGodDoodle(GSRC_TIMER);
break;
case:
StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.
GodVideo("Top 100 Movies",
"http://www.afi.com/100years/movies10.aspx",
buf,2,"~/Sup1/Sup1Blog/Movies.DD.Z");
break;
case:
StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.
GodWebIdx("Top 100 Paintings",
"http://www.brushwiz.com/most-famous-paintings",
buf,2,"~/Sup1/Sup1Blog/Paintings100.DD.Z");
break;
case:
StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.
GodWebIdx("Top 1000 Paintings",
"http://en.most-famous-paintings.com/MostFamousPaintings."
"nsf/ListOfTop1000MostPopularPainting",
buf,3,"~/Sup1/Sup1Blog/Paintings1000.DD.Z");
break;
case:
StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.
GodVideo("Metallica Song",
"http://home.hccnet.nl/a.r.adams/lyrics/"
"metallica/songindex.html",
buf,2,"~/Sup1/Sup1Blog/Metallica.DD.Z");
break;
}
}
public U0 GodIns()
{//<ALT-F7> Insert misc rand God item into blog.
U8 *st,*tag;
CRandExtDec5Form *gm=CAlloc(sizeof(CRandExtDec5Form));
I64 god_src=PopUpPickLst("NISTBeacon\0HotBits\0ANU_NIST\0Random.org\0"
"RandomNumbers.info\0Password\0GenerateData\0VirtualNotary\0Timer\0");
if (god_src>=GSRC_NIST_BEACON) {
switch (god_src) {
case GSRC_NIST_BEACON:
NISTGodIns1;
break;
start:
case GSRC_HOTBITS:
tag="https://www.fourmilab.ch/hotbits/secure_generate.html";
break;
case GSRC_ANU_NIST:
tag="http://qrng.anu.edu.au/NIST.php";
break;
end:
GodHeaderIns;
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag;
switch (PopUpPickLst("ExtDec5Bible\0LinuxWords\0"
"HappyWords\0Hex5Bible\0Hex8Books\0Doodle\0Movie\0Painting100\0"
"Painting1000\0Metallica\0")) {
case:
if (DocForm(gm(CRandExtDec5Form *)))
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,-5,FALSE,FALSE);
break;
case:
if (DocForm(gm(CHexWordForm *))) {
Adam("GodInit(\"~/Sup1/Sup1Words/LinuxDict.TXT*\");");
GodWordBatch(gm);
}
break;
case:
if (DocForm(gm(CHexWordForm *))) {
Adam("GodInit(\"~/Sup1/Sup1Words/HappyWords.TXT*\");");
GodWordBatch(gm);
}
break;
case:
if (DocForm(gm(CRandHex5Form *))) {
"$$TX,\"How this random Bible passage was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/Passage.html\"$$\n";
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,16,TRUE,TRUE);
}
break;
case:
if (DocForm(gm(CRandHex8Form *))) {
"$$TX,\"How this random book pick was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/NISTPick002.html\"$$\n";
GodBooksPassageU32(Str2I64(gm->rnd0,16),
"~/*","C:/Home/Books?/*");
}
break;
case:
if (DocForm(gm(CHexWordForm *)))
TOSGodDoodle(god_src,gm);
break;
case:
if (DocForm(gm(CMoviesForm *)))
GodVideo("Top 100 Movies",
"http://www.afi.com/100years/movies10.aspx",
gm->rnd0,2,"~/Sup1/Sup1Blog/Movies.DD.Z");
break;
case:
if (DocForm(gm(CPaintings100Form *))) {
GodWebIdx("Top 100 Paintings",
"http://www.brushwiz.com/most-famous-paintings",
gm->rnd0,2,"~/Sup1/Sup1Blog/Paintings100.DD.Z");
}
break;
case:
if (DocForm(gm(CPaintings1000Form *))) {
GodWebIdx("Top 1000 Paintings",
"http://en.most-famous-paintings.com/MostFamousPaintings."
"nsf/ListOfTop1000MostPopularPainting",
gm->rnd0,3,"~/Sup1/Sup1Blog/Paintings1000.DD.Z");
}
break;
case:
if (DocForm(gm(CMetallicaForm *)))
GodVideo("Metallica Song",
"http://home.hccnet.nl/a.r.adams/lyrics/"
"metallica/songindex.html",
gm->rnd0,2,"~/Sup1/Sup1Blog/Metallica.DD.Z");
break;
}
break;
start:
case GSRC_RANDOM_ORG:
tag="http://www.random.org";
break;
case GSRC_RANDOM_NUMBERS_INFO:
tag="http://www.randomnumbers.info";
break;
case GSRC_PASSWORD:
tag="https://passed.pw";
break;
case GSRC_GENERATE_DATA:
tag="http://www.generatedata.com";
break;
end:
GodHeaderIns;
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag;
switch (PopUpPickLst("ExtDec5Bible\0HexWordBatch\0"
"Hex5Bible\0Hex8Books\0Movie\0Metallica\0")) {
case:
if (DocForm(gm(CRandExtDec5Form *)))
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,-5,FALSE,FALSE);
break;
case:
if (DocForm(gm(CHexWordForm *)))
GodWordBatch(gm);
break;
case:
if (DocForm(gm(CRandHex5Form *))) {
"$$TX,\"How this random Bible passage was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/Passage.html\"$$\n";
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,16,TRUE,TRUE);
}
break;
case:
if (DocForm(gm(CRandHex8Form *))) {
"$$TX,\"How this random book pick was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/NISTPick002.html\"$$\n";
GodBooksPassageU32(Str2I64(gm->rnd0,16),
"~/*","C:/Home/Books?/*");
}
break;
case:
if (DocForm(gm(CMoviesForm *)))
GodVideo("Top 100 Movies",
"http://www.afi.com/100years/movies10.aspx",
gm->rnd0,2,"~/Sup1/Sup1Blog/Movies.DD.Z");
break;
case:
if (DocForm(gm(CMetallicaForm *)))
GodVideo("Metallica Song",
"http://home.hccnet.nl/a.r.adams/lyrics/"
"metallica/songindex.html",
gm->rnd0,2,"~/Sup1/Sup1Blog/Metallica.DD.Z");
break;
}
break;
case GSRC_VIRTUAL_NOTARY:
GodHeaderIns;
if (DocForm(gm(CCertRandDec5Form *))) {
tag="http://virtual-notary.org";
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag;
tag="Here is the certificate";
st=MStrPrint("http://www.templeos.org/Certs/virtual-notary-cert"
"-randomnum-%d.p12",gm->cert);
"\n$$TX,\"%$$Q: %d\",HTML=\"%$$Q\"$$.\n",tag,gm->cert,st;
Free(st);
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,-5,FALSE,FALSE);
}
break;
case GSRC_TIMER:
TimerGodIns;
break;
}
}
Free(gm);
}
if (FileFind("~/Sup1/Sup1Words/LinuxDict.TXT"))
GodInit("~/Sup1/Sup1Words/LinuxDict.TXT");
//if (FileFind("~/Sup1/Sup1Words/HappyWords.TXT"))
// GodInit("~/Sup1/Sup1Words/HappyWords.TXT");
+226
View File
@@ -0,0 +1,226 @@
#help_index "Misc/Blog"
U8 *YouTubeGet(U8 *filename="~/Sup1/Sup1Blog/YouTube.DD.Z",U8 *needle)
{
I64 i=0,line=I64_MIN;
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR),
*doc2=DocNew;
U8 *title,*code,*res;
while (DocFind(doc,line,needle)) {
if (!(doc->cur_entry->y&1)) {
title=doc->cur_entry->tag;
DocLineNumGoTo(doc,doc->cur_entry->y+2);
if (doc->cur_entry->type_u8==DOCT_TEXT) {
code=doc->cur_entry->tag;
DocPrint(doc2,"$$MU-UL,\"%s\",LE=0x%X$$\n",title,code);
i++;
}
}
line=doc->cur_entry->y+2;
}
switch (i) {
case 0:
res=NULL;
break;
case 1:
res=StrNew(code);
break;
default:
res=PopUpMenu(doc2);
if (res==DOCM_CANCEL)
res=NULL;
else
res=StrNew(res);
}
DocDel(doc);
DocDel(doc2);
return res;
}
U0 YouTubeAdd(U8 *filename="~/Sup1/Sup1Blog/YouTube.DD.Z",
U8 *title,U8 *code)
{
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
if (!DocFind(doc,,title)) {
DocBottom(doc);
DocPrint(doc,"%s\n%s\n",title,code);
DocTop(doc);
DocWrite(doc);
Sort(filename,,2);
}
DocDel(doc);
}
U8 *WebBookMarks(U8 *filename="~/Sup1/Sup1Blog/Bookmarks.html")
{
U8 *st;
CDocEntry *doc_e;
CDoc *doc=DocNew;
CCmpCtrl *cc=CmpCtrlNew(MStrPrint("#include \"%s\"",filename));
while (Lex(cc))
if (cc->token==TK_STR && *cc->cur_str(U32 *)=='http') {
DocPrint(doc,"$$MU-UL,\"%$$Q\",LE=0x%X$$\n",cc->cur_str,cc->cur_str);
cc->cur_str=NULL;
}
CmpCtrlDel(cc);
if ((st=PopUpMenu(doc))!=DOCM_CANCEL)
st=StrNew(st);
else
st=NULL;
doc_e=doc->head.next;
while (doc_e!=doc) {
if (doc_e->type_u8==DOCT_MENU_VAL)
Free(doc_e->left_exp);
doc_e=doc_e->next;
}
DocDel(doc);
return st;
}
U0 TOSIns()
{
CWebBibleForm *url=CAlloc(sizeof(CWebBibleForm));
U8 *tag,*st,*st2;
switch (PopUpPickLst("BiblePassage\0BibleVerse\0"
"YouTube\0Imgur\0Wikipedia\0WebBookMark\0")) {
case:
if (DocForm(url(CWebBibleForm *))) {
tag=url->special;
st2=URLPercentSpaces(url->special);
st=MStrPrint("http://www.biblegateway.com/passage/"
"?search=%s&version=NIV",st2);
Free(st2);
if (*url->tag)
tag=url->tag;
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st;
Free(st);
}
break;
case:
if (DocForm(url(CWebBibleForm *))) {
tag=url->special;
st2=URLPercentSpaces(url->special);
st=MStrPrint(
"http://www.biblegateway.com/verse/en/%s",st2);
Free(st2);
if (*url->tag)
tag=url->tag;
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st;
Free(st);
}
break;
case:
if (DocForm(url(CYouTubeForm *))) {
if (*url->special==CH_SPACE)
st2=YouTubeGet(,url->tag);
else
st2=StrNew(url->special);
if (st2 && *st2!=CH_SPACE) {
if (url->min || url->sec)
st=MStrPrint("%s&hl=enUS&start=%d",st2,url->min*60+url->sec);
else
st=StrNew(st2);
if (*url->special!=CH_SPACE && *url->tag)
YouTubeAdd(,url->tag,st);
"$$HC,\"<object width=\\\"640\\\" "
"height=\\\"520\\\"><param name=\\\"movie\\\" "
"value=\\\"http://www.youtube.com/v/%s\\\"></param><param "
"name=\\\"allowscriptaccess\\\" "
"value=\\\"always\\\"></param><embed "
"src=\\\"http://www.youtube.com/v/%s\\\" "
"type=\\\"application/x-shockwave-flash\\\" "
"allowscriptaccess=\\\"always\\\" "
"width=\\\"640\\\" height=\\\"520\\\">"
"</embed></object>\"$$\n",st,st;
Free(st);
Free(st2);
}
}
break;
case:
if (DocForm(url(CImgurForm *))) {
"$$HC,\"<center><img src=\\\"http://i.imgur.com/%s\\\" "
"width=\\\"%d\\\" height=\\\"%d\\\" "
"alt=\\\"\\\"></center>\"$$\n",
url->special,url->min,url->sec;
}
break;
case:
if (DocForm(url(CWikipediaForm *))) {
tag=url->special;
st=MStrPrint("http://en.wikipedia.org/wiki/%s",url->special);
if (*url->tag)
tag=url->tag;
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st;
Free(st);
}
break;
case:
if (DocForm(url(CWebBookMarkForm *))) {
tag=st=WebBookMarks;
if (*url->tag)
tag=url->tag;
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st;
Free(st);
}
break;
}
Free(url);
}
#help_index "Misc/TOS/God;God/TOS"
public U0 GodCodeJmp()
{//Jump to rand code in OS. See $LK,"::/Adam/God/HSNotes.DD"$.
CDirEntry *tmpde1=FilesFind("/*",
FUF_JUST_FILES|FUF_RECURSE|FUF_JUST_SRC|FUF_CLUSTER_ORDER),
*tmpde=tmpde1;
I64 cnt=0,num;
CDoc *doc;
U8 *st;
while (tmpde) {
doc=DocRead(tmpde->full_name);
tmpde->user_data=doc->head.y;
cnt+=doc->head.y;
DocDel(doc);
tmpde=tmpde->next;
}
FifoU8Flush(god.fifo);
GodBitsIns(GOD_GOOD_BITS,KbdMsEvtTime>>GOD_BAD_BITS);
num=GodBits(GOD_GOOD_BITS)%cnt;
tmpde=tmpde1;
while (tmpde) {
num-=tmpde->user_data;
if (num<0) {
st=MStrPrint("FL:%s,%d",tmpde->full_name,-num);
break;
}
tmpde=tmpde->next;
}
DirTreeDel(tmpde1);
Ed(st);
Free(st);
}
U0 GodOffer()
{
switch (PopUpPickLst("MosesComic\0Fiction\0")) {
case:
"---- Moses Comic ---- "
"(Set in the $TX,"Numbers 11",HTML="http://www.biblegateway.com/passage/?search=Numbers%%%%2011&version=NIV"$ "
"part of the story.)\n"
"Moses says, \"\"\n"
"God says, \"\"\n";
break;
case:
"---- $TX,"Collaborative Fiction",HTML="http://en.wikipedia.org/wiki/Collaborative_fiction"$ ----\n"
"Once upon a time ";
break;
}
}
@@ -1,4 +1,4 @@
#help_index "TOS"
#help_index "Misc/TOS"
#define VIDEO_FRAME_RATE 29.97
@@ -58,7 +58,7 @@ I64 CopyVideo()
}
public U0 FrameGrabberToggle()
{
{//The frame grabber saves BMP files to D:/Tmp/ScrnShots.
static F64 last_time=0;
if (tS-last_time>3.0) {
last_time=tS;
@@ -79,7 +79,7 @@ public U0 FrameGrabberToggle()
}
public U0 JukeSong(I64 num)
{
{//Make movie of one song.
AutoComplete;
if (!fg_on)
FrameGrabberToggle;
@@ -89,7 +89,7 @@ public U0 JukeSong(I64 num)
}
public U0 JukeLines(I64 start_line,I64 end_line)
{
{//Make movie of many lines of songs.
AutoComplete;
if (!fg_on)
FrameGrabberToggle;
@@ -99,14 +99,14 @@ public U0 JukeLines(I64 start_line,I64 end_line)
}
public U0 ChkAll()
{
{//ChkDsk on C & D.
U8 *ptr=TOS_HDS;
while (*ptr)
ChkDsk(*ptr++);
}
public CDoc *DC2Doc(CDC *dc,I64 dx=0,I64 dy=0,I64 *_total_score=NULL)
{
{//Use OCR to make a text DolDoc from CDC.
U8 byte_bit_cnts[256];
I64 i,j,*ptr,row,col,ch,best_ch,score,best_score,
cur_char_image,diff_image,total_score=0;
@@ -127,7 +127,7 @@ public CDoc *DC2Doc(CDC *dc,I64 dx=0,I64 dy=0,I64 *_total_score=NULL)
if (GrPeek(dc,col*FONT_WIDTH+j+dx,row*FONT_HEIGHT+i+dy)!=WHITE)
LBts(&cur_char_image,i*8+j);
best_score=MAX_I64;
best_score=I64_MAX;
best_ch=0;
ptr=&text.font[32];
for (ch=32;ch<127;ch++) {
@@ -152,10 +152,10 @@ public CDoc *DC2Doc(CDC *dc,I64 dx=0,I64 dy=0,I64 *_total_score=NULL)
return doc;
}
public U0 BMP2TXT(U8 *_in_name,U8 *_out_name=NULL)
{
public U0 BMP2Doc(U8 *_in_name,U8 *_out_name=NULL)
{//Use OCR to make a text DolDoc from BMP file.
U8 *in_name,*out_name;
I64 dx,dy,score,best_score=MAX_I64;
I64 dx,dy,score,best_score=I64_MAX;
CDC *dc;
CDoc *doc;
in_name=DftExt(_in_name,"BMP");
@@ -179,66 +179,11 @@ public U0 BMP2TXT(U8 *_in_name,U8 *_out_name=NULL)
Free(out_name);
}
RegDft("TempleOS/TOSVideos","I64 tos_code_walk_thru=1;\n");
RegExe("TempleOS/TOSVideos");
U0 TOSRegInit()
{
DefinePrint("DD_CODE_WALK_THRU","Episode #%d",tos_code_walk_thru);
} TOSRegInit;
U0 TOSRegWrite()
{
RegWrite("TempleOS/TOSVideos",
"I64 tos_code_walk_thru=%d;\n",tos_code_walk_thru);
TOSRegInit;
}
class CYouTubeForm2
{
U8 special[STR_LEN] fmtstr "$$DA-P,A=\"SerialNum:%s\"$$\n";
};
U8 *TOSYouTube()
{
U8 *res;
CYouTubeForm2 *url=CAlloc(sizeof(CYouTubeForm2));
if (DocForm(url(CYouTubeForm2 *)) && *url->special)
res=MStrPrint("$$HC,\"<object width=\\\"640\\\" height=\\\"520\\\">"
"<param name=\\\"movie\\\" "
"value=\\\"http://www.youtube.com/v/%s\\\"></param><param "
"name=\\\"allowscriptaccess\\\" value=\\\"always\\\"></param><embed "
"src=\\\"http://www.youtube.com/v/%s\\\" "
"type=\\\"application/x-shockwave-flash\\\" "
"allowscriptaccess=\\\"always\\\" "
"width=\\\"640\\\" height=\\\"520\\\"></embed></object>\"$$",
url->special,url->special);
else
res=NULL;
Free(url);
return res;
}
U0 CodeWalkThru()
{
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
AutoComplete;
WinBorder;
WinMax;
if (!fg_on)
PopUp("Sleep(50);FrameGrabberToggle;");
Ed("~/Videos/RandomCode.DD.Z");
SettingsPop;
Msg(MSG_KEY_DOWN_UP,'b',0x83000000830); //<ALT-b>
tos_code_walk_thru++;
TOSRegWrite;
}
U0 TempleOSTheme()
U0 TOSTheme()
{
if (!fg_on)
PopUp("Sleep(50);FrameGrabberToggle;");
ExeFile("~/Sup1/Sup1Graphics/TempleOSTheme.HC");
ExeFile("~/Sup1/Sup1Graphics/TOS/TOSTheme.HC");
DocClear;
}
@@ -271,7 +216,7 @@ U0 MemTest()
}
public I64 Profanity(
U8 *needle_filename="C:/Home/Sup1/Sup1Blog/Profanity.DD.Z",
U8 *needle_filename="~/Sup1/Sup1Blog/Profanity.DD.Z",
U8 *files_find_mask="/*",U8 *fu_flags=NULL)
{//Scan for profanity.
CCmpCtrl *cc;
@@ -285,3 +230,22 @@ public I64 Profanity(
}
return res;
}
U0 TOSChgLog2()
{
InStr("\"Ed(\\\"::/Doc/ChgLog.DD.Z\\\");\n\";
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_UP|SCF_CTRL);
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN);
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN);
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN);
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN);
Msg(MSG_KEY_DOWN_UP,CH_CTRLY,0);
Msg(MSG_KEY_DOWN_UP,0,SC_F6|SCF_ALT);
Msg(MSG_KEY_DOWN_UP,CH_ESC,0);"
"\"Exit;\n\";");
}
public U0 TOSChgLog()
{//Opdate ChgLog file.
User("TOSChgLog2;\n");
}
+158
View File
@@ -0,0 +1,158 @@
#help_index "Misc/TOS/God;God/TOS"
I64 tos_timestamp=0,tos_type=0;
RegDft("TempleOS/TOSNIST","I64 tos_nist_offset=-8049;\n");
RegExe("TempleOS/TOSNIST");
public I64 CDate2Unix(CDate dt)
{//TempleOS datetime to Unix timestamp.
return ToI64((dt-Str2Date("1/1/1970"))/CDATE_FREQ+NIST_TIME_OFFSET);
}
public CDate Unix2CDate(I64 timestamp)
{//Unix timestamp to TempleOS datetime.
return (timestamp-NIST_TIME_OFFSET)*CDATE_FREQ+Str2Date("1/1/1970");
}
public U0 NISTBeaconSync()
{//Help get local clk in sync with NIST clk.
I64 i,j;
CDate dt;
CDateStruct ds;
while (!ScanChar) {
dt=Now;
Date2Struct(&ds,dt);
i=CDate2Unix(dt);
j=FloorI64(i,60);
"%d %d %02d %02d\n",i,j,ds.sec,(60+ds.sec-(i-j))%60;
Sleep(100);
}
tos_nist_offset=GetI64("tos_nist_offset (%d):",tos_nist_offset);
RegWrite("TempleOS/TOSNIST","I64 tos_nist_offset=%d;\n",tos_nist_offset);
}
U0 NISTBeaconURL(I64 timestamp)
{//Insert NIST Beacon header into blog.
U8 *tag;
CDateStruct ds;
CDate dt=Unix2CDate(timestamp);
Date2Struct(&ds,dt+local_time_offset+30*CDATE_FREQ);
"$$TX,\"NIST Beacon Date:%D Time:%02d:%02d Unix TimeStamp:%u\","
"HTML=\"https://beacon.nist.gov/home\"$$\n",dt,ds.hour,ds.min,timestamp;
tag=MStrPrint("https://beacon.nist.gov/rest/record/%d",timestamp);
"$$TX,\"NIST Beacon Record:%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag;
Free(tag);
}
U0 NISTGodIns1()
{
tos_type=PopUpPickLst("ExtDec5Bible\0LinuxWords\0HappyWords\0"
"Hex5Bible\0Hex8Books\0Doodle\0Movie\0Painting100\0Painting1000\0"
"Metallica\0");
switch (tos_type) {
case: tos_timestamp=GodHeaderIns("Bible"); break;
case: tos_timestamp=GodHeaderIns("LinuxWords"); break;
case: tos_timestamp=GodHeaderIns("HappyWords"); break;
case: tos_timestamp=GodHeaderIns("Bible"); break;
case: tos_timestamp=GodHeaderIns("BookPick"); break;
case: tos_timestamp=GodHeaderIns("Doodle"); break;
case: tos_timestamp=GodHeaderIns("Movie"); break;
case: tos_timestamp=GodHeaderIns("Painting100"); break;
case: tos_timestamp=GodHeaderIns("Painting1000"); break;
case: tos_timestamp=GodHeaderIns("Metallica"); break;
}
Once("tos_timestamp=%d;\ntos_type=%d;\n"
"In(\"Blog(TRUE);\n\");",tos_timestamp,tos_type);
}
U0 NISTGodIns2()
{
CRandExtDec5Form *gm=CAlloc(sizeof(CRandExtDec5Form));
gm->timestamp=tos_timestamp;
switch (tos_type) {
case:
if (DocForm(gm(CRandExtDec5Form *))) {
NISTBeaconURL(gm->timestamp);
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,-5,FALSE,FALSE);
}
break;
case:
if (DocForm(gm(CHexWordForm *))) {
NISTBeaconURL(gm->timestamp);
Adam("GodInit(\"~/Sup1/Sup1Words/LinuxDict.TXT*\");");
GodWordBatch(gm);
}
break;
case:
if (DocForm(gm(CHexWordForm *))) {
NISTBeaconURL(gm->timestamp);
Adam("GodInit(\"~/Sup1/Sup1Words/HappyWords.TXT*\");");
GodWordBatch(gm);
}
break;
case:
if (DocForm(gm(CRandHex5Form *))) {
"$$TX,\"How this random Bible passage was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/NISTPassage.html\"$$\n";
NISTBeaconURL(gm->timestamp);
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,16,TRUE,TRUE);
}
break;
case:
if (DocForm(gm(CRandHex8Form *))) {
"$$TX,\"How this random book pick was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/NISTPick002.html\"$$\n";
NISTBeaconURL(gm->timestamp);
GodBooksPassageU32(Str2I64(gm->rnd0,16),
"~/*","C:/Home/Books?/*");
}
break;
case:
if (DocForm(gm(CHexWordForm *))) {
NISTBeaconURL(gm->timestamp);
TOSGodDoodle(GSRC_NIST_BEACON,gm);
}
break;
case:
if (DocForm(gm(CMoviesForm *))) {
NISTBeaconURL(gm->timestamp);
GodVideo("Top 100 Movies",
"http://www.afi.com/100years/movies10.aspx",
gm->rnd0,2,"~/Sup1/Sup1Blog/Movies.DD.Z");
}
break;
case:
if (DocForm(gm(CPaintings100Form *))) {
NISTBeaconURL(gm->timestamp);
GodWebIdx("Top 100 Paintings",
"http://www.brushwiz.com/most-famous-paintings",
gm->rnd0,2,"~/Sup1/Sup1Blog/Paintings100.DD.Z");
}
break;
case:
if (DocForm(gm(CPaintings1000Form *))) {
NISTBeaconURL(gm->timestamp);
GodWebIdx("Top 1000 Paintings",
"http://en.most-famous-paintings.com/MostFamousPaintings."
"nsf/ListOfTop1000MostPopularPainting",
gm->rnd0,3,"~/Sup1/Sup1Blog/Paintings1000.DD.Z");
}
break;
case:
if (DocForm(gm(CMetallicaForm *))) {
NISTBeaconURL(gm->timestamp);
GodVideo("Metallica Song",
"http://home.hccnet.nl/a.r.adams/lyrics/"
"metallica/songindex.html",
gm->rnd0,2,"~/Sup1/Sup1Blog/Metallica.DD.Z");
}
break;
}
Free(gm);
}
+167
View File
@@ -0,0 +1,167 @@
$WW,1$$FG,5$$TX+CX,"TOS Staff Policies"$$FG$
* Motto: Run toward bugs, not away from bugs.
* Be Metallica. Use short, sharp, powerful words, as though a song.
* Be careful $FG,2$/Demo/AcctExample$FG$ doesn't get extra files. When you run TOSRegen(), it will copy home files to $FG,2$/Demo/AcctExample$FG$.
* Be careful $FG,2$remote/Wb$FG$ site doesn't get extra files. If you delete or rename a file, also delete the $FG,2$remote/Wb$FG$ file from the site.
$TR,"PreRegen()"$
$ID,2$
Linux: Export Bookmarks to ~/TAD/Home/Sup1/Sup1Blog/Bookmarks.html
Linux: >vm_in
Linux: VMware Machine: "TOS"
{
TempleOS: >TOSPreRegen;
TempleOS: Update Budget
}
$ID,-2$
$TR,"NewRelease(Bool full=FALSE)"$
$ID,2$
if ($FG,2$full$FG$)
]PreRegen()
Linux: VMware Machine:"TOS"
{
TempleOS: >TOSRegen($FG,2$full$FG$);
}
Linux: >vm_out
if ($FG,2$full$FG$) {
Linux: Burn ~/TAD to memory stick.
On other machine {
Linux: Copy ~/TAD from memory stick.
VMware: VMware NewMachine:"TOS", Install TempleOSStaff.ISO
{ //2048 Meg RAM or 57344 Meg RAM
TempleOS: $LK,"TOSStaffIns",A="MN:TOSStaffIns"$(); in VMware.
TempleOS: >TOSRegen;
TempleOS: >#include "::/Misc/OSTestSuite"
TempleOS: >Del("~/Demo*");
}
Linux: >emu_staff_new
Linux: >emu8core or >emu24core
{
TempleOS: $LK,"TOSStaffIns",A="MN:TOSStaffIns"$(); in QEMU.
TempleOS: >TOSRegen;
}
}
}
Linux: CrossFTP sync ~/TAD/Site1/Wb to remote/Wb
if ($FG,2$full$FG$) {
FileZilla
Upload ~/TAD/Site1/index.html to remote/index.html
Upload ~/TAD/Site1/TempleOS.html to remote/TempleOS.html
}
In WebHost FileMgr {
Del {
remote/TempleOSCD.ISO
remote/TempleOSSup1.ISO.C
remote/TempleOSWeb.ISO.C
remote/TempleOSUltra.ISO
}
Copy up one level to remote root {
remote/Wb/TempleOSCD.ISO
remote/Wb/TempleOSSup1.ISO.C
remote/Wb/TempleOSWeb.ISO.C
remote/Wb/TempleOSUltra.ISO
}
}
$ID,-2$
$TR,"NewVersion(Bool full=FALSE)"$
$ID,2$
Increment minor version number.
>$LK,"R",A="MN:R"$("3.12","3.13","-i-l"); //Approve by hand.
Add version release notice in $LK,"::/Doc/ChgLog.DD"$.
]NewRelease(TRUE);
Submit to www.betanews.com.
Send email to MajorGeeks.
if ($FG,2$full$FG$) {
Submit to www.upload.com.
Upload to SourceForge.
}
$ID,-2$
$TR,"NewYearlyVersion()"$
$ID,2$
Increment major version number.
>$LK,"R",A="MN:R"$("3.13","4.00","-i-l"); //Approve by hand.
Add version release notice in $LK,"::/Doc/ChgLog.DD"$.
$LK,"Update ::/Misc/PCIDevices.DD",A="FF:::/Adam/DevInfo.HC,PCIDevFileGen"$
Remove 6 months from bottom of $LK,"::/Doc/ChgLog.DD"$.
]NewVersion(TRUE);
$ID,-2$
* If you change the compiler language syntax, immediately make a ]NewRelease(TRUE).
$FG,5$$TX+CX,"TOS Staff Indoctrination"$$FG$
Make a list of all the ways you make a project scalable. With TempleOS, we scale down, not up, so do we do the opposite of all of them.
How would you improve this $LK,"LZW Compression",A="FI:::/Kernel/Compress.HC"$? We have a 100,000 line of code limit, so it's a trick, thought provoking, question introducing you to our way of thinking.
We hope to define objective metrics so we can simply ask the world to reduce the lines of code and be perfectly objective.
We hope for an objective metric for the compiler, such as how fast it compiles itself (having been compiled by itself). It's a little less elegant, but we actually compile kernel and compiler together all the time with $LK,"TOSBootHDIns",A="FF:::/Demo/AcctExample/TOS/TOSDistro.HC,TOSBootHDIns"$('C'). We have the freedom to change the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ language, like how I made type-casting post-fix. We need some more limitations on the problem because we don't want a ridiculous language.
Consider these games as the basis of the vector space we wish to span:
$LK,"/Demo/Games/BattleLines.HC",A="FI:::/Demo/Games/BattleLines.HC"$
$LK,"/Demo/Games/BigGuns.HC",A="FI:::/Demo/Games/BigGuns.HC"$
$LK,"/Demo/Games/BlackDiamond.HC",A="FI:::/Demo/Games/BlackDiamond.HC"$
$LK,"/Demo/Games/BomberGolf.HC",A="FI:::/Demo/Games/BomberGolf.HC"$
$LK,"/Demo/Games/CastleFrankenstein.HC",A="FI:::/Demo/Games/CastleFrankenstein.HC"$
$LK,"/Demo/Games/CharDemo.HC",A="FI:::/Demo/Games/CharDemo.HC"$
$LK,"/Demo/Games/CircleTrace.HC",A="FI:::/Demo/Games/CircleTrace.HC"$
$LK,"/Demo/Games/Collision.HC",A="FI:::/Demo/Games/Collision.HC"$
$LK,"/Demo/Games/Digits.HC",A="FI:::/Demo/Games/Digits.HC"$
$LK,"/Demo/Games/DunGen.HC",A="FI:::/Demo/Games/DunGen.HC"$
$LK,"/Demo/Games/ElephantWalk.HC",A="FI:::/Demo/Games/ElephantWalk.HC"$
$LK,"/Demo/Games/FlapBat.HC",A="FI:::/Demo/Games/FlapBat.HC"$
$LK,"/Demo/Games/FlatTops.HC",A="FI:::/Demo/Games/FlatTops.HC"$
$LK,"/Demo/Games/Halogen.HC",A="FI:::/Demo/Games/Halogen.HC"$
$LK,"/Demo/Games/MassSpring.HC",A="FI:::/Demo/Games/MassSpring.HC"$
$LK,"/Demo/Games/Maze.HC",A="FI:::/Demo/Games/Maze.HC"$
$LK,"/Demo/Games/RainDrops.HC",A="FI:::/Demo/Games/RainDrops.HC"$
$LK,"/Demo/Games/RawHide.HC",A="FI:::/Demo/Games/RawHide.HC"$
$LK,"/Demo/Games/Rocket.HC",A="FI:::/Demo/Games/Rocket.HC"$
$LK,"/Demo/Games/RocketScience.HC",A="FI:::/Demo/Games/RocketScience.HC"$
$LK,"/Demo/Games/Squirt.HC",A="FI:::/Demo/Games/Squirt.HC"$
$LK,"/Demo/Games/Talons.HC",A="FI:::/Demo/Games/Talons.HC"$
$LK,"/Demo/Games/TheDead.HC",A="FI:::/Demo/Games/TheDead.HC"$
$LK,"/Demo/Games/TicTacToe.HC",A="FI:::/Demo/Games/TicTacToe.HC"$
$LK,"/Demo/Games/TreeCheckers.HC",A="FI:::/Demo/Games/TreeCheckers.HC"$
$LK,"/Demo/Games/Varoom.HC",A="FI:::/Demo/Games/Varoom.HC"$
$LK,"/Demo/Games/Wenceslas.HC",A="FI:::/Demo/Games/Wenceslas.HC"$
$LK,"/Demo/Games/Whap.HC",A="FI:::/Demo/Games/Whap.HC"$
$LK,"/Demo/Games/Zing.HC",A="FI:::/Demo/Games/Zing.HC"$
$LK,"/Demo/Games/ZoneOut.HC",A="FI:::/Demo/Games/ZoneOut.HC"$
Unlike Linux and Windows, we do not want to handle all usage models. On the contrary, we want to cherry-pick the hell out of our target usage so we maximize the elegance and simple beauty while delivering something good for $FG,4$$TX,"Hymns",HTML="http://www.templeos.org/Wb/Home/Web/TAD/HymnVideos.html"$$FG$.
If we can define the vector space we hope to span, precisely, then we can leave the operating system on autopilot for future generations. They simply make the best possible solution to the vector space.
Knuth other literate coding homos are wrong -- if you have a well define way of doing things, it usually doesn't matter as long as it is consistent and easy to remember, so you don't vasillate. Try to do things in the way the computer naturally wants to do them. Don't be an arrogant French buffoon. Top-down is ridiculous because you have to make headers for every function. Bottom-up is how a computer wants to do it. In the past, there was a big-endian/little-endian battle. Little endian is obviously the way the computer naturally wants to operate.
Do not bloat a compiler with theoretical optimizations that bad programmers might require. We would rather teach them. As a matter of fact, there is a very straight forward way to convert the C language to machine code.
When I solicit line-of-code reducing optimizations, I plan to make it 100% objective, if possible, and chuckle at the fun, hard-to-understand hacks.
If you have ideas on how to make TempleOS more like Linux, I'm not interested. However, if you have ideas to make it more like the 8-bit computer generation operating systems or like DOS, I am interested. We want the creative spirit of the 8-bit generation of computers.
$FG,8$
* "Linux" is a trademark owned by Linus Torvalds.
* "Windows" is a trademark owned by MicroSoft Corp.
@@ -1,5 +1,5 @@
//This is a customized version of $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$.
//$MA-X+PU,"Diff",LM="WinMax;WinBorder;S2T(\"/*\",\"+r+S\");Diff(\"/Demo/ToHtmlToTXTDemo/ToHtml.HC.Z\",\"/Home/TOSToHtml.HC.Z\");View;"$
//$MA-X+PU,"Diff",LM="WinMax;WinBorder;S2T(\"/*\",\"+r+S\");Diff(\"/Demo/ToHtmlToTXTDemo/ToHtml.HC.Z\",\"~/TOS/TOSToHtml.HC.Z\");View;"$
#help_index "DolDoc/Conversion"
//See $LK,"::/Doc/Credits.DD"$.
@@ -163,10 +163,10 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1,Bool line_nums=FALSE)
{//Cvt $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$doc to HTML file.
CDocEntry *doc_e,*style,*doc_e2;
I64 i,y,old_y=MIN_I64,col,old_u32_attr=DOCET_UNDEF_COLOR,old_attr,digits;
I64 i,y,old_y=I64_MIN,col,old_u32_attr=DOCET_UNDEF_COLOR,old_attr,digits;
U32 *hl,*src;
U8 *st,st_2[2],*link_st,*style_bitmap=CAlloc(256/8);
CBGR48 p[NUM_COLORS];
CBGR48 p[COLORS_NUM];
GrPaletteGet(p);
CDoc *doc_out=DocNew;
Bool unlock_doc_in=DocLock(doc_in),no_bwd;
@@ -189,7 +189,7 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
"<head>\n"
"<meta http-equiv=\"Content-Type\" "
"content=\"text/html;charset=US-ASCII\">\n"
"<meta name=\"generator\" content=\"$TX,"TempleOS V5.00",D="DD_OS_NAME_VERSION"$\">\n";
"<meta name=\"generator\" content=\"$TX,"TempleOS V5.01",D="DD_OS_NAME_VERSION"$\">\n";
if (!body_header) body_header=
"<body>\n"
"<pre style=\"font-family:courier;font-size:10pt\">\n";
@@ -402,7 +402,7 @@ public U0 TOSToHtml(U8 *_in_name,U8 *_out_name=NULL,U8 *html_header=NULL,
Free(out_name);
}
#help_index "TOS"
#help_index "Misc/TOS"
U0 TOSWebFile(U8 *name,Bool line_nums=FALSE)
{
U8 *name2;
@@ -430,7 +430,7 @@ U0 TOSWebFile(U8 *name,Bool line_nums=FALSE)
"<meta name=\"keywords\" "
"content=\"Operating System,64-Bit,64 Bit,"
"Temple,OS,TempleOS,Free,Open Source,Public Domain,x86_64\">\n"
"<meta name=\"generator\" content=\"$TX,"TempleOS V5.00",D="DD_OS_NAME_VERSION"$\">\n",
"<meta name=\"generator\" content=\"$TX,"TempleOS V5.01",D="DD_OS_NAME_VERSION"$\">\n",
"<body style=\"background-color:#55FFFF; border-style:solid;
border-width:8px; border-color:#0000AA;
@@ -473,8 +473,8 @@ U0 FreshenWebDir(U8 *dirname,Bool line_nums=FALSE)
DirTreeDel(tmpde1);
}
public U0 MakeWebSite()
{
public U0 FreshenSite()
{//Regen html files in D:/Wb
CDirEntry *tmpde,*tmpde1;
DocClear;
Cd("D:/Wb");
File diff suppressed because it is too large. Load diff
-118
View File
@@ -1,118 +0,0 @@
$WW,1$$FG,5$$TX+CX,"TOS Staff Policies"$$FG$
* Motto: Run toward bugs, not away from bugs.
* Be Metallica. Use short, sharp, powerful words, as though a song.
* Be careful $FG,2$/Demo/AcctExample$FG$ doesn't get extra files. When you run TOSRegen(), it will copy home files to $FG,2$/Demo/AcctExample$FG$.
* Be careful $FG,2$remote/Wb$FG$ site doesn't get extra files. If you delete or rename a file, also delete the $FG,2$remote/Wb$FG$ file from the site.
$TR,"PreBackUp()"$
$ID,2$
Linux: Export Bookmarks to ~/TAD/Home/Sup1/Sup1Blog/Bookmarks.html
Linux: >vm_in
{
TempleOS: >PreBackUp;
TempleOS: Update Budget
TempleOS: >#include "::/Misc/OSTestSuite"
TempleOS: >Del("/Home/Demo*");
}
$ID,-2$
$TR,"Regen()"$
$ID,2$
When you do these four steps, do them as quickly as possible so that the $LK,"::/Doc/ChangeLog.DD"$ datetime approximately matches Kernel $LK,"sys_compile_time",A="MN:sys_compile_time"$.
{
TempleOS: Add ordinary $LK,"::/Doc/ChangeLog.DD"$ entry.
TempleOS: >TOSBootHDIns('C');
TempleOS: >BootRAM;
TempleOS: >TOSRegen;
}
$ID,-2$
$TR,"NewRelease(Bool full=FALSE)"$
$ID,2$
if ($FG,2$full$FG$)
]PreBackUp()
]Regen()
Linux: >vm_out
if ($FG,2$full$FG$) {
Linux: Burn ~/TAD to memory stick.
On other machine {
Linux: Copy ~/TAD from memory stick.
VMware: Install new TempleOSStaff.ISO to machine named, "TOS".
{ //2048 Meg RAM
TempleOS: $LK,"TOSStaffIns",A="MN:TOSStaffIns"$(); in VMware.
]Regen()
TempleOS: >#include "::/Misc/OSTestSuite"
TempleOS: >Del("/Home/Demo*");
}
Linux: >emu_staff_new
Linux: >emu8core or >emu24core
{
TempleOS: $LK,"TOSStaffIns",A="MN:TOSStaffIns"$(); in QEMU.
]Regen()
}
}
}
Linux: CrossFTP sync ~/TAD/Site1/Wb to remote/Wb
if ($FG,2$full$FG$) {
FileZilla
Upload ~/TAD/Site1/index.html to remote/index.html
Upload ~/TAD/Site1/TempleOS.html to remote/TempleOS.html
}
In WebHost FileMgr {
Del {
remote/TempleOSCD.ISO
remote/TempleOSSup1.ISO.C
remote/TempleOSWeb.ISO.C
remote/TempleOSUltra.ISO
}
Copy up one level to remote root {
remote/Wb/TempleOSCD.ISO
remote/Wb/TempleOSSup1.ISO.C
remote/Wb/TempleOSWeb.ISO.C
remote/Wb/TempleOSUltra.ISO
}
}
$ID,-2$
$TR,"NewVersion(Bool full=FALSE)"$
$ID,2$
Increment minor version number.
>$LK,"R",A="MN:R"$("3.12","3.13","-i-l"); //Approve by hand.
Add version release notice in $LK,"::/Doc/ChangeLog.DD"$.
]NewRelease(TRUE);
Submit to www.betanews.com.
Send email to MajorGeeks.
if ($FG,2$full$FG$) {
Submit to www.upload.com.
Upload to SourceForge.
}
$ID,-2$
$TR,"NewYearlyVersion()"$
$ID,2$
Increment major version number.
>$LK,"R",A="MN:R"$("3.13","4.00","-i-l"); //Approve by hand.
Add version release notice in $LK,"::/Doc/ChangeLog.DD"$.
$LK,"Update ::/Misc/PCIDevices.DD",A="FF:::/Adam/DevInfo.HC,PCIDevFileGen"$
Remove 6 months from bottom of $LK,"::/Doc/ChangeLog.DD"$.
]NewVersion(TRUE);
$ID,-2$
* If you change the compiler language syntax, immediately make a ]NewRelease(TRUE).