annotate libretro.h @ 2545:c076a96f1668

Get CD titles sort of working in libretro target
author Michael Pavone <pavone@retrodev.com>
date Thu, 02 Jan 2025 23:02:52 -0800
parents 6c54bb5fe3b3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1 /*!
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2 * libretro.h is a simple API that allows for the creation of games and emulators.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4 * @file libretro.h
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5 * @version 1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6 * @author libretro
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7 * @copyright Copyright (C) 2010-2024 The RetroArch team
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
8 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
9 * @paragraph LICENSE
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
10 * The following license statement only applies to this libretro API header (libretro.h).
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
11 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
12 * Copyright (C) 2010-2024 The RetroArch team
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
13 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
14 * Permission is hereby granted, free of charge,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
15 * to any person obtaining a copy of this software and associated documentation files (the "Software"),
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
16 * to deal in the Software without restriction, including without limitation the rights to
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
17 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
18 * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
19 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
20 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
21 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
23 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
25 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
26 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
27 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
28 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
29
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
30 #ifndef LIBRETRO_H__
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
31 #define LIBRETRO_H__
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
32
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
33 #include <stdint.h>
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
34 #include <stddef.h>
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
35 #include <limits.h>
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
36
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
37 #ifdef __cplusplus
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
38 extern "C" {
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
39 #endif
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
40
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
41 #ifndef __cplusplus
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
42 #if defined(_MSC_VER) && _MSC_VER < 1800 && !defined(SN_TARGET_PS3)
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
43 /* Hack applied for MSVC when compiling in C89 mode
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
44 * as it isn't C99-compliant. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
45 #define bool unsigned char
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
46 #define true 1
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
47 #define false 0
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
48 #else
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
49 #include <stdbool.h>
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
50 #endif
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
51 #endif
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
52
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
53 #ifndef RETRO_CALLCONV
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
54 # if defined(__GNUC__) && defined(__i386__) && !defined(__x86_64__)
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
55 # define RETRO_CALLCONV __attribute__((cdecl))
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
56 # elif defined(_MSC_VER) && defined(_M_X86) && !defined(_M_X64)
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
57 # define RETRO_CALLCONV __cdecl
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
58 # else
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
59 # define RETRO_CALLCONV /* all other platforms only have one calling convention each */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
60 # endif
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
61 #endif
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
62
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
63 #ifndef RETRO_API
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
64 # if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
65 # ifdef RETRO_IMPORT_SYMBOLS
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
66 # ifdef __GNUC__
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
67 # define RETRO_API RETRO_CALLCONV __attribute__((__dllimport__))
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
68 # else
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
69 # define RETRO_API RETRO_CALLCONV __declspec(dllimport)
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
70 # endif
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
71 # else
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
72 # ifdef __GNUC__
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
73 # define RETRO_API RETRO_CALLCONV __attribute__((__dllexport__))
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
74 # else
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
75 # define RETRO_API RETRO_CALLCONV __declspec(dllexport)
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
76 # endif
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
77 # endif
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
78 # else
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
79 # if defined(__GNUC__) && __GNUC__ >= 4
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
80 # define RETRO_API RETRO_CALLCONV __attribute__((__visibility__("default")))
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
81 # else
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
82 # define RETRO_API RETRO_CALLCONV
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
83 # endif
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
84 # endif
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
85 #endif
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
86
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
87 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
88 * The major version of the libretro API and ABI.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
89 * Cores may support multiple versions,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
90 * or they may reject cores with unsupported versions.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
91 * It is only incremented for incompatible API/ABI changes;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
92 * this generally implies a function was removed or changed,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
93 * or that a \c struct had fields removed or changed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
94 * @note A design goal of libretro is to avoid having to increase this value at all costs.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
95 * This is why there are APIs that are "extended" or "V2".
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
96 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
97 #define RETRO_API_VERSION 1
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
98
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
99 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
100 * @defgroup RETRO_DEVICE Input Devices
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
101 * @brief Libretro's fundamental device abstractions.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
102 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
103 * Libretro's input system consists of abstractions over standard device types,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
104 * such as a joypad (with or without analog), mouse, keyboard, light gun, or an abstract pointer.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
105 * Instead of managing input devices themselves,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
106 * cores need only to map their own concept of a controller to libretro's abstractions.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
107 * This makes it possible for frontends to map the abstract types to a real input device
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
108 * without having to worry about the correct use of arbitrary (real) controller layouts.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
109 * @{
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
110 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
111
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
112 #define RETRO_DEVICE_TYPE_SHIFT 8
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
113 #define RETRO_DEVICE_MASK ((1 << RETRO_DEVICE_TYPE_SHIFT) - 1)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
114
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
115 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
116 * Defines an ID for a subclass of a known device type.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
117 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
118 * To define a subclass ID, use this macro like so:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
119 * @code{c}
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
120 * #define RETRO_DEVICE_SUPER_SCOPE RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_LIGHTGUN, 1)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
121 * #define RETRO_DEVICE_JUSTIFIER RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_LIGHTGUN, 2)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
122 * @endcode
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
123 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
124 * Correct use of this macro allows a frontend to select a suitable physical device
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
125 * to map to the emulated device.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
126 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
127 * @note Cores must use the base ID when polling for input,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
128 * and frontends must only accept the base ID for this purpose.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
129 * Polling for input using subclass IDs is reserved for future definition.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
130 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
131 * @param base One of the \ref RETRO_DEVICE "base device types".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
132 * @param id A unique ID, with respect to \c base.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
133 * Must be a non-negative integer.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
134 * @return A unique subclass ID.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
135 * @see retro_controller_description
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
136 * @see retro_set_controller_port_device
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
137 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
138 #define RETRO_DEVICE_SUBCLASS(base, id) (((id + 1) << RETRO_DEVICE_TYPE_SHIFT) | base)
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
139
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
140 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
141 * @defgroup RETRO_DEVICE Input Device Classes
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
142 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
143 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
144
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
145 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
146 * Indicates no input.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
147 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
148 * When provided as the \c device argument to \c retro_input_state_t,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
149 * all other arguments are ignored and zero is returned.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
150 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
151 * @see retro_input_state_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
152 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
153 #define RETRO_DEVICE_NONE 0
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
154
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
155 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
156 * An abstraction around a game controller, known as a "RetroPad".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
157 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
158 * The RetroPad is modelled after a SNES controller,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
159 * but with additional L2/R2/L3/R3 buttons
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
160 * (similar to a PlayStation controller).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
161 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
162 * When provided as the \c device argument to \c retro_input_state_t,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
163 * the \c id argument denotes the button (including D-Pad directions) to query.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
164 * The result of said query will be 1 if the button is down, 0 if not.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
165 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
166 * There is one exception; if \c RETRO_DEVICE_ID_JOYPAD_MASK is queried
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
167 * (and the frontend supports this query),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
168 * the result will be a bitmask of all pressed buttons.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
169 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
170 * @see retro_input_state_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
171 * @see RETRO_DEVICE_ANALOG
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
172 * @see RETRO_DEVICE_ID_JOYPAD
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
173 * @see RETRO_DEVICE_ID_JOYPAD_MASK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
174 * @see RETRO_ENVIRONMENT_GET_INPUT_BITMASKS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
175 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
176 #define RETRO_DEVICE_JOYPAD 1
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
177
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
178 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
179 * An abstraction around a mouse, similar to the SNES Mouse but with more buttons.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
180 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
181 * When provided as the \c device argument to \c retro_input_state_t,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
182 * the \c id argument denotes the button or axis to query.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
183 * For buttons, the result of said query
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
184 * will be 1 if the button is down or 0 if not.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
185 * For mouse wheel axes, the result
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
186 * will be 1 if the wheel was rotated in that direction and 0 if not.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
187 * For the mouse pointer axis, the result will be thee mouse's movement
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
188 * relative to the last poll.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
189 * The core is responsible for tracking the mouse's position,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
190 * and the frontend is responsible for preventing interference
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
191 * by the real hardware pointer (if applicable).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
192 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
193 * @note This should only be used for cores that emulate mouse input,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
194 * such as for home computers
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
195 * or consoles with mouse attachments.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
196 * Cores that emulate light guns should use \c RETRO_DEVICE_LIGHTGUN,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
197 * and cores that emulate touch screens should use \c RETRO_DEVICE_POINTER.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
198 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
199 * @see RETRO_DEVICE_POINTER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
200 * @see RETRO_DEVICE_LIGHTGUN
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
201 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
202 #define RETRO_DEVICE_MOUSE 2
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
203
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
204 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
205 * An abstraction around a keyboard.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
206 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
207 * When provided as the \c device argument to \c retro_input_state_t,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
208 * the \c id argument denotes the key to poll.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
209 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
210 * @note This should only be used for cores that emulate keyboard input,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
211 * such as for home computers
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
212 * or consoles with keyboard attachments.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
213 * Cores that emulate gamepads should use \c RETRO_DEVICE_JOYPAD or \c RETRO_DEVICE_ANALOG,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
214 * and leave keyboard compatibility to the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
215 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
216 * @see RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
217 * @see retro_key
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
218 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
219 #define RETRO_DEVICE_KEYBOARD 3
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
220
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
221 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
222 * An abstraction around a light gun, similar to the PlayStation's Guncon.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
223 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
224 * When provided as the \c device argument to \c retro_input_state_t,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
225 * the \c id argument denotes one of several possible inputs.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
226 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
227 * The gun's coordinates are reported in screen space (similar to the pointer)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
228 * in the range of [-0x8000, 0x7fff].
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
229 * Zero is the center of the game's screen
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
230 * and -0x8000 represents out-of-bounds.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
231 * The trigger and various auxiliary buttons are also reported.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
232 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
233 * @note A forced off-screen shot can be requested for auto-reloading
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
234 * function in some games.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
235 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
236 * @see RETRO_DEVICE_POINTER
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
237 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
238 #define RETRO_DEVICE_LIGHTGUN 4
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
239
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
240 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
241 * An extension of the RetroPad that supports analog input.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
242 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
243 * The analog RetroPad provides two virtual analog sticks (similar to DualShock controllers)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
244 * and allows any button to be treated as analog (similar to Xbox shoulder triggers).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
245 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
246 * When provided as the \c device argument to \c retro_input_state_t,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
247 * the \c id argument denotes an analog axis or an analog button.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
248 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
249 * Analog axes are reported in the range of [-0x8000, 0x7fff],
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
250 * with the X axis being positive towards the right
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
251 * and the Y axis being positive towards the bottom.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
252 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
253 * Analog buttons are reported in the range of [0, 0x7fff],
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
254 * where 0 is unpressed and 0x7fff is fully pressed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
255 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
256 * @note Cores should only use this type if they need analog input.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
257 * Otherwise, \c RETRO_DEVICE_JOYPAD should be used.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
258 * @see RETRO_DEVICE_JOYPAD
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
259 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
260 #define RETRO_DEVICE_ANALOG 5
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
261
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
262 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
263 * Input Device: Pointer.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
264 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
265 * Abstracts the concept of a pointing mechanism, e.g. touch.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
266 * This allows libretro to query in absolute coordinates where on the
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
267 * screen a mouse (or something similar) is being placed.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
268 * For a touch centric device, coordinates reported are the coordinates
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
269 * of the press.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
270 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
271 * Coordinates in X and Y are reported as:
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
272 * [-0x7fff, 0x7fff]: -0x7fff corresponds to the far left/top of the screen,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
273 * and 0x7fff corresponds to the far right/bottom of the screen.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
274 * The "screen" is here defined as area that is passed to the frontend and
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
275 * later displayed on the monitor. If the pointer is outside this screen,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
276 * such as in the black surrounding areas when actual display is larger,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
277 * edge position is reported. An explicit edge detection is also provided,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
278 * that will return 1 if the pointer is near the screen edge or actually outside it.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
279 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
280 * The frontend is free to scale/resize this screen as it sees fit, however,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
281 * (X, Y) = (-0x7fff, -0x7fff) will correspond to the top-left pixel of the
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
282 * game image, etc.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
283 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
284 * To check if the pointer coordinates are valid (e.g. a touch display
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
285 * actually being touched), \c RETRO_DEVICE_ID_POINTER_PRESSED returns 1 or 0.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
286 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
287 * If using a mouse on a desktop, \c RETRO_DEVICE_ID_POINTER_PRESSED will
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
288 * usually correspond to the left mouse button, but this is a frontend decision.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
289 * \c RETRO_DEVICE_ID_POINTER_PRESSED will only return 1 if the pointer is
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
290 * inside the game screen.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
291 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
292 * For multi-touch, the index variable can be used to successively query
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
293 * more presses.
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
294 * If index = 0 returns true for \c _PRESSED, coordinates can be extracted
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
295 * with \c _X, \c _Y for index = 0. One can then query \c _PRESSED, \c _X, \c _Y with
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
296 * index = 1, and so on.
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
297 * Eventually \c _PRESSED will return false for an index. No further presses
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
298 * are registered at this point.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
299 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
300 * @see RETRO_DEVICE_MOUSE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
301 * @see RETRO_DEVICE_ID_POINTER_X
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
302 * @see RETRO_DEVICE_ID_POINTER_Y
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
303 * @see RETRO_DEVICE_ID_POINTER_PRESSED
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
304 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
305 #define RETRO_DEVICE_POINTER 6
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
306
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
307 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
308
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
309 /** @defgroup RETRO_DEVICE_ID_JOYPAD RetroPad Input
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
310 * @brief Digital buttons for the RetroPad.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
311 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
312 * Button placement is comparable to that of a SNES controller,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
313 * combined with the shoulder buttons of a PlayStation controller.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
314 * These values can also be used for the \c id field of \c RETRO_DEVICE_INDEX_ANALOG_BUTTON
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
315 * to represent analog buttons (usually shoulder triggers).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
316 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
317 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
318
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
319 /** The equivalent of the SNES controller's south face button. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
320 #define RETRO_DEVICE_ID_JOYPAD_B 0
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
321
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
322 /** The equivalent of the SNES controller's west face button. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
323 #define RETRO_DEVICE_ID_JOYPAD_Y 1
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
324
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
325 /** The equivalent of the SNES controller's left-center button. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
326 #define RETRO_DEVICE_ID_JOYPAD_SELECT 2
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
327
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
328 /** The equivalent of the SNES controller's right-center button. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
329 #define RETRO_DEVICE_ID_JOYPAD_START 3
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
330
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
331 /** Up on the RetroPad's D-pad. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
332 #define RETRO_DEVICE_ID_JOYPAD_UP 4
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
333
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
334 /** Down on the RetroPad's D-pad. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
335 #define RETRO_DEVICE_ID_JOYPAD_DOWN 5
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
336
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
337 /** Left on the RetroPad's D-pad. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
338 #define RETRO_DEVICE_ID_JOYPAD_LEFT 6
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
339
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
340 /** Right on the RetroPad's D-pad. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
341 #define RETRO_DEVICE_ID_JOYPAD_RIGHT 7
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
342
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
343 /** The equivalent of the SNES controller's east face button. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
344 #define RETRO_DEVICE_ID_JOYPAD_A 8
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
345
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
346 /** The equivalent of the SNES controller's north face button. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
347 #define RETRO_DEVICE_ID_JOYPAD_X 9
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
348
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
349 /** The equivalent of the SNES controller's left shoulder button. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
350 #define RETRO_DEVICE_ID_JOYPAD_L 10
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
351
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
352 /** The equivalent of the SNES controller's right shoulder button. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
353 #define RETRO_DEVICE_ID_JOYPAD_R 11
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
354
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
355 /** The equivalent of the PlayStation's rear left shoulder button. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
356 #define RETRO_DEVICE_ID_JOYPAD_L2 12
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
357
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
358 /** The equivalent of the PlayStation's rear right shoulder button. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
359 #define RETRO_DEVICE_ID_JOYPAD_R2 13
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
360
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
361 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
362 * The equivalent of the PlayStation's left analog stick button,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
363 * although the actual button need not be in this position.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
364 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
365 #define RETRO_DEVICE_ID_JOYPAD_L3 14
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
366
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
367 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
368 * The equivalent of the PlayStation's right analog stick button,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
369 * although the actual button need not be in this position.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
370 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
371 #define RETRO_DEVICE_ID_JOYPAD_R3 15
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
372
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
373 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
374 * Represents a bitmask that describes the state of all \c RETRO_DEVICE_ID_JOYPAD button constants,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
375 * rather than the state of a single button.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
376 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
377 * @see RETRO_ENVIRONMENT_GET_INPUT_BITMASKS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
378 * @see RETRO_DEVICE_JOYPAD
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
379 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
380 #define RETRO_DEVICE_ID_JOYPAD_MASK 256
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
381
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
382 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
383
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
384 /** @defgroup RETRO_DEVICE_ID_ANALOG Analog RetroPad Input
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
385 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
386 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
387
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
388 /* Index / Id values for ANALOG device. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
389 #define RETRO_DEVICE_INDEX_ANALOG_LEFT 0
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
390 #define RETRO_DEVICE_INDEX_ANALOG_RIGHT 1
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
391 #define RETRO_DEVICE_INDEX_ANALOG_BUTTON 2
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
392 #define RETRO_DEVICE_ID_ANALOG_X 0
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
393 #define RETRO_DEVICE_ID_ANALOG_Y 1
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
394
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
395 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
396
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
397 /* Id values for MOUSE. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
398 #define RETRO_DEVICE_ID_MOUSE_X 0
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
399 #define RETRO_DEVICE_ID_MOUSE_Y 1
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
400 #define RETRO_DEVICE_ID_MOUSE_LEFT 2
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
401 #define RETRO_DEVICE_ID_MOUSE_RIGHT 3
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
402 #define RETRO_DEVICE_ID_MOUSE_WHEELUP 4
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
403 #define RETRO_DEVICE_ID_MOUSE_WHEELDOWN 5
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
404 #define RETRO_DEVICE_ID_MOUSE_MIDDLE 6
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
405 #define RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELUP 7
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
406 #define RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELDOWN 8
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
407 #define RETRO_DEVICE_ID_MOUSE_BUTTON_4 9
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
408 #define RETRO_DEVICE_ID_MOUSE_BUTTON_5 10
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
409
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
410 /* Id values for LIGHTGUN. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
411 #define RETRO_DEVICE_ID_LIGHTGUN_SCREEN_X 13 /*Absolute Position*/
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
412 #define RETRO_DEVICE_ID_LIGHTGUN_SCREEN_Y 14 /*Absolute Position*/
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
413 /** Indicates if lightgun points off the screen or near the edge */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
414 #define RETRO_DEVICE_ID_LIGHTGUN_IS_OFFSCREEN 15 /*Status Check*/
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
415 #define RETRO_DEVICE_ID_LIGHTGUN_TRIGGER 2
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
416 #define RETRO_DEVICE_ID_LIGHTGUN_RELOAD 16 /*Forced off-screen shot*/
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
417 #define RETRO_DEVICE_ID_LIGHTGUN_AUX_A 3
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
418 #define RETRO_DEVICE_ID_LIGHTGUN_AUX_B 4
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
419 #define RETRO_DEVICE_ID_LIGHTGUN_START 6
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
420 #define RETRO_DEVICE_ID_LIGHTGUN_SELECT 7
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
421 #define RETRO_DEVICE_ID_LIGHTGUN_AUX_C 8
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
422 #define RETRO_DEVICE_ID_LIGHTGUN_DPAD_UP 9
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
423 #define RETRO_DEVICE_ID_LIGHTGUN_DPAD_DOWN 10
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
424 #define RETRO_DEVICE_ID_LIGHTGUN_DPAD_LEFT 11
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
425 #define RETRO_DEVICE_ID_LIGHTGUN_DPAD_RIGHT 12
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
426 /* deprecated */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
427 #define RETRO_DEVICE_ID_LIGHTGUN_X 0 /*Relative Position*/
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
428 #define RETRO_DEVICE_ID_LIGHTGUN_Y 1 /*Relative Position*/
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
429 #define RETRO_DEVICE_ID_LIGHTGUN_CURSOR 3 /*Use Aux:A instead*/
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
430 #define RETRO_DEVICE_ID_LIGHTGUN_TURBO 4 /*Use Aux:B instead*/
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
431 #define RETRO_DEVICE_ID_LIGHTGUN_PAUSE 5 /*Use Start instead*/
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
432
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
433 /* Id values for POINTER. */
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
434 #define RETRO_DEVICE_ID_POINTER_X 0
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
435 #define RETRO_DEVICE_ID_POINTER_Y 1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
436 #define RETRO_DEVICE_ID_POINTER_PRESSED 2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
437 #define RETRO_DEVICE_ID_POINTER_COUNT 3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
438 /** Indicates if pointer is off the screen or near the edge */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
439 #define RETRO_DEVICE_ID_POINTER_IS_OFFSCREEN 15
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
440 /** @} */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
441
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
442 /* Returned from retro_get_region(). */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
443 #define RETRO_REGION_NTSC 0
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
444 #define RETRO_REGION_PAL 1
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
445
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
446 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
447 * Identifiers for supported languages.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
448 * @see RETRO_ENVIRONMENT_GET_LANGUAGE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
449 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
450 enum retro_language
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
451 {
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
452 RETRO_LANGUAGE_ENGLISH = 0,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
453 RETRO_LANGUAGE_JAPANESE = 1,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
454 RETRO_LANGUAGE_FRENCH = 2,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
455 RETRO_LANGUAGE_SPANISH = 3,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
456 RETRO_LANGUAGE_GERMAN = 4,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
457 RETRO_LANGUAGE_ITALIAN = 5,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
458 RETRO_LANGUAGE_DUTCH = 6,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
459 RETRO_LANGUAGE_PORTUGUESE_BRAZIL = 7,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
460 RETRO_LANGUAGE_PORTUGUESE_PORTUGAL = 8,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
461 RETRO_LANGUAGE_RUSSIAN = 9,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
462 RETRO_LANGUAGE_KOREAN = 10,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
463 RETRO_LANGUAGE_CHINESE_TRADITIONAL = 11,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
464 RETRO_LANGUAGE_CHINESE_SIMPLIFIED = 12,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
465 RETRO_LANGUAGE_ESPERANTO = 13,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
466 RETRO_LANGUAGE_POLISH = 14,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
467 RETRO_LANGUAGE_VIETNAMESE = 15,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
468 RETRO_LANGUAGE_ARABIC = 16,
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
469 RETRO_LANGUAGE_GREEK = 17,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
470 RETRO_LANGUAGE_TURKISH = 18,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
471 RETRO_LANGUAGE_SLOVAK = 19,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
472 RETRO_LANGUAGE_PERSIAN = 20,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
473 RETRO_LANGUAGE_HEBREW = 21,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
474 RETRO_LANGUAGE_ASTURIAN = 22,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
475 RETRO_LANGUAGE_FINNISH = 23,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
476 RETRO_LANGUAGE_INDONESIAN = 24,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
477 RETRO_LANGUAGE_SWEDISH = 25,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
478 RETRO_LANGUAGE_UKRAINIAN = 26,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
479 RETRO_LANGUAGE_CZECH = 27,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
480 RETRO_LANGUAGE_CATALAN_VALENCIA = 28,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
481 RETRO_LANGUAGE_CATALAN = 29,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
482 RETRO_LANGUAGE_BRITISH_ENGLISH = 30,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
483 RETRO_LANGUAGE_HUNGARIAN = 31,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
484 RETRO_LANGUAGE_BELARUSIAN = 32,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
485 RETRO_LANGUAGE_GALICIAN = 33,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
486 RETRO_LANGUAGE_NORWEGIAN = 34,
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
487 RETRO_LANGUAGE_LAST,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
488
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
489 /** Defined to ensure that <tt>sizeof(retro_language) == sizeof(int)</tt>. Do not use. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
490 RETRO_LANGUAGE_DUMMY = INT_MAX
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
491 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
492
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
493 /** @defgroup RETRO_MEMORY Memory Types
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
494 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
495 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
496
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
497 /* Passed to retro_get_memory_data/size().
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
498 * If the memory type doesn't apply to the
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
499 * implementation NULL/0 can be returned.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
500 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
501 #define RETRO_MEMORY_MASK 0xff
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
502
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
503 /* Regular save RAM. This RAM is usually found on a game cartridge,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
504 * backed up by a battery.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
505 * If save game data is too complex for a single memory buffer,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
506 * the SAVE_DIRECTORY (preferably) or SYSTEM_DIRECTORY environment
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
507 * callback can be used. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
508 #define RETRO_MEMORY_SAVE_RAM 0
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
509
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
510 /* Some games have a built-in clock to keep track of time.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
511 * This memory is usually just a couple of bytes to keep track of time.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
512 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
513 #define RETRO_MEMORY_RTC 1
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
514
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
515 /* System ram lets a frontend peek into a game systems main RAM. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
516 #define RETRO_MEMORY_SYSTEM_RAM 2
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
517
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
518 /* Video ram lets a frontend peek into a game systems video RAM (VRAM). */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
519 #define RETRO_MEMORY_VIDEO_RAM 3
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
520
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
521 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
522
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
523 /* Keysyms used for ID in input state callback when polling RETRO_KEYBOARD. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
524 enum retro_key
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
525 {
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
526 RETROK_UNKNOWN = 0,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
527 RETROK_FIRST = 0,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
528 RETROK_BACKSPACE = 8,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
529 RETROK_TAB = 9,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
530 RETROK_CLEAR = 12,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
531 RETROK_RETURN = 13,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
532 RETROK_PAUSE = 19,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
533 RETROK_ESCAPE = 27,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
534 RETROK_SPACE = 32,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
535 RETROK_EXCLAIM = 33,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
536 RETROK_QUOTEDBL = 34,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
537 RETROK_HASH = 35,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
538 RETROK_DOLLAR = 36,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
539 RETROK_AMPERSAND = 38,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
540 RETROK_QUOTE = 39,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
541 RETROK_LEFTPAREN = 40,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
542 RETROK_RIGHTPAREN = 41,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
543 RETROK_ASTERISK = 42,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
544 RETROK_PLUS = 43,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
545 RETROK_COMMA = 44,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
546 RETROK_MINUS = 45,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
547 RETROK_PERIOD = 46,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
548 RETROK_SLASH = 47,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
549 RETROK_0 = 48,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
550 RETROK_1 = 49,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
551 RETROK_2 = 50,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
552 RETROK_3 = 51,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
553 RETROK_4 = 52,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
554 RETROK_5 = 53,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
555 RETROK_6 = 54,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
556 RETROK_7 = 55,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
557 RETROK_8 = 56,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
558 RETROK_9 = 57,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
559 RETROK_COLON = 58,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
560 RETROK_SEMICOLON = 59,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
561 RETROK_LESS = 60,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
562 RETROK_EQUALS = 61,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
563 RETROK_GREATER = 62,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
564 RETROK_QUESTION = 63,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
565 RETROK_AT = 64,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
566 RETROK_LEFTBRACKET = 91,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
567 RETROK_BACKSLASH = 92,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
568 RETROK_RIGHTBRACKET = 93,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
569 RETROK_CARET = 94,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
570 RETROK_UNDERSCORE = 95,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
571 RETROK_BACKQUOTE = 96,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
572 RETROK_a = 97,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
573 RETROK_b = 98,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
574 RETROK_c = 99,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
575 RETROK_d = 100,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
576 RETROK_e = 101,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
577 RETROK_f = 102,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
578 RETROK_g = 103,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
579 RETROK_h = 104,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
580 RETROK_i = 105,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
581 RETROK_j = 106,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
582 RETROK_k = 107,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
583 RETROK_l = 108,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
584 RETROK_m = 109,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
585 RETROK_n = 110,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
586 RETROK_o = 111,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
587 RETROK_p = 112,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
588 RETROK_q = 113,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
589 RETROK_r = 114,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
590 RETROK_s = 115,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
591 RETROK_t = 116,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
592 RETROK_u = 117,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
593 RETROK_v = 118,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
594 RETROK_w = 119,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
595 RETROK_x = 120,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
596 RETROK_y = 121,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
597 RETROK_z = 122,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
598 RETROK_LEFTBRACE = 123,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
599 RETROK_BAR = 124,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
600 RETROK_RIGHTBRACE = 125,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
601 RETROK_TILDE = 126,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
602 RETROK_DELETE = 127,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
603
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
604 RETROK_KP0 = 256,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
605 RETROK_KP1 = 257,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
606 RETROK_KP2 = 258,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
607 RETROK_KP3 = 259,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
608 RETROK_KP4 = 260,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
609 RETROK_KP5 = 261,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
610 RETROK_KP6 = 262,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
611 RETROK_KP7 = 263,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
612 RETROK_KP8 = 264,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
613 RETROK_KP9 = 265,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
614 RETROK_KP_PERIOD = 266,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
615 RETROK_KP_DIVIDE = 267,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
616 RETROK_KP_MULTIPLY = 268,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
617 RETROK_KP_MINUS = 269,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
618 RETROK_KP_PLUS = 270,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
619 RETROK_KP_ENTER = 271,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
620 RETROK_KP_EQUALS = 272,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
621
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
622 RETROK_UP = 273,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
623 RETROK_DOWN = 274,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
624 RETROK_RIGHT = 275,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
625 RETROK_LEFT = 276,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
626 RETROK_INSERT = 277,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
627 RETROK_HOME = 278,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
628 RETROK_END = 279,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
629 RETROK_PAGEUP = 280,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
630 RETROK_PAGEDOWN = 281,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
631
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
632 RETROK_F1 = 282,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
633 RETROK_F2 = 283,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
634 RETROK_F3 = 284,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
635 RETROK_F4 = 285,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
636 RETROK_F5 = 286,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
637 RETROK_F6 = 287,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
638 RETROK_F7 = 288,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
639 RETROK_F8 = 289,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
640 RETROK_F9 = 290,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
641 RETROK_F10 = 291,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
642 RETROK_F11 = 292,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
643 RETROK_F12 = 293,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
644 RETROK_F13 = 294,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
645 RETROK_F14 = 295,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
646 RETROK_F15 = 296,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
647
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
648 RETROK_NUMLOCK = 300,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
649 RETROK_CAPSLOCK = 301,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
650 RETROK_SCROLLOCK = 302,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
651 RETROK_RSHIFT = 303,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
652 RETROK_LSHIFT = 304,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
653 RETROK_RCTRL = 305,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
654 RETROK_LCTRL = 306,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
655 RETROK_RALT = 307,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
656 RETROK_LALT = 308,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
657 RETROK_RMETA = 309,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
658 RETROK_LMETA = 310,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
659 RETROK_LSUPER = 311,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
660 RETROK_RSUPER = 312,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
661 RETROK_MODE = 313,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
662 RETROK_COMPOSE = 314,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
663
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
664 RETROK_HELP = 315,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
665 RETROK_PRINT = 316,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
666 RETROK_SYSREQ = 317,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
667 RETROK_BREAK = 318,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
668 RETROK_MENU = 319,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
669 RETROK_POWER = 320,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
670 RETROK_EURO = 321,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
671 RETROK_UNDO = 322,
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
672 RETROK_OEM_102 = 323,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
673
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
674 RETROK_BROWSER_BACK = 324,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
675 RETROK_BROWSER_FORWARD = 325,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
676 RETROK_BROWSER_REFRESH = 326,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
677 RETROK_BROWSER_STOP = 327,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
678 RETROK_BROWSER_SEARCH = 328,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
679 RETROK_BROWSER_FAVORITES = 329,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
680 RETROK_BROWSER_HOME = 330,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
681 RETROK_VOLUME_MUTE = 331,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
682 RETROK_VOLUME_DOWN = 332,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
683 RETROK_VOLUME_UP = 333,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
684 RETROK_MEDIA_NEXT = 334,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
685 RETROK_MEDIA_PREV = 335,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
686 RETROK_MEDIA_STOP = 336,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
687 RETROK_MEDIA_PLAY_PAUSE = 337,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
688 RETROK_LAUNCH_MAIL = 338,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
689 RETROK_LAUNCH_MEDIA = 339,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
690 RETROK_LAUNCH_APP1 = 340,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
691 RETROK_LAUNCH_APP2 = 341,
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
692
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
693 RETROK_LAST,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
694
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
695 RETROK_DUMMY = INT_MAX /* Ensure sizeof(enum) == sizeof(int) */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
696 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
697
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
698 enum retro_mod
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
699 {
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
700 RETROKMOD_NONE = 0x0000,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
701
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
702 RETROKMOD_SHIFT = 0x01,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
703 RETROKMOD_CTRL = 0x02,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
704 RETROKMOD_ALT = 0x04,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
705 RETROKMOD_META = 0x08,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
706
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
707 RETROKMOD_NUMLOCK = 0x10,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
708 RETROKMOD_CAPSLOCK = 0x20,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
709 RETROKMOD_SCROLLOCK = 0x40,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
710
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
711 RETROKMOD_DUMMY = INT_MAX /* Ensure sizeof(enum) == sizeof(int) */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
712 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
713
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
714 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
715 * @defgroup RETRO_ENVIRONMENT Environment Callbacks
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
716 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
717 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
718
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
719 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
720 * This bit indicates that the associated environment call is experimental,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
721 * and may be changed or removed in the future.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
722 * Frontends should mask out this bit before handling the environment call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
723 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
724 #define RETRO_ENVIRONMENT_EXPERIMENTAL 0x10000
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
725
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
726 /** Frontend-internal environment callbacks should include this bit. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
727 #define RETRO_ENVIRONMENT_PRIVATE 0x20000
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
728
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
729 /* Environment commands. */
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
730 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
731 * Requests the frontend to set the screen rotation.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
732 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
733 * @param[in] data <tt>const unsigned*</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
734 * Valid values are 0, 1, 2, and 3.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
735 * These numbers respectively set the screen rotation to 0, 90, 180, and 270 degrees counter-clockwise.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
736 * @returns \c true if the screen rotation was set successfully.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
737 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
738 #define RETRO_ENVIRONMENT_SET_ROTATION 1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
739
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
740 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
741 * Queries whether the core should use overscan or not.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
742 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
743 * @param[out] data <tt>bool*</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
744 * Set to \c true if the core should use overscan,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
745 * \c false if it should be cropped away.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
746 * @returns \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
747 * Does \em not indicate whether overscan should be used.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
748 * @deprecated As of 2019 this callback is considered deprecated in favor of
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
749 * using core options to manage overscan in a more nuanced, core-specific way.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
750 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
751 #define RETRO_ENVIRONMENT_GET_OVERSCAN 2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
752
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
753 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
754 * Queries whether the frontend supports frame duping,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
755 * in the form of passing \c NULL to the video frame callback.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
756 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
757 * @param[out] data <tt>bool*</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
758 * Set to \c true if the frontend supports frame duping.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
759 * @returns \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
760 * @see retro_video_refresh_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
761 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
762 #define RETRO_ENVIRONMENT_GET_CAN_DUPE 3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
763
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
764 /*
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
765 * Environ 4, 5 are no longer supported (GET_VARIABLE / SET_VARIABLES),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
766 * and reserved to avoid possible ABI clash.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
767 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
768
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
769 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
770 * @brief Displays a user-facing message for a short time.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
771 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
772 * Use this callback to convey important status messages,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
773 * such as errors or the result of long-running operations.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
774 * For trivial messages or logging, use \c RETRO_ENVIRONMENT_GET_LOG_INTERFACE or \c stderr.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
775 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
776 * \code{.c}
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
777 * void set_message_example(void)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
778 * {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
779 * struct retro_message msg;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
780 * msg.frames = 60 * 5; // 5 seconds
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
781 * msg.msg = "Hello world!";
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
782 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
783 * environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, &msg);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
784 * }
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
785 * \endcode
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
786 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
787 * @deprecated Prefer using \c RETRO_ENVIRONMENT_SET_MESSAGE_EXT for new code,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
788 * as it offers more features.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
789 * Only use this environment call for compatibility with older cores or frontends.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
790 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
791 * @param[in] data <tt>const struct retro_message*</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
792 * Details about the message to show to the user.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
793 * Behavior is undefined if <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
794 * @returns \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
795 * @see retro_message
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
796 * @see RETRO_ENVIRONMENT_GET_LOG_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
797 * @see RETRO_ENVIRONMENT_SET_MESSAGE_EXT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
798 * @see RETRO_ENVIRONMENT_SET_MESSAGE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
799 * @see RETRO_ENVIRONMENT_GET_MESSAGE_INTERFACE_VERSION
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
800 * @note The frontend must make its own copy of the message and the underlying string.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
801 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
802 #define RETRO_ENVIRONMENT_SET_MESSAGE 6
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
803
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
804 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
805 * Requests the frontend to shutdown the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
806 * Should only be used if the core can exit on its own,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
807 * such as from a menu item in a game
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
808 * or an emulated power-off in an emulator.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
809 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
810 * @param data Ignored.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
811 * @returns \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
812 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
813 #define RETRO_ENVIRONMENT_SHUTDOWN 7
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
814
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
815 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
816 * Gives a hint to the frontend of how demanding this core is on the system.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
817 * For example, reporting a level of 2 means that
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
818 * this implementation should run decently on frontends
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
819 * of level 2 and above.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
820 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
821 * It can be used by the frontend to potentially warn
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
822 * about too demanding implementations.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
823 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
824 * The levels are "floating".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
825 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
826 * This function can be called on a per-game basis,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
827 * as a core may have different demands for different games or settings.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
828 * If called, it should be called in <tt>retro_load_game()</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
829 * @param[in] data <tt>const unsigned*</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
830 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
831 #define RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL 8
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
832
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
833 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
834 * Returns the path to the frontend's system directory,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
835 * which can be used to store system-specific configuration
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
836 * such as BIOS files or cached data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
837 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
838 * @param[out] data <tt>const char**</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
839 * Pointer to the \c char* in which the system directory will be saved.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
840 * The string is managed by the frontend and must not be modified or freed by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
841 * May be \c NULL if no system directory is defined,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
842 * in which case the core should find an alternative directory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
843 * @return \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
844 * even if the value returned in \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
845 * @note Historically, some cores would use this folder for save data such as memory cards or SRAM.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
846 * This is now discouraged in favor of \c RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
847 * @see RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
848 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
849 #define RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY 9
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
850
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
851 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
852 * Sets the internal pixel format used by the frontend for rendering.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
853 * The default pixel format is \c RETRO_PIXEL_FORMAT_0RGB1555 for compatibility reasons,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
854 * although it's considered deprecated and shouldn't be used by new code.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
855 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
856 * @param[in] data <tt>const enum retro_pixel_format *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
857 * Pointer to the pixel format to use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
858 * @returns \c true if the pixel format was set successfully,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
859 * \c false if it's not supported or this callback is unavailable.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
860 * @note This function should be called inside \c retro_load_game()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
861 * or <tt>retro_get_system_av_info()</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
862 * @see retro_pixel_format
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
863 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
864 #define RETRO_ENVIRONMENT_SET_PIXEL_FORMAT 10
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
865
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
866 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
867 * Sets an array of input descriptors for the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
868 * to present to the user for configuring the core's controls.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
869 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
870 * This function can be called at any time,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
871 * preferably early in the core's life cycle.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
872 * Ideally, no later than \c retro_load_game().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
873 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
874 * @param[in] data <tt>const struct retro_input_descriptor *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
875 * An array of input descriptors terminated by one whose
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
876 * \c retro_input_descriptor::description field is set to \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
877 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
878 * @return \c true if the environment call is recognized.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
879 * @see retro_input_descriptor
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
880 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
881 #define RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS 11
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
882
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
883 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
884 * Sets a callback function used to notify the core about keyboard events.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
885 * This should only be used for cores that specifically need keyboard input,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
886 * such as for home computer emulators or games with text entry.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
887 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
888 * @param[in] data <tt>const struct retro_keyboard_callback *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
889 * Pointer to the callback function.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
890 * Behavior is undefined if <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
891 * @return \c true if the environment call is recognized.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
892 * @see retro_keyboard_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
893 * @see retro_key
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
894 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
895 #define RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK 12
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
896
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
897 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
898 * Sets an interface that the frontend can use to insert and remove disks
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
899 * from the emulated console's disk drive.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
900 * Can be used for optical disks, floppy disks, or any other game storage medium
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
901 * that can be swapped at runtime.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
902 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
903 * This is intended for multi-disk games that expect the player
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
904 * to manually swap disks at certain points in the game.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
905 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
906 * @deprecated Prefer using \c RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
907 * over this environment call, as it supports additional features.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
908 * Only use this callback to maintain compatibility
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
909 * with older cores or frontends.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
910 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
911 * @param[in] data <tt>const struct retro_disk_control_callback *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
912 * Pointer to the callback functions to use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
913 * May be \c NULL, in which case the existing disk callback is deregistered.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
914 * @return \c true if this environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
915 * even if \c data is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
916 * @see retro_disk_control_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
917 * @see RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
918 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
919 #define RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE 13
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
920
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
921 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
922 * Requests that a frontend enable a particular hardware rendering API.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
923 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
924 * If successful, the frontend will create a context (and other related resources)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
925 * that the core can use for rendering.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
926 * The framebuffer will be at least as large as
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
927 * the maximum dimensions provided in <tt>retro_get_system_av_info</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
928 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
929 * @param[in, out] data <tt>struct retro_hw_render_callback *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
930 * Pointer to the hardware render callback struct.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
931 * Used to define callbacks for the hardware-rendering life cycle,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
932 * as well as to request a particular rendering API.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
933 * @return \c true if the environment call is recognized
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
934 * and the requested rendering API is supported.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
935 * \c false if \c data is \c NULL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
936 * or the frontend can't provide the requested rendering API.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
937 * @see retro_hw_render_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
938 * @see retro_video_refresh_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
939 * @see RETRO_ENVIRONMENT_GET_PREFERRED_HW_RENDER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
940 * @note Should be called in <tt>retro_load_game()</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
941 * @note If HW rendering is used, pass only \c RETRO_HW_FRAME_BUFFER_VALID or
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
942 * \c NULL to <tt>retro_video_refresh_t</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
943 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
944 #define RETRO_ENVIRONMENT_SET_HW_RENDER 14
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
945
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
946 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
947 * Retrieves a core option's value from the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
948 * \c retro_variable::key should be set to an option key
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
949 * that was previously set in \c RETRO_ENVIRONMENT_SET_VARIABLES
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
950 * (or a similar environment call).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
951 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
952 * @param[in,out] data <tt>struct retro_variable *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
953 * Pointer to a single \c retro_variable struct.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
954 * See the documentation for \c retro_variable for details
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
955 * on which fields are set by the frontend or core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
956 * May be \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
957 * @returns \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
958 * even if \c data is \c NULL or the key it specifies is not found.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
959 * @note Passing \c NULL in to \c data can be useful to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
960 * test for support of this environment call without looking up any variables.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
961 * @see retro_variable
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
962 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
963 * @see RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
964 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
965 #define RETRO_ENVIRONMENT_GET_VARIABLE 15
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
966
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
967 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
968 * Notifies the frontend of the core's available options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
969 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
970 * The core may check these options later using \c RETRO_ENVIRONMENT_GET_VARIABLE.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
971 * The frontend may also present these options to the user
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
972 * in its own configuration UI.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
973 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
974 * This should be called the first time as early as possible,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
975 * ideally in \c retro_set_environment.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
976 * The core may later call this function again
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
977 * to communicate updated options to the frontend,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
978 * but the number of core options must not change.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
979 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
980 * Here's an example that sets two options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
981 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
982 * @code
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
983 * void set_variables_example(void)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
984 * {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
985 * struct retro_variable options[] = {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
986 * { "foo_speedhack", "Speed hack; false|true" }, // false by default
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
987 * { "foo_displayscale", "Display scale factor; 1|2|3|4" }, // 1 by default
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
988 * { NULL, NULL },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
989 * };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
990 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
991 * environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, &options);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
992 * }
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
993 * @endcode
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
994 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
995 * The possible values will generally be displayed and stored as-is by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
996 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
997 * @deprecated Prefer using \c RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2 for new code,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
998 * as it offers more features such as categories and translation.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
999 * Only use this environment call to maintain compatibility
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1000 * with older frontends or cores.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1001 * @note Keep the available options (and their possible values) as low as possible;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1002 * it should be feasible to cycle through them without a keyboard.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1003 * @param[in] data <tt>const struct retro_variable *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1004 * Pointer to an array of \c retro_variable structs that define available core options,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1005 * terminated by a <tt>{ NULL, NULL }</tt> element.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1006 * The frontend must maintain its own copy of this array.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1007 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1008 * @returns \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1009 * even if \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1010 * @see retro_variable
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1011 * @see RETRO_ENVIRONMENT_GET_VARIABLE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1012 * @see RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1013 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1014 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1015 #define RETRO_ENVIRONMENT_SET_VARIABLES 16
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1016
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1017 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1018 * Queries whether at least one core option was updated by the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1019 * since the last call to \ref RETRO_ENVIRONMENT_GET_VARIABLE.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1020 * This typically means that the user opened the core options menu and made some changes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1021 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1022 * Cores usually call this each frame before the core's main emulation logic.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1023 * Specific options can then be queried with \ref RETRO_ENVIRONMENT_GET_VARIABLE.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1024 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1025 * @param[out] data <tt>bool *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1026 * Set to \c true if at least one core option was updated
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1027 * since the last call to \ref RETRO_ENVIRONMENT_GET_VARIABLE.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1028 * Behavior is undefined if this pointer is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1029 * @returns \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1030 * @see RETRO_ENVIRONMENT_GET_VARIABLE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1031 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1032 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1033 #define RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE 17
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1034
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1035 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1036 * Notifies the frontend that this core can run without loading any content,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1037 * such as when emulating a console that has built-in software.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1038 * When a core is loaded without content,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1039 * \c retro_load_game receives an argument of <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1040 * This should be called within \c retro_set_environment() only.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1041 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1042 * @param[in] data <tt>const bool *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1043 * Pointer to a single \c bool that indicates whether this frontend can run without content.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1044 * Can point to a value of \c false but this isn't necessary,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1045 * as contentless support is opt-in.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1046 * The behavior is undefined if \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1047 * @returns \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1048 * @see retro_load_game
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1049 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1050 #define RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME 18
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1051
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1052 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1053 * Retrieves the absolute path from which this core was loaded.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1054 * Useful when loading assets from paths relative to the core,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1055 * as is sometimes the case when using <tt>RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1056 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1057 * @param[out] data <tt>const char **</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1058 * Pointer to a string in which the core's path will be saved.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1059 * The string is managed by the frontend and must not be modified or freed by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1060 * May be \c NULL if the core is statically linked to the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1061 * or if the core's path otherwise cannot be determined.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1062 * Behavior is undefined if \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1063 * @returns \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1064 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1065 #define RETRO_ENVIRONMENT_GET_LIBRETRO_PATH 19
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1066
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1067 /* Environment call 20 was an obsolete version of SET_AUDIO_CALLBACK.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1068 * It was not used by any known core at the time, and was removed from the API.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1069 * The number 20 is reserved to prevent ABI clashes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1070 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1071
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1072 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1073 * Sets a callback that notifies the core of how much time has passed
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1074 * since the last iteration of <tt>retro_run</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1075 * If the frontend is not running the core in real time
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1076 * (e.g. it's frame-stepping or running in slow motion),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1077 * then the reference value will be provided to the callback instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1078 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1079 * @param[in] data <tt>const struct retro_frame_time_callback *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1080 * Pointer to a single \c retro_frame_time_callback struct.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1081 * Behavior is undefined if \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1082 * @returns \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1083 * @note Frontends may disable this environment call in certain situations.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1084 * It will return \c false in those cases.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1085 * @see retro_frame_time_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1086 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1087 #define RETRO_ENVIRONMENT_SET_FRAME_TIME_CALLBACK 21
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1088
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1089 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1090 * Registers a set of functions that the frontend can use
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1091 * to tell the core it's ready for audio output.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1092 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1093 * It is intended for games that feature asynchronous audio.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1094 * It should not be used for emulators unless their audio is asynchronous.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1095 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1096 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1097 * The callback only notifies about writability; the libretro core still
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1098 * has to call the normal audio callbacks
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1099 * to write audio. The audio callbacks must be called from within the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1100 * notification callback.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1101 * The amount of audio data to write is up to the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1102 * Generally, the audio callback will be called continuously in a loop.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1103 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1104 * A frontend may disable this callback in certain situations.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1105 * The core must be able to render audio with the "normal" interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1106 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1107 * @param[in] data <tt>const struct retro_audio_callback *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1108 * Pointer to a set of functions that the frontend will call to notify the core
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1109 * when it's ready to receive audio data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1110 * May be \c NULL, in which case the frontend will return
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1111 * whether this environment callback is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1112 * @return \c true if this environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1113 * even if \c data is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1114 * @warning The provided callbacks can be invoked from any thread,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1115 * so their implementations \em must be thread-safe.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1116 * @note If a core uses this callback,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1117 * it should also use <tt>RETRO_ENVIRONMENT_SET_FRAME_TIME_CALLBACK</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1118 * @see retro_audio_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1119 * @see retro_audio_sample_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1120 * @see retro_audio_sample_batch_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1121 * @see RETRO_ENVIRONMENT_SET_FRAME_TIME_CALLBACK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1122 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1123 #define RETRO_ENVIRONMENT_SET_AUDIO_CALLBACK 22
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1124
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1125 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1126 * Gets an interface that a core can use to access a controller's rumble motors.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1127 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1128 * The interface supports two independently-controlled motors,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1129 * one strong and one weak.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1130 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1131 * Should be called from either \c retro_init() or \c retro_load_game(),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1132 * but not from \c retro_set_environment().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1133 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1134 * @param[out] data <tt>struct retro_rumble_interface *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1135 * Pointer to the interface struct.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1136 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1137 * @returns \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1138 * even if the current device doesn't support vibration.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1139 * @see retro_rumble_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1140 * @defgroup GET_RUMBLE_INTERFACE Rumble Interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1141 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1142 #define RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE 23
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1143
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1144 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1145 * Returns the frontend's supported input device types.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1146 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1147 * The supported device types are returned as a bitmask,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1148 * with each value of \ref RETRO_DEVICE corresponding to a bit.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1149 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1150 * Should only be called in \c retro_run().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1151 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1152 * @code
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1153 * #define REQUIRED_DEVICES ((1 << RETRO_DEVICE_JOYPAD) | (1 << RETRO_DEVICE_ANALOG))
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1154 * void get_input_device_capabilities_example(void)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1155 * {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1156 * uint64_t capabilities;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1157 * environ_cb(RETRO_ENVIRONMENT_GET_INPUT_DEVICE_CAPABILITIES, &capabilities);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1158 * if ((capabilities & REQUIRED_DEVICES) == REQUIRED_DEVICES)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1159 * printf("Joypad and analog device types are supported");
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1160 * }
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1161 * @endcode
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1162 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1163 * @param[out] data <tt>uint64_t *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1164 * Pointer to a bitmask of supported input device types.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1165 * If the frontend supports a particular \c RETRO_DEVICE_* type,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1166 * then the bit <tt>(1 << RETRO_DEVICE_*)</tt> will be set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1167 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1168 * Each bit represents a \c RETRO_DEVICE constant,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1169 * e.g. bit 1 represents \c RETRO_DEVICE_JOYPAD,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1170 * bit 2 represents \c RETRO_DEVICE_MOUSE, and so on.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1171 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1172 * Bits that do not correspond to known device types will be set to zero
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1173 * and are reserved for future use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1174 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1175 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1176 * @returns \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1177 * @note If the frontend supports multiple input drivers,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1178 * availability of this environment call (and the reported capabilities)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1179 * may depend on the active driver.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1180 * @see RETRO_DEVICE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1181 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1182 #define RETRO_ENVIRONMENT_GET_INPUT_DEVICE_CAPABILITIES 24
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1183
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1184 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1185 * Returns an interface that the core can use to access and configure available sensors,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1186 * such as an accelerometer or gyroscope.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1187 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1188 * @param[out] data <tt>struct retro_sensor_interface *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1189 * Pointer to the sensor interface that the frontend will populate.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1190 * Behavior is undefined if is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1191 * @returns \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1192 * even if the device doesn't have any supported sensors.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1193 * @see retro_sensor_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1194 * @see retro_sensor_action
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1195 * @see RETRO_SENSOR
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1196 * @addtogroup RETRO_SENSOR
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1197 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1198 #define RETRO_ENVIRONMENT_GET_SENSOR_INTERFACE (25 | RETRO_ENVIRONMENT_EXPERIMENTAL)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1199
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1200 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1201 * Gets an interface to the device's video camera.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1202 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1203 * The frontend delivers new video frames via a user-defined callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1204 * that runs in the same thread as \c retro_run().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1205 * Should be called in \c retro_load_game().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1206 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1207 * @param[in,out] data <tt>struct retro_camera_callback *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1208 * Pointer to the camera driver interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1209 * Some fields in the struct must be filled in by the core,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1210 * others are provided by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1211 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1212 * @returns \c true if this environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1213 * even if an actual camera isn't.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1214 * @note This API only supports one video camera at a time.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1215 * If the device provides multiple cameras (e.g. inner/outer cameras on a phone),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1216 * the frontend will choose one to use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1217 * @see retro_camera_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1218 * @see RETRO_ENVIRONMENT_SET_HW_RENDER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1219 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1220 #define RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE (26 | RETRO_ENVIRONMENT_EXPERIMENTAL)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1221
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1222 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1223 * Gets an interface that the core can use for cross-platform logging.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1224 * Certain platforms don't have a console or <tt>stderr</tt>,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1225 * or they have their own preferred logging methods.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1226 * The frontend itself may also display log output.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1227 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1228 * @attention This should not be used for information that the player must immediately see,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1229 * such as major errors or warnings.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1230 * In most cases, this is best for information that will help you (the developer)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1231 * identify problems when debugging or providing support.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1232 * Unless a core or frontend is intended for advanced users,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1233 * the player might not check (or even know about) their logs.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1234 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1235 * @param[out] data <tt>struct retro_log_callback *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1236 * Pointer to the callback where the function pointer will be saved.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1237 * Behavior is undefined if \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1238 * @returns \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1239 * @see retro_log_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1240 * @note Cores can fall back to \c stderr if this interface is not available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1241 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1242 #define RETRO_ENVIRONMENT_GET_LOG_INTERFACE 27
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1243
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1244 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1245 * Returns an interface that the core can use for profiling code
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1246 * and to access performance-related information.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1247 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1248 * This callback supports performance counters, a high-resolution timer,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1249 * and listing available CPU features (mostly SIMD instructions).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1250 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1251 * @param[out] data <tt>struct retro_perf_callback *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1252 * Pointer to the callback interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1253 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1254 * @returns \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1255 * @see retro_perf_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1256 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1257 #define RETRO_ENVIRONMENT_GET_PERF_INTERFACE 28
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1258
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1259 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1260 * Returns an interface that the core can use to retrieve the device's location,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1261 * including its current latitude and longitude.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1262 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1263 * @param[out] data <tt>struct retro_location_callback *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1264 * Pointer to the callback interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1265 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1266 * @return \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1267 * even if there's no location information available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1268 * @see retro_location_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1269 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1270 #define RETRO_ENVIRONMENT_GET_LOCATION_INTERFACE 29
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1271
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1272 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1273 * @deprecated An obsolete alias to \c RETRO_ENVIRONMENT_GET_CORE_ASSETS_DIRECTORY kept for compatibility.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1274 * @see RETRO_ENVIRONMENT_GET_CORE_ASSETS_DIRECTORY
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1275 **/
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1276 #define RETRO_ENVIRONMENT_GET_CONTENT_DIRECTORY 30
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1277
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1278 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1279 * Returns the frontend's "core assets" directory,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1280 * which can be used to store assets that the core needs
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1281 * such as art assets or level data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1282 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1283 * @param[out] data <tt>const char **</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1284 * Pointer to a string in which the core assets directory will be saved.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1285 * This string is managed by the frontend and must not be modified or freed by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1286 * May be \c NULL if no core assets directory is defined,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1287 * in which case the core should find an alternative directory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1288 * Behavior is undefined if \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1289 * @returns \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1290 * even if the value returned in \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1291 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1292 #define RETRO_ENVIRONMENT_GET_CORE_ASSETS_DIRECTORY 30
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1293
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1294 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1295 * Returns the frontend's save data directory, if available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1296 * This directory should be used to store game-specific save data,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1297 * including memory card images.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1298 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1299 * Although libretro provides an interface for cores to expose SRAM to the frontend,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1300 * not all cores can support it correctly.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1301 * In this case, cores should use this environment callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1302 * to save their game data to disk manually.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1303 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1304 * Cores that use this environment callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1305 * should flush their save data to disk periodically and when unloading.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1306 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1307 * @param[out] data <tt>const char **</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1308 * Pointer to the string in which the save data directory will be saved.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1309 * This string is managed by the frontend and must not be modified or freed by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1310 * May return \c NULL if no save data directory is defined.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1311 * Behavior is undefined if \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1312 * @returns \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1313 * even if the value returned in \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1314 * @note Early libretro cores used \c RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY for save data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1315 * This is still supported for backwards compatibility,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1316 * but new cores should use this environment call instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1317 * \c RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY should be used for game-agnostic data
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1318 * such as BIOS files or core-specific configuration.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1319 * @note The returned directory may or may not be the same
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1320 * as the one used for \c retro_get_memory_data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1321 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1322 * @see retro_get_memory_data
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1323 * @see RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1324 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1325 #define RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY 31
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1326
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1327 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1328 * Sets new video and audio parameters for the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1329 * This can only be called from within <tt>retro_run</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1330 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1331 * This environment call may entail a full reinitialization of the frontend's audio/video drivers,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1332 * hence it should \em only be used if the core needs to make drastic changes
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1333 * to audio/video parameters.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1334 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1335 * This environment call should \em not be used when:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1336 * <ul>
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1337 * <li>Changing the emulated system's internal resolution,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1338 * within the limits defined by the existing values of \c max_width and \c max_height.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1339 * Use \c RETRO_ENVIRONMENT_SET_GEOMETRY instead,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1340 * and adjust \c retro_get_system_av_info to account for
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1341 * supported scale factors and screen layouts
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1342 * when computing \c max_width and \c max_height.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1343 * Only use this environment call if \c max_width or \c max_height needs to increase.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1344 * <li>Adjusting the screen's aspect ratio,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1345 * e.g. when changing the layout of the screen(s).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1346 * Use \c RETRO_ENVIRONMENT_SET_GEOMETRY or \c RETRO_ENVIRONMENT_SET_ROTATION instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1347 * </ul>
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1348 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1349 * The frontend will reinitialize its audio and video drivers within this callback;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1350 * after that happens, audio and video callbacks will target the newly-initialized driver,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1351 * even within the same \c retro_run call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1352 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1353 * This callback makes it possible to support configurable resolutions
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1354 * while avoiding the need to compute the "worst case" values of \c max_width and \c max_height.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1355 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1356 * @param[in] data <tt>const struct retro_system_av_info *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1357 * Pointer to the new video and audio parameters that the frontend should adopt.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1358 * @returns \c true if the environment call is available
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1359 * and the new av_info struct was accepted.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1360 * \c false if the environment call is unavailable or \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1361 * @see retro_system_av_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1362 * @see RETRO_ENVIRONMENT_SET_GEOMETRY
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1363 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1364 #define RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO 32
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1365
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1366 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1367 * Provides an interface that a frontend can use
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1368 * to get function pointers from the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1369 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1370 * This allows cores to define their own extensions to the libretro API,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1371 * or to expose implementations of a frontend's libretro extensions.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1372 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1373 * @param[in] data <tt>const struct retro_get_proc_address_interface *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1374 * Pointer to the interface that the frontend can use to get function pointers from the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1375 * The frontend must maintain its own copy of this interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1376 * @returns \c true if the environment call is available
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1377 * and the returned interface was accepted.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1378 * @note The provided interface may be called at any time,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1379 * even before this environment call returns.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1380 * @note Extensions should be prefixed with the name of the frontend or core that defines them.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1381 * For example, a frontend named "foo" that defines a debugging extension
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1382 * should expect the core to define functions prefixed with "foo_debug_".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1383 * @warning If a core wants to use this environment call,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1384 * it \em must do so from within \c retro_set_environment().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1385 * @see retro_get_proc_address_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1386 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1387 #define RETRO_ENVIRONMENT_SET_PROC_ADDRESS_CALLBACK 33
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1388
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1389 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1390 * Registers a core's ability to handle "subsystems",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1391 * which are secondary platforms that augment a core's primary emulated hardware.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1392 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1393 * A core doesn't need to emulate a secondary platform
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1394 * in order to use it as a subsystem;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1395 * as long as it can load a secondary file for some practical use,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1396 * then this environment call is most likely suitable.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1397 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1398 * Possible use cases of a subsystem include:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1399 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1400 * \li Installing software onto an emulated console's internal storage,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1401 * such as the Nintendo DSi.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1402 * \li Emulating accessories that are used to support another console's games,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1403 * such as the Super Game Boy or the N64 Transfer Pak.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1404 * \li Inserting a secondary ROM into a console
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1405 * that features multiple cartridge ports,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1406 * such as the Nintendo DS's Slot-2.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1407 * \li Loading a save data file created and used by another core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1408 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1409 * Cores should \em not use subsystems for:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1410 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1411 * \li Emulators that support multiple "primary" platforms,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1412 * such as a Game Boy/Game Boy Advance core
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1413 * or a Sega Genesis/Sega CD/32X core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1414 * Use \c retro_system_content_info_override, \c retro_system_info,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1415 * and/or runtime detection instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1416 * \li Selecting different memory card images.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1417 * Use dynamically-populated core options instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1418 * \li Different variants of a single console,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1419 * such the Game Boy vs. the Game Boy Color.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1420 * Use core options or runtime detection instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1421 * \li Games that span multiple disks.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1422 * Use \c RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1423 * and m3u-formatted playlists instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1424 * \li Console system files (BIOS, firmware, etc.).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1425 * Use \c RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1426 * and a common naming convention instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1427 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1428 * When the frontend loads a game via a subsystem,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1429 * it must call \c retro_load_game_special() instead of \c retro_load_game().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1430 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1431 * @param[in] data <tt>const struct retro_subsystem_info *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1432 * Pointer to an array of subsystem descriptors,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1433 * terminated by a zeroed-out \c retro_subsystem_info struct.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1434 * The frontend should maintain its own copy
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1435 * of this array and the strings within it.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1436 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1437 * @returns \c true if this environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1438 * @note This environment call \em must be called from within \c retro_set_environment(),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1439 * as frontends may need the registered information before loading a game.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1440 * @see retro_subsystem_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1441 * @see retro_load_game_special
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1442 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1443 #define RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO 34
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1444
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1445 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1446 * Declares one or more types of controllers supported by this core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1447 * The frontend may then allow the player to select one of these controllers in its menu.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1448 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1449 * Many consoles had controllers that came in different versions,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1450 * were extensible with peripherals,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1451 * or could be held in multiple ways;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1452 * this environment call can be used to represent these differences
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1453 * and adjust the core's behavior to match.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1454 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1455 * Possible use cases include:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1456 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1457 * \li Supporting different classes of a single controller that supported their own sets of games.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1458 * For example, the SNES had two different lightguns (the Super Scope and the Justifier)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1459 * whose games were incompatible with each other.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1460 * \li Representing a platform's alternative controllers.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1461 * For example, several platforms had music/rhythm games that included controllers
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1462 * shaped like musical instruments.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1463 * \li Representing variants of a standard controller with additional inputs.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1464 * For example, numerous consoles in the 90's introduced 6-button controllers for fighting games,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1465 * steering wheels for racing games,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1466 * or analog sticks for 3D platformers.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1467 * \li Representing add-ons for consoles or standard controllers.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1468 * For example, the 3DS had a Circle Pad Pro attachment that added a second analog stick.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1469 * \li Selecting different configurations for a single controller.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1470 * For example, the Wii Remote could be held sideways like a traditional game pad
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1471 * or in one hand like a wand.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1472 * \li Providing multiple ways to simulate the experience of using a particular controller.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1473 * For example, the Game Boy Advance featured several games
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1474 * with motion or light sensors in their cartridges;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1475 * a core could provide controller configurations
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1476 * that allow emulating the sensors with either analog axes
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1477 * or with their host device's sensors.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1478 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1479 * Should be called in retro_load_game.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1480 * The frontend must maintain its own copy of the provided array,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1481 * including all strings and subobjects.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1482 * A core may exclude certain controllers for known incompatible games.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1483 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1484 * When the frontend changes the active device for a particular port,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1485 * it must call \c retro_set_controller_port_device() with that port's index
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1486 * and one of the IDs defined in its retro_controller_info::types field.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1487 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1488 * Input ports are generally associated with different players
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1489 * (and the frontend's UI may reflect this with "Player 1" labels),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1490 * but this is not required.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1491 * Some games use multiple controllers for a single player,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1492 * or some cores may use port indexes to represent an emulated console's
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1493 * alternative input peripherals.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1494 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1495 * @param[in] data <tt>const struct retro_controller_info *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1496 * Pointer to an array of controller types defined by this core,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1497 * terminated by a zeroed-out \c retro_controller_info.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1498 * Each element of this array represents a controller port on the emulated device.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1499 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1500 * @returns \c true if this environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1501 * @see retro_controller_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1502 * @see retro_set_controller_port_device
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1503 * @see RETRO_DEVICE_SUBCLASS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1504 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1505 #define RETRO_ENVIRONMENT_SET_CONTROLLER_INFO 35
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1506
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1507 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1508 * Notifies the frontend of the address spaces used by the core's emulated hardware,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1509 * and of the memory maps within these spaces.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1510 * This can be used by the frontend to provide cheats, achievements, or debugging capabilities.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1511 * Should only be used by emulators, as it makes little sense for game engines.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1512 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1513 * @note Cores should also expose these address spaces
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1514 * through retro_get_memory_data and \c retro_get_memory_size if applicable;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1515 * this environment call is not intended to replace those two functions,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1516 * as the emulated hardware may feature memory regions outside of its own address space
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1517 * that are nevertheless useful for the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1518 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1519 * @param[in] data <tt>const struct retro_memory_map *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1520 * Pointer to a single memory-map listing.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1521 * The frontend must maintain its own copy of this object and its contents,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1522 * including strings and nested objects.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1523 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1524 * @returns \c true if this environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1525 * @see retro_memory_map
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1526 * @see retro_get_memory_data
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1527 * @see retro_memory_descriptor
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1528 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1529 #define RETRO_ENVIRONMENT_SET_MEMORY_MAPS (36 | RETRO_ENVIRONMENT_EXPERIMENTAL)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1530
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1531 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1532 * Resizes the viewport without reinitializing the video driver.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1533 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1534 * Similar to \c RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1535 * but any changes that would require video reinitialization will not be performed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1536 * Can only be called from within \c retro_run().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1537 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1538 * This environment call allows a core to revise the size of the viewport at will,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1539 * which can be useful for emulated platforms that support dynamic resolution changes
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1540 * or for cores that support multiple screen layouts.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1541 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1542 * A frontend must guarantee that this environment call completes in
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1543 * constant time.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1544 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1545 * @param[in] data <tt>const struct retro_game_geometry *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1546 * Pointer to the new video parameters that the frontend should adopt.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1547 * \c retro_game_geometry::max_width and \c retro_game_geometry::max_height
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1548 * will be ignored.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1549 * Behavior is undefined if \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1550 * @return \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1551 * @see RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1552 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1553 #define RETRO_ENVIRONMENT_SET_GEOMETRY 37
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1554
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1555 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1556 * Returns the name of the user, if possible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1557 * This callback is suitable for cores that offer personalization,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1558 * such as online facilities or user profiles on the emulated system.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1559 * @param[out] data <tt>const char **</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1560 * Pointer to the user name string.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1561 * May be \c NULL, in which case the core should use a default name.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1562 * The returned pointer is owned by the frontend and must not be modified or freed by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1563 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1564 * @returns \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1565 * even if the frontend couldn't provide a name.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1566 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1567 #define RETRO_ENVIRONMENT_GET_USERNAME 38
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1568
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1569 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1570 * Returns the frontend's configured language.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1571 * It can be used to localize the core's UI,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1572 * or to customize the emulated firmware if applicable.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1573 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1574 * @param[out] data <tt>retro_language *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1575 * Pointer to the language identifier.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1576 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1577 * @returns \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1578 * @note The returned language may not be the same as the operating system's language.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1579 * Cores should fall back to the operating system's language (or to English)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1580 * if the environment call is unavailable or the returned language is unsupported.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1581 * @see retro_language
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1582 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1583 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1584 #define RETRO_ENVIRONMENT_GET_LANGUAGE 39
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1585
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1586 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1587 * Returns a frontend-managed framebuffer
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1588 * that the core may render directly into
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1589 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1590 * This environment call is provided as an optimization
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1591 * for cores that use software rendering
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1592 * (i.e. that don't use \refitem RETRO_ENVIRONMENT_SET_HW_RENDER "a graphics hardware API");
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1593 * specifically, the intended use case is to allow a core
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1594 * to render directly into frontend-managed video memory,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1595 * avoiding the bandwidth use that copying a whole framebuffer from core to video memory entails.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1596 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1597 * Must be called every frame if used,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1598 * as this may return a different framebuffer each frame
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1599 * (e.g. for swap chains).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1600 * However, a core may render to a different buffer even if this call succeeds.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1601 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1602 * @param[in,out] data <tt>struct retro_framebuffer *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1603 * Pointer to a frontend's frame buffer and accompanying data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1604 * Some fields are set by the core, others are set by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1605 * Only guaranteed to be valid for the duration of the current \c retro_run call,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1606 * and must not be used afterwards.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1607 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1608 * @return \c true if the environment call was recognized
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1609 * and the framebuffer was successfully returned.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1610 * @see retro_framebuffer
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1611 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1612 #define RETRO_ENVIRONMENT_GET_CURRENT_SOFTWARE_FRAMEBUFFER (40 | RETRO_ENVIRONMENT_EXPERIMENTAL)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1613
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1614 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1615 * Returns an interface for accessing the data of specific rendering APIs.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1616 * Not all hardware rendering APIs support or need this.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1617 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1618 * The details of these interfaces are specific to each rendering API.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1619 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1620 * @note \c retro_hw_render_callback::context_reset must be called by the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1621 * before this environment call can be used.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1622 * Additionally, the contents of the returned interface are invalidated
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1623 * after \c retro_hw_render_callback::context_destroyed has been called.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1624 * @param[out] data <tt>const struct retro_hw_render_interface **</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1625 * The render interface for the currently-enabled hardware rendering API, if any.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1626 * The frontend will store a pointer to the interface at the address provided here.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1627 * The returned interface is owned by the frontend and must not be modified or freed by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1628 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1629 * @return \c true if this environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1630 * the active graphics API has a libretro rendering interface,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1631 * and the frontend is able to return said interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1632 * \c false otherwise.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1633 * @see RETRO_ENVIRONMENT_SET_HW_RENDER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1634 * @see retro_hw_render_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1635 * @note Since not every libretro-supported hardware rendering API
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1636 * has a \c retro_hw_render_interface implementation,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1637 * a result of \c false is not necessarily an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1638 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1639 #define RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE (41 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1640
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1641 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1642 * Explicitly notifies the frontend of whether this core supports achievements.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1643 * The core must expose its emulated address space via
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1644 * \c retro_get_memory_data or \c RETRO_ENVIRONMENT_GET_MEMORY_MAPS.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1645 * Must be called before the first call to <tt>retro_run</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1646 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1647 * If \ref retro_get_memory_data returns a valid address
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1648 * but this environment call is not used,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1649 * the frontend (at its discretion) may or may not opt in the core to its achievements support.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1650 * whether this core is opted in to the frontend's achievement support
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1651 * is left to the frontend's discretion.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1652 * @param[in] data <tt>const bool *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1653 * Pointer to a single \c bool that indicates whether this core supports achievements.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1654 * Behavior is undefined if \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1655 * @returns \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1656 * @see RETRO_ENVIRONMENT_SET_MEMORY_MAPS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1657 * @see retro_get_memory_data
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1658 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1659 #define RETRO_ENVIRONMENT_SET_SUPPORT_ACHIEVEMENTS (42 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1660
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1661 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1662 * Defines an interface that the frontend can use
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1663 * to ask the core for the parameters it needs for a hardware rendering context.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1664 * The exact semantics depend on \ref RETRO_ENVIRONMENT_SET_HW_RENDER "the active rendering API".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1665 * Will be used some time after \c RETRO_ENVIRONMENT_SET_HW_RENDER is called,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1666 * but before \c retro_hw_render_callback::context_reset is called.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1667 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1668 * @param[in] data <tt>const struct retro_hw_render_context_negotiation_interface *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1669 * Pointer to the context negotiation interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1670 * Will be populated by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1671 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1672 * @return \c true if this environment call is supported,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1673 * even if the current graphics API doesn't use
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1674 * a context negotiation interface (in which case the argument is ignored).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1675 * @see retro_hw_render_context_negotiation_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1676 * @see RETRO_ENVIRONMENT_GET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_SUPPORT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1677 * @see RETRO_ENVIRONMENT_SET_HW_RENDER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1678 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1679 #define RETRO_ENVIRONMENT_SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE (43 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1680
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1681 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1682 * Notifies the frontend of any quirks associated with serialization.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1683 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1684 * Should be set in either \c retro_init or \c retro_load_game, but not both.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1685 * @param[in, out] data <tt>uint64_t *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1686 * Pointer to the core's serialization quirks.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1687 * The frontend will set the flags of the quirks it supports
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1688 * and clear the flags of those it doesn't.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1689 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1690 * @return \c true if this environment call is supported.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1691 * @see retro_serialize
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1692 * @see retro_unserialize
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1693 * @see RETRO_SERIALIZATION_QUIRK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1694 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1695 #define RETRO_ENVIRONMENT_SET_SERIALIZATION_QUIRKS 44
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1696
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1697 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1698 * The frontend will try to use a "shared" context when setting up a hardware context.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1699 * Mostly applicable to OpenGL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1700 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1701 * In order for this to have any effect,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1702 * the core must call \c RETRO_ENVIRONMENT_SET_HW_RENDER at some point
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1703 * if it hasn't already.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1704 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1705 * @param data Ignored.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1706 * @returns \c true if the environment call is available
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1707 * and the frontend supports shared hardware contexts.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1708 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1709 #define RETRO_ENVIRONMENT_SET_HW_SHARED_CONTEXT (44 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1710
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1711 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1712 * Returns an interface that the core can use to access the file system.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1713 * Should be called as early as possible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1714 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1715 * @param[in,out] data <tt>struct retro_vfs_interface_info *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1716 * Information about the desired VFS interface,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1717 * as well as the interface itself.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1718 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1719 * @return \c true if this environment call is available
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1720 * and the frontend can provide a VFS interface of the requested version or newer.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1721 * @see retro_vfs_interface_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1722 * @see file_path
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1723 * @see retro_dirent
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1724 * @see file_stream
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1725 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1726 #define RETRO_ENVIRONMENT_GET_VFS_INTERFACE (45 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1727
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1728 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1729 * Returns an interface that the core can use
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1730 * to set the state of any accessible device LEDs.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1731 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1732 * @param[out] data <tt>struct retro_led_interface *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1733 * Pointer to the LED interface that the frontend will populate.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1734 * May be \c NULL, in which case the frontend will only return
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1735 * whether this environment callback is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1736 * @returns \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1737 * even if \c data is \c NULL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1738 * or no LEDs are accessible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1739 * @see retro_led_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1740 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1741 #define RETRO_ENVIRONMENT_GET_LED_INTERFACE (46 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1742
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1743 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1744 * Returns hints about certain steps that the core may skip for this frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1745 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1746 * A frontend may not need a core to generate audio or video in certain situations;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1747 * this environment call sets a bitmask that indicates
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1748 * which steps the core may skip for this frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1749 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1750 * This can be used to increase performance for some frontend features.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1751 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1752 * @note Emulation accuracy should not be compromised;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1753 * for example, if a core emulates a platform that supports display capture
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1754 * (i.e. looking at its own VRAM), then it should perform its rendering as normal
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1755 * unless it can prove that the emulated game is not using display capture.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1756 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1757 * @param[out] data <tt>retro_av_enable_flags *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1758 * Pointer to the bitmask of steps that the frontend will skip.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1759 * Other bits are set to zero and are reserved for future use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1760 * If \c NULL, the frontend will only return whether this environment callback is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1761 * @returns \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1762 * regardless of the value output to \c data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1763 * If \c false, the core should assume that the frontend will not skip any steps.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1764 * @see retro_av_enable_flags
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1765 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1766 #define RETRO_ENVIRONMENT_GET_AUDIO_VIDEO_ENABLE (47 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1767
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1768 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1769 * Gets an interface that the core can use for raw MIDI I/O.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1770 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1771 * @param[out] data <tt>struct retro_midi_interface *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1772 * Pointer to the MIDI interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1773 * May be \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1774 * @return \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1775 * even if \c data is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1776 * @see retro_midi_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1777 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1778 #define RETRO_ENVIRONMENT_GET_MIDI_INTERFACE (48 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1779
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1780 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1781 * Asks the frontend if it's currently in fast-forward mode.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1782 * @param[out] data <tt>bool *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1783 * Set to \c true if the frontend is currently fast-forwarding its main loop.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1784 * Behavior is undefined if \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1785 * @returns \c true if this environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1786 * regardless of the value returned in \c data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1787 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1788 * @see RETRO_ENVIRONMENT_SET_FASTFORWARDING_OVERRIDE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1789 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1790 #define RETRO_ENVIRONMENT_GET_FASTFORWARDING (49 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1791
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1792 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1793 * Returns the refresh rate the frontend is targeting, in Hz.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1794 * The intended use case is for the core to use the result to select an ideal refresh rate.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1795 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1796 * @param[out] data <tt>float *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1797 * Pointer to the \c float in which the frontend will store its target refresh rate.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1798 * Behavior is undefined if \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1799 * @return \c true if this environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1800 * regardless of the value returned in \c data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1801 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1802 #define RETRO_ENVIRONMENT_GET_TARGET_REFRESH_RATE (50 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1803
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1804 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1805 * Returns whether the frontend can return the state of all buttons at once as a bitmask,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1806 * rather than requiring a series of individual calls to \c retro_input_state_t.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1807 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1808 * If this callback returns \c true,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1809 * you can get the state of all buttons by passing \c RETRO_DEVICE_ID_JOYPAD_MASK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1810 * as the \c id parameter to \c retro_input_state_t.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1811 * Bit #N represents the RETRO_DEVICE_ID_JOYPAD constant of value N,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1812 * e.g. <tt>(1 << RETRO_DEVICE_ID_JOYPAD_A)</tt> represents the A button.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1813 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1814 * @param data Ignored.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1815 * @returns \c true if the frontend can report the complete digital joypad state as a bitmask.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1816 * @see retro_input_state_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1817 * @see RETRO_DEVICE_JOYPAD
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1818 * @see RETRO_DEVICE_ID_JOYPAD_MASK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1819 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1820 #define RETRO_ENVIRONMENT_GET_INPUT_BITMASKS (51 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1821
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1822 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1823 * Returns the version of the core options API supported by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1824 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1825 * Over the years, libretro has used several interfaces
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1826 * for allowing cores to define customizable options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1827 * \ref SET_CORE_OPTIONS_V2 "Version 2 of the interface"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1828 * is currently preferred due to its extra features,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1829 * but cores and frontends should strive to support
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1830 * versions \ref RETRO_ENVIRONMENT_SET_CORE_OPTIONS "1"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1831 * and \ref RETRO_ENVIRONMENT_SET_VARIABLES "0" as well.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1832 * This environment call provides the information that cores need for that purpose.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1833 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1834 * If this environment call returns \c false,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1835 * then the core should assume version 0 of the core options API.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1836 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1837 * @param[out] data <tt>unsigned *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1838 * Pointer to the integer that will store the frontend's
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1839 * supported core options API version.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1840 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1841 * @returns \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1842 * \c false otherwise.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1843 * @see RETRO_ENVIRONMENT_SET_VARIABLES
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1844 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1845 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1846 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1847 #define RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION 52
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1848
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1849 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1850 * @copybrief RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1851 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1852 * @deprecated This environment call has been superseded
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1853 * by RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1854 * which supports categorizing options into groups.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1855 * This environment call should only be used to maintain compatibility
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1856 * with older cores and frontends.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1857 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1858 * This environment call is intended to replace \c RETRO_ENVIRONMENT_SET_VARIABLES,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1859 * and should only be called if \c RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1860 * returns an API version of at least 1.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1861 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1862 * This should be called the first time as early as possible,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1863 * ideally in \c retro_set_environment (but \c retro_load_game is acceptable).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1864 * It may then be called again later to update
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1865 * the core's options and their associated values,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1866 * as long as the number of options doesn't change
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1867 * from the number given in the first call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1868 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1869 * The core can retrieve option values at any time with \c RETRO_ENVIRONMENT_GET_VARIABLE.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1870 * If a saved value for a core option doesn't match the option definition's values,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1871 * the frontend may treat it as incorrect and revert to the default.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1872 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1873 * Core options and their values are usually defined in a large static array,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1874 * but they may be generated at runtime based on the loaded game or system state.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1875 * Here are some use cases for that:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1876 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1877 * @li Selecting a particular file from one of the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1878 * \ref RETRO_ENVIRONMENT_GET_ASSET_DIRECTORY "frontend's"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1879 * \ref RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY "content"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1880 * \ref RETRO_ENVIRONMENT_GET_CORE_ASSETS_DIRECTORY "directories",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1881 * such as a memory card image or figurine data file.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1882 * @li Excluding options that are not relevant to the current game,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1883 * for cores that define a large number of possible options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1884 * @li Choosing a default value at runtime for a specific game,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1885 * such as a BIOS file whose region matches that of the loaded content.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1886 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1887 * @note A guiding principle of libretro's API design is that
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1888 * all common interactions (gameplay, menu navigation, etc.)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1889 * should be possible without a keyboard.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1890 * This implies that cores should keep the number of options and values
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1891 * as low as possible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1892 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1893 * Example entry:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1894 * @code
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1895 * {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1896 * "foo_option",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1897 * "Speed hack coprocessor X",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1898 * "Provides increased performance at the expense of reduced accuracy",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1899 * {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1900 * { "false", NULL },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1901 * { "true", NULL },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1902 * { "unstable", "Turbo (Unstable)" },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1903 * { NULL, NULL },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1904 * },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1905 * "false"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1906 * }
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1907 * @endcode
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1908 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1909 * @param[in] data <tt>const struct retro_core_option_definition *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1910 * Pointer to one or more core option definitions,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1911 * terminated by a \ref retro_core_option_definition whose values are all zero.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1912 * May be \c NULL, in which case the frontend will remove all existing core options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1913 * The frontend must maintain its own copy of this object,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1914 * including all strings and subobjects.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1915 * @return \c true if this environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1916 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1917 * @see retro_core_option_definition
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1918 * @see RETRO_ENVIRONMENT_GET_VARIABLE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1919 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1920 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1921 #define RETRO_ENVIRONMENT_SET_CORE_OPTIONS 53
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1922
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1923 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1924 * A variant of \ref RETRO_ENVIRONMENT_SET_CORE_OPTIONS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1925 * that supports internationalization.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1926 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1927 * @deprecated This environment call has been superseded
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1928 * by \ref RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1929 * which supports categorizing options into groups
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1930 * (plus translating the groups themselves).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1931 * Only use this environment call to maintain compatibility
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1932 * with older cores and frontends.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1933 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1934 * This should be called instead of \c RETRO_ENVIRONMENT_SET_CORE_OPTIONS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1935 * if the core provides translations for its options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1936 * General use is largely the same,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1937 * but see \ref retro_core_options_intl for some important details.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1938 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1939 * @param[in] data <tt>const struct retro_core_options_intl *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1940 * Pointer to a core's option values and their translations.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1941 * @see retro_core_options_intl
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1942 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1943 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1944 #define RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL 54
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1945
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1946 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1947 * Notifies the frontend that it should show or hide the named core option.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1948 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1949 * Some core options aren't relevant in all scenarios,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1950 * such as a submenu for hardware rendering flags
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1951 * when the software renderer is configured.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1952 * This environment call asks the frontend to stop (or start)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1953 * showing the named core option to the player.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1954 * This is only a hint, not a requirement;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1955 * the frontend may ignore this environment call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1956 * By default, all core options are visible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1957 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1958 * @note This environment call must \em only affect a core option's visibility,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1959 * not its functionality or availability.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1960 * \ref RETRO_ENVIRONMENT_GET_VARIABLE "Getting an invisible core option"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1961 * must behave normally.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1962 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1963 * @param[in] data <tt>const struct retro_core_option_display *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1964 * Pointer to a descriptor for the option that the frontend should show or hide.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1965 * May be \c NULL, in which case the frontend will only return
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1966 * whether this environment callback is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1967 * @return \c true if this environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1968 * even if \c data is \c NULL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1969 * or the specified option doesn't exist.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1970 * @see retro_core_option_display
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1971 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_UPDATE_DISPLAY_CALLBACK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1972 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1973 #define RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY 55
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1974
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1975 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1976 * Returns the frontend's preferred hardware rendering API.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1977 * Cores should use this information to decide which API to use with \c RETRO_ENVIRONMENT_SET_HW_RENDER.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1978 * @param[out] data <tt>retro_hw_context_type *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1979 * Pointer to the hardware context type.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1980 * Behavior is undefined if \c data is <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1981 * This value will be set even if the environment call returns <tt>false</tt>,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1982 * unless the frontend doesn't implement it.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1983 * @returns \c true if the environment call is available
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1984 * and the frontend is able to use a hardware rendering API besides the one returned.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1985 * If \c false is returned and the core cannot use the preferred rendering API,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1986 * then it should exit or fall back to software rendering.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1987 * @note The returned value does not indicate which API is currently in use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1988 * For example, the frontend may return \c RETRO_HW_CONTEXT_OPENGL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1989 * while a Direct3D context from a previous session is active;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1990 * this would signal that the frontend's current preference is for OpenGL,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1991 * possibly because the user changed their frontend's video driver while a game is running.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1992 * @see retro_hw_context_type
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1993 * @see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1994 * @see RETRO_ENVIRONMENT_SET_HW_RENDER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1995 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1996 #define RETRO_ENVIRONMENT_GET_PREFERRED_HW_RENDER 56
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1997
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1998 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
1999 * Returns the minimum version of the disk control interface supported by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2000 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2001 * If this environment call returns \c false or \c data is 0 or greater,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2002 * then cores may use disk control callbacks
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2003 * with \c RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2004 * If the reported version is 1 or greater,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2005 * then cores should use \c RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2006 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2007 * @param[out] data <tt>unsigned *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2008 * Pointer to the unsigned integer that the frontend's supported disk control interface version will be stored in.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2009 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2010 * @return \c true if this environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2011 * @see RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2012 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2013 #define RETRO_ENVIRONMENT_GET_DISK_CONTROL_INTERFACE_VERSION 57
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2014
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2015 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2016 * @copybrief RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2017 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2018 * This is intended for multi-disk games that expect the player
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2019 * to manually swap disks at certain points in the game.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2020 * This version of the disk control interface provides
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2021 * more information about disk images.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2022 * Should be called in \c retro_init.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2023 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2024 * @param[in] data <tt>const struct retro_disk_control_ext_callback *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2025 * Pointer to the callback functions to use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2026 * May be \c NULL, in which case the existing disk callback is deregistered.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2027 * @return \c true if this environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2028 * even if \c data is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2029 * @see retro_disk_control_ext_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2030 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2031 #define RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE 58
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2032
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2033 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2034 * Returns the version of the message interface supported by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2035 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2036 * A version of 0 indicates that the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2037 * only supports the legacy \c RETRO_ENVIRONMENT_SET_MESSAGE interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2038 * A version of 1 indicates that the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2039 * supports \c RETRO_ENVIRONMENT_SET_MESSAGE_EXT as well.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2040 * If this environment call returns \c false,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2041 * the core should behave as if it had returned 0.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2042 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2043 * @param[out] data <tt>unsigned *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2044 * Pointer to the result returned by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2045 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2046 * @return \c true if this environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2047 * @see RETRO_ENVIRONMENT_SET_MESSAGE_EXT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2048 * @see RETRO_ENVIRONMENT_SET_MESSAGE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2049 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2050 #define RETRO_ENVIRONMENT_GET_MESSAGE_INTERFACE_VERSION 59
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2051
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2052 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2053 * Displays a user-facing message for a short time.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2054 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2055 * Use this callback to convey important status messages,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2056 * such as errors or the result of long-running operations.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2057 * For trivial messages or logging, use \c RETRO_ENVIRONMENT_GET_LOG_INTERFACE or \c stderr.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2058 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2059 * This environment call supersedes \c RETRO_ENVIRONMENT_SET_MESSAGE,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2060 * as it provides many more ways to customize
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2061 * how a message is presented to the player.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2062 * However, a frontend that supports this environment call
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2063 * must still support \c RETRO_ENVIRONMENT_SET_MESSAGE.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2064 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2065 * @param[in] data <tt>const struct retro_message_ext *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2066 * Pointer to the message to display to the player.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2067 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2068 * @returns \c true if this environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2069 * @see retro_message_ext
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2070 * @see RETRO_ENVIRONMENT_GET_MESSAGE_INTERFACE_VERSION
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2071 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2072 #define RETRO_ENVIRONMENT_SET_MESSAGE_EXT 60
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2073
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2074 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2075 * Returns the number of active input devices currently provided by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2076 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2077 * This may change between frames,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2078 * but will remain constant for the duration of each frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2079 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2080 * If this callback returns \c true,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2081 * a core need not poll any input device
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2082 * with an index greater than or equal to the returned value.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2083 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2084 * If callback returns \c false,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2085 * the number of active input devices is unknown.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2086 * In this case, all input devices should be considered active.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2087 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2088 * @param[out] data <tt>unsigned *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2089 * Pointer to the result returned by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2090 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2091 * @return \c true if this environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2092 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2093 #define RETRO_ENVIRONMENT_GET_INPUT_MAX_USERS 61
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2094
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2095 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2096 * Registers a callback that the frontend can use to notify the core
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2097 * of the audio output buffer's occupancy.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2098 * Can be used by a core to attempt frame-skipping to avoid buffer under-runs
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2099 * (i.e. "crackling" sounds).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2100 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2101 * @param[in] data <tt>const struct retro_audio_buffer_status_callback *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2102 * Pointer to the the buffer status callback,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2103 * or \c NULL to unregister any existing callback.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2104 * @return \c true if this environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2105 * even if \c data is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2106 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2107 * @see retro_audio_buffer_status_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2108 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2109 #define RETRO_ENVIRONMENT_SET_AUDIO_BUFFER_STATUS_CALLBACK 62
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2110
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2111 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2112 * Requests a minimum frontend audio latency in milliseconds.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2113 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2114 * This is a hint; the frontend may assign a different audio latency
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2115 * to accommodate hardware limits,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2116 * although it should try to honor requests up to 512ms.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2117 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2118 * This callback has no effect if the requested latency
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2119 * is less than the frontend's current audio latency.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2120 * If value is zero or \c data is \c NULL,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2121 * the frontend should set its default audio latency.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2122 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2123 * May be used by a core to increase audio latency and
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2124 * reduce the risk of buffer under-runs (crackling)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2125 * when performing 'intensive' operations.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2126 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2127 * A core using RETRO_ENVIRONMENT_SET_AUDIO_BUFFER_STATUS_CALLBACK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2128 * to implement audio-buffer-based frame skipping can get good results
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2129 * by setting the audio latency to a high (typically 6x or 8x)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2130 * integer multiple of the expected frame time.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2131 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2132 * This can only be called from within \c retro_run().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2133 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2134 * @warning This environment call may require the frontend to reinitialize its audio system.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2135 * This environment call should be used sparingly.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2136 * If the driver is reinitialized,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2137 * \ref retro_audio_callback_t "all audio callbacks" will be updated
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2138 * to target the newly-initialized driver.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2139 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2140 * @param[in] data <tt>const unsigned *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2141 * Minimum audio latency, in milliseconds.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2142 * @return \c true if this environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2143 * even if \c data is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2144 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2145 * @see RETRO_ENVIRONMENT_SET_AUDIO_BUFFER_STATUS_CALLBACK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2146 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2147 #define RETRO_ENVIRONMENT_SET_MINIMUM_AUDIO_LATENCY 63
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2148
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2149 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2150 * Allows the core to tell the frontend when it should enable fast-forwarding,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2151 * rather than relying solely on the frontend and user interaction.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2152 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2153 * Possible use cases include:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2154 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2155 * \li Temporarily disabling a core's fastforward support
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2156 * while investigating a related bug.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2157 * \li Disabling fastforward during netplay sessions,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2158 * or when using an emulated console's network features.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2159 * \li Automatically speeding up the game when in a loading screen
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2160 * that cannot be shortened with high-level emulation.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2161 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2162 * @param[in] data <tt>const struct retro_fastforwarding_override *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2163 * Pointer to the parameters that decide when and how
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2164 * the frontend is allowed to enable fast-forward mode.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2165 * May be \c NULL, in which case the frontend will return \c true
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2166 * without updating the fastforward state,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2167 * which can be used to detect support for this environment call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2168 * @return \c true if this environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2169 * even if \c data is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2170 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2171 * @see retro_fastforwarding_override
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2172 * @see RETRO_ENVIRONMENT_GET_FASTFORWARDING
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2173 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2174 #define RETRO_ENVIRONMENT_SET_FASTFORWARDING_OVERRIDE 64
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2175
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2176 #define RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE 65
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2177 /* const struct retro_system_content_info_override * --
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2178 * Allows an implementation to override 'global' content
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2179 * info parameters reported by retro_get_system_info().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2180 * Overrides also affect subsystem content info parameters
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2181 * set via RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2182 * This function must be called inside retro_set_environment().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2183 * If callback returns false, content info overrides
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2184 * are unsupported by the frontend, and will be ignored.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2185 * If callback returns true, extended game info may be
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2186 * retrieved by calling RETRO_ENVIRONMENT_GET_GAME_INFO_EXT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2187 * in retro_load_game() or retro_load_game_special().
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2188 *
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2189 * 'data' points to an array of retro_system_content_info_override
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2190 * structs terminated by a { NULL, false, false } element.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2191 * If 'data' is NULL, no changes will be made to the frontend;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2192 * a core may therefore pass NULL in order to test whether
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2193 * the RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE and
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2194 * RETRO_ENVIRONMENT_GET_GAME_INFO_EXT callbacks are supported
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2195 * by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2196 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2197 * For struct member descriptions, see the definition of
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2198 * struct retro_system_content_info_override.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2199 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2200 * Example:
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2201 *
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2202 * - struct retro_system_info:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2203 * {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2204 * "My Core", // library_name
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2205 * "v1.0", // library_version
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2206 * "m3u|md|cue|iso|chd|sms|gg|sg", // valid_extensions
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2207 * true, // need_fullpath
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2208 * false // block_extract
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2209 * }
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2210 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2211 * - Array of struct retro_system_content_info_override:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2212 * {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2213 * {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2214 * "md|sms|gg", // extensions
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2215 * false, // need_fullpath
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2216 * true // persistent_data
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2217 * },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2218 * {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2219 * "sg", // extensions
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2220 * false, // need_fullpath
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2221 * false // persistent_data
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2222 * },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2223 * { NULL, false, false }
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2224 * }
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2225 *
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2226 * Result:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2227 * - Files of type m3u, cue, iso, chd will not be
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2228 * loaded by the frontend. Frontend will pass a
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2229 * valid path to the core, and core will handle
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2230 * loading internally
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2231 * - Files of type md, sms, gg will be loaded by
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2232 * the frontend. A valid memory buffer will be
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2233 * passed to the core. This memory buffer will
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2234 * remain valid until retro_deinit() returns
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2235 * - Files of type sg will be loaded by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2236 * A valid memory buffer will be passed to the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2237 * This memory buffer will remain valid until
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2238 * retro_load_game() (or retro_load_game_special())
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2239 * returns
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2240 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2241 * NOTE: If an extension is listed multiple times in
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2242 * an array of retro_system_content_info_override
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2243 * structs, only the first instance will be registered
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2244 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2245
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2246 #define RETRO_ENVIRONMENT_GET_GAME_INFO_EXT 66
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2247 /* const struct retro_game_info_ext ** --
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2248 * Allows an implementation to fetch extended game
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2249 * information, providing additional content path
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2250 * and memory buffer status details.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2251 * This function may only be called inside
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2252 * retro_load_game() or retro_load_game_special().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2253 * If callback returns false, extended game information
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2254 * is unsupported by the frontend. In this case, only
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2255 * regular retro_game_info will be available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2256 * RETRO_ENVIRONMENT_GET_GAME_INFO_EXT is guaranteed
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2257 * to return true if RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2258 * returns true.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2259 *
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2260 * 'data' points to an array of retro_game_info_ext structs.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2261 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2262 * For struct member descriptions, see the definition of
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2263 * struct retro_game_info_ext.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2264 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2265 * - If function is called inside retro_load_game(),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2266 * the retro_game_info_ext array is guaranteed to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2267 * have a size of 1 - i.e. the returned pointer may
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2268 * be used to access directly the members of the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2269 * first retro_game_info_ext struct, for example:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2270 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2271 * struct retro_game_info_ext *game_info_ext;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2272 * if (environ_cb(RETRO_ENVIRONMENT_GET_GAME_INFO_EXT, &game_info_ext))
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2273 * printf("Content Directory: %s\n", game_info_ext->dir);
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2274 *
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2275 * - If the function is called inside retro_load_game_special(),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2276 * the retro_game_info_ext array is guaranteed to have a
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2277 * size equal to the num_info argument passed to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2278 * retro_load_game_special()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2279 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2280
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2281 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2282 * Defines a set of core options that can be shown and configured by the frontend,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2283 * so that the player may customize their gameplay experience to their liking.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2284 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2285 * @note This environment call is intended to replace
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2286 * \c RETRO_ENVIRONMENT_SET_VARIABLES and \c RETRO_ENVIRONMENT_SET_CORE_OPTIONS,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2287 * and should only be called if \c RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2288 * returns an API version of at least 2.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2289 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2290 * This should be called the first time as early as possible,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2291 * ideally in \c retro_set_environment (but \c retro_load_game is acceptable).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2292 * It may then be called again later to update
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2293 * the core's options and their associated values,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2294 * as long as the number of options doesn't change
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2295 * from the number given in the first call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2296 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2297 * The core can retrieve option values at any time with \c RETRO_ENVIRONMENT_GET_VARIABLE.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2298 * If a saved value for a core option doesn't match the option definition's values,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2299 * the frontend may treat it as incorrect and revert to the default.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2300 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2301 * Core options and their values are usually defined in a large static array,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2302 * but they may be generated at runtime based on the loaded game or system state.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2303 * Here are some use cases for that:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2304 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2305 * @li Selecting a particular file from one of the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2306 * \ref RETRO_ENVIRONMENT_GET_ASSET_DIRECTORY "frontend's"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2307 * \ref RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY "content"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2308 * \ref RETRO_ENVIRONMENT_GET_CORE_ASSETS_DIRECTORY "directories",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2309 * such as a memory card image or figurine data file.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2310 * @li Excluding options that are not relevant to the current game,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2311 * for cores that define a large number of possible options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2312 * @li Choosing a default value at runtime for a specific game,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2313 * such as a BIOS file whose region matches that of the loaded content.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2314 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2315 * @note A guiding principle of libretro's API design is that
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2316 * all common interactions (gameplay, menu navigation, etc.)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2317 * should be possible without a keyboard.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2318 * This implies that cores should keep the number of options and values
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2319 * as low as possible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2320 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2321 * @param[in] data <tt>const struct retro_core_options_v2 *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2322 * Pointer to a core's options and their associated categories.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2323 * May be \c NULL, in which case the frontend will remove all existing core options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2324 * The frontend must maintain its own copy of this object,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2325 * including all strings and subobjects.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2326 * @return \c true if this environment call is available
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2327 * and the frontend supports categories.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2328 * Note that this environment call is guaranteed to successfully register
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2329 * the provided core options,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2330 * so the return value does not indicate success or failure.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2331 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2332 * @see retro_core_options_v2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2333 * @see retro_core_option_v2_category
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2334 * @see retro_core_option_v2_definition
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2335 * @see RETRO_ENVIRONMENT_GET_VARIABLE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2336 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2337 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2338 #define RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2 67
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2339
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2340 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2341 * A variant of \ref RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2342 * that supports internationalization.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2343 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2344 * This should be called instead of \c RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2345 * if the core provides translations for its options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2346 * General use is largely the same,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2347 * but see \ref retro_core_options_v2_intl for some important details.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2348 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2349 * @param[in] data <tt>const struct retro_core_options_v2_intl *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2350 * Pointer to a core's option values and categories,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2351 * plus a translation for each option and category.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2352 * @see retro_core_options_v2_intl
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2353 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2354 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2355 #define RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL 68
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2356
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2357 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2358 * Registers a callback that the frontend can use
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2359 * to notify the core that at least one core option
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2360 * should be made hidden or visible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2361 * Allows a frontend to signal that a core must update
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2362 * the visibility of any dynamically hidden core options,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2363 * and enables the frontend to detect visibility changes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2364 * Used by the frontend to update the menu display status
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2365 * of core options without requiring a call of retro_run().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2366 * Must be called in retro_set_environment().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2367 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2368 * @param[in] data <tt>const struct retro_core_options_update_display_callback *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2369 * The callback that the frontend should use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2370 * May be \c NULL, in which case the frontend will unset any existing callback.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2371 * Can be used to query visibility support.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2372 * @return \c true if this environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2373 * even if \c data is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2374 * @see retro_core_options_update_display_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2375 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2376 #define RETRO_ENVIRONMENT_SET_CORE_OPTIONS_UPDATE_DISPLAY_CALLBACK 69
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2377
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2378 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2379 * Forcibly sets a core option's value.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2380 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2381 * After changing a core option value with this callback,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2382 * it will be reflected in the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2383 * and \ref RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE will return \c true.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2384 * \ref retro_variable::key must match
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2385 * a \ref RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2 "previously-set core option",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2386 * and \ref retro_variable::value must match one of its defined values.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2387 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2388 * Possible use cases include:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2389 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2390 * @li Allowing the player to set certain core options
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2391 * without entering the frontend's option menu,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2392 * using an in-core hotkey.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2393 * @li Adjusting invalid combinations of settings.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2394 * @li Migrating settings from older releases of a core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2395 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2396 * @param[in] data <tt>const struct retro_variable *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2397 * Pointer to a single option that the core is changing.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2398 * May be \c NULL, in which case the frontend will return \c true
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2399 * to indicate that this environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2400 * @return \c true if this environment call is available
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2401 * and the option named by \c key was successfully
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2402 * set to the given \c value.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2403 * \c false if the \c key or \c value fields are \c NULL, empty,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2404 * or don't match a previously set option.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2405 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2406 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2407 * @see RETRO_ENVIRONMENT_GET_VARIABLE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2408 * @see RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2409 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2410 #define RETRO_ENVIRONMENT_SET_VARIABLE 70
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2411
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2412 #define RETRO_ENVIRONMENT_GET_THROTTLE_STATE (71 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2413 /* struct retro_throttle_state * --
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2414 * Allows an implementation to get details on the actual rate
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2415 * the frontend is attempting to call retro_run().
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2416 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2417
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2418 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2419 * Returns information about how the frontend will use savestates.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2420 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2421 * @param[out] data <tt>retro_savestate_context *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2422 * Pointer to the current savestate context.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2423 * May be \c NULL, in which case the environment call
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2424 * will return \c true to indicate its availability.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2425 * @returns \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2426 * even if \c data is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2427 * @see retro_savestate_context
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2428 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2429 #define RETRO_ENVIRONMENT_GET_SAVESTATE_CONTEXT (72 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2430
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2431 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2432 * Before calling \c SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE, will query which interface is supported.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2433 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2434 * Frontend looks at \c retro_hw_render_interface_type and returns the maximum supported
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2435 * context negotiation interface version. If the \c retro_hw_render_interface_type is not
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2436 * supported or recognized by the frontend, a version of 0 must be returned in
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2437 * \c retro_hw_render_interface's \c interface_version and \c true is returned by frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2438 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2439 * If this environment call returns true with a \c interface_version greater than 0,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2440 * a core can always use a negotiation interface version larger than what the frontend returns,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2441 * but only earlier versions of the interface will be used by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2442 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2443 * A frontend must not reject a negotiation interface version that is larger than what the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2444 * frontend supports. Instead, the frontend will use the older entry points that it recognizes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2445 * If this is incompatible with a particular core's requirements, it can error out early.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2446 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2447 * @note Regarding backwards compatibility, this environment call was introduced after Vulkan v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2448 * context negotiation. If this environment call is not supported by frontend, i.e. the environment
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2449 * call returns \c false , only Vulkan v1 context negotiation is supported (if Vulkan HW rendering
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2450 * is supported at all). If a core uses Vulkan negotiation interface with version > 1, negotiation
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2451 * may fail unexpectedly. All future updates to the context negotiation interface implies that
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2452 * frontend must support this environment call to query support.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2453 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2454 * @param[out] data <tt>struct retro_hw_render_context_negotiation_interface *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2455 * @return \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2456 * @see SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2457 * @see retro_hw_render_interface_type
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2458 * @see retro_hw_render_context_negotiation_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2459 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2460 #define RETRO_ENVIRONMENT_GET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_SUPPORT (73 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2461
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2462 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2463 * Asks the frontend whether JIT compilation can be used.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2464 * Primarily used by iOS and tvOS.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2465 * @param[out] data <tt>bool *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2466 * Set to \c true if the frontend has verified that JIT compilation is possible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2467 * @return \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2468 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2469 #define RETRO_ENVIRONMENT_GET_JIT_CAPABLE 74
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2470
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2471 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2472 * Returns an interface that the core can use to receive microphone input.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2473 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2474 * @param[out] data <tt>retro_microphone_interface *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2475 * Pointer to the microphone interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2476 * @return \true if microphone support is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2477 * even if no microphones are plugged in.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2478 * \c false if microphone support is disabled unavailable,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2479 * or if \c data is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2480 * @see retro_microphone_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2481 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2482 #define RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE (75 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2483
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2484 /* Environment 76 was an obsolete version of RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2485 * It was not used by any known core at the time, and was removed from the API. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2486
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2487 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2488 * Returns the device's current power state as reported by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2489 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2490 * This is useful for emulating the battery level in handheld consoles,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2491 * or for reducing power consumption when on battery power.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2492 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2493 * @note This environment call describes the power state for the entire device,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2494 * not for individual peripherals like controllers.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2495 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2496 * @param[out] data <struct retro_device_power *>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2497 * Indicates whether the frontend can provide this information, even if the parameter
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2498 * is \c NULL. If the frontend does not support this functionality, then the provided
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2499 * argument will remain unchanged.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2500 * @return \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2501 * @see retro_device_power
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2502 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2503 #define RETRO_ENVIRONMENT_GET_DEVICE_POWER (77 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2504
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2505 #define RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE 78
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2506 /* const struct retro_netpacket_callback * --
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2507 * When set, a core gains control over network packets sent and
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2508 * received during a multiplayer session. This can be used to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2509 * emulate multiplayer games that were originally played on two
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2510 * or more separate consoles or computers connected together.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2511 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2512 * The frontend will take care of connecting players together,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2513 * and the core only needs to send the actual data as needed for
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2514 * the emulation, while handshake and connection management happen
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2515 * in the background.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2516 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2517 * When two or more players are connected and this interface has
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2518 * been set, time manipulation features (such as pausing, slow motion,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2519 * fast forward, rewinding, save state loading, etc.) are disabled to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2520 * avoid interrupting communication.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2521 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2522 * Should be set in either retro_init or retro_load_game, but not both.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2523 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2524 * When not set, a frontend may use state serialization-based
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2525 * multiplayer, where a deterministic core supporting multiple
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2526 * input devices does not need to take any action on its own.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2527 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2528
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2529 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2530 * Returns the device's current power state as reported by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2531 * This is useful for emulating the battery level in handheld consoles,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2532 * or for reducing power consumption when on battery power.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2533 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2534 * The return value indicates whether the frontend can provide this information,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2535 * even if the parameter is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2536 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2537 * If the frontend does not support this functionality,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2538 * then the provided argument will remain unchanged.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2539 * @param[out] data <tt>retro_device_power *</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2540 * Pointer to the information that the frontend returns about its power state.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2541 * May be \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2542 * @return \c true if the environment call is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2543 * even if \c data is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2544 * @see retro_device_power
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2545 * @note This environment call describes the power state for the entire device,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2546 * not for individual peripherals like controllers.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2547 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2548 #define RETRO_ENVIRONMENT_GET_DEVICE_POWER (77 | RETRO_ENVIRONMENT_EXPERIMENTAL)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2549
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2550 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2551 * Returns the "playlist" directory of the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2552 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2553 * This directory can be used to store core generated playlists, in case
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2554 * this internal functionality is available (e.g. internal core game detection
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2555 * engine).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2556 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2557 * @param[out] data <tt>const char **</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2558 * May be \c NULL. If so, no such directory is defined, and it's up to the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2559 * implementation to find a suitable directory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2560 * @return \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2561 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2562 #define RETRO_ENVIRONMENT_GET_PLAYLIST_DIRECTORY 79
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2563
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2564 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2565 * Returns the "file browser" start directory of the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2566 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2567 * This directory can serve as a start directory for the core in case it
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2568 * provides an internal way of loading content.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2569 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2570 * @param[out] data <tt>const char **</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2571 * May be \c NULL. If so, no such directory is defined, and it's up to the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2572 * implementation to find a suitable directory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2573 * @return \c true if the environment call is available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2574 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2575 #define RETRO_ENVIRONMENT_GET_FILE_BROWSER_START_DIRECTORY 80
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2576
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2577 /**@}*/
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2578
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2579 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2580 * @defgroup GET_VFS_INTERFACE File System Interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2581 * @brief File system functionality.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2582 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2583 * @section File Paths
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2584 * File paths passed to all libretro filesystem APIs shall be well formed UNIX-style,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2585 * using "/" (unquoted forward slash) as the directory separator
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2586 * regardless of the platform's native separator.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2587 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2588 * Paths shall also include at least one forward slash
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2589 * (e.g. use "./game.bin" instead of "game.bin").
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2590 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2591 * Other than the directory separator, cores shall not make assumptions about path format.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2592 * The following paths are all valid:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2593 * @li \c C:/path/game.bin
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2594 * @li \c http://example.com/game.bin
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2595 * @li \c #game/game.bin
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2596 * @li \c ./game.bin
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2597 *
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2598 * Cores may replace the basename or remove path components from the end, and/or add new components;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2599 * however, cores shall not append "./", "../" or multiple consecutive forward slashes ("//") to paths they request from the front end.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2600 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2601 * The frontend is encouraged to do the best it can when given an ill-formed path,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2602 * but it is allowed to give up.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2603 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2604 * Frontends are encouraged, but not required, to support native file system paths
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2605 * (including replacing the directory separator, if applicable).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2606 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2607 * Cores are allowed to try using them, but must remain functional if the frontend rejects such requests.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2608 *
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2609 * Cores are encouraged to use the libretro-common filestream functions for file I/O,
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2610 * as they seamlessly integrate with VFS,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2611 * deal with directory separator replacement as appropriate
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2612 * and provide platform-specific fallbacks
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2613 * in cases where front ends do not provide their own VFS interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2614 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2615 * @see RETRO_ENVIRONMENT_GET_VFS_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2616 * @see retro_vfs_interface_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2617 * @see file_path
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2618 * @see retro_dirent
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2619 * @see file_stream
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2620 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2621 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2622 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2623
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2624 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2625 * Opaque file handle.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2626 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2627 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2628 struct retro_vfs_file_handle;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2629
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2630 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2631 * Opaque directory handle.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2632 * @since VFS API v3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2633 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2634 struct retro_vfs_dir_handle;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2635
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2636 /** @defgroup RETRO_VFS_FILE_ACCESS File Access Flags
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2637 * File access flags.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2638 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2639 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2640 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2641
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2642 /** Opens a file for read-only access. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2643 #define RETRO_VFS_FILE_ACCESS_READ (1 << 0)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2644
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2645 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2646 * Opens a file for write-only access.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2647 * Any existing file at this path will be discarded and overwritten
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2648 * unless \c RETRO_VFS_FILE_ACCESS_UPDATE_EXISTING is also specified.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2649 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2650 #define RETRO_VFS_FILE_ACCESS_WRITE (1 << 1)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2651
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2652 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2653 * Opens a file for reading and writing.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2654 * Any existing file at this path will be discarded and overwritten
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2655 * unless \c RETRO_VFS_FILE_ACCESS_UPDATE_EXISTING is also specified.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2656 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2657 #define RETRO_VFS_FILE_ACCESS_READ_WRITE (RETRO_VFS_FILE_ACCESS_READ | RETRO_VFS_FILE_ACCESS_WRITE)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2658
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2659 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2660 * Opens a file without discarding its existing contents.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2661 * Only meaningful if \c RETRO_VFS_FILE_ACCESS_WRITE is specified.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2662 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2663 #define RETRO_VFS_FILE_ACCESS_UPDATE_EXISTING (1 << 2) /* Prevents discarding content of existing files opened for writing */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2664
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2665 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2666
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2667 /** @defgroup RETRO_VFS_FILE_ACCESS_HINT File Access Hints
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2668 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2669 * Hints to the frontend for how a file will be accessed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2670 * The VFS implementation may use these to optimize performance,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2671 * react to external interference (such as concurrent writes),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2672 * or it may ignore them entirely.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2673 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2674 * Hint flags do not change the behavior of each VFS function
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2675 * unless otherwise noted.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2676 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2677 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2678
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2679 /** No particular hints are given. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2680 #define RETRO_VFS_FILE_ACCESS_HINT_NONE (0)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2681
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2682 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2683 * Indicates that the file will be accessed frequently.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2684 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2685 * The frontend should cache it or map it into memory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2686 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2687 #define RETRO_VFS_FILE_ACCESS_HINT_FREQUENT_ACCESS (1 << 0)
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2688
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2689 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2690
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2691 /** @defgroup RETRO_VFS_SEEK_POSITION File Seek Positions
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2692 * File access flags and hints.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2693 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2694 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2695
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2696 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2697 * Indicates a seek relative to the start of the file.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2698 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2699 #define RETRO_VFS_SEEK_POSITION_START 0
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2700
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2701 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2702 * Indicates a seek relative to the current stream position.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2703 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2704 #define RETRO_VFS_SEEK_POSITION_CURRENT 1
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2705
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2706 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2707 * Indicates a seek relative to the end of the file.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2708 * @note The offset passed to \c retro_vfs_seek_t should be negative.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2709 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2710 #define RETRO_VFS_SEEK_POSITION_END 2
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2711
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2712 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2713
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2714 /** @defgroup RETRO_VFS_STAT File Status Flags
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2715 * File stat flags.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2716 * @see retro_vfs_stat_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2717 * @since VFS API v3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2718 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2719 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2720
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2721 /** Indicates that the given path refers to a valid file. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2722 #define RETRO_VFS_STAT_IS_VALID (1 << 0)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2723
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2724 /** Indicates that the given path refers to a directory. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2725 #define RETRO_VFS_STAT_IS_DIRECTORY (1 << 1)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2726
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2727 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2728 * Indicates that the given path refers to a character special file,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2729 * such as \c /dev/null.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2730 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2731 #define RETRO_VFS_STAT_IS_CHARACTER_SPECIAL (1 << 2)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2732
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2733 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2734
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2735 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2736 * Returns the path that was used to open this file.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2737 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2738 * @param stream The opened file handle to get the path of.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2739 * Behavior is undefined if \c NULL or closed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2740 * @return The path that was used to open \c stream.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2741 * The string is owned by \c stream and must not be modified.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2742 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2743 * @see filestream_get_path
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2744 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2745 typedef const char *(RETRO_CALLCONV *retro_vfs_get_path_t)(struct retro_vfs_file_handle *stream);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2746
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2747 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2748 * Open a file for reading or writing.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2749 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2750 * @param path The path to open.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2751 * @param mode A bitwise combination of \c RETRO_VFS_FILE_ACCESS flags.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2752 * At a minimum, one of \c RETRO_VFS_FILE_ACCESS_READ or \c RETRO_VFS_FILE_ACCESS_WRITE must be specified.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2753 * @param hints A bitwise combination of \c RETRO_VFS_FILE_ACCESS_HINT flags.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2754 * @return A handle to the opened file,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2755 * or \c NULL upon failure.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2756 * Note that this will return \c NULL if \c path names a directory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2757 * The returned file handle must be closed with \c retro_vfs_close_t.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2758 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2759 * @see File Paths
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2760 * @see RETRO_VFS_FILE_ACCESS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2761 * @see RETRO_VFS_FILE_ACCESS_HINT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2762 * @see retro_vfs_close_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2763 * @see filestream_open
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2764 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2765 typedef struct retro_vfs_file_handle *(RETRO_CALLCONV *retro_vfs_open_t)(const char *path, unsigned mode, unsigned hints);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2766
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2767 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2768 * Close the file and release its resources.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2769 * All files returned by \c retro_vfs_open_t must be closed with this function.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2770 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2771 * @param stream The file handle to close.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2772 * Behavior is undefined if already closed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2773 * Upon completion of this function, \c stream is no longer valid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2774 * (even if it returns failure).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2775 * @return 0 on success, -1 on failure or if \c stream is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2776 * @see retro_vfs_open_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2777 * @see filestream_close
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2778 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2779 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2780 typedef int (RETRO_CALLCONV *retro_vfs_close_t)(struct retro_vfs_file_handle *stream);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2781
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2782 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2783 * Return the size of the file in bytes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2784 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2785 * @param stream The file to query the size of.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2786 * @return Size of the file in bytes, or -1 if there was an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2787 * @see filestream_get_size
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2788 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2789 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2790 typedef int64_t (RETRO_CALLCONV *retro_vfs_size_t)(struct retro_vfs_file_handle *stream);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2791
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2792 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2793 * Set the file's length.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2794 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2795 * @param stream The file whose length will be adjusted.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2796 * @param length The new length of the file, in bytes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2797 * If shorter than the original length, the extra bytes will be discarded.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2798 * If longer, the file's padding is unspecified (and likely platform-dependent).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2799 * @return 0 on success,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2800 * -1 on failure.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2801 * @see filestream_truncate
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2802 * @since VFS API v2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2803 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2804 typedef int64_t (RETRO_CALLCONV *retro_vfs_truncate_t)(struct retro_vfs_file_handle *stream, int64_t length);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2805
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2806 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2807 * Gets the given file's current read/write position.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2808 * This position is advanced with each call to \c retro_vfs_read_t or \c retro_vfs_write_t.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2809 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2810 * @param stream The file to query the position of.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2811 * @return The current stream position in bytes
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2812 * or -1 if there was an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2813 * @see filestream_tell
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2814 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2815 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2816 typedef int64_t (RETRO_CALLCONV *retro_vfs_tell_t)(struct retro_vfs_file_handle *stream);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2817
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2818 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2819 * Sets the given file handle's current read/write position.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2820 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2821 * @param stream The file to set the position of.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2822 * @param offset The new position, in bytes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2823 * @param seek_position The position to seek from.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2824 * @return The new position,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2825 * or -1 if there was an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2826 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2827 * @see File Seek Positions
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2828 * @see filestream_seek
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2829 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2830 typedef int64_t (RETRO_CALLCONV *retro_vfs_seek_t)(struct retro_vfs_file_handle *stream, int64_t offset, int seek_position);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2831
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2832 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2833 * Read data from a file, if it was opened for reading.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2834 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2835 * @param stream The file to read from.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2836 * @param s The buffer to read into.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2837 * @param len The number of bytes to read.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2838 * The buffer pointed to by \c s must be this large.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2839 * @return The number of bytes read,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2840 * or -1 if there was an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2841 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2842 * @see filestream_read
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2843 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2844 typedef int64_t (RETRO_CALLCONV *retro_vfs_read_t)(struct retro_vfs_file_handle *stream, void *s, uint64_t len);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2845
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2846 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2847 * Write data to a file, if it was opened for writing.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2848 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2849 * @param stream The file handle to write to.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2850 * @param s The buffer to write from.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2851 * @param len The number of bytes to write.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2852 * The buffer pointed to by \c s must be this large.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2853 * @return The number of bytes written,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2854 * or -1 if there was an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2855 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2856 * @see filestream_write
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2857 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2858 typedef int64_t (RETRO_CALLCONV *retro_vfs_write_t)(struct retro_vfs_file_handle *stream, const void *s, uint64_t len);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2859
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2860 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2861 * Flush pending writes to the file, if applicable.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2862 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2863 * This does not mean that the changes will be immediately persisted to disk;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2864 * that may be scheduled for later, depending on the platform.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2865 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2866 * @param stream The file handle to flush.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2867 * @return 0 on success, -1 on failure.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2868 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2869 * @see filestream_flush
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2870 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2871 typedef int (RETRO_CALLCONV *retro_vfs_flush_t)(struct retro_vfs_file_handle *stream);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2872
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2873 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2874 * Deletes the file at the given path.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2875 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2876 * @param path The path to the file that will be deleted.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2877 * @return 0 on success, -1 on failure.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2878 * @see filestream_delete
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2879 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2880 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2881 typedef int (RETRO_CALLCONV *retro_vfs_remove_t)(const char *path);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2882
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2883 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2884 * Rename the specified file.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2885 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2886 * @param old_path Path to an existing file.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2887 * @param new_path The destination path.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2888 * Must not name an existing file.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2889 * @return 0 on success, -1 on failure
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2890 * @see filestream_rename
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2891 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2892 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2893 typedef int (RETRO_CALLCONV *retro_vfs_rename_t)(const char *old_path, const char *new_path);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2894
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2895 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2896 * Gets information about the given file.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2897 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2898 * @param path The path to the file to query.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2899 * @param[out] size The reported size of the file in bytes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2900 * May be \c NULL, in which case this value is ignored.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2901 * @return A bitmask of \c RETRO_VFS_STAT flags,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2902 * or 0 if \c path doesn't refer to a valid file.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2903 * @see path_stat
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2904 * @see path_get_size
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2905 * @see RETRO_VFS_STAT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2906 * @since VFS API v3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2907 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2908 typedef int (RETRO_CALLCONV *retro_vfs_stat_t)(const char *path, int32_t *size);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2909
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2910 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2911 * Creates a directory at the given path.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2912 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2913 * @param dir The desired location of the new directory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2914 * @return 0 if the directory was created,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2915 * -2 if the directory already exists,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2916 * or -1 if some other error occurred.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2917 * @see path_mkdir
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2918 * @since VFS API v3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2919 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2920 typedef int (RETRO_CALLCONV *retro_vfs_mkdir_t)(const char *dir);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2921
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2922 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2923 * Opens a handle to a directory so its contents can be inspected.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2924 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2925 * @param dir The path to the directory to open.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2926 * Must be an existing directory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2927 * @param include_hidden Whether to include hidden files in the directory listing.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2928 * The exact semantics of this flag will depend on the platform.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2929 * @return A handle to the opened directory,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2930 * or \c NULL if there was an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2931 * @see retro_opendir
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2932 * @since VFS API v3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2933 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2934 typedef struct retro_vfs_dir_handle *(RETRO_CALLCONV *retro_vfs_opendir_t)(const char *dir, bool include_hidden);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2935
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2936 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2937 * Gets the next dirent ("directory entry")
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2938 * within the given directory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2939 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2940 * @param[in,out] dirstream The directory to read from.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2941 * Updated to point to the next file, directory, or other path.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2942 * @return \c true when the next dirent was retrieved,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2943 * \c false if there are no more dirents to read.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2944 * @note This API iterates over all files and directories within \c dirstream.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2945 * Remember to check what the type of the current dirent is.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2946 * @note This function does not recurse,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2947 * i.e. it does not return the contents of subdirectories.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2948 * @note This may include "." and ".." on Unix-like platforms.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2949 * @see retro_readdir
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2950 * @see retro_vfs_dirent_is_dir_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2951 * @since VFS API v3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2952 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2953 typedef bool (RETRO_CALLCONV *retro_vfs_readdir_t)(struct retro_vfs_dir_handle *dirstream);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2954
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2955 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2956 * Gets the filename of the current dirent.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2957 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2958 * The returned string pointer is valid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2959 * until the next call to \c retro_vfs_readdir_t or \c retro_vfs_closedir_t.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2960 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2961 * @param dirstream The directory to read from.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2962 * @return The current dirent's name,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2963 * or \c NULL if there was an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2964 * @note This function only returns the file's \em name,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2965 * not a complete path to it.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2966 * @see retro_dirent_get_name
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2967 * @since VFS API v3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2968 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2969 typedef const char *(RETRO_CALLCONV *retro_vfs_dirent_get_name_t)(struct retro_vfs_dir_handle *dirstream);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2970
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2971 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2972 * Checks whether the current dirent names a directory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2973 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2974 * @param dirstream The directory to read from.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2975 * @return \c true if \c dirstream's current dirent points to a directory,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2976 * \c false if not or if there was an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2977 * @see retro_dirent_is_dir
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2978 * @since VFS API v3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2979 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2980 typedef bool (RETRO_CALLCONV *retro_vfs_dirent_is_dir_t)(struct retro_vfs_dir_handle *dirstream);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2981
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2982 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2983 * Closes the given directory and release its resources.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2984 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2985 * Must be called on any \c retro_vfs_dir_handle returned by \c retro_vfs_open_t.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2986 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2987 * @param dirstream The directory to close.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2988 * When this function returns (even failure),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2989 * \c dirstream will no longer be valid and must not be used.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2990 * @return 0 on success, -1 on failure.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2991 * @see retro_closedir
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2992 * @since VFS API v3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2993 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2994 typedef int (RETRO_CALLCONV *retro_vfs_closedir_t)(struct retro_vfs_dir_handle *dirstream);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2995
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2996 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2997 * File system interface exposed by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2998 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
2999 * @see dirent_vfs_init
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3000 * @see filestream_vfs_init
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3001 * @see path_vfs_init
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3002 * @see RETRO_ENVIRONMENT_GET_VFS_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3003 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3004 struct retro_vfs_interface
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3005 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3006 /* VFS API v1 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3007 /** @copydoc retro_vfs_get_path_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3008 retro_vfs_get_path_t get_path;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3009
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3010 /** @copydoc retro_vfs_open_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3011 retro_vfs_open_t open;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3012
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3013 /** @copydoc retro_vfs_close_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3014 retro_vfs_close_t close;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3015
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3016 /** @copydoc retro_vfs_size_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3017 retro_vfs_size_t size;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3018
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3019 /** @copydoc retro_vfs_tell_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3020 retro_vfs_tell_t tell;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3021
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3022 /** @copydoc retro_vfs_seek_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3023 retro_vfs_seek_t seek;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3024
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3025 /** @copydoc retro_vfs_read_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3026 retro_vfs_read_t read;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3027
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3028 /** @copydoc retro_vfs_write_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3029 retro_vfs_write_t write;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3030
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3031 /** @copydoc retro_vfs_flush_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3032 retro_vfs_flush_t flush;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3033
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3034 /** @copydoc retro_vfs_remove_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3035 retro_vfs_remove_t remove;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3036
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3037 /** @copydoc retro_vfs_rename_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3038 retro_vfs_rename_t rename;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3039 /* VFS API v2 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3040
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3041 /** @copydoc retro_vfs_truncate_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3042 retro_vfs_truncate_t truncate;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3043 /* VFS API v3 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3044
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3045 /** @copydoc retro_vfs_stat_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3046 retro_vfs_stat_t stat;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3047
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3048 /** @copydoc retro_vfs_mkdir_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3049 retro_vfs_mkdir_t mkdir;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3050
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3051 /** @copydoc retro_vfs_opendir_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3052 retro_vfs_opendir_t opendir;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3053
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3054 /** @copydoc retro_vfs_readdir_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3055 retro_vfs_readdir_t readdir;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3056
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3057 /** @copydoc retro_vfs_dirent_get_name_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3058 retro_vfs_dirent_get_name_t dirent_get_name;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3059
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3060 /** @copydoc retro_vfs_dirent_is_dir_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3061 retro_vfs_dirent_is_dir_t dirent_is_dir;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3062
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3063 /** @copydoc retro_vfs_closedir_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3064 retro_vfs_closedir_t closedir;
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3065 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3066
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3067 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3068 * Represents a request by the core for the frontend's file system interface,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3069 * as well as the interface itself returned by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3070 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3071 * You do not need to use these functions directly;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3072 * you may pass this struct to \c dirent_vfs_init,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3073 * \c filestream_vfs_init, or \c path_vfs_init
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3074 * so that you can use the wrappers provided by these modules.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3075 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3076 * @see dirent_vfs_init
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3077 * @see filestream_vfs_init
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3078 * @see path_vfs_init
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3079 * @see RETRO_ENVIRONMENT_GET_VFS_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3080 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3081 struct retro_vfs_interface_info
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3082 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3083 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3084 * The minimum version of the VFS API that the core requires.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3085 * libretro-common's wrapper API initializers will check this value as well.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3086 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3087 * Set to the core's desired VFS version when requesting an interface,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3088 * and set by the frontend to indicate its actual API version.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3089 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3090 * If the core asks for a newer VFS API version than the frontend supports,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3091 * the frontend must return \c false within the \c RETRO_ENVIRONMENT_GET_VFS_INTERFACE call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3092 * @since VFS API v1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3093 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3094 uint32_t required_interface_version;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3095
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3096 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3097 * Set by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3098 * The frontend will set this to the VFS interface it provides.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3099 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3100 * The interface is owned by the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3101 * and must not be modified or freed by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3102 * @since VFS API v1 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3103 struct retro_vfs_interface *iface;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3104 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3105
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3106 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3107
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3108 /** @defgroup GET_HW_RENDER_INTERFACE Hardware Rendering Interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3109 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3110 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3111
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3112 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3113 * Describes the hardware rendering API supported by
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3114 * a particular subtype of \c retro_hw_render_interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3115 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3116 * Not every rendering API supported by libretro has its own interface,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3117 * or even needs one.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3118 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3119 * @see RETRO_ENVIRONMENT_SET_HW_RENDER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3120 * @see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3121 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3122 enum retro_hw_render_interface_type
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3123 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3124 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3125 * Indicates a \c retro_hw_render_interface for Vulkan.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3126 * @see retro_hw_render_interface_vulkan
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3127 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3128 RETRO_HW_RENDER_INTERFACE_VULKAN = 0,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3129
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3130 /** Indicates a \c retro_hw_render_interface for Direct3D 9. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3131 RETRO_HW_RENDER_INTERFACE_D3D9 = 1,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3132
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3133 /** Indicates a \c retro_hw_render_interface for Direct3D 10. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3134 RETRO_HW_RENDER_INTERFACE_D3D10 = 2,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3135
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3136 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3137 * Indicates a \c retro_hw_render_interface for Direct3D 11.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3138 * @see retro_hw_render_interface_d3d11
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3139 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3140 RETRO_HW_RENDER_INTERFACE_D3D11 = 3,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3141
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3142 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3143 * Indicates a \c retro_hw_render_interface for Direct3D 12.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3144 * @see retro_hw_render_interface_d3d12
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3145 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3146 RETRO_HW_RENDER_INTERFACE_D3D12 = 4,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3147
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3148 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3149 * Indicates a \c retro_hw_render_interface for
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3150 * the PlayStation's 2 PSKit API.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3151 * @see retro_hw_render_interface_gskit_ps2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3152 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3153 RETRO_HW_RENDER_INTERFACE_GSKIT_PS2 = 5,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3154
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3155 /** @private Defined to ensure <tt>sizeof(retro_hw_render_interface_type) == sizeof(int)</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3156 * Do not use. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3157 RETRO_HW_RENDER_INTERFACE_DUMMY = INT_MAX
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3158 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3159
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3160 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3161 * Base render interface type.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3162 * All \c retro_hw_render_interface implementations
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3163 * will start with these two fields set to particular values.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3164 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3165 * @see retro_hw_render_interface_type
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3166 * @see RETRO_ENVIRONMENT_SET_HW_RENDER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3167 * @see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3168 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3169 struct retro_hw_render_interface
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3170 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3171 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3172 * Denotes the particular rendering API that this interface is for.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3173 * Each interface requires this field to be set to a particular value.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3174 * Use it to cast this interface to the appropriate pointer.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3175 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3176 enum retro_hw_render_interface_type interface_type;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3177
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3178 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3179 * The version of this rendering interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3180 * @note This is not related to the version of the API itself.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3181 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3182 unsigned interface_version;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3183 };
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3184
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3185 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3186
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3187 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3188 * @defgroup GET_LED_INTERFACE LED Interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3189 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3190 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3191
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3192 /** @copydoc retro_led_interface::set_led_state */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3193 typedef void (RETRO_CALLCONV *retro_set_led_state_t)(int led, int state);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3194
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3195 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3196 * Interface that the core can use to set the state of available LEDs.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3197 * @see RETRO_ENVIRONMENT_GET_LED_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3198 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3199 struct retro_led_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3200 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3201 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3202 * Sets the state of an LED.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3203 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3204 * @param led The LED to set the state of.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3205 * @param state The state to set the LED to.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3206 * \c true to enable, \c false to disable.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3207 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3208 retro_set_led_state_t set_led_state;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3209 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3210
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3211 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3212
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3213 /** @defgroup GET_AUDIO_VIDEO_ENABLE Skipped A/V Steps
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3214 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3215 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3216
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3217 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3218 * Flags that define A/V steps that the core may skip for this frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3219 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3220 * @see RETRO_ENVIRONMENT_GET_AUDIO_VIDEO_ENABLE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3221 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3222 enum retro_av_enable_flags
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3223 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3224 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3225 * If set, the core should render video output with \c retro_video_refresh_t as normal.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3226 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3227 * Otherwise, the frontend will discard any video data received this frame,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3228 * including frames presented via hardware acceleration.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3229 * \c retro_video_refresh_t will do nothing.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3230 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3231 * @note After running the frame, the video output of the next frame
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3232 * should be no different than if video was enabled,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3233 * and saving and loading state should have no issues.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3234 * This implies that the emulated console's graphics pipeline state
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3235 * should not be affected by this flag.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3236 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3237 * @note If emulating a platform that supports display capture
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3238 * (i.e. reading its own VRAM),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3239 * the core may not be able to completely skip rendering,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3240 * as the VRAM is part of the graphics pipeline's state.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3241 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3242 RETRO_AV_ENABLE_VIDEO = (1 << 0),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3243
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3244 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3245 * If set, the core should render audio output
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3246 * with \c retro_audio_sample_t or \c retro_audio_sample_batch_t as normal.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3247 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3248 * Otherwise, the frontend will discard any audio data received this frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3249 * The core should skip audio rendering if possible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3250 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3251 * @note After running the frame, the audio output of the next frame
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3252 * should be no different than if audio was enabled,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3253 * and saving and loading state should have no issues.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3254 * This implies that the emulated console's audio pipeline state
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3255 * should not be affected by this flag.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3256 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3257 RETRO_AV_ENABLE_AUDIO = (1 << 1),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3258
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3259 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3260 * If set, indicates that any savestates taken this frame
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3261 * are guaranteed to be created by the same binary that will load them,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3262 * and will not be written to or read from the disk.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3263 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3264 * The core may use these guarantees to:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3265 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3266 * @li Assume that loading state will succeed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3267 * @li Update its memory buffers in-place if possible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3268 * @li Skip clearing memory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3269 * @li Skip resetting the system.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3270 * @li Skip validation steps.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3271 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3272 * @deprecated Use \c RETRO_ENVIRONMENT_GET_SAVESTATE_CONTEXT instead,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3273 * except for compatibility purposes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3274 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3275 RETRO_AV_ENABLE_FAST_SAVESTATES = (1 << 2),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3276
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3277 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3278 * If set, indicates that the frontend will never need audio from the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3279 * Used by a frontend for implementing runahead via a secondary core instance.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3280 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3281 * The core may stop synthesizing audio if it can do so
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3282 * without compromising emulation accuracy.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3283 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3284 * Audio output for the next frame does not matter,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3285 * and the frontend will never need an accurate audio state in the future.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3286 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3287 * State will never be saved while this flag is set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3288 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3289 RETRO_AV_ENABLE_HARD_DISABLE_AUDIO = (1 << 3),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3290
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3291 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3292 * @private Defined to ensure <tt>sizeof(retro_av_enable_flags) == sizeof(int)</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3293 * Do not use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3294 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3295 RETRO_AV_ENABLE_DUMMY = INT_MAX
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3296 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3297
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3298 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3299
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3300 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3301 * @defgroup GET_MIDI_INTERFACE MIDI Interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3302 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3303 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3304
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3305 /** @copydoc retro_midi_interface::input_enabled */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3306 typedef bool (RETRO_CALLCONV *retro_midi_input_enabled_t)(void);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3307
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3308 /** @copydoc retro_midi_interface::output_enabled */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3309 typedef bool (RETRO_CALLCONV *retro_midi_output_enabled_t)(void);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3310
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3311 /** @copydoc retro_midi_interface::read */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3312 typedef bool (RETRO_CALLCONV *retro_midi_read_t)(uint8_t *byte);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3313
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3314 /** @copydoc retro_midi_interface::write */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3315 typedef bool (RETRO_CALLCONV *retro_midi_write_t)(uint8_t byte, uint32_t delta_time);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3316
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3317 /** @copydoc retro_midi_interface::flush */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3318 typedef bool (RETRO_CALLCONV *retro_midi_flush_t)(void);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3319
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3320 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3321 * Interface that the core can use for raw MIDI I/O.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3322 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3323 struct retro_midi_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3324 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3325 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3326 * Retrieves the current state of MIDI input.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3327 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3328 * @return \c true if MIDI input is enabled.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3329 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3330 retro_midi_input_enabled_t input_enabled;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3331
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3332 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3333 * Retrieves the current state of MIDI output.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3334 * @return \c true if MIDI output is enabled.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3335 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3336 retro_midi_output_enabled_t output_enabled;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3337
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3338 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3339 * Reads a byte from the MIDI input stream.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3340 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3341 * @param[out] byte The byte received from the input stream.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3342 * @return \c true if a byte was read,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3343 * \c false if MIDI input is disabled or \c byte is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3344 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3345 retro_midi_read_t read;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3346
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3347 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3348 * Writes a byte to the output stream.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3349 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3350 * @param byte The byte to write to the output stream.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3351 * @param delta_time Time since the previous write, in microseconds.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3352 * @return \c true if c\ byte was written, false otherwise.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3353 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3354 retro_midi_write_t write;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3355
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3356 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3357 * Flushes previously-written data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3358 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3359 * @return \c true if successful.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3360 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3361 retro_midi_flush_t flush;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3362 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3363
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3364 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3365
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3366 /** @defgroup SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE Render Context Negotiation
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3367 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3368 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3369
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3370 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3371 * Describes the hardware rendering API used by
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3372 * a particular subtype of \c retro_hw_render_context_negotiation_interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3373 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3374 * Not every rendering API supported by libretro has a context negotiation interface,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3375 * or even needs one.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3376 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3377 * @see RETRO_ENVIRONMENT_SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3378 * @see RETRO_ENVIRONMENT_SET_HW_RENDER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3379 * @see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3380 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3381 enum retro_hw_render_context_negotiation_interface_type
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3382 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3383 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3384 * Denotes a context negotiation interface for Vulkan.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3385 * @see retro_hw_render_context_negotiation_interface_vulkan
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3386 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3387 RETRO_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_VULKAN = 0,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3388
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3389 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3390 * @private Defined to ensure <tt>sizeof(retro_hw_render_context_negotiation_interface_type) == sizeof(int)</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3391 * Do not use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3392 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3393 RETRO_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_DUMMY = INT_MAX
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3394 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3395
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3396 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3397 * Base context negotiation interface type.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3398 * All \c retro_hw_render_context_negotiation_interface implementations
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3399 * will start with these two fields set to particular values.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3400 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3401 * @see retro_hw_render_interface_type
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3402 * @see RETRO_ENVIRONMENT_SET_HW_RENDER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3403 * @see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3404 * @see RETRO_ENVIRONMENT_SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3405 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3406 struct retro_hw_render_context_negotiation_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3407 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3408 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3409 * Denotes the particular rendering API that this interface is for.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3410 * Each interface requires this field to be set to a particular value.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3411 * Use it to cast this interface to the appropriate pointer.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3412 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3413 enum retro_hw_render_context_negotiation_interface_type interface_type;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3414
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3415 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3416 * The version of this negotiation interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3417 * @note This is not related to the version of the API itself.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3418 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3419 unsigned interface_version;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3420 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3421
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3422 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3423
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3424 /** @defgroup RETRO_SERIALIZATION_QUIRK Serialization Quirks
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3425 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3426 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3427
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3428 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3429 * Indicates that serialized state is incomplete in some way.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3430 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3431 * Set if serialization is usable for the common case of saving and loading game state,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3432 * but should not be relied upon for frame-sensitive frontend features
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3433 * such as netplay or rerecording.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3434 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3435 #define RETRO_SERIALIZATION_QUIRK_INCOMPLETE (1 << 0)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3436
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3437 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3438 * Indicates that core must spend some time initializing before serialization can be done.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3439 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3440 * \c retro_serialize(), \c retro_unserialize(), and \c retro_serialize_size() will initially fail.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3441 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3442 #define RETRO_SERIALIZATION_QUIRK_MUST_INITIALIZE (1 << 1)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3443
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3444 /** Set by the core to indicate that serialization size may change within a session. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3445 #define RETRO_SERIALIZATION_QUIRK_CORE_VARIABLE_SIZE (1 << 2)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3446
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3447 /** Set by the frontend to acknowledge that it supports variable-sized states. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3448 #define RETRO_SERIALIZATION_QUIRK_FRONT_VARIABLE_SIZE (1 << 3)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3449
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3450 /** Serialized state can only be loaded during the same session. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3451 #define RETRO_SERIALIZATION_QUIRK_SINGLE_SESSION (1 << 4)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3452
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3453 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3454 * Serialized state cannot be loaded on an architecture
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3455 * with a different endianness from the one it was saved on.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3456 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3457 #define RETRO_SERIALIZATION_QUIRK_ENDIAN_DEPENDENT (1 << 5)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3458
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3459 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3460 * Serialized state cannot be loaded on a different platform
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3461 * from the one it was saved on for reasons other than endianness,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3462 * such as word size dependence.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3463 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3464 #define RETRO_SERIALIZATION_QUIRK_PLATFORM_DEPENDENT (1 << 6)
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3465
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3466 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3467
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3468 /** @defgroup SET_MEMORY_MAPS Memory Descriptors
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3469 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3470 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3471
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3472 /** @defgroup RETRO_MEMDESC Memory Descriptor Flags
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3473 * Information about how the emulated hardware uses this portion of its address space.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3474 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3475 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3476
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3477 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3478 * Indicates that this memory area won't be modified
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3479 * once \c retro_load_game has returned.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3480 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3481 #define RETRO_MEMDESC_CONST (1 << 0)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3482
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3483 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3484 * Indicates a memory area with big-endian byte ordering,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3485 * as opposed to the default of little-endian.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3486 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3487 #define RETRO_MEMDESC_BIGENDIAN (1 << 1)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3488
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3489 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3490 * Indicates a memory area that is used for the emulated system's main RAM.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3491 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3492 #define RETRO_MEMDESC_SYSTEM_RAM (1 << 2)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3493
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3494 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3495 * Indicates a memory area that is used for the emulated system's save RAM,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3496 * usually found on a game cartridge as battery-backed RAM or flash memory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3497 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3498 #define RETRO_MEMDESC_SAVE_RAM (1 << 3)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3499
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3500 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3501 * Indicates a memory area that is used for the emulated system's video RAM,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3502 * usually found on a console's GPU (or local equivalent).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3503 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3504 #define RETRO_MEMDESC_VIDEO_RAM (1 << 4)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3505
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3506 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3507 * Indicates a memory area that requires all accesses
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3508 * to be aligned to 2 bytes or their own size
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3509 * (whichever is smaller).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3510 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3511 #define RETRO_MEMDESC_ALIGN_2 (1 << 16)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3512
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3513 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3514 * Indicates a memory area that requires all accesses
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3515 * to be aligned to 4 bytes or their own size
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3516 * (whichever is smaller).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3517 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3518 #define RETRO_MEMDESC_ALIGN_4 (2 << 16)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3519
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3520 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3521 * Indicates a memory area that requires all accesses
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3522 * to be aligned to 8 bytes or their own size
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3523 * (whichever is smaller).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3524 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3525 #define RETRO_MEMDESC_ALIGN_8 (3 << 16)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3526
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3527 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3528 * Indicates a memory area that requires all accesses
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3529 * to be at least 2 bytes long.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3530 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3531 #define RETRO_MEMDESC_MINSIZE_2 (1 << 24)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3532
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3533 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3534 * Indicates a memory area that requires all accesses
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3535 * to be at least 4 bytes long.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3536 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3537 #define RETRO_MEMDESC_MINSIZE_4 (2 << 24)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3538
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3539 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3540 * Indicates a memory area that requires all accesses
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3541 * to be at least 8 bytes long.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3542 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3543 #define RETRO_MEMDESC_MINSIZE_8 (3 << 24)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3544
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3545 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3546
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3547 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3548 * A mapping from a region of the emulated console's address space
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3549 * to the host's address space.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3550 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3551 * Can be used to map an address in the console's address space
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3552 * to the host's address space, like so:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3553 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3554 * @code
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3555 * void* emu_to_host(void* addr, struct retro_memory_descriptor* descriptor)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3556 * {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3557 * return descriptor->ptr + (addr & ~descriptor->disconnect) - descriptor->start;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3558 * }
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3559 * @endcode
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3560 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3561 * @see RETRO_ENVIRONMENT_SET_MEMORY_MAPS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3562 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3563 struct retro_memory_descriptor
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3564 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3565 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3566 * A bitwise \c OR of one or more \ref RETRO_MEMDESC "flags"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3567 * that describe how the emulated system uses this descriptor's address range.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3568 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3569 * @note If \c ptr is \c NULL,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3570 * then no flags should be set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3571 * @see RETRO_MEMDESC
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3572 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3573 uint64_t flags;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3574
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3575 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3576 * Pointer to the start of this memory region's buffer
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3577 * within the \em host's address space.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3578 * The address listed here must be valid for the duration of the session;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3579 * it must not be freed or modified by the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3580 * and it must not be moved by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3581 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3582 * May be \c NULL to indicate a lack of accessible memory
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3583 * at the emulated address given in \c start.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3584 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3585 * @note Overlapping descriptors that include the same byte
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3586 * must have the same \c ptr value.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3587 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3588 void *ptr;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3589
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3590 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3591 * The offset of this memory region,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3592 * relative to the address given by \c ptr.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3593 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3594 * @note It is recommended to use this field for address calculations
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3595 * instead of performing arithmetic on \c ptr.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3596 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3597 size_t offset;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3598
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3599 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3600 * The starting address of this memory region
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3601 * <em>within the emulated hardware's address space</em>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3602 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3603 * @note Not represented as a pointer
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3604 * because it's unlikely to be valid on the host device.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3605 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3606 size_t start;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3607
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3608 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3609 * A bitmask that specifies which bits of an address must match
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3610 * the bits of the \ref start address.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3611 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3612 * Combines with \c disconnect to map an address to a memory block.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3613 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3614 * If multiple memory descriptors can claim a particular byte,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3615 * the first one defined in the \ref retro_memory_descriptor array applies.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3616 * A bit which is set in \c start must also be set in this.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3617 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3618 * Can be zero, in which case \c start and \c len represent
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3619 * the complete mapping for this region of memory
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3620 * (i.e. each byte is mapped exactly once).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3621 * In this case, \c len must be a power of two.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3622 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3623 size_t select;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3624
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3625 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3626 * A bitmask of bits that are \em not used for addressing.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3627 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3628 * Any set bits are assumed to be disconnected from
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3629 * the emulated memory chip's address pins,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3630 * and are therefore ignored when memory-mapping.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3631 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3632 size_t disconnect;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3633
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3634 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3635 * The length of this memory region, in bytes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3636 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3637 * If applying \ref start and \ref disconnect to an address
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3638 * results in a value higher than this,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3639 * the highest bit of the address is cleared.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3640 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3641 * If the address is still too high, the next highest bit is cleared.
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3642 * Can be zero, in which case it's assumed to be
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3643 * bounded only by \ref select and \ref disconnect.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3644 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3645 size_t len;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3646
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3647 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3648 * A short name for this address space.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3649 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3650 * Names must meet the following requirements:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3651 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3652 * \li Characters must be in the set <tt>[a-zA-Z0-9_-]</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3653 * \li No more than 8 characters, plus a \c NULL terminator.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3654 * \li Names are case-sensitive, but lowercase characters are discouraged.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3655 * \li A name must not be the same as another name plus a character in the set \c [A-F0-9]
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3656 * (i.e. if an address space named "RAM" exists,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3657 * then the names "RAM0", "RAM1", ..., "RAMF" are forbidden).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3658 * This is to allow addresses to be named by each descriptor unambiguously,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3659 * even if the areas overlap.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3660 * \li May be \c NULL or empty (both are considered equivalent).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3661 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3662 * Here are some examples of pairs of address space names:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3663 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3664 * \li \em blank + \em blank: valid (multiple things may be mapped in the same namespace)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3665 * \li \c Sp + \c Sp: valid (multiple things may be mapped in the same namespace)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3666 * \li \c SRAM + \c VRAM: valid (neither is a prefix of the other)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3667 * \li \c V + \em blank: valid (\c V is not in \c [A-F0-9])
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3668 * \li \c a + \em blank: valid but discouraged (\c a is not in \c [A-F0-9])
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3669 * \li \c a + \c A: valid but discouraged (neither is a prefix of the other)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3670 * \li \c AR + \em blank: valid (\c R is not in \c [A-F0-9])
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3671 * \li \c ARB + \em blank: valid (there's no \c AR namespace,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3672 * so the \c B doesn't cause ambiguity).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3673 * \li \em blank + \c B: invalid, because it's ambiguous which address space \c B1234 would refer to.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3674 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3675 * The length of the address space's name can't be used to disambugiate,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3676 * as extra information may be appended to it without a separator.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3677 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3678 const char *addrspace;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3679
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3680 /* TODO: When finalizing this one, add a description field, which should be
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3681 * "WRAM" or something roughly equally long. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3682
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3683 /* TODO: When finalizing this one, replace 'select' with 'limit', which tells
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3684 * which bits can vary and still refer to the same address (limit = ~select).
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3685 * TODO: limit? range? vary? something else? */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3686
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3687 /* TODO: When finalizing this one, if 'len' is above what 'select' (or
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3688 * 'limit') allows, it's bankswitched. Bankswitched data must have both 'len'
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3689 * and 'select' != 0, and the mappings don't tell how the system switches the
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3690 * banks. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3691
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3692 /* TODO: When finalizing this one, fix the 'len' bit removal order.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3693 * For len=0x1800, pointer 0x1C00 should go to 0x1400, not 0x0C00.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3694 * Algorithm: Take bits highest to lowest, but if it goes above len, clear
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3695 * the most recent addition and continue on the next bit.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3696 * TODO: Can the above be optimized? Is "remove the lowest bit set in both
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3697 * pointer and 'len'" equivalent? */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3698
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3699 /* TODO: Some emulators (MAME?) emulate big endian systems by only accessing
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3700 * the emulated memory in 32-bit chunks, native endian. But that's nothing
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3701 * compared to Darek Mihocka <http://www.emulators.com/docs/nx07_vm101.htm>
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3702 * (section Emulation 103 - Nearly Free Byte Reversal) - he flips the ENTIRE
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3703 * RAM backwards! I'll want to represent both of those, via some flags.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3704 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3705 * I suspect MAME either didn't think of that idea, or don't want the #ifdef.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3706 * Not sure which, nor do I really care. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3707
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3708 /* TODO: Some of those flags are unused and/or don't really make sense. Clean
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3709 * them up. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3710 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3711
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3712 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3713 * A list of regions within the emulated console's address space.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3714 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3715 * The frontend may use the largest value of
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3716 * \ref retro_memory_descriptor::start + \ref retro_memory_descriptor::select
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3717 * in a certain namespace to infer the overall size of the address space.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3718 * If the address space is larger than that,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3719 * the last mapping in \ref descriptors should have \ref retro_memory_descriptor::ptr set to \c NULL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3720 * and \ref retro_memory_descriptor::select should have all bits used in the address space set to 1.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3721 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3722 * Here's an example set of descriptors for the SNES.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3723 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3724 * @code{.c}
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3725 * struct retro_memory_map snes_descriptors = retro_memory_map
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3726 * {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3727 * .descriptors = (struct retro_memory_descriptor[])
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3728 * {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3729 * // WRAM; must usually be mapped before the ROM,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3730 * // as some SNES ROM mappers try to claim 0x7E0000
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3731 * { .addrspace="WRAM", .start=0x7E0000, .len=0x20000 },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3732 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3733 * // SPC700 RAM
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3734 * { .addrspace="SPC700", .len=0x10000 },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3735 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3736 * // WRAM mirrors
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3737 * { .addrspace="WRAM", .start=0x000000, .select=0xC0E000, .len=0x2000 },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3738 * { .addrspace="WRAM", .start=0x800000, .select=0xC0E000, .len=0x2000 },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3739 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3740 * // WRAM mirror, alternate equivalent descriptor
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3741 * // (Various similar constructions can be created by combining parts of the above two.)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3742 * { .addrspace="WRAM", .select=0x40E000, .disconnect=~0x1FFF },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3743 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3744 * // LoROM (512KB, mirrored a couple of times)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3745 * { .addrspace="LoROM", .start=0x008000, .select=0x408000, .disconnect=0x8000, .len=512*1024, .flags=RETRO_MEMDESC_CONST },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3746 * { .addrspace="LoROM", .start=0x400000, .select=0x400000, .disconnect=0x8000, .len=512*1024, .flags=RETRO_MEMDESC_CONST },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3747 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3748 * // HiROM (4MB)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3749 * { .addrspace="HiROM", .start=0x400000, .select=0x400000, .len=4*1024*1024, .flags=RETRO_MEMDESC_CONST },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3750 * { .addrspace="HiROM", .start=0x008000, .select=0x408000, .len=4*1024*1024, .offset=0x8000, .flags=RETRO_MEMDESC_CONST },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3751 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3752 * // ExHiROM (8MB)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3753 * { .addrspace="ExHiROM", .start=0xC00000, .select=0xC00000, .len=4*1024*1024, .offset=0, .flags=RETRO_MEMDESC_CONST },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3754 * { .addrspace="ExHiROM", .start=0x400000, .select=0xC00000, .len=4*1024*1024, .offset=4*1024*1024, .flags=RETRO_MEMDESC_CONST },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3755 * { .addrspace="ExHiROM", .start=0x808000, .select=0xC08000, .len=4*1024*1024, .offset=0x8000, .flags=RETRO_MEMDESC_CONST },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3756 * { .addrspace="ExHiROM", .start=0x008000, .select=0xC08000, .len=4*1024*1024, .offset=4*1024*1024+0x8000, .flags=RETRO_MEMDESC_CONST },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3757 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3758 * // Clarifying the full size of the address space
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3759 * { .select=0xFFFFFF, .ptr=NULL },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3760 * },
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3761 * .num_descriptors = 14,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3762 * };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3763 * @endcode
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3764 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3765 * @see RETRO_ENVIRONMENT_SET_MEMORY_MAPS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3766 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3767 struct retro_memory_map
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3768 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3769 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3770 * Pointer to an array of memory descriptors,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3771 * each of which describes part of the emulated console's address space.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3772 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3773 const struct retro_memory_descriptor *descriptors;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3774
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3775 /** The number of descriptors in \c descriptors. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3776 unsigned num_descriptors;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3777 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3778
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3779 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3780
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3781 /** @defgroup SET_CONTROLLER_INFO Controller Info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3782 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3783 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3784
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3785 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3786 * Details about a controller (or controller configuration)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3787 * supported by one of a core's emulated input ports.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3788 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3789 * @see RETRO_ENVIRONMENT_SET_CONTROLLER_INFO
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3790 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3791 struct retro_controller_description
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3792 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3793 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3794 * A human-readable label for the controller or configuration
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3795 * represented by this device type.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3796 * Most likely the device's original brand name.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3797 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3798 const char *desc;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3799
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3800 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3801 * A unique identifier that will be passed to \c retro_set_controller_port_device()'s \c device parameter.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3802 * May be the ID of one of \ref RETRO_DEVICE "the generic controller types",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3803 * or a subclass ID defined with \c RETRO_DEVICE_SUBCLASS.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3804 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3805 * @see RETRO_DEVICE_SUBCLASS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3806 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3807 unsigned id;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3808 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3809
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3810 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3811 * Lists the types of controllers supported by
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3812 * one of core's emulated input ports.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3813 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3814 * @see RETRO_ENVIRONMENT_SET_CONTROLLER_INFO
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3815 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3816 struct retro_controller_info
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3817 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3818
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3819 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3820 * A pointer to an array of device types supported by this controller port.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3821 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3822 * @note Ports that support the same devices
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3823 * may share the same underlying array.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3824 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3825 const struct retro_controller_description *types;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3826
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3827 /** The number of elements in \c types. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3828 unsigned num_types;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3829 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3830
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3831 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3832
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3833 /** @defgroup SET_SUBSYSTEM_INFO Subsystems
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3834 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3835 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3836
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3837 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3838 * Information about a type of memory associated with a subsystem.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3839 * Usually used for SRAM (save RAM).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3840 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3841 * @see RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3842 * @see retro_get_memory_data
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3843 * @see retro_get_memory_size
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3844 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3845 struct retro_subsystem_memory_info
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3846 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3847 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3848 * The file extension the frontend should use
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3849 * to save this memory region to disk, e.g. "srm" or "sav".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3850 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3851 const char *extension;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3852
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3853 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3854 * A constant that identifies this type of memory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3855 * Should be at least 0x100 (256) to avoid conflict
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3856 * with the standard libretro memory types,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3857 * unless a subsystem uses the main platform's memory region.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3858 * @see RETRO_MEMORY
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3859 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3860 unsigned type;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3861 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3862
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3863 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3864 * Information about a type of ROM that a subsystem may use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3865 * Subsystems may use one or more ROMs at once,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3866 * possibly of different types.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3867 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3868 * @see RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3869 * @see retro_subsystem_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3870 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3871 struct retro_subsystem_rom_info
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3872 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3873 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3874 * Human-readable description of what the content represents,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3875 * e.g. "Game Boy ROM".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3876 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3877 const char *desc;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3878
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3879 /** @copydoc retro_system_info::valid_extensions */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3880 const char *valid_extensions;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3881
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3882 /** @copydoc retro_system_info::need_fullpath */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3883 bool need_fullpath;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3884
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3885 /** @copydoc retro_system_info::block_extract */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3886 bool block_extract;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3887
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3888 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3889 * Indicates whether this particular subsystem ROM is required.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3890 * If \c true and the user doesn't provide a ROM,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3891 * the frontend should not load the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3892 * If \c false and the user doesn't provide a ROM,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3893 * the frontend should pass a zeroed-out \c retro_game_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3894 * to the corresponding entry in \c retro_load_game_special().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3895 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3896 bool required;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3897
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3898 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3899 * Pointer to an array of memory descriptors that this subsystem ROM type uses.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3900 * Useful for secondary cartridges that have their own save data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3901 * May be \c NULL, in which case this subsystem ROM's memory is not persisted by the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3902 * and \c num_memory should be zero.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3903 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3904 const struct retro_subsystem_memory_info *memory;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3905
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3906 /** The number of elements in the array pointed to by \c memory. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3907 unsigned num_memory;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3908 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3909
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3910 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3911 * Information about a secondary platform that a core supports.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3912 * @see RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3913 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3914 struct retro_subsystem_info
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3915 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3916 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3917 * A human-readable description of the subsystem type,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3918 * usually the brand name of the original platform
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3919 * (e.g. "Super Game Boy").
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3920 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3921 const char *desc;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3922
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3923 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3924 * A short machine-friendly identifier for the subsystem,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3925 * usually an abbreviation of the platform name.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3926 * For example, a Super Game Boy subsystem for a SNES core
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3927 * might use an identifier of "sgb".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3928 * This identifier can be used for command-line interfaces,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3929 * configuration, or other purposes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3930 * Must use lower-case alphabetical characters only (i.e. from a-z).
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3931 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3932 const char *ident;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3933
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3934 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3935 * The list of ROM types that this subsystem may use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3936 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3937 * The first entry is considered to be the "most significant" content,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3938 * for the purposes of the frontend's categorization.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3939 * E.g. with Super GameBoy, the first content should be the GameBoy ROM,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3940 * as it is the most "significant" content to a user.
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3941 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3942 * If a frontend creates new files based on the content used (e.g. for savestates),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3943 * it should derive the filenames from the name of the first ROM in this list.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3944 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3945 * @note \c roms can have a single element,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3946 * but this is usually a sign that the core should broaden its
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3947 * primary system info instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3948 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3949 * @see \c retro_system_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3950 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3951 const struct retro_subsystem_rom_info *roms;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3952
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3953 /** The length of the array given in \c roms. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3954 unsigned num_roms;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3955
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3956 /** A unique identifier passed to retro_load_game_special(). */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3957 unsigned id;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3958 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3959
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3960 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3961
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3962 /** @defgroup SET_PROC_ADDRESS_CALLBACK Core Function Pointers
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3963 * @{ */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3964
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3965 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3966 * The function pointer type that \c retro_get_proc_address_t returns.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3967 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3968 * Despite the signature shown here, the original function may include any parameters and return type
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3969 * that respects the calling convention and C ABI.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3970 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3971 * The frontend is expected to cast the function pointer to the correct type.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3972 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3973 typedef void (RETRO_CALLCONV *retro_proc_address_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3974
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3975 /**
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3976 * Get a symbol from a libretro core.
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3977 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3978 * Cores should only return symbols that serve as libretro extensions.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3979 * Frontends should not use this to obtain symbols to standard libretro entry points;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3980 * instead, they should link to the core statically or use \c dlsym (or local equivalent).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3981 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3982 * The symbol name must be equal to the function name.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3983 * e.g. if <tt>void retro_foo(void);</tt> exists, the symbol in the compiled library must be called \c retro_foo.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3984 * The returned function pointer must be cast to the corresponding type.
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3985 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3986 * @param \c sym The name of the symbol to look up.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3987 * @return Pointer to the exposed function with the name given in \c sym,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3988 * or \c NULL if one couldn't be found.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3989 * @note The frontend is expected to know the returned pointer's type in advance
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3990 * so that it can be cast correctly.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3991 * @note The core doesn't need to expose every possible function through this interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3992 * It's enough to only expose the ones that it expects the frontend to use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3993 * @note The functions exposed through this interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3994 * don't need to be publicly exposed in the compiled library
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3995 * (e.g. via \c __declspec(dllexport)).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
3996 * @see RETRO_ENVIRONMENT_SET_PROC_ADDRESS_CALLBACK
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3997 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3998 typedef retro_proc_address_t (RETRO_CALLCONV *retro_get_proc_address_t)(const char *sym);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3999
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4000 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4001 * An interface that the frontend can use to get function pointers from the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4002 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4003 * @note The returned function pointer will be invalidated once the core is unloaded.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4004 * How and when that happens is up to the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4005 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4006 * @see retro_get_proc_address_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4007 * @see RETRO_ENVIRONMENT_SET_PROC_ADDRESS_CALLBACK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4008 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4009 struct retro_get_proc_address_interface
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4010 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4011 /** Set by the core. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4012 retro_get_proc_address_t get_proc_address;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4013 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4014
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4015 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4016
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4017 /** @defgroup GET_LOG_INTERFACE Logging
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4018 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4019 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4020
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4021 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4022 * The severity of a given message.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4023 * The frontend may log messages differently depending on the level.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4024 * It may also ignore log messages of a certain level.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4025 * @see retro_log_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4026 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4027 enum retro_log_level
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4028 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4029 /** The logged message is most likely not interesting to the user. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4030 RETRO_LOG_DEBUG = 0,
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4031
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4032 /** Information about the core operating normally. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4033 RETRO_LOG_INFO,
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4034
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4035 /** Indicates a potential problem, possibly one that the core can recover from. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4036 RETRO_LOG_WARN,
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4037
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4038 /** Indicates a degraded experience, if not failure. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4039 RETRO_LOG_ERROR,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4040
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4041 /** Defined to ensure that sizeof(enum retro_log_level) == sizeof(int). Do not use. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4042 RETRO_LOG_DUMMY = INT_MAX
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4043 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4044
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4045 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4046 * Logs a message to the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4047 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4048 * @param level The log level of the message.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4049 * @param fmt The format string to log.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4050 * Same format as \c printf.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4051 * Behavior is undefined if this is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4052 * @param ... Zero or more arguments used by the format string.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4053 * Behavior is undefined if these don't match the ones expected by \c fmt.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4054 * @see retro_log_level
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4055 * @see retro_log_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4056 * @see RETRO_ENVIRONMENT_GET_LOG_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4057 * @see printf
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4058 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4059 typedef void (RETRO_CALLCONV *retro_log_printf_t)(enum retro_log_level level,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4060 const char *fmt, ...);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4061
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4062 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4063 * Details about how to make log messages.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4064 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4065 * @see retro_log_printf_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4066 * @see RETRO_ENVIRONMENT_GET_LOG_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4067 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4068 struct retro_log_callback
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4069 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4070 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4071 * Called when logging a message.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4072 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4073 * @note Set by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4074 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4075 retro_log_printf_t log;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4076 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4077
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4078 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4079
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4080 /** @defgroup GET_PERF_INTERFACE Performance Interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4081 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4082 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4083
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4084 /** @defgroup RETRO_SIMD CPU Features
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4085 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4086 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4087
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4088 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4089 * Indicates CPU support for the SSE instruction set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4090 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4091 * @see https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#ssetechs=SSE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4092 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4093 #define RETRO_SIMD_SSE (1 << 0)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4094
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4095 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4096 * Indicates CPU support for the SSE2 instruction set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4097 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4098 * @see https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#ssetechs=SSE2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4099 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4100 #define RETRO_SIMD_SSE2 (1 << 1)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4101
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4102 /** Indicates CPU support for the AltiVec (aka VMX or Velocity Engine) instruction set. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4103 #define RETRO_SIMD_VMX (1 << 2)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4104
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4105 /** Indicates CPU support for the VMX128 instruction set. Xbox 360 only. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4106 #define RETRO_SIMD_VMX128 (1 << 3)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4107
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4108 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4109 * Indicates CPU support for the AVX instruction set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4110 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4111 * @see https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#avxnewtechs=AVX
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4112 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4113 #define RETRO_SIMD_AVX (1 << 4)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4114
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4115 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4116 * Indicates CPU support for the NEON instruction set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4117 * @see https://developer.arm.com/architectures/instruction-sets/intrinsics/#f:@navigationhierarchiessimdisa=[Neon]
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4118 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4119 #define RETRO_SIMD_NEON (1 << 5)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4120
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4121 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4122 * Indicates CPU support for the SSE3 instruction set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4123 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4124 * @see https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#ssetechs=SSE3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4125 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4126 #define RETRO_SIMD_SSE3 (1 << 6)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4127
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4128 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4129 * Indicates CPU support for the SSSE3 instruction set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4130 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4131 * @see https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#ssetechs=SSSE3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4132 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4133 #define RETRO_SIMD_SSSE3 (1 << 7)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4134
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4135 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4136 * Indicates CPU support for the MMX instruction set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4137 * @see https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#techs=MMX
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4138 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4139 #define RETRO_SIMD_MMX (1 << 8)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4140
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4141 /** Indicates CPU support for the MMXEXT instruction set. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4142 #define RETRO_SIMD_MMXEXT (1 << 9)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4143
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4144 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4145 * Indicates CPU support for the SSE4 instruction set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4146 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4147 * @see https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#ssetechs=SSE4_1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4148 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4149 #define RETRO_SIMD_SSE4 (1 << 10)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4150
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4151 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4152 * Indicates CPU support for the SSE4.2 instruction set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4153 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4154 * @see https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#ssetechs=SSE4_2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4155 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4156 #define RETRO_SIMD_SSE42 (1 << 11)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4157
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4158 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4159 * Indicates CPU support for the AVX2 instruction set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4160 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4161 * @see https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#avxnewtechs=AVX2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4162 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4163 #define RETRO_SIMD_AVX2 (1 << 12)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4164
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4165 /** Indicates CPU support for the VFPU instruction set. PS2 and PSP only.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4166 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4167 * @see https://pspdev.github.io/vfpu-docs
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4168 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4169 #define RETRO_SIMD_VFPU (1 << 13)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4170
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4171 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4172 * Indicates CPU support for Gekko SIMD extensions. GameCube only.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4173 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4174 #define RETRO_SIMD_PS (1 << 14)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4175
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4176 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4177 * Indicates CPU support for AES instructions.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4178 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4179 * @see https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#aestechs=AES&othertechs=AES
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4180 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4181 #define RETRO_SIMD_AES (1 << 15)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4182
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4183 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4184 * Indicates CPU support for the VFPv3 instruction set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4185 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4186 #define RETRO_SIMD_VFPV3 (1 << 16)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4187
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4188 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4189 * Indicates CPU support for the VFPv4 instruction set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4190 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4191 #define RETRO_SIMD_VFPV4 (1 << 17)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4192
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4193 /** Indicates CPU support for the POPCNT instruction. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4194 #define RETRO_SIMD_POPCNT (1 << 18)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4195
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4196 /** Indicates CPU support for the MOVBE instruction. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4197 #define RETRO_SIMD_MOVBE (1 << 19)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4198
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4199 /** Indicates CPU support for the CMOV instruction. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4200 #define RETRO_SIMD_CMOV (1 << 20)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4201
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4202 /** Indicates CPU support for the ASIMD instruction set. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4203 #define RETRO_SIMD_ASIMD (1 << 21)
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4204
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4205 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4206
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4207 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4208 * An abstract unit of ticks.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4209 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4210 * Usually nanoseconds or CPU cycles,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4211 * but it depends on the platform and the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4212 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4213 typedef uint64_t retro_perf_tick_t;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4214
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4215 /** Time in microseconds. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4216 typedef int64_t retro_time_t;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4217
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4218 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4219 * A performance counter.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4220 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4221 * Use this to measure the execution time of a region of code.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4222 * @see retro_perf_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4223 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4224 struct retro_perf_counter
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4225 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4226 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4227 * A human-readable identifier for the counter.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4228 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4229 * May be displayed by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4230 * Behavior is undefined if this is \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4231 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4232 const char *ident;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4233
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4234 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4235 * The time of the most recent call to \c retro_perf_callback::perf_start
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4236 * on this performance counter.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4237 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4238 * @see retro_perf_start_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4239 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4240 retro_perf_tick_t start;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4241
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4242 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4243 * The total time spent within this performance counter's measured code,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4244 * i.e. between calls to \c retro_perf_callback::perf_start and \c retro_perf_callback::perf_stop.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4245 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4246 * Updated after each call to \c retro_perf_callback::perf_stop.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4247 * @see retro_perf_stop_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4248 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4249 retro_perf_tick_t total;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4250
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4251 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4252 * The number of times this performance counter has been started.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4253 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4254 * Updated after each call to \c retro_perf_callback::perf_start.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4255 * @see retro_perf_start_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4256 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4257 retro_perf_tick_t call_cnt;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4258
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4259 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4260 * \c true if this performance counter has been registered by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4261 * Must be initialized to \c false by the core before registering it.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4262 * @see retro_perf_register_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4263 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4264 bool registered;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4265 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4266
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4267 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4268 * @returns The current system time in microseconds.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4269 * @note Accuracy may vary by platform.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4270 * The frontend should use the most accurate timer possible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4271 * @see RETRO_ENVIRONMENT_GET_PERF_INTERFACE
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4272 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4273 typedef retro_time_t (RETRO_CALLCONV *retro_perf_get_time_usec_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4274
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4275 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4276 * @returns The number of ticks since some unspecified epoch.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4277 * The exact meaning of a "tick" depends on the platform,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4278 * but it usually refers to nanoseconds or CPU cycles.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4279 * @see RETRO_ENVIRONMENT_GET_PERF_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4280 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4281 typedef retro_perf_tick_t (RETRO_CALLCONV *retro_perf_get_counter_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4282
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4283 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4284 * Returns a bitmask of detected CPU features.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4285 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4286 * Use this for runtime dispatching of CPU-specific code.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4287 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4288 * @returns A bitmask of detected CPU features.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4289 * @see RETRO_ENVIRONMENT_GET_PERF_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4290 * @see RETRO_SIMD
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4291 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4292 typedef uint64_t (RETRO_CALLCONV *retro_get_cpu_features_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4293
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4294 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4295 * Asks the frontend to log or display the state of performance counters.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4296 * How this is done depends on the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4297 * Performance counters can be reviewed manually as well.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4298 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4299 * @see RETRO_ENVIRONMENT_GET_PERF_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4300 * @see retro_perf_counter
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4301 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4302 typedef void (RETRO_CALLCONV *retro_perf_log_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4303
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4304 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4305 * Registers a new performance counter.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4306 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4307 * If \c counter has already been registered beforehand,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4308 * this function does nothing.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4309 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4310 * @param counter The counter to register.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4311 * \c counter::ident must be set to a unique identifier,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4312 * and all other values in \c counter must be set to zero or \c false.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4313 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4314 * @post If \c counter is successfully registered,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4315 * then \c counter::registered will be set to \c true.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4316 * Otherwise, it will be set to \c false.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4317 * Registration may fail if the frontend's maximum number of counters (if any) has been reached.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4318 * @note The counter is owned by the core and must not be freed by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4319 * The frontend must also clean up any references to a core's performance counters
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4320 * before unloading it, otherwise undefined behavior may occur.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4321 * @see retro_perf_start_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4322 * @see retro_perf_stop_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4323 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4324 typedef void (RETRO_CALLCONV *retro_perf_register_t)(struct retro_perf_counter *counter);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4325
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4326 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4327 * Starts a registered performance counter.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4328 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4329 * Call this just before the code you want to measure.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4330 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4331 * @param counter The counter to start.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4332 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4333 * @see retro_perf_stop_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4334 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4335 typedef void (RETRO_CALLCONV *retro_perf_start_t)(struct retro_perf_counter *counter);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4336
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4337 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4338 * Stops a registered performance counter.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4339 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4340 * Call this just after the code you want to measure.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4341 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4342 * @param counter The counter to stop.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4343 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4344 * @see retro_perf_start_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4345 * @see retro_perf_stop_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4346 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4347 typedef void (RETRO_CALLCONV *retro_perf_stop_t)(struct retro_perf_counter *counter);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4348
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4349 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4350 * An interface that the core can use to get performance information.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4351 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4352 * Here's a usage example:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4353 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4354 * @code{.c}
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4355 * #ifdef PROFILING
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4356 * // Wrapper macros to simplify using performance counters.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4357 * // Optional; tailor these to your project's needs.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4358 * #define RETRO_PERFORMANCE_INIT(perf_cb, name) static struct retro_perf_counter name = {#name}; if (!name.registered) perf_cb.perf_register(&(name))
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4359 * #define RETRO_PERFORMANCE_START(perf_cb, name) perf_cb.perf_start(&(name))
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4360 * #define RETRO_PERFORMANCE_STOP(perf_cb, name) perf_cb.perf_stop(&(name))
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4361 * #else
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4362 * // Exclude the performance counters if profiling is disabled.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4363 * #define RETRO_PERFORMANCE_INIT(perf_cb, name) ((void)0)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4364 * #define RETRO_PERFORMANCE_START(perf_cb, name) ((void)0)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4365 * #define RETRO_PERFORMANCE_STOP(perf_cb, name) ((void)0)
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4366 * #endif
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4367 *
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4368 * // Defined somewhere else in the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4369 * extern struct retro_perf_callback perf_cb;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4370 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4371 * void retro_run(void)
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4372 * {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4373 * RETRO_PERFORMANCE_INIT(cb, interesting);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4374 * RETRO_PERFORMANCE_START(cb, interesting);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4375 * interesting_work();
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4376 * RETRO_PERFORMANCE_STOP(cb, interesting);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4377 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4378 * RETRO_PERFORMANCE_INIT(cb, maybe_slow);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4379 * RETRO_PERFORMANCE_START(cb, maybe_slow);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4380 * more_interesting_work();
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4381 * RETRO_PERFORMANCE_STOP(cb, maybe_slow);
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4382 * }
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4383 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4384 * void retro_deinit(void)
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4385 * {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4386 * // Asks the frontend to log the results of all performance counters.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4387 * perf_cb.perf_log();
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4388 * }
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4389 * @endcode
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4390 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4391 * All functions are set by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4392 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4393 * @see RETRO_ENVIRONMENT_GET_PERF_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4394 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4395 struct retro_perf_callback
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4396 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4397 /** @copydoc retro_perf_get_time_usec_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4398 retro_perf_get_time_usec_t get_time_usec;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4399
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4400 /** @copydoc retro_perf_get_counter_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4401 retro_get_cpu_features_t get_cpu_features;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4402
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4403 /** @copydoc retro_perf_get_counter_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4404 retro_perf_get_counter_t get_perf_counter;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4405
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4406 /** @copydoc retro_perf_register_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4407 retro_perf_register_t perf_register;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4408
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4409 /** @copydoc retro_perf_start_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4410 retro_perf_start_t perf_start;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4411
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4412 /** @copydoc retro_perf_stop_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4413 retro_perf_stop_t perf_stop;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4414
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4415 /** @copydoc retro_perf_log_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4416 retro_perf_log_t perf_log;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4417 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4418
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4419 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4420
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4421 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4422 * @defgroup RETRO_SENSOR Sensor Interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4423 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4424 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4425
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4426 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4427 * Defines actions that can be performed on sensors.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4428 * @note Cores should only enable sensors while they're actively being used;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4429 * depending on the frontend and platform,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4430 * enabling these sensors may impact battery life.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4431 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4432 * @see RETRO_ENVIRONMENT_GET_SENSOR_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4433 * @see retro_sensor_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4434 * @see retro_set_sensor_state_t
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4435 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4436 enum retro_sensor_action
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4437 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4438 /** Enables accelerometer input, if one exists. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4439 RETRO_SENSOR_ACCELEROMETER_ENABLE = 0,
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4440
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4441 /** Disables accelerometer input, if one exists. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4442 RETRO_SENSOR_ACCELEROMETER_DISABLE,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4443
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4444 /** Enables gyroscope input, if one exists. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4445 RETRO_SENSOR_GYROSCOPE_ENABLE,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4446
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4447 /** Disables gyroscope input, if one exists. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4448 RETRO_SENSOR_GYROSCOPE_DISABLE,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4449
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4450 /** Enables ambient light input, if a luminance sensor exists. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4451 RETRO_SENSOR_ILLUMINANCE_ENABLE,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4452
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4453 /** Disables ambient light input, if a luminance sensor exists. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4454 RETRO_SENSOR_ILLUMINANCE_DISABLE,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4455
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4456 /** @private Defined to ensure <tt>sizeof(enum retro_sensor_action) == sizeof(int)</tt>. Do not use. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4457 RETRO_SENSOR_DUMMY = INT_MAX
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4458 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4459
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4460 /** @defgroup RETRO_SENSOR_ID Sensor Value IDs
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4461 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4462 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4463 /* Id values for SENSOR types. */
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4464
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4465 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4466 * Returns the device's acceleration along its local X axis minus the effect of gravity, in m/s^2.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4467 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4468 * Positive values mean that the device is accelerating to the right.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4469 * assuming the user is looking at it head-on.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4470 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4471 #define RETRO_SENSOR_ACCELEROMETER_X 0
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4472
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4473 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4474 * Returns the device's acceleration along its local Y axis minus the effect of gravity, in m/s^2.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4475 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4476 * Positive values mean that the device is accelerating upwards,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4477 * assuming the user is looking at it head-on.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4478 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4479 #define RETRO_SENSOR_ACCELEROMETER_Y 1
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4480
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4481 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4482 * Returns the the device's acceleration along its local Z axis minus the effect of gravity, in m/s^2.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4483 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4484 * Positive values indicate forward acceleration towards the user,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4485 * assuming the user is looking at the device head-on.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4486 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4487 #define RETRO_SENSOR_ACCELEROMETER_Z 2
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4488
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4489 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4490 * Returns the angular velocity of the device around its local X axis, in radians per second.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4491 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4492 * Positive values indicate counter-clockwise rotation.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4493 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4494 * @note A radian is about 57 degrees, and a full 360-degree rotation is 2*pi radians.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4495 * @see https://developer.android.com/reference/android/hardware/SensorEvent#sensor.type_gyroscope
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4496 * for guidance on using this value to derive a device's orientation.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4497 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4498 #define RETRO_SENSOR_GYROSCOPE_X 3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4499
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4500 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4501 * Returns the angular velocity of the device around its local Z axis, in radians per second.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4502 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4503 * Positive values indicate counter-clockwise rotation.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4504 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4505 * @note A radian is about 57 degrees, and a full 360-degree rotation is 2*pi radians.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4506 * @see https://developer.android.com/reference/android/hardware/SensorEvent#sensor.type_gyroscope
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4507 * for guidance on using this value to derive a device's orientation.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4508 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4509 #define RETRO_SENSOR_GYROSCOPE_Y 4
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4510
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4511 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4512 * Returns the angular velocity of the device around its local Z axis, in radians per second.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4513 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4514 * Positive values indicate counter-clockwise rotation.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4515 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4516 * @note A radian is about 57 degrees, and a full 360-degree rotation is 2*pi radians.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4517 * @see https://developer.android.com/reference/android/hardware/SensorEvent#sensor.type_gyroscope
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4518 * for guidance on using this value to derive a device's orientation.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4519 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4520 #define RETRO_SENSOR_GYROSCOPE_Z 5
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4521
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4522 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4523 * Returns the ambient illuminance (light intensity) of the device's environment, in lux.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4524 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4525 * @see https://en.wikipedia.org/wiki/Lux for a table of common lux values.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4526 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4527 #define RETRO_SENSOR_ILLUMINANCE 6
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4528 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4529
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4530 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4531 * Adjusts the state of a sensor.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4532 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4533 * @param port The device port of the controller that owns the sensor given in \c action.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4534 * @param action The action to perform on the sensor.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4535 * Different devices support different sensors.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4536 * @param rate The rate at which the underlying sensor should be updated, in Hz.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4537 * This should be treated as a hint,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4538 * as some device sensors may not support the requested rate
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4539 * (if it's configurable at all).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4540 * @returns \c true if the sensor state was successfully adjusted, \c false otherwise.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4541 * @note If one of the \c RETRO_SENSOR_*_ENABLE actions fails,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4542 * this likely means that the given sensor is not available
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4543 * on the provided \c port.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4544 * @see retro_sensor_action
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4545 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4546 typedef bool (RETRO_CALLCONV *retro_set_sensor_state_t)(unsigned port,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4547 enum retro_sensor_action action, unsigned rate);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4548
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4549 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4550 * Retrieves the current value reported by sensor.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4551 * @param port The device port of the controller that owns the sensor given in \c id.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4552 * @param id The sensor value to query.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4553 * @returns The current sensor value.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4554 * Exact semantics depend on the value given in \c id,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4555 * but will return 0 for invalid arguments.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4556 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4557 * @see RETRO_SENSOR_ID
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4558 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4559 typedef float (RETRO_CALLCONV *retro_sensor_get_input_t)(unsigned port, unsigned id);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4560
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4561 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4562 * An interface that cores can use to access device sensors.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4563 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4564 * All function pointers are set by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4565 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4566 struct retro_sensor_interface
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4567 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4568 /** @copydoc retro_set_sensor_state_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4569 retro_set_sensor_state_t set_sensor_state;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4570
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4571 /** @copydoc retro_sensor_get_input_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4572 retro_sensor_get_input_t get_sensor_input;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4573 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4574
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4575 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4576
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4577 /** @defgroup GET_CAMERA_INTERFACE Camera Interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4578 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4579 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4580
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4581 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4582 * Denotes the type of buffer in which the camera will store its input.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4583 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4584 * Different camera drivers may support different buffer types.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4585 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4586 * @see RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4587 * @see retro_camera_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4588 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4589 enum retro_camera_buffer
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4590 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4591 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4592 * Indicates that camera frames should be delivered to the core as an OpenGL texture.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4593 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4594 * Requires that the core is using an OpenGL context via \c RETRO_ENVIRONMENT_SET_HW_RENDER.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4595 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4596 * @see retro_camera_frame_opengl_texture_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4597 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4598 RETRO_CAMERA_BUFFER_OPENGL_TEXTURE = 0,
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4599
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4600 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4601 * Indicates that camera frames should be delivered to the core as a raw buffer in memory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4602 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4603 * @see retro_camera_frame_raw_framebuffer_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4604 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4605 RETRO_CAMERA_BUFFER_RAW_FRAMEBUFFER,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4606
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4607 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4608 * @private Defined to ensure <tt>sizeof(enum retro_camera_buffer) == sizeof(int)</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4609 * Do not use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4610 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4611 RETRO_CAMERA_BUFFER_DUMMY = INT_MAX
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4612 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4613
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4614 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4615 * Starts an initialized camera.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4616 * The camera is disabled by default,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4617 * and must be enabled with this function before being used.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4618 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4619 * Set by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4620 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4621 * @returns \c true if the camera was successfully started, \c false otherwise.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4622 * Failure may occur if no actual camera is available,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4623 * or if the frontend doesn't have permission to access it.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4624 * @note Must be called in \c retro_run().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4625 * @see retro_camera_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4626 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4627 typedef bool (RETRO_CALLCONV *retro_camera_start_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4628
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4629 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4630 * Stops the running camera.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4631 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4632 * Set by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4633 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4634 * @note Must be called in \c retro_run().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4635 * @warning The frontend may close the camera on its own when unloading the core,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4636 * but this behavior is not guaranteed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4637 * Cores should clean up the camera before exiting.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4638 * @see retro_camera_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4639 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4640 typedef void (RETRO_CALLCONV *retro_camera_stop_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4641
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4642 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4643 * Called by the frontend to report the state of the camera driver.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4644 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4645 * @see retro_camera_callback
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4646 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4647 typedef void (RETRO_CALLCONV *retro_camera_lifetime_status_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4648
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4649 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4650 * Called by the frontend to report a new camera frame,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4651 * delivered as a raw buffer in memory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4652 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4653 * Set by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4654 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4655 * @param buffer Pointer to the camera's most recent video frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4656 * Each pixel is in XRGB8888 format.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4657 * The first pixel represents the top-left corner of the image
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4658 * (i.e. the Y axis goes downward).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4659 * @param width The width of the frame given in \c buffer, in pixels.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4660 * @param height The height of the frame given in \c buffer, in pixels.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4661 * @param pitch The width of the frame given in \c buffer, in bytes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4662 * @warning \c buffer may be invalidated when this function returns,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4663 * so the core should make its own copy of \c buffer if necessary.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4664 * @see RETRO_CAMERA_BUFFER_RAW_FRAMEBUFFER
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4665 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4666 typedef void (RETRO_CALLCONV *retro_camera_frame_raw_framebuffer_t)(const uint32_t *buffer,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4667 unsigned width, unsigned height, size_t pitch);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4668
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4669 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4670 * Called by the frontend to report a new camera frame,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4671 * delivered as an OpenGL texture.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4672 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4673 * @param texture_id The ID of the OpenGL texture that represents the camera's most recent frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4674 * Owned by the frontend, and must not be modified by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4675 * @param texture_target The type of the texture given in \c texture_id.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4676 * Usually either \c GL_TEXTURE_2D or \c GL_TEXTURE_RECTANGLE,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4677 * but other types are allowed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4678 * @param affine A pointer to a 3x3 column-major affine matrix
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4679 * that can be used to transform pixel coordinates to texture coordinates.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4680 * After transformation, the bottom-left corner should have coordinates of <tt>(0, 0)</tt>
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4681 * and the top-right corner should have coordinates of <tt>(1, 1)</tt>
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4682 * (or <tt>(width, height)</tt> for \c GL_TEXTURE_RECTANGLE).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4683 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4684 * @note GL-specific typedefs (e.g. \c GLfloat and \c GLuint) are avoided here
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4685 * so that the API doesn't rely on gl.h.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4686 * @warning \c texture_id and \c affine may be invalidated when this function returns,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4687 * so the core should make its own copy of them if necessary.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4688 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4689 typedef void (RETRO_CALLCONV *retro_camera_frame_opengl_texture_t)(unsigned texture_id,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4690 unsigned texture_target, const float *affine);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4691
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4692 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4693 * An interface that the core can use to access a device's camera.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4694 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4695 * @see RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4696 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4697 struct retro_camera_callback
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4698 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4699 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4700 * Requested camera capabilities,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4701 * given as a bitmask of \c retro_camera_buffer values.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4702 * Set by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4703 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4704 * Here's a usage example:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4705 * @code
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4706 * // Requesting support for camera data delivered as both an OpenGL texture and a pixel buffer:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4707 * struct retro_camera_callback callback;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4708 * callback.caps = (1 << RETRO_CAMERA_BUFFER_OPENGL_TEXTURE) | (1 << RETRO_CAMERA_BUFFER_RAW_FRAMEBUFFER);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4709 * @endcode
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4710 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4711 uint64_t caps;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4712
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4713 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4714 * The desired width of the camera frame, in pixels.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4715 * This is only a hint; the frontend may provide a different size.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4716 * Set by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4717 * Use zero to let the frontend decide.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4718 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4719 unsigned width;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4720
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4721 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4722 * The desired height of the camera frame, in pixels.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4723 * This is only a hint; the frontend may provide a different size.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4724 * Set by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4725 * Use zero to let the frontend decide.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4726 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4727 unsigned height;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4728
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4729 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4730 * @copydoc retro_camera_start_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4731 * @see retro_camera_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4732 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4733 retro_camera_start_t start;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4734
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4735 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4736 * @copydoc retro_camera_stop_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4737 * @see retro_camera_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4738 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4739 retro_camera_stop_t stop;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4740
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4741 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4742 * @copydoc retro_camera_frame_raw_framebuffer_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4743 * @note If \c NULL, this function will not be called.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4744 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4745 retro_camera_frame_raw_framebuffer_t frame_raw_framebuffer;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4746
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4747 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4748 * @copydoc retro_camera_frame_opengl_texture_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4749 * @note If \c NULL, this function will not be called.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4750 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4751 retro_camera_frame_opengl_texture_t frame_opengl_texture;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4752
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4753 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4754 * Core-defined callback invoked by the frontend right after the camera driver is initialized
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4755 * (\em not when calling \c start).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4756 * May be \c NULL, in which case this function is skipped.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4757 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4758 retro_camera_lifetime_status_t initialized;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4759
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4760 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4761 * Core-defined callback invoked by the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4762 * right before the video camera driver is deinitialized
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4763 * (\em not when calling \c stop).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4764 * May be \c NULL, in which case this function is skipped.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4765 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4766 retro_camera_lifetime_status_t deinitialized;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4767 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4768
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4769 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4770
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4771 /** @defgroup GET_LOCATION_INTERFACE Location Interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4772 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4773 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4774
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4775 /** @copydoc retro_location_callback::set_interval */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4776 typedef void (RETRO_CALLCONV *retro_location_set_interval_t)(unsigned interval_ms,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4777 unsigned interval_distance);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4778
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4779 /** @copydoc retro_location_callback::start */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4780 typedef bool (RETRO_CALLCONV *retro_location_start_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4781
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4782 /** @copydoc retro_location_callback::stop */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4783 typedef void (RETRO_CALLCONV *retro_location_stop_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4784
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4785 /** @copydoc retro_location_callback::get_position */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4786 typedef bool (RETRO_CALLCONV *retro_location_get_position_t)(double *lat, double *lon,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4787 double *horiz_accuracy, double *vert_accuracy);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4788
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4789 /** Function type that reports the status of the location service. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4790 typedef void (RETRO_CALLCONV *retro_location_lifetime_status_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4791
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4792 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4793 * An interface that the core can use to access a device's location.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4794 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4795 * @note It is the frontend's responsibility to request the necessary permissions
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4796 * from the operating system.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4797 * @see RETRO_ENVIRONMENT_GET_LOCATION_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4798 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4799 struct retro_location_callback
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4800 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4801 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4802 * Starts listening the device's location service.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4803 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4804 * The frontend will report changes to the device's location
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4805 * at the interval defined by \c set_interval.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4806 * Set by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4807 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4808 * @return true if location services were successfully started, false otherwise.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4809 * Note that this will return \c false if location services are disabled
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4810 * or the frontend doesn't have permission to use them.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4811 * @note The device's location service may or may not have been enabled
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4812 * before the core calls this function.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4813 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4814 retro_location_start_t start;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4815
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4816 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4817 * Stop listening to the device's location service.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4818 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4819 * Set by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4820 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4821 * @note The location service itself may or may not
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4822 * be turned off by this function,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4823 * depending on the platform and the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4824 * @post The core will stop receiving location service updates.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4825 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4826 retro_location_stop_t stop;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4827
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4828 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4829 * Returns the device's current coordinates.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4830 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4831 * Set by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4832 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4833 * @param[out] lat Pointer to latitude, in degrees.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4834 * Will be set to 0 if no change has occurred since the last call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4835 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4836 * @param[out] lon Pointer to longitude, in degrees.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4837 * Will be set to 0 if no change has occurred since the last call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4838 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4839 * @param[out] horiz_accuracy Pointer to horizontal accuracy.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4840 * Will be set to 0 if no change has occurred since the last call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4841 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4842 * @param[out] vert_accuracy Pointer to vertical accuracy.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4843 * Will be set to 0 if no change has occurred since the last call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4844 * Behavior is undefined if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4845 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4846 retro_location_get_position_t get_position;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4847
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4848 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4849 * Sets the rate at which the location service should report updates.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4850 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4851 * This is only a hint; the actual rate may differ.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4852 * Sets the interval of time and/or distance at which to update/poll
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4853 * location-based data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4854 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4855 * Some platforms may only support one of the two parameters;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4856 * cores should provide both to ensure compatibility.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4857 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4858 * Set by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4859 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4860 * @param interval_ms The desired period of time between location updates, in milliseconds.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4861 * @param interval_distance The desired distance between location updates, in meters.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4862 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4863 retro_location_set_interval_t set_interval;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4864
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4865 /** Called when the location service is initialized. Set by the core. Optional. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4866 retro_location_lifetime_status_t initialized;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4867
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4868 /** Called when the location service is deinitialized. Set by the core. Optional. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4869 retro_location_lifetime_status_t deinitialized;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4870 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4871
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4872 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4873
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4874 /** @addtogroup GET_RUMBLE_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4875 * @{ */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4876
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4877 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4878 * The type of rumble motor in a controller.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4879 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4880 * Both motors can be controlled independently,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4881 * and the strong motor does not override the weak motor.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4882 * @see RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4883 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4884 enum retro_rumble_effect
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4885 {
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4886 RETRO_RUMBLE_STRONG = 0,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4887 RETRO_RUMBLE_WEAK = 1,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4888
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4889 /** @private Defined to ensure <tt>sizeof(enum retro_rumble_effect) == sizeof(int)</tt>. Do not use. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4890 RETRO_RUMBLE_DUMMY = INT_MAX
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4891 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4892
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4893 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4894 * Requests a rumble state change for a controller.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4895 * Set by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4896 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4897 * @param port The controller port to set the rumble state for.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4898 * @param effect The rumble motor to set the strength of.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4899 * @param strength The desired intensity of the rumble motor, ranging from \c 0 to \c 0xffff (inclusive).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4900 * @return \c true if the requested rumble state was honored.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4901 * If the controller doesn't support rumble, will return \c false.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4902 * @note Calling this before the first \c retro_run() may return \c false.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4903 * @see RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4904 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4905 typedef bool (RETRO_CALLCONV *retro_set_rumble_state_t)(unsigned port,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4906 enum retro_rumble_effect effect, uint16_t strength);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4907
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4908 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4909 * An interface that the core can use to set the rumble state of a controller.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4910 * @see RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4911 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4912 struct retro_rumble_interface
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4913 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4914 /** @copydoc retro_set_rumble_state_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4915 retro_set_rumble_state_t set_rumble_state;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4916 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4917
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4918 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4919
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4920 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4921 * Called by the frontend to request audio samples.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4922 * The core should render audio within this function
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4923 * using the callback provided by \c retro_set_audio_sample or \c retro_set_audio_sample_batch.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4924 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4925 * @warning This function may be called by any thread,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4926 * therefore it must be thread-safe.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4927 * @see RETRO_ENVIRONMENT_SET_AUDIO_CALLBACK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4928 * @see retro_audio_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4929 * @see retro_audio_sample_batch_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4930 * @see retro_audio_sample_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4931 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4932 typedef void (RETRO_CALLCONV *retro_audio_callback_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4933
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4934 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4935 * Called by the frontend to notify the core that it should pause or resume audio rendering.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4936 * The initial state of the audio driver after registering this callback is \c false (inactive).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4937 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4938 * @param enabled \c true if the frontend's audio driver is active.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4939 * If so, the registered audio callback will be called regularly.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4940 * If not, the audio callback will not be invoked until the next time
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4941 * the frontend calls this function with \c true.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4942 * @warning This function may be called by any thread,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4943 * therefore it must be thread-safe.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4944 * @note Even if no audio samples are rendered,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4945 * the core should continue to update its emulated platform's audio engine if necessary.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4946 * @see RETRO_ENVIRONMENT_SET_AUDIO_CALLBACK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4947 * @see retro_audio_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4948 * @see retro_audio_callback_t
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4949 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4950 typedef void (RETRO_CALLCONV *retro_audio_set_state_callback_t)(bool enabled);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4951
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4952 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4953 * An interface that the frontend uses to request audio samples from the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4954 * @note To unregister a callback, pass a \c retro_audio_callback_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4955 * with both fields set to <tt>NULL</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4956 * @see RETRO_ENVIRONMENT_SET_AUDIO_CALLBACK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4957 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4958 struct retro_audio_callback
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4959 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4960 /** @see retro_audio_callback_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4961 retro_audio_callback_t callback;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4962
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4963 /** @see retro_audio_set_state_callback_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4964 retro_audio_set_state_callback_t set_state;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4965 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4966
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4967 typedef int64_t retro_usec_t;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4968
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4969 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4970 * Called right before each iteration of \c retro_run
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4971 * if registered via <tt>RETRO_ENVIRONMENT_SET_FRAME_TIME_CALLBACK</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4972 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4973 * @param usec Time since the last call to <tt>retro_run</tt>, in microseconds.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4974 * If the frontend is manipulating the frame time
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4975 * (e.g. via fast-forward or slow motion),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4976 * this value will be the reference value initially provided to the environment call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4977 * @see RETRO_ENVIRONMENT_SET_FRAME_TIME_CALLBACK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4978 * @see retro_frame_time_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4979 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4980 typedef void (RETRO_CALLCONV *retro_frame_time_callback_t)(retro_usec_t usec);
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4981
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4982 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4983 * @see RETRO_ENVIRONMENT_SET_FRAME_TIME_CALLBACK
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4984 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4985 struct retro_frame_time_callback
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4986 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4987 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4988 * Called to notify the core of the current frame time.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4989 * If <tt>NULL</tt>, the frontend will clear its registered callback.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4990 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4991 retro_frame_time_callback_t callback;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4992
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4993 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4994 * The ideal duration of one frame, in microseconds.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4995 * Compute it as <tt>1000000 / fps</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4996 * The frontend will resolve rounding to ensure that framestepping, etc is exact.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
4997 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4998 retro_usec_t reference;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4999 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5000
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5001 /** @defgroup SET_AUDIO_BUFFER_STATUS_CALLBACK Audio Buffer Occupancy
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5002 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5003 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5004
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5005 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5006 * Notifies a libretro core of how full the frontend's audio buffer is.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5007 * Set by the core, called by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5008 * It will be called right before \c retro_run() every frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5009 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5010 * @param active \c true if the frontend's audio buffer is currently in use,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5011 * \c false if audio is disabled in the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5012 * @param occupancy A value between 0 and 100 (inclusive),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5013 * corresponding to the frontend's audio buffer occupancy percentage.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5014 * @param underrun_likely \c true if the frontend expects an audio buffer underrun
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5015 * during the next frame, which indicates that a core should attempt frame-skipping.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5016 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5017 typedef void (RETRO_CALLCONV *retro_audio_buffer_status_callback_t)(
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5018 bool active, unsigned occupancy, bool underrun_likely);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5019
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5020 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5021 * A callback to register with the frontend to receive audio buffer occupancy information.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5022 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5023 struct retro_audio_buffer_status_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5024 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5025 /** @copydoc retro_audio_buffer_status_callback_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5026 retro_audio_buffer_status_callback_t callback;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5027 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5028
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5029 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5030
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5031 /* Pass this to retro_video_refresh_t if rendering to hardware.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5032 * Passing NULL to retro_video_refresh_t is still a frame dupe as normal.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5033 * */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5034 #define RETRO_HW_FRAME_BUFFER_VALID ((void*)-1)
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5035
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5036 /* Invalidates the current HW context.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5037 * Any GL state is lost, and must not be deinitialized explicitly.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5038 * If explicit deinitialization is desired by the libretro core,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5039 * it should implement context_destroy callback.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5040 * If called, all GPU resources must be reinitialized.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5041 * Usually called when frontend reinits video driver.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5042 * Also called first time video driver is initialized,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5043 * allowing libretro core to initialize resources.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5044 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5045 typedef void (RETRO_CALLCONV *retro_hw_context_reset_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5046
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5047 /* Gets current framebuffer which is to be rendered to.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5048 * Could change every frame potentially.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5049 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5050 typedef uintptr_t (RETRO_CALLCONV *retro_hw_get_current_framebuffer_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5051
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5052 /* Get a symbol from HW context. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5053 typedef retro_proc_address_t (RETRO_CALLCONV *retro_hw_get_proc_address_t)(const char *sym);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5054
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5055 enum retro_hw_context_type
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5056 {
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5057 RETRO_HW_CONTEXT_NONE = 0,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5058 /* OpenGL 2.x. Driver can choose to use latest compatibility context. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5059 RETRO_HW_CONTEXT_OPENGL = 1,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5060 /* OpenGL ES 2.0. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5061 RETRO_HW_CONTEXT_OPENGLES2 = 2,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5062 /* Modern desktop core GL context. Use version_major/
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5063 * version_minor fields to set GL version. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5064 RETRO_HW_CONTEXT_OPENGL_CORE = 3,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5065 /* OpenGL ES 3.0 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5066 RETRO_HW_CONTEXT_OPENGLES3 = 4,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5067 /* OpenGL ES 3.1+. Set version_major/version_minor. For GLES2 and GLES3,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5068 * use the corresponding enums directly. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5069 RETRO_HW_CONTEXT_OPENGLES_VERSION = 5,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5070
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5071 /* Vulkan, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5072 RETRO_HW_CONTEXT_VULKAN = 6,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5073
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5074 /* Direct3D11, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5075 RETRO_HW_CONTEXT_D3D11 = 7,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5076
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5077 /* Direct3D10, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5078 RETRO_HW_CONTEXT_D3D10 = 8,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5079
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5080 /* Direct3D12, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5081 RETRO_HW_CONTEXT_D3D12 = 9,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5082
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5083 /* Direct3D9, see RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5084 RETRO_HW_CONTEXT_D3D9 = 10,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5085
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5086 /** Dummy value to ensure sizeof(enum retro_hw_context_type) == sizeof(int). Do not use. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5087 RETRO_HW_CONTEXT_DUMMY = INT_MAX
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5088 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5089
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5090 struct retro_hw_render_callback
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5091 {
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5092 /* Which API to use. Set by libretro core. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5093 enum retro_hw_context_type context_type;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5094
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5095 /* Called when a context has been created or when it has been reset.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5096 * An OpenGL context is only valid after context_reset() has been called.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5097 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5098 * When context_reset is called, OpenGL resources in the libretro
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5099 * implementation are guaranteed to be invalid.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5100 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5101 * It is possible that context_reset is called multiple times during an
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5102 * application lifecycle.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5103 * If context_reset is called without any notification (context_destroy),
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5104 * the OpenGL context was lost and resources should just be recreated
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5105 * without any attempt to "free" old resources.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5106 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5107 retro_hw_context_reset_t context_reset;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5108
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5109 /* Set by frontend.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5110 * TODO: This is rather obsolete. The frontend should not
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5111 * be providing preallocated framebuffers. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5112 retro_hw_get_current_framebuffer_t get_current_framebuffer;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5113
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5114 /* Set by frontend.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5115 * Can return all relevant functions, including glClear on Windows. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5116 retro_hw_get_proc_address_t get_proc_address;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5117
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5118 /* Set if render buffers should have depth component attached.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5119 * TODO: Obsolete. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5120 bool depth;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5121
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5122 /* Set if stencil buffers should be attached.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5123 * TODO: Obsolete. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5124 bool stencil;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5125
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5126 /* If depth and stencil are true, a packed 24/8 buffer will be added.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5127 * Only attaching stencil is invalid and will be ignored. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5128
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5129 /* Use conventional bottom-left origin convention. If false,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5130 * standard libretro top-left origin semantics are used.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5131 * TODO: Move to GL specific interface. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5132 bool bottom_left_origin;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5133
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5134 /* Major version number for core GL context or GLES 3.1+. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5135 unsigned version_major;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5136
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5137 /* Minor version number for core GL context or GLES 3.1+. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5138 unsigned version_minor;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5139
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5140 /* If this is true, the frontend will go very far to avoid
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5141 * resetting context in scenarios like toggling fullscreen, etc.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5142 * TODO: Obsolete? Maybe frontend should just always assume this ...
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5143 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5144 bool cache_context;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5145
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5146 /* The reset callback might still be called in extreme situations
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5147 * such as if the context is lost beyond recovery.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5148 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5149 * For optimal stability, set this to false, and allow context to be
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5150 * reset at any time.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5151 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5152
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5153 /* A callback to be called before the context is destroyed in a
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5154 * controlled way by the frontend. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5155 retro_hw_context_reset_t context_destroy;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5156
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5157 /* OpenGL resources can be deinitialized cleanly at this step.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5158 * context_destroy can be set to NULL, in which resources will
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5159 * just be destroyed without any notification.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5160 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5161 * Even when context_destroy is non-NULL, it is possible that
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5162 * context_reset is called without any destroy notification.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5163 * This happens if context is lost by external factors (such as
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5164 * notified by GL_ARB_robustness).
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5165 *
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5166 * In this case, the context is assumed to be already dead,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5167 * and the libretro implementation must not try to free any OpenGL
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5168 * resources in the subsequent context_reset.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5169 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5170
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5171 /* Creates a debug context. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5172 bool debug_context;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5173 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5174
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5175 /* Callback type passed in RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5176 * Called by the frontend in response to keyboard events.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5177 * down is set if the key is being pressed, or false if it is being released.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5178 * keycode is the RETROK value of the char.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5179 * character is the text character of the pressed key. (UTF-32).
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5180 * key_modifiers is a set of RETROKMOD values or'ed together.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5181 *
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5182 * The pressed/keycode state can be independent of the character.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5183 * It is also possible that multiple characters are generated from a
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5184 * single keypress.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5185 * Keycode events should be treated separately from character events.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5186 * However, when possible, the frontend should try to synchronize these.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5187 * If only a character is posted, keycode should be RETROK_UNKNOWN.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5188 *
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5189 * Similarly if only a keycode event is generated with no corresponding
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5190 * character, character should be 0.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5191 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5192 typedef void (RETRO_CALLCONV *retro_keyboard_event_t)(bool down, unsigned keycode,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5193 uint32_t character, uint16_t key_modifiers);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5194
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5195 struct retro_keyboard_callback
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5196 {
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5197 retro_keyboard_event_t callback;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5198 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5199
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5200 /** @defgroup SET_DISK_CONTROL_INTERFACE Disk Control
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5201 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5202 * Callbacks for inserting and removing disks from the emulated console at runtime.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5203 * Should be provided by cores that support doing so.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5204 * Cores should automate this process if possible,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5205 * but some cases require the player's manual input.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5206 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5207 * The steps for swapping disk images are generally as follows:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5208 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5209 * \li Eject the emulated console's disk drive with \c set_eject_state(true).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5210 * \li Insert the new disk image with \c set_image_index(index).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5211 * \li Close the virtual disk tray with \c set_eject_state(false).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5212 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5213 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5214 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5215
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5216 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5217 * Called by the frontend to open or close the emulated console's virtual disk tray.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5218 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5219 * The frontend may only set the disk image index
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5220 * while the emulated tray is opened.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5221 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5222 * If the emulated console's disk tray is already in the state given by \c ejected,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5223 * then this function should return \c true without doing anything.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5224 * The core should return \c false if it couldn't change the disk tray's state;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5225 * this may happen if the console itself limits when the disk tray can be open or closed
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5226 * (e.g. to wait for the disc to stop spinning).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5227 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5228 * @param ejected \c true if the virtual disk tray should be "ejected",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5229 * \c false if it should be "closed".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5230 * @return \c true if the virtual disk tray's state has been set to the given state,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5231 * false if there was an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5232 * @see retro_get_eject_state_t
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5233 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5234 typedef bool (RETRO_CALLCONV *retro_set_eject_state_t)(bool ejected);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5235
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5236 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5237 * Gets the current ejected state of the disk drive.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5238 * The initial state is closed, i.e. \c false.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5239 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5240 * @return \c true if the virtual disk tray is "ejected",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5241 * i.e. it's open and a disk can be inserted.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5242 * @see retro_set_eject_state_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5243 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5244 typedef bool (RETRO_CALLCONV *retro_get_eject_state_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5245
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5246 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5247 * Gets the index of the current disk image,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5248 * as determined by however the frontend orders disk images
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5249 * (such as m3u-formatted playlists or special directories).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5250 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5251 * @return The index of the current disk image
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5252 * (starting with 0 for the first disk),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5253 * or a value greater than or equal to \c get_num_images() if no disk is inserted.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5254 * @see retro_get_num_images_t
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5255 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5256 typedef unsigned (RETRO_CALLCONV *retro_get_image_index_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5257
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5258 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5259 * Inserts the disk image at the given index into the emulated console's drive.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5260 * Can only be called while the disk tray is ejected
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5261 * (i.e. \c retro_get_eject_state_t returns \c true).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5262 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5263 * If the emulated disk tray is ejected
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5264 * and already contains the disk image named by \c index,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5265 * then this function should do nothing and return \c true.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5266 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5267 * @param index The index of the disk image to insert,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5268 * starting from 0 for the first disk.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5269 * A value greater than or equal to \c get_num_images()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5270 * represents the frontend removing the disk without inserting a new one.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5271 * @return \c true if the disk image was successfully set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5272 * \c false if the disk tray isn't ejected or there was another error
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5273 * inserting a new disk image.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5274 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5275 typedef bool (RETRO_CALLCONV *retro_set_image_index_t)(unsigned index);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5276
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5277 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5278 * @return The number of disk images which are available to use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5279 * These are most likely defined in a playlist file.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5280 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5281 typedef unsigned (RETRO_CALLCONV *retro_get_num_images_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5282
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5283 struct retro_game_info;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5284
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5285 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5286 * Replaces the disk image at the given index with a new disk.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5287 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5288 * Replaces the disk image associated with index.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5289 * Arguments to pass in info have same requirements as retro_load_game().
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5290 * Virtual disk tray must be ejected when calling this.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5291 *
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5292 * Passing \c NULL to this function indicates
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5293 * that the frontend has removed this disk image from its internal list.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5294 * As a result, calls to this function can change the number of available disk indexes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5295 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5296 * For example, calling <tt>replace_image_index(1, NULL)</tt>
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5297 * will remove the disk image at index 1,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5298 * and the disk image at index 2 (if any)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5299 * will be moved to the newly-available index 1.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5300 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5301 * @param index The index of the disk image to replace.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5302 * @param info Details about the new disk image,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5303 * or \c NULL if the disk image at the given index should be discarded.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5304 * The semantics of each field are the same as in \c retro_load_game.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5305 * @return \c true if the disk image was successfully replaced
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5306 * or removed from the playlist,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5307 * \c false if the tray is not ejected
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5308 * or if there was an error.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5309 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5310 typedef bool (RETRO_CALLCONV *retro_replace_image_index_t)(unsigned index,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5311 const struct retro_game_info *info);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5312
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5313 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5314 * Adds a new index to the core's internal disk list.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5315 * This will increment the return value from \c get_num_images() by 1.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5316 * This image index cannot be used until a disk image has been set
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5317 * with \c replace_image_index.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5318 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5319 * @return \c true if the core has added space for a new disk image
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5320 * and is ready to receive one.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5321 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5322 typedef bool (RETRO_CALLCONV *retro_add_image_index_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5323
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5324 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5325 * Sets the disk image that will be inserted into the emulated disk drive
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5326 * before \c retro_load_game is called.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5327 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5328 * \c retro_load_game does not provide a way to ensure
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5329 * that a particular disk image in a playlist is inserted into the console;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5330 * this function makes up for that.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5331 * Frontends should call it immediately before \c retro_load_game,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5332 * and the core should use the arguments
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5333 * to validate the disk image in \c retro_load_game.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5334 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5335 * When content is loaded, the core should verify that the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5336 * disk specified by \c index can be found at \c path.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5337 * This is to guard against auto-selecting the wrong image
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5338 * if (for example) the user should modify an existing M3U playlist.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5339 * We have to let the core handle this because
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5340 * \c set_initial_image() must be called before loading content,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5341 * i.e. the frontend cannot access image paths in advance
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5342 * and thus cannot perform the error check itself.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5343 * If \c index is invalid (i.e. <tt>index >= get_num_images()</tt>)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5344 * or the disk image doesn't match the value given in \c path,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5345 * the core should ignore the arguments
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5346 * and insert the disk at index 0 into the virtual disk tray.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5347 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5348 * @warning If \c RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE is called within \c retro_load_game,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5349 * then this function may not be executed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5350 * Set the disk control interface in \c retro_init if possible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5351 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5352 * @param index The index of the disk image within the playlist to set.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5353 * @param path The path of the disk image to set as the first.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5354 * The core should not load this path immediately;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5355 * instead, it should use it within \c retro_load_game
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5356 * to verify that the correct disk image was loaded.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5357 * @return \c true if the initial disk index was set,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5358 * \c false if the arguments are invalid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5359 * or the core doesn't support this function.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5360 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5361 typedef bool (RETRO_CALLCONV *retro_set_initial_image_t)(unsigned index, const char *path);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5362
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5363 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5364 * Returns the path of the disk image at the given index
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5365 * on the host's file system.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5366 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5367 * @param index The index of the disk image to get the path of.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5368 * @param path A buffer to store the path in.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5369 * @param len The size of \c path, in bytes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5370 * @return \c true if the disk image's location was successfully
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5371 * queried and copied into \c path,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5372 * \c false if the index is invalid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5373 * or the core couldn't locate the disk image.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5374 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5375 typedef bool (RETRO_CALLCONV *retro_get_image_path_t)(unsigned index, char *path, size_t len);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5376
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5377 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5378 * Returns a friendly label for the given disk image.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5379 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5380 * In the simplest case, this may be the disk image's file name
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5381 * with the extension omitted.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5382 * For cores or games with more complex content requirements,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5383 * the label can be used to provide information to help the player
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5384 * select a disk image to insert;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5385 * for example, a core may label different kinds of disks
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5386 * (save data, level disk, installation disk, bonus content, etc.).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5387 * with names that correspond to in-game prompts,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5388 * so that the frontend can provide better guidance to the player.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5389 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5390 * @param index The index of the disk image to return a label for.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5391 * @param label A buffer to store the resulting label in.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5392 * @param len The length of \c label, in bytes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5393 * @return \c true if the disk image at \c index is valid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5394 * and a label was copied into \c label.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5395 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5396 typedef bool (RETRO_CALLCONV *retro_get_image_label_t)(unsigned index, char *label, size_t len);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5397
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5398 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5399 * An interface that the frontend can use to exchange disks
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5400 * within the emulated console's disk drive.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5401 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5402 * All function pointers are required.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5403 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5404 * @deprecated This struct is superseded by \ref retro_disk_control_ext_callback.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5405 * Only use this one to maintain compatibility
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5406 * with older cores and frontends.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5407 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5408 * @see RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5409 * @see retro_disk_control_ext_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5410 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5411 struct retro_disk_control_callback
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5412 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5413 /** @copydoc retro_set_eject_state_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5414 retro_set_eject_state_t set_eject_state;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5415
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5416 /** @copydoc retro_get_eject_state_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5417 retro_get_eject_state_t get_eject_state;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5418
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5419 /** @copydoc retro_get_image_index_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5420 retro_get_image_index_t get_image_index;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5421
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5422 /** @copydoc retro_set_image_index_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5423 retro_set_image_index_t set_image_index;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5424
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5425 /** @copydoc retro_get_num_images_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5426 retro_get_num_images_t get_num_images;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5427
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5428 /** @copydoc retro_replace_image_index_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5429 retro_replace_image_index_t replace_image_index;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5430
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5431 /** @copydoc retro_add_image_index_t */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5432 retro_add_image_index_t add_image_index;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5433 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5434
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5435 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5436 * @copybrief retro_disk_control_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5437 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5438 * All function pointers are required unless otherwise noted.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5439 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5440 * @see RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5441 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5442 struct retro_disk_control_ext_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5443 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5444 /** @copydoc retro_set_eject_state_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5445 retro_set_eject_state_t set_eject_state;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5446
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5447 /** @copydoc retro_get_eject_state_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5448 retro_get_eject_state_t get_eject_state;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5449
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5450 /** @copydoc retro_get_image_index_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5451 retro_get_image_index_t get_image_index;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5452
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5453 /** @copydoc retro_set_image_index_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5454 retro_set_image_index_t set_image_index;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5455
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5456 /** @copydoc retro_get_num_images_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5457 retro_get_num_images_t get_num_images;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5458
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5459 /** @copydoc retro_replace_image_index_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5460 retro_replace_image_index_t replace_image_index;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5461
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5462 /** @copydoc retro_add_image_index_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5463 retro_add_image_index_t add_image_index;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5464
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5465 /** @copydoc retro_set_initial_image_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5466 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5467 * Optional; not called if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5468 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5469 * @note The frontend will only try to record/restore the last-used disk index
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5470 * if both \c set_initial_image and \c get_image_path are implemented.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5471 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5472 retro_set_initial_image_t set_initial_image;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5473
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5474 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5475 * @copydoc retro_get_image_path_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5476 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5477 * Optional; not called if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5478 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5479 retro_get_image_path_t get_image_path;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5480
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5481 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5482 * @copydoc retro_get_image_label_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5483 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5484 * Optional; not called if \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5485 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5486 retro_get_image_label_t get_image_label;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5487 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5488
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5489 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5490
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5491 /* Definitions for RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5492 * A core can set it if sending and receiving custom network packets
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5493 * during a multiplayer session is desired.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5494 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5495
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5496 /* Netpacket flags for retro_netpacket_send_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5497 #define RETRO_NETPACKET_UNRELIABLE 0 /* Packet to be sent unreliable, depending on network quality it might not arrive. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5498 #define RETRO_NETPACKET_RELIABLE (1 << 0) /* Reliable packets are guaranteed to arrive at the target in the order they were sent. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5499 #define RETRO_NETPACKET_UNSEQUENCED (1 << 1) /* Packet will not be sequenced with other packets and may arrive out of order. Cannot be set on reliable packets. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5500 #define RETRO_NETPACKET_FLUSH_HINT (1 << 2) /* Request the packet and any previously buffered ones to be sent immediately */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5501
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5502 /* Broadcast client_id for retro_netpacket_send_t */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5503 #define RETRO_NETPACKET_BROADCAST 0xFFFF
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5504
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5505 /* Used by the core to send a packet to one or all connected players.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5506 * A single packet sent via this interface can contain up to 64 KB of data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5507 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5508 * The client_id RETRO_NETPACKET_BROADCAST sends the packet as a broadcast to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5509 * all connected players. This is supported from the host as well as clients.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5510 * Otherwise, the argument indicates the player to send the packet to.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5511 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5512 * A frontend must support sending reliable packets (RETRO_NETPACKET_RELIABLE).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5513 * Unreliable packets might not be supported by the frontend, but the flags can
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5514 * still be specified. Reliable transmission will be used instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5515 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5516 * Calling this with the flag RETRO_NETPACKET_FLUSH_HINT will send off the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5517 * packet and any previously buffered ones immediately and without blocking.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5518 * To only flush previously queued packets, buf or len can be passed as NULL/0.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5519 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5520 * This function is not guaranteed to be thread-safe and must be called during
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5521 * retro_run or any of the netpacket callbacks passed with this interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5522 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5523 typedef void (RETRO_CALLCONV *retro_netpacket_send_t)(int flags, const void* buf, size_t len, uint16_t client_id);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5524
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5525 /* Optionally read any incoming packets without waiting for the end of the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5526 * frame. While polling, retro_netpacket_receive_t and retro_netpacket_stop_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5527 * can be called. The core can perform this in a loop to do a blocking read,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5528 * i.e., wait for incoming data, but needs to handle stop getting called and
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5529 * also give up after a short while to avoid freezing on a connection problem.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5530 * It is a good idea to manually flush outgoing packets before calling this.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5531 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5532 * This function is not guaranteed to be thread-safe and must be called during
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5533 * retro_run or any of the netpacket callbacks passed with this interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5534 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5535 typedef void (RETRO_CALLCONV *retro_netpacket_poll_receive_t)(void);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5536
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5537 /* Called by the frontend to signify that a multiplayer session has started.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5538 * If client_id is 0 the local player is the host of the session and at this
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5539 * point no other player has connected yet.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5540 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5541 * If client_id is > 0 the local player is a client connected to a host and
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5542 * at this point is already fully connected to the host.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5543 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5544 * The core must store the function pointer send_fn and use it whenever it
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5545 * wants to send a packet. Optionally poll_receive_fn can be stored and used
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5546 * when regular receiving between frames is not enough. These function pointers
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5547 * remain valid until the frontend calls retro_netpacket_stop_t.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5548 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5549 typedef void (RETRO_CALLCONV *retro_netpacket_start_t)(uint16_t client_id, retro_netpacket_send_t send_fn, retro_netpacket_poll_receive_t poll_receive_fn);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5550
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5551 /* Called by the frontend when a new packet arrives which has been sent from
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5552 * another player with retro_netpacket_send_t. The client_id argument indicates
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5553 * who has sent the packet.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5554 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5555 typedef void (RETRO_CALLCONV *retro_netpacket_receive_t)(const void* buf, size_t len, uint16_t client_id);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5556
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5557 /* Called by the frontend when the multiplayer session has ended.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5558 * Once this gets called the function pointers passed to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5559 * retro_netpacket_start_t will not be valid anymore.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5560 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5561 typedef void (RETRO_CALLCONV *retro_netpacket_stop_t)(void);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5562
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5563 /* Called by the frontend every frame (between calls to retro_run while
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5564 * updating the state of the multiplayer session.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5565 * This is a good place for the core to call retro_netpacket_send_t from.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5566 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5567 typedef void (RETRO_CALLCONV *retro_netpacket_poll_t)(void);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5568
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5569 /* Called by the frontend when a new player connects to the hosted session.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5570 * This is only called on the host side, not for clients connected to the host.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5571 * If this function returns false, the newly connected player gets dropped.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5572 * This can be used for example to limit the number of players.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5573 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5574 typedef bool (RETRO_CALLCONV *retro_netpacket_connected_t)(uint16_t client_id);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5575
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5576 /* Called by the frontend when a player leaves or disconnects from the hosted session.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5577 * This is only called on the host side, not for clients connected to the host.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5578 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5579 typedef void (RETRO_CALLCONV *retro_netpacket_disconnected_t)(uint16_t client_id);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5580
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5581 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5582 * A callback interface for giving a core the ability to send and receive custom
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5583 * network packets during a multiplayer session between two or more instances
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5584 * of a libretro frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5585 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5586 * Normally during connection handshake the frontend will compare library_version
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5587 * used by both parties and show a warning if there is a difference. When the core
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5588 * supplies protocol_version, the frontend will check against this instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5589 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5590 * @see RETRO_ENVIRONMENT_SET_NETPACKET_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5591 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5592 struct retro_netpacket_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5593 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5594 retro_netpacket_start_t start;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5595 retro_netpacket_receive_t receive;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5596 retro_netpacket_stop_t stop; /* Optional - may be NULL */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5597 retro_netpacket_poll_t poll; /* Optional - may be NULL */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5598 retro_netpacket_connected_t connected; /* Optional - may be NULL */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5599 retro_netpacket_disconnected_t disconnected; /* Optional - may be NULL */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5600 const char* protocol_version; /* Optional - if not NULL will be used instead of core version to decide if communication is compatible */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5601 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5602
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5603 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5604 * The pixel format used for rendering.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5605 * @see RETRO_ENVIRONMENT_SET_PIXEL_FORMAT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5606 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5607 enum retro_pixel_format
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5608 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5609 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5610 * 0RGB1555, native endian.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5611 * Used as the default if \c RETRO_ENVIRONMENT_SET_PIXEL_FORMAT is not called.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5612 * The most significant bit must be set to 0.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5613 * @deprecated This format remains supported to maintain compatibility.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5614 * New code should use <tt>RETRO_PIXEL_FORMAT_RGB565</tt> instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5615 * @see RETRO_PIXEL_FORMAT_RGB565
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5616 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5617 RETRO_PIXEL_FORMAT_0RGB1555 = 0,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5618
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5619 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5620 * XRGB8888, native endian.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5621 * The most significant byte (the <tt>X</tt>) is ignored.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5622 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5623 RETRO_PIXEL_FORMAT_XRGB8888 = 1,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5624
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5625 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5626 * RGB565, native endian.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5627 * This format is recommended if 16-bit pixels are desired,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5628 * as it is available on a variety of devices and APIs.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5629 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5630 RETRO_PIXEL_FORMAT_RGB565 = 2,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5631
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5632 /** Defined to ensure that <tt>sizeof(retro_pixel_format) == sizeof(int)</tt>. Do not use. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5633 RETRO_PIXEL_FORMAT_UNKNOWN = INT_MAX
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5634 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5635
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5636 /** @defgroup GET_SAVESTATE_CONTEXT Savestate Context
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5637 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5638 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5639
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5640 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5641 * Details about how the frontend will use savestates.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5642 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5643 * @see RETRO_ENVIRONMENT_GET_SAVESTATE_CONTEXT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5644 * @see retro_serialize
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5645 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5646 enum retro_savestate_context
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5647 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5648 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5649 * Standard savestate written to disk.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5650 * May be loaded at any time,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5651 * even in a separate session or on another device.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5652 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5653 * Should not contain any pointers to code or data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5654 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5655 RETRO_SAVESTATE_CONTEXT_NORMAL = 0,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5656
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5657 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5658 * The savestate is guaranteed to be loaded
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5659 * within the same session, address space, and binary.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5660 * Will not be written to disk or sent over the network;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5661 * therefore, internal pointers to code or data are acceptable.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5662 * May still be loaded or saved at any time.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5663 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5664 * @note This context generally implies the use of runahead or rewinding,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5665 * which may work by taking savestates multiple times per second.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5666 * Savestate code that runs in this context should be fast.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5667 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5668 RETRO_SAVESTATE_CONTEXT_RUNAHEAD_SAME_INSTANCE = 1,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5669
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5670 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5671 * The savestate is guaranteed to be loaded
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5672 * in the same session and by the same binary,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5673 * but possibly by a different address space
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5674 * (e.g. for "second instance" runahead)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5675 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5676 * Will not be written to disk or sent over the network,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5677 * but may be loaded in a different address space.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5678 * Therefore, the savestate <em>must not</em> contain pointers.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5679 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5680 RETRO_SAVESTATE_CONTEXT_RUNAHEAD_SAME_BINARY = 2,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5681
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5682 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5683 * The savestate will not be written to disk,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5684 * but no other guarantees are made.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5685 * The savestate will almost certainly be loaded
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5686 * by a separate binary, device, and address space.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5687 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5688 * This context is intended for use with frontends that support rollback netplay.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5689 * Serialized state should omit any data that would unnecessarily increase bandwidth usage.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5690 * Must not contain pointers, and integers must be saved in big-endian format.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5691 * @see retro_endianness.h
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5692 * @see network_stream
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5693 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5694 RETRO_SAVESTATE_CONTEXT_ROLLBACK_NETPLAY = 3,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5695
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5696 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5697 * @private Defined to ensure <tt>sizeof(retro_savestate_context) == sizeof(int)</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5698 * Do not use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5699 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5700 RETRO_SAVESTATE_CONTEXT_UNKNOWN = INT_MAX
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5701 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5702
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5703 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5704
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5705 /** @defgroup SET_MESSAGE User-Visible Messages
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5706 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5707 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5708 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5709
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5710 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5711 * Defines a message that the frontend will display to the user,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5712 * as determined by <tt>RETRO_ENVIRONMENT_SET_MESSAGE</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5713 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5714 * @deprecated This struct is superseded by \ref retro_message_ext,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5715 * which provides more control over how a message is presented.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5716 * Only use it for compatibility with older cores and frontends.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5717 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5718 * @see RETRO_ENVIRONMENT_SET_MESSAGE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5719 * @see retro_message_ext
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5720 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5721 struct retro_message
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5722 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5723 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5724 * Null-terminated message to be displayed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5725 * If \c NULL or empty, the message will be ignored.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5726 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5727 const char *msg;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5728
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5729 /** Duration to display \c msg in frames. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5730 unsigned frames;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5731 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5732
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5733 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5734 * The method that the frontend will use to display a message to the player.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5735 * @see retro_message_ext
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5736 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5737 enum retro_message_target
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5738 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5739 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5740 * Indicates that the frontend should display the given message
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5741 * using all other targets defined by \c retro_message_target at once.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5742 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5743 RETRO_MESSAGE_TARGET_ALL = 0,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5744
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5745 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5746 * Indicates that the frontend should display the given message
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5747 * using the frontend's on-screen display, if available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5748 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5749 * @attention If the frontend allows players to customize or disable notifications,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5750 * then they may not see messages sent to this target.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5751 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5752 RETRO_MESSAGE_TARGET_OSD,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5753
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5754 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5755 * Indicates that the frontend should log the message
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5756 * via its usual logging mechanism, if available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5757 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5758 * This is not intended to be a substitute for \c RETRO_ENVIRONMENT_SET_LOG_INTERFACE.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5759 * It is intended for the common use case of
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5760 * logging a player-facing message.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5761 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5762 * This target should not be used for messages
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5763 * of type \c RETRO_MESSAGE_TYPE_STATUS or \c RETRO_MESSAGE_TYPE_PROGRESS,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5764 * as it may add unnecessary noise to a log file.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5765 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5766 * @see RETRO_ENVIRONMENT_SET_LOG_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5767 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5768 RETRO_MESSAGE_TARGET_LOG
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5769 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5770
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5771 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5772 * A broad category for the type of message that the frontend will display.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5773 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5774 * Each message type has its own use case,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5775 * therefore the frontend should present each one differently.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5776 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5777 * @note This is a hint that the frontend may ignore.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5778 * The frontend should fall back to \c RETRO_MESSAGE_TYPE_NOTIFICATION
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5779 * for message types that it doesn't support.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5780 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5781 enum retro_message_type
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5782 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5783 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5784 * A standard on-screen message.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5785 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5786 * Suitable for a variety of use cases,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5787 * such as messages about errors
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5788 * or other important events.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5789 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5790 * Frontends that display their own messages
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5791 * should display this type of core-generated message the same way.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5792 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5793 RETRO_MESSAGE_TYPE_NOTIFICATION = 0,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5794
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5795 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5796 * An on-screen message that should be visually distinct
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5797 * from \c RETRO_MESSAGE_TYPE_NOTIFICATION messages.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5798 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5799 * The exact meaning of "visually distinct" is left to the frontend,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5800 * but this usually implies that the frontend shows the message
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5801 * in a way that it doesn't typically use for its own notices.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5802 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5803 RETRO_MESSAGE_TYPE_NOTIFICATION_ALT,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5804
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5805 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5806 * Indicates a frequently-updated status display,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5807 * rather than a standard notification.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5808 * Status messages are intended to be displayed permanently while a core is running
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5809 * in a way that doesn't suggest user action is required.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5810 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5811 * Here are some possible use cases for status messages:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5812 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5813 * @li An internal framerate counter.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5814 * @li Debugging information.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5815 * Remember to let the player disable it in the core options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5816 * @li Core-specific state, such as when a microphone is active.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5817 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5818 * The status message is displayed for the given duration,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5819 * unless another status message of equal or greater priority is shown.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5820 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5821 RETRO_MESSAGE_TYPE_STATUS,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5822
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5823 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5824 * Denotes a message that reports the progress
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5825 * of a long-running asynchronous task,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5826 * such as when a core loads large files from disk or the network.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5827 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5828 * The frontend should display messages of this type as a progress bar
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5829 * (or a progress spinner for indefinite tasks),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5830 * where \c retro_message_ext::msg is the progress bar's title
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5831 * and \c retro_message_ext::progress sets the progress bar's length.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5832 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5833 * This message type shouldn't be used for tasks that are expected to complete quickly.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5834 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5835 RETRO_MESSAGE_TYPE_PROGRESS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5836 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5837
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5838 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5839 * A core-provided message that the frontend will display to the player.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5840 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5841 * @note The frontend is encouraged store these messages in a queue.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5842 * However, it should not empty the queue of core-submitted messages upon exit;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5843 * if a core exits with an error, it may want to use this API
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5844 * to show an error message to the player.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5845 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5846 * The frontend should maintain its own copy of the submitted message
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5847 * and all subobjects, including strings.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5848 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5849 * @see RETRO_ENVIRONMENT_SET_MESSAGE_EXT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5850 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5851 struct retro_message_ext
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5852 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5853 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5854 * The \c NULL-terminated text of a message to show to the player.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5855 * Must not be \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5856 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5857 * @note The frontend must honor newlines in this string
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5858 * when rendering text to \c RETRO_MESSAGE_TARGET_OSD.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5859 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5860 const char *msg;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5861
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5862 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5863 * The duration that \c msg will be displayed on-screen, in milliseconds.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5864 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5865 * Ignored for \c RETRO_MESSAGE_TARGET_LOG.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5866 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5867 unsigned duration;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5868
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5869 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5870 * The relative importance of this message
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5871 * when targeting \c RETRO_MESSAGE_TARGET_OSD.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5872 * Higher values indicate higher priority.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5873 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5874 * The frontend should use this to prioritize messages
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5875 * when it can't show all active messages at once,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5876 * or to remove messages from its queue if it's full.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5877 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5878 * The relative display order of messages with the same priority
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5879 * is left to the frontend's discretion,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5880 * although we suggest breaking ties
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5881 * in favor of the most recently-submitted message.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5882 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5883 * Frontends may handle deprioritized messages at their discretion;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5884 * such messages may have their \c duration altered,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5885 * be hidden without being delayed,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5886 * or even be discarded entirely.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5887 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5888 * @note In the reference frontend (RetroArch),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5889 * the same priority values are used for frontend-generated notifications,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5890 * which are typically between 0 and 3 depending upon importance.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5891 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5892 * Ignored for \c RETRO_MESSAGE_TARGET_LOG.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5893 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5894 unsigned priority;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5895
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5896 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5897 * The severity level of this message.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5898 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5899 * The frontend may use this to filter or customize messages
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5900 * depending on the player's preferences.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5901 * Here are some ideas:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5902 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5903 * @li Use this to prioritize errors and warnings
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5904 * over higher-ranking info and debug messages.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5905 * @li Render warnings or errors with extra visual feedback,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5906 * e.g. with brighter colors or accompanying sound effects.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5907 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5908 * @see RETRO_ENVIRONMENT_SET_LOG_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5909 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5910 enum retro_log_level level;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5911
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5912 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5913 * The intended destination of this message.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5914 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5915 * @see retro_message_target
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5916 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5917 enum retro_message_target target;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5918
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5919 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5920 * The intended semantics of this message.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5921 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5922 * Ignored for \c RETRO_MESSAGE_TARGET_LOG.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5923 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5924 * @see retro_message_type
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5925 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5926 enum retro_message_type type;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5927
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5928 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5929 * The progress of an asynchronous task.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5930 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5931 * A value between 0 and 100 (inclusive) indicates the task's percentage,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5932 * and a value of -1 indicates a task of unknown completion.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5933 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5934 * @note Since message type is a hint, a frontend may ignore progress values.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5935 * Where relevant, a core should include progress percentage within the message string,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5936 * such that the message intent remains clear when displayed
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5937 * as a standard frontend-generated notification.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5938 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5939 * Ignored for \c RETRO_MESSAGE_TARGET_LOG and for
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5940 * message types other than \c RETRO_MESSAGE_TYPE_PROGRESS.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5941 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5942 int8_t progress;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5943 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5944
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5945 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5946
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5947 /* Describes how the libretro implementation maps a libretro input bind
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5948 * to its internal input system through a human readable string.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5949 * This string can be used to better let a user configure input. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5950 struct retro_input_descriptor
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5951 {
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5952 /* Associates given parameters with a description. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5953 unsigned port;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5954 unsigned device;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5955 unsigned index;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5956 unsigned id;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5957
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5958 /* Human readable description for parameters.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5959 * The pointer must remain valid until
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5960 * retro_unload_game() is called. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5961 const char *description;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5962 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5963
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5964 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5965 * Contains basic information about the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5966 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5967 * @see retro_get_system_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5968 * @warning All pointers are owned by the core
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5969 * and must remain valid throughout its lifetime.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5970 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5971 struct retro_system_info
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5972 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5973 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5974 * Descriptive name of the library.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5975 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5976 * @note Should not contain any version numbers, etc.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5977 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5978 const char *library_name;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5979
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5980 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5981 * Descriptive version of the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5982 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5983 const char *library_version;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5984
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5985 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5986 * A pipe-delimited string list of file extensions that this core can load, e.g. "bin|rom|iso".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5987 * Typically used by a frontend for filtering or core selection.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5988 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5989 const char *valid_extensions;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5990
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5991 /* Libretro cores that need to have direct access to their content
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5992 * files, including cores which use the path of the content files to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5993 * determine the paths of other files, should set need_fullpath to true.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5994 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5995 * Cores should strive for setting need_fullpath to false,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5996 * as it allows the frontend to perform patching, etc.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5997 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5998 * If need_fullpath is true and retro_load_game() is called:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
5999 * - retro_game_info::path is guaranteed to have a valid path
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6000 * - retro_game_info::data and retro_game_info::size are invalid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6001 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6002 * If need_fullpath is false and retro_load_game() is called:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6003 * - retro_game_info::path may be NULL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6004 * - retro_game_info::data and retro_game_info::size are guaranteed
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6005 * to be valid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6006 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6007 * See also:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6008 * - RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6009 * - RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6010 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6011 bool need_fullpath;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6012
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6013 /* If true, the frontend is not allowed to extract any archives before
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6014 * loading the real content.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6015 * Necessary for certain libretro implementations that load games
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6016 * from zipped archives. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6017 bool block_extract;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6018 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6019
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6020 /* Defines overrides which modify frontend handling of
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6021 * specific content file types.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6022 * An array of retro_system_content_info_override is
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6023 * passed to RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6024 * NOTE: In the following descriptions, references to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6025 * retro_load_game() may be replaced with
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6026 * retro_load_game_special() */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6027 struct retro_system_content_info_override
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6028 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6029 /* A list of file extensions for which the override
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6030 * should apply, delimited by a 'pipe' character
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6031 * (e.g. "md|sms|gg")
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6032 * Permitted file extensions are limited to those
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6033 * included in retro_system_info::valid_extensions
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6034 * and/or retro_subsystem_rom_info::valid_extensions */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6035 const char *extensions;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6036
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6037 /* Overrides the need_fullpath value set in
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6038 * retro_system_info and/or retro_subsystem_rom_info.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6039 * To reiterate:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6040 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6041 * If need_fullpath is true and retro_load_game() is called:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6042 * - retro_game_info::path is guaranteed to contain a valid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6043 * path to an existent file
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6044 * - retro_game_info::data and retro_game_info::size are invalid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6045 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6046 * If need_fullpath is false and retro_load_game() is called:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6047 * - retro_game_info::path may be NULL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6048 * - retro_game_info::data and retro_game_info::size are guaranteed
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6049 * to be valid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6050 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6051 * In addition:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6052 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6053 * If need_fullpath is true and retro_load_game() is called:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6054 * - retro_game_info_ext::full_path is guaranteed to contain a valid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6055 * path to an existent file
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6056 * - retro_game_info_ext::archive_path may be NULL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6057 * - retro_game_info_ext::archive_file may be NULL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6058 * - retro_game_info_ext::dir is guaranteed to contain a valid path
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6059 * to the directory in which the content file exists
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6060 * - retro_game_info_ext::name is guaranteed to contain the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6061 * basename of the content file, without extension
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6062 * - retro_game_info_ext::ext is guaranteed to contain the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6063 * extension of the content file in lower case format
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6064 * - retro_game_info_ext::data and retro_game_info_ext::size
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6065 * are invalid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6066 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6067 * If need_fullpath is false and retro_load_game() is called:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6068 * - If retro_game_info_ext::file_in_archive is false:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6069 * - retro_game_info_ext::full_path is guaranteed to contain
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6070 * a valid path to an existent file
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6071 * - retro_game_info_ext::archive_path may be NULL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6072 * - retro_game_info_ext::archive_file may be NULL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6073 * - retro_game_info_ext::dir is guaranteed to contain a
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6074 * valid path to the directory in which the content file exists
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6075 * - retro_game_info_ext::name is guaranteed to contain the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6076 * basename of the content file, without extension
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6077 * - retro_game_info_ext::ext is guaranteed to contain the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6078 * extension of the content file in lower case format
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6079 * - If retro_game_info_ext::file_in_archive is true:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6080 * - retro_game_info_ext::full_path may be NULL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6081 * - retro_game_info_ext::archive_path is guaranteed to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6082 * contain a valid path to an existent compressed file
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6083 * inside which the content file is located
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6084 * - retro_game_info_ext::archive_file is guaranteed to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6085 * contain a valid path to an existent content file
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6086 * inside the compressed file referred to by
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6087 * retro_game_info_ext::archive_path
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6088 * e.g. for a compressed file '/path/to/foo.zip'
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6089 * containing 'bar.sfc'
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6090 * > retro_game_info_ext::archive_path will be '/path/to/foo.zip'
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6091 * > retro_game_info_ext::archive_file will be 'bar.sfc'
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6092 * - retro_game_info_ext::dir is guaranteed to contain a
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6093 * valid path to the directory in which the compressed file
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6094 * (containing the content file) exists
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6095 * - retro_game_info_ext::name is guaranteed to contain
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6096 * EITHER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6097 * 1) the basename of the compressed file (containing
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6098 * the content file), without extension
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6099 * OR
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6100 * 2) the basename of the content file inside the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6101 * compressed file, without extension
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6102 * In either case, a core should consider 'name' to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6103 * be the canonical name/ID of the the content file
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6104 * - retro_game_info_ext::ext is guaranteed to contain the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6105 * extension of the content file inside the compressed file,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6106 * in lower case format
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6107 * - retro_game_info_ext::data and retro_game_info_ext::size are
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6108 * guaranteed to be valid */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6109 bool need_fullpath;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6110
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6111 /* If need_fullpath is false, specifies whether the content
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6112 * data buffer available in retro_load_game() is 'persistent'
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6113 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6114 * If persistent_data is false and retro_load_game() is called:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6115 * - retro_game_info::data and retro_game_info::size
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6116 * are valid only until retro_load_game() returns
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6117 * - retro_game_info_ext::data and retro_game_info_ext::size
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6118 * are valid only until retro_load_game() returns
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6119 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6120 * If persistent_data is true and retro_load_game() is called:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6121 * - retro_game_info::data and retro_game_info::size
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6122 * are valid until retro_deinit() returns
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6123 * - retro_game_info_ext::data and retro_game_info_ext::size
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6124 * are valid until retro_deinit() returns */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6125 bool persistent_data;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6126 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6127
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6128 /* Similar to retro_game_info, but provides extended
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6129 * information about the source content file and
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6130 * game memory buffer status.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6131 * And array of retro_game_info_ext is returned by
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6132 * RETRO_ENVIRONMENT_GET_GAME_INFO_EXT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6133 * NOTE: In the following descriptions, references to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6134 * retro_load_game() may be replaced with
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6135 * retro_load_game_special() */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6136 struct retro_game_info_ext
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6137 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6138 /* - If file_in_archive is false, contains a valid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6139 * path to an existent content file (UTF-8 encoded)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6140 * - If file_in_archive is true, may be NULL */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6141 const char *full_path;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6142
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6143 /* - If file_in_archive is false, may be NULL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6144 * - If file_in_archive is true, contains a valid path
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6145 * to an existent compressed file inside which the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6146 * content file is located (UTF-8 encoded) */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6147 const char *archive_path;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6148
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6149 /* - If file_in_archive is false, may be NULL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6150 * - If file_in_archive is true, contain a valid path
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6151 * to an existent content file inside the compressed
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6152 * file referred to by archive_path (UTF-8 encoded)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6153 * e.g. for a compressed file '/path/to/foo.zip'
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6154 * containing 'bar.sfc'
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6155 * > archive_path will be '/path/to/foo.zip'
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6156 * > archive_file will be 'bar.sfc' */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6157 const char *archive_file;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6158
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6159 /* - If file_in_archive is false, contains a valid path
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6160 * to the directory in which the content file exists
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6161 * (UTF-8 encoded)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6162 * - If file_in_archive is true, contains a valid path
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6163 * to the directory in which the compressed file
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6164 * (containing the content file) exists (UTF-8 encoded) */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6165 const char *dir;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6166
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6167 /* Contains the canonical name/ID of the content file
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6168 * (UTF-8 encoded). Intended for use when identifying
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6169 * 'complementary' content named after the loaded file -
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6170 * i.e. companion data of a different format (a CD image
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6171 * required by a ROM), texture packs, internally handled
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6172 * save files, etc.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6173 * - If file_in_archive is false, contains the basename
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6174 * of the content file, without extension
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6175 * - If file_in_archive is true, then string is
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6176 * implementation specific. A frontend may choose to
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6177 * set a name value of:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6178 * EITHER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6179 * 1) the basename of the compressed file (containing
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6180 * the content file), without extension
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6181 * OR
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6182 * 2) the basename of the content file inside the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6183 * compressed file, without extension
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6184 * RetroArch sets the 'name' value according to (1).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6185 * A frontend that supports routine loading of
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6186 * content from archives containing multiple unrelated
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6187 * content files may set the 'name' value according
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6188 * to (2). */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6189 const char *name;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6190
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6191 /* - If file_in_archive is false, contains the extension
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6192 * of the content file in lower case format
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6193 * - If file_in_archive is true, contains the extension
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6194 * of the content file inside the compressed file,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6195 * in lower case format */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6196 const char *ext;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6197
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6198 /* String of implementation specific meta-data. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6199 const char *meta;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6200
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6201 /* Memory buffer of loaded game content. Will be NULL:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6202 * IF
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6203 * - retro_system_info::need_fullpath is true and
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6204 * retro_system_content_info_override::need_fullpath
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6205 * is unset
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6206 * OR
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6207 * - retro_system_content_info_override::need_fullpath
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6208 * is true */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6209 const void *data;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6210
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6211 /* Size of game content memory buffer, in bytes */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6212 size_t size;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6213
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6214 /* True if loaded content file is inside a compressed
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6215 * archive */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6216 bool file_in_archive;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6217
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6218 /* - If data is NULL, value is unset/ignored
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6219 * - If data is non-NULL:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6220 * - If persistent_data is false, data and size are
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6221 * valid only until retro_load_game() returns
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6222 * - If persistent_data is true, data and size are
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6223 * are valid until retro_deinit() returns */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6224 bool persistent_data;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6225 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6226
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6227 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6228 * Parameters describing the size and shape of the video frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6229 * @see retro_system_av_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6230 * @see RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6231 * @see RETRO_ENVIRONMENT_SET_GEOMETRY
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6232 * @see retro_get_system_av_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6233 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6234 struct retro_game_geometry
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6235 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6236 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6237 * Nominal video width of game, in pixels.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6238 * This will typically be the emulated platform's native video width
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6239 * (or its smallest, if the original hardware supports multiple resolutions).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6240 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6241 unsigned base_width;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6242
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6243 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6244 * Nominal video height of game, in pixels.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6245 * This will typically be the emulated platform's native video height
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6246 * (or its smallest, if the original hardware supports multiple resolutions).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6247 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6248 unsigned base_height;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6249
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6250 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6251 * Maximum possible width of the game screen, in pixels.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6252 * This will typically be the emulated platform's maximum video width.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6253 * For cores that emulate platforms with multiple screens (such as the Nintendo DS),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6254 * this should assume the core's widest possible screen layout (e.g. side-by-side).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6255 * For cores that support upscaling the resolution,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6256 * this should assume the highest supported scale factor is active.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6257 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6258 unsigned max_width;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6259
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6260 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6261 * Maximum possible height of the game screen, in pixels.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6262 * This will typically be the emulated platform's maximum video height.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6263 * For cores that emulate platforms with multiple screens (such as the Nintendo DS),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6264 * this should assume the core's tallest possible screen layout (e.g. vertical).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6265 * For cores that support upscaling the resolution,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6266 * this should assume the highest supported scale factor is active.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6267 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6268 unsigned max_height; /* Maximum possible height of game. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6269
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6270 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6271 * Nominal aspect ratio of game.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6272 * If zero or less,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6273 * an aspect ratio of <tt>base_width / base_height</tt> is assumed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6274 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6275 * @note A frontend may ignore this setting.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6276 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6277 float aspect_ratio;
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6278 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6279
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6280 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6281 * Parameters describing the timing of the video and audio.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6282 * @see retro_system_av_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6283 * @see RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6284 * @see retro_get_system_av_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6285 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6286 struct retro_system_timing
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6287 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6288 /** Video output refresh rate, in frames per second. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6289 double fps;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6290
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6291 /** The audio output sample rate, in Hz. */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6292 double sample_rate;
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6293 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6294
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6295 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6296 * Configures how the core's audio and video should be updated.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6297 * @see RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6298 * @see retro_get_system_av_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6299 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6300 struct retro_system_av_info
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6301 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6302 /** Parameters describing the size and shape of the video frame. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6303 struct retro_game_geometry geometry;
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6304
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6305 /** Parameters describing the timing of the video and audio. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6306 struct retro_system_timing timing;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6307 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6308
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6309 /** @defgroup SET_CORE_OPTIONS Core Options
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6310 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6311 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6312
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6313 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6314 * Represents \ref RETRO_ENVIRONMENT_GET_VARIABLE "a core option query".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6315 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6316 * @note In \ref RETRO_ENVIRONMENT_SET_VARIABLES
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6317 * (which is a deprecated API),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6318 * this \c struct serves as an option definition.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6319 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6320 * @see RETRO_ENVIRONMENT_GET_VARIABLE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6321 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6322 struct retro_variable
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6323 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6324 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6325 * A unique key identifying this option.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6326 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6327 * Should be a key for an option that was previously defined
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6328 * with \ref RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2 or similar.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6329 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6330 * Should be prefixed with the core's name
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6331 * to minimize the risk of collisions with another core's options,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6332 * as frontends are not required to use a namespacing scheme for storing options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6333 * For example, a core named "foo" might define an option named "foo_option".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6334 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6335 * @note In \ref RETRO_ENVIRONMENT_SET_VARIABLES
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6336 * (which is a deprecated API),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6337 * this field is used to define an option
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6338 * named by this key.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6339 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6340 const char *key;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6341
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6342 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6343 * Value to be obtained.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6344 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6345 * Set by the frontend to \c NULL if
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6346 * the option named by \ref key does not exist.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6347 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6348 * @note In \ref RETRO_ENVIRONMENT_SET_VARIABLES
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6349 * (which is a deprecated API),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6350 * this field is set by the core to define the possible values
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6351 * for an option named by \ref key.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6352 * When used this way, it must be formatted as follows:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6353 * @li The text before the first ';' is the option's human-readable title.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6354 * @li A single space follows the ';'.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6355 * @li The rest of the string is a '|'-delimited list of possible values,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6356 * with the first one being the default.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6357 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6358 const char *value;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6359 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6360
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6361 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6362 * An argument that's used to show or hide a core option in the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6363 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6364 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6365 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6366 struct retro_core_option_display
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6367 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6368 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6369 * The key for a core option that was defined with \ref RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6370 * \ref RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6371 * or their legacy equivalents.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6372 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6373 const char *key;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6374
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6375 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6376 * Whether the option named by \c key
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6377 * should be displayed to the player in the frontend's core options menu.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6378 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6379 * @note This value is a hint, \em not a requirement;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6380 * the frontend is free to ignore this field.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6381 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6382 bool visible;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6383 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6384
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6385 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6386 * The maximum number of choices that can be defined for a given core option.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6387 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6388 * This limit was chosen as a compromise between
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6389 * a core's flexibility and a streamlined user experience.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6390 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6391 * @note A guiding principle of libretro's API design is that
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6392 * all common interactions (gameplay, menu navigation, etc.)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6393 * should be possible without a keyboard.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6394 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6395 * If you need more than 128 choices for a core option,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6396 * consider simplifying your option structure.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6397 * Here are some ideas:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6398 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6399 * \li If a core option represents a numeric value,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6400 * consider reducing the option's granularity
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6401 * (e.g. define time limits in increments of 5 seconds instead of 1 second).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6402 * Providing a fixed set of values based on experimentation
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6403 * is also a good idea.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6404 * \li If a core option represents a dynamically-built list of files,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6405 * consider leaving out files that won't be useful.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6406 * For example, if a core allows the player to choose a specific BIOS file,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6407 * it can omit files of the wrong length or without a valid header.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6408 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6409 * @see retro_core_option_definition
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6410 * @see retro_core_option_v2_definition
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6411 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6412 #define RETRO_NUM_CORE_OPTION_VALUES_MAX 128
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6413
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6414 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6415 * A descriptor for a particular choice within a core option.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6416 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6417 * @note All option values are represented as strings.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6418 * If you need to represent any other type,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6419 * parse the string in \ref value.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6420 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6421 * @see retro_core_option_v2_category
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6422 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6423 struct retro_core_option_value
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6424 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6425 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6426 * The option value that the frontend will serialize.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6427 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6428 * Must not be \c NULL or empty.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6429 * No other hard limits are placed on this value's contents,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6430 * but here are some suggestions:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6431 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6432 * \li If the value represents a number,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6433 * don't include any non-digit characters (units, separators, etc.).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6434 * Instead, include that information in \c label.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6435 * This will simplify parsing.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6436 * \li If the value represents a file path,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6437 * store it as a relative path with respect to one of the common libretro directories
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6438 * (e.g. \ref RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY "the system directory"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6439 * or \ref RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY "the save directory"),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6440 * and use forward slashes (\c "/") as directory separators.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6441 * This will simplify cloud storage if supported by the frontend,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6442 * as the same file may be used on multiple devices.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6443 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6444 const char *value;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6445
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6446 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6447 * Human-readable name for \c value that the frontend should show to players.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6448 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6449 * May be \c NULL, in which case the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6450 * should display \c value itself.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6451 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6452 * Here are some guidelines for writing a good label:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6453 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6454 * \li Make the option labels obvious
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6455 * so that they don't need to be explained in the description.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6456 * \li Keep labels short, and don't use unnecessary words.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6457 * For example, "OpenGL" is a better label than "OpenGL Mode".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6458 * \li If the option represents a number,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6459 * consider adding units, separators, or other punctuation
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6460 * into the label itself.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6461 * For example, "5 seconds" is a better label than "5".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6462 * \li If the option represents a number, use intuitive units
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6463 * that don't take a lot of digits to express.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6464 * For example, prefer "1 minute" over "60 seconds" or "60,000 milliseconds".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6465 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6466 const char *label;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6467 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6468
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6469 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6470 * @copybrief retro_core_option_v2_definition
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6471 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6472 * @deprecated Use \ref retro_core_option_v2_definition instead,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6473 * as it supports categorizing options into groups.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6474 * Only use this \c struct to support older frontends or cores.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6475 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6476 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6477 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6478 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6479 struct retro_core_option_definition
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6480 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6481 /** @copydoc retro_core_option_v2_definition::key */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6482 const char *key;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6483
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6484 /** @copydoc retro_core_option_v2_definition::desc */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6485 const char *desc;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6486
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6487 /** @copydoc retro_core_option_v2_definition::info */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6488 const char *info;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6489
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6490 /** @copydoc retro_core_option_v2_definition::values */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6491 struct retro_core_option_value values[RETRO_NUM_CORE_OPTION_VALUES_MAX];
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6492
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6493 /** @copydoc retro_core_option_v2_definition::default_value */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6494 const char *default_value;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6495 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6496
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6497 #ifdef __PS3__
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6498 #undef local
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6499 #endif
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6500
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6501 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6502 * A variant of \ref retro_core_options that supports internationalization.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6503 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6504 * @deprecated Use \ref retro_core_options_v2_intl instead,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6505 * as it supports categorizing options into groups.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6506 * Only use this \c struct to support older frontends or cores.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6507 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6508 * @see retro_core_options
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6509 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6510 * @see RETRO_ENVIRONMENT_GET_LANGUAGE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6511 * @see retro_language
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6512 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6513 struct retro_core_options_intl
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6514 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6515 /** @copydoc retro_core_options_v2_intl::us */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6516 struct retro_core_option_definition *us;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6517
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6518 /** @copydoc retro_core_options_v2_intl::local */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6519 struct retro_core_option_definition *local;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6520 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6521
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6522 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6523 * A descriptor for a group of related core options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6524 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6525 * Here's an example category:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6526 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6527 * @code
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6528 * {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6529 * "cpu",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6530 * "CPU Emulation",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6531 * "Settings for CPU quirks."
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6532 * }
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6533 * @endcode
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6534 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6535 * @see retro_core_options_v2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6536 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6537 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6538 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6539 struct retro_core_option_v2_category
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6540 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6541 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6542 * A string that uniquely identifies this category within the core's options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6543 * Any \c retro_core_option_v2_definition whose \c category_key matches this
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6544 * is considered to be within this category.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6545 * Different cores may use the same category keys,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6546 * so namespacing them is not necessary.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6547 * Valid characters are <tt>[a-zA-Z0-9_-]</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6548 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6549 * Frontends should use this category to organize core options,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6550 * but may customize this category's presentation in other ways.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6551 * For example, a frontend may use common keys like "audio" or "gfx"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6552 * to select an appropriate icon in its UI.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6553 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6554 * Required; must not be \c NULL.
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6555 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6556 const char *key;
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6557
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6558 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6559 * A brief human-readable name for this category,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6560 * intended for the frontend to display to the player.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6561 * This should be a name that's concise and descriptive, such as "Audio" or "Video".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6562 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6563 * Required; must not be \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6564 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6565 const char *desc;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6566
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6567 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6568 * A human-readable description for this category,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6569 * intended for the frontend to display to the player
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6570 * as secondary help text (e.g. a sublabel or a tooltip).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6571 * Optional; may be \c NULL or an empty string.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6572 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6573 const char *info;
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6574 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6575
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6576 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6577 * A descriptor for a particular core option and the values it may take.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6578 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6579 * Supports categorizing options into groups,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6580 * so as not to overwhelm the player.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6581 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6582 * @see retro_core_option_v2_category
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6583 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6584 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6585 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6586 struct retro_core_option_v2_definition
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6587 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6588 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6589 * A unique identifier for this option that cores may use
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6590 * \ref RETRO_ENVIRONMENT_GET_VARIABLE "to query its value from the frontend".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6591 * Must be unique within this core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6592 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6593 * Should be unique globally;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6594 * the recommended method for doing so
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6595 * is to prefix each option with the core's name.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6596 * For example, an option that controls the resolution for a core named "foo"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6597 * should be named \c "foo_resolution".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6598 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6599 * Valid key characters are in the set <tt>[a-zA-Z0-9_-]</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6600 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6601 const char *key;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6602
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6603 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6604 * A human-readable name for this option,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6605 * intended to be displayed by frontends that don't support
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6606 * categorizing core options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6607 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6608 * Required; must not be \c NULL or empty.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6609 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6610 const char *desc;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6611
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6612 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6613 * A human-readable name for this option,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6614 * intended to be displayed by frontends that support
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6615 * categorizing core options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6616 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6617 * This version may be slightly more concise than \ref desc,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6618 * as it can rely on the structure of the options menu.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6619 * For example, "Interface" is a good \c desc_categorized,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6620 * as it can be displayed as a sublabel for a "Network" category.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6621 * For \c desc, "Network Interface" would be more suitable.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6622 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6623 * Optional; if this field or \c category_key is empty or \c NULL,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6624 * \c desc will be used instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6625 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6626 const char *desc_categorized;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6627
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6628 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6629 * A human-readable description of this option and its effects,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6630 * intended to be displayed by frontends that don't support
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6631 * categorizing core options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6632 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6633 * @details Intended to be displayed as secondary help text,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6634 * such as a tooltip or a sublabel.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6635 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6636 * Here are some suggestions for writing a good description:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6637 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6638 * \li Avoid technical jargon unless this option is meant for advanced users.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6639 * If unavoidable, suggest one of the default options for those unsure.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6640 * \li Don't repeat the option name in the description;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6641 * instead, describe what the option name means.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6642 * \li If an option requires a core restart or game reset to take effect,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6643 * be sure to say so.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6644 * \li Try to make the option labels obvious
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6645 * so that they don't need to be explained in the description.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6646 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6647 * Optional; may be \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6648 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6649 const char *info;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6650
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6651 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6652 * @brief A human-readable description of this option and its effects,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6653 * intended to be displayed by frontends that support
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6654 * categorizing core options.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6655 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6656 * This version is provided to accommodate descriptions
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6657 * that reference other options by name,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6658 * as options may have different user-facing names
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6659 * depending on whether the frontend supports categorization.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6660 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6661 * @copydetails info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6662 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6663 * If empty or \c NULL, \c info will be used instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6664 * Will be ignored if \c category_key is empty or \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6665 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6666 const char *info_categorized;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6667
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6668 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6669 * The key of the category that this option belongs to.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6670 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6671 * Optional; if equal to \ref retro_core_option_v2_category::key "a defined category",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6672 * then this option shall be displayed by the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6673 * next to other options in this same category,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6674 * assuming it supports doing so.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6675 * Option categories are intended to be displayed in a submenu,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6676 * but this isn't a hard requirement.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6677 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6678 * If \c NULL, empty, or not equal to a defined category,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6679 * then this option is considered uncategorized
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6680 * and the frontend shall display it outside of any category
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6681 * (most likely at a top-level menu).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6682 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6683 * @see retro_core_option_v2_category
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6684 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6685 const char *category_key;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6686
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6687 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6688 * One or more possible values for this option,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6689 * up to the limit of \ref RETRO_NUM_CORE_OPTION_VALUES_MAX.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6690 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6691 * Terminated by a \c { NULL, NULL } element,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6692 * although frontends should work even if all elements are used.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6693 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6694 struct retro_core_option_value values[RETRO_NUM_CORE_OPTION_VALUES_MAX];
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6695
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6696 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6697 * The default value for this core option.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6698 * Used if it hasn't been set, e.g. for new cores.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6699 * Must equal one of the \ref value members in the \c values array,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6700 * or else this option will be ignored.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6701 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6702 const char *default_value;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6703 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6704
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6705 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6706 * A set of core option descriptors and the categories that group them,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6707 * suitable for enabling a core to be customized.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6708 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6709 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6710 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6711 struct retro_core_options_v2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6712 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6713 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6714 * An array of \ref retro_core_option_v2_category "option categories",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6715 * terminated by a zeroed-out category \c struct.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6716 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6717 * Will be ignored if the frontend doesn't support core option categories.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6718 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6719 * If \c NULL or ignored, all options will be treated as uncategorized.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6720 * This most likely means that a frontend will display them at a top-level menu
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6721 * without any kind of hierarchy or grouping.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6722 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6723 struct retro_core_option_v2_category *categories;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6724
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6725 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6726 * An array of \ref retro_core_option_v2_definition "core option descriptors",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6727 * terminated by a zeroed-out definition \c struct.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6728 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6729 * Required; must not be \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6730 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6731 struct retro_core_option_v2_definition *definitions;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6732 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6733
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6734 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6735 * A variant of \ref retro_core_options_v2 that supports internationalization.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6736 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6737 * @see retro_core_options_v2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6738 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6739 * @see RETRO_ENVIRONMENT_GET_LANGUAGE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6740 * @see retro_language
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6741 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6742 struct retro_core_options_v2_intl
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6743 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6744 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6745 * Pointer to a core options set
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6746 * whose text is written in American English.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6747 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6748 * This may be passed to \c RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2 as-is
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6749 * if not using \c RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6750 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6751 * Required; must not be \c NULL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6752 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6753 struct retro_core_options_v2 *us;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6754
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6755 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6756 * Pointer to a core options set
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6757 * whose text is written in one of libretro's \ref retro_language "supported languages",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6758 * most likely the one returned by \ref RETRO_ENVIRONMENT_GET_LANGUAGE.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6759 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6760 * Structure is the same, but usage is slightly different:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6761 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6762 * \li All text (except for keys and option values)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6763 * should be written in whichever language
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6764 * is returned by \c RETRO_ENVIRONMENT_GET_LANGUAGE.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6765 * \li All fields besides keys and option values may be \c NULL,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6766 * in which case the corresponding string in \c us
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6767 * is used instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6768 * \li All \ref retro_core_option_v2_definition::default_value "default option values"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6769 * are taken from \c us.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6770 * The defaults in this field are ignored.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6771 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6772 * May be \c NULL, in which case \c us is used instead.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6773 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6774 struct retro_core_options_v2 *local;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6775 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6776
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6777 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6778 * Called by the frontend to determine if any core option's visibility has changed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6779 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6780 * Each time a frontend sets a core option,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6781 * it should call this function to see if
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6782 * any core option should be made visible or invisible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6783 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6784 * May also be called after \ref retro_load_game "loading a game",
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6785 * to determine what the initial visibility of each option should be.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6786 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6787 * Within this function, the core must update the visibility
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6788 * of any dynamically-hidden options
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6789 * using \ref RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6790 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6791 * @note All core options are visible by default,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6792 * even during this function's first call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6793 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6794 * @return \c true if any core option's visibility was adjusted
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6795 * since the last call to this function.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6796 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6797 * @see retro_core_option_display
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6798 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6799 typedef bool (RETRO_CALLCONV *retro_core_options_update_display_callback_t)(void);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6800
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6801 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6802 * Callback registered by the core for the frontend to use
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6803 * when setting the visibility of each core option.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6804 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6805 * @see RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6806 * @see retro_core_option_display
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6807 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6808 struct retro_core_options_update_display_callback
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6809 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6810 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6811 * @copydoc retro_core_options_update_display_callback_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6812 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6813 * Set by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6814 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6815 retro_core_options_update_display_callback_t callback;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6816 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6817
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6818 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6819
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6820 struct retro_game_info
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6821 {
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6822 const char *path; /* Path to game, UTF-8 encoded.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6823 * Sometimes used as a reference for building other paths.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6824 * May be NULL if game was loaded from stdin or similar,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6825 * but in this case some cores will be unable to load `data`.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6826 * So, it is preferable to fabricate something here instead
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6827 * of passing NULL, which will help more cores to succeed.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6828 * retro_system_info::need_fullpath requires
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6829 * that this path is valid. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6830 const void *data; /* Memory buffer of loaded game. Will be NULL
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6831 * if need_fullpath was set. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6832 size_t size; /* Size of memory buffer. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6833 const char *meta; /* String of implementation specific meta-data. */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6834 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6835
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6836 /** @defgroup GET_CURRENT_SOFTWARE_FRAMEBUFFER Frontend-Owned Framebuffers
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6837 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6838 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6839
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6840 /** @defgroup RETRO_MEMORY_ACCESS Framebuffer Memory Access Types
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6841 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6842 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6843
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6844 /** Indicates that core will write to the framebuffer returned by the frontend. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6845 #define RETRO_MEMORY_ACCESS_WRITE (1 << 0)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6846
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6847 /** Indicates that the core will read from the framebuffer returned by the frontend. */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6848 #define RETRO_MEMORY_ACCESS_READ (1 << 1)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6849
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6850 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6851
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6852 /** @defgroup RETRO_MEMORY_TYPE Framebuffer Memory Types
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6853 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6854 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6855
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6856 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6857 * Indicates that the returned framebuffer's memory is cached.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6858 * If not set, random access to the buffer may be very slow.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6859 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6860 #define RETRO_MEMORY_TYPE_CACHED (1 << 0)
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6861
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6862 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6863
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6864 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6865 * A frame buffer owned by the frontend that a core may use for rendering.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6866 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6867 * @see GET_CURRENT_SOFTWARE_FRAMEBUFFER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6868 * @see retro_video_refresh_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6869 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6870 struct retro_framebuffer
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6871 {
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6872 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6873 * Pointer to the beginning of the framebuffer provided by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6874 * The initial contents of this buffer are unspecified,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6875 * as is the means used to map the memory;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6876 * this may be defined in software,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6877 * or it may be GPU memory mapped to RAM.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6878 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6879 * If the framebuffer is used,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6880 * this pointer must be passed to \c retro_video_refresh_t as-is.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6881 * It is undefined behavior to pass an offset to this pointer.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6882 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6883 * @warning This pointer is only guaranteed to be valid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6884 * for the duration of the same \c retro_run iteration
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6885 * \ref GET_CURRENT_SOFTWARE_FRAMEBUFFER "that requested the framebuffer".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6886 * Reuse of this pointer is undefined.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6887 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6888 void *data;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6889
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6890 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6891 * The width of the framebuffer given in \c data, in pixels.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6892 * Set by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6893 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6894 * @warning If the framebuffer is used,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6895 * this value must be passed to \c retro_video_refresh_t as-is.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6896 * It is undefined behavior to try to render \c data with any other width.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6897 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6898 unsigned width;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6899
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6900 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6901 * The height of the framebuffer given in \c data, in pixels.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6902 * Set by the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6903 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6904 * @warning If the framebuffer is used,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6905 * this value must be passed to \c retro_video_refresh_t as-is.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6906 * It is undefined behavior to try to render \c data with any other height.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6907 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6908 unsigned height;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6909
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6910 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6911 * The distance between the start of one scanline and the beginning of the next, in bytes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6912 * In practice this is usually equal to \c width times the pixel size,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6913 * but that's not guaranteed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6914 * Sometimes called the "stride".
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6915 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6916 * @setby{frontend}
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6917 * @warning If the framebuffer is used,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6918 * this value must be passed to \c retro_video_refresh_t as-is.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6919 * It is undefined to try to render \c data with any other pitch.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6920 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6921 size_t pitch;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6922
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6923 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6924 * The pixel format of the returned framebuffer.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6925 * May be different than the format specified by the core in \c RETRO_ENVIRONMENT_SET_PIXEL_FORMAT,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6926 * e.g. due to conversions.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6927 * Set by the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6928 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6929 * @see RETRO_ENVIRONMENT_SET_PIXEL_FORMAT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6930 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6931 enum retro_pixel_format format;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6932
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6933 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6934 * One or more \ref RETRO_MEMORY_ACCESS "memory access flags"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6935 * that specify how the core will access the memory in \c data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6936 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6937 * @setby{core}
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6938 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6939 unsigned access_flags;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6940
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6941 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6942 * Zero or more \ref RETRO_MEMORY_TYPE "memory type flags"
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6943 * that describe how the framebuffer's memory has been mapped.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6944 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6945 * @setby{frontend}
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6946 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6947 unsigned memory_flags;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6948 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6949
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6950 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6951
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6952 /** @defgroup SET_FASTFORWARDING_OVERRIDE Fast-Forward Override
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6953 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6954 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6955
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6956 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6957 * Parameters that govern when and how the core takes control
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6958 * of fast-forwarding mode.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6959 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6960 struct retro_fastforwarding_override
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6961 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6962 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6963 * The factor by which the core will be sped up
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6964 * when \c fastforward is \c true.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6965 * This value is used as follows:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6966 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6967 * @li A value greater than 1.0 will run the core at
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6968 * the specified multiple of normal speed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6969 * For example, a value of 5.0
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6970 * combined with a normal target rate of 60 FPS
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6971 * will result in a target rate of 300 FPS.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6972 * The actual rate may be lower if the host's hardware can't keep up.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6973 * @li A value of 1.0 will run the core at normal speed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6974 * @li A value between 0.0 (inclusive) and 1.0 (exclusive)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6975 * will run the core as fast as the host system can manage.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6976 * @li A negative value will let the frontend choose a factor.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6977 * @li An infinite value or \c NaN results in undefined behavior.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6978 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6979 * @attention Setting this value to less than 1.0 will \em not
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6980 * slow down the core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6981 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6982 float ratio;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6983
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6984 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6985 * If \c true, the frontend should activate fast-forwarding
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6986 * until this field is set to \c false or the core is unloaded.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6987 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6988 bool fastforward;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6989
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6990 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6991 * If \c true, the frontend should display an on-screen notification or icon
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6992 * while \c fastforward is \c true (where supported).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6993 * Otherwise, the frontend should not display any such notification.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6994 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6995 bool notification;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6996
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6997 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6998 * If \c true, the core has exclusive control
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
6999 * over enabling and disabling fast-forwarding
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7000 * via the \c fastforward field.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7001 * The frontend will not be able to start or stop fast-forwarding
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7002 * until this field is set to \c false or the core is unloaded.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7003 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7004 bool inhibit_toggle;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7005 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7006
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7007 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7008
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7009 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7010 * During normal operation.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7011 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7012 * @note Rate will be equal to the core's internal FPS.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7013 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7014 #define RETRO_THROTTLE_NONE 0
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7015
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7016 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7017 * While paused or stepping single frames.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7018 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7019 * @note Rate will be 0.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7020 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7021 #define RETRO_THROTTLE_FRAME_STEPPING 1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7022
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7023 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7024 * During fast forwarding.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7025 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7026 * @note Rate will be 0 if not specifically limited to a maximum speed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7027 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7028 #define RETRO_THROTTLE_FAST_FORWARD 2
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7029
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7030 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7031 * During slow motion.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7032 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7033 * @note Rate will be less than the core's internal FPS.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7034 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7035 #define RETRO_THROTTLE_SLOW_MOTION 3
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7036
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7037 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7038 * While rewinding recorded save states.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7039 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7040 * @note Rate can vary depending on the rewind speed or be 0 if the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7041 * is not aiming for a specific rate.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7042 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7043 #define RETRO_THROTTLE_REWINDING 4
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7044
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7045 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7046 * While vsync is active in the video driver, and the target refresh rate is lower than the core's internal FPS.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7047 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7048 * @note Rate is the target refresh rate.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7049 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7050 #define RETRO_THROTTLE_VSYNC 5
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7051
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7052 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7053 * When the frontend does not throttle in any way.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7054 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7055 * @note Rate will be 0. An example could be if no vsync or audio output is active.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7056 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7057 #define RETRO_THROTTLE_UNBLOCKED 6
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7058
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7059 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7060 * Details about the actual rate an implementation is calling \c retro_run() at.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7061 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7062 * @see RETRO_ENVIRONMENT_GET_THROTTLE_STATE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7063 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7064 struct retro_throttle_state
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7065 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7066 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7067 * The current throttling mode.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7068 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7069 * @note Should be one of the \c RETRO_THROTTLE_* values.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7070 * @see RETRO_THROTTLE_NONE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7071 * @see RETRO_THROTTLE_FRAME_STEPPING
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7072 * @see RETRO_THROTTLE_FAST_FORWARD
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7073 * @see RETRO_THROTTLE_SLOW_MOTION
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7074 * @see RETRO_THROTTLE_REWINDING
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7075 * @see RETRO_THROTTLE_VSYNC
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7076 * @see RETRO_THROTTLE_UNBLOCKED
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7077 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7078 unsigned mode;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7079
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7080 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7081 * How many times per second the frontend aims to call retro_run.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7082 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7083 * @note Depending on the mode, it can be 0 if there is no known fixed rate.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7084 * This won't be accurate if the total processing time of the core and
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7085 * the frontend is longer than what is available for one frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7086 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7087 float rate;
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7088 };
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7089
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7090 /** @defgroup GET_MICROPHONE_INTERFACE Microphone Interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7091 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7092 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7093
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7094 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7095 * Opaque handle to a microphone that's been opened for use.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7096 * The underlying object is accessed or created with \c retro_microphone_interface_t.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7097 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7098 typedef struct retro_microphone retro_microphone_t;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7099
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7100 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7101 * Parameters for configuring a microphone.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7102 * Some of these might not be honored,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7103 * depending on the available hardware and driver configuration.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7104 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7105 typedef struct retro_microphone_params
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7106 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7107 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7108 * The desired sample rate of the microphone's input, in Hz.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7109 * The microphone's input will be resampled,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7110 * so cores can ask for whichever frequency they need.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7111 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7112 * If zero, some reasonable default will be provided by the frontend
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7113 * (usually from its config file).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7114 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7115 * @see retro_get_mic_rate_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7116 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7117 unsigned rate;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7118 } retro_microphone_params_t;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7119
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7120 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7121 * @copydoc retro_microphone_interface::open_mic
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7122 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7123 typedef retro_microphone_t *(RETRO_CALLCONV *retro_open_mic_t)(const retro_microphone_params_t *params);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7124
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7125 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7126 * @copydoc retro_microphone_interface::close_mic
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7127 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7128 typedef void (RETRO_CALLCONV *retro_close_mic_t)(retro_microphone_t *microphone);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7129
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7130 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7131 * @copydoc retro_microphone_interface::get_params
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7132 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7133 typedef bool (RETRO_CALLCONV *retro_get_mic_params_t)(const retro_microphone_t *microphone, retro_microphone_params_t *params);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7134
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7135 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7136 * @copydoc retro_microphone_interface::set_mic_state
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7137 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7138 typedef bool (RETRO_CALLCONV *retro_set_mic_state_t)(retro_microphone_t *microphone, bool state);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7139
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7140 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7141 * @copydoc retro_microphone_interface::get_mic_state
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7142 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7143 typedef bool (RETRO_CALLCONV *retro_get_mic_state_t)(const retro_microphone_t *microphone);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7144
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7145 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7146 * @copydoc retro_microphone_interface::read_mic
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7147 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7148 typedef int (RETRO_CALLCONV *retro_read_mic_t)(retro_microphone_t *microphone, int16_t* samples, size_t num_samples);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7149
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7150 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7151 * The current version of the microphone interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7152 * Will be incremented whenever \c retro_microphone_interface or \c retro_microphone_params_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7153 * receive new fields.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7154 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7155 * Frontends using cores built against older mic interface versions
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7156 * should not access fields introduced in newer versions.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7157 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7158 #define RETRO_MICROPHONE_INTERFACE_VERSION 1
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7159
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7160 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7161 * An interface for querying the microphone and accessing data read from it.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7162 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7163 * @see RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7164 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7165 struct retro_microphone_interface
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7166 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7167 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7168 * The version of this microphone interface.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7169 * Set by the core to request a particular version,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7170 * and set by the frontend to indicate the returned version.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7171 * 0 indicates that the interface is invalid or uninitialized.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7172 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7173 unsigned interface_version;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7174
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7175 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7176 * Initializes a new microphone.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7177 * Assuming that microphone support is enabled and provided by the frontend,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7178 * cores may call this function whenever necessary.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7179 * A microphone could be opened throughout a core's lifetime,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7180 * or it could wait until a microphone is plugged in to the emulated device.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7181 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7182 * The returned handle will be valid until it's freed,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7183 * even if the audio driver is reinitialized.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7184 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7185 * This function is not guaranteed to be thread-safe.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7186 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7187 * @param[in] args Parameters used to create the microphone.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7188 * May be \c NULL, in which case the default value of each parameter will be used.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7189 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7190 * @returns Pointer to the newly-opened microphone,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7191 * or \c NULL if one couldn't be opened.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7192 * This likely means that no microphone is plugged in and recognized,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7193 * or the maximum number of supported microphones has been reached.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7194 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7195 * @note Microphones are \em inactive by default;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7196 * to begin capturing audio, call \c set_mic_state.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7197 * @see retro_microphone_params_t
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7198 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7199 retro_open_mic_t open_mic;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7200
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7201 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7202 * Closes a microphone that was initialized with \c open_mic.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7203 * Calling this function will stop all microphone activity
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7204 * and free up the resources that it allocated.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7205 * Afterwards, the handle is invalid and must not be used.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7206 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7207 * A frontend may close opened microphones when unloading content,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7208 * but this behavior is not guaranteed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7209 * Cores should close their microphones when exiting, just to be safe.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7210 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7211 * @param microphone Pointer to the microphone that was allocated by \c open_mic.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7212 * If \c NULL, this function does nothing.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7213 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7214 * @note The handle might be reused if another microphone is opened later.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7215 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7216 retro_close_mic_t close_mic;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7217
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7218 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7219 * Returns the configured parameters of this microphone.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7220 * These may differ from what was requested depending on
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7221 * the driver and device configuration.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7222 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7223 * Cores should check these values before they start fetching samples.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7224 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7225 * Will not change after the mic was opened.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7226 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7227 * @param[in] microphone Opaque handle to the microphone
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7228 * whose parameters will be retrieved.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7229 * @param[out] params The parameters object that the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7230 * microphone's parameters will be copied to.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7231 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7232 * @return \c true if the parameters were retrieved,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7233 * \c false if there was an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7234 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7235 retro_get_mic_params_t get_params;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7236
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7237 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7238 * Enables or disables the given microphone.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7239 * Microphones are disabled by default
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7240 * and must be explicitly enabled before they can be used.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7241 * Disabled microphones will not process incoming audio samples,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7242 * and will therefore have minimal impact on overall performance.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7243 * Cores may enable microphones throughout their lifetime,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7244 * or only for periods where they're needed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7245 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7246 * Cores that accept microphone input should be able to operate without it;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7247 * we suggest substituting silence in this case.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7248 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7249 * @param microphone Opaque handle to the microphone
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7250 * whose state will be adjusted.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7251 * This will have been provided by \c open_mic.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7252 * @param state \c true if the microphone should receive audio input,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7253 * \c false if it should be idle.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7254 * @returns \c true if the microphone's state was successfully set,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7255 * \c false if \c microphone is invalid
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7256 * or if there was an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7257 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7258 retro_set_mic_state_t set_mic_state;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7259
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7260 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7261 * Queries the active state of a microphone at the given index.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7262 * Will return whether the microphone is enabled,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7263 * even if the driver is paused.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7264 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7265 * @param microphone Opaque handle to the microphone
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7266 * whose state will be queried.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7267 * @return \c true if the provided \c microphone is valid and active,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7268 * \c false if not or if there was an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7269 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7270 retro_get_mic_state_t get_mic_state;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7271
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7272 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7273 * Retrieves the input processed by the microphone since the last call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7274 * \em Must be called every frame unless \c microphone is disabled,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7275 * similar to how \c retro_audio_sample_batch_t works.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7276 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7277 * @param[in] microphone Opaque handle to the microphone
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7278 * whose recent input will be retrieved.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7279 * @param[out] samples The buffer that will be used to store the microphone's data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7280 * Microphone input is in mono (i.e. one number per sample).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7281 * Should be large enough to accommodate the expected number of samples per frame;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7282 * for example, a 44.1kHz sample rate at 60 FPS would require space for 735 samples.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7283 * @param[in] num_samples The size of the data buffer in samples (\em not bytes).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7284 * Microphone input is in mono, so a "frame" and a "sample" are equivalent in length here.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7285 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7286 * @return The number of samples that were copied into \c samples.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7287 * If \c microphone is pending driver initialization,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7288 * this function will copy silence of the requested length into \c samples.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7289 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7290 * Will return -1 if the microphone is disabled,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7291 * the audio driver is paused,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7292 * or there was an error.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7293 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7294 retro_read_mic_t read_mic;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7295 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7296
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7297 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7298
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7299 /** @defgroup GET_DEVICE_POWER Device Power
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7300 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7301 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7302
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7303 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7304 * Describes how a device is being powered.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7305 * @see RETRO_ENVIRONMENT_GET_DEVICE_POWER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7306 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7307 enum retro_power_state
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7308 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7309 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7310 * Indicates that the frontend cannot report its power state at this time,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7311 * most likely due to a lack of support.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7312 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7313 * \c RETRO_ENVIRONMENT_GET_DEVICE_POWER will not return this value;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7314 * instead, the environment callback will return \c false.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7315 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7316 RETRO_POWERSTATE_UNKNOWN = 0,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7317
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7318 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7319 * Indicates that the device is running on its battery.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7320 * Usually applies to portable devices such as handhelds, laptops, and smartphones.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7321 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7322 RETRO_POWERSTATE_DISCHARGING,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7323
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7324 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7325 * Indicates that the device's battery is currently charging.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7326 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7327 RETRO_POWERSTATE_CHARGING,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7328
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7329 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7330 * Indicates that the device is connected to a power source
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7331 * and that its battery has finished charging.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7332 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7333 RETRO_POWERSTATE_CHARGED,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7334
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7335 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7336 * Indicates that the device is connected to a power source
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7337 * and that it does not have a battery.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7338 * This usually suggests a desktop computer or a non-portable game console.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7339 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7340 RETRO_POWERSTATE_PLUGGED_IN
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7341 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7342
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7343 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7344 * Indicates that an estimate is not available for the battery level or time remaining,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7345 * even if the actual power state is known.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7346 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7347 #define RETRO_POWERSTATE_NO_ESTIMATE (-1)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7348
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7349 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7350 * Describes the power state of the device running the frontend.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7351 * @see RETRO_ENVIRONMENT_GET_DEVICE_POWER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7352 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7353 struct retro_device_power
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7354 {
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7355 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7356 * The current state of the frontend's power usage.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7357 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7358 enum retro_power_state state;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7359
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7360 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7361 * A rough estimate of the amount of time remaining (in seconds)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7362 * before the device powers off.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7363 * This value depends on a variety of factors,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7364 * so it is not guaranteed to be accurate.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7365 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7366 * Will be set to \c RETRO_POWERSTATE_NO_ESTIMATE if \c state does not equal \c RETRO_POWERSTATE_DISCHARGING.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7367 * May still be set to \c RETRO_POWERSTATE_NO_ESTIMATE if the frontend is unable to provide an estimate.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7368 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7369 int seconds;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7370
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7371 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7372 * The approximate percentage of battery charge,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7373 * ranging from 0 to 100 (inclusive).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7374 * The device may power off before this reaches 0.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7375 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7376 * The user might have configured their device
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7377 * to stop charging before the battery is full,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7378 * so do not assume that this will be 100 in the \c RETRO_POWERSTATE_CHARGED state.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7379 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7380 int8_t percent;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7381 };
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7382
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7383 /** @} */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7384
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7385 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7386 * @defgroup Callbacks
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7387 * @{
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7388 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7389
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7390 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7391 * Environment callback to give implementations a way of performing uncommon tasks.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7392 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7393 * @note Extensible.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7394 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7395 * @param cmd The command to run.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7396 * @param data A pointer to the data associated with the command.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7397 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7398 * @return Varies by callback,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7399 * but will always return \c false if the command is not recognized.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7400 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7401 * @see RETRO_ENVIRONMENT_SET_ROTATION
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7402 * @see retro_set_environment()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7403 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7404 typedef bool (RETRO_CALLCONV *retro_environment_t)(unsigned cmd, void *data);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7405
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7406 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7407 * Render a frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7408 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7409 * @note For performance reasons, it is highly recommended to have a frame
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7410 * that is packed in memory, i.e. pitch == width * byte_per_pixel.
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7411 * Certain graphic APIs, such as OpenGL ES, do not like textures
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7412 * that are not packed in memory.
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7413 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7414 * @param data A pointer to the frame buffer data with a pixel format of 15-bit \c 0RGB1555 native endian, unless changed with \c RETRO_ENVIRONMENT_SET_PIXEL_FORMAT.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7415 * @param width The width of the frame buffer, in pixels.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7416 * @param height The height frame buffer, in pixels.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7417 * @param pitch The width of the frame buffer, in bytes.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7418 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7419 * @see retro_set_video_refresh()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7420 * @see RETRO_ENVIRONMENT_SET_PIXEL_FORMAT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7421 * @see retro_pixel_format
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7422 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7423 typedef void (RETRO_CALLCONV *retro_video_refresh_t)(const void *data, unsigned width,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7424 unsigned height, size_t pitch);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7425
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7426 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7427 * Renders a single audio frame. Should only be used if implementation generates a single sample at a time.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7428 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7429 * @param left The left audio sample represented as a signed 16-bit native endian.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7430 * @param right The right audio sample represented as a signed 16-bit native endian.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7431 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7432 * @see retro_set_audio_sample()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7433 * @see retro_set_audio_sample_batch()
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7434 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7435 typedef void (RETRO_CALLCONV *retro_audio_sample_t)(int16_t left, int16_t right);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7436
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7437 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7438 * Renders multiple audio frames in one go.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7439 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7440 * @note Only one of the audio callbacks must ever be used.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7441 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7442 * @param data A pointer to the audio sample data pairs to render.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7443 * @param frames The number of frames that are represented in the data. One frame
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7444 * is defined as a sample of left and right channels, interleaved.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7445 * For example: <tt>int16_t buf[4] = { l, r, l, r };</tt> would be 2 frames.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7446 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7447 * @return The number of frames that were processed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7448 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7449 * @see retro_set_audio_sample_batch()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7450 * @see retro_set_audio_sample()
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7451 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7452 typedef size_t (RETRO_CALLCONV *retro_audio_sample_batch_t)(const int16_t *data,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7453 size_t frames);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7454
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7455 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7456 * Polls input.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7457 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7458 * @see retro_set_input_poll()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7459 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7460 typedef void (RETRO_CALLCONV *retro_input_poll_t)(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7461
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7462 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7463 * Queries for input for player 'port'.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7464 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7465 * @param port Which player 'port' to query.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7466 * @param device Which device to query for. Will be masked with \c RETRO_DEVICE_MASK.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7467 * @param index The input index to retrieve.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7468 * The exact semantics depend on the device type given in \c device.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7469 * @param id The ID of which value to query, like \c RETRO_DEVICE_ID_JOYPAD_B.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7470 * @returns Depends on the provided arguments,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7471 * but will return 0 if their values are unsupported
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7472 * by the frontend or the backing physical device.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7473 * @note Specialization of devices such as \c RETRO_DEVICE_JOYPAD_MULTITAP that
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7474 * have been set with \c retro_set_controller_port_device() will still use the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7475 * higher level \c RETRO_DEVICE_JOYPAD to request input.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7476 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7477 * @see retro_set_input_state()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7478 * @see RETRO_DEVICE_NONE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7479 * @see RETRO_DEVICE_JOYPAD
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7480 * @see RETRO_DEVICE_MOUSE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7481 * @see RETRO_DEVICE_KEYBOARD
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7482 * @see RETRO_DEVICE_LIGHTGUN
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7483 * @see RETRO_DEVICE_ANALOG
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7484 * @see RETRO_DEVICE_POINTER
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7485 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7486 typedef int16_t (RETRO_CALLCONV *retro_input_state_t)(unsigned port, unsigned device,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7487 unsigned index, unsigned id);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7488
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7489 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7490 * Sets the environment callback.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7491 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7492 * @param cb The function which is used when making environment calls.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7493 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7494 * @note Guaranteed to be called before \c retro_init().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7495 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7496 * @see RETRO_ENVIRONMENT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7497 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7498 RETRO_API void retro_set_environment(retro_environment_t cb);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7499
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7500 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7501 * Sets the video refresh callback.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7502 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7503 * @param cb The function which is used when rendering a frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7504 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7505 * @note Guaranteed to have been called before the first call to \c retro_run() is made.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7506 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7507 RETRO_API void retro_set_video_refresh(retro_video_refresh_t cb);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7508
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7509 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7510 * Sets the audio sample callback.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7511 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7512 * @param cb The function which is used when rendering a single audio frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7513 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7514 * @note Guaranteed to have been called before the first call to \c retro_run() is made.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7515 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7516 RETRO_API void retro_set_audio_sample(retro_audio_sample_t cb);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7517
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7518 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7519 * Sets the audio sample batch callback.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7520 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7521 * @param cb The function which is used when rendering multiple audio frames in one go.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7522 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7523 * @note Guaranteed to have been called before the first call to \c retro_run() is made.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7524 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7525 RETRO_API void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7526
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7527 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7528 * Sets the input poll callback.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7529 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7530 * @param cb The function which is used to poll the active input.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7531 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7532 * @note Guaranteed to have been called before the first call to \c retro_run() is made.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7533 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7534 RETRO_API void retro_set_input_poll(retro_input_poll_t cb);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7535
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7536 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7537 * Sets the input state callback.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7538 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7539 * @param cb The function which is used to query the input state.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7540 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7541 *@note Guaranteed to have been called before the first call to \c retro_run() is made.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7542 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7543 RETRO_API void retro_set_input_state(retro_input_state_t cb);
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7544
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7545 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7546 * @}
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7547 */
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7548
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7549 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7550 * Called by the frontend when initializing a libretro core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7551 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7552 * @warning There are many possible "gotchas" with global state in dynamic libraries.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7553 * Here are some to keep in mind:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7554 * <ul>
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7555 * <li>Do not assume that the core was loaded by the operating system
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7556 * for the first time within this call.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7557 * It may have been statically linked or retained from a previous session.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7558 * Consequently, cores must not rely on global variables being initialized
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7559 * to their default values before this function is called;
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7560 * this also goes for object constructors in C++.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7561 * <li>Although C++ requires that constructors be called for global variables,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7562 * it does not require that their destructors be called
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7563 * if stored within a dynamic library's global scope.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7564 * <li>If the core is statically linked to the frontend,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7565 * global variables may be initialized when the frontend itself is initially executed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7566 * </ul>
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7567 * @see retro_deinit
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7568 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7569 RETRO_API void retro_init(void);
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7570
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7571 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7572 * Called by the frontend when deinitializing a libretro core.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7573 * The core must release all of its allocated resources before this function returns.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7574 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7575 * @warning There are many possible "gotchas" with global state in dynamic libraries.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7576 * Here are some to keep in mind:
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7577 * <ul>
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7578 * <li>Do not assume that the operating system will unload the core after this function returns,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7579 * as the core may be linked statically or retained in memory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7580 * Cores should use this function to clean up all allocated resources
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7581 * and reset all global variables to their default states.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7582 * <li>Do not assume that this core won't be loaded again after this function returns.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7583 * It may be kept in memory by the frontend for later use,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7584 * or it may be statically linked.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7585 * Therefore, all global variables should be reset to their default states within this function.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7586 * <li>C++ does not require that destructors be called
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7587 * for variables within a dynamic library's global scope.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7588 * Therefore, global objects that own dynamically-managed resources
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7589 * (such as \c std::string or <tt>std::vector</tt>)
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7590 * should be kept behind pointers that are explicitly deallocated within this function.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7591 * </ul>
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7592 * @see retro_init
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7593 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7594 RETRO_API void retro_deinit(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7595
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7596 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7597 * Retrieves which version of the libretro API is being used.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7598 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7599 * @note This is used to validate ABI compatibility when the API is revised.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7600 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7601 * @return Must return \c RETRO_API_VERSION.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7602 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7603 * @see RETRO_API_VERSION
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7604 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7605 RETRO_API unsigned retro_api_version(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7606
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7607 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7608 * Gets statically known system info.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7609 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7610 * @note Can be called at any time, even before retro_init().
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7611 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7612 * @param info A pointer to a \c retro_system_info where the info is to be loaded into. This must be statically allocated.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7613 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7614 RETRO_API void retro_get_system_info(struct retro_system_info *info);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7615
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7616 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7617 * Gets information about system audio/video timings and geometry.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7618 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7619 * @note Can be called only after \c retro_load_game() has successfully completed.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7620 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7621 * @note The implementation of this function might not initialize every variable
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7622 * if needed. For example, \c geom.aspect_ratio might not be initialized if
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7623 * the core doesn't desire a particular aspect ratio.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7624 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7625 * @param info A pointer to a \c retro_system_av_info where the audio/video information should be loaded into.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7626 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7627 * @see retro_system_av_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7628 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7629 RETRO_API void retro_get_system_av_info(struct retro_system_av_info *info);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7630
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7631 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7632 * Sets device to be used for player 'port'.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7633 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7634 * By default, \c RETRO_DEVICE_JOYPAD is assumed to be plugged into all
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7635 * available ports.
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7636 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7637 * @note Setting a particular device type is not a guarantee that libretro cores
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7638 * will only poll input based on that particular device type. It is only a
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7639 * hint to the libretro core when a core cannot automatically detect the
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7640 * appropriate input device type on its own. It is also relevant when a
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7641 * core can change its behavior depending on device type.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7642 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7643 * @note As part of the core's implementation of retro_set_controller_port_device,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7644 * the core should call \c RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS to notify the
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7645 * frontend if the descriptions for any controls have changed as a
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7646 * result of changing the device type.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7647 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7648 * @param port Which port to set the device for, usually indicates the player number.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7649 * @param device Which device the given port is using. By default, \c RETRO_DEVICE_JOYPAD is assumed for all ports.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7650 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7651 * @see RETRO_DEVICE_NONE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7652 * @see RETRO_DEVICE_JOYPAD
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7653 * @see RETRO_DEVICE_MOUSE
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7654 * @see RETRO_DEVICE_KEYBOARD
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7655 * @see RETRO_DEVICE_LIGHTGUN
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7656 * @see RETRO_DEVICE_ANALOG
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7657 * @see RETRO_DEVICE_POINTER
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7658 * @see RETRO_ENVIRONMENT_SET_CONTROLLER_INFO
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7659 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7660 RETRO_API void retro_set_controller_port_device(unsigned port, unsigned device);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7661
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7662 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7663 * Resets the currently-loaded game.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7664 * Cores should treat this as a soft reset (i.e. an emulated reset button) if possible,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7665 * but hard resets are acceptable.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7666 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7667 RETRO_API void retro_reset(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7668
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7669 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7670 * Runs the game for one video frame.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7671 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7672 * During \c retro_run(), the \c retro_input_poll_t callback must be called at least once.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7673 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7674 * @note If a frame is not rendered for reasons where a game "dropped" a frame,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7675 * this still counts as a frame, and \c retro_run() should explicitly dupe
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7676 * a frame if \c RETRO_ENVIRONMENT_GET_CAN_DUPE returns true. In this case,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7677 * the video callback can take a NULL argument for data.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7678 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7679 * @see retro_input_poll_t
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7680 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7681 RETRO_API void retro_run(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7682
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7683 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7684 * Returns the amount of data the implementation requires to serialize internal state (save states).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7685 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7686 * @note Between calls to \c retro_load_game() and \c retro_unload_game(), the
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7687 * returned size is never allowed to be larger than a previous returned
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7688 * value, to ensure that the frontend can allocate a save state buffer once.
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7689 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7690 * @return The amount of data the implementation requires to serialize the internal state.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7691 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7692 * @see retro_serialize()
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7693 */
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7694 RETRO_API size_t retro_serialize_size(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7695
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7696 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7697 * Serializes the internal state.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7698 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7699 * @param data A pointer to where the serialized data should be saved to.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7700 * @param size The size of the memory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7701 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7702 * @return If failed, or size is lower than \c retro_serialize_size(), it
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7703 * should return false. On success, it will return true.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7704 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7705 * @see retro_serialize_size()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7706 * @see retro_unserialize()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7707 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7708 RETRO_API bool retro_serialize(void *data, size_t size);
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7709
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7710 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7711 * Unserialize the given state data, and load it into the internal state.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7712 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7713 * @return Returns true if loading the state was successful, false otherwise.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7714 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7715 * @see retro_serialize()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7716 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7717 RETRO_API bool retro_unserialize(const void *data, size_t size);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7718
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7719 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7720 * Reset all the active cheats to their default disabled state.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7721 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7722 * @see retro_cheat_set()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7723 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7724 RETRO_API void retro_cheat_reset(void);
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7725
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7726 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7727 * Enable or disable a cheat.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7728 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7729 * @param index The index of the cheat to act upon.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7730 * @param enabled Whether to enable or disable the cheat.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7731 * @param code A string of the code used for the cheat.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7732 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7733 * @see retro_cheat_reset()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7734 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7735 RETRO_API void retro_cheat_set(unsigned index, bool enabled, const char *code);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7736
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7737 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7738 * Loads a game.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7739 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7740 * @param game A pointer to a \c retro_game_info detailing information about the game to load.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7741 * May be \c NULL if the core is loaded without content.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7742 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7743 * @return Will return true when the game was loaded successfully, or false otherwise.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7744 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7745 * @see retro_game_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7746 * @see RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7747 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7748 RETRO_API bool retro_load_game(const struct retro_game_info *game);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7749
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7750 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7751 * Called when the frontend has loaded one or more "special" content files,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7752 * typically through subsystems.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7753 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7754 * @note Only necessary for cores that support subsystems.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7755 * Others may return \c false or delegate to <tt>retro_load_game</tt>.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7756 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7757 * @param game_type The type of game to load,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7758 * as determined by \c retro_subsystem_info.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7759 * @param info A pointer to an array of \c retro_game_info objects
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7760 * providing information about the loaded content.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7761 * @param num_info The number of \c retro_game_info objects passed into the info parameter.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7762 * @return \c true if loading is successful, false otherwise.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7763 * If the core returns \c false,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7764 * the frontend should abort the core
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7765 * and return to its main menu (if applicable).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7766 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7767 * @see RETRO_ENVIRONMENT_GET_GAME_INFO_EXT
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7768 * @see RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7769 * @see retro_load_game()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7770 * @see retro_subsystem_info
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7771 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7772 RETRO_API bool retro_load_game_special(
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7773 unsigned game_type,
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7774 const struct retro_game_info *info, size_t num_info
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7775 );
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7776
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7777 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7778 * Unloads the currently loaded game.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7779 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7780 * @note This is called before \c retro_deinit(void).
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7781 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7782 * @see retro_load_game()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7783 * @see retro_deinit()
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7784 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7785 RETRO_API void retro_unload_game(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7786
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7787 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7788 * Gets the region of the actively loaded content as either \c RETRO_REGION_NTSC or \c RETRO_REGION_PAL.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7789 * @note This refers to the region of the content's intended television standard,
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7790 * not necessarily the region of the content's origin.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7791 * For emulated consoles that don't use either standard
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7792 * (e.g. handhelds or post-HD platforms),
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7793 * the core should return \c RETRO_REGION_NTSC.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7794 * @return The region of the actively loaded content.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7795 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7796 * @see RETRO_REGION_NTSC
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7797 * @see RETRO_REGION_PAL
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7798 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7799 RETRO_API unsigned retro_get_region(void);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7800
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7801 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7802 * Get a region of memory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7803 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7804 * @param id The ID for the memory block that's desired to retrieve. Can be \c RETRO_MEMORY_SAVE_RAM, \c RETRO_MEMORY_RTC, \c RETRO_MEMORY_SYSTEM_RAM, or \c RETRO_MEMORY_VIDEO_RAM.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7805 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7806 * @return A pointer to the desired region of memory, or NULL when not available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7807 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7808 * @see RETRO_MEMORY_SAVE_RAM
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7809 * @see RETRO_MEMORY_RTC
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7810 * @see RETRO_MEMORY_SYSTEM_RAM
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7811 * @see RETRO_MEMORY_VIDEO_RAM
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7812 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7813 RETRO_API void *retro_get_memory_data(unsigned id);
2545
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7814
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7815 /**
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7816 * Gets the size of the given region of memory.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7817 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7818 * @param id The ID for the memory block to check the size of. Can be RETRO_MEMORY_SAVE_RAM, RETRO_MEMORY_RTC, RETRO_MEMORY_SYSTEM_RAM, or RETRO_MEMORY_VIDEO_RAM.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7819 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7820 * @return The size of the region in memory, or 0 when not available.
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7821 *
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7822 * @see RETRO_MEMORY_SAVE_RAM
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7823 * @see RETRO_MEMORY_RTC
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7824 * @see RETRO_MEMORY_SYSTEM_RAM
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7825 * @see RETRO_MEMORY_VIDEO_RAM
c076a96f1668 Get CD titles sort of working in libretro target
Michael Pavone <pavone@retrodev.com>
parents: 1687
diff changeset
7826 */
1687
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7827 RETRO_API size_t retro_get_memory_size(unsigned id);
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7828
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7829 #ifdef __cplusplus
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7830 }
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7831 #endif
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7832
6c54bb5fe3b3 Hacky WIP libertro implementation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7833 #endif