Re: [Ql-Users] Q-emulator
On Tue, 19 Mar 2024, at 1:30 PM, Dilwyn Jones via Ql-Users 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). > Should be pretty simple to implement this in sQLux, just need documentation for the missing values for all the OSes sQLux runs on. Graeme ___ QL-Users Mailing List
Re: [Ql-Users] Q-emulator
Have a look at QL/E's QLEhelper_bas (or boot_verbose which uses the compiled QLEhelper) where the command line option \QEMU does exactly this. Inside QLEhelper_bas look at the PROCedure QemuLator_detect which uses that Trap call. Feel free to copy, (amend) and use what you need in SuperBASIC. > -Ursprüngliche Nachricht- > Von: Ql-Users [mailto:ql-users-boun...@lists.q-v-d.com] Im Auftrag von > Daniele Terdina via Ql-Users > Gesendet: Dienstag, 19. März 2024 20:48 > An: ql-us...@q-v-d.com > Cc: Daniele Terdina > Betreff: Re: [Ql-Users] Q-emulator > > I can write you an extension for that later today. > > Thanks > Daniele > > From: Ql-Users on behalf of desin via > Ql-Users > Sent: Tuesday, March 19, 2024 12:24 PM > To: ql-us...@q-v-d.com > Cc: desin > Subject: Re: [Ql-Users] Q-emulator > > > > Am 19.03.24 um 19:25 schrieb Daniele Terdina via Ql-Users: > > 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. > > Thanks Daniele > but how do it in basic ? > > Background > > A boot file that runs on most systems (native/emulated) > on Q-emulator it must check what version of SMSQE > is necessary > > Greetings from Switzerland > Markus > > ___ > QL-Users Mailing List > ___ > QL-Users Mailing List ___ QL-Users Mailing List
Re: [Ql-Users] Q-emulator
I can write you an extension for that later today. Thanks Daniele From: Ql-Users on behalf of desin via Ql-Users Sent: Tuesday, March 19, 2024 12:24 PM To: ql-us...@q-v-d.com Cc: desin Subject: Re: [Ql-Users] Q-emulator Am 19.03.24 um 19:25 schrieb Daniele Terdina via Ql-Users: > 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. Thanks Daniele but how do it in basic ? Background A boot file that runs on most systems (native/emulated) on Q-emulator it must check what version of SMSQE is necessary Greetings from Switzerland Markus ___ QL-Users Mailing List ___ QL-Users Mailing List
Re: [Ql-Users] Q-emulator
Am 19.03.24 um 19:25 schrieb Daniele Terdina via Ql-Users: 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. Thanks Daniele but how do it in basic ? Background A boot file that runs on most systems (native/emulated) on Q-emulator it must check what version of SMSQE is necessary Greetings from Switzerland Markus ___ QL-Users Mailing List
Re: [Ql-Users] Q-emulator
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 on behalf of Dilwyn Jones via Ql-Users Sent: Tuesday, March 19, 2024 6:46 AM To: ql-us...@q-v-d.com Cc: Dilwyn Jones 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 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 > 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
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 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 > 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
Re: [Ql-Users] Q-emulator
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 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] Q-emulator
Hello how can a basic program check if its running on Q-emulator ? Greetings from Switzerland Markus ___ QL-Users Mailing List