Page 1 of 2
Detect Q-emulator
Posted: Sun Aug 31, 2025 7:17 pm
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
Re: Detect Q-emulator
Posted: Sun Aug 31, 2025 8:21 pm
by bwinkel67
You could try and edit the ROM file that Qemulator i s using and change the JS string.
Re: Detect Q-emulator
Posted: Sun Aug 31, 2025 8:22 pm
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!
Re: Detect Q-emulator
Posted: Mon Sep 01, 2025 7:09 am
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
Re: Detect Q-emulator
Posted: Mon Sep 01, 2025 8:14 am
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
Re: Detect Q-emulator
Posted: Mon Sep 01, 2025 8:43 am
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.
Re: Detect Q-emulator
Posted: Mon Sep 01, 2025 9:01 am
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
Re: Detect Q-emulator
Posted: Mon Sep 01, 2025 9:13 am
by dilwyn
Re: Detect Q-emulator
Posted: Mon Sep 01, 2025 9:16 am
by t0nyt
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
Re: Detect Q-emulator
Posted: Mon Sep 01, 2025 6:35 pm
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$).