Testing for installed TURBO

Anything QL Software or Programming Related.
User avatar
Mr_Navigator
QL Fanatic
Posts: 782
Joined: Mon Dec 13, 2010 11:17 pm
Location: UK, Essex
Contact:

Testing for installed TURBO

Post by Mr_Navigator »

Hi community, I have searched for this on the forum but cannot find an entry but I am sure this has been asked before.

I currently test for the presence of the HBA ROM in a boot program using VER$ and would like to test for other toolkits, specifically the TURBO toolkit. Is there a way to do this automatically in a boot so that when subsequent runs of the boot it is not loaded again in one session?

e.g. for the HBA version I use:

Code: Select all

IF VER$<>"HBA" THEN
   LRESPR "WIN8_SMSQ_QEM"
END IF
I feel there must be a way to test for TURBO toolkit, any ideas?


-----------------------------------------------------------------------------------
QLick here for the Back 2 the QL Blog http://backtotheql.blogspot.co.uk/
User avatar
NormanDunbar
Forum Moderator
Posts: 2249
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Testing for installed TURBO

Post by NormanDunbar »

Morning,

DJToolkit could help. It has a function called CHECK that looks for a particular function or procedure, so you could use that to determine if a given toolkit is installed.

Details at http://superbasic-manual.readthedocs.io ... html#check

Of course, how do you check that DJToolkit is installed? ;)

HTH

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Derek_Stewart
Font of All Knowledge
Posts: 3900
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Testing for installed TURBO

Post by Derek_Stewart »

Hi,

There is a keyword: TK_VER$, but only returns the version of Turbo Toolkit, which is the same for the SMS and QDOS versions.

A simple way would be to add "SMS" in the version number. Which would mean a new version of Turbo Toolkit.

The SMS version calls the SMSQ/E extended traps, where the QDOS does not, so maybe a test for SMSQ/E extended traps is the way, but I would favour the about alteration to TK_VER$.

George Gwilt used to maintain Turbo and maybe the Toolkit. I think this message needs to be posted in the QL-USERS mailing list, George Gwilt reads that list.


Regards,

Derek
Martin_Head
Aurora
Posts: 846
Joined: Tue Dec 17, 2013 1:17 pm

Re: Testing for installed TURBO

Post by Martin_Head »

Could you use the WHEN ERROR trapping (JS ROMs upward).

Try to use a Turbo Toolkit command, if the toolkit is not installed the command will be trapped in the WHEN ERROR clause, and then the toolkit can be loaded.


User avatar
Mr_Navigator
QL Fanatic
Posts: 782
Joined: Mon Dec 13, 2010 11:17 pm
Location: UK, Essex
Contact:

Re: Testing for installed TURBO

Post by Mr_Navigator »

Derek_Stewart wrote:Hi,

There is a keyword: TK_VER$, but only returns the version of Turbo Toolkit, which is the same for the SMS and QDOS versions.

A simple way would be to add "SMS" in the version number. Which would mean a new version of Turbo Toolkit.

The SMS version calls the SMSQ/E extended traps, where the QDOS does not, so maybe a test for SMSQ/E extended traps is the way, but I would favour the about alteration to TK_VER$.

George Gwilt used to maintain Turbo and maybe the Toolkit. I think this message needs to be posted in the QL-USERS mailing list, George Gwilt reads that list.

Many thanks Derek I have now done this


-----------------------------------------------------------------------------------
QLick here for the Back 2 the QL Blog http://backtotheql.blogspot.co.uk/
User avatar
Mr_Navigator
QL Fanatic
Posts: 782
Joined: Mon Dec 13, 2010 11:17 pm
Location: UK, Essex
Contact:

Re: Testing for installed TURBO

Post by Mr_Navigator »

Martin_Head wrote:Could you use the WHEN ERROR trapping (JS ROMs upward).

Try to use a Turbo Toolkit command, if the toolkit is not installed the command will be trapped in the WHEN ERROR clause, and then the toolkit can be loaded.

I will try this also Martin, thanks


