455 lines
49 KiB
HTML
Executable File
455 lines
49 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>"Graphics/Scrn"</span><span class=cF0>
|
|
<a name="l2"></a>
|
|
<a name="l3"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrUpdateTaskODEs</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *task)
|
|
<a name="l4"></a>{
|
|
<a name="l5"></a> </span><span class=cFB>sys_task_being_scrn_updated</span><span class=cF0>=task;
|
|
<a name="l6"></a> </span><span class=cF1>try</span><span class=cF0>
|
|
<a name="l7"></a> </span><span class=cF5>ODEsUpdate</span><span class=cF0>(task);
|
|
<a name="l8"></a> </span><span class=cF1>catch</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l9"></a> </span><span class=cF5>LBts</span><span class=cF0>(&task->win_inhibit,</span><span class=cF3>WIf_SELF_ODE</span><span class=cF0>);
|
|
<a name="l10"></a> </span><span class=cF6>"Exception in WinMgr: Update Task ODEs\n"</span><span class=cF0>;
|
|
<a name="l11"></a> </span><span class=cF5>PutExcept</span><span class=cF0>;
|
|
<a name="l12"></a> </span><span class=cF5>Sleep</span><span class=cF0>(3000);
|
|
<a name="l13"></a> </span><span class=cF5>VGAFlush</span><span class=cF0>;
|
|
<a name="l14"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l15"></a> </span><span class=cFB>sys_task_being_scrn_updated</span><span class=cF0>=</span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l16"></a>}
|
|
<a name="l17"></a>
|
|
<a name="l18"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrUpdateTaskWin</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *task)
|
|
<a name="l19"></a>{ </span><span class=cF2>//Draw a win. Only Core0 tasks have a win.</span><span class=cF0>
|
|
<a name="l20"></a> </span><span class=cF9>CDC</span><span class=cF0> *dc;
|
|
<a name="l21"></a> </span><span class=cF9>CD3I64</span><span class=cF0> saved_scroll;
|
|
<a name="l22"></a> </span><span class=cFB>sys_task_being_scrn_updated</span><span class=cF0>=task;
|
|
<a name="l23"></a> </span><span class=cF1>try</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l24"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&task->display_flags,</span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l25"></a> </span><span class=cF5>TextBorder</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>,task->win_left,task->win_right,task->win_top,
|
|
<a name="l26"></a> task->win_bottom,task->border_attr,task==</span><span class=cFB>sys_focus_task</span><span class=cF0>);
|
|
<a name="l27"></a> </span><span class=cF5>TextRect</span><span class=cF0>(task->win_left,task->win_right,
|
|
<a name="l28"></a> task->win_top,task->win_bottom,task->text_attr<<8);
|
|
<a name="l29"></a> </span><span class=cF1>if</span><span class=cF0> (task==</span><span class=cFB>sys_winmgr_task</span><span class=cF0>) {
|
|
<a name="l30"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>gr</span><span class=cF0>.fp_wall_paper)
|
|
<a name="l31"></a> (*</span><span class=cFB>gr</span><span class=cF0>.fp_wall_paper)(task);
|
|
<a name="l32"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>task->win_inhibit&</span><span class=cF3>WIF_SELF_DOC</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l33"></a> </span><span class=cF5>DocUpdateTaskDocs</span><span class=cF0>(task);
|
|
<a name="l34"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) {
|
|
<a name="l35"></a> </span><span class=cF1>if</span><span class=cF0> (task->draw_it) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l36"></a> dc=</span><span class=cF5>DCAlias</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.dc2,task);
|
|
<a name="l37"></a> (*task->draw_it)(task,dc);
|
|
<a name="l38"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc);
|
|
<a name="l39"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l40"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l41"></a> </span><span class=cF5>WinScrollNull</span><span class=cF0>(task,&saved_scroll);
|
|
<a name="l42"></a> </span><span class=cF5>DrawCtrls</span><span class=cF0>(task);
|
|
<a name="l43"></a> </span><span class=cF5>WinScrollRestore</span><span class=cF0>(task,&saved_scroll);
|
|
<a name="l44"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l45"></a> }
|
|
<a name="l46"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>catch</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> (task!=</span><span class=cF5>Fs</span><span class=cF0> && </span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) {
|
|
<a name="l48"></a> </span><span class=cF5>LBtr</span><span class=cF0>(&task->display_flags,</span><span class=cF3>DISPLAYf_SHOW</span><span class=cF0>);
|
|
<a name="l49"></a> </span><span class=cF6>"Exception in WinMgr: Update Task Win\n"</span><span class=cF0>;
|
|
<a name="l50"></a> </span><span class=cF5>PutExcept</span><span class=cF0>;
|
|
<a name="l51"></a> </span><span class=cF5>Sleep</span><span class=cF0>(3000);
|
|
<a name="l52"></a> </span><span class=cF5>VGAFlush</span><span class=cF0>;
|
|
<a name="l53"></a> }
|
|
<a name="l54"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l55"></a> </span><span class=cFB>sys_task_being_scrn_updated</span><span class=cF0>=</span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l56"></a>}
|
|
<a name="l57"></a>
|
|
<a name="l58"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrUpdateTasks</span><span class=cF0>()
|
|
<a name="l59"></a>{</span><span class=cF2>//Only called by WinMgr</span><span class=cF0>
|
|
<a name="l60"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
|
<a name="l61"></a> </span><span class=cF9>CTask</span><span class=cF0> *task,*task1;
|
|
<a name="l62"></a> </span><span class=cF1>try</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l63"></a> </span><span class=cFB>winmgr</span><span class=cF0>.ode_time=0;
|
|
<a name="l64"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_semas</span><span class=cF0>[</span><span class=cF3>SEMA_UPDATE_WIN_Z_BUF</span><span class=cF0>],0</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l65"></a> </span><span class=cF5>WinZBufUpdate</span><span class=cF0>;
|
|
<a name="l66"></a> task1=task=</span><span class=cFB>sys_winmgr_task</span><span class=cF0>;
|
|
<a name="l67"></a> </span><span class=cF1>do</span><span class=cF0> { </span><span class=cF2>//Loop through Core0 tasks.</span><span class=cF0>
|
|
<a name="l68"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l69"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&task->display_flags,</span><span class=cF3>DISPLAYf_SHOW</span><span class=cF7>)</span><span class=cF0> &&
|
|
<a name="l70"></a> </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>gr</span><span class=cF0>.win_uncovered_bitmap,task->win_z_num</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l71"></a> </span><span class=cF5>GrUpdateTaskWin</span><span class=cF0>(task);
|
|
<a name="l72"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l73"></a> task=task->next_task;
|
|
<a name="l74"></a> } </span><span class=cF1>while</span><span class=cF0> (task!=task1);
|
|
<a name="l75"></a>
|
|
<a name="l76"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<</span><span class=cFB>mp_cnt</span><span class=cF0>;i++) { </span><span class=cF2>//Loop through all cores.</span><span class=cF0>
|
|
<a name="l77"></a> task1=task=</span><span class=cFB>cpu_structs</span><span class=cF0>[i].seth_task;
|
|
<a name="l78"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l79"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l80"></a> </span><span class=cF5>GrUpdateTaskODEs</span><span class=cF0>(task);
|
|
<a name="l81"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l82"></a> task=task->next_task;
|
|
<a name="l83"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (task!=task1);
|
|
<a name="l84"></a> }
|
|
<a name="l85"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>catch</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l86"></a> </span><span class=cF5>PutExcept</span><span class=cF0>(</span><span class=cF3>FALSE</span><span class=cF0>);
|
|
<a name="l87"></a> </span><span class=cF5>Dbg</span><span class=cF0>(</span><span class=cF6>"Exception in WinMgr"</span><span class=cF0>);
|
|
<a name="l88"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l89"></a> </span><span class=cFB>winmgr</span><span class=cF0>.last_ode_time=</span><span class=cFB>winmgr</span><span class=cF0>.ode_time;
|
|
<a name="l90"></a> </span><span class=cFB>ode_alloced_factor</span><span class=cF0>=</span><span class=cF5>LowPass1</span><span class=cF0>(0.1,</span><span class=cFB>ode_alloced_factor</span><span class=cF0>,
|
|
<a name="l91"></a> </span><span class=cF5>Clamp</span><span class=cF7>(</span><span class=cF5>Gs</span><span class=cF0>->idle_factor-0.1,0.2,0.8</span><span class=cF7>)</span><span class=cF0>,1/</span><span class=cFB>winmgr</span><span class=cF0>.fps);
|
|
<a name="l92"></a> </span><span class=cFB>sys_task_being_scrn_updated</span><span class=cF0>=</span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l93"></a>}
|
|
<a name="l94"></a>
|
|
<a name="l95"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrFixZoomScale</span><span class=cF0>()
|
|
<a name="l96"></a>{
|
|
<a name="l97"></a> </span><span class=cFB>gr</span><span class=cF0>.scrn_zoom=</span><span class=cF5>ClampI64</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom,1,</span><span class=cF3>GR_SCRN_ZOOM_MAX</span><span class=cF0>);
|
|
<a name="l98"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom==1) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l99"></a> </span><span class=cFB>gr</span><span class=cF0>.sx=0;
|
|
<a name="l100"></a> </span><span class=cFB>gr</span><span class=cF0>.sy=0;
|
|
<a name="l101"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l102"></a> </span><span class=cFB>gr</span><span class=cF0>.sx=</span><span class=cF5>ClampI64</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.sx,0,</span><span class=cF3>GR_WIDTH</span><span class=cF0>-</span><span class=cF3>GR_WIDTH</span><span class=cF0>/</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom)&~7;
|
|
<a name="l103"></a> </span><span class=cFB>gr</span><span class=cF0>.sy=</span><span class=cF5>ClampI64</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.sy,0,</span><span class=cF3>GR_HEIGHT</span><span class=cF0>-</span><span class=cF3>GR_HEIGHT</span><span class=cF0>/</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom);
|
|
<a name="l104"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l105"></a>}
|
|
<a name="l106"></a>
|
|
<a name="l107"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrScaleZoom</span><span class=cF0>(</span><span class=cF1>F64</span><span class=cF0> scale)
|
|
<a name="l108"></a>{</span><span class=cF2>//Multiply zoom factor larger or smaller.</span><span class=cF0>
|
|
<a name="l109"></a> </span><span class=cF1>F64</span><span class=cF0> s=</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom;
|
|
<a name="l110"></a> </span><span class=cFB>gr</span><span class=cF0>.scrn_zoom=</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom*scale;
|
|
<a name="l111"></a> </span><span class=cF5>GrFixZoomScale</span><span class=cF0>;
|
|
<a name="l112"></a> s/=</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom;
|
|
<a name="l113"></a> </span><span class=cFB>ms</span><span class=cF0>.scale.x*=s;
|
|
<a name="l114"></a> </span><span class=cFB>ms</span><span class=cF0>.scale.y*=s;
|
|
<a name="l115"></a> </span><span class=cFB>ms</span><span class=cF0>.scale.z*=s;
|
|
<a name="l116"></a> </span><span class=cFB>ms</span><span class=cF0>.</span><span class=cF1>offset</span><span class=cF0>.x=</span><span class=cFB>ms</span><span class=cF0>.pos.x-(</span><span class=cFB>ms</span><span class=cF0>.pos.x-</span><span class=cFB>ms</span><span class=cF0>.</span><span class=cF1>offset</span><span class=cF0>.x)*s;
|
|
<a name="l117"></a> </span><span class=cFB>ms</span><span class=cF0>.</span><span class=cF1>offset</span><span class=cF0>.y=</span><span class=cFB>ms</span><span class=cF0>.pos.y-(</span><span class=cFB>ms</span><span class=cF0>.pos.y-</span><span class=cFB>ms</span><span class=cF0>.</span><span class=cF1>offset</span><span class=cF0>.y)*s;
|
|
<a name="l118"></a> </span><span class=cFB>ms</span><span class=cF0>.</span><span class=cF1>offset</span><span class=cF0>.z=</span><span class=cFB>ms</span><span class=cF0>.pos.z-(</span><span class=cFB>ms</span><span class=cF0>.pos.z-</span><span class=cFB>ms</span><span class=cF0>.</span><span class=cF1>offset</span><span class=cF0>.z)*s;
|
|
<a name="l119"></a> </span><span class=cFB>gr</span><span class=cF0>.sx=</span><span class=cFB>ms</span><span class=cF0>.pos.x-</span><span class=cFB>gr</span><span class=cF0>.zoomed_dc->width >>1/</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom;
|
|
<a name="l120"></a> </span><span class=cFB>gr</span><span class=cF0>.sy=</span><span class=cFB>ms</span><span class=cF0>.pos.y-</span><span class=cFB>gr</span><span class=cF0>.zoomed_dc->height>>1/</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom;
|
|
<a name="l121"></a> </span><span class=cF5>GrFixZoomScale</span><span class=cF0>;
|
|
<a name="l122"></a>}
|
|
<a name="l123"></a>
|
|
<a name="l124"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrZoomInScrn</span><span class=cF0>()
|
|
<a name="l125"></a>{
|
|
<a name="l126"></a> </span><span class=cF5>GrFixZoomScale</span><span class=cF0>;
|
|
<a name="l127"></a> </span><span class=cF9>I64</span><span class=cF0> plane,row,col,k,l,
|
|
<a name="l128"></a> d2=</span><span class=cFB>gr</span><span class=cF0>.zoomed_dc->width>>3/</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom,
|
|
<a name="l129"></a> d4=</span><span class=cFB>gr</span><span class=cF0>.zoomed_dc->width_internal>>3,
|
|
<a name="l130"></a> d5=d4-d2*</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom,
|
|
<a name="l131"></a> d3=</span><span class=cFB>gr</span><span class=cF0>.zoomed_dc->height/</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom,
|
|
<a name="l132"></a> d6=(</span><span class=cFB>gr</span><span class=cF0>.zoomed_dc->height-d3)*</span><span class=cFB>gr</span><span class=cF0>.dc1->width_internal>>3,
|
|
<a name="l133"></a> d7=</span><span class=cFB>gr</span><span class=cF0>.zoomed_dc->height%</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom*d4;
|
|
<a name="l134"></a> </span><span class=cF1>U8</span><span class=cF0> *src,*src2,*dst,*src3,*map=</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom_tables[</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom];
|
|
<a name="l135"></a>
|
|
<a name="l136"></a> src=</span><span class=cFB>gr</span><span class=cF0>.dc1->body+</span><span class=cFB>gr</span><span class=cF0>.sx>>3+</span><span class=cFB>gr</span><span class=cF0>.sy*</span><span class=cFB>gr</span><span class=cF0>.dc1->width_internal>>3;
|
|
<a name="l137"></a> dst=</span><span class=cFB>gr</span><span class=cF0>.zoomed_dc->body;
|
|
<a name="l138"></a> </span><span class=cF1>for</span><span class=cF0> (plane=1;plane<0x10;plane<<=1) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l139"></a> row=d3;
|
|
<a name="l140"></a> </span><span class=cF1>while</span><span class=cF0> (row--) {
|
|
<a name="l141"></a> k=</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom;
|
|
<a name="l142"></a> </span><span class=cF1>while</span><span class=cF0> (k--) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l143"></a> src2=src;
|
|
<a name="l144"></a> col=d2;
|
|
<a name="l145"></a> </span><span class=cF1>while</span><span class=cF0> (col--) {
|
|
<a name="l146"></a> src3=&map[*src2++];
|
|
<a name="l147"></a> l=</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom;
|
|
<a name="l148"></a> </span><span class=cF1>while</span><span class=cF0> (l--) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l149"></a> *dst++=*src3;
|
|
<a name="l150"></a> src3+=256;
|
|
<a name="l151"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l152"></a> }
|
|
<a name="l153"></a> l=d5;
|
|
<a name="l154"></a> </span><span class=cF1>while</span><span class=cF0> (l--)
|
|
<a name="l155"></a> *dst++=0;
|
|
<a name="l156"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l157"></a> src+=d4;
|
|
<a name="l158"></a> }
|
|
<a name="l159"></a> l=d7;
|
|
<a name="l160"></a> </span><span class=cF1>while</span><span class=cF0> (l--)
|
|
<a name="l161"></a> *dst++=0;
|
|
<a name="l162"></a> src+=d6;
|
|
<a name="l163"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l164"></a>}
|
|
<a name="l165"></a>
|
|
<a name="l166"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrUpdateTextBG</span><span class=cF0>()
|
|
<a name="l167"></a>{
|
|
<a name="l168"></a> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF1>reg</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0> *dst=</span><span class=cFB>gr</span><span class=cF0>.dc2->body,</span><span class=cF1>reg</span><span class=cF0> </span><span class=cFC>R13</span><span class=cF0> c,row,col,
|
|
<a name="l169"></a> num_rows=</span><span class=cF3>TEXT_ROWS</span><span class=cF0>,num_cols=</span><span class=cF3>TEXT_COLS</span><span class=cF0>,i,j,cur_ch,
|
|
<a name="l170"></a> </span><span class=cF1>reg</span><span class=cF0> </span><span class=cFC>R12</span><span class=cF0> w1=</span><span class=cFB>gr</span><span class=cF0>.dc2->width_internal,w2=-7*w1+8,w3=7*w1,w4=0;
|
|
<a name="l171"></a> </span><span class=cF9>U32</span><span class=cF0> *src=</span><span class=cFB>gr</span><span class=cF0>.text_base;
|
|
<a name="l172"></a> </span><span class=cF1>Bool</span><span class=cF0> blink_flag=</span><span class=cF5>Blink</span><span class=cF0>;
|
|
<a name="l173"></a> </span><span class=cF1>U8</span><span class=cF0> *dst2=dst;
|
|
<a name="l174"></a>
|
|
<a name="l175"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>gr</span><span class=cF0>.pan_text_x||</span><span class=cFB>gr</span><span class=cF0>.hide_col) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l176"></a> </span><span class=cFB>gr</span><span class=cF0>.pan_text_x=</span><span class=cF5>ClampI64</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.pan_text_x,-7,7);
|
|
<a name="l177"></a> j=</span><span class=cF5>AbsI64</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.pan_text_x)/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>+1;
|
|
<a name="l178"></a> num_cols-=j;
|
|
<a name="l179"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>gr</span><span class=cF0>.pan_text_x<0) {
|
|
<a name="l180"></a> src+=j;
|
|
<a name="l181"></a> i=</span><span class=cF3>FONT_WIDTH</span><span class=cF0>*j+</span><span class=cFB>gr</span><span class=cF0>.pan_text_x;
|
|
<a name="l182"></a> } </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l183"></a> i=</span><span class=cFB>gr</span><span class=cF0>.pan_text_x;
|
|
<a name="l184"></a> dst2=dst(</span><span class=cF1>U8</span><span class=cF0> *)+i;
|
|
<a name="l185"></a> w4=j;
|
|
<a name="l186"></a> w3+=j*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
|
<a name="l187"></a>
|
|
<a name="l188"></a> j*=</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
|
<a name="l189"></a> dst(</span><span class=cF1>U8</span><span class=cF0> *)=</span><span class=cFB>gr</span><span class=cF0>.dc2->body;
|
|
<a name="l190"></a> </span><span class=cF1>for</span><span class=cF0> (row=num_rows*</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;row--;) {
|
|
<a name="l191"></a> </span><span class=cF1>for</span><span class=cF0> (col=i;col--;)
|
|
<a name="l192"></a> *dst(</span><span class=cF1>U8</span><span class=cF0> *)++=0;
|
|
<a name="l193"></a> dst(</span><span class=cF1>U8</span><span class=cF0> *)+=w1-i-j;
|
|
<a name="l194"></a> </span><span class=cF1>for</span><span class=cF0> (col=j;col--;)
|
|
<a name="l195"></a> *dst(</span><span class=cF1>U8</span><span class=cF0> *)++=0;
|
|
<a name="l196"></a> }
|
|
<a name="l197"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l198"></a> dst=dst2;
|
|
<a name="l199"></a>
|
|
<a name="l200"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>gr</span><span class=cF0>.pan_text_y||</span><span class=cFB>gr</span><span class=cF0>.hide_row) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l201"></a> </span><span class=cFB>gr</span><span class=cF0>.pan_text_y=</span><span class=cF5>ClampI64</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.pan_text_y,-7,7);
|
|
<a name="l202"></a> j=</span><span class=cF5>AbsI64</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.pan_text_y)/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>+1;
|
|
<a name="l203"></a> num_rows-=j;
|
|
<a name="l204"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>gr</span><span class=cF0>.pan_text_y<0) {
|
|
<a name="l205"></a> src+=w1/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>*j;
|
|
<a name="l206"></a> i=w1*(</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>*j+</span><span class=cFB>gr</span><span class=cF0>.pan_text_y);
|
|
<a name="l207"></a> } </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l208"></a> i=w1*</span><span class=cFB>gr</span><span class=cF0>.pan_text_y;
|
|
<a name="l209"></a> dst2=dst(</span><span class=cF1>U8</span><span class=cF0> *)+i;
|
|
<a name="l210"></a>
|
|
<a name="l211"></a> j*=w1*</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
|
<a name="l212"></a> dst(</span><span class=cF1>U8</span><span class=cF0> *)=</span><span class=cFB>gr</span><span class=cF0>.dc2->body;
|
|
<a name="l213"></a> </span><span class=cF1>for</span><span class=cF0> (row=i;row--;)
|
|
<a name="l214"></a> *dst(</span><span class=cF1>U8</span><span class=cF0> *)++=0;
|
|
<a name="l215"></a> dst(</span><span class=cF1>U8</span><span class=cF0> *)=</span><span class=cFB>gr</span><span class=cF0>.dc2->body+</span><span class=cF3>TEXT_ROWS</span><span class=cF0>*</span><span class=cF3>TEXT_COLS</span><span class=cF0>*</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>-j;
|
|
<a name="l216"></a> </span><span class=cF1>for</span><span class=cF0> (row=j;row--;)
|
|
<a name="l217"></a> *dst(</span><span class=cF1>U8</span><span class=cF0> *)++=0;
|
|
<a name="l218"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l219"></a> dst=dst2;
|
|
<a name="l220"></a>
|
|
<a name="l221"></a> </span><span class=cF1>for</span><span class=cF0> (row=num_rows;row--;) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l222"></a> </span><span class=cF1>for</span><span class=cF0> (col=num_cols;col--;) {
|
|
<a name="l223"></a> cur_ch=*src++;
|
|
<a name="l224"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF7>(</span><span class=cF3>ATTRF_SEL</span><span class=cF0>|</span><span class=cF3>ATTRF_INVERT</span><span class=cF0>|</span><span class=cF3>ATTRF_BLINK</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l225"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF3>ATTRF_SEL</span><span class=cF0>)
|
|
<a name="l226"></a> cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
|
|
<a name="l227"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF3>ATTRF_INVERT</span><span class=cF0>)
|
|
<a name="l228"></a> cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
|
<a name="l229"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF3>ATTRF_BLINK</span><span class=cF0> && blink_flag)
|
|
<a name="l230"></a> cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
|
<a name="l231"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l232"></a> c=</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[cur_ch.u8[1]>>4];
|
|
<a name="l233"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cF9>U64</span><span class=cF0> [</span><span class=cFC>RSI</span><span class=cF0>],</span><span class=cFC>R13</span><span class=cF0>
|
|
<a name="l234"></a> </span><span class=cF1>ADD</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>,</span><span class=cFC>R12</span><span class=cF0>
|
|
<a name="l235"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cF9>U64</span><span class=cF0> [</span><span class=cFC>RSI</span><span class=cF0>],</span><span class=cFC>R13</span><span class=cF0>
|
|
<a name="l236"></a> </span><span class=cF1>ADD</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>,</span><span class=cFC>R12</span><span class=cF0>
|
|
<a name="l237"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cF9>U64</span><span class=cF0> [</span><span class=cFC>RSI</span><span class=cF0>],</span><span class=cFC>R13</span><span class=cF0>
|
|
<a name="l238"></a> </span><span class=cF1>ADD</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>,</span><span class=cFC>R12</span><span class=cF0>
|
|
<a name="l239"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cF9>U64</span><span class=cF0> [</span><span class=cFC>RSI</span><span class=cF0>],</span><span class=cFC>R13</span><span class=cF0>
|
|
<a name="l240"></a> </span><span class=cF1>ADD</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>,</span><span class=cFC>R12</span><span class=cF0>
|
|
<a name="l241"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cF9>U64</span><span class=cF0> [</span><span class=cFC>RSI</span><span class=cF0>],</span><span class=cFC>R13</span><span class=cF0>
|
|
<a name="l242"></a> </span><span class=cF1>ADD</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>,</span><span class=cFC>R12</span><span class=cF0>
|
|
<a name="l243"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cF9>U64</span><span class=cF0> [</span><span class=cFC>RSI</span><span class=cF0>],</span><span class=cFC>R13</span><span class=cF0>
|
|
<a name="l244"></a> </span><span class=cF1>ADD</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>,</span><span class=cFC>R12</span><span class=cF0>
|
|
<a name="l245"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cF9>U64</span><span class=cF0> [</span><span class=cFC>RSI</span><span class=cF0>],</span><span class=cFC>R13</span><span class=cF0>
|
|
<a name="l246"></a> </span><span class=cF1>ADD</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>,</span><span class=cFC>R12</span><span class=cF0>
|
|
<a name="l247"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cF9>U64</span><span class=cF0> [</span><span class=cFC>RSI</span><span class=cF0>],</span><span class=cFC>R13</span><span class=cF0>
|
|
<a name="l248"></a> dst(</span><span class=cF1>U8</span><span class=cF0> *)+=w2;
|
|
<a name="l249"></a> }
|
|
<a name="l250"></a> src+=w4;
|
|
<a name="l251"></a> dst(</span><span class=cF1>U8</span><span class=cF0> *)+=w3;
|
|
<a name="l252"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l253"></a>}
|
|
<a name="l254"></a>
|
|
<a name="l255"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrUpdateTextFG</span><span class=cF0>()
|
|
<a name="l256"></a>{</span><span class=cF2>//See </span><span class=cF4><u>TextBase Layer</u></span><span class=cF2>.</span><span class=cF0>
|
|
<a name="l257"></a> </span><span class=cF9>U32</span><span class=cF0> *src=</span><span class=cFB>gr</span><span class=cF0>.text_base;
|
|
<a name="l258"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,cur_ch,*dst=</span><span class=cFB>gr</span><span class=cF0>.dc2->body,
|
|
<a name="l259"></a> w1=</span><span class=cFB>gr</span><span class=cF0>.dc2->width_internal,w2=7*w1,w4=0,
|
|
<a name="l260"></a> num_rows=</span><span class=cF3>TEXT_ROWS</span><span class=cF0>,num_cols=</span><span class=cF3>TEXT_COLS</span><span class=cF0>,row,col;
|
|
<a name="l261"></a> </span><span class=cF1>U8</span><span class=cF0> *dst_start=</span><span class=cFB>gr</span><span class=cF0>.dc2->body,*dst_end=dst_start+w1*</span><span class=cFB>gr</span><span class=cF0>.dc2->height-7*w1-8;
|
|
<a name="l262"></a> </span><span class=cF1>Bool</span><span class=cF0> blink_flag=</span><span class=cF5>Blink</span><span class=cF0>;
|
|
<a name="l263"></a>
|
|
<a name="l264"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>gr</span><span class=cF0>.pan_text_x||</span><span class=cFB>gr</span><span class=cF0>.hide_col) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l265"></a> </span><span class=cFB>gr</span><span class=cF0>.pan_text_x=</span><span class=cF5>ClampI64</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.pan_text_x,-7,7);
|
|
<a name="l266"></a> j=</span><span class=cF5>AbsI64</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.pan_text_x)/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>+1;
|
|
<a name="l267"></a> num_cols-=j;
|
|
<a name="l268"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>gr</span><span class=cF0>.pan_text_x<0) {
|
|
<a name="l269"></a> src+=j;
|
|
<a name="l270"></a> dst(</span><span class=cF1>U8</span><span class=cF0> *)+=</span><span class=cF3>FONT_WIDTH</span><span class=cF0>*j;
|
|
<a name="l271"></a> }
|
|
<a name="l272"></a> w4=j;
|
|
<a name="l273"></a> w2+=j*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
|
<a name="l274"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l275"></a>
|
|
<a name="l276"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>gr</span><span class=cF0>.pan_text_y||</span><span class=cFB>gr</span><span class=cF0>.hide_row) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l277"></a> </span><span class=cFB>gr</span><span class=cF0>.pan_text_y=</span><span class=cF5>ClampI64</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.pan_text_y,-7,7);
|
|
<a name="l278"></a> j=</span><span class=cF5>AbsI64</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.pan_text_y)/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>+1;
|
|
<a name="l279"></a> num_rows-=j;
|
|
<a name="l280"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>gr</span><span class=cF0>.pan_text_y<0) {
|
|
<a name="l281"></a> src+=w1/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>*j;
|
|
<a name="l282"></a> dst(</span><span class=cF1>U8</span><span class=cF0> *)+=w1*</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>*j;
|
|
<a name="l283"></a> }
|
|
<a name="l284"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l285"></a>
|
|
<a name="l286"></a> </span><span class=cF1>for</span><span class=cF0> (row=num_rows;row--;) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l287"></a> </span><span class=cF1>for</span><span class=cF0> (col=num_cols;col--;) {
|
|
<a name="l288"></a> cur_ch=*src++;
|
|
<a name="l289"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF7>(</span><span class=cF3>ATTRF_UNDERLINE</span><span class=cF0>|</span><span class=cF3>ATTRF_SEL</span><span class=cF0>|</span><span class=cF3>ATTRF_INVERT</span><span class=cF0>|</span><span class=cF3>ATTRF_BLINK</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l290"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF3>ATTRF_SEL</span><span class=cF0>)
|
|
<a name="l291"></a> cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
|
|
<a name="l292"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF3>ATTRF_INVERT</span><span class=cF0>)
|
|
<a name="l293"></a> cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
|
<a name="l294"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF3>ATTRF_BLINK</span><span class=cF0> && blink_flag)
|
|
<a name="l295"></a> cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
|
<a name="l296"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l297"></a> </span><span class=cF1>if</span><span class=cF0> (i=cur_ch.u16[1]&0x3FF+</span><span class=cFB>gr</span><span class=cF0>.pan_text_x+</span><span class=cFB>gr</span><span class=cF0>.pan_text_y<<5) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l298"></a> j=i&0x1F;
|
|
<a name="l299"></a> </span><span class=cF1>if</span><span class=cF0> (j&0x10) j|=~0x1F;
|
|
<a name="l300"></a> i>>=5;
|
|
<a name="l301"></a> </span><span class=cF1>if</span><span class=cF0> (i&0x10) i|=~0x1F;
|
|
<a name="l302"></a> i=w1*i+j;
|
|
<a name="l303"></a> </span><span class=cF1>if</span><span class=cF0> (dst_start<=dst</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>+i<dst_end)
|
|
<a name="l304"></a> </span><span class=cF5>GrRopEquU8NoClipping</span><span class=cF0>(cur_ch&</span><span class=cF7>(</span><span class=cF3>ATTRF_UNDERLINE</span><span class=cF0>+0xFFF</span><span class=cF7>)</span><span class=cF0>,dst</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>+i,w1);
|
|
<a name="l305"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l306"></a> </span><span class=cF5>GrRopEquU8NoClipping</span><span class=cF0>(cur_ch&</span><span class=cF7>(</span><span class=cF3>ATTRF_UNDERLINE</span><span class=cF0>+0xFFF</span><span class=cF7>)</span><span class=cF0>,dst,w1);
|
|
<a name="l307"></a> dst(</span><span class=cF1>U8</span><span class=cF0> *)+=8;
|
|
<a name="l308"></a> }
|
|
<a name="l309"></a> src+=w4;
|
|
<a name="l310"></a> dst(</span><span class=cF1>U8</span><span class=cF0> *)+=w2;
|
|
<a name="l311"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l312"></a>}
|
|
<a name="l313"></a>
|
|
<a name="l314"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DCBlotColor8</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc,</span><span class=cF9>CDC</span><span class=cF0> *img)
|
|
<a name="l315"></a>{
|
|
<a name="l316"></a> </span><span class=cF1>U8</span><span class=cF0> *src=img->body,*b0=dc->body;
|
|
<a name="l317"></a> </span><span class=cF9>I64</span><span class=cF0> j,k,d0=img->width_internal*img->height;
|
|
<a name="l318"></a> </span><span class=cF1>for</span><span class=cF0> (k=0;k<d0;k++) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l319"></a> j=*src++;
|
|
<a name="l320"></a> </span><span class=cF1>if</span><span class=cF0> (j!=</span><span class=cF3>TRANSPARENT</span><span class=cF0>)
|
|
<a name="l321"></a> *b0++=j;
|
|
<a name="l322"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l323"></a> b0++;
|
|
<a name="l324"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l325"></a>}
|
|
<a name="l326"></a>
|
|
<a name="l327"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrUpdateTextModeText</span><span class=cF0>()
|
|
<a name="l328"></a>{
|
|
<a name="l329"></a> </span><span class=cF9>U32</span><span class=cF0> *src=</span><span class=cFB>gr</span><span class=cF0>.text_base;
|
|
<a name="l330"></a> </span><span class=cF9>I64</span><span class=cF0> cur_ch,i=</span><span class=cF3>TEXT_COLS</span><span class=cF0>*</span><span class=cF3>TEXT_ROWS</span><span class=cF0>;
|
|
<a name="l331"></a> </span><span class=cF9>U16</span><span class=cF0> *dst=</span><span class=cFB>text</span><span class=cF0>.vga_text_alias,*dst2=</span><span class=cFB>gr</span><span class=cF0>.vga_text_cache;
|
|
<a name="l332"></a> </span><span class=cF1>Bool</span><span class=cF0> blink_flag=</span><span class=cF5>Blink</span><span class=cF0>;
|
|
<a name="l333"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>LBtr</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_semas</span><span class=cF0>[</span><span class=cF3>SEMA_FLUSH_VGA_IMAGE</span><span class=cF0>],0</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l334"></a> </span><span class=cF1>while</span><span class=cF0> (i--) {
|
|
<a name="l335"></a> cur_ch=*src++;
|
|
<a name="l336"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF3>ATTRF_SEL</span><span class=cF0>)
|
|
<a name="l337"></a> cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
|
|
<a name="l338"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF3>ATTRF_INVERT</span><span class=cF0>)
|
|
<a name="l339"></a> cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
|
<a name="l340"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF3>ATTRF_BLINK</span><span class=cF0>)
|
|
<a name="l341"></a> </span><span class=cF1>if</span><span class=cF0> (blink_flag)
|
|
<a name="l342"></a> cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
|
<a name="l343"></a> *dst++=*dst2++=cur_ch&0x7FFF;
|
|
<a name="l344"></a> }
|
|
<a name="l345"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l346"></a> </span><span class=cF1>while</span><span class=cF0> (i--) {
|
|
<a name="l347"></a> cur_ch=*src++;
|
|
<a name="l348"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF3>ATTRF_SEL</span><span class=cF0>)
|
|
<a name="l349"></a> cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
|
|
<a name="l350"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF3>ATTRF_INVERT</span><span class=cF0>)
|
|
<a name="l351"></a> cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
|
<a name="l352"></a> </span><span class=cF1>if</span><span class=cF0> (cur_ch & </span><span class=cF3>ATTRF_BLINK</span><span class=cF0>)
|
|
<a name="l353"></a> </span><span class=cF1>if</span><span class=cF0> (blink_flag)
|
|
<a name="l354"></a> cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
|
<a name="l355"></a> cur_ch&=0x7FFF;
|
|
<a name="l356"></a> </span><span class=cF1>if</span><span class=cF0> (*dst2!=cur_ch)
|
|
<a name="l357"></a> *dst++=*dst2++=cur_ch;
|
|
<a name="l358"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l359"></a> dst++;
|
|
<a name="l360"></a> dst2++;
|
|
<a name="l361"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l362"></a> }
|
|
<a name="l363"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l364"></a>}
|
|
<a name="l365"></a>
|
|
<a name="l366"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrUpdateVGAGraphics</span><span class=cF0>()
|
|
<a name="l367"></a>{</span><span class=cF2>//Update Graphic Card</span><span class=cF0>
|
|
<a name="l368"></a> </span><span class=cF9>I64</span><span class=cF0> row,plane,d=</span><span class=cFB>gr</span><span class=cF0>.zoomed_dc->width_internal>>6;
|
|
<a name="l369"></a> </span><span class=cF9>U32</span><span class=cF0> *src,*vga,*dst;
|
|
<a name="l370"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom==1)
|
|
<a name="l371"></a> src=</span><span class=cFB>gr</span><span class=cF0>.dc1->body;
|
|
<a name="l372"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l373"></a> </span><span class=cF5>GrZoomInScrn</span><span class=cF0>;
|
|
<a name="l374"></a> src=</span><span class=cFB>gr</span><span class=cF0>.zoomed_dc->body;
|
|
<a name="l375"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l376"></a> dst=</span><span class=cFB>gr</span><span class=cF0>.scrn_image->body;
|
|
<a name="l377"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>LBtr</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_semas</span><span class=cF0>[</span><span class=cF3>SEMA_FLUSH_VGA_IMAGE</span><span class=cF0>],0</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l378"></a> </span><span class=cF1>for</span><span class=cF0> (plane=1;plane<0x10;plane<<=1) {
|
|
<a name="l379"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cF3>VGAP_IDX</span><span class=cF0>,</span><span class=cF3>VGAR_MAP_MASK</span><span class=cF0>);
|
|
<a name="l380"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cF3>VGAP_DATA</span><span class=cF0>,plane);
|
|
<a name="l381"></a> vga=</span><span class=cFB>text</span><span class=cF0>.vga_alias;
|
|
<a name="l382"></a> row=</span><span class=cFB>gr</span><span class=cF0>.zoomed_dc->height;
|
|
<a name="l383"></a> </span><span class=cF1>while</span><span class=cF0> (row--)
|
|
<a name="l384"></a> </span><span class=cF5>GrUpdateLine64FlushCache</span><span class=cF0>(&vga,&src,d,&dst);
|
|
<a name="l385"></a> }
|
|
<a name="l386"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l387"></a> </span><span class=cF1>for</span><span class=cF0> (plane=1;plane<0x10;plane<<=1) {
|
|
<a name="l388"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cF3>VGAP_IDX</span><span class=cF0>,</span><span class=cF3>VGAR_MAP_MASK</span><span class=cF0>);
|
|
<a name="l389"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cF3>VGAP_DATA</span><span class=cF0>,plane);
|
|
<a name="l390"></a> vga=</span><span class=cFB>text</span><span class=cF0>.vga_alias;
|
|
<a name="l391"></a> row=</span><span class=cFB>gr</span><span class=cF0>.zoomed_dc->height;
|
|
<a name="l392"></a> </span><span class=cF1>while</span><span class=cF0> (row--)
|
|
<a name="l393"></a> </span><span class=cF5>GrUpdateLine64</span><span class=cF0>(&vga,&src,d,&dst);
|
|
<a name="l394"></a> }
|
|
<a name="l395"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l396"></a>}
|
|
<a name="l397"></a>
|
|
<a name="l398"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>GrUpdateScrn</span><span class=cF0>()
|
|
<a name="l399"></a>{</span><span class=cF2>//Called by the Window Manager </span><a href="/Wb/Adam/WinMgr.HC.HTML#l271"><span class=cF4>HERE</span></a><span class=cF2>, 30 times a second.</span><span class=cF0>
|
|
<a name="l400"></a> </span><span class=cF9>CDC</span><span class=cF0> *dc;
|
|
<a name="l401"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_VGA</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF2>//if text mode</span><span class=cF0>
|
|
<a name="l402"></a> </span><span class=cF5>GrUpdateTasks</span><span class=cF0>;
|
|
<a name="l403"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l404"></a> </span><span class=cF5>GrUpdateTextBG</span><span class=cF0>;
|
|
<a name="l405"></a> </span><span class=cF5>GrUpdateTextFG</span><span class=cF0>;
|
|
<a name="l406"></a> </span><span class=cF5>GrUpdateTasks</span><span class=cF0>;
|
|
<a name="l407"></a> </span><span class=cF5>DCBlotColor8</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.dc2,</span><span class=cFB>gr</span><span class=cF0>.dc);
|
|
<a name="l408"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l409"></a>
|
|
<a name="l410"></a> dc=</span><span class=cF5>DCAlias</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.dc2,</span><span class=cF5>Fs</span><span class=cF0>);
|
|
<a name="l411"></a> dc->flags|=</span><span class=cF3>DCF_ON_TOP</span><span class=cF0>;
|
|
<a name="l412"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>gr</span><span class=cF0>.fp_final_scrn_update)
|
|
<a name="l413"></a> (*</span><span class=cFB>gr</span><span class=cF0>.fp_final_scrn_update)(dc);
|
|
<a name="l414"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc);
|
|
<a name="l415"></a>
|
|
<a name="l416"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_VGA</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF2>//if text mode</span><span class=cF0>
|
|
<a name="l417"></a> </span><span class=cF5>GrUpdateTextModeText</span><span class=cF0>;
|
|
<a name="l418"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l419"></a> </span><span class=cF5>DCBlotColor4</span><span class=cF0>(</span><span class=cFB>gr</span><span class=cF0>.dc1->body,</span><span class=cFB>gr</span><span class=cF0>.dc2->body,</span><span class=cFB>gr</span><span class=cF0>.dc_cache->body,
|
|
<a name="l420"></a> </span><span class=cFB>gr</span><span class=cF0>.dc2->height*</span><span class=cFB>gr</span><span class=cF0>.dc2->width_internal>>3);
|
|
<a name="l421"></a> </span><span class=cF5>GrUpdateVGAGraphics</span><span class=cF0>;
|
|
<a name="l422"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l423"></a>}
|
|
</span></pre></body>
|
|
</html>
|