Op Fri, 20 Apr 2012 09:00:18 +0200 schreef Daniele Terdina
<danieleterd...@hotmail.com>:

SuQcess starts with testing the validity of devices and directories to
prevent it from crashing later.
For this the TK2 commands FTEST and FTYP are used but these don't seem to work on the device names used by Q-emuLator.
Is this just an issue with the non-registered version?
Is there any way to test for Q-emuLator from S*Basic so I can skip the
test and hope for the best?

The unregistered version tries to emulate the original file drivers, which are not "level 2".

SuQcess seems too big for this version anyway.

On a registered copy of Q-emuLator, and with level 2 drivers enabled, FTEST("mdv1_") should return 0 and your check will succeed.

On the unregistered version it returns -7, and I think that's the correct behaviour: Although I can't currently check, I believe FTEST("mdv1_") would also return -7 when run on a QL, even if there is a cartridge in the drive. It would be interesting to check.

I have no working level 1 QL here, but a test on my SGC-QL (QDOS-TK2)
confirmed your suspicion that FTEST(mdv1_) returns -7 even on a level 2
system, after reading mdv1 correctly.

The problem is related to the FTEST command trying to open a file rather than a directory to verify its existance. In SMSQ/E a directory can be opened as a file, but in QDOS I don't think it can. The correct way to check for the validity of devices and directories would be to attempt to open a directory, not a file (TRAP#2 with D0=1 and D3=4 rather than D3=1).

There is no SuperBASIC keyword to test for Q-emuLator, but it would be easy to write one if needed, as there is a TRAP#1 command that can be used to detect Q-emuLator.

Some years back QLToday wrote about testing the machine you are using by
reading the sys_vars (PEEK (sv +167)).
The test on Q-emulator returns zero, as the standard QL, so this could be
used to assume there is no Level2 device.
This number is held in the 5 lowest bits, I believe 14, 15, 18 to 23, 25
to 27 & 29 are still free.

Bob

--
The BSJR QL software site at: http://members.upc.nl/b.spelten/ql/
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to