TempleOSTS_140317.ISO
This commit is contained in:
1 parent
2d2a65d572
commit
7ef616a20e
1416 files changed
+223873
-53917
No files matched your search
Binary file not shown.
@@ -0,0 +1,182 @@
|
||||
#define M_DASH_THRESHOLD 0.140
|
||||
#define M_SPACE_THRESHOLD 0.300
|
||||
|
||||
U8 *morse_lst=
|
||||
|
||||
"A.-\0"
|
||||
"B-...\0"
|
||||
"C-.-.\0"
|
||||
"D-..\0"
|
||||
"E.\0"
|
||||
"F..-.\0"
|
||||
"G--.\0"
|
||||
"H....\0"
|
||||
"I..\0"
|
||||
"J.---\0"
|
||||
"K-.-\0"
|
||||
"L.-..\0"
|
||||
"M--\0"
|
||||
"N-.\0"
|
||||
"O---\0"
|
||||
"P.--.\0"
|
||||
"Q--.-\0"
|
||||
"R.-.\0"
|
||||
"S...\0"
|
||||
"T-\0"
|
||||
"U..-\0"
|
||||
"V...-\0"
|
||||
"W.--\0"
|
||||
"X-..-\0"
|
||||
"Y-.--\0"
|
||||
"Z--..\0"
|
||||
|
||||
"1.----\0"
|
||||
"2..---\0"
|
||||
"3...--\0"
|
||||
"4....-\0"
|
||||
"5.....\0"
|
||||
"6-....\0"
|
||||
"7--...\0"
|
||||
"8---..\0"
|
||||
"9----.\0"
|
||||
"0-----\0"
|
||||
|
||||
"/-..-.\0"
|
||||
"+.-.-.\0"
|
||||
"..-.-.-\0"
|
||||
",--..--\0"
|
||||
"?..--..\0"
|
||||
"(-.--.\0"
|
||||
")-.--.-\0"
|
||||
"--....-\0"
|
||||
"\".-..-.\0"
|
||||
"_..--.-\0"
|
||||
"'.----.\0"
|
||||
":---...\0"
|
||||
";-.-.-.\0"
|
||||
"=-...-\0";
|
||||
|
||||
U0 MorseTable()
|
||||
{
|
||||
U8 *st;
|
||||
I64 i=0;
|
||||
for (i=0;i<13;i++ ) {
|
||||
if (st=LstSub(i,morse_lst))
|
||||
"$$RED$$%C$$FG$$ %-7s ",*st,st+1;
|
||||
if (st=LstSub(i+13,morse_lst))
|
||||
"$$RED$$%C$$FG$$ %-7s ",*st,st+1;
|
||||
if (st=LstSub(i+26,morse_lst))
|
||||
"$$RED$$%C$$FG$$ %-7s ",*st,st+1;
|
||||
if (st=LstSub(i+39,morse_lst))
|
||||
"$$RED$$%C$$FG$$ %-7s ",*st,st+1;
|
||||
NewLine;
|
||||
}
|
||||
NewLine;
|
||||
}
|
||||
|
||||
F64 m_start,m_end,dt_down,dt_up;
|
||||
Bool space_sent;
|
||||
|
||||
U8 *MorseTimes(CDoc *,CDocEntry *,CTask *mem_task)
|
||||
{
|
||||
U8 *st=MAlloc(64,mem_task);
|
||||
SPrint(st,"Down:%10.6f Up:%10.6f",dt_down,dt_up);
|
||||
return st;
|
||||
}
|
||||
|
||||
|
||||
I64 MorseWaitKey()
|
||||
{
|
||||
I64 ch;
|
||||
F64 dt;
|
||||
while (TRUE) {
|
||||
if (m_start) {
|
||||
GetMsg(NULL,NULL,1<<MSG_KEY_UP);
|
||||
m_end=tS;
|
||||
Snd(0);
|
||||
dt_down=m_end-m_start;
|
||||
m_start=0;
|
||||
space_sent=FALSE;
|
||||
if (dt_down<M_DASH_THRESHOLD)
|
||||
return '.';
|
||||
else
|
||||
return '-';
|
||||
} else {
|
||||
if (!space_sent) {
|
||||
while (!ScanMsg(&ch,NULL,1<<MSG_KEY_DOWN)) {
|
||||
dt=tS-m_end;
|
||||
if (dt>=M_SPACE_THRESHOLD) {
|
||||
space_sent=TRUE;
|
||||
return CH_SPACE;
|
||||
}
|
||||
Yield;
|
||||
}
|
||||
} else
|
||||
ch=GetChar(,FALSE);
|
||||
m_start=tS;
|
||||
Snd(1000);
|
||||
if (ch==CH_SHIFT_ESC || ch==CH_ESC) {
|
||||
NewLine;
|
||||
Snd(0);
|
||||
ThrowBreak; //exit program
|
||||
}
|
||||
dt_up=m_start-m_end;
|
||||
if (!space_sent && dt_up>=M_SPACE_THRESHOLD) {
|
||||
space_sent=TRUE;
|
||||
return CH_SPACE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
U0 Morse()
|
||||
{
|
||||
Bool old_preempt;
|
||||
CDocEntry *doc_e;
|
||||
I64 ch;
|
||||
U8 buf[8],*dst,*src;
|
||||
|
||||
MorseTable;
|
||||
m_start=0;
|
||||
m_end=tS;
|
||||
dt_down=0;
|
||||
dt_up=0;
|
||||
space_sent=TRUE;
|
||||
|
||||
"$$GREEN$$";
|
||||
|
||||
//We don't want the tag call back
|
||||
//called before we set it, so preempt off.
|
||||
old_preempt=Preempt(OFF);
|
||||
doc_e=DocPrint(DocPut,"$$TX+TC,\" \"$$");
|
||||
doc_e->tag_cb=&MorseTimes;
|
||||
Preempt(old_preempt);
|
||||
|
||||
"$$FG$$\n";
|
||||
|
||||
dst=buf;
|
||||
while (TRUE) {
|
||||
ch=MorseWaitKey;
|
||||
if (ch==CH_SPACE) {
|
||||
*dst=0;
|
||||
src=morse_lst;
|
||||
while (*src) {
|
||||
if (!StrCmp(src+1,buf)) {
|
||||
"$$GREEN$$%C$$FG$$",*src;
|
||||
break;
|
||||
} else
|
||||
src+=StrLen(src)+1;
|
||||
}
|
||||
'' CH_SPACE;
|
||||
dst=buf;
|
||||
} else {
|
||||
if (dst-buf<sizeof(buf)-1) {
|
||||
'' ch;
|
||||
*dst++=ch;
|
||||
}
|
||||
}
|
||||
}
|
||||
Snd(0);
|
||||
}
|
||||
|
||||
Morse;
|
||||
@@ -0,0 +1,41 @@
|
||||
U0 Song()
|
||||
{ //Song by Terry A. Davis
|
||||
Fs->task_end_cb=&SndTaskEndCB;
|
||||
MusicSettingsRst;
|
||||
try //Catch <CTRL-ALT-C> exit
|
||||
while (!ScanChar) {
|
||||
Play("4hEqDCBCDhE",
|
||||
"God \0is \0a \0g\0od \0of \0love.\n\0");
|
||||
Play("3GqFEFhG4E",
|
||||
" \0 \0 \0 \0 \0He \0");
|
||||
Play("qDCBCDhE3G",
|
||||
"wat\0ches \0us \0from \0a\0bove.\n\0 \0");
|
||||
Play("qFEFhG4BqC",
|
||||
" \0 \0 \0 \0Our \0world \0");
|
||||
Play("DhCeDChB3G",
|
||||
"is\0n't \0al\0ways \0nice.\n\0 \0");
|
||||
Play("qFEFhG4EqD",
|
||||
" \0 \0 \0 \0Be\0fore \0");
|
||||
Play("CBCDhE3G",
|
||||
"you \0gr\0ipe \0think \0twice.\n\0 \0");
|
||||
Play("qFEFhG4EqD",
|
||||
" \0 \0 \0 \0He \0wat\0");
|
||||
Play("CBCDhE3G",
|
||||
"ches \0us \0from \0a\0bove.\n\0 \0");
|
||||
Play("qFEFhG4EqD",
|
||||
" \0 \0 \0 \0He'll \0smack \0");
|
||||
Play("CBCDhE3G",
|
||||
"you \0with \0out \0a \0glove.\n\0 \0");
|
||||
Play("qFEFhG4BqC",
|
||||
" \0 \0 \0 \0Our \0world \0");
|
||||
Play("DhCeDChB3G",
|
||||
"is\0n't \0al\0ways \0nice.\n\0 \0");
|
||||
Play("qFEFhG");
|
||||
}
|
||||
catch
|
||||
PutExcept;
|
||||
NewLine;
|
||||
Snd(0);
|
||||
}
|
||||
|
||||
Song;
|
||||
Binary file not shown.
Reference in new issue
Block a user