Graphics on a terminal (well a terminal emulator)

956 views
Skip to first unread message

Steve Crompton

unread,
Sep 25, 2022, 4:35:11 PM9/25/22
to retro-comp
Hi There,

I was wondering if you could plot graphics (set pixel points, draw lines, that kind of thing) via RS-232 on a terminal - seems you can with the right terminal :-) VT-340 ?

I don't have a physical terminal of any kind - I currently use TeraTerm and have also used PuTTY in the past ...... so question is - is there a good (better) terminal emulator that runs on Windows 10 that supports colour graphics

I fancy getting my SBC to do more than just output text albeit slowly :-)

Any suggestions/recommendations?

Steve

Phillip Stevens

unread,
Sep 25, 2022, 8:16:03 PM9/25/22
to retro-comp
Steve wrote:
I was wondering if you could plot graphics (set pixel points, draw lines, that kind of thing) via RS-232 on a terminal - seems you can with the right terminal :-) VT-340 ?

Yes there's an established method using ReGIS.
 
I don't have a physical terminal of any kind - I currently use TeraTerm and have also used PuTTY in the past ...... so question is - is there a good (better) terminal emulator that runs on Windows 10 that supports colour graphics

The best (imho, only?) terminal emulator to do ReGIS is XTERM.

It fully supports all the ReGIS commands, but it is not enabled in default builds. ReGIS needs to be enabled in the source and recompiled. The instructions for building XTERM to support ReGIS are found on my z88dk-libraries/ReGIS repository.

XTERM doesn't support serial interfaces either, so it is used combined with picocom to connect to your SBC or serial device.

The example image below is generated using this ReGIS code displayed on XTERM using picocom.

^P1pS(E)W(I(M))P[600,200]V[][-200,+200]V[][400,100]W(I(G))P[700,100]V(B)[+050,][,+050][-050,](E)V(W(S1))(B)[-100,][,-050][+100,](E)V(W(S1,E))(B)[-050,][,-025][+050,](E)W(I(C))P[200,100]C(A-180)[+100]C(A+180)[+050]W(I(B))P[200,300]C(W(S1))[+100]C(W(S1,E))[+050]W(I(W))T(S02)"hello world"^\

regis_demo.png
 
I fancy getting my SBC to do more than just output text albeit slowly :-)

I built a C library to support ReGIS for the RC2014 / YAZ180.
There's nothing hardware specific about the code so it would be easy to build it for any other SBC.
Or you can generate your own ReGIS codes using assembly.

And, it is not actually slow at all.
It is a quite efficient (terse) language that works well over slow serial connections.
Over our 115200 baud connections it flies.

I made a video showing geocentric planetary orbits using ReGIS. Interesting to see planetary regression occurring from Earth' perspective.

The video shows the calculations running in real time on a z180 (real time for the machine, not for the planets).

planets.png

Hope that's a start.

Cheers, Phillip

alistair roe

unread,
Sep 26, 2022, 7:00:20 AM9/26/22
to retro-comp
You might consider the raspberry-pi rout.

PiGFX is a bare metal kernel for the Raspberry Pi that implements a basic ANSI terminal emulator with the additional support of some primitive graphics functions.




If you have a spare serial port you could even run your SBC two headed!
20220418_022706b.jpg

20220418_022706b.jpg

Todd Na

unread,
Sep 26, 2022, 8:01:24 AM9/26/22
to retro-comp
This is so cool, I had no idea there was such a thing. Was this something that was used regularly by a lot of dumb-terminals back in the day? Or is it more of a modern development?

Is that the Fibonacci algorithm?

Steve Crompton

unread,
Sep 26, 2022, 12:00:16 PM9/26/22
to retro-comp
Hi,

I like the idea of using ReGIS, - not so keen on using a Raspberry Pi if I am honest as I am guessing that uses a non standard protocol for the drawing of lines and setting pixels on/off ?

I am a Microsoft Windows man so step by step how would I get PicoTerm and Xterm setup and talking to a COM port on my Windows PC ?

I do have UBUNTU running on my Windows PC using WSL if that helps but my knowledge of Linux is limited and I currently use it only to run the 68K GCC toolchain

Steve

Phillip Stevens

unread,
Sep 26, 2022, 10:21:39 PM9/26/22
to retro-comp
Steve wrote:
I like the idea of using ReGIS, - not so keen on using a Raspberry Pi if I am honest as I am guessing that uses a non standard protocol for the drawing of lines and setting pixels on/off ?

I am a Microsoft Windows man so step by step how would I get PicoTerm and Xterm setup and talking to a COM port on my Windows PC ?

I know there’s a WSL solution that might help here. TBH, previously I’d just clicked install on my gaming PC, and thought that’s cool,  but have never done anything with it. For me the two worlds (linux vs. windows) move in separate brain spaces.

I was just reading this long standing bug with WSL2 for embedded developers (that’s us) on connecting serial ports. I think I’ll start the process with WSL1.
 
I do have UBUNTU running on my Windows PC using WSL if that helps but my knowledge of Linux is limited and I currently use it only to run the 68K GCC toolchain.

And I’ve no knowledge of WSL development either. Will be a new challenge. Let’s see how far we get. 
 
Phillip wrote:
Steve wrote:
I was wondering if you could plot graphics (set pixel points, draw lines, that kind of thing) via RS-232 on a terminal - seems you can with the right terminal :-) VT-340 ?

Yes there's an established method using ReGIS.
 
I don't have a physical terminal of any kind - I currently use TeraTerm and have also used PuTTY in the past ...... so question is - is there a good (better) terminal emulator that runs on Windows 10 that supports colour graphics

The best (imho, only?) terminal emulator to do ReGIS is XTERM.

It fully supports all the ReGIS commands, but it is not enabled in default builds. ReGIS needs to be enabled in the source and recompiled. The instructions for building XTERM to support ReGIS are found on my z88dk-libraries/ReGIS repository.

I’m certain that XTERM will build on WSL, but not at all sure whether its window can be displayed on WSL. We’ll find out. 
 
XTERM doesn't support serial interfaces either, so it is used combined with picocom to connect to your SBC or serial device.

I’m sure picocom will be OK with WSL (noting the bug above for serial ports). 
 
I built a C library to support ReGIS for the RC2014 / YAZ180.
There's nothing hardware specific about the code so it would be easy to build it for any other SBC.

It could very easily be compiled for CP/M. I just did it the existing way to get access to the RC2014 APU Module definitions (but now that’s been decoupled recently and is no longer necessary).
 
Or you can generate your own ReGIS codes using assembly.

And, it is not actually slow at all.
It is a quite efficient (terse) language that works well over slow serial connections.
Over our 115200 baud connections it flies.
 
Wrong. Actually it is on a RC2014 with APU Modules. 

Steve Crompton

unread,
Sep 27, 2022, 3:16:58 AM9/27/22
to retro-comp
I have WSL1 installed and that works great with 68K GCC Toolchain and USB serial devices/ports

My understanding though was that WSL1 worked only with command line Linux APP's so not sure XTERM with graphics will work

Phillip Stevens

unread,
Sep 27, 2022, 3:32:29 AM9/27/22
to retro-comp
 Steve wrote:
I have WSL1 installed and that works great with 68K GCC Toolchain and USB serial devices/ports
My understanding though was that WSL1 worked only with command line Linux APP's so not sure XTERM with graphics will work.

Yes, I think you're right. Microsoft is selling Windows 11 can do this feature, but that doesn't help those unwilling to replace their machines to support Win11.

So I'm approaching the process from both ends. Hopefully they'll meet in the middle.

Upstream: I've got z88dk building now, following these new WSL instructions.
And that is the "test case" for building everything else.

Downstream: I'm looking at Xming as an X Window System Server for Windows.
Perhaps, it can display windows from the WSL Ubuntu XTERM, being run remotely (on the same hardware)?


Phillip Stevens

unread,
Sep 27, 2022, 3:59:41 AM9/27/22
to retro-comp
Phillip wrote:
 Steve wrote:
I have WSL1 installed and that works great with 68K GCC Toolchain and USB serial devices/ports
My understanding though was that WSL1 worked only with command line Linux APP's so not sure XTERM with graphics will work.

Yes, I think you're right. Microsoft is selling Windows 11 can do this feature, but that doesn't help those unwilling to replace their machines to support Win11.

Downstream: I'm looking at Xming as an X Window System Server for Windows.
Perhaps, it can display windows from the WSL Ubuntu XTERM, being run remotely (on the same hardware)?

When you start looking, alternatives are rife.
Possibly MobaXterm might be sufficient, as it has an integrated X Server (which should work with XTERM being run on WSL), along with other interesting features.
For an open source alternative, it looks like VcXsrv is the preferred option.
Will try all the different options, as we get that far.

Steve Crompton

unread,
Sep 27, 2022, 8:12:47 AM9/27/22
to retro-comp
So the problem with USB COM Ports & WSL2 - does this work correctly with Windows 11 i.e. is this problem specific to Windows 10 or WSL2

Phillip Stevens

unread,
Sep 27, 2022, 8:25:18 AM9/27/22
to retro-comp
Steve wrote:
So the problem with USB COM Ports & WSL2 - does this work correctly with Windows 11 i.e. is this problem specific to Windows 10 or WSL2

The problem is with WSL2.
Microsoft are working around the problem and have a solution with Win11, but from what I'm reading it is a very janky fix.

For WSL1 it should "just work", but it isn't... ;-(
 
Phillip wrote:
 Steve wrote:
I have WSL1 installed and that works great with 68K GCC Toolchain and USB serial devices/ports
My understanding though was that WSL1 worked only with command line Linux APP's so not sure XTERM with graphics will work.

Yes, I think you're right. Microsoft is selling Windows 11 can do this feature, but that doesn't help those unwilling to replace their machines to support Win11.

Downstream: I'm looking at Xming as an X Window System Server for Windows.
Possibly MobaXterm might be sufficient, as it has an integrated X Server (which should work with XTERM being run on WSL), along with other interesting features.

 So, we're almost there. The only problem left is trying to recognise the USB connection to the RC2014.

There are no traditional USB devices appearing in WSL like /dev/ttyUSBn. (n a number)
They're all named /dev/ttySn (n a number). And, they don't work with picocom as expected. So that's a mystery I'm still working on.

It generates the required ReGIS codes.

I've compiled up an XTERM with ReGIS on WSL, and installed picocom.
I've installed MobaXterm, and it is super simple to use with XTERM. Simply open a session WSL, and then the connection to XTERM is automatic.
My XTERM window pops up correctly when opned via a MobaXterm session. So that's a win.

So close to having it working.
 

Phillip Stevens

unread,
Sep 27, 2022, 9:16:54 AM9/27/22
to retro-comp
Phillip wrote:
Steve wrote:
So the problem with USB COM Ports & WSL2 - does this work correctly with Windows 11 i.e. is this problem specific to Windows 10 or WSL2

The problem is with WSL2.
Microsoft are working around the problem and have a solution with Win11, but from what I'm reading it is a very janky fix.

For WSL1 it should "just work", but it isn't... ;-(

The issue is with picocom, as it tries to use some terminal capabilities that WSL doesn't support. So trying now with minicom.

There are no traditional USB devices appearing in WSL like /dev/ttyUSBn. (n a number)
They're all named /dev/ttySn (n a number). And, they don't work with picocom as expected. So that's a mystery I'm still working on.

So close to having it working.

And with via minicom we can access the RC2014 via an XTERM. But unfortunately minicom "cooks" the serial stream to emulate a VT102.
Which breaks ReGIS.

We need to have the raw stream to access the embedded escape characters.
So, to find out how to stop minicom trying to be too smart, and just pass the bits along nicely.
 

Phillip Stevens

unread,
Sep 27, 2022, 10:04:51 AM9/27/22
to retro-comp
Ok. So minicom was never going to stop cooking the serial I/O. So it's back to picocom...

But we have an OLD 18.04 LTS picocom (pre v2.3) which avoids the issues with the modern terminal capability calls, with which WSL can't deal...
So we uninstall the new supported version, and use dpkg to install this old version of picocom.

And... it works.
And, I'm sure that was harder than it needs to be.

RC2014 -> Win10 -> WSL1 -> Ubuntu picocom ->  Ubuntu XTERM -> onto Win10 screen.

So now the door's open to develop graphical programs on windows using WSL1, ReGIS, XTERM, and z88dk.
Nice that MobaXterm supports XTERM so well.

What is missing is XMODEM support on MobaXterm.
It support ZMODEM out of the box, but it relies on lrzsz to enable XMODEM (which I couldn't get to work at first pass).

ReGIS-on-WSL.png

Well that was a long day.
P.

Phillip Stevens

unread,
Sep 27, 2022, 11:58:59 PM9/27/22
to retro-comp
Phillip wrote:
So now the door's open to develop graphical programs on windows using WSL1, ReGIS, XTERM, and z88dk.
Well that was a long day.

Problems, or any issues, please let me know.

Cheers, Phillip

Fred Weigel

unread,
Sep 30, 2022, 3:29:00 PM9/30/22
to retro-comp
Philip --

The problem with minicom being "too smart" also exists on Linux. My solution is to use picocom... (but
note that I generally use Linux, with some testing under Windows).

But, it isn't that hard to do a suitable terminal emulator... A good start would be my hayes modem emulation:


Its not "efficient" in that it uses polling, is quite portable, and can work as a "device filter" -- which is what it
does for hayes (<delay>+++<delay> interpretation, hayes commands, connection and passthrough, it is all
there).

My la36 terminal project is also possible, but probably harder to mash into a simple "picocom" like thing.


Note that la36 uses xterm for the terminal functions... This illustrates how to execute xterm from within
your program and send/receive data to it. This may also do the trick for you -- but ties you to xterm, which
may be an unfortunate coupling.

Note that both la36 and hayes are MIT licensed... so feel free to lift any code you desire from them. Both
of these projects are "single source file", written in plain old (ordinary) C. They will require select() calls,
which IS available on cygwin, and certainly on WSL.

Fred Weigel.

Phillip Stevens

unread,
Sep 30, 2022, 4:10:42 PM9/30/22
to Fred Weigel, retro-comp
Fred wrote:
The problem with minicom being "too smart" also exists on Linux. My solution is to use picocom... (but
note that I generally use Linux, with some testing under Windows).

I’m going to take the lazy way out and just raise an issue on picocom to have the modern capability calls configurable. I’m guessing others have the same issue with WSL1 too.

Hospital pass, I think it is called. :-). 
--
Sent from a Mobile Device. Replies may appear terse.

