; Copyright (c) 1985 Harold Long›; Permission granted to distribute›; for non-commercial purposes.››INCLUDE "D:READPIC.ACT" ; Available on Action! BBS.››MODULE ;ÇÒÔÏÎÅ - GR15 Pseudo-halftone›; screen print routine. Supports›; 800XL and Epson printer only. See›; program comments for adaptation to›; other hardware environments.››; Screen to print translation:›; Each pixel on the screen occupies›; two bits in memory. This is trans-›; lated into a 6x2 matrix to keep›; the h x w aspect ratios similar.›; The default is for color 1 to be›; the least dark, and color 4 to be›; the most dark. A translator table›; is provided to allow hackers›; the ability to redefine halftone›; values to their heart's content.››BYTE J,K,L ;counters››CARD M, SAVMSC=$58 ;counters, reg's››BYTE ARRAY dots(960) ;pin values››BYTE POINTER dotptr, scrnptr››; Turns on a line of graphics output.›; Epson printer supports 960 bits in›; "L" (Low speed double density) mode.›; ªªªª Ãèáîçå åóãáðå ãïäåó âåìï÷ æïò›; ïôèåò ðòéîôåòó áó òåñõéòåä® ªªªª›PROC GrOn() ;turn on graphics›Print("L") ;double density›Put(192) Put(3) ;920 bits/line›RETURN››; Convert a pixel to a halftone value.››PROC DoPix(BYTE p) ;process a pixel›; Halftone value table:›; Values are selected to approximate›; 0%, 25%, 50%, and 100% density for›; color registers 1 through 4. Note›; that lookup alternates between table›; tone1 and tone2 to give maximum›; pattern flexibility.›BYTE ARRAY tone1(4)=[$00 $00 $40 $C0]›BYTE ARRAY tone2(4)=[$00 $40 $80 $C0]››FOR J=0 TO 5 ;6 bytes wide›DO› IF (J MOD 2)=0 THEN ;odd values› dotptr^=tone1(p) ;assumes dotptr is› dotptr==+1 ;properly set up› ELSE ;even values› dotptr^=tone2(p) ;base halftone› dotptr==+1› FI›OD›RETURN››PROC DoByte(BYTE b) ;process a screen byte›BYTE p ;the pixel value›FOR K=0 TO 6 STEP 2 ;do it 4 times›DO› p=(b RSH (6-K)) & $03 ;mask it to get reg #› DoPix(p) ;go convert pixel to halftone›OD›RETURN››PROC DoLine(BYTE r) ;process a screen line›Zero(dots,960) ;clear array›dotptr=dots ;initialize pointer›scrnptr=SAVMSC+40*r ;row pointer›FOR L=0 TO 39 ;40 bytes to a line›DO› DoByte(scrnptr^) ;the next screen byte› scrnptr==+1 ;bump pointer›OD›GrOn() ;flame on!›dotptr=dots ;reset pointer›FOR M=0 TO 959 ;full double density line›DO› Put(dotptr^)› dotptr==+1›OD›PutE()›RETURN››; Initialization and control loop.›; Open printer, get input file name›; and read it in (Micro Illustrator›; format only). ››PROC Main()›BYTE i ›BYTE ARRAY fname(18)›Close(2)›Open(2,"P:",8,0)›Close(1)›Print("Input file: ")›InputS(fname)›PutE()›Open(1,fname,4,0)›Graphics(15+16) ;´°°¯¸°° ï÷îåòó ÷éìì› ;îååä ôï âõéìä ìéóô íáîõáììù®›ReadPic()›Close(1)›device=2›; Ãèáîçå åóãáðå ãïäåó æïò ïôèåò ðòéîôåòó›Print("3") ;Set printer to›Put(6) ;6/216 inch (2 dots)›FOR i=0 TO 191 ;192 screen rows›DO› DoLine(i)›OD›device=0›Close(2)›RETURN›››Put(6) ;6/216 inch (2 dots)›FOR i=0 TO 191 ;192 screen rows›DO› ¦; Copyright (c) 1985 Harold Long›; Permission granted to distribute›; for non-commercial purposes.››INCLUDE "D:READPIC.ACT" ; Available on Action! BBS.››MODULE ;ÇÒÔ