mirror of
https://github.com/libretro/RetroArch
synced 2025-04-22 08:43:05 +00:00
Move core_len/core_buf to menu_handle_t
This commit is contained in:
parent
a130dce708
commit
aa5525f670
@ -4266,8 +4266,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
case DISPLAYLIST_CORE_CONTENT:
|
case DISPLAYLIST_CORE_CONTENT:
|
||||||
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
print_buf_lines(info->list, core_buf, "",
|
print_buf_lines(info->list, menu->core_buf, "",
|
||||||
(int)core_len, FILE_TYPE_DOWNLOAD_CORE_CONTENT, true, false);
|
(int)menu->core_len,
|
||||||
|
FILE_TYPE_DOWNLOAD_CORE_CONTENT, true, false);
|
||||||
info->need_push = true;
|
info->need_push = true;
|
||||||
info->need_refresh = true;
|
info->need_refresh = true;
|
||||||
info->need_clear = true;
|
info->need_clear = true;
|
||||||
@ -4284,9 +4285,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
if (str_list->elems[0].data)
|
if (str_list->elems[0].data)
|
||||||
strlcpy(new_label, str_list->elems[0].data, sizeof(new_label));
|
strlcpy(new_label, str_list->elems[0].data, sizeof(new_label));
|
||||||
if (str_list->elems[1].data)
|
if (str_list->elems[1].data)
|
||||||
strlcpy(core_buf, str_list->elems[1].data, core_len);
|
strlcpy(menu->core_buf, str_list->elems[1].data, menu->core_len);
|
||||||
print_buf_lines(info->list, core_buf, new_label,
|
print_buf_lines(info->list, menu->core_buf, new_label,
|
||||||
(int)core_len, FILE_TYPE_DOWNLOAD_URL, false, false);
|
(int)menu->core_len, FILE_TYPE_DOWNLOAD_URL, false, false);
|
||||||
info->need_push = true;
|
info->need_push = true;
|
||||||
info->need_refresh = true;
|
info->need_refresh = true;
|
||||||
info->need_clear = true;
|
info->need_clear = true;
|
||||||
@ -4306,8 +4307,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
fill_pathname_join(new_label,
|
fill_pathname_join(new_label,
|
||||||
settings->paths.network_buildbot_assets_url,
|
settings->paths.network_buildbot_assets_url,
|
||||||
"cores", sizeof(new_label));
|
"cores", sizeof(new_label));
|
||||||
print_buf_lines(info->list, core_buf, new_label,
|
print_buf_lines(info->list, menu->core_buf, new_label,
|
||||||
(int)core_len, FILE_TYPE_DOWNLOAD_URL, true, false);
|
(int)menu->core_len, FILE_TYPE_DOWNLOAD_URL, true, false);
|
||||||
info->need_push = true;
|
info->need_push = true;
|
||||||
info->need_refresh = true;
|
info->need_refresh = true;
|
||||||
info->need_clear = true;
|
info->need_clear = true;
|
||||||
@ -4317,8 +4318,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
case DISPLAYLIST_CORES_UPDATER:
|
case DISPLAYLIST_CORES_UPDATER:
|
||||||
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
print_buf_lines(info->list, core_buf, "",
|
print_buf_lines(info->list, menu->core_buf, "",
|
||||||
(int)core_len, FILE_TYPE_DOWNLOAD_CORE, true, true);
|
(int)menu->core_len, FILE_TYPE_DOWNLOAD_CORE, true, true);
|
||||||
info->need_push = true;
|
info->need_push = true;
|
||||||
info->need_refresh = true;
|
info->need_refresh = true;
|
||||||
info->need_clear = true;
|
info->need_clear = true;
|
||||||
@ -4327,8 +4328,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
case DISPLAYLIST_THUMBNAILS_UPDATER:
|
case DISPLAYLIST_THUMBNAILS_UPDATER:
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
||||||
print_buf_lines(info->list, core_buf, "",
|
print_buf_lines(info->list, menu->core_buf, "",
|
||||||
(int)core_len, FILE_TYPE_DOWNLOAD_THUMBNAIL_CONTENT,
|
(int)menu->core_len, FILE_TYPE_DOWNLOAD_THUMBNAIL_CONTENT,
|
||||||
true, false);
|
true, false);
|
||||||
info->need_push = true;
|
info->need_push = true;
|
||||||
info->need_refresh = true;
|
info->need_refresh = true;
|
||||||
@ -4338,8 +4339,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
case DISPLAYLIST_LAKKA:
|
case DISPLAYLIST_LAKKA:
|
||||||
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
print_buf_lines(info->list, core_buf, "",
|
print_buf_lines(info->list, menu->core_buf, "",
|
||||||
(int)core_len, FILE_TYPE_DOWNLOAD_LAKKA,
|
(int)menu->core_len, FILE_TYPE_DOWNLOAD_LAKKA,
|
||||||
true, false);
|
true, false);
|
||||||
info->need_push = true;
|
info->need_push = true;
|
||||||
info->need_refresh = true;
|
info->need_refresh = true;
|
||||||
|
@ -356,9 +356,11 @@ typedef struct
|
|||||||
{
|
{
|
||||||
unsigned rpl_entry_selection_ptr;
|
unsigned rpl_entry_selection_ptr;
|
||||||
unsigned rdb_entry_start_game_selection_ptr;
|
unsigned rdb_entry_start_game_selection_ptr;
|
||||||
|
size_t core_len;
|
||||||
size_t hack_shader_pass;
|
size_t hack_shader_pass;
|
||||||
uint64_t state;
|
uint64_t state;
|
||||||
|
|
||||||
|
char *core_buf;
|
||||||
char menu_state_msg[1024];
|
char menu_state_msg[1024];
|
||||||
/* Scratchpad variables. These are used for instance
|
/* Scratchpad variables. These are used for instance
|
||||||
* by the filebrowser when having to store intermediary
|
* by the filebrowser when having to store intermediary
|
||||||
@ -601,9 +603,6 @@ const char *menu_driver_find_ident(int index);
|
|||||||
**/
|
**/
|
||||||
const char* config_get_menu_driver_options(void);
|
const char* config_get_menu_driver_options(void);
|
||||||
|
|
||||||
/* HACK */
|
|
||||||
extern unsigned int rdb_entry_start_game_selection_ptr;
|
|
||||||
|
|
||||||
const char *menu_driver_ident(void);
|
const char *menu_driver_ident(void);
|
||||||
|
|
||||||
bool menu_driver_render(bool is_idle, bool is_inited, bool is_dummy);
|
bool menu_driver_render(bool is_idle, bool is_inited, bool is_dummy);
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include <net/net_http_parse.h>
|
#include <net/net_http_parse.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "menu_driver.h"
|
||||||
#include "menu_networking.h"
|
#include "menu_networking.h"
|
||||||
#include "menu_cbs.h"
|
#include "menu_cbs.h"
|
||||||
#include "menu_entries.h"
|
#include "menu_entries.h"
|
||||||
@ -40,9 +41,6 @@
|
|||||||
#include "../msg_hash.h"
|
#include "../msg_hash.h"
|
||||||
#include "../tasks/tasks_internal.h"
|
#include "../tasks/tasks_internal.h"
|
||||||
|
|
||||||
char *core_buf = NULL;
|
|
||||||
size_t core_len = 0;
|
|
||||||
|
|
||||||
void print_buf_lines(file_list_t *list, char *buf,
|
void print_buf_lines(file_list_t *list, char *buf,
|
||||||
const char *label, int buf_size,
|
const char *label, int buf_size,
|
||||||
enum msg_file_type type, bool append, bool extended)
|
enum msg_file_type type, bool append, bool extended)
|
||||||
@ -226,28 +224,32 @@ finish:
|
|||||||
void cb_net_generic(void *task_data, void *user_data, const char *err)
|
void cb_net_generic(void *task_data, void *user_data, const char *err)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
bool refresh = false;
|
bool refresh = false;
|
||||||
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
|
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
|
||||||
file_transfer_t *state = (file_transfer_t*)user_data;
|
file_transfer_t *state = (file_transfer_t*)user_data;
|
||||||
|
menu_handle_t *menu = NULL;
|
||||||
|
|
||||||
if (core_buf)
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
||||||
free(core_buf);
|
goto finish;
|
||||||
|
|
||||||
core_buf = NULL;
|
if (menu->core_buf)
|
||||||
core_len = 0;
|
free(menu->core_buf);
|
||||||
|
|
||||||
|
menu->core_buf = NULL;
|
||||||
|
menu->core_len = 0;
|
||||||
|
|
||||||
if (!data || err)
|
if (!data || err)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
core_buf = (char*)malloc((data->len+1) * sizeof(char));
|
menu->core_buf = (char*)malloc((data->len+1) * sizeof(char));
|
||||||
|
|
||||||
if (!core_buf)
|
if (!menu->core_buf)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
if (!string_is_empty(data->data))
|
if (!string_is_empty(data->data))
|
||||||
memcpy(core_buf, data->data, data->len * sizeof(char));
|
memcpy(menu->core_buf, data->data, data->len * sizeof(char));
|
||||||
core_buf[data->len] = '\0';
|
menu->core_buf[data->len] = '\0';
|
||||||
core_len = data->len;
|
menu->core_len = data->len;
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
refresh = true;
|
refresh = true;
|
||||||
|
@ -29,9 +29,6 @@
|
|||||||
|
|
||||||
RETRO_BEGIN_DECLS
|
RETRO_BEGIN_DECLS
|
||||||
|
|
||||||
extern char *core_buf;
|
|
||||||
extern size_t core_len;
|
|
||||||
|
|
||||||
void print_buf_lines(file_list_t *list, char *buf,
|
void print_buf_lines(file_list_t *list, char *buf,
|
||||||
const char *label, int buf_size,
|
const char *label, int buf_size,
|
||||||
enum msg_file_type type, bool append, bool extended);
|
enum msg_file_type type, bool append, bool extended);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user