Squeezing Onto A Real Screen
Jan. 14th, 2022 08:43 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Coaxing a program into working order in a TRS-80 Model 100 emulator that could display one slice of an antique cross-platform image file on the screen of that just as antique portable computer had been just the sort of small accomplishment, kind of pointless now yet “once it would have been amazing,” that keeps me delving into “old computers.” Writing up a post about that for the sake of keeping this journal updated every so often, though, did raise a thought or two about whether I’d somehow discharged my motivating energy and would drift along to something else. There was space left for improvement to the program to be sure. Even if rewriting it in anything faster than BASIC remains a towering challenge for me, I could do something about it being “basic.” While I’d got started just by seeing what sort of image could be evoked in the limited number of pixels on a Model 100’s screen, deciding to “work with tools at hand” as much as not bothering to “reinvent the wheel” and padding that image out to the fixed dimensions of an RLE file (which had once seemed a “lowest common denominator” of its day, but had just happened to also be the maximum resolution of my family’s desktop home computer back then) had got me wondering about starting somewhere else than the top left-hand corner and showing a different slice of any one of the RLE images I’ve collected.
To get the image on the Model 100’s screen in the first place, I’d had to count some of the alternating black and white pixels meant to make up a line of 256 points without plotting them. Seeing those skipped pixels meant skipping some to begin with, and before too long I had figured out how to add that much to my program.
With all of this work with the “Virtual T” emulator, though, I’d also been pondering how I’d got it running. Its Macintosh version available for download on the project’s site had stopped working many system upgrades ago, and that meant using using “CrossOver” to get the Windows version running via Wine. I’d gone so far as to experiment with compiling the latest updates to the source code. Despite my limited knowledge of modern programming reducing this to starting the compilation process and hoping, I’d wound up with an executable that could start up. However, I couldn’t type certain shifted characters, which just happened to be characters needed to program in BASIC. Just as I was turning back to CrossOver, though, someone added a message to the site’s discussions that they’d created a new Macintosh version, and I gratefully tried it out (even if, by keeping rough parity with the latest officially available Windows version, it kept a bug that meant very slow screen updates unless I switched into a “turbo mode.”)
As I kept working on measuring out full 256-pixel lines without plotting them to start displaying lower slices of an RLE image, I got to looking at some older programs for the Model 100 I’d happened on once upon a time and wondering if the site I’d got one of them from was still around. It was, and it also happened to have an archive of old files from the 1980s online service CompuServe, where RLE images had come from in the first place. Looking in the “Graphics” library didn’t turn up anything, but when I looked at “Telcom” all of a sudden I was looking at programs people had written years ago to display and print RLE files. For a moment or two I wondered if I’d just scotched my chances of working any further on my own program, but then I did note there weren’t any programs that could display an arbitrary third of an image, just “top third, middle third, and bottom third” one after the other. In any case, one program produced a somewhat skewed output even if I could appreciate how it looked at things differently than the Apple II program I’d been adapting. I wondered from an accompanying file what might have happened with its first version, and then I happened to wonder if the file had been transcribed from PCM, another magazine from the publisher of The Rainbow that had started out focused on Radio Shack’s “Portable Computer” before broadening out to Tandy’s “PC clones.” When I checked a scanned copy of an old issue I just happened to already have, I found the article.
The two articles about RLE files I’d happened on before were from a few years later, not that long before CompuServe introduced GIF images. Having a better sense of how long the earlier image format had been around was enlightening, and so was noticing how the article only talked about it being used for “weather maps.” The article had preceded by a few months the introduction of the Macintosh and MacPaint (in the editorial that month, Lonnie Falk just happened to reassure everyone how ready Radio Shack and Tandy were to weather the impending computer industry shakeout while also being smug about how things looked grim for Apple), which produced larger 1-bit images (which I have the impression some of the RLE files I’ve found have been cut down from). In the format being used for images other than weather maps, I did get to pondering the William Gibson quote “The Street finds its own uses for technology.” Along the way, I thought to look a little into “RLE-displaying programs for the Commodore 64,” but found the format linked to CP/M instead along with a few more sample images that, had I happened on them first, wouldn’t have struck me with the unsettling feeling of “two different personal interests of mine brought together, without my doing it.”
In any case, I had been contemplating how to only plot every third pixel of every third line to produce a “thumbnail” on the Model 100’s screen. Once I got past aimless pondering, the program came together quicker than I might have expected, with a solution that wound up loading numbers into an array. As ever, typing in the program in BBEdit before loading the text file into the emulator helped me keep track of things (including setting up jumps ahead to numbered lines I didn’t know the number of in advance) but also seemed to leave me with several errors to correct in the emulator itself, but the thumbnail did draw, and some of the patterns weren’t reduced to “more or less black” the way other pixel-skipping thumbnails I’d been more familiar with had had me anticipating.
All of this was working towards something of a deadline. Able to get back home for Christmas, I was contemplating loading the programs onto my family’s real Model 100, which I don’t keep among the number of computers accumulated in my own place (including the older Macbook I sorted out how to use as a substitute “portable floppy drive”). Just for the sake of it, I typed in the program from PCM on real hardware, and discovered first that it inverted black to white and second that it didn’t seem able to handle an image that was mainly white, which explained a bit about what those first weather maps would have looked like. My own programs worked better, but having needed to run the emulator speeded up meant realising the thumbnail program in particular took a long time to get through a full image. Whether I can speed up the program without learning assembly language doesn’t seem that vital a question; I feel more or less as if I’ve got this latest not that essential accomplishment packed up.


