Ticket #485 (Open)Sun May 03 17:19:38 UTC 2020
Kernel modifies Yeig of WimpMode command on very wide screen modes
Reported by: | Martin Avison (27) | Severity: | Normal |
Part: | RISC OS: Module | Release: | |
Milestone: | Status | Open |
Details by Martin Avison (27):
WimpMode and EY defaults
The Display Manager uses the *WimpMode command to change a mode, but when used on modern wide screens it causes screen corruption.
The use of *WimpMode with a Mode String is not documented directly…
- In PRM5a-105 (pdf119) under Video – Technical Details – Mode Strings it does say that they can be used by *WimpMode, and that if EY is not specified then ‘the default is used’. There is no mention of what the default is.
- In PRM5a-135 (pdf150) under OS_ScreenMode 0 it does say that the default for YEigFactor is 2 if yres < xres/2, else 1.
However, this gives a major problem when used on a modern very wide screen, because the xres can easily be more than twice yres, eg 3360×1050 that I am using now, or 3840×1440 that I know others use.
For example, if I am using a mode of:
<code> X3360 Y1050 C16M LTRGB EX1 EY1</code>
and I simply change the colours in Display Manager, it issues
<code> *WimpMode X3360 Y1050 C32K</code>
The mode then used is
<code> X3360 Y1050 C16M LTRGB EX1 EY2</code>
but the surprise EY2 default makes the screen almost unusable.
In this example, I could enter the *WimpMode command with EY1, but most users would make a simple colour change using Display Manager which omits the EY parameter.
If a user is faced with unexpected EY2, they need to recognise what has happened, and that a *WimpMode command with EY1 is required to fix it. I suggest this is unreasonable, and the original reasons are no longer valid for modern screen modes.
Applications should cater for this EX0 EY2 screen mode, but it is so unusual that I have found some that fail with strange results. Code could be written to watch for the unwanted EY2 and issue another mode change, but that should be an unnecessary bodge.
I therefore request that to avoid confusing users (and possibly applications) using modern screen sizes the following small change be made to the default calculation:
From:
If yres < xres/2 then Yeig = 2 else Yeig = 1
To:
If yres <= 1056 and yres < xres/2 then Yeig = 2 else Yeig = 1
The additional test for yres <= 1056 is because some old numbered modes probably rely on the old default, and the widest are 16, 17, and 24 with a width of 1056.
Source of one default calculation in vduswis…
<code>RMVMS_YEigFactor
LDR r2, [r0, #ModeSelector_XRes]
LDR r11, [r0, #ModeSelector_YRes]
CMP r11, r2, LSR #1 ; if yres < xres/2
MOVCC r2, #2 ; then yeig = 2
MOVCS r2, #1 ; else yeig = 1
</code>
Could be changed to add 1 line and add one condition code…
<code>RMVMS_YEigFactor
LDR r2, [r0, #ModeSelector_XRes]
LDR r11, [r0, #ModeSelector_YRes]
CMP r11,#&420 ; if yres <= 1056 ?
CMPLS r11, r2, LSR #1 ; and if yres < xres/2
MOVCC r2, #2 ; then yeig = 2
MOVCS r2, #1 ; else yeig = 1
</code>
There is very similar code in in vdudriver in GenerateModeSelectorVars
(and there may be others).
Changelog:
Modified by Martin Avison (27) Sun, May 03 2020 - 17:21:49 GMT
Grrrr. The bug preview facility gives different results to the actual – and I cannot remove the <code> etc.
Modified by Jeffrey Lee (213) Sun, May 03 2020 - 17:59:12 GMT
Checking xres <= 1056 would be more sensible than yres <= 1056.
Modified by Martin Avison (27) Sun, May 03 2020 - 18:35:55 GMT
Indeed, yes. It was xres I meant to check! I was expecting to be able to verify and change the post.
Modified by Sprow (202) Sun, January 15 2023 - 08:51:42 GMT
- Summary changed from The WimpMode command corrupts Yeig on very wide screen modes to Kernel modifies Yeig of WimpMode command on very wide screen modes