RetroArch
Classes | Macros | Typedefs | Functions | Variables
task_content.c File Reference
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <file/file_path.h>
#include <string/stdstring.h>
#include <boolean.h>
#include <encodings/crc32.h>
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <file/archive_file.h>
#include <retro_miscellaneous.h>
#include <streams/file_stream.h>
#include <retro_assert.h>
#include <lists/string_list.h>
#include "tasks_internal.h"
#include "../command.h"
#include "../core_info.h"
#include "../content.h"
#include "../configuration.h"
#include "../defaults.h"
#include "../frontend/frontend.h"
#include "../playlist.h"
#include "../paths.h"
#include "../retroarch.h"
#include "../verbosity.h"
#include "../msg_hash.h"
#include "../dynamic.h"
#include "../file_path_special.h"
#include "../core.h"
#include "../dirs.h"
#include "task_patch.c"
Include dependency graph for task_content.c:

Classes

struct  content_stream
 
struct  content_information_ctx
 

Macros

#define MAX_ARGS   32
 

Typedefs

typedef struct content_stream content_stream_t
 
typedef struct content_information_ctx content_information_ctx_t
 

Functions

static int64_t content_file_read (const char *path, void **buf, int64_t *length)
 
static void content_load_init_wrap (const struct rarch_main_wrap *args, int *argc, char **argv)
 
static bool content_load (content_ctx_info_t *info)
 
static bool load_content_into_memory (content_information_ctx_t *content_ctx, unsigned i, const char *path, void **buf, int64_t *length)
 
static bool content_file_load (struct retro_game_info *info, const struct string_list *content, content_information_ctx_t *content_ctx, char **error_string, const struct retro_subsystem_info *special, struct string_list *additional_path_allocs)
 
static const struct retro_subsystem_infocontent_file_init_subsystem (const struct retro_subsystem_info *subsystem_data, size_t subsystem_current_count, char **error_string, bool *ret)
 
static void content_file_init_set_attribs (struct string_list *content, const struct retro_subsystem_info *special, content_information_ctx_t *content_ctx, char **error_string, union string_list_elem_attr *attr)
 
static bool content_file_init (content_information_ctx_t *content_ctx, struct string_list *content, char **error_string)
 
static bool task_load_content (content_ctx_info_t *content_info, content_information_ctx_t *content_ctx, bool launched_from_menu, bool launched_from_cli, char **error_string)
 
static bool firmware_update_status (content_information_ctx_t *content_ctx)
 
bool task_push_start_dummy_core (content_ctx_info_t *content_info)
 
bool task_push_start_current_core (content_ctx_info_t *content_info)
 
bool task_push_load_new_core (const char *core_path, const char *fullpath, content_ctx_info_t *content_info, enum rarch_core_type type, retro_task_callback_t cb, void *user_data)
 
static bool task_load_content_callback (content_ctx_info_t *content_info, bool loading_from_menu, bool loading_from_cli)
 
bool task_push_load_content_with_new_core_from_companion_ui (const char *core_path, const char *fullpath, content_ctx_info_t *content_info, retro_task_callback_t cb, void *user_data)
 
bool task_push_load_content_from_cli (const char *core_path, const char *fullpath, content_ctx_info_t *content_info, enum rarch_core_type type, retro_task_callback_t cb, void *user_data)
 
bool task_push_start_builtin_core (content_ctx_info_t *content_info, enum rarch_core_type type, retro_task_callback_t cb, void *user_data)
 
bool task_push_load_content_with_current_core_from_companion_ui (const char *fullpath, content_ctx_info_t *content_info, enum rarch_core_type type, retro_task_callback_t cb, void *user_data)
 
void content_get_status (bool *contentless, bool *is_inited)
 
void content_clear_subsystem (void)
 
int content_get_subsystem ()
 
void content_set_subsystem (unsigned idx)
 
void content_add_subsystem (const char *path)
 
unsigned content_get_subsystem_rom_id (void)
 
void content_set_does_not_need_content (void)
 
void content_unset_does_not_need_content (void)
 
uint32_t content_get_crc (void)
 
char * content_get_subsystem_rom (unsigned index)
 
bool content_is_inited (void)
 
void content_deinit (void)
 
void content_set_subsystem_info ()
 
bool content_init (void)
 

Variables

static struct string_listtemporary_content = NULL
 
static bool _content_is_inited = false
 
static bool core_does_not_need_content = false
 
static uint32_t content_rom_crc = 0
 
static bool pending_subsystem_init = false
 
static int pending_subsystem_rom_num = 0
 
static int pending_subsystem_id = 0
 
static unsigned pending_subsystem_rom_id = 0
 
static char pending_subsystem_ident [255]
 
static char * pending_subsystem_roms [RARCH_MAX_SUBSYSTEM_ROMS]
 

Macro Definition Documentation

◆ MAX_ARGS

#define MAX_ARGS   32

Typedef Documentation

◆ content_information_ctx_t

◆ content_stream_t

Function Documentation

◆ content_add_subsystem()

void content_add_subsystem ( const char *  path)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_clear_subsystem()

void content_clear_subsystem ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_deinit()

void content_deinit ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_file_init()

static bool content_file_init ( content_information_ctx_t content_ctx,
struct string_list content,
char **  error_string 
)
static

content_init_file:

Initializes and loads a content file for the currently selected libretro core.

Returns : true if successful, otherwise false.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_file_init_set_attribs()

