English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 17 December 2023, 23:33   #1
hceline
Registered User
 
Join Date: Nov 2009
Location: Top of the world
Posts: 161
BestModeID() without BIDTAG_MonitorID gives wrong answer?

I'm having a problem understanding the behavior of BeatModeID().
I'm trying to fix this code to be able to show 8-bitplane pictures on ECS+Picasso96, and to be able to open an RTG-screen from a non-RTG screen.

To fix the first issue I changed this (at line 161):
Code:
            if (data->depth==24 && data->modeid==0)
            {
                // Get best available mode (under 39)
                if (GfxBase->LibNode.lib_Version>=39)
                    data->modeid=
                        BestModeID(
                            BIDTAG_NominalWidth,data->width,
                            BIDTAG_NominalHeight,data->height,
                            BIDTAG_Depth,24,
                            (screen)?BIDTAG_MonitorID:TAG_IGNORE,
                                (screen)?(GetVPModeID(&screen->ViewPort)&MONITOR_ID_MASK):0,
                            TAG_END);
            }
to this:
Code:
            if ((!(GfxBase->ChipRevBits0&GFXF_AA_ALICE) &&
                (data->depth>6 || (data->width>320 && data->depth>5))) ||
                data->depth>8)
            {
                // Get best available mode (under 39)
                if (GfxBase->LibNode.lib_Version>=39)
                    data->modeid=
                        BestModeID(
                            BIDTAG_NominalWidth,data->width,
                            BIDTAG_NominalHeight,data->height,
                            BIDTAG_Depth,data->depth,
                            (screen)?BIDTAG_MonitorID:TAG_IGNORE,
                                (screen)?(GetVPModeID(&screen->ViewPort)&MONITOR_ID_MASK):0,
                            TAG_END);
            }
and that worked. But when I removed the check for screenmode depth larger than 8-bitplanes (at line 122-133) and changed it to:
Code:
            if ((!(GfxBase->ChipRevBits0&GFXF_AA_ALICE) &&
                (data->depth>6 || (data->width>320 && data->depth>5))) ||
                data->depth>8)
            {
                // Get best available mode (under 39)
                if (GfxBase->LibNode.lib_Version>=39)
                    data->modeid=
                        BestModeID(
                            BIDTAG_NominalWidth,data->width,
                            BIDTAG_NominalHeight,data->height,
                            BIDTAG_Depth,data->depth,
                            TAG_END);
            }
It started opening slightly too small screens for my test-pictures.
For example http://aminet.net/package/pix/misc/ALEM_0014 a 736x566x8 picture. It would before this last change open in 800x600x8 on UAEgfx and in 768x576x8 on PicassoII+. But after the change it opens in 640x480x8 on both UEAgfx and PicassoII+.
I have double checked that the variables are consistently data->width=736, data->height=566 and data->depth=8, and that data->modeid does not change between BestModeID and screen opening.
Why does this not work?

-Hagbard Celine
hceline is offline  
Old 18 December 2023, 00:51   #2
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,231
Note that BestModeID not only checks the dimensions, but also the aspect ratio of the mode, and they need to be "approximately identical". The algorithm is unfortunately quite opaque, and p96BestModeIDTagList() may probably be a better match for RTG screens. It at least actively avoids "too small" screens in most recent versions. For UAE, the situation is even more complicated as it does not have configurable screen modes but rather injects them itself into the P96 database.
Thomas Richter is offline  
Old 19 December 2023, 01:22   #3
hceline
Registered User
 
Join Date: Nov 2009
Location: Top of the world
Posts: 161
Thank you. I will have to see if I have better luck with the p96 function then.
hceline is offline  
Old 22 March 2024, 20:38   #4
hceline
Registered User
 
Join Date: Nov 2009
Location: Top of the world
Posts: 161
I finally had some time to look at this again. Started with updating WinUAE to and Picasso96.
I wonder if you did any changes to the PicassoII(+) driver that might help this?

Because when I updated form v3.4.0 to v3.4.1 my PicassoII+ setup suddenly began to behave much better without any code changes.

The test pic mentioned earlier now opens in 768x576, and it gives much better result on my other test pics also (some get smaller resolution then the pic dimensions, but it seems to select the closest in pixels as opposed to many sizes smaller before), but only on PicassoII+.

Other cards tested was UAEgfx (opens 640x480x8), RetinaBLTZ3 (opens 320x240x8) and CyberVision 64/3D (opens 320x240x8). All tests done in WinUAE, both version 5.2.0 and 5.3.0beta1.

Also maybe noteworthy: When I uninstalled v3.4.1 (deleting all settings) and reverted to 3.4.0 to verify this finding, the PicassoII+ setup started opening a 320x240x8 screen for the aforementioned test pic as opposed to 640x480x8 before the updates.

Edit: I forgot to mention that I used P96Pref to "Add default modes" to all the real emulated cards between each install and test.

Last edited by hceline; 22 March 2024 at 20:44.
hceline is offline  
Old 22 March 2024, 23:30   #5
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,231
This is actually not a driver issue - the mode IDs are determined at a higher level, in this case in the P96BestModeID function in the Picasso96API.library. Frankly, I do not remember having worked on tihs particular function, if there is nothing in the release notes, then it did not change. It is rather a matter of the available modes.
Thomas Richter 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
AmigaKit does not answer emails Sgw32 Amiga websites reviews 15 18 February 2024 09:54
Controversial answer to best value Amiga to get for non AGA gaming... ImmortalA1000 Retrogaming General Discussion 12 22 January 2023 19:42
need a quick answer Tuckernem New to Emulation or Amiga scene 5 10 October 2013 09:34
For the DVD you MUST answer this :) synchro Amiga scene 26 28 June 2004 09:27
please answer this! Traquer Retrogaming General Discussion 26 07 April 2002 15:46

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 23:18.

Top

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