Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 22:23 17 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : GFXterm graphical VT220 terminal

Author Message
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 02:35am 17 Aug 2017
Copy link to clipboard 
Print this post

hi,
attached is a demo of a graphics terminal for the micromite i've been tinkering with for the past few weeks:
2017-08-17_123000_demo_17-aug.zip

this is essentially a VT220 terminal emulator with a glass graphics plane added over the front. the text and graphics are completely independent:



as this is just a demo, instructions are pretty scarce i'm afraid. upon running GFXterm.exe just right-click on the text area to bring up a panel of 6 control buttons - the top left one is 'CONNECT', which will get you started. the format of the connection string is:
PORTNAME:SPEED
so in my case i type in COM3:38400

two special key combinations are implemented:
alt-B sends a break to the serial port to reset an E-28 or similar
alt-C clears the graphics plane, you'll quickly find this useful!

there is a basic demo program included in the zip file that draws a sideways scrolling sinewave.

graphic commands are invoked with the print statement using the following format:
PRINT chr$(16) <command> param1, param2, ...
the available graphics commands are outlined in an included PDF. at the moment i've implemented the following:
clear
ink
line
plot
arc
fill
moveto
drawto
scroll
?

you can use either the full command, or just the first letter. to prevent overrunning the terminal with too many commands, you can send chr$(5) and wait for a chr$(6) response before sending more commands. see the basic demo.

i have only tested some of the graphics commands, and i am quite sure there will be plenty of bugs to explore! the code has only been tested on XP. there are also sections of the code (it is written in delphi/pascal) that are currently quite inefficient.


as always, feedback and comments are welcome!


cheers,
rob :-)
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9081
Posted: 02:44am 17 Aug 2017
Copy link to clipboard 
Print this post

Runs for me. (Windoze 8.1 Pro 64-bit)
Any plans to make the terminal window bigger with bigger text?Edited by Grogster 2017-08-18
Smoke makes things work. When the smoke gets out, it stops!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 03:22am 17 Aug 2017
Copy link to clipboard 
Print this post

the font size is dictated by the character set in the font used - just as teraterm does, i used 9-point "Terminal". this font provides a full set of 256 PC-compatible characters, but in order for the block characters to look right one needs to stick to 9 points to give a character size of 8x12 pixels (and a resulting graphics area of 640 x 288).

i may later on allow for changing the font and size, but that would require tinkering with the startup code and rethinking some stuff that is hardcoded. one option would be to allowing the users to make the changes, but then require a restart for them to take effect.


cheers,
rob :-)


 
astroboy
Newbie

Joined: 28/12/2014
Location: Australia
Posts: 38
Posted: 03:44am 17 Aug 2017
Copy link to clipboard 
Print this post

Thanks indeed Rob

It runs here on W10 64bit. I wish it was a bit bigger too .

Regards
John
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 04:12am 17 Aug 2017
Copy link to clipboard 
Print this post

have just done a bit of checking, and turns out i was quite wrong about having to stick to only 9 point. see the below screen grabs at 9, 12, and 14 points:







i'll work on making these three options selectable in some way.


cheers,
rob :-)
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 03:59am 18 Aug 2017
Copy link to clipboard 
Print this post

The test program is running here on an old XP notepad and alt-B works when its running except that the 'break' only lasts about a second then it starts running again. Alt-C clears the graphics properly and stops.

The test program wouldn't load with the 'from file' box nor from the 'paste from clipboard' box. In both cases it gave errors on all the DO and LOOP statements. It loaded properly using MMEdit and then it ran from the GFX window (using RUN) OK.

I tried to draw a line using:
PRINT chr$(16) L 100,100,200,200
from the GFX prompt but just got normal MMBasic back a la:
0 100 100 200 200

I'm probably missing something here.

Haven't tried anything else.

Greg
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 04:49am 18 Aug 2017
Copy link to clipboard 
Print this post

paceman:
oops, my mistake, the command should be in quotes. so the correct syntax is:
PRINT chr$(16) "<command>" param1, param2, ...

if you're micromite isn't connected to the PC via a 1455 running peter's firmware then alt-B will have no effect. what alt-B does is send a "set break" command, then 100ms later sends a "clear break" command. only peter's 1455 firmware interprets this as a command to reset an attached micromite.

