29 April 2018, 19:41 | #1 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,338
|
Optimised support for non-landscape monitor orientations
Does WinUAE have any support for non-landscape orientation displays? If not, the DWM/runtime will have to rotate the image for composition/presentation. Could it be more optimal to generate a pre-rotated image yourself, by changing the D3D projection matrix to be rotated 90 degrees?
For example, suppose the monitor is in portrait orientation: the screen has been rotated 90 degress clockwise from horizontal. Then the desktop image is effectively rotated 90 degrees anti-clockwise so as to appear the right way up. What was the top edge of the monitor is now the right edge, so the video signal scans the image top-to-bottom, from rightmost column to the leftmost. For D3D11, there is IDXGISwapChain1::SetRotation. You'd specify DXGI_MODE_ROTATION_IDENTITY to tell Windows not to rotate the image. [That only applies to flip-model windowed swap chains.] There's also DXGI_SWAP_CHAIN_FLAG_NONPREROTATED: "Set this flag to turn off automatic image rotation; that is, do not perform a rotation when transferring the contents of the front buffer to the monitor. Use this flag to avoid a bandwidth penalty when an application expects to handle rotation. This option is valid only during full-screen mode" And see DXGI swap chain rotation sample. Also Supporting screen orientation (DirectX and C++), but that's probably UWP-specific. I guess it's also possible to detect a change in orientation while running (WM_DISPLAYCHANGE???). WinUAE currently doesn't handle that too well. For example: - Run WinUAE, settings window appears. - Use Windows display settings to change orientation to portrait. - Start emulation with D3D11 full-screen mode. Display is distorted; wrong orientation and squashed. Last edited by mark_k; 29 April 2018 at 19:49. |
29 April 2018, 20:31 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,507
|
Why? I don't care about weird use cases unless I have the hardware and use it. I don't.
|
30 April 2018, 21:12 | #3 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,338
|
It's not too much of a weird use case, at least if your monitor has a pivotable stand. Much more vertical screen space, good for editing text/programming. If you set your desktop to portrait then run WinUAE, you can use portrait-aspect modes with uaegfx to see way more lines of text in your editor.
Separate from specifically optimising for non-landscape (i.e. rotating D3D matrix), WinUAE currently doesn't handle WM_DISPLAYCHANGE messages. If you set desktop to portrait orientation before running WinUAE, it works fine. But if you change orientation while WinUAE is running (not with emulation running, just showing settings window), it doesn't recognise the change in available resolutions. Re-enumerating display devices and modes on WM_DISPLAYCHANGE should ensure that uaegfx offers modes with the correct portrait-aspect resolutions, without needing to quit and re-run WinUAE. Here's some log output on running WinUAE with desktop in landscape, then in portrait orientation. Note the "ActiveHeight/TotalHeight" line doesn't change, since it refers to the physical display raster. Start WinUAE with desktop in landscape mode: Code:
AMD FirePro W5100 '\\.\DISPLAY1' [PCI\VEN_1002&DEV_6649&SUBSYS_230C1028&REV_00] -: Acer CB241HQK (3840*2160) * [\Registry\Machine\System\CurrentControlSet\Control\Class\{4d36e96e-e325-11ce-bfc1-08002be10318}\0011] 0: 640x480, 32-bit (59,60,67,72,75) 1: 720x480, 32-bit (59,60) 2: 800x600, 32-bit (56,60,72,75) 3: 1024x768, 32-bit (60,70,75) 4: 1152x864, 32-bit (60,75) 5: 1280x720, 32-bit (50,59,60) 6: 1280x768, 32-bit (60) 7: 1280x800, 32-bit (60) 8: 1280x960, 32-bit (60) 9: 1280x1024, 32-bit (60,75) 10: 1440x900, 32-bit (60) 11: 1600x900, 32-bit (60) 12: 1600x1200, 32-bit (23,24,29,30,60) 13: 1680x1050, 32-bit (60) 14: 1792x1344, 32-bit (23,24,29,30,60) 15: 1800x1440, 32-bit (23,24,29,30,60) 16: 1856x1392, 32-bit (23,24,29,30,60) 17: 1920x1080, 32-bit (23,24,25i,29i,30i,50,59,60) 18: 1920x1200, 32-bit (23,24,29,30,60) 19: 2048x1536, 32-bit (23,24,29,30,60) 20: 2560x1440, 32-bit (23,24,29,30,60) 21: 3200x1800, 32-bit (23,24,29,30,60) 22: 3840x2160, 32-bit (23,24,29,30,60) 23 display modes. Desktop: W=3840 H=2160 B=32 HZ=60. CXVS=3840 CYVS=2160 ... ActiveHeight: 2160 TotalHeight: 2222 VFreq=60/1=60.00Hz HFreq=533250000/4000=133.313KHz Code:
AMD FirePro W5100 '\\.\DISPLAY1' [PCI\VEN_1002&DEV_6649&SUBSYS_230C1028&REV_00] -: Acer CB241HQK (2160*3840) * [\Registry\Machine\System\CurrentControlSet\Control\Class\{4d36e96e-e325-11ce-bfc1-08002be10318}\0011] 0: 480x640, 32-bit (59,60,67,72,75) 1: 480x720, 32-bit (59,60) 2: 600x800, 32-bit (56,60,72,75) 3: 720x1280, 32-bit (50,59,60) 4: 768x1024, 32-bit (60,70,75) 5: 768x1280, 32-bit (60) 6: 800x1280, 32-bit (60) 7: 864x1152, 32-bit (60,75) 8: 900x1440, 32-bit (60) 9: 900x1600, 32-bit (60) 10: 960x1280, 32-bit (60) 11: 1024x1280, 32-bit (60,75) 12: 1050x1680, 32-bit (60) 13: 1080x1920, 32-bit (23,24,25i,29i,30i,50,59,60) 14: 1200x1600, 32-bit (23,24,29,30,60) 15: 1200x1920, 32-bit (23,24,29,30,60) 16: 1344x1792, 32-bit (23,24,29,30,60) 17: 1392x1856, 32-bit (23,24,29,30,60) 18: 1440x1800, 32-bit (23,24,29,30,60) 19: 1440x2560, 32-bit (23,24,29,30,60) 20: 1536x2048, 32-bit (23,24,29,30,60) 21: 1800x3200, 32-bit (23,24,29,30,60) 22: 2160x3840, 32-bit (23,24,29,30,60) 23 display modes. Desktop: W=2160 H=3840 B=32 HZ=60. CXVS=2160 CYVS=3840 ... ActiveHeight: 2160 TotalHeight: 2222 VFreq=60/1=60.00Hz HFreq=533250000/4000=133.313KHz |
10 May 2018, 09:45 | #4 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,507
|
|
10 May 2018, 20:10 | #5 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,338
|
Yep I figured that was the case for P96 modes. But WinUAE could re-enumate modes on WM_DISPLAYCHANGE so when the emulated machine is reset P96 shows the new available resolutions. That saves the user having to exit WinUAE and run it again (I think you currently only enumerate available modes once at startup?).
That could also be helpful in the general case where user changes desktop resolution while WinUAE is running, either just with settings window open or with emulation running in full-window mode. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Optimised Theme for Classic Amigas | Nightfox | project.EAB | 23 | 12 July 2017 14:57 |
Quake 2 optimised 060 assembler | NovaCoder | Coders. Asm / Hardware | 0 | 05 April 2013 01:52 |
Optimised Akiko Chunky-to-Planar emulation | Mequa | support.WinUAE | 9 | 05 February 2012 02:47 |
landscape generator | twizzle | MarketPlace | 0 | 04 May 2006 22:47 |
Landscape generator | DDNI | request.Apps | 30 | 04 May 2006 18:18 |
|
|