Add documentation to retroarch.c

This commit is contained in:
twinaphex 2015-01-10 23:23:01 +01:00
parent 73d4622b54
commit 2c0ad226cc
2 changed files with 92 additions and 9 deletions

View File

@ -367,7 +367,11 @@ static void init_recording(void)
}
}
/**
* rarch_render_cached_frame:
*
* Renders the current video frame.
**/
void rarch_render_cached_frame(void)
{
void *recording = driver.recording_data;
@ -1588,6 +1592,12 @@ static void main_state(unsigned cmd)
RARCH_LOG("%s\n", msg);
}
/**
* rarch_disk_control_append_image:
* @path : Path to disk image.
*
* Appends disk image to disk image list.
**/
void rarch_disk_control_append_image(const char *path)
{
char msg[PATH_MAX_LENGTH];
@ -1629,6 +1639,15 @@ void rarch_disk_control_append_image(const char *path)
rarch_disk_control_set_eject(false, false);
}
/**
* rarch_disk_control_set_eject:
* @new_state : Eject or close the virtual drive tray.
* false (0) : Close
* true (1) : Eject
* @print_log : Show message onscreen.
*
* Ejects/closes of the virtual drive tray.
**/
void rarch_disk_control_set_eject(bool new_state, bool print_log)
{
char msg[PATH_MAX_LENGTH];
@ -1667,7 +1686,13 @@ void rarch_disk_control_set_eject(bool new_state, bool print_log)
}
}
void rarch_disk_control_set_index(unsigned next_idx)
/**
* rarch_disk_control_set_index:
* @index : Index of disk to set as current.
*
* Sets current disk to @index.
**/
void rarch_disk_control_set_index(unsigned index)
{
char msg[PATH_MAX_LENGTH];
unsigned num_disks;
@ -1682,19 +1707,19 @@ void rarch_disk_control_set_index(unsigned next_idx)
num_disks = control->get_num_images();
if (control->set_image_index(next_idx))
if (control->set_image_index(index))
{
if (next_idx < num_disks)
if (index < num_disks)
snprintf(msg, sizeof(msg), "Setting disk %u of %u in tray.",
next_idx + 1, num_disks);
index + 1, num_disks);
else
strlcpy(msg, "Removed disk from tray.", sizeof(msg));
}
else
{
if (next_idx < num_disks)
if (index < num_disks)
snprintf(msg, sizeof(msg), "Failed to set disk %u of %u.",
next_idx + 1, num_disks);
index + 1, num_disks);
else
strlcpy(msg, "Failed to remove disk from tray.", sizeof(msg));
error = true;
@ -2954,12 +2979,25 @@ int rarch_defer_core(core_info_list_t *core_info, const char *dir,
return 0;
}
/* Quite intrusive and error prone.
/**
* rarch_replace_config:
* @path : Path to config file to replace
* current config file with.
*
* Replaces currently loaded configuration file with
* another one. Will load a dummy core to flush state
* properly.
*
* Quite intrusive and error prone.
* Likely to have lots of small bugs.
* Cleanly exit the main loop to ensure that all the tiny details
* get set properly.
*
* This should mitigate most of the smaller bugs. */
* This should mitigate most of the smaller bugs.
*
* Returns: true (1) if successful, false (0) if @path was the
* same as the current config file.
**/
bool rarch_replace_config(const char *path)
{

View File

@ -51,17 +51,62 @@ void rarch_main_init_wrap(const struct rarch_main_wrap *args,
void rarch_main_deinit(void);
/**
* rarch_render_cached_frame:
*
* Renders the current video frame.
**/
void rarch_render_cached_frame(void);
/**
* rarch_disk_control_set_eject:
* @new_state : Eject or close the virtual drive tray.
* false (0) : Close
* true (1) : Eject
* @print_log : Show message onscreen.
*
* Ejects/closes of the virtual drive tray.
**/
void rarch_disk_control_set_eject(bool state, bool log);
/**
* rarch_disk_control_set_index:
* @index : Index of disk to set as current.
*
* Sets current disk to @index.
**/
void rarch_disk_control_set_index(unsigned index);
/**
* rarch_disk_control_append_image:
* @path : Path to disk image.
*
* Appends disk image to disk image list.
**/
void rarch_disk_control_append_image(const char *path);
void rarch_recording_dump_frame(const void *data, unsigned width,
unsigned height, size_t pitch);
/**
* rarch_replace_config:
* @path : Path to config file to replace
* current config file with.
*
* Replaces currently loaded configuration file with
* another one. Will load a dummy core to flush state
* properly.
*
* Quite intrusive and error prone.
* Likely to have lots of small bugs.
* Cleanly exit the main loop to ensure that all the tiny details
* get set properly.
*
* This should mitigate most of the smaller bugs.
*
* Returns: true (1) if successful, false (0) if @path was the
* same as the current config file.
**/
bool rarch_replace_config(const char *path);
void rarch_playlist_load_content(content_playlist_t *playlist,