-----------------------------------------------------------------------------------
QLick here for the Back 2 the QL Blog http://backtotheql.blogspot.co.uk/
Derek_Stewart
Font of All Knowledge
Posts: 3900
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Testing for installed TURBO

Post by Derek_Stewart »

Hi Lee,

Looking at my boot file for SMSQmualtor/QPC2/Q-EMulator, I use this If clause:

Code: Select all

1300 REMark Load Turbo Toolkit
1310 IF VER$=="HBA"
1320   LRESPR "WIN1_TURBO_SMS_CODE"
1330 ELSE
1340   LRESPR "WIN1_TURBO_TK_CODE"
1350 END IF
Seems to work for QDOS and SMSQ/E.

But I guess there are other solutions.


Regards,

Derek
User avatar
Mr_Navigator
QL Fanatic
Posts: 782
Joined: Mon Dec 13, 2010 11:17 pm
Location: UK, Essex
Contact:

Re: Testing for installed TURBO

Post by Mr_Navigator »

Derek_Stewart wrote:Hi Lee,

Looking at my boot file for SMSQmualtor/QPC2/Q-EMulator, I use this If clause:

Code: Select all

1300 REMark Load Turbo Toolkit
1310 IF VER$=="HBA"
1320   LRESPR "WIN1_TURBO_SMS_CODE"
1330 ELSE
1340   LRESPR "WIN1_TURBO_TK_CODE"
1350 END IF
Seems to work for QDOS and SMSQ/E.

But I guess there are other solutions.
Thanks, but that would not work for me and perhaps I should clarify a little further.

Using Q-emuLator, my boot first loads SMSQ_QEM and restarts with the same boot

Where this

Code: Select all

IF VER$<>"HBA" THEN
   LRESPR "WIN8_SMSQ_QEM"
END IF


fails the second time around (as designed, so all good)

I then load (still in the same boot) the TURBO_SMS_CODE appropriate for SMSQ based system.

This is all fine, however, I am developing the boot for different setups and change them a lot depending on what project I decide to work on.

This means running the boot several times in the one session to test what I am trying to do and I don't want to keep using up space re-LRESPR the TURBO toolkit.
Using another toolkit to test for the existence of a keyword in the TURBO toolkit would then mean using another method to test for that additional Toolkit, as you said a catch 22.


So

Code: Select all

1300 REMark Load Turbo Toolkit
1310 IF VER$=="HBA"
1320   LRESPR "WIN1_TURBO_SMS_CODE"
1330 ELSE
1340   LRESPR "WIN1_TURBO_TK_CODE"
1350 END IF

would not work for me :cry: .


-----------------------------------------------------------------------------------
QLick here for the Back 2 the QL Blog http://backtotheql.blogspot.co.uk/
User avatar
Mr_Navigator
QL Fanatic
Posts: 782
Joined: Mon Dec 13, 2010 11:17 pm
Location: UK, Essex
Contact:

Re: Testing for installed TURBO

Post by Mr_Navigator »

Thanks for all the suggestions guys

Code: Select all

220 IF TK_VER$<>"" THEN
230  PRINT "Done":STOP
240 ELSE
250  LRESPR win8_turbo_sms_code
260 END IF
this works exactly how I wanted it to, so congrats to Tobias.

I have also been able to get this method to work with TURBO ptr extensions as well by using the following

Code: Select all

220 IF ACR<>0 THEN
230  PRINT "Done":STOP
240 ELSE
250  LRESPR win2_tptr_ext
260 END IF
(ACR being a function within the TPTR_EXTs) So as to Derek's suggestion about other toolkits, this method could be adapted if suitable extension's functions allow.


I name this process either EORMT or RMTEO

(Run Many Times Execute Once)

I thankyou, I'm here 'til thursday, no wait, what!


-----------------------------------------------------------------------------------
QLick here for the Back 2 the QL Blog http://backtotheql.blogspot.co.uk/
User avatar
tofro
Font of All Knowledge
Posts: 2679
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Testing for installed TURBO

Post by tofro »

That method should work with any toolkit function that
  • does not require any parameters
  • can be relied upon to return anything different from 0 or an empty string in the default case
Toolkit II DATAD$ could be an example to test for Toolkit 2.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Post Reply