libretro/RetroArch — pull request #459 by Themaister (2014-01-02 17:08:15+00:00)
Title: Restructure per-core configs

Had some more time today with per-core config code and found more issues. Tried to fix them. @ToadKing please look over it first.

Commit logs copy-paste:

Restructure per-core configs.

Merging yesterday was probably a bit premature.

One issue I overlooked was that per-core configs were not flushed to disk
when loading a new core on PC. The per-core flushing only happened on
main_exit(), which is only run on application termination. This hence
would only work with consoles with exitspawn.

config_set_defaults() must be called when loading per-core-specifics as
well or lots of options silently leak into other core specific configs
when cores are changed.

The handling with g_extern.config_path and original_config_path was
difficult logic and very error prone considering it was mutated aribitrarily by RGUI.
I've removed the original config path concept and stuck
with that config_path is *only* for global config, and
core_specific_config_path is for core-specifics (which are resolved
during config load). Saves some memory too,
which is always nice.

The block_config_read solution I proposed yesterday was not good after
all (in fact, broken on PC), and the current solution should work better.

"RetroArch Config" option in RGUI now only shows global config.

Only save per-core configs when core specific option is enabled.

Also, need to enforce that g_settings.core_specific_config is true
after loading core specific config. It's possible that core specific
option is set to false before loading a different core (using global
config only).