hschumann2/TempleOS-Source-Code
0847
1 2//Practice your ASCII knowledge ;-)3 4U0 SafePutChar(U8 ch)5{6 if (CH_SHIFT_SPACE<=ch<0x7F) {7 if (ch=='$')8 "%02X $RED$$$$FG$ ",ch;9 else10 "%02X $RED$%c$FG$ ",ch,ch;11 } else12 "%02X $RED$ $FG$ ",ch;13}14 15 16 17 18 19 20 <1>/* Graphics Not Rendered in HTML */21 22U0 ASCIIOrgan()23{24 I64 i,ch;25 26 for (i=0;i<32;i++) {27 SafePutChar(i);28 SafePutChar(i+32);29 SafePutChar(i+64);30 SafePutChar(i+96);31 '\n';32 }33 34 "\nPress keys to make snds\n"35 "and press $GREEN$<SHIFT-ESC>$FG$ to exit.\n";36 do {37//We don't want echo or scan codes, so we use NULL and FALSE...38 ch=GetChar(,FALSE);39 Snd(ch-CH_ESC);40 } while (ch!=CH_ESC && ch!=CH_SHIFT_ESC);41 Snd;42 43 //Note the %d in the string for sprite number.44 '\n\n\n\n\n\n\n';45 Sprite(<1>,"$SP+PU,\"Click for better organ\","46 "LM=\"#include \\\"::/Apps/Psalmody/Run\\\";\",BI=%d$");47 '\n\n\n\n\n';48}49 50ASCIIOrgan;51 