RetroArch
content.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2010-2014 - Hans-Kristian Arntzen
3  * Copyright (C) 2011-2017 - Daniel De Matteis
4  * Copyright (C) 2016-2017 - Brad Parker
5  *
6  * RetroArch is free software: you can redistribute it and/or modify it under the terms
7  * of the GNU General Public License as published by the Free Software Found-
8  * ation, either version 3 of the License, or (at your option) any later version.
9  *
10  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  * PURPOSE. See the GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along with RetroArch.
15  * If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __RARCH_FILE_H
19 #define __RARCH_FILE_H
20 
21 #include <stdio.h>
22 #include <stdint.h>
23 #include <stddef.h>
24 #include <sys/types.h>
25 
26 #include <boolean.h>
27 #include <retro_common_api.h>
28 #include <retro_miscellaneous.h>
29 
31 
33 
34 typedef struct content_ctx_info
35 {
36  int argc; /* Argument count. */
37  char **argv; /* Argument variable list. */
38  void *args; /* Arguments passed from callee */
39  environment_get_t environ_get; /* Function passed for environment_get function */
41 
42 /* Load a RAM state from disk to memory. */
43 bool content_load_ram_file(unsigned slot);
44 
45 /* Save a RAM state from memory to disk. */
46 bool content_save_ram_file(unsigned slot);
47 
48 /* Load a state from disk to memory. */
49 bool content_load_state(const char* path, bool load_to_backup_buffer, bool autoload);
50 
51 /* Save a state from memory to disk. */
52 bool content_save_state(const char *path, bool save_to_disk, bool autosave);
53 
54 /* Copy a save state. */
55 bool content_rename_state(const char *origin, const char *dest);
56 
57 /* Undoes the last load state operation that was done */
58 bool content_undo_load_state(void);
59 
60 /* Restores the last savestate file which was overwritten */
61 bool content_undo_save_state(void);
62 
63 void content_get_status(bool *contentless,
64  bool *is_inited);
65 
67 
69 
71 
72 void content_deinit(void);
73 
74 /* Initializes and loads a content file for the currently
75  * selected libretro core. */
76 bool content_init(void);
77 
78 /* Resets the state and savefile backup buffers */
80 
81 /* Checks if the buffers are empty */
84 
85 /* Clears the pending subsystem rom buffer*/
87 
88 /* Clears the pending subsystem rom buffer*/
89 void content_clear_subsystem(void);
90 
91 /* Set the current subsystem*/
92 void content_set_subsystem(unsigned subsystem);
93 
94 /* Get the current subsystem*/
95 int content_get_subsystem(void);
96 
97 /* Add a rom to the subsystem rom buffer */
98 void content_add_subsystem(const char* path);
99 
100 /* Get the current subsystem rom id */
101 unsigned content_get_subsystem_rom_id(void);
102 
103 /* Set environment variables before a subsystem load */
104 void content_set_subsystem_info(void);
105 
106 /* Get the path to the last selected subsystem rom */
107 char* content_get_subsystem_rom(unsigned index);
108 
110 
111 #endif
void content_set_does_not_need_content(void)
Definition: task_content.c:1825
bool content_load_state(const char *path, bool load_to_backup_buffer, bool autoload)
Definition: task_save.c:1276
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
bool content_is_subsystem_pending_load(void)
GLsizei const GLchar ** path
Definition: glext.h:7901
int argc
Definition: content.h:36
bool content_load_ram_file(unsigned slot)
Definition: task_save.c:1387
char ** argv
Definition: content.h:37
char * content_get_subsystem_rom(unsigned index)
Definition: task_content.c:1840
bool content_save_ram_file(unsigned slot)
Definition: task_save.c:1481
bool content_init(void)
Definition: task_content.c:1888
void content_add_subsystem(const char *path)
Definition: task_content.c:1807
void * args
Definition: content.h:38
uint32_t content_get_crc(void)
Definition: task_content.c:1835
void content_get_status(bool *contentless, bool *is_inited)
Definition: task_content.c:1747
bool content_save_state(const char *path, bool save_to_disk, bool autosave)
Definition: task_save.c:1179
void content_deinit(void)
Definition: task_content.c:1850
unsigned content_get_subsystem_rom_id(void)
Definition: task_content.c:1820
environment_get_t environ_get
Definition: content.h:39
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
RETRO_BEGIN_DECLS struct content_ctx_info content_ctx_info_t
GLuint index
Definition: glext.h:6671
bool content_undo_load_state(void)
Definition: task_save.c:388
bool content_undo_save_buf_is_empty(void)
Definition: task_save.c:1359
bool content_undo_save_state(void)
Definition: task_save.c:735
bool content_rename_state(const char *origin, const char *dest)
Definition: task_save.c:1311
void(* environment_get_t)(int *argc, char *argv[], void *args, void *params_data)
Definition: frontend_driver.h:73
bool content_reset_savestate_backups(void)
Definition: task_save.c:1331
void content_set_subsystem(unsigned subsystem)
Definition: task_content.c:1780
int content_get_subsystem(void)
Definition: task_content.c:1774
void content_unset_does_not_need_content(void)
Definition: task_content.c:1830
Definition: content.h:34
unsigned int uint32_t
Definition: stdint.h:126
void content_clear_subsystem(void)
Definition: task_content.c:1756
bool content_undo_load_buf_is_empty(void)
Definition: task_save.c:1354
void content_set_subsystem_info(void)
Definition: task_content.c:1877