mirror of
https://github.com/libretro/RetroArch
synced 2024-12-27 15:29:23 +00:00
subsystem part 2: add a wrapper to set the current subsystem
This commit is contained in:
parent
692c8683b2
commit
b212640732
@ -42,6 +42,7 @@ typedef struct content_ctx_info
|
|||||||
int pending_subsystem;
|
int pending_subsystem;
|
||||||
int pending_subsystem_rom_id;
|
int pending_subsystem_rom_id;
|
||||||
|
|
||||||
|
char pending_subsystem_ident[255];
|
||||||
char pending_subsystem_extensions[PATH_MAX_LENGTH];
|
char pending_subsystem_extensions[PATH_MAX_LENGTH];
|
||||||
char pending_subsystem_roms[RARCH_MAX_SUBSYSTEM_ROMS][PATH_MAX_LENGTH];
|
char pending_subsystem_roms[RARCH_MAX_SUBSYSTEM_ROMS][PATH_MAX_LENGTH];
|
||||||
|
|
||||||
@ -91,6 +92,9 @@ bool content_undo_save_buf_is_empty(void);
|
|||||||
/* Clears the pending subsystem rom buffer*/
|
/* Clears the pending subsystem rom buffer*/
|
||||||
void content_clear_subsystem(void);
|
void content_clear_subsystem(void);
|
||||||
|
|
||||||
|
/* Set the current subsystem*/
|
||||||
|
void content_set_subsystem(unsigned subsystem);
|
||||||
|
|
||||||
/* Add a rom to the subsystem rom buffer */
|
/* Add a rom to the subsystem rom buffer */
|
||||||
void content_add_subsystem(const char* path);
|
void content_add_subsystem(const char* path);
|
||||||
|
|
||||||
|
@ -448,7 +448,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
filebrowser_clear_type();
|
filebrowser_clear_type();
|
||||||
if (pending_subsystem != type - MENU_SETTINGS_SUBSYSTEM_ADD)
|
if (pending_subsystem != type - MENU_SETTINGS_SUBSYSTEM_ADD)
|
||||||
content_clear_subsystem();
|
content_clear_subsystem();
|
||||||
pending_subsystem = type - MENU_SETTINGS_SUBSYSTEM_ADD;
|
content_set_subsystem(type - MENU_SETTINGS_SUBSYSTEM_ADD);
|
||||||
filebrowser_set_type(FILEBROWSER_SELECT_FILE_SUBSYSTEM);
|
filebrowser_set_type(FILEBROWSER_SELECT_FILE_SUBSYSTEM);
|
||||||
info.type = type;
|
info.type = type;
|
||||||
info.directory_ptr = idx;
|
info.directory_ptr = idx;
|
||||||
|
@ -1678,11 +1678,23 @@ void content_clear_subsystem(void)
|
|||||||
pending_subsystem_roms[i][0] = '\0';
|
pending_subsystem_roms[i][0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set the current subsystem*/
|
||||||
|
void content_set_subsystem(unsigned sub)
|
||||||
|
{
|
||||||
|
rarch_system_info_t *system = runloop_get_system_info();
|
||||||
|
const struct retro_subsystem_info* subsystem = NULL;
|
||||||
|
|
||||||
|
pending_subsystem = sub;
|
||||||
|
subsystem = system->subsystem.data + pending_subsystem;
|
||||||
|
|
||||||
|
strlcpy(pending_subsystem_ident, subsystem->ident, sizeof(pending_subsystem_ident));
|
||||||
|
}
|
||||||
|
|
||||||
/* Add a rom to the subsystem rom buffer */
|
/* Add a rom to the subsystem rom buffer */
|
||||||
void content_add_subsystem(const char* path)
|
void content_add_subsystem(const char* path)
|
||||||
{
|
{
|
||||||
strlcpy(pending_subsystem_roms[pending_subsystem_rom_id], path, sizeof(pending_subsystem_roms[pending_subsystem_rom_id]));
|
strlcpy(pending_subsystem_roms[pending_subsystem_rom_id], path, sizeof(pending_subsystem_roms[pending_subsystem_rom_id]));
|
||||||
RARCH_LOG("[subsystem] subsystem id: %d rom id: %d, rom path: %s\n", pending_subsystem, pending_subsystem_rom_id, pending_subsystem_roms[pending_subsystem_rom_id]);
|
RARCH_LOG("[subsystem] subsystem id: %d subsystem ident: %s rom id: %d, rom path: %s\n", pending_subsystem, pending_subsystem_ident, pending_subsystem_rom_id, pending_subsystem_roms[pending_subsystem_rom_id]);
|
||||||
pending_subsystem_rom_id++;
|
pending_subsystem_rom_id++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user