6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Apr 27, 2024 7:07 pm

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: 6502 VT100 Terminal(?)
PostPosted: Sat Nov 11, 2023 2:16 pm 
Offline
User avatar

Joined: Sun Dec 26, 2021 8:27 pm
Posts: 182
So I'm slowly making my little 65uino into a very basic terminal - and so far it has some basic IO, scrolls, has a serial buffer and most recently it got a feel for flow control:

https://youtu.be/pdloxXDJejM

But.. The more I implement, the more I realize making just a 90% VT100 compatible, is quite an undertaking (Dunning-Kruger in full effect here).

I did a search and see some VT100 use but I've missed it if someone's already made a VT100 terminal from a 6502 system on here. It's a rabbit hole I'm not sure I want to follow too far but if I can cheat and use someone else's code I'd like to wrap it up .. but I can't seem to find any :)

It might be a nonsense idea to make a VT100 out of a minimal 6502 with a screen, but I appreciate any help I can get.

_________________
---
New new new new new video out! Serial Bootloader for my 65uino
Also, check out: I2C on a 6502 Single Board Computer
and Complete hardware overview of my 6502 SBC R1 :)


Top
 Profile  
Reply with quote  
PostPosted: Sat Nov 11, 2023 2:58 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1399
Location: Scotland
AndersNielsen wrote:
So I'm slowly making my little 65uino into a very basic terminal - and so far it has some basic IO, scrolls, has a serial buffer and most recently it got a feel for flow control:

https://youtu.be/pdloxXDJejM

But.. The more I implement, the more I realize making just a 90% VT100 compatible, is quite an undertaking (Dunning-Kruger in full effect here).

I did a search and see some VT100 use but I've missed it if someone's already made a VT100 terminal from a 6502 system on here. It's a rabbit hole I'm not sure I want to follow too far but if I can cheat and use someone else's code I'd like to wrap it up .. but I can't seem to find any :)

It might be a nonsense idea to make a VT100 out of a minimal 6502 with a screen, but I appreciate any help I can get.


Interesting stuff.. Is it nonsense? Well, you're not doing anything new - we did this on Apple IIs and BBC Micros and everything else we used back in the day - even if you look at older terminals, they often had am early CPU in them like the 6800 or 8080 - and a genuine DEC VT100 has an 8080A inside it ... So ...

What you're doing isn't new by a long way... Writing serial drivers and so on has long been the bane of my life and today? I find that a lot of adapters and softwares, etc. just don't bother to even check (or enable) flow control (be it hardware, cts/rts or software xon/xoff...) and some USB adapters don't support hardware flow control either. It's a dying art.

Software - Xon/off isn't always as obvious as it may appear either - remember the wires are full duplex and you may have a full output buffer when your input buffer become full, so where can you inject the Xoff character in the output stream? And remember that in the time it takes to get to the sender, the sender may have sent another 2 characters (one in-flight and another starting before the in-flight Xoff lands on the remote end.. And modern UARTs have FIFOs in them, so they may have the next 16 characters ready to be clocked out - the receiver can get the Xoff and stop sending, but those bytes in the output FIFO are still there, still being clocked out... (unless that UART hardware can recognise them rather than pass them through)

So you need high-water marks and low water marks - and a means to bypass the output buffer to inject the Xoff even if the output buffer is full. So don't wait until the input buffer is full to send the stop, but maybe 75-80% full to give you some wiggle room. And it works both ways. Don't send the Xon when empty, but almost empty (low water mark), so you never run out with gaps in the transmissions...

The same applies for hardware handshaking although that ought to stop within one character being sent, but remember that when you say stop to the remote there may still be a byte in-flight on the wire...

Simple terminals would probably never have a full output buffer (no-one can type that fast) but one day you may be transferring files... If you want an example of just how horrible that can get the look at the Kermit protocol...

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Sat Nov 11, 2023 5:00 pm 
Offline

Joined: Mon Feb 15, 2021 2:11 am
Posts: 98
drogon wrote:
Interesting stuff.. Is it nonsense? Well, you're not doing anything new - we did this on Apple IIs and BBC Micros and everything else we used back in the day - even if you look at older terminals, they often had am early CPU in them like the 6800 or 8080 - and a genuine DEC VT100 has an 8080A inside it ... So ...


And the TeleVideo 9xx series terminals were 6502-based terminals.


Top
 Profile  
Reply with quote  
PostPosted: Sat Nov 11, 2023 5:06 pm 
Offline

