VT52 console output for TOS and Mint with TOSWIN2

GFA, ASM, STOS, ...

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4869
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

VT52 console output for TOS and Mint with TOSWIN2

Postby simonsunnyboy » Sat Oct 28, 2017 9:23 am

This is a language agnostic question.

When writing a textbased TOS console application that is supposed to work full screen in SingleTOS and in TOSWIN2 like windows with Mint.....

Which OS calls are to be preferred for dealing with the console I/O. BIOS or GEMDOS? Or is it ok to mix them?
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

joska
Hardware Guru
Hardware Guru
Posts: 3684
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: VT52 console output for TOS and Mint with TOS2WIN

Postby joska » Sat Oct 28, 2017 6:09 pm

Stick to GEMDOS calls.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

ThorstenOtto
Captain Atari
Captain Atari
Posts: 178
Joined: Sun Aug 03, 2014 5:54 pm

Re: VT52 console output for TOS and Mint with TOS2WIN

Postby ThorstenOtto » Sun Oct 29, 2017 1:36 am

I think bios calls might not even work in tos2win, since the I/O is done through a gemdos pipe when running under Mint.

susher
Retro freak
Retro freak
Posts: 12
Joined: Sat Oct 03, 2015 7:06 pm

Re: VT52 console output for TOS and Mint with TOS2WIN

Postby susher » Sun Oct 29, 2017 7:18 am

You don't say which language you are using.

If you're programming in C merely use the mintlib "UNIX" standard library with the ncurses library. This will allow your application to be terminal agnostic and you won't have to re-invent the wheel with the display management.

ThorstenOtto
Captain Atari
Captain Atari
Posts: 178
Joined: Sun Aug 03, 2014 5:54 pm

Re: VT52 console output for TOS and Mint with TOS2WIN

Postby ThorstenOtto » Sun Oct 29, 2017 7:48 am

susher wrote:If you're programming in C merely use the mintlib "UNIX" standard library with the ncurses library. This will allow your application to be terminal agnostic and you won't have to re-invent the wheel with the display management.


I guess that wont work very well with SingleTOS. The emulation of the necessary functions in the mintlib like tcgetattr() etc. it rather rudimentary. Not to speak that there might not be a terminfo description database in /usr/share/terminfo, TERM environment not set etc.

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4869
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: VT52 console output for TOS and Mint with TOS2WIN

Postby simonsunnyboy » Sun Oct 29, 2017 8:24 am

susher wrote:You don't say which language you are using.

If you're programming in C merely use the mintlib "UNIX" standard library with the ncurses library. This will allow your application to be terminal agnostic and you won't have to re-invent the wheel with the display management.


I will be using C but as said above it is irrelevant, C without any supplied runtime to conserve RAM.
I actually want to provide a small and reduced portable version of the old (Borland?) conio API.
It is easier to get conio support on other nun-unix platforms than a bloated ncurses runtime.
For Linux and co I plan to implement an ncurses based conio.

For the time being, simply conio for gcc on Atari for TOS.
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

joska
Hardware Guru
Hardware Guru
Posts: 3684
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: VT52 console output for TOS and Mint with TOS2WIN

Postby joska » Sun Oct 29, 2017 2:47 pm

Btw I guess you guys are talking about TOSWIN2, not TOS2WIN. If you really are talking about TOS2WIN then I don't know how BIOS I/O works with this emulator.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4869
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: VT52 console output for TOS and Mint with TOS2WIN

Postby simonsunnyboy » Sun Oct 29, 2017 3:53 pm

Sorry my fault, the naming is easy to mix up ;) I'll go for your GEMDOS suggestion.
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4869
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby simonsunnyboy » Wed Nov 01, 2017 8:51 am

It seems I discovered a TOS "feature". Can someone explain the following effect?

I am issueing VT52 color change commands through Cconws()

(void)Cconws("\033b\009") for color 9 will not work, I get blank text.
TOS seems to interpret the literal 0x09 character. I also discovered that atleast EmuTOS 0.9.4 does the same.

If I output the control codes through Bconout() instead (BIOS here, not GEMDOS) everything works fine.

The other colors do work through Cconws().

Now which GEMDOS functions do not mangle the data given and pass them through as expected?
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

czietz
Hardware Guru
Hardware Guru
Posts: 480
Joined: Tue May 24, 2016 6:47 pm

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby czietz » Wed Nov 01, 2017 9:52 am

Well, it is documented that Cconws will expand tabs. It seems you're looking for Crawio.

PS: Interestingly Atari's own GEMDOS Reference Manual http://dev-docs.exxoshost.co.uk/GEMDOS_ ... 4-1986.pdf says about Cconout: "Tabs are not expanded." This is however wrong, at least for TOS 2.06 (and for EmuTOS).

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4869
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby simonsunnyboy » Wed Nov 01, 2017 9:59 am

My 1988 copy of the Atari ST Profibuch does not mention this ;)
So I will try with Crawio() instead although this only can do one character at a time, not strings.
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

joska
Hardware Guru
Hardware Guru
Posts: 3684
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby joska » Wed Nov 01, 2017 9:59 am

simonsunnyboy wrote:Now which GEMDOS functions do not mangle the data given and pass them through as expected?


