1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-03 08:48:42 +00:00

Allow RETRO_ENVIRONMENT_SET_MEMORY_MAPS also after core startup

Change the comment in libretro.h about the removed limit and handle the environment call during core runtime in RetroArch.
This commit is contained in:
Bernhard Schelling 2023-05-22 03:56:29 +09:00 committed by LibretroAdmin
parent 22de73da3b
commit 18f79a8a8d
5 changed files with 20 additions and 5 deletions

View File

@ -933,13 +933,13 @@ int cheat_manager_initialize_memory(rarch_setting_t *setting, size_t idx, bool w
offset += cheat_st->memory_size_list[i];
}
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_INIT_SUCCESS), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
cheat_st->memory_search_initialized = true;
}
cheat_st->memory_initialized = true;
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_INIT_SUCCESS), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
#ifdef HAVE_MENU
if (!wraparound)
menu_st->flags |= MENU_ST_FLAG_ENTRIES_NEED_REFRESH
@ -1028,7 +1028,7 @@ static int cheat_manager_search(enum cheat_search_type search_type)
struct menu_state *menu_st = menu_state_get_ptr();
#endif
if (cheat_st->num_memory_buffers == 0)
if (cheat_st->num_memory_buffers == 0 || prev == NULL || cheat_st->matches == NULL)
{
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_NOT_INITIALIZED), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
return 0;

View File

@ -744,6 +744,11 @@ void rcheevos_reset_game(bool widgets_ready)
rcheevos_init_memory(&rcheevos_locals);
}
void rcheevos_refresh_memory()
{
rcheevos_init_memory(&rcheevos_locals);
}
bool rcheevos_hardcore_active(void)
{
return rcheevos_locals.hardcore_active;

View File

@ -37,6 +37,7 @@ bool rcheevos_unload(void);
void rcheevos_test(void);
void rcheevos_reset_game(bool widgets_ready);
void rcheevos_refresh_memory();
void rcheevos_pause_hardcore(void);
void rcheevos_hardcore_enabled_changed(void);

View File

@ -928,8 +928,6 @@ enum retro_mod
* anything else.
* It is recommended to expose all relevant pointers through
* retro_get_memory_* as well.
*
* Can be called from retro_init and retro_load_game.
*/
#define RETRO_ENVIRONMENT_SET_GEOMETRY 37
/* const struct retro_game_geometry * --

View File

@ -2832,6 +2832,17 @@ bool runloop_environment_cb(unsigned cmd, void *data)
mmap_preprocess_descriptors(descriptors, mmaps->num_descriptors);
#ifdef HAVE_CHEEVOS
rcheevos_refresh_memory();
#endif
#ifdef HAVE_CHEATS
if (cheat_manager_state.memory_initialized)
{
cheat_manager_initialize_memory(NULL, 0, true);
cheat_manager_apply_retro_cheats();
}
#endif
if (log_level != RETRO_LOG_DEBUG)
break;