Per-Game Video and Shader Configs?

Is there any way to set up per-game video and shader configs? I’ve got per-core configs working, and I can save per-game core options and button mappings, but can’t seem to set up per-game video and shader configs.

An example would be Symphony of the Night in Mednafen PSX. To display that game full-screen in the correct aspect ratio at 1080p, I need to use a custom viewport width: 1451, height: 1252, x offset: 229, y offset -104. And since that’s using non-integer scaling, I also need to use the Pixellate.cg shader. These settings look great, but are very wrong for any other PSX game.

Same thing applies to many other games/cores. I like the look of Super Mario World unfiltered, but Donkey Kong Country’s sprites look awful without a CRT shader for example.

You can do per-game overrides but they’re mutually exclusive with per-core configs. It should be pretty easy to switch over from per-core configs to overrides, though, just by making a few directories and renaming some config files.

Thank you, it seems that what I had to do to get this working was disable the option to use per-core configs. Everything else I had set up was actually correct and started to work right away. Is there a reason that you cannot use both at the same time? This seems very restrictive.

The way I expected it to work was: [ol] [li]RetroArch Config - handles general video, audio, path settings etc.[/li][li]Core Config - handles core-specific options such as setting up a general video scaling profile for the hardware. (e.g. SNES is some integer scale of 256x224, Gameboy is 160x144, GBA is 240x160, Genesis is 320x224 etc.)[/li][li]Game Config - handles any game-specific adjustments that are necessary.[/li][/ol] If I have to pick one or the other, I’m either setting up a profile for every new game that I play, or I’m having to change settings back & forth from my default core config every time I play a game where the default does not apply. Very inconvenient.

My General PSX config would be non-integer 4:3 scaling with the Pixellate shader, while my Symphony of the Night config is:

aspect_ratio_index = "22"
custom_viewport_width = "1451"
custom_viewport_height = "1252"
custom_viewport_x = "	229"
custom_viewport_y = "-104"
video_scale_integer = "false"
video_shader = ":\shaders\Pixellate.cgp"

Other games may set up Mednafen to enable the widescreen hack (where that works) and set the aspect ratio to 16:9 for example.

It would also be a lot easier to set this up if the main menu options were: [ul] [li]Save RetroArch Config[/li][li]Save <core name> Config[/li][li]Save <game name> Config[/li][/ul] Having to set these up manually as we do now could become quite time consuming.

I’ve also found a bug where, if the “Save Configuration On Exit” option is disabled, it is no longer possible to manually save the config via the “Save Current Config” option. (XMB UI on Windows x64) It seems to disable saving the config entirely, instead of only preventing it from saving automatically on exit.

The way it works is:

  1. RetroArch config - holds default options
  2. core override - appends these options to the default config any time you load content using this core
  3. game override - appends these options to the default config any time you load this game If you have both a core override and a game override, I’m not sure if it loads the core one first and then the game one or if it’s just the game one. I suspect the former but asked radius about it anyway, since he’s the one that implemented that feature.

It loads core override, and then game overrides

Oh I’m sorry, I thought you were saying that you could only use per-core or per-game overrides, and not both. After doing a bit of testing, I think the reason that disabling per-core configs fixed my per-game overrides, is that the core configuration had been created long before I enabled the option to load per-game overrides. I deleted my previous per-core configs and now both are working as expected.

I also noticed that RetroArch crashes if the core config is using a different GUI from the main RA config. (unintentionally - I just switched from GLUI back to XMB) So it’s possible that some settings should be forced as global and only ever written to, or read from, the main RA config file.

I do still think that the process of creating per-core, or per-game configs could be greatly simplified with a couple of new options however.

…and suddenly my per-game configs aren’t loading again. I have to disable per-core configs for them to load.

Any idea why that could be?

per-core configs and overrides are different features. With core-specific configs enabled overrides don’t load they are mutually exclusive

Well now I’m confused, I thought you said that it would load the core override, then game overrides in that order. It also seemed to be working before, but I’ve had issues with some of the settings not being saved or resetting so it’s possible that I thought the per-core configs were enabled but they actually were not.

My setup is: \retroarch.cfg \config\core.cfg \config\core\game.cfg

For some games, there is also game.opt alongside the game.cfg

As I mentioned above, what I’m looking to set up is: retroarch.cfg - defines most video/audio/input/general settings core.cfg - defines a standard resolution/shader and audio settings for each core (some cores need higher latency settings than others) game.cfg - defines a custom resolution/shader/core config specific to that game e.g. fixing the aspect ratio of bordered games, enabling widescreen hacks

[ul] [li]Symphony of the Night looks like this using the 4:3 settings defined in mednafen_psx_libretro.dll.cfg because it doesn’t fill the vertical height of the frame [/li][li]And it looks like this with the custom settings defined in sotn.cfg [/li][/ul] The problem is that I’m having to set up this sort of thing manually right now.

To get per game overrides working, you’re going to have to also convert your per-core configs into per core overrides. So, for example, rename “mednafen_psx_libretro.dll.cfg” to “Mednafen PSX.cfg” and put it in “\config\Mednafen PSX” along with your per game overrides. You can remove any settings in that file that are identical to the ones in retroarch.cfg. Note that to change settings for either the core or game you have to edit the config files manually; they won’t save from the interface. Also turn off per-core settings in retroarch.cfg and leave auto load overrides on.