To get the image on the Model 100’s screen in the first place, I’d had to count some of the alternating black and white pixels meant to make up a line of 256 points without plotting them. Seeing those skipped pixels meant skipping some to begin with, and before too long I had figured out how to add that much to my program.
With all of this work with the “Virtual T” emulator, though, I’d also been pondering how I’d got it running. Its Macintosh version available for download on the project’s site had stopped working many system upgrades ago, and that meant using using “CrossOver” to get the Windows version running via Wine. I’d gone so far as to experiment with compiling the latest updates to the source code. Despite my limited knowledge of modern programming reducing this to starting the compilation process and hoping, I’d wound up with an executable that could start up. However, I couldn’t type certain shifted characters, which just happened to be characters needed to program in BASIC. Just as I was turning back to CrossOver, though, someone added a message to the site’s discussions that they’d created a new Macintosh version, and I gratefully tried it out (even if, by keeping rough parity with the latest officially available Windows version, it kept a bug that meant very slow screen updates unless I switched into a “turbo mode.”)
As I kept working on measuring out full 256-pixel lines without plotting them to start displaying lower slices of an RLE image, I got to looking at some older programs for the Model 100 I’d happened on once upon a time and wondering if the site I’d got one of them from was still around. It was, and it also happened to have an archive of old files from the 1980s online service CompuServe, where RLE images had come from in the first place. Looking in the “Graphics” library didn’t turn up anything, but when I looked at “Telcom” all of a sudden I was looking at programs people had written years ago to display and print RLE files. For a moment or two I wondered if I’d just scotched my chances of working any further on my own program, but then I did note there weren’t any programs that could display an arbitrary third of an image, just “top third, middle third, and bottom third” one after the other. In any case, one program produced a somewhat skewed output even if I could appreciate how it looked at things differently than the Apple II program I’d been adapting. I wondered from an accompanying file what might have happened with its first version, and then I happened to wonder if the file had been transcribed from PCM, another magazine from the publisher of The Rainbow that had started out focused on Radio Shack’s “Portable Computer” before broadening out to Tandy’s “PC clones.” When I checked a scanned copy of an old issue I just happened to already have, I found the article.
The two articles about RLE files I’d happened on before were from a few years later, not that long before CompuServe introduced GIF images. Having a better sense of how long the earlier image format had been around was enlightening, and so was noticing how the article only talked about it being used for “weather maps.” The article had preceded by a few months the introduction of the Macintosh and MacPaint (in the editorial that month, Lonnie Falk just happened to reassure everyone how ready Radio Shack and Tandy were to weather the impending computer industry shakeout while also being smug about how things looked grim for Apple), which produced larger 1-bit images (which I have the impression some of the RLE files I’ve found have been cut down from). In the format being used for images other than weather maps, I did get to pondering the William Gibson quote “The Street finds its own uses for technology.” Along the way, I thought to look a little into “RLE-displaying programs for the Commodore 64,” but found the format linked to CP/M instead along with a few more sample images that, had I happened on them first, wouldn’t have struck me with the unsettling feeling of “two different personal interests of mine brought together, without my doing it.”
In any case, I had been contemplating how to only plot every third pixel of every third line to produce a “thumbnail” on the Model 100’s screen. Once I got past aimless pondering, the program came together quicker than I might have expected, with a solution that wound up loading numbers into an array. As ever, typing in the program in BBEdit before loading the text file into the emulator helped me keep track of things (including setting up jumps ahead to numbered lines I didn’t know the number of in advance) but also seemed to leave me with several errors to correct in the emulator itself, but the thumbnail did draw, and some of the patterns weren’t reduced to “more or less black” the way other pixel-skipping thumbnails I’d been more familiar with had had me anticipating.
All of this was working towards something of a deadline. Able to get back home for Christmas, I was contemplating loading the programs onto my family’s real Model 100, which I don’t keep among the number of computers accumulated in my own place (including the older Macbook I sorted out how to use as a substitute “portable floppy drive”). Just for the sake of it, I typed in the program from PCM on real hardware, and discovered first that it inverted black to white and second that it didn’t seem able to handle an image that was mainly white, which explained a bit about what those first weather maps would have looked like. My own programs worked better, but having needed to run the emulator speeded up meant realising the thumbnail program in particular took a long time to get through a full image. Whether I can speed up the program without learning assembly language doesn’t seem that vital a question; I feel more or less as if I’ve got this latest not that essential accomplishment packed up.

