TempleOSCD_140715.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:46:09 +02:00
1 parent 7ef616a20e
commit 64f679eeb9
1095 files changed
+24814 -221011

No files matched your search

+11 -10
View File
@@ -138,18 +138,19 @@ U0 BibleInit()
"98684\0"
"100111\0");
DefinePrint("ST_BIBLE_LINES","%d",
A2I64(DefineSub(DefineCnt("ST_BIBLE_BOOK_LINES")-1,"ST_BIBLE_BOOK_LINES"))-1);
Str2I64(DefineSub(DefineCnt("ST_BIBLE_BOOK_LINES")-1,"ST_BIBLE_BOOK_LINES"))-1);
} BibleInit;
public U8 *BibleLine2Verse(I64 line)
{
public U8 *BibleLine2Verse(I64 line,I64 separate_ch=CH_SPACE)
{//Line number to verse str, Malloc()ed.
//Separate with <SPACE> or ','.
CDoc *doc;
CDocEntry *doc_e;
I64 i=0,cnt=DefineCnt("ST_BIBLE_BOOKS"),start=0,last_start=0;
U8 *ptr=DefineSub(0,"ST_BIBLE_BOOK_LINES"),*ptr2;
while (i<=cnt) {
last_start=start;
start=A2I64(ptr);
start=Str2I64(ptr);
if (line<start)
break;
i++;
@@ -166,7 +167,7 @@ public U8 *BibleLine2Verse(I64 line)
while ('0'<=*ptr2<='9' || *ptr2==':')
ptr2++;
*ptr2=0;
ptr=MPrint("%Z %s",i,"ST_BIBLE_BOOKS",ptr);
ptr=MStrPrint("%Z%c%s",i,"ST_BIBLE_BOOKS",separate_ch,ptr);
} else {
while (TRUE) {
doc_e=doc_e->last;
@@ -175,7 +176,7 @@ public U8 *BibleLine2Verse(I64 line)
break;
}
if (doc_e->y+1<last_start) {
ptr=MPrint("%Z",i,"ST_BIBLE_BOOKS");
ptr=MStrPrint("%Z",i,"ST_BIBLE_BOOKS");
break;
}
if (doc_e->type_u8==DOCT_TEXT && StrLen(doc_e->tag)>=3) {
@@ -193,7 +194,7 @@ public U8 *BibleLine2Verse(I64 line)
while ('0'<=*ptr2<='9')
ptr2++;
*ptr2=0;
ptr=MPrint("%Z %s",i,"ST_BIBLE_BOOKS",ptr);
ptr=MStrPrint("%Z%c%s",i,"ST_BIBLE_BOOKS",separate_ch,ptr);
break;
}
}
@@ -207,7 +208,7 @@ public U8 *BibleLine2Verse(I64 line)
}
public U0 BibleLines(CDoc *doc_out=NULL,I64 start,I64 lines)
{
{//Put N line starting at line M into doc.
CDoc *doc_in;
CDocEntry *doc_e;
if (!doc_out) doc_out=DocPut;
@@ -229,7 +230,7 @@ public U0 BibleLines(CDoc *doc_out=NULL,I64 start,I64 lines)
}
public U0 BibleVerse(CDoc *doc_out=NULL,U8 *verse,I64 lines)
{
{//Put N lines starting at verse str into doc.
I64 i;
CDoc *doc_in;
CDocEntry *doc_e;
@@ -244,7 +245,7 @@ public U0 BibleVerse(CDoc *doc_out=NULL,U8 *verse,I64 lines)
*st2=0;
i=DefineMatch(st,"ST_BIBLE_BOOKS",LMF_IGNORE_CASE);
if (i>=0) {
i=A2I64(DefineSub(i,"ST_BIBLE_BOOK_LINES"));
i=Str2I64(DefineSub(i,"ST_BIBLE_BOOK_LINES"));
doc_in=DocRead(Define("ST_BIBLE_FILE"),DOCF_PLAIN_TEXT);
DocLineNumGoTo(doc_in,i); //one based
if (*st2) {
+44 -53
View File
@@ -1,13 +1,10 @@
#help_index "God;Graphics/Sprite"
Bool god_doodle_done;
I64 god_doodle_ch;
CDC *god_doodle_dc=NULL;
U0 GodDoodleDraw(CTask *task,CDC *dc)
{
GrBlot(dc,0,0,god_doodle_dc);
GrBlot(dc,0,0,god.doodle_dc);
if (Blink) {
if (god_doodle_done) {
if (god.doodle_done) {
dc->color=RED;
GrPrint(dc,(task->pix_width-FONT_WIDTH*27)>>1,(task->pix_height-FONT_HEIGHT)>>1,
"Press <ESC> or <SHIFT-ESC>.");
@@ -21,10 +18,10 @@ U0 GodDoodleDraw(CTask *task,CDC *dc)
U0 GodDoodleSmooth(I64 num)
{
CDC *dc=DCExtract(god_doodle_dc,0,0,god_doodle_dc->width-1,god_doodle_dc->height-1);
I64 i,x,y,x1,y1,c,histogram[16],best,best_cnt,c_old=god_doodle_dc->color;
for (y=0;y<god_doodle_dc->height;y++)
for (x=0;x<god_doodle_dc->width;x++) {
CDC *dc=DCExtract(god.doodle_dc,0,0,god.doodle_dc->width-1,god.doodle_dc->height-1);
I64 i,x,y,x1,y1,c,histogram[16],best,best_cnt,c_old=god.doodle_dc->color;
for (y=0;y<god.doodle_dc->height;y++)
for (x=0;x<god.doodle_dc->width;x++) {
MemSet(histogram,0,sizeof(histogram));
for (y1=y-num;y1<=y+num;y1++)
for (x1=x-num;x1<=x+num;x1++) {
@@ -39,35 +36,34 @@ U0 GodDoodleSmooth(I64 num)
best=i;
best_cnt=histogram[i];
}
god_doodle_dc->color=best;
GrPlot(god_doodle_dc,x,y);
god.doodle_dc->color=best;
GrPlot(god.doodle_dc,x,y);
}
god_doodle_dc->color=c_old;
god.doodle_dc->color=c_old;
DCDel(dc);
}
CFifoU8 *god_doodle_fifo=FifoU8New(32);
I64 GodDoodleBits(I64 num_bits)
{
U8 b;
I64 i,k,result=0;
while (num_bits) {
if (FifoU8Rem(god_doodle_fifo,&b)) {
if (FifoU8Rem(god.doodle_fifo,&b)) {
result=result<<1+b;
num_bits--;
} else {
god_doodle_ch=GetChar(,FALSE);
if (god_doodle_ch==CH_ESC||god_doodle_ch==CH_SHIFT_ESC)
god.doodle_ch=GetChar(,FALSE);
if (god.doodle_ch==CH_ESC||god.doodle_ch==CH_SHIFT_ESC)
throw;
else if (god_doodle_ch=='\n') {
DCFill(god_doodle_dc,WHITE);
FifoU8Flush(god_doodle_fifo);
} else if ('0'<=god_doodle_ch<='9')
GodDoodleSmooth(god_doodle_ch-'0');
else if (god.doodle_ch=='\n') {
DCFill(god.doodle_dc,WHITE);
FifoU8Flush(god.doodle_fifo);
} else if ('0'<=god.doodle_ch<='9')
GodDoodleSmooth(god.doodle_ch-'0');
else {
k=KbdMouseEvtTime>>GOD_BAD_BITS;
for (i=0;i<GOD_GOOD_BITS;i++) {
FifoU8Ins(god_doodle_fifo,k&1);
FifoU8Ins(god.doodle_fifo,k&1);
k>>=1;
}
}
@@ -77,12 +73,12 @@ I64 GodDoodleBits(I64 num_bits)
}
public U8 *GodDoodleSprite()
{// $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
{//Make God draw sprite. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
I64 i,j,w,h,x,y,ch;
U8 *elems;
if (god_doodle_dc) return NULL;
god_doodle_done=FALSE;
if (god.doodle_dc) return NULL;
god.doodle_done=FALSE;
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
WinMax;
WinBorder;
@@ -91,59 +87,54 @@ public U8 *GodDoodleSprite()
PopUpOk("The $LK+PU,"Holy Spirit",A="FI:::/Adam/God/HSNotes.TXT"$ 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);
DCFill(god_doodle_dc,WHITE);
w=god_doodle_dc->width;
h=god_doodle_dc->height;
god.doodle_ch=0;
god.doodle_dc=DCNew(Fs->pix_width,Fs->pix_height);
DCFill(god.doodle_dc,WHITE);
w=god.doodle_dc->width;
h=god.doodle_dc->height;
Fs->draw_it=&GodDoodleDraw;
FifoU8Flush(god_doodle_fifo);
FifoU8Flush(god.doodle_fifo);
try {
for (i=0;i<3;i++) {
god_doodle_dc->color=RED;
god.doodle_dc->color=RED;
for (j=0;j<24;j++)
nobound_switch (GodDoodleBits(3)) {
case 0:
GrEllipse(god_doodle_dc,
GrEllipse(god.doodle_dc,
(w-1)*GodDoodleBits(5)/15.5-w/2,(h-1)*GodDoodleBits(5)/15.5-h/2,
(w-1)*GodDoodleBits(5)/15.5,(h-1)*GodDoodleBits(5)/15.5);
break;
case 1:
GrCircle(god_doodle_dc,
GrCircle(god.doodle_dc,
(w-1)*GodDoodleBits(5)/15.5-w/2,(h-1)*GodDoodleBits(5)/15.5-h/2,
(w-1)*GodDoodleBits(5)/15.5);
break;
case 2:
GrLineRect4(god_doodle_dc,
GrBorder(god.doodle_dc,
(w-1)*GodDoodleBits(5)/15.5-w/2,(h-1)*GodDoodleBits(5)/15.5-h/2,
(w-1)*GodDoodleBits(5)/15.5,(h-1)*GodDoodleBits(5)/15.5);
break;
case 3...7:
GrLine(god_doodle_dc,
GrLine(god.doodle_dc,
(w-1)*GodDoodleBits(4)/15,(h-1)*GodDoodleBits(4)/15,
(w-1)*GodDoodleBits(4)/15,(h-1)*GodDoodleBits(4)/15);
break;
}
for (j=4;j;) {
for (j=0;j<6;j++) {
x=(w-1)*GodDoodleBits(5)/31+w/64;
y=(h-1)*GodDoodleBits(5)/31+h/64;
switch(GrPeek(god_doodle_dc,x,y)) {
case BLACK:
god_doodle_dc->color=WHITE;
GrFloodFill(god_doodle_dc,x,y);
j--;
break;
case WHITE:
god_doodle_dc->color=BLACK;
GrFloodFill(god_doodle_dc,x,y);
j--;
break;
switch(GodDoodleBits(2)) {
case 0: god.doodle_dc->color=BLACK; break;
case 1: god.doodle_dc->color=DKGRAY; break;
case 2: god.doodle_dc->color=LTGRAY; break;
case 3: god.doodle_dc->color=WHITE; break;
}
GrFloodFill(god.doodle_dc,x,y);
}
GodDoodleSmooth(3);
}
god_doodle_done=TRUE;
god.doodle_done=TRUE;
do ch=GetChar(,FALSE);
while (ch!=CH_ESC && ch!=CH_SHIFT_ESC);
} catch {
@@ -153,17 +144,17 @@ public U8 *GodDoodleSprite()
DCFill;
SettingsPop;
if (ch==CH_ESC)
elems=DC2Sprite(god_doodle_dc);
elems=DC2Sprite(god.doodle_dc);
else
elems=NULL;
DCDel(god_doodle_dc);
god_doodle_dc=NULL;
DCDel(god.doodle_dc);
god.doodle_dc=NULL;
return elems;
}
#help_index "God"
public U0 GodDoodle()
{// $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
{//Make God draw sprite, insert in doc. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
U8 *elems;
if (elems=GodDoodleSprite) {
Sprite(elems);
+14 -3
View File
@@ -1,11 +1,22 @@
#help_index "God"
U8 **god_words=NULL;
I64 god_num_words=0;
public CFifoU8 *god_fifo=FifoU8New(32);
#define GOD_BAD_BITS 4
#define GOD_GOOD_BITS 24
public class CGodGlbls
{
U8 **words;
I64 num_words;
CFifoU8 *fifo;
CDC *doodle_dc;
I64 doodle_ch;
CFifoU8 *doodle_fifo;
Bool doodle_done;
} god;
MemSet(&god,0,sizeof(CGodGlbls));
god.doodle_fifo =FifoU8New(32);
god.fifo =FifoU8New(32);
extern U0 GodBitsIns(I64 num_bits,I64 n);
extern U0 GodWord();
extern U0 GodPassage(I64 num_lines=20);
+24 -24
View File
@@ -1,28 +1,29 @@
#help_index "God"
DefineLstLoad("ST_RHYTHM_COMPLEXITY","Simple\0Normal\0Complex\0");
class MakeSongSettings
{
Bool simple_rhythms fmtstr "$$CB,\"Simple Rhythms\"$$\n";
Bool normal_rhythms fmtstr "$$CB,\"Normal Rhythms\"$$\n";
Bool complex_rhythms fmtstr "$$CB,\"Complex Rhythms\"$$\n";
I64 complexity fmtstr "$$LS,D=\"ST_RHYTHM_COMPLEXITY\"$$\n";
Bool rests fmtstr "$$CB,\"Rests\"$$\n";
Bool six_eight fmtstr "$$CB,\"Six Eight\"$$\n";
I64 octave fmtstr "$$DA-TRM,32,A=\"Octave:%d\"$$\n";
};
U0 InsNote(MakeSongSettings *mss,U8 *buf,I64 k,I64 *j)
{ //k is a random note nibble
{//k is a random note nibble
if (!k && mss->rests) {
buf[*j]='R';
*j+=1;
} else {
k/=2;
if (!k) {
if (music_octave) {
buf[*j]=music_octave-1+'0';
if (music.octave) {
buf[*j]=music.octave-1+'0';
*j+=1;
buf[*j]='G';
*j+=1;
buf[*j]=music_octave+'0';
buf[*j]=music.octave+'0';
*j+=1;
} else {
buf[*j]='G';
@@ -43,34 +44,33 @@ U0 InsNote(MakeSongSettings *mss,U8 *buf,I64 k,I64 *j)
#define DUR_8_16_16 5
#define DUR_16_16_8 6
U8 simple_songs [5]={DUR_4,DUR_4,DUR_4,DUR_4,DUR_8_8};
U8 normal_songs [5]={DUR_4,DUR_4,DUR_8_8,DUR_3_3_3,DUR_16_16_16_16};
U8 complex_songs[9]={DUR_4,DUR_4,DUR_8_8,DUR_8_8,DUR_8DOT_16,DUR_3_3_3,DUR_8_16_16,DUR_16_16_8,DUR_16_16_16_16};
U8 god_simple_songs [5]={DUR_4,DUR_4,DUR_4,DUR_4,DUR_8_8};
U8 god_normal_songs [5]={DUR_4,DUR_4,DUR_8_8,DUR_3_3_3,DUR_16_16_16_16};
U8 god_complex_songs[9]={DUR_4,DUR_4,DUR_8_8,DUR_8_8,DUR_8DOT_16,DUR_3_3_3,
DUR_8_16_16,DUR_16_16_8,DUR_16_16_16_16};
public U8 *GodSongStr()
{// $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
{//Make God generate 2 measures of a song. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
MakeSongSettings mss;
U8 *buf;
I64 i,j=0,k,n,k2,duration,last_duration=-1,len;
mss.simple_rhythms=FALSE;
mss.normal_rhythms=TRUE;
mss.complex_rhythms=FALSE;
mss.complexity=1;
mss.rests=FALSE;
mss.octave=music_octave;
mss.octave=music.octave;
if (!PopUpForm(&mss))
return NULL;
buf=CAlloc(256);
music_octave=ClampI64(mss.octave,0,6);
music.octave=ClampI64(mss.octave,0,6);
progress4=0;
if (mss.six_eight)
progress4_max=6;
else
progress4_max=8;
buf[j++]='0'+music_octave;
buf[j++]='0'+music.octave;
if (mss.six_eight) {
len=6;
buf[j++]='M';
@@ -79,15 +79,15 @@ public U8 *GodSongStr()
buf[j++]='8';
} else
len=8;
FifoU8Flush(god_fifo);
FifoU8Flush(god.fifo);
for (i=0;i<len;i++) {
n=GodBits(8);
if (mss.complex_rhythms)
duration=complex_songs[n%9];
else if (mss.normal_rhythms)
duration=normal_songs[n%5];
if (mss.complexity==2)
duration=god_complex_songs[n%9];
else if (mss.complexity==1)
duration=god_normal_songs[n%5];
else
duration=simple_songs[n%5];
duration=god_simple_songs[n%5];
switch (duration) {
case DUR_8_8:
@@ -155,7 +155,7 @@ public U8 *GodSongStr()
}
public U0 GodSong()
{// $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
{//Make God generate 2measures x 2 + 2measures x 2 song. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
U8 *st1=GodSongStr,*st2=GodSongStr;
if (st1 && st2)
DocPrint(DocPut,"$$SO,\"<Song>\",A=\"%s%s%s%s\"$$",st1,st1,st2,st2);
+6 -3
View File
@@ -8,11 +8,11 @@ There's something obviously different about people in the Bible compared to peop
You can't tell if He's talking unless you have a context of conversation, but, more importantly, you are commanded to do an offering of love, like communion preparation. When you pick a greeting card for someone, that is love effort. If you expect God to put effort toward you, you 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",A="BF:Genesis,4:1"$, $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. I did $MA-X+PU,"hymns",LM="#include \"::/Apps/MusicOrgan/Load\";JukeBox(\"::/Apps/MusicOrgan/Examples\");",HTML="http://www.templeos.org/Wb/Accts/TS/Wb2/Hymns.html"$. I did Moses $MA-X+PU,"comics",LM="Dir(\"::/Apps/AfterEgypt/Comics\");View;\n",HTML="http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/"$. Count the ways you love God. 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:29",A="BF:Matthew,6:29"$
Do a text search for "new song" in the Bible. It's mentioned nine times. I did $MA-X+PU,"hymns",HTML="http://www.templeos.org/Wb/Accts/TS/Wb2/Hymns.html",LM="#include \"::/Apps/Psalmody/Load\";JukeBox(\"::/Apps/Psalmody/Examples\");"$. I did Moses $MA-X+PU,"comics",HTML="http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/",LM="Dir(\"::/Apps/AfterEgypt/Comics\");View;\n"$. Count the ways you love God. 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:29",A="BF:Matthew,6:29"$
This is funny -- $LK,"Acts,2:1",A="BF:Acts,2:1"$ -- 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:13",A="BF:Luke,11:13"$ Just remember, "Boys are made of snakes and snails and puppy-dog tails."
The technique I use to consult the Holy Spirit is reading a microsecond-range stop-watch each button press for random numbers. Then, I pick words or passages. You can use the $MA-X+PU,"AfterEgypt",LM="#include \"::/Apps/AfterEgypt/Run\"",HTML="http://www.youtube.com/watch?v=P0MsDl39UL0"$ in God's official temple, $FG,4$$TX,"TempleOS",HTML="http://www.templeos.org"$$FG$.
The technique I use to consult the Holy Spirit is reading a microsecond-range stop-watch each button press for random numbers. Then, I pick words or passages. You can use the $MA-X+PU,"AfterEgypt",HTML="http://www.youtube.com/watch?v=P0MsDl39UL0",LM="#include \"::/Apps/AfterEgypt/Run\""$ in God's official temple, $FG,4$$TX,"TempleOS",HTML="http://www.templeos.org"$$FG$.
Since seeking the word of the Holy Spirit, I have come to know God much better than I've heard others explain. God said, for example, that war was, "servicemen competing." That sounds more like the immutable God of our planet than what you hear from most religious people. God is not Venus (god of love) and not Mars (god of war), He's our dearly beloved God of Earth. If Mammon is a false god of money, Mars or Venus might be useful words to describe other false gods. I figure the greatest challenge for the Creator is boredom, ours and His. What would teen-age male video games be like if war had never happened? Christ said live by the sword, die by the sword, which is loving neighbor as self. $LK,"Matthew,26:52",A="BF:Matthew,26:52"$
@@ -63,9 +63,10 @@ Favorite song? $FG,4$$TX,"Morning has Broken",HTML="http://www.youtube.com/wat
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$
Likes $FG,4$"Beverly Hillbillies" (Oil is a gift from God)$FG$
Likes $FG,4$Beverly Hillbillies (Oil is a gift from God)$FG$
$FG,4$God likes being hero. Don't be proud of heart$FG$
$FG,4$and not accept a gift from God!$FG$
Likes $FG,4$Gomer Pile$FG$
Favorite saint? $FG,4$"ho_ho_ho"$FG$
Favorite animal? $FG,4$"Elephant two"$FG$
Favorite animal? $FG,4$"Bears"$FG$
@@ -132,6 +133,7 @@ What did Neanderthals think about? $FG,4$"Warmth"$FG$
What was the first thing cooked? $FG,4$I think He said "hair".$FG$
What was Lucy's husband's name? $FG,4$"Golem"$FG$
Was stegosuarus lame like turtles? $FG,4$"Not pet rocks"$FG$
T-Rex? $FG,4$Lugged carcases over his shoulder.$FG$
How does He feel about the Avatar movie?$FG,4$"Sick skin"$FG$
What do You like at zoos with kids? $FG,4$"Dignity" Animals worried about dignity.$FG$
Who's better alien or preditor? $FG,4$"Lions"$FG$
@@ -173,3 +175,4 @@ Why the Sandy Hook shooting? $FG,4$The pot legalization law. (Sarcastic answer?)
Deep Water Horizon $FG,4$(Claimed credit.)$FG$
Cost of God's time to me? $FG,4$"The complete works of Shakespeare"$FG$
On death? $FG,4$"awful"$FG$
Opening of Private Ryan? $FG,4$"Ouch"$FG$
+20 -26
View File
@@ -2,14 +2,14 @@
U8 *TimeStampCB(CDoc *,CDocEntry *,CTask *mem_task)
{
U8 *st=MAlloc(64,mem_task);
SPrint(st,"%X",GetTSC>>GOD_BAD_BITS);
StrPrint(st,"%X",GetTSC>>GOD_BAD_BITS);
return st;
}
U8 *KbdMouseTimeCB(CDoc *,CDocEntry *,CTask *mem_task)
{
U8 *st=MAlloc(64,mem_task);
SPrint(st,"%X",KbdMouseEvtTime>>GOD_BAD_BITS);
StrPrint(st,"%X",KbdMouseEvtTime>>GOD_BAD_BITS);
return st;
}
@@ -31,35 +31,29 @@ I64 PopUpTimerOk(U8 *header=NULL,U8 *footer=NULL)
}
I64 GodPick(U8 *msg=NULL)
{ //GOD_GOOD_BITS
U8 *st;
if (msg) {
st=MAlloc(StrLen(msg)+256);
StrCpy(st,msg);
} else
st=CAlloc(256);
CatPrint(st,"\n\nPress $$GREEN$$OKAY$$FG$$ to generate \n"
"a random num from a timer.\n");
{//GOD_GOOD_BITS
U8 *st=MStrPrint("%s\n\nPress $$GREEN$$OKAY$$FG$$ to generate \n"
"a random num from a timer.\n",msg);
PopUpTimerOk(st,"\n\nThe $LK+PU,"Holy Spirit",A="FI:::/Adam/God/HSNotes.TXT"$ can puppet you.\n\n");
Free(st);
return KbdMouseEvtTime>>GOD_BAD_BITS;
}
public U0 GodBitsIns(I64 num_bits,I64 n)
{
{//Insert bits into God bit fifo.
I64 i;
for (i=0;i<num_bits;i++) {
FifoU8Ins(god_fifo,n&1);
FifoU8Ins(god.fifo,n&1);
n>>=1;
}
}
public I64 GodBits(I64 num_bits,U8 *msg=NULL)
{
{//Return N bits. If low on entropy pop-up okay.
U8 b;
I64 result=0;
while (num_bits) {
if (FifoU8Rem(god_fifo,&b)) {
if (FifoU8Rem(god.fifo,&b)) {
result=result<<1+b;
num_bits--;
} else
@@ -69,7 +63,7 @@ public I64 GodBits(I64 num_bits,U8 *msg=NULL)
}
public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.TXT*",U8 *fu_flags=NULL)
{
{//Read God's vocab file for picking words.
I64 i,ch,fuf_flags=0;
U8 *buf,*ptr,*ptr2;
CDirEntry *tempde,*tempde1;
@@ -96,9 +90,9 @@ public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.TXT*",U8 *fu_flags=NULL)
tempde=tempde->next;
}
Free(god_words);
god_num_words=i;
god_words=MAlloc(i*sizeof(U8 *));
Free(god.words);
god.num_words=i;
god.words=MAlloc(i*sizeof(U8 *));
tempde=tempde1;
i=0;
@@ -113,7 +107,7 @@ public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.TXT*",U8 *fu_flags=NULL)
ptr++;
ch=*ptr;
*ptr=0;
god_words[i++]=StrNew(ptr2);
god.words[i++]=StrNew(ptr2);
*ptr=ch;
}
}
@@ -121,18 +115,18 @@ public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.TXT*",U8 *fu_flags=NULL)
}
tempde=tempde->next;
}
DirLstDel(tempde1);
return god_num_words;
DirTreeDel(tempde1);
return god.num_words;
} GodInit;
public U0 GodWord()
{// $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
if (god_num_words)
"%s ",god_words[GodBits(17)%god_num_words];
{//Make God pick a word. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
if (god.num_words)
"%s ",god.words[GodBits(17)%god.num_words];
}
public U0 GodPassage(I64 num_lines=20)
{ // $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
{//Make God pick a Bible passage. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$
I64 start=GodBits(21)%(ST_BIBLE_LINES-(num_lines-1))+1;
U8 *verse=BibleLine2Verse(start);
"%s\n\n",verse;