Determining VT52 console dimension

GFA, ASM, STOS, ...

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

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

Re: Determining VT52 console dimension

Postby ThorstenOtto » Thu Nov 02, 2017 9:41 pm

m0n0 wrote:why don't you use Getrez() to determine the number of characters? ^^


And how do you determine the screen dimensions from this when running a 800x600 resolution?

I would also suggest the linea variables. The environment will not be set when run from the auto-folder, and using VDI functions there might also be difficult (although not impossible, XBoot is an example for this).

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

Re: Determining VT52 console dimension

Postby simonsunnyboy » Fri Nov 03, 2017 7:37 am

mfro wrote:for most practical purposes, i would assume, the negative LineA variables v_cel_mx and v_cel_my (-$2c and -$2a) might be good enough?


I would like to avoid LineA if possible even if this is an option.
Getrez() fails on anything not standard. I currently use it to disable text colors for ST-HIGH but it is not a very good solution.

Until now I have hardcoded the console dimension to 80x25. Maybe it it is sufficient to to check Getrez() for 0 and maybe 7 to limit to 40x25 unless the enviromental variables are present.
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
mfro
Atari Super Hero
Atari Super Hero
Posts: 689
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Determining VT52 console dimension

Postby mfro » Fri Nov 03, 2017 8:24 am

simonsunnyboy wrote:I would like to avoid LineA if possible even if this is an option.

Generally a good idea, but what if you have no other reasonable options?

simonsunnyboy wrote:Getrez() fails on anything not standard.

Getrez() can even be fooled on bog standard machines as it basically just returns an (offsetted) VDI physical workstation number. If you are using GDOS or screen extenders, you are free to assign any resolution to anything and even if you don't mix up numbers, you can still have GDOS load a screen font with nonstandard size.

If you insist using Getrez(), you should actually try to open the returned workstation and ask it for its dimensions using VDI functions.

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

Re: Determining VT52 console dimension

Postby joska » Fri Nov 03, 2017 8:43 am

What mfro said. LineA is a much more reliable option than Getrez. LineA is also documented by Atari and is safe to use if you really have to.

I suggest you first look for the ROWS/COLUMNS env variables (for compatibility with TOSWIN/MiniWin) and fall back to LineA.
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: 4872
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Determining VT52 console dimension

Postby simonsunnyboy » Fri Nov 03, 2017 8:54 am

I prefer anything over VDI. This leads to additional efforts that are unnecessary for console applications.
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: 3692
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Determining VT52 console dimension

Postby joska » Fri Nov 03, 2017 11:41 am

Fair enough, but that also means that you can't make console applications that adapts to the console size.
Jo Even

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

m0n0
Captain Atari
Captain Atari
Posts: 419
Joined: Mon Oct 05, 2009 3:13 am

Re: Determining VT52 console dimension

Postby m0n0 » Fri Nov 03, 2017 5:51 pm

And how do you determine the screen dimensions from this when running a 800x600 resolution?


Well, this was kind of a joke.

I think using VDI functions would be the right thing to do:

- It's not bloating your application
- It works
- It's almost just 3 calls...

But the problem is:

There is an bug (I guess) with FVDI (or maybe XaAES?). Once you opened an physical workstation during autostart, FVDI (or XaAES?) fails to run. presumably I did also call v_clswk at the end of my program. This affects aranym and FireBee systems. So I did not use that method to determine screen size during boot...

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

Re: Determining VT52 console dimension

Postby ThorstenOtto » Fri Nov 03, 2017 6:47 pm

simonsunnyboy wrote:Getrez() fails on anything not standard.


Thats the problem. I would think that most people nowadays use a setup with non-standard resolutions, Getrez() isn't very helpful in this case. The line-a variables are probably the most compatible option, even if they are deprecated since tos 1.04 or so. But for a program run from the auto folder there aren't that many choices.

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2067
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: Determining VT52 console dimension

Postby charles » Fri Nov 03, 2017 10:27 pm

the omikron dutch Atari language disk has a vt52 emulator ,,goods place to begin ?
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
shoggoth
Nature
Nature
Posts: 856
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: Determining VT52 console dimension

Postby shoggoth » Sat Nov 04, 2017 9:24 pm

... until you're in a windowed console environment.
Ain't no space like PeP-space.

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

Re: Determining VT52 console dimension

Postby joska » Sat Nov 04, 2017 11:48 pm

...hence my suggestion to use ROWS/COLUMNS if available, and fall back to LineA if not.
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 1 guest