VT-100 Codes

997 views
Skip to first unread message

Tom Lake

unread,
Sep 5, 2022, 12:35:52 PM9/5/22
to Altair-Duino
I have a program that draws a hat in hi-res using the enhanced VT-100 codes included with the Altair-Duino. I can draw points by drawing a line with the start and end points the same.
What I'd like to do, though, is be able to draw lines and circles in the background color so that they're invisible and erase whatever they cross. I don't see a way to do this. I tried turning invisible text mode on before drawing but that didn't work. Is there a way?

Charley Jones

unread,
Sep 5, 2022, 12:48:08 PM9/5/22
to Tom Lake, Altair-Duino
Those are actually ANSI codes.   Technically VT100 escape sequences.  I found these accidentally, long before the age of internet, by dumping random sequences to the screen.  Worked out the cursor controls, then later, found the vt100 sequences in a book.

Maybe you are talking about dazzler?

I did find this:

https://www.csie.ntu.edu.tw/~r92094/c++/VT100.html#:~:text=As%20an%20example%20of%20how%20to%20use%20this,or%20puts%20%28%22033%20%5B2J%22%29%3B%20Name%20Description%20Esc%20Code

Sent from my iPhone 12pm!
Charley Jones, PMP

On Sep 5, 2022, at 9:35 AM, Tom Lake <tl...@twcny.rr.com> wrote:

I have a program that draws a hat in hi-res using the enhanced VT-100 codes included with the Altair-Duino. I can draw points by drawing a line with the start and end points the same.
What I'd like to do, though, is be able to draw lines and circles in the background color so that they're invisible and erase whatever they cross. I don't see a way to do this. I tried turning invisible text mode on before drawing but that didn't work. Is there a way?

--
You received this message because you are subscribed to the Google Groups "Altair-Duino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altair-duino...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/altair-duino/8efe72a2-b04e-4299-8a80-3e2b75ce7b73n%40googlegroups.com.

Tom Lake

unread,
Sep 5, 2022, 1:56:41 PM9/5/22
to Altair-Duino
No, not Dazzler. I'm using the ASCII terminal (version 1.3) built into the AltairDuino Pro. It has many of the VT-100 escape sequences but not all. It also has enhancements to the VT-100 escape sequences for drawing lines and empty or filled boxes and circles. To draw a point on the screen, you can draw a line with start and end points the same:

Example, draw a line from 50,100 to 200,10

PRINT CHR$(27);"[Z1;50;100;200;10Z"

Example, set a single point at 150,200:

PRINT CHR$(27);"[Z1;150;200;150;200Z"






Tom Lake

unread,
Sep 5, 2022, 4:24:29 PM9/5/22
to Altair-Duino
Here are some pics to illustrate. You can see how I tried to erase lines in 205-215 but it still drew lines instead. Also can anyone tell me why it's drawing those extra horizontal and vertical lines?
IMG_1823[1].JPG
Message has been deleted
Message has been deleted

Tom Lake

unread,
Sep 5, 2022, 4:51:53 PM9/5/22
to Altair-Duino
Here's the code:
10 PRINT CHR$(27) ; "[2J": PRINT CHR$(27) ; "[?7l" ' Clear screen and turn off auto-wrap
20 P=240: Q=144
30 XP=144: XR=1.5*3.1415927#
40 YP=56: YR=1: ZP=64
50 XF=XR/XP: YF=YP/YR: ZF=XR/ZP
60 FOR ZI=-Q TO Q-1
70 IF ZI<-ZP OR ZI>ZP THEN GOTO 150
80 ZT=ZI*XP/ZP: ZZ=ZI
90 XL=INT(.5+SQR(XP*XP-ZT*ZT))
100 FOR XI=-XL TO XL
110 XT=SQR(XI*XI+ZT*ZT)*XF: XX=XI
120 YY=(SIN(XT)+.4*SIN(3*XT))*YF
130 GOSUB 170
140 NEXT XI
150 NEXT ZI
160 PRINT CHR$(27) ; "[?7h" ; : STOP  ' Turn on auto-wrap mode
170 X1=INT(XX+ZZ+P): X1$=MID$(STR$(X1),2)
180 Y1=YY-ZZ+Q: Y1$=MID$(STR$(Y1),2)
190 PRINT CHR$(27);"Z1;" ; X1$ ; ";" ; Y1$ ; ";" ; X1$ ; Y1$ ; "Z"
200 IF Y1=288  GOTO 220
205 ' PRINT CHR$(27) ; "[8m"
210 '  PRINT CHR$(27) ; "Z1 ;" ; X1$ ; ";" ; MID$(STR$(Y1+1),2) ; ";" ; X1$ ; ";288Z"
215 ' PRINT CHR$(27) ; "[m"
220 RETURN

Reply all
Reply to author
Forward
Message has been deleted

Charley Jones

unread,
Sep 5, 2022, 8:00:01 PM9/5/22
to John Galt, Altair-Duino
And congrats on the beautiful archimedes spiral.  I did one of the these and showed it to my 7th grade teacher who was floored.  I asked if there were more formulas like theirs, he did that he didn’t even know what this one was.


Sent from my iPhone 12pm!
Charley Jones, PMP

On Sep 5, 2022, at 4:38 PM, John Galt <furba...@gmail.com> wrote:


I was explaining this months ago when I posted my original spiral on the forums; 


I talked about modifying the terminal i/o code to allow you to delete a pixel, line, circle, or box currently the only way is you must clear the screen in order to do this.

In order to do this you must reprogram the PIC32 in the Terminal I/O

Attached in the code required to modify  Geoff Graham's ASCII video terminals with David's USB mod for the Altair Pro Terminal I/O card to include my little graphics patch.
it adds 5 additional escape codes allowing additional graphics functions.

