krpalmer: Imagination sold and serviced here: Infocom (infocom)
[personal profile] krpalmer
In the process of trying to make “RLE image files” that much more cross-platform by getting them displayed on an (emulated) TRS-80 Model I hooked up to a Percom Electric Crayon, I did realise at last that the Disk BASIC commands I’d discovered could read through an unformatted data file of arbitrary length also existed on the Color Computer. Back when I’d thought that would be much more involved, I’d instead found proper machine-language programs for that computer that could display RLE images. (While the very first one of them I’d tried had required an actual “CoCo” hooked up to another machine to send it the image file through its serial port, after lucking into a much more capable utility I’d then found the original CompuServe terminal program could also work in an offline mode to display the images first introduced to provide weather maps on that commercial online service.) Even so, the thought of proving the concept once more had me turning to BASIC manuals again.

While I’ve reworked the Applesoft program I found in an old magazine when getting started with RLE images several times now, it still took a fair bit of experimenting with the Color Computer’s ample set of graphics commands before I had the peculiarities worked out of this newest version. As I expected, it wasn’t fast, even if it was faster than the Model I version. What I did wind up noticing was that it ran faster in the trs80gp emulator than in the more feature-packed XRoar; my impression is that trs80gp is less constrained through not providing “disk access speed as it would have been.”

10 X=0:Y=0:F=0:B=5
20 H$=CHR$(27)+CHR$(71)+CHR$(72)
30 PRINT"FILE TO OPEN";:INPUT F$
40 OPEN "D",#1,F$,1
50 FIELD #1,1 AS A$
60 FOR R=1 TO 3
70 GET #1,R
80 C$=C$+A$
90 NEXT R
100 IF C$=H$ THEN 120
110 CLOSE #1:PRINT"DOESN'T BEGIN WITH RLE HEADER":END
120 R=4:PMODE 4,1:PCLS:SCREEN 1,1:COLOR F,B
130 GET #1,R
140 A=ASC(A$)-32
150 IF A=0 THEN 270
160 IF A<0 THEN 310
170 D=X+A
180 IF D<256 THEN 220
190 LINE(X,Y)-(255,Y),PSET
200 Y=Y+1:X=0:D=D-256
210 IF Y>=192 THEN 310
220 LINE(X,Y)-(D,Y),PSET
230 IF D<=256 THEN 260 
240 D=0:Y=Y+1
250 IF Y>=192 THEN 310
260 X=D
270 S=F:F=B:B=S
280 COLOR F,B
290 R=R+1
300 GOTO 130
310 CLOSE #1
320 I$=INKEY$:IF I$="" THEN 320
330 END

June 2025

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 8th, 2025 07:27 am
Powered by Dreamwidth Studios