Selective SCREEN$ Line Copy

Publication

Pub Details

Date

Pages

See all articles from Quarters Fall 1985

In the Winter-85 issue of QuarTerS Bill Johnson enlightened us with a TS2068 program to COPY a screen without using the COPY command. The advantage being selected lines could be specified to COPY instead of the entire screen. His program used the SCREEN$ function as the heart of the routine.

Although it worked, the SCREEN$ function has some disadvantages. Most notably it cannot print user defined graphics (UDG’s). Both user defined and Sinclair UDG’s are not recognized by the SCREEN$ function. Which led Mr. Johnson to propose his readers to submit various programs that would determine printable SCREEN$ characters. Below is a short subroutine which takes care of everything.

This program selectively COPYs each and every speck you care to PLOT, line by line. Any number of lines may be COPYed from the screen to the printer. I call it:

“Selective SCREEN$ Line Copy”

The heart of the program utilizes the POINT function for precise pixel identification. Rather than use a bit mapped transfer algorithim I chose four nested loops. Sinclair’s screen layout is rather tedious and an understanding of the bit transfer technique is easier to grasp using four nested loops.

Line 130. The outer most loop controls which lines we want sent to the printer.

Line 140. This loop sends a 32 character line, as selected by the outer most loop, to the printer.

Line 160. This loop controls which of the eight pixel rows within a given character will be equivalenced to a decimal number.

Line 180. The inner most loop takes a row of eight pixels, within a character, and calculates the equivalent decimal value. This decimal number is then POKEd into UDG B.

Line 210. UDG B is transferred to variable a$ to be LPRINTed in line 220.

The only complaint which a user might have with this subroutine is its speed of execution. For each specific line you want COPYed from the screen to the printer a delay of 48 seconds is in order. This is caused by the fact that the printer cannot LPRINT one character at a time. Consequently it must LPRINT an entire line at a time. In turn this can only be done if the printer buffer is full. Hence, the delay.

BASIC Listing

  30 REM Test Routine
40 CLS
50 FOR i=97 TO 118
60 FOR j=BIN TO 31
70 PRINT CHR$ i;
80 NEXT j: NEXT i
90 GO SUB 100: STOP
100 REM Selective COPY Routine
110 INPUT AT 0,0;"Enter First LINE TO COPY ";first'"Enter Last LINE TO COPY ";last
120 IF first<0 OR last >21 THEN RUN 100
130 FOR v=first TO last
140 FOR h=BIN TO 255 STEP 8
150 LET top=175-(v * 8)
160 FOR r=top TO top-7 STEP -1
170 LET b=BIN
180 FOR c=h TO h+7
190 LET b=b* 2+(POINT (c,r)<>0)
200 NEXT c: POKE USR "b"+top-r,b
210 NEXT r: LET a$="b"
220 LPRINT a$;
230 NEXT h
240 NEXT v
250 RETURN

EDITOR’S NOTE: Enter RUN and the screen will fill up with the letters ‘a’ to ‘v’. To use the Selective COPY routine use GOTO 100. Lines 100 to 250 can be placed in any program.

Products

 

Media

 

Image Gallery

Source Code

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

Scroll to Top