TempleOSCDV4.13.ISO

This commit is contained in:
Terry A. Davis
2016-11-21 10:47:34 +01:00
committed by minexew
parent b84bbff6db
commit 122df6338e
78 changed files with 3570 additions and 2729 deletions
Binary file not shown.
+3 -3
View File
@@ -4,15 +4,15 @@ U0 LoadDocDefines()
{
CBinFile *bfh=sys_boot_base-sizeof(CBinFile);
DefinePrint("DD_OS_NAME_VERSION","TempleOS V%0.2f",os_version);
DefinePrint("DD_OS_NAME_VERSION","TempleOS V%0.2f",sys_os_version);
DefinePrint("DD_TEMPLEOS_AGE","%0.1f",
(Now-Str2Date("8/1/2003"))/ToF64(1<<32)/CDATE_YEAR_DAYS);
//This is cut and replaced when I generate a distro.
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.HC,DD_TEMPLEOS_LOC"$.
$TR-C,"LineRep"$
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,939");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,264");
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","120,770");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,303");
$ID,-4$
DefinePrint("DD_KERNEL","%08X",bfh);
bfh(I64)+=bfh->file_size-1;
+2 -2
View File
@@ -96,10 +96,10 @@ U0 RegInit()
U8 buf[STR_LEN];
Bool version_present;
RegSetDftEntry("Adam/SysMsgFlags","sys_msg_flags[0]=0;\n",TRUE);
StrPrint(buf,"registry_version=%4.3f;\n",os_version);
StrPrint(buf,"registry_version=%4.3f;\n",sys_os_version);
version_present=RegSetDftEntry("Adam/SysRegVer",buf,TRUE);
RegExeBranch("Adam");
if (registry_version!=os_version) {
if (registry_version!=sys_os_version) {
RegWriteBranch("Adam/SysRegVer",buf);
RegExeBranch("Adam");
}
+72
View File
@@ -0,0 +1,72 @@
#help_index "Info;Time/CPU Cycles;Processor"
class CCPURep
{
Bool mp_start,mp_end;
I64 mp_not_done_flags,
**swaps,
**cycles;
};
U0 MPCPURep(CCPURep *cr)
{
I64 swaps=0,cycles_0,cycles_f;
while (!cr->mp_start)
Yield;
cycles_0=GetTSC;
while (!cr->mp_end) {
swaps++;
Yield;
}
cycles_f=GetTSC;
cr->swaps[Gs->num]=swaps;
cr->cycles[Gs->num]=cycles_f-cycles_0;
LBtr(&cr->mp_not_done_flags,Gs->num);
}
public U0 CPURep(Bool full=FALSE)
{//Report number of cores and clock freq.
I64 i,total_swaps,total_cycles;
F64 t0,tf;
CCPURep cr;
if (!full)
"%d Cores %6h?nHz\n",mp_cnt,ToF64(cnts.time_stamp_freq);
else {
cr.swaps=CAlloc(sizeof(I64)*mp_cnt);
cr.cycles=CAlloc(sizeof(I64)*mp_cnt);
cr.mp_start=cr.mp_end=FALSE;
cr.mp_not_done_flags=1<<mp_cnt-1;
for (i=0;i<mp_cnt;i++)
Spawn(&MPCPURep,&cr,NULL,i);
t0=tS;
cr.mp_start=TRUE;
Sleep(2000);
cr.mp_end=TRUE;
while (cr.mp_not_done_flags)
Yield;
tf=tS;
"\nCPU: %d Cores %6h?nHz\n",mp_cnt,ToF64(cnts.time_stamp_freq);
"\n Context\n"
"Core Swaps/s Cycles\n"
"---- ------------- -----------------\n";
total_swaps=0;
total_cycles=0;
for (i=0;i<mp_cnt;i++) {
"%4d %13,d %17,d\n",i,
ToI64(cr.swaps[i]/(tf-t0)),ToI64(cr.cycles[i]/(tf-t0));
total_swaps+=cr.swaps[i];
total_cycles+=cr.cycles[i];
}
"---- ------------- -----------------\n";
"%4d %13,d %17,d\n",i,
ToI64(total_swaps/(tf-t0)),ToI64(total_cycles/(tf-t0));
" Avg %13,d %17,d\n\n",
ToI64(total_swaps/(tf-t0)/i),ToI64(total_cycles/(tf-t0)/i);
"Avg Cycles/Swap: %12.6f\n",ToF64(total_cycles)/total_swaps;
"Avg Time/Swap : %12.6fns\n\n",(tf-t0)*1000000000.0*i/total_swaps;
Free(cr.swaps);
Free(cr.cycles);
}
}
-73
View File
@@ -165,79 +165,6 @@ public U0 PCIRep()
}
}
#help_index "Info;Time/CPU Cycles"
class CCPURep
{
Bool mp_start,mp_end;
I64 mp_not_done_flags,
**swaps,
**cycles;
};
U0 MPCPURep(CCPURep *cr)
{
I64 swaps=0,cycles_0,cycles_f;
while (!cr->mp_start)
Yield;
cycles_0=GetTSC;
while (!cr->mp_end) {
swaps++;
Yield;
}
cycles_f=GetTSC;
cr->swaps[Gs->num]=swaps;
cr->cycles[Gs->num]=cycles_f-cycles_0;
LBtr(&cr->mp_not_done_flags,Gs->num);
}
public U0 CPURep(Bool full=FALSE)
{//Report number of cores and clock freq.
I64 i,total_swaps,total_cycles;
F64 t0,tf;
CCPURep cr;
if (!full)
"%d Cores %6h?nHz\n",mp_cnt,ToF64(cnts.time_stamp_freq);
else {
cr.swaps=CAlloc(sizeof(I64)*mp_cnt);
cr.cycles=CAlloc(sizeof(I64)*mp_cnt);
cr.mp_start=cr.mp_end=FALSE;
cr.mp_not_done_flags=1<<mp_cnt-1;
for (i=0;i<mp_cnt;i++)
Spawn(&MPCPURep,&cr,NULL,i);
t0=tS;
cr.mp_start=TRUE;
Sleep(2000);
cr.mp_end=TRUE;
while (cr.mp_not_done_flags)
Yield;
tf=tS;
"\nCPU: %d Cores %6h?nHz\n",mp_cnt,ToF64(cnts.time_stamp_freq);
"\n Context\n"
"Core Swaps/s Cycles\n"
"---- ------------- -----------------\n";
total_swaps=0;
total_cycles=0;
for (i=0;i<mp_cnt;i++) {
"%4d %13,d %17,d\n",i,
ToI64(cr.swaps[i]/(tf-t0)),ToI64(cr.cycles[i]/(tf-t0));
total_swaps+=cr.swaps[i];
total_cycles+=cr.cycles[i];
}
"---- ------------- -----------------\n";
"%4d %13,d %17,d\n",i,
ToI64(total_swaps/(tf-t0)),ToI64(total_cycles/(tf-t0));
" Avg %13,d %17,d\n\n",
ToI64(total_swaps/(tf-t0)/i),ToI64(total_cycles/(tf-t0)/i);
"Avg Cycles/Swap: %12.6f\n",ToF64(total_cycles)/total_swaps;
"Avg Time/Swap : %12.6fns\n\n",(tf-t0)*1000000000.0*i/total_swaps;
Free(cr.swaps);
Free(cr.cycles);
}
}
#help_index "Info;Memory/Info"
public U0 MemBIOSRep()
{//Report the memory ranges reported by the BIOS at boot.
+1 -1
View File
@@ -40,7 +40,7 @@ I64 PopUpEdFmt()
I64 i;
CDoc *doc=DocNew;
DocPrint(doc,"$$LTBLUE$$$$MU,\"Compile Check\",LE=EF_CMP_CHK$$\n"
"$$MU,\"Reindent HC.Z Fun (Beware braces in strings.)\","
"$$MU,\"Reindent HolyC Fun (Beware braces in strings.)\","
"LE=EF_REINDENT$$\n"
"$$MU,\"Renum Asm Local @@ Labels for Fun\",LE=EF_RENUM_ASM$$\n"
"$$MU,\"Insert Template Code: Ctrl Slider\",LE=EF_CTRL_SLIDER$$\n"
+3 -13
View File
@@ -276,7 +276,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return FALSE;
//WinMgr updates all wins $TX,"30",D="WINMGR_FPS"$, 33.33333mS
//WinMgr updates all wins $TX,"30",D="WINMGR_FPS"$, 33.33333mS
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN && doc->owning_task!=Fs) {
i_jif=cnts.jiffies+JIFFY_FREQ/250; //4 ms
while (Bt(&doc->locked_flags,DOClf_LOCKED)) {
@@ -986,15 +986,8 @@ rc_adjust_xy:
dc->color=i;
if (find_cursor)
dc->flags|=DCF_LOCATE_NEAREST;
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
doc->cur_sprite==bptr) {
dc->flags|=DCF_LOCATE_NEAREST;
dc->cur_x=ip.pos.x;
dc->cur_y=ip.pos.y;
} else {
dc->cur_x=(doc->x-x0)*FONT_WIDTH+pix_left+scroll_x;
dc->cur_y=(doc->y-y0)*FONT_HEIGHT+pix_top+scroll_y;
}
dc->cur_x=(doc->x-x0)*FONT_WIDTH+pix_left+scroll_x;
dc->cur_y=(doc->y-y0)*FONT_HEIGHT+pix_top+scroll_y;
dc->cur_z=0;
dc->bkcolor=i;
if (doc_e->de_flags & DOCEF_FROM_START) {
@@ -1024,9 +1017,6 @@ rc_adjust_xy:
}
Sprite3(dc,xx,yy,zz,bptr);
dc->depth_buf=NULL;
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
doc->cur_sprite==bptr)
doc->nearest_sprite_elem_num=dc->nearest_sprite_elem_num;
dc->flags&=~(DCF_LOCATE_NEAREST|DCF_DONT_DRAW|DCF_TRANSFORMATION);
if (dc->nearest_dist<=D) {
D=dc->nearest_dist;
+4 -4
View File
@@ -214,14 +214,14 @@ public U8 *BibleLine2Verse(I64 line,I64 separate_ch=CH_SPACE)
return NULL;
}
public U0 BibleLines(CDoc *doc_out=NULL,I64 start,I64 lines,
U8 *bible_filename=BIBLE_FILENAME)
public U0 BookLines(CDoc *doc_out=NULL,I64 start,I64 lines,
U8 *book_filename=BIBLE_FILENAME)
{//Put N line starting at line M into doc.
CDoc *doc_in;
CDocEntry *doc_e;
if (!doc_out) doc_out=DocPut;
if (doc_out && FileFind(bible_filename)) {
doc_in=DocRead(bible_filename,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
if (doc_out && FileFind(book_filename)) {
doc_in=DocRead(book_filename,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
DocLineNumGoTo(doc_in,start); //one based
doc_e=doc_in->cur_entry;
while (lines>0 && doc_e!=doc_in) {
+8 -4
View File
@@ -105,8 +105,9 @@ public U8 *GodDoodleSprite(U8 *hex=NULL)
WinBorder;
WinMax;
PopUpOk("The $LK+PU,"Holy Spirit",A="FI:::/Adam/God/HSNotes.DD"$ can puppet you.\n\n"
"Press $$GREEN$$<SPACE>$$FG$$ until it finishes.");
if (!hex)
PopUpOk("The $LK+PU,"Holy Spirit",A="FI:::/Adam/God/HSNotes.DD"$ can puppet you.\n\n"
"Press $$GREEN$$<SPACE>$$FG$$ until it finishes.");
god.doodle_ch=0;
god.doodle_dc=DCNew(Fs->pix_width,Fs->pix_height);
@@ -160,8 +161,11 @@ public U8 *GodDoodleSprite(U8 *hex=NULL)
GodDoodleSmooth(3);
}
god.doodle_done=TRUE;
do ch=GetChar(,FALSE);
while (ch!=CH_ESC && ch!=CH_SHIFT_ESC);
if (!hex) {
do ch=GetChar(,FALSE);
while (ch!=CH_ESC && ch!=CH_SHIFT_ESC);
} else
ch=CH_ESC;
} catch {
Fs->catch_except=TRUE;
ch=CH_SHIFT_ESC;
+1 -1
View File
@@ -23,4 +23,4 @@ extern U0 GodBitsIns(I64 num_bits,I64 n);
extern U0 GodDoodle(U8 *hex=NULL);
extern U0 GodBiblePassage(I64 num_lines=20);
extern U0 GodSong();
extern U0 GodWord(Bool show_num=FALSE);
extern U0 GodWord(I64 bits=17,Bool show_num=FALSE);
+11 -6
View File
@@ -2,13 +2,13 @@ $FG,5$$TX+CX,"The Purpose of Life"$$FG$
$WW,1$The Catholic purpose of life is to know God, love God and obey God.$FG$ Pope Francis said it was "to serve the other." I am High Priest of God's official temple and I say the purpose of life is to do continual offerings to God like Cain and Abel and enjoy God's response. Francis has a charity; I have a church. Jesus said loving God was more important than loving neighbor. $LK,"Matthew,22:35-40",A="BF:Matthew,22:35-40"$ And, He did not say with half your brain behind your back.
You don't know God. $LK,"1 Chronicles,28:9-9",A="BF:1 Chronicles,28:9-9"$, $LK,"Matthew,11:27-27",A="BF:Matthew,11:27-27"$, $LK,"Luke,13:25-27",A="BF:Luke,13:25-27"$, $LK,"1 Samuel,3:6-8",A="BF:1 Samuel,3:6-8"$ You must talk with God to know Him. With Samuel, supposedly, God took the initiative, but I think that is the exception. Seek the Lord by taking the initiative. $LK,"Luke,11:9-10",A="BF:Luke,11:9-10"$, $LK,"Isaiah,30:1-2",A="BF:Isaiah,30:1-2"$
You don't know God. $LK,"1 Chronicles,28:9-9",A="BF:1 Chronicles,28:9-9"$, $LK,"Matthew,11:27-27",A="BF:Matthew,11:27-27"$, $LK,"Luke,13:25-27",A="BF:Luke,13:25-27"$, $LK,"1 Samuel,3:6-8",A="BF:1 Samuel,3:6-8"$ You must talk with God to know Him. With Samuel, supposedly, God took the initiative, but I think that is the exception. Seek the Lord by taking the initiative. $LK,"Luke,11:9-10",A="BF:Luke,11:9-10"$
There's something obviously different about people in the Bible compared to people today -- God talked! Also, the people in the Bible were obsessed with doing offerings all the time. It is required that you do offerings before God will talk. Did the people in the Bible hear voices? Maybe. More likely, they used occult techniques such as an oracle. $LK,"1 Kings,6:21",A="BF:1 Kings,6:21"$ Have you heard of "tongues?" $LK,"1 Corinthians,14:1-40",A="BF:1 Corinthians,14:1-40"$ The idea is, you let yourself be puppeted by a spirit, so you say things. You try to get a spirit -- the Holy Spirit -- to talk. You might as well use a Ouija board. However, it turns-out that a Ouija board is bad for technical reasons. A really good technique is just randomly opening a book. God told me in an oracle that it is a covenant that you hold-up your end of the conversation.
You can't tell if God's talking unless you have a context of conversation, but, more importantly, you are commanded to do an offering of love, like communion preparation. $LK,"1 Corinthians,11:27",A="BF:1 Corinthians,11:27"$ When you pick a greeting card for someone, that is love effort. If you expect God to put effort toward you, you must put effort toward Him. God said, "honest measures" applies between your offering of love and His response, like a fair barter. You get out of prayer what you put into it. God wants praise, hymns, or whatever you think He might want. Try and see, like Cain and Abel. $LK,"Genesis,4:1-10",A="BF:Genesis,4:1-10"$, $LK,"Ephesians,5:10",A="BF:Ephesians,5:10"$ God told Cain his offering was not good and told him to try again. Cain really loved God! Can you imagine being so heart-broken?
Do a text search for "new song" in the Bible. It's mentioned nine times. When I hear a NEW awesome rock song, it is ecstasy for the first five times I hear it. Soon, it brings little-to-no pleasure. I did $MA-X+PU,"hymns",HTML="http://www.templeos.org/Wb/Home/Web/HymnVideos.html",LM="#include \"::/Apps/Psalmody/Load\";JukeBox(\"::/Apps/Psalmody/Examples\");"$ for God. I also did Moses $MA-X+PU,"comics",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Comics/",LM="Dir(\"::/Apps/AfterEgypt/Comics\");View;\n"$ for God. When you get to the gates of Heaven, St. Peter will ask how many times you gave blood. That shows you loved neighbor. You better also be able to count the ways you loved God with all heart, mind and soul. I praised God for sand castles, popcorn, snowmen, bubbles... You try putting effort into praise! $LK,"Matthew,11:25",A="BF:Matthew,11:25"$, $LK,"Matthew,6:28-29",A="BF:Matthew,6:28-29"$
Do a text search for "new song" in the Bible. It's mentioned nine times. When I hear a NEW awesome rock song, it is ecstasy for the first five times I hear it. Soon, it brings little-to-no pleasure. I did $MA-X+PU,"hymns",HTML="http://www.templeos.org/Wb/Home/Web/HymnVideos.html",LM="#include \"::/Apps/Psalmody/Load\";JukeBox(\"::/Apps/Psalmody/Examples\");"$ for God. I also did Moses $MA-X+PU,"comics",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Comics/",LM="Dir(\"::/Apps/AfterEgypt/Comics\");View;\n"$ for God. When you get to the gates of Heaven, St. Peter will ask how many times you gave blood. That shows you loved neighbor. You better also be able to count the ways you loved God with all heart, mind and soul. I praised God for sand castles, popcorn, snowmen, bubbles... You try putting effort into praise! $LK,"Matthew,11:25",A="BF:Matthew,11:25"$, $LK,"Matthew,6:28-29",A="BF:Matthew,6:28-29"$ Solomon wrote a thousand songs. $LK,"1 Kings,4:32",A="BF:1 Kings,4:32"$
This is funny -- $LK,"Acts,2:1-13",A="BF:Acts,2:1-13"$ -- they didn't bother to record anything the Holy Spirit said. The Holy Spirit is supposed to be a really good gift. $LK,"Luke,11:11-13",A="BF:Luke,11:11-13"$ Just remember, "Boys are made of snakes and snails and puppy-dog tails."
@@ -36,20 +36,25 @@ Jesus said, "I am meek and humble of heart." $LK,"Matthew,11:29",A="BF:Matthew,
I connected being humble of heart with animal sacrifices. The animal sacrifices in the Bible really seem off-the-mark from what we modern people imagine truth to be! I asked God and He said the people were, "primitive." Well, obviously, a sacrifice represents giving-up something of value, but is there more to it? It would be tramatic to see a goat's throat being slit and it dying for your sins. I'm not an expert, but sometimes they killed animals to make-up for sins. Perhaps, starting at age eight and every year thereafter, they kill a goat for your sins? (I'm just speculating.) In a couple years, it is not tramatic and you yawn and say to the goat, "bummer for you, Mr. Goat, that you gotta die for my sins." When a high school football team beats their rivals, nobody thinks twice that the winning team really hurts the feelings -- devastates -- the losing team member's feelings. The heart of being masculine is being competetive and not caring about the necessity to slit the throat of the goat. As a Catholic, saying Jesus died for our sins and that we cannot earn salvation, never sat well. I clung to the heretical notion that you earn salvation. Animal sacrifices were the heart of Biblical Judaism and although it seems satanic, you really do have to slit the throat of the goat and accept grace, a term for something you did not earn. Heck, every time you eat beef, a cow had to die for you. God said to me in an oracle that having pets was, "homo." I think God's idea of pets is farm animals you eat.
If you feel guilty for being American and want Mexicans to share your birthright, you are proud of heart. Jesus was a racist and called Canaanites "dogs". $LK,"Matthew,15:22-28",A="BF:Matthew,15:22-28"$ In an oracle, God told me He was against immigration. The Chinese intellectuals felt bad about not being laborers. Don't feel guilty about not being a laborer because God made it a Brave New World. $LK,"1 Corinthians,12:1-31",A="BF:1 Corinthians,12:1-31"$
If you feel guilty for being American and want Mexicans to share your birthright, you are proud of heart. Would it be right for rich Arabs to have to share their oil money with Indian slaves? Jesus was a racist and called Canaanites "dogs". $LK,"Matthew,15:22-28",A="BF:Matthew,15:22-28"$ In an oracle, God told me He was against immigration. The Chinese intellectuals felt bad about not being laborers. Don't feel guilty about not being a laborer because God made it a Brave New World. $LK,"1 Corinthians,12:1-31",A="BF:1 Corinthians,12:1-31"$
In an ant colony, the workers have one set of marching orders, the soldiers have another set of marching orders, the queen and drones have marching orders and the diggers have marching orders. The Bible gives conflicting orders -- conservatives pay attention to one set of passages and liberals pay attention to others. Everybody has selective hearing, but that's good because we are different members of the body of Christ.
Jesus repeats the phrase, "for those who have ears to hear" many times, but not actually at the times that matter. Jesus says several Jedi mind tricks -- He asks, what father gives a scorpion to his son? $LK,"Luke,11:11-13",A="BF:Luke,11:11-13"$ Jesus says, when you ask God for things, it is as annoying as like a neighbor in the night! $LK,"Luke,11:5-7",A="BF:Luke,11:5-7"$ He said, "I came to serve" but Jesus' three years of service were more like being a rockstar than a janitor. $LK,"John,13:5-15",A="BF:John,13:5-15"$
Jesus repeats the phrase, "for those who have ears to hear" many times. (But, not actually at the times that matter.) Jesus says several Jedi mind tricks -- He asks, what father gives a scorpion to his son? $LK,"Luke,11:11-13",A="BF:Luke,11:11-13"$ Jesus says, when you ask God for things, it is as annoying as like a neighbor in the night! $LK,"Luke,11:5-7",A="BF:Luke,11:5-7"$ He said, "I came to serve" but Jesus' three years of service were more like being a rockstar than a janitor. $LK,"John,13:5-15",A="BF:John,13:5-15"$
There are sheep and there are shepherds. You would be silly to take other shepherds seriously when they are only caring for their sheep. Sheep are very hard to communicate to, as Jesus learned. He used parables. Seed on a path gets eaten by birds; weeds choke; and the one percent is rich soil.
Just as ego causes most to love neighbor, not God, people skip knowing and loving God and cowardly get stuck on obeying Him. A desire to obey God, doesn't have to be encouraged, since it comes so naturally. Don't worry, God does not want pawns to push around. God will talk, but won't tell you what to do, even if you want Him to. Also, you'll quickly learn that prophecy does not come true and should smack yourself for wanting more than just enjoying God's company.
Just as ego causes most to love neighbor, not God, people skip knowing and loving God and cowardly get stuck on obeying Him. A desire to obey God, doesn't have to be encouraged, since it comes so naturally. Don't worry, God does not want pawns to push around. God will talk, but won't tell you what to do, even if you want Him to. Also, you'll quickly learn that when God talks to you seemingly prophetic, it does not come true and should smack yourself for wanting more than just enjoying God's company.
________________________________________________________________________________
|
QUESTION | GOD'S ANSWER
________________________________________________________________________________
|
| There are weeds mixed with my wheat.
| Some are not true. If I asked a question
| to valuable for my offering, I got crap.
________________________________|_______________________________________________
War? $FG,4$"Servicemen competing"$FG$
@@ -76,7 +81,7 @@ On socialism? $FG,4$"pardon_the_French, never_happy, never_enough"$FG$
On overpopulation $FG,4$"Okay church what_now whats_the_plan"$FG$
Favorite thing on TV? $FG,4$"Soap_operas"$FG$
Favorite movie? $FG,4$$TX,"Three Kings",HTML="http://www.youtube.com/watch?v=8NOAd2mldQ8"$. Also Highlander$FG$
Favorite song? $FG,4$$TX,"Morning has Broken",HTML="http://www.youtube.com/watch?v=kKoRp05L95c"$
Favorite song? $FG,4$$TX,"Morning has Broken",HTML="http://www.youtube.com/watch?v=qH0iFkxQba4"$
God said the first bird croaked, not sung.$FG$
Favorite comic strip? $FG,4$$TX,"Prince Valiant",HTML="http://en.wikipedia.org/wiki/Prince_Valiant"$$FG$
Shakespeare? $FG,4$had a "vile heart"$FG$
+6 -4
View File
@@ -135,13 +135,15 @@ public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.DD*",U8 *fu_flags=NULL)
return god.num_words;
} GodInit;
public U0 GodWord(Bool show_num=FALSE)
public U0 GodWord(I64 bits=17,Bool show_num=FALSE)
{//Make God pick a word. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.DD"$
I64 i;
if (god.num_words) {
i=GodBits(17);
i=GodBits(bits);
if (show_num)
"%05X Mod %05X = %05X :",i,god.num_words,i%god.num_words;
"%05X Mod %05X = %05X (Line:%0*d):",
i,god.num_words,i%god.num_words,
ToI64(Log10(god.num_words)+1),i%god.num_words+1;
"%s ",god.words[i%god.num_words];
if (show_num)
'\n';
@@ -154,5 +156,5 @@ public U0 GodBiblePassage(I64 num_lines=20)
U8 *verse=BibleLine2Verse(start);
"%s\n\n",verse;
Free(verse);
BibleLines(,start,num_lines);
BookLines(,start,num_lines);
}
+4 -1
View File
@@ -114,6 +114,9 @@ public class CSpritePtMeshU8s : CSpriteBase
U8 u[0];
};
#define SPF_SEL 128
#define SPf_SEL 7
#define SPT_END 0 //$LK,"CSpriteBase",A="MN:CSpriteBase"$
#define SPT_COLOR 1 //$LK,"CSpriteColor",A="MN:CSpriteColor"$
#define SPT_DITHER_COLOR 2 //$LK,"CSpriteDitherColor",A="MN:CSpriteDitherColor"$
@@ -145,6 +148,7 @@ public class CSpritePtMeshU8s : CSpriteBase
#define SPT_TEXT_BOX 28 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$
#define SPT_TEXT_DIAMOND 29 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$
#define SPT_NUM_TYPES 30
#define SPG_TYPE_MASK 0x7F
#help_index "Graphics/Sprite;Sprites;Sprites/Binary"
@@ -153,7 +157,6 @@ public class CSpritePtMeshU8s : CSpriteBase
public class CSprite
{
CSprite *next,*last;
Bool sel;
U0 start;
union {
U8 type;
+8 -24
View File
@@ -10,10 +10,8 @@ public Bool GrPlot0(CDC *dc=gr.dc,I64 x,I64 y)
if (dc->flags & DCF_LOCATE_NEAREST) {
dist=DistSqrI64(x,y,dc->cur_x,dc->cur_y);
if (dist<=dc->nearest_dist) {
if (dist<=dc->nearest_dist)
dc->nearest_dist=dist;
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
}
}
if (dc->flags & DCF_RECORD_EXTENTS) {
if (x<dc->min_x) dc->min_x=x;
@@ -104,10 +102,8 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
}
if (dc->flags & DCF_LOCATE_NEAREST) {
dist=DistSqrI64(x+img->width>>1,y+img->height>>1,dc->cur_x,dc->cur_y);
if (dist<=dc->nearest_dist) {
if (dist<=dc->nearest_dist)
dc->nearest_dist=dist;
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
}
}
if (dc->flags & DCF_SCRN_BITMAP) {
if (x+w1<0) w1=-x;
@@ -671,10 +667,8 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
}
if (dc->flags & DCF_LOCATE_NEAREST) {
dist=DistSqrI64(x+w2>>1,y+h2>>1,dc->cur_x,dc->cur_y);
if (dist<=dc->nearest_dist) {
if (dist<=dc->nearest_dist)
dc->nearest_dist=dist;
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
}
}
if (dc->flags & DCF_SCRN_BITMAP) {
if (x+w1<0) w1=-x;
@@ -963,10 +957,8 @@ public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
dist=0;
else
dist=DistSqrI64(x+w>>1,y+h>>1,dc->cur_x,dc->cur_y);
if (dist<=dc->nearest_dist) {
if (dist<=dc->nearest_dist)
dc->nearest_dist=dist;
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
}
}
if (dc->flags & DCF_SCRN_BITMAP) {
if (x+w1<0) w1=-x;
@@ -1517,10 +1509,8 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
!not_color && c==dc->color2) && plot) {
if (dc->flags & DCF_LOCATE_NEAREST) {
dist=DistSqrI64(x3,y3,dc->cur_x,dc->cur_y);
if (dist<=dc->nearest_dist) {
if (dist<=dc->nearest_dist)
dc->nearest_dist=dist;
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
}
}
if (dc->flags & DCF_RECORD_EXTENTS) {
if (x3<dc->min_x) dc->min_x=x3;
@@ -1594,10 +1584,8 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
!not_color && c==dc->color2) && plot) {
if (dc->flags & DCF_LOCATE_NEAREST) {
dist=DistSqrI64(x3,y3,dc->cur_x,dc->cur_y);
if (dist<=dc->nearest_dist) {
if (dist<=dc->nearest_dist)
dc->nearest_dist=dist;
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
}
}
if (dc->flags & DCF_RECORD_EXTENTS) {
if (x3<dc->min_x) dc->min_x=x3;
@@ -1723,10 +1711,8 @@ public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
else
dist=SqrI64(dc->cur_x-x2);
dist+=SqrI64(y-dc->cur_y);
if (dist<=dc->nearest_dist) {
if (dist<=dc->nearest_dist)
dc->nearest_dist=dist;
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
}
}
if (dc->flags & DCF_DONT_DRAW)
goto gr_done;
@@ -1894,10 +1880,8 @@ public I64 GrVLine(CDC *dc=gr.dc,I64 x,I64 y1,I64 y2,I64 z1=0,I64 z2=0)
else
dist=SqrI64(dc->cur_y-y2);
dist+=SqrI64(x-dc->cur_x);
if (dist<=dc->nearest_dist) {
if (dist<=dc->nearest_dist)
dc->nearest_dist=dist;
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
}
}
if (dc->flags & DCF_DONT_DRAW)
goto gr_done;
+1 -3
View File
@@ -519,10 +519,8 @@ public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
}
if (dc->flags & DCF_LOCATE_NEAREST) {
dist=DistSqrI64(x,y,dc->cur_x,dc->cur_y);
if (dist<=dc->nearest_dist) {
if (dist<=dc->nearest_dist)
dc->nearest_dist=dist;
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
}
}
if (dc->flags & DCF_RECORD_EXTENTS) {
if (x-w<dc->min_x) dc->min_x=x-w;
+7 -13
View File
@@ -20,22 +20,17 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
{//Plot a sprite into a CDC.
CSprite *tmpg=elems-offset(CSprite.start);
I64 i,j,k,x1,y1,z1,x2,y2,
cur_sprite_elem_num=0,*old_r,*r2,
old_flags=dc->flags,
old_pen_width=dc->pen_width;
*old_r,*r2,old_flags=dc->flags,old_pen_width=dc->pen_width;
I32 *ptr;
CColorROPU32 old_color=dc->color;
CDC *img;
CD3I32 *p,*p2;
CGrSym old_sym;
MemCpy(&old_sym,&dc->sym,sizeof(CGrSym));
if (dc->flags & DCF_LOCATE_NEAREST) {
dc->nearest_sprite_elem_num=0;
if (dc->flags & DCF_LOCATE_NEAREST)
dc->nearest_dist=MAX_I64;
}
while (tmpg->type) {
dc->cur_sprite_elem_num=cur_sprite_elem_num;
switch (tmpg->type) {
while (tmpg->type&SPG_TYPE_MASK) {
switch (tmpg->type&SPG_TYPE_MASK) {
case SPT_COLOR:
dc->color=dc->color&~(COLORROP_COLORS_MASK|ROPF_DITHER)|tmpg->c.color;
break;
@@ -237,7 +232,6 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
}
break;
}
cur_sprite_elem_num++;
if (just_one_elem) break;
tmpg(U8 *)+=SpriteElemSize(tmpg);
}
@@ -346,10 +340,10 @@ public U8 *SpriteInterpolate(F64 t,U8 *elems0,U8 *elems1)
MemCpy(res,elems1,i);
}
tmpgr=res-offset(CSprite.start);
while (tmpg0->type) {
if (tmpg0->type!=tmpg1->type)
while (tmpg0->type&SPG_TYPE_MASK) {
if (tmpg0->type&SPG_TYPE_MASK!=tmpg1->type&SPG_TYPE_MASK)
throw('Graphics');
switch (tmpg0->type) {
switch (tmpg0->type&SPG_TYPE_MASK) {
case SPT_ROTATED_RECT:
tmpgr->ppa.angle=(tmpg0->ppa.angle*t0+tmpg1->ppa.angle*t1)/GR_SCALE;
case SPT_RECT:
+6 -5
View File
@@ -8,8 +8,8 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tmpg)
CD3I32 *p;
CMeshTri *tri;
if (!doc) doc=DocPut;
DocPrint(doc,"%Z",tmpg->type,"ST_SPRITE_ELEM_CODES");
switch (tmpg->type) {
DocPrint(doc,"%Z",tmpg->type&SPG_TYPE_MASK,"ST_SPRITE_ELEM_CODES");
switch (tmpg->type&SPG_TYPE_MASK) {
case SPT_COLOR:
DocPrint(doc,"{%s}",
Color2Str(buf1,tmpg->c.color));
@@ -92,7 +92,8 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tmpg)
if (i&3==3 && i+1<tmpg->nu.num)
DocPrint(doc,"\n");
}
if (tmpg->type==SPT_BSPLINE2||tmpg->type==SPT_BSPLINE3)
if (tmpg->type&SPG_TYPE_MASK==SPT_BSPLINE2||
tmpg->type&SPG_TYPE_MASK==SPT_BSPLINE3)
DocPrint(doc,",FALSE}");
else
DocPrint(doc,",TRUE}");
@@ -186,13 +187,13 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tmpg)
DocPrint(doc,"}");
break;
}
DocPrint(doc,";\n");
DocPrint(doc,";\n");
}
public U0 Sprite2Code(CDoc *doc=NULL,U8 *elems)
{//Sprite to text.
CSprite *tmpg=elems-offset(CSprite.start);
while (tmpg->type) {
while (tmpg->type&SPG_TYPE_MASK) {
SpriteElem2Code(doc,tmpg);
tmpg(U8 *)+=SpriteElemSize(tmpg);
}
+122 -96
View File
@@ -9,7 +9,7 @@ CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num,
CColorROPU32 color=BLACK;
if (dc) DCRst(dc);
while (elem_num-->0 && res!=head) {
switch (res->type) {
switch (res->type&SPG_TYPE_MASK) {
case SPT_COLOR:
color=res->c.color;
if (dc) dc->color=color;
@@ -65,11 +65,10 @@ CSprite *Sprite2SpriteQue(U8 *elems)
CSprite *res=CAlloc(sizeof(CSprite)),
*tmpg=elems-offset(CSprite.start),*tmpg1;
QueInit(res);
while (tmpg->type) {
while (tmpg->type&SPG_TYPE_MASK) {
tmpg1=MAlloc(SpriteElemSize(tmpg)+offset(CSprite.start));
s=SpriteElemSize(tmpg);
MemCpy(&tmpg1->start,&tmpg->start,s);
tmpg1->sel=FALSE;
QueIns(tmpg1,res->last);
tmpg(U8 *)+=s;
}
@@ -117,8 +116,8 @@ U0 SpriteSetOrigin(CSprite *head,I64 dx,I64 dy,I64 dz)
CD3I32 *p;
CSprite *tmpg=head->next;
while (tmpg!=head) {
if (tmpg->sel)
switch (tmpg->type) {
if (Bt(&tmpg->type,SPf_SEL))
switch (tmpg->type&SPG_TYPE_MASK) {
case SPT_ARROW:
case SPT_LINE:
case SPT_PLANAR_SYMMETRY:
@@ -203,7 +202,7 @@ CSprite *SpriteTransformCircle(I64 *r,CSprite *tmpg)
tmpg1->pwha.height=ToI64(m2)/0x10000;
tmpg1->pwha.angle=-a1;
tmpg1->sel=tmpg->sel;
tmpg1->type|=tmpg->type&SPF_SEL;
return tmpg1;
}
@@ -212,9 +211,9 @@ CSprite *SpriteTransformEllipse(I64 *r,CSprite *tmpg)
I64 x,y,z;
F64 m1,a1,m2,a2,s,c,x_radius=tmpg->pwha.width<<16,
y_radius=tmpg->pwha.height<<16;
CSprite *tmpg1=CAlloc(SpriteElemQuedBaseSize(tmpg->type));
CSprite *tmpg1=CAlloc(SpriteElemQuedBaseSize(tmpg->type&SPG_TYPE_MASK));
tmpg1->type=tmpg->type;
if (tmpg->type==SPT_POLYGON)
if (tmpg->type&SPG_TYPE_MASK==SPT_POLYGON)
tmpg1->pwhas.sides=tmpg->pwhas.sides;
x=tmpg->pwha.x1; y=tmpg->pwha.y1; z=0;
@@ -244,7 +243,7 @@ CSprite *SpriteTransformEllipse(I64 *r,CSprite *tmpg)
if (tmpg1->pwha.height<1) tmpg1->pwha.height=1;
tmpg1->pwha.angle=-a1;
tmpg1->sel=tmpg->sel;
tmpg1->type|=tmpg->type&SPF_SEL;
return tmpg1;
}
@@ -286,7 +285,7 @@ CSprite *SpriteTransformRect(I64 *r,CSprite *tmpg,F64
tmpg1->ppa.y2=tmpg1->ppa.y1+h;
tmpg1->ppa.angle=-a1;
tmpg1->sel=tmpg->sel;
tmpg1->type|=tmpg->type&SPF_SEL;
return tmpg1;
}
@@ -380,8 +379,8 @@ U0 SpriteTransform(I64 *r,CSprite *head)
CD3I32 *p;
CSprite *tmpg=head->next,head2,*tmpg1,*tmpg2,*tmpg3;
while (tmpg!=head) {
if (tmpg->sel)
switch (tmpg->type) {
if (Bt(&tmpg->type,SPf_SEL))
switch (tmpg->type&SPG_TYPE_MASK) {
case SPT_WIDTH:
tmpg->w.width*=Sqrt(Mat4x4NormSqr65536(r))/65536;
if (tmpg->w.width<0) tmpg->w.width=0;
@@ -502,11 +501,10 @@ U0 SpriteTransform(I64 *r,CSprite *head)
Free(tmpg1);
tmpg1=tmpg2;
}
tmpg3->type=SPT_POLYPT;
tmpg3->type=SPT_POLYPT|tmpg->type&SPF_SEL;
tmpg3->npu.num=num;
QueIns(tmpg3,tmpg);
QueRem(tmpg);
tmpg3->sel=tmpg->sel;
Free(tmpg);
tmpg=tmpg3;
break;
@@ -559,7 +557,7 @@ I64 SpriteQueSelCnt(CSprite *head,Bool val=TRUE)
CSprite *tmpg=head->next;
val=ToBool(val);
while (tmpg!=head) {
if (ToBool(tmpg->sel)==val)
if (Bt(&tmpg->type,SPf_SEL)==val)
res++;
tmpg=tmpg->next;
}
@@ -571,7 +569,7 @@ I64 SpriteQueSelAll(CSprite *head,Bool val=TRUE)
I64 res=0;
CSprite *tmpg=head->next;
while (tmpg!=head) {
tmpg->sel=val;
BEqu(&tmpg->type,SPf_SEL,val);
res++;
tmpg=tmpg->next;
}
@@ -590,7 +588,7 @@ CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *head,I64 *_cur_elem_num)
tmpg=SpriteSetSettings(,head,doc_e->left_exp);
if (tmpg!=head) {
tmpg=MAllocIdent(tmpg);
tmpg->sel=Bt(&doc_e->type,DOCEt_SEL);
BEqu(&tmpg->type,SPf_SEL,Bt(&doc_e->type,DOCEt_SEL));
if (*_cur_elem_num==doc_e->left_exp) {
*_cur_elem_num=num;
found=TRUE;
@@ -627,8 +625,8 @@ U0 SpriteSideBarPickNew(CDoc *doc,CSprite *head,I64 old_num)
DocPrint(doc,"$$LTBLUE$$");
doc_e=DocPrint(doc,"$$MU-UL,\"%$$Q\",LE=%d$$\n",st,cur_elem_num++);
}
BEqu(&doc_e->de_flags,DOCEf_SEL,tmpg->sel);
BEqu(&doc_e->type,DOCEt_SEL,tmpg->sel);
BEqu(&doc_e->de_flags,DOCEf_SEL,Bt(&tmpg->type,&SPf_SEL));
BEqu(&doc_e->type,DOCEt_SEL,Bt(&tmpg->type,SPf_SEL));
Free(st);
tmpg=tmpg->next;
}
@@ -716,25 +714,27 @@ Bool SpriteEdText(CSprite **_head,I64 *_cur_elem_num)
}
#define SPED_SEL_UNSEL_ALL 0
#define SPED_SEL 1
#define SPED_UNSEL 2
#define SPED_SHIFT_PTS 3
#define SPED_SHIFT_RECTS 4
#define SPED_SHIFT_SEL 5
#define SPED_TRANSFORM_SEL 6
#define SPED_SET_ORIGIN 7
#define SPED_SHIFT_SUB_ORIGIN 8
#define SPED_TEXT_ED 9
#define SPED_INS_CLIPBOARD 10
#define SPED_MAIN_MENU 11
#define SPED_EXIT 12
#define SPED_SEL 2
#define SPED_SEL_RECTS 3
#define SPED_UNSEL 4
#define SPED_UNSEL_RECTS 5
#define SPED_SHIFT_PTS 6
#define SPED_SHIFT_RECTS 7
#define SPED_SHIFT_SEL 8
#define SPED_TRANSFORM_SEL 9
#define SPED_SET_ORIGIN 10
#define SPED_SHIFT_SUB_ORIGIN 11
#define SPED_TEXT_ED 12
#define SPED_INS_CLIPBOARD 13
#define SPED_MAIN_MENU 14
#define SPED_EXIT 15
U0 GrInit3()
{
DefineLstLoad("ST_SPRITE_ED_MENU","Select/Unselect All\0"
"Select\0Unselect\0Shift Points\0Shift Rects\0Shift Selected\0"
"Transform Selected\0Set Origin\0Insert Shift SubOrigin\0"
"Edit as Text\0Insert Clipboard\0Main Menu\0");
DefineLstLoad("ST_SPRITE_ED_MENU","Select/Unselect All\0 \0Select\0"
"Select Rects\0Unselect\0Unselect Rects\0Shift Points\0Shift Rects\0"
"Shift Selected\0Transform Selected\0Set Origin\0"
"Insert Shift SubOrigin\0Edit as Text\0Insert Clipboard\0Main Menu\0");
}
GrInit3;
@@ -748,7 +748,9 @@ I64 PopUpSpriteEd(CSprite **_head,I64 *_cur_elem_num)
"$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteEd.DD.Z\"$$\n\n"
"$$LTBLUE$$$$MU-UL,\"Select/Unselect All\",LE=SPED_SEL_UNSEL_ALL$$\n"
"$$MU-UL,\"Select Elems\",LE=SPED_SEL$$\n"
"$$MU-UL,\"Unsel Elems\",LE=SPED_UNSEL$$\n\n"
"$$MU-UL,\"Select Elems with Rects\",LE=SPED_SEL_RECTS$$\n"
"$$MU-UL,\"Unsel Elems\",LE=SPED_UNSEL$$\n"
"$$MU-UL,\"Unsel Elems with Rects\",LE=SPED_UNSEL_RECTS$$\n\n"
"$$MU-UL,\"Shift Points\",LE=SPED_SHIFT_PTS$$\n"
"$$MU-UL,\"Shift Points with Rects\",LE=SPED_SHIFT_RECTS$$\n"
"$$MU-UL,\"Shift Selected Elems\",LE=SPED_SHIFT_SEL$$\n"
@@ -780,10 +782,21 @@ I64 PopUpSpriteEd(CSprite **_head,I64 *_cur_elem_num)
class CEdSprite
{
CEdSprite *next,*last;
CSprite *g;
I32 type,num,flags,xx,yy,zz;
I32 *x,*y,*z,*w,*h;
};
CEdSprite *EdSpriteNew(I64 type,CSprite *tmpg)
{
CEdSprite *res=CAlloc(sizeof(CEdSprite));
res->g=tmpg;
if (tmpg->type&SPF_SEL)
res->flags|=SPEDF_SEL;
res->type=type;
return res;
}
U0 SpritePtQueNew(U8 *elems,I64 x,I64 y,CEdSprite *head)
{
I64 i,num=0;
@@ -792,12 +805,11 @@ U0 SpritePtQueNew(U8 *elems,I64 x,I64 y,CEdSprite *head)
CEdSprite *tmpes;
CSprite *tmpg=elems-offset(CSprite.start);
QueInit(head);
while (tmpg->type) {
switch (tmpg->type) {
while (tmpg->type&SPG_TYPE_MASK) {
switch (tmpg->type&SPG_TYPE_MASK) {
case SPT_ELLIPSE:
case SPT_POLYGON:
tmpes=CAlloc(sizeof(CEdSprite));
tmpes->type=SPEDT_WIDTH_HEIGHT;
tmpes=EdSpriteNew(SPEDT_WIDTH_HEIGHT,tmpg);
tmpes->xx=x;
tmpes->yy=y;
tmpes->x=&tmpg->pwha.x1;
@@ -812,8 +824,7 @@ U0 SpritePtQueNew(U8 *elems,I64 x,I64 y,CEdSprite *head)
case SPT_LINE:
case SPT_ARROW:
case SPT_PLANAR_SYMMETRY:
tmpes=CAlloc(sizeof(CEdSprite));
tmpes->type=SPEDT_SIMPLE_PT;
tmpes=EdSpriteNew(SPEDT_SIMPLE_PT,tmpg);
tmpes->xx=x;
tmpes->yy=y;
tmpes->x=&tmpg->pp.x2;
@@ -829,8 +840,7 @@ U0 SpritePtQueNew(U8 *elems,I64 x,I64 y,CEdSprite *head)
case SPT_FLOOD_FILL_NOT:
case SPT_CIRCLE:
pq_x1_y1:
tmpes=CAlloc(sizeof(CEdSprite));
tmpes->type=SPEDT_SIMPLE_PT;
tmpes=EdSpriteNew(SPEDT_SIMPLE_PT,tmpg);
tmpes->xx=x;
tmpes->yy=y;
tmpes->x=&tmpg->p.x1;
@@ -845,8 +855,7 @@ pq_x1_y1:
case SPT_POLYLINE:
ptr=&tmpg->nu.u;
for (i=0;i<tmpg->nu.num;i++) {
tmpes=CAlloc(sizeof(CEdSprite));
tmpes->type=SPEDT_SIMPLE_PT;
tmpes=EdSpriteNew(SPEDT_SIMPLE_PT,tmpg);
tmpes->xx=x;
tmpes->yy=y;
tmpes->x=&ptr[i<<1];
@@ -856,8 +865,7 @@ pq_x1_y1:
}
break;
case SPT_POLYPT:
tmpes=CAlloc(sizeof(CEdSprite));
tmpes->type=SPEDT_SIMPLE_PT;
tmpes=EdSpriteNew(SPEDT_SIMPLE_PT,tmpg);
tmpes->xx=x;
tmpes->yy=y;
tmpes->x=&tmpg->npu.x;
@@ -871,8 +879,7 @@ pq_x1_y1:
case SPT_BSPLINE3_CLOSED:
p=&tmpg->nu.u;
for (i=0;i<tmpg->nu.num;i++) {
tmpes=CAlloc(sizeof(CEdSprite));
tmpes->type=SPEDT_SIMPLE_PT;
tmpes=EdSpriteNew(SPEDT_SIMPLE_PT,tmpg);
tmpes->xx=x;
tmpes->yy=y;
tmpes->x=&p[i].x;
@@ -885,8 +892,7 @@ pq_x1_y1:
case SPT_MESH:
break;
case SPT_SHIFTABLE_MESH:
tmpes=CAlloc(sizeof(CEdSprite));
tmpes->type=SPEDT_SIMPLE_PT;
tmpes=EdSpriteNew(SPEDT_SIMPLE_PT,tmpg);
tmpes->xx=x;
tmpes->yy=y;
tmpes->x=&tmpg->pmu.x;
@@ -952,7 +958,7 @@ U0 SpriteCtrlPtsMove(CEdSprite *head,I64 dx,I64 dy)
}
}
Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
Bool SpriteSelUnselShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
{
I64 msg_code,a1,a2,xx,yy,xx2,yy2,dd,best_dd,cur_elem_num;
Bool res=TRUE;
@@ -968,6 +974,8 @@ Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
1<<MSG_IP_R_UP|1<<MSG_IP_L_DOWN|1<<MSG_KEY_DOWN)) {
case MSG_IP_L_DOWN:
switch (mode) {
case SPED_SEL:
case SPED_UNSEL:
case SPED_SHIFT_PTS:
xx=a1; yy=a2;
best_dd=MAX_I64;
@@ -990,9 +998,15 @@ Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
tmpes=tmpes->next;
}
cur_elem_num=best_es->num;
best_es->flags|=SPEDF_SEL;
if (mode!=SPED_UNSEL) {
best_es->flags|=SPEDF_SEL;
best_es->g->type|=SPF_SEL;
} else {
best_es->flags&=~SPEDF_SEL;
best_es->g->type&=~SPF_SEL;
}
break;
case SPED_SHIFT_RECTS:
start:
xx2=xx=a1; yy2=yy=a2;
while (TRUE) {
SpriteCtrlPtsDraw(dc,&head);
@@ -1012,37 +1026,62 @@ Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
switch (tmpes->type) {
case SPEDT_SIMPLE_PT:
if (xx<=*tmpes->x+tmpes->xx<=xx2 &&
yy<=*tmpes->y+tmpes->yy<=yy2)
tmpes->flags|=SPEDF_SEL;
yy<=*tmpes->y+tmpes->yy<=yy2) {
if (mode!=SPED_UNSEL_RECTS) {
tmpes->flags|=SPEDF_SEL;
tmpes->g->type|=SPF_SEL;
} else {
tmpes->flags&=~SPEDF_SEL;
tmpes->g->type&=~SPF_SEL;
}
}
break;
case SPEDT_WIDTH_HEIGHT:
if (xx<=*tmpes->x+*tmpes->w+tmpes->xx<=xx2 &&
yy<=*tmpes->y+*tmpes->h+tmpes->yy<=yy2)
tmpes->flags|=SPEDF_SEL;
yy<=*tmpes->y+*tmpes->h+tmpes->yy<=yy2) {
if (mode!=SPED_UNSEL_RECTS) {
tmpes->flags|=SPEDF_SEL;
tmpes->g->type|=SPF_SEL;
} else {
tmpes->flags&=~SPEDF_SEL;
tmpes->g->type&=~SPF_SEL;
}
}
break;
}
tmpes=tmpes->next;
}
case SPED_SEL_RECTS:
case SPED_UNSEL_RECTS:
break;
case SPED_SHIFT_RECTS:
do {
SpriteCtrlPtsDraw(dc,&head);
msg_code=ScanMsg(&a1,&a2,1<<MSG_KEY_DOWN|1<<MSG_IP_L_DOWN);
if (msg_code==MSG_KEY_DOWN) goto gs_key;
} while (msg_code!=MSG_IP_L_DOWN);
xx=a1;yy=a2;
break;
end:
}
switch (mode) {
case SPED_SHIFT_PTS:
case SPED_SHIFT_RECTS:
do {
SpriteCtrlPtsDraw(dc,&head);
msg_code=ScanMsg(&a1,&a2,1<<MSG_KEY_DOWN|1<<MSG_IP_L_DOWN);
if (msg_code==MSG_KEY_DOWN) goto gs_key;
} while (msg_code!=MSG_IP_L_DOWN);
xx=a1;yy=a2;
if (msg_code=ScanMsg(&a1,&a2,1<<MSG_IP_MOVE|1<<MSG_IP_L_UP)) {
SpriteCtrlPtsMove(&head,a1-xx,a2-yy);
xx=a1;yy=a2;
}
} while (msg_code!=MSG_IP_L_UP);
tmpes=head.next;
while (tmpes!=&head) {
tmpes->flags&=~SPEDF_SEL;
tmpes->g->type&=~SPF_SEL;
tmpes=tmpes->next;
}
break;
}
do {
SpriteCtrlPtsDraw(dc,&head);
if (msg_code=ScanMsg(&a1,&a2,1<<MSG_IP_MOVE|1<<MSG_IP_L_UP)) {
SpriteCtrlPtsMove(&head,a1-xx,a2-yy);
xx=a1;yy=a2;
}
} while (msg_code!=MSG_IP_L_UP);
tmpes=head.next;
while (tmpes!=&head) {
tmpes->flags&=~SPEDF_SEL;
tmpes=tmpes->next;
}
break;
case MSG_KEY_DOWN:
gs_key:
@@ -1054,11 +1093,11 @@ gs_key:
goto gs_done;
case 'p':
case 'P':
mode=SPED_SHIFT_PTS;
mode&=~1;
break;
case 'r':
case 'R':
mode=SPED_SHIFT_RECTS;
mode|=1;
break;
}
break;
@@ -1084,7 +1123,7 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
Bool unlock;
I64 i,r[16],msg_code,a1,a2,xx,yy,
old_de_flags;
CSprite *cur_elem,*head2,*next,*last,*tmpg,*insert_pt;
CSprite *head2,*next,*last,*tmpg,*insert_pt;
old_de_flags=doc_ce->de_flags;
tmpb=doc_ce->bin_data;
@@ -1105,23 +1144,6 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
else
SpriteQueSelAll(*_head,FALSE);
break;
case SPED_SEL:
case SPED_UNSEL:
doc_ce->de_flags=old_de_flags;
doc->cur_sprite=tmpb->data;
do {
doc->nearest_sprite_elem_num=0;
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_DOWN|1<<MSG_IP_R_UP);
Refresh(2);
if (msg_code==MSG_IP_L_DOWN) {
*_cur_elem_num=doc->nearest_sprite_elem_num;
cur_elem=SpriteSetSettings(,*_head,*_cur_elem_num);
cur_elem->sel=ToBool(i==SPED_SEL);
GetMsg(,,1<<MSG_IP_L_UP);
}
} while (msg_code!=MSG_IP_R_UP);
doc->cur_sprite=NULL;
break;
case SPED_SET_ORIGIN:
SpriteQueSelAll(*_head);
doc_ce->de_flags=old_de_flags;
@@ -1146,6 +1168,10 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
if (!SpriteQueSelCnt(*_head,FALSE))
SpriteQueSelAll(*_head,FALSE);
break;
case SPED_SEL:
case SPED_SEL_RECTS:
case SPED_UNSEL:
case SPED_UNSEL_RECTS:
case SPED_SHIFT_PTS:
case SPED_SHIFT_RECTS:
RegOneTimePopUp(ARf_CSPRITE_PTS_RECTANGLES,
@@ -1154,7 +1180,7 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
"Press '$$GREEN$$r$$FG$$' after one rectangle\n"
"to OR another rectangle.\n");
doc_ce->de_flags=old_de_flags;
if (SpriteShiftPts(tmpb->data,x,y,_cur_elem_num,i)) {
if (SpriteSelUnselShiftPts(tmpb->data,x,y,_cur_elem_num,i)) {
QueDel(*_head);
Free(*_head);
*_head=Sprite2SpriteQue(tmpb->data);
+15 -12
View File
@@ -627,7 +627,7 @@ I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,
img->color=bm_bkcolor;
GrRect(img,0,0,tmpg->pwhu.width,tmpg->pwhu.height);
tmpg1=insert_pt;
if (tmpg1==head || tmpg1->type!=SPT_BITMAP) {
if (tmpg1==head || tmpg1->type&SPG_TYPE_MASK!=SPT_BITMAP) {
SpriteSetSettings(img,head,0,-(xx1-x),-(yy1-y));
x=xx; y=yy;
Sprite3(img,-(xx1-x),-(yy1-y),0,doc_ce->bin_data->data);
@@ -671,9 +671,9 @@ U0 SMMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,I64 *_cur_elem_num)
CD3I32 *p;
I64 i,size,x1,y1,z1;
I32 *mesh,*old_mesh;
if (tmpg1!=head && tmpg1->type==SPT_MESH)
if (tmpg1!=head && tmpg1->type&SPG_TYPE_MASK==SPT_MESH)
old_mesh=&tmpg1->mu.vertex_cnt;
else if (tmpg1!=head && tmpg1->type==SPT_SHIFTABLE_MESH) {
else if (tmpg1!=head && tmpg1->type&SPG_TYPE_MASK==SPT_SHIFTABLE_MESH) {
x1=tmpg1->pmu.x;
y1=tmpg1->pmu.y;
z1=tmpg1->pmu.z;
@@ -700,7 +700,7 @@ U0 SMMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,I64 *_cur_elem_num)
SpriteEdUpdate(doc,doc_ce,head);
} else
*_cur_elem_num+=1;
} else if (old_mesh && tmpg1->type==SPT_SHIFTABLE_MESH) {
} else if (old_mesh && tmpg1->type&SPG_TYPE_MASK==SPT_SHIFTABLE_MESH) {
x1=tmpg1->pmu.x;
y1=tmpg1->pmu.y;
z1=tmpg1->pmu.z;
@@ -721,7 +721,7 @@ U0 SMShiftableMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,
CD3I32 *p;
I64 i,size,z,x1,y1,z1;
I32 *mesh,*old_mesh;
if (tmpg1!=head && tmpg1->type==SPT_MESH) {
if (tmpg1!=head && tmpg1->type&SPG_TYPE_MASK==SPT_MESH) {
z=0;
x1=-(a1-x);
y1=-(a2-y);
@@ -733,7 +733,7 @@ U0 SMShiftableMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,
p->z+=z1;
}
old_mesh=&tmpg1->mu.vertex_cnt;
} else if (tmpg1!=head && tmpg1->type==SPT_SHIFTABLE_MESH) {
} else if (tmpg1!=head && tmpg1->type&SPG_TYPE_MASK==SPT_SHIFTABLE_MESH) {
z=-tmpg1->pmu.z;
x1=tmpg1->pmu.x-(a1-x);
y1=tmpg1->pmu.y-(a2-y);
@@ -766,7 +766,7 @@ U0 SMShiftableMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,
SpriteEdUpdate(doc,doc_ce,head);
} else
*_cur_elem_num+=1;
} else if (old_mesh && tmpg1->type==SPT_SHIFTABLE_MESH) {
} else if (old_mesh && tmpg1->type&SPG_TYPE_MASK==SPT_SHIFTABLE_MESH) {
x1=tmpg1->pmu.x-(a1-x);
y1=tmpg1->pmu.y-(a2-y);
z1=tmpg1->pmu.z+z;
@@ -776,7 +776,7 @@ U0 SMShiftableMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,
p->y-=y1;
p->z-=z1;
}
} else if (old_mesh && tmpg1->type==SPT_MESH) {
} else if (old_mesh && tmpg1->type&SPG_TYPE_MASK==SPT_MESH) {
x1=-(a1-x);
y1=-(a2-y);
z1= z;
@@ -901,8 +901,8 @@ I64 SpriteMainEd(CDoc *doc)
case SPT_ED_MENU:
switch (SpriteEd(doc,doc_ce,x,y,&head,&cur_elem_num)) {
case SPE_ABORT: eletype=DOCM_CANCEL; break;
case SPE_EXIT: eletype=SPT_EXIT; break;
case SPE_CONT: eletype=SPT_MENU; break;
case SPE_EXIT: eletype=SPT_EXIT; break;
case SPE_CONT: eletype=SPT_MENU; break;
}
break;
case SPT_MESH:
@@ -1196,7 +1196,8 @@ U0 EdSpriteIns(CDoc *doc)
if (SpriteMainEd(doc)==SPE_ABORT) {
DocLock(doc);
DocEntryDel(doc,doc_e);
}
} else
SpriteSelAll(tmpb->data,FALSE);
} else
DocBinDel(doc,tmpb);
if (unlock)
@@ -1224,8 +1225,10 @@ U0 EdSpriteEd(CDoc *doc)
Free(tmpb->data);
tmpb->data=old_csprite;
tmpb->size=old_size;
} else
} else {
SpriteSelAll(tmpb->data,FALSE);
Free(old_csprite);
}
if (unlock)
DocUnlock(doc);
}
+18 -9
View File
@@ -38,13 +38,13 @@ I64 sprite_elem_base_sizes[SPT_NUM_TYPES]={
I64 SpriteElemQuedBaseSize(I64 type)
{
return sprite_elem_base_sizes[type]+offset(CSprite.start);
return sprite_elem_base_sizes[type&SPG_TYPE_MASK]+offset(CSprite.start);
}
I64 SpriteElemSize(CSprite *tmpg)
{
I64 i=sprite_elem_base_sizes[tmpg->type];
switch (tmpg->type) {
I64 i=sprite_elem_base_sizes[tmpg->type&SPG_TYPE_MASK];
switch (tmpg->type&SPG_TYPE_MASK) {
case SPT_POLYLINE:
i+=tmpg->nu.num*sizeof(CD2I32);
break;
@@ -80,7 +80,7 @@ I64 SpriteElemSize(CSprite *tmpg)
public I64 SpriteSize(U8 *elems)
{//Walk sprite elements and return size of sprite as binary data.
CSprite *tmpg=elems-offset(CSprite.start),*tmpg1=tmpg;
while (tmpg->type)
while (tmpg->type&SPG_TYPE_MASK)
tmpg(U8 *)+=SpriteElemSize(tmpg);
return tmpg(U8 *)-tmpg1(U8 *)+sprite_elem_base_sizes[SPT_END];
}
@@ -89,15 +89,24 @@ I64 SpriteTypeMask(U8 *elems)
{
I64 res=0;
CSprite *tmpg=elems-offset(CSprite.start);
while (tmpg->type) {
if (tmpg->type>=SPT_NUM_TYPES)
while (tmpg->type&SPG_TYPE_MASK) {
if (tmpg->type&SPG_TYPE_MASK>=SPT_NUM_TYPES)
return 1<<SPT_NUM_TYPES;
Bts(&res,tmpg->type);
Bts(&res,tmpg->type&SPG_TYPE_MASK);
tmpg(U8 *)+=SpriteElemSize(tmpg);
}
return res;
}
U0 SpriteSelAll(U8 *elems,Bool val)
{
CSprite *tmpg=elems-offset(CSprite.start);
while (tmpg->type&SPG_TYPE_MASK) {
BEqu(&tmpg->type,SPf_SEL,val);
tmpg(U8 *)+=SpriteElemSize(tmpg);
}
}
public U8 *DC2Sprite(CDC *tmpb)
{//Convert device context to sprite.
CSprite *tmpg;
@@ -118,8 +127,8 @@ public U8 *SpriteElem2Summary(CSprite *tmpg)
{//Study $LK,"::/Demo/Graphics/SpriteText.HC"$.
U8 buf[STR_LEN],buf2[STR_LEN];
I32 *ptr;
StrPrint(buf,"%Z",tmpg->type,"ST_SPRITE_ELEM_TYPES");
switch (tmpg->type) {
StrPrint(buf,"%Z",tmpg->type&SPG_TYPE_MASK,"ST_SPRITE_ELEM_TYPES");
switch (tmpg->type&SPG_TYPE_MASK) {
case SPT_COLOR:
CatPrint(buf," %s",Color2Str(buf2,tmpg->c.color));
break;
+1
View File
@@ -22,6 +22,7 @@ LBts(&sys_run_level,RLf_DOC);
#include "God/MakeGod"
#include "AHash"
#include "TaskSettings"
#include "CPURep"
#include "DevInfo"
#include "ADefine"
#include "WallPaper"
+5 -3
View File
@@ -40,8 +40,7 @@ public CDoc *Doc2TXT(CDoc *doc_in)
CDocEntry *doc_e,*doc_e2;
I64 y,col;
CDoc *doc_out=DocNew;
Bool unlock_doc_in=DocLock(doc_in),no_bwd;
Bool unlock_doc_in=DocLock(doc_in),no_bwd,line_has_html_code=FALSE;
DocRecalc(doc_in);
doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
@@ -55,7 +54,10 @@ public CDoc *Doc2TXT(CDoc *doc_in)
TXTPutS(doc_out,"\n",&col);
y++;
col=0;
line_has_html_code=FALSE;
}
if (doc_e->type_u8==DOCT_HTML_CODE)
line_has_html_code=TRUE;
no_bwd=TRUE;
doc_e2=doc_e->next;
@@ -66,7 +68,7 @@ public CDoc *Doc2TXT(CDoc *doc_in)
}
doc_e2=doc_e2->next;
}
if (no_bwd)
if (no_bwd && !(doc_e->type_u8==DOCT_NEW_LINE && line_has_html_code))
while (col<doc_e->x)
TXTPutS(doc_out," ",&col);
+9 -4
View File
@@ -17,7 +17,7 @@ winmgr.t->last_calc_idle_time=tS;
U0 DrawProgressBars(CDC *dc)
{
I64 i,j,k,n,m;
U8 *st;
U8 *st,*st2;
for (i=0;i<NUM_PROGRESS_BARS;i++) {
if (m=sys_progresses[i].max) {
dc->color=BLACK;
@@ -57,10 +57,15 @@ U0 DrawProgressBars(CDC *dc)
st=StrNew(sys_progresses[i].desc);
else
st=MStrPrint("%d/%d",n,m);
GrPrint(dc,(GR_WIDTH-FONT_WIDTH*StrLen(st))/2,
if (sys_progresses[i].t0) {
st2=MStrPrint("%s %5.3f",st,tS-sys_progresses[i].t0);
Free(st);
} else
st2=st;
GrPrint(dc,(GR_WIDTH-FONT_WIDTH*StrLen(st2))/2,
(GR_HEIGHT-FONT_HEIGHT-
(NUM_PROGRESS_BARS*2-2-i*4)*PROGRESS_BAR_HEIGHT)/2,"%s",st);
Free(st);
(NUM_PROGRESS_BARS*2-2-i*4)*PROGRESS_BAR_HEIGHT)/2,"%s",st2);
Free(st2);
}
}
}
+12
View File
@@ -7,6 +7,18 @@ U0 BgtEntryDel2(CBgtEntry *tmpb)
}
}
CBgtEntry *BgtEntryCopy(CBgtEntry *tmpb,Bool periodic_copy)
{
CBgtEntry *res=MAlloc(sizeof(CBgtEntry));
MemCpy(res,tmpb,sizeof(CBgtEntry));
if (periodic_copy) {
res->credit=StrNew(tmpb->credit);
res->debit =StrNew(tmpb->debit);
res->desc =StrNew(tmpb->desc);
}
return res;
}
U0 BgtEntryDel(CBgtEntry *tmpb)
{
BgtEntryDel2(tmpb);
+13 -3
View File
@@ -38,9 +38,7 @@ Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
tmpb=doc_ce->user_data;
if (tmpt=tmpb->template) {
QueRem(tmpt);
BgtTemplatePurge(tmpt);
BgtEntryDel2(&tmpt->b);
Free(tmpt);
BgtTemplateDel(tmpt);
} else {
QueRem(tmpb);
BgtEntryDel(tmpb);
@@ -87,6 +85,17 @@ Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
BgtRegen;
}
return TRUE;
case 'p':
if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
doc_ce->type_u8==DOCT_MENU_VAL) {
tmpb=doc_ce->user_data;
if (tmpt1=BgtTemplatePmt(,tmpb)) {
BgtTemplateExpand(tmpt1,TRUE);
BgtTemplateDel(tmpt1);
BgtRegen;
}
}
return TRUE;
}
return FALSE;
}
@@ -176,6 +185,7 @@ U0 Budget()
"Edit {"
" NewEntry(,'n');"
" CopyEntry(,'c');"
" PeriodicEntry(,'p');"
" EditEntry(,'\n');"
" DeleteEntry(,CH_CTRLY);"
" NewTemplate(,'t');"
+69 -34
View File
@@ -13,11 +13,19 @@ U0 BgtTemplatePurge(CBgtTemplate *tmpt)
}
}
U0 BgtTemplateExpand(CBgtTemplate *tmpt)
U0 BgtTemplateDel(CBgtTemplate *tmpt)
{
BgtTemplatePurge(tmpt);
BgtEntryDel2(&tmpt->b);
Free(tmpt);
}
U0 BgtTemplateExpand(CBgtTemplate *tmpt,Bool periodic_copy=FALSE)
{
CDate d,start,end;
CDateStruct ds;
CBgtEntry *tmpb;
Bool first=TRUE;
start=MyStr2Date(tmpt->start_date);
end =MyStr2Date(tmpt->end_date);
@@ -26,12 +34,17 @@ U0 BgtTemplateExpand(CBgtTemplate *tmpt)
case BT_INTERVAL:
d=start;
while (d<=end) {
tmpb=CAlloc(sizeof(CBgtEntry));
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
tmpb->date=d;
tmpb->type=BE_TEMPLATE_COPY;
BgtIns(tmpb);
if (!first || !periodic_copy) {
tmpb=BgtEntryCopy(&tmpt->b,periodic_copy);
tmpb->date=d;
if (periodic_copy)
tmpb->template=NULL;
else
tmpb->type=BE_TEMPLATE_COPY;
BgtIns(tmpb);
}
d+=tmpt->period*0x100000000;
first=FALSE;
}
break;
case BT_MONTHLY:
@@ -39,17 +52,22 @@ U0 BgtTemplateExpand(CBgtTemplate *tmpt)
while (TRUE) {
d=Struct2Date(&ds);
if (d<=end) {
tmpb=CAlloc(sizeof(CBgtEntry));
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
tmpb->date=d;
tmpb->type=BE_TEMPLATE_COPY;
BgtIns(tmpb);
if (!first || !periodic_copy) {
tmpb=BgtEntryCopy(&tmpt->b,periodic_copy);
tmpb->date=d;
if (periodic_copy)
tmpb->template=NULL;
else
tmpb->type=BE_TEMPLATE_COPY;
BgtIns(tmpb);
}
} else
break;
if (++ds.mon>11) {
ds.mon=0;
if (++ds.mon>12) {
ds.mon=1;
ds.year++;
}
first=FALSE;
}
break;
case BT_BIMONTHLY:
@@ -57,18 +75,23 @@ U0 BgtTemplateExpand(CBgtTemplate *tmpt)
while (TRUE) {
d=Struct2Date(&ds);
if (d<=end) {
tmpb=CAlloc(sizeof(CBgtEntry));
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
tmpb->date=d;
tmpb->type=BE_TEMPLATE_COPY;
BgtIns(tmpb);
if (!first || !periodic_copy) {
tmpb=BgtEntryCopy(&tmpt->b,periodic_copy);
tmpb->date=d;
if (periodic_copy)
tmpb->template=NULL;
else
tmpb->type=BE_TEMPLATE_COPY;
BgtIns(tmpb);
}
} else
break;
ds.mon+=2;
if (ds.mon>11) {
if (ds.mon>12) {
ds.mon-=12;
ds.year++;
}
first=FALSE;
}
break;
case BT_SEMIANNUAL:
@@ -76,18 +99,23 @@ U0 BgtTemplateExpand(CBgtTemplate *tmpt)
while (TRUE) {
d=Struct2Date(&ds);
if (d<=end) {
tmpb=CAlloc(sizeof(CBgtEntry));
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
tmpb->date=d;
tmpb->type=BE_TEMPLATE_COPY;
BgtIns(tmpb);
if (!first || !periodic_copy) {
tmpb=BgtEntryCopy(&tmpt->b,periodic_copy);
tmpb->date=d;
if (periodic_copy)
tmpb->template=NULL;
else
tmpb->type=BE_TEMPLATE_COPY;
BgtIns(tmpb);
}
} else
break;
ds.mon+=6;
if (ds.mon>11) {
if (ds.mon>12) {
ds.mon-=12;
ds.year++;
}
first=FALSE;
}
break;
case BT_ANNUAL:
@@ -95,14 +123,19 @@ U0 BgtTemplateExpand(CBgtTemplate *tmpt)
while (TRUE) {
d=Struct2Date(&ds);
if (d<=end) {
tmpb=CAlloc(sizeof(CBgtEntry));
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
tmpb->date=d;
tmpb->type=BE_TEMPLATE_COPY;
BgtIns(tmpb);
if (!first || !periodic_copy) {
tmpb=BgtEntryCopy(&tmpt->b,periodic_copy);
tmpb->date=d;
if (periodic_copy)
tmpb->template=NULL;
else
tmpb->type=BE_TEMPLATE_COPY;
BgtIns(tmpb);
}
} else
break;
ds.year++;
first=FALSE;
}
break;
}
@@ -117,19 +150,21 @@ U0 CBgtTemplatesExpand()
}
}
CBgtTemplate *BgtTemplatePmt(CBgtTemplate *dft_t=NULL)
CBgtTemplate *BgtTemplatePmt(CBgtTemplate *dft_t=NULL,CBgtEntry *dft_b=NULL)
{
CBgtTemplate t,*tmpt;
CBgtEntry *tmpb,*dft_b;
CBgtEntry *tmpb;
MemSet(&t,0,sizeof(CBgtTemplate));
if (dft_t) {
MemCpy(&t.start,&dft_t->start,BT_SIZE);
dft_b=&dft_t->b;
} else {
t.type=BT_INTERVAL;
StrCpy(&t.start_date,"[");
if (dft_b)
StrPrint(&t.start_date,"%D",dft_b->date);
else
StrCpy(&t.start_date,"[");
StrCpy(&t.end_date,"]");
dft_b=NULL;
}
while (TRUE)
if (PopUpForm(&t) && ((t.type==BT_INTERVAL && t.period>0) ||
+405 -253
View File
File diff suppressed because one or more lines are too long
+160 -131
View File
@@ -1,34 +1,3 @@
/* I did not limit myself to real physics. It's a game.
I suppose the gun shoots plazma blobs that have a delayed
explosion due to a chemical reaction timer.
The caliber of the gun is adjustible.
I did a simple anti-spin controller when you press cursor-down.
It's intentionally not very good. It needs to take into
account flexing of the struts. You'll notice when you
try to shoot the laser.
If you are interested in control theory, you might download
SimStructure, a program I wrote.
http://www.templeos.org/files/SimStrSetUp.zip
There's not sound in space and explosions
don't make shock waves, or something like that.
In X-Caliber, ships are destroyed by
causing springs to break due to acceleration
differences on different masses in a ship.
A real game would be dull with guided
missiles that always hit and lasers
that never miss.
Don't be anal. If you aspire to making
games, do like Hollywood. They know the
public isn't interested in realism.
*/
#define XMSGF_ANTISPIN 0
RegSetDftEntry("TempleOS/XCaliber",
"I64 best_score=0;\n"
@@ -36,11 +5,16 @@ RegSetDftEntry("TempleOS/XCaliber",
);
RegExeBranch("TempleOS/XCaliber");
#define MT_HUMAN_SHIP 0
#define MT_ENEMY_SHIP 1
#define MT_SUPER_NAPALM_BALL 2
#define MT_SUPER_NAPALM_SPLAT 3
#define MT_MISSILE 4
class MyMass:CMass
{
F64 temperature;
F64 radius;
I64 color;
F64 temperature,radius,die_timeout;
I64 type;
Bool no_overlap;
};
@@ -63,8 +37,7 @@ extern class Ship;
class Missile
{
Missile *next,*last;
F64 explosion_radius;
F64 fuse_time,die_timeout;
F64 tons,fuse_time,die_timeout;
MyMass p_front,p_back;
MySpring s[5];
U8 *img;
@@ -93,10 +66,9 @@ F64 human_t_left,human_t_right,human_antispin;
class Shot
{
Shot *next,*last;
F64 radius,explosion_radius;
F64 fuse_time,die_timeout;
F64 radius,fuse_time;
I64 splats;
MyMass p;
Bool exploding;
} shot_head;
#define MAX_THRUST 200.0
@@ -174,9 +146,11 @@ U0 MissileNew(Ship *tmpsp,I64 n)
else
StrCpy(tmpmi->label,"R");
tmpmi->owner=tmpsp;
tmpmi->explosion_radius=5;
tmpmi->tons=0.5;
tmpmi->p_front.mass=0.1;
tmpmi->p_front.type=MT_MISSILE;
tmpmi->p_back.mass =0.1;
tmpmi->p_back.type =MT_MISSILE;
tmpmi->p_front.radius=2;
tmpmi->p_back.radius =2;
tmpmi->p_front.no_overlap=TRUE;
@@ -236,6 +210,7 @@ Ship *ShipNew(I64 x,I64 y,I64 type)
for (i=0;i<tmpsp->masses;i++) {
tmpsp->p[i].mass=1;
tmpsp->p[i].type=MT_HUMAN_SHIP;
if (i<3)
tmpsp->p[i].radius=2.5;
else
@@ -290,6 +265,7 @@ Ship *ShipNew(I64 x,I64 y,I64 type)
for (i=0;i<tmpsp->masses;i++) {
tmpsp->p[i].mass=1;
tmpsp->p[i].type=MT_ENEMY_SHIP;
tmpsp->p[i].radius=7;
tmpsp->p[i].drag_profile_factor=3;
QueIns(&tmpsp->p[i],ode->last_mass);
@@ -329,9 +305,9 @@ Ship *ShipNew(I64 x,I64 y,I64 type)
for (i=0;i<tmpsp->masses;i++) {
tmpsp->p[i].mass=1;
tmpsp->p[i].type=MT_ENEMY_SHIP;
tmpsp->p[i].radius=6;
tmpsp->p[i].drag_profile_factor=5;
tmpsp->p[i].color=PURPLE;
QueIns(&tmpsp->p[i],ode->last_mass);
}
@@ -472,6 +448,7 @@ U0 DrawIt(CTask *task,CDC *dc)
CD3 p,p1,p2;
F64 t_left,t_right,spin,d,x,y;
MySpring *tmpsps;
MyMass *tmpm;
U8 *img;
Bool draw_laser_line=FALSE;
@@ -492,6 +469,15 @@ U0 DrawIt(CTask *task,CDC *dc)
for (i=0;i<NUM_STARS;i++)
GrPlot(dc,stars_x[i],stars_y[i]);
tmpm=ode->next_mass;
while (tmpm!=&ode->next_mass) {
if (tmpm->type==MT_SUPER_NAPALM_SPLAT) {
dc->color=YELLOW;
GrPlot(dc,tmpm->x,tmpm->y);
}
tmpm=tmpm->next;
}
tmpsps=ode->next_spring;
while (tmpsps!=&ode->next_spring) {
if (!(tmpsps->flags&SSF_INACTIVE) && tmpsps->color) {
@@ -507,7 +493,7 @@ U0 DrawIt(CTask *task,CDC *dc)
if (tmpmi->active) {
if (tmpmi->launched && tmpmi->exploding) {
d=(tS-tmpmi->fuse_time)/(tmpmi->die_timeout-tmpmi->fuse_time);
d=7*Sin(ã*d)*tmpmi->explosion_radius+1;
d=70*Sin(ã*d)*tmpmi->tons+1;
for (i=1;i<d;i++) {
if (i&1)
dc->color=YELLOW;
@@ -526,7 +512,7 @@ U0 DrawIt(CTask *task,CDC *dc)
tmpsp=ship_head.next;
while (tmpsp!=&ship_head) {
if (!tmpsp->exploding)
if (!tmpsp->exploding) {
switch (tmpsp->type) {
case ST_HUMAN1:
if (tmpsp->spacewalk_side) {
@@ -633,7 +619,7 @@ U0 DrawIt(CTask *task,CDC *dc)
break;
case ST_ENEMY2:
for (i=3;i<tmpsp->masses;i++) {
dc->color=tmpsp->p[i].color;
dc->color=PURPLE;
GrCircle(dc,tmpsp->p[i].x,tmpsp->p[i].y,tmpsp->p[i].radius);
GrFloodFill(dc,tmpsp->p[i].x,tmpsp->p[i].y+2,TRUE);
dc->color=WHITE;
@@ -655,14 +641,15 @@ U0 DrawIt(CTask *task,CDC *dc)
arg=Arg(p2.x,p2.y);
SpriteZ3B(dc,tmpsp->p[0].x+p2.x,tmpsp->p[0].y+p2.y,0,
$IB,"<EnemySide>",BI=5$,arg);
for (i=0;i<tmpsp->masses;i++) {
dc->color=YELLOW;
if (tmpsp->p[i].temperature>=1.0)
GrCircle(dc,tmpsp->p[i].x,tmpsp->p[i].y,
tmpsp->p[i].temperature);
}
break;
}
for (i=0;i<tmpsp->masses;i++) {
dc->color=YELLOW;
if (tmpsp->p[i].temperature>=1.0)
GrCircle(dc,tmpsp->p[i].x,tmpsp->p[i].y,
tmpsp->p[i].temperature);
}
}
else if (tmpsp->die_time<=tS<=tmpsp->die_timeout)
for (j=0;j<tmpsp->masses;j++) {
d=(tS-tmpsp->die_time)/(tmpsp->die_timeout-tmpsp->die_time);
@@ -680,28 +667,16 @@ U0 DrawIt(CTask *task,CDC *dc)
tmps=shot_head.next;
while (tmps!=&shot_head) {
if (tmps->exploding) {
d=(tS-tmps->fuse_time)/(tmps->die_timeout-tmps->fuse_time);
d=7*Sin(ã*d)*tmps->explosion_radius+1;
for (i=1;i<d;i++) {
if (i&1)
dc->color=YELLOW;
else
dc->color=LTRED;
GrCircle(dc,tmps->p.x,tmps->p.y,i);
}
if (tmps->radius<1.0) {
dc->color=LTGREEN;
GrPlot(dc,tmps->p.x,tmps->p.y);
} else {
if (tmps->radius<1.0) {
dc->color=LTGREEN;
GrPlot(dc,tmps->p.x,tmps->p.y);
} else {
dc->color=YELLOW;
GrCircle(dc,tmps->p.x,tmps->p.y,tmps->radius);
if (tmps->radius>=2.0)
GrFloodFill(dc,tmps->p.x,tmps->p.y,TRUE);
dc->color=LTGREEN;
GrCircle(dc,tmps->p.x,tmps->p.y,tmps->radius);
}
dc->color=YELLOW;
GrCircle(dc,tmps->p.x,tmps->p.y,tmps->radius);
if (tmps->radius>=2.0)
GrFloodFill(dc,tmps->p.x,tmps->p.y,TRUE);
dc->color=LTGREEN;
GrCircle(dc,tmps->p.x,tmps->p.y,tmps->radius);
}
tmps=tmps->next;
}
@@ -726,7 +701,7 @@ U0 DrawIt(CTask *task,CDC *dc)
}
}
U0 Explosion(MyMass *tmpm1,MyMass *tmpm2,F64 r)
U0 Explosion(MyMass *tmpm1,MyMass *tmpm2,F64 tons)
{
MyMass *tmpm;
CD3 p1;
@@ -742,8 +717,7 @@ U0 Explosion(MyMass *tmpm1,MyMass *tmpm2,F64 r)
d=1;
else
d=Sqrt(d);
d=2e8*r`7/d`6;
if (d>1e5) d=1e5;
d=250000*tons/d`2;
D3MulEqu(&p1,d);
D3AddEqu(&tmpm->DstateDt->DxDt,&p1);
}
@@ -786,7 +760,6 @@ U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)
CTask *task=ode->win_task;
CD3 p,p1,p2;
Ship *tmpsp;
Shot *tmps;
Missile *tmpmi;
MyMass *tmpm,*tmpm1;
@@ -803,20 +776,34 @@ U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)
tmpm->DstateDt->DyDt+=Sqr(Sqr(Sqr(d-tmpm->radius)));
if (d+tmpm->radius>task->pix_height)
tmpm->DstateDt->DyDt-=Sqr(Sqr(Sqr((d+tmpm->radius)-task->pix_height)));
tmpm1=ode->next_mass;
while (tmpm1!=&ode->next_mass) {
if (tmpm!=tmpm1) {
D3Sub(&p,&tmpm->state->x,&tmpm1->state->x);
dd=D3NormSqr(&p);
dd2=Sqr(tmpm->radius+tmpm1->radius);
if (dd<=dd2) {
d=Sqrt(dd)+0.0001;
D3MulEqu(&p,Sqr(Sqr(dd2-dd))/d);
D3AddEqu(&tmpm ->DstateDt->DxDt,&p);
D3SubEqu(&tmpm1->DstateDt->DxDt,&p);
if (tmpm->type!=MT_SUPER_NAPALM_SPLAT) {
tmpm1=ode->next_mass;
while (tmpm1!=&ode->next_mass) {
if (tmpm!=tmpm1) {
if (tmpm1->type==MT_SUPER_NAPALM_SPLAT) {
if (tmpm->type==MT_HUMAN_SHIP || tmpm->type==MT_ENEMY_SHIP) {
D3Sub(&p,&tmpm->state->x,&tmpm1->state->x);
dd=D3NormSqr(&p)+1;
if (dd<100000) {
D3MulEqu(&p,100000/dd);
D3AddEqu(&tmpm1->DstateDt->DxDt,&p);
}
}
} else {
D3Sub(&p,&tmpm->state->x,&tmpm1->state->x);
dd=D3NormSqr(&p);
dd2=Sqr(tmpm->radius+tmpm1->radius);
if (dd<=dd2) {
d=Sqrt(dd)+0.0001;
D3MulEqu(&p,Sqr(Sqr(dd2-dd))/d);
D3AddEqu(&tmpm ->DstateDt->DxDt,&p);
D3SubEqu(&tmpm1->DstateDt->DxDt,&p);
}
}
}
tmpm1=tmpm1->next;
}
tmpm1=tmpm1->next;
}
tmpm=tmpm->next;
}
@@ -825,7 +812,7 @@ U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)
while (tmpsp!=&ship_head) {
if (tmpsp->exploding && tmpsp->die_time<=tS<=tmpsp->die_timeout)
for (i=0;i<tmpsp->masses;i++)
Explosion(&tmpsp->p[i],NULL,tmpsp->p[i].radius/3.0);
Explosion(&tmpsp->p[i],NULL,tmpsp->p[i].radius/250.0);
switch (tmpsp->type) {
case ST_HUMAN1:
if (!tmpsp->exploding) {
@@ -886,19 +873,12 @@ U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)
tmpsp=tmpsp->next;
}
tmps=shot_head.next;
while (tmps!=&shot_head) {
if (tmps->exploding)
Explosion(&tmps->p,NULL,tmps->explosion_radius);
tmps=tmps->next;
}
tmpmi=missile_head.next;
while (tmpmi!=&missile_head) {
if (tmpmi->active) {
if (tmpmi->launched) {
if (tmpmi->exploding)
Explosion(&tmpmi->p_front,&tmpmi->p_back,tmpmi->explosion_radius);
Explosion(&tmpmi->p_front,&tmpmi->p_back,tmpmi->tons);
else {
//Guide missile
if (tmpsp=tmpmi->target) {
@@ -930,17 +910,29 @@ U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)
U0 CheckDamage()
{
I64 i,j,k;
I64 i,j,death_score;
Ship *tmpsp,*tmpsp1;
MyMass *tmpm,*best_mass;
MyMass *tmpm,*tmpm1,*best_mass;
CD3 p,p1,p2;
F64 d,best_distance;
tmpm=ode->next_mass;
while (tmpm!=&ode->next_mass) {
tmpm->temperature*=0.9;
if (tmpm->type==MT_SUPER_NAPALM_SPLAT) {
tmpm1=ode->next_mass;
while (tmpm1!=&ode->next_mass) {
if (tmpm1->type!=MT_SUPER_NAPALM_SPLAT) {
D3Sub(&p,&tmpm1->x,&tmpm->x);
if (D3NormSqr(&p)<Sqr(tmpm1->radius))
tmpm1->temperature+=0.4;
}
tmpm1=tmpm1->next;
}
} else
tmpm->temperature*=0.9;
tmpm=tmpm->next;
}
if (human) {
human->laser_temperature*=0.975;
@@ -984,6 +976,7 @@ U0 CheckDamage()
tmpsp=ship_head.next;
while (tmpsp!=&ship_head) {
tmpsp1=tmpsp->next;
death_score=0;
switch (tmpsp->type) {
case ST_HUMAN1:
if (tmpsp->exploding) {
@@ -1000,18 +993,8 @@ U0 CheckDamage()
else if (i==5)
MissileDel(&tmpsp->missiles[1]);
}
if (tmpsp->s[i].flags&SSF_INACTIVE) {
if (i<3) {
if (!tmpsp->exploding) {
tmpsp->exploding=TRUE;
tmpsp->die_time=tS;
tmpsp->die_timeout=tS+0.75;
game_over=TRUE;
Noise(750,1000,2000);
break;
}
}
}
if (tmpsp->s[i].flags&SSF_INACTIVE && i<3)
death_score++;
}
break;
default:
@@ -1032,19 +1015,23 @@ U0 CheckDamage()
j++;
}
}
k=0;
for (i=0;i<tmpsp->masses;i++) {
if (tmpsp->p[i].temperature>MASS_MAX_TEMP)
k++;
}
if (j>1 || k) {
tmpsp->exploding=TRUE;
tmpsp->die_time=tS;
tmpsp->die_timeout=tS+0.75;
Noise(750,1000,3000);
}
if (j>1)
death_score++;
}
}
if (!tmpsp->exploding) {
for (i=0;i<tmpsp->masses;i++)
if (tmpsp->p[i].temperature>MAX_MASS_TEMP)
death_score++;
if (death_score) {
tmpsp->exploding=TRUE;
tmpsp->die_time=tS;
tmpsp->die_timeout=tS+0.75;
Noise(750,1000,3000);
if (tmpsp->type==ST_HUMAN1)
game_over=TRUE;
}
}
tmpsp=tmpsp1;
}
}
@@ -1058,10 +1045,11 @@ U0 FireOneGun(Ship *tmpsp,I64 n,F64 r,F64 fuse_time)
tmps=CAlloc(sizeof(Shot));
D3Copy(&tmps->p.x,&tmpsp->p[n].x);
tmps->explosion_radius=tmps->radius=r;
tmps->fuse_time=tS+1.5*fuse_time;
tmps->die_timeout=tmps->fuse_time+0.125;
tmps->radius=r;
tmps->splats=20*r;
tmps->fuse_time=tS+fuse_time;
tmps->p.mass=0.3*r*r*r;
tmps->p.type=MT_SUPER_NAPALM_BALL;
D3Sub(&p1,&tmpsp->p[0].x,&tmpsp->p[1].x);
D3Sub(&p2,&tmpsp->p[0].x,&tmpsp->p[2].x);
D3Unit(D3Add(&p,&p1,&p2));
@@ -1138,13 +1126,27 @@ U0 HumanFireLaserEnd()
U0 ExpireShots()
{
I64 i;
F64 é;
Shot *tmps=shot_head.next,*tmps1;
MyMass *tmpm;
while (tmps!=&shot_head) {
tmps1=tmps->next;
if (!tmps->exploding && tS>tmps->fuse_time) {
tmps->exploding=TRUE;
Noise(50,3000,6000);
} else if (tS>tmps->die_timeout) {
if (tS>tmps->fuse_time) {
é=Arg(tmps->p.DxDt,tmps->p.DyDt);
for (i=0;i<tmps->splats;i++) {
tmpm=CAlloc(sizeof(MyMass));
D3Copy(&tmpm->x,&tmps->p.x);
tmpm->radius=1;
tmpm->mass=1;
tmpm->die_timeout=tS+0.2;
tmpm->type=MT_SUPER_NAPALM_SPLAT;
D3Copy(&tmpm->DxDt,&tmps->p.DxDt);
tmpm->DxDt+=50*Sqr(tmps->radius)*Rand*Sin(é+2*ã*i/tmps->splats);
tmpm->DyDt+=50*Sqr(tmps->radius)*Rand*Cos(é+2*ã*i/tmps->splats);
QueIns(tmpm,ode->last_mass);
}
QueRem(tmps);
QueRem(&tmps->p);
Free(tmps);
@@ -1153,6 +1155,20 @@ U0 ExpireShots()
}
}
U0 ExpireSplats()
{
MyMass *tmpm,*tmpm1;
tmpm=ode->next_mass;
while (tmpm!=&ode->next_mass) {
tmpm1=tmpm->next;
if (tmpm->type==MT_SUPER_NAPALM_SPLAT && tS>tmpm->die_timeout) {
QueRem(tmpm);
Free(tmpm);
}
tmpm=tmpm1;
}
}
U0 ExpireMissiles()
{
I64 i;
@@ -1205,6 +1221,18 @@ U0 AI()
U0 InitLevel()
{
I64 i;
MyMass *tmpm,*tmpm1;
tmpm=ode->next_mass;
while (tmpm!=&ode->next_mass) {
tmpm1=tmpm->next;
if (tmpm->type==MT_SUPER_NAPALM_SPLAT) {
QueRem(tmpm);
Free(tmpm);
}
tmpm=tmpm1;
}
if (level==4)
OneTimePopUp(&msg_flags,XMSGF_ANTISPIN,
"Press $$GREEN$$<CURSOR-DOWN>$$FG$$ for anti-spin stabilizer.\n");
@@ -1300,7 +1328,7 @@ U0 XCaliber()
case SC_CURSOR_RIGHT:
if (sc&SCF_CTRL)
HumanFireMissileBegin(0);
if (sc&SCF_SHIFT)
else if (sc&SCF_SHIFT)
ctrl_panel.fuse_time+=2;
else
human_t_right=MAX_THRUST;
@@ -1308,7 +1336,7 @@ U0 XCaliber()
case SC_CURSOR_LEFT:
if (sc&SCF_CTRL)
HumanFireMissileBegin(1);
if (sc&SCF_SHIFT)
else if (sc&SCF_SHIFT)
ctrl_panel.fuse_time-=2;
else
human_t_left =MAX_THRUST;
@@ -1379,6 +1407,7 @@ U0 XCaliber()
}
AI;
ExpireShots;
ExpireSplats;
ExpireMissiles;
CheckDamage;
Refresh; //msgs are only qued by winmgr
+1 -1
View File
@@ -1,6 +1,6 @@
#define LASER_MAX_TEMP 30.0
#define LASER_THRESHOLD_TEMP 10.0
#define MASS_MAX_TEMP 5.0
#define MAX_MASS_TEMP 5.0
class CtrlPanelState
{
Binary file not shown.
+87 -85
View File
File diff suppressed because one or more lines are too long
+1
View File
@@ -61,6 +61,7 @@ public extern I64 MemberMetaData(U8 *st,CMemberLst *ml);
public extern CMemberLstMeta *MemberMetaFind(U8 *st,CMemberLst *ml);
public extern CHashClass *OptClassFwd(CHashClass *tmpc);
public extern I64 PrsKeyWord(CCmpCtrl *cc);
#help_index "Compiler;Cmd Line (Typically)"
extern I64 Cmp(U8 *filename,
U8 *map_name=NULL,U8 *out_name=NULL,U8 mapfile_drv_let=0);
+2 -1
View File
@@ -638,6 +638,8 @@ lex_float_start:
cc->token=TK_STR;
goto lex_end;
case '\'':
if (cc->flags&CCF_NO_CHAR_CONST)
break;
k=0;
for (j=0;j<8;j++) {
if (!(ch=LexGetChar(cc)) || ch=='\'')
@@ -1175,7 +1177,6 @@ lex_check_comment:
goto lex_end;
}
case TK_NUM_TK:
default:
break;
}
}
+8 -1
View File
@@ -18,7 +18,7 @@ U0 DoOnce()
DocBottom;
if (RunFile("::/Misc/OSInstall",,FALSE)) {
*sys_registry_doc->filename.name='C';
"\n\n1) TAD\n\n";
"\n\n1) TAD\n2) DLC\n\n";
switch (GetI64("Staff Member Number:")) {
case 1:
RegWriteBranch("TempleOS/Staff",
@@ -27,6 +27,11 @@ U0 DoOnce()
GetI64("Machine Cfg Number:")
);
break;
case 2:
RegWriteBranch("TempleOS/Staff",
"#define PERSONAL_INITIALS \"DLC\"\n"
"#define MACHINE_CFG 0\n");
break;
}
Del("C:/Home/DoDistro.HC.Z");
Del("D:/Home/DoDistro.HC.Z");
@@ -43,6 +48,8 @@ U0 DoOnce()
"D:/Tmp/Logs/*.log","D:/Home/WebLogRep.DD");
Del("D:/Tmp/Logs/*.log");
}
if (tos_timestamp)
Blog(TRUE);
}
DoOnce;
+9 -26
View File
@@ -127,22 +127,10 @@ Bool MyPutKey(I64 ch,I64 sc)
}
return TRUE;
case SC_F5:
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
KeyDescSet("Edit/Collaborative Fiction");
else
"---- $TX,"Collaborative Fiction",HTML="http://en.wikipedia.org/wiki/Collaborative_fiction"$ ----\n"
"Once upon a time ";
} else {
if (sc&SCF_KEY_DESC)
KeyDescSet("Edit/Moses Comic");
else
"---- Moses Comic ---- "
"(Set in the $TX,"Numbers 11",HTML="http://www.biblegateway.com/passage/?search=Numbers%%%%2011&version=NIV"$ "
"part of the story.)\n"
"Moses says, \"\"\n"
"God says, \"\"\n";
}
if (sc&SCF_KEY_DESC)
KeyDescSet("Edit/God Offering");
else
GodOffer;
return TRUE;
case SC_F6:
if (sc&SCF_SHIFT) {
@@ -159,20 +147,15 @@ Bool MyPutKey(I64 ch,I64 sc)
return TRUE;
case SC_F7:
if (sc&SCF_SHIFT) {
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /NISTGodMisc2");
else
NISTGodMisc2;
} else {
if (sc&SCF_KEY_DESC)
KeyDescSet("Cmd /God Misc");
else
GodMisc;
} 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:
+1 -1
View File
@@ -7,7 +7,7 @@ Option(OPTf_WARN_DUP_TYPES,ON);
KbdTypeMatic(0);
// Las Vegas is -7 during summer, -8 during winter
local_time_offset=-7*60*60*CDATE_FREQ; //Pacific
local_time_offset=-8*60*60*CDATE_FREQ; //Pacific
// Remember you can set the time in the BIOS.
//$AN,"",A="mouse_move_scale"$adjust these to set mouse move scale
+1 -1
View File
@@ -44,4 +44,4 @@ if (DrvIsWritable(':')) {
StartUpTasks;
"\nOS Compile Time:%D %T\n",sys_compile_time,sys_compile_time;
"\nTempleOS V%5.3f\t%D %T\n\n",sys_os_version,sys_compile_time,sys_compile_time;
File diff suppressed because one or more lines are too long
+31 -8
View File
@@ -1,7 +1,7 @@
$WW,1$$FG,5$$TX+CX,"TODO"$$FG$
* $LK,"::/Demo/RandDemo.HC"$ Rand is kinda crappy.
* $LK,"::/Demo/RandDemo.HC"$ is kinda crappy.
* Cursor in $LK,"::/Home/TOSToHtml.HC"$.
* Cursor in $LK,"~/TOSToHtml.HC"$.
* Investigate why packet loss $LK,"Training Sleep(1)",A="FF:::/Adam/Training.HC,Sleep(1)"$.
@@ -9,12 +9,24 @@ $WW,1$$FG,5$$TX+CX,"TODO"$$FG$
* $LK,"SpriteEd",A="FI:::/Adam/Gr/SpriteEd.HC"$ shift pts, Ctrl pt for ellipse/polygon w,h is off when rotated.
* Get rid of $LK,"JobQue",A="MN:JobQue"$() and use just $LK,"Spawn",A="MN:Spawn"$()? Not sure about this, probably.
* Add missiles to $LK,"::/Apps/TimeOut/TimeOut.HC"$.
* Add asteroid harbor defense to $LK,"::/Apps/X-Caliber/X-Caliber.HC"$.
* God said this is bad. $LK,"FL:::/Adam/DolDoc/DocFind.HC,41"$
* Backward <SHIFT-F3> is broken?
* Cannot include ':' in $LK,"Document Links",A="FF:::/Adam/DolDoc/DocLink.HC,AD"$ search string.
* $$DA fixed width string: <Del> or <BACKSPACE> permanently shortens.
* 11/19/16 editor took long time after copying old testament onto clipboard and exiting.
* Nestled switch() start/end?
* Editor filter froze.
* Editor overstrike mode at cmd line with menu macro? Probably, many other overstrike issues.
* $LK,"DOCT_HEX_ED",A="MN:DOCT_HEX_ED"$ with odd size, ASCII cannot be edited.
@@ -66,6 +78,8 @@ $WW,1$$FG,5$$TX+CX,"TODO"$$FG$
* Get rid of JIFFY and HPET and just use tS.
* Use "Rosetta Stone" in documentaion pointing to this: $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$.
* Change %h*c so the character is not a arg?
* $LK,"GrLineFat3",A="MN:GrLineFat3"$() needs a little work.
@@ -117,6 +131,10 @@ $FG,5$$TX+CX,"TODO: Too Hard, or Not Worth Doing."$$FG$
* Short FAT32 ~ names.
* $LK,"Find",A="MN:Find"$() search text in sprites.
* Links in text in sprites.
* Compiler: Inline functions?
* Compiler: FunPtr local vars? I forgot if this was hard or not.
@@ -170,8 +188,6 @@ $FG,5$$TX+CX,"Bugs? Not really sure."$$FG$
$FG,5$$TX+CX,"TODO? Not really, just angst."$$FG$
* Nontimer $LK,"Rand",A="MN:Rand"$() is really bad!
* Should these be moved into $LK,"CHashClass",A="MN:CHashClass"$ from $LK,"CMemberLst",A="MN:CMemberLst"$ and $LK,"CHashGlblVar",A="MN:CHashGlblVar"$?
$ID,5$CArrayDim dim;
CHashFun *fun_ptr;
@@ -405,13 +421,15 @@ Abundance of Spirits $TX,"1 Corinthians 14:12",HTML="http://www.usccb.org/bibl
The stone rejected is cornerstone $TX,"Matthew 21:42",HTML="http://www.biblegateway.com/verse/en/Matthew%2021:42"$
Egypt rise like flood $TX,"Jeremiah 46:7-8",HTML="http://www.biblegateway.com/passage/?search=Jeremiah%2046:7-8&version=NIV"$
New wineskins $TX,"Mark 2:22",HTML="http://www.biblegateway.com/verse/en/Mark%202:22"$
Thousand songs of Solomon $TX,"1 Kings 4:30-32",HTML="http://www.biblegateway.com/passage/?search=1%20Kings%204:30-32&version=NIV"$
Thousand songs of Solomon $TX,"1 Kings 4:32",HTML="http://www.biblegateway.com/passage/?search=1%20Kings%204:32&version=NIV"$
Not rich, nor poor, but my portion $TX,"Proverbs 30:8",HTML="http://www.biblegateway.com/verse/en/Proverbs%2030:8"$
Be hot or cold. Lukewarm I spit you out $TX,"Revelation 3:16",HTML="http://www.biblegateway.com/verse/en/Revelation%203:16"$
$FG,5$$TX+CX,"Misc Notes"$$FG$
Erik van der Karbargenbok: $LK,"TempleBot",A="PI:::/Home/Sup1/Sup1Bin/TempleBot"$.
Erik van der Karbargenbok: $LK,"TempleBot",A="PI:~/Sup1/Sup1Bin/TempleBot"$.
Intel CEO's name: Brian Krzanich
>$FG,2$lspci -v$FG$
Size:$TX,"17416KB",D="DD_TEMPLEOSCD_K_SIZE"$
Size:$TX,"17426KB",D="DD_TEMPLEOSCD_K_SIZE"$
$FG,5$$TX+CX,"My Web Bookmarks"$$FG$$WW,0$
$TX,"My FireFox Bookmarks",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/Bookmarks"$
@@ -425,13 +443,16 @@ Iceberg $HC,"<center><img src=\"https://upload.wikimedia.org/wikipedia/commons/
I made dis $HC,"<center><img src=\"http://i.imgur.com/cZKkxTX.jpg\" width=\"640\" height=\"800\" alt=\"\"></center>"$
NIST Beacon $HC,"<center><img src=\"http://www.nist.gov/itl/csd/ct/images/beacon_architecture_2013.jpg\" width=\"550\" height=\"278\" alt=\"\"></center>"$
Purple Frog $HC,"<center><img src=\"https://s-media-cache-ak0.pinimg.com/736x/fb/08/2a/fb082a53bd798f5957a474ff9095e6d4.jpg\" width=\"640\" height=\"420\" alt=\"\"></center>"$
Casino (Dog) $HC,"<center><img src=\"http://www.templeos.org/images/Dog1855x1056.jpg\" width=\"640\" height=\"364\" alt=\"\"></center>"$
$TX,"SimStructure",HTML="http://www.templeos.org/files/SimStrSetUp.zip"$
$TX,"ASU_Transcripts",HTML="http://www.templeos.org/files/ASU_Transcripts.pdf"$ $TX,"ASU Course Catalog (See page 261)",HTML="https://catalog.asu.edu/files/shared/archives/1994-1996/general/UG1994-1996.pdf/1994-1996-UG-241-267.pdf"$
$TX,"Dr. David Pheanis",HTML="https://webapp4.asu.edu/directory/person/77201"$ $TX,"Dr. Konstantinos S. Tsakalis",HTML="http://ecee.engineering.asu.edu/directory/tenured-and-tenure-track-faculty/kostantinos-s-tsakalis"$ $TX,"Dr. Walter Higgins",HTML="https://webapp4.asu.edu/directory/directorysearch?cn=Walter+Higgins"$
$TX,"Peter Gadwa",HTML="http://www.wired.com/magazine/2010/11/mf_ticketmaster/all/1"$
$TX,"Peter Gadwa",HTML="http://www.wired.com/magazine/2010/11/mf_ticketmaster/all/1"$ $TX,"Ticketmaster",HTML="http://www.nytimes.com/1994/11/06/business/ticketmaster-s-mr-tough-guy.html?pagewanted=a"$
$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."$
$TX,"Stephen Davis",HTML="https://photos.google.com/share/AF1QipM4HI3mb_9qe8wDQ--nRfjIzOKyGG8heqWH-tbGBIIoxChWe4GeBegNzgHRy4Z1Qw?key=eGR0R0tyZG5tenRWd0tDN2RHRFRNTmI4NXdhc25B"$
3qEeEGCAsBABAqFDBeE2G33qEeEGCAsBABAqFDBeE2G33qCsBDBDq2G3s2G3F2G3FqAet2G32G3AEDAqF3qCsBDBDq2G3s2G3F2G3FqAet2G32G3AEDAqF
qFeDAsBDeDqCeF2G3sGGeF2sG3C2G3CBCeF
@@ -443,8 +464,10 @@ $TX,"Handford school",HTML="https:/pinterest.com/pin/255368241346360278"$
$TX,"Look at PCI interrupt routing.",HTML="http://forum.osdev.org/viewtopic.php?f=1&t=29558"$
$TX,"The sins of Newton",HTML="https://www.brainpickings.org/2012/01/04/isaac-newton-list-of-sins"$
$TX,"Stalin's Tanks",HTML="https://boardgamegeek.com/boardgame/5198/stalins-tanks"$
$TX,"Wisdom for the Way",HTML="https://www.amazon.com/Wisdom-Way-Wise-Words-People/dp/1404113258#reader_1404113258"$
$TX,"Lamp shades",HTML="http://www.lampsplus.com/products/lamp-shades"$
$TX,"The Original Jewish Temple",HTML="http://www.jewishvirtuallibrary.org/jsource/Judaism/The_Temple.html"$
$TX,"Top 1000 Movies",HTML="http://www.theyshootpictures.com/gf1000_all1000films.htm"$
$TX,"KingJamesBible with LineNums",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/NumBible.TXT"$
$TX,"Higgs 5-Sigma Proof",HTML="http://understandinguncertainty.org/explaining-5-sigma-higgs-how-well-did-they-do"$
$TX,"The Number Bleem",HTML="http://www.strangehorizons.com/2000/20001120/secret_number.shtml"$
+22 -16
View File
@@ -2,21 +2,25 @@ $TR-UL,"Adam"$
$ID,2$$TR,"SysMsgFlags"$
$ID,2$sys_msg_flags[0]=0xFF;
$ID,-2$$TR,"SysRegVer"$
$ID,2$registry_version=4.120;
$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,"CircleTrace"$
$ID,2$registry_version=4.130;
$ID,-2$$ID,-2$$TR-C-UL,"TempleOS"$
$ID,2$$TR,"CircleTrace"$
$ID,2$F64 best_score=4.9425;
$ID,-2$$TR,"DiningStars"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"Staff"$
$ID,2$#define PERSONAL_INITIALS "TAD"
#define MACHINE_CFG 0
$ID,-2$$TR,"BlackDiamond"$
$ID,2$I64 best_score=1;
$ID,-2$$TR,"TOSVideos"$
$ID,2$I64 tos_code_walk_thru=105,tos_after_egypt_in_action=46;
$ID,-2$$TR,"EagleDive"$
$ID,2$F64 best_score=147.6932;
$ID,-2$$TR,"TOSGodOffer"$
$ID,2$I64 tos_gus_gwen=22;
$ID,-2$$TR,"TOSGodMisc"$
$ID,2$I64 tos_timestamp=0,tos_type=1;
$ID,-2$$TR,"BlackDiamond"$
$ID,2$I64 best_score=1;
$ID,-2$$TR,"DunGen"$
$ID,2$F64 best_score=20.5295;
$ID,-2$$TR,"CastleFrankenstein"$
@@ -25,25 +29,27 @@ $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.3077;
$ID,-2$$TR,"TimeOut"$
$ID,2$I64 best_score=28128;
$ID,-2$$TR,"RawHide"$
$ID,2$F64 best_score=96.1279;
$ID,-2$$TR,"KeepAway"$
$ID,2$I64 best_score0=68,best_score1=30;
$ID,-2$$TR,"XCaliber"$
$ID,2$I64 best_score=248;
I64 msg_flags=1;
$ID,-2$$TR,"Wenceslas"$
$ID,2$F64 best_score=43.9944;
$ID,-2$$TR,"Talons"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"FlapBat"$
$ID,2$F64 best_score=16.3077;
$ID,-2$$TR,"XCaliber"$
$ID,2$I64 best_score=20;
I64 msg_flags=1;
$ID,-2$$TR,"BomberGolf"$
$ID,2$I64 best_score=175;
$ID,-2$$TR,"TimeOut"$
$ID,2$I64 best_score=11291;
$ID,-2$$ID,-2$$TR,"DemoCompany"$
$ID,2$
$TR,"Game1"$
$ID,2$F64 best_score=511.36611;
$ID,2$F64 best_score=180.03208;
$TR,"SimpleVal"$
$ID,2$1387;
$ID,2$1400;
$ID,-2$$ID,-2$
+7 -3
View File
@@ -97,7 +97,7 @@ public U0 MakeWebSitePartial()
Drv('C');
}
public U0 Blog()
public U0 Blog(Bool god_misc2=FALSE)
{
if (!FileFind(BlogLocalFile,,FUF_JUST_FILES))
Copy("~/Web/" PERSONAL_INITIALS "/DailyBlogHeader.DD.Z",
@@ -106,8 +106,12 @@ public U0 Blog()
WinBorder;
WinMax;
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN|SCF_CTRL);
Msg(MSG_KEY_DOWN_UP,0,SC_F6|SCF_ALT);
Msg(MSG_KEY_DOWN_UP,'\n',0);
if (god_misc2)
Msg(MSG_KEY_DOWN_UP,0,SC_F7|SCF_SHIFT|SCF_ALT);
else {
Msg(MSG_KEY_DOWN_UP,0,SC_F6|SCF_ALT);
Msg(MSG_KEY_DOWN_UP,'\n',0);
}
if (Ed(BlogLocalFile,EDF_WAS_WRITE)) {
DocOpt(BlogLocalFile,"-r");
Copy(BlogLocalFile,"::" DAILY_BASE ".DD.Z");
+24 -15
View File
@@ -238,7 +238,7 @@ U0 MakeStaffDistro()
ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOSSTAFF_SIZE",
"Download $TX,"TempleOS V4.12",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1fMB)",
"Download $TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1fMB)",
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
Drv('C');
}
@@ -266,7 +266,7 @@ U0 MakeDbgDistro()
ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOSDBG_SIZE",
"Download $TX,"TempleOS V4.12",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1fMB)",
"Download $TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1fMB)",
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
Drv('C');
}
@@ -292,7 +292,7 @@ U0 MakeStdDistro()
ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOSCD_SIZE",
"Download $TX,"TempleOS V4.12",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
"Download $TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
Drv('C');
}
@@ -301,7 +301,7 @@ U0 MakeStdRedSeaDistro()
StdDistroPrep;
RedSeaISO(TOS_ISO_C_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOSCD_RS_SIZE",
"Download $TX,"TempleOS V4.12",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1fMB)",
"Download $TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1fMB)",
0.1*(10*Size(TOS_ISO_C_NAME,"+s")/1024/1024));
Drv('C');
}
@@ -325,7 +325,7 @@ U0 UltraDistroPrep()
Del(TOS_DISTRO_DIR "/Misc/OSTestSuite.HC.Z");
Copy("C:/Home/Sup1/Sup1Distro/UltraMenu.DD.Z",
TOS_DISTRO_DIR "/PersonalMenu.DD.Z");
Copy("C:/Demo/Games/EagleDive.HC.Z",
Copy("C:/Demo/Games/Talons.HC.Z",
TOS_DISTRO_DIR "/Misc");
}
U0 MakeUltraDistro()
@@ -334,7 +334,7 @@ U0 MakeUltraDistro()
ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOSULTRA_SIZE",
"Download $TX,"TempleOS V4.12",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2fMB)",
"Download $TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2fMB)",
0.01*(100*Size(TOS_ISO_NAME,"+s")/1024/1024));
Drv('C');
}
@@ -343,14 +343,14 @@ U0 MakeUltraRedSeaDistro()
UltraDistroPrep;
RedSeaISO(TOS_ISO_C_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOSULTRA_RS_SIZE",
"Download $TX,"TempleOS V4.12",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2fMB)",
"Download $TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2fMB)",
0.01*(100*Size(TOS_ISO_C_NAME,"+s")/1024/1024));
Drv('C');
}
U0 MakeSup1ISO()
{
RedSeaISO(TOS_ISO_C_NAME,"::/Home/Sup1");
RedSeaISO(TOS_ISO_C_NAME,"~/Sup1");
DefinePrint("DD_TEMPLEOS_SUP1_SIZE","Supplemental ISO #1 (%0.2fMB)",
0.01*(100*Size(TOS_ISO_C_NAME,"+s")/1024/1024));
Drv('C');
@@ -360,31 +360,31 @@ U0 UpdateISODocDefines()
{
try {
DefinePrint("DD_TEMPLEOSCD_SIZE",
"Download $TX,"TempleOS V4.12",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
"Download $TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
0.1*(10*Size("D:/Wb/TempleOSCD.ISO","+s")/1024/1024));
DefinePrint("DD_TEMPLEOSCD_K_SIZE",
"%dKB",Size("D:/Wb/TempleOSCD.ISO","+s")/1024);
// DefinePrint("DD_TEMPLEOSCD_RS_SIZE",
// "Download $TX,"TempleOS V4.12",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1fMB)",
// "Download $TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1fMB)",
// 0.1*(10*Size("D:/Wb/TempleOSCDRS.ISO","+s")/1024/1024));
// DefinePrint("DD_TEMPLEOSCD_RS_K_SIZE",
// "%dKB",Size("D:/Wb/TempleOSCDRS.ISO","+s")/1024);
DefinePrint("DD_TEMPLEOSULTRA_SIZE",
"Download $TX,"TempleOS V4.12",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2fMB)",
"Download $TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2fMB)",
0.01*(100*Size("D:/Wb/TempleOSUltra.ISO","+s")/1024/1024));
DefinePrint("DD_TEMPLEOSULTRA_K_SIZE",
"%dKB",Size("D:/Wb/TempleOSUltra.ISO","+s")/1024);
// DefinePrint("DD_TEMPLEOSULTRA_RS_SIZE",
// "Download $TX,"TempleOS V4.12",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2fMB)",
// "Download $TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2fMB)",
// 0.01*(100*Size("D:/Wb/TempleOSUltraRS.ISO","+s")/1024/1024));
// DefinePrint("DD_TEMPLEOSULTRA_RS_K_SIZE",
// "%dKB",Size("D:/Wb/TempleOSUltraRS.ISO","+s")/1024);
// DefinePrint("DD_TEMPLEOSDBG_SIZE",
// "Download $TX,"TempleOS V4.12",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.2fMB)",
// "Download $TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.2fMB)",
// 0.01*(100*Size("D:/Wb/TempleOSDbg.ISO","+s")/1024/1024));
// DefinePrint("DD_TEMPLEOSDBG_K_SIZE",
// "%dKB",Size("D:/Wb/TempleOSDbg.ISO","+s")/1024);
@@ -403,6 +403,7 @@ public U0 MakeDistrosAndBackUp()
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
progress4=*progress4_desc=0;
progress4_max=18;
progress4_t0=tS;
AutoComplete;
WinBorder;
WinMax;
@@ -434,7 +435,7 @@ public U0 MakeDistrosAndBackUp()
DocClear;
Move(TOS_ISO_C_NAME,"D:/Wb/TempleOSSup1.ISO"); progress4++;
// MakeStaffDistro; progress4++;
// MakeDbgDistro; progress4++;
// DocClear;
// Move(TOS_ISO_NAME,"D:/Wb/TempleOSDbg.ISO"); progress4++;
@@ -446,21 +447,29 @@ public U0 MakeDistrosAndBackUp()
Cd("C:/");
DocClear;
"$$PURPLE$$Lines longer than 80 columns:$$FG$$\n";
if (LongLines)
throw;
progress4++;
DocClear;
"$$PURPLE$$Broken DolDoc Links:$$FG$$\n";
if (LinkChk)
throw;
progress4++;
DocClear;
MakeSymFiles; progress4++;
DocClear;
MakeWebSite; progress4++;
Drv('C');
ChkAll; progress4++;
progress4=progress4_max=0;
SettingsPop;
"Elapsed Time:%5.3f\n",tS-progress4_t0;
ProgressBarsRst;
}
public U0 PreBackUp()
+477 -146
View File
@@ -5,7 +5,6 @@ U8 *URLPercentSpaces(U8 *src)
U8 buf[2048],*dst=buf;
while (*src) {
if (*src==CH_SPACE) {
*dst++='%';
*dst++='%';
*dst++='2';
*dst++='0';
@@ -45,7 +44,8 @@ I64 ExtDecFromHex(U8 *st,I64 digits)
return res;
}
U0 TOSBibleLines(U8 *st,I64 num_lines,I64 radix,Bool modulo,Bool plus_one)
U0 TOSBookLines(U8 *book_filename,I64 book_lines,U8 *st,I64 num_lines,
I64 radix,Bool modulo,Bool plus_one)
{//Radix<0 means extract N dec digits from hex.
CDoc *doc_out,*doc_in;
CDocEntry *doc_e;
@@ -62,8 +62,8 @@ U0 TOSBibleLines(U8 *st,I64 num_lines,I64 radix,Bool modulo,Bool plus_one)
DocPrint(doc_out,"0x%s-->",st);
if (modulo) {
DocPrint(doc_out,"(%d remainder when divided by %d)",
i,ST_BIBLE_LINES-(num_lines-1));
start=i%(ST_BIBLE_LINES-(num_lines-1));
i,book_lines-(num_lines-1));
start=i%(book_lines-(num_lines-1));
} else {
if (radix>=0 || plus_one)
DocPrint(doc_out,"%d",i);
@@ -75,12 +75,15 @@ U0 TOSBibleLines(U8 *st,I64 num_lines,I64 radix,Bool modulo,Bool plus_one)
}
DocPrint(doc_out,"-->Line:%d\n",start);
verse=BibleLine2Verse(start);
DocPrint(doc_out,"$TX,"KingJamesBible",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/NumBible.TXT"$ (%s)\n\nGod says...\n$$RED$$",verse);
Free(verse);
if (StrMatch("NumBible",book_filename)) {
verse=BibleLine2Verse(start);
DocPrint(doc_out,"$TX,"KingJamesBible",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/NumBible.TXT"$ (%s)\n\nGod says...\n$$RED$$",verse);
Free(verse);
} else if (StrMatch("Kosher",book_filename))
DocPrint(doc_out,"$TX,"KosherTexts",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/Kosher.TXT"$\n\nGod says...\n$$RED$$");
doc_in=DocNew;
BibleLines(doc_in,start,num_lines,"::/Home/Sup1/Sup1Blog/NumBible.TXT");
BookLines(doc_in,start,num_lines,book_filename);
while (TRUE) {//Del leading blanks
doc_e=doc_in->head.next;
if (doc_e==doc_in)
@@ -161,7 +164,7 @@ public U0 GodBooksPassage(U8 *files_find_mask,I64 len=512,
DirTreeDel(tmpde1);
}
U8 *GodVideoRead(U8 *filename,I64 line)
U8 *FileDblRead(U8 *filename,I64 line)
{
U8 *res=NULL;
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
@@ -171,7 +174,7 @@ U8 *GodVideoRead(U8 *filename,I64 line)
return res;
}
U8 *GodVideoWrite(U8 *filename,I64 line,U8 *st)
U8 *FileDblWrite(U8 *filename,I64 line,U8 *st)
{
U8 *res=NULL;
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
@@ -201,10 +204,11 @@ U0 GodVideo(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename)
U8 *st,*st2;
CGodVideoForm *gvf=CAlloc(sizeof(CGodVideoForm));
I64 i=ExtDecFromHex(rnd,digits);
if (st=GodVideoRead(filename,i*2)) {
if (!i) i=Round(10`digits);
if (st=FileDblRead(filename,i*2)) {
StrCpy(gvf->title,st);
Free(st);
if (!(st=GodVideoRead(filename,i*2+1))||!*st) {
if (!(st=FileDblRead(filename,i*2+1))||!*st) {
Free(st);
if (DocForm(gvf) && *gvf->serial) {
if (gvf->min || gvf->sec)
@@ -212,10 +216,11 @@ U0 GodVideo(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename)
gvf->serial,gvf->min*60+gvf->sec);
else
st=StrNew(gvf->serial);
GodVideoWrite(filename,i*2+1,st);
FileDblWrite(filename,i*2+1,st);
} else
st=NULL;
}
"'%s'-->(Taking first 2 decimal digits) #%02d\n",rnd,i;
if (StrIMatch("Metallica",filename)) {
st2=URLPlusSpaces(gvf->title+3);
"God's response:\n"
@@ -245,6 +250,21 @@ U0 GodVideo(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename)
Free(gvf);
}
U0 GodWebIdx(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename)
{
U8 *st1,*st2;
I64 i=ExtDecFromHex(rnd,digits);
if (!i) i=Round(10`digits);
"'%s'-->(Taking first 2 decimal digits) #%02d\n",rnd,i;
st1=FileDblRead(filename,i*2);
st2=FileDblRead(filename,i*2+1);
"God's response:\n";
"$$TX,\"%s\",HTML=\"%s\"$$\n",title,webpage;
"$$TX,\"%s\",HTML=\"%s\"$$\n",st1,st2;
Free(st1);
Free(st2);
}
class CRandExtDec5Form
{
I64 timestamp;
@@ -252,16 +272,14 @@ class CRandExtDec5Form
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
I64 cert;
};
class CNISTBeaconRandExtDec5Form
{
I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n";
U8 rnd0[512] fmtstr "$$DA-P,A=\"5 Decimal Digits from Hex:%s\"$$\n";
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert;
};
@@ -272,6 +290,14 @@ class CHexWordForm
U8 rnd1[512] fmtstr "$$DA-P,A=\"Hex Word Indices#1:%s\"$$\n";
U8 rnd2[512] fmtstr "$$DA-P,A=\"Hex Word Indices#2:%s\"$$\n";
U8 rnd3[512] fmtstr "$$DA-P,A=\"Hex Word Indices#3:%s\"$$\n";
U8 rnd4[512] fmtstr "$$DA-P,A=\"Hex Word Indices#4:%s\"$$\n";
U8 rnd5[512] fmtstr "$$DA-P,A=\"Hex Word Indices#5:%s\"$$\n";
U8 rnd6[512] fmtstr "$$DA-P,A=\"Hex Word Indices#6:%s\"$$\n";
U8 rnd7[512] fmtstr "$$DA-P,A=\"Hex Word Indices#7:%s\"$$\n";
U8 rnd8[512] fmtstr "$$DA-P,A=\"Hex Word Indices#8:%s\"$$\n";
U8 rnd9[512] fmtstr "$$DA-P,A=\"Hex Word Indices#9:%s\"$$\n";
U8 rndA[512] fmtstr "$$DA-P,A=\"Hex Word Indices#A:%s\"$$\n";
U8 rndB[512] fmtstr "$$DA-P,A=\"Hex Word Indices#B:%s\"$$\n";
I64 cert;
};
@@ -282,6 +308,14 @@ class CNISTBeaconHexWordForm
U8 rnd1[512] fmtstr "$$DA-P,A=\"Hex Word Indices#1:%s\"$$\n";
U8 rnd2[512] fmtstr "$$DA-P,A=\"Hex Word Indices#2:%s\"$$\n";
U8 rnd3[512] fmtstr "$$DA-P,A=\"Hex Word Indices#3:%s\"$$\n";
U8 rnd4[512] fmtstr "$$DA-P,A=\"Hex Word Indices#4:%s\"$$\n";
U8 rnd5[512] fmtstr "$$DA-P,A=\"Hex Word Indices#5:%s\"$$\n";
U8 rnd6[512] fmtstr "$$DA-P,A=\"Hex Word Indices#6:%s\"$$\n";
U8 rnd7[512] fmtstr "$$DA-P,A=\"Hex Word Indices#7:%s\"$$\n";
U8 rnd8[512] fmtstr "$$DA-P,A=\"Hex Word Indices#8:%s\"$$\n";
U8 rnd9[512] fmtstr "$$DA-P,A=\"Hex Word Indices#9:%s\"$$\n";
U8 rndA[512] fmtstr "$$DA-P,A=\"Hex Word Indices#A:%s\"$$\n";
U8 rndB[512] fmtstr "$$DA-P,A=\"Hex Word Indices#B:%s\"$$\n";
I64 cert;
};
@@ -293,17 +327,14 @@ class CRandHex5Form
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
I64 cert;
};
class CNISTBeaconRandHex5Form
{
I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n";
U8 rnd0[512] fmtstr "$$DA-P-TRM,LEN=5,"
"A=\"Line (5-Digit Hex):%5s\"$$\n";
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert;
};
@@ -315,17 +346,14 @@ class CRandHex8Form
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
I64 cert;
};
class CNISTBeaconRandHex8Form
{
I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n";
U8 rnd0[512] fmtstr "$$DA-P-TRM,LEN=8,"
"A=\"Line (8-Digit Hex):%8s\"$$\n";
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert;
};
@@ -337,17 +365,33 @@ class CMoviesForm
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert;
};
class CNISTMoviesForm
class CPaintingsForm
{
I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n";
I64 timestamp;
U8 rnd0[512] fmtstr "$$DA-P,"
"A=\"Movie #1-100 (2 Decimal Digits from Hex):%s\"$$\n";
"A=\"Painting #00-99 (2 Decimal Digits from Hex):%s\"$$\n";
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert;
};
@@ -359,17 +403,14 @@ class CMetallicaForm
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
I64 cert;
};
class CNISTMetallicaForm
{
I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n";
U8 rnd0[512] fmtstr "$$DA-P,"
"A=\"Song #1-99 (2 Decimal Digits from Hex):%s\"$$\n";
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert;
};
@@ -380,19 +421,35 @@ class CCertRandDec5Form
U8 rnd1[512];
U8 rnd2[512];
U8 rnd3[512];
U8 rnd4[512];
U8 rnd5[512];
U8 rnd6[512];
U8 rnd7[512];
U8 rnd8[512];
U8 rnd9[512];
U8 rndA[512];
U8 rndB[512];
I64 cert fmtstr "$$DA,A=\"Certificate:%d\"$$\n";
};
U0 GodWordBatch(CHexWordForm *url)
U0 GodWordBatch(CHexWordForm *gm)
{
I64 i=0;
CDirEntry *tmpde,*tmpde1;
FifoU8Flush(god.fifo);
GodHexIns(url->rnd0);
GodHexIns(url->rnd1);
GodHexIns(url->rnd2);
GodHexIns(url->rnd3);
GodHexIns(gm->rnd0);
GodHexIns(gm->rnd1);
GodHexIns(gm->rnd2);
GodHexIns(gm->rnd3);
GodHexIns(gm->rnd4);
GodHexIns(gm->rnd5);
GodHexIns(gm->rnd6);
GodHexIns(gm->rnd7);
GodHexIns(gm->rnd8);
GodHexIns(gm->rnd9);
GodHexIns(gm->rndA);
GodHexIns(gm->rndB);
tmpde=tmpde1=FilesFind(god.word_file_mask,god.word_fuf_flags);
while (tmpde) {
PutFileLink(tmpde->full_name);
@@ -402,36 +459,61 @@ U0 GodWordBatch(CHexWordForm *url)
DirTreeDel(tmpde1);
"\n$$RED$$";
if (*url->rnd0)
"%s\n",url->rnd0;
if (*url->rnd1)
"%s\n",url->rnd1;
if (*url->rnd2)
"%s\n",url->rnd2;
if (*url->rnd3)
"%s\n",url->rnd3;
if (*gm->rnd0)
"%s\n",gm->rnd0;
if (*gm->rnd1)
"%s\n",gm->rnd1;
if (*gm->rnd2)
"%s\n",gm->rnd2;
if (*gm->rnd3)
"%s\n",gm->rnd3;
if (*gm->rnd4)
"%s\n",gm->rnd4;
if (*gm->rnd5)
"%s\n",gm->rnd5;
if (*gm->rnd6)
"%s\n",gm->rnd6;
if (*gm->rnd7)
"%s\n",gm->rnd7;
if (*gm->rnd8)
"%s\n",gm->rnd8;
if (*gm->rnd9)
"%s\n",gm->rnd9;
if (*gm->rndA)
"%s\n",gm->rndA;
if (*gm->rndB)
"%s\n",gm->rndB;
'\n';
while (FifoU8Cnt(god.fifo)>20) {
GodBits(3);
"%02d: ",i++;
GodWord(TRUE);
GodWord(20,TRUE);
}
FifoU8Flush(god.fifo);
"$$FG$$\n";
}
#define NIST_TIME_OFFSET (-7998-local_time_offset/CDATE_FREQ)
#define NIST_TIME_OFFSET (-8015-local_time_offset/CDATE_FREQ)
#define NIST_TIME_TO_SWITCH 3
I64 CDate2Unix(CDate dt)
{
return ToI64((dt-Str2Date("1/1/1970"))/CDATE_FREQ+NIST_TIME_OFFSET);
}
CDate Unix2CDate(I64 timestamp)
{
return (timestamp-NIST_TIME_OFFSET)*CDATE_FREQ+Str2Date("1/1/1970");
}
public U0 NISTSync()
{
I64 i,j;
CDate d;
CDate dt;
CDateStruct ds;
while (!ScanChar) {
d=Now;
Date2Struct(&ds,d);
i=ToI64((d-Str2Date("1/1/1970"))/CDATE_FREQ+NIST_TIME_OFFSET);
dt=Now;
Date2Struct(&ds,dt);
i=CDate2Unix(dt);
j=FloorI64(i,60);
"%d %d %02d %02d\n",i,j,ds.sec,(60+ds.sec-(i-j))%60;
Sleep(100);
@@ -442,94 +524,304 @@ U0 NISTBeaconURL(I64 timestamp)
{
U8 *tag;
CDateStruct ds;
CDate dt=(timestamp-NIST_TIME_OFFSET)*CDATE_FREQ+Str2Date("1/1/1970");
CDate dt=Unix2CDate(timestamp);
Date2Struct(&ds,dt+local_time_offset+30*CDATE_FREQ);
"$$TX,\"NIST Beacon Date:%D Time:%02d:%02d Unix TimeStamp:%u\","
"HTML=\"https://beacon.nist.gov/home\"$$\n",dt,ds.hour,ds.min,timestamp;
tag=MStrPrint("https:/beacon.nist.gov/rest/record/%d",timestamp);
tag=MStrPrint("https://beacon.nist.gov/rest/record/%d",timestamp);
"$$TX,\"NIST Beacon Record:%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag;
Free(tag);
}
U0 TOSGodDoodle(CNISTBeaconHexWordForm *gm,Bool NIST)
{
CDC *dc;
Bool old_silent;
U8 *elems,*hex=MAlloc(sizeof(CNISTBeaconHexWordForm.rnd0)*12);
StrPrint(hex,"%s%s",gm->rnd0,gm->rnd1);
if (NIST) {
gm->timestamp=FloorI64(CDate2Unix(Now),60);
if (DocForm(gm(CNISTBeaconHexWordForm *)))
NISTBeaconURL(gm->timestamp);
else
goto gd_done;
}
CatPrint(hex,"%s%s",gm->rnd2,gm->rnd3);
if (NIST) {
gm->timestamp=FloorI64(CDate2Unix(Now),60);
if (DocForm(gm(CNISTBeaconHexWordForm *)))
NISTBeaconURL(gm->timestamp);
else
goto gd_done;
}
CatPrint(hex,"%s%s",gm->rnd4,gm->rnd5);
if (NIST) {
gm->timestamp=FloorI64(CDate2Unix(Now),60);
if (DocForm(gm(CNISTBeaconHexWordForm *)))
NISTBeaconURL(gm->timestamp);
else
goto gd_done;
}
CatPrint(hex,"%s%s",gm->rnd6,gm->rnd7);
if (NIST) {
gm->timestamp=FloorI64(CDate2Unix(Now),60);
if (DocForm(gm(CNISTBeaconHexWordForm *)))
NISTBeaconURL(gm->timestamp);
else
goto gd_done;
}
CatPrint(hex,"%s%s",gm->rnd8,gm->rnd9);
if (NIST) {
gm->timestamp=FloorI64(CDate2Unix(Now),60);
if (DocForm(gm(CNISTBeaconHexWordForm *)))
NISTBeaconURL(gm->timestamp);
else
goto gd_done;
}
CatPrint(hex,"%s%s",gm->rndA,gm->rndB);
if (elems=GodDoodleSprite(hex)) {
dc=Sprite2DC(elems);
BlogDCImgWrite(dc);
DCDel(dc);
Free(elems);
old_silent=Silent;
MakeWebSitePartial;
Silent(old_silent);
}
gd_done:
Free(hex);
}
I64 GodMiscHeader(U8 *type=NULL)
{
CDateStruct ds;
I64 res;
if (type) {
res=FloorI64(CDate2Unix(Now+120*CDATE_FREQ),60);
Date2Struct(&ds,Unix2CDate(res)+local_time_offset+30*CDATE_FREQ);
"Response of %s at %02d:%02d Timestamp:%d.\n\n",type,ds.hour,ds.min,res;
In("%c//Response of %s at %02d:%02d Timestamp:%d.\n\n",
CH_ESC,type,ds.hour,ds.min,res);
}
"$$TX,\"Guidelines for Talking with God.\","
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
return res;
}
RegSetDftEntry("TempleOS/TOSGodMisc","I64 tos_timestamp=0,tos_type=0;\n");
RegExeBranch("TempleOS/TOSGodMisc");
U0 NISTGodMisc1()
{
tos_type=PopUpPickLst("ExtDec5Bible\0ExtDec5Kosher\0LinuxWords\0HappyWords\0"
"Hex5Bible\0Hex8Books\0Doodle\0Movie\0Painting\0Metallica\0");
switch (tos_type) {
case: tos_timestamp=GodMiscHeader("Bible"); break;
case: tos_timestamp=GodMiscHeader("Kosher"); break;
case: tos_timestamp=GodMiscHeader("LinuxWords"); break;
case: tos_timestamp=GodMiscHeader("HappyWords"); break;
case: tos_timestamp=GodMiscHeader("Bible"); break;
case: tos_timestamp=GodMiscHeader("BookPick"); break;
case: tos_timestamp=GodMiscHeader("Doodle"); break;
case: tos_timestamp=GodMiscHeader("Movie"); break;
case: tos_timestamp=GodMiscHeader("Painting"); break;
case: tos_timestamp=GodMiscHeader("Metallica"); break;
}
RegWriteBranch("TempleOS/TOSGodMisc","I64 tos_timestamp=%d,tos_type=%d;\n",
tos_timestamp,tos_type);
}
U0 NISTGodMisc2()
{
CRandExtDec5Form *gm=CAlloc(sizeof(CRandExtDec5Form));
gm->timestamp=tos_timestamp;
tos_timestamp=0;
RegWriteBranch("TempleOS/TOSGodMisc","I64 tos_timestamp=%d,tos_type=%d;\n",
tos_timestamp,tos_type);
switch (tos_type) {
case:
if (DocForm(gm(CRandExtDec5Form *))) {
NISTBeaconURL(gm->timestamp);
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,-5,FALSE,FALSE);
}
break;
case:
if (DocForm(gm(CRandExtDec5Form *))) {
NISTBeaconURL(gm->timestamp);
TOSBookLines("~/Sup1/Sup1Blog/Kosher.TXT",100000,
gm->rnd0,20,-5,FALSE,FALSE);
}
break;
case:
if (DocForm(gm(CHexWordForm *))) {
NISTBeaconURL(gm->timestamp);
Adam("GodInit(\"~/Sup1/Sup1Words/LinuxDict.TXT*\");");
GodWordBatch(gm);
}
break;
case:
if (DocForm(gm(CHexWordForm *))) {
NISTBeaconURL(gm->timestamp);
Adam("GodInit(\"~/Sup1/Sup1Words/HappyWords.TXT*\");");
GodWordBatch(gm);
}
break;
case:
if (DocForm(gm(CRandHex5Form *))) {
"$$TX,\"How this random Bible passage was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/NISTPassage.html\"$$\n";
NISTBeaconURL(gm->timestamp);
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,16,TRUE,TRUE);
}
break;
case:
if (DocForm(gm(CRandHex8Form *))) {
"$$TX,\"How this random book pick was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/NISTPick001.html\"$$\n";
NISTBeaconURL(gm->timestamp);
GodBooksPassage("C:/Home/Sup1/Sup1Texts/*",,
Str2I64(gm->rnd0,16),GBP_MEDIUM);
}
break;
case:
if (DocForm(gm(CHexWordForm *))) {
NISTBeaconURL(gm->timestamp);
TOSGodDoodle(gm,TRUE);
}
break;
case:
if (DocForm(gm(CMoviesForm *))) {
NISTBeaconURL(gm->timestamp);
GodVideo("Top 100 Movies",
"http://www.afi.com/100years/movies10.aspx",
gm->rnd0,2,"C:/Home/Sup1/Sup1Blog/Movies.DD.Z");
}
break;
case:
if (DocForm(gm(CPaintingsForm *))) {
NISTBeaconURL(gm->timestamp);
GodWebIdx("Top 100 Paintings",
"http://www.brushwiz.com/most-famous-paintings",
gm->rnd0,2,"C:/Home/Sup1/Sup1Blog/Paintings.DD.Z");
}
break;
case:
if (DocForm(gm(CMetallicaForm *))) {
NISTBeaconURL(gm->timestamp);
GodVideo("Metallica Song",
"http://home.hccnet.nl/a.r.adams/lyrics/"
"metallica/songindex.html",
gm->rnd0,2,"C:/Home/Sup1/Sup1Blog/Metallica.DD.Z");
}
break;
}
Free(gm);
}
U0 GodMisc()
{
U8 *st,*tag;
CRandExtDec5Form *gm=CAlloc(sizeof(CRandExtDec5Form));
I64 i=PopUpPickLst("NISTBeacon\0HotBits\0Random.org\0RandomNumbers.info\0"
"ANU_NIST\0Password\0GenerateData\0VirtualNotary\0Timer\0");
I64 i=PopUpPickLst("NISTBeacon\0HotBits\0ANU_NIST\0Random.org\0"
"RandomNumbers.info\0Password\0GenerateData\0VirtualNotary\0Timer\0");
if (i>=0) {
"$$TX,\"Guidelines for Talking with God.\","
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
switch (i) {
case:
gm->timestamp=FloorI64((Now-Str2Date("1/1/1970"))/CDATE_FREQ+
NIST_TIME_OFFSET-NIST_TIME_TO_SWITCH,60);
switch (PopUpPickLst("ExtDec5Bible\0HexWordBatch\0Hex5Bible\0"
"Hex8Books\0Movie\0Metallica\0")) {
case:
if (DocForm(gm(CNISTBeaconRandExtDec5Form *))) {
NISTBeaconURL(gm->timestamp);
TOSBibleLines(gm->rnd0,20,-5,FALSE,FALSE);
}
break;
case:
if (DocForm(gm(CNISTBeaconHexWordForm *))) {
NISTBeaconURL(gm->timestamp);
GodWordBatch(gm);
}
break;
case:
if (DocForm(gm(CNISTBeaconRandHex5Form *))) {
"$$TX,\"How this random Bible passage was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/NISTPassage.html\"$$\n";
NISTBeaconURL(gm->timestamp);
TOSBibleLines(gm->rnd0,20,16,TRUE,TRUE);
}
break;
case:
if (DocForm(gm(CNISTBeaconRandHex8Form *))) {
"$$TX,\"How this random book pick was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/NISTPick001.html\"$$\n";
NISTBeaconURL(gm->timestamp);
GodBooksPassage("C:/Home/Sup1/Sup1Texts/*",,
Str2I64(gm->rnd0,16),GBP_MEDIUM);
}
break;
case:
if (DocForm(gm(CNISTMoviesForm *))) {
NISTBeaconURL(gm->timestamp);
GodVideo("Top 100 Movies",
"http://www.afi.com/100years/movies10.aspx",
gm->rnd0,2,"C:/Home/Sup1/Sup1Blog/Movies.DD.Z");
}
break;
case:
if (DocForm(gm(CNISTMetallicaForm *))) {
NISTBeaconURL(gm->timestamp);
GodVideo("Metallica Song",
"http://home.hccnet.nl/a.r.adams/lyrics/"
"metallica/songindex.html",
gm->rnd0,2,"C:/Home/Sup1/Sup1Blog/Metallica.DD.Z");
}
break;
}
NISTGodMisc1;
break;
start:
case:
tag="https://www.fourmilab.ch/hotbits/secure_generate.html";
break;
case:
tag="http://qrng.anu.edu.au/NIST.php";
break;
end:
GodMiscHeader;
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag;
switch (PopUpPickLst("ExtDec5Bible\0ExtDec5Kosher\0LinuxWords\0"
"HappyWords\0Hex5Bible\0Hex8Books\0Doodle\0Movie\0Painting\0"
"Metallica\0")) {
case:
if (DocForm(gm(CRandExtDec5Form *)))
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,-5,FALSE,FALSE);
break;
case:
if (DocForm(gm(CRandExtDec5Form *)))
TOSBookLines("~/Sup1/Sup1Blog/Kosher.TXT",100000,
gm->rnd0,20,-5,FALSE,FALSE);
break;
case:
if (DocForm(gm(CHexWordForm *))) {
Adam("GodInit(\"~/Sup1/Sup1Words/LinuxDict.TXT*\");");
GodWordBatch(gm);
}
break;
case:
if (DocForm(gm(CHexWordForm *))) {
Adam("GodInit(\"~/Sup1/Sup1Words/HappyWords.TXT*\");");
GodWordBatch(gm);
}
break;
case:
if (DocForm(gm(CRandHex5Form *))) {
"$$TX,\"How this random Bible passage was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/Passage.html\"$$\n";
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,16,TRUE,TRUE);
}
break;
case:
if (DocForm(gm(CRandHex8Form *))) {
"$$TX,\"How this random book pick was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/Pick001.html\"$$\n";
GodBooksPassage("C:/Home/Sup1/Sup1Texts/*",,
Str2I64(gm->rnd0,16),GBP_MEDIUM);
}
break;
case:
if (DocForm(gm(CHexWordForm *)))
TOSGodDoodle(gm,FALSE);
break;
case:
if (DocForm(gm(CMoviesForm *)))
GodVideo("Top 100 Movies",
"http://www.afi.com/100years/movies10.aspx",
gm->rnd0,2,"C:/Home/Sup1/Sup1Blog/Movies.DD.Z");
break;
case:
if (DocForm(gm(CPaintingsForm *))) {
GodWebIdx("Top 100 Paintings",
"http://www.brushwiz.com/most-famous-paintings",
gm->rnd0,2,"C:/Home/Sup1/Sup1Blog/Paintings.DD.Z");
}
break;
case:
if (DocForm(gm(CMetallicaForm *)))
GodVideo("Metallica Song",
"http://home.hccnet.nl/a.r.adams/lyrics/"
"metallica/songindex.html",
gm->rnd0,2,"C:/Home/Sup1/Sup1Blog/Metallica.DD.Z");
break;
}
break;
start:
case:
tag="http://www.random.org";
break;
case:
tag="http://www.randomnumbers.info";
break;
case:
tag="http://qrng.anu.edu.au/NIST.php";
break;
case:
tag="https://passed.pw";
break;
@@ -537,12 +829,19 @@ U0 GodMisc()
tag="http://www.generatedata.com";
break;
end:
GodMiscHeader;
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag;
switch (PopUpPickLst("ExtDec5Bible\0HexWordBatch\0Hex5Bible\0"
"Hex8Books\0Movie\0Metallica\0")) {
switch (PopUpPickLst("ExtDec5Bible\0ExtDec5Kosher\0HexWordBatch\0"
"Hex5Bible\0Hex8Books\0Movie\0Metallica\0")) {
case:
if (DocForm(gm(CRandExtDec5Form *)))
TOSBibleLines(gm->rnd0,20,-5,FALSE,FALSE);
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,-5,FALSE,FALSE);
break;
case:
if (DocForm(gm(CRandExtDec5Form *)))
TOSBookLines("~/Sup1/Sup1Blog/Kosher.TXT",100000,
gm->rnd0,20,-5,FALSE,FALSE);
break;
case:
if (DocForm(gm(CHexWordForm *)))
@@ -553,7 +852,8 @@ U0 GodMisc()
"$$TX,\"How this random Bible passage was chosen.\","
"HTML=\"http://www.templeos.org/Wb"
"/Home/Web/TAD/Passage.html\"$$\n";
TOSBibleLines(gm->rnd0,20,16,TRUE,TRUE);
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,16,TRUE,TRUE);
}
break;
case:
@@ -581,6 +881,7 @@ U0 GodMisc()
}
break;
case:
GodMiscHeader;
if (DocForm(gm(CCertRandDec5Form *))) {
tag="http://virtual-notary.org";
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag;
@@ -589,10 +890,12 @@ U0 GodMisc()
"-randomnum-%d.p12",gm->cert);
"\n$$TX,\"%$$Q: %d\",HTML=\"%$$Q\"$$.\n",tag,gm->cert,st;
Free(st);
TOSBibleLines(gm->rnd0,20,-5,FALSE,FALSE);
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
gm->rnd0,20,-5,FALSE,FALSE);
}
break;
case:
GodMiscHeader;
FifoU8Flush(god.fifo);
GodBitsIns(GOD_GOOD_BITS,KbdMouseEvtTime>>GOD_BAD_BITS);
GodBooksPassage("C:/Home/Sup1/Sup1Texts/*");
@@ -848,6 +1151,34 @@ U0 GodCodeJmp()
Free(st);
}
RegSetDftEntry("TempleOS/TOSGodOffer","I64 tos_gus_gwen=0;\n");
RegExeBranch("TempleOS/TOSGodOffer");
U0 GodOffer()
{
switch (PopUpPickLst("MosesComic\0GusGwen\0Fiction\0")) {
case:
"---- Moses Comic ---- "
"(Set in the $TX,"Numbers 11",HTML="http://www.biblegateway.com/passage/?search=Numbers%%%%2011&version=NIV"$ "
"part of the story.)\n"
"Moses says, \"\"\n"
"God says, \"\"\n";
break;
case:
"---- Gus and Gwen Soap Opera Episode %d ----\n"
"Gus says, \"\"\n"
"Gwen says, \"\"\n"
"-----------------------------------------\n",tos_gus_gwen++;
RegWriteBranch("TempleOS/TOSGodOffer","I64 tos_gus_gwen=%d;\n",
tos_gus_gwen);
break;
case:
"---- $TX,"Collaborative Fiction",HTML="http://en.wikipedia.org/wiki/Collaborative_fiction"$ ----\n"
"Once upon a time ";
break;
}
}
if (FileFind("~/Sup1/Sup1Words/LinuxDict.TXT"))
GodInit("~/Sup1/Sup1Words/LinuxDict.TXT");
//if (FileFind("~/Sup1/Sup1Words/HappyWords.TXT"))
+3 -3
View File
@@ -219,9 +219,9 @@ public U0 BMP2TXT(U8 *_in_name,U8 *_out_name=NULL)
Free(out_name);
}
RegSetDftEntry("TempleOS/TOS",
RegSetDftEntry("TempleOS/TOSVideos",
"I64 tos_code_walk_thru=1,tos_after_egypt_in_action=1;\n");
RegExeBranch("TempleOS/TOS");
RegExeBranch("TempleOS/TOSVideos");
U0 TOSRegInit()
{
@@ -232,7 +232,7 @@ U0 TOSRegInit()
U0 TOSRegWrite()
{
RegWriteBranch("TempleOS/TOS",
RegWriteBranch("TempleOS/TOSVideos",
"I64 tos_code_walk_thru=%d,tos_after_egypt_in_action=%d;\n",
tos_code_walk_thru,tos_after_egypt_in_action);
TOSRegInit;
+108 -71
View File
@@ -1,29 +1,46 @@
//This is a customized version of $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$.
//$MA-X+PU,"Diff",LM="WinMax;WinBorder;S2T(\"/*\",\"+r+S\");Diff(\"/Demo/ToHtmlToTXTDemo/ToHtml.HC.Z\",\"/Home/TOSToHtml.HC.Z\");View;"$
#help_index "DolDoc/Conversion"
//See $LK,"::/Doc/Credits.DD"$.
U0 HtmlPutS(CDoc *doc,I64 u32_attr,I64 *_old_u32_attr,
#define DOCET_UNDEF_COLOR 0x100000000
#define DOCET_LINK_UNDERLINE 0x200000000
U0 HtmlPutS(CDoc *doc,I64 u32_attr,I64 *_old_u32_attr,Bool underline_update,
U8 *st,I64 *_col,U8 *style_bitmap=NULL)
{
U8 *ch,*ptr;
u32_attr&=0xFFFFFF00;
if (u32_attr&DOCET_INVERT)
u32_attr.u8[1]=(u32_attr.u8[1]&15)<<4|u32_attr.u8[1]>>4;
if (u32_attr!=*_old_u32_attr) {
if (!(u32_attr&DOCET_BLINK) &&
*_old_u32_attr!=-1 && *_old_u32_attr&DOCET_BLINK)
DocPrint(doc,"</blink>");
if (*_old_u32_attr!=-1)
if (underline_update &&
!(u32_attr&DOCET_UNDERLINE) && *_old_u32_attr&DOCET_UNDERLINE) {
if (!(*_old_u32_attr&DOCET_LINK_UNDERLINE))
DocPrint(doc,"</u>");
*_old_u32_attr&=~DOCET_LINK_UNDERLINE;
}
if (!(u32_attr&DOCET_BLINK) && *_old_u32_attr&DOCET_BLINK)
DocPrint(doc,"</blink>");
if (u32_attr&0xFF00!=*_old_u32_attr&0xFF00) {
if (!(*_old_u32_attr&DOCET_UNDEF_COLOR))
DocPrint(doc,"</span>");
DocPrint(doc,"<span class=c%02X>",u32_attr.u8[1]);
if (u32_attr&DOCET_BLINK &&
(*_old_u32_attr==-1 || !(*_old_u32_attr&DOCET_BLINK)))
DocPrint(doc,"<blink>");
*_old_u32_attr=u32_attr;
if (style_bitmap)
LBts(style_bitmap,u32_attr.u8[1]);
}
if (u32_attr&DOCET_BLINK && !(*_old_u32_attr&DOCET_BLINK))
DocPrint(doc,"<blink>");
if (underline_update) {
if (u32_attr&DOCET_UNDERLINE && !(*_old_u32_attr&DOCET_UNDERLINE))
DocPrint(doc,"<u>");
} else //Keep same underline status.
u32_attr=u32_attr&~DOCET_UNDERLINE | *_old_u32_attr&DOCET_UNDERLINE;
*_old_u32_attr=u32_attr | *_old_u32_attr&DOCET_LINK_UNDERLINE;
while (ch=*st++) {
switch (ch) {
case '\t':
@@ -143,10 +160,10 @@ U8 *TOSLinkCvt1(U8 *link_st)
public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
U8 *body_footer=NULL,U8 *html_footer=NULL,Bool line_anchors=TRUE,
U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1)
U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1,Bool line_nums=FALSE)
{//Cvt $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$doc to HTML file.
CDocEntry *doc_e,*style,*doc_e2;
I64 i,y,old_y=MIN_I64,col,old_u32_attr=-1,old_attr;
I64 i,y,old_y=MIN_I64,col,old_u32_attr=DOCET_UNDEF_COLOR,old_attr,digits;
U32 *hl,*src;
U8 *st,st_2[2],*link_st,*style_bitmap=CAlloc(256/8);
CBGR48 p[NUM_COLORS];
@@ -161,6 +178,7 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
LBts(style_bitmap,i);
DocRecalc(doc_in,RECALCt_NORMAL|RECALCF_TO_HTML);
digits=Log10(doc_in->head.last->y+1)+1;
st_2[0]=0; st_2[1]=0;
doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
@@ -171,7 +189,7 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
"<head>\n"
"<meta http-equiv=\"Content-Type\" "
"content=\"text/html;charset=US-ASCII\">\n"
"<meta name=\"generator\" content=\"$TX,"TempleOS V4.12",D="DD_OS_NAME_VERSION"$\">\n";
"<meta name=\"generator\" content=\"$TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$\">\n";
if (!body_header) body_header=
"<body>\n"
"<pre style=\"font-family:courier;font-size:10pt\">\n";
@@ -194,15 +212,21 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
y=doc_e->y;
while (doc_e!=doc_in) {
if (!(doc_e->de_flags&DOCEF_SKIP)) {
if (y!=old_y && line_anchors) {
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
if (y!=old_y) {
if (line_anchors)
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
if (line_nums)
DocPrint(doc_out,"%0*d ",digits,y+1);
old_y=y;
}
while (y<doc_e->y) {
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr,"\n",&col,style_bitmap);
if (++y!=old_y && line_anchors) {
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,&old_u32_attr,FALSE,
"\n",&col,style_bitmap);
if (++y!=old_y) {
if (line_anchors)
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
if (line_nums)
DocPrint(doc_out,"%0*d ",digits,y+1);
old_y=y;
}
col=0;
@@ -217,10 +241,11 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
}
doc_e2=doc_e2->next;
}
if (no_bwd)
while (col<doc_e->x)
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr," ",&col,style_bitmap);
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,&old_u32_attr,FALSE,
" ",&col,style_bitmap);
link_st=NULL;
if (doc_e->de_flags&DOCEF_HTML_LINK)
@@ -231,10 +256,13 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
}
if (link_st) {
if (old_u32_attr!=-1) {
if (old_u32_attr&DOCET_UNDERLINE &&!(old_u32_attr&DOCET_LINK_UNDERLINE))
DocPrint(doc_out,"</u>");
if (old_u32_attr&DOCET_BLINK)
DocPrint(doc_out,"</blink>");
if (!(old_u32_attr&DOCET_UNDEF_COLOR))
DocPrint(doc_out,"</span>");
old_u32_attr=-1;
}
old_u32_attr=DOCET_UNDEF_COLOR|DOCET_UNDERLINE|DOCET_LINK_UNDERLINE;
DocPrint(doc_out,"<a href=\"%s\">",link_st);
}
@@ -251,7 +279,8 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
doc_e->type&0xFF00);
while (*src) {
st_2[0]=*src&0xFF;
HtmlPutS(doc_out,*src++,&old_u32_attr,st_2,&col,style_bitmap);
HtmlPutS(doc_out,*src++,&old_u32_attr,TRUE,
st_2,&col,style_bitmap);
}
Free(hl);
} else {
@@ -259,41 +288,48 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
doc_e->settings.final_u32_attr&0xF00==PURPLE<<8)
DocPrint(doc_out,"<h1><center>");
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr,doc_e->tag,&col,style_bitmap);
&old_u32_attr,TRUE,doc_e->tag,&col,style_bitmap);
if (doc_e->de_flags&DOCEF_CENTER_X && //$BK,1$Nonstandard$BK,0$
doc_e->settings.final_u32_attr&0xF00==PURPLE<<8)
DocPrint(doc_out,"</center></h1>");
}
break;
case DOCT_TAB:
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr,"\t",&col,style_bitmap);
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,&old_u32_attr,TRUE,
"\t",&col,style_bitmap);
break;
case DOCT_HTML_CODE:
if (old_u32_attr!=-1) {
if (old_u32_attr&DOCET_UNDERLINE &&
!(old_u32_attr&DOCET_LINK_UNDERLINE))
DocPrint(doc_out,"</u>");
if (old_u32_attr&DOCET_BLINK)
DocPrint(doc_out,"</blink>");
if (!(old_u32_attr&DOCET_UNDEF_COLOR))
DocPrint(doc_out,"</span>");
old_u32_attr=-1;
}
old_u32_attr=DOCET_UNDEF_COLOR;
DocPrint(doc_out,"%s",doc_e->tag);
break;
case DOCT_SPRITE:
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr,doc_e->tag,&col,style_bitmap);
&old_u32_attr,TRUE,doc_e->tag,&col,style_bitmap);
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr,"/* Graphics Not Rendered in HTML */",
&old_u32_attr,TRUE,"/* Graphics Not Rendered in HTML */",
&col,style_bitmap);
break;
default:
if (doc_e->de_flags&DOCEF_TAG)
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr,doc_e->tag,&col,style_bitmap);
&old_u32_attr,TRUE,doc_e->tag,&col,style_bitmap);
}
if (link_st) {
if (old_u32_attr!=-1) {
if (old_u32_attr&DOCET_UNDERLINE &&!(old_u32_attr&DOCET_LINK_UNDERLINE))
DocPrint(doc_out,"</u>");
if (old_u32_attr&DOCET_BLINK)
DocPrint(doc_out,"</blink>");
if (!(old_u32_attr&DOCET_UNDEF_COLOR))
DocPrint(doc_out,"</span>");
old_u32_attr=-1;
}
DocPrint(doc_out,"</a>");
old_u32_attr=DOCET_UNDEF_COLOR|DOCET_UNDERLINE|DOCET_LINK_UNDERLINE;
Free(link_st);
}
}
@@ -301,15 +337,16 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
}
while (y++<doc_e->y) {
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr,"\n",&col,style_bitmap);
&old_u32_attr,TRUE,"\n",&col,style_bitmap);
col=0;
}
if (old_u32_attr!=-1) {
if (old_u32_attr&DOCET_BLINK)
DocPrint(doc_out,"</blink>");
if (old_u32_attr&DOCET_UNDERLINE && !(old_u32_attr&DOCET_LINK_UNDERLINE))
DocPrint(doc_out,"</u>");
if (old_u32_attr&DOCET_BLINK)
DocPrint(doc_out,"</blink>");
if (!(old_u32_attr&DOCET_UNDEF_COLOR))
DocPrint(doc_out,"</span>");
old_u32_attr=-1;
}
old_u32_attr=DOCET_UNDEF_COLOR;
DocPrint(doc_out,"%s",body_footer);
DocPrint(doc_out,"%s",html_footer);
@@ -334,7 +371,7 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
public U0 TOSToHtml(U8 *_in_name,U8 *_out_name=NULL,U8 *html_header=NULL,
U8 *body_header=NULL,U8 *body_footer=NULL,U8 *html_footer=NULL,
I64 width=80,Bool line_anchors=TRUE,
U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1)
U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1,Bool line_nums=FALSE)
{//Convert $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$file to HTML.
//Supply your own link_cvt routine.
U8 *in_name,*out_name;
@@ -353,7 +390,7 @@ public U0 TOSToHtml(U8 *_in_name,U8 *_out_name=NULL,U8 *html_header=NULL,
DocTop(doc_in);
DocPrint(doc_in,"$$BD,LTCYAN$$"); //$BK,1$Nonstandard$BK,0$
doc_out=Doc2Html(doc_in,html_header,body_header,body_footer,html_footer,
line_anchors,link_cvt);
line_anchors,link_cvt,line_nums);
StrCpy(&doc_out->filename.name,out_name);
SettingsPop;
@@ -366,7 +403,7 @@ public U0 TOSToHtml(U8 *_in_name,U8 *_out_name=NULL,U8 *html_header=NULL,
}
#help_index "TOS"
U0 TOSWebFile(U8 *name)
U0 TOSWebFile(U8 *name,Bool line_nums=FALSE)
{
U8 *name2;
CDirEntry de;
@@ -393,7 +430,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.12",D="DD_OS_NAME_VERSION"$\">\n",
"<meta name=\"generator\" content=\"$TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$\">\n",
"<body style=\"background-color:#55FFFF; border-style:solid;
border-width:8px; border-color:#0000AA;
@@ -402,34 +439,13 @@ U0 TOSWebFile(U8 *name)
"<div style=\"margin-left:auto; margin-right:auto;"
" width: 640px;\">\n",
"</div></pre></body>\n",
"</html>\n",,line_anchors);
"</html>\n",,line_anchors,,line_nums);
Touch(name2,"",,de.datetime);
Free(name2);
}
}
public U0 MakeWebSite()
{
CDirEntry *tmpde,*tmpde1;
DocClear;
Cd("D:/Wb");
DelTree("D:/Wb/Home/Budget");
DelTree("D:/Wb/Home/Private");
Del("D:/Wb/Home/*");
Touch("D:/Wb/Home/Web/index.DD.Z","");
Touch("D:/Wb/Home/Web/DownloadOS.DD.Z","");
Touch("D:/Wb/Home/Web/TempleOS.DD.Z","");
tmpde=tmpde1=FilesFind("*",
FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER);
while (tmpde) {
TOSWebFile(tmpde->full_name);
tmpde=tmpde->next;
}
DirTreeDel(tmpde1);
Drv('C');
}
U0 FreshenWebDir(U8 *dirname)
U0 FreshenWebDir(U8 *dirname,Bool line_nums=FALSE)
{//No recurse
CDirEntry *tmpde,*tmpde1;
U8 *src,*dst;
@@ -451,9 +467,30 @@ U0 FreshenWebDir(U8 *dirname)
src=MStrPrint("D:/Wb%s/*",dirname);
tmpde=tmpde1=FilesFind(src,FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER);
while (tmpde) {
TOSWebFile(tmpde->full_name);
TOSWebFile(tmpde->full_name,line_nums);
tmpde=tmpde->next;
}
DirTreeDel(tmpde1);
}
public U0 MakeWebSite()
{
CDirEntry *tmpde,*tmpde1;
DocClear;
Cd("D:/Wb");
DelTree("D:/Wb/Home/Budget");
DelTree("D:/Wb/Home/Private");
Del("D:/Wb/Home/*");
Touch("D:/Wb/Home/Web/index.DD.Z","");
Touch("D:/Wb/Home/Web/DownloadOS.DD.Z","");
Touch("D:/Wb/Home/Web/TempleOS.DD.Z","");
tmpde=tmpde1=FilesFind("*",
FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER);
while (tmpde) {
TOSWebFile(tmpde->full_name);
tmpde=tmpde->next;
}
DirTreeDel(tmpde1);
FreshenWebDir("/Home/Sup1/Sup1Words",TRUE);
Drv('C');
}
Binary file not shown.
Binary file not shown.
@@ -1,7 +1,7 @@
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$.
RegSetDftEntry("TempleOS/EagleDive","F64 best_score=9999;\n");
RegExeBranch("TempleOS/EagleDive");
RegSetDftEntry("TempleOS/Talons","F64 best_score=9999;\n");
RegExeBranch("TempleOS/Talons");
//Keep these power of two so shift is used instead of multiply
//to index arrays.
@@ -738,7 +738,7 @@ U0 MPDrawIt(CTask *task,CDC *dc)
LBtr(&mp.update_not_done_flags,Gs->num);
}
U0 CoreAPEagleDiveTask(CTask *master_task)
U0 CoreAPTalonsTask(CTask *master_task)
{
CDC *dc=DCAlias(main_dc,master_task);
while (!mp.app_done) {
@@ -861,7 +861,7 @@ U0 DrawHorizon(CDC *dc)
dc->depth_buf=old_db;
}
U0 Core0EagleDive()
U0 Core0Talons()
{
CDC *dc=DCAlias(main_dc,Fs);
I64 i,xx,yy,elev,height,cx=Fs->pix_width>>1,cy=Fs->pix_height>>1;
@@ -1097,7 +1097,7 @@ U0 Init()
z+=elevations[yy][xx]*COORDINATE_SCALE;
for (i=1;i<mp_cnt;i++)
Spawn(&CoreAPEagleDiveTask,Fs,"AP EagleDive",i);
Spawn(&CoreAPTalonsTask,Fs,"AP Talons",i);
Fs->task_end_cb=&TaskEndCB;
game_t0=tS;
}
@@ -1116,7 +1116,7 @@ U0 CleanUp()
DCDel(main_dc);
}
U0 EagleDive()
U0 Talons()
{
I64 ch,sc;
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
@@ -1177,17 +1177,17 @@ U0 EagleDive()
break;
}
} else
Core0EagleDive;
Core0Talons;
} while (ch!=CH_SHIFT_ESC && ch!=CH_ESC);
catch
PutExcept;
SettingsPop;
CleanUp;
RegWriteBranch("TempleOS/EagleDive","F64 best_score=%5.4f;\n",best_score);
RegWriteBranch("TempleOS/Talons","F64 best_score=%5.4f;\n",best_score);
MenuPop;
}
EagleDive;
Talons;

àÿÿÿýÿÿÿ
ýÿÿÿ"
+1 -1
View File
@@ -8,4 +8,4 @@ U0 InputPointer()
DCFill;
}
InputPointer;
InputPointer;
Binary file not shown.
Binary file not shown.
+19 -3
View File
@@ -9,8 +9,8 @@ U0 Main1()
"\nWith description.\n";
PressAKey;
ProgressBarsRst;
StrCpy(progress1_desc,"Progress Demo"); //PROGRESS_DESC_LEN is max
progress1_max=200;
StrCpy(progress1_desc,"Progress Demo"); //PROGRESS_DESC_LEN is max
while (progress1++!=progress1_max)
Sleep(20);
progress1_max=0; //hide
@@ -19,6 +19,21 @@ U0 Main1()
Main1;
U0 Main2()
{
"\nWith description and time.\n";
PressAKey;
ProgressBarsRst;
progress1_max=200;
progress1_t0=tS;
StrCpy(progress1_desc,"Progress Demo"); //PROGRESS_DESC_LEN is max
while (progress1++!=progress1_max)
Sleep(20);
progress1_max=0; //hide
}
Main2;
U0 Main3()
{
"\nNo description.\n";
PressAKey;
@@ -30,7 +45,7 @@ U0 Main2()
progress1_max=0; //hide
}
Main2;
Main3;
"\n$$LTRED$$Now, from asm... It's handy for debugging.$$FG$$\n"
"$$LTRED$$Watch the progress on the wallpaper.$$FG$$\n";
@@ -39,8 +54,9 @@ PressAKey;
asm {
_PROGRESS_DEMO::
MOV RCX,0x80000000
MOV RCX,12000000
@@05: MOV U64 [&progress1],RCX
CALL &Yield
LOOP @@05
MOV U64 [&progress1],RCX
RET
+62
View File
@@ -0,0 +1,62 @@
#define RADIX 256
#define N 16
U8 a[N];
class Lst
{
Lst *next;
U8 *a;
} l[N],*r[RADIX];
U0 DumpIn()
{
I64 i;
"$$RED$$\n\nInput$$FG$$\n";
for (i=0;i<N;i++)
"%d:%d\n",i,a[i];
}
U0 DumpOut()
{
I64 i,j=0;
Lst *tmpl;
"$$RED$$\n\nOutput$$FG$$\n";
for (i=0;i<RADIX;i++) {
tmpl=r[i];
while (tmpl) {
"%d:%d\n",j++,*tmpl->a;
tmpl=tmpl->next;
}
}
}
U0 Init()
{
I64 i;
MemSet(r,0,sizeof(r));
for (i=0;i<N;i++) {
a[i]=RandU16&255;
l[i].next=NULL;
l[i].a=&a[i];
}
}
U0 Sort()
{
I64 i;
for (i=0;i<N;i++) {
l[i].next=r[*l[i].a];
r[*l[i].a]=&l[i];
}
}
U0 RadixSort()
{
Init;
DumpIn;
Sort;
DumpOut;
}
RadixSort;
+6 -6
View File
@@ -1,8 +1,8 @@
$WW,1$$FG,5$$TX+CX,"The Temple Operating System"$$FG,0$
$FG,4$
$LK,"Download Operating System",A="FI:::/Home/Web/DownloadOS.DD"$ $LK,"App Store",A="FI:::/Home/Web/AppStore.DD"$
$LK,"Download Operating System",A="FI:~/Web/DownloadOS.DD"$ $LK,"App Store",A="FI:~/Web/AppStore.DD"$
$LK,"Scrn Shots",A="FI:::/Home/Web/ScrnShots.DD"$ $LK,"Instructional Videos",A="FI:::/Home/Web/TOSVideos.DD"$
$LK,"Screen Shots",A="FI:~/Web/ScrnShots.DD"$ $LK,"Instructional Videos",A="FI:~/Web/TOSVideos.DD"$
$LK,"Introduction",A="FI:::/Doc/Welcome.DD"$ $LK,"F.A.Q.",A="FI:::/Doc/FAQ.DD"$
@@ -12,9 +12,9 @@ $LK,"Source Code By File",A="FF:~/Web/LineRep.DD,KStart16.HC"$ $TX,"Source Cod
$TX,"Source Code By Sym",HTML="http://www.templeos.org/Wb/Home/Web/SymsAlpha.html"$ $TX,"Source Code By Address",HTML="http://www.templeos.org/Wb/Home/Web/SymsAddress.html"$
$LK,"Change Log",A="FI:::/Doc/ChangeLog.DD"$ $LK,"History of TempleOS",A="FI:::/Home/Web/History.DD"$
$LK,"Change Log",A="FI:::/Doc/ChangeLog.DD"$ $LK,"History of TempleOS",A="FI:~/Web/History.DD"$
$LK,"TempleOS Credits",A="FI:::/Doc/Credits.DD"$ $LK,"About Terry Davis",A="FI:::/Home/Web/TAD/TAD.DD"$
$LK,"TempleOS Credits",A="FI:::/Doc/Credits.DD"$ $LK,"Terry Davis",A="FI:~/Web/TAD/TAD.DD"$ $LK,"Dianna Cowern",A="FI:~/Web/DLC/DLC.DD"$
$FG$
The Brits are moving to $TX,"ban \"hacking tools\"",HTML="http://www.theregister.co.uk/2008/01/02/hacker_toll_ban_guidance"$. Take my $LK,"unassembler",A="MN:Ui"$ from my cold dead hands. NRA is for guns; IRA is for computers.
@@ -24,7 +24,7 @@ TempleOS is a free, public domain, open source, $FG,4$$TX,"x86_64",HTML="http://
The CIA encourages code obsfucation. They make it more complicated than necessary. TempleOS is, literally, more simple than necessary. It is obnoxiously simple... to the point it hurts.
This $TX,"\"Hello World\" joke",HTML="http://www.infiltec.com/j-h-wrld.htm"$, the $TX,"BMP file format",HTML="http://en.wikipedia.org/wiki/BMP_file_format"$ and the $TX,"WAV file format",HTML="http://en.wikipedia.org/wiki/WAV"$ show that the industry is really screwed-up! That's what TempleOS fixes. I capped the line-of-code count at 100,000 and God said it must be perfect, so it will never be an ugly monstrocity. It is currently $TX,"81,223",D="DD_TEMPLEOS_LOC_OFFICIAL"$ lines of unblemished code. Backward compatibility is not promised.
This $TX,"\"Hello World\" joke",HTML="http://www.infiltec.com/j-h-wrld.htm"$, the $TX,"BMP file format",HTML="http://en.wikipedia.org/wiki/BMP_file_format"$ and the $TX,"WAV file format",HTML="http://en.wikipedia.org/wiki/WAV"$ show that the industry is really screwed-up! That's what TempleOS fixes. I capped the line-of-code count at 100,000 and God said it must be perfect, so it will never be an ugly monstrocity. It is currently $TX,"81,304",D="DD_TEMPLEOS_LOC_OFFICIAL"$ lines of unblemished code. Backward compatibility is not promised.
Normally, failure is not an option, but since TempleOS accompanies Windows or Linux, we exclude certain uses. There is no reason to duplicate browsing, multimedia, desktop publishing, etc. Linux wants to be a secure, multi-user mainframe. That's why it has file permissions. The vision for TempleOS, however, is a modern, 64-bit Commodore 64. The C64 was a non-networked, home computer mostly used for games. It trained my generation how to program because it was wide open, completely hackable. The games were not multimedia works of art, but generated by non-artist.
@@ -40,7 +40,7 @@ $HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://w
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/W_b4zMxfLvA\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/W_b4zMxfLvA\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
I wrote all $LK,"119,996",A="FF:~/Web/LineRep.DD,Kernel.PRJ",D="DD_TEMPLEOS_LOC"$ lines of TempleOS over the last $TX,"13.2",D="DD_TEMPLEOS_AGE"$ years, full-time, including the 64-bit compiler. It was called, at various times, "$FG,4$$TX,"Hoppy",HTML="http://web.archive.org/web/*/http://www.simstructure.hare.com/*"$$FG$", "$FG,4$$TX,"The J Operating System",HTML="http://wayback.archive.org/web/*/http://www.justrighteous.org/*"$$FG$", "$FG,4$$TX,"LoseThos",HTML="http://web.archive.org/web/*/http://www.losethos.com/*"$$FG$" and "$FG,4$$TX,"SparrowOS",HTML="http://web.archive.org/web/*/http://www.sparrowos.com/*"$$FG$". Here are my $FG,4$$TX,"college transcripts",HTML="http://www.templeos.org/files/ASU_Transcripts.pdf"$$FG$. I've been a professional operating system developer since 1990 when I was hired to work on Ticketmaster's VAX OS.
I wrote all $LK,"120,646",A="FF:~/Web/LineRep.DD,Kernel.PRJ",D="DD_TEMPLEOS_LOC"$ lines of TempleOS over the last $TX,"13.3",D="DD_TEMPLEOS_AGE"$ years, full-time, including the 64-bit compiler. It was called, at various times, "$FG,4$$TX,"Hoppy",HTML="http://web.archive.org/web/*/http://www.simstructure.hare.com/*"$$FG$", "$FG,4$$TX,"The J Operating System",HTML="http://wayback.archive.org/web/*/http://www.justrighteous.org/*"$$FG$", "$FG,4$$TX,"LoseThos",HTML="http://web.archive.org/web/*/http://www.losethos.com/*"$$FG$" and "$FG,4$$TX,"SparrowOS",HTML="http://web.archive.org/web/*/http://www.sparrowos.com/*"$$FG$". Here are my $FG,4$$TX,"college transcripts",HTML="http://www.templeos.org/files/ASU_Transcripts.pdf"$$FG$. I've been a professional operating system developer since 1990 when I was hired to work on Ticketmaster's VAX OS.
$FG,8$
* "Commodore 64" is a trademark owned by Polabe Holding NV.
+100 -45
View File
@@ -2,27 +2,40 @@
//See $LK,"::/Doc/Credits.DD"$.
U0 HtmlPutS(CDoc *doc,I64 u32_attr,I64 *_old_u32_attr,
#define DOCET_UNDEF_COLOR 0x100000000
#define DOCET_LINK_UNDERLINE 0x200000000
U0 HtmlPutS(CDoc *doc,I64 u32_attr,I64 *_old_u32_attr,Bool underline_update,
U8 *st,I64 *_col,U8 *style_bitmap=NULL)
{
U8 *ch,*ptr;
u32_attr&=0xFFFFFF00;
if (u32_attr&DOCET_INVERT)
u32_attr.u8[1]=(u32_attr.u8[1]&15)<<4|u32_attr.u8[1]>>4;
if (u32_attr!=*_old_u32_attr) {
if (!(u32_attr&DOCET_BLINK) &&
*_old_u32_attr!=-1 && *_old_u32_attr&DOCET_BLINK)
DocPrint(doc,"</blink>");
if (*_old_u32_attr!=-1)
if (underline_update &&
!(u32_attr&DOCET_UNDERLINE) && *_old_u32_attr&DOCET_UNDERLINE) {
if (!(*_old_u32_attr&DOCET_LINK_UNDERLINE))
DocPrint(doc,"</u>");
*_old_u32_attr&=~DOCET_LINK_UNDERLINE;
}
if (!(u32_attr&DOCET_BLINK) && *_old_u32_attr&DOCET_BLINK)
DocPrint(doc,"</blink>");
if (u32_attr&0xFF00!=*_old_u32_attr&0xFF00) {
if (!(*_old_u32_attr&DOCET_UNDEF_COLOR))
DocPrint(doc,"</span>");
DocPrint(doc,"<span class=c%02X>",u32_attr.u8[1]);
if (u32_attr&DOCET_BLINK &&
(*_old_u32_attr==-1 || !(*_old_u32_attr&DOCET_BLINK)))
DocPrint(doc,"<blink>");
*_old_u32_attr=u32_attr;
if (style_bitmap)
LBts(style_bitmap,u32_attr.u8[1]);
}
if (u32_attr&DOCET_BLINK && !(*_old_u32_attr&DOCET_BLINK))
DocPrint(doc,"<blink>");
if (underline_update) {
if (u32_attr&DOCET_UNDERLINE && !(*_old_u32_attr&DOCET_UNDERLINE))
DocPrint(doc,"<u>");
} else //Keep same underline status.
u32_attr=u32_attr&~DOCET_UNDERLINE | *_old_u32_attr&DOCET_UNDERLINE;
*_old_u32_attr=u32_attr | *_old_u32_attr&DOCET_LINK_UNDERLINE;
while (ch=*st++) {
switch (ch) {
case '\t':
@@ -78,6 +91,27 @@ U8 *TOSLinkCvt2(U8 *filename,I64 line_num)
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;
if (StrOcc(buf,'-'))
return MStrPrint(
"http://www.biblegateway.com/passage/?search=%s&version=NIV",buf);
else
return MStrPrint(
"http://www.biblegateway.com/verse/en/%s",buf);
}
U8 *TOSLinkCvt1(U8 *link_st)
{
static CDoc *bible=NULL;
@@ -105,7 +139,7 @@ U8 *TOSLinkCvt1(U8 *link_st)
if (!bible)
bible=Adam("DocRead(\"%s\");",filename);
if (DocFind(bible,num,needle))
res=TOSLinkCvt2(filename,bible->cur_entry->y+1);
res=URLBibleGateway(link_st);
LBtr(&locks,0);
break;
default:
@@ -120,10 +154,10 @@ U8 *TOSLinkCvt1(U8 *link_st)
public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
U8 *body_footer=NULL,U8 *html_footer=NULL,Bool line_anchors=TRUE,
U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1)
U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1,Bool line_nums=FALSE)
{//Cvt $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$doc to HTML file.
CDocEntry *doc_e,*style,*doc_e2;
I64 i,y,old_y=MIN_I64,col,old_u32_attr=-1,old_attr;
I64 i,y,old_y=MIN_I64,col,old_u32_attr=DOCET_UNDEF_COLOR,old_attr,digits;
U32 *hl,*src;
U8 *st,st_2[2],*link_st,*style_bitmap=CAlloc(256/8);
CBGR48 p[NUM_COLORS];
@@ -139,6 +173,8 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
DocRecalc(doc_in,RECALCt_NORMAL|RECALCF_TO_HTML);
digits=Log10(doc_in->head.last->y+1)+1;
st_2[0]=0; st_2[1]=0;
doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
@@ -148,7 +184,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.12",D="DD_OS_NAME_VERSION"$\">\n";
"<meta name=\"generator\" content=\"$TX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$\">\n";
if (!body_header) body_header=
"<body>\n"
"<pre style=\"font-family:courier;font-size:10pt\">\n";
@@ -171,15 +207,21 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
y=doc_e->y;
while (doc_e!=doc_in) {
if (!(doc_e->de_flags&DOCEF_SKIP)) {
if (y!=old_y && line_anchors) {
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
if (y!=old_y) {
if (line_anchors)
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
if (line_nums)
DocPrint(doc_out,"%0*d ",digits,y+1);
old_y=y;
}
while (y<doc_e->y) {
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr,"\n",&col,style_bitmap);
if (++y!=old_y && line_anchors) {
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,&old_u32_attr,FALSE,
"\n",&col,style_bitmap);
if (++y!=old_y) {
if (line_anchors)
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
if (line_nums)
DocPrint(doc_out,"%0*d ",digits,y+1);
old_y=y;
}
col=0;
@@ -194,10 +236,11 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
}
doc_e2=doc_e2->next;
}
if (no_bwd)
while (col<doc_e->x)
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr," ",&col,style_bitmap);
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,&old_u32_attr,FALSE,
" ",&col,style_bitmap);
link_st=NULL;
if (doc_e->de_flags&DOCEF_HTML_LINK)
@@ -208,10 +251,13 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
}
if (link_st) {
if (old_u32_attr!=-1) {
if (old_u32_attr&DOCET_UNDERLINE &&!(old_u32_attr&DOCET_LINK_UNDERLINE))
DocPrint(doc_out,"</u>");
if (old_u32_attr&DOCET_BLINK)
DocPrint(doc_out,"</blink>");
if (!(old_u32_attr&DOCET_UNDEF_COLOR))
DocPrint(doc_out,"</span>");
old_u32_attr=-1;
}
old_u32_attr=DOCET_UNDEF_COLOR|DOCET_UNDERLINE|DOCET_LINK_UNDERLINE;
DocPrint(doc_out,"<a href=\"%s\">",link_st);
}
@@ -228,7 +274,8 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
doc_e->type&0xFF00);
while (*src) {
st_2[0]=*src&0xFF;
HtmlPutS(doc_out,*src++,&old_u32_attr,st_2,&col,style_bitmap);
HtmlPutS(doc_out,*src++,&old_u32_attr,TRUE,
st_2,&col,style_bitmap);
}
Free(hl);
} else
@@ -236,34 +283,41 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
&old_u32_attr,doc_e->tag,&col,style_bitmap);
break;
case DOCT_TAB:
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr,"\t",&col,style_bitmap);
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,&old_u32_attr,TRUE,
"\t",&col,style_bitmap);
break;
case DOCT_HTML_CODE:
if (old_u32_attr!=-1) {
if (old_u32_attr&DOCET_UNDERLINE &&
!(old_u32_attr&DOCET_LINK_UNDERLINE))
DocPrint(doc_out,"</u>");
if (old_u32_attr&DOCET_BLINK)
DocPrint(doc_out,"</blink>");
if (!(old_u32_attr&DOCET_UNDEF_COLOR))
DocPrint(doc_out,"</span>");
old_u32_attr=-1;
}
old_u32_attr=DOCET_UNDEF_COLOR;
DocPrint(doc_out,"%s",doc_e->tag);
break;
case DOCT_SPRITE:
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr,doc_e->tag,&col,style_bitmap);
&old_u32_attr,TRUE,doc_e->tag,&col,style_bitmap);
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr,"/* Graphics Not Rendered in HTML */",
&old_u32_attr,TRUE,"/* Graphics Not Rendered in HTML */",
&col,style_bitmap);
break;
default:
if (doc_e->de_flags&DOCEF_TAG)
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr,doc_e->tag,&col,style_bitmap);
&old_u32_attr,TRUE,doc_e->tag,&col,style_bitmap);
}
if (link_st) {
if (old_u32_attr!=-1) {
if (old_u32_attr&DOCET_UNDERLINE &&!(old_u32_attr&DOCET_LINK_UNDERLINE))
DocPrint(doc_out,"</u>");
if (old_u32_attr&DOCET_BLINK)
DocPrint(doc_out,"</blink>");
if (!(old_u32_attr&DOCET_UNDEF_COLOR))
DocPrint(doc_out,"</span>");
old_u32_attr=-1;
}
DocPrint(doc_out,"</a>");
old_u32_attr=DOCET_UNDEF_COLOR|DOCET_UNDERLINE|DOCET_LINK_UNDERLINE;
Free(link_st);
}
}
@@ -271,15 +325,16 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
}
while (y++<doc_e->y) {
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
&old_u32_attr,"\n",&col,style_bitmap);
&old_u32_attr,TRUE,"\n",&col,style_bitmap);
col=0;
}
if (old_u32_attr!=-1) {
if (old_u32_attr&DOCET_BLINK)
DocPrint(doc_out,"</blink>");
if (old_u32_attr&DOCET_UNDERLINE && !(old_u32_attr&DOCET_LINK_UNDERLINE))
DocPrint(doc_out,"</u>");
if (old_u32_attr&DOCET_BLINK)
DocPrint(doc_out,"</blink>");
if (!(old_u32_attr&DOCET_UNDEF_COLOR))
DocPrint(doc_out,"</span>");
old_u32_attr=-1;
}
old_u32_attr=DOCET_UNDEF_COLOR;
DocPrint(doc_out,"%s",body_footer);
DocPrint(doc_out,"%s",html_footer);
@@ -304,7 +359,7 @@ public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
public U0 ToHtml(U8 *_in_name,U8 *_out_name=NULL,U8 *html_header=NULL,
U8 *body_header=NULL,U8 *body_footer=NULL,U8 *html_footer=NULL,
I64 width=80,Bool line_anchors=TRUE,
U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1)
U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1,Bool line_nums=FALSE)
{//Convert $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$file to HTML.
//Supply your own link_cvt routine.
U8 *in_name,*out_name;
@@ -321,7 +376,7 @@ public U0 ToHtml(U8 *_in_name,U8 *_out_name=NULL,U8 *html_header=NULL,
doc_in=DocRead(in_name);
doc_out=Doc2Html(doc_in,html_header,body_header,body_footer,html_footer,
line_anchors,link_cvt);
line_anchors,link_cvt,line_nums);
StrCpy(&doc_out->filename.name,out_name);
SettingsPop;
BIN
View File
Binary file not shown.
+41 -6
View File
@@ -2,7 +2,42 @@ $WW,1$$FG,5$$TX+CX,"Change Log"$$FG$
Use $LK,"R",A="MN:R"$() to rename if I change a label.
$IV,1$----09/29/16 11:52:04----$IV,0$
$IV,1$----11/21/16 01:46:12----$IV,0$
$IV,1$----11/20/16 19:46:43----$IV,0$
* $BK,1$TempleOS version 4.13 Released$BK,0$
* Improved $LK,"::/Apps/TimeOut/TimeOut.HC"$.
* Improved $LK,"::/Apps/X-Caliber/X-Caliber.HC"$.
$IV,1$----11/19/16 08:19:51----$IV,0$
* Improved Budget application.
$IV,1$----11/17/16 18:49:51----$IV,0$
* $LK,"R",A="MN:R"$("EagleDive","Talons");
* Improved $LK,"::/Demo/Games/RocketScience.HC"$.
* Improved $LK,"::/Demo/Games/Rocket.HC"$.
$IV,1$----10/28/16 05:54:27----$IV,0$
* Added $LK,"::/Demo/RadixSort.HC"$.
$IV,1$----10/26/16 00:21:06----$IV,0$
* Added $LK,"CProgress",A="MN:CProgress"$.t0.
* Improved $LK,"::/Doc/Boot.DD"$.
$IV,1$----10/25/16 18:02:44----$IV,0$
* Improved $LK,"::/Adam/Gr/SpriteEd.HC"$.
* Improved $LK,"::/Demo/AcctExample/TOSHolySpirit.HC"$.
$IV,1$----10/12/16 10:55:26----$IV,0$
* Added $LK,"CCF_NO_CHAR_CONST",A="MN:CCF_NO_CHAR_CONST"$.
* Improved $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$.
$IV,1$----10/03/16 01:09:35----$IV,0$
* Changed $LK,"GodWord",A="MN:GodWord"$().
$IV,1$----09/30/16 18:29:59----$IV,0$
* Improved $LK,"Rand",A="MN:Rand"$()'s.
* Improved $LK,"::/Adam/Opt/Utils/ToTXT.HC"$.
$IV,1$----09/29/16 10:13:14----$IV,0$
* $BK,1$TempleOS version 4.12 Released$BK,0$
@@ -83,7 +118,7 @@ $IV,1$----07/17/16 03:23:53----$IV,0$
$IV,1$----07/15/16 10:11:10----$IV,0$
* $BK,1$TempleOS version 4.10 Released$BK,0$
* Improved $LK,"::/Demo/Games/EagleDive.HC"$.
* Improved $LK,"::/Demo/Games/Talons.HC"$.
$IV,1$----07/15/16 05:17:24----$IV,0$
* Created $LK,"CDevGlbls",A="MN:CDevGlbls"$.uncached_alias.
@@ -93,7 +128,7 @@ $IV,1$----07/13/16 17:21:19----$IV,0$
* Added multicore report to $LK,"CPURep",A="MN:CPURep"$().
$IV,1$----07/09/16 08:46:36----$IV,0$
* Changed scoring in $LK,"::/Demo/Games/EagleDive.HC"$.
* Changed scoring in $LK,"::/Demo/Games/Talons.HC"$.
* Replaced many $FG,2$"%Q"$FG$ with $FG,2$"%$$Q"$FG$.
* Fixed $FG,2$'\x24'$FG$.
* Added $FG,2$'\d'$FG$ for $FG,2$'$$'$FG$.
@@ -108,11 +143,11 @@ $IV,1$----07/07/16 07:21:03----$IV,0$
$IV,1$----07/06/16 23:45:30----$IV,0$
* Fixed multicore bug in $LK,"Sprite3",A="MN:Sprite3"$().
* Improved $LK,"::/Demo/Games/EagleDive.HC"$.
* Improved $LK,"::/Demo/Games/Talons.HC"$.
$IV,1$----07/05/16 06:03:47----$IV,0$
* $BK,1$TempleOS version 4.09 Released$BK,0$
* Improved $LK,"::/Demo/Games/EagleDive.HC"$.
* Improved $LK,"::/Demo/Games/Talons.HC"$.
* Improved $LK,"GrFillTri0",A="MN:GrFillTri0"$().
$IV,1$----07/03/16 04:30:05----$IV,0$
@@ -165,7 +200,7 @@ $IV,1$----06/16/16 19:49:39----$IV,0$
$IV,1$----06/02/16 03:20:56----$IV,0$
* $BK,1$TempleOS version 4.07 Released$BK,0$
* Added claws to $LK,"::/Demo/Games/EagleDive.HC"$.
* Added claws to $LK,"::/Demo/Games/Talons.HC"$.
$IV,1$----05/30/16 21:16:44----$IV,0$
* Added waterfall to $LK,"::/Demo/Games/RawHide.HC"$.
+2 -2
View File
@@ -94,7 +94,7 @@ $LK,"::/Demo/Games/Collision.HC"$
$ID,-2$$TR,"Games: Advanced"$
$ID,2$$LK,"::/Demo/MultiCore/LoadTest.HC"$
$LK,"::/Demo/MultiCore/Primes.HC"$
$LK,"::/Demo/MultiCore/RadixSort.HC"$
$LK,"::/Demo/MultiCore/MPRadix.HC"$
$LK,"::/Demo/MultiCore/Interrupts.HC"$
$MA-X+PU,"::/Apps/AfterEgypt",LM="Cd(\"::/Apps/AfterEgypt\");Dir;View;\n"$
$LK,"::/Demo/Games/Varoom.HC"$
@@ -117,7 +117,7 @@ $LK,"::/Demo/Games/Squirt.HC"$
$MA-X+PU,"::/Apps/X-Caliber",LM="Cd(\"::/Apps/X-Caliber\");Dir;View;\n"$
$LK,"::/Demo/Games/ZoneOut.HC"$
$LK,"::/Demo/Games/CastleFrankenstein.HC"$
$LK,"::/Demo/Games/EagleDive.HC"$
$LK,"::/Demo/Games/Talons.HC"$
$MA-X+PU,"::/Apps/Strut",LM="Cd(\"::/Apps/Strut\");Dir;View;\n"$
$MA-X+PU,"::/Apps/Span",LM="Cd(\"::/Apps/Span\");Dir;View;\n"$
$MA-X+PU,"::/Apps/Psalmody",LM="Cd(\"::/Apps/Psalmody\");Dir;View;\n"$
+1 -1
View File
@@ -13,7 +13,7 @@ Here is the grammar:
The format of DolDoc cmds is a two character code, +/-flags, a comma and args separated by commas. Some commands have mandatory args. Optional args are indicated with <$LK,"ArgCode",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS"$>$FG,2$=$FG$. A $LK,"ColorName",A="MN:ST_COLORS"$ bracked by dollars, will change the foreground color.
See $LK,"::/Doc/Widget.DD"$ and $LK,"::/Demo/DolDoc/DemoDoc.DD"$.
See $LK,"::/Doc/Widget.DD"$, $LK,"::/Demo/DolDoc/DemoDoc.DD"$, and $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$.
<$LK,"TwoLetterCmd",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_CMDS"$> See $LK,"Type Defines",A="MN:DOCT_TEXT"$ and $LK,"PrsDollarCmd",A="MN:PrsDollarCmd"$().
$TR,"TX Text"$
+1 -1
View File
@@ -1,4 +1,4 @@
$WW+H,1$$FG,5$$TX+CX,"TempleOS V4.12",D="DD_OS_NAME_VERSION"$$FG$
$WW+H,1$$FG,5$$TX+CX,"TempleOS V4.13",D="DD_OS_NAME_VERSION"$$FG$
$TX+CX,"Public Domain Operating System"$
+1 -1
View File
@@ -10,4 +10,4 @@ The 4th dimension allows a neat trick where you can place pos shifts (translatio
Finally, $LK,"CDC",A="MN:CDC"$'s have an $FG,2$x$FG$, $FG,2$y$FG$ and $FG,2$z$FG$ which is an additional shift (translation).
The transformation is implemented as a callback on the $LK,"CDC",A="MN:CDC"$'s $FG,2$transform()$FG$ member. The default $FG,2$transform()$FG$ callback is $LK,"DCTransform",A="MN:DCTransform"$(). See $LK,"::/Demo/Games/EagleDive.HC"$ or $LK,"::/Demo/Games/CastleFrankenstein.HC"$ to see how to change the $FG,2$transform()$FG$ callback for foreshortening.
The transformation is implemented as a callback on the $LK,"CDC",A="MN:CDC"$'s $FG,2$transform()$FG$ member. The default $FG,2$transform()$FG$ callback is $LK,"DCTransform",A="MN:DCTransform"$(). See $LK,"::/Demo/Games/Talons.HC"$ or $LK,"::/Demo/Games/CastleFrankenstein.HC"$ to see how to change the $FG,2$transform()$FG$ callback for foreshortening.
+1 -1
View File
@@ -23,7 +23,7 @@ $LK,"/Demo/Games/CircleTrace.HC",A="FI:::/Demo/Games/CircleTrace.HC"$
$LK,"/Demo/Games/Collision.HC",A="FI:::/Demo/Games/Collision.HC"$
$LK,"/Demo/Games/Digits.HC",A="FI:::/Demo/Games/Digits.HC"$
$LK,"/Demo/Games/DunGen.HC",A="FI:::/Demo/Games/DunGen.HC"$
$LK,"/Demo/Games/EagleDive.HC",A="FI:::/Demo/Games/EagleDive.HC"$
$LK,"/Demo/Games/Talons.HC",A="FI:::/Demo/Games/Talons.HC"$
$LK,"/Demo/Games/ElephantWalk.HC",A="FI:::/Demo/Games/ElephantWalk.HC"$
$LK,"/Demo/Games/FlapBat.HC",A="FI:::/Demo/Games/FlapBat.HC"$
$LK,"/Demo/Games/FlatTops.HC",A="FI:::/Demo/Games/FlatTops.HC"$
+1 -1
View File
@@ -35,4 +35,4 @@ U0 StartUpTasks()
StartUpTasks;
"\nOS Compile Time:%D %T\n",sys_compile_time,sys_compile_time;
"\nTempleOS V%5.3f\t%D %T\n\n",sys_os_version,sys_compile_time,sys_compile_time;
+22 -23
View File
@@ -88,8 +88,8 @@ Bool BootDVDProbeAll(CBlkDev *bd)
}
}
U0 ATARepEntry(I64 base0,I64 base1,I64 unit,I64 irq,U8 *msg,
CATARep **_head,I64 *num_hints)
U0 ATARepEntry(I64 base0,I64 base1,I64 unit,U8 *msg,
CATARep **_head,I64 *num_hints)
{
I64 type;
base0&=-8;
@@ -97,13 +97,13 @@ U0 ATARepEntry(I64 base0,I64 base1,I64 unit,I64 irq,U8 *msg,
CATARep *tmpha;
if (type=ATAProbe(base0,base1,unit)) {
*num_hints+=1;
"\n\n$$PURPLE$$ $$BT+X,\"%d\",LM=\"%d\\n\"$$$$FG$$$$LM,4$$",*num_hints,*num_hints;
"\n$$PURPLE$$ $$BT+X,\"%d\",LM=\"%d\\n\"$$$$FG$$$$LM,4$$",*num_hints,*num_hints;
if (type==BDT_ATA)
"$$RED$$Hard Drive $$LTBLUE$$ATA ";
else
"$$RED$$CD/DVD Drive $$LTBLUE$$ATAPI ";
"%s$$FG$$\nBase0:0x%04X Base1:0x%04X\nIrq:0x%02X Unit:%d$$LM,0$$\n",
msg,base0,base1,irq,unit;
"%s$$FG$$\nBase0:0x%04X Base1:0x%04X Unit:%d$$LM,0$$\n",
msg,base0,base1,unit;
if (_head) {
tmpha=CAlloc(sizeof(CATARep));
tmpha->next=*_head;
@@ -130,7 +130,7 @@ Bool ATARepExitAllApplications()
public I64 ATARep(Bool pmt=TRUE,Bool just_ide=FALSE,CATARep **_head=NULL)
{//Report possible ATA devices by probing. Hard disks and CD/DVDs.
I64 d1,d2,d3,i,j,k,cnt=0,unlock_flags=0,num_hints=0;
I64 d1,d2,i,j,k,cnt=0,unlock_flags=0,num_hints=0;
#assert NUM_BLKDEVS<=64
if (_head) *_head=NULL;
@@ -155,35 +155,34 @@ public I64 ATARep(Bool pmt=TRUE,Bool just_ide=FALSE,CATARep **_head=NULL)
d1=PCIReadU32(j.u8[2],j.u8[1],j.u8[0],0x10);
d2=PCIReadU32(j.u8[2],j.u8[1],j.u8[0],0x14);
d3=PCIReadU8(j.u8[2],j.u8[1],j.u8[0],0x3C);
if (d1&1 && d2&1) {
ATARepEntry(d1,d2,0,d3,"Primary IDE",_head,&num_hints);
ATARepEntry(d1,d2,1,d3,"Primary IDE",_head,&num_hints);
ATARepEntry(d1,d2,0,"Primary IDE",_head,&num_hints);
ATARepEntry(d1,d2,1,"Primary IDE",_head,&num_hints);
} else {
d1=0x1F0; d2=0x3F6; d3=14;
ATARepEntry(d1,d2,0,d3,"Primary IDE",_head,&num_hints);
ATARepEntry(d1,d2,1,d3,"Primary IDE",_head,&num_hints);
d1=0x1F0; d2=0x3F6;
ATARepEntry(d1,d2,0,"Primary IDE",_head,&num_hints);
ATARepEntry(d1,d2,1,"Primary IDE",_head,&num_hints);
}
d1=PCIReadU32(j.u8[2],j.u8[1],j.u8[0],0x18);
d2=PCIReadU32(j.u8[2],j.u8[1],j.u8[0],0x1C);
if (d1&1 && d2&1) {
ATARepEntry(d1,d2,0,d3,"Secondary IDE",_head,&num_hints);
ATARepEntry(d1,d2,1,d3,"Secondary IDE",_head,&num_hints);
ATARepEntry(d1,d2,0,"Secondary IDE",_head,&num_hints);
ATARepEntry(d1,d2,1,"Secondary IDE",_head,&num_hints);
} else {
d1=0x170; d2=0x376; d3=15;
ATARepEntry(d1,d2,0,d3,"Secondary IDE",_head,&num_hints);
ATARepEntry(d1,d2,1,d3,"Secondary IDE",_head,&num_hints);
d1=0x170; d2=0x376;
ATARepEntry(d1,d2,0,"Secondary IDE",_head,&num_hints);
ATARepEntry(d1,d2,1,"Secondary IDE",_head,&num_hints);
}
}
}
if (!cnt) {
d1=0x1F0; d2=0x3F6; d3=14;
ATARepEntry(d1,d2,0,d3,"Primary IDE",_head,&num_hints);
ATARepEntry(d1,d2,1,d3,"Primary IDE",_head,&num_hints);
d1=0x1F0; d2=0x3F6;
ATARepEntry(d1,d2,0,"Primary IDE",_head,&num_hints);
ATARepEntry(d1,d2,1,"Primary IDE",_head,&num_hints);
d1=0x170; d2=0x376; d3=15;
ATARepEntry(d1,d2,0,d3,"Secondary IDE",_head,&num_hints);
ATARepEntry(d1,d2,1,d3,"Secondary IDE",_head,&num_hints);
d1=0x170; d2=0x376;
ATARepEntry(d1,d2,0,"Secondary IDE",_head,&num_hints);
ATARepEntry(d1,d2,1,"Secondary IDE",_head,&num_hints);
}
'\n\n';
for (i=0;i<NUM_BLKDEVS;i++)
-2
View File
@@ -177,7 +177,6 @@ Bool GetBaseUnit(CBlkDev *bd)
{
I64 ch;
Bool probe;
" TempleOS\n\n\n";
#exe {
if (kernel_cfg->opts[CFG_DONT_PROBE])
StreamPrint("probe=FALSE;");
@@ -221,7 +220,6 @@ U0 BlkDevsInitAll()
blkdev.drvs=CAlloc(sizeof(CDrv)*NUM_DRVS);
for (i=0;i<NUM_DRVS;i++)
blkdev.let_to_drv[i]=&blkdev.drvs[i];
text.raw_col=0;
#exe {
if (kernel_cfg->opts[CFG_AUTO_MOUNT_IDE])
StreamPrint("AutoMountIDE;");
+4 -4
View File
@@ -155,6 +155,9 @@ U0 KernelMain()
//Before this point use $LK,"Snd",A="MN:Snd"$() and $LK,"BusyWait",A="MN:BusyWait"$()
//to debug. After this point, use $LK,"RawPrint",A="MN:RawPrint"$()
LBts(&sys_run_level,RLf_RAW);
"TempleOS V%5.3f\t%D %T\n\n",
sys_os_version,sys_compile_time,sys_compile_time;
TimersInit;
if (BIOSTotalMem<ToI64(0.95*MEM_MIN_MEG*0x100000))
RawPrint(4000,"!!! Requires $TX,"512Meg",D="DD_MEM_MIN_MEG"$ of RAM Memory !!!");
@@ -167,11 +170,8 @@ U0 KernelMain()
LBts(&sys_run_level,RLf_INTERRUPTS);
TimeStampFreqCal;
"Before BlkDevsInitAll\n";
BlkDevsInitAll;
"After BlkDevsInitAll\n";
"ChgDsk(':');\n";
ChgDsk(':');
#exe {StreamPrint("HomeSet(\"%s\");",kernel_cfg->home_dir);}
Gs->idle_task->cur_dv=blkdev.let_to_drv[*blkdev.home_dir-'A'];
+2 -1
View File
@@ -12,7 +12,8 @@ CTask *sys_winmgr_task,*sys_task_being_scrn_updated;
U8 *rev_bits_table, //Table with U8 bits revd
*set_bits_table; //Table with count of set bits in a U8
CDate local_time_offset;
F64 *pow10_I64;
F64 *pow10_I64,
sys_os_version=4.130;
CAutoCompleteDictGlbls acd;
CAutoCompleteGlbls ac;
+40 -21
View File
@@ -71,58 +71,77 @@ I64 CeilI64(I64 num,I64 to)
}
//See $LK,"::/Doc/Credits.DD"$.
#define LIN_CONGRUE_A 6364136223846793005
#define LIN_CONGRUE_C 1442695040888963407
I16 RandI16()
{//Random I16.
Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407;
I64 res=Fs->rand_seed;
res=LIN_CONGRUE_A*res^(res&0xFFFFFFFF0000)>>16+LIN_CONGRUE_C;
if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND))
Fs->rand_seed^=GetTSC>>4;
return Fs->rand_seed.i16[0];
res^=GetTSC;
Fs->rand_seed=res;
return res.i16[0];
}
U16 RandU16()
{//Random U16.
Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407;
I64 res=Fs->rand_seed;
res=LIN_CONGRUE_A*res^(res&0xFFFFFFFF0000)>>16+LIN_CONGRUE_C;
if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND))
Fs->rand_seed^=GetTSC>>4;
return Fs->rand_seed.u16[0];
res^=GetTSC;
Fs->rand_seed=res;
return res.u16[0];
}
I32 RandI32()
{//Random I32.
Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407;
I64 res=Fs->rand_seed;
res=LIN_CONGRUE_A*res^(res&0xFFFFFFFF0000)>>16+LIN_CONGRUE_C;
if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND))
Fs->rand_seed^=GetTSC>>4;
return Fs->rand_seed.i32[0];
res^=GetTSC;
Fs->rand_seed=res;
return res.i32[0];
}
U32 RandU32()
{//Random U32.
Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407;
I64 res=Fs->rand_seed;
res=LIN_CONGRUE_A*res^(res&0xFFFFFFFF0000)>>16+LIN_CONGRUE_C;
if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND))
Fs->rand_seed^=GetTSC>>4;
return Fs->rand_seed.u32[0];
res^=GetTSC;
Fs->rand_seed=res;
return res.u32[0];
}
I64 RandI64()
{//Random I64.
Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407;
I64 res=Fs->rand_seed;
res=LIN_CONGRUE_A*res^(res&0xFFFFFFFF0000)>>16+LIN_CONGRUE_C;
if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND))
Fs->rand_seed^=GetTSC>>4;
return Fs->rand_seed;
res^=GetTSC;
Fs->rand_seed=res;
return res;
}
U64 RandU64()
{//Random U64.
Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407;
I64 res=Fs->rand_seed;
res=LIN_CONGRUE_A*res^(res&0xFFFFFFFF0000)>>16+LIN_CONGRUE_C;
if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND))
Fs->rand_seed^=GetTSC>>4;
return Fs->rand_seed;
res^=GetTSC;
Fs->rand_seed=res;
return res;
}
F64 Rand()
{//Random F64.
I64 res=RandI64&0x3FFFFFFFFFFFFFFF;
return res/ToF64(0x4000000000000000);
I64 res=Fs->rand_seed;
res=LIN_CONGRUE_A*res^(res&0xFFFFFFFF0000)>>16+LIN_CONGRUE_C;
if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND))
res^=GetTSC;
Fs->rand_seed=res;
return (res&0x3FFFFFFFFFFFFFFF)/ToF64(0x4000000000000000);
}
I64 Seed(I64 seed=0,CTask *task=NULL)
@@ -133,6 +152,6 @@ I64 Seed(I64 seed=0,CTask *task=NULL)
return task->rand_seed=seed;
} else {
LBtr(&task->task_flags,TASKf_NONTIMER_RAND);
return task->rand_seed=GetTSC>>4;
return task->rand_seed^=GetTSC;
}
}
+4
View File
@@ -30,15 +30,19 @@ SYS_DATA_BP:: DU64 0;
SYS_PROGRESSES::
SYS_PROGRESS1:: DU64 0;
SYS_PROGRESS1_MAX:: DU64 0;
SYS_PROGRESS1_T0:: DU64 0;
SYS_PROGRESS1_DESC:: DU8 PROGRESS_DESC_LEN DUP(0);
SYS_PROGRESS2:: DU64 0;
SYS_PROGRESS2_MAX:: DU64 0;
SYS_PROGRESS2_T0:: DU64 0;
SYS_PROGRESS2_DESC:: DU8 PROGRESS_DESC_LEN DUP(0);
SYS_PROGRESS3:: DU64 0;
SYS_PROGRESS3_MAX:: DU64 0;
SYS_PROGRESS3_T0:: DU64 0;
SYS_PROGRESS3_DESC:: DU8 PROGRESS_DESC_LEN DUP(0);
SYS_PROGRESS4:: DU64 0;
SYS_PROGRESS4_MAX:: DU64 0;
SYS_PROGRESS4_T0:: DU64 0;
SYS_PROGRESS4_DESC:: DU8 PROGRESS_DESC_LEN DUP(0);
#assert $$-SYS_PROGRESSES==sizeof(CProgress)*4
+1236 -1220
View File
File diff suppressed because one or more lines are too long
+33 -38
View File
@@ -1375,10 +1375,6 @@ public class CDoc //Linked Text File header
updates_cnt;
CEdFindText *find_replace;
U8 *cur_sprite;//Set cur_sprite use (ip.pos.x,ip.pos.y) as input.
//Output is nearest. See $LK,"*_cur_elem_num=",A="FF:::/Adam/Gr/SpriteEd.HC,*_cur_elem_num=doc->"$ and $LK,"::/Demo/Graphics/Pick.HC"$.
I64 nearest_sprite_elem_num;
CEdFileName filename;
I64 file_attr;
I64 (*left_click_link)(CDoc *doc,CDocEntry *doc_e);
@@ -2138,34 +2134,35 @@ class CLexHashTableContext
#define CCF_KEEP_DOT 0x100
#define CCF_KEEP_NUM_SIGN 0x200
#define CCF_KEEP_AT_SIGN 0x400
#define CCf_PASS_TRACE_PRESENT 11
#define CCF_NOT_CONST 0x0000010000
#define CCF_NO_REG_OPT 0x0000020000
#define CCF_IN_QUOTES 0x0000040000
#define CCF_EXE_BLK 0x0000080000
#define CCF_HAS_MISC_DATA 0x0000100000
#define CCF_HAS_RETURN 0x0000200000
#define CCF_ASM_EXPRESSIONS 0x0000400000
#define CCF_UNRESOLVED 0x0000800000
#define CCF_LOCAL 0x0001000000
#define CCF_FUN_EXP 0x0002000000
#define CCf_FUN_EXP 25
#define CCF_POSTINC 0x0004000000
#define CCF_POSTDEC 0x0008000000
#define CCF_PREINC 0x0010000000
#define CCF_PREDEC 0x0020000000
#define CCF_ARRAY 0x0040000000
#define CCF_RAX 0x0080000000
#define CCF_USE_LAST_U16 0x0100000000
#define CCf_USE_LAST_U16 32
#define CCF_LAST_WAS_DOT 0x0200000000
#define CCF_AOT_COMPILE 0x0400000000
#define CCf_AOT_COMPILE 34
#define CCF_NO_ABSS 0x0800000000
#define CCF_PAREN 0x1000000000
#define CCf_PAREN 36
#define CCF_CLASS_IP 0x2000000000
#define CCF_DONT_MAKE_RES 0x4000000000
#define CCF_NO_CHAR_CONST 0x800
#define CCf_PASS_TRACE_PRESENT 12
#define CCF_NOT_CONST 0x0000020000
#define CCF_NO_REG_OPT 0x0000040000
#define CCF_IN_QUOTES 0x0000080000
#define CCF_EXE_BLK 0x0000100000
#define CCF_HAS_MISC_DATA 0x0000200000
#define CCF_HAS_RETURN 0x0000400000
#define CCF_ASM_EXPRESSIONS 0x0000800000
#define CCF_UNRESOLVED 0x0001000000
#define CCF_LOCAL 0x0002000000
#define CCF_FUN_EXP 0x0004000000
#define CCf_FUN_EXP 26
#define CCF_POSTINC 0x0008000000
#define CCF_POSTDEC 0x0010000000
#define CCF_PREINC 0x0020000000
#define CCF_PREDEC 0x0040000000
#define CCF_ARRAY 0x0080000000
#define CCF_RAX 0x0100000000
#define CCF_USE_LAST_U16 0x0200000000
#define CCf_USE_LAST_U16 33
#define CCF_LAST_WAS_DOT 0x0400000000
#define CCF_AOT_COMPILE 0x0800000000
#define CCf_AOT_COMPILE 35
#define CCF_NO_ABSS 0x1000000000
#define CCF_PAREN 0x2000000000
#define CCf_PAREN 37
#define CCF_CLASS_IP 0x4000000000
#define CCF_DONT_MAKE_RES 0x8000000000
public class CCmpCtrl
{
@@ -3295,6 +3292,7 @@ public class CTaskSettings
#define TASKf_PENDING_BREAK 11
#define TASKf_BREAK_TO_SHIFT_ESC 12
#define TASKf_KILL_AFTER_DBG 13
#define TASKf_NONTIMER_RAND 14
//CTask.display_flags
@@ -3700,15 +3698,11 @@ public class CDC
//Set by $LK,"DCSymmetrySet",A="MN:DCSymmetrySet"$() or $LK,"DCSymmetry3Set",A="MN:DCSymmetry3Set"$()
CGrSym sym;
I64 nearest_dist,
cur_sprite_elem_num,
nearest_sprite_elem_num; //num in a CSprite elem lst
I32 cur_x,cur_y,cur_z,pad;
I64 collision_cnt;
//Set by $LK,"DCF_RECORD_EXTENTS",A="MN:DCF_RECORD_EXTENTS"$
I64 min_x,max_x,min_y,max_y; //scrn coordinates
I64 nearest_dist,
min_x,max_x,min_y,max_y; //Set by $LK,"DCF_RECORD_EXTENTS",A="MN:DCF_RECORD_EXTENTS"$ (scrn coordinates)
U32 dc_signature,pad;
CTask *mem_task,*win_task;
@@ -3912,6 +3906,7 @@ public class CDbgGlbls
class CProgress
{
I64 val,max;
F64 t0;
U8 desc[PROGRESS_DESC_LEN];
};
+8 -4
View File
@@ -206,19 +206,23 @@ _extern SYS_CTRL_ALT_FLAGS
public _extern SYS_PROGRESS1 I64 progress1; //Current progress 1.
public _extern SYS_PROGRESS1_DESC
U8 progress1_desc[PROGRESS_DESC_LEN]; //Progress 1 desc.
public _extern SYS_PROGRESS1_MAX I64 progress1_max; //Max progress 1.
public _extern SYS_PROGRESS1_MAX I64 progress1_max; //Progress 1 max.
public _extern SYS_PROGRESS1_T0 F64 progress1_t0; //Progress 1 start time.
public _extern SYS_PROGRESS2 I64 progress2; //Current progress 2.
public _extern SYS_PROGRESS2_DESC
U8 progress2_desc[PROGRESS_DESC_LEN]; //Progress 2 desc.
public _extern SYS_PROGRESS2_MAX I64 progress2_max; //Max progress 2.
public _extern SYS_PROGRESS2_MAX I64 progress2_max; //Progress 2 max.
public _extern SYS_PROGRESS2_T0 F64 progress2_t0; //Progress 2 start time.
public _extern SYS_PROGRESS3 I64 progress3; //Current progress 3.
public _extern SYS_PROGRESS3_DESC
U8 progress3_desc[PROGRESS_DESC_LEN]; //Progress 3 desc.
public _extern SYS_PROGRESS3_MAX I64 progress3_max; //Max progress 3.
public _extern SYS_PROGRESS3_MAX I64 progress3_max; //Progress 3 max.
public _extern SYS_PROGRESS3_T0 F64 progress3_t0; //Progress 3 start time.
public _extern SYS_PROGRESS4 I64 progress4; //Current progress 4.
public _extern SYS_PROGRESS4_DESC
U8 progress4_desc[PROGRESS_DESC_LEN]; //Progress 4 desc.
public _extern SYS_PROGRESS4_MAX I64 progress4_max; //Max progress 4.
public _extern SYS_PROGRESS4_MAX I64 progress4_max; //Progress 4 max.
public _extern SYS_PROGRESS4_T0 F64 progress4_t0; //Progress 4 start time.
public _extern SYS_PROGRESSES
CProgress sys_progresses[NUM_PROGRESS_BARS]; //All progress bars.
+2
View File
@@ -394,6 +394,7 @@ extern U0 (*fp_set_std_palette)();
public extern U8 *Color2Str(U8 *buf,CColorROPU32 c);
public extern CColorROPU16 Str2ColorU16(U8 *st);
public extern CColorROPU32 Str2ColorU32(U8 *st);
#help_index "Hash"
#help_file "::/Doc/Hash"
public _extern _HASH_ADD U0 HashAdd(CHash *tmph,CHashTable *table);
@@ -573,6 +574,7 @@ public extern U0 QSort(U8 *base,I64 num, I64 width,
I64 (*fp_compare)(U8 *e1,U8 *e2));
public extern U0 QSortI64(I64 *base,I64 num,
I64 (*fp_compare)(I64 e1,I64 e2));
public extern F64 sys_os_version;
#help_index "Misc/Progress Bars"
public extern U0 ProgressBarsRst();
+2 -2
View File
@@ -5,7 +5,7 @@ fp_compare() passes by value instead of ref.
For ascending strings: return StrCmp(e1,e2);
For ascending ints : return e1-e2;
Maybe, look at $LK,"::/Demo/MultiCore/RadixSort.HC"$.
Maybe, look at $LK,"::/Demo/MultiCore/MPRadix.HC"$.
*/
I64 i,*left,*right,pivot;
if (num>1) {
@@ -89,7 +89,7 @@ For ascending strings: return StrCmp(*e1,*e2);
For ascending ints : return *e1-*e2;
Don't return e1-e2 if numbers can overflow, return -1,0 or 1.
Maybe, look at $LK,"::/Demo/MultiCore/RadixSort.HC"$.
Maybe, look at $LK,"::/Demo/MultiCore/MPRadix.HC"$.
*/
U8 *tmp;
if (width && num>1) {
+182 -177
View File
@@ -1,7 +1,8 @@
U0 TS(I64 i)
U0 TS(I64 i,F64 t0)
{
progress4=i;
progress4_max=171;
progress4_max=172;
progress4_t0=t0;
*progress4_desc=0;
}
U0 TSFile(U8 *name,I64 ms=750)
@@ -1287,11 +1288,11 @@ U0 DoFPS()
DeathWait(&task,TRUE);
}
U0 DoEagleDive()
U0 DoTalons()
{
I64 i;
CTask *task=User;
XTalkWait(task,"#include \"::/Demo/Games/EagleDive\";\n");
XTalkWait(task,"#include \"::/Demo/Games/Talons\";\n");
Sleep(500);
for (i=0;i<10;i++) {
PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP);
@@ -1388,7 +1389,8 @@ U0 DoSortFile()
U0 DoToHtmlToTXT()
{
CTask *task=User("#include \"::/Demo/ToHtmlToTXTDemo/HtmlGen\";"
"#include \"::/Demo/ToHtmlToTXTDemo/TXTGen\";Sleep(750);\n");
"#include \"::/Demo/ToHtmlToTXTDemo/TXTGen\";"
"Type(\"/Home/DemoOutPage.TXT\");Sleep(750);\n");
DeathWait(&task,TRUE);
}
@@ -1556,195 +1558,198 @@ U0 DoAsmAndC2()
}
U0 OSTestSuite()
{ //$MA+LIS-X,"RENUM",LM="I64 i;for (i=0;i<171;i++){if(i)Msg(MSG_KEY_DOWN_UP,0,SC_F3);else\"%cTS(%c\",CH_CTRLF,CH_ESC;Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);\"%03d\",i;Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);\"%c%c%c\",CH_BACKSPACE,CH_BACKSPACE,CH_BACKSPACE;}"$
{ //$MA+LIS-X,"RENUM",LM="I64 i;for (i=0;i<172;i++){if(i)Msg(MSG_KEY_DOWN_UP,0,SC_F3);else\"%cTS(%c\",CH_CTRLF,CH_ESC;Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);\"%03d\",i;Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);\"%c%c%c\",CH_BACKSPACE,CH_BACKSPACE,CH_BACKSPACE;}"$
F64 t0=tS;
CTask *task;
TS(000); DoBlackDiamond;
TS(001); DoEagleDive;
TS(002); DoFlatTops;
TS(003); DoDunGen;
TS(004); DoFPS;
TS(005); DoZoneOut;
TS(006); DoVaroom;
TS(007); DoRocket;
TS(008); DoRocketScience;
TS(009); DoBattleLines;
TS(010); DoBigGuns;
TS(011); DoFlapBat;
TS(012); DoTimeOut;
TS(013); DoToTheFront;
TS(014); DoPsalmody;
TS(015); DoJukeBox;
TS(016); if (!sys_heap_init_flag) DoSpan; //Has FloodFill
TS(017); DoStrut;
TS(018); DoRawHide;
TS(019); DoKeepAway;
TS(020); DoAfterEgypt;
TS(021); DoXCaliber;
TS(022); DoWenceslas;
TS(023); DoBomberGolf;
TS(024); DoTheDead;
TS(025); DoTreeCheckers;
TS(026); DoMPAdd;
TS(027); TSFile("::/Demo/MultiCore/Primes");
TS(028); if (FileFind(BIBLE_FILENAME))
TS(000,t0); DoBlackDiamond;
TS(001,t0); DoTalons;
TS(002,t0); DoFlatTops;
TS(003,t0); DoDunGen;
TS(004,t0); DoFPS;
TS(005,t0); DoZoneOut;
TS(006,t0); DoVaroom;
TS(007,t0); DoRocket;
TS(008,t0); DoRocketScience;
TS(009,t0); DoBattleLines;
TS(010,t0); DoBigGuns;
TS(011,t0); DoFlapBat;
TS(012,t0); DoTimeOut;
TS(013,t0); DoToTheFront;
TS(014,t0); DoPsalmody;
TS(015,t0); DoJukeBox;
TS(016,t0); if (!sys_heap_init_flag) DoSpan; //Has FloodFill
TS(017,t0); DoStrut;
TS(018,t0); DoRawHide;
TS(019,t0); DoKeepAway;
TS(020,t0); DoAfterEgypt;
TS(021,t0); DoXCaliber;
TS(022,t0); DoWenceslas;
TS(023,t0); DoBomberGolf;
TS(024,t0); DoTheDead;
TS(025,t0); DoTreeCheckers;
TS(026,t0); TSFile("::/Demo/RadixSort");
TS(027,t0); DoMPAdd;
TS(028,t0); TSFile("::/Demo/MultiCore/Primes");
TS(029,t0); if (FileFind(BIBLE_FILENAME))
TSFile("::/Demo/MultiCore/Palindrome");
TS(029); TSFileChar("::/Demo/MultiCore/Clouds");
TS(030); if (mp_cnt>1) TSFile("::/Demo/MultiCore/RadixSort");
TS(031); if (mp_cnt>1 && DrvIsWritable(':'))
TS(030,t0); TSFileChar("::/Demo/MultiCore/Clouds");
TS(031,t0); if (mp_cnt>1) TSFile("::/Demo/MultiCore/MPRadix");
TS(032,t0); if (mp_cnt>1 && DrvIsWritable(':'))
TSFileChar("::/Demo/MultiCore/LoadTest");
TS(032); if (mp_cnt>1) TSFile("::/Demo/MultiCore/MPPrint");
TS(033); if (mp_cnt>1) TSFile("::/Demo/MultiCore/Lock");
TS(034); if (mp_cnt>1) TSFile("::/Demo/MultiCore/Interrupts");
TS(035); TSFileChar("::/Demo/Graphics/SpritePlot");
TS(036); TSFileChar("::/Demo/Graphics/Elephant",,CH_SHIFT_ESC);
TS(037); TSFileChar("::/Demo/Graphics/SpritePlot3D");
TS(038); TSFile("::/Demo/Graphics/SpritePut");
TS(039); TSFile("::/Demo/Graphics/SpritePutExt");
TS(040); TSFile("::/Demo/Graphics/SpriteText");
TS(041); TSFile("::/Demo/Graphics/SpriteRaw");
TS(042); TSFile("::/Demo/Graphics/EdSprite");
TS(043); TSFile("::/Demo/Graphics/Balloon",0);
TS(044); TSFile("::/Demo/Carry");
TS(045); TSFile("::/Demo/Directives");
TS(046); DoRandDemo;
TS(047); TSFileChar("::/Demo/Graphics/Extents");
TS(048); TSFileChar("::/Demo/Graphics/NetOfDots");
TS(049); TSFileChar("::/Demo/Graphics/SunMoon");
TS(050); DoLowPassFilter;
TS(051); DoMathAudioDemo;
TS(052); TSFileChar("::/Demo/Graphics/Lines");
TS(053); TSFileChar("::/Demo/Graphics/Bounce",,CH_SHIFT_ESC,FALSE);
TS(054); DoMsgLoop;
TS(055); DoASCIIOrgan;
TS(056); DoMorseCode;
TS(057); DoPixCollision;
TS(058); DoDoodle;
TS(059); DoMassSpring;
TS(060); DoSpeedLine;
TS(061); DoKeyBitMap;
TS(062); DoMountain;
TS(063); DoBSpline;
TS(064); DoGrModels;
TS(065); TSFileChar("::/Demo/Graphics/Blot",1800);
TS(066); if (DrvIsWritable('~')) DoScrnCapture;
TS(067); DoGrid;
TS(068); DoPick;
TS(069); DoPick3D;
TS(070); DoWhap;
TS(071); DoPalette;
TS(072); TSFile("::/Demo/Print");
TS(073); TSFileChar("::/Demo/Graphics/Shading",1500);
TS(074); TSFileChar("::/Demo/Graphics/RotateTank",1500);
TS(075); TSFileChar("::/Demo/Graphics/3DPoly",1500);
TS(076); TSFileChar("::/Demo/Graphics/Box",1500);
TS(077); DoSymmetry;
TS(078); TSFileChar("::/Demo/Graphics/Shadow",1500);
TS(079); TSFileChar("::/Demo/Graphics/Transform",,CH_SHIFT_ESC);
TS(080); DoPredatorPrey;
TS(081); DoPoleZeros;
TS(082); DoDigits;
TS(083); DoStadium;
TS(084); DoElephantWalk;
TS(085); DoHalogen;
TS(086); TSFileChar("::/Demo/Games/Maze",,CH_SHIFT_ESC);
TS(087); TSFileChar("::/Demo/Graphics/FontEd",,CH_SHIFT_ESC);
TS(088); DoLattice;
TS(089); DoCtrlR1;
TS(090); DoF2Macro;
TS(091); TSFile("::/Demo/SubIntAccess");
TS(092); DoDemoDoc;
TS(093); TSFile("::/Demo/DolDoc/TreeDemo");
TS(094); TSFile("::/Demo/DolDoc/TextDemo");
TS(095); TSFile("::/Demo/DolDoc/CursorMove");
TS(096); DoMiniCompiler;
TS(097); TSFile("::/Demo/Lectures/MiniGrLib",0);
TS(098); TSFileChar("::/Demo/TimeIns");
TS(099); DoPhoneNumWords;
TS(100); TSFile("::/Demo/Dsk/UnusedSpaceRep");
TS(101); TSFile("::/Demo/Dsk/BlkDevRep");
TS(102); DoLastClass;
TS(103); if (DrvIsWritable('~')) DoFPrintF;
TS(104); TSFile("::/Demo/Dsk/SerializeTree");
TS(105); DoExceptions;
TS(106); TSFileChar("::/Demo/ScrnCodes");
TS(107); TSFile("::/Demo/ExtChars");
TS(108); TSFile("::/Demo/Graphics/PanText",0);
TS(109); TSFile("::/Demo/Graphics/CharAnimation");
TS(110); DoCharDemo;
TS(111); TSFile("::/Demo/DateTime");
TS(112); TSFile("::/Demo/SubSwitch");
TS(113); TSFile("::/Demo/NullCase");
TS(114); TSFile("::/Demo/MagicPairs");
TS(115); TSFileChar("::/Demo/Graphics/Hanoi",3000);
TS(116); DoSquirt;
TS(117); TSFileChar("::/Demo/Graphics/CommonAncestor",1500,CH_SHIFT_ESC);
TS(118); DoCartesian;
TS(119); TSFileChar("::/Demo/Games/RainDrops",,CH_SHIFT_ESC);
TS(120); TSFileChar("::/Demo/Games/Collision",1500);
TS(121); DoLogic;
TS(122); TSFile("::/Demo/CompileDemo");
TS(123); DoPrompt;
TS(124); if (DrvIsWritable('~')) DoWebLog;
TS(125); if (DrvIsWritable('~')) DoRevFile;
TS(126); if (DrvIsWritable('~')) DoSortFile;
TS(127); if (DrvIsWritable('~')) DoToHtmlToTXT;
TS(128); if (DrvIsWritable('~')) TSFile("::/Demo/RegistryDemo");
TS(129); DoDefine;
TS(130); TSFile("::/Demo/GlblVars");
TS(131); DoFileRead;
TS(132); TSFile("::/Demo/ParenWarn");
TS(133); TSFile("::/Demo/DolDoc/DefineStr");
TS(134); TSFile("::/Demo/DolDoc/Data");
TS(135); TSFile("::/Demo/DolDoc/CallBack");
TS(136); TSFile("::/Demo/ClassMeta");
TS(137); if (DrvIsWritable('~')) DoNumBible;
TS(138); DoForm;
TS(139); DoClickCallBack;
TS(140); DoMenuButton;
TS(141); DoMenuSprite;
TS(142); DoSuggestedSpelling;
TS(143); TSFileChar("::/Demo/WordSearch");
TS(144); TSFile("::/Demo/StkGrow");
TS(145); TSFile("::/Demo/MemDemo");
TS(146); TSFileChar("::/Demo/Snd/WaterFowl");
TS(147); TSFile("::/Demo/Asm/AsmHelloWorld");
TS(148); DoAsmAndC1;
TS(149); DoAsmAndC2;
TS(150); TSFile("::/Demo/Asm/AsmAndC3");
TS(151); TSFile("::/Demo/Asm/MulByHand");
TS(152); TSFile("::/Demo/Asm/DivByHand");
TS(153); TSFile("::/Demo/Asm/BuzzFizz");
TS(154); TSFile("::/Demo/Asm/PutDec");
TS(033,t0); if (mp_cnt>1) TSFile("::/Demo/MultiCore/MPPrint");
TS(034,t0); if (mp_cnt>1) TSFile("::/Demo/MultiCore/Lock");
TS(035,t0); if (mp_cnt>1) TSFile("::/Demo/MultiCore/Interrupts");
TS(036,t0); TSFileChar("::/Demo/Graphics/SpritePlot");
TS(037,t0); TSFileChar("::/Demo/Graphics/Elephant",,CH_SHIFT_ESC);
TS(038,t0); TSFileChar("::/Demo/Graphics/SpritePlot3D");
TS(039,t0); TSFile("::/Demo/Graphics/SpritePut");
TS(040,t0); TSFile("::/Demo/Graphics/SpritePutExt");
TS(041,t0); TSFile("::/Demo/Graphics/SpriteText");
TS(042,t0); TSFile("::/Demo/Graphics/SpriteRaw");
TS(043,t0); TSFile("::/Demo/Graphics/EdSprite");
TS(044,t0); TSFile("::/Demo/Graphics/Balloon",0);
TS(045,t0); TSFile("::/Demo/Carry");
TS(046,t0); TSFile("::/Demo/Directives");
TS(047,t0); DoRandDemo;
TS(048,t0); TSFileChar("::/Demo/Graphics/Extents");
TS(049,t0); TSFileChar("::/Demo/Graphics/NetOfDots");
TS(050,t0); TSFileChar("::/Demo/Graphics/SunMoon");
TS(051,t0); DoLowPassFilter;
TS(052,t0); DoMathAudioDemo;
TS(053,t0); TSFileChar("::/Demo/Graphics/Lines");
TS(054,t0); TSFileChar("::/Demo/Graphics/Bounce",,CH_SHIFT_ESC,FALSE);
TS(055,t0); DoMsgLoop;
TS(056,t0); DoASCIIOrgan;
TS(057,t0); DoMorseCode;
TS(058,t0); DoPixCollision;
TS(059,t0); DoDoodle;
TS(060,t0); DoMassSpring;
TS(061,t0); DoSpeedLine;
TS(062,t0); DoKeyBitMap;
TS(063,t0); DoMountain;
TS(064,t0); DoBSpline;
TS(065,t0); DoGrModels;
TS(066,t0); TSFileChar("::/Demo/Graphics/Blot",1800);
TS(067,t0); if (DrvIsWritable('~')) DoScrnCapture;
TS(068,t0); DoGrid;
TS(069,t0); DoPick;
TS(070,t0); DoPick3D;
TS(071,t0); DoWhap;
TS(072,t0); DoPalette;
TS(073,t0); TSFile("::/Demo/Print");
TS(074,t0); TSFileChar("::/Demo/Graphics/Shading",1500);
TS(075,t0); TSFileChar("::/Demo/Graphics/RotateTank",1500);
TS(076,t0); TSFileChar("::/Demo/Graphics/3DPoly",1500);
TS(077,t0); TSFileChar("::/Demo/Graphics/Box",1500);
TS(078,t0); DoSymmetry;
TS(079,t0); TSFileChar("::/Demo/Graphics/Shadow",1500);
TS(080,t0); TSFileChar("::/Demo/Graphics/Transform",,CH_SHIFT_ESC);
TS(081,t0); DoPredatorPrey;
TS(082,t0); DoPoleZeros;
TS(083,t0); DoDigits;
TS(084,t0); DoStadium;
TS(085,t0); DoElephantWalk;
TS(086,t0); DoHalogen;
TS(087,t0); TSFileChar("::/Demo/Games/Maze",,CH_SHIFT_ESC);
TS(088,t0); TSFileChar("::/Demo/Graphics/FontEd",,CH_SHIFT_ESC);
TS(089,t0); DoLattice;
TS(090,t0); DoCtrlR1;
TS(091,t0); DoF2Macro;
TS(092,t0); TSFile("::/Demo/SubIntAccess");
TS(093,t0); DoDemoDoc;
TS(094,t0); TSFile("::/Demo/DolDoc/TreeDemo");
TS(095,t0); TSFile("::/Demo/DolDoc/TextDemo");
TS(096,t0); TSFile("::/Demo/DolDoc/CursorMove");
TS(097,t0); DoMiniCompiler;
TS(098,t0); TSFile("::/Demo/Lectures/MiniGrLib",0);
TS(099,t0); TSFileChar("::/Demo/TimeIns");
TS(100,t0); DoPhoneNumWords;
TS(101,t0); TSFile("::/Demo/Dsk/UnusedSpaceRep");
TS(102,t0); TSFile("::/Demo/Dsk/BlkDevRep");
TS(103,t0); DoLastClass;
TS(104,t0); if (DrvIsWritable('~')) DoFPrintF;
TS(105,t0); TSFile("::/Demo/Dsk/SerializeTree");
TS(106,t0); DoExceptions;
TS(107,t0); TSFileChar("::/Demo/ScrnCodes");
TS(108,t0); TSFile("::/Demo/ExtChars");
TS(109,t0); TSFile("::/Demo/Graphics/PanText",0);
TS(110,t0); TSFile("::/Demo/Graphics/CharAnimation");
TS(111,t0); DoCharDemo;
TS(112,t0); TSFile("::/Demo/DateTime");
TS(113,t0); TSFile("::/Demo/SubSwitch");
TS(114,t0); TSFile("::/Demo/NullCase");
TS(115,t0); TSFile("::/Demo/MagicPairs");
TS(116,t0); TSFileChar("::/Demo/Graphics/Hanoi",3000);
TS(117,t0); DoSquirt;
TS(118,t0); TSFileChar("::/Demo/Graphics/CommonAncestor",1500,CH_SHIFT_ESC);
TS(119,t0); DoCartesian;
TS(120,t0); TSFileChar("::/Demo/Games/RainDrops",,CH_SHIFT_ESC);
TS(121,t0); TSFileChar("::/Demo/Games/Collision",1500);
TS(122,t0); DoLogic;
TS(123,t0); TSFile("::/Demo/CompileDemo");
TS(124,t0); DoPrompt;
TS(125,t0); if (DrvIsWritable('~')) DoWebLog;
TS(126,t0); if (DrvIsWritable('~')) DoRevFile;
TS(127,t0); if (DrvIsWritable('~')) DoSortFile;
TS(128,t0); if (DrvIsWritable('~')) DoToHtmlToTXT;
TS(129,t0); if (DrvIsWritable('~')) TSFile("::/Demo/RegistryDemo");
TS(130,t0); DoDefine;
TS(131,t0); TSFile("::/Demo/GlblVars");
TS(132,t0); DoFileRead;
TS(133,t0); TSFile("::/Demo/ParenWarn");
TS(134,t0); TSFile("::/Demo/DolDoc/DefineStr");
TS(135,t0); TSFile("::/Demo/DolDoc/Data");
TS(136,t0); TSFile("::/Demo/DolDoc/CallBack");
TS(137,t0); TSFile("::/Demo/ClassMeta");
TS(138,t0); if (DrvIsWritable('~')) DoNumBible;
TS(139,t0); DoForm;
TS(140,t0); DoClickCallBack;
TS(141,t0); DoMenuButton;
TS(142,t0); DoMenuSprite;
TS(143,t0); DoSuggestedSpelling;
TS(144,t0); TSFileChar("::/Demo/WordSearch");
TS(145,t0); TSFile("::/Demo/StkGrow");
TS(146,t0); TSFile("::/Demo/MemDemo");
TS(147,t0); TSFileChar("::/Demo/Snd/WaterFowl");
TS(148,t0); TSFile("::/Demo/Asm/AsmHelloWorld");
TS(149,t0); DoAsmAndC1;
TS(150,t0); DoAsmAndC2;
TS(151,t0); TSFile("::/Demo/Asm/AsmAndC3");
TS(152,t0); TSFile("::/Demo/Asm/MulByHand");
TS(153,t0); TSFile("::/Demo/Asm/DivByHand");
TS(154,t0); TSFile("::/Demo/Asm/BuzzFizz");
TS(155,t0); TSFile("::/Demo/Asm/PutDec");
task=User;
TS(155); XTalkWait(task,"DocMax;Prof;HeapLog(ON);\n");
TS(156); XTalkWait(task,"PCIRep;Sleep(750);\n");
TS(157); XTalkWait(task,"MemBIOSRep;Sleep(750);\n");
TS(158); XTalkWait(task,"MemRep;Sleep(750);\n");
TS(159); XTalkWait(task,"ZipRep;Sleep(750);\n");
TS(160); XTalkWait(task,"ProfRep;Sleep(750);\n");
TS(161); XTalkWait(task,"HeapLogSizeRep;Sleep(750);\n");
TS(162); if (mp_cnt>1) XTalkWait(task,"CPURep(TRUE);Sleep(750);\n");
TS(163); if (DrvIsWritable(':')) XTalkWait(task,"ChkDsk;Sleep(750);\n");
TS(164); if (DrvIsWritable(':')) {
TS(156,t0); XTalkWait(task,"DocMax;Prof;HeapLog(ON);\n");
TS(157,t0); XTalkWait(task,"PCIRep;Sleep(750);\n");
TS(158,t0); XTalkWait(task,"MemBIOSRep;Sleep(750);\n");
TS(159,t0); XTalkWait(task,"MemRep;Sleep(750);\n");
TS(160,t0); XTalkWait(task,"ZipRep;Sleep(750);\n");
TS(161,t0); XTalkWait(task,"ProfRep;Sleep(750);\n");
TS(162,t0); XTalkWait(task,"HeapLogSizeRep;Sleep(750);\n");
TS(163,t0); if (mp_cnt>1) XTalkWait(task,"CPURep(TRUE);Sleep(750);\n");
TS(164,t0); if (DrvIsWritable(':')) XTalkWait(task,"ChkDsk;Sleep(750);\n");
TS(165,t0); if (DrvIsWritable(':')) {
XTalkWait(task,"DrvView;\n");
Sleep(750);
PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0);
}
TS(165); if (DrvIsWritable(':')) {
TS(166,t0); if (DrvIsWritable(':')) {
XTalkWait(task,"DskView;\n");
Sleep(250); //Short because ATARep takes time.
PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0);
}
TS(166); XTalkWait(task,"ATARep;\npSleep(750);\n");
TS(167); XTalkWait(task,
TS(167,t0); XTalkWait(task,"ATARep;\npSleep(750);\n");
TS(168,t0); XTalkWait(task,
"HashDepthRep(adam_task->hash_table);Sleep(750);\n");
TS(168); XTalkWait(task,"Who;Sleep(750);\n");
TS(169); XTalkWait(task,"DrvRep;Sleep(750);\n");
TS(170); XTalkWait(task,"TaskRep;Sleep(750);\n");
TS(169,t0); XTalkWait(task,"Who;Sleep(750);\n");
TS(170,t0); XTalkWait(task,"DrvRep;Sleep(750);\n");
TS(171,t0); XTalkWait(task,"TaskRep;Sleep(750);\n");
DeathWait(&task,TRUE);
ProgressBarsRst;
"Elapsed Time:%5.3f\n",tS-t0;
}
OSTestSuite;
BIN
View File
Binary file not shown.
-4
View File
@@ -15,10 +15,6 @@ Option(OPTf_WARN_PAREN,ON);
Option(OPTf_WARN_DUP_TYPES,ON);
HashTablePurge(adam_task->hash_table);
#help_index "Misc"
//Use Dbg("Type 'G;'"); to debug before window mgr is running.
public F64 os_version=4.120;//Operating system version.
#include "/Adam/MakeAdam"
//Dbg("Type 'G;'");