Jump to content
Sign in to follow this  
Sinphaltimus

Printing Graphics (Need Help) - Basic, XB, Call Link

Recommended Posts

I unintentionally hijacked another thread (https://atariage.com/forums/topic/225460-printers-on-the-classic-ti-994a/) and thought I'd start a topic of its own to continue.

I'll continue as the first comment.
Here is a history of the thread so far:

Sinphaltimus

  • Sinphaltimus
  • River Patroller
  • team_rank_subscriber.png
  • 2,936 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

From 2015 to 2021. 

Just got a PHP2500 connected.

 

Can print text from TI-Writer.

I've been reading around and haven't found a way yet so I thought I'd ask others who own printers. 

 

Is there a way to print TI-BASIC graphics displayed on the screen?

I have an image converted to BASIC via Magellan. 

I'd like to be able to print that image.

Can it be done?

 

 

 

 

~Sinphaltimus Exmortus

blackbox

  • blackbox
  • Dragonstomper
  • pip_rank_joysticks_5.gif
  • 552 posts
  • Location:England

 FIRST-  The BASIC way- requires TI Basic with Mini Memory OR Extended Basic, plus a suitable printer (eg that uses the Epson printer code ESC K ) 


 

NOTE: Using square brackets (that is a [  and ])in a variable name is legal!


 

Insert this code into your program as required- the screen will be printed when you get to this code.  You could put it into a GOSUB. The routine reads the screen and prints it- rather slowly.

 100 OPEN #1:"PIO.CRLF" 
 110 REM OR EQUIVALENT RS232 
 FILE NAME 
 120 PRINT #1:CHR$(27);"A";CH 
 R$(8) 
 130 FOR [A=1 TO 32 
 140 PRINT #1:CHR$(27);"K";CH 
 R$(192);CHR$(0) 
 150 FOR [B=24 TO 1 STEP -1 
 160 CALL GCHAR([B,[A,[CHAR) 
 170 IF [CHAR<33 THEN 300 
 180 CALL CHARPAT([CHAR,DEF$) 
 190 IF DEF$="000000000000000 
 0" THEN 300 
 200 FOR [SEG=16 TO 2 STEP -2 
 210 [HEX=ASC(SEG$(DEF$,[SEG,1))
 220 GOSUB 430 
 230 [PRINTDEF=[HEX 
 240 [HEX=ASC(SEG$(DEF$,[SEG-1,1))
 250 GOSUB 430 
 260 [PRINTDEF=[PRINTDEF+[HEX*16 
 270 PRINT #1:CHR$([PRINTDEF); 
 280 NEXT [SEG 
 290 GOTO 340 
 300 FOR []=1 TO 7 
 310 PRINT #1:CHR$(0); 
 320 NEXT [] 
 330 PRINT #1:CHR$(0) 
 340 NEXT [B 
 350 PRINT #1:CHR$(13);CHR$(10) 
 360 NEXT [A 
 370 PRINT #1:CHR$(27);"@" 
 380 PRINT #1:CHR$(7) 
 390 CLOSE #1 
 400 REM NOW GO WHERE YOU WISH 
 410 REM USING RETURN OR GO 
 TO AS APPROPRIATE 
 420 STOP 
 430 [HEX=[HEX-48+([HEX>64)*7 
 440 RETURN 
 450 END 

 To permit the routine to be added to any program, the square bracket has been used in front of each variable: [. The [ is accepted as a valid character in variable names. 

 ESC K {CHR$(27);"K"} is used in the Epson printer, and some others, to select: 'Normal density 8 pin bit image mode'


 

OR  The assembly code way- faster-    


 

If you are running a TI Basic program, in order to print the screen you must first leave the TI Basic program and run an assembly language program that will output to a printer with Epson graphics coding.

You need to have a "Load Interrupt Switch" fitted, 32k ram and printer plus printer interface. Plus a suitable assembly language program.  The switch will cause the computer to jump to an assembly routine while your program is running and not interfere with the display you wish to print.

eg Danny Michael's DUMP


OR- if the program will run in Extended Basic, a machine code utility plus 32k ram, printer and interface. The utility needs to use a "hot key" that will not interfere with your Basic program, that will jump to the assembly routine to print the screen image OR the utility may permit you to insert a CALL LINK in an appropriate part of the program to print the screen...

eg use the disk based utility THE MISSING LINK and in your program at an opportune place insert CALL LINK("DUMP")


 

Yes it can be done  (and has been done).  Several options but you first need the printer interface and Epson code printer;  then you need 32k ram and an assembly program or routine.  

To load the assembly routine you will probably need to have a disk system too.


 

  [Does RXB support screen dumps?? ]

There is also a utility that takes a screen image and transfers it to a code you can insert into your TI Writer documents so that TI Writer can print a screen dump with text around it....(can't recall what it was called...)

 




 

Edited Sunday at 05:20 PM by blackbox
ti writer added
RickyDean reacted to this
Like

Sinphaltimus

  • Sinphaltimus
  • River Patroller
  • team_rank_subscriber.png
  • 2,936 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA
  On 10/10/2021 at 5:16 PM, blackbox said:

Yes it can be done  (and has been done).
 

I will have to dig into this.  I have everything besides the program.  Not sure if my printer is correct. It's the PHP2500.

 

I will also give that, basic code you provided, a shot this week for sure.

 

EDIT: I believe I found the program "Dump". I think it's archive034.dsk in the collection I recently uploaded.  Extensive instructions too.

RickyDean reacted to this

 

~Sinphaltimus Exmortus

Sinphaltimus

  • Sinphaltimus
  • River Patroller
  • team_rank_subscriber.png
  • 2,936 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA
  On 10/10/2021 at 5:16 PM, blackbox said:

 

 To permit the routine to be added to any program, the square bracket has been used in front of each variable: [. The [ is accepted as a valid character in variable names. 

 ESC K {CHR$(27);"K"} is used in the Epson printer, and some others, to select: 'Normal density 8 pin bit image mode'


 

 



 

Yep, I think I'm going to have to figure out the LINK to DUMP option.

The basic way doesn't work for me. I bet it's an incompatible printer.

 

I will attach a photo of the result after i finish posting this. @computer, photo on phone.

 

 

Here's the entire program with the graphic I'm try to print.

The code you sent is lines 1300 - 1660

 

100 CALL COLOR(5,2,1)
110 CALL COLOR(6,2,1)
120 CALL COLOR(7,2,1)
130 CALL COLOR(8,2,1)
140 CALL COLOR(9,2,1)
150 CALL COLOR(10,2,1)
160 CALL COLOR(11,2,1)
170 CALL COLOR(12,2,1)
500 CALL CHAR(64,"00000103070F0F0F")
510 CALL CHAR(65,"7FFFF1FBFEFFFFFF")
520 CALL CHAR(66,"FECE2A33B5DDFFFF")
530 CALL CHAR(67,"FF351D1FBFBFBFFF")
540 CALL CHAR(68,"80C040E0F0F8FC3E")
550 CALL CHAR(72,"1F1F1F1F1F1F1F1F")
560 CALL CHAR(73,"FFFFF18080808080")
570 CALL CHAR(74,"FFFFFF0800000000")
580 CALL CHAR(75,"FCF0C00000000000")
590 CALL CHAR(76,"131B0F0F0D0F0F2F")
600 CALL CHAR(80,"1F1F1F1F1F3F2F27")
610 CALL CHAR(81,"80808080BFFFC3DF")
620 CALL CHAR(82,"000000000080C0E0")
630 CALL CHAR(83,"000000001F3F60FF")
640 CALL CHAR(84,"2D6F7F2DADEF7735")
650 CALL CHAR(88,"371F1F1F1F151515")
660 CALL CHAR(89,"FF6F3C011F000080")
670 CALL CHAR(90,"F1F1F0B030302020")
680 CALL CHAR(91,"FF6D3D180C000000")
690 CALL CHAR(92,"D797971707050505")
700 CALL CHAR(96,"150D070303030301")
710 CALL CHAR(97,"8080C1C6EDF9FBE7")
720 CALL CHAR(98,"21A100A0FBFEF8FF")
730 CALL CHAR(99,"003078CD0F071FFC")
740 CALL CHAR(100,"0614BCF8F8F8F8F8")
750 CALL CHAR(104,"0100000000000000")
760 CALL CHAR(105,"E7F3F35151292B17")
770 CALL CHAR(106,"04C0FFF0FFE03F3F")
780 CALL CHAR(107,"183020000001C183")
790 CALL CHAR(108,"707060E0E0C0C080")
800 CALL CHAR(112,"0C225BB387F3FB79")
810 CALL CHAR(113,"0E1E3FFBF1E1C0C0")
820 CALL CHAR(114,"60E0C0C0C0FE3F00")
830 CALL CHAR(115,"0307061C3870E000")
840 CALL CHAR(116,"8000000000000000")
850 CALL CHAR(120,"793F1E0000000000")
860 CALL CHAR(121,"8000000000000000")
900 PRINT "BCD                         JKL                         RST                         "
910 PRINT "Z[\                         bcd                         jkl                         "
920 PRINT "rst                         "
930 PRINT
940 PRINT
950 PRINT
960 PRINT
970 PRINT
980 PRINT
990 PRINT
1000 PRINT
1010 PRINT
1020 PRINT
1030 PRINT
1040 PRINT
1050 PRINT
1060 PRINT
1070 PRINT
1080 PRINT
1190 DATA 1,1,64,1,2,65,2,1,72,2,2,73,3,1,80,3,2,81,4,1,88,4,2,89
1200 DATA 5,1,96,5,2,97,6,1,104,6,2,105,7,1,112,7,2,113,8,1,120,8,2,121
1230 RESTORE 1190
1240 FOR FILL=1 TO 16
1250 READ Y,X,CP
1260 CALL VCHAR(Y,X,CP)
1270 NEXT FILL
1280 CALL KEY(0,K,S)
1290 IF S=0 THEN 1280
1300 OPEN #1:"PIO"
1310 REM  OR EQUIVALENT RS232 FILE NAME
1320 PRINT #1:CHR$(27);"A";CHR$(8)
1330 FOR A=1 TO 32
1340 PRINT #1:CHR$(27);"K";CHR$(192);CHR$(0)
1350 FOR B=24 TO 1 STEP-1
1360 CALL GCHAR(B,A,[CHAR)
1370 IF CHAR<33 THEN 1500
1380 CALL CHARPAT(CHAR,DEF$)
1390 IF DEF$="0000000000000000" THEN 1500
1400 FOR SEG=16 TO 2 STEP-2
1410 HEX=ASC(SEG$(DEF$,SEG,1))
1420 GOSUB 1640
1430 PRINTDEF=HEX
1440 HEX=ASC(SEG$(DEF$,SEG-1,1))
1450 GOSUB 1640
1460 PRINTDEF=PRINTDEF+[HEX*16
1470 PRINT #1:CHR$(PRINTDEF);
1480 NEXT SEG
1490 GOTO 1540
1500 FOR J=1 TO 7
1510 PRINT #1:CHR$(0);
1520 NEXT J
1530 PRINT #1:CHR$(0)
1540 NEXT B
1550 PRINT #1:CHR$(13);CHR$(10)
1560 NEXT A
1570 PRINT #1:CHR$(27);"@"
1580 PRINT #1:CHR$(7)
1590 CLOSE #1
1600 REM  NOW GO WHERE YOU WISH
1610 REM  USING RETURN OR GO TO AS APPROPRIATE
1620 RETURN
1630 STOP
1640 HEX=HEX-48+(HEX>64)*7
1650 RETURN
1660 END
2000 END

 

20211010_214444.jpg

RickyDean reacted to this

 

~Sinphaltimus Exmortus

Ksarul

  • Ksarul
  • Quadrunner
  • team_rank_subscriber.png
  • 6,848 posts

Note the original TI printer is a rebadged EPSON MX80 with a serial card in it (the MX80 had either a serial or a parallel card in it, and the cards were available separately as well to allow switching one to the other), so it should work with any program that uses EPSON controls.

RickyDean reacted to this
Like

 

Enter my mind at your own risk. . .

blackbox

  • blackbox
  • Dragonstomper
  • pip_rank_joysticks_5.gif
  • 552 posts
  • Location:England

Your line 1300 is in error- you have used "PIO", whereas  my original code used "PIO.CR.LF"  (I actually omitted the stop between CR and LF, sorry... my eyesight is not what is used to be..).
The printer interface manual actually says you only need "PIO.CR" and that .CR will turn off the carriage return and line feed but the manuals for many TI graphiucs programs refer to PIO.CR.LF.- The Printers Apprentice says to use either PIO.CR.LF or PIO.CR....
Confusingly the .CR is referred to in the manual as CRLF OFF. By default the interface has CRLF ON.

You MUST use PIO.CR.LF  (or PIO.CR) for all TI graphics programs, otherwise there will be a line feed after each character.

In your coding line 1550 takes care of the line feeds at the appropriate time.

That should get things going....

Edited Monday at 06:56 AM by blackbox
reduce to PIO.CR
RickyDean reacted to this
Like

Sinphaltimus

  • Sinphaltimus
  • River Patroller
  • team_rank_subscriber.png
  • 2,936 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA
  On 10/11/2021 at 6:41 AM, blackbox said:

Your line 1300 is in error- you have used "PIO", whereas  my original code used "PIO.CR.LF"  (I actually omitted the stop between CR and LF, sorry... my eyesight is not what is used to be..).
The printer interface manual actually says you only need "PIO.CR" and that .CR will turn off the carriage return and line feed but the manuals for many TI graphiucs programs refer to PIO.CR.LF.- The Printers Apprentice says to use either PIO.CR.LF or PIO.CR....
Confusingly the .CR is referred to in the manual as CRLF OFF. By default the interface has CRLF ON.

You MUST use PIO.CR.LF  (or PIO.CR) for all TI graphics programs, otherwise there will be a line feed after each character.

In your coding line 1550 takes care of the line feeds at the appropriate time.

That should get things going....

HAHAAA! Thanks. i will try this as soon as I can. I suppose the original post with pio.crlf is what threw me off. i hadn't even thought about the stop. so when I got the error, I removed it entirely and it started printing. I will fix and try again, probably later tonight if not, then tomorrow.

 

 

~Sinphaltimus Exmortus

Share this post


Link to post
Share on other sites

Black Box - 

Still a no go. I was very tired last night so I'm going to attach the code so far.

 

What ended up happening is the printer made some noises (adjusting the feeder back and forth) in short bursts with long delays without actually printing anything until I got an error.

The error was about line 1650 - I think it said "Can't do that line 1650"

I will go back and review the conversation we had above to make sure I don't have anymore issues with the way I copied your code but that will have to wait until later tonight after work.
I also need to understand Call Link and how to use the DUMP program currently on its own DSK. It does come with documentation but I haven't read it in detail.
JRBD13013.txt- The program so far.
a4BoBPEBv3.dsk - The DSK containing said program.


archive034.dsk - the DUMP program I think was mentioned earlier. I have not yet tried this method.

 

a4BoB99PEBV3.DSK archive034.dsk

Share this post


Link to post
Share on other sites

Looking at your code I found two more errors quite quickly- where you have used [CHAR and CHAR (line 1360) and where you have used both [HEX and HEX - line 1460.   Check again!!!


 

To quickly get a result, run this Basic program (from Epson) - it should print several lines of thick black like

|||||||||

|||||||||

|||||||||

but more solidly black probably with gaps between the lines.!

If this works you have proof that the printer graphics is working.


 

10 OPEN #1:"PIO.CR"

20 FOR I = 1 TO 5

30 PRINT #1:CHR$(27);"K";CHR$(80);CHR$(0);

40 FOR N=1 TO 80

50 PRINT #1:CHR$(255);

60 NEXT N

70 PRINT #1:CHR$(13);CHR$(10)

80 NEXT I

90 PRINT #1:CHR$(27);"@"

100 CLOSE #1

110 STOP


 

Line 90 resets the printer.


 

You reported "CAN'T DO THAT" error- is generated by a RETURN without a GOSUB, which fits the line number- except I would have expected it for line 1620 as you didn't enter the routine with a GOSUB.  Your listing should be 1620 STOP.

 

regards  bb

Edited by blackbox
  • Like 2

Share this post


Link to post
Share on other sites

On the screen, the graphics is defined by row inside each character. On the printer, it's defined by column. When I did a screen dump routine, I kept the printing instructions to output the 24 lines from the screen to paper in high level language, but wrote an assembly routine which converted a specified row on the screen to data formatted to work with the printer.

Thus the time consuming conversion was as fast as possible, but the comparatively complex printing function, which isn't time critical (the printer is slower anyway) was kept in high level language.

  • Like 1

Share this post


Link to post
Share on other sites
On 10/13/2021 at 7:52 AM, blackbox said:

Looking at your code I found two more errors quite quickly- where you have used [CHAR and CHAR (line 1360) and where you have used both [HEX and HEX - line 1460.   Check again!!!


 

To quickly get a result, run this Basic program (from Epson) - it should print several lines of thick black like

|||||||||

|||||||||

|||||||||

but more solidly black probably with gaps between the lines.!

If this works you have proof that the printer graphics is working.


 

10 OPEN #1:"PIO.CR"

20 FOR I = 1 TO 5

30 PRINT #1:CHR$(27);"K";CHR$(80);CHR$(0);

40 FOR N=1 TO 80

50 PRINT #1:CHR$(255);

60 NEXT N

70 PRINT #1:CHR$(13);CHR$(10)

80 NEXT I

90 PRINT #1:CHR$(27);"@"

100 CLOSE #1

110 STOP


 

Line 90 resets the printer.


 

You reported "CAN'T DO THAT" error- is generated by a RETURN without a GOSUB, which fits the line number- except I would have expected it for line 1620 as you didn't enter the routine with a GOSUB.  Your listing should be 1620 STOP.

 

regards  bb

I'm just not having any luck with this at all. I'm posting from my cell phone right now because that's where I have the pictures.  I'll edit from my desk top shortly the revised code. 

 

The printer test sends to have gone well.

But my graphic keeps throwing errors ate each edit. 

 

See attached photos. If is the test result.  The other is a new error.   EDIT: Code added.imageproxy.php?img=&key=f4dcc336a70d5c68

20211014_055426.jpg

20211014_060542.jpg

JRBD13013.txt

Share this post


Link to post
Share on other sites
On 10/13/2021 at 7:52 AM, blackbox said:

OR- if the program will run in Extended Basic, a machine code utility plus 32k ram, printer and interface. The utility needs to use a "hot key" that will not interfere with your Basic program, that will jump to the assembly routine to print the screen image OR the utility may permit you to insert a CALL LINK in an appropriate part of the program to print the screen...

eg use the disk based utility THE MISSING LINK and in your program at an opportune place insert CALL LINK("DUMP")

^^^^^^^^^^^

THIS! THIS! THIS!

 

Thank you for mentioning this blackbox!

 

The back and forth with my typos and lack of sleep lately sent me back to your original reply.

 

After reading the documentation on the DUMP disk...

I copied DUMP disk to my DSK2 (3.5" floppy), Loaded Mini-Memory from my final grom 99 (I do have the actual cart but would rather save the wear and tear on the cart port), loaded the attached code from USB gotek (DSK1) and achieve SUCCESS!

Thank you blackbox! To spite never getting the slower code to work right for various reasons, using the DUMP program was super fast!

20211015_045355.jpg

JRBD13013a.txt

Share this post


Link to post
Share on other sites

Glad it all worked out for you in the end.


 

The BAD NAME IN 1380 was due to TI Basic being unable to find the CALL CHARPAT.  CHARPAT is added to TI Basic by the Mini Memory module by (ahem...) magical means and if you were running with the FG99 version that might be the culprit.   Or you didn't have the Mini Memory module loaded.

There are several versions of the FG99 operating system and I don't have them all- Mini Memory was one cause of amendments.

A quick check:  Select FG99 module mini memory, then from the TI console menu with the Mini Memory options plus 1 for TI Basic,  select TI Basic.  Type CALL CHARPAT(42,A$) and if you have an error, you don't have access to the extra BASIC sub programs.  This will also probably apply to the additional subprograms in the Personal Record Keeping, Statistics and Advertizer modules.

Not a problem if you don't intend to use the extensions they add to TI Basic.


 

 

- If you had instead selected one of the Extended Basic versions for FG99 it would have worked a treat, as the CHARPAT command in XB is not hidden away....

bb

 

Edited by blackbox
  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...