The current escape codes are
   Draw a line ESC [Z1;;;;Z 
   Draw a box ESC [Z2;;;;Z 
   Draw a filled box ESC [Z3;;;;Z 
   Draw a circle ESC [Z4;;;Z  
   Draw a filled circle ESC [Z5;;;Z
  
I've added 
   erase a line ESC [Z6;;;;Z 
   erase a box ESC [Z7;;;;Z 
   erase a filled box ESC [Z8;;;;Z 
   erase a circle ESC [Z9;;;Z  
   erase a filled circle ESC [Z10;;;Z

It is backwards compatible since it adds 5 more escape codes rather then redoing the original 5 with another option.

the main changes are in VT100.C

the code is
// draw graphics
void cmd_Draw(void) {
//    if(Display24Lines) {
//        arg[2] = (arg[2]/3)*2;
//        arg[4] = (arg[4]/3)*2;
//    }
    if(arg[0] == 1) DrawLine(arg[1], arg[2], arg[3], arg[4], 1);
    if(arg[0] == 2) DrawBox(arg[1], arg[2], arg[3], arg[4], 0, 1);
    if(arg[0] == 3) DrawBox(arg[1], arg[2], arg[3], arg[4], 1, 1);
    if(arg[0] == 4) DrawCircle(arg[1], arg[2], arg[3], 0, 1, vga ? 1.14 : 1.0);
    if(arg[0] == 5) DrawCircle(arg[1], arg[2], arg[3], 1, 1, vga ? 1.14 : 1.0);
    if(arg[0] == 6) DrawLine(arg[1], arg[2], arg[3], arg[4], 0);
    if(arg[0] == 7) DrawBox(arg[1], arg[2], arg[3], arg[4], 0, 0);
    if(arg[0] == 8) DrawBox(arg[1], arg[2], arg[3], arg[4], 1, 0);
    if(arg[0] == 9) DrawCircle(arg[1], arg[2], arg[3], 0, 0, vga ? 1.14 : 1.0);
    if(arg[0] == 10) DrawCircle(arg[1], arg[2], arg[3], 1, 0, vga ? 1.14 : 1.0);


google will not allow me to attach the entire code archive.
but here are the 2 main changes i made.

download the code off Github https://github.com/dhansel/TerminalUSB  and then copy over main.c and vt100.c from the attached zip file.

recompile and upload the new firmware to your PIC32 in the terminal I/O board. you will get a new message on startup confirming the patch i made is enabled.
it will allow you to do what you want.
--
You received this message because you are subscribed to the Google Groups "Altair-Duino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altair-duino...@googlegroups.com.
patch.zip
Message has been deleted

Walt Perko

unread,
Sep 5, 2022, 8:56:41 PM9/5/22
to Altair-Duino
Hi, 

I copy/pasted that program into Note++, saved it as text file and sent it to my Altair-Duino Pro.  When I run it, I just get a blank screen ... no dots.  I do have the updated PIC Terminal firmware added into my Altair-Duino Pro computers.  

IMG_3896-20220905-John Galt PIC Graphics Patch-c2K.JPG

Tom Lake

unread,
Sep 5, 2022, 9:26:14 PM9/5/22
to Altair-Duino
My bad. That's what happens when I try to type a listing in while online. Here's the one I posted

190 PRINT CHR$(27);"Z1;" ; X1$ ; ";" ; Y1$ ; ";" ; X1$ ; Y1$ ; "Z"

and here is the correct one with the correct extra quoted semi-colon:

190 PRINT CHR$(27);"Z1;" ; X1$ ; ";" ; Y1$ ; ";" ; X1$ ; ";" ; Y1$ ; "Z"

Tom Lake

unread,
Sep 5, 2022, 9:52:44 PM9/5/22
to Altair-Duino
And change line 180

180 Y1=INT(YY-ZZ+Q): Y1$=MID$(STR$(Y1),2)

Tom Lake

unread,
Sep 5, 2022, 10:11:18 PM9/5/22
to Altair-Duino
I have programmers for 20 kinds of chip. Do you think I could find the PIC32 programmer? Of course not! Is there a way to program it right in the terminal board in the pro?
If so, are there instructions anywhere?

Walt Perko

unread,
Sep 5, 2022, 10:22:55 PM9/5/22
to Altair-Duino
Hi, 

You should be able to plug direct onto the Altair-Duino VT-100 I/O board to program the PIC chip too.  

I used my PICKit4 w/MLAB XIPE v5.50 to program my chips right on the Gary Kaufman ASCII VT-100 terminal board (I am using a blank with just the cap and resistors needed around the PIC chip socket.)  

I still have a few more blanks.  

Walt Perko

unread,
Sep 5, 2022, 10:30:25 PM9/5/22
to Altair-Duino
Hi, 

Is it possible for you to "attach" the working program here?  I've added the two corrections, but the program is still not working.  

Tom Lake

unread,
Sep 5, 2022, 10:39:36 PM9/5/22
to Altair-Duino
Those are the only two corrections I made - the added ";" and the added INT( function. You're plugging the VGA monitor and USB keyboard right into the back of the Pro and have ASCII terminal version 1.3,, right?

Walt Perko

unread,
Sep 5, 2022, 10:46:04 PM9/5/22
to Altair-Duino
Hi, 

Yes, I have a VGA monitor and USB keyboard as Configuration 0 setup so I can run DAZZLER programs too.  

The latest fix to line 180 (I'm copy/pasting) the fixes into the program listing before sending the program up to the Altair-Duino Pro ... leaves me with a blank screen with one line of text on the bottom.  

10 PRINT CHR$(27) ; "[2J": PRINT CHR$(27) ; "[?7l" ' Clear screen and turn off auto-wrap
20 P=240: Q=144
30 XP=144: XR=1.5*3.1415927#
40 YP=56: YR=1: ZP=64
50 XF=XR/XP: YF=YP/YR: ZF=XR/ZP
60 FOR ZI=-Q TO Q-1
70 IF ZI<-ZP OR ZI>ZP THEN GOTO 150
80 ZT=ZI*XP/ZP: ZZ=ZI
90 XL=INT(.5+SQR(XP*XP-ZT*ZT))
100 FOR XI=-XL TO XL
110 XT=SQR(XI*XI+ZT*ZT)*XF: XX=XI
120 YY=(SIN(XT)+.4*SIN(3*XT))*YF
130 GOSUB 170
140 NEXT XI
150 NEXT ZI
160 PRINT CHR$(27) ; "[?7h" ; : STOP  ' Turn on auto-wrap mode
170 X1=INT(XX+ZZ+P): X1$=MID$(STR$(X1),2)
180 Y1=INT(YY-ZZ+Q): Y1$=MID$(STR$(Y1),2)

190 PRINT CHR$(27);"Z1;" ; X1$ ; ";" ; Y1$ ; ";" ; X1$ ; ";" ; Y1$ ; "Z"
200 IF Y1=288  GOTO 220
205 ' PRINT CHR$(27) ; "[8m"
210 '  PRINT CHR$(27) ; "Z1 ;" ; X1$ ; ";" ; MID$(STR$(Y1+1),2) ; ";" ; X1$ ; ";288Z"
215 ' PRINT CHR$(27) ; "[m"
220 RETURN
VT-HAT.BAS.txt

Tom Lake

unread,
Sep 6, 2022, 12:46:39 AM9/6/22
to Altair-Duino
Weird! The code you've posted looks identical to the code I used to generate the picture. I get weird, extraneous lines and you get no graphics at all.
I wonder what's going on!

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Walt Perko

unread,
Sep 6, 2022, 9:24:08 PM9/6/22
to Altair-Duino
Hi, 

I copy/pasted the code into Note++, then PCGET the program to my Altair-Duino Pro ... when I run the program I get a syntax error in line 86.  

IMG_3898-20220906-JG Archimedes Spiral-2K.JPG


On Tuesday, September 6, 2022 at 5:50:36 PM UTC-7 furba...@gmail.com wrote:
i just realized this old code i threw together months ago just using the space bar to quit when its done.
i thought it was using any of the keys but it isn't. if you compile the code to run it faster then just hit stop reset if you don't want to wait for it to finish.


On Tuesday, September 6, 2022 at 8:46:26 PM UTC-4 John Galt wrote:
0 ' ARCHIMEDES SPIRAL PORT TO ALTAIR WITH ASCII VIDEO TERMINAL VER 1.3 BY JOHN GALT 2022
10 ' SETUP TERMINAL DRAW FUNCTIONS FOR ALTAIR PRO 8800 TERMINAL
25 F1$="[Z1;":F2$=";":F3$="Z":F4$="[":F5$="H":F6$="[H":F7$="[2J":F8$="[Z6;"
30 ESC$= CHR$(27) 'ESC CHARACTER
40 HOME$= ESC$+F6$ 'HOME THE CURSOR UPPER LEFT
50 CLS$= ESC$+F7$ 'CLEAR SREEN
60 DEF FNLTRIM$ (X$)= RIGHT$(X$, (LEN(X$)-1)) 'STRIP THE LEADING SPACE STR CONVERT
70 DEF FNLOCATE$ (X$,Y$)= ESC$+F4$+X$+F2$+Y$+F5$ 'LOCATE TEXT ON TERMINAL AT ROW,COL
80 DEF FNPIXEL$ (X$,Y$)= ESC$+F1$+X$+F2$+Y$+F2$+X$+f2$+Y$+F3$ 'PSET(X,Y) ON
85 DEF FNPIXEL1$ (X$,Y$)= ESC$+F8$+X$+F2$+Y$+F2$+X$+f2$+Y$+F3$ 'PSET(X,Y) OFF
86 DEF FNLINE$ (X3$,Y3$,X4$,Y4$)= ESC$+F1$+X3$+F2$+Y3$+F2$+X4$+f2$+Y4$+F3$ 'LINE(X1,Y1,X2,Y2) 'LINE ON
87 DEF FNLINE1$ (X3$,Y3$,X4$,Y4$)= ESC$+F8$+X3$+F2$+Y3$+F2$+X4$+f2$+Y4$+F3$ 'LINE(X1,Y1,X2,Y2) 'LINE OFF

400 '
410 ' PREPARE FOR GRAPHICS
420 GALT=0
430 PRINT "THIS PROGRAM CAN TAKE UPWARDS OF 4 HOURS TO COMPLETE"
440 PRINT "IT IS DESIGNED TO RUN TO COMPLETION BEFORE ALLOWING KEYBOARD INPUT TO RESUME"
450 PRINT "WHEN COMPLETE PRESS ANY KEY TO EXIT BACK TO CPM"
460 PRINT "DO YOU WANT TO PLOT AS A SOLID (Y/n)? (SOLID: REQUIRES GRAPHICS PATCH 2022 JOHN GALT FOR TERMINAL)"
470 INPUT SOLID$:
480 IF (SOLID$="y" OR SOLID$="Y") THEN GALT=1
490 PRINT CLS$;:PRINT ESC$+"[?25l"; ' CURSOR OFF

500 '
510 ' MAIN PROGRAM
520 '
530 XP=144:XR=4.71238905:XF=XR/XP '4.71238905 2.25X2.25
540 FOR ZI=-64 TO 64
550 ZT=ZI*2.25:ZS=ZT*ZT
560 XL=INT(SQR(20736-ZS)+0.5)
570 FOR XI=0-XL TO XL
580 XT=SQR(XI*XI+ZS)*XF
590 YY=(SIN(XT)+SIN(XT*3)*0.4)*56
600 X1=XI+ZI+160:Y1=90-YY+ZI '240x144  160=240 90=144
610 X1=INT(X1):Y1=INT(Y1) ' CHANGED FROM CINT TO INT
620 PRINT HOME$+FNPIXEL$ (FNLTRIM$(STR$(X1)),FNLTRIM$(STR$(Y1)));
630 IF GALT THEN PRINT HOME$+FNLINE1$ (FNLTRIM$(STR$(X1)),FNLTRIM$(STR$(Y1+1)),FNLTRIM$(STR$(X1)),FNLTRIM$(STR$(191)));
640 NEXT XI:NEXT ZI
650 WHILE INKEY$<>" ":WEND
660 END




On Tuesday, September 6, 2022 at 8:28:38 PM UTC-4 John Galt wrote:
I went back to the code I worked on last year and cleaned it up for the ASCII terminal patch. I'm running 2 tests on it solid and transparent when I'm done, I'll post it here.

Solid will only work with my little graphics patch otherwise transparent will work as normal. Solid takes much longer to run.

I would recommend compiling the code with BASCOM so it does not take 6 hours to complete.

check back soon.


Tom Lake

unread,
Sep 6, 2022, 9:26:56 PM9/6/22
to Altair-Duino
Great! Thanks for that. Did you update your PIC32 in place? If so what do I need to connect to where? I see a bootloader jumper on the I/O board. Does that need to be moved?

Jay Falck

unread,
Sep 6, 2022, 9:36:46 PM9/6/22
to Walt Perko, Altair-Duino
Check the single quotes used for comment indicator to be sure it’s the right one. Looks like it might be something else.


Sent from my Altair 8800
--
You received this message because you are subscribed to the Google Groups "Altair-Duino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altair-duino...@googlegroups.com.

Walt Perko

unread,
Sep 6, 2022, 9:40:39 PM9/6/22
to Altair-Duino
Hi, 

No.  I'm using a near blank ASCII Terminal board (I still have five blanks) with a cap and resistor ... (didn't need the crystal or 2nd cap or 2nd resistor ... )  

IMG_3901-20220906-ASCII Term + PICKit4-c2K.JPG
Message has been deleted
Message has been deleted

Tom Lake

unread,
Sep 7, 2022, 5:10:08 AM9/7/22
to Altair-Duino
I get syntax errors in the DEF FN lines. When I comment one out, I get an error in another DEF line. I don't know what's going on but Altair Disk Extended BASIC doesn't appear to like something although it sure looks like legal BASIC to me!

Tom Lake

unread,
Sep 7, 2022, 5:15:47 AM9/7/22
to Altair-Duino
Where is "ESC[?25l" and "ESC[?25h" described for turning the cursor on and off? I don't see it in the ASCII terminal manual nor in the VT-100 manual I have although it works fine on my Pro with unenhanced terminal.


Tom Lake

unread,
Sep 7, 2022, 6:43:12 AM9/7/22
to Altair-Duino
I'm not sure about MBASIC or BASIC-80 but I do know that you can't name a function FNLINE$, FNLINE1$, FNLOCATE$, FNLOCATE1$, FNLOC$ or FNLOC1$ in Altair Extended Disk BASIC. It sees future keywords in there, I guess.
I had to rename the functions in this program. I named them FNLIN$, FNLIN1$, FNLOATE$ and FNLOATE1$ and the syntax errors went away.

Walt Perko

unread,
Sep 7, 2022, 7:07:21 AM9/7/22
to Altair-Duino

Hi,

 The odd thing is that the code compiles and works as a compiled program. 

 I ran it before I went to bed last night, and now I have a nice clean solid hat on my Altair-Duino Pro LCD monitor. 

 I tried runnign it on my Altair 8800c connected to a VersaTerm in VT-102 mode, but only got a bunch of numbers on the screen. 

 I tried all three emulations, PETASCII, VT-52 and VT-102, both Solid and regular mode.  Just numbers on the screen.

 

THIS PROGRAM CAN TAKE UPWARDS OF 4 HOURS TO COMPLETE

IT IS DESIGNED TO RUN TO COMPLETION BEFORE ALLOWING KEYBOARD INPUT TO RESUME

WHEN COMPLETE PRESS ANY KEY TO EXIT BACK TO CPM

DO YOU WANT TO PLOT AS A SOLID (Y/n)? (SOLID: REQUIRES GRAPHICS PATCH 2022 JOHN
GALT FOR TERMINAL)

?


IMG_3902-20220907-JGSpiral-2K.JPG
Message has been deleted

fridtjof.ma...@gmail.com

unread,
Sep 7, 2022, 10:46:15 PM9/7/22
to Altair-Duino
The DEC way of doing these graphics is ReGIS:

https://en.wikipedia.org/wiki/ReGIS

(supported on the VT125 -- and supported by Xterm).

I am assuming 480x288 pixels, absolute for this new graphics mode?

FredW

On Wednesday, September 7, 2022 at 10:47:31 AM UTC-4 furba...@gmail.com wrote:
i would add some changes to make my program a little more stable. 
There appears to be some issues with the ASCII Terminal where it can miss a character being sent. I've seen it send incorrect information as a character is dropped.

I would 
1) disable interrupts. 
2) have a temp$ that just assembles all the strings being Concatenate together all at once then print that statement to avoid some kind of missed character where the Concatenate is active in the print statement.

I've noticed this behavior of the Ascii terminal before and just kind of ignored it but it shouldn't really being doing it.  i minimized it somewhat by forcing variables instead of direct print " " statements.
if you say 10 print "HELLO" and loop it it eventually fills basic dynamic memory and forces a garbage clean up. where if you say 10 A$="hello" 20 print A$ and loop it A$ has a permanent place in memory and is no longer dynamic and thus the garbage clean up basic does will not occur. this can cause the terminal to drop a character

-----
"I tried runnign it on my Altair 8800c connected to a VersaTerm in VT-102 mode, but only got a bunch of numbers on the screen. 

 I tried all three emulations, PETASCII, VT-52 and VT-102, both Solid and regular mode.  Just numbers on the screen."

-----

this is because the graphics commands are not VT102 or VT52 standard the Ascii Terminal has extra graphics abilities.
these are driven by escape codes hence when you have a non-compatible terminal it cannot translate the escape codes into something for the screen. 
this is what happens when you attempt to run a TEK graphics program on a non-TEK supported terminal you will just see escape codes.

Tom Lake

unread,
Sep 7, 2022, 11:46:39 PM9/7/22
to Altair-Duino
As my photo earlier in this thread shows there are indeed some artifacts when concatenating directly in the PRINT.
   

On Wednesday, September 7, 2022 at 10:47:31 AM UTC-4 furba...@gmail.com wrote:
i would add some changes to make my program a little more stable. 
There appears to be some issues with the ASCII Terminal where it can miss a character being sent. I've seen it send incorrect information as a character is dropped.

I would 
1) disable interrupts. 
2) have a temp$ that just assembles all the strings being Concatenate together all at once then print that statement to avoid some kind of missed character where the Concatenate is active in the print statement.

I've noticed this behavior of the Ascii terminal before and just kind of ignored it but it shouldn't really being doing it.  i minimized it somewhat by forcing variables instead of direct print " " statements.
if you say 10 print "HELLO" and loop it it eventually fills basic dynamic memory and forces a garbage clean up. where if you say 10 A$="hello" 20 print A$ and loop it A$ has a permanent place in memory and is no longer dynamic and thus the garbage clean up basic does will not occur. this can cause the terminal to drop a character

-----
"I tried runnign it on my Altair 8800c connected to a VersaTerm in VT-102 mode, but only got a bunch of numbers on the screen. 

 I tried all three emulations, PETASCII, VT-52 and VT-102, both Solid and regular mode.  Just numbers on the screen."

-----

this is because the graphics commands are not VT102 or VT52 standard the Ascii Terminal has extra graphics abilities.
these are driven by escape codes hence when you have a non-compatible terminal it cannot translate the escape codes into something for the screen. 
this is what happens when you attempt to run a TEK graphics program on a non-TEK supported terminal you will just see escape codes.

On Wednesday, September 7, 2022 at 7:07:21 AM UTC-4 r4r...@gmail.com wrote:

Tom Wilson

unread,
Sep 7, 2022, 11:55:31 PM9/7/22
to Tom Lake, Altair-Duino
It’s simpler than all that. BASIC sends a CRLF sequence after 80 characters were printed on a single line. So you can’t send a bunch of escape codes all on one line.

What you can do is prefix a batch of escape codes with ESC[H to put the cursor in the home position. Just make sure to call PRINT without a semicolon at the end before you have sent 80 characters. 

--
You received this message because you are subscribed to the Google Groups "Altair-Duino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altair-duino...@googlegroups.com.
--

Tom Lake

unread,
Sep 8, 2022, 6:17:21 AM9/8/22
to Altair-Duino
Of course you can extend it up to 255 characters before CRLF with WIDTH 255 but the problem remains when printing many concatenated strings.
Originally I had thought that the graphics cursor locate would take care of it.

fridtjof.ma...@gmail.com

unread,
Sep 8, 2022, 9:48:36 AM9/8/22
to Tom Lake, Altair-Duino
WIDTH 255 disables automatic CR/LF - This experiment shows this:

WIDTH 254
FOR I=1 TO 300:PRINT "X";:NEXT

Observe that a CR/LF is inserted at position 255. Now try

WIDTH 255
FOR I=1 TO 300:PRINT "X";:NEXT

And, NO CR/LF is inserted. At all. Note that MBASIC has a limit of 255 characters per string, anyway

To show this:

s$=space$(255)
print len(s$)
 255
s$ = s$ + "."
String too long

SPACE$(N) generates a string with N spaces. (see also SPC and STRING$)

It IS important to use WIDTH 255 to disable auto CR/LF for such applications.

This is discussed in the BASIC-80 manual on page 2-83, which also observes that, when WIDTH 255
(WIDTH LPRINT 255) is used, POS (or LPOS) returns to zero after position 255.

Fred Weigel

Tom Lake

unread,
Sep 8, 2022, 10:00:13 AM9/8/22
to Altair-Duino
Ah yes, but I don't use MBASIC or BASIC-80. I use Altair Disk Extended BASIC. There's no difference at all between WIDTH 254 and WIDTH 255 in that version. See photo.
IMG_1828[1].JPG

fridtjof.ma...@gmail.com

unread,
Sep 8, 2022, 10:17:56 AM9/8/22
to Tom Lake, Altair-Duino
Tom

You are correct! Microsoft BASIC 4.51 does it that way. BASIC 5.21 "fixes" WIDTH 255.

This fix is important, exactly to support such applications. You can poke an output routine
into memory, and call that.

Fred Weigel

Tom Lake

unread,
Sep 8, 2022, 6:06:26 PM9/8/22
to Altair-Duino
Gee, could I talk you into adding PSET and PRESET functions? I know I can set or reset a point by drawing or erasing a line with the start and endpoints the same but having dedicated functions makes the code so much neater.

On Monday, September 5, 2022 at 7:38:47 PM UTC-4 furba...@gmail.com wrote:
I was explaining this months ago when I posted my original spiral on the forums; 


I talked about modifying the terminal i/o code to allow you to delete a pixel, line, circle, or box currently the only way is you must clear the screen in order to do this.

In order to do this you must reprogram the PIC32 in the Terminal I/O

Attached in the code required to modify  Geoff Graham's ASCII video terminals with David's USB mod for the Altair Pro Terminal I/O card to include my little graphics patch.
it adds 5 additional escape codes allowing additional graphics functions.

The current escape codes are
   Draw a line ESC [Z1;;;;Z 
   Draw a box ESC [Z2;;;;Z 
   Draw a filled box ESC [Z3;;;;Z 
   Draw a circle ESC [Z4;;;Z  
   Draw a filled circle ESC [Z5;;;Z
  
I've added 
   erase a line ESC [Z6;;;;Z 
   erase a box ESC [Z7;;;;Z 
   erase a filled box ESC [Z8;;;;Z 
   erase a circle ESC [Z9;;;Z  
   erase a filled circle ESC [Z10;;;Z

It is backwards compatible since it adds 5 more escape codes rather then redoing the original 5 with another option.

the main changes are in VT100.C

the code is
// draw graphics
void cmd_Draw(void) {
//    if(Display24Lines) {
//        arg[2] = (arg[2]/3)*2;
//        arg[4] = (arg[4]/3)*2;
//    }
    if(arg[0] == 1) DrawLine(arg[1], arg[2], arg[3], arg[4], 1);
    if(arg[0] == 2) DrawBox(arg[1], arg[2], arg[3], arg[4], 0, 1);
    if(arg[0] == 3) DrawBox(arg[1], arg[2], arg[3], arg[4], 1, 1);
    if(arg[0] == 4) DrawCircle(arg[1], arg[2], arg[3], 0, 1, vga ? 1.14 : 1.0);
    if(arg[0] == 5) DrawCircle(arg[1], arg[2], arg[3], 1, 1, vga ? 1.14 : 1.0);
    if(arg[0] == 6) DrawLine(arg[1], arg[2], arg[3], arg[4], 0);
    if(arg[0] == 7) DrawBox(arg[1], arg[2], arg[3], arg[4], 0, 0);
    if(arg[0] == 8) DrawBox(arg[1], arg[2], arg[3], arg[4], 1, 0);
    if(arg[0] == 9) DrawCircle(arg[1], arg[2], arg[3], 0, 0, vga ? 1.14 : 1.0);
    if(arg[0] == 10) DrawCircle(arg[1], arg[2], arg[3], 1, 0, vga ? 1.14 : 1.0);


google will not allow me to attach the entire code archive.
but here are the 2 main changes i made.

download the code off Github https://github.com/dhansel/TerminalUSB  and then copy over main.c and vt100.c from the attached zip file.

recompile and upload the new firmware to your PIC32 in the terminal I/O board. you will get a new message on startup confirming the patch i made is enabled.
it will allow you to do what you want.

Tom Lake

unread,
Sep 10, 2022, 2:41:32 AM9/10/22
to Altair-Duino
Here's the program as I modified it to simplify calling the functions a bit (in modern terminology, I encapsulated the functions) and I've attached the original listing from the COMPUTE! ad for comparison.
The subroutine at 300 only defines the needed graphics strings. It doesn't do any printing. Parameters are now passed exactly as in original program, as floating point numbers. The main routine shouldn't have to know what goes on
"under the hood" of the functions. As for the functions, they redefine the coordinate system to put point (0,0) at the lower left rather than the upper left. That's caused by subtracting the Y coordinate from 288 in all functions.
Again, the main routine shouldn't have to worry about this. It's all handled in the functions.
One limitation I face here in Altair BASIC (and MBASIC 4.x) which isn't a problem for those of you who use MBASIC 5.x is that I had to shorten function names to eliminate keywords and make the first two characters of all variable names unique. 
The original program was written in Commodore PET BASIC (with graphics extensions that come with the MTU add-on graphics board) which has the same limitations as Altair BASIC.

10 GOSUB 300: PRINT CLS$; :PRINT ESC$+"[?25l"; ' CURSOR OFF
20 P=244: Q=144
30 XP=144: XR=1.5*3.1415927#
40 XP=56: YR=1: ZP=64
50 XF=XR/XP: YF=YP/YR: ZF=XR/XP

60 FOR ZI=-Q TO Q-1
70 IF ZI<-ZP OR ZI>ZP GOTO 150

80 ZT=ZI*XP/ZP: ZZ=ZI
90 XL=INT(.5+SQR(XP*XP-ZT*ZT))
100 FOR XI=-XL TO XL
110 XT=SQR(XI*XI+ZT*ZT)*XF: XX=XI
120 YY=(SIN(XT)+.4*SIN(3*XT))*YF
130 GOSUB 170
140 NEXT XI
150 NEXT ZI
160 PRINT ESC$+"[?25h":STOP 'CURSOR ON AND STOP PROGRAM
170 X1=XX+ZZ+P
180 Y1=YY-ZZ+Q
190 PRINT FNPSET$(X1,Y1);
200 IF Y1=0 GOTO 220
210 PRINT FNLO$(X1,Y1-1,X1,0)
220 RETURN
300 ' ARCHIMEDES SPIRAL PORT TO ALTAIR WITH ASCII VIDEO TERMINAL VER 1.3 BY JOHN GALT 2022
310 ' SETUP TERMINAL DRAW FUNCTIONS FOR ALTAIR PRO 8800 TERMINAL
320 F1$="[Z1;": F2$=";": F3$="Z": F4$="[": F5$="H": F6$="[H": F7$="[2J": F8$="[Z6;"
330 ESC$=CHR$(27) 'ESC CHARACTER
340 HOME$=ESC$+F6$ 'HOME THE CURSOR UPPER LEFT
350 CLS$=ESC$+F7$ 'CLEAR SREEN
360 DEF FNTRIM$(X)=MID$(STR$(INT(X)),2)
370 DEF FNPAT$(X,Y)=HOME$+ESC$+F4$+FNTRIM$(X)+F2$+FNTRIM$(288-Y)+F5$ 'LOCATE TEXT ON TERMINAL AT ROW,COL
380 DEF FNPSET$(X,Y)=HOME$+ESC$+F1$+FNTRIM$(X)+F2$+FNTRIM$(288-Y)+F2$+FNTRIM$(X)+F2$+FNTRIM$(288-Y)+F3$ 'PSET(X,Y) ON
390 DEF FNPRESET$(X,Y)=HOME$+ESC$+F8$+FNTRIM$(X)+F2$+FNTRIM$(288-Y)+F2$+FNTRIM$(X)+F2$+FNTRIM$(288-Y)+F3$ 'PSET(X,Y) OFF
400 DEF FNLN$(X1,Y1,X2,Y2)=HOME$+ESC$+F1$+FNTRIM$(X1)+F2$+FNTRIM$(288-Y1)+F2$+FNTRIM$(X2)+F2$+FNTRIM$(288-Y2)+F3$ 'LINE(X1,Y1,X2,Y2) 'LINE ON
410 DEF FNLO$(X1,Y1,X2,Y2)=HOME$+ESC$+F8$+FNTRIM$(X1)+F2$+FNTRIM$(288-Y1)+F2$+FNTRIM$(X2)+F2$+FNTRIM$(288-Y2)+F3$ 'LINE(X1,Y1,X2,Y2) 'LINE OFF
420 RETURN


Original program:

Hat.jpg

Walt Perko

unread,
Sep 10, 2022, 6:34:46 AM9/10/22
to Altair-Duino
Hi, 

Tom, your BASIC program is working on my Altair-Duino Pro, CP/M, MBASIC-80 v5.21 

So far it looks like a more solid hat than the others.  

OTOH, I tried running it on my Altair 8800c computer, CP/M, MBASIC-80 v5.21  connected to the VersaTerm (all three emulations VT-52, VT-102/Ansi and PETSCII) and I only get numbers on the screen.  

I guess there are some differences between the VT-100 emulation on the Altair-Duino Pro and the VersaTerm.  

Walt Perko

unread,
Sep 10, 2022, 1:35:28 PM9/10/22
to Altair-Duino
Hi, 

I let the BASIC program run on my Altair-Duino Pro for a few hours to get this;  

IMG_3914-20220910-Tom Lake TLSpiral-c1K.JPG

A nice solid disc ... at an angle.  Is that what it should be?  

Tom Lake

unread,
Sep 10, 2022, 4:56:23 PM9/10/22
to Altair-Duino
No. It's my fault again! :(  Line 40 should read 

40 YP=56: YR=1: ZP=64

Walt Perko

unread,
Sep 10, 2022, 7:29:55 PM9/10/22
to Altair-Duino
Hi, 

Yeah, it's looking better now, I figure it will take a couple of hours to finish rendering as a BASIC program, then I'll try it as a compiled program.  

Cool!  

Walt Perko

unread,
Sep 10, 2022, 10:55:54 PM9/10/22
to Altair-Duino
Hi, 

Now sure how long it took, but I just took a look at the monitor and it's done and looking good;  Great job Tom!  Now where is the Fedora?  

IMG_3919-20220910-Tom Lake TLSpiral-c1K.JPG

Tom Lake

unread,
Sep 11, 2022, 4:16:30 AM9/11/22
to Altair-Duino
Change the color jumper on the I/O board from green to Red and you'll have a Red Hat!
To get an even smoother plot, use 36 row mode! You need to adjust Q, XP, YP and ZP.

10 GOSUB 300: PRINT CLS$+ESC$+"[?9l"+ESC$+"[?25l"; ' 36 LINES PER SCREEN, CURSOR OFF
20 P=240: Q=216
30 XP=P*.9: XR=1.5*3.1415927
40 YP=90: YR=1: ZP=90


Tom Lake

unread,
Sep 11, 2022, 5:25:51 AM9/11/22
to Altair-Duino
I wish this forum allowed editing! Besides the changes to lines 10-40, you have to change all 288s in lines 370-410 to 432 to accommodate the higher vertical resolution.

Walt Perko

unread,
Sep 11, 2022, 6:25:48 AM9/11/22
to Altair-Duino
Hi, 

Yeah, the software for this forum is kind of weak.  I added the changes to the program, but it looks like the hat is too far to the left on the screen, and maybe started a little low on the screen too.  

It will be a few hours until the program completes.  I'll post the results later.  

Tom Lake

unread,
Sep 11, 2022, 1:35:14 PM9/11/22
to Altair-Duino
You might have to adjust your monitor. I had to adjust my 7" LCD backup camera monitor to center the picture.
try printing 24 rows of 80 characters and see if the result is centered on your screen.

This prints 24 rows of 80 letter O lines and waits for Ctrl-C to stop the program. 
 
10 WIDTH 80
20 FOR I=1 TO 24
30 PRINT STRING$(80,"O");  'The letter "O" not the digit zero.
40 NEXT I
50 GOTO 50

Walt Perko

unread,
Sep 11, 2022, 3:08:33 PM9/11/22
to Altair-Duino
Hi, 

Turned out the image started with the brim of the hat rather than what I thought was the top so when the plotting is complete it looks perfect! 

IMG_3924-20220911-Tom Lake TLHat-2K.JPG

Nice job!  

Walt Perko

unread,
Sep 12, 2022, 8:10:00 AM9/12/22
to Altair-Duino
Hi, 

Nice on a 1080p monitor ... in RED!  

I let the program run on my 2nd Altair-Duino Pro which is setup for RED and uses a 1080p PC monitor ($2 at the local thrift store)  

it's fun to walk past and see the progression ... I should setup my camera to do a video of the growth over night while the room is dark and there's minimal reflection from the room.  

IMG_3930-20220912-Tom Lake TLSpiral TLHat-c2K.JPG

IMG_3932-20220912-Tom Lake TLSpiral TLHat-c2K.JPG

IMG_3934-20220912-Tom Lake TLSpiral TLHat-c2K.JPG

IMG_3935-20220912-Tom Lake TLSpiral TLHat-c2K.JPG

IMG_3937-20220912-Tom Lake TLSpiral TLHat-c2K.JPG

I love supporting local thrift stores ...  

Walt Perko

unread,
Sep 12, 2022, 8:47:18 AM9/12/22
to Altair-Duino
Hi, 

The optimal program would simply ask for an equation from the user, then try to graph it on the screen.  Then the program might ask the user might to add horizontal and vertical offsets as needed to better center the image on the screen.  

That would be a fun program to play with.  

Tom Lake

unread,
Sep 15, 2022, 7:04:46 AM9/15/22
to Altair-Duino
I can compile the Terminal source code with your changes but should I use the Bootloader configuration or the Programmer configuration? I have a PicKit 3.5 so I'd think I'd use the Programmer configuration but I want to be sure, since I've never really worked with a PIC32 before.

On Monday, September 5, 2022 at 8:00:01 PM UTC-4 data...@gmail.com wrote:
And congrats on the beautiful archimedes spiral.  I did one of the these and showed it to my 7th grade teacher who was floored.  I asked if there were more formulas like theirs, he did that he didn’t even know what this one was.


Sent from my iPhone 12pm!
Charley Jones, PMP
--
You received this message because you are subscribed to the Google Groups "Altair-Duino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altair-duino...@googlegroups.com.

Walt Perko

unread,
Sep 16, 2022, 2:30:09 PM9/16/22
to Altair-Duino
Hi, 

Okay, I know not everybody has the upgraded PIC chip firmware inside their Altair-Duino's or Geoff ASCII Terminal boards so for S**ts 'n Grins and practice I made a demo video showing the entire rendering using timelapse photography;  

TLHAT TimeLapse 1sssM2     https://youtu.be/hDIJXg4yS0k

Yeah, it goes fast!  https://youtu.be/hDIJXg4yS0k

Walt Perko

unread,
Sep 16, 2022, 3:22:25 PM9/16/22
to Altair-Duino
Hi Tom,  

Can I share the program in some other forums?  I'm getting questions asking for the program.  

Tom Lake

unread,
Sep 16, 2022, 4:41:51 PM9/16/22
to Altair-Duino
Sure! If you'd mention that I was the one who ported it, I'd appreciate it. It would also be a good idea to show the original program from the ad , as I did.

Tom Lake

unread,
Sep 16, 2022, 4:44:52 PM9/16/22
to Altair-Duino
You wrote Waiting for Christmas? I love it!

Walt Perko

unread,
Sep 16, 2022, 6:55:42 PM9/16/22
to Altair-Duino
Hi, 

Okay, the program is working perfectly on my Altair 8800c computer, with the console being a slightly modified firmware in the Gary Kaufman ASCII Terminal
The firmware mod is from John Galt (furba), and the BASIC program is from Tom Lake who created it from the original listing for "Analog Computing 1982 Num7 Altair Mathematical Hat-1"

Analog Computing 1982 Num7 Altair Mathematical Hat-1.jpg  
Analog Computing 1982 Num7 Altair Mathematical Hat-1.jpg

Now we need a multi-color DAZZLER version of the program!  A neat looking "Summer of Love ... '67" hat.  
TLHAT1.BAS

Tom Lake

unread,
Sep 17, 2022, 6:28:18 AM9/17/22
to Altair-Duino
Actually, I created it from an ad in Compute! magazine in March, 1981

HAT.BAS Compute 010 Mar 1981.png

Eightbitswide

unread,
Sep 17, 2022, 3:48:54 PM9/17/22
to Altair-Duino
I'm adapting my current terminal to accept these graphics codes.

Looking at the documentation for the terminal I see:
  • Draw a lineESC[Z1;<x1>;<y1>;<x2>;<y2>Z
  • Draw a boxESC[Z2;<x1>;<y1>;<x2>;<y2>Z
  • Draw a filled boxESC[Z3;<x1>;<y1>;<x2>;<y2>Z
  • Draw a circleESC[Z4;<x1>;<y1>;<r>Z
  • Draw a filled circleESC[Z5;<x1>;<y1>;<r>Z

The BASIC "hat" program uses a Z6 command.  What is this additional command?

8b

Charley Jones

unread,
Sep 17, 2022, 4:29:12 PM9/17/22
to Eightbitswide, Altair-Duino
I found some code back around 77 and programmed this on my TRS-80 4k level 1.  127x47 resolution.  I still remember asking the math teach for more like this, and he didn’t even know what this was!


Sent from my iPhone 12pm!
Charley Jones, PMP

On Sep 17, 2022, at 12:48 PM, Eightbitswide <jeffl...@gmail.com> wrote:



Tom Lake

unread,
Sep 17, 2022, 4:48:23 PM9/17/22
to Altair-Duino
John Galt has extended the standard firmware with codes to erase lines, boxes and circles as well as draw them.

He added 
   erase a line ESC [Z6;<x1>;<y2>;<x2;<y2>Z 
   erase a box ESC [Z7;<x1>;<y1>;<x2>;<y2>Z 
   erase a filled box ESC [Z8;<x1>;<y1>;<x2>;>y2>Z 
   erase a circle ESC [Z9;<x>;<y>;<r>Z  
   erase a filled circle ESC [Z10;<x>;<y>;<r>Z

You have to get his patched code (in an earlier message in this thread), compile it with a PIC32 compiler (I use MPLAB compilers and IDE) then program the chip yourself. It can be programmed without removing it from the I/O board.

Walt Perko

unread,
Sep 17, 2022, 5:27:18 PM9/17/22
to Altair-Duino

Hi,

Here are a few equations that make interesting graphics;  

MOBIUS STRIP:
LOG(R) * SIN(1/2 * T) = Z * COS(1/2 * T)


BOOBS:
exp(-((x-4)^2+(y-4)^2)^2/1000) + exp(-((x +4)^2+(y+4)^2)^2/1000) + 0.1exp(-((x +4)^2+(y+4)^2)^2)+0.1exp(-((x -4)^2+(y-4)^2)^2)

 

SIZE 10 FLOWER CIRCLE:

((A + B) COS(T) – B * COS((A/B + 1) * T)), ((A + B) * SIN(T) – B * SIN((A/B + 1) * T)))

 

FLOWER:
R(X) = 2 + COS(10X) + 2 * SIN(5X)

 

SPIDER:
Plot3D[Sin[x * y], {x, -Pi, Pi}, {y, -Pi, Pi}]


A FUN MESS:

SIN(COS(TAN(XY))) = SIN(COS(TAN(X))) + SIN(COS(TAN(Y)))

 

COS(XY + COS(4Y))^2 + SIN(Y) = 0.4X + 0.1Y^2


HAT:
SIN(SQR(X^2+Y^2))^2

Tom Lake

unread,
Sep 18, 2022, 6:09:43 AM9/18/22
to Altair-Duino
To your additions I added commands to set and reset a pixel:


// draw graphics
void cmd_Draw(void) {
//    if(Display24Lines) {
//        arg[2] = (arg[2]/3)*2;
//        arg[4] = (arg[4]/3)*2;
//    }
    if(arg[0] == 1) DrawLine(arg[1], arg[2], arg[3], arg[4], 1);
    if(arg[0] == 2) DrawBox(arg[1], arg[2], arg[3], arg[4], 0, 1);
    if(arg[0] == 3) DrawBox(arg[1], arg[2], arg[3], arg[4], 1, 1);
    if(arg[0] == 4) DrawCircle(arg[1], arg[2], arg[3], 0, 1, vga ? 1.14 : 1.0);
    if(arg[0] == 5) DrawCircle(arg[1], arg[2], arg[3], 1, 1, vga ? 1.14 : 1.0);
    if(arg[0] == 6) DrawLine(arg[1], arg[2], arg[3], arg[4], 0);
    if(arg[0] == 7) DrawBox(arg[1], arg[2], arg[3], arg[4], 0, 0);
    if(arg[0] == 8) DrawBox(arg[1], arg[2], arg[3], arg[4], 1, 0);
    if(arg[0] == 9) DrawCircle(arg[1], arg[2], arg[3], 0, 0, vga ? 1.14 : 1.0);
    if(arg[0] == 10) DrawCircle(arg[1], arg[2], arg[3], 1, 0, vga ? 1.14 : 1.0);
    if(arg[0] == 11) DrawLine(arg[1], arg[2], arg[1], arg[2], 1);
    if(arg[0] == 12) DrawLine(arg[1], arg[2], arg[1], arg[2], 0);

Walt Perko

unread,
Sep 18, 2022, 7:28:00 AM9/18/22
to Altair-Duino
Hi, 

I compiled the program and tested it on both my Altair-Duino Pro and my Altair 8800c ... it's a little faster at 6 hours to render rather than 8 hours it takes as interpreted BASIC.  

Not so much time was saved.  

Eightbitswide

unread,
Sep 18, 2022, 12:07:01 PM9/18/22
to Altair-Duino
Tom,

Do you have a link to the PIC .hex file for these updates and will it run on an original version (non USB) of Geoff's board?

Thanks
8b

Walt Perko

unread,
Sep 18, 2022, 1:37:41 PM9/18/22
to Altair-Duino
Hi, 

This is the file I got from John Galt ... 

I'm using it on both of my Altair-Duino Pro computers and my Geoff Graham ASCII VT-100 terminal connected to my Altair 8800c computer.  
TerminalUSB.X.production.hex

Tom Lake

unread,
Sep 18, 2022, 2:30:31 PM9/18/22
to Altair-Duino
There are two versions. One you'd use if you're using the booloader to load the code and one if you're using a programmer. I've included both here with John's additions and mine.
TerminalUSB.zip

Eightbitswide

unread,
Sep 18, 2022, 7:40:09 PM9/18/22
to Altair-Duino
Thanks Tom,  As soon as my 8mhz crystal arrives I should be able to get it up and running. 
(Wasted the afternoon attempting to generate a clock signal from another micro.)

8b

Tom Lake

unread,
Sep 18, 2022, 10:52:04 PM9/18/22
to Altair-Duino
The new code boots up on Geoff's original board but I can't find my PS/2 keyboard to test it further than the splash screen.

da...@hansels.net

unread,
Sep 18, 2022, 11:05:50 PM9/18/22
to Altair-Duino
If the new code is derived from the version that supports USB then it will not work with the PS/2 keyboard.
As far as I know there is currently no firmware version that supports both USB and PS/2 keyboards.
It's either Geoff's original firmware for PS/2 support or my modified firmware for USB support.
Message has been deleted

Eightbitswide

unread,
Sep 20, 2022, 1:35:37 AM9/20/22
to Altair-Duino
Tom, 

Could you translate what Z6-Z12 are doing differently from Z1-Z5?

    if(arg[0] == 6) DrawLine(arg[1], arg[2], arg[3], arg[4], 0);
    if(arg[0] == 7) DrawBox(arg[1], arg[2], arg[3], arg[4], 0, 0);
    if(arg[0] == 8) DrawBox(arg[1], arg[2], arg[3], arg[4], 1, 0);
    if(arg[0] == 9) DrawCircle(arg[1], arg[2], arg[3], 0, 0, vga ? 1.14 : 1.0);
    if(arg[0] == 10) DrawCircle(arg[1], arg[2], arg[3], 1, 0, vga ? 1.14 : 1.0);
    if(arg[0] == 11) DrawLine(arg[1], arg[2], arg[1], arg[2], 1);
    if(arg[0] == 12) DrawLine(arg[1], arg[2], arg[1], arg[2], 0);

So far I have:

Draw a line ESC [Z1;<x1>;<y1>;<x2>;<y2>Z
Draw a box ESC [Z2;<x1>;<y1>;<x2>;<y2>Z
Draw a filled box ESC [Z3;<x1>;<y1>;<x2>;<y2>Z
Draw a circle ESC [Z4;<x1>;<y1>;<r>Z
Draw a filled circle ESC [Z5;<x1>;<y1>;<r>Z

Thanks!
8b

Tom Lake

unread,
Sep 20, 2022, 6:09:21 AM9/20/22
to Altair-Duino
Z1-Z5 draw lines, boxes and circles while Z6 - Z10 erase lines, boxes and circles. I added Z11 which sets a single pixel and Z12 which resets a single pixel. Here's a chart:
Graphics Terminal Escape Codes.pdf

Mark Lawler

unread,
Sep 23, 2022, 7:40:35 PM9/23/22
to Altair-Duino
Okay, you all made my day!  I've been running my own version of an assembly program to make the front of my Altair do the Cylon / KITT bouncy light thing.  Today I had some time to download the TLHAT1.BAS program in this conversation and transfer it to my Altair-Duino 8800 using PCGET and ExtraPutty's XMODEM.  I typed "MBASIC TLHAT1.BAS" into the CP/M command line after resetting my serial port, remounting the disk, and rebooting (to use my "VT100" vs ExtraPutty as my terminal) and wala!  The hat draws.  Nice!!!  Kinda soothing how long it takes to render. ;) 

I love this machine and this google group.  Thanks all!

Best,
-Mark

Eightbitswide

unread,
Sep 24, 2022, 5:53:26 PM9/24/22
to Altair-Duino
Looks like a few more interesting plots we can do if we can convert the code.


They included The Hat demo so I'm sure the others are very doable.

Walt Perko

unread,
Sep 27, 2022, 6:23:02 PM9/27/22
to Altair-Duino
Hi, 

Post the Cylon program ... 
Message has been deleted
Message has been deleted

Tom Lake

unread,
Sep 28, 2022, 5:48:44 AM9/28/22
to Altair-Duino
First, get rid of all the POKEs. 
Next, you have to figure out the new coordinates for your screen. The VGA coordinates are 640x480 so adjust the 320 and 240 numbers in the code to reflect a new center point.
Then add the string routines to convert coordinates to ESC strings.

Finally, replace lines  210-230 with this (those are letter "O", not zeroes):

200 PRINT ESC$;"[Z1;"+FNTRIM$(XS+XO)+";"+FNTRIM$(YS+YO)+";"+FNTRIM$(XT+XO)+";"+FNTRIM$(YT+YO)+"Z";
230 RETURN

or, if you use the string conversion routines in an earlier post, you can just do this:

200 PRINT FNLINE$(XS+XO,YS+YO,XT+XO,YT+YO);
230 RETURN

and you're done!
Reply all
Reply to author
Forward

Walt Perko

unread,
Oct 9, 2022, 6:53:20 PM10/9/22
to Altair-Duino
Hi, 

MAURER program seems to be running inverted on my IMSAI & JAIR computer;  

IMG_4115-20221009-IMSAI+JAIR-c2K.JPG

Figure that one out!  

villa...@gmail.com

unread,
Oct 10, 2022, 2:25:33 PM10/10/22
to Altair-Duino
Are you running the Northern or Southern hemisphere version ?  :-)

Tom Lake

unread,
Oct 10, 2022, 5:20:31 PM10/10/22
to Altair-Duino
Some graphics systems use the upper left for (0,0), some use the lower left. In your case, subtract the Y coordinate from the max Y resolution before plotting.

Example: 

If YMAX=200
original plot:

FNPLOT$(34,17)

corrected plot

FNPLOT$(34, YMAX - 17)

Walt Perko

unread,
Oct 10, 2022, 5:59:23 PM10/10/22
to Altair-Duino
Hi, 

Both computers have 8080 CPUs, both are connected to a  Geoff Graham/Gary Kaufman ASCII VT-100 terminal.  I even tried swapping the terminals between the two computers to get the same results, so I know it's not something in the terminal.  

OTOH, Tom you are assuming I know more about MBASIC than I actually know.  The example seems straight forward, but I have no clue how to insert it into the program.  

10 REM Tom Lake Revised Program  TLHAT1.BAS
20 REM ARCHIMEDES SPIRAL PORT
30 REM SETUP TERMINAL DRAW FUNCTIONS FOR ALTAIR PRO 8800 TERMINAL
40 F1$="[Z1;": F2$=";": F3$="Z": F4$="[": F5$="H": F6$="[H"
55 F7$="[2J": F8$="[Z6;"
60 ESC$=CHR$(27)
70 HOME$=ESC$+F6$
80 CLS$=ESC$+F7$
90 DEF FNA$(X)=MID$(STR$(INT(X)),2)
100 DEF FNB$(X,Y)=HOME$+ESC$+F4$+FNA$(X)+F2$+FNA$(432-Y)+F5$
110 DEF FNCA$(X,Y)=HOME$+ESC$+F1$+FNA$(X)+F2$+FNA$(432-Y)
120 DEF FNCB$(X,Y)=F2$+FNA$(X)+F2$+FNA$(432-Y)+F3$
130 DEF FNFA$(X1,Y1)=HOME$+ESC$+F8$+FNA$(X1)+F2$+FNA$(432-Y1)
140 DEF FNFB$(X2,Y2)=F2$+FNA$(X2)+F2$+FNA$(432-Y2)+F3$
150 PRINT CLS$+ESC$+"[?9l"+ESC$+"[?25l";
160 P=240: Q=216
170 XP=P*.9: XR=1.5*3.1415927#
180 YP=90: YR=1: ZP=90
190 XF=XR/XP: YF=YP/YR: ZF=XR/XP
200 FOR ZI=-Q TO Q-1
210 IF ZI<-ZP OR ZI>ZP GOTO 290
220 ZT=ZI*XP/ZP: ZZ=ZI
230 XL=INT(.5+SQR(XP*XP-ZT*ZT))
240 FOR XI=-XL TO XL
250 XT=SQR(XI*XI+ZT*ZT)*XF: XX=XI
260 YY=(SIN(XT)+.4*SIN(3*XT))*YF
270 GOSUB 320
280 NEXT XI
290 NEXT ZI
300 PRINT ESC$+"[?25h":STOP
310 REM
320 X1=XX+ZZ+P
330 Y1=YY-ZZ+Q
340 PRINT FNCA$(X1,Y1);FNCB$(X1,Y1)
350 IF Y1=0 GOTO 370
360 PRINT FNFA$(X1,Y1-1);FNFB$(X1,0)
370 RETURN

Walt Perko

unread,
Oct 10, 2022, 6:00:46 PM10/10/22
to Altair-Duino
Hi, 

I hadn't thought of that.  Maybe I just need to turn the computer so the CPU chip is facing the same direction as the CPU chip in my Altair ??? 

Wouldn't that be a conundrum!  

Walt Perko

unread,
Oct 10, 2022, 6:53:26 PM10/10/22
to Altair-Duino
Hi, 

For those interested I made a high speed video of the sketch growing on the display;  

Tom Lake

unread,
Oct 10, 2022, 9:36:37 PM10/10/22
to Altair-Duino
Here are the changes you should make:

340 PRINT FNCA$(X1,432-Y1);FNCB$(X1,432-Y1)

350 IF Y1=0 GOTO 370
360 PRINT FNFA$(X1,432-(Y1-1));FNFB$(X1,432)

Walt Perko

unread,
Oct 10, 2022, 10:06:13 PM10/10/22
to Altair-Duino
Hi, 

Those three changes make the program just turn a pixel ON/OFF, move a little and turn another pixel ON/OFF and so on.  Doesn't seem to be building an image on the display.  

Tom Lake

unread,
Oct 10, 2022, 10:47:37 PM10/10/22
to Altair-Duino
Try 360 PRINT FNFA$(X1,432-(Y1+1));FNFB$(X1,432)

Walt Perko

unread,
Oct 10, 2022, 10:59:00 PM10/10/22
to Altair-Duino
Hi, 

Okay, now I'm getting an image.  It will take a few hours to see what it looks like.  

Walt Perko

unread,
Oct 11, 2022, 8:20:34 AM10/11/22
to Altair-Duino
Hi, 

Now it's a very strange looking piece.  But I think this is because this computer isn't working exactly right, but it was a fun try;  

WIN_20221011_04_03_45_Pro.jpg

Mark Lawler

unread,
Oct 11, 2022, 2:55:24 PM10/11/22
to Altair-Duino
Tom,

Thank you so much!  Best thread ever?  I took your source code for TLHAT1.BAS and hacked it into a port of SPHERE.BAS.  Your vector graphic defines are just pure gold.  Here is my ported version of www.glansstuff.com's SPHERE.BAS after running with parameters of 200, 60, 45, and 23.

Sphere.jpg

Some dumb questions...  Am I right to assume the original source files assumed a TRS-80 with 640x240 graphics display?  The VT-100 is 768 x 240?  I find I'm experimenting with some of the initialization of X & Y vars to get results drawing, but not landing the plane on how to get them to "match" the originals in terms of screen placement and filling the display.

Best,
-Mark

Walt Perko

unread,
Oct 11, 2022, 4:14:28 PM10/11/22
to Altair-Duino
Hi, 

Why not post the code so we can try it on our respective computers?  

Tom Lake

unread,
Oct 11, 2022, 4:18:04 PM10/11/22
to Altair-Duino
The resolution on the VT-100 is 480x288 pixels in VGA 25 line mode, and 480x432 pixels in VGA 36 line mode.

Walt Perko

unread,
Oct 11, 2022, 4:32:06 PM10/11/22
to Altair-Duino
Hi, 

How do we switch from VGA 25 lines to VGA 36 lines on the (Gary Kaufman UpDated Geoff Graham) ASCII Video terminal board?  

Mark Lawler

unread,
Oct 11, 2022, 8:02:00 PM10/11/22
to Altair-Duino
So here is my copy of SPHERE.BAS.  Warning:  It is a quick port/hack.  I started with Tom's TLHAT1.BAS, deleted all the hat specific code, leaving Tom's setup and vector graphics defines for the VT-100 (thanks Tom!!!), then proceed to port SPHERE.BAS into this file from the original found on www.glensstuff.com.

I have yet to make the correct adjustments to lines 15 & 20 to take into account the VT100 screen size of 480 x 288 (I was playing with values to see what I could get to simply work first).

Running with a diameter of 200 (instead of 400) seems to yield better results.  Diameter = 200, segments = 60, x degrees = 45, y degrees = 23 will yield a good output (photo previously attached).

I'll play with the setup variables when I get some more time.

Enjoy!

Best,
-Mark

SPHERE.BAS

Walt Perko

unread,
Oct 11, 2022, 8:11:55 PM10/11/22
to Altair-Duino
Hi, 

Thanks.  I'll give it a try on my Altair-Duino Pro and my Altair 8800c computers.  
It is loading more messages.
0 new messages