I was given this file a few years ago. I'm sorry, I don't know if it's
still accurate. Hope it helps.



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
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
  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

Reply via email to