Can I modify the hardware details reported to a game?

Report bugs, errors, problems, etc.
Ray Koopa
Posts: 3
Joined: Mon Apr 30, 2018 9:14 am

Can I modify the hardware details reported to a game?

Postby Ray Koopa » Mon Apr 30, 2018 9:22 am

Hi there,

I have an old game (Pod) which allows switching between resolutions.
However, it only allows switching to the 800x600 resolution if the hardware details report back more than 1 MB RAM (it seems), and with nGlide, I do not seem to report back more than 1 MB RAM.

Here's the code switching between resolutions, note the Gfx_Has1MbRam() method which always seems to return FALSE with nGlide, and does not allow 800x600 in effect:

Code: Select all

switch ( g_currentDisplayMode )
{
    case 4:
        g_currentDisplayMode = GDM_640x400;
        g_iniDisplayMode = GDMI_640x400_2;
        a2 = 6;
        goto LABEL_3;
    case 7:
        if ( Gfx_Has1MbRam() ) // <-- always returns FALSE with nGlide
        {
            g_currentDisplayMode = GDM_800x600;
            g_iniDisplayMode = GDMI_800x600_6;
            a2 = 8;
        }
        else
        {
            g_currentDisplayMode = GDM_640x480;
            g_iniDisplayMode = 0;
            a2 = 7;
        }
        goto LABEL_3;
    case 8:
        a1 = GDMI_512x384_4;
        g_currentDisplayMode = GDM_512x384;
        g_iniDisplayMode = GDMI_512x384_4;
        a2 = 3;
        goto LABEL_3;
    case 9:
        g_currentDisplayMode = GDM_640x480;
        g_iniDisplayMode = 0;
        a2 = 7;
LABEL_3:
        a3 = 0;
        break;
    default:
        break;
}


The Gfx_Has1MbRam function checks a global variable g_glideRam:

Code: Select all

BOOL Gfx_Has1MbRam()
{
    return g_glideRam > 960000;
}


g_glideRam is initially set like this:

Code: Select all

g_glideRam = 0;
grGlideInit();
result = grSstQueryHardware(&g_grHwConfiguration);
if ( !result )
    sub_490E58(v2);
v3 = 0;
if ( g_grHwConfiguration.num_sst > 0 )
{
    sstIndex = 0;
    do
    {
        hwType = g_grHwConfiguration.SSTs[sstIndex].type;
        if ( hwType == 1 )
        {
            result = g_glideRam;
            if ( g_glideRam > g_grHwConfiguration.SSTs[sstIndex].sstBoard.VoodooConfig.fbRam )
                g_glideRam = g_grHwConfiguration.SSTs[sstIndex].sstBoard.VoodooConfig.fbRam;
            dword_6DAE84 = (int (*)(void))nullsub_7;
        }
        else
        {
            if ( hwType )
                sub_490E58(v3);
            result = g_glideRam;
            if ( g_glideRam > g_grHwConfiguration.SSTs[sstIndex].sstBoard.VoodooConfig.fbRam )
                g_glideRam = g_grHwConfiguration.SSTs[sstIndex].sstBoard.VoodooConfig.fbRam;
            dword_6DAE84 = (int (*)(void))sub_4A5F8C;
            byte_6DAE79 = 0;
        }
        ++v3;
        ++sstIndex;
    }
    while ( v3 < g_grHwConfiguration.num_sst );
}


Is there any way to modify or make up completely arbitrary HW configurations with nGlide or do I have to modify the game's code for now?

User avatar
Zeus
Site Admin
Posts: 1563
Joined: Sun Sep 21, 2008 2:51 pm
Contact:

Re: Can I modify the hardware details reported to a game?

Postby Zeus » Mon Apr 30, 2018 12:32 pm

The latter. You should also read this.

Ray Koopa
Posts: 3
Joined: Mon Apr 30, 2018 9:14 am

Re: Can I modify the hardware details reported to a game?

Postby Ray Koopa » Sat May 05, 2018 4:07 pm

Yeah, I know the app, sadly it wasn't sufficient; If you toggle between resolutions in Pod, going from high res (800x600) to low res and back to high res, it (accidentally) disables some dumb feature of not drawing too distant polygons (the distance seems further away at lower resolutions but is not decreased again when switching back to a higher res). Nico's patch doesn't allow going back to high res though, and maxes out at 640x480 (high res only works if initially set at game start. This resolution switching code of Pod is kinda dumb aswell).
I may just extend nico's pod hacks or modify the drawing distance in Pod. For now I just patched the jump seen above, but that causes some other hickups (the UI is aligned correctly but still thinks it can only display the last 3 lap times as if in very low res even though there's space for more. Hilarious!).
Thanks for the feedback!


Return to “Problems”

Who is online

Users browsing this forum: No registered users and 13 guests