z : *************: ** GRAFGEN **: *************(:2: by Wes Meier<: 230 B Park Lake CircleF: Walnut Creek, CA 94598"P:>Z: June/July 1982Fd:rn: Requires Color Adapter, BASICA,x: and, optionally, IBM or Epson: (MX-80 or MX-100) equipped with: the GRAFTRAX ROMs.:  (  , , AZK GRID (),REDBOX (), YELLOWBOX ()Qk GC(G,C)(G)C EXC(C)(C)Q$("): Quote Marks: Set up graphics grid. X I  (X,)(X,H),", Y  I 6 (,Y)(H,Y),@3J (,)(H,H),GRID9TP^: Set up cursor.gh (,)(,),,BFr (,)(,),REDBOX|: Set up graphics block. (,)(,),,BF (,)(,),YELLOWBOX  : Set up Main Menu Key Vectors.% () 6 () G ()  X () \i () zz ()  ()  () 8 () V ( ) & ( ) 0 ( ) : ( ) HD () z%N: Turn on Key Trapping.4X X @b (X) FlLvn: Main Menu Key Subroutines: F1 Sub. Set Block.T(GC(GN,ROW)) T EXC(COL) : Block already set. (COL,ROW),YELLOWBOX,:Set block.TTEXC(COL)<(GC(GN,ROW)),T:Put it in memory.B_: F2 Sub. Reset block.uT(GC(GN,ROW)) (T EXC(COL)) : Cell not set. Return. (COL,ROW),YELLOWBOX: Reset Block (XOR).TTEXC(COL) : Put cursor there.:  :Put in mem. and return.U: F3 Sub. Fill grid.n K: All dots on.~* ROW 4 GC(GN,ROW),K>H  R: F4 Sub. Clear grid.\K: All dots off.f *: Use fill routine.p: F5 Sub. Fill Current column.+z ROW AP(GC(GN,ROW))] (P EXC(COL)) oPPEXC(COL) GC(GN,ROW),P H: F7 Sub. Fill Current Row. GC(GN,ROW), H: F6 Sub. Reset Current Column.  ROW !P (GC(GN,ROW))? (P EXC(COL)) QPPEXC(COL)e GC(GN,ROW),Pku$ H.: F8 Sub. Reset Current Row.8 GC(GN,ROW),B HL: F9 Sub. Save Set on Disk.V`  ,j "Enter Filespec ";FS$ t (FS$) : VE~"Is "Q$FS$Q$" correct (Y/N) ?";A$: A$""  : A$"Y" A$"y" A$( )  : A$"N" A$"n" A$"0" V : :  FS$,,  : F10 Sub. Select Alternate Menu. : Set up Alternate Menu.8 (,d)(>,),,BFD , Z"Alternate Menu" ,:"F1 Main Menu. F2 Display Set." ,:"F3 Print Set. F4 End Program.": Set up Alternate Menu Keys. () d  ()  () ,* () XF(: Turn off Keys 5-14.U2 X a< (X) gFP P: Pressing the proper "F" key will break this loop.Z: F1 Sub. Return to Main Menu.d : Restore Main Key Vectors.n < x: F2 Sub. Display Set on CRT.&: X  H Y [ XY "#";: "### = "Q$"!"Q$" ";XY;(XY);: X "Press any key to continue..."A$ A$"" "Press any key to continue..."A$* A$"" 0: dB":t,: F3 Sub. Display Character Set on Printer.6: This routine will function only@: with an IBM or EPSON (MX-80 or 100)J: equipped with the GRAFTRAX graphicsT: ROMS!!.^: Also, use this routine only if youYh: have IBM DOS Version 1.10. Versionr: 1.00 has a bug in its printer|: I/O routine. ()"@": Reset Printer. X   Y  YX   "#";: "### = "Q$;XY;4  ()"K"()();F  Z W  BYTEk  B   (GC(XY,B)) EXC(Z) BYTEBYTE EXC(B)  B  (BYTE);  Z  Q$();  Y  !& X!0 ( )!:"!D d?!N: F4 Sub. End Program.E!XO!b ln!l: Turn Key Trapping off.}!v X ! (X) !!!: Cursor Positioning Subroutines.!: F11 Sub. Cursor Up." ROW : At top of grid already." :XOR Cursor.5"ROWROW:Go Up.`": This Sub. erases cursor, if there,": or sets it, if not there." (COL,ROW),REDBOX"X""MBMSL64O=X;T255A": Just for the fun of it."# : F12 Sub. Cursor Left.8# COL : Already at left side of grid.Y#  : XOR Current cursor.s#*COLCOL: Go left.#4 : Set Cursor.#>: F13 Sub. Cursor Right.#H COL #R #\COLCOL#f #p: F14 Sub. Cursor Down.$z ROW $ '$ROWROW1$ [$:Point graphics vector to area just$:above BASICA in a 128K system.$ SEG: Point to Bottom of RAM.$ |,$ },$ ~,( )$ ,( )+%:The vector at 0000:0510H-0511H points to the start of BASICA's?%:64K segment.G%:r% :Point to Graphics table 64K+1 bytes% :above beginning of BASICA.% SEG()(~)%$ %.  ,%8 "Do you want to load a previously saved" &B "character set (Y/N) ?"#&L A$: A$"" L H&V A$"N" A$"n" A$"0"  w&` A$( ) A$"Y" A$"y" : L &j "Enter filespec ";FS$&t  :Trap "File not found" error. ERR=53.&~  ' 5 Q$FS$Q$" was not found.":: j -' : Crash if any other error.9' FS$,?' J'  ,u' "Last Character number generated ="GN~' XGN' "Enter Character number to"' "generate (128-255)(EN=Next) ";GN' GN GNX' GN GN( GN GN( GN 2 ( K( "CHR$(255) is always null and cannot be"\( "modified."f((  l(2 w(< ,(F (,d)(>,),,BF(P ,:"Use Arrow Keys to move Cursor."(Z ,:"F1 Sets Dot. F2 Resets Dot.")d ,:"F3 Fills Grid. F4 Clears Grid."J)n ,:"F5 Fills Col. F6 Clears Col."x)x ,:"F7 Fills Row. F8 Clears Row.") ,:"F9 Saves Set. F10 Alternate Menu.") ,:"Press Enter to Accept Character.") (,c)(?,),,B* X * (I,X)(,X),$* X* (,),GRID,: Overwrite the existing grid.h* ROW * P(GC(GN,ROW))* P  : Skip a blank row.* COL * P EXC(COL) :(COL,ROW),YELLOWBOX* + + ROW+ COL,+" (,),REDBOX6+, h @+6 ROWJ+@ COL\+J (,),GRIDp+T (,),REDBOX+^ *** Main Strobe Loop ***+h  ,+r "CHR$("((GN),)") = "Q$(GN)Q$" ";+| "STRING$(5,"((GN),)") = "Q$(,GN)Q$;, A$A, A$( )  : "Enter" key? Get a new Character if so.O, X \, X,, "Byte"X"= "("0"((GC(GN,X))),), , h , : of program.