mirror of
https://github.com/minexew/Shrine.git
synced 2026-05-26 17:09:46 +00:00
TempleOSCDV4.13.ISO
This commit is contained in:
Binary file not shown.
+3
-3
@@ -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
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
@@ -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
@@ -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$
|
||||
|
||||
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
@@ -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
@@ -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:
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
@@ -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
@@ -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
File diff suppressed because one or more lines are too long
+160
-131
@@ -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,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
File diff suppressed because one or more lines are too long
@@ -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
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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"$
|
||||
|
||||
@@ -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$
|
||||
@@ -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");
|
||||
|
||||
@@ -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
@@ -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"))
|
||||
|
||||
@@ -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
@@ -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;
|
||||
| ||||