Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
game.h
1/*
2 * Copyright (C) 2014-2025 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#ifndef C_API_ADDONINSTANCE_GAME_H
10#define C_API_ADDONINSTANCE_GAME_H
11
12#include "../addon_base.h"
13
14#include <stddef.h> /* size_t */
15#include <stdint.h>
16
17#ifdef __cplusplus
18extern "C"
19{
20#endif /* __cplusplus */
21
22 //============================================================================
54 //----------------------------------------------------------------------------
55
56 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
65
66 //============================================================================
71 typedef enum GAME_PCM_FORMAT
72 {
73 GAME_PCM_FORMAT_UNKNOWN,
74
78 //----------------------------------------------------------------------------
79
80 //============================================================================
150 //----------------------------------------------------------------------------
151
152 //============================================================================
158 {
159 GAME_PCM_FORMAT format;
160 const GAME_AUDIO_CHANNEL* channel_map;
161 } ATTR_PACKED game_stream_audio_properties;
162 //----------------------------------------------------------------------------
163
164 //============================================================================
170 {
172 const uint8_t* data;
173
175 size_t size;
176 } ATTR_PACKED game_stream_audio_packet;
177 //----------------------------------------------------------------------------
178
180
181 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
190
191 //============================================================================
209 //----------------------------------------------------------------------------
210
211 //============================================================================
230 //----------------------------------------------------------------------------
231
232 //============================================================================
239 {
242
244 unsigned int nominal_width;
245
247 unsigned int nominal_height;
248
254
256 unsigned int max_width;
257
259 unsigned int max_height;
260 } ATTR_PACKED game_stream_video_properties;
261 //----------------------------------------------------------------------------
262
263 //============================================================================
269 {
271 unsigned int width;
272
274 unsigned int height;
275
281
284
286 const uint8_t* data;
287
289 size_t size;
290 } ATTR_PACKED game_stream_video_packet;
291 //----------------------------------------------------------------------------
292
294
295 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
301
302 //============================================================================
328 //----------------------------------------------------------------------------
329
330 //==============================================================================
338 {
342
347 bool depth;
348
357
365
367 unsigned int version_major;
368
370 unsigned int version_minor;
371
384
387
388 } ATTR_PACKED game_hw_rendering_properties;
389 //------------------------------------------------------------------------------
390
391 //==============================================================================
399 {
409 unsigned int max_width;
410
412 unsigned int max_height;
413
419
421 //----------------------------------------------------------------------------
422
423 //============================================================================
427 {
429 uintptr_t framebuffer;
431 //----------------------------------------------------------------------------
432
433 //============================================================================
437 {
439 uintptr_t framebuffer;
440
446 unsigned int width;
447 unsigned int height;
448
454
458 //----------------------------------------------------------------------------
459
460 //============================================================================
463 typedef void (*game_proc_address_t)(void);
464 //----------------------------------------------------------------------------
465
467
468 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
474
475 //============================================================================
481 //----------------------------------------------------------------------------
482
483 //============================================================================
487 {
488 GAME_PIXEL_FORMAT format;
489 uint8_t* data;
490 size_t size;
492 //----------------------------------------------------------------------------
493
494 //============================================================================
500 //----------------------------------------------------------------------------
501
503
504 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
510
511 //============================================================================
531 //----------------------------------------------------------------------------
532
533 //============================================================================
540 {
543
544 union
545 {
548
551
554
557 };
558 } ATTR_PACKED game_stream_properties;
559 //----------------------------------------------------------------------------
560
561 //============================================================================
564 typedef struct game_stream_buffer
565 {
568
569 union
570 {
573
576 };
577 } ATTR_PACKED game_stream_buffer;
578 //----------------------------------------------------------------------------
579
580 //============================================================================
587 typedef struct game_stream_packet
588 {
591
592 union
593 {
596
599
602
605 };
606 } ATTR_PACKED game_stream_packet;
607 //----------------------------------------------------------------------------
608
610
611 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
617
618 //============================================================================
633 //----------------------------------------------------------------------------
634
635 //============================================================================
654 //----------------------------------------------------------------------------
655
656 //============================================================================
701 //----------------------------------------------------------------------------
702
703 //============================================================================
705 typedef enum GAME_SIMD
706 {
708 GAME_SIMD_SSE = (1 << 0),
709
711 GAME_SIMD_SSE2 = (1 << 1),
712
714 GAME_SIMD_VMX = (1 << 2),
715
718
720 GAME_SIMD_AVX = (1 << 4),
721
723 GAME_SIMD_NEON = (1 << 5),
724
726 GAME_SIMD_SSE3 = (1 << 6),
727
729 GAME_SIMD_SSSE3 = (1 << 7),
730
732 GAME_SIMD_MMX = (1 << 8),
733
736
738 GAME_SIMD_SSE4 = (1 << 10),
739
741 GAME_SIMD_SSE42 = (1 << 11),
742
744 GAME_SIMD_AVX2 = (1 << 12),
745
747 GAME_SIMD_VFPU = (1 << 13),
748 } GAME_SIMD;
749 //----------------------------------------------------------------------------
750
752
753 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
780
781 //==============================================================================
783#define ROOT_PORT_ADDRESS "/"
784 //------------------------------------------------------------------------------
785
786 //==============================================================================
788#define DEFAULT_PORT_ID "1"
789 //------------------------------------------------------------------------------
790
791 //==============================================================================
793#define KEYBOARD_PORT_ID "keyboard"
794 //------------------------------------------------------------------------------
795
796 //==============================================================================
798#define MOUSE_PORT_ID "mouse"
799 //------------------------------------------------------------------------------
800
801 //==============================================================================
803#define DEFAULT_PORT_ADDRESS "/1"
804 //------------------------------------------------------------------------------
805
806 //==============================================================================
808#define KEYBOARD_PORT_ADDRESS "/keyboard"
809 //------------------------------------------------------------------------------
810
811 //==============================================================================
813#define MOUSE_PORT_ADDRESS "/mouse"
814 //------------------------------------------------------------------------------
815
816 //============================================================================
847 //----------------------------------------------------------------------------
848
849 //============================================================================
851 typedef enum GAME_KEY_MOD
852 {
855
858
861
864
867
870
873
876
879 } GAME_KEY_MOD;
880 //----------------------------------------------------------------------------
881
882 //============================================================================
898 //----------------------------------------------------------------------------
899
908 {
909 char* controller_id;
910 bool provides_input; // False for multitaps
911 char** digital_buttons;
912 unsigned int digital_button_count;
913 char** analog_buttons;
914 unsigned int analog_button_count;
915 char** analog_sticks;
916 unsigned int analog_stick_count;
917 char** accelerometers;
918 unsigned int accelerometer_count;
919 char** keys;
920 unsigned int key_count;
921 char** rel_pointers;
922 unsigned int rel_pointer_count;
923 char** abs_pointers;
924 unsigned int abs_pointer_count;
925 char** motors;
926 unsigned int motor_count;
927 } ATTR_PACKED game_controller_layout;
928
929 struct game_input_port;
930
931 //============================================================================
933 typedef struct game_input_device
934 {
936 const char* controller_id;
937
939 const char* port_address;
940
943
945 unsigned int port_count;
946 } ATTR_PACKED game_input_device;
947 //----------------------------------------------------------------------------
948
949 //============================================================================
952 typedef struct game_input_port
953 {
956
958 const char* port_id;
959
966
972
975
977 unsigned int device_count;
978 } ATTR_PACKED game_input_port;
979 //----------------------------------------------------------------------------
980
981 //============================================================================
988 typedef struct game_input_topology
989 {
992
994 unsigned int port_count;
995
998 } ATTR_PACKED game_input_topology;
999 //----------------------------------------------------------------------------
1000
1001 //============================================================================
1004 {
1007 } ATTR_PACKED game_digital_button_event;
1008 //----------------------------------------------------------------------------
1009
1010 //============================================================================
1013 {
1016 } ATTR_PACKED game_analog_button_event;
1017 //----------------------------------------------------------------------------
1018
1019 //============================================================================
1021 typedef struct game_axis_event
1022 {
1025 } ATTR_PACKED game_axis_event;
1026 //----------------------------------------------------------------------------
1027
1028 //============================================================================
1035 {
1037 float x;
1038
1040 float y;
1041 } ATTR_PACKED game_analog_stick_event;
1042 //----------------------------------------------------------------------------
1043
1044 //============================================================================
1047 {
1049 float x;
1050
1052 float y;
1053
1055 float z;
1056 } ATTR_PACKED game_accelerometer_event;
1057 //----------------------------------------------------------------------------
1058
1059 //============================================================================
1061 typedef struct game_key_event
1062 {
1065
1071 uint32_t unicode;
1072
1075 } ATTR_PACKED game_key_event;
1076 //----------------------------------------------------------------------------
1077
1078 //============================================================================
1081 {
1083 int x;
1084
1086 int y;
1087 } ATTR_PACKED game_rel_pointer_event;
1088 //----------------------------------------------------------------------------
1089
1090 //============================================================================
1093 {
1096
1098 float x;
1099
1101 float y;
1102 } ATTR_PACKED game_abs_pointer_event;
1103 //----------------------------------------------------------------------------
1104
1105 //============================================================================
1107 typedef struct game_motor_event
1108 {
1111 } ATTR_PACKED game_motor_event;
1112 //----------------------------------------------------------------------------
1113
1114 //============================================================================
1116 typedef struct game_input_event
1117 {
1120
1122 const char* controller_id;
1123
1126
1128 const char* port_address;
1129
1131 const char* feature_name;
1132
1133 union
1134 {
1136 struct game_digital_button_event digital_button;
1137
1139 struct game_analog_button_event analog_button;
1140
1142 struct game_axis_event axis;
1143
1145 struct game_analog_stick_event analog_stick;
1146
1148 struct game_accelerometer_event accelerometer;
1149
1151 struct game_key_event key;
1152
1154 struct game_rel_pointer_event rel_pointer;
1155
1157 struct game_abs_pointer_event abs_pointer;
1158
1160 struct game_motor_event motor;
1161 };
1162 } ATTR_PACKED game_input_event;
1163 //----------------------------------------------------------------------------
1164
1166
1167 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
1173
1174 //============================================================================
1178 {
1180 double fps;
1181
1184 };
1185 //----------------------------------------------------------------------------
1186
1188
1189 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
1206
1207 //============================================================================
1221 //----------------------------------------------------------------------------
1222
1223 //============================================================================
1226 typedef struct game_rc_achievement
1227 {
1229 unsigned int id;
1230
1232 const char* title;
1233
1235 const char* description;
1236
1238 const char* badge_url;
1239
1241 const char* badge_locked_url;
1242
1244 unsigned int points;
1245
1248
1251
1253 float rarity;
1254
1257 } ATTR_PACKED game_rc_achievement;
1258 //----------------------------------------------------------------------------
1259
1260 //============================================================================
1266 typedef struct game_rc_game_loaded
1267 {
1269 unsigned int game_id;
1270
1272 const char* title;
1273
1275 const char* icon_url;
1276
1279
1281 unsigned int achievement_count;
1282 } ATTR_PACKED game_rc_game_loaded;
1283 //----------------------------------------------------------------------------
1284
1285 //============================================================================
1289 {
1291 unsigned int id;
1292
1294 const char* title;
1295
1297 const char* description;
1298
1300 const char* badge_url;
1301
1303 unsigned int points;
1304
1307 } ATTR_PACKED game_rc_achievement_triggered;
1308 //----------------------------------------------------------------------------
1309
1310 //============================================================================
1314 {
1317
1319 const char* username;
1320
1322 const char* display_name;
1323
1325 const char* icon_url;
1326
1328 unsigned int points;
1329
1331 const char* error_message;
1332
1341 } ATTR_PACKED game_rc_login_result;
1342 //----------------------------------------------------------------------------
1343
1344 //============================================================================
1355 {
1357 unsigned int id;
1358
1361
1364 } ATTR_PACKED game_rc_achievement_progress;
1365
1366 //============================================================================
1373 typedef struct game_rc_leaderboard
1374 {
1376 unsigned int id;
1377
1379 const char* title;
1380
1382 const char* description;
1383
1389 const char* value;
1390 } ATTR_PACKED game_rc_leaderboard;
1391
1392 //============================================================================
1399 {
1401 unsigned int id;
1402
1404 const char* submitted_score;
1405
1410 const char* best_score;
1411
1413 unsigned int new_rank;
1414
1416 unsigned int num_entries;
1417 } ATTR_PACKED game_rc_leaderboard_scoreboard;
1418
1419 //============================================================================
1425 {
1430 unsigned int id;
1431
1433 const char* display;
1434 } ATTR_PACKED game_rc_leaderboard_tracker;
1435
1436 //============================================================================
1444 {
1446 unsigned int id;
1447
1449 const char* title;
1450
1452 const char* badge_url;
1453 } ATTR_PACKED game_rc_achievement_challenge;
1454
1455 //============================================================================
1466 {
1468 unsigned int id;
1469
1471 const char* title;
1472
1474 const char* badge_url;
1475
1481
1488 //----------------------------------------------------------------------------
1489
1491
1492 //--==----==----==----==----==----==----==----==----==----==----==----==----==--
1493
1499 typedef struct AddonProps_Game
1500 {
1505
1509 const char** proxy_dll_paths;
1510
1514 unsigned int proxy_dll_count;
1515
1523
1528
1536
1541
1545 const char** extensions;
1546
1550 unsigned int extension_count;
1552
1553 typedef void* KODI_GAME_STREAM_HANDLE;
1554
1558 struct AddonInstance_Game;
1559
1566 {
1567 KODI_HANDLE kodiInstance;
1568
1569 bool (*EnableHardwareRendering)(void*, const game_hw_rendering_properties*);
1570 void (*CloseGame)(KODI_HANDLE kodiInstance);
1571 double (*GetPlaybackSpeed)(KODI_HANDLE kodiInstance);
1572 void (*SetGameTiming)(KODI_HANDLE kodiInstance, const struct game_system_timing* timing_info);
1573 KODI_GAME_STREAM_HANDLE (*OpenStream)(KODI_HANDLE, const struct game_stream_properties*);
1574 bool (*GetStreamBuffer)(KODI_HANDLE,
1575 KODI_GAME_STREAM_HANDLE,
1576 unsigned int,
1577 unsigned int,
1578 struct game_stream_buffer*);
1579 void (*AddStreamData)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE, const struct game_stream_packet*);
1580 void (*ReleaseStreamBuffer)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE, struct game_stream_buffer*);
1581 void (*CloseStream)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE);
1582 game_proc_address_t (*HwGetProcAddress)(KODI_HANDLE kodiInstance, const char* symbol);
1583 bool (*InputEvent)(KODI_HANDLE kodiInstance, const struct game_input_event* event);
1584 void (*RCOnGameLoaded)(KODI_HANDLE kodiInstance, const struct game_rc_game_loaded* data);
1585 void (*RCOnAchievementTriggered)(KODI_HANDLE kodiInstance,
1586 const struct game_rc_achievement_triggered* data);
1587 void (*RCOnGameCompleted)(KODI_HANDLE kodiInstance, const char* title, bool hardcore);
1588 void (*RCOnRichPresenceUpdated)(KODI_HANDLE kodiInstance, const char* evaluation);
1589 void (*RCOnLoginResult)(KODI_HANDLE kodiInstance, const struct game_rc_login_result* data);
1590
1591 void (*RCOnAchievementProgress)(KODI_HANDLE kodiInstance,
1592 const struct game_rc_achievement_progress* progress,
1593 unsigned int count);
1594 void (*RCOnServerError)(KODI_HANDLE kodiInstance, const char* message, const char* api);
1595 void (*RCOnConnectionChanged)(KODI_HANDLE kodiInstance, bool connected);
1596
1597 void (*RCOnChallengeIndicator)(KODI_HANDLE kodiInstance,
1598 const struct game_rc_achievement_challenge* data,
1599 bool show);
1600 void (*RCOnAchievementProgressShow)(KODI_HANDLE kodiInstance,
1601 const struct game_rc_achievement_progress_indicator* data);
1602 void (*RCOnAchievementProgressUpdate)(
1603 KODI_HANDLE kodiInstance, const struct game_rc_achievement_progress_indicator* data);
1604 void (*RCOnAchievementProgressHide)(KODI_HANDLE kodiInstance,
1605 const struct game_rc_achievement_progress_indicator* data);
1606 void (*RCOnLeaderboardStarted)(KODI_HANDLE kodiInstance,
1607 const struct game_rc_leaderboard* data);
1608 void (*RCOnLeaderboardFailed)(KODI_HANDLE kodiInstance, const struct game_rc_leaderboard* data);
1609 void (*RCOnLeaderboardSubmitted)(KODI_HANDLE kodiInstance,
1610 const struct game_rc_leaderboard* data);
1611 void (*RCOnLeaderboardTrackerShow)(KODI_HANDLE kodiInstance,
1612 const struct game_rc_leaderboard_tracker* data);
1613 void (*RCOnLeaderboardTrackerUpdate)(KODI_HANDLE kodiInstance,
1614 const struct game_rc_leaderboard_tracker* data);
1615 void (*RCOnLeaderboardTrackerHide)(KODI_HANDLE kodiInstance,
1616 const struct game_rc_leaderboard_tracker* data);
1617 void (*RCOnLeaderboardScoreboard)(KODI_HANDLE kodiInstance,
1618 const struct game_rc_leaderboard_scoreboard* data);
1619 void (*RCOnReset)(KODI_HANDLE kodiInstance);
1620 void (*RCOnSubsetCompleted)(KODI_HANDLE kodiInstance, const char* title);
1621
1630 bool (*StartStream)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE);
1632
1639 {
1640 KODI_HANDLE addonInstance;
1641
1642 GAME_ERROR(__cdecl* LoadGame)(const struct AddonInstance_Game*, const char*);
1643 GAME_ERROR(__cdecl* LoadGameSpecial)
1644 (const struct AddonInstance_Game*, enum SPECIAL_GAME_TYPE, const char**, size_t);
1645 GAME_ERROR(__cdecl* LoadStandalone)(const struct AddonInstance_Game*);
1646 GAME_ERROR(__cdecl* UnloadGame)(const struct AddonInstance_Game*);
1647 GAME_ERROR(__cdecl* GetGameTiming)
1648 (const struct AddonInstance_Game*, struct game_system_timing*);
1649 GAME_REGION(__cdecl* GetRegion)(const struct AddonInstance_Game*);
1650 bool(__cdecl* RequiresGameLoop)(const struct AddonInstance_Game*);
1651 GAME_ERROR(__cdecl* RunFrame)(const struct AddonInstance_Game*);
1652 GAME_ERROR(__cdecl* Reset)(const struct AddonInstance_Game*);
1653 GAME_ERROR(__cdecl* HwContextReset)(const struct AddonInstance_Game*);
1654 GAME_ERROR(__cdecl* HwContextDestroy)(const struct AddonInstance_Game*);
1655 GAME_ERROR(__cdecl* AudioAvailable)(const AddonInstance_Game*);
1656 bool(__cdecl* HasFeature)(const struct AddonInstance_Game*, const char*, const char*);
1657 game_input_topology*(__cdecl* GetTopology)(const struct AddonInstance_Game*);
1658 void(__cdecl* FreeTopology)(const struct AddonInstance_Game*, struct game_input_topology*);
1659 void(__cdecl* SetControllerLayouts)(const struct AddonInstance_Game*,
1660 const struct game_controller_layout*,
1661 unsigned int);
1662 bool(__cdecl* EnableKeyboard)(const struct AddonInstance_Game*, bool, const char*);
1663 bool(__cdecl* EnableMouse)(const struct AddonInstance_Game*, bool, const char*);
1664 bool(__cdecl* ConnectController)(const struct AddonInstance_Game*,
1665 bool,
1666 const char*,
1667 const char*);
1668 bool(__cdecl* InputEvent)(const struct AddonInstance_Game*, const struct game_input_event*);
1669 size_t(__cdecl* SerializeSize)(const struct AddonInstance_Game*);
1670 GAME_ERROR(__cdecl* Serialize)(const struct AddonInstance_Game*, uint8_t*, size_t);
1671 GAME_ERROR(__cdecl* Deserialize)(const struct AddonInstance_Game*, const uint8_t*, size_t);
1672 GAME_ERROR(__cdecl* CheatReset)(const struct AddonInstance_Game*);
1673 GAME_ERROR(__cdecl* GetMemory)
1674 (const struct AddonInstance_Game*, enum GAME_MEMORY, uint8_t**, size_t*);
1675 GAME_ERROR(__cdecl* SetCheat)
1676 (const struct AddonInstance_Game*, unsigned int, bool, const char*);
1677 bool(__cdecl* GetEjectState)(const AddonInstance_Game*);
1678 GAME_ERROR(__cdecl* SetEjectState)(const AddonInstance_Game*, bool);
1679 unsigned int(__cdecl* GetImageIndex)(const AddonInstance_Game*);
1680 GAME_ERROR(__cdecl* SetImageIndex)(const AddonInstance_Game*, unsigned int);
1681 unsigned int(__cdecl* GetImageCount)(const AddonInstance_Game*);
1682 GAME_ERROR(__cdecl* AddImageIndex)(const AddonInstance_Game*);
1683 GAME_ERROR(__cdecl* ReplaceImageIndex)(const AddonInstance_Game*, unsigned int, const char*);
1684 GAME_ERROR(__cdecl* RemoveImageIndex)(const AddonInstance_Game*, unsigned int);
1685 GAME_ERROR(__cdecl* SetInitialImage)(const AddonInstance_Game*, unsigned int, const char*);
1686 char*(__cdecl* GetImagePath)(const AddonInstance_Game*, unsigned int);
1687 char*(__cdecl* GetImageLabel)(const AddonInstance_Game*, unsigned int);
1688 GAME_ERROR(__cdecl* SetRetroAchievementsCredentials)
1689 (const AddonInstance_Game*, const char*, const char*);
1690 GAME_ERROR(__cdecl* RCSetHardcoreEnabled)(const AddonInstance_Game*, bool);
1691 GAME_ERROR(__cdecl* RCSetEncoreModeEnabled)(const AddonInstance_Game*, bool);
1692 GAME_ERROR(__cdecl* ActivateAchievement)(const AddonInstance_Game*, unsigned int, const char*);
1693 GAME_ERROR(__cdecl* GetCheevoUrlId)
1694 (const AddonInstance_Game*,
1695 void(__cdecl*)(const void*, const char*, unsigned int),
1696 const void*);
1697 size_t(__cdecl* AchievementStateSize)(const struct AddonInstance_Game*);
1698 GAME_ERROR(__cdecl* SerializeAchievements)
1699 (const struct AddonInstance_Game*, uint8_t*, size_t);
1700 GAME_ERROR(__cdecl* DeserializeAchievements)
1701 (const struct AddonInstance_Game*, const uint8_t*, size_t);
1702 void(__cdecl* FreeString)(const AddonInstance_Game*, char*);
1704
1710 typedef struct AddonInstance_Game
1711 {
1712 struct AddonProps_Game* props;
1713 struct AddonToKodiFuncTable_Game* toKodi;
1714 struct KodiToAddonFuncTable_Game* toAddon;
1716
1717#ifdef __cplusplus
1718}
1719#endif /* __cplusplus */
1720
1721#endif /* !C_API_ADDONINSTANCE_GAME_H */
const uint8_t * data
Pointer to the audio stream data given to Kodi.
Definition game.h:172
size_t size
Size of the data array.
Definition game.h:175
GAME_AUDIO_CHANNEL
Audio channel
Definition game.h:86
GAME_PCM_FORMAT
Stream Format
Definition game.h:72
@ GAME_CH_TFC
Channel top front center.
Definition game.h:130
@ GAME_CH_FL
Channel front left.
Definition game.h:91
@ GAME_CH_BL
Channel back left.
Definition game.h:103
@ GAME_CH_TBR
Channel top back right.
Definition game.h:139
@ GAME_CH_FC
Channel front center.
Definition game.h:97
@ GAME_CH_BLOC
Channel back left over center.
Definition game.h:145
@ GAME_CH_TFL
Channel top front left.
Definition game.h:124
@ GAME_CH_NULL
Channel list terminator.
Definition game.h:88
@ GAME_CH_TBC
Channel top back center.
Definition game.h:142
@ GAME_CH_SR
Channel surround/side right.
Definition game.h:121
@ GAME_CH_TFR
Channel top front right.
Definition game.h:127
@ GAME_CH_FR
Channel front right.
Definition game.h:94
@ GAME_CH_BC
Channel back center.
Definition game.h:115
@ GAME_CH_SL
Channel surround/side left.
Definition game.h:118
@ GAME_CH_LFE
Channel low frequency effects / subwoofer.
Definition game.h:100
@ GAME_CH_BROC
Channel back right over center.
Definition game.h:148
@ GAME_CH_TC
Channel top center.
Definition game.h:133
@ GAME_CH_FLOC
Channel front left over center.
Definition game.h:109
@ GAME_CH_FROC
Channel front right over center.
Definition game.h:112
@ GAME_CH_TBL
Channel top back left.
Definition game.h:136
@ GAME_CH_BR
Channel back right.
Definition game.h:106
@ GAME_PCM_FORMAT_S16NE
S16NE sample format.
Definition game.h:76
Audio stream packet
Definition game.h:170
Game audio stream properties
Definition game.h:158
double sample_rate
Sampling rate of audio.
Definition game.h:1183
double fps
FPS of video content.
Definition game.h:1180
Game system timing.
Definition game.h:1178
GAME_SIMD
ID values for SIMD CPU features
Definition game.h:706
GAME_REGION
Game region definition
Definition game.h:623
SPECIAL_GAME_TYPE
Special game types passed into game_load_game_special().
Definition game.h:641
GAME_MEMORY
Game Memory
Definition game.h:660
@ GAME_SIMD_VFPU
SIMD CPU VFPU.
Definition game.h:747
@ GAME_SIMD_VMX128
SIMD CPU VMX128.
Definition game.h:717
@ GAME_SIMD_SSE
SIMD CPU SSE.
Definition game.h:708
@ GAME_SIMD_SSE4
SIMD CPU SSE4.
Definition game.h:738
@ GAME_SIMD_NEON
SIMD CPU NEON.
Definition game.h:723
@ GAME_SIMD_AVX2
SIMD CPU AVX2.
Definition game.h:744
@ GAME_SIMD_SSE42
SIMD CPU SSE42.
Definition game.h:741
@ GAME_SIMD_SSSE3
SIMD CPU SSSE3.
Definition game.h:729
@ GAME_SIMD_SSE2
SIMD CPU SSE2.
Definition game.h:711
@ GAME_SIMD_SSE3
SIMD CPU SSE3.
Definition game.h:726
@ GAME_SIMD_AVX
SIMD CPU AVX.
Definition game.h:720
@ GAME_SIMD_MMXEXT
SIMD CPU MMXEXT.
Definition game.h:735
@ GAME_SIMD_MMX
SIMD CPU MMX.
Definition game.h:732
@ GAME_SIMD_VMX
SIMD CPU VMX.
Definition game.h:714
@ GAME_REGION_NTSC
Game region NTSC.
Definition game.h:628
@ GAME_REGION_PAL
Game region PAL.
Definition game.h:631
@ GAME_REGION_UNKNOWN
Game region unknown.
Definition game.h:625
@ SPECIAL_GAME_TYPE_SUPER_GAME_BOY
Game Type super game boy.
Definition game.h:652
@ SPECIAL_GAME_TYPE_BSX
Game Type BSX.
Definition game.h:643
@ SPECIAL_GAME_TYPE_BSX_SLOTTED
Game Type BSX slotted.
Definition game.h:646
@ SPECIAL_GAME_TYPE_SUFAMI_TURBO
Game Type sufami turbo.
Definition game.h:649
@ GAME_MEMORY_SNES_SUFAMI_TURBO_A_RAM
Special memory type.
Definition game.h:690
@ GAME_MEMORY_VIDEO_RAM
Video ram lets a frontend peek into a game systems video RAM (VRAM)
Definition game.h:681
@ GAME_MEMORY_SNES_SUFAMI_TURBO_B_RAM
Special memory type.
Definition game.h:693
@ GAME_MEMORY_SNES_GAME_BOY_RTC
Special memory type.
Definition game.h:699
@ GAME_MEMORY_SNES_BSX_PRAM
Special memory type.
Definition game.h:687
@ GAME_MEMORY_MASK
Passed to game_get_memory_data/size(). If the memory type doesn't apply to the implementation NULL/0 ...
Definition game.h:663
@ GAME_MEMORY_SAVE_RAM
Regular save ram.
Definition game.h:670
@ GAME_MEMORY_SYSTEM_RAM
System ram lets a frontend peek into a game systems main RAM.
Definition game.h:678
@ GAME_MEMORY_SNES_BSX_RAM
Special memory type.
Definition game.h:684
@ GAME_MEMORY_RTC
Some games have a built-in clock to keep track of time.
Definition game.h:675
@ GAME_MEMORY_SNES_GAME_BOY_RAM
Special memory type.
Definition game.h:696
bool cache_context
If true, the frontend will go to great lengths to avoid resetting the context in scenarios like toggl...
Definition game.h:383
unsigned int version_minor
Minor version number for the core GL context or GLES 3.1+.
Definition game.h:370
bool depth
Set to true if render buffers should have a depth component attached.
Definition game.h:347
float display_aspect_ratio
Display aspect ratio (DAR) to use when showing the video frame.
Definition game.h:453
unsigned int version_major
Major version number for the core GL context or GLES 3.1+.
Definition game.h:367
bool bottom_left_origin
Use the conventional bottom-left origin.
Definition game.h:364
GAME_HW_CONTEXT_TYPE context_type
The API to use.
Definition game.h:341
unsigned int max_height
The largest frame height the client will render, in pixels.
Definition game.h:412
GAME_VIDEO_ROTATION rotation
Video rotation angle defined by GAME_VIDEO_ROTATION.
Definition game.h:456
unsigned int max_width
The largest frame width the client will render, in pixels.
Definition game.h:409
unsigned int width
Size of the image the client just drew.
Definition game.h:446
float nominal_display_aspect_ratio
The nominal display aspect ratio (DAR) used to show the video frame.
Definition game.h:418
bool debug_context
Creates a debug context.
Definition game.h:386
bool stencil
Set to true if stencil buffers should be attached.
Definition game.h:356
void(* game_proc_address_t)(void)
Hardware framebuffer process function address
Definition game.h:463
GAME_HW_CONTEXT_TYPE
Hardware framebuffer type
Definition game.h:306
@ GAME_HW_CONTEXT_OPENGLES2
OpenGL ES 2.0.
Definition game.h:314
@ GAME_HW_CONTEXT_OPENGL_CORE
Modern desktop core GL context. Use the major and minor fields to set the GL version.
Definition game.h:317
@ GAME_HW_CONTEXT_VULKAN
Vulkan.
Definition game.h:326
@ GAME_HW_CONTEXT_OPENGLES_VERSION
OpenGL ES 3.1+. Set major/minor fields.
Definition game.h:323
@ GAME_HW_CONTEXT_OPENGLES3
OpenGL ES 3.0.
Definition game.h:320
@ GAME_HW_CONTEXT_NONE
No context.
Definition game.h:308
@ GAME_HW_CONTEXT_OPENGL
OpenGL 2.x. The driver can choose to use the latest compatibility context.
Definition game.h:311
Hardware rendering properties
Definition game.h:338
Hardware framebuffer buffer
Definition game.h:427
Hardware framebuffer packet
Definition game.h:437
Hardware framebuffer properties
Definition game.h:399
int y
The relative Y position of the pointer.
Definition game.h:1086
bool pressed
True if the button is pressed, false if it is released.
Definition game.h:1006
const char * feature_name
The name of the feature that generated the event.
Definition game.h:1131
GAME_INPUT_EVENT_SOURCE type
The type of input event.
Definition game.h:1119
unsigned int port_count
The number of ports in the available ports list.
Definition game.h:945
game_input_port * ports
The list of ports on the virtual game console.
Definition game.h:991
bool force_connected
Flag to prevent a port from being disconnected.
Definition game.h:965
unsigned int device_count
The number of devices in the accepted devices list.
Definition game.h:977
int x
The relative X position of the pointer.
Definition game.h:1083
GAME_PORT_TYPE type
The type of port.
Definition game.h:955
float position
The position of the axis, from -1.0 to 1.0.
Definition game.h:1024
struct game_input_port * available_ports
The list of ports that the device can be connected to.
Definition game.h:942
float magnitude
The magnitude of the button press, from 0.0 to 1.0.
Definition game.h:1015
const char * controller_id
ID used in the Kodi controller API, e.g. game.controller.default
Definition game.h:936
bool autoconnect
Flag to auto-connect this port when a game session begins.
Definition game.h:971
float y
The position of the stick along the Y axis, from -1.0 to 1.0.
Definition game.h:1040
const char * port_address
The address of the port that the device is connected to.
Definition game.h:939
uint32_t unicode
If the keypress generates a printing character.
Definition game.h:1071
GAME_KEY_MOD modifiers
Modifier keys pressed with the event key.
Definition game.h:1074
GAME_PORT_TYPE port_type
The type of port that the controller is connected to.
Definition game.h:1125
float x
The position of the stick along the X axis, from -1.0 to 1.0.
Definition game.h:1037
int player_limit
A limit on the number of input-providing devices, or -1 for no limit.
Definition game.h:997
const char * port_id
Required for GAME_PORT_CONTROLLER type.
Definition game.h:958
game_input_device * accepted_devices
The list of devices that can be connected to the port.
Definition game.h:974
float z
The accelerometer Z axis, from -1.0 to 1.0.
Definition game.h:1055
GAME_INPUT_EVENT_SOURCE
Type of input event.
Definition game.h:819
GAME_KEY_MOD
A modifier key pressed to give another key a special meaning.
Definition game.h:852
GAME_PORT_TYPE
Type of port on the virtual game console.
Definition game.h:885
@ GAME_INPUT_EVENT_DIGITAL_BUTTON
Digital button press or release.
Definition game.h:821
@ GAME_INPUT_EVENT_ANALOG_STICK
Analog stick motion.
Definition game.h:830
@ GAME_INPUT_EVENT_ABSOLUTE_POINTER
Absolute pointer motion.
Definition game.h:842
@ GAME_INPUT_EVENT_RELATIVE_POINTER
Relative pointer motion.
Definition game.h:839
@ GAME_INPUT_EVENT_MOTOR
Motor vibration.
Definition game.h:845
@ GAME_INPUT_EVENT_ACCELEROMETER
Accelerometer motion.
Definition game.h:833
@ GAME_INPUT_EVENT_KEY
Key press or release.
Definition game.h:836
@ GAME_INPUT_EVENT_AXIS
Axis motion.
Definition game.h:827
@ GAME_INPUT_EVENT_ANALOG_BUTTON
Analog button motion.
Definition game.h:824
@ GAME_KEY_MOD_ALT
Alt key.
Definition game.h:863
@ GAME_KEY_MOD_CAPSLOCK
Caps Lock key.
Definition game.h:875
@ GAME_KEY_MOD_CTRL
Control key.
Definition game.h:860
@ GAME_KEY_MOD_META
Meta key.
Definition game.h:866
@ GAME_KEY_MOD_SCROLLOCK
Scroll Lock key.
Definition game.h:878
@ GAME_KEY_MOD_NUMLOCK
Num Lock key.
Definition game.h:872
@ GAME_KEY_MOD_SUPER
Windows key.
Definition game.h:869
@ GAME_KEY_MOD_NONE
No modifier key.
Definition game.h:854
@ GAME_KEY_MOD_SHIFT
Shift key.
Definition game.h:857
@ GAME_PORT_MOUSE
Game port mouse.
Definition game.h:893
@ GAME_PORT_CONTROLLER
Game port controller.
Definition game.h:896
@ GAME_PORT_KEYBOARD
Game port Keyboard.
Definition game.h:890
@ GAME_PORT_UNKNOWN
Game port unknown.
Definition game.h:887
An absolute pointer event, such as a touchscreen or tablet motion.
Definition game.h:1093
An accelerometer event.
Definition game.h:1047
An analog button event, such as a trigger press or release.
Definition game.h:1013
An analog stick event, such as a joystick's motion.
Definition game.h:1035
An axis event, such as a joystick or accelerometer.
Definition game.h:1022
"C" Game add-on controller layout.
Definition game.h:908
A digital button event, such as a button press or release.
Definition game.h:1004
Device that can provide input.
Definition game.h:934
An input event.
Definition game.h:1117
Port that can provide input.
Definition game.h:953
The input topology is the possible ways to connect input devices.
Definition game.h:989
A key event, such as a key press or release.
Definition game.h:1062
A motor vibration event.
Definition game.h:1108
A relative pointer event, such as a mouse motion.
Definition game.h:1081
const game_rc_achievement * achievements
Achievements of the game, or NULL if achievement_count is 0.
Definition game.h:1278
const char * submitted_score
The value that was submitted, formatted for display, or NULL
Definition game.h:1404
unsigned int new_rank
The player's rank after the submission, counting from one.
Definition game.h:1413
unsigned int num_entries
How many entries the leaderboard holds.
Definition game.h:1416
bool hardcore
True if the achievement was earned in hardcore mode.
Definition game.h:1306
const char * icon_url
URL of the game's icon, or NULL
Definition game.h:1275
const char * display_name
Display name of the player, or NULL
Definition game.h:1322
float rarity
Percentage of players who earned this achievement, 0.0 if unknown.
Definition game.h:1253
float measured_percent
Progress towards the achievement, from 0.0 to 100.0.
Definition game.h:1360
const char * badge_locked_url
URL of the locked (greyscale) badge, or NULL
Definition game.h:1241
const char * description
Description of how the achievement is earned, or NULL
Definition game.h:1235
unsigned int points
Point value of the achievement.
Definition game.h:1244
bool success
True if the player was logged in.
Definition game.h:1316
const char * title
Title of the achievement, or NULL if unknown.
Definition game.h:1232
const char * value
The value as it stands, already formatted for display, or NULL
Definition game.h:1389
unsigned int id
Unique RetroAchievements ID of the achievement.
Definition game.h:1229
const char * username
Account name of the player, or NULL
Definition game.h:1319
int64_t unlock_time
Unix time the achievement was earned, or 0 if it was not.
Definition game.h:1250
GAME_RC_UNLOCK_STATE unlock_state
Whether and how the player has earned this achievement.
Definition game.h:1247
const char * display
The value as it stands, formatted for display, or NULL
Definition game.h:1433
unsigned int achievement_count
Number of elements in achievements.
Definition game.h:1281
unsigned int game_id
Unique RetroAchievements ID of the game.
Definition game.h:1269
bool credentials_rejected
True if the account or token was rejected, rather than the attempt failing for some other reason.
Definition game.h:1340
const char * badge_url
URL of the unlocked (full colour) badge, or NULL
Definition game.h:1238
const char * measured_progress
Human-readable progress such as "45/100", or NULL
Definition game.h:1363
const char * error_message
Reason the login failed, or NULL if it succeeded.
Definition game.h:1331
float rarity_hardcore
Percentage of players who earned this in hardcore, 0.0 if unknown.
Definition game.h:1256
const char * best_score
The player's best value on this leaderboard, or NULL
Definition game.h:1410
GAME_RC_UNLOCK_STATE
Unlock state of an achievement
Definition game.h:1211
@ GAME_RC_UNLOCK_STATE_SOFTCORE
The achievement was earned outside of hardcore mode.
Definition game.h:1216
@ GAME_RC_UNLOCK_STATE_HARDCORE
The achievement was earned in hardcore mode.
Definition game.h:1219
@ GAME_RC_UNLOCK_STATE_LOCKED
The achievement has not been earned by this player.
Definition game.h:1213
A single achievement belonging to the loaded game
Definition game.h:1227
**Payload of AddonToKodiFuncTable_Game::RCOnChallengeIndicator**
Definition game.h:1444
Progress towards a single measured achievement
Definition game.h:1355
Payload of the achievement progress indicator callbacks
Definition game.h:1466
**Payload of AddonToKodiFuncTable_Game::RCOnAchievementTriggered**
Definition game.h:1289
**Payload of AddonToKodiFuncTable_Game::RCOnGameLoaded**
Definition game.h:1267
Payload of the leaderboard attempt callbacks
Definition game.h:1374
**Payload of AddonToKodiFuncTable_Game::RCOnLeaderboardScoreboard**
Definition game.h:1399
Payload of the leaderboard tracker callbacks
Definition game.h:1425
**Payload of AddonToKodiFuncTable_Game::RCOnLoginResult**
Definition game.h:1314
game_stream_video_packet game_stream_sw_framebuffer_packet
Software framebuffer packet
Definition game.h:499
game_stream_video_properties game_stream_sw_framebuffer_properties
Game software framebuffer stream properties
Definition game.h:480
Software framebuffer type
Definition game.h:487
GAME_STREAM_TYPE type
The stream type.
Definition game.h:542
GAME_STREAM_TYPE
Game stream types
Definition game.h:515
@ GAME_STREAM_VIDEO
Video stream.
Definition game.h:523
@ GAME_STREAM_AUDIO
Audio stream.
Definition game.h:520
@ GAME_STREAM_HW_FRAMEBUFFER
Hardware framebuffer.
Definition game.h:526
@ GAME_STREAM_UNKNOWN
Unknown.
Definition game.h:517
@ GAME_STREAM_SW_FRAMEBUFFER
Software framebuffer.
Definition game.h:529
Stream buffers for hardware rendering and zero-copy support
Definition game.h:565
Stream packet and ephemeral metadata
Definition game.h:588
Immutable stream metadata
Definition game.h:540
float display_aspect_ratio
Display aspect ratio (DAR) to use when showing the video frame.
Definition game.h:280
const uint8_t * data
Pointer to the video stream data given to Kodi.
Definition game.h:286
size_t size
Size of the data array.
Definition game.h:289
unsigned int nominal_width
The nominal width, in pixels.
Definition game.h:244
unsigned int max_height
The maximum height, in pixels.
Definition game.h:259
GAME_VIDEO_ROTATION rotation
Video rotation angle defined by GAME_VIDEO_ROTATION.
Definition game.h:283
unsigned int height
Video height, in pixels.
Definition game.h:274
unsigned int max_width
The maximum width, in pixels.
Definition game.h:256
unsigned int width
Video width, in pixels.
Definition game.h:271
float nominal_display_aspect_ratio
The nominal display aspect ratio (DAR) used to show the video frame.
Definition game.h:253
GAME_PIXEL_FORMAT format
The stream's pixel format.
Definition game.h:241
unsigned int nominal_height
The nominal height, in pixels.
Definition game.h:247
GAME_PIXEL_FORMAT
Pixel format
Definition game.h:197
GAME_VIDEO_ROTATION
Video rotation orientation
Definition game.h:217
@ GAME_PIXEL_FORMAT_RGB565
RGB565 Format.
Definition game.h:204
@ GAME_PIXEL_FORMAT_0RGB1555
0RGB1555 Format
Definition game.h:207
@ GAME_PIXEL_FORMAT_0RGB8888
0RGB8888 Format
Definition game.h:201
@ GAME_VIDEO_ROTATION_180_CCW
Rotate 180° counterclockwise.
Definition game.h:225
@ GAME_VIDEO_ROTATION_0
0° without rotation
Definition game.h:219
@ GAME_VIDEO_ROTATION_90_CCW
Rotate 90° counterclockwise.
Definition game.h:222
@ GAME_VIDEO_ROTATION_270_CCW
Rotate 270° counterclockwise.
Definition game.h:228
Video stream packet
Definition game.h:269
Game video stream properties
Definition game.h:239
GAME_ERROR
Game add-on error codes
Definition game.h:29
@ GAME_ERROR_FAILED
The command failed.
Definition game.h:46
@ GAME_ERROR_REJECTED
The command was rejected by the game client.
Definition game.h:40
@ GAME_ERROR_INVALID_PARAMETERS
The parameters of the called method are invalid for this operation.
Definition game.h:43
@ GAME_ERROR_UNKNOWN
An unknown error occurred.
Definition game.h:34
@ GAME_ERROR_NO_ERROR
No error occurred.
Definition game.h:31
@ GAME_ERROR_RESTRICTED
Game requires restricted resources.
Definition game.h:52
@ GAME_ERROR_NOT_LOADED
No game is loaded.
Definition game.h:49
@ GAME_ERROR_NOT_IMPLEMENTED
The method called by the frontend is not implemented.
Definition game.h:37
Game instance.
Definition game.h:1711
Game properties.
Definition game.h:1500
const char ** resource_directories
The "system" directories of the frontend.
Definition game.h:1522
unsigned int proxy_dll_count
Number of proxy DLL paths provided.
Definition game.h:1514
const char * profile_directory
The writable directory of the frontend.
Definition game.h:1535
const char * game_client_dll_path
The path of the game client being loaded.
Definition game.h:1504
unsigned int extension_count
Number of extensions provided.
Definition game.h:1550
bool supports_vfs
The value of the <supports_vfs> property from addon.xml.
Definition game.h:1540
const char ** proxy_dll_paths
Paths to proxy DLLs used to load the game client.
Definition game.h:1509
const char ** extensions
The extensions in the <extensions> property from addon.xml.
Definition game.h:1545
unsigned int resource_directory_count
Number of resource directories provided.
Definition game.h:1527
Game callbacks.
Definition game.h:1566
bool(* StartStream)(KODI_HANDLE, KODI_GAME_STREAM_HANDLE)
Reset a prepared hardware stream after installing its returned handle.
Definition game.h:1630
Game function hooks.
Definition game.h:1639