diff --git a/TempleOSCD/0000Boot/0000Kernel.BIN.C b/TempleOSCD/0000Boot/0000Kernel.BIN.C index 413c0fe..3e67b5d 100644 Binary files a/TempleOSCD/0000Boot/0000Kernel.BIN.C and b/TempleOSCD/0000Boot/0000Kernel.BIN.C differ diff --git a/TempleOSCD/Adam/ADefine.HC b/TempleOSCD/Adam/ADefine.HC index 588acc4..36afc4c 100644 --- a/TempleOSCD/Adam/ADefine.HC +++ b/TempleOSCD/Adam/ADefine.HC @@ -18,8 +18,8 @@ U0 LoadDocDefines() //$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/Adam/Opt/Boot/BootDVD.HC,DD_BOOT_HIGH_LOC_DVD"$ $TR-C,"LineRep"$ -$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,875"); -DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,991"); +$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,909"); +DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","82,011"); $ID,-4$ DefinePrint("DD_MP_VECT","%08X",MP_VECT_ADDR); DefinePrint("DD_MP_VECT_END","%08X", diff --git a/TempleOSCD/Adam/DolDoc/DocExt.HC b/TempleOSCD/Adam/DolDoc/DocExt.HC index 69b8a1b..6da4174 100644 --- a/TempleOSCD/Adam/DolDoc/DocExt.HC +++ b/TempleOSCD/Adam/DolDoc/DocExt.HC @@ -3,6 +3,7 @@ extern Bool DocEd(CDoc *doc,I64 dof_flags=0); extern I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e, Bool exited,I64 *_has_action=NULL); extern U0 DocFormBwd(CDoc *doc,Bool giveup=FALSE); +extern Bool DocGoToLine(CDoc *doc,I64 line_num); extern U0 DocLoad(CDoc *doc,U8 *src2,I64 size); extern U0 DocPrintAtomic(CDoc *doc=NULL,U8 *fmt,...); extern U0 DocPrintPartial(CDoc *doc=NULL,U8 *fmt,...); diff --git a/TempleOSCD/Adam/DolDoc/DocFile.HC b/TempleOSCD/Adam/DolDoc/DocFile.HC index 136843a..8b975da 100644 --- a/TempleOSCD/Adam/DolDoc/DocFile.HC +++ b/TempleOSCD/Adam/DolDoc/DocFile.HC @@ -331,3 +331,32 @@ public Bool Type(U8 *filename,I64 trailing_new_lines=1) {//Output txt or graphic file to command line. return DocType(,filename,trailing_new_lines); } + +#help_index "DolDoc/File" + +public U8 *DocLineRead(U8 *filename,I64 line,CTask *mem_task=NULL) +{//Extract line from stored doc file. (Slow.) + U8 *res=NULL; + CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR); + if (DocGoToLine(doc,line) && doc->cur_entry->type_u8==DOCT_TEXT) + res=StrNew(doc->cur_entry->tag,mem_task); + DocDel(doc); + return res; +} + +public U8 *DocLineWrite(U8 *filename,I64 line,U8 *st) +{//Write line to stored doc file. (Slow.) + U8 *res=NULL; + CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR); + if (DocGoToLine(doc,line)) { + 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; +} diff --git a/TempleOSCD/Adam/God/GodExt.HC b/TempleOSCD/Adam/God/GodExt.HC index d252626..af3c416 100644 --- a/TempleOSCD/Adam/God/GodExt.HC +++ b/TempleOSCD/Adam/God/GodExt.HC @@ -23,4 +23,4 @@ extern U0 GodBiblePassage(I64 num_lines=20); extern U0 GodBitsIns(I64 num_bits,I64 n); extern U0 GodDoodle(U8 *hex=NULL); extern U0 GodSong(); -extern U0 GodWord(I64 bits=17,Bool show_num=FALSE); +extern U0 GodWord(I64 bits=17); diff --git a/TempleOSCD/Adam/God/HolySpirit.HC b/TempleOSCD/Adam/God/HolySpirit.HC index 2d6fd40..ba4967b 100644 --- a/TempleOSCD/Adam/God/HolySpirit.HC +++ b/TempleOSCD/Adam/God/HolySpirit.HC @@ -143,19 +143,10 @@ public U8 *GodWordStr(I64 bits=17) return NULL; } -public U0 GodWord(I64 bits=17,Bool show_num=FALSE) +public U0 GodWord(I64 bits=17) {//Make God pick a word. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.DD"$ - I64 i; - if (god.num_words) { - i=GodBits(bits); - if (show_num) - "%05X Mod %05X = %05X (Line:%0*d):", - i,god.num_words,i%god.num_words, - ToI64(Log10(god.num_words)+1),i%god.num_words+1; - "%s ",god.words[i%god.num_words]; - if (show_num) - '\n'; - } + if (god.num_words) + "%s ",god.words[GodBits(bits)%god.num_words]; } public U0 GodBiblePassage(I64 num_lines=20) diff --git a/TempleOSCD/Compiler/Compiler.BIN b/TempleOSCD/Compiler/Compiler.BIN index 14f1bec..5dda17f 100644 Binary files a/TempleOSCD/Compiler/Compiler.BIN and b/TempleOSCD/Compiler/Compiler.BIN differ diff --git a/TempleOSCD/Compiler/CompilerB.HH b/TempleOSCD/Compiler/CompilerB.HH index 667f88f..989e1f4 100644 --- a/TempleOSCD/Compiler/CompilerB.HH +++ b/TempleOSCD/Compiler/CompilerB.HH @@ -11,6 +11,7 @@ public _extern _LAST_FUN I64 LastFun(I64 argc,I64 *argv); public extern I64 RunFile(U8 *name,I64 ccf_flags=0,...); public extern I64 RunFile2(U8 *name,I64 ccf_flags=0,...); public extern CCmpGlbls cmp; + #help_index "Compiler/Directive" #help_file "::/Doc/Directives" public extern Bool Echo(Bool val); diff --git a/TempleOSCD/Demo/AcctExample/Registry.HC b/TempleOSCD/Demo/AcctExample/Registry.HC index f2241c9..afb00f1 100644 --- a/TempleOSCD/Demo/AcctExample/Registry.HC +++ b/TempleOSCD/Demo/AcctExample/Registry.HC @@ -62,7 +62,7 @@ $ID,-2$$TR,"Titanium"$ $ID,2$I64 best_score=16469; $ID,-2$$TR,"TOSRegen"$ $ID,2$progress1_tf=0.000;progress2_tf=0.000; -progress3_tf=0.000;progress4_tf=191.799; +progress3_tf=0.000;progress4_tf=201.792; $ID,-2$$ID,-2$$TR,"Once"$ $ID,2$$TR,"Adam"$ $ID,2$$ID,-2$$TR,"User"$ diff --git a/TempleOSCD/Demo/AcctExample/TOS/TOSExt.HC b/TempleOSCD/Demo/AcctExample/TOS/TOSExt.HC index 4be930b..d451c2d 100644 --- a/TempleOSCD/Demo/AcctExample/TOS/TOSExt.HC +++ b/TempleOSCD/Demo/AcctExample/TOS/TOSExt.HC @@ -258,7 +258,7 @@ extern I64 GodHeaderIns(U8 *type=NULL); extern U0 GodVideoDigits(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename); extern U0 GodVideoU32(U32 rand_u32,U8 *filename); extern U0 GodWebIdx(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename) -extern U0 GodWordBatch(CHexWordForm *gm); +extern U0 GodWordBatch(CHexWordForm *gm,I64 radix,I64 digits); 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); diff --git a/TempleOSCD/Demo/AcctExample/TOS/TOSHolySpirit.HC b/TempleOSCD/Demo/AcctExample/TOS/TOSHolySpirit.HC index c5b9fee..588d6ab 100644 --- a/TempleOSCD/Demo/AcctExample/TOS/TOSHolySpirit.HC +++ b/TempleOSCD/Demo/AcctExample/TOS/TOSHolySpirit.HC @@ -174,43 +174,16 @@ public U0 GodBooksPassageU32(U32 rand_u32,U8 *files_find_mask, } } -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 (DocGoToLine(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 (DocGoToLine(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 GodVideoDigits(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)) { + if (st=DocLineRead(filename,i*2+1)) { StrCpy(gvf->title,st); Free(st); - if (!(st=FileDblRead(filename,i*2+1))||!*st) { + if (!(st=DocLineRead(filename,i*2+2))||!*st) { Free(st); if (DocForm(gvf) && *gvf->serial) { if (gvf->min || gvf->sec) @@ -218,7 +191,7 @@ U0 GodVideoDigits(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename) gvf->serial,gvf->min*60+gvf->sec); else st=StrNew(gvf->serial); - FileDblWrite(filename,i*2+1,st); + DocLineWrite(filename,i*2+2,st); } else st=NULL; } @@ -261,8 +234,8 @@ U0 GodVideoU32(U32 rand_u32,U8 *filename) Silent(old_silent); if (num) { i=rand_u32%num; - if (st=FileDblRead(filename,i*2)) { - st2=FileDblRead(filename,i*2+1); + if (st=DocLineRead(filename,i*2+1)) { + st2=DocLineRead(filename,i*2+2); PutFileLink(filename); "\nGod's response:\n" "%08X-->#%d out of %d\n%s\n",rand_u32,i,num,st; @@ -288,8 +261,8 @@ U0 GodWebIdx(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename) 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); + st1=DocLineRead(filename,i*2+1); + st2=DocLineRead(filename,i*2+2); "God's response:\n"; "$$TX,\"%s\",HTML=\"%s\"$$\n",title,webpage; PutFileLink(filename); @@ -301,9 +274,9 @@ U0 GodWebIdx(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename) Free(st2); } -U0 GodWordBatch(CHexWordForm *gm) +U0 GodWordBatch(CHexWordForm *gm,I64 radix,I64 digits) {//Insert batch of words from rand hex. - I64 i=0; + I64 i=0,j,k,min; CDirEntry *tmpde,*tmpde1; FifoU8Flush(god.fifo); @@ -319,13 +292,19 @@ U0 GodWordBatch(CHexWordForm *gm) 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); + + if (radix==16) { + tmpde=tmpde1=FilesFind(god.word_file_mask,god.word_fuf_flags); + while (tmpde) { + PutFileLink(tmpde->full_name); + '\n'; + tmpde=tmpde->next; + } + DirTreeDel(tmpde1); + } else { + PutFileLink("::/Home/Sup1/Sup1Blog/NumWords1000.TXT"); '\n'; - tmpde=tmpde->next; } - DirTreeDel(tmpde1); "\n$$RED$$"; if (*gm->rnd0) @@ -353,9 +332,33 @@ U0 GodWordBatch(CHexWordForm *gm) if (*gm->rndB) "%s\n",gm->rndB; '\n'; - while (FifoU8Cnt(god.fifo)>20) { - "%02d: ",i++; - GodWord(20,TRUE); + if (radix==16) + min=digits*4; + else + min=4; + while (FifoU8Cnt(god.fifo)>=min) { + if (radix==16) { + j=GodBits(digits*4); + if (god.num_words) { + "%02d: %0*X Mod %0*X = %0*X (Line:%0*d):",i++, + digits,j,digits,god.num_words,digits,j%god.num_words, + ToI64(Log10(god.num_words)+1),j%god.num_words+1; + "%s\n",god.words[j%god.num_words]; + } + } else { + i=digits; + j=0; + do { + k=GodBits(4); + if (k<=9) { + j=j*10+k; + if (!--i) { + "%s\n",DocLineRead("::/Home/Sup1/Sup1Blog/NumWords1000.TXT",j+1); + break; + } + } + } while (FifoU8Cnt(god.fifo)>4); + } } FifoU8Flush(god.fifo); "$$FG$$\n"; @@ -510,8 +513,8 @@ public U0 GodIns() end: GodHeaderIns; "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag; - switch (PopUpPickLst("ExtDec5Bible\0LinuxWords\0" - "HappyWords\0Hex5Bible\0Hex8Books\0Doodle\0Movie100\0" + switch (PopUpPickLst("ExtDec5Bible\0LinuxWords\0HappyWords\0" + "Words1000\0Hex5Bible\0Hex8Books\0Doodle\0Movie100\0" "Painting100\0Painting1000\0Metallica\0")) { case: if (DocForm(gm(CRandExtDec5Form *))) @@ -521,15 +524,19 @@ public U0 GodIns() case: if (DocForm(gm(CHexWordForm *))) { Adam("GodInit(\"~/Sup1/Sup1Words/LinuxDict.TXT*\");"); - GodWordBatch(gm); + GodWordBatch(gm,16,5); } break; case: if (DocForm(gm(CHexWordForm *))) { Adam("GodInit(\"~/Sup1/Sup1Words/HappyWords.TXT*\");"); - GodWordBatch(gm); + GodWordBatch(gm,16,5); } break; + case: + if (DocForm(gm(CHexWordForm *))) + GodWordBatch(gm,10,3); + break; case: if (DocForm(gm(CRandHex5Form *))) { "$$TX,\"How this random Bible passage was chosen.\"," @@ -606,7 +613,7 @@ public U0 GodIns() break; case: if (DocForm(gm(CHexWordForm *))) - GodWordBatch(gm); + GodWordBatch(gm,16,5); break; case: if (DocForm(gm(CRandHex5Form *))) { diff --git a/TempleOSCD/Demo/AcctExample/TOS/TOSNIST.HC b/TempleOSCD/Demo/AcctExample/TOS/TOSNIST.HC index cb0c246..aa658fe 100644 --- a/TempleOSCD/Demo/AcctExample/TOS/TOSNIST.HC +++ b/TempleOSCD/Demo/AcctExample/TOS/TOSNIST.HC @@ -47,13 +47,14 @@ U0 NISTBeaconURL(I64 timestamp) U0 NISTGodIns1() { - tos_type=PopUpPickLst("ExtDec5Bible\0LinuxWords\0HappyWords\0" + tos_type=PopUpPickLst("ExtDec5Bible\0LinuxWords\0HappyWords\0Words1000\0" "Hex5Bible\0Hex8Books\0Doodle\0Movie100\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("Words1000"); break; case: tos_timestamp=GodHeaderIns("Bible"); break; case: tos_timestamp=GodHeaderIns("BookPick"); break; case: tos_timestamp=GodHeaderIns("Doodle"); break; @@ -83,14 +84,20 @@ U0 NISTGodIns2() if (DocForm(gm(CHexWordForm *))) { NISTBeaconURL(gm->timestamp); Adam("GodInit(\"~/Sup1/Sup1Words/LinuxDict.TXT*\");"); - GodWordBatch(gm); + GodWordBatch(gm,16,5); } break; case: if (DocForm(gm(CHexWordForm *))) { NISTBeaconURL(gm->timestamp); Adam("GodInit(\"~/Sup1/Sup1Words/HappyWords.TXT*\");"); - GodWordBatch(gm); + GodWordBatch(gm,16,5); + } + break; + case: + if (DocForm(gm(CHexWordForm *))) { + NISTBeaconURL(gm->timestamp); + GodWordBatch(gm,10,3); } break; case: diff --git a/TempleOSCD/Doc/ChgLog.DD b/TempleOSCD/Doc/ChgLog.DD index aedbbcb..dd2b082 100644 --- a/TempleOSCD/Doc/ChgLog.DD +++ b/TempleOSCD/Doc/ChgLog.DD @@ -2,7 +2,8 @@ $WW,1$$FG,5$$TX+CX,"Change Log"$$FG$ Use $LK,"R",A="MN:R"$() to rename if I change a label. -$IV,1$----01/27/17 05:11:06----$IV,0$ +$IV,1$----01/27/17 08:13:37----$IV,0$ +* Added $LK,"DocLineRead",A="MN:DocLineRead"$() and $LK,"DocLineWrite",A="MN:DocLineWrite"$(). $IV,1$----01/25/17 20:44:17----$IV,0$ * $LK,"R",A="MN:R"$("DocLineNumGoto","DocGoToLine");