Something else you might want to try is per game core options files. You can create a .opt file with the same filename as a game in the “\config\core name” folder just like an override. You can even create them from the interface in Quick Menu, Core Options, Create game-options file. That will store core options for that game and, unlike overrides, will save core options you modify from the interface to that file when you have that game running. So you could do that for SOTN to cut off the unused scanlines to get rid of the black bars on the top and bottom using the initial and last scanline options instead of using a custom viewport. This works with any resolution. Though you do need to also set a custom aspect ratio in the per game override to account for the cut off scanlines. I use video_aspect_ratio = “1.3786” in my SOTN override combined with beetle_psx_initial_scanline = “20” and beetle_psx_last_scanline = “226” in the core options file to basically crop and zoom into the viewable gameplay area while maintaining correct geometry. Crop overscan is off in my retroarch.cfg since it messes with the aspect if it’s on.

I had to take a screenshot at 1x window scale and count how many scanlines to cut off from the top and bottom in Paint.net. Then I divided the width of the viewable gameplay area by the length to get the aspect ratio. Messing with the viewport is probably easier, but if I get a higher res monitor these settings will work there too without modification.

[QUOTE=Awakened;36929]To get per game overrides working, you’re going to have to also convert your per-core configs into per core overrides. So, for example, rename “mednafen_psx_libretro.dll.cfg” to “Mednafen PSX.cfg” and put it in “\config\Mednafen PSX” along with your per game overrides.[/quote]Aha! I’m not quite sure why “per-core configs” and “per-core overrides” are somehow a different thing, but I’ve done a bit of testing now and this seems to have done the trick.

So the structure is: \retroarch.cfg \configs&lt;core>&lt;core>.cfg \configs&lt;core>&lt;game>.cfg

[QUOTE=Awakened;36929]You can remove any settings in that file that are identical to the ones in retroarch.cfg. Note that to change settings for either the core or game you have to edit the config files manually; they won’t save from the interface. Also turn off per-core settings in retroarch.cfg and leave auto load overrides on.[/quote]Yes, this would be a lot easier to set up if we had options to save the current configuration as a core or game override in the menu, but it can be achieved with the “save new config” option and then manually renaming & moving the file that is created. It’s just a pain to do.

[QUOTE=Awakened;36929]Something else you might want to try is per game core options files. You can create a .opt file with the same filename as a game in the “\config\core name” folder just like an override. You can even create them from the interface in Quick Menu, Core Options, Create game-options file. That will store core options for that game and, unlike overrides, will save core options you modify from the interface to that file when you have that game running.[/quote]Yes, I have been using that, since there is an option directly in the menu to do so.

[QUOTE=Awakened;36929]So you could do that for SOTN to cut off the unused scanlines to get rid of the black bars on the top and bottom using the initial and last scanline options instead of using a custom viewport. This works with any resolution. Though you do need to also set a custom aspect ratio in the per game override to account for the cut off scanlines. I use video_aspect_ratio = “1.3786” in my SOTN override combined with beetle_psx_initial_scanline = “20” and beetle_psx_last_scanline = “226” in the core options file to basically crop and zoom into the viewable gameplay area while maintaining correct geometry. Crop overscan is off in my retroarch.cfg since it messes with the aspect if it’s on.[/quote]That’s great information, thanks. I didn’t think to use the scanline options to crop the image vertically, and you’re right about having to disable the crop overscan option. The crop overscan option is misaligned, so while you get a 256px wide image instead of a 280px wide image, the first two columns are black and the last two columns are cropped. The cropping and scaling of most Mednafen cores never seems to be quite right in my experience. Using integer scaling, it wants to display both the 256px (cropped) or 280px (uncropped) images at 320px. So to get the correct aspect ratio, we’re trying to correct 256x207 inside a 280x207 container, and the correction for that is 1.458333333333330 - assuming that the intended output is a 4:3 image.

[QUOTE=Awakened;36929]Messing with the viewport is probably easier, but if I get a higher res monitor these settings will work there too without modification.[/QUOTE]That’s a good point. If I’m taking the time to make these corrections, it’s best to make them as universal as possible. So my final config files are:

Castlevania - Symphony of the Night.cfg

aspect_ratio_index = "19"
video_aspect_ratio = "1.458333333333330"
video_crop_overscan = "false"
video_scale_integer = "false"
video_shader = ":\shaders\shaders_cg\retro\pixellate.cgp"

Castlevania - Symphony of the Night.opt

beetle_psx_cdimagecache = "enabled"
beetle_psx_cpu_overclock = "disabled"
beetle_psx_skipbios = "disabled"
beetle_psx_widescreen_hack = "disabled"
beetle_psx_internal_resolution = "1x(native)"
beetle_psx_dither_mode = "1x(native)"
beetle_psx_gte_subpixel = "subpixel"
beetle_psx_use_mednafen_memcard0_method = "libretro"
beetle_psx_shared_memory_cards = "disabled"
beetle_psx_initial_scanline = "20"
beetle_psx_initial_scanline_pal = "0"
beetle_psx_last_scanline = "226"
beetle_psx_last_scanline_pal = "287"
beetle_psx_analog_toggle = "disabled"
beetle_psx_enable_multitap_port1 = "disabled"
beetle_psx_enable_multitap_port2 = "disabled"
beetle_psx_frame_duping_enable = "disabled"
beetle_psx_display_internal_framerate = "disabled"

Per-core configs is the older solution from before Radius and someone else added overrides. It still remains since a lot of people already have setups with the older method and the devs don’t like to remove features from RetroArch. I think maybe it could be removed if Radius figures out how to get override saving from the interface working, since then per-core settings would be completely redundant.

Anyway, your setup looks good to me!

I just updated to the latest build and all of a sudden my configs have stopped working again. Any idea what the issue could be?

They worked initially but now they don’t seem to be working at all. Checked my config and it’s still set up as it was previously.

EDIT: The issue is that the PSX core was renamed from Mednafen PSX to Mednafen PSX (PBP test). Additionally, after this change, it no longer seems to load or save core options correctly. I get a blank file if I save a new one.