Detect Q-emulator

Discussion and advice about emulating the QL on other machines.
User avatar
t0nyt
QL Wafer Drive
Posts: 1122
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Detect Q-emulator

Post by t0nyt »

I’m going to be working on some test software that needs to use different configurations depending on whether it’s running on a real QL or in Q-emulator (ideally I’d do all the development on a QL, but that’s just impractical for me currently due to circumstances)

So is there a way to determine which system the program is running on please?

If not I have the options of either running one on JS and the other on Minerva and checking the version or setting a flag at the top of the code

But it would be so much easier, and less chance of messing up/getting confused, if the detection was automatic

Any thoughts please?

Many thanks
Tony


User avatar
bwinkel67
QL Wafer Drive
Posts: 1604
Joined: Thu Oct 03, 2019 2:09 am

Re: Detect Q-emulator

Post by bwinkel67 »

You could try and edit the ROM file that Qemulator i s using and change the JS string.


User avatar
t0nyt
QL Wafer Drive
Posts: 1122
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Detect Q-emulator

Post by t0nyt »

bwinkel67 wrote: Sun Aug 31, 2025 8:21 pm You could try and edit the ROM file that Qemulator i s using and change the JS string.
That’s genius, thanks!


Derek_Stewart
Font of All Knowledge
Posts: 4843
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Detect Q-emulator

Post by Derek_Stewart »

Hi,

Why not use VER$ which returns:

PRINT VER$ : REMark returns the QDOS ID
PRINT VER$(1) : REMark returns the QDOS version


Regards, Derek
User avatar
t0nyt
QL Wafer Drive
Posts: 1122
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Detect Q-emulator

Post by t0nyt »

Derek_Stewart wrote: Mon Sep 01, 2025 7:09 am Hi,

Why not use VER$ which returns:

PRINT VER$ : REMark returns the QDOS ID
PRINT VER$(1) : REMark returns the QDOS version
Hi Derek,

I’d assumed both the QL & Q-emulator would return the same values for the same ROM

They do for ver$

I get bad parameter from ver$(1)

Thanks
Tony


User avatar
janbredenbeek
Super Gold Card
Posts: 718
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands
Contact:

Re: Detect Q-emulator

Post by janbredenbeek »

Derek_Stewart wrote: Mon Sep 01, 2025 7:09 am PRINT VER$(1) : REMark returns the QDOS version
Doesn't work on JS, only Minerva and SMSQ/E.

It's unfortunate that the MACHINE function only works on SMSQ/E.


User avatar
t0nyt
QL Wafer Drive
Posts: 1122
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Detect Q-emulator

Post by t0nyt »

janbredenbeek wrote: Mon Sep 01, 2025 8:43 am
Derek_Stewart wrote: Mon Sep 01, 2025 7:09 am PRINT VER$(1) : REMark returns the QDOS version
Doesn't work on JS, only Minerva and SMSQ/E.

It's unfortunate that the MACHINE function only works on SMSQ/E.
I’ll be using Minerva, but both QL & Q-emulator return 1.98 for ver$(1)

Will do something with the ROM image

Many thanks
Tony


User avatar
dilwyn
Mr QL
Posts: 3169
Joined: Wed Dec 01, 2010 10:39 pm

Re: Detect Q-emulator

Post by dilwyn »



User avatar
t0nyt
QL Wafer Drive
Posts: 1122
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Detect Q-emulator

Post by t0nyt »

dilwyn wrote: Mon Sep 01, 2025 9:13 am https://dilwyn.theqlforum.com/docs/arti ... ulator.zip

Assembler only, IIRC.

Other articles also on same page about identifying machine type, e.g. https://dilwyn.theqlforum.com/docs/articles/machine.zip and https://dilwyn.theqlforum.com/docs/articles/what_hw.zip
Thanks Dilwyn. That could be useful when I switch the dev from basic to assembler testing

For now I've just edited the 1.98 ROM to return 1.97 in q-emulator

Many thanks all
Tony


User avatar
M68008
Gold Card
Posts: 295
Joined: Sat Jan 29, 2011 1:55 am
Contact:

Re: Detect Q-emulator

Post by M68008 »

There is an extension to detect Q-emuLator:

https://www.terdina.net/ql/soft/qemu_version_bin

It provides a command called IS_QEMULATOR (and another one called QEMU_VER$).


Post Reply