Graphics Drawing on the NEC Starlet William H. Ball 71735,505 Introduction The DRAW.COM Interpreter DRAW.CO i graphic drawin progra fo th NE Starlet Yo ca us th progra t dra picture o th Starlet' scree an the dum th pictur t you printer DRAW.CO i no interactive bu i "file-draw progra tha load you ASCI tex fil o command an draw th pictur o you screen Yo ca sav you picture fo late use DRAW.CO feature ove 2 command fo movin aroun th Starlet' scree an creatin an printin images Th synta i simila t Microsof BASIC' drawin commands. With DRAW.COM you can: - addres an tur o o of an o th Starlet' 61,44 pixels - draw lines between any two points on the screen - dra boxes circles an fille boxe o circle o an size - design your own character fonts for drawing - dump your picture to your Tandy or IBM graphic printer I yo can' wait an wan t tr thi program us thi command: DRAW DEMO.DRW or DRAW DRAWME.DRW an hi th Retur key You'l se tha th Starle ca d graphics just as well as its bigger brothers! Thi progra i mini-interprete tha take you ASCI fil o UPPERCAS command an draw picture o th Starlet' screen I yo hav Tand o IB graphi printer yo ca dum the screen t you printe a an poin i th file I'v limite th siz o th ASCI fil t 500 characters bu yo ca chang thi defaul b recompilin th program. Your draw file must be specified on the command. For example, DRAW MYFILE.DRW wil loa DRAW the loa th specifie ASCI tex file I yo d no specif "MYFILE.DRW, DRA wil exi wit "fil no specified error I DRA canno fin "MYFILE.DRW, i wil exi wit "fil no found error. Screen Size Th Starlet' LC resolutio i 48 dot wid (X-axis b 12 dot hig (Y-axis) s X' valu ca b betwee an 480 ca hav valu o t 128 A x, positio o 0, i th uppe lef o th screen. 0,0 ----------------------------------------- 480,0 | | | The NEC's screen is a liquid- | | crystal display of 480 dots | | by 128 dots. The screen corners | | are x,y positions. | | | | | 0,128 ----------------------------------------- 480,128 Design Your Own Fonts I'v als include comman yo ca us t desig you ow characte font o icons Yo ca us matri o u t 1 dot wid an 1 dot high Thi mean yo ca fi abou 3 character o icon i th maximu siz acros th screen mor i yo overla them Abou nin character o icon wil b a hig a th screen Again yo ca chang thi b recompilin th program Thes limit ar becaus Small- ca onl handl integers as large as 32,768. Index of Commands Here's a quick list of the commands and their syntax: Abx,b1,b2,b3,...bx - draw a user-defined character or icon Bx,y - draw a box to x,y Cn - set color to n Dn - move down n units Fn,x,y - draw box to x,y and fill with color n Gn - move north east n units while plotting Hn - move south east n units while plotting In - move south west n units while plotting Jn - move north west n units while plotting K - wait for a keypress before proceeding Ln - move left n units while plotting Mx,y - move to x,y Nx,y - draw line to x,y Pn - dump screen to printer Rn - move right n units while plotting Sx,y str" - move to approx x,y cursor pos and print str Tx,y,r - draw a circle of radius r around x,y Un - move up n units while plotting Vx,y,r - draw a filled circle of radius r around x,y X - XOR screen ; - ignore rest of line (used for comments) $ - end of program, wait for keypress, quit Th dra fil mus b a ASCI fil create b you edito o WordStar' non-documen mode Al command mus b i uppercase Excep fo th single-lette commands al command mus b followe b a integer Yo ma us an characte t separat th x, integers usuall us comma Th command' strin mus b separate fro th intege b space an mus b delimite by a quote mark. See the S command description. Th Starle mus b i th VT-10 mode becaus som of th commands use that terminal's escape sequences. Fo specifi detail concernin th commands refe t th following information. Command Syntax $ Thi characte tell DRAW.CO t wai fo keypress clea th screen, then quit and return to the MENU command line. ; Ignor th line becaus th tex i comment Yo ca us thi comman a reminde an t documen you picture Thi comman shoul b th firs characte o line I yo hav thi comman followin strin o drawin commands don' us an uppercas letters o DRAW.CO wil interpre th comment a commands Fo example, ; THIS IS A COMMENT AND DRAW.COM WILL IGNORE THIS LINE M240,128 ; move to the middle of the screen Abx,b1,b2,b3,...bx Dra characte a th curren x, positio usin th specifie characte definition The b equal th numbe o binar digit an y-axi line o th character an b throug b equal th decima valu o eac o th y-axi lines Thi comman update th curren x, position I thi sound complicated don' worry Here' a exampl t hel you Fo example A9,0,0,0,0,60,6,62,70,59 wil dra a "a o th screen I yo loo closely you'l se the "a" is not like the Starlet's. Here's what the command means. 000000000 A - start definition of 9 lines, 0 for line 1 000000000 0 for line 2 000000000 the character is 9 dots wide 0 for line 3 000000000 0 for line 4 000111100 1111 <-- 60 for line 5 000000110 11 | 6 for line 6 000111110 11111 |-- Look familiar? 62 for line 7 001000110 1 11 | 70 for line 8 000111011 111 11 <-- 59 for line 9 Usin thi approach yo ca desig you ow font o characters I you omi mov (Mx,y comman befor definin an printin th letter th letter wil b printe alon vertica axis Doe anyon ou ther wan t desig cursor-controlle fon editor Usin binar number drive m crazy. Bx,y Dra box usin diagona fro th curren x, positio t x,y I th curren x, positio were 0,0 the command B480,128 woul dra bo th siz o th screen Nic fo borders Thi command does not update the current x,y position. Cn Dra usin th specifie color wher equa fo o o fo off I you'r jus starting includ "C1 a th firs comman i you file Thi comman doe no affec th curren x, position. Dn Move dow times plottin do eac time Yo ca us thi command alon wit I G H J L R an U t dra character too bu prefe th command Thi comman update th curren x, position. Fn,x,y Dra bo fro th curren x, positio o diagona t th specifie x, position an us th specifie colo t fil th box Th color n ca b o 1 Thi comman doe no update the current x,y position. Gn Mov north east units plottin do alon th way Thi command updates the current x,y position. Hn Move south east n units, plottin do alon th way Thi command updates the current x,y position. In Move south west n units, plottin do alon th way Thi command updates the current x,y position. Jn Move north west n units, plottin do alon th way Thi command updates the current x,y position. K Wai fo keypres befor proceeding Don' us thi comman i yo hav XOR' th screen Th keypres wil b echoe t th scree a th curren curso (no x,y position creatin hol i you picture Thi comman i helpfu i yo ar testin portion o you dra file DRAW.CO wil wai fo keypres a th en o fil a default. Ln Mov lef units plottin do alon th way Thi comman updates the current x,y position. Mx,y Mov t specifie do position Thi comman update th curren x, position bu doe no dra lin fro th previou x, positio o plo do a th specifie position Us thi comman t mov aroun th scree an positio fo draw. Nx,y Dra lin fro th curren x, positio t th specifie x, position. This command does not update the current x,y position. Pn Dum th scree t you printer I equal 1 th printe i Tand printer I equal 2 th printe i a IB graphi printer. Rn Mov righ units plottin do alon th way Thi comman update the current x,y position. Sx,y str" Mov t specifie x, positio an prin th string Thi comman calculate th curso positio b dividin b an b 8 Fo example, S240,64 At center" wil mov th curso t characte 40 (24 divide b equal 40) an lin (6 divide b equal 8) Thi comman i no a flexibl a th command bu i faste becaus i use th Starlet' VT-10 curso positionin sequence Th curso positio i calculate b intege division s th an value wil b rounde down I yo omi th en quote th scree wil b cleare an you'l receiv a erro message Thi comman doe no updat th curren x, position bu i doe updat th current cursor position. Tx,y,r Dra circl o radiu aroun th specifie x, position Thi command updates the current x,y position. Un Mov u units plottin do alon th way Thi comman updates the current x,y position. Vx,y,r Dra fille circl o radiu aroun th specifie x, position. This command updates the current x,y position. X Thi comman XOR th screen Thi mean th blac dot wil becom whit an th whit dot wil becom black Thi comman does not affect the current x,y position. A Note About DRAW.COM Th progra doe littl error-checking s b careful o yo ma en u drawin picture of th Starlet' screen. You pictur fil i limite t abou 5,00 characters WordSta wil tel yo exactl ho larg you ASCI fil i i yo d ^Q t g t th en o th fil i th non-documen mode DRAW.CO wil exi wit a erro messag i you fil i to large kep thi siz smal s peopl withou NODE' grea Datapa ca ru th program (I yo tr t ru progra large tha 31 o th Starle whe i th 32 CP mode you'l ge "Ba Fil Load error. I yo ru ou o room tr deletin th comments Yo ca als strin severa command o eac line DRAW.CO see you progra a on lon string an load i int memor first s you comman lin ca a wid a 256 characters. Don' forge t plac th Starle i th VT-10 mod vi th OPTIO comman fro th MENU Otherwise th scree wil no b cleare whe DRAW.CO starts an escap sequence wil b echoe t th screen DRAW.CO wil rea you file dra th pictur fro you commands the wai fo keypress clea th scree and quit. Strang thing ma happe i yo tr t defin character large tha 1 dot wid wit th command or forge t inser space o delimiter wher the shoul b fo eac command I'v kep error-checkin t minimu t kee th progra small Don' b afraid to experiment though, and have fun! I yo woul lik th sourc cod t DRAW an doze othe utilitie written just for the Starlet, send $10 to: William H. Ball 4255 Ancona Court Indianapolis, IN 46236