libretro / libretro-uae

PUAE libretro
GNU General Public License v2.0
111 stars 60 forks source link

Fix core options not set in retro_set_environment() #593

Closed garbear closed 1 year ago

garbear commented 1 year ago

Description

This PR fixes core variables for frontends that require the variables to be set inside retro_set_environment().

The documentation of RETRO_ENVIRONMENT_SET_VARIABLES states:

This should be called the first time as early as possible (ideally in retro_set_environment).

Afterward it may be called again for the core to communicate updated options to the frontend, but the number of core options must not change from the number in the initial call.

By calling retro_set_core_options() both inside retro_set_environment and when loading a game, we satisfy the libretro documentation.

Motivation and context

This PR is fully analogous to https://github.com/libretro/vice-libretro/pull/488 (indeed, the diff is nearly identical).

How has this been tested?

Used to generate the Kodi game add-on for PUAE: https://github.com/kodi-game/game.libretro.uae

sonninnos commented 1 year ago

Thanks, I'll try to add it soon to the 2.6.1 branch once I finish some other stuff.