10 REM RLE Displayer
20 DEFINT A-Z:C=-1
30 FILES:INPUT"Open which file";N$
40 OPEN N$ FOR INPUT AS 1
50 A$=INPUT$(1,1)
60 IF A$<>CHR$(27) THEN 50
70 A$=INPUT$(1,1):IF A$<>"G" THEN 60
80 A$=INPUT$(1,1):IF A$<>"H" THEN 60
90 CLS
100 PRINT"RLE header found"
110 INPUT"Start at what line [0]-128";L$
115 IF L$="" THEN L$="0"
120 L=VAL(L$):IF L>128 THEN L=128
130 INPUT"Skip left pixels [0]-16";S$
135 IF S$="" THEN S$="0"
140 S=VAL(S$):IF S>16 THEN S=16
145 CLS
150 IF L=0 THEN 200
155 PRINT@0,"Please wait; skipping line";Y
160 A$=INPUT$(1,1):A=ASC(A$)-32
165 IF A<0 THEN 800
170 IF A=0 THEN C=NOT C:GOTO 160
175 D=X+A:IF D>=255 THEN 185
180 X=D:C=NOT C:GOTO 160
185 Y=Y+1:X=D-256:D=0:C=NOT C
190 IF Y=L THEN Y=0:CLS:LINE(0,0)-(X,0),ABS(NOT C):GOTO 200
195 GOTO 155
200 IF S=0 THEN 300
210 A$=INPUT$(1,1):A=ASC(A$)-32
220 IF A<0 THEN 800
230 IF A=0 THEN C=NOT C:GOTO 210
240 D=X+A
250 IF D>=S THEN 270
260 X=D:C=NOT C:GOTO 210
270 X=0:D=D-S:GOTO 500
300 A$=INPUT$(1,1):A=ASC(A$)-32
310 IF A<0 THEN 800
320 IF A=0 THEN 700
330 D=X+A
340 IF D<=239 THEN 500
350 IF X>=240 THEN 400
360 LINE(X,Y)-(239,Y),ABS(C)
400 IF D<=255 THEN 600
410 X=0:D=D-256:Y=Y+1
420 IF Y=64 THEN 800
500 LINE(X,Y)-(D,Y),ABS(C)
600 X=D
700 C=NOT C
710 GOTO 300
800 CLOSE 1
810 A$=INKEY$:IF A$="" THEN 810
820 END

10 REM RLE Thumbnail
20 DEFINT A-Z:C=-1
25 CLEAR 300:DIM L(255)
30 FILES:INPUT"Open which file";N$
40 OPEN N$ FOR INPUT AS 1
50 IF EOF(1) THEN PRINT"Not a graphic file":CLOSE 1:GOTO 30
60 A$=INPUT$(1,1)
70 IF A$<>CHR$(27) THEN 50
80 IF EOF(1) THEN PRINT"RLE header not found":CLOSE 1:GOTO 30
90 A$=INPUT$(2,1)
100 IF A$<>"GH" THEN 80
110 CLS
120 A=ASC(INPUT$(1,1))-32
130 IF A<0 THEN 340
140 IF A=0 THEN C=NOT C:GOTO 120
150 D=X+A:IF D>=256 THEN 205
155 IF P<>0 THEN 190
160 FOR F=X TO D
170 L(F)=C
180 NEXT F
190 X=D:C=NOT C
200 GOTO 120
205 IF P<>0 THEN 290
210 FOR F=X TO 255
220 L(F)=C
230 NEXT F
240 IF P<>0 THEN 290
250 FOR W=0 TO 255 STEP 3
260 IF L(W)=0 THEN PSET(70+O,Y)
270 O=O+1
280 NEXT W
290 P=P+1
300 IF P=3 THEN P=0:Y=Y+1
310 IF Y=64 THEN 340
320 X=0:D=D-256:O=0
330 GOTO 160
340 CLOSE 1
350 A$=INKEY$:IF A$="" THEN 350
360 END