LTCD_070816.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:45:20 +02:00
1 parent d14bbc24f9
commit 0e9364ff4c
506 files changed
+157705 -41812

No files matched your search

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,23 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("3sFGFGetBFFDARqEC2G3FC");
Play("sFGFGetBFFDARqEC2G3FC");
Play("2eG3GetDB2G3qFDAReECsCRCR");
Play("2eG3GetDB2G3qFDAReECsCRCR");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
+36
View File
@@ -0,0 +1,36 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
TssStruct *tss;
Fs->end_task_cb=&EndTsk;
tss=PopUpViewStr(
"$$LK-A,\"BF:Acts,9:3\"$$\r\n"
);
WaitTskIdle(tss);
tss->win_right=Fs->win_right;
tss->win_left=Fs->win_left;
tss->win_top=Fs->win_bottom+3;
tss->win_bottom=tss->win_top+12;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("3qEeACA2G3qCEC2G3E",
"Now... \0 \0 \0 \0 \0I \0see \0the \0light.\r\n\0 \0");
Play("EeACA2G3qCEC2G3E",
"Now... \0 \0 \0 \0 \0I \0see \0the \0light.\r\n\0 \0");
Play("GCGBEeDFCAqD",
"It's \0 \0quite \0 \0bright.\r\n\0 \0 \0 \0 \0 \0");
Play("GCGBEeDFCAqD",
"It's \0 \0quite \0 \0bright.\r\n\0 \0 \0 \0 \0 \0");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
Binary file not shown.
Binary file not shown.
+36
View File
@@ -0,0 +1,36 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
TssStruct *tss;
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
tss=PopUpViewStr(
"$$LK-A,\"BF:Luke,12:16\"$$\r\n"
);
WaitTskIdle(tss);
tss->win_right=Fs->win_right;
tss->win_left=Fs->win_left;
tss->win_top=Fs->win_bottom+3;
tss->win_bottom=tss->win_top+12;
while (!ScanKey) {
Play("3etGREqDDBRGCB",
"It \0 \0de\0pends \0 \0on \0 \0the \0wea\0ther.\r\n\0");
Play("etGREqDDBRGCB",
"If \0 \0we \0reach \0 \0the \0 \0end \0ev\0er.\r\n\0");
Play("2sG3E2G3EqGsGBGBqDsFCFCqBRsCBCB",
"Hand \0 \0of \0 \0God, \0 \0just \0 \0might, \0 \0in\0 \0ter\0 \0cedes.\r\n\0 \0 \0 \0 \0 \0");
Play("2G3E2G3EqGsGBGBqDsFCFCqBRsCBCB",
"If \0 \0it's \0 \0not \0 \0deemed \0 \0right, \0 \0won't \0 \0suc\0 \0ceed.\r\n\0 \0 \0 \0 \0 \0");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
@@ -0,0 +1,20 @@
//star
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
while (TRUE) {
Play("etCCBetGGDetBBFeGCetBABeAAqEqF");
Play("etCCBetGGDetBBFeGCetBABeAAqEqF");
Play("eCGqFqDqDqCeDGqCqB");
Play("eCGqFqDqDqCeDGqCqB");
}
}
Song;
+22
View File
@@ -0,0 +1,22 @@
//has words,star,star
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
while (TRUE) {
Play("et2G32G3Gq2G3qCq2G3sFAFAq2G3etGDAqA",
"Don't \0 \0need \0 \0help. \0 \0Got \0 \0it \0 \0all \0figured \0 \0 \0out.\r\n\0");
Play("et2G32G3Gq2G3qCq2G3sFAFAq2G3etGDAqA",
"Don't \0 \0need \0 \0help. \0 \0Got \0 \0it \0 \0all \0figured \0 \0 \0out.\r\n\0");
Play("etCCCq2G3qDeDFetCF2G3qBeGFsAGAG");
Play("etCCCq2G3qDeDFetCF2G3qBeGFsAGAG");
}
}
Song;
Binary file not shown.
Binary file not shown.
Binary file not shown.
+41
View File
@@ -0,0 +1,41 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
TssStruct *tss;
Fs->end_task_cb=&EndTsk;
tss=PopUpViewStr(
"$$LK-A,\"BF:Luke,7:42\"$$\r\n"
"\r\n"
"Prodigal Son\r\n"
"$$LK-A,\"BF:Luke,15:21\"$$\r\n"
);
WaitTskIdle(tss);
tss->win_right=Fs->win_right;
tss->win_left=Fs->win_left;
tss->win_top=Fs->win_bottom+3;
tss->win_bottom=tss->win_top+12;
music_tempo=2.5;
try {
PutS("$$WW+H,1$$");
while (!ScanKey) {
Play("3qGGsEAEAqAsF2G3F2G3qCeEFqD",
"Life, \0life, \0isn't \0 \0 \0 \0fair. \0Isn't \0 \0 \0 \0fair.\r\n\0 \0 \0 \0");
Play("GGsEAEAqAsF2G3F2G3qCeEFqD",
"Life, \0life, \0isn't \0 \0 \0 \0fair. \0Isn't \0 \0 \0 \0fair.\r\n\0 \0 \0 \0");
Play("eFCqEBDBE2eG3EsFEFE",
" \0 \0I \0 \0ne\0ver \0sin.\r\n\0 \0 \0 \0 \0 \0 \0");
Play("eFCqEBDBE2eG3EsFEFE",
" \0 \0I \0 \0ne\0ver \0win.\r\n\0 \0 \0 \0 \0 \0 \0");
PutS("$$FG,GREEN$$(A warning on presumption. 'Who loves more man -- forgiven big debt or little?' See prodigal son.)$$FG$$\r\n");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
+38
View File
@@ -0,0 +1,38 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
TssStruct *tss;
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
tss=PopUpViewStr(
"$$LK-A,\"BF:Matthew,4:19\"$$\r\n"
"$$LK-A,\"BF:Luke,5:4\"$$\r\n"
);
WaitTskIdle(tss);
tss->win_right=Fs->win_right;
tss->win_left=Fs->win_left;
tss->win_top=Fs->win_bottom+3;
tss->win_bottom=tss->win_top+12;
while (!ScanKey) {
Play("3qEsGEGEeF2G3BCqCeDEqBsERER",
"$$FG$$Lord, \0I \0 \0am \0 \0feel\0ing \0just \0a \0bit \0un\0in\0spired.\r\n\0With \0 \0 \0 \0");
Play("qEsGEGEeF2G3BCqCeDEqBsERER",
"net \0or \0 \0with \0 \0reel\0ing \0 \0I \0keep \0get\0ting \0mired.\r\n\0 \0 \0 \0 \0");
Play("qDetRAFqDGetFC2G3sBCBCqDF",
"$$FG,PURPLE$$Throw \0 \0out \0your \0net.\r\n\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
Play("DetRAFqDGetFC2G3sBCBCqDF",
"Make \0 \0you \0a \0bet.\r\n\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
+20
View File
@@ -0,0 +1,20 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("eGFqCqAqCqAetFDBetDBGeAFeGFqCqAqCqAetFDBetDBGeAFsDEDEetAGEsARARqDsARARqAetRFEqBsDEDEetAGEsARARqDsARARqAetRFEqB");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
+20
View File
@@ -0,0 +1,20 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("eEEeGGeRReRCetABCeEDsABABe2G3GeEEeGGeRReRCetABCeEDsABABe2G3GqRqFetFFDeCRqEeFCqFet2G3RFqRqFetFFDeCRqEeFCqFet2G3RF");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("3qFeRRqAeRAqGDetBACeCB",
"God \0 \0 \0is \0 \0a \0good \0God. \0(Thank \0 \0 \0God!!)\r\n\0 \0");
Play("qFeRRqAeRAqGDetBACeCB",
"God \0 \0 \0is \0 \0a \0good \0God. \0(Thank \0 \0 \0God!!)\r\n\0 \0");
Play("qGsCECEeC2GqR3FeEDqEF",
" \0 \0 \0 \0 \0 \0 \0 \0He \0is \0a \0good \0God.\r\n\0");
Play("GsCECEeC2GqR3FeEDqEF",
" \0 \0 \0 \0 \0 \0 \0 \0He \0is \0a \0good \0God.\r\n\0");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
+27
View File
@@ -0,0 +1,27 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("3eGCBEqDAEetFECqED",
"Do \0an \0act \0of \0kind\0ness.\r\n\0 \0 \0 \0 \0 \0 \0");
Play("eGCBEqDAEetFECqED",
"Do \0an \0act \0of \0kind\0ness.\r\n\0 \0 \0 \0 \0 \0 \0");
Play("GFEEeAAqDFF",
" \0 \0 \0 \0Hold \0 \0a \0hand.\r\n\0 \0");
Play("GFEEeAAqDFF",
" \0 \0 \0 \0Hold \0 \0a \0hand.\r\n\0 \0");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("3qGGGGsGGGGetFFFeEFsGGGG",
"I've \0been \0pat\0ient; \0Grant \0 \0 \0 \0me \0 \0 \0jus\0 \0tice.\r\n\0 \0 \0 \0");
Play("qGGGGsGGGGetFFFeEFsGGGG",
"Not \0comp\0lan\0cient; \0You \0 \0 \0 \0are \0 \0 \0whit\0 \0ness.\r\n\0 \0 \0 \0");
Play("BBBBeCCqDDA2G3etAAAqB",
"All \0 \0 \0 \0my \0 \0foes \0 \0re\0joice \0o\0ver \0 \0me.\r\n\0");
Play("sBBBBeCCqDDA2G3etAAAqB",
"See \0 \0 \0 \0their \0 \0throes; \0 \0Now, \0it's \0they \0that \0are \0stoned.\r\n\0");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
+37
View File
@@ -0,0 +1,37 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
TssStruct *tss;
Fs->end_task_cb=&EndTsk;
try {
tss=PopUpViewStr(
"$$LK-A,\"BF:Matthew,19:16\"$$\r\n"
);
WaitTskIdle(tss);
tss->win_right=Fs->win_right;
tss->win_left=Fs->win_left;
tss->win_top=Fs->win_bottom+3;
tss->win_bottom=tss->win_top+12;
PutS("$$WW+H,1$$");
while (!ScanKey) {
Play("3eGAetCCCFFDqAeAAFAAFqG",
"I \0 \0have \0 \0 \0kept \0 \0 \0 \0 \0 \0the \0 \0 \0com\0mands.\r\n\0");
Play("eGAetCCCFFDqAeAAFAAFqG",
"I \0 \0have \0 \0 \0kept \0 \0 \0 \0 \0 \0the \0 \0 \0com\0mands.\r\n\0");
Play("EeEGqEeEEqDBetCCGqC",
"What \0 \0 \0else \0 \0 \0must \0I \0do?\r\n\0 \0 \0 \0");
Play("EeEGqEeEEqDBetCCGqC",
"What \0 \0 \0else \0 \0 \0must \0I \0do?\r\n\0 \0 \0 \0");
PutS("$$FG,GREEN$$(Christ said sell all and follow me.)\r\n$$FG$$");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
+20
View File
@@ -0,0 +1,20 @@
//star
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
while (TRUE) {
Play("qCqFeDEetDCCetCCCqDqAqC");
Play("qCqFeDEetDCCetCCCqDqAqC");
Play("qFqEetFAFqAqDeGAqEeBC");
Play("qFqEetFAFqAqDeGAqEeBC");
}
}
Song;
+38
View File
@@ -0,0 +1,38 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
TssStruct *tss;
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
tss=PopUpViewStr(
"$$LK-A,\"BF:John,16:28\"$$\r\n"
);
WaitTskIdle(tss);
tss->win_right=Fs->win_right;
tss->win_left=Fs->win_left;
tss->win_top=Fs->win_bottom+3;
tss->win_bottom=tss->win_top+12;
PutS("$$WW+H,1$$");
while (!ScanKey) {
Play("3qBBDsDGDGqFeFAFAqB",
"Now, \0I \0go \0 \0 \0 \0 \0to \0the \0 \0Fa\0th\0er.\r\n\0");
Play("BBDsDGDGqFeFAFAqB",
"Now, \0I \0go \0 \0 \0 \0 \0to \0the \0 \0Fa\0th\0er.\r\n\0");
Play("EDetBEA2eG3CsECECqGDeDD",
"Don't \0worry. \0 \0 \0 \0 \0 \0I'll \0 \0 \0 \0be \0back.\r\n\0 \0 \0");
Play("qEDetBEA2eG3CsECECqGDeDD",
"Don't \0worry. \0 \0 \0 \0 \0 \0I'll \0 \0 \0 \0be \0back.\r\n\0 \0 \0");
PutS("$$FG,GREEN$$(Christ promised to return.)\r\n$$FG$$");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
+37
View File
@@ -0,0 +1,37 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("3qBDAGFFeBAsD2G3D2G",
"Do \0not \0push \0your \0luck.\r\n\0 \0 \0 \0 \0 \0 \0 \0");
Play("3qBDAGFFeBAsD2G3D2G",
"Do \0not \0push \0your \0luck.\r\n\0 \0 \0 \0 \0 \0 \0 \0");
Play("3qGFCeCGqFetAAFqEF",
"God \0is \0not \0 \0a \0schmuck.\r\n\0 \0 \0 \0 \0 \0");
Play("GFCeCGqFetAAFqEF",
"God \0is \0not \0 \0a \0schmuck.\r\n\0 \0 \0 \0 \0 \0");
Play("3qBDAGFFeBAsD2G3D2G",
"\r\nDo \0not \0tell \0the \0Lord\r\n\0 \0 \0 \0 \0 \0 \0 \0");
Play("3qBDAGFFeBAsD2G3D2G",
"that \0you're \0feel\0ing \0bored.\r\n\0 \0 \0 \0 \0 \0 \0 \0");
Play("3qGFCeCGqFetAAFqEF",
"He \0will \0send \0 \0the \0sword.\r\n\0 \0 \0 \0 \0 \0");
Play("GFCeCGqFetAAFqEF",
"He \0will \0send \0 \0the \0sword.\r\n\r\n\0 \0 \0 \0 \0 \0");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
+24
View File
@@ -0,0 +1,24 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
music_stacatto_factor=0.8;
try {
while (!ScanKey) {
Play("3eEEqCGGeGBDGEBsG2G3G2G");
Play("3eEEqCGGeGBDGEBsG2G3G2G");
Play("3qFDetB2GGsGGGG3eEEetBEGqGeDA");
Play("qFDetB2GGsGGGG3eEEetBEGqGeDA");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
+28
View File
@@ -0,0 +1,28 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("3qBeGDetCBCqGAeGCqDC",
" \0I \0 \0don't \0 \0 \0mind, \0 \0 \0 \0you \0de\0");
Play("BeGDetCBCqGAeGCqDC",
"cide.\r\n\0I \0 \0don't \0 \0 \0mind.\r\n\0 \0 \0 \0 \0 \0");
Play("etDFGqEeDGqFEetDFFqBetBDB",
"I \0trust \0God \0 \0 \0 \0to \0 \0look-out \0for \0me.\r\n\0 \0 \0 \0 \0");
Play("DFGqEeDGqFEetDFFqBetBDB",
"I \0trust \0God \0 \0 \0 \0to \0 \0look-out \0for \0me.\r\n\0 \0 \0 \0 \0");
Play("qC");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
+36
View File
@@ -0,0 +1,36 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
TssStruct *tss;
tss=PopUpViewStr(
"$$LK-A,\"BF:Mark,4:37\"$$\r\n"
);
WaitTskIdle(tss);
tss->win_right=Fs->win_right;
tss->win_left=Fs->win_left;
tss->win_top=Fs->win_bottom+3;
tss->win_bottom=tss->win_top+12;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("3qEsGEGEqDsCCCCqBsDEDEqFG",
"Lord, \0there's \0 \0a \0 \0storm \0u\0 \0 \0 \0pon \0the \0 \0 \0 \0sea.\r\n\0 \0");
Play("EsGEGEqDsCCCCqBsDEDEqFG",
"Lord, \0there's \0 \0a \0 \0storm \0u\0 \0 \0 \0pon \0the \0 \0 \0 \0sea.\r\n\0 \0");
Play("GEC2G3etB2G3FGGEDBBeBE",
"$$FG,PURPLE$$Re\0lax \0fel\0las.$$FG$$\r\n\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
Play("qGEC2G3etB2G3FGGEDBBeBE",
"$$FG,GREEN$$(Sea \0be\0came \0glass.)$$FG$$\r\n\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
+36
View File
@@ -0,0 +1,36 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
TssStruct *tss;
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
tss=PopUpViewStr(
"$$LK-A,\"BF:Matthew,14:19\"$$\r\n"
);
WaitTskIdle(tss);
tss->win_right=Fs->win_right;
tss->win_left=Fs->win_left;
tss->win_top=Fs->win_bottom+3;
tss->win_bottom=tss->win_top+12;
try {
while (!ScanKey) {
Play("3etGCECAFqFFAFBD",
"We \0 \0don't \0 \0have \0e\0nough.\r\n\0 \0 \0 \0 \0 \0");
Play("etGCECAFqFFAFBD",
"$$FG,PURPLE$$You \0 \0don't \0 \0halve \0e\0nough.\r\n\0 \0 \0 \0 \0 \0");
Play("AeGFGDqEAeCEGAetFAF",
" \0Try \0 \0 \0 \0to \0share.\r\n\0 \0 \0 \0 \0 \0 \0 \0");
Play("qAeGFGDqEAeCEGAetFAF",
" \0Try \0 \0 \0 \0to \0share.$$FG$$\r\n\0 \0 \0 \0 \0 \0 \0 \0");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+22
View File
@@ -0,0 +1,22 @@
//has words,star,star,star
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
while (TRUE) {
Play("qCqAqAsEDEDqBqBetGGEs2G3C2G3C");
Play("qCqAqAsEDEDqBqBetGGEs2G3C2G3C");
Play("etCD2G3etEE2G3qFqFqAsACACsAFAFetECC",
"In \0my \0 \0corn\0 \0 \0er? \0 \0 \0 \0 \0 \0 \0Hope \0we're \0right.\r\n\0");
Play("etCD2G3etEE2G3qFqFqAsACACsAFAFetECC",
"In \0my \0 \0corn\0 \0 \0er? \0 \0 \0 \0 \0 \0 \0Hope \0we're \0right.\r\n\0");
}
}
Song;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("3qB2G3DsBABABDBDqDeAD2sG3A2G3A",
"All \0seeing \0eye.\r\n\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
Play("qB2G3DsBABABDBDqDeAD2sG3A2G3A",
"It's \0no \0lie.\r\n\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
Play("qEGC2sG3B2G3B2G3B2G3BqDetBGAsGGGG",
"God \0sees \0you.\r\n\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
Play("qEGC2sG3B2G3B2G3B2G3BqDetBGAsGGGG",
"Yes, \0it's \0true.\r\n\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
+29
View File
@@ -0,0 +1,29 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
PutS("$$WW+H,1$$");
while (!ScanKey) {
Play("qR3eG2G3qDsCCCCqDeCCetDDBsR2GRG",
" \0Be\0ing \0rid \0of \0 \0 \0 \0sin \0is \0a \0bit\0ter \0 \0 \0pill.\r\n\0 \0 \0");
Play("qR3eG2G3qDsCCCCqDeCCetDDBsR2GRG",
" \0Be\0ing \0rid \0of \0 \0 \0 \0sin \0is \0a \0bit\0ter \0 \0 \0pill.\r\n\0 \0 \0");
Play("3eCDqFAAeA2G3etA2G3AeCCAR",
" \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
Play("CDqFAAeA2G3etA2G3AeCCAR");
PutS("$$FG,GREEN$$(This isn't a riddle, oddly enough.)$$FG$$\r\n");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+36
View File
@@ -0,0 +1,36 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
TssStruct *tss;
tss=PopUpViewStr(
"$$LK-A,\"BF:Matthew,25:15\"$$"
);
WaitTskIdle(tss);
tss->win_right=Fs->win_right;
tss->win_left=Fs->win_left;
tss->win_top=Fs->win_bottom+3;
tss->win_bottom=tss->win_top+12;
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("3qDetBAReGEqCCA2G3etFAC",
"Ma\0as\0ter! \0 \0I \0made \0more \0for \0you.\r\n\0 \0 \0 \0 \0");
Play("qDetBAReGEqCCA2G3etFAC",
"Ma\0as\0ter! \0 \0I \0made \0more \0for \0you!\r\n\0 \0 \0 \0 \0");
Play("eCB2qG3EFFG2G3etCFG",
" \0 \0 \0Got \0some\0thing \0else?\r\n\0 \0 \0 \0 \0");
Play("eCB2qG3EFFG2G3etCFG",
" \0 \0 \0Got \0some\0thing \0else?\r\n\0 \0 \0 \0 \0");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
+21
View File
@@ -0,0 +1,21 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
while (TRUE) {
Play("qGsCECEsGAGAsEBEBqFeFFeDEqF",
"Shout! \0 \0 \0Let \0 \0your \0 \0voice \0 \0be \0 \0heard.\r\n\0");
Play("qGsCECEsGAGAsEBEBqFeFFeDEqF",
"Shout! \0 \0 \0Let \0 \0your \0 \0voice \0 \0be \0 \0heard.\r\n\0");
Play("e2G3CetDAAetFBEsD2G3D2G3qDqCetBEEsAFAF");
Play("e2G3CetDAAetFBEsD2G3D2G3qDqCetBEEsAFAF");
}
}
Song;
Binary file not shown.
+25
View File
@@ -0,0 +1,25 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("3eDRetAAAsBCBCeEGqF2GsG3B2G3BeDF",
"Good! \0 \0Now, \0 \0 \0I \0 \0don't \0 \0have \0to \0wor\0ry.\r\n\0 \0 \0 \0 \0 \0 \0");
Play("DRetAAAsBCBCeEGqF2GsG3B2G3BeDF",
"Good! \0 \0Now, \0 \0 \0I \0 \0don't \0 \0have \0to \0wor\0ry.\r\n\0 \0 \0 \0 \0 \0 \0");
Play("qFRAetACEqEG2G3sBRBR");
Play("qFRAetACEqEG2G3sBRBR");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
+23
View File
@@ -0,0 +1,23 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
while (TRUE) {
Play("qAqBqFqFqDeEGeFDeDE",
"Show \0some \0love.\r\n\0");
Play("qAqBqFqFqDeEGeFDeDE",
"Show \0some \0love.\r\n\0");
Play("eABeFAqFeFDetDBBqGeCGqA",
"As \0 \0you \0 \0mea\0 \0sure \0 \0 \0out...\r\n\0");
Play("eABeFAqFeFDetDBBqGeCGqA",
"As \0 \0you \0 \0mea\0 \0sure \0 \0 \0out...\r\n\0");
}
}
Song;
+27
View File
@@ -0,0 +1,27 @@
void EndTsk()
{
Sound(0);
Exit;
}
void Song()
{
Fs->end_task_cb=&EndTsk;
music_tempo=2.5;
try {
while (!ScanKey) {
Play("3sFGFGetDCFqD2G3DGDetDFB",
"God, \0 \0 \0 \0please \0 \0 \0help \0me.\r\n\0 \0 \0 \0 \0 \0 \0");
Play("sFGFGetDCFqD2G3DGDetDFB",
"God, \0 \0 \0 \0please \0 \0 \0help \0me.\r\n\0 \0 \0 \0 \0 \0 \0");
Play("qACADetF2G3B2sG3F2G3FetCDFsDFDF",
"Thy \0will \0be \0done.\r\n\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
Play("qACADetF2G3B2sG3F2G3FetCDFsDFDF",
"Thy \0will \0be \0done.\r\n\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
}
} catch
Fs->catch_except=TRUE;
Sound(0);
}
Song;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+73
View File
@@ -0,0 +1,73 @@
void InsertNote(I1 *buf,U4 k,U4 *j)
{
if (k==0) {
buf[*j]='2';
*j=*j+1;
buf[*j]='G';
*j=*j+1;
buf[*j]='3';
*j=*j+1;
} else if (k==8) {
buf[*j]='R';
*j=*j+1;
} else {
buf[*j]=k-1+'A';
*j=*j+1;
}
}
I1 *MakeSong()
{
I1 *buf=MAllocZ(256),
buf2[256];
U4 i,j=0,k,n,k2;
for (i=0;i<8;i++) {
SPrintF(buf2,"Picks Left:%d",8-i);
k=RandU4;
n=k/9;
k=k%9;
switch (n%6) {
case 0:
buf[j++]='e';
InsertNote(buf,k,&j);
SPrintF(buf2,"Picks Left:%d:1",8-i);
k=RandU4;
k=k%9;
InsertNote(buf,k,&j);
break;
case 1:
buf[j++]='e';
buf[j++]='t';
InsertNote(buf,k,&j);
SPrintF(buf2,"Picks Left:%d:2",8-i);
k=RandU4;
k=k%9;
InsertNote(buf,k,&j);
SPrintF(buf2,"Picks Left:%d:1",8-i);
k=RandU4;
k=k%9;
InsertNote(buf,k,&j);
break;
case 2:
buf[j++]='s';
InsertNote(buf,k,&j);
k2=k;
SPrintF(buf2,"Picks Left:%d:1",8-i);
k=RandU4;
k=k%9;
InsertNote(buf,k,&j);
InsertNote(buf,k2,&j);
InsertNote(buf,k,&j);
break;
default:
buf[j++]='q';
InsertNote(buf,k,&j);
break;
}
}
buf[j++]=0;
return buf;
}
+992
View File
@@ -0,0 +1,992 @@
class OrgNote
{
OrgNote *next,*last;
I1 note,octive,duration;
I1 ascii[9];
I1 *word;
};
class OrgCtrl
{
OrgNote root;
BoolU4 record_on;
I8 screen_x;
OrgNote *cur_note,*insert_point;
void old_update(TssStruct *tss);
};
I1 *org_note_list="A\0A#\0B\0C\0C#\0D\0D#\0E\0F\0F#\0G\0G#\0\0";
I1 org_note_map[12]={6,6,5,4,4,3,3,2,1,1,0,0};
I1 org_note_inverse_map[7]={10,8,7,5,3,2,0};
$PI,"<PI2>",2$
$PI,"<PI3>",3$
$PI,"<PI4>",4$
$PI,"<PI5>",5$
$PI,"<PI6>",6$
$PI,"<PI7>",7$
$PI,"<PI8>",8$
$PI,"<PI9>",9$
$PI,"<PI11>",11$
$PI,"<PI18>",18$
$PI,"<PI19>",19$
$PI,"<PI20>",20$
$PI,"<PI21>",21$
#define ORG_NOTE_SPACING 9
#define ORG_NUM_DURATIONS 8
double org_durations[ORG_NUM_DURATIONS+1]={2*.25/3,.25,2*.5/3,.5,2.0/3.0,1.0,2.0,4.0,1000000.0};
I1 *org_duration_list="st\0s\0et\0e\0qt\0q\0h\0w\0\0";
U1 *org_duration_PI_map[ORG_NUM_DURATIONS]={$IB,"<IB7>",7$,$IB,"<IB2>",2$,$IB,"<IB8>",8$,
$IB,"<IB3>",3$,$IB,"<IB9>",9$,$IB,"<IB4>",4$,
$IB,"<IB5>",5$,$IB,"<IB6>",6$};
void DrawIt(TssStruct *tss)
{
OrgCtrl *oc=tss->user_data0;
OrgNote *tempo;
I8 i,y;
I8 w=tss->win_pixel_right-tss->win_pixel_left;
I8 h=tss->win_pixel_bottom-tss->win_pixel_top;
GrBitMap *base=GrAlias(grbase2,tss);
ClearWinText(tss);
base->color=BLACK;
for (i=1;i<6;i++)
GrLine(base,0,i*8,w,i*8);
for (i=7;i<12;i++)
GrLine(base,0,i*8,w,i*8);
i=0;
tempo=oc->root.next;
while (tempo!=&oc->root) {
if (tempo==oc->cur_note)
base->color=GREEN;
else {
if (tempo->octive)
base->color=BLACK;
else
base->color=DKGRAY;
if (tempo->word)
if (StrCmp(tempo->word," "))
base->color=RED;
}
if (tempo->octive)
y=(15+(org_note_map[tempo->note]-7*(tempo->octive-3)))*4;
else
y=50;
base->bkcolor=WHITE;
GrElemsPlot(base,8+i*ORG_NOTE_SPACING-oc->screen_x,y,0,
org_duration_PI_map[tempo->duration]);
tempo=tempo->next;
i++;
}
GrDel(base);
oc->old_update(tss);
}
OrgNote *OrgFindNote(I8 x,I8 y)
{
OrgCtrl *oc=Fs->user_data0;
OrgNote *tempo=oc->root.next;
I8 i=(x+oc->screen_x-8+ORG_NOTE_SPACING/2)/ORG_NOTE_SPACING;
nounusedwarn y;
while (i-- && tempo!=&oc->root)
tempo=tempo->next;
if (tempo==&oc->root)
tempo=NULL;
return tempo;
}
#define ORGR_REST -5
#define ORGR_INSERT_NOTE -4
#define ORGR_DELETE_NOTE -3
#define ORGR_SET_WORD -2
double PopUpDuration()
{
I8 i;
Ltf *l=LtfNew;
LtfPrintF(l,"$$MU,\"Set Word\" %d$$\r\n",ORGR_SET_WORD);
LtfPrintF(l,"$$MU,\"Make Rest\" %d$$\r\n",ORGR_REST);
LtfPrintF(l,"$$MU,\"Insert Note\" %d$$\r\n",ORGR_INSERT_NOTE);
LtfPrintF(l,"$$MU,\"Delete Note\" %d$$\r\n\r\n",ORGR_DELETE_NOTE);
for (i=0;i<ORG_NUM_DURATIONS;i++)
LtfPrintF(l,"$$MU,\"%7.5f\" %d$$\r\n",org_durations[i],i);
i=PopUpMenu(l);
LtfDel(l);
return i;
}
void OrgRightClick(I8 x,I8 y)
{
OrgCtrl *oc=Fs->user_data0;
I1 *st,*st2;
OrgNote *tempo=OrgFindNote(x,y),*tempo1;
I8 i;
U8 old_ltf_flags=Fs->cur_ltf->flags;
oc->insert_point=tempo;
oc->cur_note=tempo;
if (tempo) {
Btr(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK);
ip_inhibit_win_operations=FALSE;
i=PopUpDuration;
if (i>=0 && i<ORG_NUM_DURATIONS)
tempo->duration=i;
else {
switch (i) {
case ORGR_REST:
tempo->octive=0;
tempo->note=0;
break;
case ORGR_SET_WORD:
Fs->cur_ltf->flags&=~LTFF_FORM;
if (tempo->word)
st2=MSPrintF("\r\nWord(\"%Q\"):",tempo->word);
else
st2=MSPrintF("\r\nWord(\"\"):");
LtfBottom(Fs->cur_ltf);
st=PmtStr(st2);
Free(st2);
Free(tempo->word);
if (*st) {
tempo->word=MSPrintF("%q",st);
Free(st);
} else
tempo->word=NewStr(" ");
Fs->cur_ltf->flags=old_ltf_flags;
break;
case ORGR_INSERT_NOTE:
tempo1=MAllocIdentical(tempo);
tempo1->word=NewStr(tempo->word);
InsQue(tempo1,tempo);
break;
case ORGR_DELETE_NOTE:
oc->insert_point=tempo->next;
oc->cur_note=oc->insert_point;
RemQue(tempo);
Free(tempo->word);
Free(tempo);
break;
}
}
ip_inhibit_win_operations=TRUE;
Bts(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK);
}
}
void OrgLeftClick(I8 x,I8 y)
{
OrgCtrl *oc=Fs->user_data0;
OrgNote *tempo=OrgFindNote(x,y);
I8 o,n,cmd,p1,p2;
oc->insert_point=tempo;
oc->cur_note=tempo;
if (tempo) {
do {
cmd=GetMsg(&p1,&p2,1<<MSG_IP_L_UP|1<<MSG_IP_MOVE|1<<MSG_IP_R_UP);
if (cmd==MSG_IP_R_UP)
OrgRightClick(p1,p2);
else {
p2=p2/4-15;
n=-p2%7;
o=3+p2/-7;
n=-n;
if (n<0) {
n+=7;
o++;
}
n=org_note_inverse_map[n];
tempo->note=n;
tempo->octive=o;
}
} while (cmd!=MSG_IP_L_UP);
}
}
void OrgPlayEnd()
{
Sound(0);
Exit;
}
#define ORGPM_NORMAL 0
#define ORGPM_REVERB1 1
#define ORGPM_NUM_PLAY_MODES 2
U8 org_play_mode=0;
double org_play_f=0;
void OrgPlayTsk()
{
BoolU4 going_up=TRUE;
U8 i=0;
double f=0,f2=0;
Fs->end_task_cb=&OrgPlayEnd;
while (TRUE) {
i++;
switch (org_play_mode) {
case ORGPM_NORMAL:
if (org_play_f!=f) {
f=org_play_f;
Sound(f);
}
break;
case ORGPM_REVERB1:
if (org_play_f!=f) {
if (f>0)
f2=f;
f=org_play_f;
}
if (!(i&15)) {
if (i&16)
Sound(f);
else
Sound(f2);
}
break;
}
Sleep(1);
}
}
U1 OrgCvtDuration(double d)
{
double d1,d2;
I8 j;
for (j=0;j<ORG_NUM_DURATIONS;j++) {
d1=org_durations[j];
d2=org_durations[j+1];
if (d<d1*d2/(d1+d2))
return j;
}
return 0;
}
I1 *OrgMusicSetOctive(I1 *st,U8 *org_octive)
{
I1 ch=*st++;
while (ch>='0' && ch<='9') {
*org_octive=ch-'0';
ch=*st++;
}
return --st;
}
I1 *OrgMusicSetNoteLen(I1 *st,double *org_duration)
{
BoolU4 cont=TRUE;
do {
switch (*st++) {
case 'w': *org_duration=4.0; break;
case 'h': *org_duration=2.0; break;
case 'q': *org_duration=1.0; break;
case 'e': *org_duration=0.5; break;
case 's': *org_duration=0.25; break;
case 't': *org_duration=2.0* *org_duration/3.0; break;
case '.': *org_duration=1.5* *org_duration; break;
default:
st--;
cont=FALSE;
}
} while (cont);
return st;
}
void OrgLoadSongStr(I1 *st,U8 *org_octive,double *org_duration)
{
OrgCtrl *oc=Fs->user_data0;
OrgNote *tempo;
U8 note,i=0;
while (*st) {
tempo=MAllocZ(sizeof(OrgNote));
st=OrgMusicSetOctive(st,org_octive);
st=OrgMusicSetNoteLen(st,org_duration);
st=OrgMusicSetOctive(st,org_octive);
if (!*st) break;
note=*st++-'A';
if (note<7) {
note=music_note_map[note];
if (*st=='b') {
note--;
st++;
} else if (*st=='#') {
note++;
st++;
}
tempo->note=note;
tempo->octive=*org_octive;
} else {
tempo->note=0;
tempo->octive=0;
}
if (*org_duration<=2*.25/3)
i=0;
else if (*org_duration<=.25)
i=1;
else if (*org_duration<=2*.5/3)
i=2;
else if (*org_duration<=.5)
i=3;
else if (*org_duration<=2.0/3)
i=4;
else if (*org_duration<=1.0)
i=5;
else if (*org_duration<=2.0)
i=6;
else
i=7;
tempo->duration=i;
InsQue(tempo,oc->root.last);
}
}
void OrgLoadSong(I1 *filename,U8 *org_octive,double *org_duration)
{
OrgCtrl *oc=Fs->user_data0;
I1 *st;
OrgNote *tempo;
LexStruct *lx=LexNew(ReadTextFile(filename),0,NewStr(filename));
Lex(lx);
while (lx->token) {
if (lx->token==TK_IDENT)
if (!StrCmp(lx->ident,"Play"))
if (Lex(lx)=='(')
if (Lex(lx)==TK_STR) {
tempo=oc->root.last;
st=LexExtendStr(lx);
OrgLoadSongStr(st,org_octive,org_duration);
if (lx->token==',') {
if (Lex(lx)==TK_STR) {
st=LexExtendStr(lx);
do {
tempo=tempo->next;
tempo->word=NewStr(st);
st+=StrLen(st)+1;
} while (*st);
}
}
}
Lex(lx);
}
LexDel(lx);
}
I1 *OrgCvtSong()
{
OrgCtrl *oc=Fs->user_data0;
OrgNote *tempo;
I1 *buf,*src,*dst;
U8 i,note,octive,last_octive,last_duration;
i=0;
tempo=oc->root.next;
last_octive=-1;
last_duration=-1;
while (tempo!=&oc->root) {
dst=&tempo->ascii;
octive=tempo->octive;
note=tempo->note;
if (octive!=last_octive && (note || octive)) {
*dst++=octive+'0';
last_octive=octive;
}
if (tempo->duration!=last_duration) {
src=PointAtListEntry(tempo->duration,org_duration_list);
*dst++=src[0];
if (src[1])
*dst++=src[1];
last_duration=tempo->duration;
}
if (note || octive) {
src=PointAtListEntry(note,org_note_list);
*dst++=src[0];
if (src[1])
*dst++=src[1];
} else
*dst++='R';
*dst++=0;
i+=StrLen(tempo->ascii);
tempo=tempo->next;
}
buf=MAlloc(i+1);
dst=buf;
tempo=oc->root.next;
while (tempo!=&oc->root) {
StrCpy(dst,tempo->ascii);
dst+=StrLen(tempo->ascii);
tempo=tempo->next;
}
*dst++=0;
return buf;
}
void OrgDelSong(I1 *full_filename)
{
EditFileNameStruct fn;
if (full_filename) {
StrCpy(fn.name,full_filename);
if (DoForm(&fn,"EditFileNameStruct"))
Del(fn.name);
}
}
void OrgSaveSong(I1 *dirname,I1 *full_filename=NULL)
{
OrgCtrl *oc=Fs->user_data0;
Ltf *l=LtfNew;
BoolU4 has_words;
OrgNote *tempo,*tempo1;
double two_measure_left=8.0;
I1 *ptr,ch;
Free(OrgCvtSong); //set tempo->ascii;
tempo=oc->root.next;
tempo1=tempo;
has_words=FALSE;
LtfPutSExt(l,
"void EndTsk()\r\n"
"{\r\n"
" Sound(0);\r\n"
" Exit;\r\n"
"}\r\n"
"\r\n"
"void Song()\r\n"
"{\r\n"
" Fs->end_task_cb=&EndTsk;\r\n"
" music_tempo=2.5;\r\n"
" try {\r\n"
" while (!ScanKey) {\r\n"
"\tPlay(\"");
while (tempo!=&oc->root) {
LtfPutSExt(l,tempo->ascii);
if (tempo->word) has_words=TRUE;
two_measure_left-=org_durations[tempo->duration];
tempo=tempo->next;
if (two_measure_left<0.001 && tempo!=&oc->root) {
if (has_words) {
LtfPutSExt(l,"\",\r\n\t\t\"");
while (tempo1!=tempo) {
if (tempo1->word) {
ptr=tempo1->word;
while (ch=*ptr) {
if (ch==CH_SPACE)
*ptr=CH_SHIFT_SPACE;
ptr++;
}
LtfPrintF(l,"%Q\\0",tempo1->word);
} else
LtfPrintF(l,"%c\\0",CH_SHIFT_SPACE);
tempo1=tempo1->next;
}
}
LtfPutSExt(l,"\");\r\n");
LtfPutSExt(l,"\tPlay(\"");
two_measure_left=8.0;
tempo1=tempo;
has_words=FALSE;
}
}
if (has_words) {
LtfPutSExt(l,"\",\r\n\t\t\"");
while (tempo1!=tempo) {
if (tempo1->word) {
ptr=tempo1->word;
while (ch=*ptr) {
if (ch==CH_SPACE)
*ptr=CH_SHIFT_SPACE;
ptr++;
}
LtfPrintF(l,"%Q\\0",tempo1->word);
} else
LtfPrintF(l,"%c\\0",CH_SHIFT_SPACE);
tempo1=tempo1->next;
}
}
LtfPutSExt(l,"\");\r\n"
" }\r\n"
" } catch\r\n"
" Fs->catch_except=TRUE;\r\n"
" Sound(0);\r\n"
"}\r\n"
"\r\n"
"Song;\r\n");
LtfRecalc(l);
if (full_filename)
StrCpy(l->filename.name,full_filename);
else
SPrintF(l->filename.name,"%s/Temp.CPZ",dirname);
LtfWrite(l,TRUE);
LtfDel(l);
}
void OrgClearSong()
{
OrgCtrl *oc=Fs->user_data0;
OrgNote *tempo,*tempo1;
tempo=oc->root.next;
while (tempo!=&oc->root) {
tempo1=tempo->next;
Free(tempo);
tempo=tempo1;
}
oc->root.next=&oc->root;
oc->root.last=&oc->root;
}
void OrgHelp(I8 org_octive)
{
I8 i;
coutln "$$CL$$$$BD,LTGRAY$$$$FD,YELLOW$$$$BU,LTGRAY$$$$FU,YELLOW$$$$FM,YELLOW$$$$BM,LTGRAY$$$$CM,0,12$$";
coutln " E R T U I P [ ] ";
coutln "A S D F G H J K L ; ' ENTER";
coutln;
coutln "$$FG,LTRED$$SPACE$$FG$$\t\tRest";
coutln "$$FG,LTRED$$BACKSPACE$$FG$$\t$$MA+A-X,\"Deletes Last Note\",\"\\x08\"$$";
coutln "$$FG,LTRED$$Left Mouse$$FG$$\tDrag note";
coutln "$$FG,LTRED$$Right Mouse$$FG$$\tChange duration or set word";
PutGrElem($IB,"<IB11>",11$,$IS,"<IS11>",11$,"$$PI+LM+LA,\"\",\"Msg(MSG_KEY_DOWN,0,SC_CURSOR_LEFT);\",%d$$");
cout " ";
PutGrElem($IB,"<IB19>",19$,$IS,"<IS19>",19$,"$$PI+LM,\"\",\"x\",%d$$");
cout " ";
if (Fs->user_data0><(OrgCtrl *)->record_on)
PutGrElem($IB,"<IB20>",20$,$IS,"<IS20>",20$,"$$PI+LM,\"\",\"z\",%d$$");
else
PutGrElem($IB,"<IB21>",21$,$IS,"<IS21>",21$,"$$PI+LM,\"\",\"z\",%d$$");
cout " ";
PutGrElem($IB,"<IB18>",18$,$IS,"<IS18>",18$,"$$PI+LM+LA,\"\",\"Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);\",%d$$");
cout "\r\n\r\n\rOctive: $$FG$$";
for (i=1;i<6;i++)
if (org_octive==i)
PrintF("$$BT-LE+LM-X+S,\"%d\",\"%d\"$$$$CM,3,0$$",i,i);
else
PrintF("$$BT-LE+LM-X,\"%d\",\"%d\"$$$$CM,3,0$$",i,i);
cout "\r\n\r\n\r\n";
cout " $$BT-LE+LM-X,\"Mode\",\"c\"$$$$CM,2,0$$";
cout "$$BT-LE+LM-X\"File Menu\",\"v\"$$$$CM,2,0$$";
cout "$$BT-LE+LM-X\"Random Song\",\",\"$$$$CM,2,0$$";
cout "$$BT-LE+LM-X\"Clear Song\",\".\"$$$$CM,2,0$$";
cout "$$BT-LE+LM-X,\"Exit\",\"\\x1B\"$$";
cout "\r\n\r\n\r";
}
#define ORGF_CANCEL 0
#define ORGF_SAVE 1
#define ORGF_CD 2
#define ORGF_JUKEBOX 3
#define ORGF_DELETE 4
I8 OrgPopUpFileMenu(I1 *dirname)
{
I8 i;
Ltf *l=LtfNew;
LtfPrintF(l,"%s\r\n\r\n",dirname);
LtfPrintF(l,"$$MU,\"Load Song\" %d$$\r\n",ORGF_JUKEBOX);
LtfPrintF(l,"$$MU,\"Save Song\" %d$$\r\n",ORGF_SAVE);
LtfPrintF(l,"$$MU,\"Delete Song\" %d$$\r\n",ORGF_DELETE);
LtfPrintF(l,"$$MU,\"Change Directory\" %d$$\r\n",ORGF_CD);
LtfPrintF(l,"$$MU,\"CANCEL\" %d$$\r\n",ORGF_CANCEL);
i=PopUpMenu(l);
LtfDel(l);
return i;
}
void MusicOrgan(I1 *dirname=NULL)
{
OrgCtrl *oc=MAlloc(sizeof(OrgCtrl));
BoolU4 is_note;
U8 p1,p2,i,j,ch,sc,cmd=0,note_down_time;
U8 note,octive,org_octive=3;
double record_tempo=LTDATE_FREQ/2.5;
double f=0,last_f=0,org_duration=1.0;
I1 *buf,*filename=NULL;
TssStruct *tss=Spawn(&OrgPlayTsk);
OrgNote *tempo;
BoolU4 old_ip_double=Bts(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK);
BoolU4 old_inhibit=ip_inhibit_win_operations;
BoolU4 old_wordstat=WordStat(OFF);
U8 old_user_data0=Fs->user_data0;
U8 old_ltf_flags=Fs->cur_ltf->flags;
BoolU4 old_border=WinBorder(OFF);
Fs->cur_ltf->flags|=LTFF_FORM;
oc->screen_x=0;
oc->record_on=FALSE;
oc->root.next=&oc->root;
oc->root.last=&oc->root;
oc->insert_point=NULL;
oc->cur_note=NULL;
Fs->user_data0=oc;
WinMax;
if (!dirname)
dirname=NewStr("HOME/MusicOrgan");
else
dirname=NewStr(dirname);
ip_inhibit_win_operations=TRUE;
OrgHelp(org_octive);
oc->old_update=Fs->update_win;
Fs->update_win=&DrawIt;
try {
do {
start:
if (ipty-Fs->win_top<13)
cmd=GetMsg(&p1,&p2,1<<MSG_KEY_DOWN|1<<MSG_KEY_UP|1<<MSG_IP_L_DOWN|1<<MSG_IP_R_UP|
1<<MSG_IP_MOVE);
else
cmd=GetMsg(&p1,&p2,1<<MSG_KEY_DOWN|1<<MSG_KEY_UP|1<<MSG_IP_MOVE);
got_msg:
if (cmd==MSG_KEY_DOWN && p1==CH_SPACE && !p2) {
PutKey(p1,p2);
goto start;
}
if (cmd!=MSG_IP_MOVE)
LtfBottom(Fs->cur_ltf);
octive=org_octive;
if (cmd==MSG_KEY_DOWN) {
ch=p1;
sc=p2;
if (ch>='0' && ch<='9') {
org_octive=ch-'0';
OrgHelp(org_octive);
} else {
is_note=TRUE;
switch (ch) {
case 0:
if (sc.u1[0]==SC_CURSOR_LEFT) {
oc->screen_x-=100;
} else if (sc.u1[0]==SC_CURSOR_RIGHT) {
oc->screen_x+=100;
}
is_note=FALSE;
break;
case 'a': note=7; octive--; break;
case 's': note=8; octive--; break;
case 'e': note=9; octive--; break;
case 'd': note=10; octive--; break;
case 'r': note=11; octive--; break;
case 'f': note=0; break;
case 't': note=1; break;
case 'g': note=2; break;
case 'h': note=3; break;
case 'u': note=4; break;
case 'j': note=5; break;
case 'i': note=6; break;
case 'k': note=7; break;
case 'l': note=8; break;
case 'p': note=9; break;
case ';': note=10; break;
case '[': note=11; break;
case '\'': note=0; octive++; break;
case ']': note=1; octive++; break;
case '\r': note=2; octive++; break;
case CH_SPACE:
note=0;
octive=0;
break;
case 'v':
Btr(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK);
ip_inhibit_win_operations=FALSE;
switch (OrgPopUpFileMenu(dirname)) {
case ORGF_SAVE:
OrgSaveSong(dirname,filename);
break;
case ORGF_DELETE:
OrgDelSong(filename);
break;
case ORGF_CD:
Free(filename);
filename=NULL;
buf=dirname;
if (dirname=PopUpPickDir)
Free(buf);
else
dirname=buf;
break;
case ORGF_JUKEBOX:
Free(filename);
filename=NULL;
JukeBox(dirname,&filename);
if (filename) {
oc->screen_x=0;
org_duration=1.0;
org_octive=3;
OrgClearSong;
OrgLoadSong(filename,&org_octive,&org_duration);
oc->record_on=OFF;
oc->insert_point=NULL;
oc->cur_note=NULL;
}
break;
}
ip_inhibit_win_operations=TRUE;
Bts(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK);
is_note=FALSE;
OrgHelp(org_octive);
break;
case ',':
Free(filename);
filename=NULL;
Btr(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK);
ip_inhibit_win_operations=FALSE;
buf=MakeSong();
if (!oc->insert_point) {
oc->insert_point=&oc->root;
oc->cur_note=oc->insert_point;
}
OrgLoadSongStr(buf,&org_octive,&org_duration);
OrgLoadSongStr(buf,&org_octive,&org_duration);
Free(buf);
ip_inhibit_win_operations=TRUE;
Bts(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK);
is_note=FALSE;
OrgHelp(org_octive);
break;
case '.':
OrgHelp(org_octive);
Free(filename);
filename=NULL;
org_duration=1.0;
org_octive=3;
OrgClearSong;
oc->insert_point=NULL;
oc->cur_note=NULL;
oc->screen_x=0;
is_note=FALSE;
break;
case '?':
OrgHelp(org_octive);
is_note=FALSE;
break;
case 'x':
OrgHelp(org_octive);
tempo=oc->root.next;
while (tempo!=&oc->root) {
if (ipty-Fs->win_top<13)
cmd=ScanMsg(&p1,&p2,1<<MSG_KEY_DOWN|1<<MSG_KEY_UP|1<<MSG_IP_L_DOWN|1<<MSG_IP_R_UP);
else
cmd=ScanMsg(&p1,&p2,1<<MSG_KEY_DOWN|1<<MSG_KEY_UP);
if (cmd) {
f=0;
org_play_f=0;
is_note=FALSE;
oc->cur_note=oc->insert_point;
goto got_msg;
}
oc->cur_note=tempo;
if (tempo->word)
if (StrCmp(tempo->word," "))
PutS(tempo->word);
note=tempo->note;
octive=tempo->octive;
if (note || octive)
f=Note2Freq(note,octive);
else
f=-1; //rest
if (f>0)
org_play_f=f;
else
org_play_f=0;
Sleep(org_durations[tempo->duration]*record_tempo*1000.0/LTDATE_FREQ);
org_play_f=0;
Sleep(3);
tempo=tempo->next;
}
oc->cur_note=oc->insert_point;
f=0;
org_play_f=0;
is_note=FALSE;
break;
case CH_BACKSPACE:
if (!oc->insert_point) {
oc->insert_point=&oc->root;
oc->cur_note=oc->insert_point;
}
tempo=oc->insert_point->last;
if (tempo!=&oc->root) {
PutChar(CH_BACKSPACE);
RemQue(tempo);
Free(tempo);
}
is_note=FALSE;
break;
case 'c':
org_play_mode++;
if (org_play_mode>=ORGPM_NUM_PLAY_MODES) org_play_mode=0;
is_note=FALSE;
OrgHelp(org_octive);
coutln "Mode:",org_play_mode;
break;
case 'z':
if (oc->record_on) {
oc->record_on=FALSE;
buf=OrgCvtSong;
coutln buf;
Free(buf);
} else {
coutln "\r\nCalibrate timing with 4 Quarter Notes";
cmd=GetMsg(&ch,&sc,1<<MSG_KEY_DOWN);
j=GetTimeStamp;
for (i=0;i<3;i++) {
PrintF("%d more\r\n",3-i);
cmd=GetMsg(&ch,&sc,1<<MSG_KEY_DOWN);
}
record_tempo=(GetTimeStamp-j)/3.0;
oc->record_on=TRUE;
org_duration=1.0;
org_octive=3;
oc->screen_x=0;
}
is_note=FALSE;
OrgHelp(org_octive);
break;
default:
is_note=FALSE;
}
if (is_note) {
if (note || octive)
f=Note2Freq(note,octive);
else
f=-1; //rest
}
}
} else if (cmd==MSG_KEY_UP)
f=0;
else if (cmd==MSG_IP_MOVE) {
if (p2>13*FONT_HEIGHT) {
Btr(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK);
ip_inhibit_win_operations=FALSE;
} else {
Bts(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK);
ip_inhibit_win_operations=TRUE;
}
} else if (cmd==MSG_IP_L_DOWN)
OrgLeftClick(p1,p2);
else
OrgRightClick(p1,p2);
if (f!=last_f) {
if (oc->record_on) {
if (last_f) {
tempo->duration=OrgCvtDuration((kbd_evt_time-note_down_time)/record_tempo);
if (!oc->insert_point) {
oc->insert_point=&oc->root;
oc->cur_note=oc->insert_point;
}
InsQue(tempo,oc->insert_point->last);
}
if (f) {
note_down_time=kbd_evt_time;
tempo=MAllocZ(sizeof(OrgNote));
tempo->note=note;
tempo->octive=octive;
}
}
if (f>0) {
cout PointAtListEntry(note,org_note_list);
org_play_f=f;
} else {
if (f<0)
cout "R";
org_play_f=0;
}
last_f=f;
}
} while (ch!=CH_ESC && ch!=CH_CTRLQ);
} catch
Fs->catch_except=TRUE;
AssignBit(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK,old_ip_double);
ip_inhibit_win_operations=old_inhibit;
OrgClearSong;
Kill(tss);
Fs->update_win=oc->old_update;
Fs->cur_ltf->flags=old_ltf_flags;
Free(oc);
Fs->user_data0=old_user_data0;
Free(dirname);
coutln "$$CL$$";
WinBorder(old_border);
WordStat(old_wordstat);
}
Xòÿÿÿñÿÿÿñÿÿÿ
ñÿÿÿõÿÿÿ
õÿÿÿóÿÿÿ òÿÿÿöÿÿÿ
÷ÿÿÿÿÿÿÿýÿÿÿüÿÿÿüÿÿÿÿÿÿÿÿÿÿÿýÿÿÿòÿÿÿþÿÿÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿÿýÿÿÿýÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿ0óÿÿÿ
óÿÿÿóÿÿÿóÿÿÿòÿÿÿ òÿÿÿÿÿÿÿýÿÿÿüÿÿÿüÿÿÿÿÿÿÿÿÿÿÿýÿÿÿòÿÿÿþÿÿÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿÿýÿÿÿýÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿôÿÿÿÿýÿÿÿüÿÿÿüÿÿÿÿÿÿÿÿÿÿÿýÿÿÿòÿÿÿþÿÿÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿÿýÿÿÿýÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿhÿÿÿÿýÿÿÿüÿÿÿüÿÿÿÿÿÿÿÿÿÿÿýÿÿÿòÿÿÿTÿÿÿÿýÿÿÿüÿÿÿüÿÿÿÿÿÿÿÿÿÿÿýÿÿÿlþÿÿÿñÿÿÿòÿÿÿñÿÿÿñÿÿÿ
ñÿÿÿõÿÿÿ
õÿÿÿóÿÿÿ òÿÿÿöÿÿÿ
÷ÿÿÿÿÿÿÿýÿÿÿüÿÿÿüÿÿÿÿÿÿÿÿÿÿÿýÿÿÿòÿÿÿþÿÿÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿÿýÿÿÿýÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿDþÿÿÿòÿÿÿóÿÿÿ
óÿÿÿóÿÿÿóÿÿÿòÿÿÿ òÿÿÿÿÿÿÿýÿÿÿüÿÿÿüÿÿÿÿÿÿÿÿÿÿÿýÿÿÿòÿÿÿþÿÿÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿÿýÿÿÿýÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿ þÿÿÿñÿÿÿÿÿÿÿýÿÿÿüÿÿÿüÿÿÿÿÿÿÿÿÿÿÿýÿÿÿòÿÿÿþÿÿÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿÿýÿÿÿýÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿ       




   

␍      ]  





 



 






W 

Binary file not shown.
Binary file not shown.
+736
View File
@@ -0,0 +1,736 @@
$BD,0$$FD,15$
GrBitMap *RK_base=GrAlias(grbase2,Fs);
$PI,"<ship_null>",2$
$PI,"<ship_thrust>",3$
$PI,"<ship_null2>",19$
$PI,"<ship_thrust2>",20$
$PI,"<speck>",24$
$PI,"<pebble>",23$
$PI,"<tiny_rock>",21$
$PI,"<tiny_rock2>",22$
$PI,"<small_rock>",4$
$PI,"<small_rock2>",13$
$PI,"<medium_rock>",5$
$PI,"<medium_rock2>",14$
$PI,"<large_rock>",6$
$PI,"<large_rock2>",15$
$PI,"<Bullet>",7$
$PI,"<Cargo>",18$
#define CMD_NULL 0
#define CMD_SPIN_LEFT 1
#define CMD_SPIN_RIGHT 2
#define CMD_THRUST 3
#define CMD_FIRE 4
#define CMD_EXIT 5
I8 cmd=CMD_NULL;
#define NUM_STARS 100
I8 stars_x[NUM_STARS],stars_y[NUM_STARS];
BoolU4 bounce=TRUE;
#define OT_SHIP 1
#define OT_CARGO 2
#define OT_BULLET 3
#define OT_SPECK 4
#define OT_PEBBLE 5
#define OT_TINY_ROCK 6
#define OT_SMALL_ROCK 7
#define OT_MEDIUM_ROCK 8
#define OT_LARGE_ROCK 9
#define A_TRANSITION -1
#define A_INACTIVE 0
#define A_ACTIVE 1
class Order2D2Theta
{
double x,y,theta;
double DxDt,DyDt,DthetaDt;
};
class Object
{
I4 active;
I4 type;
U1 *img;
double mass,radius;
U8 timeout;
};
#define NUM_OBJECTS 256
Ode *ode;
Order2D2Theta *o;
Object *objs;
void InitObject(I8 i, I8 type)
{
objs[i].active=A_ACTIVE;
objs[i].timeout=0;
objs[i].type=type;
switch (type) {
case OT_SHIP:
objs[i].img=$IB,"<ship_null>",2$;
objs[i].radius=15;
break;
case OT_CARGO:
objs[i].img=$IB,"<cargo>",18$;
objs[i].radius=30;
break;
case OT_BULLET:
objs[i].img=$IB,"<bullet>",9$;
objs[i].radius=7;
break;
case OT_SPECK:
objs[i].img=$IB,"<speck>",24$;
objs[i].radius=3;
break;
case OT_PEBBLE:
objs[i].img=$IB,"<pebble>",23$;
objs[i].radius=5;
break;
case OT_TINY_ROCK:
if (i&1)
objs[i].img=$IB,"<tiny_rock>",21$;
else
objs[i].img=$IB,"<tiny_rock2>",22$;
objs[i].radius=5;
break;
case OT_SMALL_ROCK:
if (i&1)
objs[i].img=$IB,"<small_rock>",10$;
else
objs[i].img=$IB,"<small_rock2>",13$;
objs[i].radius=11;
break;
case OT_MEDIUM_ROCK:
if (i&1)
objs[i].img=$IB,"<medium_rock>",11$;
else
objs[i].img=$IB,"<medium_rock2>",14$;
objs[i].radius=20;
break;
case OT_LARGE_ROCK:
if (i&1)
objs[i].img=$IB,"<large_rock>",12$;
else
objs[i].img=$IB,"<large_rock2>",15$;
objs[i].radius=26;
break;
}
objs[i].mass=objs[i].radius*objs[i].radius*objs[i].radius;
}
I8 AllocObject(I8 type)
{
I8 i;
for (i=0;i<NUM_OBJECTS-1;i++)
if (objs[i].active==A_INACTIVE)
break;
InitObject(i,type);
return i;
}
void DrawIt(TssStruct *tss)
{
I8 i,*r1,x,y;
ClearWinText(tss);
LtfUpdateAuxLtf(tss);
RK_base->color=WHITE;
for (i=0;i<NUM_STARS;i++)
GrPlot(RK_base,stars_x[i],stars_y[i]);
for (i=0;i<NUM_OBJECTS;i++) {
if (objs[i].active==A_ACTIVE) {
if (objs[i].timeout && objs[i].timeout<GetTimeStamp)
objs[i].active=A_INACTIVE;
else {
x=o[i].x;
y=o[i].y;
if (x<0) {
x=GR_WIDTH-AbsI8(x)%GR_WIDTH;
o[i].x=x;
} else if (x>GR_WIDTH) {
x=x%GR_WIDTH;
o[i].x=x;
}
if (y<0) {
y=GR_HEIGHT-AbsI8(y)%GR_HEIGHT;
o[i].y=y;
} else if (y>GR_HEIGHT) {
y=y%GR_HEIGHT;
o[i].y=y;
}
switch (objs[i].type) {
case OT_SHIP:
RK_base->flags|=BMF_TRANSFORMATION;
r1=RK_base->r;
RK_base->r=GrTheta(o[i].theta);
RK_base->x=x;
RK_base->y=y;
RK_base->z=0;
if (cmd==CMD_THRUST && GetTimeStamp&8192)
GrElemsPlot(RK_base,0,0,0,$IB,"<ship_thrust>",3$);
else
GrElemsPlot(RK_base,0,0,0,$IB,"<ship_null>",2$);
Free(RK_base->r);
RK_base->r=r1;
RK_base->flags&=~BMF_TRANSFORMATION;
break;
case OT_BULLET:
case OT_SPECK:
case OT_PEBBLE:
case OT_TINY_ROCK:
case OT_SMALL_ROCK:
case OT_MEDIUM_ROCK:
case OT_LARGE_ROCK:
case OT_CARGO:
RK_base->flags|=BMF_TRANSFORMATION;
r1=RK_base->r;
RK_base->r=GrTheta(o[i].theta);
RK_base->x=x;
RK_base->y=y;
RK_base->z=0;
GrElemsPlot(RK_base,0,0,0,objs[i].img);
Free(RK_base->r);
RK_base->r=r1;
RK_base->flags&=~BMF_TRANSFORMATION;
break;
}
}
}
}
}
void SongEndTsk()
{
Sound(0);
Exit;
}
void SongTsk()
{
Fs->end_task_cb=&SongEndTsk;
ResetMusicSettings;
while (TRUE) {
Play("qDCDeEGBDetBBFqDeDB");
Play("FAetAFDeDFqAetDFBeDFetFDEqD");
Play("eFAetAFDeDFqAetDFBeDFetFDEqD");
}
}
void InitObjs()
{
I8 i,j;
for (i=0;i<NUM_STARS;i++) {
stars_x[i]=RandU2%GR_WIDTH;
stars_y[i]=RandU2%GR_HEIGHT;
}
MemSet(objs,0,sizeof(Object)*NUM_OBJECTS);
MemSet(o,0,sizeof(Order2D2Theta)*NUM_OBJECTS);
i=AllocObject(OT_SHIP); //always #0
objs[i].mass=2.0*objs[i].radius*objs[i].radius*objs[i].radius;
o[i].x=GR_WIDTH/2;
o[i].y=GR_HEIGHT/2;
i=AllocObject(OT_CARGO); //always #1
objs[i].mass=0.5*objs[i].radius*objs[i].radius*objs[i].radius;
o[i].x=0;
o[i].DxDt=16.0;
o[i].y=GR_HEIGHT/2;
o[i].theta=pi/2;
for (j=0;j<4;j++) {
i=AllocObject(OT_LARGE_ROCK);
o[i].x=RandU4%GR_WIDTH;
o[i].y=RandU4%GR_HEIGHT;
o[i].DxDt=(32768-RandU2)/2000.0;
o[i].DyDt=(32768-RandU2)/2000.0;
o[i].DthetaDt=(32768-RandU2)/25000.0;
o[i].theta=pi2*(32768-RandU2)/16384.0;
}
}
void MyDerivative(Ode *ode,double t,Order2D2Theta *state,Order2D2Theta *DstateDt)
{
I8 i,j;
double f,d,d1,dd,dx,dy;
nounusedwarn ode,t;
MemSet(DstateDt,0,sizeof(Order2D2Theta)*NUM_OBJECTS);
for (i=0;i<NUM_OBJECTS;i++) {
if (objs[i].active==A_ACTIVE) {
DstateDt[i].x=state[i].DxDt;
DstateDt[i].y=state[i].DyDt;
DstateDt[i].theta=state[i].DthetaDt;
for (j=0;j<NUM_OBJECTS;j++) {
if (i!=j && objs[j].active==A_ACTIVE) {
dx=state[i].x-state[j].x;
dy=state[i].y-state[j].y;
dd=Sqr(dx)+Sqr(dy);
d=Sqrt(dd);
if (d) {
dx/=d;
dy/=d;
} else {
dx=0;
dy=0;
}
d1=objs[i].radius+objs[j].radius;
f=0;
if (dd<Sqr(d1)) {
if (bounce && objs[i].type!=OT_CARGO && objs[j].type!=OT_CARGO) {
f=Sqr(Sqr(Sqr(d1-Abs(d)+0.1))); //spring force
if (f>1000000.0) f=1000000.0;
}
} else
f=-2.5*objs[i].mass*objs[j].mass/(dd+1.0);
DstateDt[i].DxDt+=f*dx/objs[i].mass;
DstateDt[i].DyDt+=f*dy/objs[i].mass;
}
}
}
}
switch (cmd) {
case CMD_SPIN_LEFT:
DstateDt[0].DthetaDt-=10.0;
break;
case CMD_SPIN_RIGHT:
DstateDt[0].DthetaDt+=10.0;
break;
case CMD_THRUST:
DstateDt[0].DxDt+=100.0*Cos(state[0].theta-pi/2.0);
DstateDt[0].DyDt+=100.0*Sin(state[0].theta-pi/2.0);
break;
}
DstateDt[1].DxDt+=2.0*Cos(state[1].theta-pi/2.0);
DstateDt[1].DyDt+=2.0*Sin(state[1].theta-pi/2.0);
}
void Collision(I8 i,I8 j)
{
I8 i2;
switch (objs[i].type) {
case OT_SHIP:
if (!bounce) {
cmd=CMD_EXIT;
objs[i].active=A_INACTIVE;
}
break;
case OT_CARGO:
cmd=CMD_EXIT;
objs[i].active=A_INACTIVE;
break;
case OT_SPECK:
if (objs[j].type==OT_BULLET && !bounce)
objs[i].active=A_INACTIVE;
break;
case OT_BULLET:
if (!bounce)
objs[i].active=A_INACTIVE;
break;
case OT_PEBBLE:
case OT_TINY_ROCK:
case OT_SMALL_ROCK:
case OT_MEDIUM_ROCK:
i2=AllocObject(objs[i].type-1);
objs[i2].active=A_TRANSITION;
o[i2].x=o[i].x+objs[i2].radius+2.0;
o[i2].y=o[i].y;
o[i2].theta=o[i].theta;
o[i2].DxDt=o[i].DxDt;
o[i2].DyDt=o[i].DyDt;
o[i2].DthetaDt=o[i].DthetaDt;
i2=AllocObject(objs[i].type-1);
objs[i2].active=A_TRANSITION;
o[i2].x=o[i].x-objs[i2].radius-2.0;
o[i2].y=o[i].y;
o[i2].theta=o[i].theta;
o[i2].DxDt=o[i].DxDt;
o[i2].DyDt=o[i].DyDt;
o[i2].DthetaDt=o[i].DthetaDt;
objs[i].active=A_INACTIVE;
break;
case OT_LARGE_ROCK:
i2=AllocObject(objs[i].type-1);
objs[i2].active=A_TRANSITION;
o[i2].x=o[i].x+objs[i2].radius+4.0;
o[i2].y=o[i].y+objs[i2].radius+4.0;
o[i2].theta=o[i].theta;
o[i2].DxDt=o[i].DxDt;
o[i2].DyDt=o[i].DyDt;
o[i2].DthetaDt=o[i].DthetaDt;
i2=AllocObject(objs[i].type-1);
objs[i2].active=A_TRANSITION;
o[i2].x=o[i].x-objs[i2].radius-4.0;
o[i2].y=o[i].y-objs[i2].radius-4.0;
o[i2].theta=o[i].theta;
o[i2].DxDt=o[i].DxDt;
o[i2].DyDt=o[i].DyDt;
o[i2].DthetaDt=o[i].DthetaDt;
i2=AllocObject(objs[i].type-1);
objs[i2].active=A_TRANSITION;
o[i2].x=o[i].x-objs[i2].radius-4.0;
o[i2].y=o[i].y+objs[i2].radius+4.0;
o[i2].theta=o[i].theta;
o[i2].DxDt=o[i].DxDt;
o[i2].DyDt=o[i].DyDt;
o[i2].DthetaDt=o[i].DthetaDt;
i2=AllocObject(objs[i].type-1);
objs[i2].active=A_TRANSITION;
o[i2].x=o[i].x+objs[i2].radius+4.0;
o[i2].y=o[i].y-objs[i2].radius-4.0;
o[i2].theta=o[i].theta;
o[i2].DxDt=o[i].DxDt;
o[i2].DyDt=o[i].DyDt;
o[i2].DthetaDt=o[i].DthetaDt;
objs[i].active=A_INACTIVE;
break;
}
switch (objs[j].type) {
case OT_SHIP:
if (!bounce) {
cmd=CMD_EXIT;
objs[j].active=A_INACTIVE;
}
break;
case OT_CARGO:
cmd=CMD_EXIT;
objs[j].active=A_INACTIVE;
break;
case OT_SPECK:
if (objs[i].type==OT_BULLET && !bounce)
objs[j].active=A_INACTIVE;
break;
case OT_BULLET:
if (!bounce)
objs[j].active=A_INACTIVE;
break;
case OT_PEBBLE:
case OT_TINY_ROCK:
case OT_SMALL_ROCK:
case OT_MEDIUM_ROCK:
i2=AllocObject(objs[j].type-1);
objs[i2].active=A_TRANSITION;
o[i2].x=o[j].x+objs[i2].radius+2.0;
o[i2].y=o[j].y;
o[i2].theta=o[j].theta;
o[i2].DxDt=o[j].DxDt;
o[i2].DyDt=o[j].DyDt;
o[i2].DthetaDt=o[j].DthetaDt;
i2=AllocObject(objs[j].type-1);
objs[i2].active=A_TRANSITION;
o[i2].x=o[j].x-objs[i2].radius-2.0;
o[i2].y=o[j].y;
o[i2].theta=o[j].theta;
o[i2].DxDt=o[j].DxDt;
o[i2].DyDt=o[j].DyDt;
o[i2].DthetaDt=o[j].DthetaDt;
objs[j].active=A_INACTIVE;
break;
case OT_LARGE_ROCK:
i2=AllocObject(objs[j].type-1);
objs[i2].active=A_TRANSITION;
o[i2].x=o[j].x+objs[i2].radius+4.0;
o[i2].y=o[j].y+objs[i2].radius+4.0;
o[i2].theta=o[j].theta;
o[i2].DxDt=o[j].DxDt;
o[i2].DyDt=o[j].DyDt;
o[i2].DthetaDt=o[j].DthetaDt;
i2=AllocObject(objs[j].type-1);
objs[i2].active=A_TRANSITION;
o[i2].x=o[j].x-objs[i2].radius-4.0;
o[i2].y=o[j].y-objs[i2].radius-4.0;
o[i2].theta=o[j].theta;
o[i2].DxDt=o[j].DxDt;
o[i2].DyDt=o[j].DyDt;
o[i2].DthetaDt=o[j].DthetaDt;
i2=AllocObject(objs[j].type-1);
objs[i2].active=A_TRANSITION;
o[i2].x=o[j].x-objs[i2].radius-4.0;
o[i2].y=o[j].y+objs[i2].radius+4.0;
o[i2].theta=o[j].theta;
o[i2].DxDt=o[j].DxDt;
o[i2].DyDt=o[j].DyDt;
o[i2].DthetaDt=o[j].DthetaDt;
i2=AllocObject(objs[j].type-1);
objs[i2].active=A_TRANSITION;
o[i2].x=o[j].x+objs[i2].radius+4.0;
o[i2].y=o[j].y-objs[i2].radius-4.0;
o[i2].theta=o[j].theta;
o[i2].DxDt=o[j].DxDt;
o[i2].DyDt=o[j].DyDt;
o[i2].DthetaDt=o[j].DthetaDt;
objs[j].active=A_INACTIVE;
break;
}
}
void CheckCollisions()
{
I8 i,j,*r1;
double d,d1,dd,dx,dy;
GrBitMap *b;
for (i=0;i<NUM_OBJECTS;i++) {
if (objs[i].active==A_ACTIVE) {
for (j=i+1;j<NUM_OBJECTS;j++) {
if (objs[j].active==A_ACTIVE) {
dx=o[i].x-o[j].x;
dy=o[i].y-o[j].y;
dd=Sqr(dx)+Sqr(dy);
d=Sqrt(dd);
if (d) {
dx/=d;
dy/=d;
} else {
dx=0;
dy=0;
}
d1=objs[i].radius+objs[j].radius;
if (dd<Sqr(d1)) {
b=GrBitMapNew(BMT_COLOR4,64,64,Fs);
b->flags|=BMF_TRANSFORMATION;
r1=b->r;
b->r=GrTheta(o[i].theta);
b->x=32;
b->y=32;
b->z=0;
GrElemsPlot(b,0,0,0,objs[i].img);
Free(b->r);
b->r=r1;
b->bkcolor=ROP_COLLISION+BLACK;
r1=b->r;
b->r=GrTheta(o[j].theta);
b->x=o[j].x-o[i].x+32;
b->y=o[j].y-o[i].y+32;
b->z=0;
GrElemsPlot(b,0,0,0,objs[j].img);
Free(b->r);
b->r=r1;
if (b->collision_cnt>0)
Collision(i,j);
GrDel(b);
}
}
}
}
}
for (i=0;i<NUM_OBJECTS;i++)
if (objs[i].active==A_TRANSITION)
objs[i].active=A_ACTIVE;
}
#define MUZZLE_VELOCITY 500.0
void Fire()
{
double t=o[0].theta;
I8 i=AllocObject(OT_BULLET);
objs[i].timeout=GetTimeStamp+time_stamp_freq/2;
objs[i].mass*=10.0;
o[i].x=o[0].x+(objs[0].radius+objs[i].radius+1.0)*Cos(t-pi/2.0);
o[i].y=o[0].y+(objs[0].radius+objs[i].radius+1.0)*Sin(t-pi/2.0);
o[i].DxDt=o[0].DxDt+MUZZLE_VELOCITY*Cos(t-pi/2.0);
o[i].DyDt=o[0].DyDt+MUZZLE_VELOCITY*Sin(t-pi/2.0);
o[i].DthetaDt=(32768-RandU2)/3000.0;
//not real physics with the 0.005 factor
o[0].DxDt-=0.005*MUZZLE_VELOCITY*Cos(t-pi/2.0)*objs[i].mass/objs[0].mass;
o[0].DyDt-=0.005*MUZZLE_VELOCITY*Sin(t-pi/2.0)*objs[i].mass/objs[0].mass;
}
void CheckCrazy()
{
I8 i;
double d;
for (i=0;i<NUM_OBJECTS;i++)
if (objs[i].active==A_ACTIVE) {
d=Sqrt(Sqr(o[i].DxDt)+Sqr(o[i].DyDt));
if (d>MUZZLE_VELOCITY*5.0)
Auto(" ");
}
}
void Rocks()
{
I8 ch=0,i=0,c,p1,p2,sc=0;
void *old_update=Fs->update_win;
Ltf *l,*old_cur_ltf=Fs->cur_ltf,*old_aux_ltf=Fs->aux_ltf;
BoolU4 old_preempt=Preempt(OFF),
old_border=WinBorder(OFF);
TssStruct *song_tss=Spawn(&SongTsk,"Rocks Song",Fs);
I8 old_attr=Fs->text_attribute;
SetTypeMatic(0);
ode=OdeNew(NUM_OBJECTS*6);
ode->derivative=&MyDerivative;
ode->tolerance_start=.1;
o=ode->state;
objs=MAlloc(NUM_OBJECTS*sizeof(Object));
Fs->text_attribute=0x0F;
WinMax;
Fs->cur_ltf=NULL;
Fs->aux_ltf=l=InitSysAuxLtf(TRUE);
LtfPutSExt(l,"$$MA+A+TML+IV,\"Restart | \",\" \"$$");
LtfPutSExt(l,"$$MA+A+TML+IV,\"Bounce | \",\"b\"$$");
LtfPutSExt(l,"$$MA+A+TML+IV,\"Exit\",\"\\033\"$$");
LtfPutSExt(l,"$$CM+LX+TY,2,2$$$$TX+BK,\"Escort the cargo ship\"$$");
InitObjs;
InsQue(ode,Fs->last_ode);
Fs->update_win=&DrawIt;
while (ch!=CH_ESC && ch!=CH_CTRLQ) {
InitObjs;
ch=0;
cmd=CMD_NULL;
while (ch!=CH_ESC && ch!=CH_CR && ch!=CH_SPACE && ch!=CH_CTRLQ) {
while (c=ScanMsg(&p1,&p2,1<<MSG_KEY_DOWN|1<<MSG_KEY_UP)) {
ch=p1; sc=p2;
if (c==MSG_KEY_DOWN) {
if (ch==CH_SPACE) {
if (!l->best_d && l->cur_entry!=l) {
LtfRunEntry(l,l->cur_entry,TRUE,old_preempt);
ch=0;
l->best_d=MAX_I8;
}
} else if (ch=='b')
bounce=!bounce;
else if (sc.u1[0]==SC_CURSOR_RIGHT)
cmd=CMD_SPIN_RIGHT;
else if (sc.u1[0]==SC_CURSOR_LEFT)
cmd=CMD_SPIN_LEFT;
else if (sc.u1[0]==SC_CURSOR_UP)
cmd=CMD_THRUST;
else if (sc.u1[0]==SC_CURSOR_DOWN)
Fire;
} else
cmd=CMD_NULL;
}
CheckCollisions;
CheckCrazy;
if (cmd==CMD_EXIT) {
Sleep(1000);
ch=CH_SPACE;
}
WinSync; //messages are only queued by winmngr
}
}
Kill(song_tss);
Sound(0);
LtfDel(l);
Fs->aux_ltf=old_aux_ltf;
if (Fs->cur_ltf=old_cur_ltf)
LtfBottom(Fs->cur_ltf);
RemQue(ode);
OdeDel(ode);
Free(objs);
Fs->text_attribute=old_attr;
Fs->update_win=old_update;
WinBorder(old_border);
Preempt(old_preempt);
}
 ùÿÿÿüÿÿÿüÿÿÿúÿÿÿÿÿÿÿþÿÿÿþÿÿÿÿÿÿÿýÿÿÿýÿÿÿ÷ÿÿÿ÷ÿÿÿûÿÿÿûÿÿÿÿÿÿÿøÿÿÿøÿÿÿ   
 ôÿÿÿôÿÿÿôÿÿÿôÿÿÿùÿÿÿùÿÿÿùÿÿÿùÿÿÿþÿÿÿ þÿÿÿ  �ùÿÿÿüÿÿÿüÿÿÿúÿÿÿÿÿÿÿþÿÿÿþÿÿÿÿÿÿÿýÿÿÿýÿÿÿ÷ÿÿÿ÷ÿÿÿûÿÿÿûÿÿÿÿÿÿÿøÿÿÿøÿÿÿÿÿÿÿþÿÿÿ
þÿÿÿ

 ␍  ýÿÿÿ



óÿÿÿóÿÿÿøÿÿÿøÿÿÿûÿÿÿ ûÿÿÿ E þÿÿÿýÿÿÿólß$† n[½þÿÿÿd¨­hþÿÿÿûÿÿÿn[϶m’$C’$É$Q¶eÛ¼„ar–ͳíÙžW’"Cš¶½mÛ²úÿÿÿ¶m’6MÛ+€üÿÿÿ¤m þÿÿÿþÿÿÿ¤iÛT
I²rsüÿÿÿôÿÿÿóæy^ÝÚ³m“$íÛ¶mÛ³g’¡F CQŒ¢d["‰©( ³lÁ°lž×n.$I’T¤$à ÷ÿÿÿž=Û$Îúÿÿÿ«]»¶m“¦IFI’$I’„IrY–ms×zõÖm¶kÛ&MÛ¶m“¤%‘’l¶e[’$‰HÒ·m›<I“$I’$I’ ³mÛ¶mÛ¶m[DŠŒüÿÿÿøÿÿÿ¶Mß§m{ þÿÿÿI�ɶm›·yÛùÿÿÿv]×£’,K€$ÉX $¥�Q‘ IŠK°Ù2Û´MoK’dɶm›=Ï3O“¦=øÿÿÿúÿÿÿ«ëu¦ P ÿÿÿÿþÿÿÿþÿÿÿþÿÿÿýÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿþÿÿÿþÿÿÿþÿÿÿÿÿÿÿÿÿÿÿþÿÿÿþÿÿÿÿÿÿÿýÿÿÿÿÿÿÿÿÿÿÿýÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿ
þÿÿÿýÿÿÿþÿÿÿ P ÿÿÿÿþÿÿÿþÿÿÿþÿÿÿýÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿþÿÿÿþÿÿÿþÿÿÿÿÿÿÿÿÿÿÿþÿÿÿþÿÿÿÿÿÿÿýÿÿÿÿÿÿÿÿÿÿÿýÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿ
þÿÿÿýÿÿÿþÿÿÿ
E þÿÿÿýÿÿÿólß$† n[½þÿÿÿd¨ ­hþÿÿÿûÿÿÿn[϶m’$C’$É$Q¶eÛ¼„ar–ͳíÙžW’"Cš¶½mÛ²úÿÿÿ¶m’6MÛ+€üÿÿÿ¤m þÿÿÿþÿÿÿ¤iÛT
I² rsüÿÿÿôÿÿÿóæy^ÝÚ³m“$íÛ¶mÛ³g’¡F CQŒ¢d["‰©( ³lÁ°lž×n.$I’T¤$à ÷ÿÿÿž=Û$Îúÿÿÿ«]»¶m“¦IFI’$I’„IrY–ms×zõÖm¶kÛ&MÛ¶m“¤%‘’l¶e[’$‰HÒ·m›<I“$I’$I’ ³mÛ¶mÛ¶m[DŠŒüÿÿÿøÿÿÿ¶Mß§m{ þÿÿÿI�ɶm›·yÛùÿÿÿv]×£’,K€$ÉX $¥�Q‘ IŠK°Ù2Û´MoK’dɶm›=Ï3O“¦=øÿÿÿúÿÿÿ«ëu¦ ␍J)ÿÿÿÿûÿÿÿÛlÛ¤m“dÂ�$·m ²dm þÿÿÿþÿÿÿöiÚ�Nøÿÿÿض¶µkۦϓ$Û$‰$ ’ A’$$m»Þ6ÏófHÿÿÿÿûÿÿÿuëÚöH† EQdlÛö¶-Q$Æë Á²l¶mýÿÿÿúÿÿÿ6ÚöÿÿÿsÛÖmëÖ­ÏŸ¶mû$¥$”"mY�%‰¢( #I’ÚömÛ®k»@’,˶mö¼$a…‰Â�$mÛ¾i’¾ùÛÁ¶mÛ¶m›çºvm[I¤„‰ÂDHøÿÿÿ®ëÚöì%›mÛ¶Iš´ízÛšˆÜþoI&IHA’$I’$II”m“¤ïmÛ¶Õž·$
’!É␍,øÿÿÿþÿÿÿ¶k»¶éÿ´mÓ$™0L�e[ ýÿÿÿI– É úÿÿÿ¶]Ûh# ýÿÿÿ›·Í¶m& ¥�¦í­n!ðÿÿÿþÿÿÿÿÿÿÿ ␍ûÿÿÿúÿÿÿûÿÿÿúÿÿÿùÿÿÿöÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿüÿÿÿýÿÿÿýÿÿÿ␍␍␍ýÿÿÿ

þÿÿÿûÿÿÿþÿÿÿûÿÿÿ␍   ÿÿÿÿúÿÿÿüÿÿÿ ûÿÿÿþÿÿÿJùÿÿÿüÿÿÿüÿÿÿúÿÿÿÿÿÿÿþÿÿÿþÿÿÿÿÿÿÿýÿÿÿýÿÿÿ÷ÿÿÿ÷ÿÿÿûÿÿÿûÿÿÿÿÿÿÿøÿÿÿøÿÿÿüùÿÿÿüÿÿÿüÿÿÿúÿÿÿÿÿÿÿþÿÿÿþÿÿÿÿÿÿÿýÿÿÿýÿÿÿ÷ÿÿÿ÷ÿÿÿûÿÿÿûÿÿÿÿÿÿÿøÿÿÿøÿÿÿÿÿÿÿþÿÿÿ
þÿÿÿ

 ␍ 7þÿÿÿþÿÿÿ4In]Kjÿÿÿÿ 7þÿÿÿ6™%Ifýÿÿÿ$Iþÿÿÿÿÿÿÿ¤ÿÿÿÿ(
Binary file not shown.
Binary file not shown.
Binary file not shown.
+164
View File
@@ -0,0 +1,164 @@
#define TIME_FILENAME "HOME/TimeClock/TimeFile.DTZ"
#define TET_EOF 0
#define TET_PUNCH_IN 1
#define TET_PUNCH_OUT 2
class TimeEntry
{
TimeEntry *next,*last;
LTDate d;
U1 type;
I1 *desc;
};
void ReadTimeFile(TimeEntry *header)
{
U1 *buf,*ptr,type;
TimeEntry *tempt;
LTDate *d;
buf=ReadFile(TIME_FILENAME);
if (!buf)
buf=MAllocZ(1);
header->next=header;
header->last=header;
ptr=buf;
while (type=*ptr++) {
tempt=MAllocZ(sizeof(TimeEntry));
tempt->type=type;
d=ptr;
ptr+=sizeof(LTDate);
tempt->d=*d;
tempt->desc=NewStr(ptr);
ptr+=StrLen(ptr)+1;
InsQue(tempt,header->last);
}
Free(buf);
}
void WriteTimeFile(TimeEntry *header)
{
U1 *buf,*ptr;
TimeEntry *tempt;
LTDate *d;
U8 size=1; //for eof
tempt=header->next;
while (tempt!=header) {
size+=sizeof(U1)+sizeof(LTDate)+StrLen(tempt->desc)+1;
tempt=tempt->next;
}
buf=MAlloc(size);
ptr=buf;
tempt=header->next;
while (tempt!=header) {
*ptr++=tempt->type;
d=ptr;
*d=tempt->d;
ptr+=sizeof(LTDate);
StrCpy(ptr,tempt->desc);
ptr+=StrLen(tempt->desc)+1;
tempt=tempt->next;
}
*ptr=TET_EOF;
WriteFile(TIME_FILENAME,buf,size);
Free(buf);
}
void DelTimeEntries(TimeEntry *header)
{
TimeEntry *tempt=header->next,*tempt1;
while (tempt!=header) {
tempt1=tempt->next;
Free(tempt->desc);
Free(tempt);
tempt=tempt1;
}
Free(header);
}
public BoolU4 TimeRep(TimeEntry **header=NULL)
{
BoolU4 is_in=FALSE;
TimeEntry *tempt;
U8 week,cur_week,week_total=0;
TimeEntry *my_header=MAlloc(sizeof(TimeEntry));
if (header)
*header=my_header;
ReadTimeFile(my_header);
tempt=my_header->next;
while (tempt!=my_header) {
week=tempt->d.date/7; //TODO
if (week!=cur_week) {
if (is_in)
week_total=week_total+GetCurTimeLTDate;
PrintF("Week Total:%h2T\r\n",week_total);
cur_week=week;
week_total=0;
}
if (tempt->type==TET_PUNCH_IN) {
PutS("$$FG,RED$$IN ");
if (!is_in)
week_total=week_total-tempt->d;
is_in=TRUE;
} else {
PutS("$$FG,RED$$OUT");
if (is_in)
week_total=week_total+tempt->d;
is_in=FALSE;
}
PrintF(" %h2D %T:$$FG$$\r\n%s\r\n",
tempt->d,tempt->d,tempt->desc);
tempt=tempt->next;
}
if (is_in)
week_total=week_total+GetCurTimeLTDate;
PrintF("$$FG,RED$$Week Total:%h2T$$FG$$\r\n",week_total);
if (!header)
DelTimeEntries(my_header);
return is_in;
}
void PunchOut()
{
BoolU4 is_in;
TimeEntry *tempt,*header;
is_in=TimeRep(&header);
if (!is_in) {
PutS("$$BK,1$$Already Punched-Out$$BK,0$$\r\n");
View;
} else {
tempt=MAlloc(sizeof(TimeEntry));
tempt->type=TET_PUNCH_OUT;
tempt->d=GetCurTimeLTDate;
PrintF("\r\nEnter Description:\r\n");
if (!(tempt->desc=MGetS))
tempt->desc=MAllocZ(1);
InsQue(tempt,header->last);
WriteTimeFile(header);
}
DelTimeEntries(header);
}
void PunchIn()
{
BoolU4 is_in;
TimeEntry *tempt,*header;
is_in=TimeRep(&header);
if (is_in) {
PutS("$$BK,1$$Already Punched-In$$BK,0$$\r\n");
View;
} else {
tempt=MAlloc(sizeof(TimeEntry));
tempt->type=TET_PUNCH_IN;
tempt->d=GetCurTimeLTDate;
PrintF("\r\nEnter Description:\r\n");
if (!(tempt->desc=MGetS))
tempt->desc=MAllocZ(1);
InsQue(tempt,header->last);
WriteTimeFile(header);
}
DelTimeEntries(header);
}
Binary file not shown.
+2
View File
@@ -0,0 +1,2 @@
#include "/LT/Apps/Vocabulary/Load"
VocabQuiz;
Binary file not shown.
Binary file not shown.
Binary file not shown.
+385
View File
@@ -0,0 +1,385 @@
#define p1_color (ROP_EQU+LTGREEN)
#define p2_color (ROP_EQU+PURPLE)
#define enemy_fire_color (ROP_EQU+LTBLUE)
#define friendly_fire_color (ROP_EQU+WHITE)
GrBitMap *WG_base=GrAlias(grbase2,Fs);
$PI,"+",1$
$PI,"+",3$
$PI,"+",2$
$PI,"+",4$
U1 *GrTrooper[7]={$IB,"<P1>",1$,$IB,"<P3>",3$,$IB,"<P2>",2$,
$IB,"<P4>",4$,
$IB,"<P2>",2$,$IB,"<P3>",3$,$IB,"<P1>",1$};
U8 fire_end_time=0;
BoolU4 sound_off=TRUE;
class Trooper
{
I8 num,x,y,dx,dy,fx,fy,att,def,rng,player;
U8 fire_end_time;
};
#define num_troopers 100
Trooper tr[num_troopers<<1];
U8 cnt1,cnt2;
I8 text_area_size=(GR_HEIGHT/FONT_HEIGHT)*(GR_WIDTH/FONT_WIDTH);
#define mm_none 1
#define mm_friendly_firepower 2
#define mm_laps_time 3
I8 map_mode=mm_none,cmd_intensity=128;
U2 *map_values;
#define ai_nothing 1
#define ai_target 2
#define ai_random 3
U8 ai;
void UpdateMap(TssStruct *tss)
{
I8 i;
for (i=tss->win_top;i<=tss->win_bottom;i++) {
MemCpy(textbase+(i*TEXT_COLS+tss->win_left)*4,
map_values+(i*TEXT_COLS+tss->win_left)*4,
(tss->win_right+1-tss->win_left)*4);
}
}
void ClearMapValues()
{
MemSet(map_values,0,text_area_size*sizeof(U4));
}
void PutFriendlyFirepower(TssStruct *tss)
{
I8 i,d,x,y,dx,dy;
I8 lt=tss->win_left,rt=tss->win_right,
tp=tss->win_top, bm=tss->win_bottom;
U4 *ptr;
U8 v;
for (y=0;y<=bm-tp;y++) {
ptr=map_values+((y+tp)*TEXT_COLS+tss->win_left)*4;
for (x=0;x<=rt-lt;x++) {
v=0;
for (i=0;i<num_troopers;i++)
if (tr[i].def>0 && tr[i].fire_end_time<Jiffies) {
dx=(tr[i].x>>16)-(x*FONT_WIDTH+FONT_WIDTH>>1);
dy=(tr[i].y>>16)-(y*FONT_HEIGHT+FONT_HEIGHT>>1);
d=dx*dx+dy*dy;
if (d<tr[i].rng)
v+=tr[i].att;
}
ptr[x]=(v*128 & 0xF000)+CH_SPACE;
}
}
}
void DrawTrooper(Trooper *t,U8 color)
{
I8 x=t->dx>>12,y=t->dy>>12,s,fire_col,
speed=Sqrt(x*x+y*y);
if (map_mode==mm_laps_time) {
x=(t->x+500*t->dx)>>16;
y=(t->y+500*t->dy)>>16;
} else {
x=t->x>>16;
y=t->y>>16;
}
s=t->def;
if (s>0) {
s=s/3;
WG_base->color=color;
WG_base->bkcolor=BLACK;
GrElemsPlot(WG_base,x,y,0,GrTrooper[(t->num+Jiffies*speed/JIFFY_FREQ)%7]);
if (t->player==0)
fire_col=friendly_fire_color;
else
fire_col=enemy_fire_color;
if (Jiffies<t->fire_end_time) {
Sound(2000);
sound_off=FALSE;
WG_base->color=fire_col;
GrLine3(WG_base,x,y,0,t->fx>>16,t->fy>>16,0);
}
if (Jiffies>=fire_end_time)
if (!sound_off) {
sound_off=TRUE;
Sound(0);
}
}
}
void DrawIt(TssStruct *tss)
{
I1 buf[32];
I8 i,c,x=ipx-tss->win_pixel_left,y=ipy-tss->win_pixel_top;
cmd_intensity=(ip_throttle*128)>>32;
UpdateMap(tss);
LtfUpdateAuxLtf(tss);
cnt1=0;
cnt2=0;
for (i=0;i<num_troopers;i++)
if (tr[i].def>0) {
DrawTrooper(&tr[i],p1_color);
cnt1++;
}
for (i=num_troopers;i<num_troopers<<1;i++)
if (tr[i].def>0) {
DrawTrooper(&tr[i],p2_color);
cnt2++;
}
if (cmd_intensity>0) {
if (ip_lb)
c=ROP_EQU+LTGREEN;
else
c=ROP_EQU+GREEN;
} else {
if (ip_lb)
c=ROP_EQU+LTBLUE;
else
c=ROP_EQU+BLUE;
}
WG_base->color=c;
GrCircle(WG_base,x,y,AbsI8(cmd_intensity));
SPrintF(buf,"%03d %03d",cnt1,cnt2);
PlotWinStr(tss,buf,WHITE,tss->win_right-8,0);
}
I8 targets[10];
void InitTroopers()
{
I8 i,j,dx,dy;
Trooper *t;
for (i=0;i<10;i++) {
targets[i]=RandU2%num_troopers;
dx=RandU2-0x8000;
dy=RandU2-0x8000;
for (j=0;j<10;j++) {
t=&tr[i*10+j];
t->num=i*10+j;
t->x=(GR_WIDTH-100-i*10)<<16;
t->y=(GR_HEIGHT>>1-50+j*10)<<16;
t->dx=0;
t->dy=0;
t->fire_end_time=Jiffies;
t->att=3;
t->def=10;
t->rng=50*50;
t->player=0;
t=&tr[i*10+j+num_troopers];
t->num=i*10+j;
t->x=(100+i*10)<<16;
t->y=(GR_HEIGHT>>1-50+j*10)<<16;
t->dx=0;
t->dy=0;
if (ai==ai_random) {
t->dx=dx;
t->dy=dy;
}
t->fire_end_time=Jiffies;
t->att=3;
t->def=10;
t->rng=50*50;
t->player=1;
}
}
}
void DoAiTarget()
{
I8 i,j;
Trooper *t,*t2;
for (i=0;i<10;i++) {
t2=&tr[targets[i]];
for (j=0;j<10;j++) {
t=&tr[i*10+j+num_troopers];
t->dx=(t2->x-t->x)>>11;
t->dy=(t2->y-t->y)>>11;
}
}
}
void UpdatePositions()
{
I8 i;
Trooper *t;
for (i=0;i<num_troopers<<1;i++) {
t=&tr[i];
t->x+=t->dx;
if (t->x>=GR_WIDTH<<16) t->x-=GR_WIDTH<<16;
if (t->x<0) t->x+=GR_WIDTH<<16;
t->y+=t->dy;
if (t->y>=GR_HEIGHT<<16) t->y-=GR_HEIGHT<<16;
if (t->y<0) t->y+=GR_HEIGHT<<16;
}
}
void ResolveFiring()
{
I8 i,j,d,dx,dy;
for (i=0;i<num_troopers;i++)
for (j=num_troopers;j<num_troopers<<1;j++) {
if (tr[i].def>0 && tr[j].def>0) {
dx=(tr[i].x-tr[j].x)>>16;
dy=(tr[i].y-tr[j].y)>>16;
d=dx*dx+dy*dy;
if (d<tr[i].rng && tr[i].fire_end_time<Jiffies) {
tr[i].fire_end_time=Jiffies+JIFFY_FREQ>>3;
fire_end_time=tr[i].fire_end_time;
tr[i].fx=tr[j].x;
tr[i].fy=tr[j].y;
tr[j].def=tr[j].def-tr[i].att;
}
if (d<tr[j].rng && tr[j].fire_end_time<Jiffies) {
tr[j].fire_end_time=Jiffies+JIFFY_FREQ>>3;
fire_end_time=tr[i].fire_end_time;
tr[j].fx=tr[i].x;
tr[j].fy=tr[i].y;
tr[i].def=tr[i].def-tr[j].att;
}
}
}
}
void UpdateVelocities()
{
I8 i,x=ipx-Fs->win_pixel_left,y=ipy-Fs->win_pixel_top,dx,dy,d;
Trooper *t;
if (ip_lb) {
for (i=0;i<num_troopers;i++) {
t=&tr[i];
dx=(x-(t->x>>16));
dy=(y-(t->y>>16));
d=dx*dx+dy*dy+1;
dx=(cmd_intensity<<13*dx)/d;
dy=(cmd_intensity<<13*dy)/d;
t->dx=t->dx-dx;
t->dy=t->dy-dy;
}
}
}
void SongEndTsk()
{
Sound(0);
Exit;
}
void SongTsk()
{
Fs->end_task_cb=&SongEndTsk;
ResetMusicSettings;
while (TRUE) {
Play("3qAG2eG3DqDeBGqEsARAReFA");
Play("qAG2eG3DqDeBGqEsARAReFA");
Play("sCCCC2qG3G2G3ABD2eGR");
Play("3sCCCC2qG3G2G3ABD2eGR");
}
}
void WarGame()
{
I8 ch=0,i=0;
U8 sc=0,ms=0;
void *old_update=Fs->update_win;
Ltf *l,*m,*old_cur_ltf=Fs->cur_ltf,*old_aux_ltf=Fs->aux_ltf;
BoolU4 old_has_menu;
BoolU4 old_border=WinBorder(OFF);
BoolU4 old_ip_double=Bts(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK);
BoolU4 old_preempt=Preempt(OFF);
TssStruct *song_tss=Spawn(&SongTsk,"WarGame Song",Fs);
WinMax;
map_values=MAlloc(text_area_size*sizeof(U4));
ip_throttle=-1<<30;
Fs->cur_ltf=NULL;
m=LtfRead("::/LT/Apps/WarGame/WarGame.MUZ");
old_has_menu=Bts(&Fs->crt_flags,CRTf_HAS_MENU); //todo aux ltf to show "MENU"
Fs->aux_ltf=l=InitSysAuxLtf(TRUE);
LtfPutSExt(l,"$$MA+A+TML+IV,\"Restart | \",\" \"$$");
LtfPutSExt(l,"$$MA+A+TML+IV,\"Normal | \",\"1\"$$");
LtfPutSExt(l,"$$MA+A+TML+IV,\"FirePower | \",\"2\"$$");
LtfPutSExt(l,"$$MA+A+TML+IV,\"LapseTime | \",\"3\"$$");
LtfPutSExt(l,"$$MA+A+TML+IV,\"Exit\",\"\\033\"$$");
ClearMapValues;
InitTroopers();
Fs->update_win=&DrawIt;
PopUpOk("Wheel Controls Command Strength");
while (ms!=101 && ch!=CH_ESC && ch!=CH_CTRLQ) {
ch=0;ms=0;
ai=RandU2%3+1;
InitTroopers();
while (ch!=CH_ESC && ch!=CH_CR && ch!=CH_SPACE && ch!=CH_CTRLQ && ms!=101 && ms!=100) {
ms=0;
if (ScanKey(&ch,&sc)) {
if (ch==CH_SPACE) {
if (!l->best_d && l->cur_entry!=l) {
LtfRunEntry(l,l->cur_entry,TRUE,old_preempt);
ch=0;
}
}
ClearMapValues;
if (sc.u1[0]==SC_GUI)
ms=DoMenu(m);
if (ms==1 || ch=='1')
map_mode=mm_none;
else if (ms==2 || ch=='2')
map_mode=mm_friendly_firepower;
else if (ms==3 || ch=='3')
map_mode=mm_laps_time;
}
if (!(++i&7) && map_mode==mm_friendly_firepower)
PutFriendlyFirepower(Fs);
Sleep(40);
if (ai==ai_target)
DoAiTarget;
UpdateVelocities;
UpdatePositions;
ResolveFiring;
}
}
Kill(song_tss);
Sound(0);
LtfDel(l);
Fs->aux_ltf=old_aux_ltf;
if (Fs->cur_ltf=old_cur_ltf)
LtfBottom(Fs->cur_ltf);
LtfDel(m);
Fs->update_win=old_update;
Free(map_values);
AssignBit(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK,old_ip_double);
AssignBit(&Fs->crt_flags,CRTf_HAS_MENU,old_has_menu);
WinBorder(old_border);
Preempt(old_preempt);
}
Tøÿÿÿýÿÿÿÿÿÿÿ þÿÿÿ|  ÿÿÿÿÿÿÿÿÿÿÿÿøÿÿÿýÿÿÿÿÿÿÿ þÿÿÿ|
 øÿÿÿýÿÿÿÿÿÿÿ þÿÿÿ|  ÿÿÿÿ␍ÿÿÿÿ␍ÿÿÿÿøÿÿÿýÿÿÿÿÿÿÿ þÿÿÿ
+14
View File
@@ -0,0 +1,14 @@
$TX+CX,"WarGame"$
$TX+CX,"------------"$
$TX+CX,"Button #1 issues command"$s
$TX+CX,"Throttle/Wheel adjusts command strength."$
$MA+A+CX,"SPACE Restart"," "$
$MA+A+CX,"ESC Quit ","\033"$
$TX+CX,"---------------------------"$
$MA+A+CX,"'1' No Map ","1"$
$MA+A+CX,"'2' Friendly Fire Power Map","2"$
$MA+A+CX,"'3' Lapse Time ","3"$