Cconws... Just tested it here and no problems with any of the colours. Maybe it's your compiler that mangles the data?
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

joska
Hardware Guru
Hardware Guru
Posts: 3684
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby joska » Wed Nov 01, 2017 10:04 am

czietz wrote:Well, it is documented that Cconws will expand tabs. It seems you're looking for Crawio.


No, Cconws does not interpret TAB as a TAB when it's a part of a VT52 escape sequence :)

cconws-test.png
You do not have the required permissions to view the files attached to this post.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

czietz
Hardware Guru
Hardware Guru
Posts: 480
Joined: Tue May 24, 2016 6:47 pm

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby czietz » Wed Nov 01, 2017 10:25 am

joska, which TOS version are we talking about? This is TOS 2.06:

cconws-colors.PNG


I can see from its source code (as made available by Thorsten Otto) that TABs are indeed expanded. There's no special provision for VT52 escape sequences.
You do not have the required permissions to view the files attached to this post.
Last edited by czietz on Wed Nov 01, 2017 10:27 am, edited 1 time in total.

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4869
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby simonsunnyboy » Wed Nov 01, 2017 10:26 am

I used Vincent Riviere's gcc and its Mintlib Cconws() binding for passing the codes.

OTOH I also had Cconout() used with the same effect. With Crawio() it is all fine for me and I will leave it that way

Tested with TOS 2.06 and EmuTOS 0.9.4
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4869
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby simonsunnyboy » Wed Nov 01, 2017 10:26 am

czietz wrote:joska, which TOS version are we talking about? This is TOS 2.06:

cconws-colors.PNG

I can see from its source code (as made available by Thorsten Otto) that TABs are indeed expanded. There's no special provision for VT52 escape sequences.


Yeah very similar to my attempt. Line for color 9 is white on white ;)
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4869
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby simonsunnyboy » Wed Nov 01, 2017 10:35 am

My efforts can be found and reviewed under https://github.com/simonsunnyboy/atarist_conio
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

czietz
Hardware Guru
Hardware Guru
Posts: 480
Joined: Tue May 24, 2016 6:47 pm

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby czietz » Wed Nov 01, 2017 10:49 am

Also happens with TOS 1.04 and TOS 3.06. Now I really wonder which TOS version joska was using for his test.

PS: EmuTOS 0.9.4 is really ancient -- we're close to 0.9.9 -- and as such should be avoided even for testing. You'll never know if you trigger a long fixed bug...

joska
Hardware Guru
Hardware Guru
Posts: 3684
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby joska » Wed Nov 01, 2017 10:58 am

czietz wrote:joska, which TOS version are we talking about?


TOS 2.06. What happens when you try the attached binary?
You do not have the required permissions to view the files attached to this post.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

czietz
Hardware Guru
Hardware Guru
Posts: 480
Joined: Tue May 24, 2016 6:47 pm

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby czietz » Wed Nov 01, 2017 11:08 am

Exactly what I had expected:
cconws-colors2.PNG


Tells me that you're running something non-standard. Any AUTO-start applications, maybe?
You do not have the required permissions to view the files attached to this post.

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4869
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby simonsunnyboy » Wed Nov 01, 2017 11:08 am

joska wrote:
czietz wrote:joska, which TOS version are we talking about?


TOS 2.06. What happens when you try the attached binary?


Same as with my old code, color 9 not available.
You do not have the required permissions to view the files attached to this post.
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4869
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby simonsunnyboy » Wed Nov 01, 2017 11:09 am

czietz wrote:Also happens with TOS 1.04 and TOS 3.06. Now I really wonder which TOS version joska was using for his test.

PS: EmuTOS 0.9.4 is really ancient -- we're close to 0.9.9 -- and as such should be avoided even for testing. You'll never know if you trigger a long fixed bug...


I expected BIOS and GEMDOS to be quite stable for this. It was the latest named version I had.
But I will check with more recent versions aswell.
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

czietz
Hardware Guru
Hardware Guru
Posts: 480
Joined: Tue May 24, 2016 6:47 pm

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby czietz » Wed Nov 01, 2017 11:16 am

simonsunnyboy wrote:But I will check with more recent versions aswell.


In this particular case it's not necessary; current EmuTOS will do the same thing. (And that's correct because it matches Atari TOS behavior.) It was more of a general remark to please not use ancient EmuTOS versions, unless it's for finding a regression.

joska
Hardware Guru
Hardware Guru
Posts: 3684
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby joska » Wed Nov 01, 2017 12:00 pm

czietz wrote:Tells me that you're running something non-standard. Any AUTO-start applications, maybe?


Yes I am! Sorry, I did not remember that I was using NVDI 2.51 as well. So that is probably why it works here.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

joska
Hardware Guru
Hardware Guru
Posts: 3684
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: VT52 console output for TOS and Mint with TOSWIN2

Postby joska » Wed Nov 01, 2017 12:03 pm

Not tested, but maybe you could output the escape sequences using Cconout()? Or does Cconout expand tabs as well?

Edit: Tested. Cconout expands TABs, while Cconws does not... If I replace Cconws with a loop around Cconout, I see the same result as you guys see with Cconws on plain TOS.
Last edited by joska on Wed Nov 01, 2017 12:18 pm, edited 1 time in total.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 2 guests

cron