when pasting, were you loading into the editor, or using autosave? unfortunately pasting into the editor has various issues and is extremely hard to make work reliably, while i've always found autosave to be quite reliable.

how both types of pasting work is that each line of text is sent to the micromite, then GFXterm waits until there has been silence from the micromite for 60ms before sending the next line.

pasting into the editor could likely be made to work reliably if the mmbasic editor implemented software flow-control (XON and XOFF). it would not need to respond to XON/XOFF commands from the terminal, but just to send the commands when accepting input. the editor also seems to do a great deal of unnecessary screen redrawing whenever it sees a carriage return.


cheers,
rob :-)
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 03:49am 19 Aug 2017
Copy link to clipboard 
Print this post

here's a new beta that allows for 3 possible font sizes: 9pt (default), 12p, and 14pt.
2017-08-19_134404_demo_20-aug.zip

the 'cancel paste' function has now been moved to an alt key. there are now SEVEN alt key combinations that do things:

alt-Z cancel a paste from clipboard or load from file that is in progress
alt-C clear graphics plane
alt-B send 'break' to the serial port
alt-1 select 9pt font size
alt-2 select 12pt font size
alt-3 select 14pt font size
alt-0 insert break line in command window (see below)

changing font size (alt-1/2/3) clears the text and graphics screens, and homes the cursor.

the bottom right button on the control panel (accessed with a right mouse click) now shows/hides a small floating command window. this window displays VT and GFX commands as they are processed, marked with pass/fail. the command window remembers the last 1000 or so commands with command strings only added when the command window is visible.

would appreciate any feedback. is the graphics ability useful?


cheers,
rob :-)Edited by robert.rozee 2017-08-20
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 04:15am 19 Aug 2017
Copy link to clipboard 
Print this post

Rob, have only just read your response from yesterday and it's 11:55pm so off to bed now, will test more tomorrow with your new beta.

Quick response - I'm using Mick's SMD MUP which has Jean's earlier 1455 f/w so that's probably the Alt-B issue. Re the errors on DO and LOOP when pasting - I used AUTOSAVE first but got no response, but that was just as I first started playing so it could well have been me. I then tried pasting it into the editor and that's where the DO and LOOP errors occurred but the rest of it seemed to load OK.

BTW isn't it about 3 AM over your way - time you were in bed!

Greg
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 05:40am 19 Aug 2017
Copy link to clipboard 
Print this post

Greg,
Instead of ALT+B just press the reset button on the micromite, does the same thing.


Microblocks. Build with logic.
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 07:05am 19 Aug 2017
Copy link to clipboard 
Print this post

  paceman said  BTW isn't it about 3 AM over your way - time you were in bed!


everyone knows the best code is written after midnight!

just gone 5am here, so will head off to bed.


cheers,
rob :-)
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 03:10am 20 Aug 2017
Copy link to clipboard 
Print this post

  MicroBlocks said   Greg,
Instead of ALT+B just press the reset button on the micromite, does the same thing.

Mick's SMD MUP doesn't have a reset button but I do have a jumper wire sitting on the MCLR pin of the ICSD header for just that Jean and it's been used regularly. The way I have the development 'system' (ahem ) mounted though means I have to turn it over and search for the Gnd pin to touch it against - very Basic (pun intended ).
Think it's time I spent five minutes organising something simpler.

Greg
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 04:28am 20 Aug 2017
Copy link to clipboard 
Print this post

  robert.rozee said   here's a new beta that allows for 3 possible font sizes: 9pt (default), 12p, and 14pt.

Different fonts working here on XP, definitely more readable. Not sure but have you got Alt-2/3 reversed?
AUTOSAVE using the "Paste from clipboard" box working all the time OK (nice and quick). "Load from textfile" and "Load from clipboard" (latter direct without AUTOSAVE) still give the DO and LOOP errors. The errors are "DO without LOOP" and "LOOP without DO".
When the error (on LOADS above) first comes up it now leaves a graphic 'dot' at the end of the line at that first instance of the error, not subsequent errors though. Don't think that was there in the previous .exe.
Tried the line "L" command again, this time with the quotes and it's working - haven't tried the other commands yet.

Greg
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 04:55am 22 Aug 2017
Copy link to clipboard 
Print this post

  paceman said  Not sure but have you got Alt-2/3 reversed?
