mirror of
https://github.com/libretro/RetroArch
synced 2024-12-28 09:29:16 +00:00
Create CORE_CTL_RETRO_CHEAT_SET
This commit is contained in:
parent
0d81f669e0
commit
277f08022d
10
cheats.c
10
cheats.c
@ -84,7 +84,15 @@ void cheat_manager_apply_cheats(void)
|
||||
for (i = 0; i < handle->size; i++)
|
||||
{
|
||||
if (handle->cheats[i].state)
|
||||
core.retro_cheat_set(idx++, true, handle->cheats[i].code);
|
||||
{
|
||||
retro_ctx_cheat_info_t cheat_info;
|
||||
|
||||
cheat_info.index = idx++;
|
||||
cheat_info.enabled = true;
|
||||
cheat_info.code = handle->cheats[i].code;
|
||||
|
||||
core_ctl(CORE_CTL_RETRO_CHEAT_SET, &cheat_info);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_CHEEVOS
|
||||
|
@ -174,6 +174,12 @@ bool core_ctl(enum core_ctl_state state, void *data)
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case CORE_CTL_RETRO_CHEAT_SET:
|
||||
{
|
||||
retro_ctx_cheat_info_t *info = (retro_ctx_cheat_info_t*)data;
|
||||
core.retro_cheat_set(info->index, info->enabled, info->code);
|
||||
}
|
||||
break;
|
||||
case CORE_CTL_RETRO_CHEAT_RESET:
|
||||
core.retro_cheat_reset();
|
||||
break;
|
||||
|
@ -80,6 +80,8 @@ enum core_ctl_state
|
||||
|
||||
CORE_CTL_RETRO_SYMBOLS_INIT,
|
||||
|
||||
CORE_CTL_RETRO_CHEAT_SET,
|
||||
|
||||
CORE_CTL_RETRO_CHEAT_RESET,
|
||||
|
||||
CORE_CTL_RETRO_API_VERSION,
|
||||
@ -106,6 +108,13 @@ enum core_ctl_state
|
||||
CORE_CTL_RETRO_SET_CONTROLLER_PORT_DEVICE
|
||||
};
|
||||
|
||||
typedef struct retro_ctx_cheat_info
|
||||
{
|
||||
unsigned index;
|
||||
bool enabled;
|
||||
const char *code;
|
||||
} retro_ctx_cheat_info_t;
|
||||
|
||||
typedef struct retro_ctx_api_info
|
||||
{
|
||||
unsigned version;
|
||||
|
Loading…
Reference in New Issue
Block a user