Q68 SMSQ/E Screen modes

Anything QL Software or Programming Related.
Derek_Stewart
Font of All Knowledge
Posts: 4793
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Q68 SMSQ/E Screen modes

Post by Derek_Stewart »

Hi,

I have been asked how to determine the screen mode or a Q68 screen, which SMSQ/E has a function: RMODE

RMODE seems to work only in QPC2 and SMSQmulator.

On a Q68 RMODE returns 0 in all Q68 screen modes.

What is the best way to find the Q68 screen mode?

My rough solugion is to use the screen resolution with SCR_XSIZE, SCR_YSIZE and set a variale based on my knowledge of the Q68 screen mode.


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

Re: Q68 SMSQ/E Screen modes

Post by janbredenbeek »

Derek_Stewart wrote: Tue Jul 23, 2024 8:07 pm I have been asked how to determine the screen mode or a Q68 screen, which SMSQ/E has a function: RMODE

RMODE seems to work only in QPC2 and SMSQmulator.

On a Q68 RMODE returns 0 in all Q68 screen modes.

What is the best way to find the Q68 screen mode?
I've found out that the Q68's mode register at $FF000018 can be PEEKed for the current mode set by DISP_MODE. However this is an undocumented feature.

It would be better if RMODE would be fixed to return the correct screen mode.
* note to self: RMODE should be implemented in the next Minerva4Q68 release *


User avatar
BSJR
Trump Card
Posts: 225
Joined: Sun Oct 18, 2015 12:53 pm
Location: Amsterdam
Contact:

Re: Q68 SMSQ/E Screen modes

Post by BSJR »

Derek_Stewart wrote: Tue Jul 23, 2024 8:07 pm Hi,

I have been asked how to determine the screen mode or a Q68 screen, which SMSQ/E has a function: RMODE

RMODE seems to work only in QPC2 and SMSQmulator.
On a Q68 RMODE returns 0 in all Q68 screen modes.
RMODE is not an SMSQ/E but a QPTR keyword. So if those extensions are not loaded it's just an empty variable.
When loaded it will return the correct mode, even on the Q68.

According to the official SMSQ/E Keyword Database there is also an RMODE function in the tool FN_ext.
But I know nothing about that one.

BSJR


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

Re: Q68 SMSQ/E Screen modes

Post by Derek_Stewart »

BSJR wrote: Wed Jul 24, 2024 11:27 am RMODE is not an SMSQ/E but a QPTR keyword. So if those extensions are not loaded it's just an empty variable.
When loaded it will return the correct mode, even on the Q68.

According to the official SMSQ/E Keyword Database there is also an RMODE function in the tool FN_ext.
But I know nothing about that one.

BSJR
Hi Bob,

Thank you for reminding about QPTR RMODE, which when QPTR Toolkit is loaded the Q68 reports:
DISP_MODE 0: 8
DISP_MODE 1, 4: 4
DISP_MODE 3,6,7: 33
DISP_MODE 5: 16

This being the screen mode.

I suppose that RMODE coupled with the SCR_XLIM/SCR_YLIM will give the appropriate DISP_MODE the Q68 is in.

Maybe could do with a function like DISP_MODE$:

Code: Select all

DEFine FuNction DISP_MODE$
  RETurn PEEK($FF000018)
END DEFine DISP_MODE$
But I suppose there are more elegant solutions.


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

Re: Q68 SMSQ/E Screen modes

Post by dilwyn »

Not at home to check. Could the DISP_TYPE function be used? It is implemented in Q68 SMSQ/E (one of the few DISP_xxx extensions implemented) but I'm not sure if it returns the exact type of information you are looking for.


User avatar
Andrew
QL Wafer Drive
Posts: 1048
Joined: Tue Jul 17, 2018 9:10 pm

Re: Q68 SMSQ/E Screen modes

Post by Andrew »

dilwyn wrote: Wed Jul 24, 2024 1:04 pm Not at home to check. Could the DISP_TYPE function be used? It is implemented in Q68 SMSQ/E (one of the few DISP_xxx extensions implemented) but I'm not sure if it returns the exact type of information you are looking for.
According to SuperBasic Manual DISP_TYPE returns only:
0 Original ST QL Emulator, QL Hardware (either of these two may support MODE 8) plus QXL and QPC. All of these (except the original ST QL emulator) may support higher resolutions.
1 Extended Mode 4 Emulator (either 512x256 or 768x280 pixel screen)
2 QVME Mode 4 Emulator
4 Monochrome display (only two colours)


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

Re: Q68 SMSQ/E Screen modes

Post by dilwyn »

I'll fire up the Q68 to check when I get home this evening.


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

Re: Q68 SMSQ/E Screen modes

Post by Derek_Stewart »

Hi,

unless there has been a change DISP_TYPE does nothing, as with the DISP_XXX functions.

I asked Wolfgang about a while back, confirmed, maybe it has been implemented.


Regards, Derek
User avatar
Andrew
QL Wafer Drive
Posts: 1048
Joined: Tue Jul 17, 2018 9:10 pm

Re: Q68 SMSQ/E Screen modes

Post by Andrew »

Derek_Stewart wrote: Wed Jul 24, 2024 7:13 pm Hi,

unless there has been a change DISP_TYPE does nothing, as with the DISP_XXX functions.

I asked Wolfgang about a while back, confirmed, maybe it has been implemented.
I hoped that at least DISP_SIZE works :(
I was relying on it to set the screen size for Pitman.


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

Re: Q68 SMSQ/E Screen modes

Post by dilwyn »

Just tried DISP_TYPE now on Q68. It does work (SMSQ/E only, not Minerva), but the function returns the usual SBASIC values for the high colour modes in addition to the values listed earlier for MODE 4 and MODE 8:

16=MODE 16 (the 8-bit 256-colour mode)
33=MODE 33 (the 16-bit colour mode, like a Q40/Q60)

These values are not the same as the mode numbers used in the DISP_MODE command though. And you can't use DISP_TYPE to check screen resolution, you'd need to use SCR_XLIM and SCR_YLIM for that.

As I thought earlier, DISP_TYPE is the only one of the DISP_xxx set of extensions (apart from DISP_MODE) to work on Q68's SMSQ/E


Post Reply