AUTOSAVE using the "Paste from clipboard" box working all the time OK (nice and quick). "Load from textfile" and "Load from clipboard" (latter direct without AUTOSAVE) still give the DO and LOOP errors. The errors are "DO without LOOP" and "LOOP without DO"


alt-1/2/3 are in the correct order, it is just that the 12 point 'Terminal' font is narrower than the 14 point. the point size of a font refers purely to the character height, with the width largely up to the font designer.

here's another beta:
2017-08-22_143933_demo_23-aug.zip

i've made quite a few tweaks to the way comms are handled, with a bit of luck leading to a more stable and smooth performance. the automated side of pasting has been moved to a separate timer. fyi, there are now 4 timers driving everything: 500ms for cursor flashing; 50ms for cursor positioning and the status bar; 5ms for serial comms ,VT and GFX engines; and a variable period timer for pasting operations.

GFXterm now detects if the micromite editor is running, and adjusts the pasting speed accordingly. i've done tests with a 40k file and it quickly pastes/loads with autosave, while slowly but surely being accepted if pasted/loaded while the editor is running.

i've also added a 'bouncing ball' demo.


cheers,
rob :-)
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 03:31am 23 Aug 2017
Copy link to clipboard 
Print this post

  robert.rozee said   the point size of a font refers purely to the character height, with the width largely up to the font designer.

Well I've just learned something, thanks, guess I should have known that.

AUTOSAVE works fast and well for me too. Pasting when EDIT is running as you say is slow but does work. Interesting here that in this latter case the listing in the window after the final DO command has each successive line indented by a further two characters (using the 'ball' demo).

Greg
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 04:24am 23 Aug 2017
Copy link to clipboard 
Print this post

that is a 'feature' of the micromite editor. unfortunately you can't turn off auto-indenting, but you can trick it as follows:

with the cursor at the start of a clear line, press space, then the left arrow. this leaves a space to the right of the cursor. if you now paste, auto-indent will not interfere.

if anyone has any suggestions of changes/improvements/etc, i'd be interested in hearing.


cheers,
rob :-)
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 05:35pm 27 Aug 2017
Copy link to clipboard 
Print this post

a new beta. this one fixes a problem with pasting into the editor where a long first line would be corrupted. fixed by making the initial assumption that we are pasting into the editor and only ramps up the paste speed when determined otherwise.

have also added a 64k ring buffer to serial port reads, providing a fair bit more leeway in case of massive quantities of data arriving from the micromite. the three statement program do: print: loop takes around 60 seconds (at 38k4 and 40mhz) to fill the buffer. the buffer state is now shown on the status line.

support for reading the cursor position (ESC [ 6 n) now included, with a view to this being useful in future for mouse control of the editor. also alt-A to clear the ring buffer and alt-D to clear the text screen.

2017-08-28_033141_demo_28-aug.zip

terminal control commands:
====================
alt-Z cancel a paste from clipboard or load from file that is in progress
alt-A clear the 64k serial ring buffer
alt-C clear graphics plane
alt-D clear text plane
alt-B send 'break' to the serial port
alt-1 select 9pt font size (640 x 288 graphics)
alt-2 select 12pt font size (960 x 384 graphics)
alt-3 select 14pt font size (800 x 432 graphics)
alt-0 insert break line in command window

right-click mouse anywhere on text area to bring up action buttons (connect, paste, log to file, etc).


cheers,
rob :-)Edited by robert.rozee 2017-08-29
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 01:49pm 07 Sep 2017
Copy link to clipboard 
Print this post

another beta, this one is getting close to a finished product. the 'action button' panel has now been replaced with a more conventional right-click menu, with several of the alt-key functions moved there.

it is now possible to set the default foreground colour. this setting, along with font size and last successful comm port string are saved in the windows registry. there have also been numerous small bug fixes and enhancements made under the hood.

a Quickstart Guide has been added, detailing basic usage.

2017-09-07_234253_GFXterm_8-sep-2017.zip

to run GFXterm the only file you need is GFXterm.exe - this was one of the two main design goals, so it can be used without needing any installation (the other main design goal was making simple graphics available).

i'd appreciate feedback on performance, as well as suggested improvements to both the program and the documentation. i only have a rather elderly netbook running XP to do testing on here.


cheers,
rob :-)
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024