-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQRetroDiskControl.h
More file actions
82 lines (61 loc) · 2.02 KB
/
Copy pathQRetroDiskControl.h
File metadata and controls
82 lines (61 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef QRETRO_DISKCONTROL_H
#define QRETRO_DISKCONTROL_H
#include <QObject>
#include "libretro.h"
class QRetroDiskControl : public QObject
{
Q_OBJECT
public:
explicit QRetroDiskControl(QObject *parent = nullptr)
: QObject(parent)
{
}
enum Version
{
/// Format used by RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE.
v0 = 0,
/// Format used by RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE.
v1 = 1,
Invalid
};
QRetroDiskControl::Version version(void) { return m_Version; }
bool setVersion(QRetroDiskControl::Version version)
{
if (version > m_MaxVersion)
return false;
m_Version = version;
return true;
}
QRetroDiskControl::Version maxVersion(void) { return m_MaxVersion; }
bool setMaxVersion(QRetroDiskControl::Version version)
{
if (version < m_Version)
return false;
m_MaxVersion = version;
return true;
}
bool setInterface(const retro_disk_control_callback *callback);
bool setExtInterface(const retro_disk_control_ext_callback *callback);
/* v0 */
bool setEjectState(bool ejected);
bool getEjectState(void);
unsigned getImageIndex(void);
bool setImageIndex(unsigned index);
unsigned getNumImages(void);
bool replaceImageIndex(unsigned index, const retro_game_info *info);
bool addImageIndex(void);
/* v1 */
bool setInitialImage(unsigned index, const char *path);
bool getImagePath(unsigned index, char *s, size_t len);
bool getImageLabel(unsigned index, char *s, size_t len);
private:
retro_disk_control_ext_callback m_Callback = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
/// The version of disk control interface currently in use. This is set by
/// the type of interface sent by the core.
QRetroDiskControl::Version m_Version = QRetroDiskControl::Invalid;
/// The reported maximum version of disk control interface supported.
/// The frontend can pretend to not support the extension interface by
/// setting this with `setMaxVersion`.
QRetroDiskControl::Version m_MaxVersion = QRetroDiskControl::v1;
};
#endif