195 lines
19 KiB
HTML
Executable File
195 lines
19 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="generator" content="TempleOS V5.03">
|
|
<meta name="viewport" content="width=device-width">
|
|
<link rel="stylesheet" href="/style/templeos.css">
|
|
<script src="/script/templeos.js"></script>
|
|
<style type="text/css">
|
|
.cF0{color:#000000;background-color:#ffffff;}
|
|
.cF1{color:#0000aa;background-color:#ffffff;}
|
|
.cF2{color:#00aa00;background-color:#ffffff;}
|
|
.cF3{color:#00aaaa;background-color:#ffffff;}
|
|
.cF4{color:#aa0000;background-color:#ffffff;}
|
|
.cF5{color:#aa00aa;background-color:#ffffff;}
|
|
.cF6{color:#aa5500;background-color:#ffffff;}
|
|
.cF7{color:#aaaaaa;background-color:#ffffff;}
|
|
.cF8{color:#555555;background-color:#ffffff;}
|
|
.cF9{color:#5555ff;background-color:#ffffff;}
|
|
.cFA{color:#55ff55;background-color:#ffffff;}
|
|
.cFB{color:#55ffff;background-color:#ffffff;}
|
|
.cFC{color:#ff5555;background-color:#ffffff;}
|
|
.cFD{color:#ff55ff;background-color:#ffffff;}
|
|
.cFE{color:#ffff55;background-color:#ffffff;}
|
|
.cFF{color:#ffffff;background-color:#ffffff;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre id="content">
|
|
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"Misc/TOS"</span><span class=cF0>
|
|
<a name="l2"></a>
|
|
<a name="l3"></a></span><span class=cF1>Bool</span><span class=cF0> fg_on =</span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l4"></a>
|
|
<a name="l5"></a></span><span class=cF9>I64</span><span class=cF0> CopyVideo()
|
|
<a name="l6"></a>{
|
|
<a name="l7"></a> </span><span class=cF9>I64</span><span class=cF0> res=0;
|
|
<a name="l8"></a> </span><span class=cF1>Bool</span><span class=cF0> old_silent=</span><span class=cF5>Silent</span><span class=cF0>;
|
|
<a name="l9"></a> </span><span class=cF5>Del</span><span class=cF0>(</span><span class=cF6>"D:/Tmp/*.AU"</span><span class=cF0>);
|
|
<a name="l10"></a> </span><span class=cF5>Del</span><span class=cF0>(</span><span class=cF6>"D:/Tmp/*.MV"</span><span class=cF0>);
|
|
<a name="l11"></a> </span><span class=cF5>Silent</span><span class=cF0>(old_silent);
|
|
<a name="l12"></a> </span><span class=cF5>SndShift</span><span class=cF0>(&</span><span class=cFB>scrncast</span><span class=cF0>.snd_head,0.185);
|
|
<a name="l13"></a> </span><span class=cF5>AUWrite</span><span class=cF0>(</span><span class=cF6>"D:/Tmp/AUDIO"</span><span class=cF0>,&</span><span class=cFB>scrncast</span><span class=cF0>.snd_head,</span><span class=cFB>scrncast</span><span class=cF0>.t0_now,</span><span class=cFB>scrncast</span><span class=cF0>.t0_tS);
|
|
<a name="l14"></a> </span><span class=cF5>QueDel</span><span class=cF0>(&</span><span class=cFB>scrncast</span><span class=cF0>.snd_head,</span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l15"></a> </span><span class=cF5>GR2MV</span><span class=cF0>(</span><span class=cF6>"D:/Tmp/VID%03d.MV"</span><span class=cF0>,</span><span class=cF6>"B:/Tmp"</span><span class=cF0>,</span><span class=cF6>"+d"</span><span class=cF0>);
|
|
<a name="l16"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l17"></a>}
|
|
<a name="l18"></a>
|
|
<a name="l19"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"ScrnCast/TOS"</span><span class=cF0>
|
|
<a name="l20"></a></span><span class=cF1>U0</span><span class=cF0> DelScrnShots()
|
|
<a name="l21"></a>{
|
|
<a name="l22"></a> </span><span class=cF1>Bool</span><span class=cF0> old_silent=</span><span class=cF5>Silent</span><span class=cF0>;
|
|
<a name="l23"></a> </span><span class=cF5>DelTree</span><span class=cF0>(</span><span class=cF6>"B:/Tmp"</span><span class=cF0>);
|
|
<a name="l24"></a> </span><span class=cF5>DirMk</span><span class=cF0>(</span><span class=cF6>"B:/Tmp"</span><span class=cF0>);
|
|
<a name="l25"></a> </span><span class=cF5>Del</span><span class=cF0>(</span><span class=cF6>"D:/Tmp/*.AU"</span><span class=cF0>);
|
|
<a name="l26"></a> </span><span class=cF5>Del</span><span class=cF0>(</span><span class=cF6>"D:/Tmp/*.MV"</span><span class=cF0>);
|
|
<a name="l27"></a> </span><span class=cF5>Del</span><span class=cF0>(</span><span class=cF6>"C:/Tmp/*.AU"</span><span class=cF0>);
|
|
<a name="l28"></a> </span><span class=cF5>Del</span><span class=cF0>(</span><span class=cF6>"C:/Tmp/*.MV"</span><span class=cF0>);
|
|
<a name="l29"></a> </span><span class=cF5>Silent</span><span class=cF0>(old_silent);
|
|
<a name="l30"></a>}
|
|
<a name="l31"></a>
|
|
<a name="l32"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> FrameGrabberToggle(</span><span class=cF1>Bool</span><span class=cF0> sync_tone,</span><span class=cF1>Bool</span><span class=cF0> tos_theme,
|
|
<a name="l33"></a> </span><span class=cF1>Bool</span><span class=cF0> just_audio=</span><span class=cF3>FALSE</span><span class=cF0>)
|
|
<a name="l34"></a>{</span><span class=cF2>//The frame grabber saves GR files to B:/Tmp.</span><span class=cF0>
|
|
<a name="l35"></a> </span><span class=cF1>static</span><span class=cF0> </span><span class=cF1>F64</span><span class=cF0> last_time=0;
|
|
<a name="l36"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>tS</span><span class=cF0>-last_time>3.0) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l37"></a> last_time=</span><span class=cF5>tS</span><span class=cF0>;
|
|
<a name="l38"></a> </span><span class=cF1>if</span><span class=cF0> (fg_on) {
|
|
<a name="l39"></a> fg_on=</span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l40"></a> </span><span class=cF5>ScrnCast</span><span class=cF0>(</span><span class=cF3>OFF</span><span class=cF0>);
|
|
<a name="l41"></a> </span><span class=cF5>User</span><span class=cF0>(</span><span class=cF6>"CopyVideo;Exit;\n"</span><span class=cF0>);
|
|
<a name="l42"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
|
<a name="l43"></a> DelScrnShots;
|
|
<a name="l44"></a> fg_on=</span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l45"></a> </span><span class=cF5>ScrnCast</span><span class=cF0>(</span><span class=cF3>ON</span><span class=cF0>,just_audio);
|
|
<a name="l46"></a> </span><span class=cF1>if</span><span class=cF0> (sync_tone) </span><span class=cF7>{</span><span class=cF5>Beep</span><span class=cF0>;</span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l47"></a> </span><span class=cF1>if</span><span class=cF0> (tos_theme) </span><span class=cF7>{</span><span class=cF5>User</span><span class=cF0>(</span><span class=cF6>"ExeFile(\"~/TOS/TOSTheme\");Exit;\n"</span><span class=cF0>);</span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l48"></a> }
|
|
<a name="l49"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l50"></a>}
|
|
<a name="l51"></a>
|
|
<a name="l52"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> JukeSongTAD(</span><span class=cF9>I64</span><span class=cF0> num,</span><span class=cF9>I64</span><span class=cF0> passes=2)
|
|
<a name="l53"></a>{</span><span class=cF2>//Make movie of one song.</span><span class=cF0>
|
|
<a name="l54"></a> </span><span class=cF1>if</span><span class=cF0> (!fg_on)
|
|
<a name="l55"></a> FrameGrabberToggle(</span><span class=cF3>FALSE</span><span class=cF0>,</span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l56"></a> </span><span class=cF5>Sleep</span><span class=cF0>(200);
|
|
<a name="l57"></a> JukeSongsPuppet(</span><span class=cF6>"~/TAD/Songs"</span><span class=cF0>,passes,num,num+1);
|
|
<a name="l58"></a> </span><span class=cF1>if</span><span class=cF0> (fg_on)
|
|
<a name="l59"></a> FrameGrabberToggle(</span><span class=cF3>FALSE</span><span class=cF0>,</span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l60"></a>}
|
|
<a name="l61"></a>
|
|
<a name="l62"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> JukeSongSup(</span><span class=cF9>I64</span><span class=cF0> vol,</span><span class=cF9>I64</span><span class=cF0> num,</span><span class=cF9>I64</span><span class=cF0> passes=2)
|
|
<a name="l63"></a>{</span><span class=cF2>//Make movie of one song.</span><span class=cF0>
|
|
<a name="l64"></a> </span><span class=cF1>U8</span><span class=cF0> *st=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"~/Sup%d/Sup%dHymns"</span><span class=cF0>,vol,vol);
|
|
<a name="l65"></a> </span><span class=cF1>if</span><span class=cF0> (!fg_on)
|
|
<a name="l66"></a> FrameGrabberToggle(</span><span class=cF3>FALSE</span><span class=cF0>,</span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l67"></a> JukeSongsPuppet(st,passes,num,num+1);
|
|
<a name="l68"></a> </span><span class=cF1>if</span><span class=cF0> (fg_on)
|
|
<a name="l69"></a> FrameGrabberToggle(</span><span class=cF3>FALSE</span><span class=cF0>,</span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l70"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l71"></a>}
|
|
<a name="l72"></a>
|
|
<a name="l73"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> JukeLines(</span><span class=cF9>I64</span><span class=cF0> vol,</span><span class=cF9>I64</span><span class=cF0> start_line,</span><span class=cF9>I64</span><span class=cF0> end_line)
|
|
<a name="l74"></a>{</span><span class=cF2>//Make movie of many lines of songs, starting at 0.</span><span class=cF0>
|
|
<a name="l75"></a> </span><span class=cF1>U8</span><span class=cF0> *st=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"~/Sup%d/Sup%dHymns"</span><span class=cF0>,vol,vol);
|
|
<a name="l76"></a> </span><span class=cF1>if</span><span class=cF0> (!fg_on)
|
|
<a name="l77"></a> FrameGrabberToggle(</span><span class=cF3>FALSE</span><span class=cF0>,</span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l78"></a> JukeSongsPuppet(st,,start_line*5,end_line*5);
|
|
<a name="l79"></a> </span><span class=cF1>if</span><span class=cF0> (fg_on)
|
|
<a name="l80"></a> FrameGrabberToggle(</span><span class=cF3>FALSE</span><span class=cF0>,</span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l81"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l82"></a>}
|
|
<a name="l83"></a>
|
|
<a name="l84"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> TADHymns(</span><span class=cF9>I64</span><span class=cF0> vol,</span><span class=cF9>I64</span><span class=cF0> let)
|
|
<a name="l85"></a>{</span><span class=cF2>//Make 2-lines of songs movie</span><span class=cF0>
|
|
<a name="l86"></a> </span><span class=cF9>I64</span><span class=cF0> line=2*(</span><span class=cF5>ToUpper</span><span class=cF7>(</span><span class=cF0>let</span><span class=cF7>)</span><span class=cF0>-</span><span class=cF6>'A'</span><span class=cF0>);
|
|
<a name="l87"></a> JukeLines(vol,line,line+2);
|
|
<a name="l88"></a>}
|
|
<a name="l89"></a>
|
|
<a name="l90"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"Misc/TOS"</span><span class=cF0>
|
|
<a name="l91"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> DskChkAll()
|
|
<a name="l92"></a>{</span><span class=cF2>//DskChk on C & D.</span><span class=cF0>
|
|
<a name="l93"></a> </span><span class=cF1>U8</span><span class=cF0> *ptr=TOS_HDS;
|
|
<a name="l94"></a> </span><span class=cF1>while</span><span class=cF0> (*ptr) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l95"></a> </span><span class=cF6>"DskChk('%c')\n"</span><span class=cF0>,*ptr;
|
|
<a name="l96"></a> </span><span class=cF5>DskChk</span><span class=cF0>(*ptr++,</span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l97"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l98"></a>}
|
|
<a name="l99"></a>
|
|
<a name="l100"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>CDoc</span><span class=cF0> *DC2Doc(</span><span class=cF9>CDC</span><span class=cF0> *dc,</span><span class=cF9>I64</span><span class=cF0> dx=0,</span><span class=cF9>I64</span><span class=cF0> dy=0,</span><span class=cF9>I64</span><span class=cF0> *_total_score=</span><span class=cF3>NULL</span><span class=cF0>)
|
|
<a name="l101"></a>{</span><span class=cF2>//Use OCR to make a text DolDoc from CDC.</span><span class=cF0>
|
|
<a name="l102"></a> </span><span class=cF1>U8</span><span class=cF0> byte_bit_cnts[256];
|
|
<a name="l103"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,*ptr,row,col,ch,best_ch,score,best_score,
|
|
<a name="l104"></a> cur_char_image,diff_image,total_score=0;
|
|
<a name="l105"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF5>DocNew</span><span class=cF0>;
|
|
<a name="l106"></a>
|
|
<a name="l107"></a> </span><span class=cF5>MemSet</span><span class=cF0>(byte_bit_cnts,0,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>byte_bit_cnts</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l108"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<256;i++)
|
|
<a name="l109"></a> </span><span class=cF1>for</span><span class=cF0> (j=0;j<7;j++)
|
|
<a name="l110"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&i,j</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l111"></a> byte_bit_cnts[i]++;
|
|
<a name="l112"></a>
|
|
<a name="l113"></a> </span><span class=cF1>for</span><span class=cF0> (row=0;row<dc->height/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;row++) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l114"></a> </span><span class=cF1>for</span><span class=cF0> (col=0;col<dc->width/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;col++) {
|
|
<a name="l115"></a>
|
|
<a name="l116"></a> cur_char_image=0;
|
|
<a name="l117"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;i++)
|
|
<a name="l118"></a> </span><span class=cF1>for</span><span class=cF0> (j=0;j<</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;j++)
|
|
<a name="l119"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>GrPeek</span><span class=cF7>(</span><span class=cF0>dc,col*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>+j+dx,row*</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>+i+dy</span><span class=cF7>)</span><span class=cF0>!=</span><span class=cF3>WHITE</span><span class=cF0>)
|
|
<a name="l120"></a> </span><span class=cF5>LBts</span><span class=cF0>(&cur_char_image,i*8+j);
|
|
<a name="l121"></a>
|
|
<a name="l122"></a> best_score=</span><span class=cF3>I64_MAX</span><span class=cF0>;
|
|
<a name="l123"></a> best_ch=0;
|
|
<a name="l124"></a> ptr=&</span><span class=cFB>text</span><span class=cF0>.font[32];
|
|
<a name="l125"></a> </span><span class=cF1>for</span><span class=cF0> (ch=32;ch<127;ch++) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l126"></a> diff_image=*ptr++ ^ cur_char_image;
|
|
<a name="l127"></a> score=0;
|
|
<a name="l128"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<8;i++)
|
|
<a name="l129"></a> score+=byte_bit_cnts[diff_image.u8[i]];
|
|
<a name="l130"></a> </span><span class=cF1>if</span><span class=cF0> (score<best_score) {
|
|
<a name="l131"></a> best_score=score;
|
|
<a name="l132"></a> best_ch=ch;
|
|
<a name="l133"></a> }
|
|
<a name="l134"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l135"></a> </span><span class=cF1>if</span><span class=cF0> (best_ch==</span><span class=cF6>'$'</span><span class=cF0>)
|
|
<a name="l136"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$$"</span><span class=cF0>);
|
|
<a name="l137"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l138"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%c"</span><span class=cF0>,best_ch);
|
|
<a name="l139"></a> total_score+=best_score;
|
|
<a name="l140"></a> }
|
|
<a name="l141"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"\n"</span><span class=cF0>);
|
|
<a name="l142"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l143"></a> </span><span class=cF1>if</span><span class=cF0> (_total_score) *_total_score=total_score;
|
|
<a name="l144"></a> </span><span class=cF1>return</span><span class=cF0> doc;
|
|
<a name="l145"></a>}
|
|
<a name="l146"></a>
|
|
<a name="l147"></a>#</span><span class=cF1>define</span><span class=cF0> MEM_TEST_SIZE 1024*1024
|
|
<a name="l148"></a></span><span class=cF1>U0</span><span class=cF0> MemTest()
|
|
<a name="l149"></a>{
|
|
<a name="l150"></a> </span><span class=cF1>U8</span><span class=cF0> *b;
|
|
<a name="l151"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>sys_data_bp</span><span class=cF0>->alloced_u8s-</span><span class=cFB>sys_data_bp</span><span class=cF0>->used_u8s>0x1000000) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l152"></a> b=</span><span class=cF5>MAlloc</span><span class=cF0>(MEM_TEST_SIZE,</span><span class=cF5>Fs</span><span class=cF0>->data_heap);
|
|
<a name="l153"></a> </span><span class=cF5>MemSet</span><span class=cF0>(b,0x88,</span><span class=cF5>MSize</span><span class=cF7>(</span><span class=cF0>b</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l154"></a> </span><span class=cF6>"Data:%X\n"</span><span class=cF0>,</span><span class=cFB>sys_data_bp</span><span class=cF0>->alloced_u8s-</span><span class=cFB>sys_data_bp</span><span class=cF0>->used_u8s;
|
|
<a name="l155"></a> </span><span class=cF5>Yield</span><span class=cF0>;
|
|
<a name="l156"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l157"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>sys_code_bp</span><span class=cF0>->alloced_u8s-</span><span class=cFB>sys_code_bp</span><span class=cF0>->used_u8s>0x1000000) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l158"></a> b=</span><span class=cF5>MAlloc</span><span class=cF0>(MEM_TEST_SIZE,</span><span class=cF5>Fs</span><span class=cF0>->code_heap);
|
|
<a name="l159"></a> </span><span class=cF5>MemSet</span><span class=cF0>(b,0x88,</span><span class=cF5>MSize</span><span class=cF7>(</span><span class=cF0>b</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l160"></a> </span><span class=cF6>"Code:%X\n"</span><span class=cF0>,</span><span class=cFB>sys_code_bp</span><span class=cF0>->alloced_u8s-</span><span class=cFB>sys_code_bp</span><span class=cF0>->used_u8s;
|
|
<a name="l161"></a> </span><span class=cF5>Yield</span><span class=cF0>;
|
|
<a name="l162"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l163"></a>}
|
|
</span></pre></body>
|
|
</html>
|