Skip to content

Commit

Permalink
One more environment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sonninnos committed Jun 7, 2023
1 parent 9bb6676 commit 605264f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions libretro/libretro-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ static void retro_set_paths(void)
string_is_empty(save_dir) ? retro_system_directory : save_dir,
sizeof(retro_save_directory));
}
else
else if (!retro_save_directory)
{
/* Make retro_save_directory the same in case RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY is not implemented by the frontend */
strlcpy(retro_save_directory,
Expand Down Expand Up @@ -3229,18 +3229,18 @@ void retro_set_environment(retro_environment_t cb)
{
environ_cb = cb;

/* Must set these here for the dynamic cartridge option,
* and must set only once, since `retro_set_environment`
* is called multiple times, and save dir is wrong later.. */
if (string_is_empty(retro_temp_directory))
retro_set_paths();
/* Must set these here for the dynamic cartridge option */
retro_set_paths();

retro_set_core_options();
retro_set_inputs();

bool support_no_game = true;
environ_cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &support_no_game);

struct retro_core_options_update_display_callback update_display_callback = {retro_update_display};
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_UPDATE_DISPLAY_CALLBACK, &update_display_callback);

struct retro_led_interface led_interface;
if (environ_cb(RETRO_ENVIRONMENT_GET_LED_INTERFACE, &led_interface))
if (led_interface.set_led_state && !led_state_cb)
Expand Down Expand Up @@ -5259,9 +5259,6 @@ void retro_init(void)
static struct retro_keyboard_callback keyboard_callback = {retro_keyboard_event};
environ_cb(RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK, &keyboard_callback);

static struct retro_core_options_update_display_callback update_display_callback = {retro_update_display};
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_UPDATE_DISPLAY_CALLBACK, &update_display_callback);

bool achievements = true;
environ_cb(RETRO_ENVIRONMENT_SET_SUPPORT_ACHIEVEMENTS, &achievements);

Expand Down

0 comments on commit 605264f

Please sign in to comment.