This is correct, thank you Dilwyn! If you'd like to test whether you are running on the Q-emuLator-specific version of SMSQ/E (file named SMSQ_QEM, that can only run on Q-emuLator), you can use MACHINE and check for code 26.
On any version of QDOS or SMSQ/E, you can test whether you are running on Q-emuLator by setting D0=-26 (notice the minus sign), D1=1 and calling TRAP #1. On return, if the error code (in D0) is zero and D1.B is 1, you are running on Q-emuLator. ________________________________ From: Ql-Users <ql-users-boun...@lists.q-v-d.com> on behalf of Dilwyn Jones via Ql-Users <ql-users@lists.q-v-d.com> Sent: Tuesday, March 19, 2024 6:46 AM To: ql-us...@q-v-d.com <ql-us...@q-v-d.com> Cc: Dilwyn Jones <dilwyn...@gmail.com> Subject: Re: [Ql-Users] Q-emulator I think I forgot to mention that under the QemuLator specific version 3.38 from Daniele's website, the MACHINE function in SBASIC returns 26 for QemuLator. I don't know if the Gold Card and Aurora versions also do this, sorry. Dilwyn On Tue, 19 Mar 2024 at 13:30, Dilwyn Jones <dilwyn...@gmail.com> wrote: > > I was given this file a few years ago. I'm sorry, I don't know if it's > still accurate. Hope it helps. > > Dilwyn > > Q-EMULATOR TRAP CALL > > Use Trap #1 with D0.L = -26 to get some emulator info. The trap is > designed to be usable by other emulators, but I don't think anybody > else is using it, so it works only with Q-emuLator. > > In systems where the trap is not implemented you will get an error > in D0.L (bad parameter, I think), in Q-emuLator you get 0 in D0.L. > There are three commands, identified by the value in D1: > > ================================================================== > > D1.L = 0 > > Currently returns 0 in both D1.L and D2.L. I don't remember anymore > for sure what the intended meaning was :(. I think D1 was the version of > the D0=-26 TRAP implemented by the emulator (for example in the future > there might be a version 1 TRAP that returns extra info, or allows more > values in D1.L), and D2 is probably reserved for future use. Just ignore D1 > and D2 and look only at D0 (0 = trap is supported, error = it is not), > or directly call > with > D1.L = 1 or 2. > ====================================================================== > > D1.L = 1 > > Returns in D1.L info about the host system: > D1.L = $00aabbcc, where > aa = host OS > 0 = Windows > 3 = Mac OS > bb = host OS variant (for example, if aa was Unix, bb would > identify whether it is BSD, Linux, etc.). Currently always > zero. > cc = emulator ID > 1 = Q-emuLator > > Returns in D2.L the version of the emulator: > D2.L = $xxyyzzww, where > xx = major version number > yy = middle version number > zz = minor version number > > ww was supposed to be a global incremental number, but a 0-255 > range is probably too little, so you can just ignore it. > > D3.L = type of build > 0 = alpha > 1 = beta > 2 = release > > For example, > D2.L = $02010005 and D3.L = 2 means version 2.1 > D2.L = $01030218 and D3.L = 1 means version 1.3.2b > > ====================================================================== > > D1.L = 2 > A1.L = pointer to memory buffer > D2.L = length of buffer > > Fills the buffer with a short QL string identifying the emulator > (for example "Q-emuLator 2.2"). > > Returns a buffer full error in D0 if the buffer is smaller than the > string (and the buffer content is not valid in this case). > ====================================================================== > > Hope this helps. Most of this is untested so you may find some bugs. > The only piece of software currently using one of these traps is the > Q-emuLator's mouse driver (it refuses to install and prints an error > if it's not running in Q-emuLator). > > On Tue, 19 Mar 2024 at 12:54, desin via Ql-Users > <ql-users@lists.q-v-d.com> wrote: > > > > Hello > > how can a basic program check if its running on Q-emulator ? > > > > Greetings from Switzerland > > Markus > > _______________________________________________ > > QL-Users Mailing List _______________________________________________ QL-Users Mailing List _______________________________________________ QL-Users Mailing List