How do I find out the TOS language version installed?

C and PASCAL (or any other high-level languages) in here please

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

Post Reply
User avatar
wyerd
Atari maniac
Atari maniac
Posts: 87
Joined: Fri May 31, 2013 7:31 pm
Location: Upstate NY. USA.

How do I find out the TOS language version installed?

Post by wyerd »

Is there a way to interrogate what language TOS is in C? For example, if it’s US English, the date will be displayed as MM/DD/YY, if any european language it’ll be displayed DD/MM/YY.
czietz
Hardware Guru
Hardware Guru
Posts: 1298
Joined: Tue May 24, 2016 6:47 pm

Re: How do I find out the TOS language version installed?

Post by czietz »

If available, use the _IDT cookie to determine the user's/OS's preference how to display a date: http://toshyp.atari.org/en/003007.html#Cookie_2C_20_IDT
Otherwise, the sysbase variable points to an OSHEADER structure, whose os_conf member will tell you the TOS language.
User avatar
wyerd
Atari maniac
Atari maniac
Posts: 87
Joined: Fri May 31, 2013 7:31 pm
Location: Upstate NY. USA.

Re: How do I find out the TOS language version installed?

Post by wyerd »

Great, thanks. I’ll look into these.
AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2978
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: How do I find out the TOS language version installed?

Post by AtariZoll »

There is cookie less way - in TOS header there is region/language flag. Word at offset $1C . 7 is UK English, 3 is German .... You can find more details after little search.
Famous Schrodinger's cat hypothetical experiment says that cat is dead or alive until we open box and see condition of poor animal, which deserved better logic. Cat is always in some certain state - regardless from is observer able or not to see what the state is.
czietz
Hardware Guru
Hardware Guru
Posts: 1298
Joined: Tue May 24, 2016 6:47 pm

Re: How do I find out the TOS language version installed?

Post by czietz »

AtariZoll wrote:There is cookie less way - in TOS header there is region/language flag. Word at offset $1C . 7 is UK English, 3 is German .... You can find more details after little search.
Yes, as I already wrote above: "Otherwise, the sysbase variable points to an OSHEADER structure, whose os_conf member will tell you the TOS language." However, the cookie -- if present -- should take preference when displaying a date/time to the user.
User avatar
wyerd
Atari maniac
Atari maniac
Posts: 87
Joined: Fri May 31, 2013 7:31 pm
Location: Upstate NY. USA.

Re: How do I find out the TOS language version installed?

Post by wyerd »

Thanks for the info. I found a PDF for the Atari Compendium- it’s one helluva reference guide!
Post Reply

Return to “C / PASCAL etc.”