static void content_file_init_set_attribs ( struct string_list content,
const struct retro_subsystem_info special,
content_information_ctx_t content_ctx,
char **  error_string,
union string_list_elem_attr attr 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_file_init_subsystem()

static const struct retro_subsystem_info* content_file_init_subsystem ( const struct retro_subsystem_info subsystem_data,
size_t  subsystem_current_count,
char **  error_string,
bool ret 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_file_load()

static bool content_file_load ( struct retro_game_info info,
const struct string_list content,
content_information_ctx_t content_ctx,
char **  error_string,
const struct retro_subsystem_info special,
struct string_list additional_path_allocs 
)
static

content_file_load: : subsystem of content to be loaded. Can be NULL. content :

Load content file (for libretro core).

Returns : true if successful, otherwise false.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_file_read()

static int64_t content_file_read ( const char *  path,
void **  buf,
int64_t length 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_get_crc()

uint32_t content_get_crc ( void  )
Here is the caller graph for this function:

◆ content_get_status()

void content_get_status ( bool contentless,
bool is_inited 
)
Here is the caller graph for this function:

◆ content_get_subsystem()

int content_get_subsystem ( void  )
Here is the caller graph for this function:

◆ content_get_subsystem_rom()

char* content_get_subsystem_rom ( unsigned  index)
Here is the caller graph for this function:

◆ content_get_subsystem_rom_id()

unsigned content_get_subsystem_rom_id ( void  )
Here is the caller graph for this function:

◆ content_init()

bool content_init ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_is_inited()

bool content_is_inited ( void  )

◆ content_load()

static bool content_load ( content_ctx_info_t info)
static

content_load:

Loads content file and starts up RetroArch. If no content file can be loaded, will start up RetroArch as-is.

Returns: false (0) if retroarch_main_init failed, otherwise true (1).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_load_init_wrap()

static void content_load_init_wrap ( const struct rarch_main_wrap args,
int *  argc,
char **  argv 
)
static

content_load_init_wrap: : Input arguments. : Count of arguments. : Arguments.

Generates an and pair based on of type rarch_main_wrap.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_set_does_not_need_content()

void content_set_does_not_need_content ( void  )
Here is the caller graph for this function:

◆ content_set_subsystem()

void content_set_subsystem ( unsigned  idx)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_set_subsystem_info()

void content_set_subsystem_info ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ content_unset_does_not_need_content()

void content_unset_does_not_need_content ( void  )
Here is the caller graph for this function:

◆ firmware_update_status()

static bool firmware_update_status ( content_information_ctx_t content_ctx)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_content_into_memory()

static bool load_content_into_memory ( content_information_ctx_t content_ctx,
unsigned  i,
const char *  path,
void **  buf,
int64_t length 
)
static

load_content_into_memory: : buffer of the content file. : size of the content file. : size of the content file that has been read from.

Read the content file. If read into memory, also performs soft patching (see patch_content function) in case soft patching has not been blocked by the enduser.

Returns: true if successful, false on error.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ task_load_content()

static bool task_load_content ( content_ctx_info_t content_info,
content_information_ctx_t content_ctx,
bool  launched_from_menu,
bool  launched_from_cli,
char **  error_string 
)
static

task_load_content:

Loads content into currently selected core. Will also optionally push the content entry to the history playlist.

Returns: true (1) if successful, otherwise false (0).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ task_load_content_callback()

static bool task_load_content_callback ( content_ctx_info_t content_info,
bool  loading_from_menu,
bool  loading_from_cli 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ task_push_load_content_from_cli()

bool task_push_load_content_from_cli ( const char *  core_path,
const char *  fullpath,
content_ctx_info_t content_info,
enum rarch_core_type  type,
retro_task_callback_t  cb,
void user_data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ task_push_load_content_with_current_core_from_companion_ui()

bool task_push_load_content_with_current_core_from_companion_ui ( const char *  fullpath,
content_ctx_info_t content_info,
enum rarch_core_type  type,
retro_task_callback_t  cb,
void user_data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ task_push_load_content_with_new_core_from_companion_ui()

bool task_push_load_content_with_new_core_from_companion_ui ( const char *  core_path,
const char *  fullpath,
content_ctx_info_t content_info,
retro_task_callback_t  cb,
void user_data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ task_push_load_new_core()

bool task_push_load_new_core ( const char *  core_path,
const char *  fullpath,
content_ctx_info_t content_info,
enum rarch_core_type  type,
retro_task_callback_t  cb,
void user_data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ task_push_start_builtin_core()

bool task_push_start_builtin_core ( content_ctx_info_t content_info,
enum rarch_core_type  type,
retro_task_callback_t  cb,
void user_data 
)
Here is the call graph for this function:

◆ task_push_start_current_core()

bool task_push_start_current_core ( content_ctx_info_t content_info)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ task_push_start_dummy_core()

bool task_push_start_dummy_core ( content_ctx_info_t content_info)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ _content_is_inited

bool _content_is_inited = false
static

◆ content_rom_crc

uint32_t content_rom_crc = 0
static

◆ core_does_not_need_content

bool core_does_not_need_content = false
static

◆ pending_subsystem_id

int pending_subsystem_id = 0
static

◆ pending_subsystem_ident

char pending_subsystem_ident[255]
static

◆ pending_subsystem_init

bool pending_subsystem_init = false
static

◆ pending_subsystem_rom_id

unsigned pending_subsystem_rom_id = 0
static

◆ pending_subsystem_rom_num

int pending_subsystem_rom_num = 0
static

◆ pending_subsystem_roms

char* pending_subsystem_roms[RARCH_MAX_SUBSYSTEM_ROMS]
static

◆ temporary_content

struct string_list* temporary_content = NULL
static