English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 15 November 2013, 11:50   #1
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,340
Off-by-one error with RTG image scaling?

[This could possibly be a bug in Wine, I guess.]

I noticed an off-by-one error when the RTG image is scaled ("Always scale in windowed mode" checked).

I changed screenmode to P96 640×480. Opening the settings window and changing window size to 1280×960 causes one pixel row to be missing (so the scaled RTG display occupies 1280×959 pixels). If I change window size to 1280×961 the entire RTG display is shown correctly.

It turns out that on setting window size to 1280×962, 1280×964, 1280×966 etc. (all of which should give the same perfect 2× scaling since window width is unchanged), there is the same one pixel row missing. With window sizes 1280×963, 1280×965, 1280×967 etc. the image appears correctly.
mark_k is offline  
Old 15 November 2013, 16:20   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
I can't duplicate. 961 adds extra black line at the bottom. 960 looks fine.
Toni Wilen is offline  
Old 16 November 2013, 09:45   #3
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,340
Hmm this is strange. Maybe the specific issue I noticed was a Wine bug.

However I just tested in Windows Vista SP2 with Classic theme. There seems to be an off-by-one problem relating to the RTG window width, but only in DirectDraw mode. (My laptop has an Nvidia graphics chip by the way.)
Attached Thumbnails
Click image for larger version

Name:	output.png
Views:	268
Size:	70.3 KB
ID:	37854  
mark_k is offline  
Old 17 November 2013, 16:20   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
Did the height problem happen in both DD and D3D?
Toni Wilen is offline  
Old 17 November 2013, 16:32   #5
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,340
If I remember correctly, in Wine I only saw the problem in D3D mode. But that's because — at least with the very recent version of Wine I tested with — the DirectDraw display seems to be rendered with bilinear filtering. So a missing or extra row wouldn't be as noticeable.
mark_k is offline  
Old 19 November 2013, 21:37   #6
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,340
After playing with the settings some more I noticed the off-by-one problem with image width in Vista with both D3D and DirectDraw, with native chipset modes. This is with null filter, automatic resize 2×.

In the attached pics I've pointed to the missing/extra pixel column. The exact position of the column might vary depending on Windows version, graphics driver etc.

Also with DirectDraw there are refresh problems when you open the settings window. The image is scaled 2×. On opening the settings window, if you drag it around, the newly-exposed parts of the main window are drawn with an unscaled image, see pics. If you click on the desktop (so making the WinUAE window inactive) the entire main window is redrawn with unscaled image. On dismissing the settings window, the display is shown scaled again. (Pics were taken with WinUAE 2.7.0b13.)
Attached Thumbnails
Click image for larger version

Name:	Native_autoresize_2x_D3D_pngout.png
Views:	238
Size:	60.5 KB
ID:	37912   Click image for larger version

Name:	Native_autoresize_2x_DirectDraw_pngout.png
Views:	252
Size:	72.1 KB
ID:	37913   Click image for larger version

Name:	DirectDraw_refresh_issue_pngout.png
Views:	263
Size:	78.0 KB
ID:	37914  
mark_k is offline  
Old 27 November 2013, 17:59   #7
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,340
A guess as to what the problem might be, if it's something to do with texture sizes. Converting float to int always rounds towards zero. If you actually want to round to the nearest integer instead, you could/should add 0.5 to the value.
mark_k is offline  
Old 27 November 2013, 18:08   #8
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
Can't duplicate. Requires at least config file and WB config that has exact same screen mode/overscan/etc prefs.

(coordinates have +0.5 added or it wouldn't work at all, there would be really ugly line from top/left to bottom/right and also it wouldn't affect DD at all)
Toni Wilen is offline  
Old 27 November 2013, 19:32   #9
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,340
Here's a config I used in Windows Vista. Boot an unmodified Workbench 3.1 disk. Run WBPattern prefs and set the crosshatch background, then set Workbench window to backdrop. (Could switching back and forth between the D3D and DirectDraw screenshots give any clues?)
Attached Thumbnails
Click image for larger version

Name:	Vista_D3D_pngout.png
Views:	208
Size:	7.1 KB
ID:	38011   Click image for larger version

Name:	Vista_DirectDraw_pngout.png
Views:	214
Size:	5.8 KB
ID:	38012  
Attached Files
File Type: zip Off-by-one_test.uae.zip (2.9 KB, 145 views)
mark_k is offline  
Old 30 November 2013, 13:35   #10
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,510
Confirmed but it makes no sense in DD mode. More debugging after 2.7.0.
Toni Wilen is offline  
Old 01 December 2013, 19:18   #11
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,340
Just as another point of information, I tested using a Windows 7 SP1 VM using VirtualBox. There was no problem with the DirectDraw image. I couldn't test D3D in VirtualBox.
mark_k is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pre-Scaling before Bilinear Scaling? rsn8887 request.UAE Wishlist 6 05 September 2015 19:13
Off-by-one problem with 2x scaling mark_k support.WinUAE 0 05 February 2013 22:41
Scaling in RTG modes mark_k support.WinUAE 4 08 March 2012 15:57
Invalid Kickstart Image WHDLOAD error TronPlayer support.Games 5 16 November 2010 20:59
Heimdall 2 AGA - error during resload_loadkick Invalid kickstart image DanE support.Games 0 26 September 2006 15:08

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:10.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08013 seconds with 14 queries