TempleOSCDV3.11.ISO
This commit is contained in:
1 parent
f8c05f98f4
commit
ed64d7e3b8
549 files changed
+10643
-12855
No files matched your search
@@ -1,271 +0,0 @@
|
||||
//Place this file in /Home and change
|
||||
//anything you want.
|
||||
|
||||
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);
|
||||
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
|
||||
|
||||
//See $LK,"Char",A="HI:Char"$ for definition of scan codes.
|
||||
//See $LK,"Key Allocations",A="FI:::/Doc/KeyAlloc.TXT"$.
|
||||
//See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$.
|
||||
|
||||
//You can customize keys. This routine
|
||||
//is called before the main editor
|
||||
//key handler $LK,"DocPutKey",A="MN:DocPutKey"$().
|
||||
//You can intercept any key.
|
||||
|
||||
//Return TRUE if you completely
|
||||
//handled the key.
|
||||
I64 i,sc2=sc.u8[0];
|
||||
U8 *st1,*st2;
|
||||
|
||||
if (SC_F1<=sc2<=SC_F10 &&
|
||||
sc&SCF_ALT &&
|
||||
!(sc & SCF_CTRL)) {
|
||||
switch (sc2) {
|
||||
case SC_F1:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc & SCF_SHIFT)
|
||||
KeyDescSet("Dollar/LTPURPLE");
|
||||
else
|
||||
KeyDescSet("Dollar/PURPLE");
|
||||
} else {
|
||||
if (sc & SCF_SHIFT)
|
||||
"$$LTPURPLE$$";
|
||||
else
|
||||
"$$PURPLE$$";
|
||||
}
|
||||
break;
|
||||
case SC_F2:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc & SCF_SHIFT)
|
||||
KeyDescSet("Dollar/LTRED");
|
||||
else
|
||||
KeyDescSet("Dollar/RED");
|
||||
} else {
|
||||
if (sc & SCF_SHIFT)
|
||||
"$$LTRED$$";
|
||||
else
|
||||
"$$RED$$";
|
||||
}
|
||||
break;
|
||||
case SC_F3:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc & SCF_SHIFT)
|
||||
KeyDescSet("Dollar/LTGREEN");
|
||||
else
|
||||
KeyDescSet("Dollar/GREEN");
|
||||
} else {
|
||||
if (sc & SCF_SHIFT)
|
||||
"$$LTGREEN$$";
|
||||
else
|
||||
"$$GREEN$$";
|
||||
}
|
||||
break;
|
||||
case SC_F4:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc & SCF_SHIFT)
|
||||
KeyDescSet("Dollar/Default Color");
|
||||
else
|
||||
KeyDescSet("Dollar/BLUE");
|
||||
} else {
|
||||
if (sc & SCF_SHIFT)
|
||||
"$$FG$$";
|
||||
else
|
||||
"$$BLUE$$";
|
||||
}
|
||||
break;
|
||||
case SC_F6:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc & SCF_SHIFT)
|
||||
KeyDescSet("Misc/Ins My URL");
|
||||
else
|
||||
KeyDescSet("Misc/Ins Datetime");
|
||||
} else {
|
||||
if (sc & SCF_SHIFT)
|
||||
InsMyURL;
|
||||
else
|
||||
InsTime;
|
||||
}
|
||||
break;
|
||||
case SC_F7:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc & SCF_SHIFT)
|
||||
KeyDescSet("God Book Passage");
|
||||
else
|
||||
KeyDescSet("God Doodle File");
|
||||
} else {
|
||||
//$LK,"::/Adam/God/HSNotes.TXT"$
|
||||
if (sc & SCF_SHIFT) {
|
||||
FifoU8Flush(god.fifo);
|
||||
GodBitsIns(GOD_GOOD_BITS,KbdMouseEvtTime>>GOD_BAD_BITS);
|
||||
GodBooksPassage("C:/Home/Wb2/Files/Text/*");
|
||||
} else {
|
||||
st1=PopUpPickFile;
|
||||
st2=FileRead(st1);
|
||||
GodDoodle(st2);
|
||||
Free(st2);
|
||||
Free(st1);
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
return TRUE;
|
||||
} else {
|
||||
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)
|
||||
KeyDescSet("Win/Tile Horizontally");
|
||||
else
|
||||
WinTileHorz;
|
||||
return TRUE;
|
||||
case 'm':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Win/Maximize");
|
||||
else {
|
||||
WinMax;
|
||||
WinBorder;
|
||||
}
|
||||
return TRUE;
|
||||
case 'v':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Win/Tile Vertically");
|
||||
else
|
||||
WinTileVert;
|
||||
return TRUE;
|
||||
case 'V':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Sys/Frame Grabber Toggle");
|
||||
else
|
||||
FrameGrabberToggle;
|
||||
return TRUE;
|
||||
|
||||
case 'l':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Edit/Put Link to Cur Pos on Clipboard");
|
||||
else {
|
||||
ClipboardDel;
|
||||
st1=FileNameAbs(BIBLE_FILENAME);
|
||||
st2=FileNameAbs(DocPut->filename.name);
|
||||
if (!StrCmp(st1,st2)) {
|
||||
Free(st1);
|
||||
st1=BibleLine2Verse(DocPut->cur_entry->y+1,',');
|
||||
DocPrint(sys_clipboard_doc,"$$LK,\"BF:%s\"$$",st1);
|
||||
} else
|
||||
DocPrint(sys_clipboard_doc,"$$LK,\"FL:%s,%d\"$$",
|
||||
st2,DocPut->cur_entry->y+1);
|
||||
Free(st1);
|
||||
Free(st2);
|
||||
}
|
||||
return TRUE;
|
||||
case 'L':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Edit/Place Anchor, Put Link to Clipboard");
|
||||
else {
|
||||
i=RandU32;
|
||||
ClipboardDel;
|
||||
DocPrint(sys_clipboard_doc,"$$LK,\"<TODO>\",A=\"FA:%s,ANC%d\"$$",
|
||||
DocPut->filename.name,i);
|
||||
"$$AN,\"<TODO>\",A=\"ANC%d\"$$",i;
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
//Ins your own ALT-key plug-ins
|
||||
case 'b':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd/Jump to Bad Code");
|
||||
else //$LK,"::/Adam/God/HSNotes.TXT"$
|
||||
BadCodeJump;
|
||||
return TRUE;
|
||||
|
||||
case 'g':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("BlogScreenShot");
|
||||
else
|
||||
BlogScreenShot;
|
||||
return TRUE;
|
||||
|
||||
case 'p':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("JukeBox(TAD)");
|
||||
else
|
||||
JukeBox("::/Home/Psalmody");
|
||||
return TRUE;
|
||||
case 'P':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("JukeBox(Examples)");
|
||||
else
|
||||
JukeBox("::/Apps/Psalmody/Examples");
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Bool MyPutS(U8 *)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
KeyDevAdd(&MyPutKey,&MyPutS,0x20000000,TRUE);
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
//This file is executed by the
|
||||
//first terminal window upon start-up.
|
||||
//See $LK,"DoOnce",A="FF:/Home/AdamSys.CPP,DoOnce"$ and $LK,"Home Files",A="FF:::/Doc/GuideLines.TXT,/Home Files"$.
|
||||
//See $LK,"DoOnce",A="FF:/Home/HomeSys.CPP,DoOnce"$ and $LK,"Home Files",A="FF:::/Doc/GuideLines.TXT,/Home Files"$.
|
||||
|
||||
// Type("::/Doc/Customize.TXT");
|
||||
|
||||
|
||||
@@ -0,0 +1,285 @@
|
||||
//Place this file in /Home and change
|
||||
//anything you want.
|
||||
|
||||
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);
|
||||
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
|
||||
|
||||
//See $LK,"Char",A="HI:Char"$ for definition of scan codes.
|
||||
//See $LK,"Key Allocations",A="FI:::/Doc/KeyAlloc.TXT"$.
|
||||
//See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$.
|
||||
|
||||
//You can customize keys. This routine
|
||||
//is called before the main editor
|
||||
//key handler $LK,"DocPutKey",A="MN:DocPutKey"$().
|
||||
//You can intercept any key.
|
||||
|
||||
//Return TRUE if you completely
|
||||
//handled the key.
|
||||
I64 i;
|
||||
U8 *st1,*st2;
|
||||
if (sc&SCF_ALT && !(sc&SCF_CTRL)) {
|
||||
switch (ch) {
|
||||
case 0:
|
||||
switch (sc.u8[0]) {
|
||||
case SC_F1:
|
||||
if (sc&SCF_SHIFT) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /LTPURPLE");
|
||||
else
|
||||
"$$LTPURPLE$$";
|
||||
} else {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /PURPLE");
|
||||
else
|
||||
"$$PURPLE$$";
|
||||
}
|
||||
return TRUE;
|
||||
case SC_F2:
|
||||
if (sc&SCF_SHIFT) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /LTRED");
|
||||
else
|
||||
"$$LTRED$$";
|
||||
} else {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /RED");
|
||||
else
|
||||
"$$RED$$";
|
||||
}
|
||||
return TRUE;
|
||||
case SC_F3:
|
||||
if (sc&SCF_SHIFT) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /LTGREEN");
|
||||
else
|
||||
"$$LTGREEN$$";
|
||||
} else {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /GREEN");
|
||||
else
|
||||
"$$GREEN$$";
|
||||
}
|
||||
return TRUE;
|
||||
case SC_F4:
|
||||
if (sc&SCF_SHIFT) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /Default Color");
|
||||
else
|
||||
"$$FG$$";
|
||||
} else {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /BLUE");
|
||||
else
|
||||
"$$BLUE$$";
|
||||
}
|
||||
return TRUE;
|
||||
case SC_F6:
|
||||
if (sc&SCF_SHIFT) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /Ins My URL");
|
||||
else
|
||||
InsMyURL;
|
||||
} else {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /Ins Datetime");
|
||||
else
|
||||
InsTime;
|
||||
}
|
||||
return TRUE;
|
||||
case SC_F7:
|
||||
//$LK,"::/Adam/God/HSNotes.TXT"$
|
||||
if (sc&SCF_SHIFT) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /God Book Passage");
|
||||
else {
|
||||
FifoU8Flush(god.fifo);
|
||||
GodBitsIns(GOD_GOOD_BITS,KbdMouseEvtTime>>GOD_BAD_BITS);
|
||||
GodBooksPassage("C:/Home/Wb2/Files/Text/*");
|
||||
}
|
||||
} else {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /God Doodle File");
|
||||
else {
|
||||
st1=PopUpPickFile;
|
||||
st2=FileRead(st1);
|
||||
GodDoodle(st2);
|
||||
Free(st2);
|
||||
Free(st1);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
case SC_F8:
|
||||
if (sc&SCF_SHIFT) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /Ins Dir Links");
|
||||
else
|
||||
InsDirLinks;
|
||||
} else {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /Ins File Link");
|
||||
else
|
||||
InsFileLink;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case 'a':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /AutoComplete On");
|
||||
else
|
||||
AutoComplete(ON);
|
||||
return TRUE;
|
||||
case 'A':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /AutoComplete Off");
|
||||
else
|
||||
AutoComplete;
|
||||
return TRUE;
|
||||
case 'h':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /Tile Horizontally");
|
||||
else
|
||||
WinTileHorz;
|
||||
return TRUE;
|
||||
case 'm':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /Maximize");
|
||||
else {
|
||||
WinBorder;
|
||||
WinMax;
|
||||
}
|
||||
return TRUE;
|
||||
case 'v':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /Tile Vertically");
|
||||
else
|
||||
WinTileVert;
|
||||
return TRUE;
|
||||
case 'V':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /Frame Grabber Toggle");
|
||||
else
|
||||
FrameGrabberToggle;
|
||||
return TRUE;
|
||||
case 'l':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Edit/Put Link to Cur Pos on Clipboard");
|
||||
else {
|
||||
ClipboardDel;
|
||||
st1=FileNameAbs(BIBLE_FILENAME);
|
||||
st2=FileNameAbs(DocPut->filename.name);
|
||||
if (!StrCmp(st1,st2)) {
|
||||
Free(st1);
|
||||
st1=BibleLine2Verse(DocPut->cur_entry->y+1,',');
|
||||
DocPrint(sys_clipboard_doc,"$$LK,\"BF:%s\"$$",st1);
|
||||
} else
|
||||
DocPrint(sys_clipboard_doc,"$$LK,\"FL:%s,%d\"$$",
|
||||
st2,DocPut->cur_entry->y+1);
|
||||
Free(st1);
|
||||
Free(st2);
|
||||
}
|
||||
return TRUE;
|
||||
case 'L':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Edit/Place Anchor, Put Link to Clipboard");
|
||||
else {
|
||||
i=RandU32;
|
||||
ClipboardDel;
|
||||
DocPrint(sys_clipboard_doc,"$$LK,\"<TODO>\",A=\"FA:%s,ANC%d\"$$",
|
||||
DocPut->filename.name,i);
|
||||
"$$AN,\"<TODO>\",A=\"ANC%d\"$$",i;
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
//Ins your own ALT-key plug-ins
|
||||
case '1':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /ã");
|
||||
else
|
||||
'ã';
|
||||
return TRUE;
|
||||
case '2':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /é");
|
||||
else
|
||||
'é';
|
||||
return TRUE;
|
||||
case '3':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /è");
|
||||
else
|
||||
'è';
|
||||
return TRUE;
|
||||
case '4':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /ê");
|
||||
else
|
||||
'ê';
|
||||
return TRUE;
|
||||
case 'b':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /Jump to Bad Code");
|
||||
else //$LK,"::/Adam/God/HSNotes.TXT"$
|
||||
BadCodeJump;
|
||||
return TRUE;
|
||||
case 'g':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Edit/BlogScreenShot");
|
||||
else
|
||||
BlogScreenShot;
|
||||
return TRUE;
|
||||
case 'p':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /JukeBox(TAD)");
|
||||
else
|
||||
JukeBox("::/Home/Wb2/Files/Psalmody");
|
||||
return TRUE;
|
||||
case 'P':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /JukeBox(Examples)");
|
||||
else
|
||||
JukeBox("::/Apps/Psalmody/Examples");
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Bool MyPutS(U8 *)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
KeyDevAdd(&MyPutKey,&MyPutS,0x20000000,TRUE);
|
||||
@@ -1,8 +1,8 @@
|
||||
//Place this file in /Home and change
|
||||
//anything you want.
|
||||
|
||||
OptOn(OPTf_WARN_PAREN);
|
||||
OptOn(OPTf_WARN_DUP_TYPES);
|
||||
Option(OPTf_WARN_PAREN,ON);
|
||||
Option(OPTf_WARN_DUP_TYPES,ON);
|
||||
|
||||
KbdTypeMatic(0);
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
//Place this file in /Home and change
|
||||
//anything you want.
|
||||
|
||||
#include "::/AdamPkgs"
|
||||
#include "::/HomePkgs"
|
||||
#include "::/Apps/Psalmody/Load"
|
||||
#include "::/Demo/WebLogExample/WebLogRep"
|
||||
Cd("::/Home");;
|
||||
#include "::/Misc/ToDolDoc"
|
||||
#include "::/Home/TOSIDComputer"
|
||||
#include "::/Home/TOSCfg"
|
||||
#include "::/Home/TOSMisc"
|
||||
@@ -8,7 +8,6 @@ U0 UserStartUp()
|
||||
LBts(&Fs->display_flags,DISPLAYf_SHOW);
|
||||
WinToTop;
|
||||
WinZBufUpdate;
|
||||
Preempt(ON);
|
||||
Dir;
|
||||
switch (tos_cid) {
|
||||
case CID_DFT:
|
||||
@@ -25,7 +24,6 @@ U0 SrvStartUp()
|
||||
LBts(&Fs->display_flags,DISPLAYf_SHOW);
|
||||
WinToTop;
|
||||
WinZBufUpdate;
|
||||
Preempt(ON);
|
||||
}
|
||||
|
||||
CTask *user1,*user2;
|
||||
Binary file not shown.
@@ -1,19 +1,35 @@
|
||||
$WW,1$* Clean-up $LK,"FileNameAbs",A="MN:FileNameAbs"$().
|
||||
$WW,1$* I'm going to redo all my videos and make them more professional.
|
||||
|
||||
* $TX,"Kruskal-Wallis_one-way_analysis_of_variance",HTML="http://en.wikipedia.org/wiki/Kruskal-Wallis_one-way_analysis_of_variance"$ disk sector allocation?
|
||||
|
||||
* Investigate why packet loss $LK,"Training Sleep(1)",A="FF:::/Adam/Training.CPP,Sleep(1)"$.
|
||||
|
||||
* 8/20/2015 TAD8, Tour1, then Tour TestSuite was missing #include "TestSuite".
|
||||
|
||||
* 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.)
|
||||
|
||||
* Make Bible into Tree Branches Collapsed.
|
||||
|
||||
* 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.
|
||||
* Should these be moved into $LK,"CHashClass",A="MN:CHashClass"$ from $LK,"CMemberLst",A="MN:CMemberLst"$ and $LK,"CHashGlblVar",A="MN:CHashGlblVar"$?
|
||||
CArrayDim dim;
|
||||
CHashFun *fun_ptr;
|
||||
|
||||
* Clean-up ASCII-127 delete char.
|
||||
* $LK,"StrPrintJoin",A="MN:StrPrintJoin"$(st); With st="\n\\";
|
||||
|
||||
* 8/2/2015 VMware start-up. Probably multicore.
|
||||
|
||||
* 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.
|
||||
* 1/?/2015,8/10/2015 Macro select in Menu did not go to shell. No: I think CTRL-M twice.
|
||||
|
||||
* $LK,"BMPRLE4To",A="MN:BMPRLE4To"$() has files_size too big by 108. Did I fix it?
|
||||
|
||||
@@ -25,6 +41,12 @@ $WW,1$* Clean-up $LK,"FileNameAbs",A="MN:FileNameAbs"$().
|
||||
|
||||
* Add Redo to editor.
|
||||
|
||||
* Perhaps, links to self document if empty file name? $LK,"Document Links",A="FF:::/Adam/DolDoc/DocLink.CPP,AD"$
|
||||
|
||||
* Cannot include ':' in $LK,"Document Links",A="FF:::/Adam/DolDoc/DocLink.CPP,AD"$ search string.
|
||||
|
||||
* $LK,"Type",A="MN:Type"$() doesn't work in $LK,"Raw",A="MN:Raw"$() mode.
|
||||
|
||||
* PSect does not scan all task tables.
|
||||
|
||||
* No Compiler Warning: dc->palette48.r =palette24[i].r<<8;
|
||||
@@ -54,7 +76,6 @@ $WW,1$* Clean-up $LK,"FileNameAbs",A="MN:FileNameAbs"$().
|
||||
* $$CM+LE+RE is nasty
|
||||
|
||||
* FlatTop is torpedo, not bombs.
|
||||
* BomberGolf is weird concept?
|
||||
|
||||
* Maybe, 3x3 instead of 4x4 matrices. <sigh>
|
||||
|
||||
@@ -137,8 +158,6 @@ $LK,"::/Demo/Lectures/FixedPointAdvanced.CPP"$.
|
||||
|
||||
* 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
|
||||
@@ -200,13 +219,13 @@ 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"$
|
||||
* $LK,"Bible sized nodes",A="FF:::/Adam/DolDoc/DocRecalc.CPP,->tag+i"$
|
||||
* Mouseinstall throws exceptions, doesn't work, investigate Mouse $LK,"0x9FC30",A="FF:::/Kernel/SerialDev/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
|
||||
* Fix Mom's secondary CD/DVD, dad's primary
|
||||
* pmtstr in install didn't like focus change
|
||||
|
||||
*$FG,2$U0 Main()
|
||||
@@ -234,7 +253,6 @@ short names.
|
||||
* 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.
|
||||
@@ -267,7 +285,6 @@ registry-like routines... or registry I guess.
|
||||
* new HolyC language features
|
||||
* better debugging
|
||||
|
||||
* Too much preemption turned off?
|
||||
* Look for mem leaks.
|
||||
* Move stuff out of Kernel module.
|
||||
|
||||
@@ -311,32 +328,77 @@ assignments. Is ShiftNoPush fully implemented?
|
||||
* sort options for findfiles
|
||||
* Maybe, get rid of $LK,"0x20000",A="FF:::/Compiler/CMain.CPP,0x20000"$ in compiler.
|
||||
|
||||
It is love I desire: $LK,"Hosea,6:6",A="BF:Hosea,6:6"$ $TX,"Hosea 6:6",HTML="http://www.biblegateway.com/verse/en/Hosea%206:6"$
|
||||
================================================================================
|
||||
It is love I desire: $TX,"Hosea 6:6",HTML="http://www.biblegateway.com/verse/en/Hosea%206:6"$
|
||||
Offer a sacrifice of praise: $TX,"Hebrews 13:15",HTML="http://www.biblegateway.com/verse/en/Hebrews%2013:15"$
|
||||
Do I drink blood of goats? Offer praise: $TX,"Psalms 50:14",HTML="http://www.biblegateway.com/verse/en/Psalms%2050:14"$
|
||||
Runner's Stride: $TX,"Psalms 147:10",HTML="http://www.biblegateway.com/verse/en/Psalms%20147:10"$
|
||||
|
||||
Offer a sacrifice of praise: $LK,"Hebrews,13:15",A="BF:Hebrews,13:15"$ $TX,"Hebrews 13:15",HTML="http://www.biblegateway.com/verse/en/Hebrews%2013:15"$
|
||||
|
||||
Do I drink blood of goats? Offer praise: $LK,"Psalms,50:14",A="BF:Psalms,50:14"$ $TX,"Psalms 50:14",HTML="http://www.biblegateway.com/verse/en/Psalms%2050:14"$
|
||||
|
||||
Runner's Stride: $LK,"Psalms,147:10",A="BF:Psalms,147:10"$ $TX,"Psalms 147:10",HTML="http://www.biblegateway.com/verse/en/Psalms%20147:10"$
|
||||
|
||||
Buckling Armor: $LK,"1 Kings,20:11",A="BF:1 Kings,20:11"$ $TX,"1 Kings 20:11",HTML="http://www.biblegateway.com/verse/en/1%20Kings%2020:11"$
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/aKchwAWMpDA\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/aKchwAWMpDA\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
Buckling Armor: $TX,"1 Kings 20:11",HTML="http://www.biblegateway.com/verse/en/1%20Kings%2020:11"$
|
||||
Lot cast in the lap: $TX,"Proverbs 16:33",HTML="http://www.biblegateway.com/verse/en/Proverbs%2016:33"$
|
||||
Lord does not repeat: $TX,"Job 33:14",HTML="http://www.biblegateway.com/verse/en/Job%2033:14"$
|
||||
Offer only in approved place: $TX,"Deuteronomy 12:13-18",HTML="http://www.biblegateway.com/passage/?search=Deuteronomy%2012:13-18&version=NIV"$
|
||||
Jesus' zeal for the Temple: $TX,"John 2:14-19",HTML="http://www.biblegateway.com/passage/?search=John%202:14-19&version=NIV"$
|
||||
|
||||
>lspci -v
|
||||
Size:$TX,"17294 KB",D="DD_TEMPLEOSCD_K_SIZE"$
|
||||
|
||||
Size:$TX,"17594 KB",D="DD_TEMPLEOSCD_K_SIZE"$
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/E6K9zK9ZWSg\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/E6K9zK9ZWSg\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
8:11 Behold, the days come, saith the Lord GOD, that I will send a
|
||||
famine in the land, not a famine of bread, nor a thirst for water, but
|
||||
of hearing the words of the LORD: 8:12 And they shall wander from sea
|
||||
to sea, and from the north even to the east, they shall run to and fro
|
||||
to seek the word of the LORD, and shall not find it.
|
||||
|
||||
$TX,"Let me Google NIST Random Beacon",HTML="http://lmgtfy.com?q=NIST+random+beacon"$
|
||||
TempleOS Logo
|
||||
$HC,"<img src=\"http://www.templeos.org/images/Logo128x152.jpg\" width=\"640\" height=\"760\" alt=\"\">"$
|
||||
|
||||
Contact
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/SRoj3jK37Vc\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/SRoj3jK37Vc\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
|
||||
Black Knight
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/dhRUe-gz690\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/dhRUe-gz690\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
|
||||
Metallica: Creeping Death
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/z5lXEFdZAmU\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/z5lXEFdZAmU\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
|
||||
Neil Degrasse Tyson: Get of of their Way
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/AIEJjpVlZu0\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/AIEJjpVlZu0\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
Neil Degrasse Tyson: Girl
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/rVwQ9jBuoFA\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/rVwQ9jBuoFA\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
|
||||
Commodore 64 Basic/Assembly
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/d8bZ92gIVms\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/d8bZ92gIVms\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
|
||||
Red Fang: Prehistoric Dog
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/VufilzHKTqk\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/VufilzHKTqk\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
|
||||
Bill Gates Predictions
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/4r9u_R0cCew\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/4r9u_R0cCew\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
|
||||
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=\"\">"$
|
||||
|
||||
Frontier Psychiatrist
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/qLrnkK2YEcE\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/qLrnkK2YEcE\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/DfIcZtjAch8\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/DfIcZtjAch8\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
|
||||
Morning has Broken
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/kKoRp05L95c\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/kKoRp05L95c\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
|
||||
Icarus
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/0Pmgtyw2n8w\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/0Pmgtyw2n8w\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
|
||||
Zombie Game
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/F27r_9oyqBI\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/F27r_9oyqBI\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
Sports Game
|
||||
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/ORXqOEGFQfE\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/ORXqOEGFQfE\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
|
||||
|
||||
|
||||
$TX,"WWW.OSDEV.ORG",HTML="http://www.osdev.org"$
|
||||
$TX,"PCI Interrupt Routing",HTML="http://forum.osdev.org/viewtopic.php?f=1&t=29558"$
|
||||
$TX,"Lamp Shades",HTML="http://www.lampsplus.com/products/lamp-shades"$
|
||||
$TX,"My Bookmarks",HTML="http://www.templeos.org/Wb/Home/Wb2/Files/Bookmarks"$
|
||||
$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"$
|
||||
@@ -348,6 +410,7 @@ $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,"Bible with LineNums",HTML="http://www.templeos.org/files/NumBible.TXT"$
|
||||
$TX,"Security at NIST",HTML="http://csrc.nist.gov/publications/nistpubs/800-30-rev1/sp800_30_r1.pdf"$
|
||||
$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"$
|
||||
@@ -362,3 +425,5 @@ $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"$
|
||||
$TX,"8-Bit Japanese Pixel Art",HTML="http://designmadeinjapan.com/magazine/illustration-icon/tumblr-gifs-of-japanese-life"$
|
||||
$TX,"Resperdal Shortens Life",HTML="http://factmed.com/study-RISPERDAL-causing-LIFE EXPECTANCY SHORTENED.php"$
|
||||
@@ -2,16 +2,14 @@ $TR-UL,"Adam"$
|
||||
$ID,2$$TR,"SysMsgFlags"$
|
||||
$ID,2$sys_msg_flags[0]=0xFF;
|
||||
$ID,-2$$TR,"SysRegVer"$
|
||||
$ID,2$registry_version=3.070;
|
||||
$ID,-2$$ID,-2$$TR-C-UL,"TempleOS"$
|
||||
$ID,2$$TR,"CircleTrace"$
|
||||
$ID,2$F64 best_score=4.9425;
|
||||
$ID,-2$$TR,"TOS"$
|
||||
$ID,2$registry_version=3.110;
|
||||
$ID,-2$$ID,-2$$TR-UL,"TempleOS"$
|
||||
$ID,2$$TR,"TOS"$
|
||||
$ID,2$I64 tos_code_walk_thru=105,tos_after_egypt_in_action=46;
|
||||
$ID,-2$$TR,"DiningStars"$
|
||||
$ID,2$F64 best_score=9999.0000;
|
||||
$ID,-2$$TR,"BlackDiamond"$
|
||||
$ID,2$I64 best_score=1;
|
||||
$ID,2$I64 best_score=9;
|
||||
$ID,-2$$TR,"EagleDive"$
|
||||
$ID,2$I64 best_score=4;
|
||||
$ID,-2$$TR,"DunGen"$
|
||||
@@ -21,25 +19,27 @@ $ID,2$F64 best_score=33.8405;
|
||||
$ID,-2$$TR,"ZoneOut"$
|
||||
$ID,2$F64 best_score=50.3318;
|
||||
$ID,-2$$TR,"Varoom"$
|
||||
$ID,2$F64 best_score=11.8623;
|
||||
$ID,-2$$TR,"BugBird"$
|
||||
$ID,2$F64 best_score=18.2332;
|
||||
$ID,2$F64 best_score=46.2643;
|
||||
$ID,-2$$TR,"FlapBat"$
|
||||
$ID,2$F64 best_score=16.4090;
|
||||
$ID,-2$$TR,"TimeOut"$
|
||||
$ID,2$I64 best_score=21532;
|
||||
$ID,2$I64 best_score=22202;
|
||||
$ID,-2$$TR,"RawHide"$
|
||||
$ID,2$F64 best_score=81.1088;
|
||||
$ID,2$F64 best_score=96.1279;
|
||||
$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=49.8074;
|
||||
$ID,-2$$TR,"BomberGolf"$
|
||||
$ID,2$I64 best_score=32;
|
||||
$ID,2$I64 best_score=175;
|
||||
$ID,-2$$TR,"XCaliber"$
|
||||
$ID,2$I64 best_score=248;
|
||||
I64 msg_flags=1;
|
||||
$ID,-2$$TR,"CircleTrace"$
|
||||
$ID,2$F64 best_score=4.9425;
|
||||
$ID,-2$$ID,-2$$TR,"DemoCompany"$
|
||||
$ID,2$$TR,"Game1"$
|
||||
$ID,2$F64 best_score=168.62557;
|
||||
$ID,2$F64 best_score=166.20441;
|
||||
$TR,"SimpleVal"$
|
||||
$ID,2$1250;
|
||||
$ID,2$1267;
|
||||
$ID,-2$$ID,-2$$ID,-2$
|
||||
+12
-12
@@ -6,7 +6,7 @@ U0 TOSBootRescueDrv1()
|
||||
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-
|
||||
(BOOT_RAM_LIMIT-(BOOT_STK_SIZE+DVD_BOOT_LOADER_SIZE))>>4<<4-
|
||||
(bfh(I64)-SYS_KERNEL_END)-SLOP,BLK_SIZE));
|
||||
DefinePrint("CFG_BOOT_RESCUE_DRV_FILE","\"/Temp/BootRescueDrv.BIN.Z\"");
|
||||
} TOSBootRescueDrv1;
|
||||
@@ -25,25 +25,25 @@ U0 TOSInit()
|
||||
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) {
|
||||
"\"b1\nScale2Mem(2048,0x100000,4*1024*1024*1024)\n\"");
|
||||
if (blkdev.auto_mount_ide_cnt) {
|
||||
//If AutoMount was successful, No need to manually mount in next compile
|
||||
DefinePrint("CFG_HARD_DRVS","\"\"");
|
||||
DefinePrint("CFG_CDROM_DRVS","\"\"");
|
||||
DefinePrint("CFG_DVD_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\"");
|
||||
DefinePrint("CFG_DVD_DRVS","\"t3s0x170\n0\"");
|
||||
|
||||
bd=Let2BlkDev(':');
|
||||
if (bd->type==BDT_ATAPI) {
|
||||
ATARep(FALSE,,&root);
|
||||
ATAIDDrvs(root,dsk.boot_drv_let,&ata_drv,&atapi_drv);
|
||||
ATAIDDrvs(root,blkdev.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);
|
||||
DefinePrint("CFG_DVD_DRVS","\"t3p%d\n\"",atapi_drv->num);
|
||||
} else {
|
||||
try {
|
||||
bd=Let2BlkDev('C');
|
||||
@@ -53,7 +53,7 @@ U0 TOSInit()
|
||||
Fs->catch_except=TRUE;
|
||||
try {
|
||||
bd=Let2BlkDev('T');
|
||||
DefinePrint("CFG_CDROM_DRVS","\"t3s0x%X\n%d\"",bd->base0,bd->unit);
|
||||
DefinePrint("CFG_DVD_DRVS","\"t3s0x%X\n%d\"",bd->base0,bd->unit);
|
||||
} catch
|
||||
Fs->catch_except=TRUE;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ U0 TOSDrvTextAttrSet()
|
||||
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
|
||||
DrvTextAttrSet('T', LTGRAY<<4|BLUE); //CD/DVD
|
||||
} TOSDrvTextAttrSet;
|
||||
|
||||
#define TOS_ISO_NAME "B:/TempleOSCD.ISO"
|
||||
@@ -80,10 +80,10 @@ U0 TOSDrvTextAttrSet()
|
||||
"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"\
|
||||
#define TOS_CFG "\n" CFG_RAM_DRVS CFG_DVD_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\
|
||||
#define TOS_DVD_CFG "Tb1\n0x20000\nt3 \n\n\nAutoMountIDE\nCT\n"
|
||||
#define TOS_DVD_DBG_CFG "A" CFG_BOOT_RESCUE_DRV\
|
||||
"b1\nScale2Mem(2048,0x40000)\n\n\n"\
|
||||
"DontProbe\nBootRescueDrv\n"\
|
||||
"C:" CFG_BOOT_RESCUE_DRV_FILE "\n"\
|
||||
|
||||
@@ -90,7 +90,8 @@ public U0 CopySongs(U8 threshold='7')
|
||||
{
|
||||
CDoc *s;
|
||||
CDocEntry *doc_e;
|
||||
CDirEntry *tempde=FilesFind("::/Home/Psalmody/*.CPP*",FUF_CLUSTER_ORDER),
|
||||
CDirEntry *tempde=FilesFind("::/Home/Wb2/Files/Psalmody/*.CPP*",
|
||||
FUF_CLUSTER_ORDER),
|
||||
*tempde1=tempde;
|
||||
DelTree("/Apps/Psalmody/Examples");
|
||||
MkDir("/Apps/Psalmody/Examples");
|
||||
@@ -110,7 +111,7 @@ U0 DistroPrep()
|
||||
Del("/Demo/ReverseFileExample/PoemForeward.TXT*");
|
||||
Del("/Home/NumBible.TXT.Z");
|
||||
DelTree("/Home/*Temp.TXT.Z");
|
||||
if (FileFind("::/Home/Psalmody"))
|
||||
if (FileFind("::/Home/Wb2/Files/Psalmody"))
|
||||
CopySongs;
|
||||
|
||||
DelTree("/Temp");
|
||||
@@ -123,8 +124,12 @@ U0 DistroPrep()
|
||||
DelTree("/Demo/AcctExample");
|
||||
CopyTree("/Home","/Demo/AcctExample");
|
||||
DelTree("/Demo/AcctExample/Archive");
|
||||
DelTree("/Demo/AcctExample/Blog");
|
||||
DelTree("/Demo/AcctExample/Budget");
|
||||
DelTree("/Demo/AcctExample/Code");
|
||||
DelTree("/Demo/AcctExample/Misc");
|
||||
DelTree("/Demo/AcctExample/Psalmody");
|
||||
DelTree("/Demo/AcctExample/Videos");
|
||||
DelTree("/Demo/AcctExample/Wb2");
|
||||
Del("/Demo/AcctExample/Test*");
|
||||
|
||||
@@ -160,15 +165,17 @@ U0 MakeBootRescueDrvFile()
|
||||
|
||||
MkDir("A:/Kernel");
|
||||
Copy("C:/Kernel/*.HPP*", "A:/Kernel");
|
||||
CopyTree("C:/Kernel/Dsk", "A:/Kernel/Dsk");
|
||||
CopyTree("C:/Kernel/BlkDev", "A:/Kernel/BlkDev");
|
||||
|
||||
Copy("C:/Home/Wb2/Files/DbgAdam.CPP.Z","A:/Adam.CPP.Z");
|
||||
Copy("C:/Home/Wb2/Files/DbgStartOS.CPP.Z","A:/StartOS.CPP.Z");
|
||||
|
||||
MkDir("A:/Adam");
|
||||
Copy("C:/Home/Wb2/Files/DbgMakeAdam.CPP.Z","A:/Adam/MakeAdam.CPP.Z");
|
||||
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/AMem.CPP.Z", "A:/Adam");
|
||||
Copy("C:/Adam/TaskRep.CPP.Z", "A:/Adam");
|
||||
Copy("C:/Adam/AMathODE.CPP.Z","A:/Adam");
|
||||
|
||||
FileWrite("C:" CFG_BOOT_RESCUE_DRV_FILE,
|
||||
@@ -270,7 +277,7 @@ website, too.
|
||||
*/
|
||||
Drv('C');
|
||||
DistroPrep;
|
||||
Auto(TOS_CDROM_CFG);
|
||||
Auto(TOS_DVD_CFG);
|
||||
MakeOSDrvBootInstall('C','T');
|
||||
DelTree(TOS_DISTRO_DIR);
|
||||
CopyTree("C:/",TOS_DISTRO_DIR "/");
|
||||
@@ -282,14 +289,14 @@ U0 MakeTOSDistro()
|
||||
ISOFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
|
||||
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSTS_SIZE",
|
||||
"Download $TX,"TempleOS V3.07",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V3.10",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
|
||||
{/*This is a debug distro. The CD/DVD 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
|
||||
@@ -305,7 +312,7 @@ I call $LK,"MakeBootDrvFile",A="FF:::/Demo/AcctExample/TOSDistro.CPP,MakeBootRes
|
||||
Drv('C');
|
||||
DistroPrep;
|
||||
MakeBootRescueDrvFile;
|
||||
Auto(TOS_CDROM_DBG_CFG);
|
||||
Auto(TOS_DVD_DBG_CFG);
|
||||
MakeOSDrvBootInstall('C','T');
|
||||
DelTree(TOS_DISTRO_DIR);
|
||||
CopyTree("C:/",TOS_DISTRO_DIR "/");
|
||||
@@ -318,7 +325,7 @@ U0 MakeDbgDistro()
|
||||
ISOFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
|
||||
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSDBG_SIZE",
|
||||
"Download $TX,"TempleOS V3.07",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V3.10",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
@@ -327,7 +334,7 @@ U0 StdDistroPrep()
|
||||
{
|
||||
Drv('C');
|
||||
DistroPrep;
|
||||
Auto(STD_DISTRO_CDROM_CFG);
|
||||
Auto(STD_DISTRO_DVD_CFG);
|
||||
MakeOSDrvBootInstall('C','T');
|
||||
DelTree(TOS_DISTRO_DIR);
|
||||
CopyTree("C:/",TOS_DISTRO_DIR "/");
|
||||
@@ -366,7 +373,7 @@ U0 MakeLiteDistro()
|
||||
ISOFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
|
||||
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSLITE_SIZE",
|
||||
"Download $TX,"TempleOS V3.07",D="DD_OS_NAME_VERSION"$ - Lite Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V3.10",D="DD_OS_NAME_VERSION"$ - Lite Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
@@ -388,6 +395,10 @@ FileManager, WindowManager, PCSpeaker, Documentation.
|
||||
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");
|
||||
Copy("C:/Home/Wb2/Files/UltraMenu.TXT.Z",
|
||||
TOS_DISTRO_DIR "/PersonalMenu.TXT.Z");
|
||||
Copy("C:/Demo/Games/EagleDive.CPP.Z",
|
||||
TOS_DISTRO_DIR "/Misc");
|
||||
}
|
||||
U0 MakeUltraDistro()
|
||||
{
|
||||
@@ -395,7 +406,7 @@ U0 MakeUltraDistro()
|
||||
ISOFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
|
||||
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSULTRA_SIZE",
|
||||
"Download $TX,"TempleOS V3.07",D="DD_OS_NAME_VERSION"$ - UltraLite Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V3.10",D="DD_OS_NAME_VERSION"$ - UltraLite Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
@@ -473,18 +484,19 @@ U0 FreshenWebDir(U8 *dirname)
|
||||
U0 MakeWebSitePartial()
|
||||
{
|
||||
FreshenWebDir("/Home/Wb2");
|
||||
FreshenWebDir("/Home/Wb2/Imgs");
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 UpdateISODocDefines()
|
||||
{
|
||||
DefinePrint("DD_TEMPLEOSCD_SIZE",
|
||||
"Download $TX,"TempleOS V3.07",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V3.10",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.07",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V3.10",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);
|
||||
@@ -498,8 +510,8 @@ public U0 MakeDistrosAndBackUp()
|
||||
progress4=*progress4_desc=0;
|
||||
progress4_max=14;
|
||||
AutoComplete;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
ChkAll; progress4++;
|
||||
|
||||
MakeLineRepFile; progress4++;
|
||||
|
||||
@@ -127,7 +127,7 @@ class CTopMoviesForm
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN];
|
||||
I64 timestamp;
|
||||
I64 cert fmtstr "$$DA,32,A=\"Movie #1-100 :%d\"$$\n";
|
||||
I64 cert fmtstr "$$DA-TRM,2,A=\"Movie #1-100 :%02d\"$$\n";
|
||||
I64 min;
|
||||
I64 sec;
|
||||
};
|
||||
@@ -155,7 +155,7 @@ class CWebBibleForm
|
||||
class CYouTubeForm
|
||||
{
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"SerialNum:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P-TRM,11,A=\"SerialNum:%11s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
I64 min fmtstr "$$DA,32,A=\"Minutes :%d\"$$\n";
|
||||
@@ -165,7 +165,7 @@ class CYouTubeForm
|
||||
class CTopMoviesYouTubeForm
|
||||
{
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Movie :%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"SerialNum:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"SerialNum:%s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
I64 min fmtstr "$$DA,32,A=\"Minutes :%d\"$$\n";
|
||||
@@ -175,7 +175,7 @@ class CTopMoviesYouTubeForm
|
||||
class CImgurForm
|
||||
{
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"SerialNum:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"SerialNum:%s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
I64 min fmtstr "$$DA,32,A=\"Width :%d\"$$\n";
|
||||
@@ -185,7 +185,7 @@ class CImgurForm
|
||||
class CWikipediaForm
|
||||
{
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Tag Text:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Index :%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Index :%s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
I64 min;
|
||||
@@ -195,7 +195,7 @@ class CWikipediaForm
|
||||
class CRandDecForm
|
||||
{
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Line (Dec):%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Line (Dec):%s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
I64 min;
|
||||
@@ -205,7 +205,7 @@ class CRandDecForm
|
||||
class CRandHexForm
|
||||
{
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Line (Hex):%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Line (Hex):%s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
I64 min;
|
||||
@@ -222,10 +222,22 @@ class CRandCertForm
|
||||
I64 sec;
|
||||
};
|
||||
|
||||
class CRandHexBeaconForm
|
||||
class CRandHexBeacon5Form
|
||||
{
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Line (Hex):%s\"$$\n";
|
||||
U8 special[STR_LEN]
|
||||
fmtstr "$$DA-P-TRM,5,A=\"Line (5-Digit Hex):%5s\"$$\n";
|
||||
I64 timestamp fmtstr "$$DA,32,A=\"TimeStamp :%d\"$$\n";
|
||||
I64 cert;
|
||||
I64 min;
|
||||
I64 sec;
|
||||
};
|
||||
|
||||
class CRandHexBeacon8Form
|
||||
{
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN]
|
||||
fmtstr "$$DA-P-TRM,8,A=\"Line (8-Digit Hex):%8s\"$$\n";
|
||||
I64 timestamp fmtstr "$$DA,32,A=\"TimeStamp :%d\"$$\n";
|
||||
I64 cert;
|
||||
I64 min;
|
||||
@@ -311,7 +323,53 @@ U0 MyBibleLines(U8 *st,I64 num_lines,I64 radix,Bool modulo,Bool plus_one)
|
||||
}
|
||||
}
|
||||
|
||||
#define NIST_TIME_OFFSET (-7788-local_time_offset/CDATE_FREQ)
|
||||
public U0 GodBooksPassage(U8 *files_find_mask,I64 len=512,
|
||||
I64 rand_i32=MIN_I64,Bool full=FALSE)
|
||||
{//Make God pick a book passage. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
|
||||
CDirEntry *tempde=FilesFind(files_find_mask,
|
||||
FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT),
|
||||
*tempde1=tempde;
|
||||
I64 i=0;
|
||||
U8 *st,*st2=NULL;
|
||||
while (tempde) {
|
||||
st=FileRead(tempde->full_name);
|
||||
tempde->user_data=StrLen(st);
|
||||
if (full)
|
||||
"%08X-",i;
|
||||
if (tempde->user_data>=len)
|
||||
i+=tempde->user_data+1-len;
|
||||
if (full)
|
||||
"%08X:$$LK,\"%s\",A=\"FI:%s\"$$\n",
|
||||
i-1,tempde->full_name+2,tempde->full_name;
|
||||
Free(st);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
if (rand_i32<0)
|
||||
rand_i32=GodBits(32);
|
||||
if (full)
|
||||
"\n%08X*%08X",rand_i32,i;
|
||||
i*=rand_i32;
|
||||
if (full)
|
||||
"=%08X.%08X\n",i.u32[1],i.u32[0];
|
||||
i=i.u32[1];
|
||||
tempde=tempde1;
|
||||
while (tempde) {
|
||||
if (!st2 && tempde->user_data>=len) {
|
||||
i-=tempde->user_data+1-len;
|
||||
if (i<0) {
|
||||
st=FileRead(tempde->full_name);
|
||||
st2=st+(tempde->user_data+1-len)+i;
|
||||
st2[len]=0;
|
||||
"%s\n\n$$RED$$%s$$FG$$\n",tempde->full_name,st2;
|
||||
Free(st);
|
||||
}
|
||||
}
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
#define NIST_TIME_OFFSET (-7788-21-local_time_offset/CDATE_FREQ)
|
||||
#define NIST_TIME_TO_SWITCH 3
|
||||
|
||||
public U0 NISTSync()
|
||||
@@ -336,12 +394,13 @@ U0 InsMyURL()
|
||||
url->timestamp=
|
||||
FloorI64((Now-Str2Date("1/1/1970"))/CDATE_FREQ+NIST_TIME_OFFSET-
|
||||
NIST_TIME_TO_SWITCH,60);
|
||||
switch (PopUpPickLst("NISTBeacon\0BibleGatewaySearch\0BibleGatewayVerse\0"
|
||||
switch (PopUpPickLst("NISTBeacon5Bible\0NISTBeacon8Passage\0"
|
||||
"BibleGatewaySearch\0BibleGatewayVerse\0"
|
||||
"YouTube\0Imgur\0Wikipedia\0RandomNumbers.info\0Random.org\0PassWord\0"
|
||||
"VirtualNotary\0Nist\0HotBits\0GenerateData\0WebBookMark\0"
|
||||
"Roulette\0Movie\0")) {
|
||||
case 0:
|
||||
if (DocForm(url(CRandHexBeaconForm *))) {
|
||||
if (DocForm(url(CRandHexBeacon5Form *))) {
|
||||
"$$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);
|
||||
@@ -351,6 +410,17 @@ U0 InsMyURL()
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (DocForm(url(CRandHexBeacon8Form *))) {
|
||||
"$$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);
|
||||
GodBooksPassage("C:/Home/Wb2/Files/Text/*",,
|
||||
Str2I64(url->special,16),TRUE);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (DocForm(url(CWebBibleForm *))) {
|
||||
tag=url->special;
|
||||
st2=URLPercentSpaces(url->special);
|
||||
@@ -363,7 +433,7 @@ U0 InsMyURL()
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
if (DocForm(url(CWebBibleForm *))) {
|
||||
tag=url->special;
|
||||
st2=URLPercentSpaces(url->special);
|
||||
@@ -376,7 +446,7 @@ U0 InsMyURL()
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
if (DocForm(url(CYouTubeForm *))) {
|
||||
if (url->min || url->sec)
|
||||
st=MStrPrint("%s&hl=enUS&start=%d",url->special,url->min*60+url->sec);
|
||||
@@ -395,14 +465,14 @@ U0 InsMyURL()
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
if (DocForm(url(CImgurForm *))) {
|
||||
"$$HC,\"<img src=\\\"http://i.imgur.com/%s\\\" "
|
||||
"width=\\\"%d\\\" height=\\\"%d\\\" alt=\\\"\\\">\"$$\n",
|
||||
url->special,url->min,url->sec;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
case 6:
|
||||
if (DocForm(url(CWikipediaForm *))) {
|
||||
tag=url->special;
|
||||
st=MStrPrint("http://en.wikipedia.org/wiki/%s",url->special);
|
||||
@@ -412,7 +482,7 @@ U0 InsMyURL()
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
if (DocForm(url(CRandDecForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
@@ -421,7 +491,7 @@ U0 InsMyURL()
|
||||
MyBibleLines(url->special,20,10,FALSE,TRUE);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
if (DocForm(url(CRandDecForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
@@ -430,7 +500,7 @@ U0 InsMyURL()
|
||||
MyBibleLines(url->special,20,10,FALSE,FALSE);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
if (DocForm(url(CRandDecForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
@@ -439,7 +509,7 @@ U0 InsMyURL()
|
||||
MyBibleLines(url->special,20,10,FALSE,FALSE);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
if (DocForm(url(CRandCertForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
@@ -453,7 +523,7 @@ U0 InsMyURL()
|
||||
MyBibleLines(url->special,20,10,FALSE,FALSE);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
case 11:
|
||||
if (DocForm(url(CRandHexForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
@@ -462,7 +532,7 @@ U0 InsMyURL()
|
||||
MyBibleLines(url->special,20,16,TRUE,TRUE);
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
case 12:
|
||||
if (DocForm(url(CRandHexForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
@@ -471,7 +541,7 @@ U0 InsMyURL()
|
||||
MyBibleLines(url->special,20,16,TRUE,TRUE);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
case 13:
|
||||
if (DocForm(url(CRandDecForm *))) {
|
||||
"$$TX,\"Guidelines for Talking with God\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
@@ -480,7 +550,7 @@ U0 InsMyURL()
|
||||
MyBibleLines(url->special,20,10,FALSE,FALSE);
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
case 14:
|
||||
if (DocForm(url(CWebBookMarkForm *))) {
|
||||
tag=st=WebBookMarks;
|
||||
if (*url->tag)
|
||||
@@ -489,17 +559,16 @@ U0 InsMyURL()
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
case 15:
|
||||
if (DocForm(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";
|
||||
tag="https://www.dublinbet.com";
|
||||
"$$TX,\"%Q\",HTML=\"%Q\"$$\n",tag,tag;
|
||||
MyBibleLines(url->special,20,10,FALSE,FALSE);
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
case 16:
|
||||
if (DocForm(url(CTopMoviesForm *)) && (st=TopMoviesRead(,url->cert*2))) {
|
||||
StrCpy(url->tag,st);
|
||||
Free(st);
|
||||
@@ -538,38 +607,5 @@ U0 InsMyURL()
|
||||
Free(url);
|
||||
}
|
||||
|
||||
public U0 GodBooksPassage(U8 *files_find_mask,I64 len=512)
|
||||
{//Make God pick a book passage. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
|
||||
CDirEntry *tempm=FilesFind(files_find_mask,
|
||||
FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT),
|
||||
*tempm1=tempm;
|
||||
I64 i=0;
|
||||
U8 *st,*st2=NULL;
|
||||
while (tempm) {
|
||||
st=FileRead(tempm->full_name);
|
||||
tempm->user_data=StrLen(st);
|
||||
if (tempm->user_data>=len)
|
||||
i+=tempm->user_data+1-len;
|
||||
Free(st);
|
||||
tempm=tempm->next;
|
||||
}
|
||||
i=(GodBits(24)*i)>>24;
|
||||
tempm=tempm1;
|
||||
while (tempm) {
|
||||
if (!st2 && tempm->user_data>=len) {
|
||||
i-=tempm->user_data+1-len;
|
||||
if (i<0) {
|
||||
st=FileRead(tempm->full_name);
|
||||
st2=st+(tempm->user_data+1-len)+i;
|
||||
st2[len]=0;
|
||||
"%s\n\n%s\n",tempm->full_name,st2;
|
||||
Free(st);
|
||||
}
|
||||
}
|
||||
tempm=tempm->next;
|
||||
}
|
||||
DirTreeDel(tempm1);
|
||||
}
|
||||
|
||||
if (FileFind("::/Home/Wb2/Files/Words/HappyWords.TXT"))
|
||||
GodInit("::/Home/Wb2/Files/Words/HappyWords.TXT");
|
||||
@@ -7,43 +7,31 @@ I64 fg_mode=FG_RAM_DRV;
|
||||
Bool fg_on =FALSE;
|
||||
|
||||
U0 FrameGrabberTask(I64)
|
||||
{//ffmpeg -r 8 -i VID%05d.BMP -y Movie.avi
|
||||
{//#!/bin/bash
|
||||
//for f in ./ScreenShots/*.Z; do ./Bin/TOSZ $$f; done
|
||||
//ffmpeg -r 8 -i VID%05d.BMP -y Movie.avi
|
||||
I64 frame_num=0;
|
||||
U8 buf[STR_LEN],buf2[STR_LEN];
|
||||
U8 buf[STR_LEN],buf2[STR_LEN],*st_dir;
|
||||
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);
|
||||
BMPScreenCapture(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);
|
||||
BMPScreenCapture(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);
|
||||
if (fg_mode==FG_RAM_DRV)
|
||||
st_dir="B:/Temp/ScreenShots";
|
||||
else
|
||||
st_dir="::/Temp/ScreenShots";
|
||||
MkDir(st_dir);
|
||||
while (fg_on) {
|
||||
StrPrint(buf,"%s/VID%05d.BMP.Z",st_dir,frame_num++);
|
||||
StrCpy(buf2,buf);
|
||||
BMPScreenCapture(buf);
|
||||
while (TRUE) {
|
||||
end_time+=1.0/VIDEO_FRAME_RATE;
|
||||
if (end_time<tS) {
|
||||
StrPrint(buf,"%s/VID%05d.BMP.Z",st_dir,frame_num++);
|
||||
Copy(buf2,buf);
|
||||
} else
|
||||
break;
|
||||
}
|
||||
SleepUntil(cnts.jiffies+(end_time-tS)*JIFFY_FREQ);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,17 +40,15 @@ 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);
|
||||
SndFileCreate("D:/Temp/Audio",0.115,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);
|
||||
SndFileCreate("D:/Temp/Audio",0.115,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 {
|
||||
} 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;
|
||||
}
|
||||
@@ -79,7 +65,7 @@ public U0 FrameGrabberToggle()
|
||||
Snd(0);
|
||||
wall->record=snd.record=FALSE;
|
||||
Sleep(1000);
|
||||
CopyVideo;
|
||||
User("CopyVideo;Exit;\n");
|
||||
} else {
|
||||
fg_on=TRUE;
|
||||
if (fg_mode!=FG_JUST_AUDIO)
|
||||
@@ -160,11 +146,11 @@ public U0 BMP2TXT(U8 *_in_name,U8 *_out_name=NULL)
|
||||
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");
|
||||
in_name=DftExt(_in_name,"BMP");
|
||||
if (_out_name)
|
||||
out_name=DftExt(_out_name,"TXT.Z");
|
||||
else
|
||||
out_name=ChgExt(_in_name,"TXT.Z");
|
||||
out_name=ChgExt(_in_name,"TXT.Z");
|
||||
if (dc=BMPRead(in_name)) {
|
||||
for (dy=-3;dy<=4;dy++)
|
||||
for (dx=-3;dx<=4;dx++) {
|
||||
@@ -278,11 +264,11 @@ U0 AfterEgyptInAction()
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Adam("GodInit(\"/Adam/God/Vocab.TXT*\");");
|
||||
AutoComplete;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
if (!fg_on)
|
||||
PopUp("Sleep(50);FrameGrabberToggle;");
|
||||
Ed("::/Home/Archive/AfterEgypt.TXT.Z");
|
||||
Ed("::/Home/Videos/AfterEgypt.TXT.Z");
|
||||
Msg(MSG_KEY_DOWN_UP,CH_SPACE,0x3900000039); //<SPACE>
|
||||
ExeFile("::/Apps/AfterEgypt/Run");
|
||||
SettingsPop;
|
||||
@@ -294,17 +280,25 @@ U0 CodeWalkThru()
|
||||
{
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
AutoComplete;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
if (!fg_on)
|
||||
PopUp("Sleep(50);FrameGrabberToggle;");
|
||||
Ed("::/Home/Archive/RandomCode.TXT.Z");
|
||||
Ed("::/Home/Videos/RandomCode.TXT.Z");
|
||||
SettingsPop;
|
||||
Msg(MSG_KEY_DOWN_UP,'b',0x83000000830); //<ALT-b>
|
||||
tos_code_walk_thru++;
|
||||
TOSRegWrite;
|
||||
}
|
||||
|
||||
U0 TempleOSTheme()
|
||||
{
|
||||
if (!fg_on)
|
||||
PopUp("Sleep(50);FrameGrabberToggle;");
|
||||
ExeFile("::/Home/Wb2/Files/TempleOSTheme.CPP");
|
||||
DocClear;
|
||||
}
|
||||
|
||||
U0 TOSJukeVideo(I64 start=0,I64 end=10)
|
||||
{
|
||||
U8 *buf=FileRead("::/Misc/Bible.TXT.Z"); //Put in cache
|
||||
|
||||
@@ -119,7 +119,6 @@
|
||||
#define IC_ASM 0x61
|
||||
#define IC_CLI 0x62
|
||||
#define IC_STI 0x63
|
||||
#define IC_PREEMPT 0x64
|
||||
#define IC_CLD 0x65
|
||||
#define IC_STD 0x66
|
||||
#define IC_HLT 0x67
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ U0 DumpStruct(U8 *_d,U8 *class_name=lastclass)
|
||||
F64 percentile;
|
||||
if (!tempc) return;
|
||||
CMemberLst *ml;
|
||||
ml=tempc->member_lst;
|
||||
ml=tempc->member_lst_and_root;
|
||||
while (ml) {
|
||||
"%s:",ml->str;
|
||||
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
/*Uses $LK,"DocPrint",A="MN:DocPrint"$() because updates
|
||||
to within a tree while a tree is collapsed get
|
||||
messed-up if "live" (like using ordinary Print.)
|
||||
The insert point is confused by hiding of
|
||||
data in collapsed trees. Therefore, the window main
|
||||
Doc is taken off-line by disabling preemption so there
|
||||
are no screen updates until all data has been inserted.
|
||||
|
||||
There is a special Doc function which is also
|
||||
available to take an Doc off-line. See $LK,"DocPrintAtomic",A="MN:DocPrintAtomic"$.
|
||||
For this example, however, I wanted to use DocPrint
|
||||
and disabled Preemption myself.
|
||||
*/
|
||||
|
||||
U0 TreeSub(CDoc *doc,CDirEntry *tempde)
|
||||
{
|
||||
CDirEntry *tempde1;
|
||||
|
||||
@@ -20,9 +20,6 @@ U0 UnusedDefineScan()
|
||||
CDocEntry *doc_e,*doc_e2;
|
||||
Bool old_silent=IsSilent;
|
||||
|
||||
//Technically, we might want to
|
||||
//turn-off preemption in case the
|
||||
//table were modified.
|
||||
try {
|
||||
table=Fs->hash_table;
|
||||
while (table) {
|
||||
|
||||
@@ -2,9 +2,10 @@ U0 BlkDevRep()
|
||||
{//Block Device Report.
|
||||
I64 i;
|
||||
for (i=0;i<NUM_BLKDEVS;i++)
|
||||
if (dsk.blkdevs[i].bd_signature==BD_SIGNATURE_VAL)
|
||||
ClassRep(&dsk.blkdevs[i]);//$LK,"ClassRep",A="MN:ClassRep"$() dumps any structure, automatically.
|
||||
//The lastclass arg tells ClassRep the datatype.
|
||||
if (blkdev.blkdevs[i].bd_signature==BD_SIGNATURE_VAL)
|
||||
//$LK,"ClassRep",A="MN:ClassRep"$() dumps any structure, automatically.
|
||||
ClassRep(&blkdev.blkdevs[i]);
|
||||
//The lastclass arg tells ClassRep the datatype.
|
||||
//lastclass is a language feature of $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$.
|
||||
//See $LK,"::/Demo/LastClass.CPP"$.
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -186,6 +186,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
Mat4x4RotX(r3,-ã/2);
|
||||
Mat4x4Scale(r3,PLANT_SCALE);
|
||||
|
||||
Seed(1);
|
||||
x1h=man_xx+yh*PLOT_GRID_WIDTH/2+xh*(PLOT_GRID_HEIGHT-1);
|
||||
y1h=man_yy-xh*PLOT_GRID_WIDTH/2+yh*(PLOT_GRID_HEIGHT-1);
|
||||
xh>>=1; yh>>=1;
|
||||
@@ -370,6 +371,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
GrPrint(dc,0,0,"Enemy:%d Time:%3.2f Best:%3.2f",
|
||||
monsters_left,tt-t0,best_score);
|
||||
Free(s2w);
|
||||
Seed(0);
|
||||
}
|
||||
|
||||
U0 Fire()
|
||||
@@ -541,14 +543,13 @@ U0 CastleFrankenstein()
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Fs->text_attr=DKGRAY<<4+WHITE;
|
||||
Preempt;
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
AutoComplete;
|
||||
DocCursor;
|
||||
Init;
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs);
|
||||
DocCursor;
|
||||
Fs->draw_it=&DrawIt;
|
||||
|
||||
try {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//Practice tracing circles
|
||||
|
||||
//Giotto, a famous artist, drew a freehand circle as a portfolio for a job.
|
||||
//Giotto, a famous artist, drew a freehand circle to get a job.
|
||||
|
||||
RegSetDftEntry("TempleOS/CircleTrace","F64 best_score=999;\n");
|
||||
RegExeBranch("TempleOS/CircleTrace");
|
||||
@@ -42,13 +42,15 @@ U0 CircleTrace()
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs);
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
|
||||
cx=Fs->pix_width/2;
|
||||
cy=Fs->pix_height/2;
|
||||
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_BORDER;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Fs->draw_it=&DrawIt;
|
||||
|
||||
DCFill;
|
||||
|
||||
Binary file not shown.
@@ -334,13 +334,13 @@ U0 DunGen()
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Fs->text_attr=BLACK<<4+WHITE;
|
||||
Preempt;
|
||||
WinMax;
|
||||
AutoComplete;
|
||||
Init;
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Init;
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
Fs->draw_it=&DrawIt;
|
||||
|
||||
try {
|
||||
|
||||
+18
-16
@@ -500,7 +500,6 @@ U0 MPDrawIt(CTask *task,CDC *dc)
|
||||
U0 APEagleDiveTask(CTask *master_task)
|
||||
{
|
||||
CDC *dc=DCAlias(main_dc,master_task);
|
||||
Preempt(ON);
|
||||
while (!mp.app_done) {
|
||||
while (!Bt(&mp.update_not_done_flags,Gs->num) && !mp.app_done)
|
||||
Sleep(1);
|
||||
@@ -609,10 +608,8 @@ U0 DrawHorizon(CDC *dc)
|
||||
U0 BSPEagleDive()
|
||||
{
|
||||
CDC *dc=DCAlias(main_dc,Fs);
|
||||
I64 i,xx,yy,height,bkcolor,
|
||||
cx=Fs->pix_width>>1,
|
||||
cy=Fs->pix_height>>1;
|
||||
F64 min_strip_width;
|
||||
I64 i,xx,yy,height,bkcolor,cx=Fs->pix_width>>1,cy=Fs->pix_height>>1;
|
||||
F64 min_strip_width,roll,pitch,heading;
|
||||
Fish *tempf;
|
||||
|
||||
update_jiffy_limit=cnts.jiffies+JIFFY_FREQ/40;
|
||||
@@ -673,13 +670,18 @@ U0 BSPEagleDive()
|
||||
dc->flags&=~DCF_TRANSFORMATION;
|
||||
GrLine3(dc,cx+5,cy,0,cx-5,cy,0);
|
||||
GrLine3(dc,cx,cy+5,0,cx,cy-5,0);
|
||||
GrPrint(dc,0,0,"é1:%5.1f è:%5.1f é2:%5.1f Strip:%5d",
|
||||
é1*180/ã,è*180/ã,é2*180/ã,strip_height);
|
||||
GrPrint(dc,0,FONT_HEIGHT,
|
||||
"x:%5.1f y:%5.1f z:%5.1f height:%3d score:%d high:%d",
|
||||
ToF64(x)/COORDINATE_SCALE,
|
||||
ToF64(y)/COORDINATE_SCALE,ToF64(z)/COORDINATE_SCALE,
|
||||
height,game_score,best_score);
|
||||
heading=Wrap(é2,0);
|
||||
roll=é1;
|
||||
pitch=Wrap(-è-ã/2,-ã);
|
||||
if (Abs(pitch)>ã/2) {
|
||||
pitch=Wrap(ã-pitch,-ã);
|
||||
roll=Wrap(roll+ã,-ã);
|
||||
heading=Wrap(heading+ã,0);
|
||||
}
|
||||
GrPrint(dc,0,0,"Roll:%5.1f Pitch:%5.1f Heading:%5.1f",
|
||||
roll*180/ã,pitch*180/ã,heading*180/ã);
|
||||
GrPrint(dc,0,FONT_HEIGHT,"Height:%5d Score:%d High:%d [Core Strip:%3d]",
|
||||
height,game_score,best_score,strip_height);
|
||||
|
||||
if (game_over && Blink) {
|
||||
dc->color=RED;
|
||||
@@ -840,7 +842,6 @@ U0 EagleDive(I64 _mp_cnt=MP_MAX_PROCESSORS)
|
||||
F64 pp,tt1,tt2;
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
AutoComplete;
|
||||
MenuPush(
|
||||
"File {"
|
||||
" Abort(,CH_SHIFT_ESC);"
|
||||
@@ -854,14 +855,15 @@ U0 EagleDive(I64 _mp_cnt=MP_MAX_PROCESSORS)
|
||||
" Right(,,SC_CURSOR_RIGHT);"
|
||||
"}"
|
||||
);
|
||||
WinMax;
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
"Initializing...\n";
|
||||
Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs);
|
||||
Init(_mp_cnt);
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Fs->draw_it=&DrawIt;
|
||||
try //in case <CTRL-ALT-c> is pressed.
|
||||
do {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -162,7 +162,6 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
F64 d,cur_time=tS;
|
||||
Obj *tempo;
|
||||
Torpedo *tempt;
|
||||
Bool old_preempt=Preempt;
|
||||
|
||||
tempt=torpedo_root.next;
|
||||
while (tempt!=&torpedo_root) {
|
||||
@@ -272,7 +271,6 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
task->pix_height>>1-FONT_HEIGHT/2-task->scroll_y,"Game Over");
|
||||
}
|
||||
}
|
||||
Preempt(old_preempt);
|
||||
}
|
||||
|
||||
U0 Init()
|
||||
@@ -693,7 +691,7 @@ U0 Combat(F64 period)
|
||||
|
||||
#define ANIMATE_FREQ 50
|
||||
U0 AnimateTask(I64)
|
||||
{//Preemption is off after Spawn
|
||||
{
|
||||
Obj *tempo;
|
||||
Torpedo *tempt,*tempt1;
|
||||
F64 d,period;
|
||||
@@ -787,17 +785,16 @@ U0 FlatTops()
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Fs->text_attr=BLUE<<4+WHITE;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
PopUpOk("$$GREEN$${Left-Mouse}$$FG$$\t\tChange Course\n"
|
||||
"$$GREEN$${Right-Mouse}$$FG$$\t\tLaunch Squadron\n"
|
||||
"$$GREEN$${Right-Double-Mouse}$$FG$$\tReturn Squadron\n"
|
||||
"$$GREEN$${Ctrl-Left Grab}$$FG$$\tScroll Screen\n");
|
||||
Preempt,
|
||||
MenuPush(
|
||||
MenuPush(
|
||||
"File {"
|
||||
" Abort(,CH_SHIFT_ESC);"
|
||||
" Exit(,CH_ESC);"
|
||||
|
||||
@@ -12,7 +12,6 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
{
|
||||
I64 w=task->pix_width,h=task->pix_height;
|
||||
I64 i,x,y,xx;
|
||||
Bool old_preempt=Preempt;
|
||||
xx=w>>1-car_x+road_x[road_ptr&(NUM_ROAD-1)];
|
||||
|
||||
dc->color=LTGRAY;
|
||||
@@ -40,7 +39,6 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
dc->color=YELLOW;
|
||||
if (crash)
|
||||
GrPrint(dc,w>>1-FONT_WIDTH*4,(h-FONT_HEIGHT)>>1,"Game Over");
|
||||
Preempt(old_preempt);
|
||||
}
|
||||
|
||||
U0 UpdateRoad()
|
||||
@@ -94,11 +92,11 @@ U0 Halogen()
|
||||
" Right(,,SC_CURSOR_RIGHT);"
|
||||
"}"
|
||||
);
|
||||
Preempt;
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
Init;
|
||||
DocCursor;
|
||||
Init;
|
||||
Fs->draw_it=&DrawIt;
|
||||
try {
|
||||
while (TRUE) {
|
||||
|
||||
@@ -107,24 +107,13 @@ U0 MassSpringDemo()
|
||||
"connect with spring.\n\n"
|
||||
"Springs are 100 pixs long.\n");
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
|
||||
/*Preempt eliminates a lot of hassles.
|
||||
The concern is about changing
|
||||
que links while the winmgr task
|
||||
is updating the ode or screen.
|
||||
|
||||
The Window mgr suspends this
|
||||
task while updating the ode. It
|
||||
will not be interrupted and with this
|
||||
preempt, we will not be interrupted.
|
||||
There is little downside to Preempt()
|
||||
since we will yield during GetMsg().
|
||||
*/
|
||||
Preempt;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
|
||||
Fs->win_inhibit|=WIG_DBL_CLICK;
|
||||
AutoComplete;
|
||||
|
||||
MenuPush(
|
||||
"File {"
|
||||
@@ -137,8 +126,6 @@ since we will yield during GetMsg().
|
||||
);
|
||||
|
||||
Init;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Fs->draw_it=&DrawIt;
|
||||
|
||||
try {
|
||||
|
||||
+2
-2
@@ -79,9 +79,9 @@ U0 Maze()
|
||||
I64 ch,x,y;
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
WinMax;
|
||||
WinBorder;
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Fs->draw_it=&DrawIt;
|
||||
|
||||
@@ -56,13 +56,11 @@ U0 DrawDrops(CTask *,CDC *dc)
|
||||
|
||||
U0 UpdateCurBase(CTask *task,CDC *dc)
|
||||
{
|
||||
Bool old_preempt=Preempt;
|
||||
cur_dc->color=ROP_EQU;
|
||||
dc->flags|=DCF_NO_TRANSPARENTS;
|
||||
GrBlot(cur_dc,-task->pix_left-task->scroll_x,
|
||||
-task->pix_top-task->scroll_y,dc);
|
||||
dc->flags&=~DCF_NO_TRANSPARENTS;
|
||||
Preempt(old_preempt);
|
||||
}
|
||||
|
||||
U0 DrawIt(CTask *task,CDC *dc)
|
||||
@@ -162,16 +160,17 @@ U0 RainDrops()
|
||||
"}"
|
||||
);
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
cur_dc=DCNew(GR_WIDTH,GR_HEIGHT);
|
||||
sc_1=Char2ScanCode('1');
|
||||
sc_2=Char2ScanCode('2');
|
||||
Init;
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Fs->draw_it=&DrawIt;
|
||||
AutoComplete;
|
||||
try {
|
||||
do
|
||||
switch (ch=GetKey(&sc)) {
|
||||
|
||||
+66
-13
@@ -13,6 +13,10 @@ I64 outside_cnt;
|
||||
#define MAP_BORDER 3
|
||||
CDC *map_dc;
|
||||
|
||||
#define GATE_WIDTH 22
|
||||
#define GATE_HEIGHT 7
|
||||
F64 gate_é,gate_t;
|
||||
|
||||
$BG,10$#define GE_COW 0
|
||||
|
||||
|
||||
@@ -153,8 +157,7 @@ U0 RiverDropsNext(CTask *mem_task)
|
||||
Free(tempr);
|
||||
} else {
|
||||
do {
|
||||
if (RandU16&1 &&
|
||||
GrPeek(map_dc,r_x[tempr->index]+tempr->dx,
|
||||
if (RandU16&1 && GrPeek(map_dc,r_x[tempr->index]+tempr->dx,
|
||||
r_y[tempr->index]+tempr->dy)==BLUE)
|
||||
break;
|
||||
tempr->dx=ClampI64(tempr->dx+RandU16%3-1,-r_width[tempr->index]/2,
|
||||
@@ -271,6 +274,52 @@ U0 BuddySelect(I64 i)
|
||||
a[i].buddy=best_b;
|
||||
}
|
||||
|
||||
|
||||
U0 RedrawGate()
|
||||
{
|
||||
F64 tt=tS-gate_t;
|
||||
I64 x1=FENCE_WIDTH-63,y1=FENCE_HEIGHT-1,dx,dy;
|
||||
|
||||
if (tt<0.5)
|
||||
gate_é=Clamp(gate_é+0.02,0,ă/2);
|
||||
else if (tt>5.0)
|
||||
gate_é=Clamp(gate_é-0.02,0,ă/2);
|
||||
|
||||
dx=GATE_WIDTH*Cos(gate_é); dy=-0.8*GATE_WIDTH*Sin(gate_é);
|
||||
|
||||
map_dc->color=LTGREEN;
|
||||
GrRect(map_dc,x1,y1-0.8*GATE_WIDTH-GATE_HEIGHT,
|
||||
46,0.8*GATE_WIDTH+GATE_HEIGHT+3);
|
||||
|
||||
map_dc->color=BLACK;
|
||||
|
||||
GrLine(map_dc,x1,y1,x1+dx,y1+dy);
|
||||
GrLine(map_dc,x1,y1,x1,y1-GATE_HEIGHT);
|
||||
GrLine(map_dc,x1+dx,y1+dy,x1+dx,y1+dy-GATE_HEIGHT);
|
||||
GrLine(map_dc,x1,y1-GATE_HEIGHT,x1+dx,y1+dy-GATE_HEIGHT);
|
||||
GrLine(map_dc,x1,y1,x1+dx,y1+dy-GATE_HEIGHT);
|
||||
GrLine(map_dc,x1,y1-GATE_HEIGHT,x1+dx,y1+dy);
|
||||
|
||||
GrLine(map_dc,x1+45,y1,x1+45-dx,y1+dy);
|
||||
GrLine(map_dc,x1+45,y1,x1+45,y1-GATE_HEIGHT);
|
||||
GrLine(map_dc,x1+45-dx,y1+dy,x1+45-dx,y1+dy-GATE_HEIGHT);
|
||||
GrLine(map_dc,x1+45,y1-GATE_HEIGHT,x1+45-dx,y1+dy-GATE_HEIGHT);
|
||||
GrLine(map_dc,x1+45,y1,x1+45-dx,y1+dy-GATE_HEIGHT);
|
||||
GrLine(map_dc,x1+45,y1-GATE_HEIGHT,x1+45-dx,y1+dy);
|
||||
}
|
||||
|
||||
Bool CheckMap(I64 x,I64 y)
|
||||
{
|
||||
I64 i,j,c;
|
||||
for (j=-4;j<=2;j++)
|
||||
for (i=-4;i<=4;i++) {
|
||||
c=GrPeek(map_dc,x+i,y+j);
|
||||
if (c==LTGRAY || c==BLACK)
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
U0 AnimateTask(CTask *parent)
|
||||
{
|
||||
I64 i,cx,cy,cursor_x,cursor_y,dd,ddx,ddy,cnt,max_speed=MAX_I64,updates=0,
|
||||
@@ -285,6 +334,9 @@ U0 AnimateTask(CTask *parent)
|
||||
cursor_y=ip.pos.y+cy-parent->pix_top -parent->scroll_y;
|
||||
cnt=0;stress=0;
|
||||
my_outside_cnt=0;
|
||||
if (cursor_x<FENCE_WIDTH && cursor_y<FENCE_HEIGHT)
|
||||
gate_t=tS;
|
||||
RedrawGate;
|
||||
for (i=0;i<NUM_ANIMALS;i++) {
|
||||
tempa=&a[i];
|
||||
if (!tempa->dead) {
|
||||
@@ -335,8 +387,7 @@ U0 AnimateTask(CTask *parent)
|
||||
tempa->dy/=2;
|
||||
}
|
||||
|
||||
if (GrPeek(map_dc,(tempa->x+tempa->dx)>>32,(tempa->y+tempa->dy)>>32)
|
||||
!=LTGRAY) {
|
||||
if (CheckMap((tempa->x+tempa->dx)>>32,(tempa->y+tempa->dy)>>32)) {
|
||||
tempa->x+=tempa->dx;
|
||||
tempa->y+=tempa->dy;
|
||||
}
|
||||
@@ -420,9 +471,7 @@ U0 ReInit()
|
||||
GrLine(map_dc,FENCE_WIDTH-1,i,FENCE_WIDTH-1,i+7);
|
||||
map_dc->color=LTGRAY;
|
||||
GrLine(map_dc,FENCE_WIDTH,0,FENCE_WIDTH,FENCE_HEIGHT-6);
|
||||
|
||||
map_dc->color=LTGREEN;
|
||||
GrRect(map_dc,FENCE_WIDTH-63,FENCE_HEIGHT-8,46,9);
|
||||
RedrawGate;
|
||||
|
||||
map_dc->pen_width=MAP_BORDER;
|
||||
map_dc->color=RED;
|
||||
@@ -435,8 +484,10 @@ U0 ReInit()
|
||||
MemSet(a,0,NUM_ANIMALS*sizeof(Animal));
|
||||
for (i=0;i<NUM_ANIMALS;i++) {
|
||||
a[i].num=i;
|
||||
a[i].x=(64+RandU32%(MAP_WIDTH-128))<<32;
|
||||
a[i].y=(64+RandU32%(MAP_WIDTH-128))<<32;
|
||||
do {
|
||||
a[i].x=(64+RandU32%(MAP_WIDTH-128))<<32;
|
||||
a[i].y=(64+RandU32%(MAP_WIDTH-128))<<32;
|
||||
} while (!CheckMap(a[i].x>>32,a[i].y>>32));
|
||||
if (i&1)
|
||||
a[i].ge=&rh_sprite[GE_COW];
|
||||
else
|
||||
@@ -444,6 +495,8 @@ U0 ReInit()
|
||||
BuddySelect(i);
|
||||
}
|
||||
outside_cnt=NUM_ANIMALS;
|
||||
gate_t=0;
|
||||
gate_é=0;
|
||||
t0=tS;
|
||||
tf=0;
|
||||
}
|
||||
@@ -497,13 +550,13 @@ U0 RawHide()
|
||||
Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs);
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS
|
||||
-WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL-WIF_FOCUS_TASK_MENU;
|
||||
WinMax;
|
||||
AutoComplete;
|
||||
Preempt;
|
||||
Init;
|
||||
Fs->animate_task=Spawn(&AnimateTask,Fs,"Animate",,Fs);
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Init;
|
||||
Fs->animate_task=Spawn(&AnimateTask,Fs,"Animate",,Fs);
|
||||
Fs->draw_it=&DrawIt;
|
||||
try {
|
||||
while (TRUE) {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -6,13 +6,13 @@ U0 StadiumGen()
|
||||
CDC *dc,*dc2;
|
||||
|
||||
Cd(__DIR__);
|
||||
WinMax;
|
||||
WinBorder;
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocCursor(OFF);
|
||||
DocClear;
|
||||
Type("StadiumBG.TXT");
|
||||
"$$CM,0,%d$$",TEXT_ROWS-3;
|
||||
DocCursor(OFF);
|
||||
fp_old_update=gr.fp_final_screen_update; //hide mouse cursor
|
||||
gr.fp_final_screen_update=NULL;
|
||||
|
||||
|
||||
Binary file not shown.
@@ -204,12 +204,15 @@ CDC *DrawHexMap(I64 *_w,I64 *_h)
|
||||
U0 Init()
|
||||
{
|
||||
I64 i,j,j1,j2,dd,best_dd,best,w=Fs->pix_width,h=Fs->pix_height;
|
||||
|
||||
map_dc=DrawHexMap(&w,&h);
|
||||
cur_player=0;
|
||||
|
||||
for (i=0;i<NUM_UNITS/2;i++) {
|
||||
u[i].num=i;
|
||||
u[i+NUM_UNITS/2].num=i+NUM_UNITS/2;
|
||||
|
||||
ti_restart:
|
||||
u[i].y=FloorI64(RandU32%h,CIRCLE_RAD*2)+CIRCLE_RAD;
|
||||
u[i+NUM_UNITS/2].y=h-1-u[i].y;
|
||||
j1=u[i].y/(CIRCLE_RAD*2);
|
||||
@@ -217,11 +220,14 @@ U0 Init()
|
||||
u[i].y+=BORDER_Y;
|
||||
u[i+NUM_UNITS/2].y+=BORDER_Y;
|
||||
|
||||
if (!i)
|
||||
if (!i) {
|
||||
u[i].x=CIRCLE_RAD;
|
||||
else
|
||||
if (j1&1)
|
||||
goto ti_restart;
|
||||
} else
|
||||
u[i].x=FloorI64(RandU32%((w-CIRCLE_RAD*2*2)/2),CIRCLE_RAD*2)+CIRCLE_RAD;
|
||||
u[i+NUM_UNITS/2].x=w-1-u[i].x;
|
||||
|
||||
if (j1&1)
|
||||
u[i].x+=CIRCLE_RAD;
|
||||
if (j2&1)
|
||||
@@ -281,7 +287,6 @@ U0 TreeCheckers()
|
||||
Unit *tempu;
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Preempt;
|
||||
MenuPush(
|
||||
"File {"
|
||||
" Abort(,CH_SHIFT_ESC);"
|
||||
@@ -291,10 +296,9 @@ U0 TreeCheckers()
|
||||
" Restart(,'\n');"
|
||||
"}"
|
||||
);
|
||||
WinMax;
|
||||
WinBorder;
|
||||
AutoComplete;
|
||||
Preempt;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
PopUpOk("Step on the link mid points.\n");
|
||||
|
||||
+319
-130
@@ -93,6 +93,29 @@ RegExeBranch("TempleOS/Varoom");
|
||||
F64 distance,t0,tf;
|
||||
Bool game_over;
|
||||
|
||||
#define BORDER 7500
|
||||
#define R 10000
|
||||
#define WIDTH 2000
|
||||
#define SHOULDER 200
|
||||
#define D_é (2*ã/360) //Curve track slice is one degree.
|
||||
#define D_S (2*ã*R/360) //Straight track slice is degree at 10000.
|
||||
#define DIPS 5
|
||||
#define DIP_DEPTH 50
|
||||
class Track
|
||||
{
|
||||
Track *next,*last;
|
||||
I32 num;
|
||||
CColorROPU16 c,pad;
|
||||
I64 x,z;
|
||||
F64 é,d;
|
||||
CD3I32 left[4],center[4],right[4];
|
||||
} track_root,
|
||||
*track_start[MP_MAX_PROCESSORS],*track_end[MP_MAX_PROCESSORS];
|
||||
|
||||
CDC *track_map;
|
||||
#define MAP_BITS 9
|
||||
I64 t_minx,t_maxx,t_minz,t_maxz;
|
||||
|
||||
#define NUM_BUSHES 512
|
||||
class Bush
|
||||
{
|
||||
@@ -105,29 +128,16 @@ class Bush
|
||||
class Car
|
||||
{
|
||||
CD3I32 p;
|
||||
F64 é,speed;
|
||||
F64 é,dé,speed;
|
||||
CSprite *img;
|
||||
Track *t;
|
||||
} c[NUM_CARS];
|
||||
|
||||
#define TRACK_INNER 16000
|
||||
#define TRACK_OUTER 18000
|
||||
#define SHOULDER 200
|
||||
#define SLICES 500
|
||||
#define D_é (2*ã/SLICES)
|
||||
#define TRACK_POLYS (3*SLICES)
|
||||
#define DIPS 5
|
||||
#define DIP_DEPTH 100
|
||||
class TrackPoly
|
||||
{
|
||||
CColorROPU16 c,pad[3];
|
||||
CD3I32 p[4];
|
||||
} track[TRACK_POLYS];
|
||||
|
||||
I64 DipY(I64 x,I64 z)
|
||||
{
|
||||
F64 m,a;
|
||||
R2P(&m,&a,x,z);
|
||||
return DIP_DEPTH*m*Cos(DIPS*a)/((TRACK_INNER+TRACK_OUTER)/2);
|
||||
return DIP_DEPTH*m*Cos(DIPS*a)/R;
|
||||
}
|
||||
|
||||
#define CAR_LENGTH 400
|
||||
@@ -140,62 +150,210 @@ F64 Dip
|
||||
return ASin((y_front-y_back)/CAR_LENGTH);
|
||||
}
|
||||
|
||||
U0 InitTrackPoly(TrackPoly *tempt,CColorROPU16 c,
|
||||
I64 inner,I64 outer,F64 é1,F64 é2)
|
||||
Track *TrackFind(Track *_tempt,I64 x,I64 z)
|
||||
{
|
||||
tempt->c=c;
|
||||
tempt->p[0].x=inner*Cos(é1);
|
||||
tempt->p[0].z=inner*Sin(é1);
|
||||
tempt->p[0].y=DipY(tempt->p[0].x,tempt->p[0].z);
|
||||
tempt->p[1].x=outer*Cos(é1);
|
||||
tempt->p[1].z=outer*Sin(é1);
|
||||
tempt->p[1].y=DipY(tempt->p[1].x,tempt->p[1].z);
|
||||
tempt->p[2].x=outer*Cos(é2);
|
||||
tempt->p[2].z=outer*Sin(é2);
|
||||
tempt->p[2].y=DipY(tempt->p[2].x,tempt->p[2].z);
|
||||
tempt->p[3].x=inner*Cos(é2);
|
||||
tempt->p[3].z=inner*Sin(é2);
|
||||
tempt->p[3].y=DipY(tempt->p[3].x,tempt->p[3].z);
|
||||
Track *result=_tempt,*tempt;
|
||||
I64 dd,best=SqrI64(result->x-x)+SqrI64(result->z-z);
|
||||
|
||||
tempt=_tempt;
|
||||
while (TRUE) {
|
||||
tempt=tempt->next;
|
||||
if (tempt==&track_root)
|
||||
tempt=tempt->next;
|
||||
dd=SqrI64(tempt->x-x)+SqrI64(tempt->z-z);
|
||||
if (dd<best) {
|
||||
best=dd;
|
||||
result=tempt;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
tempt=_tempt;
|
||||
while (TRUE) {
|
||||
tempt=tempt->last;
|
||||
if (tempt==&track_root)
|
||||
tempt=tempt->last;
|
||||
dd=SqrI64(tempt->x-x)+SqrI64(tempt->z-z);
|
||||
if (dd<best) {
|
||||
best=dd;
|
||||
result=tempt;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
U0 TrackSlice(F64 *_x,F64 *_z,F64 é,F64 d)
|
||||
{
|
||||
F64 x=*_x,z=*_z,c=Cos(é),s=Sin(é),dx=d*s,dz=-d*c;
|
||||
Track *tempt,*last=track_root.last;
|
||||
if (last==&track_root)
|
||||
last=NULL;
|
||||
|
||||
tempt=CAlloc(sizeof(Track));
|
||||
if (last) {
|
||||
MemCpy(&tempt->center[0],&last->center[3],sizeof(CD3I32));
|
||||
MemCpy(&tempt->center[1],&last->center[2],sizeof(CD3I32));
|
||||
}
|
||||
tempt->center[2].x=x+(WIDTH/2)*c+dx;
|
||||
tempt->center[2].z=z+(WIDTH/2)*s+dz;
|
||||
tempt->center[2].y=DipY(tempt->center[2].x,tempt->center[2].z);
|
||||
tempt->center[3].x=x-(WIDTH/2)*c+dx;
|
||||
tempt->center[3].z=z-(WIDTH/2)*s+dz;
|
||||
tempt->center[3].y=DipY(tempt->center[3].x,tempt->center[3].z);
|
||||
|
||||
if (last) {
|
||||
MemCpy(&tempt->left[0],&last->left[3],sizeof(CD3I32));
|
||||
MemCpy(&tempt->left[1],&last->left[2],sizeof(CD3I32));
|
||||
}
|
||||
tempt->left[2].x=x-(WIDTH/2)*c+dx;
|
||||
tempt->left[2].z=z-(WIDTH/2)*s+dz;
|
||||
tempt->left[2].y=DipY(tempt->left[2].x,tempt->left[2].z);
|
||||
tempt->left[3].x=x-(WIDTH/2+SHOULDER)*c+dx;
|
||||
tempt->left[3].z=z-(WIDTH/2+SHOULDER)*s+dz;
|
||||
tempt->left[3].y=DipY(tempt->left[3].x,tempt->left[3].z);
|
||||
|
||||
if (last) {
|
||||
MemCpy(&tempt->right[0],&last->right[3],sizeof(CD3I32));
|
||||
MemCpy(&tempt->right[1],&last->right[2],sizeof(CD3I32));
|
||||
}
|
||||
tempt->right[2].x=x+(WIDTH/2+SHOULDER)*c+dx;
|
||||
tempt->right[2].z=z+(WIDTH/2+SHOULDER)*s+dz;
|
||||
tempt->right[2].y=DipY(tempt->right[2].x,tempt->right[2].z);
|
||||
tempt->right[3].x=x+(WIDTH/2)*c+dx;
|
||||
tempt->right[3].z=z+(WIDTH/2)*s+dz;
|
||||
tempt->right[3].y=DipY(tempt->right[3].x,tempt->right[3].z);
|
||||
|
||||
tempt->x=x;
|
||||
tempt->z=z;
|
||||
tempt->é=é;
|
||||
tempt->num=track_root.last->num+1;
|
||||
tempt->d =track_root.last->d+d;
|
||||
|
||||
QueIns(tempt,track_root.last);
|
||||
|
||||
if (tempt->num&1)
|
||||
tempt->c=RED;
|
||||
else
|
||||
tempt->c=WHITE;
|
||||
|
||||
if (x<t_minx) t_minx=x;
|
||||
if (x>t_maxx) t_maxx=x;
|
||||
if (z<t_minz) t_minz=z;
|
||||
if (z>t_maxz) t_maxz=z;
|
||||
|
||||
x+=dx;
|
||||
*_x=x;
|
||||
z+=dz;
|
||||
*_z=z;
|
||||
|
||||
if (x<t_minx) t_minx=x;
|
||||
if (x>t_maxx) t_maxx=x;
|
||||
if (z<t_minz) t_minz=z;
|
||||
if (z>t_maxz) t_maxz=z;
|
||||
}
|
||||
|
||||
U0 CoupleEnds()
|
||||
{
|
||||
Track *first=track_root.next,*last=track_root.last;
|
||||
MemCpy(&first->center[0],&last->center[3],sizeof(CD3I32));
|
||||
MemCpy(&first->center[1],&last->center[2],sizeof(CD3I32));
|
||||
MemCpy(&first->left[0] ,&last->left[3] ,sizeof(CD3I32));
|
||||
MemCpy(&first->left[1] ,&last->left[2] ,sizeof(CD3I32));
|
||||
MemCpy(&first->right[0] ,&last->right[3] ,sizeof(CD3I32));
|
||||
MemCpy(&first->right[1] ,&last->right[2] ,sizeof(CD3I32));
|
||||
}
|
||||
|
||||
U0 InitTrack()
|
||||
{
|
||||
TrackPoly *tempt=track;
|
||||
I64 i;
|
||||
for (i=0;i<SLICES;i++) {
|
||||
InitTrackPoly(tempt++,DKGRAY,TRACK_INNER,TRACK_OUTER,
|
||||
i*2*ã/SLICES,(i+1)*2*ã/SLICES);
|
||||
if (i&1) {
|
||||
InitTrackPoly(tempt++,RED,TRACK_INNER-SHOULDER,TRACK_INNER,
|
||||
i*2*ã/SLICES,(i+1)*2*ã/SLICES);
|
||||
InitTrackPoly(tempt++,WHITE,TRACK_OUTER,TRACK_OUTER+SHOULDER,
|
||||
i*2*ã/SLICES,(i+1)*2*ã/SLICES);
|
||||
} else {
|
||||
InitTrackPoly(tempt++,WHITE,TRACK_INNER-SHOULDER,TRACK_INNER,
|
||||
i*2*ã/SLICES,(i+1)*2*ã/SLICES);
|
||||
InitTrackPoly(tempt++,RED,TRACK_OUTER,TRACK_OUTER+SHOULDER,
|
||||
i*2*ã/SLICES,(i+1)*2*ã/SLICES);
|
||||
}
|
||||
I64 i,j;
|
||||
Track *tempt;
|
||||
F64 x,z,é,d;
|
||||
|
||||
MemSet(&track_root,0,sizeof(Track));
|
||||
QueInit(&track_root);
|
||||
|
||||
t_minx=t_minz=MAX_I64;
|
||||
t_maxx=t_maxz=MIN_I64;
|
||||
|
||||
x=0; z=0; é=0;
|
||||
for (d=0;d<6*R;d+=D_S)
|
||||
TrackSlice(&x,&z,é,D_S);
|
||||
for (i=0;i<180;i++,é+=D_é)
|
||||
TrackSlice(&x,&z,é,D_é*R);
|
||||
for (d=0;d<R;d+=D_S)
|
||||
TrackSlice(&x,&z,é,D_S);
|
||||
for (i=0;i<90;i++,é-=D_é)
|
||||
TrackSlice(&x,&z,é,D_é*R);
|
||||
for (i=0;i<180;i++,é+=D_é)
|
||||
TrackSlice(&x,&z,é,D_é*R);
|
||||
for (i=0;i<90;i++,é-=D_é)
|
||||
TrackSlice(&x,&z,é,D_é*R);
|
||||
for (d=0;d<R;d+=D_S)
|
||||
TrackSlice(&x,&z,é,D_S);
|
||||
for (i=0;i<180;i++,é+=D_é)
|
||||
TrackSlice(&x,&z,é,D_é*R);
|
||||
|
||||
CoupleEnds;
|
||||
|
||||
tempt=track_root.next;
|
||||
for (i=0;i<mp_cnt;i++) {
|
||||
j=(i+1)*track_root.last->num/mp_cnt+1;
|
||||
track_start[i]=tempt;
|
||||
while (tempt!=&track_root && tempt->num!=j)
|
||||
tempt=tempt->next;
|
||||
track_end[i]=tempt;
|
||||
}
|
||||
|
||||
t_minx-=BORDER; t_minz-=BORDER;
|
||||
t_maxx+=BORDER; t_maxz+=BORDER;
|
||||
track_map=DCNew((t_maxx-t_minx+1<<MAP_BITS-1)>>MAP_BITS,
|
||||
(t_maxz-t_minz+1<<MAP_BITS-1)>>MAP_BITS);
|
||||
|
||||
track_map->color=LTGRAY;
|
||||
GrRect(track_map,0,0,track_map->width,track_map->height);
|
||||
tempt=track_root.next;
|
||||
track_map->color=YELLOW;
|
||||
track_map->pen_width=3;
|
||||
while (tempt!=&track_root) {
|
||||
GrPlot3(track_map,track_map->width-(tempt->x-t_minx)>>MAP_BITS,
|
||||
(tempt->z-t_minz)>>MAP_BITS,0);
|
||||
tempt=tempt->next;
|
||||
}
|
||||
}
|
||||
|
||||
#define HORIZON_DIP 200
|
||||
|
||||
Bool PrepPoly(CD3I32 *p,I64 *r,I64 cx,I64 h,CD3I32 *poly)
|
||||
{
|
||||
I64 x,y,z,i;
|
||||
F64 s;
|
||||
for (i=0;i<4;i++) {
|
||||
x=p[i].x-c[0].p.x;
|
||||
y=p[i].y-c[0].p.y;
|
||||
z=p[i].z-c[0].p.z;
|
||||
Mat4x4MulXYZ(r,&x,&y,&z);
|
||||
s=100.0/(AbsI64(z)+50);
|
||||
poly[i].y=s*y+h;
|
||||
if (z<-200 || !(-h<poly[i].y<2*h))
|
||||
return FALSE;
|
||||
poly[i].x=s*x+cx;
|
||||
poly[i].z=z+GR_Z_ALL;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
I64 mp_not_done_flags;
|
||||
|
||||
U0 MPUpdateWin(CDC *dc2)
|
||||
{
|
||||
CTask *task=dc2->win_task;
|
||||
I64 i,j,x,y,z,lo,hi,
|
||||
w=task->pix_width,
|
||||
h=task->pix_height,r[16],
|
||||
cx=w>>1;
|
||||
F64 s,dip_é=Dipé(c[0].p.x,c[0].p.z,c[0].é);
|
||||
Car *tempc;
|
||||
Bool draw;
|
||||
I64 i,x,y,z,
|
||||
w=task->pix_width,h=task->pix_height,r[16],cx=w>>1;
|
||||
F64 s,dip_é=Dipé(c[0].p.x,c[0].p.z,c[0].é);
|
||||
Car *tempc;
|
||||
CD3I32 poly[4];
|
||||
TrackPoly *tempt;
|
||||
CDC *dc=DCAlias(gr.dc2,task);
|
||||
Track *tempt,*tempt1;
|
||||
CDC *dc=DCAlias(gr.dc2,task);
|
||||
|
||||
Mat4x4IdentEqu(r);
|
||||
Mat4x4RotY(r,ă-c[0].é);
|
||||
@@ -204,27 +362,19 @@ U0 MPUpdateWin(CDC *dc2)
|
||||
dc->depth_buf=dc2->depth_buf;
|
||||
|
||||
//Track
|
||||
lo=Gs->num*TRACK_POLYS/mp_cnt;
|
||||
hi=(Gs->num+1)*TRACK_POLYS/mp_cnt;
|
||||
for (i=lo,tempt=&track[lo];i<hi;i++,tempt++) {
|
||||
dc->color=tempt->c;
|
||||
draw=TRUE;
|
||||
for (j=0;j<4;j++) {
|
||||
x=tempt->p[j].x-c[0].p.x;
|
||||
y=tempt->p[j].y-c[0].p.y;
|
||||
z=tempt->p[j].z-c[0].p.z;
|
||||
Mat4x4MulXYZ(r,&x,&y,&z);
|
||||
s=100.0/(AbsI64(z)+50);
|
||||
poly[j].y=s*y+h;
|
||||
if (z<-200 || !(-h<poly[j].y<2*h)) {
|
||||
draw=FALSE;
|
||||
break;
|
||||
}
|
||||
poly[j].x=s*x+cx;
|
||||
poly[j].z=z+GR_Z_ALL;
|
||||
}
|
||||
if (draw)
|
||||
tempt =track_start[Gs->num];
|
||||
tempt1=track_end [Gs->num];
|
||||
while (tempt!=tempt1) {
|
||||
dc->color=DKGRAY;
|
||||
if (PrepPoly(&tempt->center,r,cx,h,poly)) {
|
||||
GrFillPoly3(dc,4,poly);
|
||||
dc->color=tempt->c;
|
||||
if (PrepPoly(&tempt->left,r,cx,h,poly))
|
||||
GrFillPoly3(dc,4,poly);
|
||||
if (PrepPoly(&tempt->right,r,cx,h,poly))
|
||||
GrFillPoly3(dc,4,poly);
|
||||
}
|
||||
tempt=tempt->next;
|
||||
}
|
||||
|
||||
dc->flags|=DCF_TRANSFORMATION;
|
||||
@@ -278,11 +428,12 @@ U0 VRTransform(CDC *dc,I64 *x,I64 *y,I64 *z)
|
||||
|
||||
U0 DrawIt(CTask *task,CDC *dc)
|
||||
{
|
||||
I64 i,x,y,z,
|
||||
I64 i,x,y,z,
|
||||
w=task->pix_width,
|
||||
h=task->pix_height,r[16],
|
||||
cx=w>>1;
|
||||
F64 s,è,dip_é=Dipé(c[0].p.x,c[0].p.z,c[0].é);
|
||||
F64 s,dip_é=Dipé(c[0].p.x,c[0].p.z,c[0].é);
|
||||
Car *tempc=&c[0];
|
||||
|
||||
dc->color=LTCYAN;
|
||||
GrRect(dc,0,0,w,HORIZON_DIP*Sin(dip_é)+FONT_HEIGHT*4.5);
|
||||
@@ -310,14 +461,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
while (mp_not_done_flags)
|
||||
Yield;
|
||||
|
||||
if (Bt(kbd.down_bitmap,SC_CURSOR_LEFT))
|
||||
è=-0.5;
|
||||
else if (Bt(kbd.down_bitmap,SC_CURSOR_RIGHT))
|
||||
è=0.5;
|
||||
else
|
||||
è=0;
|
||||
Mat4x4IdentEqu(r);
|
||||
Mat4x4RotY(r,è);
|
||||
Mat4x4RotY(r,tempc->dé);
|
||||
Mat4x4RotX(r,0.4-8*dip_é); //Made this up
|
||||
dc->transform=&VRTransform;
|
||||
dc->x=task->pix_width>>1;
|
||||
@@ -326,12 +471,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
SpriteMat3B(dc,0,0,-100,c[0].img,r);
|
||||
|
||||
//Map
|
||||
dc->color=LTGRAY;
|
||||
GrRect(dc,w-64,h-64,64,64);
|
||||
dc->color=LTGREEN;
|
||||
for (i=0;i<NUM_BUSHES;i++)
|
||||
GrPlot(dc,w-64+64*(0x5000-b[i].p.x)/0xA000,
|
||||
h-64*(-b[i].p.z+0x5000)/0xA000);
|
||||
GrBlot(dc,w-track_map->width,h-track_map->height,track_map);
|
||||
|
||||
dc->pen_width=2;
|
||||
for (i=0;i<NUM_CARS;i++) {
|
||||
@@ -339,8 +479,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
dc->color=LTPURPLE;
|
||||
else
|
||||
dc->color=LTCYAN;
|
||||
GrPlot3(dc,w-64+64*(0x5000-c[i].p.x)/0xA000,
|
||||
h-64*(-c[i].p.z+0x5000)/0xA000,0);
|
||||
GrPlot3(dc,w-(c[i].p.x-t_minx)>>MAP_BITS,
|
||||
h-track_map->height+(c[i].p.z-t_minz)>>MAP_BITS,0);
|
||||
}
|
||||
|
||||
if (game_over) {
|
||||
@@ -357,44 +497,58 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
} else
|
||||
s=tS-t0;
|
||||
dc->color=BLACK;
|
||||
GrPrint(dc,0,0,"é:%0.1f %0.1f%% Time:%0.2f Best:%0.2f",
|
||||
180+180/ã*Arg(c[0].p.x,c[0].p.z),
|
||||
100.0*distance/(2*ã*TRACK_INNER),s,best_score);
|
||||
GrPrint(dc,0,0,"%0.1f%% Time:%0.2f Best:%0.2f",
|
||||
100.0*distance/track_root.last->d,s,best_score);
|
||||
}
|
||||
|
||||
U0 AnimateTask(I64)
|
||||
{
|
||||
Car *tempc;
|
||||
I64 i;
|
||||
F64 m,a;
|
||||
I64 i,x,z;
|
||||
Bool on_track;
|
||||
Track *tempt,*tempt2;
|
||||
while (TRUE) {
|
||||
if (!game_over)
|
||||
Snd(c[0].speed*3+10);
|
||||
Snd(0.01*c[0].speed*3+10);
|
||||
else
|
||||
Snd(0);
|
||||
for (i=0;i<NUM_CARS;i++) {
|
||||
tempc=&c[i];
|
||||
tempc->p.x-=tempc->speed*Cos(tempc->é-ã/2);
|
||||
tempc->p.z+=tempc->speed*Sin(tempc->é-ã/2);
|
||||
tempc->p.x-=0.01*tempc->speed*Cos(tempc->é-ã/2);
|
||||
tempc->p.z+=0.01*tempc->speed*Sin(tempc->é-ã/2);
|
||||
tempt=TrackFind(tempc->t,tempc->p.x,tempc->p.z);
|
||||
if (i) {
|
||||
tempc->é=Arg(-tempc->p.x,tempc->p.z);
|
||||
tempc->p.x=-(TRACK_INNER+TRACK_OUTER)/2*Cos(tempc->é);
|
||||
tempc->p.z= (TRACK_INNER+TRACK_OUTER)/2*Sin(tempc->é);
|
||||
if (tempt!=tempc->t) {
|
||||
tempt2=tempt->next;
|
||||
if (tempt2==&track_root)
|
||||
tempt2=tempt2->next;
|
||||
tempc->é=Arg(-tempt2->z+tempc->p.z,-tempt2->x+tempc->p.x);
|
||||
}
|
||||
} else {
|
||||
tempc->é+=0.01*tempc->dé;
|
||||
x=track_map->width-(tempc->p.x-t_minx)>>MAP_BITS;
|
||||
z=(tempc->p.z-t_minz)>>MAP_BITS;
|
||||
if (GrPeek(track_map,x,z)!=YELLOW) {
|
||||
on_track=FALSE;
|
||||
tempc->speed-=0.01*tempc->speed;
|
||||
if (tempc->speed<0) tempc->speed=0;
|
||||
} else
|
||||
on_track=TRUE;
|
||||
}
|
||||
tempc->t=tempt;
|
||||
tempc->p.y=DipY(tempc->p.x,tempc->p.z);
|
||||
}
|
||||
R2P(&m,&a,c[0].p.x,c[0].p.z);
|
||||
if (!game_over && TRACK_INNER<=m<=TRACK_OUTER) {
|
||||
if (!game_over && on_track) {
|
||||
for (i=1;i<NUM_CARS;i++)
|
||||
if (D3I32DistSqr(&c[i].p,&c[0].p)<CAR_LENGTH*CAR_LENGTH>>1) {
|
||||
if (D3I32DistSqr(&c[i].p,&c[0].p)<CAR_LENGTH>>1*CAR_LENGTH>>1) {
|
||||
game_over=TRUE;
|
||||
Noise(500,50,100);
|
||||
Sleep(500);
|
||||
break;
|
||||
}
|
||||
if (!game_over) {
|
||||
distance+=c[0].speed;
|
||||
if (distance>2*ã*TRACK_INNER && Wrap(a+ã,-ã)>0.0) {
|
||||
distance+=0.01*c[0].speed;
|
||||
if (distance>track_root.last->d&& c[0].t->num<track_root.last->num>>1) {
|
||||
tf=tS;
|
||||
game_over=TRUE;
|
||||
Beep;
|
||||
@@ -411,36 +565,61 @@ U0 AnimateTask(I64)
|
||||
|
||||
CSprite *imgs[8]={$IB,"<1>",BI=1$,$IB,"<1>",BI=1$,$IB,"<2>",BI=2$,$IB,"<2>",BI=2$,$IB,"<3>",BI=3$,$IB,"<4>",BI=4$,$IB,"<4>",BI=4$,$IB,"<4>",BI=4$};
|
||||
|
||||
U0 Init()
|
||||
|
||||
U0 InitBushes()
|
||||
{
|
||||
Bush *tempb;
|
||||
Car *tempc;
|
||||
I64 i;
|
||||
I64 i,j,x,z;
|
||||
track_map->color=LTGREEN;
|
||||
track_map->pen_width=1;
|
||||
for (i=0;i<NUM_BUSHES;i++) {
|
||||
tempb=&b[i];
|
||||
do {
|
||||
tempb->p.x=RandU32&0x7FFF-0x4000;
|
||||
tempb->p.z=RandU32&0x7FFF-0x4000;
|
||||
} while (TRACK_INNER-SHOULDER<=
|
||||
Sqrt(SqrI64(tempb->p.x)+SqrI64(tempb->p.z))<=TRACK_OUTER+SHOULDER);
|
||||
|
||||
ib_restart:
|
||||
tempb->p.x=Rand*(t_maxx-t_minx)+t_minx;
|
||||
tempb->p.z=Rand*(t_maxz-t_minz)+t_minz;
|
||||
x=track_map->width-(tempb->p.x-t_minx)>>MAP_BITS;
|
||||
z=(tempb->p.z-t_minz)>>MAP_BITS;
|
||||
for (j=0;j<8;j++)
|
||||
if (GrPeek(track_map,x+gr_x_offsets[j],z+gr_y_offsets[j])!=LTGRAY)
|
||||
goto ib_restart;
|
||||
|
||||
GrPlot(track_map,x,z);
|
||||
tempb->p.y=DipY(tempb->p.x,tempb->p.z);
|
||||
tempb->sym=RandU16&1;
|
||||
tempb->img=imgs[i&7];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
U0 Init()
|
||||
{
|
||||
Car *tempc;
|
||||
Track *tempt;
|
||||
F64 d;
|
||||
I64 i;
|
||||
|
||||
InitTrack;
|
||||
InitBushes;
|
||||
tempt=track_root.next;
|
||||
for (i=0;i<NUM_CARS;i++) {
|
||||
tempc=&c[i];
|
||||
if (i==0) {
|
||||
tempc->t=tempt;
|
||||
tempc->p.x=tempt->x;
|
||||
tempc->p.z=tempt->z;
|
||||
tempc->p.y=DipY(tempc->p.x,tempc->p.z);
|
||||
tempc->é =-tempt->é;
|
||||
tempc->dé=0;
|
||||
if (!i) {
|
||||
tempc->img=$IB,"<5>",BI=5$;
|
||||
tempc->speed=0;
|
||||
} else {
|
||||
tempc->img=$IB,"<6>",BI=6$;
|
||||
tempc->speed=50.0;
|
||||
tempc->speed=2500.0;
|
||||
}
|
||||
tempc->é=i*2*ã/NUM_CARS;
|
||||
tempc->p.x=-(TRACK_INNER+TRACK_OUTER)/2*Cos(tempc->é);
|
||||
tempc->p.z= (TRACK_INNER+TRACK_OUTER)/2*Sin(tempc->é);
|
||||
tempc->p.y=DipY(tempc->p.x,tempc->p.z);
|
||||
d=(i+1)*track_root.last->d/NUM_CARS;
|
||||
while (tempt->next!=&track_root && tempt->d<d)
|
||||
tempt=tempt->next;
|
||||
}
|
||||
distance=0;
|
||||
tf=0;
|
||||
@@ -448,6 +627,14 @@ U0 Init()
|
||||
game_over=FALSE;
|
||||
}
|
||||
|
||||
U0 CleanUp()
|
||||
{
|
||||
while (mp_not_done_flags)
|
||||
Yield;
|
||||
QueDel(&track_root,TRUE);
|
||||
DCDel(track_map);
|
||||
}
|
||||
|
||||
U0 Varoom()
|
||||
{
|
||||
I64 sc;
|
||||
@@ -470,12 +657,11 @@ U0 Varoom()
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS
|
||||
-WIF_SELF_GRAB_SCROLL-WIF_FOCUS_TASK_MENU;
|
||||
AutoComplete;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
Preempt;
|
||||
Init;
|
||||
WinMax;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Init;
|
||||
Fs->draw_it=&DrawIt;
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
while (TRUE)
|
||||
@@ -483,20 +669,22 @@ U0 Varoom()
|
||||
case 0:
|
||||
switch (sc.u8[0]) {
|
||||
case SC_CURSOR_LEFT:
|
||||
c[0].é-=ã/100;
|
||||
c[0].dé-=ã/60;
|
||||
break;
|
||||
case SC_CURSOR_RIGHT:
|
||||
c[0].é+=ã/100;
|
||||
c[0].dé+=ã/60;
|
||||
break;
|
||||
case SC_CURSOR_UP:
|
||||
c[0].speed+=3;
|
||||
c[0].speed+=300;
|
||||
break;
|
||||
case SC_CURSOR_DOWN:
|
||||
c[0].speed-=3;
|
||||
c[0].speed-=900;
|
||||
if (c[0].speed<0) c[0].speed=0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '\n':
|
||||
CleanUp;
|
||||
Init;
|
||||
break;
|
||||
case CH_SHIFT_ESC:
|
||||
@@ -506,6 +694,7 @@ U0 Varoom()
|
||||
vr_done: //Don't goto out of try
|
||||
} catch
|
||||
Fs->catch_except=TRUE;
|
||||
CleanUp;
|
||||
SettingsPop(,TSF_SAME_SONG);
|
||||
MenuPop;
|
||||
RegWriteBranch("TempleOS/Varoom","F64 best_score=%5.4f;\n",best_score);
|
||||
|
||||
@@ -128,7 +128,6 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
Step *tempst;
|
||||
Peasant *tempp;
|
||||
F64 tt;
|
||||
Bool old_preempt=Preempt;
|
||||
|
||||
dc->pen_width=1;
|
||||
for (i=0;i<NUM_TREES;i++) {
|
||||
@@ -225,8 +224,6 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
dc->color=LTBLUE;
|
||||
GrPrint(dc,0,0,"Freezing Peasants:%d Time:%3.2f Best:%3.2f",
|
||||
not_stopped_cnt,tt-t0,best_score);
|
||||
|
||||
Preempt(old_preempt);
|
||||
}
|
||||
|
||||
U0 StepNew(CTask *task,I64 x,I64 y,F64 é,Bool left_right,Bool king)
|
||||
@@ -337,7 +334,7 @@ U0 Follow(CTask *,Peasant *tempp)
|
||||
}
|
||||
|
||||
U0 AnimateTask(I64)
|
||||
{//Preempt off by default after spawned.
|
||||
{
|
||||
Step *temps,*temps1;
|
||||
Peasant *tempp;
|
||||
I64 i,w,h;
|
||||
@@ -472,8 +469,11 @@ U0 Wenceslas()
|
||||
);
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
Preempt;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs);
|
||||
|
||||
PopUpOk("
|
||||
@@ -536,10 +536,6 @@ Lead peasants to fires.
|
||||
|
||||
Init;
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
AutoComplete;
|
||||
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Fs->draw_it=&DrawIt;
|
||||
try {
|
||||
while (TRUE) {
|
||||
|
||||
+2
-2
@@ -110,9 +110,9 @@ U0 Whap()
|
||||
CMathODE *ode=ODENew(0,1e-2,ODEF_HAS_MASSES);
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
WinMax;
|
||||
AutoComplete;
|
||||
Preempt;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
|
||||
MenuPush(
|
||||
"File {"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+2
-2
@@ -46,7 +46,7 @@ because they don't take-up room in the .BIN.Z file.
|
||||
*/
|
||||
|
||||
#ifjit
|
||||
#exe {OptOn(OPTf_GLBLS_ON_DATA_HEAP);};
|
||||
#exe {Option(OPTf_GLBLS_ON_DATA_HEAP,ON);};
|
||||
|
||||
Test g2[]={
|
||||
{10,"name1"},
|
||||
@@ -70,7 +70,7 @@ U0 Main2()
|
||||
|
||||
Main2;
|
||||
|
||||
#exe {OptOn(OPTf_GLBLS_ON_DATA_HEAP);};
|
||||
#exe {Option(OPTf_GLBLS_ON_DATA_HEAP,ON);};
|
||||
#endif
|
||||
|
||||
'\n';
|
||||
+15
-16
@@ -18,26 +18,25 @@ U0 Init()
|
||||
U0 Bounce()
|
||||
{
|
||||
CDC *dc=DCAlias;
|
||||
I64 i,ch,update;
|
||||
I64 i,ch;
|
||||
Init;
|
||||
try {//Catch <CTRL-ALT-c>
|
||||
do {
|
||||
update=winmgr.updates;
|
||||
do for (i=0;i<16;i++) {
|
||||
dc->color=i;
|
||||
GrPlot(dc,x[i].i32[1],y[i].i32[1]);
|
||||
x[i]+=dx[i];
|
||||
y[i]+=dy[i];
|
||||
if (!(0<=x[i]<Fs->pix_width<<32)) {
|
||||
x[i]-=dx[i];
|
||||
dx[i]=-dx[i];
|
||||
}
|
||||
if (!(0<=y[i]<Fs->pix_height<<32)) {
|
||||
y[i]-=dy[i];
|
||||
dy[i]=-dy[i];
|
||||
}
|
||||
for (i=0;i<16;i++) {
|
||||
dc->color=i;
|
||||
GrPlot(dc,x[i].i32[1],y[i].i32[1]);
|
||||
x[i]+=dx[i];
|
||||
y[i]+=dy[i];
|
||||
if (!(0<=x[i]<Fs->pix_width<<32)) {
|
||||
x[i]-=dx[i];
|
||||
dx[i]=-dx[i];
|
||||
}
|
||||
while (update==winmgr.updates);
|
||||
if (!(0<=y[i]<Fs->pix_height<<32)) {
|
||||
y[i]-=dy[i];
|
||||
dy[i]=-dy[i];
|
||||
}
|
||||
}
|
||||
Yield;
|
||||
} while (!(ch=ScanChar) || (ch!=CH_SHIFT_ESC && ch!=CH_ESC));
|
||||
} catch
|
||||
PutExcept;
|
||||
|
||||
@@ -27,7 +27,6 @@ U0 Box()
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
DocClear;
|
||||
Fs->draw_it=&DrawIt;
|
||||
Preempt; //We don't want matrix used while we're changing it.
|
||||
|
||||
dc->x=200;
|
||||
dc->y=200;
|
||||
|
||||
Binary file not shown.
@@ -8,11 +8,11 @@ U0 Doodle()
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_BORDER;
|
||||
|
||||
WinMax;
|
||||
AutoComplete;
|
||||
|
||||
DCFill;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocClear;
|
||||
DCFill;
|
||||
do {
|
||||
msg_code=GetMsg(&a1,&a2,
|
||||
1<<MSG_KEY_DOWN+1<<MSG_IP_L_DOWN+
|
||||
|
||||
Binary file not shown.
@@ -79,8 +79,8 @@ U0 FontEd()
|
||||
" Exit(,CH_ESC);"
|
||||
"}");
|
||||
AutoComplete;
|
||||
DocClear;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Fs->win_inhibit|=WIG_DBL_CLICK;
|
||||
cur_ch=0;
|
||||
try {
|
||||
|
||||
@@ -18,8 +18,10 @@ U0 GridDemo()
|
||||
ip_grid.y=GRID;
|
||||
old_draw_input_ptr=gr.fp_draw_input_ptr;
|
||||
gr.fp_draw_input_ptr=&DrawMyInputPtr;
|
||||
while (!ip.lb) //Left button to exit.
|
||||
while (!ip.lb) {//Left button to exit.
|
||||
GrPlot(,ip.pos.x,ip.pos.y);
|
||||
Yield;
|
||||
}
|
||||
DCFill;
|
||||
gr.fp_draw_input_ptr=old_draw_input_ptr;
|
||||
MemCpy(&ip_grid,&old_grid,sizeof(CGridGlbls));
|
||||
|
||||
@@ -169,12 +169,11 @@ U0 Lattice()
|
||||
"}"
|
||||
);
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Preempt;
|
||||
WinMax;
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
DocClear;
|
||||
WinMax;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
TurtleInit(&tt);
|
||||
SetMenu;
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_FOCUS_TASK_MENU
|
||||
|
||||
@@ -56,12 +56,13 @@ public U0 Life()
|
||||
restart=FALSE;
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DCFill;
|
||||
DocClear;
|
||||
DCFill;
|
||||
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
AutoComplete;
|
||||
Fs->draw_it=&DrawIt;
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_BORDER;
|
||||
do {
|
||||
|
||||
@@ -5,6 +5,7 @@ U0 LowPassFilterDemo()
|
||||
F64 y,y1,t,dt;
|
||||
CDC *dc=DCAlias;
|
||||
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocClear;
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -108,12 +108,11 @@ U0 PoleZeros()
|
||||
GrPaletteSet(gr_palette_gray);
|
||||
GrPaletteColorSet(15,0xFFFF00000000); //White is red
|
||||
|
||||
WinMax;
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
|
||||
DCFill;
|
||||
WinMax;
|
||||
DocClear;
|
||||
DCFill;
|
||||
scale=1.0;
|
||||
|
||||
try {
|
||||
|
||||
@@ -55,11 +55,11 @@ U0 PredatorPrey()
|
||||
"with different, random, initial populations.\n");
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
try {
|
||||
DocClear;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
WinMgrSync;
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocClear;
|
||||
WinMgrSync;
|
||||
|
||||
dc->color=BLACK;
|
||||
GrLine(dc,OX,0,OX,GR_HEIGHT-FONT_HEIGHT-1);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -159,10 +159,10 @@ U0 Main()
|
||||
s->sz=6*VIEWANGLES_SNAP;
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
DocClear;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocClear;
|
||||
Fs->draw_it=&DrawIt;
|
||||
try {
|
||||
"\n\nMove mouse to change light source.\n\n";
|
||||
|
||||
Binary file not shown.
@@ -73,7 +73,6 @@ U0 LeftClickSlider(CCtrl *c,I64 x,I64 y,Bool)
|
||||
|
||||
CCtrl *SliderNew()
|
||||
{
|
||||
Bool old_preempt;
|
||||
CCtrl *c=CAlloc(sizeof(CCtrl));
|
||||
c->win_task=Fs;
|
||||
c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_IP;
|
||||
@@ -83,18 +82,14 @@ CCtrl *SliderNew()
|
||||
c->draw_it=&DrawCtrlSlider;
|
||||
c->left_click=&LeftClickSlider;
|
||||
c->update_derived_vals=&UpdateDerivedCtrlSlider;
|
||||
old_preempt=Preempt;
|
||||
QueIns(c,Fs->last_ctrl);
|
||||
TaskDerivedValsUpdate;
|
||||
Preempt(old_preempt);
|
||||
return c;
|
||||
}
|
||||
|
||||
U0 SliderDel(CCtrl *c)
|
||||
{
|
||||
Bool old_preempt=Preempt;
|
||||
QueRem(c);
|
||||
Preempt(old_preempt);
|
||||
Free(c);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ public U0 SpeedLineDemo()
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_BORDER;
|
||||
|
||||
WinMax;
|
||||
WinBorder;
|
||||
AutoComplete;
|
||||
DCFill;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocClear;
|
||||
DCFill;
|
||||
do {
|
||||
msg_code=GetMsg(&a1,&a2,
|
||||
1<<MSG_KEY_DOWN+1<<MSG_IP_L_DOWN+
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -7,10 +7,10 @@ U0 SunMoon()
|
||||
{
|
||||
I64 i,x,y,radius;
|
||||
|
||||
AutoComplete; //AutoComplete Off
|
||||
WinBorder; //No Border
|
||||
WinMax; //Maximize window
|
||||
DocClear; //Clear command-line text
|
||||
WinBorder; //No Border
|
||||
AutoComplete; //AutoComplete Off
|
||||
Fs->text_attr=BLACK<<4+WHITE; //Current $LK,"CTask",A="MN:CTask"$ is Fs segment register.
|
||||
|
||||
for (i=0;i<0x8000;i+=0x200) {
|
||||
|
||||
@@ -11,9 +11,10 @@ U0 SymmetryDemo()
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_BORDER;
|
||||
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DCFill;
|
||||
DocClear;
|
||||
DCFill;
|
||||
dc->flags|=DCF_SYMMETRY;
|
||||
DCSymmetrySet(dc,Fs->pix_width/2,0,Fs->pix_width/2,1);
|
||||
do {
|
||||
@@ -50,10 +51,8 @@ U0 SymmetryDemo()
|
||||
}
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
break;
|
||||
case MSG_KEY_DOWN:
|
||||
break;
|
||||
}
|
||||
} while (msg_code!=MSG_KEY_DOWN || !a1);
|
||||
} while (msg_code!=MSG_KEY_DOWN || (a1!=CH_ESC && a1!=CH_SHIFT_ESC));
|
||||
GetMsg(,,1<<MSG_KEY_UP);
|
||||
DCFill;
|
||||
DCDel(dc);
|
||||
|
||||
Binary file not shown.
@@ -79,7 +79,6 @@ U0 LeftClickSlider(CCtrl *c,I64 x,I64 y,Bool)
|
||||
|
||||
CCtrl *SliderNew()
|
||||
{
|
||||
Bool old_preempt;
|
||||
CCtrl *c;
|
||||
if (Fs!=adam_task) {
|
||||
"Must be Adam Included with SHIFT-F5.\n"
|
||||
@@ -94,18 +93,14 @@ CCtrl *SliderNew()
|
||||
c->draw_it=&DrawCtrlSlider;
|
||||
c->left_click=&LeftClickSlider;
|
||||
c->update_derived_vals=&UpdateDerivedCtrlSlider;
|
||||
old_preempt=Preempt;
|
||||
QueIns(c,sys_winmgr_task->last_ctrl);
|
||||
TaskDerivedValsUpdate;
|
||||
Preempt(old_preempt);
|
||||
return c;
|
||||
}
|
||||
|
||||
U0 SliderDel(CCtrl *c)
|
||||
{
|
||||
Bool old_preempt=Preempt;
|
||||
QueRem(c);
|
||||
Preempt(old_preempt);
|
||||
Free(c->state);
|
||||
Free(c);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ U0 TimeIns()
|
||||
{
|
||||
I64 start1,end1,start2,end2,overhead_time,test_time;
|
||||
I64 reg i,reg temp;
|
||||
Bool old_preempt=Preempt;
|
||||
|
||||
CPURep;
|
||||
|
||||
@@ -34,8 +33,6 @@ U0 TimeIns()
|
||||
test_time=end2-start2;
|
||||
"Remainder Version #2 Cycles\t: %10.5f\n",
|
||||
ToF64(test_time-overhead_time)/SAMPLE_SIZE;
|
||||
|
||||
Preempt(old_preempt);
|
||||
}
|
||||
|
||||
TimeIns;
|
||||
|
||||
@@ -78,7 +78,6 @@ U0 Main()
|
||||
I64 start,end,overhead_time,test_time;
|
||||
F64 d1,fsum;
|
||||
I64 reg i,temp,reg d2,reg sum;
|
||||
Bool old_preempt=Preempt;
|
||||
|
||||
CPURep;
|
||||
|
||||
@@ -141,7 +140,6 @@ U0 Main()
|
||||
"$$RED$$Asm Float Cycles :%10.5f$$FG$$\n",
|
||||
ToF64(test_time)/SAMPLE_SIZE;
|
||||
|
||||
Preempt(old_preempt);
|
||||
}
|
||||
|
||||
Main;
|
||||
|
||||
@@ -18,7 +18,6 @@ U0 GrDemo()
|
||||
{
|
||||
I64 i;
|
||||
F64 t;
|
||||
Bool old_preempt=Preempt;
|
||||
CPURep;
|
||||
for (i=0;i<16;i++) {
|
||||
t=VGAPattern(0x5555555555555555);
|
||||
@@ -28,7 +27,6 @@ U0 GrDemo()
|
||||
"$$GREEN$$Rate:$$RED$$%5.1f FPS$$FG$$"
|
||||
" $$GREEN$$Load@30Hz:$$RED$$%5.1f%%$$FG$$\n",1/t,100*t*30.0;
|
||||
}
|
||||
Preempt(old_preempt);
|
||||
//<CTRL-ALT-f> will flush screen VGA cache.
|
||||
VGAFlush;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@ U0 TimeIns()
|
||||
{
|
||||
I64 start,end;
|
||||
I64 i,old_irq;
|
||||
Bool old_preempt=Preempt;
|
||||
|
||||
CPURep;
|
||||
old_irq=IntEntrySet(I_F_UNARY_MINUS,F_UNARY_MINUS_INT,IDTET_TRAP);
|
||||
@@ -74,7 +73,6 @@ U0 TimeIns()
|
||||
end=GetTSC;
|
||||
"Call Cycles: %10.5f\n",ToF64(end-start)/SAMPLE_SIZE;
|
||||
|
||||
Preempt(old_preempt);
|
||||
IntEntrySet(I_F_UNARY_MINUS,old_irq,IDTET_IRQ);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ $ID,2$The mini compiler is like the main compiler, except the main compiler's le
|
||||
|
||||
The main compiler generates $LK,"Intermediate Code",A="FF:::/Compiler/CompilerA.HPP,IC_END"$ at the parser stage. See $LK,"PrsExpression",A="MN:PrsExpression"$(), $LK,"PrsStatement",A="MN:PrsStatement"$().
|
||||
|
||||
The main compiler optimizes See $LK,"Intermediate Code Attributes",A="MN:intermediate_code_table"$, $LK,"Combining Consts",A="FF:::/Compiler/OptPass012.CPP,case IC_MUL"$, $LK,"Choosing Reg Vars",A="FF:::/Compiler/OptPass3.CPP,cmp.num_reg_vars"$. Set $LK,"OTrace",A="MN:OTrace"$(ON) to see the optimization stages.
|
||||
The main compiler optimizes See $LK,"Intermediate Code Attributes",A="MN:intermediate_code_table"$, $LK,"Combining Consts",A="FF:::/Compiler/OptPass012.CPP,case IC_MUL"$, $LK,"Choosing Reg Vars",A="FF:::/Compiler/OptPass3.CPP,cmp.num_reg_vars"$. Use $LK,"PassTrace",A="MN:PassTrace"$() to see the optimization stages.
|
||||
|
||||
The main compiler makes machine code in the back end. See $LK,"IC Struct",A="MN:CIntermediateCode"$, $LK,"COCCompile",A="MN:COCCompile"$ and $LK,"OptPass789A",A="FF:::/Compiler/OptPass789A.CPP,IC_MUL"$(), $LK,"BackEnd",A="FF:::/Compiler/BackA.CPP,ICMul"$. Set $LK,"CTrace",A="MN:CTrace"$(ON) to see the output of the backend.
|
||||
The main compiler makes machine code in the back end. See $LK,"IC Struct",A="MN:CIntermediateCode"$, $LK,"COCCompile",A="MN:COCCompile"$ and $LK,"OptPass789A",A="FF:::/Compiler/OptPass789A.CPP,IC_MUL"$(), $LK,"BackEnd",A="FF:::/Compiler/BackA.CPP,ICMul"$. Set $LK,"Trace",A="MN:Trace"$(ON) to see the output of the backend.
|
||||
$ID,-2$
|
||||
$TR,"Mini Compiler"$
|
||||
$ID,2$For this mini compiler, some things you should know about 64-bit asm:
|
||||
|
||||
@@ -105,10 +105,8 @@ U0 MGCircle(I64 x,I64 y,F64 r)
|
||||
U0 MiniGrLibDemo()
|
||||
{
|
||||
I64 i;
|
||||
Bool old_preempt;
|
||||
MGInit;
|
||||
|
||||
old_preempt=Preempt;
|
||||
for (i=0;i<100;i++)
|
||||
MGHLine(200+i,400+i,300+i);
|
||||
for (i=0;i<500;i+=10)
|
||||
@@ -117,7 +115,6 @@ U0 MiniGrLibDemo()
|
||||
MGCircle(200,100+i,i);
|
||||
MGUpdate;
|
||||
BusyWait(1500000);
|
||||
Preempt(old_preempt);
|
||||
/*
|
||||
We are returning graphics to normal operations under TempleOS.
|
||||
It is not normal to by-pass the TempleOS graphcis routines.
|
||||
|
||||
@@ -8,31 +8,31 @@
|
||||
|
||||
#assert I_USER==0x40
|
||||
|
||||
interrupt U0 MyVect40()
|
||||
interrupt U0 IntMy40()
|
||||
{
|
||||
lock {progress1++;}
|
||||
*LAPIC_EOI(U32 *)=0;
|
||||
}
|
||||
|
||||
interrupt U0 MyVect41()
|
||||
interrupt U0 IntMy41()
|
||||
{
|
||||
lock {progress2++;}
|
||||
*LAPIC_EOI(U32 *)=0;
|
||||
}
|
||||
|
||||
interrupt U0 MyVect42()
|
||||
interrupt U0 IntMy42()
|
||||
{
|
||||
lock {progress3++;}
|
||||
*LAPIC_EOI(U32 *)=0;
|
||||
}
|
||||
|
||||
interrupt U0 MyVect43()
|
||||
interrupt U0 IntMy43()
|
||||
{
|
||||
lock {progress4++;}
|
||||
*LAPIC_EOI(U32 *)=0;
|
||||
}
|
||||
|
||||
I64 vect[4]={&MyVect40,&MyVect41,&MyVect42,&MyVect43};
|
||||
I64 vect[4]={&IntMy40,&IntMy41,&IntMy42,&IntMy43};
|
||||
|
||||
U0 Main()
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ I64 *addr=VGAM_GRAPHICS,
|
||||
48[RBP]=STK_SELECTOR
|
||||
*/
|
||||
|
||||
interrupt haserrcode U0 PageFault()
|
||||
interrupt haserrcode U0 IntPageFault()
|
||||
{
|
||||
I64 reg *rbp=GetRBP;
|
||||
*pte_addr|=1;
|
||||
@@ -24,7 +24,7 @@ interrupt haserrcode U0 PageFault()
|
||||
|
||||
U0 PageTableDemo2()
|
||||
{
|
||||
U8 *old_idte=IntEntrySet(I_PAGE_FAULT,&PageFault,IDTET_IRQ);
|
||||
U8 *old_idte=IntEntrySet(I_PAGE_FAULT,&IntPageFault,IDTET_IRQ);
|
||||
err_code=0;
|
||||
*pte_addr &=~1; //Not present
|
||||
InvlPg(addr);
|
||||
|
||||
@@ -12,7 +12,7 @@ a fault to switch back.
|
||||
U8 *old_stk,*new_rip;
|
||||
|
||||
asm {
|
||||
TO_RING0:: //Set to handle general protection 0xD fault temporarily.
|
||||
INT_TO_RING0:: //Set to handle general protection 0xD fault temporarily.
|
||||
INC U64 [SYS_PROGRESS1]
|
||||
PUSH U32 CGDT.ds //STKSEG
|
||||
MOV RAX,U64 [&old_stk]
|
||||
@@ -29,7 +29,7 @@ U0 Ring3Demo()
|
||||
U8 *old_vect;
|
||||
"Progress1 Before:%X\n",progress1;
|
||||
CLI
|
||||
old_vect=IntEntrySet(0x0D,TO_RING0,IDTET_TRAP,0);
|
||||
old_vect=IntEntrySet(0x0D,INT_TO_RING0,IDTET_TRAP,0);
|
||||
|
||||
TSSBusy(Gs->tss->tr_ring3,OFF);
|
||||
SetRAX(Gs->tss->tr_ring3+3);
|
||||
|
||||
@@ -10,8 +10,6 @@ U0 PlotXY(I64 x,I64 y)
|
||||
U0 Main()
|
||||
{
|
||||
I64 i;
|
||||
Bool old_preempt=Preempt;
|
||||
|
||||
//This makes all 4 color planes active.
|
||||
OutU8(VGAP_INDEX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_DATA,WHITE);
|
||||
@@ -39,8 +37,6 @@ That means no read-modify-writes, too.
|
||||
*/
|
||||
BusyWait(4000000);
|
||||
|
||||
Preempt(old_preempt);
|
||||
|
||||
//TempleOS has a 4 plane memory duplicate of the screen, $LK,"gr.screen_image",A="MN:CGrGlbls"$,
|
||||
//and only writes actual changes. See $LK,"GrUpdateVGAGraphics",A="MN:GrUpdateVGAGraphics"$().
|
||||
//<CTRL-ALT-f> will flush screen VGA cache.
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
//This task lets you hear how busy the CPU is.
|
||||
U0 LoadTask(I64)
|
||||
{
|
||||
I64 i,j=100;
|
||||
//Preemption is ctrlled on a per task basis.
|
||||
//Preemption is OFF by default on new tasks.
|
||||
//It is turned on for user terminal tasks.
|
||||
Preempt(ON);
|
||||
while (TRUE) {
|
||||
for (i=0;i<10000;i++)
|
||||
InU8(0x21); //Roughly 1 microsecond on all PC's
|
||||
Snd(j);
|
||||
j+=20;
|
||||
if (j>1000) j=100;
|
||||
}
|
||||
}
|
||||
|
||||
U0 SpinningPreempt()
|
||||
{
|
||||
I64 i;
|
||||
"Spinning with preemption....\n";
|
||||
for (i=0;i<3000000;i++)
|
||||
InU8(0x21); //This is a sample hardware stat read
|
||||
}
|
||||
|
||||
U0 SpinningNoPreempt()
|
||||
{
|
||||
I64 i;
|
||||
Bool old_preempt;
|
||||
"Spinning with no preemption...\n";
|
||||
|
||||
//Put on screen before it starts. Text lags by one refresh
|
||||
//and we might catch it in the middle of an update.
|
||||
WinMgrSync;
|
||||
WinMgrSync;
|
||||
WinMgrSync;
|
||||
|
||||
old_preempt=Preempt;
|
||||
for (i=0;i<3000000;i++)
|
||||
InU8(0x21);
|
||||
Preempt(old_preempt);
|
||||
}
|
||||
|
||||
U0 SpinningNoInterrupts()
|
||||
{
|
||||
I64 i;
|
||||
//Interrupts are ctrlled on a per task basis.
|
||||
"Spinning with no interrupts...\n";
|
||||
WinMgrSync;
|
||||
WinMgrSync;
|
||||
WinMgrSync;
|
||||
CLI
|
||||
for (i=0;i<3000000;i++)
|
||||
InU8(0x21);
|
||||
STI
|
||||
}
|
||||
|
||||
U0 CooperativeMultitaskingPreempt()
|
||||
{
|
||||
F64 timeout=tS+3.0;
|
||||
|
||||
"Cooperative multitasking with preemption...\n";
|
||||
while (tS<timeout) {
|
||||
InU8(0x21);
|
||||
Yield;
|
||||
}
|
||||
}
|
||||
|
||||
U0 CooperativeMultitaskingNoPreempt()
|
||||
{
|
||||
F64 timeout=tS+3.0;
|
||||
Bool old_preempt=Preempt;
|
||||
"Cooperative multitasking with no preemption...\n";
|
||||
while (tS<timeout) {
|
||||
InU8(0x21);
|
||||
Yield;
|
||||
}
|
||||
Preempt(old_preempt);
|
||||
}
|
||||
|
||||
U0 CooperativeMultitaskingNoInterrupts()
|
||||
{
|
||||
F64 timeout=tS+3.0;
|
||||
|
||||
CLI
|
||||
"Cooperative multitasking with no interrupts...\n";
|
||||
while (tS<timeout) {
|
||||
InU8(0x21);
|
||||
Yield;
|
||||
}
|
||||
STI
|
||||
}
|
||||
|
||||
U0 SpinningDemo()
|
||||
{
|
||||
CTask *task=Spawn(&LoadTask);
|
||||
SpinningPreempt;
|
||||
SpinningNoPreempt;
|
||||
SpinningNoInterrupts;
|
||||
CooperativeMultitaskingPreempt;
|
||||
CooperativeMultitaskingNoPreempt;
|
||||
CooperativeMultitaskingNoInterrupts;
|
||||
Kill(task);
|
||||
Snd(0);
|
||||
}
|
||||
|
||||
SpinningDemo;
|
||||
@@ -7,7 +7,6 @@ U0 TimeIns()
|
||||
shared_blks,*uncached_I64;
|
||||
CBlkPool *bp;
|
||||
CHeapCtrl *hc;
|
||||
Bool old_preempt;
|
||||
|
||||
"$$RED$$Now, this demo seems broken, perhaps,\n"
|
||||
"because I run in a virtual machine.$$FG$$\n\n";
|
||||
@@ -18,8 +17,6 @@ U0 TimeIns()
|
||||
hc=HeapCtrlBPInit(bp,shared_blks<<12);
|
||||
uncached_I64=MAlloc(sizeof(I64),hc);
|
||||
|
||||
old_preempt=Preempt;
|
||||
|
||||
//Measure cached time
|
||||
start=GetTSC;
|
||||
for (i=0;i<SAMPLE_SIZE;i++)
|
||||
@@ -40,7 +37,6 @@ U0 TimeIns()
|
||||
Free(cached_I64);
|
||||
Free(uncached_I64);
|
||||
Mem2MegFree(bp,shared_blks);
|
||||
Preempt(old_preempt);
|
||||
}
|
||||
|
||||
TimeIns;
|
||||
|
||||
@@ -179,19 +179,18 @@ U0 CloudScene()
|
||||
try {
|
||||
Fs->text_attr=YELLOW<<4+BLUE;
|
||||
Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs);
|
||||
DocCursor;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
Init;
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
|
||||
DocClear;
|
||||
"$$BG,LTCYAN$$%h*c",SKY_LINES,'\n';
|
||||
"$$BG,YELLOW$$%h5c",'\n';
|
||||
BibleVerse(,"Exodus,14:19",7);
|
||||
|
||||
Preempt;
|
||||
Fs->draw_it=&DrawIt;
|
||||
GetChar;
|
||||
WinMgrSync;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
interrupt U0 BeepOn()
|
||||
interrupt U0 IntBeepOn()
|
||||
{
|
||||
*LAPIC_EOI(U32 *)=0; //signal end of interrupt
|
||||
Snd(100);
|
||||
}
|
||||
|
||||
interrupt U0 BeepOff()
|
||||
interrupt U0 IntBeepOff()
|
||||
{
|
||||
*LAPIC_EOI(U32 *)=0;
|
||||
Snd(0);
|
||||
@@ -12,8 +12,8 @@ interrupt U0 BeepOff()
|
||||
|
||||
U0 IntTest()
|
||||
{//Modify interrupt descriptor table use by all cores.
|
||||
IntEntrySet(I_USER,&BeepOn,IDTET_TRAP);
|
||||
IntEntrySet(I_USER+1,&BeepOff,IDTET_TRAP);
|
||||
IntEntrySet(I_USER,&IntBeepOn,IDTET_TRAP);
|
||||
IntEntrySet(I_USER+1,&IntBeepOff,IDTET_TRAP);
|
||||
//Issue interupt to core#1
|
||||
MPInt(I_USER,1);
|
||||
Sleep(1000);
|
||||
|
||||
@@ -3,7 +3,6 @@ I64 app_done_ack;
|
||||
|
||||
U0 Job1(I64)
|
||||
{//Compile Compiler
|
||||
Preempt(ON); //Off by default
|
||||
Silent;
|
||||
while (!app_done) {
|
||||
Cd("::/Compiler");
|
||||
@@ -14,7 +13,6 @@ U0 Job1(I64)
|
||||
|
||||
U0 Job2(I64)
|
||||
{//Log a file
|
||||
Preempt(ON); //Off by default
|
||||
while (!app_done) {
|
||||
AdamLog("%F","::/Demo/MultiCore/LoadTest.CPP");
|
||||
Yield;
|
||||
@@ -24,7 +22,6 @@ U0 Job2(I64)
|
||||
|
||||
U0 Job3(I64)
|
||||
{//Log a file
|
||||
Preempt(ON); //Off by default
|
||||
while (!app_done) {
|
||||
Cd("::/Compiler");
|
||||
AdamLog("%F","Compiler.PRJ.Z");
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
OptOn(OPTf_WARN_PAREN);
|
||||
Option(OPTf_WARN_PAREN,ON);
|
||||
|
||||
F64 d,d1=1,d2=1;
|
||||
|
||||
@@ -14,4 +14,4 @@ d=2`(3`2);
|
||||
|
||||
d=-d1`(d+d2);
|
||||
|
||||
OptOff(OPTf_WARN_PAREN);
|
||||
Option(OPTf_WARN_PAREN,OFF);
|
||||
+1
-1
@@ -13,7 +13,7 @@ U0 RandDemo()
|
||||
I64 i;
|
||||
|
||||
"Seed(0) will do timer randomized random numbers. A task starts with "
|
||||
"$LK,"Seed(0)",A="FF:::/Kernel/Task.CPP,Seed("$ by dft.\n";
|
||||
"$LK,"Seed(0)",A="FF:::/Kernel/KTask.CPP,Seed("$ by dft.\n";
|
||||
PressAKey;
|
||||
Seed;
|
||||
RandPts;
|
||||
|
||||
@@ -12,7 +12,6 @@ U0 Reverse(U8 *in_name,U8 *out_name)
|
||||
DocTop(doc_in);
|
||||
while (doc_in->root.next!=doc_in) {
|
||||
EdLineDown(doc_in,SC_CURSOR_DOWN|SCF_SHIFT);
|
||||
ClipboardDel;
|
||||
EdCutToClipboard(doc_in);
|
||||
DocTop(doc_out);
|
||||
EdPasteClipboard(doc_out);
|
||||
|
||||
@@ -130,7 +130,6 @@ I64 MorseWaitKey()
|
||||
|
||||
U0 Morse()
|
||||
{
|
||||
Bool old_preempt;
|
||||
CDocEntry *doc_e;
|
||||
I64 ch;
|
||||
U8 buf[8],*dst,*src;
|
||||
@@ -144,12 +143,8 @@ U0 Morse()
|
||||
|
||||
"$$GREEN$$";
|
||||
|
||||
//We don't want the tag call back
|
||||
//called before we set it, so preempt off.
|
||||
old_preempt=Preempt;
|
||||
doc_e=DocPrint(DocPut,"$$TX+TC,\" \"$$");
|
||||
doc_e->tag_cb=&MorseTimes;
|
||||
Preempt(old_preempt);
|
||||
|
||||
"$$FG$$\n";
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
ײ��t7p¾?ל•Xu}ֶ?0s)§Q_ָ?|�²´$ˆֻ?µiwiֻױ?2Hֻv״?l}צטװתא?BYְ#*ײי?¨adUּך?עGzgֽ ן?
|
||||
Z¶ϊ5Ρ§?πWΜτ™£Ο?§¦O�x·�?/΅ξV�OΫ?@ο��ξ*ά? $Υώϊγ?ΰ"ϋ©/η?J3™®ΐ*λ?`έ¶¦c�λ?Υ*«b3ύν?
|
||||
@@ -1,11 +1,11 @@
|
||||
//This is sorted.
|
||||
0.085632
|
||||
0.163161
|
||||
0.182332
|
||||
0.249695
|
||||
0.422056
|
||||
0.452876
|
||||
0.529350
|
||||
0.670680
|
||||
0.871274
|
||||
0.985883
|
||||
0.209918
|
||||
0.227671
|
||||
0.252834
|
||||
0.282144
|
||||
0.283027
|
||||
0.388650
|
||||
0.663171
|
||||
0.694189
|
||||
0.888085
|
||||
0.998097
|
||||
@@ -1 +1 @@
|
||||
0s)§Q_ָ?ל•Xu}ֶ?µiwiֻױ?|�²´$ˆֻ?BYְ#*ײי?עGzgֽ ן?l}צטװתא?¨adUּך?ײ��t7p¾?2Hֻv״?
|
||||
@ο��ξ*ά?J3™®ΐ*λ?Z¶ϊ5Ρ§? $Υώϊγ?§¦O�x·�?`έ¶¦c�λ?Υ*«b3ύν?πWΜτ™£Ο?ΰ"ϋ©/η?/΅ξV�OΫ?
|
||||
@@ -1,11 +1,11 @@
|
||||
//This is unsorted.
|
||||
0.422056
|
||||
0.670680
|
||||
0.085632
|
||||
0.985883
|
||||
0.529350
|
||||
0.452876
|
||||
0.249695
|
||||
0.871274
|
||||
0.163161
|
||||
0.182332
|
||||
0.283027
|
||||
0.998097
|
||||
0.663171
|
||||
0.694189
|
||||
0.252834
|
||||
0.388650
|
||||
0.227671
|
||||
0.282144
|
||||
0.209918
|
||||
0.888085
|
||||
Loaded 100 of 549 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user