mirror of
https://github.com/rricharz/Tek4010.git
synced 2026-04-11 23:12:52 +00:00
dotted and dashed lines added, a few bugs fixed
This commit is contained in:
1
pltfiles/das-dot.plt
Normal file
1
pltfiles/das-dot.plt
Normal file
@@ -0,0 +1 @@
|
||||
5|%[5h'A4t(F4`)L3l*Q2x+W2d,\1p.B0|/G0h0M/t1R/`2X.l3]-x5C-d6H,p7N+|8S+h9Y*t:^*`<D5|$V)l$V)l$B)l<D*`$L*`$V*t$L*t$V+h$L+h$V+|$L+|$V,p$B,p<D-d$L-d$V-x$L-x$V.l$L.l$V/`$L/`$V/t$B/t<D0h$L0h$V0|$L0|$V1p$L1p$V2d$L2d$V2x$B2x<D3l$L3l$V4`$L4`$V4t$L4t$V5h$L5h$V5|$B5|<D)l$V)l<D(x$V5|$V)b%[)l%[)b'A)l'A)b(F)l(F)b)L)l)L(x*Q5|*Q)b+W)l+W)b,\)l,\)b.B)l.B)b/G)l/G(x0M5|0M)b1R)l1R)b2X)l2X)b3])l3])b5C)l5C(x6H5|6H)b7N)l7N)b8S)l8S)b9Y)l9Y)b:^)l:^(x<D5|<D(c$Q0(c*L5(c0A10(c5\15(c;X20)e#Q0,i#Q5/m#C102q#C155u#C206p&HEXAMPLE OF HARDWARE DASHED AND DOTTED LINES$v&\NORMAL VECTORS$v$V$v&Ha*`%[*t'A+h(F+|)L,p*Q-d+W-x,\.l.B/`/G/t0M0h1R0|2X1p3]2d5C2x6H3l7N4`8S4t9Y5h:^5|<D#d$V#d&H
|
||||
@@ -1 +0,0 @@
|
||||
潬釥翢妸妸妸姛<EFBFBD>燚D臜墒鶮{蘉N螾岩S訳V棕YZ埴\{蒉搡!繟B肈牌GH墒K贴MN螾岩S詘UV<EFBFBD>豿YZ<EFBFBD>x\蒉<EFBFBD><EFBFBD>"纗AB<EFBFBD>D牌GH蓌蔏蘉N<EFBFBD>P岩S訳V棕YZ踈蒉搦@鶤鵅肈<EFBFBD>迄GH<EFBFBD>蔏{厅MN}螾<EFBFBD>襸S<EFBFBD>UV棕YZ<EFBFBD>\蒉<EFBFBD><EFBFBD>$繟B肈舩苭G鮄生<EFBFBD>$cK鹛~MルNt象P溲$r裔S<EFBFBD>怎UwVx棕YZ踳\蓥辸搛ダAB肈牌GH墒K蘉N跸P岩S訳V棕YZ踈蒉t辴<EFBFBD>魽tB肈牌GH墒K蘉鮊t螾跹襍鲈UwV讀豗鵝踈蔸辿辿'繟B肈牌麲{H生蔏蘉鵑螾岩S訳V棕xYZ踈<EFBFBD>搡搡(砾AB肈牌GH蓌蔏蘉Nw霄YZ踈蒉搛├AB趺D牌GH墒K迢MN螾跹鲆S訳V柞豗鯶踣\蒉搋<EFBFBD>AB肈舤契GHt墒鮇蘉N螾岩鯯w訳Vx棕wYZ鲔w\x蒉辺+纖A鯞肈捧苩GH墒K蘉Nr蟩Pr氧襼S$j詘U<EFBFBD>V钭豟Y$頩<EFBFBD>踭\q蒹辴辴<EFBFBD>AB竺rD牌GqHr墒K蘱MNr蟩P裷襍q訳V棕YZ垧\蒉摒-繟Bq肈牌G餒墒K蘉N蟩P鹧襍詑UV棕YZr踈蒹揶<EFBFBD>.纓AB趺D雠苭GH墒N螾鲅阴S訳V譼豗Z踣\蓥搋搋<EFBFBD>AtB肈牌GH跎蔏蘴M鮊t螾笱t襍訳V棕YZ踈蒹揶<EFBFBD>0繟B肈牌GHr墒驥蘉Nt螾笱襍訳V棕tYZ踈蒹辴辴崩AB竺tD笈t艷H甚蕋K蘉鮊霄P岩鮏訳V做豾YxZ踈輜辺搦怖AxB肈w碰艷H墒K跆MN螾裻殷St詗U$`Vl<EFBFBD>廿鏨qZ筵f\$t葩蓿蹀<EFBFBD>3纎AqBr皿D跖艷tH笊蕋K蘉N螾岩S訳V棕骙Zt踈蒹揶t蠢AB肈牌驡Ht墒K筇MN蟭P岩S訳V棕Y鮖踈鲚w辺辺5纖AxB脀Dx霹艷H<EFBFBD>蔏蘉N嚣P岩S訳V棕xYZ<EFBFBD>\x蒉搦6纗AB鸣D牌G鶫<EFBFBD>蔏<EFBFBD>M鵑螾岩S詘UV座豿YZ踈<EFBFBD>x揶x防AB肈牌GH墒K贴MNx螾岩S赠UV讀豗Z<EFBFBD>x\甍揶x咐鵄Bx肈霹艷H墒K蘉鶱螾<EFBFBD>寅S訳V棕Y{Z<EFBFBD>\}蒉迃9傈A{B<EFBFBD>}D<EFBFBD>艷{H生蔏蘉N<EFBFBD>P岩S詘U鯲座<EFBFBD>$醂lZ<EFBFBD>ョ\r蒗辤<EFBFBD>$x:纄A<EFBFBD>Br皿Dt捧砌GwHx蓋述K蘉鮊螾仰阴S訳V譼豗Z踈蒉摅焕ABt皿D牌GHr墒驥r蘉N螾岩S訳V棕YZ踈蒉筠<EFBFBD><繟Bt肈跖砌GwH墒Kx蘉wN蟲P岩S訳Vw棕YZ踈蒉辸嚼AB肈牌G鯤w墒K蘉N鱿P褀襍鲈UwV鲎豗Z埘\蒉搋纠AB肈t捧艷H墒K蘴MN跸Pt岩S訳V棕YZ踈蒉辴?繟驜肈牌GH蓃蔏筇MNr螾笱襍訳V棕YZ踈t輺+鸂DD牌GwH生蔏蘉N嚣P褁淫S<EFBFBD>UxV座豗鶽踈x甍搡辿!繟鶥<EFBFBD>鶧霹艷{H<EFBFBD>{蔏<EFBFBD>M鶱螾褅襍渣U{V<EFBFBD>佞YZ{踈<EFBFBD>辿辿"傈AB{肈批艷{H墒鶮厅MN蟵P<E89FB5>襸S訳黇讃豗Z<E8B197>\<EFBFBD>揶<EFBFBD>纚AB<EFBFBD>{Dx牌GHw墒鵎<E5A292>MxNw蟲P样襵Sw詘U鯲w讀豗鵝<E8B197>{\輢迆迃$傈AB肈}牌GH{肾蕂Ke酞麺qN缦隤+e佯襱Sw詘U鵙x座貃Y}Z蹥<5A>\~輾<>揶~ダ<><E38380>A琡B<E790A1>+<2B><>D琡牌GH墒K蘉N<E89889>+<2B><>P褈覛<E8A488>S琡訳+<2B><>V赚`<60>+<2B><>YZ琡<5A>+<2B><>\~輾<>蕃`轥<>+<2B><>A~B琡肈+~舽茪<E888BD>GH~墒K蘉N}螾腰襺S~詝U黇棕{YZ踈蔸揶{'历AB{肈批艷H墒K{厅M{N销P<E99480>寅S訳鵙棕鶼{Z埴\<EFBFBD>揶{(繟鶥肈牌G鵋蓌戍K{蘉鶱螾岩{S訳V<E8A8B3>豗{Z踈<5A>搡搡├鵄B<E9B584>D牌GH墒{K铁M鵑销P岩鵖x赠UV<55>伫YZ<59>\<EFBFBD>x搦搡<EFBFBD>{A鶥鸣D<E9B8A3><44>xG鵋墒xK蘉鯪跸鯬氧襍w訳xV鲎仵YwZ埚\w蒉鲛<EFBFBD>+繟Bw肈批苳G鶫墒鵎<E5A292>M{N<>Px氧翼S湓<53>UqVi诅貧<E8AF85>Y+鞿r踈t蒗辸搛<E8BEB8>AxB<78>{D劈艷}H墒K厅M{N<>P{腰襺S<E8A5BA>}U黇}讃豗黌踼\<EFBFBD>}揶<>-纝AB~脈D<E88488>{艷xH<78><48>}K~厅M鶱{嚣P<E59AA3>{襍訳鶹讀伫Y鶽w踈x輜搋辸.纗A鯞w悯D碰契GtH肾蔏t蘉鮊霄Pt岩鮏t訳鮒t柞豻YZ踣骪蒉t摅<74>AB趺驞q舝企G鯤跎r鼠K条MtN螾氧襍笤qU骎t做豗Z踣鯸踺鲛筠<E9B29B>0繟魾雒Dw碰苩GoHq蓆述Kw蘴M鮊w螾t仰阴Sx訳wV鲎踟wY鮖筵鵟輜搋辴崩wA{B<>D雠x苭GH蓆述Kw蘉xN{嚣P鲅t殷S詏UrVx棕wY骦踣\輖揶r怖驛tB趺tD笈t苭GxH声蕏K<EFBFBD>MxNw硝P鲅襵S<EFBFBD>wU頥e转<EFBFBD>骙鑊e埴\+j蓓揞辭3纑A養r悯D雠苭GxHw墒K贴M鶱嚣P<E59AA3>襵S扎U鵙x棕鵜Zx垸\輝搡搦蠢鶤xB<EFBFBD>鶧x霹弃G鵋墒{K<>wMN<4D>鵓x样襵Sw詘U鮒t譿佞YxZw踈鲚辺搋5繟鯞趺tD跖笃tG鮄笊r鼠Kr条MtN跸驪t氧殷Sr泽UtV笞r伢YrZ埘\輖農農6纐ArB竺rD朋苢G驢蓃鼠Kq蘲MtN跸驪r裻襍笤tUqVr柞豶YqZ筵t\筝揶r防驛tB皿Dr舤契GH笊蔏t蘉N硝P笱r襍怎UVt柞豻Y鮖踭\蒹辴搋咐tA驜t悯Dt牌鮃Ht审蕋K腆MtN跸Pt岩rS訳qV鹱q仞YqZr踈疠r揶<EFBFBD>9纐AoB灭Dq牌餑qH笊q蕆Kt蘹MwN蟭Pw褁阴S鲈鮑V譼仞YeZ獂垲\c輅辸<EFBFBD>+<2B>:纋A驜r胵D笈r苢GH錾<48>鵎<EFBFBD>鵐xN销Px褀姻Sx詞U鶹x座豗xZ}踈<><E8B888>x搡焕麬xB命D}劈迄G鶫}蓒庶K<E5BAB6>wM鵑{销P<E99480>}襸S<E8A5B8>{U鶹<55>佞YZ<59>x\鲚蹀<EFBFBD>x<繟魾<E7B99F>鶧舩苭GHt肾蔏蘷MN鱿Pw仰阴S訳wVx譿伥YwZ埘\蒉<EFBFBD><EFBFBD>纖AB雒鮀w舩苭G鮄w蓌蔏w条MtN笙wP<EFBFBD>w襍x訳V踝豾Y鯶踣x\<EFBFBD>辺辺纠鵄wBt闽D<EFBFBD>艷鶫声术K鎏鶰Nx蟱P鲅<EFBFBD>{S<>xU鵙讀伫YZw踈<77>x搛搦?历AxB鸣D舩苭GH蓌戍K<E6888D>wMN<4D>鵓x样襵S詗UxVw柞豻YZr垠\w輝揶迻3鶢DD牌G鶫<47>竖K贴M鶱螾岩S訳V棕YZ踈甍揶<E7948D>!繟B肈牌GH墒K蘉xN嚣Px岩S訳V棕YZ踈蒉辺"繟B肈牌GH墒K蘉N螾岩S訳V棕YZ踈蒉辺@A鵅铭D舺艷H墒K铁M鵑x蟱P鲅跻鯯怎UtV柞伥YwZ<EFBFBD>\x蒉辺$砾AB铭D牌麲<EFBFBD><EFBFBD>H碿蒵蕎K5馓鐼iNc洗驪3<EFBFBD>i也鵖笤鵘3`V枳o豻YwZx踈蒉辺ダ鵄Bx肈霹艷H墒K蘉N螾岩S訳V<EFBFBD>伫Y鶽踈蒉辿<EFBFBD>鶤{B肈牌麲H墒K}蘉麼}螾岩S訳黇}棕YZ踈蔹揶<EFBFBD>'繟B肈{牌GH墒K蘉N螾岩S訳V棕YZ踈<5A>{揶{(繟B铭D牌GH墒K<E5A292>M鶱<4D>P岩Sx訳V棕YZ踈w蒉x辸├AB肈牌GH墒K蘉鯪w螾仰襴S訳鯲譿豗Z踈蓥揶w<E68FB6>AB肈牌鯣wH墒Kx蘉鵑销P样襍詘UwV鲎踟tYZ踈筝農摅+纓A魾雒D牌鮃鯤蓋蔏鎏wMN<4D>黀<EFBFBD><E9BB80>汛e襯S~<7E>5銾鏥c状t<E78AB6>3{Y鏩瞱垧\筝{<7B>3c辥<63>預rB竺tD牌G鮄墒K蘉N螾岩鯯訳V棕鮕Z踈蒉搋-繟鯞趺D雠跗GH錾蔏蘉N蟱P岩S詘UV棕YZ踈蒉辺.繟B脀D牌GH墒K迢MN螾岩S怎UV譼豗鮖踈蒉搋<E89289>A鯞悯D牌GH墒K蘉N蟭P洋襱S笤UV棕YZr垠\輗辯農0繟Bq肈r牌qGrH蓂蔏蘉Nr螾岩S訳Vq棕YZr踈蒉農崩AqBr肈q舝艷qH墒K蘉rN笙P裻襍泽UtV笞豶YqZ疔\o蓊辭揞怖鞟lB砻oD鹋q苧GqH鹕o署K蘱M餘q螾洋姻S<EFBFBD>瘁UlVx<EFBFBD>5`豤Y礆<59>Zr<5A>3{\栎瞱揄揄3纓A麭3崦鏒肱钇oG頗o墒K蘉餘蟧P佯襍詏UV棕Y餤踥\蒺揶鸫纎AB灭Do牌GH墒餕蘉N螾岩Sq訳V棕YZ踈蒉農5繟qBr肈牌驡H蓃蔏蘉N螾岩qS詒UqV棕YZ踈蒉辯6繟rB胵D牌GH蓃蔏q蘉N橡Pq岩餝訳V棕YZ踥\蒉疝o防AB鹈oD牌GH墒K蘉N螾岩餝詏UV鹱豗oZ踈疠o摒摒咐AB肈牌GHq绅蔏蘉No橡P裶襍詒UV棕YZ踧\疠o揞揞9理A頑胠D彭祁GoHq墒K鹛MqN螾裷襍泽UwV{状`仉YxZ5`踓\`荽t<E88DBD>3~辥:啦鵄頑o闽D}<7D>3c苅G鞨o绅蕅K蘉Nr螾岩S笤UrV笞豗Z踈蒉摅焕AB胻D牌GH墒K跆MN鱿P岩S詗UV棕xYZ踳\x蒉辺<繟鵅脁D<E88481>艷H墒K蘉N螾岩xS訳V棕wYxZ踳\輝揶x嚼AB肈牌鵊H蓌戍K蘹MN螾岩S詗UV棕YZ踈蓥揶鼍繟B肈牌GH墒K蘉N跸P鲅阴S訳鯲踝豗Z踈蓥搋搋?繟鯞悯D牌GH墒K蘉N鱿P跹襍增UVw棕YZ踈蓥揶迻痻κ熢臟砸螻韶犜<E99FB6>00矤G褹PH擅犆螹PU耘覡耘襇蒒A<E89292><1D>κ烝ND牬60睜HA褼犆螾Y燯N稍.lκ煚牋牋牋牋牋牋燰AD燝褹PH擅犈D稍弦-靓薀煃
|
||||
189
tek4010.c
Normal file → Executable file
189
tek4010.c
Normal file → Executable file
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#define DEBUG 0 // print debug info
|
||||
#define DEBUGMAX 100 // maximum number of bytes to process in debug mode
|
||||
#define DEBUGMAX 0 // exit after DEBUGMAX chars, 0 means no exit
|
||||
|
||||
#define REFRESH_INTERVAL 30 // time in msec between refresh events
|
||||
|
||||
@@ -65,6 +65,10 @@ int isBrightSpot = 0; // set if there is currently a bright sp
|
||||
int count = 0;
|
||||
static int x0,y0,x2,y2,xh,xl,yh,yl,xy4014;
|
||||
|
||||
enum LineType {SOLID,DOTTED,DOTDASH,SHORTDASH,LONGDASH};
|
||||
enum LineType ltype;
|
||||
double dashset[] = {2,6,2,2,6,3,3,3,6,6};
|
||||
|
||||
static int plotPointMode = 0; // plot point mode
|
||||
static int writeThroughMode = 0; // write through mode
|
||||
static int debugCount = 0;
|
||||
@@ -146,7 +150,7 @@ int isInput()
|
||||
ioctl(getDataPipe[0], FIONREAD, &bytesWaiting);
|
||||
if (DEBUG) {
|
||||
debugCount++;
|
||||
if (debugCount > DEBUGMAX) return 0;
|
||||
if (DEBUGMAX && (debugCount > DEBUGMAX)) return 0;
|
||||
}
|
||||
if (bytesWaiting == 0) {
|
||||
// reset the baud rate counter
|
||||
@@ -340,7 +344,7 @@ void tek4010_init(int argc, char* argv[])
|
||||
setbuf(putKeys,0);
|
||||
|
||||
mSeconds(); // initialize the timer
|
||||
u100ResetSeconds(1);
|
||||
u100ResetSeconds(1);
|
||||
}
|
||||
|
||||
int tek4010_on_timer_event()
|
||||
@@ -425,6 +429,7 @@ void clearPersistent(cairo_t *cr, cairo_t *cr2)
|
||||
cairo_paint(cr2);
|
||||
isBrightSpot = 1;
|
||||
plotPointMode = 0;
|
||||
ltype = SOLID;
|
||||
}
|
||||
|
||||
void clearSecond(cairo_t *cr2)
|
||||
@@ -436,9 +441,40 @@ void clearSecond(cairo_t *cr2)
|
||||
cairo_set_operator(cr2, CAIRO_OPERATOR_OVER);
|
||||
}
|
||||
|
||||
void tek4010_line_type(cairo_t *cr, cairo_t *cr2, enum LineType ln)
|
||||
{
|
||||
int ndash,ndx;
|
||||
double ofs = 0.5;
|
||||
|
||||
switch (ln) {
|
||||
case SOLID:
|
||||
ndx = 0;
|
||||
ndash = 0;
|
||||
break;
|
||||
case DOTTED:
|
||||
ndx = 0;
|
||||
ndash = 2;
|
||||
break;
|
||||
case DOTDASH:
|
||||
ndx = 2;
|
||||
ndash = 4;
|
||||
break;
|
||||
case LONGDASH:
|
||||
ndx = 8;
|
||||
ndash = 2;
|
||||
break;
|
||||
case SHORTDASH:
|
||||
ndx = 6;
|
||||
ndash = 2;
|
||||
break;
|
||||
}
|
||||
cairo_set_dash (cr,&dashset[ndx],ndash,ofs);
|
||||
cairo_set_dash (cr2,&dashset[ndx],ndash,ofs);
|
||||
}
|
||||
|
||||
void drawVector(cairo_t *cr, cairo_t *cr2,int x0,int y0,int x2,int y2)
|
||||
{
|
||||
// printf("write-through-mode=%d\n", writeThroughMode);
|
||||
if (DEBUG) printf("******************************************** Drawing to (%d,%d)\n",x2,y2);
|
||||
if (writeThroughMode) {
|
||||
cairo_set_line_width (cr2, 1);
|
||||
cairo_set_source_rgb(cr2, 0.0, 1.0, 0.0);
|
||||
@@ -448,6 +484,7 @@ void drawVector(cairo_t *cr, cairo_t *cr2,int x0,int y0,int x2,int y2)
|
||||
}
|
||||
|
||||
else {
|
||||
tek4010_line_type(cr, cr2, ltype);
|
||||
cairo_move_to(cr, x0, windowHeight - y0);
|
||||
cairo_line_to(cr, x2, windowHeight - y2);
|
||||
cairo_stroke (cr);
|
||||
@@ -477,6 +514,66 @@ void drawVector(cairo_t *cr, cairo_t *cr2,int x0,int y0,int x2,int y2)
|
||||
isBrightSpot = 1; // also to be set if writeThroughMode
|
||||
}
|
||||
|
||||
int escapeCodeHandler(cairo_t *cr, cairo_t *cr2, int todo, int ch)
|
||||
// handle escape sequencies
|
||||
// returns todo to allow changes to todo
|
||||
{
|
||||
if (DEBUG) printf("Escape mode, ch=%02X\n",ch);
|
||||
switch (ch) {
|
||||
case 12:
|
||||
if (DEBUG) printf("Form feed, clear screen\n");
|
||||
clearPersistent(cr,cr2);
|
||||
mode = 0;
|
||||
break;
|
||||
case '[':
|
||||
// a second escape code follows, do not reset mode
|
||||
break;
|
||||
|
||||
// start of ignoring ANSI escape sequencies, could be improved (but the Tek4010 couldn't do this either!)
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9': break;
|
||||
case ';': mode = 31; break;
|
||||
case ']': break;
|
||||
case 'm': mode = 0; break;
|
||||
|
||||
// end of ignoring ANSI escape sequencies
|
||||
|
||||
case '`': ltype = SOLID; writeThroughMode = 0; mode = 0; break;
|
||||
case 'a': ltype = DOTTED; writeThroughMode = 0; mode = 0; break;
|
||||
case 'b': ltype = DOTDASH; writeThroughMode = 0; mode = 0; break;
|
||||
case 'c': ltype = SHORTDASH;writeThroughMode = 0; mode = 0; break;
|
||||
case 'd': ltype = LONGDASH; writeThroughMode = 0; mode = 0; break;
|
||||
case 'e': ltype = SOLID; writeThroughMode = 0; mode = 0; break;
|
||||
case 'f': ltype = SOLID; writeThroughMode = 0; mode = 0; break;
|
||||
case 'h': ltype = SOLID; writeThroughMode = 0; mode = 0; break;
|
||||
|
||||
// todo is set here to zero to achieve some synchronization with screen refresh cycle
|
||||
case 'p': ltype = SOLID; writeThroughMode = 1; mode = 101; showCursor = 0; todo = 0; break;
|
||||
case 'q': ltype = DOTTED; writeThroughMode = 1; mode = 101; showCursor = 0; todo = 0; break;
|
||||
case 'r': ltype = DOTDASH; writeThroughMode = 1; mode = 101; showCursor = 0; todo = 0; break;
|
||||
case 's': ltype = SHORTDASH;writeThroughMode = 1; mode = 101; showCursor = 0; todo = 0; break;
|
||||
case 't': ltype = LONGDASH; writeThroughMode = 1; mode = 101; showCursor = 0; todo = 0; break;
|
||||
case 'u': ltype = SOLID; writeThroughMode = 1; mode = 101; showCursor = 0; todo = 0; break;
|
||||
case 'v': ltype = SOLID; writeThroughMode = 1; mode = 101; showCursor = 0; todo = 0; break;
|
||||
case 'w': ltype = SOLID; writeThroughMode = 1; mode = 101; showCursor = 0; todo = 0; break;
|
||||
|
||||
default:
|
||||
printf("Escape code %02X not implemented\n",ch);
|
||||
mode = 0;
|
||||
break;
|
||||
}
|
||||
return todo;
|
||||
|
||||
}
|
||||
|
||||
void tek4010_draw(cairo_t *cr, cairo_t *cr2, int first)
|
||||
// draw onto the main window using cairo
|
||||
// width is the actual width of the main window
|
||||
@@ -500,8 +597,7 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int first)
|
||||
first = 0;
|
||||
|
||||
if (windowWidth == 1024) efactor = 0.0;
|
||||
else efactor = windowWidth / 1024.0;
|
||||
|
||||
else efactor = windowWidth / 1024.0;
|
||||
}
|
||||
|
||||
long startPaintTime = mSeconds(); // start to measure time for this draw operation
|
||||
@@ -534,6 +630,7 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int first)
|
||||
}
|
||||
|
||||
if (plotPointMode) todo = 4 * TODO;
|
||||
else if (writeThroughMode) todo = 8 * todo;
|
||||
else todo = TODO;
|
||||
|
||||
do {
|
||||
@@ -557,6 +654,10 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int first)
|
||||
if ((ch>='0') && (ch<='9')) mode = 30;
|
||||
}
|
||||
|
||||
if (ch == 27) { // escape code
|
||||
mode = 30; return;
|
||||
}
|
||||
|
||||
int tag = (ch >> 5) & 3;
|
||||
|
||||
if ((mode >= 1) && (mode <= 8)) {
|
||||
@@ -623,7 +724,7 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int first)
|
||||
}
|
||||
else {
|
||||
if (ch == 29) mode = 1; // group separator
|
||||
else if (DEBUG) printf("Plot mode, unknown char %d, plotPointMode = %d\n",ch,plotPointMode);
|
||||
else printf("Plot mode, unknown char %d, plotPointMode = %d\n",ch,plotPointMode);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -739,68 +840,18 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int first)
|
||||
mode = 5;
|
||||
|
||||
break;
|
||||
case 30: // handle escape sequencies
|
||||
if (DEBUG) printf("Escape mode, ch=%02X\n",ch);
|
||||
switch (ch) {
|
||||
case 12:
|
||||
if (DEBUG) printf("Form feed, clear screen\n");
|
||||
clearPersistent(cr,cr2);
|
||||
mode = 0;
|
||||
break;
|
||||
case '[': // a second escape code follows, do not reset mode
|
||||
break;
|
||||
|
||||
// start of ignoring ANSI escape sequencies, could be improved (but the Tek4010 couldn't do this either!)
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9': break;
|
||||
case ';': mode = 31; break;
|
||||
case ']': break;
|
||||
case 'm': mode = 0; break;
|
||||
// end of ignoring ANSI escape sequencies
|
||||
|
||||
case '`':
|
||||
case 'a':
|
||||
case 'b':
|
||||
case 'c':
|
||||
case 'd':
|
||||
case 'e':
|
||||
case 'f':
|
||||
case 'h': writeThroughMode = 0;
|
||||
if (DEBUG) printf("normal-mode activated\n");
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
case 'q':
|
||||
case 'r':
|
||||
case 's':
|
||||
case 't':
|
||||
case 'u':
|
||||
case 'v':
|
||||
case 'w': writeThroughMode = 1;
|
||||
if (DEBUG) printf("write-through-mode activated\n");
|
||||
mode = 101; // ignore until group separator, not yet implemented
|
||||
break;
|
||||
default:
|
||||
if (DEBUG) printf("Escape code %d not implemented\n",ch);
|
||||
mode = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 30:
|
||||
todo = escapeCodeHandler(cr, cr2, todo, ch);
|
||||
break;
|
||||
case 40: // used to ignore certain 4014 sequencies
|
||||
if (ch == 31) mode = 0; // leave this mode
|
||||
break;
|
||||
case 101: if (DEBUG) printf("Ignore until group separator, ch = %02x\n", ch);
|
||||
case 101:
|
||||
if (DEBUG) printf("Ignore until group separator, ch = %02x\n", ch);
|
||||
if (ch == 29) mode = 1;
|
||||
break;
|
||||
default: switch (ch) {
|
||||
default:
|
||||
switch (ch) {
|
||||
case 0: break;
|
||||
case 7: // bell function, delay 0.1 sec
|
||||
// cannot delay if bright spot is on, needs to be turned off first
|
||||
@@ -824,7 +875,7 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int first)
|
||||
if (y0 < 4) {
|
||||
y0 = windowHeight - vDotsPerChar;
|
||||
if (leftmargin) leftmargin = 0;
|
||||
else leftmargin = windowHeight / 2;
|
||||
else leftmargin = windowWidth / 2;
|
||||
}
|
||||
if (!argRaw) x0 = leftmargin;
|
||||
break;
|
||||
@@ -834,10 +885,10 @@ void tek4010_draw(cairo_t *cr, cairo_t *cr2, int first)
|
||||
case 13: // return
|
||||
mode = 0; x0 = leftmargin;
|
||||
break;
|
||||
case 27: // escape
|
||||
mode = 30;
|
||||
// printf("Starting escape mode\n");
|
||||
break;
|
||||
// case 27: // escape
|
||||
// mode = 30;
|
||||
// // printf("Starting escape mode\n");
|
||||
// break;
|
||||
case 28: // file separator
|
||||
if (DEBUG) printf("Point plot mode\n");
|
||||
mode = 5;
|
||||
|
||||
Reference in New Issue
Block a user