Joined: Thu Oct 12, 2023 3:05 am
Posts: 11
The Picocomputer I sent you has a VT-like terminal in it. It's not that bad looking back but getting started was hard. The deepest part of the hole is CSI with multiple arguments. I haven't filled out every command yet, but the state machine logic is complete.


Top
 Profile  
Reply with quote  
PostPosted: Sat Nov 11, 2023 5:21 pm 
Offline
User avatar

Joined: Sun Dec 26, 2021 8:27 pm
Posts: 182
Rumbledethumps wrote:
The Picocomputer I sent you has a VT-like terminal in it. It's not that bad looking back but getting started was hard. The deepest part of the hole is CSI with multiple arguments. I haven't filled out every command yet, but the state machine logic is complete.


Excitedly waiting for that to arrive. Written in 6502 ASM, python or c/++?

Sean wrote:
drogon wrote:
Interesting stuff.. Is it nonsense? Well, you're not doing anything new - we did this on Apple IIs and BBC Micros and everything else we used back in the day - even if you look at older terminals, they often had am early CPU in them like the 6800 or 8080 - and a genuine DEC VT100 has an 8080A inside it ... So ...


And the TeleVideo 9xx series terminals were 6502-based terminals.


Source available for those by any chance?

_________________
---
New new new new new video out! Serial Bootloader for my 65uino
Also, check out: I2C on a 6502 Single Board Computer
and Complete hardware overview of my 6502 SBC R1 :)


Top
 Profile  
Reply with quote  
PostPosted: Sat Nov 11, 2023 5:38 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1399
Location: Scotland
AndersNielsen wrote:
Rumbledethumps wrote:
The Picocomputer I sent you has a VT-like terminal in it. It's not that bad looking back but getting started was hard. The deepest part of the hole is CSI with multiple arguments. I haven't filled out every command yet, but the state machine logic is complete.


Excitedly waiting for that to arrive. Written in 6502 ASM, python or c/++?

Sean wrote:
drogon wrote:
Interesting stuff.. Is it nonsense? Well, you're not doing anything new - we did this on Apple IIs and BBC Micros and everything else we used back in the day - even if you look at older terminals, they often had am early CPU in them like the 6800 or 8080 - and a genuine DEC VT100 has an 8080A inside it ... So ...


And the TeleVideo 9xx series terminals were 6502-based terminals.


Source available for those by any chance?


You might find ROM dumps on e.g. bitsavers if you're lucky - but given the hardware is a raft of TTL then who knows just how much use it might be.

Another thought I just had - as well as DEC/ANSI codes, Acorn/BBC Micro codes are handy - much simpler too and can cater for graphics so the small but seemingly up and coming folks trying to get BBC Basic going might find that handy - I actually do the reverse in my Ruby system in that the host MCU translates Acorn codes into ANSI codes to code running on the 6502 can output to an ANSI terminal without any changes...

Just don't write/rewrite termcap... That's above & beyond!

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Sat Nov 11, 2023 5:45 pm 
Offline

Joined: Thu Oct 12, 2023 3:05 am
Posts: 11
AndersNielsen wrote:
Excitedly waiting for that to arrive. Written in 6502 ASM, python or c/++?

I think they put it on the wrong truck because it took an unnecessary tour of the USA. Seems back on track now.

It's C that should port well to CC65. I'm planning on renaming the file, so here's a long permalink...
https://github.com/picocomputer/rp6502/ ... erm/term.c


Top
 Profile  
Reply with quote  
PostPosted: Sat Nov 11, 2023 6:54 pm 
Offline

Joined: Wed Aug 21, 2019 6:10 pm
Posts: 217
While VT52 is a lot less capable, it is also simpler, with all but one control codes ESC plus one character ... if not supporting the graphics & keypad functions, 8 single character functions, plus the single three character command for setting cursor position. It's far from as common as VT-100/ANSI, but it does have some support -- eg, xterm can be opened in vt52 mode, for instance.

ESC A - cursor up
ESC B - cursor down
ESC C - cursor right
ESC D - cursor left
ESC H - cursor home
ESC I - reverse line feed ... cursor up one line, unless at home row, in which case scroll display down one line
ESC J - clear to end of screen
ESC K - clear to end of line
ESC Y r c - set cursor to row r, column c


Top
 Profile  
Reply with quote  
PostPosted: Sat Nov 11, 2023 10:43 pm 
Offline
User avatar

