VOGONS


First post, by yevrowl

User metadata
Rank Newbie
Rank
Newbie

Is it possible to determine the presence of an Tandy adapter with a redirect of the type «ON ERROR — NEXT RESUME» if one is not detected?

÷)

Reply 1 of 3, by DrAnthony

User metadata
Rank Member
Rank
Member

It should be possible but why not just poke the bios?

Reply 2 of 3, by wierd_w

User metadata
Rank Oldbie
Rank
Oldbie

If you are looking for things that are outside normal Tandy hardware (Tandy LPT, for instance), it's possible to do a direct IO Port read/write from Qbasic. Sadly, the Tandy 3 voice synthesis device does not give returns on any IO port, so you cant test for it that way.

You are kinda limited to asking the user to define if they have a Tandy 3voice synthesis device, and if so, is it at the normal IO port, or is it saddled to an LPT port.

You could look for genuine Tandy machines by PEEK ing in the system bios segment, and looking for the identification string.

For full reference:

Write to raw IO port
OUT <port number>, <value in hex>

Read from raw IO port
MyRead = INP(portnumber)

PEEK using DEFSEG
https://qbasic.net/en/qb-manual/Function/PEEK.htm

So, from my understanding, you should set the default segment to be equal to the top of the system bios, PEEK the values out at known offsets from there, and if you find magic strings, DO STUFF, otherwise, skip to "Did User Manually Specify TANDY sound?" then either configure and use that way, or skip Tandy init gracefully.

Reply 3 of 3, by yevrowl

User metadata
Rank Newbie
Rank
Newbie

In general, organized it in such a way that if there is an error with the graphics adapter, EGA switches to the Tandy... even if there is no such adapter in the PC. =)

÷)