TempleOSCD_150216.ISO
This commit is contained in:
1 parent
64f679eeb9
commit
401601816c
531 files changed
+23341
-22071
No files matched your search
@@ -1,8 +0,0 @@
|
||||
#include "/Accts/Adam3bPkgs"
|
||||
#include "/Apps/Psalmody/Load"
|
||||
Cd("HOME");;
|
||||
#include "/Accts/TS/TSAdam"
|
||||
#include "/Accts/TS/TSSortHeader"
|
||||
#include "/Accts/TS/TSDistro"
|
||||
#include "/Accts/TS/TSHolySpirit"
|
||||
Cd("HOME");;
|
||||
@@ -1,13 +1,38 @@
|
||||
//Change anything you want in this
|
||||
//acct file or others.
|
||||
//Place this file in /Home and change
|
||||
//anything you want.
|
||||
|
||||
U0 FillInTime()
|
||||
U0 InsTime()
|
||||
{
|
||||
CDate cdt;
|
||||
cdt=Now;
|
||||
"$$IV,1$$----%D %T----$$IV,0$$\n",cdt,cdt;
|
||||
}
|
||||
|
||||
U0 InsFileLink()
|
||||
{
|
||||
U8 *st=PopUpPickFile;
|
||||
st[0]=':'; //This is my personal code, not production. LOL
|
||||
"$$LK,\"%s\",A=\"FI:%s\"$$",st+2,st;
|
||||
Free(st);
|
||||
}
|
||||
|
||||
U0 InsDirLinks()
|
||||
{
|
||||
CDirEntry *tempde,*tempde1;
|
||||
U8 *st=PopUpPickDir,*st2;
|
||||
st[0]=':'; //This is my personal code, not production. LOL
|
||||
st2=MStrPrint("%s/*",st);
|
||||
tempde=tempde1=FilesFind(st2,FUF_JUST_FILES|FUF_JUST_TXT);
|
||||
while (tempde) {
|
||||
tempde->full_name[0]=':';
|
||||
"$$LK,\"%s\",A=\"FI:%s\"$$\n",tempde->full_name+2,tempde->full_name;
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
Free(st);
|
||||
Free(st2);
|
||||
}
|
||||
|
||||
Bool MyPutKey(I64 ch,I64 sc)
|
||||
{//ch=ASCII; sc=scan_code
|
||||
|
||||
@@ -32,9 +57,9 @@ Bool MyPutKey(I64 ch,I64 sc)
|
||||
case SC_F1:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc & SCF_SHIFT)
|
||||
SetKeyDesc("Dollar/LTPURPLE");
|
||||
KeyDescSet("Dollar/LTPURPLE");
|
||||
else
|
||||
SetKeyDesc("Dollar/PURPLE");
|
||||
KeyDescSet("Dollar/PURPLE");
|
||||
} else {
|
||||
if (sc & SCF_SHIFT)
|
||||
"$$LTPURPLE$$";
|
||||
@@ -45,9 +70,9 @@ Bool MyPutKey(I64 ch,I64 sc)
|
||||
case SC_F2:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc & SCF_SHIFT)
|
||||
SetKeyDesc("Dollar/LTRED");
|
||||
KeyDescSet("Dollar/LTRED");
|
||||
else
|
||||
SetKeyDesc("Dollar/RED");
|
||||
KeyDescSet("Dollar/RED");
|
||||
} else {
|
||||
if (sc & SCF_SHIFT)
|
||||
"$$LTRED$$";
|
||||
@@ -58,9 +83,9 @@ Bool MyPutKey(I64 ch,I64 sc)
|
||||
case SC_F3:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc & SCF_SHIFT)
|
||||
SetKeyDesc("Dollar/LTGREEN");
|
||||
KeyDescSet("Dollar/LTGREEN");
|
||||
else
|
||||
SetKeyDesc("Dollar/GREEN");
|
||||
KeyDescSet("Dollar/GREEN");
|
||||
} else {
|
||||
if (sc & SCF_SHIFT)
|
||||
"$$LTGREEN$$";
|
||||
@@ -71,39 +96,52 @@ Bool MyPutKey(I64 ch,I64 sc)
|
||||
case SC_F4:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc & SCF_SHIFT)
|
||||
SetKeyDesc("Dollar/LTBLUE");
|
||||
KeyDescSet("Dollar/Default Color");
|
||||
else
|
||||
SetKeyDesc("Dollar/Default Color");
|
||||
KeyDescSet("Dollar/BLUE");
|
||||
} else {
|
||||
if (sc & SCF_SHIFT)
|
||||
"$$LTBLUE$$";
|
||||
else
|
||||
"$$FG$$";
|
||||
else
|
||||
"$$BLUE$$";
|
||||
}
|
||||
break;
|
||||
case SC_F6:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc & SCF_SHIFT)
|
||||
SetKeyDesc("Misc/Insert My URL");
|
||||
KeyDescSet("Misc/Ins My URL");
|
||||
else
|
||||
SetKeyDesc("Misc/Insert Datetime");
|
||||
KeyDescSet("Misc/Ins Datetime");
|
||||
} else {
|
||||
if (sc & SCF_SHIFT)
|
||||
FillInMyURL;
|
||||
InsMyURL;
|
||||
else
|
||||
FillInTime;
|
||||
InsTime;
|
||||
}
|
||||
break;
|
||||
case SC_F7:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc & SCF_SHIFT)
|
||||
SetKeyDesc("God Book Passage");
|
||||
KeyDescSet("God Book Passage");
|
||||
} else {
|
||||
//$LK,"::/Adam/God/HSNotes.TXT"$
|
||||
FifoU8Flush(god.fifo);
|
||||
GodBitsIns(GOD_GOOD_BITS,KbdMouseEvtTime>>GOD_BAD_BITS);
|
||||
if (sc & SCF_SHIFT)
|
||||
GodBooksPassage("HOME/Archive/Text/*");
|
||||
GodBooksPassage("C:/Home/Wb2/Files/Text/*");
|
||||
}
|
||||
break;
|
||||
case SC_F8:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc & SCF_SHIFT)
|
||||
KeyDescSet("Misc/Ins Dir Links");
|
||||
else
|
||||
KeyDescSet("Misc/Ins File Link");
|
||||
} else {
|
||||
if (sc & SCF_SHIFT)
|
||||
InsDirLinks;
|
||||
else
|
||||
InsFileLink;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -112,15 +150,28 @@ Bool MyPutKey(I64 ch,I64 sc)
|
||||
if (!(sc & SCF_CTRL)) {
|
||||
if (sc & SCF_ALT) {
|
||||
switch (ch) {
|
||||
case 'a':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Win/AutoComplete(ON);");
|
||||
else
|
||||
AutoComplete(ON);
|
||||
return TRUE;
|
||||
case 'A':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Win/AutoComplete;");
|
||||
else
|
||||
AutoComplete;
|
||||
return TRUE;
|
||||
|
||||
case 'h':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Win/Tile Horizontally");
|
||||
KeyDescSet("Win/Tile Horizontally");
|
||||
else
|
||||
WinTileHorz;
|
||||
return TRUE;
|
||||
case 'm':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Win/Maximize");
|
||||
KeyDescSet("Win/Maximize");
|
||||
else {
|
||||
WinMax;
|
||||
WinBorder;
|
||||
@@ -128,23 +179,23 @@ Bool MyPutKey(I64 ch,I64 sc)
|
||||
return TRUE;
|
||||
case 'v':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Win/Tile Vertically");
|
||||
KeyDescSet("Win/Tile Vertically");
|
||||
else
|
||||
WinTileVert;
|
||||
return TRUE;
|
||||
case 'V':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Sys/Frame Grabber Toggle");
|
||||
KeyDescSet("Sys/Frame Grabber Toggle");
|
||||
else
|
||||
FrameGrabberToggle;
|
||||
return TRUE;
|
||||
|
||||
case 'l':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Edit/Put Link to Cur Pos on Clipboard");
|
||||
KeyDescSet("Edit/Put Link to Cur Pos on Clipboard");
|
||||
else {
|
||||
ClipboardDel;
|
||||
st1=FileNameAbs(Define("ST_BIBLE_FILE"));
|
||||
st1=FileNameAbs(BIBLE_FILENAME);
|
||||
st2=FileNameAbs(DocPut->filename.name);
|
||||
if (!StrCmp(st1,st2)) {
|
||||
Free(st1);
|
||||
@@ -159,7 +210,7 @@ Bool MyPutKey(I64 ch,I64 sc)
|
||||
return TRUE;
|
||||
case 'L':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Edit/Place Anchor, Put Link to Clipboard");
|
||||
KeyDescSet("Edit/Place Anchor, Put Link to Clipboard");
|
||||
else {
|
||||
i=RandU32;
|
||||
ClipboardDel;
|
||||
@@ -169,43 +220,30 @@ Bool MyPutKey(I64 ch,I64 sc)
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
case 'w':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Win/WordStat(ON);");
|
||||
else
|
||||
WordStat(ON);
|
||||
return TRUE;
|
||||
case 'W':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Win/WordStat;");
|
||||
else
|
||||
WordStat;
|
||||
return TRUE;
|
||||
|
||||
//Ins your own ALT-key plug-ins
|
||||
case 'b':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Cmd/Jump to Bad Code");
|
||||
KeyDescSet("Cmd/Jump to Bad Code");
|
||||
else //$LK,"::/Adam/God/HSNotes.TXT"$
|
||||
BadCodeJump;
|
||||
return TRUE;
|
||||
|
||||
case 'g':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("BlogScreenShot");
|
||||
KeyDescSet("BlogScreenShot");
|
||||
else
|
||||
BlogScreenShot;
|
||||
return TRUE;
|
||||
|
||||
case 'p':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("JukeBox(TAD)");
|
||||
KeyDescSet("JukeBox(TAD)");
|
||||
else
|
||||
JukeBox("::/Accts/TS/TAD/Psalmody");
|
||||
JukeBox("::/Home/Psalmody");
|
||||
return TRUE;
|
||||
case 'P':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("JukeBox(Examples)");
|
||||
KeyDescSet("JukeBox(Examples)");
|
||||
else
|
||||
JukeBox("::/Apps/Psalmody/Examples");
|
||||
return TRUE;
|
||||
@@ -0,0 +1,20 @@
|
||||
//Place this file in /Home and change
|
||||
//anything you want.
|
||||
|
||||
OptOn(OPTf_WARN_PAREN);
|
||||
OptOn(OPTf_WARN_DUP_TYPES);
|
||||
|
||||
KbdTypeMatic(0);
|
||||
|
||||
// Las Vegas is -7 during summer, -8 during winter
|
||||
local_time_offset=-8*60*60*CDATE_FREQ; //Pacific
|
||||
|
||||
//$AN,"",A="mouse_move_scale"$adjust these to set mouse move scale
|
||||
mouse.scale.x=0.5;
|
||||
mouse.scale.y=0.5;
|
||||
mouse.scale.z=5.0; //wheel
|
||||
|
||||
//don't change these
|
||||
mouse.prescale.x=mouse.pos.x/mouse.scale.x;
|
||||
mouse.prescale.y=mouse.pos.y/mouse.scale.y;
|
||||
mouse.prescale.z=mouse.pos.z/mouse.scale.z;
|
||||
@@ -0,0 +1,13 @@
|
||||
//Place this file in /Home and change
|
||||
//anything you want.
|
||||
|
||||
#include "::/AdamPkgs"
|
||||
#include "::/Apps/Psalmody/Load"
|
||||
#include "::/Demo/WebLogExample/WebLogRep"
|
||||
Cd("::/Home");;
|
||||
#include "::/Home/TOSIDComputer"
|
||||
#include "::/Home/TOSCfg"
|
||||
#include "::/Home/TOSMisc"
|
||||
#include "::/Home/TOSDistro"
|
||||
#include "::/Home/TOSHolySpirit"
|
||||
Cd("::/Home");;
|
||||
@@ -1,3 +1,6 @@
|
||||
//Place this file in /Home and change
|
||||
//anything you want.
|
||||
|
||||
U0 UserStartUp()
|
||||
{//Run each time a user a spawned
|
||||
DocTermNew;
|
||||
@@ -7,18 +10,12 @@ U0 UserStartUp()
|
||||
WinZBufUpdate;
|
||||
Preempt(ON);
|
||||
Dir;
|
||||
switch (ts_cid) {
|
||||
case CID_TAD8:
|
||||
"$$GREEN$$TAD8$$FG$$:";
|
||||
break;
|
||||
case CID_TAD8_VM:
|
||||
"$$RED$$TAD8_VM$$FG$$:";
|
||||
break;
|
||||
switch (tos_cid) {
|
||||
case CID_DFT:
|
||||
"$$PURPLE$$DFT$$FG$$:";
|
||||
break;
|
||||
}
|
||||
"$TX,"81,527",D="DD_TEMPLEOS_LOC_OFFICIAL"$LOC:";
|
||||
"$TX,"79,905",D="DD_TEMPLEOS_LOC_OFFICIAL"$LOC:";
|
||||
CPURep;
|
||||
}
|
||||
|
||||
@@ -35,19 +32,16 @@ CTask *user1,*user2;
|
||||
|
||||
U0 StartUpTasks()
|
||||
{
|
||||
user1=SpawnUser;
|
||||
user2=SpawnUser;
|
||||
user1=User;
|
||||
user2=User;
|
||||
WinToTop(user1);
|
||||
WinTileVert;
|
||||
PopUp("#include \"::/Adam/Start\";");
|
||||
"Boot Time:%7.3fs\n",tS;
|
||||
XTalk(user1,"Cd(\"HOME\");#include \"DoOnce\";\n");
|
||||
Silent(ON);
|
||||
WSInit("/*;~*Bible.TXT*");
|
||||
XTalk(user1,"Cd(\"::/Home\");#include \"DoOnce\";\n");
|
||||
Silent;
|
||||
ACInit("/*;~*Bible.TXT*;~*.TXT*"); //No Bible, no uncompressed TXT.
|
||||
Silent(OFF);
|
||||
"WordStat Time:%7.3fs\n",tS;
|
||||
if (ts_has_win_drv)
|
||||
DrvEnable(TS_WIN_DRV_LET,OFF);
|
||||
"AutoComplete Time:%7.3fs\n",tS;
|
||||
}
|
||||
|
||||
DelTree("::/Temp/ScreenShots");
|
||||
@@ -1,51 +0,0 @@
|
||||
#exe {OptOn(OPTf_WARN_PAREN);};
|
||||
#exe {OptOn(OPTf_WARN_DUP_TYPES);};
|
||||
|
||||
HashTablePurge(adam_task->hash_table);
|
||||
|
||||
#help_index "Misc"
|
||||
|
||||
F64 os_version=2.11;//Operating system version.
|
||||
|
||||
#include "AdamExts.HPP"
|
||||
#include "Math2a"
|
||||
#include "Training"
|
||||
#include "Utils2a"
|
||||
#include "MathODE"
|
||||
|
||||
Dbg("Type 'G;'");
|
||||
|
||||
Cd("::/Adam/Gr");;
|
||||
#include "Gr"
|
||||
|
||||
Cd("::/Adam/Snd");;
|
||||
#include "Snd"
|
||||
|
||||
Cd("::/Adam/Dsk");;
|
||||
#include "Dsk2"
|
||||
|
||||
Cd("::/Adam");;
|
||||
#include "Menu"
|
||||
#include "Win2a"
|
||||
#include "Win2b"
|
||||
#include "Dbg2a"
|
||||
|
||||
Cd("::/Adam/DolDoc");;
|
||||
#include "Doc"
|
||||
LBts(&sys_run_level,RLf_DOC);
|
||||
|
||||
Cd("::/Adam/Ctrls");;
|
||||
#include "Ctrls"
|
||||
|
||||
Cd("::/Adam");;
|
||||
#include "AutoFile2a"
|
||||
#include "LogIn"
|
||||
|
||||
Cd("::/Adam/WordStat");;
|
||||
#include "WordStat"
|
||||
|
||||
Cd("::/Adam");;
|
||||
#include "Hash2a"
|
||||
#include "TaskSettings"
|
||||
#include "DevInfo"
|
||||
#include "DocDefines"
|
||||
@@ -1,12 +1,19 @@
|
||||
//Place this file in /Home and change
|
||||
//anything you want.
|
||||
|
||||
//This file is executed by the
|
||||
//first terminal window upon start-up.
|
||||
//See $LK,"DoOnce",A="FF:HOME/Adam3eSys.CPP,DoOnce"$ and $LK,"Acct Files",A="FF:::/Doc/GuideLines.TXT,ACCT FILES"$.
|
||||
//See $LK,"DoOnce",A="FF:/Home/AdamSys.CPP,DoOnce"$ and $LK,"Home Files",A="FF:::/Doc/GuideLines.TXT,/Home Files"$.
|
||||
|
||||
//It goes in your HOME directory and
|
||||
//you can customize it.
|
||||
// Type("::/Doc/Customize.TXT");
|
||||
|
||||
//Delete this to get rid of
|
||||
//default start-up msg.
|
||||
|
||||
//Type("::/Doc/Customize.TXT");
|
||||
U0 DoOnce()
|
||||
{
|
||||
if (FileFind("D:/Temp/Logs/access.log")) {
|
||||
Auto("\n\n%C",CH_ESC);
|
||||
WebLogRep("D:/Temp/Logs/*.log","D:/Temp/LogRep.TXT");
|
||||
Del("D:/Temp/Logs/*.log");
|
||||
}
|
||||
}
|
||||
|
||||
DoOnce;
|
||||
Binary file not shown.
@@ -0,0 +1,403 @@
|
||||
$WW,1$* Clean-up $LK,"FileNameAbs",A="MN:FileNameAbs"$().
|
||||
|
||||
* Get rid of having two terms and pick one, "Disk" and "BlkDev"? I don't think so. (Probably not.)
|
||||
|
||||
* God said this is bad. $LK,"FL:::/Adam/DolDoc/DocFind.CPP,41"$
|
||||
|
||||
* $LK,"ChkDsk",A="MN:ChkDsk"$ alloc unalloced.
|
||||
|
||||
* Entering a '$$' in text entry
|
||||
|
||||
* Clean-up ASCII-127 delete.
|
||||
* $LK,"StrPrintJoin",A="MN:StrPrintJoin"$(st); With st="\n\\";
|
||||
|
||||
* 1/1/2015 Bug messing-up keyboard, like no CTRL key. Was working on Sprites.
|
||||
|
||||
* 1/?/2015 Macro select in Menu did not go to shell.
|
||||
|
||||
* Real World User Issues:
|
||||
QEMU runs maximized, but slow.
|
||||
If you move cursor off of bottom, macros don't work.
|
||||
Stutters in QEMU doing sound.
|
||||
|
||||
* $LK,"BMPRLE4To",A="MN:BMPRLE4To"$() has files_size too big by 108.
|
||||
|
||||
* Why is nontimer $LK,"Rand",A="MN:Rand"$() so bad?
|
||||
|
||||
* $LK,"FL:::/Adam/Gr/SpriteEd.CPP,789"$ Resize bitmap?
|
||||
|
||||
* More $LK,"CCtrl",A="MN:CCtrl"$.
|
||||
|
||||
* Add change-triangle-color to mesh editor.
|
||||
|
||||
* Add AVL binary tree support or red/black whatever that is. We have fixed-size stack. Auto-balancing binary tree is very needed. Where could we use?
|
||||
|
||||
* Maybe let committee decide if we want intern to make binary tree look-up using PSECT symbol addresses, so we can eliminate psect cache and wall-paper kludge. All HolyC functions and glbl vars would have left-right for address search.
|
||||
|
||||
* QEMU $LK,"tS",A="MN:tS"$ real-time-clock, slow Wenceslas.
|
||||
|
||||
* Is "GrSetSymmetry" or "GrSymmetry" better?
|
||||
|
||||
* DCF_TRANSFORMATION|DCF_SYMMETRY|DCF_JUST_MIRROR -- maybe not both needed at once.
|
||||
|
||||
* DiskCache during FileRead. CTRL-ALT-C, $LK,"Kill",A="MN:Kill"$().
|
||||
|
||||
* Help Index no mention of Symmetry in $LK,"GrLine",A="MN:GrLine"$() $LK,"GrLine3",A="MN:GrLine3"$().
|
||||
|
||||
* Get rid of BYTE WORD DWORD in opcode and replace with U8 U16 U32.
|
||||
|
||||
* 5/7/14:Something like AFSetIP.CPP caused hang, then reboot in TestSuite.
|
||||
* 5/7/14:#63 Maybe, $LK,"::/Demo/Graphics/Pick3D.CPP"$ crashed in TestSuite.
|
||||
* 6/8/14:After or in PageEntries2 in TestSuite crash.
|
||||
|
||||
* $$LK,L="FL:D:/Kernel/File.CPP"$$ instead of A=
|
||||
* $$SP,B=1$$ instead of $$SP,BI=1$$
|
||||
* $$CM+LE+RE is nasty
|
||||
|
||||
* FlatTop is torpedo, not bombs.
|
||||
* BomberGolf is weird concept?
|
||||
|
||||
* Make a game, S.E.T.I., with radio telescope array. Put God on air.
|
||||
|
||||
* $LK,"Diff",A="MN:Diff"$() flags.
|
||||
|
||||
* Backward SHIFT-F3 is broken
|
||||
|
||||
* MOV U8 [RSP+RCX],DL
|
||||
|
||||
* Might want HeapLog x Cnt
|
||||
|
||||
* Find-and-replace text on $$PT$$ line before it.
|
||||
|
||||
* Compiler: Warn recurse class define?
|
||||
|
||||
* <CTRL-r> Text "$$" has no extents and deletes
|
||||
|
||||
* Exception msgs in Adam look bad
|
||||
|
||||
3sGCGCqCCe2G3EE2G3qDetDEFsDBDB
|
||||
|
||||
* $LK,"Mem32DevAlloc",A="MN:Mem32DevAlloc"$() is broken. Devices should be in free spot of E820 report.
|
||||
|
||||
* SPRITES in CMD Line code.
|
||||
|
||||
* Might want to move kernel code out of low 2Meg. Might be faster.
|
||||
|
||||
* F2 Macro on TestSuite
|
||||
|
||||
* 4/13/14 Strut or RawHide crashed when sys_var_init_flag etc
|
||||
was set during testsuite.
|
||||
|
||||
* PSect search all tables if not found very well.
|
||||
* asm LIST NOLIST bug
|
||||
* Bible ranges.
|
||||
* No way to clear +Hold entries
|
||||
|
||||
---------------------
|
||||
$$=-CTASK_NEG_OFFSET
|
||||
offset(CTask.addr)==0
|
||||
Spawn(): CAlloc()
|
||||
TaskFinishOff(): Free()
|
||||
CSysFixedArea.adam
|
||||
Looks like task_flags,locked_flags cause problems with neg offset.
|
||||
---------------------
|
||||
|
||||
* 3/19/14: RESET during RawHide
|
||||
* 2013? Wenceslas in TestSuite crashes, long time ago
|
||||
|
||||
* 12/26/13: Mountain in TestSuite didn't run right. Turned yellow, did nothing.
|
||||
|
||||
* FAQ frontloaded
|
||||
|
||||
COMPILER
|
||||
* Postpone LocalVar Init until last possible moment. (in case RETURN)
|
||||
* PtrArith MUL SIZE -->QueIns(MUL)?
|
||||
* QueRem(IC_NOP)?
|
||||
|
||||
* Fix return result for GrBlot, ect.
|
||||
|
||||
* CTRL-r transform individual elements
|
||||
|
||||
* Size zero files don't copy out from VMware.
|
||||
|
||||
* FileMgr header (scrolled out of window?)
|
||||
|
||||
* ATA/ATAPI ID in VMware, when not booted to CD? I forgot.
|
||||
|
||||
* I use fixed-point in $LK,"Circle",A="MN:Circle"$(), $LK,"Ellipse",A="MN:Ellipse"$(), $LK,"GrRot",A="MN:GrRot"$(), $LK,"GrMulMat",A="MN:GrMulMat"$() and others.
|
||||
God says I might want to change to float.
|
||||
$LK,"::/Demo/Lectures/FixedPoint.CPP"$.
|
||||
$LK,"::/Demo/Lectures/FixedPointAdvanced.CPP"$.
|
||||
|
||||
* DOCF_DBL_DOLLARS in reindention
|
||||
* # in reindention
|
||||
|
||||
* HexEdit with odd size, ASCII cannot be edited.
|
||||
|
||||
* clean-up addDev pmt
|
||||
|
||||
* Might want to convert some Preempt() to Cli
|
||||
|
||||
* $LK,"Plain",A="MN:Plain"$() might be better not saving $LK,"CH_CURSOR",A="MN:CH_CURSOR"$.
|
||||
|
||||
* TRANSPARENT might not work with line ROPF_DITHER
|
||||
|
||||
* It would be nice if $LK,"U",A="MN:U"$() NOP were better.
|
||||
|
||||
* unhandled exception on MP message gets overwritten by WinMgr
|
||||
|
||||
* Cmd to enable/disable compiler warnings
|
||||
|
||||
* What if we had a type for either F64 or I64, like Print -- no conversion.
|
||||
* What if we had a ... that did do conversion, if we have one that doesn't.
|
||||
|
||||
* fix documentation problem -- remembering 0 terminator in str or not for $$DA
|
||||
* GetS, crazy putkey code
|
||||
* editor page formatting is FUBAR
|
||||
|
||||
* $LK,"gr.screen_image",A="MN:CGrGlbls"$
|
||||
>Might want to do ZOOM in U8 graphics and convert screen capture to U8
|
||||
>Might want to reverse bit order
|
||||
|
||||
* return vals for grrect, grblot, grputchar?
|
||||
* collisions for grrect, grblot, grputchar?
|
||||
|
||||
* Race condition in FlatTops.CPP.Z torpedo
|
||||
|
||||
* {Lock|Rep}{Seg|2E=NotBr|3E=Br}{OP}{ADD}{REX}
|
||||
* Virtual Box MP reboot
|
||||
* Std local var names
|
||||
|
||||
//After Egypt possible future ideas
|
||||
//$LK,"Numbers,13:33",A="BF:Numbers,13:33"$ scouts
|
||||
//$LK,"Numbers,21:8",A="BF:Numbers,21:8"$ snakes
|
||||
|
||||
* GrEdit: Move sidebar selected elems.
|
||||
- Be careful of multipt elems.
|
||||
* GrEdit: Strip origin shift cmds.
|
||||
|
||||
* GrEditBitMap, grabscroll?
|
||||
|
||||
* extern of fun with dft arg of str?
|
||||
|
||||
* We kinda need a routine to return how much free memory,
|
||||
so that applications can plan a big alloc.
|
||||
|
||||
* FileMgr bad with lots of files.
|
||||
|
||||
* This $LK,"Fs->catch_except=TRUE",A="FF:::/Kernel/SrvCmd.CPP,Fs->catch_except=TRUE"$ causes problems because it
|
||||
catches divide and out-of-mem. Not sure what to do, yet.
|
||||
|
||||
* Make $LK,"BSPStartMP",A="MN:BSPStartMP"$() start work after boot to reset multicores. Bonus for
|
||||
freeing old task memory. (Prolly never gonna do anything about this.)
|
||||
|
||||
* $LK,"sys_var_init_flag",A="MN:sys_var_init_flag"$ local vars.
|
||||
* sprite shift pts, ctrl pt for ellipse/polygon w,h is off when rotated.
|
||||
|
||||
* Window mgr needs to do DOC operations on posted messages from mouse.
|
||||
Works for $LK,"IPSet",A="MN:IPSet"$(), though.
|
||||
|
||||
* Add local vars to sym table in $LK,"Dbg",A="MN:Dbg"$()? (maybe)
|
||||
|
||||
* $LK,"Bible sized nodes",A="FF:::/Adam/DolDoc/DocRecalcB.CPP,->tag+i"$
|
||||
* Mouseinstall throws exceptions, doesn't work, investigate Mouse $LK,"0x9FC30",A="FF:::/Kernel/KbdMouse/Mouse.CPP,9FC"$
|
||||
* get kbd lights working.
|
||||
* Might have issue with compiler exceptions and restoring lex.hash tables.
|
||||
* Generates two compiler error messages for expressions in statements.
|
||||
* release semaphores or break lock sema,usb_td
|
||||
* Fix Mom's secondary CD-ROM, dad's primary
|
||||
* pmtstr in install didn't like focus change
|
||||
|
||||
*$FG,2$U0 Main()
|
||||
{
|
||||
U0 (*fp_old_draw_input_ptr)(CDC *dc,I64 x,I64 y)=gr.fp_draw_input_ptr;
|
||||
}$FG$
|
||||
|
||||
* What about local variable array/struct initialization.
|
||||
|
||||
* Demo $LK,"ToHtml",A="MN:ToHtml"$().
|
||||
|
||||
* Del short name in FAT32--currently I do not check to see if I have generated
|
||||
a unique short name and one can delete multiple files accidentally.
|
||||
Generating unique short names is a pain in the ass because you have to scan
|
||||
the whole directory. I think I just truncate the name instead of
|
||||
"Program~1" or whatever. S081130-0001.BMP crashed windows--two identical
|
||||
short names.
|
||||
|
||||
* OVERSTRIKE at cmd line with menu macro.
|
||||
|
||||
* $FG,2$lock{}$FG$ warning on invalid modes.
|
||||
* Local array vars-->reg.
|
||||
* $LK,"DCF_SYMMETRY",A="MN:DCF_SYMMETRY"$, before transformation? (Currently it's after)
|
||||
* all graphics clipping -- screen y+top<0 for top<0
|
||||
* Maybe convert graphics to float
|
||||
* Warn unnecessary typecast
|
||||
* compiler F32
|
||||
* preempt(OFF) during graphic clipping?
|
||||
* compiler optimization heap_glbls with added offset
|
||||
* Might make FAT32 read in contiguous chunks.
|
||||
* make Clamp(),Min(),Max() asm routines.
|
||||
* Might make CSprite flood fill operate on a separate bitmap
|
||||
and blotted at the end.
|
||||
* autofile popup of popup
|
||||
* <CTRL-r> delete subsprite in menu near others
|
||||
* consider changing domenu so a real <ESC> on menu item doesn't select
|
||||
(<SPACE> sends <ESC> followed by <SPACE> or something)
|
||||
* puts3 with depth buf? might not do this
|
||||
* make task queins and querem safe for multicore cycling through tasks (fwd).
|
||||
* make better heapwalk, do something with _CFG_HEAP_DBG.
|
||||
* log to file--would be inefficient--load-in whole file, modify and write out.
|
||||
Useful, but not very efficient (TempleOS file system has no grow-file ability.
|
||||
Created when FAT patent was an issue and wanted absly nothing people could sue
|
||||
me for.)
|
||||
* APIC2
|
||||
* import intel datasheets, somehow?
|
||||
* Get better dictionary, good spell checker.
|
||||
* AutoComplete/Man Jmp for user code.
|
||||
* Might make DskView show drive colors.
|
||||
* Might do utility to set drive colors, making a tree entry in Adam 3 using
|
||||
registry-like routines... or registry I guess.
|
||||
|
||||
* New Editor widgets
|
||||
|
||||
* Make use of flag potential in SysFilesFind and possibly CFileAccess
|
||||
* implement fixed pos files
|
||||
|
||||
* new HolyC language features
|
||||
* better debugging
|
||||
|
||||
* Too much preemption turned off?
|
||||
* Look for mem leaks.
|
||||
* Move stuff out of Kernel module.
|
||||
|
||||
* $LK,"ROP_XOR",A="MN:ROP_XOR"$ with pen_width>1 is broken.
|
||||
* RGB wrong in BMP files.
|
||||
|
||||
* use width and height in line clipping for pen_width>1 or blot.
|
||||
* SIMD transformation
|
||||
* test removable media id (critical for resident files)
|
||||
|
||||
* add field overflow U8 "t='*'"
|
||||
* Implement fmt codes into Get
|
||||
* Date Input
|
||||
* Default date fmt
|
||||
|
||||
* 16 bit Unassembly is bad--very low priority
|
||||
* more signed int disassembly
|
||||
* support r4u8 by adding 0x40 byte
|
||||
* static var off of data heap.
|
||||
* Might want to use U32*U32 multiplication.
|
||||
* could add "const" to not set LF_NOT_CONST flag for trig, etc.
|
||||
* do r,rm ICCmp like ICBrCmp
|
||||
* could make glblvar imports use TY_RIP_DISP32.
|
||||
* PUSH_CMP allocs reg R9 or whatever
|
||||
* Might be problem with NOP in OPT pass1 for NO_PUSH in expressions besides
|
||||
assignments. Is ShiftNoPush fully implemented?
|
||||
* NOP1 might need to have diff ic_data's
|
||||
* in divequal, it assumes about ebx
|
||||
* error/warning line nums
|
||||
* ASM branch out warning of range off by 1 line--use lx->last_line_num
|
||||
|
||||
* Switch statement with sparse cases (low priority)
|
||||
* maybe inline functions?
|
||||
* Use of more floating-point stk?
|
||||
|
||||
* More aggressive in this routine $LK,"CmpF2PushPop",A="MN:CmpF2PushPop"$() with types besides MOV and F64.
|
||||
* !dbl ~dbl
|
||||
* &=, |= can overflow with Bts Btr on small data types
|
||||
|
||||
* num lock comes on with break key
|
||||
* sort options for findfiles
|
||||
* Maybe, get rid of $LK,"0x20000",A="FF:::/Compiler/CMain.CPP,0x20000"$ in compiler.
|
||||
|
||||
|
||||
$LK,"Hosea,6:6",A="BF:Hosea,6:6"$
|
||||
|
||||
$LK,"Hebrews,13:15",A="BF:Hebrews,13:15"$
|
||||
|
||||
$LK,"Psalms,50:14",A="BF:Psalms,50:14"$
|
||||
|
||||
|
||||
|
||||
>lspci -v
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
$WW,1$This is the transcript of a radio conversation of a US naval ship with Canadian authorities off the coast of Newfoundland in October, 1995. Radio conversation released by the Chief of Naval Operations 10-10-95.
|
||||
|
||||
Americans: Please divert your course 15 degrees to the North to avoid a Collision.
|
||||
|
||||
Canadians: Recommend you divert YOUR course 15 degrees to the South to avoid a collision.
|
||||
|
||||
Americans: This is the Captain of a US Navy ship. I say again, divert YOUR course.
|
||||
|
||||
Canadians: No. I say again, you divert YOUR course.
|
||||
|
||||
Americans: This is the aircraft carrier USS Lincoln, the second largest ship in the United States' Atlantic fleet. We are accompanied by three destroyers, three cruisers and numerous support vessels. I demand that YOU change your course 15 degrees north, that's one five degrees north, or countermeasures will be undertaken to ensure the safety of this ship.
|
||||
|
||||
Canadians: This is a lighthouse. Your call.[2]
|
||||
$WW,0$/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
char *words[10000]; //Single word list. No statistical weights allowed.
|
||||
int i=0;
|
||||
|
||||
while (true) {
|
||||
while (!keyboard_hit())
|
||||
i++;
|
||||
printf("%s ",words[i%10000]);
|
||||
}
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
Size:$TX,"17784 KB",D="DD_TEMPLEOSCD_K_SIZE"$
|
||||
|
||||
/************************** $TX,"Perfect Coin Toss",HTML="http://hackaday.com/2014/12/19/nist-randomness-beacon/"$ ********************************/
|
||||
$TX,"NIST Randomness Beacon",HTML="http://www.nist.gov/itl/csd/ct/nist_beacon.cfm"$ is a government certified random number. You can call
|
||||
the caretaker on that page, Rene Peralta 301-975-8702, $TX,"rene.peralta@nist.gov",HTML="mailto:rene.peralta@nist.gov"$.
|
||||
Once every minute, they have a random lottery and post the results to their
|
||||
site. You can go back and check old lottery numbers, by entering link+time.
|
||||
$TX,"https:/beacon.nist.gov/rest/record/1415440980",HTML="https:/beacon.nist.gov/rest/record/1415440980"$
|
||||
$TX,"https:/beacon.nist.gov/rest/record/1415445300",HTML="https:/beacon.nist.gov/rest/record/1415445300"$ To check old numbers, enter
|
||||
$TX,"https:/beacon.nist.gov/rest/record/1415529600",HTML="https:/beacon.nist.gov/rest/record/1415529600"$ Unix timestamp in the the URL.
|
||||
$TX,"https:/beacon.nist.gov/rest/record/1415531580",HTML="https:/beacon.nist.gov/rest/record/1415531580"$ (Seconds since 1-JAN-1970)
|
||||
$TX,"https:/beacon.nist.gov/rest/record/1415563680",HTML="https:/beacon.nist.gov/rest/record/1415563680"$ $TX,"Unix Timestamp Tool",HTML="http://www.epochconverter.com"$
|
||||
$TX,"https:/beacon.nist.gov/rest/record/1415565600",HTML="https:/beacon.nist.gov/rest/record/1415565600"$
|
||||
$TX,"https:/beacon.nist.gov/rest/record/1415566560",HTML="https:/beacon.nist.gov/rest/record/1415566560"$ They chain the numbers so they
|
||||
$TX,"https:/beacon.nist.gov/rest/record/1415568120",HTML="https:/beacon.nist.gov/rest/record/1415568120"$ cannot be tampered with.
|
||||
/*****************************************************************************/
|
||||
|
||||
Cop tying shoe: (After drive-by shooting, God said kid was not innocent, LOL.)
|
||||
$HC,"<img src=\"https://goodtimestories.files.wordpress.com/2013/04/cop-tying-shoe-cambridge-county-pd.jpg\" width=\"480\" height=\"376\" alt=\"\">"$
|
||||
|
||||
$TX,"WWW.OSDEV.ORG",HTML="http://www.osdev.org"$
|
||||
$TX,"Perfect Coin Toss",HTML="http://hackaday.com/2014/12/19/nist-randomness-beacon/"$
|
||||
$TX,"Top 100 Movies",HTML="http://www.afi.com/100years/movies10.aspx"$
|
||||
$TX,"Dr. David Pheanis",HTML="https://webapp4.asu.edu/directory/person/77201"$
|
||||
$TX,"KeyPeele#1",HTML="http://www.youtube.com/watch?v=Dd7FixvoKBw"$
|
||||
$TX,"KeyPeele#2",HTML="http://www.youtube.com/watch?v=VHG_Gv_zLY4"$
|
||||
$TX,"ThePrisoner",HTML="http://www.youtube.com/watch?v=HRPDO63rI1E"$
|
||||
$TX,"WestWorld",HTML="http://www.youtube.com/watch?v=LcL3eP0Hfy4"$
|
||||
$TX,"Picard:FourLights",HTML="http://www.youtube.com/watch?v=o_eSwq1ewsU"$
|
||||
$TX,"Dwight:NerdTorture",HTML="http://www.noob.us/humor/the-office-dwight-faces-nerd-torture-of-the-highest-form"$
|
||||
$TX,"AliG:Homosapiens",HTML="http://www.youtube.com/watch?v=eB5VXJXxnNU&t=2m20s"$
|
||||
$TX,"Dumb Guards",HTML="http://www.youtube.com/watch?v=OdKa9bXVinE"$
|
||||
$TX,"Mapping the Commodore 64",HTML="http://unusedino.de/ec64/technical/project64/mapping_c64.html"$
|
||||
Holy Grail: Lmq5PxHpLNw 1:28:27
|
||||
$TX,"ATA/ATAPI Spec",HTML="http://www.t13.org/Documents/UploadedDocuments/docs2007/D1532v1r4b-AT_Attachment_with_Packet_Interface_-_7_Volume_1.pdf"$
|
||||
$TX,"BBC",HTML="http://www.knpr.org/"$
|
||||
$TX,"BBC_Five_Live",HTML="http://www.bbc.co.uk/radio/player/bbc_radio_five_live"$
|
||||
$TX,"KNPR",HTML="http://www.knpr.org/"$
|
||||
$TX,"C64 Users Guide",HTML="http://www.commodore.ca/manuals/c64_users_guide/c64-users_guide.htm"$
|
||||
$TX,"C64 Programmers Reference Guide",HTML="http://www.commodore.ca/manuals/c64_programmers_reference/c64-programmers_reference.htm"$
|
||||
|
||||
|
||||
1) Strings, Opcode in Compiler
|
||||
2) FizzBuzz
|
||||
3) Negative displacements
|
||||
4) Multicore
|
||||
5) Preempt
|
||||
6) Graphics
|
||||
@@ -0,0 +1,40 @@
|
||||
$TR-UL,"Adam"$
|
||||
$ID,2$$TR,"SysMsgFlags"$
|
||||
$ID,2$sys_msg_flags[0]=0xFB;
|
||||
$ID,-2$$TR,"SysRegVer"$
|
||||
$ID,2$registry_version=3.030;
|
||||
$ID,-2$$ID,-2$$TR-C-UL,"TempleOS"$
|
||||
$ID,2$$TR,"CircleTrace"$
|
||||
$ID,2$F64 best_score=4.9425;
|
||||
$ID,-2$$TR,"DiningStars"$
|
||||
$ID,2$F64 best_score=9999.0000;
|
||||
$ID,-2$$TR,"DunGen"$
|
||||
$ID,2$F64 best_score=20.5295;
|
||||
$ID,-2$$TR,"CastleFrankenstein"$
|
||||
$ID,2$F64 best_score=33.8405;
|
||||
$ID,-2$$TR,"ZoneOut"$
|
||||
$ID,2$F64 best_score=50.3318;
|
||||
$ID,-2$$TR,"BugBird"$
|
||||
$ID,2$F64 best_score=18.2332;
|
||||
$ID,-2$$TR,"TimeOut"$
|
||||
$ID,2$I64 best_score=21532;
|
||||
$ID,-2$$TR,"RawHide"$
|
||||
$ID,2$F64 best_score=81.1088;
|
||||
$ID,-2$$TR,"KeepAway"$
|
||||
$ID,2$I64 best_score0=0,best_score1=9999;
|
||||
$ID,-2$$TR,"XCaliber"$
|
||||
$ID,2$I64 best_score=248;
|
||||
I64 msg_flags=1;
|
||||
$ID,-2$$TR,"Wenceslas"$
|
||||
$ID,2$F64 best_score=62.7035;
|
||||
$ID,-2$$TR,"BomberGolf"$
|
||||
$ID,2$I64 best_score=32;
|
||||
$ID,-2$$TR,"EagleDive"$
|
||||
$ID,2$I64 best_score=4;
|
||||
$ID,-2$$TR,"Varoom"$
|
||||
$ID,2$F64 best_score=11.8623;
|
||||
$ID,-2$$TR,"BlackDiamond"$
|
||||
$ID,2$I64 best_score=1;
|
||||
$ID,-2$$TR,"TOS"$
|
||||
$ID,2$I64 tos_code_walk_thru=101,tos_after_egypt_in_action=46;
|
||||
$ID,-2$$ID,-2$
|
||||
@@ -0,0 +1,84 @@
|
||||
#define SLOP BLK_SIZE
|
||||
U0 TOSBootRescueDrv1()
|
||||
{
|
||||
CBinFile *bfh=sys_boot_base-sizeof(CBinFile);
|
||||
bfh(I64)+=bfh->file_size-1;
|
||||
DefinePrint("TOS_BOOT_RESCUE_DRV","0x%X",CeilI64(SYS_KERNEL_END+SLOP,BLK_SIZE));
|
||||
DefinePrint("TOS_BOOT_RESCUE_DRV_END", "0x%X",FloorI64(
|
||||
(BOOT_RAM_LIMIT-(BOOT_STK_SIZE+CD_BOOT_LOADER_SIZE))>>4<<4-
|
||||
(bfh(I64)-SYS_KERNEL_END)-SLOP,BLK_SIZE));
|
||||
DefinePrint("CFG_BOOT_RESCUE_DRV_FILE","\"/Temp/BootRescueDrv.BIN.Z\"");
|
||||
} TOSBootRescueDrv1;
|
||||
|
||||
U0 TOSBootRescueDrv2()
|
||||
{
|
||||
DefinePrint("CFG_BOOT_RESCUE_DRV","\"a10x%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;
|
||||
|
||||
U0 TOSInit()
|
||||
{
|
||||
CATARep *root=NULL,*ata_drv=NULL,*atapi_drv=NULL;
|
||||
CBlkDev *bd;
|
||||
switch (tos_cid) {
|
||||
case CID_DFT:
|
||||
DefinePrint("CFG_RAM_DRVS","\"b1\nScale2Mem(2048,0x280000,4*1024*1024*1024)\n\"");
|
||||
if (dsk.auto_mount_ide_cnt) {
|
||||
//If AutoMount was successful, No need to manually mount in next compile
|
||||
DefinePrint("CFG_HARD_DRVS","\"\"");
|
||||
DefinePrint("CFG_CDROM_DRVS","\"\"");
|
||||
} else {
|
||||
|
||||
//These two are a crazy guess. ATA:IDE Primary ATAPI:IDE Secondary
|
||||
DefinePrint("CFG_HARD_DRVS","\"c2s0x1F0\n0x3F4\n0\"");
|
||||
DefinePrint("CFG_CDROM_DRVS","\"t3s0x170\n0\"");
|
||||
|
||||
bd=Let2BlkDev(':');
|
||||
if (bd->type==BDT_ATAPI) {
|
||||
ATARep(FALSE,,&root);
|
||||
ATAIDDrvs(root,dsk.boot_drv_let,&ata_drv,&atapi_drv);
|
||||
if (ata_drv)
|
||||
DefinePrint("CFG_HARD_DRVS","\"c2p%d\n\"",ata_drv->num);
|
||||
if (atapi_drv)
|
||||
DefinePrint("CFG_CDROM_DRVS","\"t3p%d\n\"",atapi_drv->num);
|
||||
} else {
|
||||
try {
|
||||
bd=Let2BlkDev('C');
|
||||
DefinePrint("CFG_HARD_DRVS","\"c2s0x%X\n0x%X\n%d\"",
|
||||
bd->base0,bd->base1,bd->unit);
|
||||
} catch
|
||||
Fs->catch_except=TRUE;
|
||||
try {
|
||||
bd=Let2BlkDev('T');
|
||||
DefinePrint("CFG_CDROM_DRVS","\"t3s0x%X\n%d\"",bd->base0,bd->unit);
|
||||
} catch
|
||||
Fs->catch_except=TRUE;
|
||||
}
|
||||
}
|
||||
DefinePrint("CFG_DSK_CACHE","\"Scale2Mem(0x80000,0x8000000)\n\"");
|
||||
DefinePrint("TOS_HDS","\"CD\"");
|
||||
DefinePrint("TOS_MASTER_BOOT_DRVS","\"C\"");
|
||||
}
|
||||
} TOSInit;
|
||||
|
||||
U0 TOSDrvTextAttrSet()
|
||||
{
|
||||
DrvTextAttrSet('C', WHITE <<4|BLUE); //Main
|
||||
DrvTextAttrSet('D', WHITE <<4|RED); //Back-up
|
||||
DrvTextAttrSet('A', BLUE <<4|BROWN); //Rescue
|
||||
DrvTextAttrSet('B', BLUE <<4|YELLOW);//RAM
|
||||
DrvTextAttrSet('T', LTGRAY<<4|BLUE); //CDROM
|
||||
} TOSDrvTextAttrSet;
|
||||
|
||||
#define TOS_ISO_NAME "B:/TempleOSCD.ISO"
|
||||
#define TOS_DISTRO_DIR "B:/Distro"
|
||||
#define CFG_OPTS "AutoMountIDE\nCT\n"
|
||||
#define CFG_DBG_OPTS "AutoMountIDE\nCT"\
|
||||
"HeapInit\n130\nMemInit\n131\nVarInit\n132\n\n"
|
||||
#define CFG_DBGZ_OPTS "AutoMountIDE\nCT"\
|
||||
"HeapInit\n0\nMemInit\n0\nVarInit\n0\n\n"
|
||||
#define TOS_CFG "\n" CFG_RAM_DRVS CFG_CDROM_DRVS CFG_HARD_DRVS "\n" CFG_DSK_CACHE CFG_OPTS
|
||||
#define TOS_CDROM_CFG "Tb1\n0x20000\nt3 \n\n\nAutoMountIDE\nCT\n"
|
||||
#define TOS_CDROM_DBG_CFG "A" CFG_BOOT_RESCUE_DRV "b1\nScale2Mem(2048,0x40000)\n\n\n"\
|
||||
"DontProbe\nBootRescueDrv\n" "C:" CFG_BOOT_RESCUE_DRV_FILE "\n" CFG_BOOT_RESCUE_DRV_START "\n\n"
|
||||
@@ -0,0 +1,509 @@
|
||||
//The CFG defines are $LK,"::/Home/TOSCfg.CPP",A="FI:::/Demo/AcctExample/TOSCfg.CPP"$.
|
||||
|
||||
U8 TOSGetDrv()
|
||||
{
|
||||
I64 result;
|
||||
"Drive (%s):",TOS_HDS;
|
||||
result=ToUpper(GetChar);
|
||||
'\n';
|
||||
return result;
|
||||
}
|
||||
|
||||
U0 TOSMakeOSDrvBootInstall(U8 drv_let)
|
||||
{
|
||||
drv_let=ToUpper(drv_let);
|
||||
Auto(TOS_CFG);
|
||||
MakeOSDrvBootInstall(drv_let);
|
||||
if (StrOcc(TOS_MASTER_BOOT_DRVS,drv_let))
|
||||
MasterBootIntall(drv_let);
|
||||
}
|
||||
|
||||
U0 TOSCopyDrv(U8 src,U8 dst)
|
||||
{
|
||||
U8 buf_s[128],buf_d[128];
|
||||
src=ToUpper(src);
|
||||
dst=ToUpper(dst);
|
||||
|
||||
Fmt(dst,,FALSE,DVT_FAT32);
|
||||
|
||||
StrPrint(buf_s,"%c:/",src);
|
||||
StrPrint(buf_d,"%c:/",dst);
|
||||
CopyTree(buf_s,buf_d);
|
||||
|
||||
DocClear;
|
||||
Drv(dst);
|
||||
TOSMakeOSDrvBootInstall(dst);
|
||||
}
|
||||
|
||||
U0 TOSPromptAndCopyDrv()
|
||||
{
|
||||
I64 src,dst;
|
||||
"$$RED$$\nCopy Src Drive:\n$$FG$$";
|
||||
src=TOSGetDrv;
|
||||
"$$RED$$\nCopy Dst Drive:\n$$FG$$";
|
||||
dst=TOSGetDrv;
|
||||
TOSCopyDrv(src,dst);
|
||||
}
|
||||
|
||||
public U0 CursorRemFile(U8 *filename)
|
||||
{
|
||||
CDoc *doc;
|
||||
doc=DocRead(filename,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
}
|
||||
public U0 CursorRem(U8 *files_find_mask="*")
|
||||
{
|
||||
I64 fuf_flags=0;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T+f+F+O");
|
||||
CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde;
|
||||
while (tempde) {
|
||||
CursorRemFile(tempde->full_name);
|
||||
Touch(tempde->full_name,"",,tempde->datetime);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
U0 UncollapseFile(U8 *filename,I64 *)
|
||||
{
|
||||
CDoc *doc=DocRead(filename,DOCF_NO_CURSOR);
|
||||
DocCollapse(FALSE,doc);
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
}
|
||||
U0 Uncollapse(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
||||
{
|
||||
I64 fuf_flags=0;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T+O");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde;
|
||||
while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) {
|
||||
UncollapseFile(tempde->full_name,&fuf_flags);
|
||||
Touch(tempde->full_name,"",,tempde->datetime);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
public U0 CopySongs(U8 threshold='7')
|
||||
{
|
||||
CDoc *s;
|
||||
CDocEntry *doc_e;
|
||||
CDirEntry *tempde=FilesFind("::/Home/Psalmody/*.CPP*",FUF_CLUSTER_ORDER),*tempde1=tempde;
|
||||
DelTree("/Apps/Psalmody/Examples");
|
||||
MkDir("/Apps/Psalmody/Examples");
|
||||
while (tempde) {
|
||||
s=DocRead(tempde->full_name);
|
||||
doc_e=s->root.next;
|
||||
if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[2]>=threshold)
|
||||
Copy(tempde->full_name,"/Apps/Psalmody/Examples");
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
U0 DistroPrep()
|
||||
{
|
||||
Del("/Demo/WebLogExample/WebLogRep.TXT*");
|
||||
Del("/Demo/ReverseFileExample/PoemForeward.TXT*");
|
||||
DelTree("/Home/*Temp.TXT.Z");
|
||||
CopySongs;
|
||||
|
||||
DelTree("/Temp");
|
||||
MkDir("/Temp");
|
||||
MkDir("/Temp/ScreenShots");
|
||||
|
||||
Touch("/PersonalMenu.TXT.Z","+T");
|
||||
Touch("/Home/PersonalMenu.TXT.Z","+T");
|
||||
|
||||
DelTree("/Demo/AcctExample");
|
||||
CopyTree("/Home","/Demo/AcctExample");
|
||||
DelTree("/Demo/AcctExample/Archive");
|
||||
DelTree("/Demo/AcctExample/Budget");
|
||||
DelTree("/Demo/AcctExample/Psalmody");
|
||||
DelTree("/Demo/AcctExample/Wb2");
|
||||
Del("/Demo/AcctExample/Test*");
|
||||
|
||||
//Once in a while, do these:
|
||||
// SortHeaders;
|
||||
// DocOpt("/*");
|
||||
// DblSpaceScan("/*");
|
||||
|
||||
CursorRem("/*");
|
||||
DelTree("/Demo/*.BI*");
|
||||
S2T("/*","+r+S");
|
||||
DocOpt("/*");
|
||||
Move(ACD_DEF_FILENAME,ACD_DEF_FILENAME_Z);
|
||||
}
|
||||
|
||||
U0 MakeBootRescueDrvFile()
|
||||
{
|
||||
try
|
||||
Let2Drv('A');
|
||||
catch {
|
||||
Fs->catch_except=TRUE;
|
||||
Auto(CFG_BOOT_RESCUE_DRV "\n");
|
||||
Mount;
|
||||
}
|
||||
CBlkDev *bd=Let2BlkDev('A');
|
||||
Fmt('A',,FALSE,DVT_REDSEA);
|
||||
|
||||
MkDir("A:/Compiler");
|
||||
Copy("C:/Compiler/Compiler.BIN.Z", "A:/Compiler");
|
||||
Copy("C:/Compiler/OpCodes.TXT.Z", "A:/Compiler");
|
||||
Copy("C:/Compiler/CompilerA.HPP.Z", "A:/Compiler");
|
||||
Copy("C:/Compiler/CompilerB.HPP.Z", "A:/Compiler");
|
||||
|
||||
MkDir("A:/Kernel");
|
||||
Copy("C:/Kernel/*.HPP*", "A:/Kernel");
|
||||
CopyTree("C:/Kernel/Dsk", "A:/Kernel/Dsk");
|
||||
|
||||
Copy("C:/Home/Wb2/Files/DbgAdam.CPP.Z","A:/Adam.CPP.Z");
|
||||
|
||||
MkDir("A:/Adam");
|
||||
Copy("C:/Adam/AExts.HPP.Z", "A:/Adam");
|
||||
Copy("C:/Adam/AMath.CPP.Z", "A:/Adam");
|
||||
Copy("C:/Adam/Training.CPP.Z","A:/Adam");
|
||||
Copy("C:/Adam/AUtils.CPP.Z", "A:/Adam");
|
||||
Copy("C:/Adam/AMathODE.CPP.Z","A:/Adam");
|
||||
|
||||
FileWrite("C:" CFG_BOOT_RESCUE_DRV_FILE,bd->RAM_dsk,(bd->max_blk+1)<<BLK_SIZE_BITS);
|
||||
}
|
||||
|
||||
U0 MakeSymFiles()
|
||||
{
|
||||
CDoc *doc;
|
||||
U8 *st;
|
||||
|
||||
DocClear;
|
||||
DocMax;
|
||||
HashTablePurge(adam_task->hash_table);
|
||||
Who;
|
||||
if (doc=DocPut) {
|
||||
st=StrNew(doc->filename.name);
|
||||
StrCpy(doc->filename.name,"D:/Wb/Home/Wb2/SymsAlpha.TXT.Z");
|
||||
DocWrite(doc);
|
||||
StrCpy(doc->filename.name,st);
|
||||
Free(st);
|
||||
}
|
||||
DocClear;
|
||||
DocMax;
|
||||
Who("+m");
|
||||
if (doc=DocPut) {
|
||||
st=StrNew(doc->filename.name);
|
||||
StrCpy(doc->filename.name,"D:/Wb/Home/Wb2/SymsAddress.TXT.Z");
|
||||
DocWrite(doc);
|
||||
StrCpy(doc->filename.name,st);
|
||||
Free(st);
|
||||
}
|
||||
DocClear;
|
||||
}
|
||||
|
||||
I64 MakeLineRepFile()
|
||||
{
|
||||
U8 *st;
|
||||
CDoc *doc;
|
||||
I64 result,official;
|
||||
CDocEntry *tree_branch,*start_indent,*end_indent;
|
||||
|
||||
DocClear;
|
||||
Drv('C');
|
||||
DistroPrep;
|
||||
|
||||
Cd("C:/");
|
||||
DelTree("B:/TOS");
|
||||
CopyTree("C:/Home","B:/TOS");
|
||||
DelTree("C:/Home");
|
||||
|
||||
DocMax;
|
||||
DocClear;
|
||||
result=LineRep;
|
||||
if (doc=DocPut) {
|
||||
st=StrNew(doc->filename.name);
|
||||
StrCpy(doc->filename.name,"B:/TOS/Wb2/LineRep.TXT.Z");
|
||||
DocWrite(doc);
|
||||
StrCpy(doc->filename.name,st);
|
||||
Free(st);
|
||||
}
|
||||
DocClear;
|
||||
official=LineRep("C:/*","-r")+
|
||||
LineRep("C:/Adam/*")+
|
||||
LineRep("C:/Compiler/*","-S+T")+
|
||||
LineRep("C:/Kernel/*");
|
||||
DocClear;
|
||||
CopyTree("B:/TOS","C:/Home");
|
||||
DelTree("B:/TOS");
|
||||
|
||||
doc=DocRead("C:/Adam/ADefine.CPP.Z");
|
||||
DocTreeFind(doc,"LineRep",&tree_branch,&start_indent,&end_indent);
|
||||
DocCut(doc,start_indent->next,end_indent->last);
|
||||
doc->cur_entry=start_indent->next;
|
||||
doc->cur_data_col=0;
|
||||
|
||||
DocPrint(doc,"DefinePrint(\"DD_TEMPLEOS_LOC\",\"%,d\");\n",result);
|
||||
DocPrint(doc,"DefinePrint(\"DD_TEMPLEOS_LOC_OFFICIAL\",\"%,d\");\n",official);
|
||||
|
||||
DefinePrint("DD_TEMPLEOS_LOC","%,d",result);
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","%,d",official);
|
||||
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
|
||||
"Total LOC:%12,d\n\n",result;
|
||||
return result;
|
||||
}
|
||||
|
||||
U0 TOSDistroPrep()
|
||||
{/*This is the TempleOS internal distro. Only run this on a
|
||||
virtual machine, not bare metal hardware because it's settings could cause
|
||||
problems. The hard drive must be partitioned. Install Std Distro, then
|
||||
install this on top.
|
||||
>$LK,"TSInstall",A="FF:::/Demo/AcctExample/TOSDistro.CPP,TSInstall"$;
|
||||
>$LK,"TSUpgrade",A="FF:::/Demo/AcctExample/TOSDistro.CPP,TSUpgrade"$;
|
||||
See $LK,"MakeDistrosAndBackUp",A="FF:::/Demo/AcctExample/TOSDistro.CPP,MakeDistrosAndBackUp"$() to reproduce the ISO's in $FG,4$E:/Wb$FG$. It makes this
|
||||
website, too.
|
||||
*/
|
||||
Drv('C');
|
||||
DistroPrep;
|
||||
Auto(TOS_CDROM_CFG);
|
||||
MakeOSDrvBootInstall('C','T');
|
||||
DelTree(TOS_DISTRO_DIR);
|
||||
CopyTree("C:/",TOS_DISTRO_DIR "/");
|
||||
}
|
||||
U0 MakeTOSDistro()
|
||||
{
|
||||
TOSDistroPrep;
|
||||
CDFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSTS_SIZE",
|
||||
"Download $TX,"TempleOS V3.02",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
|
||||
U0 DbgDistroPrep()
|
||||
{/*This is a debug distro. The CDROM bootloader uses BIOS INT 0x13 0x42 to
|
||||
load Kernel.BIN.C which has been modified to also hold a small RAM drive
|
||||
(Drive A) that fits in the low 640k. The bootloader starts in real mode
|
||||
and the kernel changes to long, 64-bit mode. It loads the 64-bit compiler
|
||||
and assembler, compiles some, but not all, of the normal start-up scripts
|
||||
and drops you off at the $LK,"Dbg",A="MN:Dbg"$ command-line where you can JIT compile,
|
||||
use $LK,"EdLite",A="MN:EdLite"$ on RAM files, and use many of the other normal Kernel commands.
|
||||
I could not fit all the normal start-up scripts into the small RAM drive,
|
||||
so you do not have the window manager or normal document framework. You
|
||||
should have many Gig of RAM to play with with RAM Drive B, a high memory
|
||||
RAM drive, but you have only those few files. When I generate this distro,
|
||||
I call $LK,"MakeBootDrvFile",A="FF:::/Demo/AcctExample/TOSDistro.CPP,MakeBootRescueDrvFile"$.
|
||||
*/
|
||||
Drv('C');
|
||||
DistroPrep;
|
||||
MakeBootRescueDrvFile;
|
||||
Auto(TOS_CDROM_DBG_CFG);
|
||||
MakeOSDrvBootInstall('C','T');
|
||||
DelTree(TOS_DISTRO_DIR);
|
||||
CopyTree("C:/",TOS_DISTRO_DIR "/");
|
||||
Del("C:" CFG_BOOT_RESCUE_DRV_FILE);
|
||||
}
|
||||
U0 MakeDbgDistro()
|
||||
{
|
||||
DbgDistroPrep;
|
||||
CDFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSDBG_SIZE",
|
||||
"Download $TX,"TempleOS V3.02",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 StdDistroPrep()
|
||||
{
|
||||
Drv('C');
|
||||
DistroPrep;
|
||||
Auto(STD_DISTRO_CDROM_CFG);
|
||||
MakeOSDrvBootInstall('C','T');
|
||||
DelTree(TOS_DISTRO_DIR);
|
||||
CopyTree("C:/",TOS_DISTRO_DIR "/");
|
||||
DelTree(TOS_DISTRO_DIR "/Home");
|
||||
MkDir(TOS_DISTRO_DIR "/Home");
|
||||
Del(TOS_DISTRO_DIR "/0000Boot/OldMBR.BIN.C");
|
||||
Del(TOS_DISTRO_DIR "/0000Boot/BootMHD2.BIN.C");
|
||||
}
|
||||
U0 MakeStdDistro()
|
||||
{
|
||||
StdDistroPrep;
|
||||
CDFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 LiteDistroPrep()
|
||||
{/*Missing: Dictionary, Bible and TOSZ Utility. Still 100% OpenSource.
|
||||
Includes: x86_64 64BitMultiCoredKernel, 64BitCompiler, Assembler,
|
||||
Unassembler, Debugger, Editor, VGAGraphics, Tools, BootLoaders,
|
||||
Keyboard&Mouse, HardDrives, FAT32, Partitioner, CD/DVD, ISO9660FileCreator,
|
||||
FileManager, WindowManager, PCSpeaker, Apps, Games, God-Oracle-App, Hymns,
|
||||
Demos, Documentation.
|
||||
*/
|
||||
StdDistroPrep;
|
||||
DelTree(TOS_DISTRO_DIR "/Linux");
|
||||
Del(TOS_DISTRO_DIR "/Adam/AutoComplete/ACDefs.DAT*");
|
||||
Del(TOS_DISTRO_DIR "/Misc/PCIDevices.TXT.Z");
|
||||
Del(TOS_DISTRO_DIR "/Misc/Bible.TXT.Z");
|
||||
}
|
||||
U0 MakeLiteDistro()
|
||||
{
|
||||
LiteDistroPrep;
|
||||
CDFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSLITE_SIZE",
|
||||
"Download $TX,"TempleOS V3.02",D="DD_OS_NAME_VERSION"$ - Lite Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 UltraDistroPrep()
|
||||
{/*Missing: Apps, Demos, Dictionary, Bible and TOSZ Utility. Still 100% OpenSource.
|
||||
Includes: x86_64 64BitMultiCoredKernel, 64BitCompiler, Assembler,
|
||||
Unassembler, Debugger, Editor, VGAGraphics, Tools, BootLoaders,
|
||||
Keyboard&Mouse, HardDrives, FAT32, Partitioner, CD/DVD, ISO9660FileCreator,
|
||||
FileManager, WindowManager, PCSpeaker, Documentation.
|
||||
*/
|
||||
LiteDistroPrep;
|
||||
DelTree(TOS_DISTRO_DIR "/Apps");
|
||||
DelTree(TOS_DISTRO_DIR "/Demo");
|
||||
DelTree(TOS_DISTRO_DIR "/Misc/Tour");
|
||||
Del(TOS_DISTRO_DIR "/Adam/AutoComplete/ACWords.DAT*");
|
||||
Del(TOS_DISTRO_DIR "/Adam/God/Vocab.TXT.Z");
|
||||
Del(TOS_DISTRO_DIR "/Misc/OSTestSuite.CPP.Z");
|
||||
}
|
||||
U0 MakeUltraDistro()
|
||||
{
|
||||
UltraDistroPrep;
|
||||
CDFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSULTRA_SIZE",
|
||||
"Download $TX,"TempleOS V3.02",D="DD_OS_NAME_VERSION"$ - UltraLite Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 TOSWebFile(U8 *name)
|
||||
{
|
||||
U8 *name2;
|
||||
CDirEntry de;
|
||||
if (FileFind(name,&de)) {
|
||||
Free(de.full_name);
|
||||
"File:%s\n",name;
|
||||
UncollapseFile(name,NULL);
|
||||
Touch(name,"",,de.datetime);
|
||||
name2=ChgExt(name,"html");
|
||||
ToHtml(name,name2,
|
||||
"<title>The Temple Operating System</title>\n"
|
||||
"<meta name=\"keywords\" content=\"Operating System,64-Bit,64 Bit,Temple,OS,TempleOS,Free,Open Source,Public Domain,x86_64\">\n"
|
||||
);
|
||||
Touch(name2,"",,de.datetime);
|
||||
Free(name2);
|
||||
}
|
||||
}
|
||||
|
||||
U0 MakeWebSite()
|
||||
{
|
||||
CDirEntry *tempde,*tempde1;
|
||||
DocClear;
|
||||
Cd("D:/Wb");
|
||||
DelTree("D:/Wb/Home/Archive");
|
||||
DelTree("D:/Wb/Home/Budget");
|
||||
DelTree("D:/Wb/Home/Psalmody");
|
||||
Del("D:/Wb/Home/*");
|
||||
Touch("D:/Wb/Home/Wb2/index.TXT.Z","",,Now);
|
||||
Touch("D:/Wb/Home/Wb2/Downloads.TXT.Z","",,Now);
|
||||
Touch("D:/Wb/Home/Wb2/TempleOS.TXT.Z","",,Now);
|
||||
tempde=tempde1=FilesFind("*",FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER);
|
||||
while (tempde) {
|
||||
TOSWebFile(tempde->full_name);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 FreshenWebDir(U8 *dirname)
|
||||
{//No recurse
|
||||
CDirEntry *tempde,*tempde1;
|
||||
U8 *src,*dst;
|
||||
|
||||
src=MStrPrint("D:/Wb%s/*",dirname);
|
||||
Del(src);
|
||||
Free(src);
|
||||
src=MStrPrint("C:%s/*",dirname);
|
||||
dst=MStrPrint("D:/Wb%s",dirname);
|
||||
Copy(src,dst);
|
||||
Free(src);
|
||||
Free(dst);
|
||||
|
||||
src=MStrPrint("D:/Wb%s/*",dirname);
|
||||
tempde=tempde1=FilesFind(src,FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER);
|
||||
while (tempde) {
|
||||
TOSWebFile(tempde->full_name);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
U0 MakeWebSitePartial()
|
||||
{
|
||||
FreshenWebDir("/Home/Wb2");
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 UpdateISODocDefines()
|
||||
{
|
||||
DefinePrint("DD_TEMPLEOSCD_SIZE",
|
||||
"Download $TX,"TempleOS V3.02",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1f MB)",
|
||||
0.1*(10*Size("D:/Wb/TempleOSCD.ISO","+s")/1024/1024));
|
||||
DefinePrint("DD_TEMPLEOSCD_K_SIZE",
|
||||
"%d KB",Size("D:/Wb/TempleOSCD.ISO","+s")/1024);
|
||||
DefinePrint("DD_TEMPLEOSULTRA_SIZE",
|
||||
"Download $TX,"TempleOS V3.02",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.1f MB)",
|
||||
0.1*(10*Size("D:/Wb/TempleOSUltra.ISO","+s")/1024/1024));
|
||||
DefinePrint("DD_TEMPLEOSULTRA_K_SIZE",
|
||||
"%d KB",Size("D:/Wb/TempleOSUltra.ISO","+s")/1024);
|
||||
}
|
||||
|
||||
UpdateISODocDefines;
|
||||
|
||||
public U0 MakeDistrosAndBackUp()
|
||||
{
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
progress4=*progress4_desc=0;
|
||||
progress4_max=13;
|
||||
AutoComplete;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
ChkAll; progress4++;
|
||||
|
||||
MakeLineRepFile; progress4++;
|
||||
TOSCopyDrv('C','D'); progress4++;
|
||||
DelTree ("D:/Wb"); progress4++;
|
||||
CopyTree("C:/","D:/Wb"); progress4++;
|
||||
DocClear;
|
||||
|
||||
MakeStdDistro; progress4++;
|
||||
DocClear;
|
||||
Copy(TOS_ISO_NAME,"D:/Wb/TempleOSCD.ISO"); progress4++;
|
||||
|
||||
MakeUltraDistro; progress4++;
|
||||
DocClear;
|
||||
Copy(TOS_ISO_NAME,"D:/Wb/TempleOSUltra.ISO"); progress4++;
|
||||
|
||||
UpdateISODocDefines;
|
||||
|
||||
Cd("C:/");
|
||||
if (LinkChk)
|
||||
throw;
|
||||
progress4++;
|
||||
MakeSymFiles; progress4++;
|
||||
MakeWebSite; progress4++;
|
||||
|
||||
Drv('C');
|
||||
ChkAll; progress4++;
|
||||
progress4=progress4_max=0;
|
||||
SettingsPop;
|
||||
}
|
||||
@@ -37,10 +37,11 @@ public U8 *FileNameNumNext(U8 *files_find_mask,U8 *fmt)
|
||||
|
||||
U0 DCImgWrite(CDC *dc)
|
||||
{
|
||||
U8 *st=FileNameNumNext("::" TS_BLOG_DIR "/Img*","::" TS_BLOG_DIR "/Img%03d.BMP"),*st2;
|
||||
st2=MStrPrint("http://www.templeos.org/Wb%s",st+2);
|
||||
BMPFileWrite(st,dc);
|
||||
Free(st);
|
||||
U8 *st1=FileNameNumNext("::/Home/Wb2/Imgs/Img*",
|
||||
"::/Home/Wb2/Imgs/Img%03d.BMP"),
|
||||
*st2=MStrPrint("http://www.templeos.org/Wb%s",st1+2);
|
||||
BMPWrite(st1,dc);
|
||||
Free(st1);
|
||||
"$$HC,\"<img src=\\\"%s\\\" width=\\\"%d\\\" height=\\\"%d\\\" alt=\\\"\\\">\"$$\n",st2,dc->width,dc->height;
|
||||
Free(st2);
|
||||
}
|
||||
@@ -61,7 +62,7 @@ U0 BlogScreenShot()
|
||||
DocCursor(old_cursor);
|
||||
}
|
||||
|
||||
U8 *WebBookMarks(U8 *filename="HOME/Archive/Bookmarks.html")
|
||||
U8 *WebBookMarks(U8 *filename="::/Home/Archive/Bookmarks.html")
|
||||
{
|
||||
U8 *st;
|
||||
CDocEntry *doc_e;
|
||||
@@ -90,6 +91,45 @@ U8 *WebBookMarks(U8 *filename="HOME/Archive/Bookmarks.html")
|
||||
return st;
|
||||
}
|
||||
|
||||
U8 *TopMoviesRead(U8 *filename="C:/Home/Wb2/Files/Movies.TXT.Z",
|
||||
I64 line)
|
||||
{
|
||||
U8 *result=NULL;
|
||||
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_WITH_TABS);
|
||||
if (DocLineNumGoTo(doc,line-1) && doc->cur_entry->type_u8==DOCT_TEXT)
|
||||
result=StrNew(doc->cur_entry->tag);
|
||||
DocDel(doc);
|
||||
return result;
|
||||
}
|
||||
|
||||
U8 *TopMoviesWrite(U8 *filename="C:/Home/Wb2/Files/Movies.TXT.Z",
|
||||
I64 line,U8 *st)
|
||||
{
|
||||
U8 *result=NULL;
|
||||
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_WITH_TABS);
|
||||
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 result;
|
||||
}
|
||||
|
||||
class CTopMoviesForm
|
||||
{
|
||||
U8 tag[136];
|
||||
U8 special[136];
|
||||
I64 timestamp;
|
||||
I64 cert fmtstr "$$DA,32,A=\"Movie #1-100 :%d\"$$\n";
|
||||
I64 min;
|
||||
I64 sec;
|
||||
};
|
||||
|
||||
class CWebBookMarkForm
|
||||
{
|
||||
U8 tag[136] fmtstr "$$DA-P,135,A=\"Tag Text :%s\"$$\n";
|
||||
@@ -120,6 +160,16 @@ class CYouTubeForm
|
||||
I64 sec fmtstr "$$DA,32,A=\"Seconds :%d\"$$\n";
|
||||
};
|
||||
|
||||
class CTopMoviesYouTubeForm
|
||||
{
|
||||
U8 tag[136] fmtstr "$$DA-P,135,A=\"Movie :%s\"$$\n";
|
||||
U8 special[136] fmtstr "$$DA-P,135,A=\"SerialNum:%s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
I64 min fmtstr "$$DA,32,A=\"Minutes :%d\"$$\n";
|
||||
I64 sec fmtstr "$$DA,32,A=\"Seconds :%d\"$$\n";
|
||||
};
|
||||
|
||||
class CImgurForm
|
||||
{
|
||||
U8 tag[136];
|
||||
@@ -208,10 +258,9 @@ U0 MyBibleLines(U8 *st,I64 num_lines,I64 radix,Bool modulo,Bool plus_one)
|
||||
i=Str2I64(st,radix);
|
||||
|
||||
if (modulo) {
|
||||
DocPrint(doc_out,"$TX,"(Modulo is just remainder.)",HTML="http://en.wikipedia.org/wiki/Modulo_operation"$\n");
|
||||
if (radix==16)
|
||||
DocPrint(doc_out,"0x%s-->",st);
|
||||
DocPrint(doc_out,"(%d mod %d)",i,ST_BIBLE_LINES-(num_lines-1));
|
||||
DocPrint(doc_out,"(%d remainder when divided by %d)",i,ST_BIBLE_LINES-(num_lines-1));
|
||||
start=i%(ST_BIBLE_LINES-(num_lines-1));
|
||||
} else {
|
||||
if (radix==16)
|
||||
@@ -223,7 +272,7 @@ U0 MyBibleLines(U8 *st,I64 num_lines,I64 radix,Bool modulo,Bool plus_one)
|
||||
start++;
|
||||
DocPrint(doc_out,"+1");
|
||||
}
|
||||
DocPrint(doc_out,"-->Line:%d\n\n",start);
|
||||
DocPrint(doc_out,"-->Line:%d\n",start);
|
||||
|
||||
verse=BibleLine2Verse(start);
|
||||
DocPrint(doc_out,"$TX,"KingJamesBible",HTML="http://www.templeos.org/files/BIBLE.TXT"$ (%s) God says...\n$$RED$$",verse);
|
||||
@@ -259,7 +308,7 @@ U0 MyBibleLines(U8 *st,I64 num_lines,I64 radix,Bool modulo,Bool plus_one)
|
||||
}
|
||||
}
|
||||
|
||||
#define NIST_TIME_OFFSET 17586
|
||||
#define NIST_TIME_OFFSET 21082
|
||||
|
||||
public U0 SyncNIST()
|
||||
{
|
||||
@@ -276,22 +325,21 @@ public U0 SyncNIST()
|
||||
}
|
||||
}
|
||||
|
||||
U0 FillInMyURL()
|
||||
U0 InsMyURL()
|
||||
{
|
||||
U8 *tag,*st,*st2;
|
||||
CWebBibleForm *url=CAlloc(sizeof(CWebBibleForm));
|
||||
url->timestamp=
|
||||
FloorI64((Now-Str2Date("1/1/1970"))/CDATE_FREQ+NIST_TIME_OFFSET,60);
|
||||
switch (PopUpPickLst("NISTBeacon\0WebBible\0YouTube\0Imgur\0Wikipedia\0RandomNumbers.info\0"
|
||||
"Random.org\0VirtualNotary\0Nist\0HotBits\0GenerateData\0WebBookMark\0")) {
|
||||
"Random.org\0VirtualNotary\0Nist\0HotBits\0GenerateData\0WebBookMark\0"
|
||||
"Roulette\0Movie\0")) {
|
||||
case 0:
|
||||
if (DocFormDo(url(CRandHexBeaconForm *))) {
|
||||
"$$TX,\"National Institute of Standards Public Randomness Beacon\","
|
||||
"HTML=\"http://beacon.nist.gov/home\"$$\n\n"
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n\n";
|
||||
tag=MStrPrint("http://beacon.nist.gov/rest/record/%d",url->timestamp);
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n\n",tag,tag;
|
||||
"$$TX,\"Guidelines for Talking with God.\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
tag=MStrPrint("https:/beacon.nist.gov/rest/record/%d",url->timestamp);
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n",tag,tag;
|
||||
Free(tag);
|
||||
MyBibleLines(url->special,20,16,TRUE,TRUE);
|
||||
}
|
||||
@@ -343,30 +391,30 @@ U0 FillInMyURL()
|
||||
case 5:
|
||||
if (DocFormDo(url(CRandDecForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n\n";
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
tag="http://www.randomnumbers.info";
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n\n",tag,tag;
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n",tag,tag;
|
||||
MyBibleLines(url->special,20,10,FALSE,TRUE);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (DocFormDo(url(CRandDecForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n\n";
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
tag="http://www.random.org";
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n\n",tag,tag;
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n",tag,tag;
|
||||
MyBibleLines(url->special,20,10,FALSE,FALSE);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (DocFormDo(url(CRandCertForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n\n";
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
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",url->cert);
|
||||
"\n$$TX,\"%Q: %d\",HTML=\"%Q\"$$.\n\n",tag,url->cert,st;
|
||||
"\n$$TX,\"%Q: %d\",HTML=\"%Q\"$$.\n",tag,url->cert,st;
|
||||
Free(st);
|
||||
MyBibleLines(url->special,20,10,FALSE,FALSE);
|
||||
}
|
||||
@@ -374,27 +422,27 @@ U0 FillInMyURL()
|
||||
case 8:
|
||||
if (DocFormDo(url(CRandHexForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n\n";
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
tag="http://qrng.anu.edu.au/NIST.php";
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n\n",tag,tag;
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n",tag,tag;
|
||||
MyBibleLines(url->special,20,16,TRUE,TRUE);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (DocFormDo(url(CRandHexForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n\n";
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
tag="https://www.fourmilab.ch/hotbits/secure_generate.html";
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n\n",tag,tag;
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n",tag,tag;
|
||||
MyBibleLines(url->special,20,16,TRUE,TRUE);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (DocFormDo(url(CRandDecForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n\n";
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
tag="http://www.generatedata.com";
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n\n",tag,tag;
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n",tag,tag;
|
||||
MyBibleLines(url->special,20,10,FALSE,FALSE);
|
||||
}
|
||||
break;
|
||||
@@ -407,6 +455,44 @@ U0 FillInMyURL()
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
if (DocFormDo(url(CRandDecForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
tag="https://www.dublinbet.com/casino_game.html?mode=demo&game=136#gameId=136";
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n",tag,tag;
|
||||
MyBibleLines(url->special,20,10,FALSE,FALSE);
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
if (DocFormDo(url(CTopMoviesForm *)) && (st=TopMoviesRead(,url->cert*2))) {
|
||||
StrCpy(url->tag,st);
|
||||
Free(st);
|
||||
if (!(st=TopMoviesRead(,url->cert*2+1))||!*st) {
|
||||
Free(st);
|
||||
if (DocFormDo(url(CTopMoviesYouTubeForm *)) && *url->special) {
|
||||
if (url->min || url->sec)
|
||||
st=MStrPrint("%s&hl=enUS&start=%d",url->special,url->min*60+url->sec);
|
||||
else
|
||||
st=StrNew(url->special);
|
||||
TopMoviesWrite(,url->cert*2+1,st);
|
||||
} else
|
||||
st=NULL;
|
||||
}
|
||||
"God's response:\n"
|
||||
"$$TX,\"Top 100 Movies\",HTML=\"http://www.afi.com/100years/movies10.aspx\"$$\n"
|
||||
"#%s\n",url->tag;
|
||||
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);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
Free(url);
|
||||
}
|
||||
@@ -434,7 +520,7 @@ public U0 GodBooksPassage(U8 *files_find_mask,I64 len=512)
|
||||
st=FileRead(tempm->full_name);
|
||||
st2=st+(tempm->user_data+1-len)+i;
|
||||
st2[len]=0;
|
||||
"%s\n",st2;
|
||||
"%s\n\n%s\n",tempm->full_name,st2;
|
||||
Free(st);
|
||||
}
|
||||
}
|
||||
@@ -442,3 +528,6 @@ public U0 GodBooksPassage(U8 *files_find_mask,I64 len=512)
|
||||
}
|
||||
DirTreeDel(tempm1);
|
||||
}
|
||||
|
||||
|
||||
//GodInit("C:/Home/Wb2/Files/Words/Happy.TXT*");
|
||||
@@ -0,0 +1,63 @@
|
||||
//This file has handy functions used to identify which machine
|
||||
//is which in your personal collection of computers.
|
||||
|
||||
Bool IsDrvVMware(U8 drv_let)
|
||||
{
|
||||
Bool result=FALSE;
|
||||
U8 *m=NULL;
|
||||
try
|
||||
if ((m=DrvModelNum(drv_let)) &&
|
||||
!MemCmp(m,"VMware",6))
|
||||
result=TRUE;
|
||||
catch
|
||||
Fs->catch_except=TRUE;
|
||||
Free(m);
|
||||
return result;
|
||||
}
|
||||
|
||||
I64 DrvMaxBlk(U8 drv_let)
|
||||
{
|
||||
I64 result=0;
|
||||
CBlkDev *bd;
|
||||
try {
|
||||
if (bd=Let2BlkDev(drv_let))
|
||||
result=bd->max_blk;
|
||||
} catch
|
||||
Fs->catch_except=TRUE;
|
||||
return result;
|
||||
}
|
||||
|
||||
I64 IsDrvATAPI(U8 drv_let)
|
||||
{
|
||||
Bool result=FALSE;
|
||||
CBlkDev *bd;
|
||||
try if ((bd=Let2BlkDev(drv_let)) &&
|
||||
bd->type==BDT_ATAPI)
|
||||
result=TRUE;
|
||||
catch
|
||||
Fs->catch_except=TRUE;
|
||||
return result;
|
||||
}
|
||||
|
||||
Bool ChkDrvModelSerial(U8 drv_let,U8 *model,U8 *serial)
|
||||
{
|
||||
Bool result;
|
||||
U8 *m=NULL,*s=NULL;
|
||||
try {
|
||||
m=DrvModelNum(drv_let);
|
||||
s=DrvSerialNum(drv_let);
|
||||
} catch {
|
||||
Free(m); Free(s);
|
||||
m=NULL; s=NULL;
|
||||
Fs->catch_except=TRUE;
|
||||
}
|
||||
if (m && s && !StrCmp(m,model) && !StrCmp(s,serial))
|
||||
result=TRUE;
|
||||
else
|
||||
result=FALSE;
|
||||
Free(m); Free(s);
|
||||
return result;
|
||||
}
|
||||
|
||||
#define CID_DFT 0
|
||||
I64 tos_cid=CID_DFT;
|
||||
@@ -0,0 +1,301 @@
|
||||
#define VIDEO_FRAME_RATE 8
|
||||
|
||||
#define FG_JUST_AUDIO 0
|
||||
#define FG_BOOT_DRV 1
|
||||
#define FG_RAM_DRV 2
|
||||
I64 fg_mode=FG_JUST_AUDIO;
|
||||
Bool fg_on =FALSE;
|
||||
|
||||
U0 FrameGrabberTask(I64)
|
||||
{//ffmpeg -r 8 -i VID%05d.BMP -y Movie.avi
|
||||
I64 frame_num=0;
|
||||
U8 buf[136],buf2[136];
|
||||
F64 end_time=tS;
|
||||
Silent; //no output to screen
|
||||
if (fg_mode==FG_RAM_DRV) {
|
||||
MkDir("B:/Temp/ScreenShots");
|
||||
while (fg_on) {
|
||||
StrPrint(buf,"B:/Temp/ScreenShots/VID%05d.BMP",frame_num++);
|
||||
StrCpy(buf2,buf);
|
||||
BMPCaptureScreen(buf);
|
||||
while (TRUE) {
|
||||
end_time+=1.0/VIDEO_FRAME_RATE;
|
||||
if (end_time<tS) {
|
||||
StrPrint(buf,"B:/Temp/ScreenShots/VID%05d.BMP",frame_num++);
|
||||
Copy(buf2,buf);
|
||||
} else
|
||||
break;
|
||||
}
|
||||
SleepUntil(cnts.jiffies+(end_time-tS)*JIFFY_FREQ);
|
||||
}
|
||||
} else {
|
||||
MkDir("::/Temp/ScreenShots");
|
||||
while (fg_on) {
|
||||
StrPrint(buf,"::/Temp/ScreenShots/VID%05d.BMP.Z",frame_num++);
|
||||
StrCpy(buf2,buf);
|
||||
BMPCaptureScreen(buf);
|
||||
while (TRUE) {
|
||||
end_time+=1.0/VIDEO_FRAME_RATE;
|
||||
if (end_time<tS) {
|
||||
StrPrint(buf,"::/Temp/ScreenShots/VID%05d.BMP.Z",frame_num++);
|
||||
Copy(buf2,buf);
|
||||
} else
|
||||
break;
|
||||
}
|
||||
SleepUntil(cnts.jiffies+(end_time-tS)*JIFFY_FREQ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
I64 CopyVideo()
|
||||
{
|
||||
I64 result=0;
|
||||
Del("D:/Temp/*.SND");
|
||||
if (fg_mode==FG_JUST_AUDIO)
|
||||
SndFileCreate("D:/Temp/Audio",0.015,0.0,WF_SQUARE,0.45,0.35,2.5);
|
||||
else {
|
||||
SndFileCreate("D:/Temp/Audio",0.23,0.0,WF_SQUARE,0.45,0.35);
|
||||
DelTree("D:/Temp/ScreenShots");
|
||||
if (fg_mode==FG_RAM_DRV) {
|
||||
result=CopyTree("B:/Temp/ScreenShots","D:/Temp/ScreenShots");
|
||||
"Unused Space: %12.6fMeg\n",UnusedDrvSpace('B')/1024.0/1024.0;
|
||||
} else {
|
||||
result=CopyTree("::/Temp/ScreenShots","D:/Temp/ScreenShots");
|
||||
Unzip("D:/Temp/ScreenShots/*.Z");
|
||||
}
|
||||
"$$BK,1$$Files Copied:%d$$BK,0$$ Time:%8.3fm\n",result,result/60.0/VIDEO_FRAME_RATE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public U0 FrameGrabberToggle()
|
||||
{
|
||||
static F64 last_time=0;
|
||||
if (tS-last_time>3.0) {
|
||||
last_time=tS;
|
||||
if (fg_on) {
|
||||
fg_on=FALSE;
|
||||
Snd(0);
|
||||
wall->record=snd.record=FALSE;
|
||||
Sleep(1000);
|
||||
CopyVideo;
|
||||
} else {
|
||||
fg_on=TRUE;
|
||||
if (fg_mode!=FG_JUST_AUDIO)
|
||||
Spawn(&FrameGrabberTask,NULL,"Frame Grabber");
|
||||
wall->record=snd.record=TRUE;
|
||||
Snd(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public U0 JukeLines(I64 start_line,I64 end_line)
|
||||
{
|
||||
AutoComplete;
|
||||
if (!fg_on)
|
||||
FrameGrabberToggle;
|
||||
JukeSongsPuppet("::/Apps/Psalmody/Examples",,start_line*5,end_line*5);
|
||||
if (fg_on)
|
||||
FrameGrabberToggle;
|
||||
}
|
||||
|
||||
public U0 ChkAll()
|
||||
{
|
||||
U8 *ptr=TOS_HDS;
|
||||
while (*ptr)
|
||||
ChkDsk(*ptr++);
|
||||
}
|
||||
|
||||
public CDoc *DC2Doc(CDC *dc,I64 dx=0,I64 dy=0,I64 *_total_score=NULL)
|
||||
{
|
||||
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;
|
||||
CDoc *doc=DocNew;
|
||||
|
||||
MemSet(byte_bit_cnts,0,sizeof(byte_bit_cnts));
|
||||
for (i=0;i<256;i++)
|
||||
for (j=0;j<7;j++)
|
||||
if (Bt(&i,j))
|
||||
byte_bit_cnts[i]++;
|
||||
|
||||
for (row=0;row<dc->height/FONT_HEIGHT;row++) {
|
||||
for (col=0;col<dc->width/FONT_WIDTH;col++) {
|
||||
|
||||
cur_char_image=0;
|
||||
for (i=0;i<FONT_HEIGHT;i++)
|
||||
for (j=0;j<FONT_WIDTH;j++)
|
||||
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_ch=0;
|
||||
ptr=&text.font[32];
|
||||
for (ch=32;ch<127;ch++) {
|
||||
diff_image=*ptr++ ^ cur_char_image;
|
||||
score=0;
|
||||
for (i=0;i<8;i++)
|
||||
score+=byte_bit_cnts[diff_image.u8[i]];
|
||||
if (score<best_score) {
|
||||
best_score=score;
|
||||
best_ch=ch;
|
||||
}
|
||||
}
|
||||
if (best_ch=='$$')
|
||||
DocPrint(doc,"$$$$");
|
||||
else
|
||||
DocPrint(doc,"%c",best_ch);
|
||||
total_score+=best_score;
|
||||
}
|
||||
DocPrint(doc,"\n");
|
||||
}
|
||||
if (_total_score) *_total_score=total_score;
|
||||
return doc;
|
||||
}
|
||||
|
||||
public U0 BMP2TXT(U8 *_in_name,U8 *_out_name=NULL)
|
||||
{
|
||||
U8 *in_name,*out_name;
|
||||
I64 dx,dy,score,best_score=MAX_I64;
|
||||
CDC *dc;
|
||||
CDoc *doc;
|
||||
in_name=DftExt(_in_name,"BMP"),
|
||||
if (_out_name)
|
||||
out_name=DftExt(_out_name,"TXT.Z");
|
||||
else
|
||||
out_name=ChgExt(_in_name,"TXT.Z");
|
||||
if (dc=BMPRead(in_name)) {
|
||||
for (dy=-3;dy<=4;dy++)
|
||||
for (dx=-3;dx<=4;dx++) {
|
||||
doc=DC2Doc(dc,dx,dy,&score);
|
||||
if (score<best_score) {
|
||||
best_score=score;
|
||||
StrCpy(&doc->filename.name,out_name);
|
||||
DocWrite(doc);
|
||||
}
|
||||
DocDel(doc);
|
||||
}
|
||||
}
|
||||
Free(in_name);
|
||||
Free(out_name);
|
||||
}
|
||||
|
||||
U0 DblSpaceScanFile(U8 *filename)
|
||||
{
|
||||
CDoc *doc=DocRead(filename);
|
||||
I64 i;
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_NEW_LINE &&
|
||||
doc_e->next->type_u8==DOCT_NEW_LINE &&
|
||||
doc_e->next->next->type_u8==DOCT_NEW_LINE) {
|
||||
i=0;
|
||||
while (doc_e->type_u8==DOCT_NEW_LINE) {
|
||||
i++;
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
"%02d:",i;
|
||||
PutFileLink(doc->filename.name,doc_e->y);
|
||||
'\n';
|
||||
} else
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
DocDel(doc);
|
||||
}
|
||||
|
||||
U0 DblSpaceScanLst(CDirEntry *tempde)
|
||||
{
|
||||
CDirEntry *tempde1;
|
||||
while (tempde) {
|
||||
tempde1=tempde->next;
|
||||
if (tempde->attr & RS_ATTR_DIR) {
|
||||
if (tempde->sub) {
|
||||
"Scanning Directory: %s\n",tempde->full_name;
|
||||
DblSpaceScanLst(tempde->sub);
|
||||
}
|
||||
} else
|
||||
DblSpaceScanFile(tempde->full_name);
|
||||
DirEntryDel(tempde);
|
||||
tempde=tempde1;
|
||||
}
|
||||
}
|
||||
|
||||
public U0 DblSpaceScan(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
||||
{
|
||||
I64 f=0;
|
||||
ScanFlags(&f,Define("ST_FILE_UTIL_FLAGS"),"+r+T");
|
||||
ScanFlags(&f,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
DblSpaceScanLst(FilesFind(files_find_mask,f));
|
||||
}
|
||||
|
||||
AcctRegSetDftEntry("TempleOS/TOS",
|
||||
"I64 tos_code_walk_thru=1,tos_after_egypt_in_action=1;\n");
|
||||
AcctRegExeBranch("TempleOS/TOS");
|
||||
|
||||
U0 TOSRegInit()
|
||||
{
|
||||
DefinePrint("DD_CODE_WALK_THRU","Episode #%d",tos_code_walk_thru);
|
||||
DefinePrint("DD_AFTER_EGYPT_IN_ACTION","Episode #%d",tos_after_egypt_in_action);
|
||||
} TOSRegInit;
|
||||
|
||||
U0 TOSRegWrite()
|
||||
{
|
||||
AcctRegWriteBranch("TempleOS/TOS",
|
||||
"I64 tos_code_walk_thru=%d,tos_after_egypt_in_action=%d;\n",
|
||||
tos_code_walk_thru,tos_after_egypt_in_action);
|
||||
TOSRegInit;
|
||||
}
|
||||
|
||||
class CYouTubeForm2
|
||||
{
|
||||
U8 special[136] fmtstr "$$DA-P,135,A=\"SerialNum:%s\"$$\n";
|
||||
};
|
||||
|
||||
U8 *TOSYouTube()
|
||||
{
|
||||
U8 *result;
|
||||
CYouTubeForm2 *url=CAlloc(sizeof(CYouTubeForm2));
|
||||
if (DocFormDo(url(CYouTubeForm2 *)) && *url->special)
|
||||
result=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
|
||||
result=NULL;
|
||||
Free(url);
|
||||
return result;
|
||||
}
|
||||
|
||||
U0 AfterEgyptInAction()
|
||||
{
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Adam("GodInit(\"/Adam/God/Vocab.TXT*\");");
|
||||
AutoComplete;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
if (!fg_on)
|
||||
PopUp("Sleep(50);FrameGrabberToggle;");
|
||||
Ed("::/Home/Archive/AfterEgypt.TXT.Z");
|
||||
Msg(MSG_KEY_DOWN_UP,CH_SPACE,0x3900000039); //<SPACE>
|
||||
ExeFile("::/Apps/AfterEgypt/Run");
|
||||
SettingsPop;
|
||||
tos_after_egypt_in_action++;
|
||||
TOSRegWrite;
|
||||
}
|
||||
|
||||
U0 CodeWalkThru()
|
||||
{
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
AutoComplete;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
if (!fg_on)
|
||||
PopUp("Sleep(50);FrameGrabberToggle;");
|
||||
Ed("::/Home/Archive/RandomCode.TXT.Z");
|
||||
SettingsPop;
|
||||
Msg(MSG_KEY_DOWN_UP,'b',0x83000000830); //<ALT-b>
|
||||
tos_code_walk_thru++;
|
||||
TOSRegWrite;
|
||||
}
|
||||
@@ -1,490 +0,0 @@
|
||||
Bool IsDrvVMware(U8 drv_let)
|
||||
{
|
||||
Bool result=FALSE;
|
||||
U8 *m=NULL;
|
||||
try
|
||||
if ((m=DrvModelNum(drv_let)) &&
|
||||
!MemCmp(m,"VMware",6))
|
||||
result=TRUE;
|
||||
catch
|
||||
Fs->catch_except=TRUE;
|
||||
Free(m);
|
||||
return result;
|
||||
}
|
||||
|
||||
I64 DrvMaxBlk(U8 drv_let)
|
||||
{
|
||||
I64 result=0;
|
||||
CBlkDev *bdev;
|
||||
try {
|
||||
if (bdev=Drv2BlkDev(drv_let))
|
||||
result=bdev->max_blk;
|
||||
} catch
|
||||
Fs->catch_except=TRUE;
|
||||
return result;
|
||||
}
|
||||
|
||||
I64 IsDrvATAPI(U8 drv_let)
|
||||
{
|
||||
Bool result=FALSE;
|
||||
CBlkDev *bdev;
|
||||
try if ((bdev=Drv2BlkDev(drv_let)) &&
|
||||
bdev->type==BDT_ATAPI)
|
||||
result=TRUE;
|
||||
catch
|
||||
Fs->catch_except=TRUE;
|
||||
return result;
|
||||
}
|
||||
|
||||
Bool ChkDrvModelSerial(U8 drv_let,U8 *model,U8 *serial)
|
||||
{
|
||||
Bool result;
|
||||
U8 *m=NULL,*s=NULL;
|
||||
try {
|
||||
m=DrvModelNum(drv_let);
|
||||
s=DrvSerialNum(drv_let);
|
||||
} catch {
|
||||
Free(m); Free(s);
|
||||
m=NULL; s=NULL;
|
||||
Fs->catch_except=TRUE;
|
||||
}
|
||||
if (m && s && !StrCmp(m,model) && !StrCmp(s,serial))
|
||||
result=TRUE;
|
||||
else
|
||||
result=FALSE;
|
||||
Free(m); Free(s);
|
||||
return result;
|
||||
}
|
||||
|
||||
#define SLOP BLK_SIZE
|
||||
U0 TSBootRescueDrv1()
|
||||
{
|
||||
CBinFile *bfh=sys_boot_base-sizeof(CBinFile);
|
||||
bfh(I64)+=bfh->file_size-1;
|
||||
DefinePrint("TS_BOOT_RESCUE_DRV_START","0x%X",CeilI64(SYS_KERNEL_END+SLOP,BLK_SIZE));
|
||||
DefinePrint("TS_BOOT_RESCUE_DRV_END", "0x%X",FloorI64(
|
||||
(BOOT_RAM_LIMIT-(BOOT_STK_SIZE+CD_BOOT_LOADER_SIZE))>>4<<4-
|
||||
(bfh(I64)-SYS_KERNEL_END)-SLOP,BLK_SIZE));
|
||||
DefinePrint("CFG_BOOT_RESCUE_DRV_FILE","\"/Temp/BootRescueDrv.BIN.Z\"");
|
||||
} TSBootRescueDrv1;
|
||||
|
||||
U0 TSBootRescueDrv2()
|
||||
{
|
||||
DefinePrint("CFG_BOOT_RESCUE_DRV","\"a10x%X\n0x%X\n\"",TS_BOOT_RESCUE_DRV_START,
|
||||
(TS_BOOT_RESCUE_DRV_END-TS_BOOT_RESCUE_DRV_START)/BLK_SIZE);
|
||||
DefinePrint("CFG_BOOT_RESCUE_DRV_START","\"0x%X\"",TS_BOOT_RESCUE_DRV_START);
|
||||
} TSBootRescueDrv2;
|
||||
|
||||
U0 TSEmployeeSet()
|
||||
{
|
||||
U8 *st=StrNew(sys_acct),*st2=MAllocIdentical(st);
|
||||
StrLastRem(st,"/",st2);
|
||||
Free(st);
|
||||
DefinePrint("TS_EMPLOYEE","\"%s\"",st2);
|
||||
Free(st2);
|
||||
} TSEmployeeSet;
|
||||
|
||||
U0 TSBlogDirSet()
|
||||
{
|
||||
CDateStruct ds;
|
||||
Date2Struct(&ds,Now+local_time_offset);
|
||||
DefinePrint("TS_BLOG_DIR","\"/Accts/TS/Wb2/Rants/%s/%04d/%02d\"",
|
||||
TS_EMPLOYEE,ds.year,ds.mon);
|
||||
} TSBlogDirSet;
|
||||
|
||||
#define CID_DFT 0
|
||||
#define CID_TAD8 1 //This was my old machine but it died. Booted natively
|
||||
#define CID_TAD8_VM 2 //It could run booted with physical drive in VMware
|
||||
//My current machine is TAD9 but it only runs in VMware, so it's CID_DFT
|
||||
|
||||
I64 ts_cid=CID_DFT;
|
||||
|
||||
U0 TSIDComputer()
|
||||
{
|
||||
/* My TAD8 computer died. It had two hard drives. You could
|
||||
boot it directly or from VMware with a physical drive.
|
||||
|
||||
CMemE820 *m20=SYS_MEM_E820;
|
||||
if (IsDrvVMware('D') && DrvMaxBlk('D')==0x575466EF)
|
||||
ts_cid=CID_TAD8_VM; //VMware boot of TAD8
|
||||
else if (ChkDrvModelSerial('D',"Hitachi HDS721075KLA330","GTF202P8H509AF") &&
|
||||
ChkDrvModelSerial('I',"ST3320620AS","6QF24J0A"))
|
||||
ts_cid=CID_TAD8; //Regular boot of TAD8
|
||||
//beware 'S'
|
||||
else if (*sys_acct=='T' && IsDrvATAPI('T') && m20[11].base==0x100000000 &&
|
||||
m20[11].base(I64)+m20[11].len-1==0x33FFFFFFF)
|
||||
ts_cid=CID_TAD8; //CDROM boot of TAD8
|
||||
|
||||
*/
|
||||
} TSIDComputer;
|
||||
|
||||
U0 TSInit()
|
||||
{
|
||||
CATARep *root=NULL,*ata_drv=NULL,*atapi_drv=NULL;
|
||||
CBlkDev *bdev;
|
||||
switch (ts_cid) {
|
||||
/* This machine died, but you can use it as an example.
|
||||
|
||||
case CID_TAD8:
|
||||
case CID_TAD8_VM:
|
||||
DefinePrint("CFG_ACCT","\"\nTS/TAD\n\"");
|
||||
DefinePrint("CFG_HARD_DRVS","\"h2s0xbc00\n0xb880\n1d2s0xbc00\n0xb880\n0\"");
|
||||
DefinePrint("CFG_RAM_DRVS","\"b1\nScale2Mem(2048,0x40000)\n\"");
|
||||
DefinePrint("CFG_CDROM_DRVS","\"t3s0xb800\n0\"");
|
||||
DefinePrint("CFG_DSK_CACHE","\"Scale2Mem(0x80000,0x8000000)\n\"");
|
||||
if (ts_cid==CID_TAD8) {
|
||||
DefinePrint("TS_HDS","\"DEI\"");
|
||||
DefinePrint("TS_MASTER_BOOT_DRVS","\"I\"");
|
||||
} else {//CID_TAD8_VM
|
||||
DefinePrint("TS_HDS","\"DE\"");
|
||||
DefinePrint("TS_MASTER_BOOT_DRVS","\"\"");
|
||||
}
|
||||
DefinePrint("TS_MAIN_DRV","\"D\"");
|
||||
DefinePrint("TS_BAK_DRV","\"E\"");
|
||||
DefinePrint("TS_RAM_DRV","\"B\"");
|
||||
DefinePrint("TS_WIN_DRV","\"H\"");
|
||||
DefinePrint("TS_CDROM_DRV","\"T\"");
|
||||
break;
|
||||
*/
|
||||
case CID_DFT:
|
||||
DefinePrint("CFG_ACCT","\"\nTS/TAD\n\"");
|
||||
DefinePrint("CFG_RAM_DRVS","\"b1\nScale2Mem(2048,0x40000)\n\"");
|
||||
if (dsk.auto_mount_ide_cnt) {
|
||||
//If AutoMount was successful, No need to manually mount in next compile
|
||||
DefinePrint("CFG_HARD_DRVS","\"\"");
|
||||
DefinePrint("CFG_CDROM_DRVS","\"\"");
|
||||
} else {
|
||||
|
||||
//These two are a crazy guess. ATA:IDE Primary ATAPI:IDE Secondary
|
||||
DefinePrint("CFG_HARD_DRVS","\"d2s0x1F0\n0x3F4\n0\"");
|
||||
DefinePrint("CFG_CDROM_DRVS","\"t3s0x170\n0\"");
|
||||
|
||||
bdev=Drv2BlkDev(*sys_acct);
|
||||
if (bdev->type==BDT_ATAPI) {
|
||||
ATARep(FALSE,,&root);
|
||||
ATAIDDrvs(root,*sys_acct,&ata_drv,&atapi_drv);
|
||||
if (ata_drv)
|
||||
DefinePrint("CFG_HARD_DRVS","\"d2p%d\n\"",ata_drv->num);
|
||||
if (atapi_drv)
|
||||
DefinePrint("CFG_CDROM_DRVS","\"t3p%d\n\"",atapi_drv->num);
|
||||
} else {
|
||||
try {
|
||||
bdev=Drv2BlkDev('D');
|
||||
DefinePrint("CFG_HARD_DRVS","\"d2s0x%X\n0x%X\n%d\"",
|
||||
bdev->base0,bdev->base1,bdev->unit);
|
||||
} catch
|
||||
Fs->catch_except=TRUE;
|
||||
try {
|
||||
bdev=Drv2BlkDev('T');
|
||||
DefinePrint("CFG_CDROM_DRVS","\"t3s0x%X\n%d\"",bdev->base0,bdev->unit);
|
||||
} catch
|
||||
Fs->catch_except=TRUE;
|
||||
}
|
||||
}
|
||||
DefinePrint("CFG_DSK_CACHE","\"Scale2Mem(0x80000,0x8000000)\n\"");
|
||||
DefinePrint("TS_HDS","\"DE\"");
|
||||
DefinePrint("TS_MASTER_BOOT_DRVS","\"D\"");
|
||||
DefinePrint("TS_MAIN_DRV","\"D\"");
|
||||
DefinePrint("TS_BAK_DRV","\"E\"");
|
||||
DefinePrint("TS_BOOT_RESCUE_DRV","\"A\"");
|
||||
DefinePrint("TS_RAM_DRV","\"B\"");
|
||||
DefinePrint("TS_WIN_DRV","\"\"");
|
||||
DefinePrint("TS_CDROM_DRV","\"T\"");
|
||||
}
|
||||
} TSInit;
|
||||
|
||||
U0 TSInit2()
|
||||
{
|
||||
DefinePrint("TS_MAIN_DRV_LET","'%s'",TS_MAIN_DRV);
|
||||
DefinePrint("TS_BAK_DRV_LET","'%s'",TS_BAK_DRV);
|
||||
DefinePrint("TS_BOOT_RESCUE_DRV_LET","'%s'",TS_BOOT_RESCUE_DRV);
|
||||
DefinePrint("TS_RAM_DRV_LET","'%s'",TS_RAM_DRV);
|
||||
DefinePrint("TS_WIN_DRV_LET","'%s'",TS_WIN_DRV);
|
||||
DefinePrint("TS_CDROM_DRV_LET","'%s'",TS_CDROM_DRV);
|
||||
|
||||
} TSInit2;
|
||||
|
||||
Bool ts_has_main_drv =ToBool(StrLen(TS_MAIN_DRV)),
|
||||
ts_has_bak_drv =ToBool(StrLen(TS_BAK_DRV)),
|
||||
ts_has_boot_rescue_drv =ToBool(StrLen(TS_BOOT_RESCUE_DRV)),
|
||||
ts_has_ram_drv =ToBool(StrLen(TS_RAM_DRV)),
|
||||
ts_has_win_drv =ToBool(StrLen(TS_WIN_DRV)),
|
||||
ts_has_cdrom_drv=ToBool(StrLen(TS_CDROM_DRV));
|
||||
|
||||
if (ts_has_main_drv)
|
||||
SetDrvTextAttr(TS_MAIN_DRV_LET, WHITE <<4|BLUE);
|
||||
if (ts_has_bak_drv)
|
||||
SetDrvTextAttr(TS_BAK_DRV_LET, WHITE <<4|RED);
|
||||
if (ts_has_boot_rescue_drv)
|
||||
SetDrvTextAttr(TS_BOOT_RESCUE_DRV_LET, BLUE <<4|BROWN);
|
||||
if (ts_has_ram_drv)
|
||||
SetDrvTextAttr(TS_RAM_DRV_LET, BLUE <<4|YELLOW);
|
||||
if (ts_has_win_drv)
|
||||
SetDrvTextAttr(TS_WIN_DRV_LET, LTRED <<4|BLACK);
|
||||
if (ts_has_cdrom_drv)
|
||||
SetDrvTextAttr(TS_CDROM_DRV_LET,LTGRAY<<4|BLUE);
|
||||
|
||||
#define TS_ISO_NAME TS_RAM_DRV ":/TempleOSCD.ISO"
|
||||
#define TS_DISTRO_DIR TS_RAM_DRV ":/Distro"
|
||||
#define CFG_OPTS "AutoMountIDE\nDT\n"
|
||||
#define CFG_DBG_OPTS "AutoMountIDE\nDT"\
|
||||
"HeapInit\n130\nMemInit\n131\nVarInit\n132\n\n"
|
||||
#define CFG_DBGZ_OPTS "AutoMountIDE\nDT"\
|
||||
"HeapInit\n0\nMemInit\n0\nVarInit\n0\n\n"
|
||||
#define TS_CFG "\n" CFG_RAM_DRVS CFG_CDROM_DRVS CFG_HARD_DRVS CFG_ACCT CFG_DSK_CACHE CFG_OPTS
|
||||
#define TS_MENU_CFG "\n" CFG_RAM_DRVS CFG_CDROM_DRVS CFG_HARD_DRVS "\n\n" CFG_DSK_CACHE CFG_OPTS
|
||||
#define TS_CDROM_CFG "Tb1\n0x20000\nt3 \n\nTS\n\nAutoMountIDE\nDT\n"
|
||||
#define TS_CDROM_DBG_CFG "A" CFG_BOOT_RESCUE_DRV "b1\nScale2Mem(2048,0x40000)\n\n\n\n"\
|
||||
"DontProbe\nBootRescueDrv\n" TS_MAIN_DRV ":" CFG_BOOT_RESCUE_DRV_FILE "\n" CFG_BOOT_RESCUE_DRV_START "\n\n"
|
||||
//$BK,1$Change these, too...$BK,0$
|
||||
//$MA-X+PU,"STD_DISTRO_CDROM_CFG",LM="F(\"STD_DISTRO_CDROM_CFG\");View;"$
|
||||
//$LK,"Install Acct",A="FF:::/Accts/Install/DoOnce.CPP,MakeOSPrtBootInstall"$
|
||||
|
||||
Bool frame_grabber_on=FALSE;
|
||||
#define VIDEO_FRAME_RATE 8
|
||||
U0 FrameGrabberTask(I64)
|
||||
{/**** TO MAKE MOVIE ****
|
||||
|
||||
TempleOS
|
||||
<ALT-SHIFT-V>
|
||||
[Do stuff you want recorded]
|
||||
<ALT-SHIFT-V>
|
||||
|
||||
Boot Windows
|
||||
Copy /Temp
|
||||
Download "ffmpeg" from the Internet
|
||||
|
||||
>CD SCREENSHOTS
|
||||
>TSZ .
|
||||
>ffmpeg -r 8 -i VID%05d.BMP -y Movie.avi
|
||||
|
||||
*/
|
||||
I64 frame_num=0;
|
||||
U8 buf[136],buf2[136];
|
||||
F64 end_time=tS;
|
||||
Silent(ON); //no output to screen
|
||||
MkDir("::/Temp/ScreenShots");
|
||||
while (frame_grabber_on) {
|
||||
StrPrint(buf,"::/Temp/ScreenShots/VID%05d.BMP.Z",frame_num++);
|
||||
StrCpy(buf2,buf);
|
||||
BMPFileCaptureScreen(buf);
|
||||
while (TRUE) {
|
||||
end_time+=1.0/VIDEO_FRAME_RATE;
|
||||
if (end_time<tS) {
|
||||
StrPrint(buf,"::/Temp/ScreenShots/VID%05d.BMP.Z",frame_num++);
|
||||
Copy(buf2,buf);
|
||||
} else
|
||||
break;
|
||||
}
|
||||
SleepUntil(cnts.jiffies+(end_time-tS)*JIFFY_FREQ);
|
||||
}
|
||||
}
|
||||
|
||||
I64 CopyVideo()
|
||||
{
|
||||
I64 result=0;
|
||||
if (ts_has_bak_drv) {
|
||||
Del(TS_BAK_DRV ":/Temp/*.SND");
|
||||
SndFileCreate(TS_BAK_DRV ":/Temp/Audio",0.23,0.0,WF_SQUARE,0.45,0.35);
|
||||
DelTree(TS_BAK_DRV ":/Temp/ScreenShots");
|
||||
CopyTree("::/Temp/ScreenShots",TS_BAK_DRV ":/Temp/ScreenShots");
|
||||
result=Unzip(TS_BAK_DRV ":/Temp/ScreenShots/*.Z");
|
||||
}
|
||||
"$$BK,1$$Files Copied:%d$$BK,0$$ Time:%8.3fm\n",result,result/60.0/VIDEO_FRAME_RATE;
|
||||
return result;
|
||||
}
|
||||
|
||||
public U0 FrameGrabberToggle()
|
||||
{
|
||||
static F64 last_time=0;
|
||||
if (tS-last_time>3.0) {
|
||||
last_time=tS;
|
||||
if (frame_grabber_on) {
|
||||
frame_grabber_on=FALSE;
|
||||
Snd(0);
|
||||
wall->record=snd.record=FALSE;
|
||||
Sleep(1000);
|
||||
CopyVideo;
|
||||
} else {
|
||||
frame_grabber_on=TRUE;
|
||||
Spawn(&FrameGrabberTask,NULL,"Frame Grabber");
|
||||
wall->record=snd.record=TRUE;
|
||||
Snd(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
U0 JukeSongsPut(U8 *dir,I64 start_song,I64 end_song)
|
||||
{
|
||||
I64 i,j,len=4;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
Cd(dir);
|
||||
tempde1=FilesFind("*",FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES);
|
||||
|
||||
for (tempde=tempde1,i=0;tempde && i<start_song;i++)
|
||||
tempde=tempde->next;
|
||||
for (i=start_song;tempde && i<end_song;i++) {
|
||||
if (FileExtDot(tempde->name))
|
||||
FileExtRem(tempde->name);
|
||||
if (j=StrLen(tempde->name)) {
|
||||
*tempde->full_name=':';
|
||||
*tempde->name=ToUpper(*tempde->name);
|
||||
if (j>len) len=j;
|
||||
}
|
||||
tempde=tempde->next;
|
||||
}
|
||||
|
||||
for (tempde=tempde1,i=0;tempde && i<start_song;i++)
|
||||
tempde=tempde->next;
|
||||
if (end_song-start_song<=9)
|
||||
j=1;
|
||||
else if (end_song-start_song<=99)
|
||||
j=2;
|
||||
else
|
||||
j=3;
|
||||
for (i=start_song;tempde && i<end_song;i++) {
|
||||
"$$LK+CX,\"%*d) %-*s\",A=\"FI:%s\"$$\n",j,i-start_song+1,len,tempde->name,tempde->full_name;
|
||||
tempde=tempde->next;
|
||||
}
|
||||
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
public U0 JukeLines(I64 start_line,I64 end_line)
|
||||
{
|
||||
WordStat;
|
||||
if (!frame_grabber_on)
|
||||
FrameGrabberToggle;
|
||||
JukeSongsPuppet("::/Apps/Psalmody/Examples",,start_line*5,end_line*5);
|
||||
if (frame_grabber_on)
|
||||
FrameGrabberToggle;
|
||||
JukeSongsPut("::/Apps/Psalmody/Examples",start_line*5,end_line*5);
|
||||
}
|
||||
|
||||
public U0 ChkAll()
|
||||
{
|
||||
U8 *ptr=TS_HDS;
|
||||
while (*ptr)
|
||||
ChkDsk(*ptr++);
|
||||
}
|
||||
|
||||
public CDoc *DC2Doc(CDC *dc,I64 dx=0,I64 dy=0,I64 *_total_score=NULL)
|
||||
{
|
||||
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;
|
||||
CDoc *doc=DocNew;
|
||||
|
||||
MemSet(byte_bit_cnts,0,sizeof(byte_bit_cnts));
|
||||
for (i=0;i<256;i++)
|
||||
for (j=0;j<7;j++)
|
||||
if (Bt(&i,j))
|
||||
byte_bit_cnts[i]++;
|
||||
|
||||
for (row=0;row<dc->height/FONT_HEIGHT;row++) {
|
||||
for (col=0;col<dc->width/FONT_WIDTH;col++) {
|
||||
|
||||
cur_char_image=0;
|
||||
for (i=0;i<FONT_HEIGHT;i++)
|
||||
for (j=0;j<FONT_WIDTH;j++)
|
||||
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_ch=0;
|
||||
ptr=&text.font[32*FONT_HEIGHT];
|
||||
for (ch=32;ch<127;ch++) {
|
||||
diff_image=*ptr++ ^ cur_char_image;
|
||||
score=0;
|
||||
for (i=0;i<8;i++)
|
||||
score+=byte_bit_cnts[diff_image.u8[i]];
|
||||
if (score<best_score) {
|
||||
best_score=score;
|
||||
best_ch=ch;
|
||||
}
|
||||
}
|
||||
if (best_ch=='$$')
|
||||
DocPrint(doc,"$$$$");
|
||||
else
|
||||
DocPrint(doc,"%c",best_ch);
|
||||
total_score+=best_score;
|
||||
}
|
||||
DocPrint(doc,"\n");
|
||||
}
|
||||
if (_total_score) *_total_score=total_score;
|
||||
return doc;
|
||||
}
|
||||
|
||||
public U0 BMP2TXT(U8 *_in_name,U8 *_out_name=NULL)
|
||||
{
|
||||
U8 *in_name,*out_name;
|
||||
I64 dx,dy,score,best_score=MAX_I64;
|
||||
CDC *dc;
|
||||
CDoc *doc;
|
||||
in_name=DftExt(_in_name,"BMP"),
|
||||
if (_out_name)
|
||||
out_name=DftExt(_out_name,"TXT.Z");
|
||||
else
|
||||
out_name=ChgExt(_in_name,"TXT.Z");
|
||||
if (dc=BMPFileRead(in_name)) {
|
||||
for (dy=-3;dy<=4;dy++)
|
||||
for (dx=-3;dx<=4;dx++) {
|
||||
doc=DC2Doc(dc,dx,dy,&score);
|
||||
if (score<best_score) {
|
||||
best_score=score;
|
||||
StrCpy(&doc->filename.name,out_name);
|
||||
DocWrite(doc);
|
||||
}
|
||||
DocDel(doc);
|
||||
}
|
||||
}
|
||||
Free(in_name);
|
||||
Free(out_name);
|
||||
}
|
||||
|
||||
U0 DblSpaceScanFile(U8 *filename)
|
||||
{
|
||||
CDoc *doc=DocRead(filename);
|
||||
I64 i;
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_NEW_LINE &&
|
||||
doc_e->next->type_u8==DOCT_NEW_LINE &&
|
||||
doc_e->next->next->type_u8==DOCT_NEW_LINE) {
|
||||
i=0;
|
||||
while (doc_e->type_u8==DOCT_NEW_LINE) {
|
||||
i++;
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
"%02d:",i;
|
||||
PutFileLink(doc->filename.name,doc_e->y);
|
||||
'\n';
|
||||
} else
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
DocDel(doc);
|
||||
}
|
||||
|
||||
U0 DblSpaceScanLst(CDirEntry *tempde)
|
||||
{
|
||||
CDirEntry *tempde1;
|
||||
while (tempde) {
|
||||
tempde1=tempde->next;
|
||||
if (tempde->attr & RS_ATTR_DIR) {
|
||||
if (tempde->sub) {
|
||||
"Scanning Directory: %s\n",tempde->full_name;
|
||||
DblSpaceScanLst(tempde->sub);
|
||||
}
|
||||
} else
|
||||
DblSpaceScanFile(tempde->full_name);
|
||||
DirEntryDel(tempde);
|
||||
tempde=tempde1;
|
||||
}
|
||||
}
|
||||
|
||||
public U0 DblSpaceScan(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
||||
{
|
||||
I64 f=0;
|
||||
ScanFlags(&f,Define("ST_FILE_UTIL_FLAGS"),"+r+T");
|
||||
ScanFlags(&f,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
DblSpaceScanLst(FilesFind(files_find_mask,f));
|
||||
}
|
||||
@@ -1,624 +0,0 @@
|
||||
//The CFG defines are $LK,"Here",A="FI:::/Demo/AcctExample/TSAdam.CPP"$.
|
||||
|
||||
U8 TSGetDrv()
|
||||
{
|
||||
I64 result;
|
||||
"Drive (%s):",TS_HDS;
|
||||
result=ToUpper(GetChar);
|
||||
'\n';
|
||||
return result;
|
||||
}
|
||||
|
||||
U0 TSMakeOSPrtBootInstall(U8 drv_let)
|
||||
{
|
||||
drv_let=ToUpper(drv_let);
|
||||
Auto(TS_CFG);
|
||||
MakeOSPrtBootInstall(drv_let);
|
||||
if (StrOcc(TS_MASTER_BOOT_DRVS,drv_let))
|
||||
MasterBootIntall(drv_let);
|
||||
}
|
||||
|
||||
U0 SoftBootMenu(U8 drv_let=0)
|
||||
{
|
||||
if (!drv_let)
|
||||
drv_let=Prt2Drv(Fs->cur_prt);
|
||||
Drv(drv_let);
|
||||
Cd("/Kernel");
|
||||
Auto(TS_MENU_CFG);
|
||||
if (!Cmp("Kernel","Kernel",NULL,':'))
|
||||
SoftBoot("Kernel.BIN.Z");
|
||||
}
|
||||
|
||||
U0 TSCopyDrv(U8 src,U8 dst)
|
||||
{
|
||||
U8 buf_s[128],buf_d[128];
|
||||
src=ToUpper(src);
|
||||
dst=ToUpper(dst);
|
||||
|
||||
Fmt(dst,,FALSE,PT_FAT32);
|
||||
|
||||
StrPrint(buf_s,"%c:/",src);
|
||||
StrPrint(buf_d,"%c:/",dst);
|
||||
CopyTree(buf_s,buf_d);
|
||||
|
||||
DocClear;
|
||||
Drv(dst);
|
||||
TSMakeOSPrtBootInstall(dst);
|
||||
}
|
||||
|
||||
U0 TSPromptAndCopyDrv()
|
||||
{
|
||||
I64 src,dst;
|
||||
"$$RED$$\nCopy Src Drive:\n$$FG$$";
|
||||
src=TSGetDrv;
|
||||
"$$RED$$\nCopy Dst Drive:\n$$FG$$";
|
||||
dst=TSGetDrv;
|
||||
TSCopyDrv(src,dst);
|
||||
}
|
||||
|
||||
public U0 CursorRemFile(U8 *filename)
|
||||
{
|
||||
CDoc *doc;
|
||||
doc=DocRead(filename,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
}
|
||||
public U0 CursorRem(U8 *files_find_mask="*")
|
||||
{
|
||||
I64 fuf_flags=0;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T+f+F+O");
|
||||
CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde;
|
||||
while (tempde) {
|
||||
CursorRemFile(tempde->full_name);
|
||||
Touch(tempde->full_name,"",,tempde->datetime);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
U0 UncollapseFile(U8 *filename,I64 *)
|
||||
{
|
||||
CDoc *doc=DocRead(filename,DOCF_NO_CURSOR);
|
||||
DocCollapse(FALSE,doc);
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
}
|
||||
U0 Uncollapse(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
||||
{
|
||||
I64 fuf_flags=0;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T+O");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde;
|
||||
while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) {
|
||||
UncollapseFile(tempde->full_name,&fuf_flags);
|
||||
Touch(tempde->full_name,"",,tempde->datetime);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
public U0 CopySongs(U8 threshold='7')
|
||||
{
|
||||
CDoc *s;
|
||||
CDocEntry *doc_e;
|
||||
CDirEntry *tempde=FilesFind("/Accts/TS/TAD/Psalmody/*.CPP*",FUF_CLUSTER_ORDER),*tempde1=tempde;
|
||||
DelTree("/Apps/Psalmody/Examples");
|
||||
MkDir("/Apps/Psalmody/Examples");
|
||||
while (tempde) {
|
||||
s=DocRead(tempde->full_name);
|
||||
doc_e=s->root.next;
|
||||
if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[2]>=threshold)
|
||||
Copy(tempde->full_name,"/Apps/Psalmody/Examples");
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
U0 DistroPrep()
|
||||
{
|
||||
Del("/Demo/WebLogExample/WebLogRep.TXT*");
|
||||
Del("/Demo/ReverseFileExample/PoemForeward.TXT*");
|
||||
Del("/Demo/Games/EagleDive.BIN*");
|
||||
DelTree("/Accts/*Temp.TXT.Z");
|
||||
CopySongs;
|
||||
|
||||
DelTree("/Temp");
|
||||
MkDir("/Temp");
|
||||
MkDir("/Temp/ScreenShots");
|
||||
|
||||
//User
|
||||
Del("/Accts/User/Registry.CPP.Z");
|
||||
//Install
|
||||
Del("/Accts/Install/Registry.CPP.Z");
|
||||
|
||||
Touch("/Accts/PersonalMenu.TXT.Z","+T");
|
||||
//TS
|
||||
Touch("/Accts/TS/PersonalMenu.TXT.Z","+T");
|
||||
|
||||
DelTree("/Demo/AcctExample");
|
||||
CopyTree("/Accts/TS","/Demo/AcctExample");
|
||||
DelTree("/Demo/AcctExample/TAD/Psalmody");
|
||||
DelTree("/Demo/AcctExample/Wb2");
|
||||
DelTree("/Demo/AcctExample/TAD");
|
||||
|
||||
//Once in a while, do these:
|
||||
// TSSortHeaders;
|
||||
// DocOpt("/*");
|
||||
// DblSpaceScan("/*");
|
||||
|
||||
CursorRem("/*");
|
||||
DelTree("/Demo/*.BI*");
|
||||
S2T("/*","+r+S");
|
||||
DocOpt("/*");
|
||||
Move(WSD_DEF_FILENAME,WSD_DEF_FILENAME_Z);
|
||||
}
|
||||
|
||||
U0 MakeBootRescueDrvFile()
|
||||
{
|
||||
try
|
||||
PrtChk(Drv2Prt(TS_BOOT_RESCUE_DRV_LET));
|
||||
catch {
|
||||
Fs->catch_except=TRUE;
|
||||
Auto(CFG_BOOT_RESCUE_DRV "\n");
|
||||
Mount;
|
||||
}
|
||||
CBlkDev *bdev=Drv2BlkDev(TS_BOOT_RESCUE_DRV_LET);
|
||||
Fmt(TS_BOOT_RESCUE_DRV_LET,,FALSE,PT_REDSEA);
|
||||
|
||||
MkDir(TS_BOOT_RESCUE_DRV ":/Compiler");
|
||||
Copy(TS_MAIN_DRV ":/Compiler/Compiler.BIN.Z", TS_BOOT_RESCUE_DRV ":/Compiler");
|
||||
Copy(TS_MAIN_DRV ":/Compiler/OpCodes.TXT.Z", TS_BOOT_RESCUE_DRV ":/Compiler");
|
||||
Copy(TS_MAIN_DRV ":/Compiler/CmpDefs.HPP.Z", TS_BOOT_RESCUE_DRV ":/Compiler");
|
||||
Copy(TS_MAIN_DRV ":/Compiler/Cmp.HPP.Z", TS_BOOT_RESCUE_DRV ":/Compiler");
|
||||
|
||||
MkDir(TS_BOOT_RESCUE_DRV ":/Kernel");
|
||||
Copy(TS_MAIN_DRV ":/Kernel/*.HPP*", TS_BOOT_RESCUE_DRV ":/Kernel");
|
||||
Copy(TS_MAIN_DRV ":/Kernel/Adam1*", TS_BOOT_RESCUE_DRV ":/Kernel");
|
||||
CopyTree(TS_MAIN_DRV ":/Kernel/Dsk", TS_BOOT_RESCUE_DRV ":/Kernel/Dsk");
|
||||
|
||||
MkDir(TS_BOOT_RESCUE_DRV ":/Adam");
|
||||
Copy(TS_MAIN_DRV ":/Accts/TS/DbgAdam2.CPP.Z", TS_BOOT_RESCUE_DRV ":/Adam/Adam2.CPP.Z");
|
||||
Copy(TS_MAIN_DRV ":/Adam/AdamExts.HPP.Z", TS_BOOT_RESCUE_DRV ":/Adam");
|
||||
Copy(TS_MAIN_DRV ":/Adam/Math2a.CPP.Z", TS_BOOT_RESCUE_DRV ":/Adam");
|
||||
Copy(TS_MAIN_DRV ":/Adam/Training.CPP.Z", TS_BOOT_RESCUE_DRV ":/Adam");
|
||||
Copy(TS_MAIN_DRV ":/Adam/Utils2a.CPP.Z", TS_BOOT_RESCUE_DRV ":/Adam");
|
||||
Copy(TS_MAIN_DRV ":/Adam/MathODE.CPP.Z", TS_BOOT_RESCUE_DRV ":/Adam");
|
||||
|
||||
FileWrite(TS_MAIN_DRV ":" CFG_BOOT_RESCUE_DRV_FILE,bdev->RAM_dsk,(bdev->max_blk+1)<<BLK_SIZE_BITS);
|
||||
}
|
||||
|
||||
U0 MakeSymFiles()
|
||||
{
|
||||
CDoc *doc;
|
||||
U8 *st;
|
||||
if (ts_has_bak_drv) {
|
||||
DocClear;
|
||||
DocMax;
|
||||
HashTablePurge(adam_task->hash_table);
|
||||
Who;
|
||||
if (doc=DocPut) {
|
||||
st=StrNew(doc->filename.name);
|
||||
StrCpy(doc->filename.name,TS_BAK_DRV ":/Wb/Accts/TS/Wb2/SymsAlpha.TXT.Z");
|
||||
DocWrite(doc);
|
||||
StrCpy(doc->filename.name,st);
|
||||
Free(st);
|
||||
}
|
||||
DocClear;
|
||||
DocMax;
|
||||
Who("+m");
|
||||
if (doc=DocPut) {
|
||||
st=StrNew(doc->filename.name);
|
||||
StrCpy(doc->filename.name,TS_BAK_DRV ":/Wb/Accts/TS/Wb2/SymsAddress.TXT.Z");
|
||||
DocWrite(doc);
|
||||
StrCpy(doc->filename.name,st);
|
||||
Free(st);
|
||||
}
|
||||
DocClear;
|
||||
}
|
||||
}
|
||||
|
||||
I64 MakeLineRepFile()
|
||||
{
|
||||
U8 *st;
|
||||
CDoc *doc;
|
||||
I64 result,official;
|
||||
CDocEntry *tree_branch,*start_indent,*end_indent;
|
||||
|
||||
DocClear;
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
DistroPrep;
|
||||
|
||||
Cd(TS_MAIN_DRV ":/");
|
||||
if (ts_has_ram_drv) {
|
||||
DelTree(TS_RAM_DRV ":/TS");
|
||||
CopyTree(TS_MAIN_DRV ":/Accts/TS",TS_RAM_DRV ":/TS");
|
||||
DelTree(TS_MAIN_DRV ":/Accts/TS");
|
||||
}
|
||||
|
||||
DocMax;
|
||||
DocClear;
|
||||
result=LineRep;
|
||||
if (doc=DocPut) {
|
||||
st=StrNew(doc->filename.name);
|
||||
StrCpy(doc->filename.name,TS_RAM_DRV ":/TS/Wb2/LineRep.TXT.Z");
|
||||
DocWrite(doc);
|
||||
StrCpy(doc->filename.name,st);
|
||||
Free(st);
|
||||
}
|
||||
DocClear;
|
||||
official=LineRep(TS_MAIN_DRV ":/Accts/*")+
|
||||
LineRep(TS_MAIN_DRV ":/Adam/*")+
|
||||
LineRep(TS_MAIN_DRV ":/Compiler/*","-S+T")+
|
||||
LineRep(TS_MAIN_DRV ":/Kernel/*");
|
||||
DocClear;
|
||||
if (ts_has_ram_drv) {
|
||||
CopyTree(TS_RAM_DRV ":/TS",TS_MAIN_DRV ":/Accts/TS");
|
||||
DelTree(TS_RAM_DRV ":/TS");
|
||||
}
|
||||
|
||||
doc=DocRead(TS_MAIN_DRV ":/Adam/DocDefines.CPP.Z");
|
||||
DocTreeFind(doc,"LineRep",&tree_branch,&start_indent,&end_indent);
|
||||
DocCut(doc,start_indent->next,end_indent->last);
|
||||
doc->cur_entry=start_indent->next;
|
||||
doc->cur_data_col=0;
|
||||
|
||||
DocPrint(doc,"DefinePrint(\"DD_TEMPLEOS_LOC\",\"%,d\");\n",result);
|
||||
DocPrint(doc,"DefinePrint(\"DD_TEMPLEOS_LOC_OFFICIAL\",\"%,d\");\n",official);
|
||||
st=MStrPrint("%,d",result);
|
||||
DefineLoad("DD_TEMPLEOS_LOC",st);
|
||||
Free(st);
|
||||
st=MStrPrint("%,d",official);
|
||||
DefineLoad("DD_TEMPLEOS_LOC_OFFICIAL",st);
|
||||
Free(st);
|
||||
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
|
||||
"Total LOC:%12,d\n\n",result;
|
||||
return result;
|
||||
}
|
||||
|
||||
U0 TSDistroPrep()
|
||||
{/*This is the Trivial Solution internal company distro. Only run this on a
|
||||
virtual machine, not bare metal hardware because it's settings could cause
|
||||
problems. The hard drive must be partitioned. Install Std Distro, then
|
||||
install this on top.
|
||||
>$LK,"TSInstall",A="FF:::/Demo/AcctExample/TSDistro.CPP,TSInstall"$;
|
||||
>$LK,"TSUpgrade",A="FF:::/Demo/AcctExample/TSDistro.CPP,TSUpgrade"$;
|
||||
See $LK,"MakeDistrosAndBackUp",A="FF:::/Demo/AcctExample/TSDistro.CPP,MakeDistrosAndBackUp"$() to reproduce the ISO's in $FG,4$E:/Wb$FG$. It makes this
|
||||
website, too.
|
||||
*/
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
DistroPrep;
|
||||
Auto(TS_CDROM_CFG);
|
||||
MakeOSPrtBootInstall(TS_MAIN_DRV_LET,TS_CDROM_DRV_LET);
|
||||
DelTree(TS_DISTRO_DIR);
|
||||
CopyTree(TS_MAIN_DRV ":/",TS_DISTRO_DIR "/");
|
||||
}
|
||||
U0 MakeTSDistro()
|
||||
{
|
||||
TSDistroPrep;
|
||||
CDFileCreate(TS_ISO_NAME,TS_DISTRO_DIR "/*",,TS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSTS_SIZE",
|
||||
"Download $TX,"TempleOS V2.10",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
}
|
||||
|
||||
|
||||
U0 DbgDistroPrep()
|
||||
{/*This is a debug distro. The CDROM bootloader uses BIOS INT 0x13 0x42 to
|
||||
load Kernel.BIN.C which has been modified to also hold a small RAM drive
|
||||
(Drive A) that fits in the low 640k. The bootloader starts in real mode
|
||||
and the kernel changes to long, 64-bit mode. It loads the 64-bit compiler
|
||||
and assembler, compiles some, but not all, of the normal start-up scripts
|
||||
and drops you off at the $LK,"Dbg",A="MN:Dbg"$ command-line where you can JIT compile,
|
||||
use $LK,"EdLite",A="MN:EdLite"$ on RAM files, and use many of the other normal Kernel commands.
|
||||
I could not fit all the normal start-up scripts into the small RAM drive,
|
||||
so you do not have the window manager or normal document framework. You
|
||||
should have many Gig of RAM to play with with RAM Drive B, a high memory
|
||||
RAM drive, but you have only those few files. When I generate this distro,
|
||||
I call $LK,"MakeBootDrvFile",A="FF:::/Demo/AcctExample/TSDistro.CPP,MakeBootRescueDrvFile"$.
|
||||
*/
|
||||
if (ts_has_boot_rescue_drv) {
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
DistroPrep;
|
||||
MakeBootRescueDrvFile;
|
||||
Auto(TS_CDROM_DBG_CFG);
|
||||
MakeOSPrtBootInstall(TS_MAIN_DRV_LET,TS_CDROM_DRV_LET);
|
||||
DelTree(TS_DISTRO_DIR);
|
||||
CopyTree(TS_MAIN_DRV ":/",TS_DISTRO_DIR "/");
|
||||
Del(TS_MAIN_DRV ":" CFG_BOOT_RESCUE_DRV_FILE);
|
||||
}
|
||||
}
|
||||
U0 MakeDbgDistro()
|
||||
{
|
||||
DbgDistroPrep;
|
||||
CDFileCreate(TS_ISO_NAME,TS_DISTRO_DIR "/*",,TS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSDBG_SIZE",
|
||||
"Download $TX,"TempleOS V2.10",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
}
|
||||
|
||||
|
||||
U0 StdDistroPrep()
|
||||
{
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
DistroPrep;
|
||||
Auto(STD_DISTRO_CDROM_CFG);
|
||||
MakeOSPrtBootInstall(TS_MAIN_DRV_LET,TS_CDROM_DRV_LET);
|
||||
DelTree(TS_DISTRO_DIR);
|
||||
CopyTree(TS_MAIN_DRV ":/",TS_DISTRO_DIR "/");
|
||||
DelTree(TS_DISTRO_DIR "/Accts/TS");
|
||||
Del(TS_DISTRO_DIR "/0000Boot/OldMBR.BIN.C");
|
||||
Del(TS_DISTRO_DIR "/0000Boot/BootMHD2.BIN.C");
|
||||
}
|
||||
U0 MakeStdDistro()
|
||||
{
|
||||
StdDistroPrep;
|
||||
CDFileCreate(TS_ISO_NAME,TS_DISTRO_DIR "/*",,TS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
}
|
||||
|
||||
|
||||
U0 LiteDistroPrep()
|
||||
{/*Missing: Dictionary, Bible and TSZ Utility. Still 100% OpenSource.
|
||||
Includes: x86_64 64BitMultiCoredKernel, 64BitCompiler, Assembler,
|
||||
Unassembler, Debugger, Editor, VGAGraphics, Tools, BootLoaders,
|
||||
Keyboard&Mouse, HardDrives, FAT32, Partitioner, CD/DVD, ISO9660FileCreator,
|
||||
FileManager, WindowManager, PCSpeaker, Apps, Games, God-Oracle-App, Hymns,
|
||||
Demos, Documentation.
|
||||
*/
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
DistroPrep;
|
||||
Auto(STD_DISTRO_CDROM_CFG);
|
||||
MakeOSPrtBootInstall(TS_MAIN_DRV_LET,TS_CDROM_DRV_LET);
|
||||
DelTree(TS_DISTRO_DIR);
|
||||
CopyTree(TS_MAIN_DRV ":/",TS_DISTRO_DIR "/");
|
||||
DelTree(TS_DISTRO_DIR "/Accts/TS");
|
||||
DelTree(TS_DISTRO_DIR "/Linux");
|
||||
DelTree(TS_DISTRO_DIR "/Windows");
|
||||
Del(TS_DISTRO_DIR "/0000Boot/OldMBR.BIN.C");
|
||||
Del(TS_DISTRO_DIR "/0000Boot/BootMHD2.BIN.C");
|
||||
Del(TS_DISTRO_DIR "/Adam/WordStat/WSDefs.DAT*");
|
||||
Del(TS_DISTRO_DIR "/Misc/PCIDevices.TXT.Z");
|
||||
Del(TS_DISTRO_DIR "/Misc/Bible.TXT.Z");
|
||||
}
|
||||
U0 MakeLiteDistro()
|
||||
{
|
||||
LiteDistroPrep;
|
||||
CDFileCreate(TS_ISO_NAME,TS_DISTRO_DIR "/*",,TS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSLITE_SIZE",
|
||||
"Download $TX,"TempleOS V2.10",D="DD_OS_NAME_VERSION"$ - Lite Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
}
|
||||
|
||||
U0 UltraDistroPrep()
|
||||
{/*Missing: Apps, Demos, Dictionary, Bible and TSZ Utility. Still 100% OpenSource.
|
||||
Includes: x86_64 64BitMultiCoredKernel, 64BitCompiler, Assembler,
|
||||
Unassembler, Debugger, Editor, VGAGraphics, Tools, BootLoaders,
|
||||
Keyboard&Mouse, HardDrives, FAT32, Partitioner, CD/DVD, ISO9660FileCreator,
|
||||
FileManager, WindowManager, PCSpeaker, Documentation.
|
||||
*/
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
DistroPrep;
|
||||
Auto(STD_DISTRO_CDROM_CFG);
|
||||
MakeOSPrtBootInstall(TS_MAIN_DRV_LET,TS_CDROM_DRV_LET);
|
||||
DelTree(TS_DISTRO_DIR);
|
||||
CopyTree(TS_MAIN_DRV ":/",TS_DISTRO_DIR "/");
|
||||
DelTree(TS_DISTRO_DIR "/Accts/TS");
|
||||
DelTree(TS_DISTRO_DIR "/Linux");
|
||||
DelTree(TS_DISTRO_DIR "/Windows");
|
||||
DelTree(TS_DISTRO_DIR "/Apps");
|
||||
DelTree(TS_DISTRO_DIR "/Demo");
|
||||
Del(TS_DISTRO_DIR "/0000Boot/OldMBR.BIN.C");
|
||||
Del(TS_DISTRO_DIR "/0000Boot/BootMHD2.BIN.C");
|
||||
Del(TS_DISTRO_DIR "/Adam/WordStat/*.DAT*");
|
||||
DelTree(TS_DISTRO_DIR "/Misc/Tour");
|
||||
Del(TS_DISTRO_DIR "/Misc/PCIDevices.TXT.Z");
|
||||
Del(TS_DISTRO_DIR "/Misc/Bible.TXT.Z");
|
||||
Del(TS_DISTRO_DIR "/Adam/God/Vocab.TXT.Z");
|
||||
}
|
||||
U0 MakeUltraDistro()
|
||||
{
|
||||
UltraDistroPrep;
|
||||
CDFileCreate(TS_ISO_NAME,TS_DISTRO_DIR "/*",,TS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSULTRA_SIZE",
|
||||
"Download $TX,"TempleOS V2.10",D="DD_OS_NAME_VERSION"$ - UltraLite Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
}
|
||||
|
||||
U0 TSWebFile(U8 *name)
|
||||
{
|
||||
U8 *name2;
|
||||
CDirEntry de;
|
||||
if (FileFind(name,&de)) {
|
||||
Free(de.full_name);
|
||||
"File:%s\n",name;
|
||||
UncollapseFile(name,NULL);
|
||||
Touch(name,"",,de.datetime);
|
||||
name2=ChgExt(name,"html");
|
||||
ToHtml(name,name2,
|
||||
"<title>The Temple Operating System</title>\n"
|
||||
"<meta name=\"keywords\" content=\"Operating System,64-Bit,64 Bit,Temple,OS,TempleOS,Free,Open Source,Public Domain,x86_64\">\n"
|
||||
);
|
||||
Touch(name2,"",,de.datetime);
|
||||
Free(name2);
|
||||
}
|
||||
}
|
||||
|
||||
U0 MakeWebSite()
|
||||
{
|
||||
CDirEntry *tempde,*tempde1;
|
||||
if (ts_has_bak_drv) {
|
||||
DocClear;
|
||||
Cd(TS_BAK_DRV ":/Wb");
|
||||
DelTree(TS_BAK_DRV ":/Wb/Accts/TS/TAD");
|
||||
Del(TS_BAK_DRV ":/Wb/Accts/TS/*");
|
||||
Touch(TS_BAK_DRV ":/Wb/Accts/TS/Wb2/index.TXT.Z","",,Now);
|
||||
Touch(TS_BAK_DRV ":/Wb/Accts/TS/Wb2/Downloads.TXT.Z","",,Now);
|
||||
Touch(TS_BAK_DRV ":/Wb/Accts/TS/Wb2/TempleOS.TXT.Z","",,Now);
|
||||
tempde=tempde1=FilesFind("*",FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER);
|
||||
while (tempde) {
|
||||
TSWebFile(tempde->full_name);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
}
|
||||
}
|
||||
|
||||
U0 FreshenWebDir(U8 *dirname)
|
||||
{
|
||||
CDirEntry *tempde,*tempde1;
|
||||
U8 *src,*dst;
|
||||
|
||||
src=MStrPrint(TS_BAK_DRV ":/Wb%s/*",dirname);
|
||||
Del(src);
|
||||
Free(src);
|
||||
src=MStrPrint(TS_MAIN_DRV ":%s/*",dirname);
|
||||
dst=MStrPrint(TS_BAK_DRV ":/Wb%s",dirname);
|
||||
Copy(src,dst);
|
||||
Free(src);
|
||||
Free(dst);
|
||||
|
||||
src=MStrPrint(TS_BAK_DRV ":/Uncompressed%s/*",dirname);
|
||||
Del(src);
|
||||
Free(src);
|
||||
src=MStrPrint(TS_MAIN_DRV ":%s/*",dirname);
|
||||
dst=MStrPrint(TS_BAK_DRV ":/Uncompressed%s",dirname);
|
||||
Copy(src,dst);
|
||||
Free(src);
|
||||
Free(dst);
|
||||
|
||||
src=MStrPrint(TS_BAK_DRV ":/Wb%s/*",dirname);
|
||||
tempde=tempde1=FilesFind(src,FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER);
|
||||
while (tempde) {
|
||||
TSWebFile(tempde->full_name);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
U0 MakeWebSitePartial()
|
||||
{
|
||||
if (ts_has_bak_drv) {
|
||||
FreshenWebDir("/Accts/TS/Wb2");
|
||||
FreshenWebDir("/Accts/TS/Wb2/Rants/TAD");
|
||||
FreshenWebDir(TS_BLOG_DIR);
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
}
|
||||
}
|
||||
|
||||
I64 TSUncompress()
|
||||
{
|
||||
I64 result=0;
|
||||
if (ts_has_bak_drv) {
|
||||
DelTree(TS_BAK_DRV ":/Uncompressed");
|
||||
CopyTree(TS_MAIN_DRV ":/",TS_BAK_DRV ":/Uncompressed");
|
||||
result=Unzip(TS_BAK_DRV ":/Uncompressed/*.Z");
|
||||
CursorRem(TS_BAK_DRV ":/Uncompressed/*");
|
||||
}
|
||||
"Files Copied:%d\n",result;
|
||||
return result;
|
||||
}
|
||||
|
||||
U0 UpdateISODocDefines()
|
||||
{
|
||||
DefinePrint("DD_TEMPLEOSCD_SIZE",
|
||||
"Download $TX,"TempleOS V2.10",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TS_BAK_DRV ":/Wb/TempleOSCD.ISO","+s")/1024/1024));
|
||||
}
|
||||
|
||||
UpdateISODocDefines;
|
||||
|
||||
public U0 MakeDistrosAndBackUp()
|
||||
{
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
progress4=*progress4_desc=0;
|
||||
progress4_max=12;
|
||||
WordStat;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
ChkAll; progress4++;
|
||||
if (ts_has_bak_drv) {
|
||||
MakeLineRepFile; progress4++;
|
||||
TSCopyDrv(TS_MAIN_DRV_LET,TS_BAK_DRV_LET); progress4++;
|
||||
DelTree (TS_BAK_DRV ":/Wb"); progress4++;
|
||||
CopyTree(TS_MAIN_DRV ":/",TS_BAK_DRV ":/Wb"); progress4++;
|
||||
DocClear;
|
||||
|
||||
MakeStdDistro; progress4++;
|
||||
DocClear;
|
||||
Copy(TS_ISO_NAME,TS_BAK_DRV ":/Wb/TempleOSCD.ISO"); progress4++;
|
||||
|
||||
UpdateISODocDefines;
|
||||
|
||||
Cd(TS_MAIN_DRV ":/");
|
||||
if (LinkChk)
|
||||
throw;
|
||||
progress4++;
|
||||
MakeSymFiles; progress4++;
|
||||
MakeWebSite; progress4++;
|
||||
TSUncompress; progress4++;
|
||||
}
|
||||
Drv(TS_MAIN_DRV_LET);
|
||||
ChkAll; progress4++;
|
||||
progress4=progress4_max=0;
|
||||
SettingsPop;
|
||||
}
|
||||
|
||||
public U0 TSMount()
|
||||
{
|
||||
if (!dsk.auto_mount_ide_cnt) {
|
||||
Auto(CFG_HARD_DRVS "\n");
|
||||
Mount;
|
||||
}
|
||||
}
|
||||
|
||||
U0 TSCopy()
|
||||
{
|
||||
if (ts_cid==CID_DFT) {//Dangerous! don't do on my main machine
|
||||
Fmt(TS_MAIN_DRV_LET,,FALSE);
|
||||
CopyTree(TS_CDROM_DRV ":/",TS_MAIN_DRV ":/");
|
||||
TSMakeOSPrtBootInstall(TS_MAIN_DRV_LET);
|
||||
Fmt(TS_BAK_DRV_LET,,FALSE);
|
||||
CopyTree(TS_CDROM_DRV ":/",TS_BAK_DRV ":/");
|
||||
TSMakeOSPrtBootInstall(TS_BAK_DRV_LET);
|
||||
Reboot;
|
||||
}
|
||||
}
|
||||
|
||||
U0 TSPrtDsk()
|
||||
{
|
||||
CTask *task=SpawnUser;
|
||||
CATARep *root=NULL,*ata_drv=NULL,*atapi_drv=NULL;
|
||||
if (ts_cid==CID_DFT) {//Dangerous! don't do on my main machine
|
||||
ATARep(FALSE,TRUE,&root);
|
||||
ATAIDDrvs(root,*sys_acct,&ata_drv,&atapi_drv);
|
||||
if (ata_drv) {
|
||||
XTalkWait(task,"PrtDsk;\nY%C2p%d\nYYY",TS_MAIN_DRV_LET,ata_drv->num);
|
||||
XTalkWait(task,"%d\nY\nY\n",(prt_dsk_dsk_size-PRT_HEADER)/2);
|
||||
}
|
||||
Kill(task);
|
||||
}
|
||||
}
|
||||
|
||||
public U0 TSUpgrade()
|
||||
{
|
||||
if (ts_cid==CID_DFT) {//Dangerous! don't do on my main machine
|
||||
TSMount;
|
||||
TSCopy;
|
||||
}
|
||||
}
|
||||
|
||||
public U0 TSInstall()
|
||||
{
|
||||
if (ts_cid==CID_DFT) {//Dangerous! don't do on my main machine
|
||||
TSPrtDsk;
|
||||
TSCopy;
|
||||
}
|
||||
}
|
||||
@@ -1,276 +0,0 @@
|
||||
class CSHEntry
|
||||
{
|
||||
CDocEntry *next,*last;
|
||||
};
|
||||
|
||||
class CSHSection
|
||||
{
|
||||
CDocEntry *next,*last;
|
||||
};
|
||||
|
||||
U8 *SHSkipDataType(U8 *st)
|
||||
{
|
||||
if (!st)
|
||||
return NULL;
|
||||
while (Bt(chars_bitmap_white_space,*st))
|
||||
st++;
|
||||
if (*st=='#')
|
||||
return st;
|
||||
while (Bt(chars_bitmap_alpha_numeric,*st))
|
||||
st++;
|
||||
while (Bt(chars_bitmap_white_space,*st))
|
||||
st++;
|
||||
while (*st=='*')
|
||||
st++;
|
||||
return st;
|
||||
}
|
||||
|
||||
U8 *SHSkipLabel(U8 *st)
|
||||
{
|
||||
if (!st)
|
||||
return NULL;
|
||||
while (Bt(chars_bitmap_white_space,*st))
|
||||
st++;
|
||||
while (Bt(chars_bitmap_alpha_numeric,*st))
|
||||
st++;
|
||||
while (Bt(chars_bitmap_white_space,*st))
|
||||
st++;
|
||||
return st;
|
||||
}
|
||||
|
||||
U8 *SHNewEntry(CDocEntry *doc_e,I64 *_type=NULL)
|
||||
{
|
||||
U8 *st;
|
||||
if (doc_e->type_u8==DOCT_TEXT && (st=doc_e->tag)) {
|
||||
if (!StrNCmp("#help_index",st,11)) {
|
||||
if (_type) *_type=0;
|
||||
return st+11;
|
||||
} else if (!StrNCmp("#help_file",st,10)) {
|
||||
if (_type) *_type=1;
|
||||
return st+10;//'#' makes it first alphabetically.
|
||||
} else if (!StrNCmp("import",st,6)) {
|
||||
if (_type) *_type=2;
|
||||
return st+6;
|
||||
} else if (!StrNCmp("public import",st,13)) {
|
||||
if (_type) *_type=2;
|
||||
return st+13;
|
||||
} else if (!StrNCmp("_import",st,7)) {
|
||||
if (_type) *_type=2;
|
||||
return SHSkipLabel(st+7);
|
||||
} else if (!StrNCmp("public _import",st,14)) {
|
||||
if (_type) *_type=2;
|
||||
return SHSkipLabel(st+14);
|
||||
} else if (!StrNCmp("_intern",st,7)) {
|
||||
if (_type) *_type=3;
|
||||
return SHSkipLabel(st+7);
|
||||
} else if (!StrNCmp("public _intern",st,14)) {
|
||||
if (_type) *_type=3;
|
||||
return SHSkipLabel(st+14);
|
||||
} else if (!StrNCmp("extern",st,6)) {
|
||||
if (_type) *_type=4;
|
||||
return st+6;
|
||||
} else if (!StrNCmp("public extern",st,13)) {
|
||||
if (_type) *_type=4;
|
||||
return st+13;
|
||||
} else if (!StrNCmp("_extern",st,7)) {
|
||||
if (_type) *_type=4;
|
||||
return SHSkipLabel(st+7);
|
||||
} else if (!StrNCmp("public _extern",st,14)) {
|
||||
if (_type) *_type=4;
|
||||
return SHSkipLabel(st+14);
|
||||
}
|
||||
}
|
||||
if (_type) *_type=-1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
I64 SHCompareEntry(CSHEntry *e1,CSHEntry *e2)
|
||||
{
|
||||
U8 *st1,*st2;
|
||||
I64 t1,t2;
|
||||
if (e1 && e2 && e1->next!=e1 && e2->next!=e2) {
|
||||
if (e1->next->type_u8==DOCT_TEXT && e2->next->type_u8==DOCT_TEXT) {
|
||||
st1=SHNewEntry(e1->next,&t1);
|
||||
st2=SHNewEntry(e2->next,&t2);
|
||||
if (t1!=t2)
|
||||
return t1-t2;
|
||||
else {
|
||||
if (st1&&st2) {
|
||||
st1=SHSkipDataType(st1);
|
||||
st2=SHSkipDataType(st2);
|
||||
if (st1&&st2)
|
||||
return StrCmp(st1,st2);
|
||||
else
|
||||
return Sign(st1-st2);
|
||||
} else
|
||||
return Sign(st1-st2);
|
||||
}
|
||||
} else
|
||||
return Sign(e1->next-e2->next);
|
||||
} else
|
||||
return Sign(e1-e2);
|
||||
}
|
||||
|
||||
U0 SHSortSection(CSHSection *temps)
|
||||
{
|
||||
I64 i=0,cnt;
|
||||
CSHEntry **a;
|
||||
CDocEntry *doc_e,*doc_e1;
|
||||
|
||||
cnt=0;
|
||||
doc_e=temps->next;
|
||||
while (doc_e!=temps) {
|
||||
if (SHNewEntry(doc_e))
|
||||
cnt++;
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
cnt++;
|
||||
|
||||
a=MAlloc(sizeof(CSHEntry *)*cnt);
|
||||
for (i=0;i<cnt;i++) {
|
||||
a[i]=MAlloc(sizeof(CSHEntry));
|
||||
QueInit(a[i]);
|
||||
}
|
||||
|
||||
i=0;
|
||||
doc_e=temps->next;
|
||||
while (doc_e!=temps) {
|
||||
doc_e1=doc_e->next;
|
||||
QueRem(doc_e);
|
||||
if (SHNewEntry(doc_e))
|
||||
i++;
|
||||
QueIns(doc_e,a[i]->last);
|
||||
doc_e=doc_e1;
|
||||
}
|
||||
|
||||
QSortI64(a,cnt,&SHCompareEntry);
|
||||
|
||||
for (i=0;i<cnt;i++) {
|
||||
doc_e=a[i]->next;
|
||||
while (doc_e!=a[i]) {
|
||||
doc_e1=doc_e->next;
|
||||
QueRem(doc_e);
|
||||
QueIns(doc_e,temps->last);
|
||||
doc_e=doc_e1;
|
||||
}
|
||||
Free(a[i]);
|
||||
}
|
||||
Free(a);
|
||||
}
|
||||
|
||||
U8 *SHNewSection(CDocEntry *doc_e)
|
||||
{
|
||||
U8 *st;
|
||||
if (doc_e->type_u8==DOCT_TEXT && (st=doc_e->tag)) {
|
||||
if (!StrNCmp(st,"#help_index",11))
|
||||
return st+11;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
I64 SHCompareSection(CSHSection *e1,CSHSection *e2)
|
||||
{
|
||||
I64 i1,i2;
|
||||
U8 *st1,*st2;
|
||||
if (e1 && e2 && e1->next!=e1 && e2->next!=e2) {
|
||||
if (e1->next->type_u8==DOCT_TEXT && e2->next->type_u8==DOCT_TEXT) {
|
||||
st1=SHNewSection(e1->next);
|
||||
st2=SHNewSection(e2->next);
|
||||
if (st1&&st2) {
|
||||
if (StrMatch("\"\"",st1))
|
||||
i1=1;
|
||||
else
|
||||
i1=0;
|
||||
if (StrMatch("\"\"",st2))
|
||||
i2=1;
|
||||
else
|
||||
i2=0;
|
||||
if (i1!=i2)
|
||||
return i1-i2;
|
||||
else
|
||||
return StrCmp(st1,st2);
|
||||
} else
|
||||
return Sign(st1-st2);
|
||||
} else
|
||||
return Sign(e1->next-e2->next);
|
||||
} else
|
||||
return Sign(e1-e2);
|
||||
}
|
||||
|
||||
public U0 TSSortHeader(U8 *name)
|
||||
{
|
||||
CDoc *doc;
|
||||
I64 i=0,cnt;
|
||||
CSHSection **a;
|
||||
CDocEntry *doc_e,*doc_e1;
|
||||
|
||||
if (!name || !*name || !FileFind(name))
|
||||
return;
|
||||
|
||||
doc=DocRead(name,DOCF_PLAIN_TEXT_WITH_TABS|DOCF_NO_CURSOR);
|
||||
|
||||
cnt=1;
|
||||
doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
if (SHNewSection(doc_e))
|
||||
cnt++;
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
|
||||
a=MAlloc(sizeof(CSHSection *)*cnt);
|
||||
for (i=0;i<cnt;i++) {
|
||||
a[i]=MAlloc(sizeof(CSHSection));
|
||||
QueInit(a[i]);
|
||||
}
|
||||
|
||||
i=0;
|
||||
doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
doc_e1=doc_e->next;
|
||||
if (doc_e->type_u8==DOCT_TEXT && doc_e->tag && *doc_e->tag) {
|
||||
QueRem(doc_e);
|
||||
if (SHNewSection(doc_e))
|
||||
i++;
|
||||
QueIns(doc_e,a[i]->last);
|
||||
} else
|
||||
DocEntryDel(doc,doc_e);
|
||||
doc_e=doc_e1;
|
||||
}
|
||||
|
||||
QSortI64(a,cnt,&SHCompareSection);
|
||||
|
||||
for (i=0;i<cnt;i++) {
|
||||
if (a[i]->next!=a[i]) {
|
||||
SHSortSection(a[i]);
|
||||
doc_e=a[i]->next;
|
||||
while (doc_e!=a[i]) {
|
||||
doc_e1=doc_e->next;
|
||||
QueRem(doc_e);
|
||||
QueIns(doc_e,doc->root.last);
|
||||
if (doc_e->type_u8==DOCT_TEXT && doc_e->tag) {
|
||||
doc->cur_entry=doc_e;
|
||||
doc->cur_data_col=StrLen(doc_e->tag);
|
||||
DocPrint(doc,"\n");
|
||||
}
|
||||
doc_e=doc_e1;
|
||||
}
|
||||
if (i+1<cnt && a[i+1]->next!=a[i+1])
|
||||
DocPrint(doc,"\n");
|
||||
}
|
||||
Free(a[i]);
|
||||
}
|
||||
Free(a);
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
}
|
||||
|
||||
public U0 TSSortHeaders()
|
||||
{
|
||||
TSSortHeader("/Kernel/Adam1b.HPP.Z");
|
||||
TSSortHeader("/Kernel/Adam1c.HPP.Z");
|
||||
TSSortHeader("/Kernel/KExts.CPP.Z");
|
||||
TSSortHeader("/Compiler/CmpExts.CPP.Z");
|
||||
TSSortHeader("/Compiler/Cmp.HPP.Z");
|
||||
TSSortHeader("/Adam/AdamExts.HPP.Z");
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ _BEEPS::
|
||||
//You can always clobber RAX,RBX,RCX,RDX,R8,R9. The compiler expects that.
|
||||
PUSH RBP
|
||||
MOV RBP,RSP
|
||||
MOV RCX,U64 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/Adam1a.HPP,SF_ARG1"$
|
||||
MOV RCX,U64 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/KernelA.HPP,SF_ARG1"$
|
||||
|
||||
@@05: PUSH RCX
|
||||
//U0 $LK,"Beep",A="MN:Beep"$(I64 freq=500,Bool busy=FALSE)
|
||||
|
||||
@@ -17,13 +17,13 @@ USE64 //Defaults to 64, but this is a good habit.
|
||||
|
||||
JIFFIES_MSG: DU8 "Jiffies:",0;
|
||||
|
||||
//See $LK,"::/Kernel/Str1a.CPP",A="FL:::/Kernel/Str1a.CPP,1"$ and $LK,"::/Kernel/Utils1a.CPP"$.
|
||||
//See $LK,"::/Kernel/StrA.CPP",A="FL:::/Kernel/StrA.CPP,1"$ and $LK,"::/Kernel/KUtils.CPP"$.
|
||||
|
||||
_BEEPS2::
|
||||
//You can clobber RAX,RBX,RCX,RDX,R8,R9. The compiler expects that.
|
||||
PUSH RBP
|
||||
MOV RBP,RSP
|
||||
MOV RCX,U64 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/Adam1a.HPP,SF_ARG1"$
|
||||
MOV RCX,U64 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/KernelA.HPP,SF_ARG1"$
|
||||
|
||||
PUSH U64 [&cnts.jiffies]
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ error, like when repeatedly #including
|
||||
it from the cmd line.
|
||||
|
||||
These are many useful kernel
|
||||
routines $LK,"::/Kernel/Str1a.CPP",A="FF:::/Kernel/Str1a.CPP,PUT_CHARS"$
|
||||
routines $LK,"::/Kernel/StrA.CPP",A="FF:::/Kernel/StrA.CPP,PUT_CHARS"$
|
||||
intended to be called from
|
||||
asm. Generally, they preserve
|
||||
regs.
|
||||
|
||||
+16
-18
@@ -51,29 +51,27 @@ Call(_BUZZ_FIZZ);
|
||||
_BUZZ_FIZZ+0x0001 488BEC MOV U64 RBP,U64 RSP
|
||||
_BUZZ_FIZZ+0x0004 56 PUSH U64 RSI
|
||||
_BUZZ_FIZZ+0x0005 57 PUSH U64 RDI
|
||||
_BUZZ_FIZZ+0x0006 BE06000000 MOV U64 RSI,U32 00000006
|
||||
_BUZZ_FIZZ+0x000B BF07000000 MOV U64 RDI,U32 00000007
|
||||
_BUZZ_FIZZ+0x0010 B801000000 MOV U64 RAX,U32 00000001
|
||||
_BUZZ_FIZZ+0x0015 E88F7D2480 CALL I32 PUT_HEX_U64+0x0000
|
||||
_BUZZ_FIZZ+0x0006 BE06000000 MOV U32 ESI,U32 00000006
|
||||
_BUZZ_FIZZ+0x000B BF07000000 MOV U32 EDI,U32 00000007
|
||||
_BUZZ_FIZZ+0x0010 B801000000 MOV U32 EAX,U32 00000001
|
||||
_BUZZ_FIZZ+0x0015 E8C51F2BC0 CALL I32 PUT_HEX_U64+0x0000
|
||||
_BUZZ_FIZZ+0x001A 50 PUSH U64 RAX
|
||||
_BUZZ_FIZZ+0x001B B820000000 MOV U64 RAX,U32 00000020
|
||||
_BUZZ_FIZZ+0x0020 E8E87D2480 CALL I32 PUT_CHARS+0x0000
|
||||
_BUZZ_FIZZ+0x001B B820000000 MOV U32 EAX,U32 00000020
|
||||
_BUZZ_FIZZ+0x0020 E81E202BC0 CALL I32 PUT_CHARS+0x0000
|
||||
_BUZZ_FIZZ+0x0025 48FFCE DEC U64 RSI
|
||||
_BUZZ_FIZZ+0x0028 7514 JNZ I8 _BUZZ_FIZZ+0x003E
|
||||
_BUZZ_FIZZ+0x002A 48B846495A5A MOV U64 RAX,U32 5A5A4946
|
||||
_BUZZ_FIZZ+0x0030 2000 AND U8 [RAX],U8 AL
|
||||
_BUZZ_FIZZ+0x0032 0000 ADD U8 [RAX],U8 AL
|
||||
_BUZZ_FIZZ+0x0034 E8D47D2480 CALL I32 PUT_CHARS+0x0000
|
||||
_BUZZ_FIZZ+0x0039 BE06000000 MOV U64 RSI,U32 00000006
|
||||
_BUZZ_FIZZ+0x002A 48B846495A5A MOV U64 RAX,I64 000000205A5A4946
|
||||
_BUZZ_FIZZ+0x0030 20000000
|
||||
_BUZZ_FIZZ+0x0034 E80A202BC0 CALL I32 PUT_CHARS+0x0000
|
||||
_BUZZ_FIZZ+0x0039 BE06000000 MOV U32 ESI,U32 00000006
|
||||
_BUZZ_FIZZ+0x003E 48FFCF DEC U64 RDI
|
||||
_BUZZ_FIZZ+0x0041 7514 JNZ I8 _BUZZ_FIZZ+0x0057
|
||||
_BUZZ_FIZZ+0x0043 48B842555A5A MOV U64 RAX,U32 5A5A5542
|
||||
_BUZZ_FIZZ+0x0049 2000 AND U8 [RAX],U8 AL
|
||||
_BUZZ_FIZZ+0x004B 0000 ADD U8 [RAX],U8 AL
|
||||
_BUZZ_FIZZ+0x004D E8BB7D2480 CALL I32 PUT_CHARS+0x0000
|
||||
_BUZZ_FIZZ+0x0052 BF07000000 MOV U64 RDI,U32 00000007
|
||||
_BUZZ_FIZZ+0x0057 B80A000000 MOV U64 RAX,U32 0000000A
|
||||
_BUZZ_FIZZ+0x005C E8AC7D2480 CALL I32 PUT_CHARS+0x0000
|
||||
_BUZZ_FIZZ+0x0043 48B842555A5A MOV U64 RAX,I64 000000205A5A5542
|
||||
_BUZZ_FIZZ+0x0049 20000000
|
||||
_BUZZ_FIZZ+0x004D E8F11F2BC0 CALL I32 PUT_CHARS+0x0000
|
||||
_BUZZ_FIZZ+0x0052 BF07000000 MOV U32 EDI,U32 00000007
|
||||
_BUZZ_FIZZ+0x0057 B80A000000 MOV U32 EAX,U32 0000000A
|
||||
_BUZZ_FIZZ+0x005C E8E21F2BC0 CALL I32 PUT_CHARS+0x0000
|
||||
_BUZZ_FIZZ+0x0061 58 POP U64 RAX
|
||||
_BUZZ_FIZZ+0x0062 48FFC0 INC U64 RAX
|
||||
_BUZZ_FIZZ+0x0065 4883F864 CMP U64 RAX,I8 64
|
||||
|
||||
@@ -26,7 +26,7 @@ MUL_BY_HAND_U8_U8_TO_U16: //This is only for fun.
|
||||
_MUL_BY_HAND_U8_U8_TO_U16:: //C callable
|
||||
PUSH RBP
|
||||
MOV RBP,RSP
|
||||
MOV AL,U8 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/Adam1a.HPP,SF_ARG1"$
|
||||
MOV AL,U8 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/KernelA.HPP,SF_ARG1"$
|
||||
MOV BL,U8 SF_ARG2[RBP]
|
||||
CALL MUL_BY_HAND_U8_U8_TO_U16
|
||||
MOVZX RAX,AX
|
||||
@@ -38,7 +38,7 @@ _MUL_U64_U64_TO_U128::
|
||||
PUSH RBP
|
||||
MOV RBP,RSP
|
||||
MOV RBX,U64 SF_ARG3[RBP]
|
||||
MOV RAX,U64 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/Adam1a.HPP,SF_ARG1"$
|
||||
MOV RAX,U64 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/KernelA.HPP,SF_ARG1"$
|
||||
MUL U64 SF_ARG2[RBP] //Result RDX:RAX 128bit
|
||||
MOV U64 [RBX],RAX
|
||||
MOV U64 8[RBX],RDX
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ PUT_DEC_U64::
|
||||
MOV RBP,RSP
|
||||
SUB RSP,24 //24 char buffer on stack
|
||||
|
||||
//$LK,"Save regs",A="FF:::/Kernel/Adam1a.HPP,PUSH_C_REGS"$ which C code is free to clobber. We don't have to for C callers,
|
||||
//$LK,"Save regs",A="FF:::/Kernel/KernelA.HPP,PUSH_C_REGS"$ which C code is free to clobber. We don't have to for C callers,
|
||||
//but this function will be nice for ASM callers if it saves all regs.
|
||||
PUSH_C_REGS
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define IC_CALL_END2 0x08
|
||||
#define IC_RETURN_VAL 0x09
|
||||
#define IC_RETURN_VAL2 0x0A
|
||||
#define IC_IMM_U64 0x0B
|
||||
#define IC_IMM_I64 0x0B
|
||||
#define IC_IMM_F64 0x0C
|
||||
#define IC_STR_CONST 0x0D
|
||||
#define IC_ABS_ADDR 0x0E
|
||||
|
||||
@@ -4,10 +4,10 @@ U0 AFSetIPDemo()
|
||||
WinBorder(ON);
|
||||
l=Fs->pix_left+Fs->scroll_x;
|
||||
t=Fs->pix_top+Fs->scroll_y;
|
||||
SetIP(,,,FALSE,FALSE); //Mouse unclicked
|
||||
IPSet(,,,FALSE,FALSE); //Mouse unclicked
|
||||
AFSetIP(,l-4,t-4);
|
||||
AFSetIP(20,l+20,t+20,,TRUE);
|
||||
SetIP(,,,FALSE,FALSE);
|
||||
IPSet(,,,FALSE,FALSE);
|
||||
}
|
||||
|
||||
AFSetIPDemo;
|
||||
@@ -0,0 +1,13 @@
|
||||
U0 Directives()
|
||||
{
|
||||
"Date :%s\n",__DATE__;
|
||||
"Time :%s\n",__TIME__;
|
||||
"File :%s\n",__FILE__;
|
||||
"Dir :%s\n",__DIR__;
|
||||
"Line :%d\n",__LINE__;
|
||||
"Depth:%d\n",__DEPTH__;
|
||||
"Instruction1:%P:%08X\n",$$,$$;
|
||||
"Instruction2:%P:%08X\n",$$,$$;
|
||||
}
|
||||
|
||||
Directives;
|
||||
@@ -7,7 +7,7 @@ documentation.
|
||||
|
||||
*/
|
||||
|
||||
DefineLoad("COMPANY","Trivial Solutions");
|
||||
DefineLoad("COMPANY","Acme Inc");
|
||||
"Company: $$TX,\"\",D=\"COMPANY\"$$\n";
|
||||
|
||||
DefinePrint("COMPANY_TIME","%T",Now);
|
||||
|
||||
@@ -57,7 +57,7 @@ Note: Not all $LK,"CDocEntry",A="MN:CDocEntry"$'s are full-sized nodes.
|
||||
Some are $LK,"MAlloc",A="MN:MAlloc"$ed with a smaller size to save
|
||||
mem. They all have at least the size $LK,"CDocEntryBase",A="MN:CDocEntryBase"$.
|
||||
|
||||
Note: $LK,"CDocEntry",A="MN:CDocEntry"$'s should be allocated from the
|
||||
Note: $LK,"CDocEntry",A="MN:CDocEntry"$'s should be alloced from the
|
||||
heap of the owning task, doc->mem_task.
|
||||
|
||||
The flag arrays $LK,"doldoc.type_flags_form",A="MN:CDolDocGlbls"$, etc
|
||||
|
||||
Binary file not shown.
@@ -5,16 +5,16 @@ it only occurs once in files.
|
||||
It's a brute force solution, but
|
||||
gets the job done... slowly.
|
||||
|
||||
$LK,"Grep",A="MN:Grep"$() returns a count of matches.
|
||||
$LK,"Find",A="MN:Find"$() returns a count of matches.
|
||||
|
||||
$LK,"FileOcc",A="MN:FileOcc"$() is $LK,"Grep",A="MN:Grep"$() with
|
||||
$LK,"FileOcc",A="MN:FileOcc"$() is $LK,"Find",A="MN:Find"$() with
|
||||
output $LK,"Silent",A="MN:Silent"$().
|
||||
*/
|
||||
|
||||
U0 UnusedDefineScan()
|
||||
{
|
||||
CDoc *old_put_doc,*old_display_doc,*doc;
|
||||
I64 cnt=0;
|
||||
I64 i,cnt=0;
|
||||
CHashTable *table;
|
||||
CHash *temph;
|
||||
CDocEntry *doc_e,*doc_e2;
|
||||
@@ -26,11 +26,13 @@ U0 UnusedDefineScan()
|
||||
try {
|
||||
table=Fs->hash_table;
|
||||
while (table) {
|
||||
temph=table->next_added;
|
||||
while (temph!=table) {
|
||||
if (temph->type&HTT_DEFINE_STR)
|
||||
cnt++;
|
||||
temph=temph->next_added;
|
||||
for (i=0;i<=table->mask;i++) {
|
||||
temph=table->body[i];
|
||||
while (temph) {
|
||||
if (temph->type&HTT_DEFINE_STR)
|
||||
cnt++;
|
||||
temph=temph->next;
|
||||
}
|
||||
}
|
||||
table=table->next;
|
||||
}
|
||||
@@ -41,32 +43,34 @@ U0 UnusedDefineScan()
|
||||
|
||||
table=Fs->hash_table;
|
||||
while (table) {
|
||||
temph=table->next_added;
|
||||
while (temph!=table) {
|
||||
if (temph->type&HTT_DEFINE_STR) {
|
||||
progress1++;
|
||||
if (FileOcc(temph->str,"/*","+l-i+T")==1) {
|
||||
doc=DocNew;
|
||||
old_put_doc=DocPut;
|
||||
old_display_doc=DocDisplay;
|
||||
Fs->put_doc=Fs->display_doc=doc;
|
||||
Grep(temph->str,"/*","+l-i+T");
|
||||
Fs->put_doc=old_put_doc;
|
||||
Fs->display_doc=old_display_doc;
|
||||
doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_LINK) {
|
||||
"%s ",temph->str;
|
||||
doc_e2=DocEntryCopy(doc,doc_e);
|
||||
DocInsEntry(old_put_doc,doc_e2);
|
||||
'\n';
|
||||
for (i=0;i<=table->mask;i++) {
|
||||
temph=table->body[i];
|
||||
while (temph) {
|
||||
if (temph->type&HTT_DEFINE_STR) {
|
||||
progress1++;
|
||||
if (FileOcc(temph->str,"/*","+l-i+T")==1) {
|
||||
doc=DocNew;
|
||||
old_put_doc=DocPut;
|
||||
old_display_doc=DocDisplay;
|
||||
Fs->put_doc=Fs->display_doc=doc;
|
||||
Find(temph->str,"/*","+l-i+T");
|
||||
Fs->put_doc=old_put_doc;
|
||||
Fs->display_doc=old_display_doc;
|
||||
doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_LINK) {
|
||||
"%s ",temph->str;
|
||||
doc_e2=DocEntryCopy(doc,doc_e);
|
||||
DocInsEntry(old_put_doc,doc_e2);
|
||||
'\n';
|
||||
}
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
doc_e=doc_e->next;
|
||||
DocDel(doc);
|
||||
}
|
||||
DocDel(doc);
|
||||
}
|
||||
temph=temph->next;
|
||||
}
|
||||
temph=temph->next_added;
|
||||
}
|
||||
table=table->next;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#define DB_FILENAME "HOME/DataBaseDemo.BIN"
|
||||
#define DB_FILENAME "::/Home/DataBaseDemo.BIN"
|
||||
#define DB_MAX_ACCT 100
|
||||
#define DB_ACCT_BLKS 1
|
||||
|
||||
|
||||
+14
-14
@@ -1,41 +1,41 @@
|
||||
U0 RawAccess(I64 drv_let=0)
|
||||
{
|
||||
CPrt *p=Drv2Prt(drv_let);
|
||||
CBlkDev *bdev=Drv2BlkDev(drv_let);
|
||||
CDrv *dv=Let2Drv(drv_let);
|
||||
CBlkDev *bd=Let2BlkDev(drv_let);
|
||||
I64 blk,old_offset,old_size;
|
||||
U8 *buf=MAlloc(BLK_SIZE);
|
||||
|
||||
PrtRep;
|
||||
DrvRep;
|
||||
PressAKey;
|
||||
|
||||
ClassRep(p);
|
||||
ClassRep(dv);
|
||||
PressAKey;
|
||||
|
||||
ClassRep(bdev);
|
||||
ClassRep(bd);
|
||||
PressAKey;
|
||||
|
||||
//Temporarily change partition range to full device.
|
||||
//Normally, you are limited to just your partition.
|
||||
//This is obviously $BK,1$dangerous$BK,0$!
|
||||
old_offset=p->offset;
|
||||
old_size =p->size;
|
||||
p->offset=bdev->min_blk;
|
||||
p->size=bdev->max_blk-bdev->min_blk+1;
|
||||
old_offset=dv->base_offset;
|
||||
old_size =dv->size;
|
||||
dv->base_offset=bd->min_blk;
|
||||
dv->size=bd->max_blk-bd->min_blk+1;
|
||||
|
||||
try {
|
||||
blk=GetI64("Blk to Read: ",old_offset,bdev->min_blk,bdev->max_blk);
|
||||
RBlks(p,buf,blk,1);
|
||||
blk=GetI64("Blk to Read: ",old_offset,bd->min_blk,bd->max_blk);
|
||||
RBlks(dv,buf,blk,1);
|
||||
D(buf,BLK_SIZE);
|
||||
} catch
|
||||
PutExcept;
|
||||
|
||||
p->offset=old_offset;
|
||||
p->size =old_size;
|
||||
dv->base_offset=old_offset;
|
||||
dv->size =old_size;
|
||||
|
||||
Free(buf);
|
||||
}
|
||||
|
||||
RawAccess;
|
||||
|
||||
//See $LK,"RBlks",A="MN:RBlks"$(), $LK,"WBlks",A="MN:WBlks"$(), $LK,"PrtLock",A="MN:PrtLock"$(), $LK,"PrtUnlock",A="MN:PrtUnlock"$()
|
||||
//See $LK,"RBlks",A="MN:RBlks"$(), $LK,"WBlks",A="MN:WBlks"$(), $LK,"DrvLock",A="MN:DrvLock"$(), $LK,"DrvUnlock",A="MN:DrvUnlock"$()
|
||||
//$LK,"DBlk",A="MN:DBlk"$(), $LK,"DCluster",A="MN:DCluster"$(), $LK,"BlkDevLock",A="MN:BlkDevLock"$() and $LK,"BlkDevUnlock",A="MN:BlkDevUnlock"$().
|
||||
@@ -1,13 +1,13 @@
|
||||
U0 UnusedSpaceRep()
|
||||
{
|
||||
I64 i;
|
||||
CPrt *p;
|
||||
CDrv *dv;
|
||||
for (i=0;i<26;i++)
|
||||
try {
|
||||
p=Drv2Prt(i+'A');
|
||||
if (p->type==PT_FAT32 || p->type==PT_REDSEA)
|
||||
dv=Let2Drv(i+'A');
|
||||
if (dv->type==DVT_FAT32 || dv->type==DVT_REDSEA)
|
||||
"%C: %7.3f%% Free\n",
|
||||
Prt2Drv(p),UnusedDrvSpace(Prt2Drv(p))*100.0/(p->size*BLK_SIZE);
|
||||
Drv2Let(dv),UnusedDrvSpace(Drv2Let(dv))*100.0/(dv->size*BLK_SIZE);
|
||||
} catch
|
||||
Fs->catch_except=TRUE;
|
||||
}
|
||||
|
||||
+15
-12
@@ -1,16 +1,19 @@
|
||||
U0 Install()
|
||||
{
|
||||
text.font[8*255+0]=0b00111100;
|
||||
text.font[8*255+1]=0b01000010;
|
||||
text.font[8*255+2]=0b10100101;
|
||||
text.font[8*255+3]=0b10000001;
|
||||
text.font[8*255+4]=0b11000011;
|
||||
text.font[8*255+5]=0b10111101;
|
||||
text.font[8*255+6]=0b01000010;
|
||||
text.font[8*255+7]=0b00111100;
|
||||
}
|
||||
|
||||
Install;
|
||||
U8 face[8]={
|
||||
|
||||
0b00111100,
|
||||
0b01000010,
|
||||
0b10100101,
|
||||
0b10000001,
|
||||
0b11000011,
|
||||
0b10111101,
|
||||
0b01000010,
|
||||
0b00111100,
|
||||
|
||||
};
|
||||
|
||||
|
||||
text.font[255]=face[0](U64);
|
||||
|
||||
"Face:ÿ\n";
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -144,6 +144,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
CSprite *temps;
|
||||
F64 tt;
|
||||
CD3I32 poly[4];
|
||||
Monster *tempm;
|
||||
|
||||
DCAllocDepthBuf(dc);
|
||||
MemSet(panels_processed_bitmap,0,(map_width*map_height+7)>>3);
|
||||
@@ -197,7 +198,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
LOS(xx*SCREEN_SCALE+SCREEN_SCALE/2,yy*SCREEN_SCALE+SCREEN_SCALE/2,
|
||||
man_xx,man_yy)) {
|
||||
if (c==YELLOW)
|
||||
dc->color=RED;
|
||||
dc->color=DKGRAY;
|
||||
else
|
||||
dc->color=c;
|
||||
poly[0].x=x;
|
||||
@@ -246,7 +247,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
GrFillPoly3(dc,4,poly);
|
||||
}
|
||||
if (!map[yy*map_width+xx+1]) {
|
||||
dc->color=DKGRAY;
|
||||
dc->color=WHITE;
|
||||
poly[0].x=x+SCREEN_SCALE;
|
||||
poly[0].y=y;
|
||||
poly[0].z=0;
|
||||
@@ -278,7 +279,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
GrFillPoly3(dc,4,poly);
|
||||
}
|
||||
if (!map[yy*map_width+xx-1]) {
|
||||
dc->color=DKGRAY;
|
||||
dc->color=WHITE;
|
||||
poly[0].x=x;
|
||||
poly[0].y=y;
|
||||
poly[0].z=0;
|
||||
@@ -303,9 +304,9 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
}
|
||||
|
||||
//Draw Monsters
|
||||
for (i=0;i<NUM_MONSTERS;i++) {
|
||||
x=monsters[i].x;
|
||||
y=monsters[i].y;
|
||||
for (i=0,tempm=monsters;i<NUM_MONSTERS;i++,tempm++) {
|
||||
x=tempm->x;
|
||||
y=tempm->y;
|
||||
if (LOS(x,y,man_xx,man_yy)) {
|
||||
x-=man_xx;
|
||||
y-=man_yy;
|
||||
@@ -314,7 +315,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
zz=0;
|
||||
GrTransform(dc,&xx,&yy,&zz);
|
||||
if (zz>0) {
|
||||
if (monsters[i].dead)
|
||||
if (tempm->dead)
|
||||
SpriteMat3B(dc,x,y,0,$IB,"<2>",BI=2$,r2);
|
||||
else {
|
||||
tt=Tri(tS,1.0);
|
||||
@@ -345,9 +346,9 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
|
||||
//Draw Things on heads-up Map
|
||||
dc->color=LTPURPLE;
|
||||
for (i=0;i<NUM_MONSTERS;i++)
|
||||
if (!monsters[i].dead)
|
||||
GrPlot3(dc,2*(monsters[i].x/SCREEN_SCALE),2*(map_height-1-monsters[i].y/SCREEN_SCALE),0);
|
||||
for (i=0,tempm=monsters;i<NUM_MONSTERS;i++,tempm++)
|
||||
if (!tempm->dead)
|
||||
GrPlot3(dc,2*(tempm->x/SCREEN_SCALE),2*(map_height-1-tempm->y/SCREEN_SCALE),0);
|
||||
dc->color=LTCYAN;
|
||||
GrPlot3(dc,2*(man_xx/SCREEN_SCALE),2*(map_height-1-man_yy/SCREEN_SCALE),0);
|
||||
|
||||
@@ -370,11 +371,13 @@ U0 Fire()
|
||||
{
|
||||
I64 i,x,y;
|
||||
F64 d,dx,dy,xx=Cos(man_é),yy=Sin(man_é);
|
||||
Monster *tempm;
|
||||
|
||||
Noise(100,300,1000);
|
||||
for (i=0;i<NUM_MONSTERS;i++) {
|
||||
x=monsters[i].x;
|
||||
y=monsters[i].y;
|
||||
if (!monsters[i].dead &&
|
||||
for (i=0,tempm=monsters;i<NUM_MONSTERS;i++,tempm++) {
|
||||
x=tempm->x;
|
||||
y=tempm->y;
|
||||
if (!tempm->dead &&
|
||||
LOS(x,y,man_xx,man_yy)) {
|
||||
dx=x-man_xx;
|
||||
dy=man_yy-y;
|
||||
@@ -382,7 +385,7 @@ U0 Fire()
|
||||
dx/=d;
|
||||
dy/=d;
|
||||
if (dx*xx+dy*yy>0.995) {
|
||||
monsters[i].dead=TRUE;
|
||||
tempm->dead=TRUE;
|
||||
if (!--monsters_left) {
|
||||
tf=tS;
|
||||
if (tf-t0<best_score)
|
||||
@@ -397,34 +400,33 @@ U0 Fire()
|
||||
U0 Init()
|
||||
{
|
||||
I64 i,x,y;
|
||||
I64 min_map_x,max_map_x,min_map_y,max_map_y;
|
||||
CDC *dc;
|
||||
Monster *tempm;
|
||||
|
||||
DocClear;
|
||||
"$$BG,BLACK$$%h*c",TEXT_ROWS/2,'\n';
|
||||
|
||||
SpriteExtents($IB,"<1>",BI=1$,&min_map_x,&max_map_x,&min_map_y,&max_map_y);
|
||||
map_width =(max_map_x-min_map_x+1)/MAP_SCALE+2;
|
||||
map_height=(max_map_y-min_map_y+1)/MAP_SCALE+2;
|
||||
dc=Sprite2DC($IB,"<1>",BI=1$);
|
||||
map_width =dc->width/MAP_SCALE+2;
|
||||
map_height=dc->height/MAP_SCALE+2;
|
||||
Free(map);
|
||||
Free(panels_processed_bitmap);
|
||||
map=CAlloc(map_width*map_height*sizeof(U8));
|
||||
panels_processed_bitmap=MAlloc((map_width*map_height+7)>>3);
|
||||
dc=DCNew(map_width*MAP_SCALE,map_height*MAP_SCALE);
|
||||
Sprite3(dc,-min_map_x+MAP_SCALE,-min_map_y+MAP_SCALE,0,$IB,"<1>",BI=1$);
|
||||
for (y=1;y<map_height-1;y++)
|
||||
for (x=1;x<map_width-1;x++)
|
||||
map[(map_height-1-y)*map_width+x]=GrPeek(dc,x*MAP_SCALE,y*MAP_SCALE);
|
||||
DCDel(dc);
|
||||
for (y=0;y<map_height-2;y++)
|
||||
for (x=0;x<map_width-2;x++)
|
||||
map[(map_height-2-y)*map_width+x+1]=GrPeek(dc,x*MAP_SCALE,y*MAP_SCALE);
|
||||
DCDel(dc);
|
||||
man_xx=(1+MAN_START_X)*SCREEN_SCALE;
|
||||
man_yy=(map_height-1-MAN_START_Y)*SCREEN_SCALE;
|
||||
man_é=0;
|
||||
|
||||
for (i=0;i<NUM_MONSTERS;i++) {
|
||||
monsters[i].dead=FALSE;
|
||||
for (i=0,tempm=monsters;i<NUM_MONSTERS;i++,tempm++) {
|
||||
tempm->dead=FALSE;
|
||||
do {
|
||||
monsters[i].x=RandU64%((map_width-2)*SCREEN_SCALE)+SCREEN_SCALE;
|
||||
monsters[i].y=RandU64%((map_height-2)*SCREEN_SCALE)+SCREEN_SCALE;
|
||||
} while (!map[(monsters[i].y/SCREEN_SCALE)*map_width+monsters[i].x/SCREEN_SCALE]);
|
||||
tempm->x=RandU64%((map_width-2)*SCREEN_SCALE)+SCREEN_SCALE;
|
||||
tempm->y=RandU64%((map_height-2)*SCREEN_SCALE)+SCREEN_SCALE;
|
||||
} while (!map[(tempm->y/SCREEN_SCALE)*map_width+tempm->x/SCREEN_SCALE]);
|
||||
}
|
||||
monsters_left=NUM_MONSTERS;
|
||||
tf=0;
|
||||
@@ -434,12 +436,14 @@ U0 Init()
|
||||
U0 AnimateTask(I64)
|
||||
{
|
||||
I64 i,x,y,dd;
|
||||
Monster *tempm;
|
||||
|
||||
while (TRUE) {
|
||||
dd=0.25*SCREEN_SCALE*Sin(tS/2);
|
||||
for (i=0;i<NUM_MONSTERS;i++)
|
||||
if (!monsters[i].dead) {
|
||||
x=monsters[i].x;
|
||||
y=monsters[i].y;
|
||||
for (i=0,tempm=monsters;i<NUM_MONSTERS;i++,tempm++)
|
||||
if (!tempm->dead) {
|
||||
x=tempm->x;
|
||||
y=tempm->y;
|
||||
if (i&1)
|
||||
x+=dd;
|
||||
else
|
||||
@@ -457,8 +461,8 @@ U0 AnimateTask(I64)
|
||||
!map[(y/SCREEN_SCALE-1)*map_width+x/SCREEN_SCALE] &&
|
||||
y-RoundI64(y,SCREEN_SCALE)<SCREEN_SCALE/2)
|
||||
y=RoundI64(y,SCREEN_SCALE)+SCREEN_SCALE/2;
|
||||
monsters[i].x=x;
|
||||
monsters[i].y=y;
|
||||
tempm->x=x;
|
||||
tempm->y=y;
|
||||
}
|
||||
}
|
||||
Sleep(20);
|
||||
@@ -493,7 +497,7 @@ U0 MoveMan(F64
|
||||
x=Clamp(x,0,map_width*SCREEN_SCALE);
|
||||
y=Clamp(y,0,map_height*SCREEN_SCALE);
|
||||
color=map[y/SCREEN_SCALE*map_width+x/SCREEN_SCALE];
|
||||
if (color==RED || color==GREEN) {
|
||||
if (color==DKGRAY || color==GREEN) {
|
||||
man_xx=x;
|
||||
man_yy=y;
|
||||
break;
|
||||
@@ -531,11 +535,11 @@ U0 CastleFrankenstein()
|
||||
);
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Fs->text_attr=RED<<4+WHITE;
|
||||
Fs->text_attr=DKGRAY<<4+WHITE;
|
||||
Preempt(OFF);
|
||||
WinBorder;
|
||||
WinMax;
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
Init;
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs);
|
||||
@@ -583,7 +587,7 @@ fs_done:
|
||||
}
|
||||
|
||||
CastleFrankenstein;
|
||||
| ||||