Joined: Sun Dec 26, 2021 8:27 pm
Posts: 182
drogon wrote:
Just don't write/rewrite termcap... That's above & beyond!


If it's supposed to be useful as a quick and dirty terminal to hook up to anything spitting out VT100, I guess it only has to know its own limitations.

And maybe handle as many of these as possible: http://www.braun-home.net/michael/info/ ... mmands.htm

_________________
---
New new new new new video out! Serial Bootloader for my 65uino
Also, check out: I2C on a 6502 Single Board Computer
and Complete hardware overview of my 6502 SBC R1 :)


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 12, 2023 2:54 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 565
The VT 100 used an Intel 8080 as its processor, so it's within the capability of a 6502 to emulate a VT 100. Back in the day I used one on my Atari 800 XL to do my CS homework on my college's time sharing system.

So it's just a simple matter of programming. Which in practice is never simple.


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 12, 2023 3:17 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
I think it's interesting that you're essential doing the opposite of what most people do - so rather than having a VT100-compatible terminal connected to your computer for input and output, you're allowing other devices to use your 6502 based computer as an output terminal. I'm curious what these other devices are, did you have anything in mind? It is fairly easy to get a Linux computer to accept logins over a serial port, so that could be one thing.

Another benefit you'll get is that you can use VT100 sequences even from local programs, and have a standardised method for moving the cursor around regardless of whether the output is going to the LCD or to an external terminal.


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 12, 2023 5:00 pm 
Offline

Joined: Wed Aug 21, 2019 6:10 pm
Posts: 217
gfoot wrote:
... Another benefit you'll get is that you can use VT100 sequences even from local programs, and have a standardised method for moving the cursor around regardless of whether the output is going to the LCD or to an external terminal.


This is the really interesting side of it to me ... for instance, in Forth, implementing a cursor down display word by printing a string starting with ESC [ is a nice and tidy approach.


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 12, 2023 5:03 pm 
Offline
User avatar

Joined: Sun Dec 26, 2021 8:27 pm
Posts: 182
gfoot wrote:
I think it's interesting that you're essential doing the opposite of what most people do - so rather than having a VT100-compatible terminal connected to your computer for input and output, you're allowing other devices to use your 6502 based computer as an output terminal. I'm curious what these other devices are, did you have anything in mind? It is fairly easy to get a Linux computer to accept logins over a serial port, so that could be one thing.

Another benefit you'll get is that you can use VT100 sequences even from local programs, and have a standardised method for moving the cursor around regardless of whether the output is going to the LCD or to an external terminal.


In my last three videos I’ve been using a Raspberry Pi Zero as the “mainframe” I connect to and have been using that as starting point for what’s missing - so first I got it to login, then I got it to scroll and then I (almost) got it to respect flow control during boot.

Who knows - maybe I’ll get my hands on a minicomputer one day :)

Can a 6502 computer control a Raspberry Pi?
https://youtu.be/QYN7VGy-H6Y

Scrolling OLED on a 6502 Single Board Computer
https://youtu.be/Cexdm8K4kW0

Serial Flow Control. What's CTS RTS XOFF XON and why should you care?
https://youtu.be/pdloxXDJejM

_________________
---
New new new new new video out! Serial Bootloader for my 65uino
Also, check out: I2C on a 6502 Single Board Computer
and Complete hardware overview of my 6502 SBC R1 :)


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 13, 2023 12:14 am 
Offline

Joined: Sun Feb 22, 2004 9:01 pm
Posts: 78
drogon wrote:
I actually do the reverse in my Ruby system in that the host MCU translates Acorn codes into ANSI codes to code running on the 6502 can output to an ANSI terminal without any changes...
And if you want PDP11 code that translates BBC VDU sequences to ANSI sequences.... or C code.... :)

_________________
--
JGH - http://mdfs.net


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 13, 2023 11:24 am 
Offline
User avatar

Joined: Sun Dec 26, 2021 8:27 pm
Posts: 182
jgharston wrote:
drogon wrote:
I actually do the reverse in my Ruby system in that the host MCU translates Acorn codes into ANSI codes to code running on the 6502 can output to an ANSI terminal without any changes...
And if you want PDP11 code that translates BBC VDU sequences to ANSI sequences.... or C code.... :)


Sounds cool but all the links on your site seem dead? :?

_________________
---
New new new new new video out! Serial Bootloader for my 65uino
Also, check out: I2C on a 6502 Single Board Computer
and Complete hardware overview of my 6502 SBC R1 :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: Proxy and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: