TempleOSCDV4.06.ISO
This commit is contained in:
1 parent
6fe38d2d9d
commit
b632ab9a4f
261 files changed
+6282
-5801
No files matched your search
Binary file not shown.
@@ -45,6 +45,8 @@ $WW,1$$FG,5$$TX+CX,"TODO"$$FG$
|
||||
* Good $LK,"spell checker",A="MN:ACMisspelledFind"$.
|
||||
* Good Bible search.
|
||||
|
||||
* Can $LK,"MEM_EXTRA_HASH2_PAGES",A="MN:MEM_EXTRA_HASH2_PAGES"$ be just one?
|
||||
|
||||
* Bible ranges in $LK,"BibleVerse",A="MN:BibleVerse"$().
|
||||
|
||||
* $LK,"::/Demo/Games/FlatTops.CPP"$ is torpedo, not bombs.
|
||||
@@ -154,7 +156,7 @@ $FG,5$$TX+CX,"Bugs? Not really sure."$$FG$
|
||||
|
||||
* 5/7/14:Something like $LK,"AFSetIP",A="MN:AFSetIP"$ caused hang, then reboot in TestSuite.
|
||||
* 5/7/14:#63 Maybe, $LK,"::/Demo/Graphics/Pick3D.CPP"$ crashed in TestSuite.
|
||||
* 6/8/14:After or in $LK,"PageTableEntries2",A="FF:::/Misc/OSTestSuite.CPP,PageTableEntries2"$ in TestSuite crash.
|
||||
* 6/8/14:After or in $LK,"PageTableEntries",A="FF:::/Misc/OSTestSuite.CPP,PageTableEntries"$ in TestSuite crash.
|
||||
|
||||
* $LK,"StrPrintJoin",A="MN:StrPrintJoin"$(,st); With st="\n\\"; (Forgot what this is talking about.)
|
||||
|
||||
@@ -202,7 +204,6 @@ $ID,-5$
|
||||
|
||||
$FG,5$$TX+CX,"Committee Needed"$$FG$
|
||||
* Make binary tree look-up using FUN_SEG symbol addresses, so we can eliminate fun_seg cache and wall-paper kludge? All HolyC functions and glbl vars would have left-right for address search.
|
||||
* FunSeg does not scan all task tables.
|
||||
|
||||
* Improve editor undo, add redo.
|
||||
|
||||
@@ -211,8 +212,6 @@ $FG,5$$TX+CX,"Committee Needed"$$FG$
|
||||
* International Date output: $LK,"MPrintDate",A="MN:MPrintDate"$(). Every country make own version?
|
||||
* International Date input: $LK,"Str2Date",A="MN:Str2Date"$().
|
||||
|
||||
* Might want to move kernel code out of low 2Meg. Might be faster.
|
||||
|
||||
* $LK,"DCF_SYMMETRY",A="MN:DCF_SYMMETRY"$ before transformation? (Currently, it's after.)
|
||||
|
||||
* $LK,"TRANSPARENT",A="MN:TRANSPARENT"$ does not work with $LK,"ROPF_DITHER",A="MN:ROPF_DITHER"$.
|
||||
@@ -323,7 +322,7 @@ $ID,-5$
|
||||
$FG,5$$TX+CX,"Test"$$FG$
|
||||
* $LK,"SpriteBitMap",A="FI:::/Adam/Gr/SpriteBitMap.CPP"$: Grabscroll?
|
||||
|
||||
* Return results for $LK,"GrBlot",A="MN:GrBlot"$, $LK,"GrRect",A="MN:GrRect"$, $LK,"GrPutChar",A="MN:GrPutChar"$?
|
||||
* Return ress for $LK,"GrBlot",A="MN:GrBlot"$, $LK,"GrRect",A="MN:GrRect"$, $LK,"GrPutChar",A="MN:GrPutChar"$?
|
||||
* Collision cnts for $LK,"GrBlot",A="MN:GrBlot"$, $LK,"GrRect",A="MN:GrRect"$, $LK,"GrPutChar",A="MN:GrPutChar"$?
|
||||
|
||||
* $LK,"GetStr",A="MN:GetStr"$() or $LK,"GetChar",A="MN:GetChar"$() in $LK,"OSInstall",A="FI:::/Misc/OSInstall.CPP"$ didn't like focus change.
|
||||
@@ -390,14 +389,15 @@ Jesus' zeal for the Temple $TX,"John 2:14-19",HTML="http://www.biblegateway.com
|
||||
Famine not for bread $TX,"Amos 8:11-12",HTML="http://www.biblegateway.com/passage/?search=Amos%208:11-12&version=NIV"$
|
||||
To the honest, you are honest $TX,"Psalm 18:26",HTML="http://www.biblegateway.com/verse/en/Psalm%2018:26"$
|
||||
Meek and humble of heart $TX,"Matthew 11:29",HTML="http://www.biblegateway.com/verse/en/Matthew%2011:29"$
|
||||
MOses hgets Aaron $TX,"Exodus 4:10-16",HTML="http://www.biblegateway.com/passage/?search=Exodus%204:10-16&version=NIV"$
|
||||
Moses gets Aaron $TX,"Exodus 4:10-16",HTML="http://www.biblegateway.com/passage/?search=Exodus%204:10-16&version=NIV"$
|
||||
There is no council against the Lord $TX,"Proverbs 21:30",HTML="http://www.biblegateway.com/verse/en/Proverbs%2021:30"$
|
||||
Human help is worthless $TX,"Psalm 108:12",HTML="http://www.biblegateway.com/verse/en/Psalm%20108:12"$
|
||||
Do not seek your own wealth $TX,"1 Corinthians 10:24",HTML="http://www.biblegateway.com/verse/en/1%20Corinthians%2010:24"$
|
||||
|
||||
$FG,5$$TX+CX,"Misc Notes"$$FG$
|
||||
Intel CEO's name: Brian Krzanich
|
||||
>$FG,2$lspci -v$FG$
|
||||
Size:$TX,"17362 KB",D="DD_TEMPLEOSCD_K_SIZE"$
|
||||
Size:$TX,"17380 KB",D="DD_TEMPLEOSCD_K_SIZE"$
|
||||
|
||||
$FG,5$$TX+CX,"My Web Bookmarks"$$FG$$WW,0$
|
||||
$TX,"My FireFox Bookmarks",HTML="http://www.templeos.org/Wb/Home/Downloads/Blog/Bookmarks"$
|
||||
@@ -419,6 +419,9 @@ $TX,"Tom Foley",HTML="http://web.gccaz.edu/~tfoley/perspage.html"$
|
||||
$TX,"Graphic Technologies",HTML="https://web.archive.org/web/20020811060541/http://www.graphic-technologies.com/"$ $TX,"Lexmark vs Static Control",HTML="https://en.wikipedia.org/wiki/Lexmark_International,_Inc._v._Static_Control_Components,_Inc."$
|
||||
|
||||
|
||||
3qEeEGCAsBABAqFDBeE2G33qEeEGCAsBABAqFDBeE2G33qCsBDBDq2G3s2G3F2G3FqAet2G32G3AEDAqF3qCsBDBDq2G3s2G3F2G3FqAet2G32G3AEDAqF
|
||||
qFeDAsBDeDqCeF2G3sGGeF2sG3C2G3CBCeF
|
||||
|
||||
$FG,5$$TX+CX,"Web Bookmarks"$$FG$
|
||||
Cop tying shoe $HC,"<center><img src=\"https://goodtimestories.files.wordpress.com/2013/04/cop-tying-shoe-cambridge-county-pd.jpg\" width=\"480\" height=\"376\" alt=\"\"></center>"$
|
||||
$TX,"Good Time Bad Times Lyrics",HTML="https://www.google.com/#q=led+zep+good+times+bad+times+lyrics"$
|
||||
|
||||
@@ -2,7 +2,7 @@ $TR-UL,"Adam"$
|
||||
$ID,2$$TR,"SysMsgFlags"$
|
||||
$ID,2$sys_msg_flags[0]=0xFF;
|
||||
$ID,-2$$TR,"SysRegVer"$
|
||||
$ID,2$registry_version=4.050;
|
||||
$ID,2$registry_version=4.06;
|
||||
$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;
|
||||
@@ -12,34 +12,35 @@ $ID,-2$$TR,"DiningStars"$
|
||||
$ID,2$F64 best_score=9999.0000;
|
||||
$ID,-2$$TR,"BlackDiamond"$
|
||||
$ID,2$I64 best_score=9;
|
||||
$ID,-2$$TR,"EagleDive"$
|
||||
$ID,2$I64 best_score=4;
|
||||
$ID,-2$$TR,"DunGen"$
|
||||
$ID,2$F64 best_score=20.5295;
|
||||
$ID,-2$$TR,"CastleFrankenstein"$
|
||||
$ID,2$F64 best_score=33.8405;
|
||||
$ID,-2$$TR,"ZoneOut"$
|
||||
$ID,2$F64 best_score=8.1373;
|
||||
$ID,-2$$TR,"Varoom"$
|
||||
$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=22202;
|
||||
$ID,-2$$TR,"RawHide"$
|
||||
$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=175;
|
||||
$ID,-2$$TR,"RawHide"$
|
||||
$ID,2$F64 best_score=96.1279;
|
||||
$ID,-2$$TR,"Varoom"$
|
||||
$ID,2$F64 best_score=46.2643;
|
||||
$ID,-2$$TR,"EagleDive"$
|
||||
$ID,2$I64 best_score=4;
|
||||
$ID,-2$$TR,"XCaliber"$
|
||||
$ID,2$I64 best_score=248;
|
||||
I64 msg_flags=1;
|
||||
$ID,-2$$ID,-2$$TR,"DemoCompany"$
|
||||
$ID,2$$TR,"Game1"$
|
||||
$ID,2$F64 best_score=481.84264;
|
||||
$ID,2$
|
||||
$TR,"Game1"$
|
||||
$ID,2$F64 best_score=190.66292;
|
||||
$TR,"SimpleVal"$
|
||||
$ID,2$1309;
|
||||
$ID,-2$$ID,-2$$ID,-2$
|
||||
$ID,2$1313;
|
||||
$ID,-2$$ID,-2$
|
||||
@@ -47,9 +47,9 @@ U8 *BlogWebFile(CDate cdt=0)
|
||||
public U8 *FileNameNumNext(U8 *files_find_mask,U8 *fmt)
|
||||
{
|
||||
CDirEntry *tempde=FilesFind(files_find_mask);
|
||||
U8 *result=MStrPrint(fmt,FileCnt(tempde));
|
||||
U8 *res=MStrPrint(fmt,FileCnt(tempde));
|
||||
DirTreeDel(tempde);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 BlogDCImgWrite(CDC *dc,CDate cdt=0)
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
U8 TOSGetDrv()
|
||||
{
|
||||
I64 result;
|
||||
I64 res;
|
||||
"Drive (%s):",TOS_HDS;
|
||||
result=ToUpper(GetChar);
|
||||
res=ToUpper(GetChar);
|
||||
'\n';
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 TOSMakeOSDrvBootInstall(U8 drv_let)
|
||||
@@ -175,7 +175,7 @@ I64 MakeLineRepFile()
|
||||
{
|
||||
U8 *st;
|
||||
CDoc *doc;
|
||||
I64 result,official;
|
||||
I64 res,official;
|
||||
CDocEntry *tree_branch,*start_indent,*end_indent;
|
||||
|
||||
DocClear;
|
||||
@@ -189,7 +189,7 @@ I64 MakeLineRepFile()
|
||||
|
||||
DocMax;
|
||||
DocClear;
|
||||
result=LineRep;
|
||||
res=LineRep;
|
||||
if (doc=DocPut) {
|
||||
st=StrNew(doc->filename.name);
|
||||
StrCpy(doc->filename.name,"B:/TOS/Web/LineRep.TXT.Z");
|
||||
@@ -211,18 +211,16 @@ I64 MakeLineRepFile()
|
||||
DocCut(doc,start_indent->next,end_indent->last);
|
||||
doc->cur_entry=start_indent->next;
|
||||
doc->cur_col=0;
|
||||
|
||||
DocPrint(doc,"DefinePrint(\"DD_TEMPLEOS_LOC\",\"%,d\");\n",result);
|
||||
DocPrint(doc,"DefinePrint(\"DD_TEMPLEOS_LOC\",\"%,d\");\n",res);
|
||||
DocPrint(doc,"DefinePrint(\"DD_TEMPLEOS_LOC_OFFICIAL\",\"%,d\");\n",official);
|
||||
|
||||
DefinePrint("DD_TEMPLEOS_LOC","%,d",result);
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","%,d",official);
|
||||
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
|
||||
"Total LOC:%12,d\n\n",result;
|
||||
return result;
|
||||
DefinePrint("DD_TEMPLEOS_LOC","%,d",res);
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","%,d",official);
|
||||
|
||||
"Total LOC:%12,d\n\n",res;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 TOSDistroPrep()
|
||||
@@ -245,7 +243,7 @@ U0 MakeTOSDistro()
|
||||
ISOFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
|
||||
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSTS_SIZE",
|
||||
"Download $TX,"TempleOS V4.05",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V4.06",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');
|
||||
}
|
||||
@@ -280,7 +278,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 V4.05",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V4.06",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
@@ -328,7 +326,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 V4.05",D="DD_OS_NAME_VERSION"$ - Lite Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V4.06",D="DD_OS_NAME_VERSION"$ - Lite Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
@@ -361,7 +359,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 V4.05",D="DD_OS_NAME_VERSION"$ - UltraLite Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V4.06",D="DD_OS_NAME_VERSION"$ - UltraLite Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
@@ -370,12 +368,12 @@ U0 UpdateISODocDefines()
|
||||
{
|
||||
try {
|
||||
DefinePrint("DD_TEMPLEOSCD_SIZE",
|
||||
"Download $TX,"TempleOS V4.05",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V4.06",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 V4.05",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V4.06",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);
|
||||
|
||||
@@ -64,7 +64,7 @@ U8 *YouTubeGet(U8 *filename="C:/Home/Downloads/Blog/YouTube.TXT.Z",U8 *needle)
|
||||
I64 i=0,line=MIN_I64;
|
||||
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR),
|
||||
*doc2=DocNew;
|
||||
U8 *title,*code,*result;
|
||||
U8 *title,*code,*res;
|
||||
while (DocFind(doc,line,needle)) {
|
||||
if (!(doc->cur_entry->y&1)) {
|
||||
title=doc->cur_entry->tag;
|
||||
@@ -79,21 +79,21 @@ U8 *YouTubeGet(U8 *filename="C:/Home/Downloads/Blog/YouTube.TXT.Z",U8 *needle)
|
||||
}
|
||||
switch (i) {
|
||||
case 0:
|
||||
result=NULL;
|
||||
res=NULL;
|
||||
break;
|
||||
case 1:
|
||||
result=StrNew(code);
|
||||
res=StrNew(code);
|
||||
break;
|
||||
default:
|
||||
result=PopUpMenu(doc2);
|
||||
if (result==DOCM_CANCEL)
|
||||
result=NULL;
|
||||
res=PopUpMenu(doc2);
|
||||
if (res==DOCM_CANCEL)
|
||||
res=NULL;
|
||||
else
|
||||
result=StrNew(result);
|
||||
res=StrNew(res);
|
||||
}
|
||||
DocDel(doc);
|
||||
DocDel(doc2);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 YouTubeAdd(U8 *filename="C:/Home/Downloads/Blog/YouTube.TXT.Z",
|
||||
@@ -232,19 +232,50 @@ class CRandHexBeacon8Form
|
||||
I64 sec;
|
||||
};
|
||||
|
||||
U8 *URLPercentSpaces(U8 *src)
|
||||
{
|
||||
U8 buf[2048],*dst=buf;
|
||||
while (*src) {
|
||||
if (*src==CH_SPACE) {
|
||||
*dst++='%';
|
||||
*dst++='%';
|
||||
*dst++='2';
|
||||
*dst++='0';
|
||||
src++;
|
||||
} else
|
||||
*dst++=*src++;
|
||||
}
|
||||
*dst=0;
|
||||
return StrNew(buf);
|
||||
}
|
||||
|
||||
U8 *URLPlusSpaces(U8 *src)
|
||||
{
|
||||
U8 buf[2048],*dst=buf;
|
||||
while (*src) {
|
||||
if (*src==CH_SPACE) {
|
||||
*dst++='+';
|
||||
src++;
|
||||
} else
|
||||
*dst++=*src++;
|
||||
}
|
||||
*dst=0;
|
||||
return StrNew(buf);
|
||||
}
|
||||
|
||||
U8 *RandVideoRead(U8 *filename,I64 line)
|
||||
{
|
||||
U8 *result=NULL;
|
||||
U8 *res=NULL;
|
||||
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
|
||||
if (DocLineNumGoTo(doc,line-1) && doc->cur_entry->type_u8==DOCT_TEXT)
|
||||
result=StrNew(doc->cur_entry->tag);
|
||||
res=StrNew(doc->cur_entry->tag);
|
||||
DocDel(doc);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U8 *RandVideoWrite(U8 *filename,I64 line,U8 *st)
|
||||
{
|
||||
U8 *result=NULL;
|
||||
U8 *res=NULL;
|
||||
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
|
||||
if (DocLineNumGoTo(doc,line-1)) {
|
||||
if (doc->cur_entry->type_u8==DOCT_TEXT) {
|
||||
@@ -256,12 +287,12 @@ U8 *RandVideoWrite(U8 *filename,I64 line,U8 *st)
|
||||
DocWrite(doc);
|
||||
}
|
||||
DocDel(doc);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 RandVideo(U8 *title,U8 *webpage,CTopMoviesForm *url,U8 *filename)
|
||||
{
|
||||
U8 *st;
|
||||
U8 *st,*st2;
|
||||
if (st=RandVideoRead(filename,url->cert*2)) {
|
||||
StrCpy(url->tag,st);
|
||||
Free(st);
|
||||
@@ -277,9 +308,18 @@ U0 RandVideo(U8 *title,U8 *webpage,CTopMoviesForm *url,U8 *filename)
|
||||
} else
|
||||
st=NULL;
|
||||
}
|
||||
"God's response:\n"
|
||||
"$$TX,\"%s\",HTML=\"%s\"$$\n"
|
||||
"#%s\n",title,webpage,url->tag;
|
||||
if (StrIMatch("Metallica",filename)) {
|
||||
st2=URLPlusSpaces(url->tag+3);
|
||||
"God's response:\n"
|
||||
"$$TX,\"%s\",HTML=\"%s\"$$\n"
|
||||
"$$TX,\"%s (Lyrics)\","
|
||||
"HTML=\"http://lmgtfy.com/?q=Metallica+lyrics+%s\"$$\n",
|
||||
title,webpage,url->tag,st2;
|
||||
Free(st2);
|
||||
} else
|
||||
"God's response:\n"
|
||||
"$$TX,\"%s\",HTML=\"%s\"$$\n"
|
||||
"#%s\n",title,webpage,url->tag;
|
||||
if (st) {
|
||||
"$$HC,\"<object width=\\\"640\\\" height=\\\"520\\\">"
|
||||
"<param name=\\\"movie\\\" "
|
||||
@@ -296,23 +336,6 @@ U0 RandVideo(U8 *title,U8 *webpage,CTopMoviesForm *url,U8 *filename)
|
||||
}
|
||||
}
|
||||
|
||||
U8 *URLPercentSpaces(U8 *src)
|
||||
{
|
||||
U8 buf[1024],*dst=buf;
|
||||
while (*src) {
|
||||
if (*src==CH_SPACE) {
|
||||
*dst++='%';
|
||||
*dst++='%';
|
||||
*dst++='2';
|
||||
*dst++='0';
|
||||
src++;
|
||||
} else
|
||||
*dst++=*src++;
|
||||
}
|
||||
*dst=0;
|
||||
return StrNew(buf);
|
||||
}
|
||||
|
||||
U0 MyBibleLines(U8 *st,I64 num_lines,I64 radix,Bool modulo,Bool plus_one)
|
||||
{
|
||||
CDoc *doc_out,*doc_in;
|
||||
@@ -425,7 +448,7 @@ public U0 GodBooksPassage(U8 *files_find_mask,I64 len=512,
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
#define NIST_TIME_OFFSET (-7916-local_time_offset/CDATE_FREQ)
|
||||
#define NIST_TIME_OFFSET (-7923-local_time_offset/CDATE_FREQ)
|
||||
#define NIST_TIME_TO_SWITCH 3
|
||||
|
||||
public U0 NISTSync()
|
||||
|
||||
@@ -80,7 +80,7 @@ U0 FrameGrabberTask(I64)
|
||||
|
||||
I64 CopyVideo()
|
||||
{
|
||||
I64 result=0;
|
||||
I64 res=0;
|
||||
Del("D:/Temp/*.SND");
|
||||
if (fg_mode==FG_JUST_AUDIO)
|
||||
SndFileCreate("D:/Temp/Audio",0.115,0.0,WF_SQUARE,0.45,0.35,2.5);
|
||||
@@ -88,14 +88,14 @@ I64 CopyVideo()
|
||||
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");
|
||||
res=CopyTree("B:/Temp/ScreenShots","D:/Temp/ScreenShots");
|
||||
"Unused Space: %12.6fMeg\n",UnusedDrvSpace('B')/1024.0/1024.0;
|
||||
} else
|
||||
result=CopyTree("::/Temp/ScreenShots","D:/Temp/ScreenShots");
|
||||
res=CopyTree("::/Temp/ScreenShots","D:/Temp/ScreenShots");
|
||||
"$$BK,1$$Files Copied:%d$$BK,0$$ Time:%8.3fm\n",
|
||||
result,result/60.0/VIDEO_FRAME_RATE;
|
||||
res,res/60.0/VIDEO_FRAME_RATE;
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
public U0 FrameGrabberToggle()
|
||||
@@ -246,10 +246,10 @@ class CYouTubeForm2
|
||||
|
||||
U8 *TOSYouTube()
|
||||
{
|
||||
U8 *result;
|
||||
U8 *res;
|
||||
CYouTubeForm2 *url=CAlloc(sizeof(CYouTubeForm2));
|
||||
if (DocForm(url(CYouTubeForm2 *)) && *url->special)
|
||||
result=MStrPrint("$$HC,\"<object width=\\\"640\\\" height=\\\"520\\\">"
|
||||
res=MStrPrint("$$HC,\"<object width=\\\"640\\\" height=\\\"520\\\">"
|
||||
"<param name=\\\"movie\\\" "
|
||||
"value=\\\"http://www.youtube.com/v/%s\\\"></param><param "
|
||||
"name=\\\"allowscriptaccess\\\" value=\\\"always\\\"></param><embed "
|
||||
@@ -259,9 +259,9 @@ U8 *TOSYouTube()
|
||||
"width=\\\"640\\\" height=\\\"520\\\"></embed></object>\"$$",
|
||||
url->special,url->special);
|
||||
else
|
||||
result=NULL;
|
||||
res=NULL;
|
||||
Free(url);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 AfterEgyptInAction()
|
||||
|
||||
@@ -69,28 +69,45 @@ U0 HtmlPutS(CDoc *doc,I64 u32_attr,I64 *_old_u32_attr,
|
||||
U8 *TOSLinkCvt2(U8 *filename,I64 line_num)
|
||||
{// ::/ --> http://www.templeos.org/Wb/
|
||||
//Make your own LinkCvt routine
|
||||
U8 *result=NULL,*st;
|
||||
U8 *res=NULL,*st;
|
||||
if (filename) {
|
||||
st=ChgExt(filename,"html");
|
||||
if (st && StrLen(st)>3 && !StrNCmp(st+1,":/",2))
|
||||
result=MStrPrint(PERSONAL_WEB "/%s#l%d",st+3,line_num);
|
||||
res=MStrPrint(PERSONAL_WEB "/%s#l%d",st+3,line_num);
|
||||
Free(st);
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U8 *URLBibleGateway(U8 *src)
|
||||
{
|
||||
U8 buf[STR_LEN],*dst=buf;
|
||||
if (!MemCmp(src,"BF:",3))
|
||||
src+=3;
|
||||
while (*src) {
|
||||
if (*src==CH_SPACE || *src==',')
|
||||
*dst++='+';
|
||||
else
|
||||
*dst++=*src;
|
||||
src++;
|
||||
}
|
||||
*dst=0;
|
||||
return MStrPrint(
|
||||
"http://www.biblegateway.com/passage/?search=%s&version=NIV",buf);
|
||||
}
|
||||
|
||||
U8 *TOSLinkCvt1(U8 *link_st)
|
||||
{
|
||||
static CDoc *bible=NULL;
|
||||
static I64 locks=0;
|
||||
U8 *result=NULL,*filename,*needle;
|
||||
U8 *res=NULL,*filename,*needle;
|
||||
I64 i,num;
|
||||
if (link_st) {
|
||||
switch (i=EdLinkCvt(link_st,&filename,&needle,&num)) {
|
||||
case LK_FILE_LINE:
|
||||
case LK_PLAIN_LINE:
|
||||
case LK_FILE:
|
||||
result=TOSLinkCvt2(filename,num);
|
||||
res=TOSLinkCvt2(filename,num);
|
||||
break;
|
||||
case -1:
|
||||
case LK_DEF:
|
||||
@@ -105,18 +122,22 @@ U8 *TOSLinkCvt1(U8 *link_st)
|
||||
Yield;
|
||||
if (!bible)
|
||||
bible=Adam("DocRead(\"%s\");",filename);
|
||||
if (DocFind(bible,num,needle))
|
||||
result=TOSLinkCvt2(filename,bible->cur_entry->y+1);
|
||||
if (DocFind(bible,num,needle)) {
|
||||
if (StrOcc(link_st,'-'))
|
||||
res=URLBibleGateway(link_st);
|
||||
else
|
||||
res=TOSLinkCvt2(filename,bible->cur_entry->y+1);
|
||||
}
|
||||
LBtr(&locks,0);
|
||||
break;
|
||||
default:
|
||||
if (DocFileEd(i,filename,needle,&num,EDF_UNCOLLAPSE|EDF_BAIL))
|
||||
result=TOSLinkCvt2(filename,num);
|
||||
res=TOSLinkCvt2(filename,num);
|
||||
}
|
||||
Free(filename);
|
||||
Free(needle);
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +171,7 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
|
||||
"<head>\n"
|
||||
"<meta http-equiv=\"Content-Type\" "
|
||||
"content=\"text/html;charset=US-ASCII\">\n"
|
||||
"<meta name=\"generator\" content=\"$TX,"TempleOS V4.05",D="DD_OS_NAME_VERSION"$\">\n";
|
||||
"<meta name=\"generator\" content=\"$TX,"TempleOS V4.06",D="DD_OS_NAME_VERSION"$\">\n";
|
||||
if (!body_header) body_header=
|
||||
"<body>\n"
|
||||
"<pre style=\"font-family:courier;font-size:10pt\">\n";
|
||||
@@ -372,7 +393,7 @@ U0 TOSWebFile(U8 *name)
|
||||
"<meta name=\"keywords\" "
|
||||
"content=\"Operating System,64-Bit,64 Bit,"
|
||||
"Temple,OS,TempleOS,Free,Open Source,Public Domain,x86_64\">\n"
|
||||
"<meta name=\"generator\" content=\"$TX,"TempleOS V4.05",D="DD_OS_NAME_VERSION"$\">\n",
|
||||
"<meta name=\"generator\" content=\"$TX,"TempleOS V4.06",D="DD_OS_NAME_VERSION"$\">\n",
|
||||
|
||||
"<body style=\"background-color:#55FFFF; border-style:solid;
|
||||
border-width:8px; border-color:#0000AA;
|
||||
|
||||
@@ -37,7 +37,7 @@ _MUL_U64_U64_TO_U128::
|
||||
MOV RBP,RSP
|
||||
MOV RBX,U64 SF_ARG3[RBP]
|
||||
MOV RAX,U64 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/KernelA.HPP,SF_ARG1"$
|
||||
MUL U64 SF_ARG2[RBP] //Result RDX:RAX 128bit
|
||||
MUL U64 SF_ARG2[RBP] //Res RDX:RAX 128bit
|
||||
MOV U64 [RBX],RAX
|
||||
MOV U64 8[RBX],RDX
|
||||
POP RBP
|
||||
|
||||
@@ -5,23 +5,23 @@ F64 CompileDemo(U8 *st)
|
||||
I64 type;
|
||||
U8 *machine_code;
|
||||
CCmpCtrl *cc=CmpCtrlNew(st,CCF_DONT_FREE_BUF);
|
||||
F64 result=0;
|
||||
F64 res=0;
|
||||
Lex(cc); //Gotta get it started
|
||||
"Compile \"%s\"\n",st;
|
||||
do {
|
||||
if (machine_code=LexExpression2Bin(cc,&type)) {
|
||||
if (type!=RT_F64)
|
||||
result=ToF64(Call(machine_code));
|
||||
res=ToF64(Call(machine_code));
|
||||
else
|
||||
result=Call(machine_code)(F64);
|
||||
res=Call(machine_code)(F64);
|
||||
Free(machine_code);
|
||||
}
|
||||
"result=%9.4f\n",result;
|
||||
"res=%9.4f\n",res;
|
||||
if (cc->token==';')
|
||||
Lex(cc);
|
||||
} while (cc->token!=TK_EOF); //end of file?
|
||||
CmpCtrlDel(cc);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
CompileDemo("2+Cos(ã)");
|
||||
|
||||
+3
-3
@@ -17,7 +17,7 @@ if (YorN) {
|
||||
|
||||
Bool Quit()
|
||||
{
|
||||
Bool result;
|
||||
Bool res;
|
||||
U8 *st;
|
||||
I64 i;
|
||||
while (TRUE) {
|
||||
@@ -25,12 +25,12 @@ Bool Quit()
|
||||
st=GetStr;
|
||||
i=DefineMatch(st,"ST_NO_YES_LST",LMF_IGNORE_CASE);
|
||||
if (i>=0) {
|
||||
result=i;
|
||||
res=i;
|
||||
break;
|
||||
}
|
||||
Free(st);
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
Quit;
|
||||
Binary file not shown.
@@ -323,7 +323,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
SpriteMat3B(dc,x,y,0,$IB,"<2>",BI=2$,r2);
|
||||
else {
|
||||
tt=Tri(tS,1.0);
|
||||
temps=SpriteInterpolate($IB,"<3>",BI=3$,$IB,"<4>",BI=4$,tt);
|
||||
temps=SpriteInterpolate(tt,$IB,"<3>",BI=3$,$IB,"<4>",BI=4$);
|
||||
SpriteMat3B(dc,x,y,0,temps,r1);
|
||||
Free(temps);
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -127,7 +127,7 @@ Bool TestSameSlope(I64 x,I64 y,I64 w,I64 h)
|
||||
s=&normals[y][x];
|
||||
for (k2=0;k2<h;k2++)
|
||||
for (k1=0;k1<w;k1++)
|
||||
if (D3NormSqr(D3Sub(&normals[y+k2][x+k1],s,&p))>.10)
|
||||
if (D3NormSqr(D3Sub(&p,&normals[y+k2][x+k1],s))>.10)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -416,7 +416,7 @@ U0 MPDrawIt(CTask *task,CDC *dc)
|
||||
dc->x=cx;
|
||||
dc->y=cy;
|
||||
|
||||
//dc->x and the translation part of dc->r are identical in effect,
|
||||
//dc->x and the translation part of dc->r are ident in effect,
|
||||
//but we use both to show-off. We could add offsets together and
|
||||
//use one or the other.
|
||||
|
||||
|
||||
Binary file not shown.
@@ -42,7 +42,7 @@ U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)
|
||||
while (tempm1!=&ode->next_mass) {
|
||||
tempm2=tempm1->next;
|
||||
while (tempm2!=&ode->next_mass) {
|
||||
D3Sub(&tempm2->state->x,&tempm1->state->x,&p);
|
||||
D3Sub(&p,&tempm2->state->x,&tempm1->state->x);
|
||||
dd=D3NormSqr(&p);
|
||||
if (dd<=Sqr(tempm1->radius+tempm2->radius)) {
|
||||
d=Sqrt(dd)+0.0001;
|
||||
|
||||
+14
-14
@@ -132,7 +132,7 @@ U0 RiverDel()
|
||||
class RiverDrop
|
||||
{
|
||||
RiverDrop *next,*last;
|
||||
I64 index,dx,dy;
|
||||
I64 idx,dx,dy;
|
||||
} rd_root;
|
||||
Bool rd_lock;
|
||||
|
||||
@@ -153,27 +153,27 @@ U0 RiverDropsNext(CTask *mem_task)
|
||||
tempr=rd_root.next;
|
||||
while (tempr!=&rd_root) {
|
||||
tempr1=tempr->next;
|
||||
if (++tempr->index>river_hi) {
|
||||
if (++tempr->idx>river_hi) {
|
||||
QueRem(tempr);
|
||||
Free(tempr);
|
||||
} else {
|
||||
do {
|
||||
if (RandU16&1 && GrPeek(map_dc,r_x[tempr->index]+tempr->dx,
|
||||
r_y[tempr->index]+tempr->dy)==BLUE)
|
||||
if (RandU16&1 && GrPeek(map_dc,r_x[tempr->idx]+tempr->dx,
|
||||
r_y[tempr->idx]+tempr->dy)==BLUE)
|
||||
break;
|
||||
tempr->dx=ClampI64(tempr->dx+RandU16%3-1,-r_width[tempr->index]/2,
|
||||
r_width[tempr->index]/2);
|
||||
tempr->dy=ClampI64(tempr->dy+RandU16%3-1,-r_width[tempr->index]/2,
|
||||
r_width[tempr->index]/2);
|
||||
} while (GrPeek(map_dc,r_x[tempr->index]+tempr->dx,
|
||||
r_y[tempr->index]+tempr->dy)!=BLUE &&
|
||||
GrPeek(map_dc,r_x[tempr->index],
|
||||
r_y[tempr->index])==BLUE); //Might be reinitializing
|
||||
tempr->dx=ClampI64(tempr->dx+RandU16%3-1,-r_width[tempr->idx]/2,
|
||||
r_width[tempr->idx]/2);
|
||||
tempr->dy=ClampI64(tempr->dy+RandU16%3-1,-r_width[tempr->idx]/2,
|
||||
r_width[tempr->idx]/2);
|
||||
} while (GrPeek(map_dc,r_x[tempr->idx]+tempr->dx,
|
||||
r_y[tempr->idx]+tempr->dy)!=BLUE &&
|
||||
GrPeek(map_dc,r_x[tempr->idx],
|
||||
r_y[tempr->idx])==BLUE); //Might be reinitializing
|
||||
}
|
||||
tempr=tempr1;
|
||||
}
|
||||
tempr=MAlloc(sizeof(RiverDrop),mem_task);
|
||||
tempr->index=river_lo;
|
||||
tempr->idx=river_lo;
|
||||
tempr->dx=0;
|
||||
tempr->dy=0;
|
||||
QueIns(tempr,rd_root.last);
|
||||
@@ -188,7 +188,7 @@ U0 RiverDropsDraw(CDC *dc,I64 cx,I64 cy)
|
||||
Yield;
|
||||
tempr=rd_root.next;
|
||||
while (tempr!=&rd_root) {
|
||||
GrPlot(dc,r_x[tempr->index]+tempr->dx-cx,r_y[tempr->index]+tempr->dy-cy);
|
||||
GrPlot(dc,r_x[tempr->idx]+tempr->dx-cx,r_y[tempr->idx]+tempr->dy-cy);
|
||||
tempr=tempr->next;
|
||||
}
|
||||
LBtr(&rd_lock,0);
|
||||
|
||||
Binary file not shown.
@@ -99,17 +99,17 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
Unit *FindUnit(I64 x,I64 y,I64 player)
|
||||
{
|
||||
I64 i,dd,best_dd=MAX_I64;
|
||||
Unit *result=NULL;
|
||||
Unit *res=NULL;
|
||||
for (i=0;i<NUM_UNITS;i++) {
|
||||
if (u[i].player==player && u[i].alive) {
|
||||
dd=SqrI64(u[i].x-x)+SqrI64(u[i].y-y);
|
||||
if (dd<best_dd) {
|
||||
best_dd=dd;
|
||||
result=&u[i];
|
||||
res=&u[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 CheckForKills(I64 x1,I64 y1,I64 player)
|
||||
|
||||
@@ -152,8 +152,8 @@ F64 Dip
|
||||
|
||||
Track *TrackFind(Track *_tempt,I64 x,I64 z)
|
||||
{
|
||||
Track *result=_tempt,*tempt;
|
||||
I64 dd,best=SqrI64(result->x-x)+SqrI64(result->z-z);
|
||||
Track *res=_tempt,*tempt;
|
||||
I64 dd,best=SqrI64(res->x-x)+SqrI64(res->z-z);
|
||||
|
||||
tempt=_tempt;
|
||||
while (TRUE) {
|
||||
@@ -163,7 +163,7 @@ Track *TrackFind(Track *_tempt,I64 x,I64 z)
|
||||
dd=SqrI64(tempt->x-x)+SqrI64(tempt->z-z);
|
||||
if (dd<best) {
|
||||
best=dd;
|
||||
result=tempt;
|
||||
res=tempt;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
@@ -175,11 +175,11 @@ Track *TrackFind(Track *_tempt,I64 x,I64 z)
|
||||
dd=SqrI64(tempt->x-x)+SqrI64(tempt->z-z);
|
||||
if (dd<best) {
|
||||
best=dd;
|
||||
result=tempt;
|
||||
res=tempt;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 TrackSlice(F64 *_x,F64 *_z,F64 é,F64 d)
|
||||
@@ -646,12 +646,12 @@ U0 Varoom()
|
||||
"Play {"
|
||||
" Restart(,'\n');"
|
||||
" Accelerator(,,SC_CURSOR_UP);"
|
||||
" Break(,,SC_CURSOR_DOWN);"
|
||||
" Brake(,,SC_CURSOR_DOWN);"
|
||||
" Left(,,SC_CURSOR_LEFT);"
|
||||
" Right(,,SC_CURSOR_RIGHT);"
|
||||
"}"
|
||||
);
|
||||
SettingsPush(,TSF_SAME_SONG); //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
try {
|
||||
Fs->text_attr=YELLOW<<4+BLUE;
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS
|
||||
@@ -695,7 +695,7 @@ vr_done: //Don't goto out of try
|
||||
} catch
|
||||
PutExcept;
|
||||
CleanUp;
|
||||
SettingsPop(,TSF_SAME_SONG);
|
||||
SettingsPop;
|
||||
MenuPop;
|
||||
RegWriteBranch("TempleOS/Varoom","F64 best_score=%5.4f;\n",best_score);
|
||||
}
|
||||
|
||||
+12
-14
@@ -96,7 +96,7 @@ class Flake
|
||||
class Tree
|
||||
{
|
||||
U16 x,y;
|
||||
I64 fire_frame_index;
|
||||
I64 fire_frame_idx;
|
||||
} trees[NUM_TREES];
|
||||
|
||||
I64 snow_x,snow_y;
|
||||
@@ -132,8 +132,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
dc->pen_width=1;
|
||||
for (i=0;i<NUM_TREES;i++) {
|
||||
if (trees[i].y<=h/2) {//Draw trees behind house
|
||||
if (trees[i].fire_frame_index) {
|
||||
if (trees[i].fire_frame_index++&1)
|
||||
if (trees[i].fire_frame_idx) {
|
||||
if (trees[i].fire_frame_idx++&1)
|
||||
img=$IB,"<8>",BI=8$;
|
||||
else
|
||||
img=$IB,"<9>",BI=9$;
|
||||
@@ -149,8 +149,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
|
||||
for (i=0;i<NUM_TREES;i++) {
|
||||
if (trees[i].y>h/2) {//Draw trees in front of house
|
||||
if (trees[i].fire_frame_index) {
|
||||
if (trees[i].fire_frame_index++&1)
|
||||
if (trees[i].fire_frame_idx) {
|
||||
if (trees[i].fire_frame_idx++&1)
|
||||
img=$IB,"<8>",BI=8$;
|
||||
else
|
||||
img=$IB,"<9>",BI=9$;
|
||||
@@ -182,10 +182,9 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
if (tempp->stopped)
|
||||
SpriteMat3B(dc,tempp->x,tempp->y,GR_Z_ALL,peasant_imgs[0],r);
|
||||
else {
|
||||
temps=SpriteInterpolate(
|
||||
temps=SpriteInterpolate(Saw(animate_mS/250.0,1.0),
|
||||
peasant_imgs[ animate_phase &3],
|
||||
peasant_imgs[(animate_phase+1)&3],
|
||||
Saw(animate_mS/250.0,1.0));
|
||||
peasant_imgs[(animate_phase+1)&3]);
|
||||
SpriteMat3B(dc,tempp->x,tempp->y,GR_Z_ALL,temps,r);
|
||||
Free(temps);
|
||||
}
|
||||
@@ -199,10 +198,9 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
if (tS>king_timeout)
|
||||
SpriteMat3B(dc,king_x,king_y,GR_Z_ALL,king_imgs[0],r);
|
||||
else {
|
||||
temps=SpriteInterpolate(
|
||||
temps=SpriteInterpolate(Saw(king_mS/250.0,1.0),
|
||||
king_imgs[ king_phase &3],
|
||||
king_imgs[(king_phase+1)&3],
|
||||
Saw(king_mS/250.0,1.0));
|
||||
king_imgs[(king_phase+1)&3]);
|
||||
SpriteMat3B(dc,king_x,king_y,GR_Z_ALL,temps,r);
|
||||
Free(temps);
|
||||
}
|
||||
@@ -279,7 +277,7 @@ U0 Init()
|
||||
for (i=0;i<NUM_TREES;i++) {
|
||||
trees[i].x=RandU16%(w-2*BORDER-(max_x-min_x+1))+BORDER-min_x;
|
||||
trees[i].y=RandU16%(h-2*BORDER-(max_y-min_y+1))+BORDER-min_y;
|
||||
trees[i].fire_frame_index=0;
|
||||
trees[i].fire_frame_idx=0;
|
||||
}
|
||||
|
||||
QueInit(&step_root);
|
||||
@@ -376,7 +374,7 @@ U0 AnimateTask(I64)
|
||||
tempp->door_opened_t0=door_open_t0=tS;
|
||||
}
|
||||
for (i=0;i<NUM_TREES;i++) //Hang-out by fire
|
||||
if (trees[i].fire_frame_index &&
|
||||
if (trees[i].fire_frame_idx &&
|
||||
Sqr(tempp->x-trees[i].x)+Sqr(tempp->y-trees[i].y)<20*20) {
|
||||
tempp->stopped=TRUE;
|
||||
break;
|
||||
@@ -433,7 +431,7 @@ U0 BurnTrees()
|
||||
I64 i;
|
||||
for (i=0;i<NUM_TREES;i++)
|
||||
if (Sqr(king_x-trees[i].x)+Sqr(king_y-trees[i].y)<10*10)
|
||||
trees[i].fire_frame_index=1;
|
||||
trees[i].fire_frame_idx=1;
|
||||
}
|
||||
|
||||
U0 SongTask(I64)
|
||||
|
||||
+2
-2
@@ -66,7 +66,7 @@ U0 MyDerivative(CMathODE *ode,F64 t,COrder2D3 *,COrder2D3 *)
|
||||
|
||||
D3Equ(&p2,task->pix_width>>1,task->pix_height>>1,0);
|
||||
for (i=1;i<NUM_BALLS;i++) {
|
||||
D3Sub(&p2,&balls[i].state->x,&p);
|
||||
D3Sub(&p,&p2,&balls[i].state->x);
|
||||
if (d=D3Norm(&p)) {
|
||||
//Gravity would be /(d*d*d), but that's too exponential.
|
||||
D3MulEqu(&p,GRAVITY/d);
|
||||
@@ -76,7 +76,7 @@ U0 MyDerivative(CMathODE *ode,F64 t,COrder2D3 *,COrder2D3 *)
|
||||
|
||||
for (i=0;i<NUM_BALLS;i++)
|
||||
for (j=i+1;j<NUM_BALLS;j++) {
|
||||
D3Sub(&balls[j].state->x,&balls[i].state->x,&p);
|
||||
D3Sub(&p,&balls[j].state->x,&balls[i].state->x);
|
||||
dd=D3NormSqr(&p);
|
||||
if (dd<=(2*BALL_RADIUS)*(2*BALL_RADIUS)) {
|
||||
if (t-collision_t>0.05) {
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ ones which need initialization on the code heap.
|
||||
|
||||
You can't dynamically initialize data heap
|
||||
glbls--they are consts. This might be a silly
|
||||
point, but might result in odd differences, perhaps
|
||||
point, but might res in odd differences, perhaps
|
||||
from the order things are evaluated.
|
||||
|
||||
Data heap glbls are good for AOT modules
|
||||
|
||||
@@ -12,23 +12,23 @@ U0 Balloon()
|
||||
|
||||
CLI
|
||||
|
||||
OutU8(VGAP_INDEX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_DATA,0xF);
|
||||
MemSetI64(0xA0000,0,640*480/64);
|
||||
MemSetI64(text.vga_alias,0,640*480/64);
|
||||
|
||||
OutU8(VGAP_INDEX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_DATA,RED+GREEN+8);
|
||||
for (k=100;k<150;k++) {
|
||||
|
||||
for (i=0;i<20;i++)
|
||||
for (j=0;j<3;j++)
|
||||
*(0xA0000+0x1000+(i+k)*640/8+j)(U8 *)=a[i*3+j];
|
||||
*(text.vga_alias(I64)+0x1000+(i+k)*640/8+j)(U8 *)=a[i*3+j];
|
||||
|
||||
BusyWait(40000);
|
||||
|
||||
for (i=0;i<20;i++)
|
||||
for (j=0;j<3;j++)
|
||||
*(0xA0000+0x1000+(i+k)*640/8+j)(U8 *)=0;
|
||||
*(text.vga_alias(I64)+0x1000+(i+k)*640/8+j)(U8 *)=0;
|
||||
}
|
||||
|
||||
STI
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -22,11 +22,11 @@ I64 TopDisk(I64 pole)
|
||||
|
||||
I64 PosInStk(I64 pole,I64 disk)
|
||||
{
|
||||
I64 result=0,i;
|
||||
I64 res=0,i;
|
||||
for (i=NUM_DISKS-1;i>disk;i--)
|
||||
if (disks_pole[i]==pole)
|
||||
result++;
|
||||
return result;
|
||||
res++;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 SetDisksRestXY()
|
||||
|
||||
@@ -17,7 +17,7 @@ F64 angles[ANGLES]={
|
||||
class Turtle
|
||||
{
|
||||
F64 x,y,z,speed,é,w;
|
||||
I64 dé_index;
|
||||
I64 dé_idx;
|
||||
CColorROPU16 edge,middle;
|
||||
Bool ends,first;
|
||||
} tt;
|
||||
@@ -39,7 +39,7 @@ U0 TurtleMicroMove(Turtle *t,F64 dt)
|
||||
{
|
||||
t->x+=dt*t->speed*Cos(t->é);
|
||||
t->y+=dt*t->speed*Sin(t->é);
|
||||
t->é=Wrap(t->é+dt*angles[t->dé_index]);
|
||||
t->é=Wrap(t->é+dt*angles[t->dé_idx]);
|
||||
}
|
||||
|
||||
U0 TurtleEnd(CDC *dc,Turtle *t,CColorROPU16 edge,CColorROPU16 middle,F64 é)
|
||||
@@ -88,7 +88,7 @@ U0 TurtleInit(Turtle *t)
|
||||
t->z=5;
|
||||
t->edge=BLACK;
|
||||
t->middle=YELLOW;
|
||||
t->dé_index=ANGLES/2;
|
||||
t->dé_idx=ANGLES/2;
|
||||
t->first=TRUE;
|
||||
t->ends=TRUE;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ U0 DrawIt(CTask *,CDC *dc)
|
||||
Turtle t2;
|
||||
MemCpy(&t2,&tt,sizeof(Turtle));
|
||||
GrPrint(dc,0,0,"Layer:%f Speed:%f é:%5.1f dé:%5.1f Width:%f",
|
||||
tt.z,tt.speed,tt.é*180/ã,angles[tt.dé_index]*180/ã,tt.w);
|
||||
tt.z,tt.speed,tt.é*180/ã,angles[tt.dé_idx]*180/ã,tt.w);
|
||||
|
||||
TurtleMove(dc,&t2,RED,LTRED);
|
||||
dc->color=LTRED;
|
||||
@@ -205,12 +205,12 @@ U0 Lattice()
|
||||
case 0:
|
||||
switch (a2.u8[0]) {
|
||||
case SC_CURSOR_LEFT:
|
||||
if (tt.dé_index)
|
||||
tt.dé_index--;
|
||||
if (tt.dé_idx)
|
||||
tt.dé_idx--;
|
||||
break;
|
||||
case SC_CURSOR_RIGHT:
|
||||
if (tt.dé_index<ANGLES-1)
|
||||
tt.dé_index++;
|
||||
if (tt.dé_idx<ANGLES-1)
|
||||
tt.dé_idx++;
|
||||
break;
|
||||
case SC_CURSOR_UP:
|
||||
tt.speed+=TURTLE_SPEED_STEP;
|
||||
|
||||
Binary file not shown.
@@ -9,22 +9,22 @@ Complex *PoleZeroFind(I64 x,I64 y)
|
||||
{
|
||||
I64 i;
|
||||
F64 dd,best_dd=MAX_F64;
|
||||
Complex *result=NULL;
|
||||
Complex *res=NULL;
|
||||
for (i=0;i<NUM_POLES;i++) {
|
||||
dd=Sqr(poles[i].x-x)+Sqr(poles[i].y-y);
|
||||
if (dd<best_dd) {
|
||||
best_dd=dd;
|
||||
result=&poles[i];
|
||||
res=&poles[i];
|
||||
}
|
||||
}
|
||||
for (i=0;i<NUM_ZEROS;i++) {
|
||||
dd=Sqr(zeros[i].x-x)+Sqr(zeros[i].y-y);
|
||||
if (dd<best_dd) {
|
||||
best_dd=dd;
|
||||
result=&zeros[i];
|
||||
res=&zeros[i];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
F64 F(Complex *x)
|
||||
@@ -32,9 +32,9 @@ F64 F(Complex *x)
|
||||
F64 m,a;
|
||||
Complex num,denom,n1;
|
||||
|
||||
CPoly(&num, x,zeros,NUM_ZEROS);
|
||||
CPoly(&denom,x,poles,NUM_POLES);
|
||||
CDiv(&num,&denom,&n1);
|
||||
CPoly(&num, NUM_ZEROS,zeros,x);
|
||||
CPoly(&denom,NUM_POLES,poles,x);
|
||||
CDiv(&n1,&num,&denom);
|
||||
|
||||
R2P(&m,&a,n1.x,n1.y);
|
||||
if (ip.rb)
|
||||
@@ -74,7 +74,7 @@ U0 Draw()
|
||||
tempm[i]=JobQue(&MPDraw,Fs,i,0);
|
||||
y_total=0;
|
||||
for (i=0;i<mp_cnt;i++)
|
||||
y_total+=JobResultGet(tempm[i])(F64);
|
||||
y_total+=JobResGet(tempm[i])(F64);
|
||||
|
||||
if (!y_total) break;
|
||||
scale*=7*GR_WIDTH*GR_HEIGHT/y_total;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
U0 StructName(U8 *d,U8 *class_name=lastclass)
|
||||
{//lastclass is the previous fun arg's class as a string.
|
||||
{//lastclass is the prev fun arg's class as a string.
|
||||
"%X is a \"%s\".\n",d,class_name;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ F64 VGAPattern(I64 p)
|
||||
F64 start=tS;
|
||||
I64 plane;
|
||||
for (plane=1;plane<0x10;plane<<=1) {
|
||||
OutU8(VGAP_INDEX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_DATA,plane);
|
||||
MemSetI64(0xA0000,p,640*480/64);
|
||||
MemSetI64(text.vga_alias,p,640*480/64);
|
||||
}
|
||||
return tS-start;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ so a ptr to a page count is passed.
|
||||
Return: NULL if out of memory.
|
||||
*/
|
||||
I64 i,j,*pte,num=*_pages2Meg;
|
||||
CMemBlk *result=NULL,*m,*m1;
|
||||
CMemBlk *res=NULL,*m,*m1;
|
||||
|
||||
if (!bp) bp=sys_code_bp;
|
||||
PUSHFD
|
||||
@@ -20,18 +20,18 @@ Return: NULL if out of memory.
|
||||
|
||||
m=&bp->mem_free_2meg_lst;
|
||||
while (TRUE) {
|
||||
if (!(result=m->next))
|
||||
if (!(res=m->next))
|
||||
break;
|
||||
if (result->pages<num)
|
||||
m=result;
|
||||
if (res->pages<num)
|
||||
m=res;
|
||||
else {
|
||||
if (result->pages==num) {
|
||||
m->next=result->next;
|
||||
if (res->pages==num) {
|
||||
m->next=res->next;
|
||||
goto am_done;
|
||||
} else {
|
||||
result->pages-=num;
|
||||
result(U8 *)+=result->pages<<MEM_PAGE_BITS;
|
||||
result->pages=num;
|
||||
res->pages-=num;
|
||||
res(U8 *)+=res->pages<<MEM_PAGE_BITS;
|
||||
res->pages=num;
|
||||
goto am_done;
|
||||
}
|
||||
}
|
||||
@@ -39,36 +39,36 @@ Return: NULL if out of memory.
|
||||
|
||||
m=&bp->mem_free_lst;
|
||||
while (TRUE) {
|
||||
if (!(result=m->next)) {
|
||||
if (!(res=m->next)) {
|
||||
num=0;
|
||||
result=NULL; //Out of memory
|
||||
res=NULL; //Out of memory
|
||||
goto am_done;
|
||||
}
|
||||
if (result->pages<num)
|
||||
m=result;
|
||||
if (res->pages<num)
|
||||
m=res;
|
||||
else {
|
||||
if (result->pages==num) {
|
||||
if (result(U8 *)&0x1FFFFF)
|
||||
m=result;
|
||||
if (res->pages==num) {
|
||||
if (res(U8 *)&0x1FFFFF)
|
||||
m=res;
|
||||
else {
|
||||
m->next=result->next;
|
||||
m->next=res->next;
|
||||
goto am_done;
|
||||
}
|
||||
} else {
|
||||
if (i=(result(U8 *)&0x1FFFFF)>>MEM_PAGE_BITS) {
|
||||
if (i=(res(U8 *)&0x1FFFFF)>>MEM_PAGE_BITS) {
|
||||
j=1<<(21-MEM_PAGE_BITS)-i;
|
||||
if (result->pages<num+j)
|
||||
m=result;
|
||||
else if (result->pages==num+j) {
|
||||
result->pages-=num;
|
||||
result(U8 *)+=result->pages<<MEM_PAGE_BITS;
|
||||
result->pages=num;
|
||||
if (res->pages<num+j)
|
||||
m=res;
|
||||
else if (res->pages==num+j) {
|
||||
res->pages-=num;
|
||||
res(U8 *)+=res->pages<<MEM_PAGE_BITS;
|
||||
res->pages=num;
|
||||
goto am_done;
|
||||
} else {
|
||||
m1=result;
|
||||
result(U8 *)+=j<<MEM_PAGE_BITS;
|
||||
result->pages=num;
|
||||
m=result(U8 *)+num<<MEM_PAGE_BITS;
|
||||
m1=res;
|
||||
res(U8 *)+=j<<MEM_PAGE_BITS;
|
||||
res->pages=num;
|
||||
m=res(U8 *)+num<<MEM_PAGE_BITS;
|
||||
m->pages=m1->pages-num-j;
|
||||
m1->pages=j;
|
||||
m->next=m1->next;
|
||||
@@ -77,11 +77,11 @@ Return: NULL if out of memory.
|
||||
goto am_done;
|
||||
}
|
||||
} else {
|
||||
m=m->next=result(U8 *)+num<<MEM_PAGE_BITS;
|
||||
m->next=result->next;
|
||||
m->pages=result->pages-num;
|
||||
m=m->next=res(U8 *)+num<<MEM_PAGE_BITS;
|
||||
m->next=res->next;
|
||||
m->pages=res->pages-num;
|
||||
m->mb_signature=MBS_UNUSED_SIGNATURE_VAL;
|
||||
result->pages=num;
|
||||
res->pages=num;
|
||||
goto am_done;
|
||||
}
|
||||
}
|
||||
@@ -92,17 +92,17 @@ am_done:
|
||||
bp->used_u8s+=i;
|
||||
num>>=21-MEM_PAGE_BITS;
|
||||
*_pages2Meg=num;
|
||||
m=result;
|
||||
m=res;
|
||||
m1=m(U8 *)+i;
|
||||
while (m<m1) {
|
||||
pte=MemPageTable(m);
|
||||
*pte &= ~0x18;
|
||||
InvlPg(m);
|
||||
m(U8 *)+=MemPageSize(m);
|
||||
m(U8 *)+=0x200000;
|
||||
}
|
||||
LBtr(&bp->locked_flags,BPlf_LOCKED);
|
||||
POPFD
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U8 *Mem2MegUncachedAlloc(I64 *_pages2Meg,CBlkPool *bp=NULL)
|
||||
@@ -113,20 +113,20 @@ so a ptr to a page count is passed.
|
||||
|
||||
Return: NULL if out of memory.
|
||||
*/
|
||||
CMemBlk *result,*m,*m1;
|
||||
CMemBlk *res,*m,*m1;
|
||||
I64 num=*_pages2Meg,*pte;
|
||||
if (result=Mem2MegAlloc(_pages2Meg,bp)) {
|
||||
if (res=Mem2MegAlloc(_pages2Meg,bp)) {
|
||||
num=*_pages2Meg;
|
||||
m=result;
|
||||
m=res;
|
||||
m1=m(U8 *)+num<<21;
|
||||
while (m<m1) {
|
||||
pte=MemPageTable(m);
|
||||
*pte= *pte& ~0x18 |0x10;
|
||||
InvlPg(m);
|
||||
m(U8 *)+=MemPageSize(m);
|
||||
m(U8 *)+=0x200000;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U8 *Mem2MegWriteThruAlloc(I64 *_pages2Meg,CBlkPool *bp=NULL)
|
||||
@@ -137,20 +137,20 @@ so a ptr to a page count is passed.
|
||||
|
||||
Return: NULL if out of memory.
|
||||
*/
|
||||
CMemBlk *result,*m,*m1;
|
||||
CMemBlk *res,*m,*m1;
|
||||
I64 num=*_pages2Meg,*pte;
|
||||
if (result=Mem2MegAlloc(_pages2Meg,bp)) {
|
||||
if (res=Mem2MegAlloc(_pages2Meg,bp)) {
|
||||
num=*_pages2Meg;
|
||||
m=result;
|
||||
m=res;
|
||||
m1=m(U8 *)+num<<21;
|
||||
while (m<m1) {
|
||||
pte=MemPageTable(m);
|
||||
*pte= *pte& ~0x18 |8;
|
||||
InvlPg(m);
|
||||
m(U8 *)+=MemPageSize(m);
|
||||
m(U8 *)+=0x200000;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 Mem2MegFree(CMemBlk *m,I64 pages2Meg,CBlkPool *bp=NULL)
|
||||
@@ -165,7 +165,7 @@ U0 Mem2MegFree(CMemBlk *m,I64 pages2Meg,CBlkPool *bp=NULL)
|
||||
pte=MemPageTable(m2);
|
||||
*pte=*pte & ~0x18;
|
||||
InvlPg(m2);
|
||||
m2(U8 *)+=MemPageSize(m2);
|
||||
m2(U8 *)+=0x200000;
|
||||
}
|
||||
PUSHFD
|
||||
CLI
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
I64 *addr=VGAM_GRAPHICS,
|
||||
I64 *addr=text.vga_alias,
|
||||
*pte_addr=MemPageTable(addr),
|
||||
err_code=0,
|
||||
*reported_fault_addr;
|
||||
@@ -22,7 +22,7 @@ interrupt haserrcode U0 IntPageFault()
|
||||
reported_fault_addr=GetRAX;
|
||||
}
|
||||
|
||||
U0 PageTableDemo2()
|
||||
U0 PageTableDemo()
|
||||
{
|
||||
U8 *old_idte=IntEntrySet(I_PAGE_FAULT,&IntPageFault,IDTET_IRQ);
|
||||
err_code=0;
|
||||
@@ -34,4 +34,4 @@ U0 PageTableDemo2()
|
||||
"Err Code:%X Addr:%X\n",err_code,reported_fault_addr;
|
||||
}
|
||||
|
||||
PageTableDemo2;
|
||||
PageTableDemo;
|
||||
@@ -1,47 +0,0 @@
|
||||
/*What's funner than page tables for programmers to play with!!
|
||||
|
||||
This changes a page table entry for VGA graphics memory.
|
||||
TempleOS keeps a cached copy of VGA memory in
|
||||
$LK,"gr.screen_image",A="MN:CGrGlbls"$. See $LK,"GrUpdateVGAGraphics",A="MN:GrUpdateVGAGraphics"$.
|
||||
|
||||
TempleOS used 4096 size pages for memory below addr 2 Meg
|
||||
and 2 Meg pages above two Meg. See $LK,"MemPageSize",A="MN:MemPageSize"$() and $LK,"INIT_MEMORY",A="FF:::/Kernel/Mem/PageTables.CPP,SYS_INIT_MEM"$.
|
||||
*/
|
||||
|
||||
U0 PageTableDemo1()
|
||||
{
|
||||
I64 *pte=MemPageTable(VGAM_GRAPHICS),p0,p1;
|
||||
"Page table entries for VGA screen memory\n";
|
||||
DocD(pte);
|
||||
PressAKey;
|
||||
|
||||
p0=pte[0];
|
||||
p1=pte[1];
|
||||
pte[0]=p1;
|
||||
pte[1]=p0;
|
||||
InvlPg(VGAM_GRAPHICS); //Invalidate translation look aside buffer (TLB).
|
||||
InvlPg(VGAM_GRAPHICS+0x1000);
|
||||
|
||||
//Use this if you wish to change
|
||||
//the page table reg.
|
||||
|
||||
// SetRAX(0x100000+0x1000*(MEM_NUM_PML1+MEM_NUM_PML2+MEM_NUM_PML3));
|
||||
// MOV_CR3_EAX
|
||||
|
||||
//<CTRL-ALT-v> will flush screen VGA cache.
|
||||
VGAFlush;
|
||||
PressAKey;
|
||||
|
||||
pte[0]=p0;
|
||||
pte[1]=p1;
|
||||
InvlPg(VGAM_GRAPHICS);
|
||||
InvlPg(VGAM_GRAPHICS+0x1000);
|
||||
|
||||
//<CTRL-ALT-v> will flush screen VGA cache.
|
||||
VGAFlush;
|
||||
}
|
||||
|
||||
PageTableDemo1;
|
||||
|
||||
//See $LK,"CBlkPool",A="MN:CBlkPool"$, $LK,"CHeapCtrl",A="MN:CHeapCtrl"$, $LK,"sys_code_bp",A="MN:sys_code_bp"$ and $LK,"sys_data_bp",A="MN:sys_data_bp"$.
|
||||
//See $LK,"Memory Overview",A="FI:::/Doc/MemOverview.TXT"$ and $LK,"Memory Routines",A="HI:Memory"$.
|
||||
@@ -2,7 +2,7 @@
|
||||
U8 reverse[256], //The VGA bits are bwd
|
||||
|
||||
image[640*480/8]; //We need read-modify write.
|
||||
//0xA0000 memory can't be read.
|
||||
//0xA0000 alias memory can't be read.
|
||||
|
||||
U0 MGInit()
|
||||
{
|
||||
@@ -18,10 +18,10 @@ U0 MGInit()
|
||||
U0 MGUpdate()
|
||||
{//Copy image to VGA memory
|
||||
//For better performance we could only write what's changed.
|
||||
//0xA0000 is slower than normal RAM.
|
||||
OutU8(VGAP_INDEX,VGAR_MAP_MASK);
|
||||
//0xA0000 alias is slower than normal RAM.
|
||||
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_DATA,0xF);//All color planes at once -- Black and White
|
||||
MemCpy(0xA0000,image,sizeof(image));
|
||||
MemCpy(text.vga_alias,image,sizeof(image)); //Alias of 0xA0000
|
||||
}
|
||||
|
||||
U0 MGPlot(I64 x,I64 y)
|
||||
|
||||
@@ -78,31 +78,31 @@ CPURep;
|
||||
"Bad Code\n";
|
||||
t0=tS;
|
||||
i=Loop1;
|
||||
"Result:%d Time:%9.6f\n",i,tS-t0;
|
||||
"Res:%d Time:%9.6f\n",i,tS-t0;
|
||||
|
||||
"Good Code #1\n";
|
||||
t0=tS;
|
||||
i=Loop2;
|
||||
"Result:%d Time:%9.6f\n",i,tS-t0;
|
||||
"Res:%d Time:%9.6f\n",i,tS-t0;
|
||||
|
||||
"Good Code #2\n";
|
||||
t0=tS;
|
||||
i=Loop3;
|
||||
"Result:%d Time:%9.6f\n",i,tS-t0;
|
||||
"Res:%d Time:%9.6f\n",i,tS-t0;
|
||||
|
||||
"Good Code #3\n";
|
||||
t0=tS;
|
||||
i=Loop4;
|
||||
"Result:%d Time:%9.6f\n",i,tS-t0;
|
||||
"Res:%d Time:%9.6f\n",i,tS-t0;
|
||||
|
||||
/* Program Output$HL,0$$WW+H,1$$FD,1$
|
||||
8 Cores 2.660GHz
|
||||
Bad Code
|
||||
Result:3200000040000000 Time: 0.069966
|
||||
Res:3200000040000000 Time: 0.069966
|
||||
Good Code #1
|
||||
Result:3200000040000000 Time: 0.062567
|
||||
Res:3200000040000000 Time: 0.062567
|
||||
Good Code #2
|
||||
Result:3200000040000000 Time: 0.062907
|
||||
Res:3200000040000000 Time: 0.062907
|
||||
Good Code #3
|
||||
Result:3200000040000000 Time: 0.156359
|
||||
Res:3200000040000000 Time: 0.156359
|
||||
$HL,1$*/
|
||||
@@ -4,28 +4,28 @@
|
||||
U0 PlotXY(I64 x,I64 y)
|
||||
{
|
||||
//Screen bits are reversed
|
||||
LBts(VGAM_GRAPHICS,y*GR_WIDTH+x^7);
|
||||
LBts(text.vga_alias,y*GR_WIDTH+x^7);
|
||||
}
|
||||
|
||||
U0 Main()
|
||||
{
|
||||
I64 i;
|
||||
//This makes all 4 color planes active.
|
||||
OutU8(VGAP_INDEX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_DATA,WHITE);
|
||||
MemSet(VGAM_GRAPHICS,0,GR_WIDTH*GR_HEIGHT/8);
|
||||
MemSet(text.vga_alias,0,GR_WIDTH*GR_HEIGHT/8);
|
||||
|
||||
OutU8(VGAP_INDEX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_DATA,RED);
|
||||
for (i=0;i<200;i++)
|
||||
PlotXY(i,i);
|
||||
|
||||
OutU8(VGAP_INDEX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_DATA,GREEN);
|
||||
for (i=0;i<200;i++)
|
||||
PlotXY(100,i);
|
||||
|
||||
OutU8(VGAP_INDEX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_DATA,BLUE);
|
||||
for (i=0;i<200;i++)
|
||||
PlotXY(200-i,i);
|
||||
|
||||
+10
-10
@@ -263,7 +263,7 @@ class RangeJob
|
||||
|
||||
I64 TestCoreSubRange(RangeJob *r)
|
||||
{
|
||||
I64 i,j,m,n,n2,sf,result=0,range=r->hi-r->lo,
|
||||
I64 i,j,m,n,n2,sf,res=0,range=r->hi-r->lo,
|
||||
*sumfacts=MAlloc(range*sizeof(I64)),
|
||||
*residue =MAlloc(range*sizeof(I64));
|
||||
U16 *pow_cnt =MAlloc(range*sizeof(U16));
|
||||
@@ -303,21 +303,21 @@ I64 TestCoreSubRange(RangeJob *r)
|
||||
if (r->lo<=n2<r->hi && sumfacts[n2-r->lo]-n2-1==n ||
|
||||
TestSumFact(n2,sf,r->sqrt_primes,r->cbrt_primes,r->primes)) {
|
||||
DocPrint(r->doc,"%u:%u\n",n,sf-n-1);
|
||||
result++;
|
||||
res++;
|
||||
}
|
||||
}
|
||||
}
|
||||
Free(pow_cnt);
|
||||
Free(residue);
|
||||
Free(sumfacts);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
#define CORE_SUB_RANGE 0x1000
|
||||
|
||||
I64 TestCoreRange(RangeJob *r)
|
||||
{
|
||||
I64 i,result=0;
|
||||
I64 i,res=0;
|
||||
RangeJob rj;
|
||||
MemCpy(&rj,r,sizeof(RangeJob));
|
||||
for (i=r->lo;i<r->hi;i+=CORE_SUB_RANGE) {
|
||||
@@ -325,15 +325,15 @@ I64 TestCoreRange(RangeJob *r)
|
||||
rj.hi=i+CORE_SUB_RANGE;
|
||||
if (rj.hi>r->hi)
|
||||
rj.hi=r->hi;
|
||||
result+=TestCoreSubRange(&rj);
|
||||
res+=TestCoreSubRange(&rj);
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 MagicPairs(I64 N)
|
||||
{
|
||||
F64 t0=tS;
|
||||
I64 result=0;
|
||||
I64 res=0;
|
||||
I64 sqrt_primes,cbrt_primes,num_powprimes,
|
||||
i,k,n=(N-1)/mp_cnt+1;
|
||||
Prime *primes=PrimesNew(N,&sqrt_primes,&cbrt_primes);
|
||||
@@ -355,11 +355,11 @@ I64 MagicPairs(I64 N)
|
||||
rj[i].cmd=JobQue(&TestCoreRange,&rj[i],i,0);
|
||||
}
|
||||
for (i=0;i<mp_cnt;i++)
|
||||
result+=JobResultGet(rj[i].cmd);
|
||||
res+=JobResGet(rj[i].cmd);
|
||||
Free(powprimes);
|
||||
Free(primes);
|
||||
"Found:%u Time:%9.4f\n",result,tS-t0;
|
||||
return result;
|
||||
"Found:%u Time:%9.4f\n",res,tS-t0;
|
||||
return res;
|
||||
}
|
||||
|
||||
MagicPairs(1000000);
|
||||
|
||||
@@ -24,8 +24,8 @@ U0 UnlockedInc()
|
||||
glbl=0;
|
||||
tempm0=JobQue(&MPUnlockedInc,NULL,0,0);
|
||||
tempm1=JobQue(&MPUnlockedInc,NULL,1,0);
|
||||
JobResultGet(tempm0);
|
||||
JobResultGet(tempm1);
|
||||
JobResGet(tempm0);
|
||||
JobResGet(tempm1);
|
||||
"Correct Cnt:%X Actual Cnt:%X\n",CNT*2,glbl;
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ U0 LockedInc()
|
||||
glbl=0;
|
||||
tempm0=JobQue(&MPLockedInc,NULL,0,0);
|
||||
tempm1=JobQue(&MPLockedInc,NULL,1,0);
|
||||
JobResultGet(tempm0);
|
||||
JobResultGet(tempm1);
|
||||
JobResGet(tempm0);
|
||||
JobResGet(tempm1);
|
||||
"Correct Cnt:%X Actual Cnt:%X\n",CNT*2,glbl;
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -4,22 +4,22 @@ I64 MPSum(I64 my_mp_cnt)
|
||||
{//We could use the formula n*(n+1)/2
|
||||
I64 lo=mp_n*Gs->num/my_mp_cnt,
|
||||
hi=mp_n*(Gs->num+1)/my_mp_cnt,
|
||||
result=0,i;
|
||||
res=0,i;
|
||||
for (i=lo;i<hi;i++)
|
||||
result+=i;
|
||||
return result;
|
||||
res+=i;
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 Sum(I64 n,I64 my_mp_cnt)
|
||||
{
|
||||
CSrvCmd *tempm[MP_MAX_PROCESSORS];
|
||||
I64 result=0,i;
|
||||
I64 res=0,i;
|
||||
mp_n=n+1;
|
||||
for (i=0;i<my_mp_cnt;i++)
|
||||
tempm[i]=JobQue(&MPSum,my_mp_cnt,i,0);
|
||||
for (i=0;i<my_mp_cnt;i++)
|
||||
result+=JobResultGet(tempm[i]);
|
||||
return result;
|
||||
res+=JobResGet(tempm[i]);
|
||||
return res;
|
||||
}
|
||||
|
||||
#define SAMPLE_SIZE 100
|
||||
@@ -48,14 +48,14 @@ U0 MPAdd()
|
||||
I64 i,n,
|
||||
h=Fs->pix_width,
|
||||
v=Fs->pix_height;
|
||||
F64 t1,t2,results[NUM_TESTS];
|
||||
F64 t1,t2,ress[NUM_TESTS];
|
||||
CDC *dc=DCAlias;
|
||||
|
||||
for (i=0,n=MIN_VAL;i<NUM_TESTS;i++,n*=10) {
|
||||
t1=Test(n,1);
|
||||
t2=Test(n,mp_cnt);
|
||||
results[i]=t2*100.0/t1;
|
||||
"$$GREEN$$%8.4f%%$$FG$$\n\n",results[i];
|
||||
ress[i]=t2*100.0/t1;
|
||||
"$$GREEN$$%8.4f%%$$FG$$\n\n",ress[i];
|
||||
}
|
||||
PressAKey;
|
||||
|
||||
@@ -70,8 +70,8 @@ U0 MPAdd()
|
||||
for (i=0;i<NUM_TESTS-1;i++) {
|
||||
dc->color=RED;
|
||||
dc->pen_width=2;
|
||||
GrLine3(dc,i*h/(NUM_TESTS-1), v-results[i ]/MAX_PERCENT*v,0,
|
||||
(i+1)*h/(NUM_TESTS-1),v-results[i+1]/MAX_PERCENT*v,0);
|
||||
GrLine3(dc,i*h/(NUM_TESTS-1), v-ress[i ]/MAX_PERCENT*v,0,
|
||||
(i+1)*h/(NUM_TESTS-1),v-ress[i+1]/MAX_PERCENT*v,0);
|
||||
dc->color=GREEN;
|
||||
GrPrint(dc,i*h/(NUM_TESTS-1),v-FONT_HEIGHT,"10e%d",i+MIN_TEST);
|
||||
GrLine(dc,i*h/(NUM_TESTS-1),0,i*h/(NUM_TESTS-1),v);
|
||||
|
||||
@@ -132,7 +132,7 @@ U0 MPRadixSortDemo(I64 dummy=0)
|
||||
|
||||
MPRadixSortDemo;
|
||||
|
||||
/*$HL,0$ Results on 8 Cores 3.397GHz Core i7:
|
||||
/*$HL,0$ Ress on 8 Cores 3.397GHz Core i7:
|
||||
$FG,2$QSort$FG$
|
||||
Time: 0.759998
|
||||
$FG,2$QSortU32$FG$
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
//This shows a switch stmt with some null cases.
|
||||
//If no number for the case,
|
||||
//it uses one plus previous case number.
|
||||
//it uses one plus prev case number.
|
||||
|
||||
U0 NullCase()
|
||||
{
|
||||
@@ -8,11 +8,11 @@ U0 NullCase()
|
||||
for (i=0;i<20;i++)
|
||||
switch (i) {
|
||||
case: "Zero\n"; break; //Starts at zero
|
||||
case: "One\n"; break; //One plus previous case.
|
||||
case: "One\n"; break; //One plus prev case.
|
||||
case: "Two\n"; break;
|
||||
case: "Three\n"; break;
|
||||
case 10: "Ten\n"; break;
|
||||
case: "Eleven\n"; break; //One plus previous case.
|
||||
case: "Eleven\n"; break; //One plus prev case.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
Кь'^╩≥?ЪS■aтд?┤u∙кj^о?*П╗╔y╖р?Пe╒Щё┴з?аhYВвъ?mКc|≤Д?┴-еiU╟Е?в│v÷WбХ?ч/PдAК?
|
||||
•�yδ�•Ή?¦›T¤νaΏ?ΝsΙβΟ?Χ�Ϊ�OΡ?�ΜΣ-&”α?½Ρ*Υ»ε?β�›¤ωζ?�'γ!Ω‚η?‰?®{oθ?BQάa#Έο?
|
||||
@@ -1,11 +1,11 @@
|
||||
//This is sorted.
|
||||
0.014631
|
||||
0.073055
|
||||
0.074138
|
||||
0.078977
|
||||
0.245686
|
||||
0.393559
|
||||
0.554134
|
||||
0.570852
|
||||
0.856893
|
||||
0.981828
|
||||
0.148057
|
||||
0.226413
|
||||
0.264850
|
||||
0.317576
|
||||
0.427559
|
||||
0.437611
|
||||
0.492485
|
||||
0.581437
|
||||
0.743565
|
||||
0.876452
|
||||
@@ -1 +1 @@
|
||||
Þ/PÄAë?‰-ÅiU°å?ðe¢ý£‰Ú?ÁhY÷×ß?×�vŸWÂè?mëc|˜ä?‡u•Ëj^Ï?ëØ'^»™?ÿS”aÔÄ?*ð¨¥y§Ò?
|
||||
¦›T¤νaΏ?•�yδ�•Ή?�'γ!Ω‚η?β�›¤ωζ?ΝsΙβΟ?BQάa#Έο?½Ρ*Υ»ε?Χ�Ϊ�OΡ?‰?®{oθ?�ΜΣ-&”α?
|
||||
@@ -1,11 +1,11 @@
|
||||
//This is unsorted.
|
||||
0.981828
|
||||
0.554134
|
||||
0.570852
|
||||
0.393559
|
||||
0.014631
|
||||
0.856893
|
||||
0.245686
|
||||
0.074138
|
||||
0.073055
|
||||
0.078977
|
||||
0.148057
|
||||
0.437611
|
||||
0.226413
|
||||
0.581437
|
||||
0.264850
|
||||
0.317576
|
||||
0.427559
|
||||
0.743565
|
||||
0.876452
|
||||
0.492485
|
||||
@@ -6,8 +6,8 @@ one for fun.
|
||||
U8 *SuggestMatchForm(U8 *src)
|
||||
{
|
||||
I64 ch,ch1=0;
|
||||
U8 *result=MStrUtil(src,SUF_TO_UPPER),*dst;
|
||||
dst=src=result;
|
||||
U8 *res=MStrUtil(src,SUF_TO_UPPER),*dst;
|
||||
dst=src=res;
|
||||
while (ch=*src++) {
|
||||
if (!StrOcc("AEIOU",ch)) {
|
||||
if (ch=='C') ch='K';
|
||||
@@ -18,7 +18,7 @@ U8 *SuggestMatchForm(U8 *src)
|
||||
ch1=ch;
|
||||
}
|
||||
*dst=0;
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
/*Fmt of word lst entry:
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
U0 DrawIt(CTask *task,CDC *dc)
|
||||
{
|
||||
}
|
||||
|
||||
U0 AnimateTask(I64)
|
||||
{
|
||||
while (TRUE) {
|
||||
Sleep(10);
|
||||
}
|
||||
}
|
||||
|
||||
U0 Init()
|
||||
{
|
||||
}
|
||||
|
||||
U0 CleanUp()
|
||||
{
|
||||
}
|
||||
|
||||
U0 SongTask(I64)
|
||||
{
|
||||
Fs->task_end_cb=&SndTaskEndCB;
|
||||
MusicSettingsRst;
|
||||
while (TRUE) {
|
||||
Play("ABC");
|
||||
}
|
||||
}
|
||||
|
||||
U0 MyGame()
|
||||
{
|
||||
I64 sc;
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Fs->text_attr=YELLOW<<4+BLUE;
|
||||
Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs);
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocCursor;
|
||||
DocClear;
|
||||
|
||||
MenuPush(
|
||||
"File {"
|
||||
" Abort(,CH_SHIFT_ESC);"
|
||||
" Exit(,CH_ESC);"
|
||||
"}"
|
||||
"Play {"
|
||||
" Restart(,'\n');"
|
||||
" Up(,,SC_CURSOR_UP);"
|
||||
" Down(,,SC_CURSOR_DOWN);"
|
||||
" Left(,,SC_CURSOR_LEFT);"
|
||||
" Right(,,SC_CURSOR_RIGHT);"
|
||||
"}"
|
||||
);
|
||||
|
||||
Init;
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
Fs->draw_it=&DrawIt;
|
||||
|
||||
try {
|
||||
while (TRUE)
|
||||
switch (GetKey(&sc)) {
|
||||
case 0:
|
||||
switch (sc.u8[0]) {
|
||||
case SC_CURSOR_LEFT:
|
||||
break;
|
||||
case SC_CURSOR_RIGHT:
|
||||
break;
|
||||
case SC_CURSOR_UP:
|
||||
break;
|
||||
case SC_CURSOR_DOWN:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '\n':
|
||||
CleanUp;
|
||||
Init;
|
||||
break;
|
||||
case CH_SHIFT_ESC:
|
||||
case CH_ESC:
|
||||
goto mg_done;
|
||||
}
|
||||
mg_done: //Don't goto out of try
|
||||
} catch
|
||||
PutExcept;
|
||||
SettingsPop;
|
||||
CleanUp;
|
||||
MenuPop;
|
||||
}
|
||||
|
||||
MyGame;
|
||||
@@ -0,0 +1,16 @@
|
||||
U0 MyRead(U8 *filename)
|
||||
{
|
||||
CCmpCtrl *cc=CmpCtrlNew(MStrPrint("#include \"%s\"",filename));
|
||||
while (Lex(cc)) {
|
||||
"%03d:",cc->token;
|
||||
switch (cc->token) {
|
||||
case TK_IDENT: "IDENT:%s",cc->cur_str; break;
|
||||
case TK_STR: "STR:%s",cc->cur_str; break;
|
||||
case TK_CHAR_CONST: "CHAR:%d",cc->cur_i64; break;
|
||||
case TK_I64: "I64:%d",cc->cur_i64; break;
|
||||
case TK_F64: "F64:%d",cc->cur_f64; break;
|
||||
}
|
||||
'\n';
|
||||
}
|
||||
CmpCtrlDel(cc);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
I64 mp_not_done_flags;
|
||||
|
||||
U0 MPRoutine(CDoc *doc)
|
||||
{
|
||||
DocPrint(doc,"Core:%d\n",Gs->num);
|
||||
LBtr(&mp_not_done_flags,Gs->num);
|
||||
}
|
||||
|
||||
U0 Main()
|
||||
{
|
||||
I64 i;
|
||||
mp_not_done_flags=1<<mp_cnt-1;
|
||||
for (i=0;i<mp_cnt;i++)
|
||||
Spawn(&MPRoutine,DocPut,NULL,i);
|
||||
while (mp_not_done_flags)
|
||||
Yield;
|
||||
}
|
||||
|
||||
Main;
|
||||
@@ -0,0 +1,43 @@
|
||||
class MyMass:CMass
|
||||
{
|
||||
F64 radius;
|
||||
};
|
||||
|
||||
class MySpring:CSpring
|
||||
{
|
||||
};
|
||||
|
||||
CMathODE *ode=NULL;
|
||||
|
||||
U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)
|
||||
{
|
||||
MyMass *tempm1,*tempm2;
|
||||
|
||||
tempm1=ode->next_mass;
|
||||
while (tempm1!=&ode->next_mass) {
|
||||
tempm2=tempm1->next;
|
||||
while (tempm2!=&ode->next_mass) {
|
||||
tempm2=tempm2->next;
|
||||
}
|
||||
tempm1=tempm1->next;
|
||||
}
|
||||
}
|
||||
|
||||
U0 Init()
|
||||
{
|
||||
ode=ODENew(0,1e-4,ODEF_HAS_MASSES);
|
||||
ode->derivative=&MyDerivative;
|
||||
ode->drag_v2=0.002;
|
||||
ode->drag_v3=0.00001;
|
||||
ode->acceleration_limit=5e3;
|
||||
|
||||
QueIns(ode,Fs->last_ode);
|
||||
}
|
||||
|
||||
U0 CleanUp()
|
||||
{
|
||||
QueRem(ode);
|
||||
QueDel(&ode->next_mass,TRUE);
|
||||
QueDel(&ode->next_spring,TRUE);
|
||||
ODEDel(ode);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
RegSetDftEntry("MyCompany/MyApp","F64 best_score=9999;\n");
|
||||
RegExeBranch("MyCompany/MyApp");
|
||||
|
||||
U0 Main()
|
||||
{
|
||||
GetChar;
|
||||
RegWriteBranch("MyCompany/MyApp","F64 best_score=%5.4f;\n",best_score);
|
||||
}
|
||||
|
||||
Main;
|
||||
@@ -0,0 +1,14 @@
|
||||
U0 MyUtil(U8 *files_find_mask,U8 *fu_flags=NULL)
|
||||
{
|
||||
I64 fuf_flags=0;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tempde) {
|
||||
PutFileLink(tempde->full_name);
|
||||
'\n';
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
I64 MyUtilDoc(CDoc *doc,I64 fuf_flags)
|
||||
{
|
||||
Bool unlock=DocLock(doc);
|
||||
I64 res=0;
|
||||
CDocEntry *doc_e;
|
||||
DocRecalc(doc);
|
||||
doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
res++;
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
DocRecalc(doc);
|
||||
if (unlock)
|
||||
DocUnlock(doc);
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 MyUtilFile(U8 *filename,I64 fuf_flags)
|
||||
{//Optimize File.
|
||||
I64 res;
|
||||
CDoc *doc=DocRead(filename);
|
||||
if (res=MyUtilDoc(doc,fuf_flags)) {
|
||||
"%8d:%s\n",res,doc->filename.name;
|
||||
DocWrite(doc);
|
||||
}
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
I64 MyUtilLst(CDirEntry *tempde,I64 fuf_flags)
|
||||
{
|
||||
I64 res=0;
|
||||
CDirEntry *tempde1;
|
||||
while (tempde) {
|
||||
tempde1=tempde->next;
|
||||
if (tempde->attr & RS_ATTR_DIR) {
|
||||
if (tempde->sub) {
|
||||
"Processing Directory: %s\n",tempde->full_name;
|
||||
res+=MyUtilLst(tempde->sub,fuf_flags);
|
||||
}
|
||||
} else
|
||||
res+=MyUtilFile(tempde->full_name,fuf_flags);
|
||||
DirEntryDel(tempde);
|
||||
tempde=tempde1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
I64 MyUtil(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
||||
{
|
||||
I64 fuf_flags=0;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
return MyUtilLst(FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND),
|
||||
fuf_flags&~FUG_FILES_FIND);
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*Allows you to time insts.
|
||||
Results vary because the CPU does
|
||||
Ress vary because the CPU does
|
||||
parallel and out-of-order execution.
|
||||
*/
|
||||
|
||||
|
||||
@@ -68,28 +68,28 @@ U0 HtmlPutS(CDoc *doc,I64 u32_attr,I64 *_old_u32_attr,
|
||||
U8 *TOSLinkCvt2(U8 *filename,I64 line_num)
|
||||
{// ::/ --> http://www.templeos.org/Wb/
|
||||
//Make your own LinkCvt routine
|
||||
U8 *result=NULL,*st;
|
||||
U8 *res=NULL,*st;
|
||||
if (filename) {
|
||||
st=ChgExt(filename,"html");
|
||||
if (st && StrLen(st)>3 && !StrNCmp(st+1,":/",2))
|
||||
result=MStrPrint("http://www.templeos.org/Wb/%s#l%d",st+3,line_num);
|
||||
res=MStrPrint("http://www.templeos.org/Wb/%s#l%d",st+3,line_num);
|
||||
Free(st);
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U8 *TOSLinkCvt1(U8 *link_st)
|
||||
{
|
||||
static CDoc *bible=NULL;
|
||||
static I64 locks=0;
|
||||
U8 *result=NULL,*filename,*needle;
|
||||
U8 *res=NULL,*filename,*needle;
|
||||
I64 i,num;
|
||||
if (link_st) {
|
||||
switch (i=EdLinkCvt(link_st,&filename,&needle,&num)) {
|
||||
case LK_FILE_LINE:
|
||||
case LK_PLAIN_LINE:
|
||||
case LK_FILE:
|
||||
result=TOSLinkCvt2(filename,num);
|
||||
res=TOSLinkCvt2(filename,num);
|
||||
break;
|
||||
case -1:
|
||||
case LK_DEF:
|
||||
@@ -105,17 +105,17 @@ U8 *TOSLinkCvt1(U8 *link_st)
|
||||
if (!bible)
|
||||
bible=Adam("DocRead(\"%s\");",filename);
|
||||
if (DocFind(bible,num,needle))
|
||||
result=TOSLinkCvt2(filename,bible->cur_entry->y+1);
|
||||
res=TOSLinkCvt2(filename,bible->cur_entry->y+1);
|
||||
LBtr(&locks,0);
|
||||
break;
|
||||
default:
|
||||
if (DocFileEd(i,filename,needle,&num,EDF_UNCOLLAPSE|EDF_BAIL))
|
||||
result=TOSLinkCvt2(filename,num);
|
||||
res=TOSLinkCvt2(filename,num);
|
||||
}
|
||||
Free(filename);
|
||||
Free(needle);
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
|
||||
@@ -148,7 +148,7 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
|
||||
"<head>\n"
|
||||
"<meta http-equiv=\"Content-Type\" "
|
||||
"content=\"text/html;charset=US-ASCII\">\n"
|
||||
"<meta name=\"generator\" content=\"$TX,"TempleOS V4.05",D="DD_OS_NAME_VERSION"$\">\n";
|
||||
"<meta name=\"generator\" content=\"$TX,"TempleOS V4.06",D="DD_OS_NAME_VERSION"$\">\n";
|
||||
if (!body_header) body_header=
|
||||
"<body>\n"
|
||||
"<pre style=\"font-family:courier;font-size:10pt\">\n";
|
||||
|
||||
@@ -510,7 +510,7 @@
|
||||
231.231.121.94 - - [12/Feb/2015:12:21:21 -0800] "GET /robots.txt HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" "www.templeos.org"
|
||||
96.11.7.152 - - [12/Feb/2015:12:24:18 -0800] "GET /Wb/Apps/Psalmody/Examples/fog.html HTTP/1.1" 200 26215 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org"
|
||||
35.132.148.108 - - [12/Feb/2015:12:24:21 -0800] "GET /logs/access.log HTTP/1.1" 200 114097 "-" "Wget/1.15 (linux-gnu)" "www.templeos.org"
|
||||
69.53.241.54 - - [12/Feb/2015:12:25:36 -0800] "GET /Wb/Accts/TS/Web/TAD/2014/03/Rant140312.html++++++++++++++Result:+%ED%E5+%ED%E0%F8%EB%EE%F1%FC+%F4%EE%F0%EC%FB+%E4%EB%FF+%EE%F2%EF%F0%E0%E2%EA%E8 HTTP/1.1" 404 89 "http://www.templeos.org/Wb/Accts/TS/Web/TAD/2014/03/Rant140312.html++++++++++++++Result:+%ED%E5+%ED%E0%F8%EB%EE%F1%FC+%F4%EE%F0%EC%FB+%E4%EB%FF+%EE%F2%EF%F0%E0%E2%EA%E8;" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0" "www.templeos.org"
|
||||
69.53.241.54 - - [12/Feb/2015:12:25:36 -0800] "GET /Wb/Accts/TS/Web/TAD/2014/03/Rant140312.html++++++++++++++Res:+%ED%E5+%ED%E0%F8%EB%EE%F1%FC+%F4%EE%F0%EC%FB+%E4%EB%FF+%EE%F2%EF%F0%E0%E2%EA%E8 HTTP/1.1" 404 89 "http://www.templeos.org/Wb/Accts/TS/Web/TAD/2014/03/Rant140312.html++++++++++++++Res:+%ED%E5+%ED%E0%F8%EB%EE%F1%FC+%F4%EE%F0%EC%FB+%E4%EB%FF+%EE%F2%EF%F0%E0%E2%EA%E8;" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0" "www.templeos.org"
|
||||
69.53.241.54 - - [12/Feb/2015:12:25:36 -0800] "GET / HTTP/1.1" 200 6329 "http://www.templeos.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0" "www.templeos.org"
|
||||
96.156.190.246 - - [12/Feb/2015:12:26:42 -0800] "GET / HTTP/1.1" 200 6329 "https://www.google.ro/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org"
|
||||
96.156.190.246 - - [12/Feb/2015:12:26:43 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org"
|
||||
@@ -561,7 +561,7 @@
|
||||
227.169.17.38 - - [12/Feb/2015:14:08:07 -0800] "GET /Wb/Doc/CharOverview.html HTTP/1.1" 200 6197 "http://www.google.com/url?sa=t&rct=j&q=ascii+temple&source=web&cd=19&ved=0CDQQFjAIOAo&url=http%3A%2F%2Fwww.templeos.org%2FWb%2FDoc%2FCharOverview.html&ei=MSTdVLjmHpT_sATX64L4BA&usg=AFQjCNEeIHKVUE8TiGGjx2BF_AnsVKDLFQ" "Mozilla/5.0 (iPad; CPU OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53" "www.templeos.org"
|
||||
54.95.196.143 - - [12/Feb/2015:14:09:44 -0800] "GET /Wb/Home/Web/Downloads.html HTTP/1.1" 200 7086 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org"
|
||||
147.107.16.169 - - [12/Feb/2015:14:13:31 -0800] "HEAD / HTTP/1.1" 200 0 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)" "www.templeos.org"
|
||||
132.172.136.207 - - [12/Feb/2015:14:13:31 -0800] "GET / HTTP/1.1" 200 6329 "http://www.bing.com/search?q=templeos&src=IE-TopResult&FORM=IETR02&conversationid=" "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko" "templeos.org"
|
||||
132.172.136.207 - - [12/Feb/2015:14:13:31 -0800] "GET / HTTP/1.1" 200 6329 "http://www.bing.com/search?q=templeos&src=IE-TopRes&FORM=IETR02&conversationid=" "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko" "templeos.org"
|
||||
132.172.136.207 - - [12/Feb/2015:14:13:34 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko" "templeos.org"
|
||||
35.18.127.92 - - [12/Feb/2015:14:16:31 -0800] "GET /beacon.nist.gov/rest/record/1417177380 HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org"
|
||||
15.172.25.14 - - [12/Feb/2015:14:18:10 -0800] "GET /Wb/Accts/TS/Web/TempleOSV0218A.BMP HTTP/1.1" 404 89 "-" "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)" "www.templeos.org"
|
||||
|
||||
Reference in new issue
Block a user