libretro / vice-libretro

Versatile Commodore 8-bit Emulator
GNU General Public License v2.0
40 stars 70 forks source link

Fix core options not set in retro_set_environment() #488

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.

How has this been tested?

Used to generate Kodi settings for the following cores:

garbear commented 1 year ago

I found this while hunting down https://github.com/libretro/mrboom-libretro/pull/27, so if that PR could be merged too it'd be awesome!

sonninnos commented 1 year ago

Thanks, merging!