Create STRING_LIST_CORES

This commit is contained in:
twinaphex 2015-10-26 19:03:29 +01:00
parent 2dd30f743d
commit 5f8cb99282
2 changed files with 17 additions and 1 deletions

View File

@ -30,6 +30,7 @@
#include "location/location_driver.h"
#endif
#include "general.h"
#include "gfx/video_driver.h"
#include "input/input_driver.h"
#include "input/input_hid_driver.h"
@ -44,6 +45,7 @@ const char *string_list_special_new(enum string_list_type type)
unsigned i;
char *options = NULL;
int len = 0;
global_t *global = global_get_ptr();
struct string_list *s = string_list_new();
attr.i = 0;
@ -148,6 +150,19 @@ const char *string_list_special_new(enum string_list_type type)
string_list_append(s, opt, attr);
}
break;
case STRING_LIST_CORES:
for (i = 0; i < core_info_list_num_info_files(global->core_info.list); i++)
{
const core_info_t *info = (const core_info_t*)&global->core_info.list->list[i];
const char *opt = info ? info->display_name : NULL;
if (!opt)
goto end;
len += strlen(opt) + 1;
string_list_append(s, opt, attr);
}
break;
case STRING_LIST_NONE:
default:
goto end;

View File

@ -28,7 +28,8 @@ enum string_list_type
STRING_LIST_INPUT_DRIVERS,
STRING_LIST_INPUT_JOYPAD_DRIVERS,
STRING_LIST_INPUT_HID_DRIVERS,
STRING_LIST_RECORD_DRIVERS
STRING_LIST_RECORD_DRIVERS,
STRING_LIST_CORES
};
const char *string_list_special_new(enum string_list_type type);