Phillip Stevens

unread,
Oct 10, 2022, 9:22:09 AM10/10/22
to retro-comp
Just posted on the RC2014 Group (but some people don't read both)...

I've been having some further fun with 3D graphics and the RC2014. Following along from this discussion on getting ReGIS working on Windows, I thought it was worth porting my z88dk ReGIS library to the Arduino platform. During that process, I found that someone had written GLXGEARS for Arduino so I adapted their C++ Arduino program to use my Arduino ReGIS Library for demonstration.

And then I thought it would be fun to move GLXGEARS back to CP/M and z88dk in C and getting it running on RC2014 CP/M.
In the process I separated the 3D graphics matrix and vector functions out into a z88dk 3D library, and used the GLXGEARS program as the demonstration.

And, it works, CP/M ReGIS graphics GLXGEARS...

z80gears.png

Cheers, Phillip

Bernard Oates

unread,
Oct 11, 2022, 6:09:54 AM10/11/22
to retro-comp
Wow, cool.  Any hope of reviving CP/M GSX now that there is a graphics capability?

Phillip Stevens

unread,
Oct 11, 2022, 6:40:11 AM10/11/22
to retro-comp
Bernard wrote:
Wow, cool.  Any hope of reviving CP/M GSX now that there is a graphics capability?

Phillip wrote:
So now the door's open to develop graphical programs on windows using WSL1, ReGIS, XTERM, and z88dk.
Well that was a long day.

Problems, or any issues, please let me know.

And then I thought it would be fun to move GLXGEARS back to CP/M and z88dk in C and getting it running on RC2014 CP/M.
In the process I separated the 3D graphics matrix and vector functions out into a z88dk 3D library, and used the GLXGEARS program as the demonstration.

Well CP/M GSX has been available within z88dk for some time. So I'd say that's a yes.
Stefano finished the implementation middle of 2021. His posts here. And the still open issue on GSX support here.

The only thing that turned me off GSX was the need to use it with CP/M GSX capable video hardware and drivers, which the RC2014 has not.
And the need to use the GENGRAF tool to patch programs to use the GSX system calls adds an extra layer of complexity (which I didn't need).
Stefano (@zx70) was planning to implement generation of the GSX system calls directly (avoiding the need for GENGRAF patching) but this hasn't happened yet.

Hit him up on the z88dk forum or on github if you want to know more.

Cheers, Philip

fridtjof.ma...@gmail.com

unread,
Oct 11, 2022, 10:26:16 AM10/11/22
to Phillip Stevens, retro-comp
Udo Monk did a GSX driver for the 4014, which works perfectly under xterm. So, its at the same level as ReGIS.

I can email you a kit, if you want (Well, I can put it on DropBox, and put a link to it here -- just someone has to
say "please do it"). The benefit of 4014 over ReGIS? 4014 is 4096x4096 vector drawing, so has the ability to match
even 4k displays!

As well Udo did a PostScript driver (which is useful for generating print files).

Yes, GENGRAF is needed... but that is a very simple layer. Not too much reason to change it (it just adds a
loader and call 5 interception). It doesn't add graphics... the load of the graphics driver itself is done
purely at run-time. If that is too much of a pain, GENGRAF could be "eliminated"... but I haven't seen a
need for that (yet).

Still -- that should run on the RC2014 (I use it on my Altair-Duino).

FredW
--
You received this message because you are subscribed to a topic in the Google Groups "retro-comp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/retro-comp/xaa2N2RpJQM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to retro-comp+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/retro-comp/2fe1e6d8-44ab-4391-a401-b562f5d39907n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages