Feedback Loop

loose after a while. With even the slightest Jolt, it freezes the machine or reboots.

Last week I used a good old pink eraser, trimmed to size, as a wedge between the bottom of my Expansion Interface and the doubler board—much the same thing you do for the RS-232. which isn't fighting gravity.

I haven't had a reboot since, and have experienced the usual run of trailer trucks, kids breakdancing on the desk, and air conditioners and other appli ances cutting in and out. (Joel M. Reed. New York. NY)

A9 Thanks for the update on your

• problem. It sure was a stickler, but in hindsight the solution was rather obvious.

99 I'm writing in response to James

•Criscimagna's request for a screen dump for his Epson RX-80 (February 1985. p. 19). 1 wrote a subroutine for the MX-80 with Graftrax Plus, but it should do for the RX as well (see Program Listing 2). The screen prints out wide because of the Model Ill's skinny pixels. Changing line 991 gives you a screen-like aspect ratio (see Program Listing 3). but the text lines are spread vertically. (Bob Keegan. Fayettville. ARI

A ^Thanks for sending a copy of

9« Here's a response to James Crisci-

• magna's request for a screen dump for an RX-80 printer (see Program Listing 4). My program works on an Epson MX-80 with Graftrax Plus or on an RX-80. On Epsons. a character takes the equivalent of six dots, including one dot between characters. This spacing is matched for block graphics by printing six dots in the wider dot-addressable mode (LPRINT CHR$(27)"K"), using a three- by four-dot block to represent a lit pixel.

Since graphics blocks are taller than alphanumeric characters, the program prints each line on the screen in two passes. Line 10020 sets line spacing at eight dots high for the first pass, which prints alphanumeric characters and the top two rows of graphics pixels. Line 10130 then changes line spacing to four dots high for the second pass to print the bottom row of pixels.

Nested loops scan all print positions on the screen. On the first pass across each line (lines 10030-10120). the program PEEKs the ASCII code for each position. Then it prints the left and right halves of any graphics character it finds in that position; otherwise, it prints the alphanumeric character.

In the second pass on each line (lines 10140-10230). the program prints lit pixels in the bottom row of each graphics character. Line 10000 ensures that the printer uses 80 characters a line and directs the printer to use unidirectional printing to make block graphics line up. Line 10250 turns off all printer codes before leaving the subroutine. (Donald B. Heckenlively. Hillsdale. MI)

AlThanks for your program and

Terry Kepner is a freelance writer and programmer who has been writing about microcomputers since 1979.

Program Listing 2. A Model III screen-to-RX dump program.

990 'MX SCREEN DUMP FOR MIXED GRAPHICS-TEXT V.3 ** RRKEEGAN C0PR . '85

991 SOI5360:LPRINTCHR$(27) "A"CHR$(4) :Al$«STRING$(3,240) :A0$=STR ING$(3,0):l7-128:FORI-0TO15:I6=I*64:GOSUB995:FORJ»0TO4STEP2:XX-2 [J:I1=XX+XX:LPRINTCHR$(27) "K"CHR$(128)CHR$(1); :FORK-0TO63:P-PEEK (I6+K+SC):IFP<I7THENP-I7

992 IF((P—17)ANDXX)THENLPRINTAl$;ELSELPRINTA0 $;

993 IF((P—17)ANDI1)THENLPRINTA1$;ELSELPRINTA0$;

994 NEXTK:LPRINT:NEXTJj NEXTI:LPRINTCHR$(27)"S":LPRINTCHR$(13)CHR $(13)CHR$(13)s RETURN

995 FORK-0TO63:P-PEEK(I6+K+SC):IFP>1260RP<32THENP-32

996 LPRINTCHR$(P);:NEXTK:LPRINTCHR$(27)"J"CHR$(0);:RETURN

Program Listing 3. Modification to Program Listing 2.

991 SC-15360:LPRINTCHR$(27)"A"CHR$(6):A1$-STRING$(3,252):A0$=STR ING$(3,0): 17-128:FORI=0TO15:16 = 1*64:GOSUB995:FORJ-0TO4STEP2:XX=2 [J :I1«XX+XX:LPRINTCHR$(27)"K"CHR$(128)CHR$(1);:FORK-0TO63 :P-PEEK (I6+K+SC):IFP<I7THENP-I7

Program Listing 4. A screen dump program for Models ///// block graphics.

1 G0SUB 8000 'CODES FOR SCREEN DUMP GRAPHICS 7990 'SETUP FOR MX-80 SCREEN DUMP WITH GRAPHTRAX 8000 DIM Q5(64),Q6(64),Q7(64),Q8(64) 8010 FOR IX-1 TO 16 8020 READ QX,QY

8030 Q5(IX)-QX: Q5(IX+16)-QX: Q5(IX+32)=QX: Q5(IX+48)=QX 8040 Q6(IX)-QY: Q6(IX+16)-QY: Q6(IX+32)-QY: Q6(IX+48)=QY 8050 NEXT IX

8060 DATA 0,0,240,0,0,240,240,240,15,0,255,0,15,240,255,240

8070 DATA 0,15,240,15,0,255,240,255,15,15,255,15,15,255,255,255

8090 FOR IX-17 TO 32i Q7(IX)=240: Q8(IX)-0: NEXT IX

8100 FOR IX-33 TO 48: Q7(IX)-0: Q8(IX)«240: NEXT IX

8110 FOR IX-49 TO 64: Q7(IX)-240: Q8(IX)-240: NEXT IX

0 0

Post a comment