libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.14k stars 1.82k forks source link

Retroarch ignoring root directory switchres.ini #16732

Open chinagreenelvis opened 3 months ago

chinagreenelvis commented 3 months ago

Description

switchres.ini files only work as core overrides, the contents of the root directory ini file is ignored completely and treated as default values (arcade_15).

Expected behavior

The root directory switchres.ini (placed in the same folder as retroarch.exe) should produce proper results when modified if no core override INI file exists.

Actual behavior

Changes to the root directory switchres.ini make no difference.

Steps to reproduce the bug

  1. have a properly functioning CRT setup with CRTEmuDriver and a card that supports it
  2. create a switchres.ini and place it in the RA root directory, edit a value such as h_shift
  3. enable INI mode for switchres and restart retroarch, see no changes to the h_shift
  4. create a corename.switchres.ini override with an edited h_shift
  5. run a game on the core, see that h_shift now produces effects

I stumbled upon this after struggling to create custom crt_range for my television set and having VMM produce proper modelines but having RetroArch generate nothing but the default arcade_15 preset modelines. I then created an override switchres file for cores and finally RA began producing modelines consistent with VMM. Because I plan on using the same settings for most cores, having to create an override file for each core is less ideal than being able to use one main switchres.ini to handle everything I don't wish to override.

Bisect Results

I haven't tested with previous versions, so I don't know if this behavior was ever consistent with my expectations, maybe I'm misunderstanding how the main .ini file setup works on Windows or it's just still in early stages of implementation.

Version/Commit

Environment information

chinagreenelvis commented 3 months ago

Also, strangely, override corename.switchres.ini files work when a display is connected through a card with CRTEmudriver even when no root-directory INI file exists; a display connected through the main card requires both the root-directory INI file (in order to work at all) and the override INI (in order to work properly).

gouchi commented 3 months ago

@alphanu1 @substring Might have some feedback, thank you ;)

Redemp commented 3 months ago

There is also this bug where it should look for the file in \ini\ but it doesn't

Taken from swichres readme file

switchres GitHub A default switchres.ini file will be searched in the current working directory, then in .\ini on Windows, ./ini then /etc on Linux.

chinagreenelvis commented 3 months ago

It definitely requires an .ini file in the root directory at least for my DOS mode switchres to work. Changes to that INI file don't make any difference but the contents of the file still matter because I tried blanking it out and it failed to function when I did.

The whole thing is really tricky at the moment and it's almost a miracle that I have it working at all but I'm glad that I do because having it working is amazing.

substring commented 3 months ago

Windows 😒 I don't have a windows CRT setup, but I'll do my best.

Could it be that it's just the monitor definition that is not loaded from the .ini in the root dir ?

Redemp commented 3 months ago

rgui Main Menu->Settings->Video->CRT SwitchRes

CRT SwitchRes: INI CRT Super Resolution: Native

Retroarch.cfg

crt_switch_resolution = "4"
crt_switch_resolution_super = "0"

With switchres.ini file not present in the root of the Retroarch folder

INFO] [CRT]: Requested Resolution: 256x224@60.099827 orientation: normal
[INFO] [CRT] Video context is: wgl
[INFO] [CRT]: Current running core FCEUmm 
[DEBUG] 256x224 rotation: 0 rotated: 0 core rotation:0
[INFO] Switchres: Calculating best video mode for 256x224@60.099827 orientation: normal
[INFO] Switchres: Modeline "800x480_60i 15.656005KHz 60.099827Hz" 16.266589 800 833 909 1039 480 483 489 521 interlace  -hsync -vsync
[INFO] set_desktop_mode: \\.\DISPLAY20 (800x480@60) flags(2)
[INFO] sr_set_mode: successfully switched to 800x480@60.099827
[INFO] [CRT]: Setting Aspect Ratio: 1.714286 
[INFO] [CRT]: Setting Video Screen Size to: 768x448 
[INFO] [Video]: Video refresh rate changed to 60.100 Hz.

Symbolic soft link from C:\ini\switchres.ini to the root of the Retroarch folder.

INFO] [CRT]: Requested Resolution: 256x224@60.099827 orientation: normal
[INFO] [CRT] Video context is: (null)
[INFO] [CRT]: Current running core FCEUmm 
[DEBUG] 256x224 rotation: 0 rotated: 0 core rotation:0
[INFO] Switchres: Calculating best video mode for 256x224@60.099827 orientation: normal
[INFO] Switchres: Modeline "256x224_60 15.625955KHz 60.099827Hz" 5.172191 256 266 290 331 224 233 236 260   -hsync -vsync
[INFO] set_desktop_mode: \\.\DISPLAY20 (256x224@60) flags(0)
[INFO] sr_set_mode: successfully switched to 256x224@60.099827
[INFO] [CRT]: Setting Aspect Ratio: 1.142857 
[INFO] [CRT]: Setting Video Screen Size to: 256x224 
[INFO] [Video]: Video refresh rate changed to 60.100 Hz.

The ini file should be searched for first in \ini\ but it completely ignores this.

Redemp commented 3 months ago

According to Switchres it should search for the file ini file:

A default switchres.ini file will be searched in the current working directory, then in .\ini on Windows, ./ini then /etc on Linux

So If there is no ini file in the RA root folder RA or an override folder it should search for the file in \ini\

But it doesn't...

This is how it works on Linux so shouldn't it be the same on windows? Better to have one main ini file instead of the same file spread across multiple directories.