Kodi Documentation  18.0
Kodi is an open source media player and entertainment hub.
kodi_game_types.h File Reference
#include "versions.h"
#include "xbmc_addon_types.h"
#include <stddef.h>
#include <stdint.h>
#include "input/XBMC_vkeys.h"

Classes

struct  game_stream_audio_properties
 
struct  game_stream_audio_packet
 
struct  game_stream_video_properties
 
struct  game_stream_video_packet
 
struct  game_stream_hw_framebuffer_properties
 
struct  game_stream_hw_framebuffer_buffer
 
struct  game_stream_hw_framebuffer_packet
 
struct  game_stream_sw_framebuffer_buffer
 
struct  game_stream_properties
 Immutable stream metadata. More...
 
struct  game_stream_buffer
 Stream buffers for hardware rendering and zero-copy support. More...
 
struct  game_stream_packet
 Stream packet and ephemeral metadata. More...
 
struct  game_controller
 
struct  game_input_device
 Device that can provide input. More...
 
struct  game_input_port
 Port that can provide input. More...
 
struct  game_input_topology
 The input topology is the possible ways to connect input devices. More...
 
struct  game_digital_button_event
 
struct  game_analog_button_event
 
struct  game_axis_event
 
struct  game_analog_stick_event
 
struct  game_accelerometer_event
 
struct  game_key_event
 
struct  game_rel_pointer_event
 
struct  game_abs_pointer_event
 
struct  game_motor_event
 
struct  game_input_event
 
struct  game_system_timing
 
struct  AddonProps_Game
 } More...
 
struct  AddonToKodiFuncTable_Game
 
struct  KodiToAddonFuncTable_Game
 
struct  AddonInstance_Game
 

Macros

#define ATTRIBUTE_PACKED
 
#define PRAGMA_PACK   1
 
#define DEFAULT_PORT_ID   "1"
 

Typedefs

Software framebuffer stream

}

{

typedef game_stream_video_properties game_stream_sw_framebuffer_properties
 
typedef struct game_stream_sw_framebuffer_buffer game_stream_sw_framebuffer_buffer
 
typedef game_stream_video_packet game_stream_sw_framebuffer_packet
 
Environment types

}

{

typedef struct AddonProps_Game AddonProps_Game
 } More...
 
typedef AddonProps_Game game_client_properties
 
typedef struct AddonToKodiFuncTable_Game AddonToKodiFuncTable_Game
 
typedef struct KodiToAddonFuncTable_Game KodiToAddonFuncTable_Game
 
typedef struct AddonInstance_Game AddonInstance_Game
 

Add-on types

{

enum  GAME_ERROR {
  GAME_ERROR_NO_ERROR, GAME_ERROR_UNKNOWN, GAME_ERROR_NOT_IMPLEMENTED, GAME_ERROR_REJECTED,
  GAME_ERROR_INVALID_PARAMETERS, GAME_ERROR_FAILED, GAME_ERROR_NOT_LOADED, GAME_ERROR_RESTRICTED
}
 
typedef enum GAME_ERROR GAME_ERROR
 

Audio stream

}

{

enum  GAME_PCM_FORMAT { GAME_PCM_FORMAT_UNKNOWN, GAME_PCM_FORMAT_S16NE }
 
enum  GAME_AUDIO_CHANNEL {
  GAME_CH_NULL, GAME_CH_FL, GAME_CH_FR, GAME_CH_FC,
  GAME_CH_LFE, GAME_CH_BL, GAME_CH_BR, GAME_CH_FLOC,
  GAME_CH_FROC, GAME_CH_BC, GAME_CH_SL, GAME_CH_SR,
  GAME_CH_TFL, GAME_CH_TFR, GAME_CH_TFC, GAME_CH_TC,
  GAME_CH_TBL, GAME_CH_TBR, GAME_CH_TBC, GAME_CH_BLOC,
  GAME_CH_BROC
}
 
typedef enum GAME_PCM_FORMAT GAME_PCM_FORMAT
 
typedef enum GAME_AUDIO_CHANNEL GAME_AUDIO_CHANNEL
 
typedef struct game_stream_audio_properties game_stream_audio_properties
 
typedef struct game_stream_audio_packet game_stream_audio_packet
 

Video stream

}

{

enum  GAME_PIXEL_FORMAT { GAME_PIXEL_FORMAT_UNKNOWN, GAME_PIXEL_FORMAT_0RGB8888, GAME_PIXEL_FORMAT_RGB565, GAME_PIXEL_FORMAT_0RGB1555 }
 
enum  GAME_VIDEO_ROTATION { GAME_VIDEO_ROTATION_0, GAME_VIDEO_ROTATION_90_CCW, GAME_VIDEO_ROTATION_180_CCW, GAME_VIDEO_ROTATION_270_CCW }
 
typedef enum GAME_PIXEL_FORMAT GAME_PIXEL_FORMAT
 
typedef enum GAME_VIDEO_ROTATION GAME_VIDEO_ROTATION
 
typedef struct game_stream_video_properties game_stream_video_properties
 
typedef struct game_stream_video_packet game_stream_video_packet
 

Hardware framebuffer stream

}

{

enum  GAME_HW_CONTEXT_TYPE {
  GAME_HW_CONTEXT_NONE, GAME_HW_CONTEXT_OPENGL, GAME_HW_CONTEXT_OPENGLES2, GAME_HW_CONTEXT_OPENGL_CORE,
  GAME_HW_CONTEXT_OPENGLES3, GAME_HW_CONTEXT_OPENGLES_VERSION, GAME_HW_CONTEXT_VULKAN
}
 
typedef enum GAME_HW_CONTEXT_TYPE GAME_HW_CONTEXT_TYPE
 
typedef struct game_stream_hw_framebuffer_properties game_stream_hw_framebuffer_properties
 
typedef struct game_stream_hw_framebuffer_buffer game_stream_hw_framebuffer_buffer
 
typedef struct game_stream_hw_framebuffer_packet game_stream_hw_framebuffer_packet
 
typedef void(* game_proc_address_t) (void)
 

Stream types

}

{

enum  GAME_STREAM_TYPE {
  GAME_STREAM_UNKNOWN, GAME_STREAM_AUDIO, GAME_STREAM_VIDEO, GAME_STREAM_HW_FRAMEBUFFER,
  GAME_STREAM_SW_FRAMEBUFFER
}
 
typedef enum GAME_STREAM_TYPE GAME_STREAM_TYPE
 
typedef struct game_stream_properties game_stream_properties
 Immutable stream metadata. More...
 
typedef struct game_stream_buffer game_stream_buffer
 Stream buffers for hardware rendering and zero-copy support. More...
 
typedef struct game_stream_packet game_stream_packet
 Stream packet and ephemeral metadata. More...
 

Game types

}

{

enum  GAME_REGION { GAME_REGION_UNKNOWN, GAME_REGION_NTSC, GAME_REGION_PAL }
 
enum  SPECIAL_GAME_TYPE { SPECIAL_GAME_TYPE_BSX, SPECIAL_GAME_TYPE_BSX_SLOTTED, SPECIAL_GAME_TYPE_SUFAMI_TURBO, SPECIAL_GAME_TYPE_SUPER_GAME_BOY }
 
enum  GAME_MEMORY {
  GAME_MEMORY_MASK = 0xff, GAME_MEMORY_SAVE_RAM = 0, GAME_MEMORY_RTC = 1, GAME_MEMORY_SYSTEM_RAM = 2,
  GAME_MEMORY_VIDEO_RAM = 3, GAME_MEMORY_SNES_BSX_RAM = ((1 << 8) | GAME_MEMORY_SAVE_RAM), GAME_MEMORY_SNES_BSX_PRAM = ((2 << 8) | GAME_MEMORY_SAVE_RAM), GAME_MEMORY_SNES_SUFAMI_TURBO_A_RAM = ((3 << 8) | GAME_MEMORY_SAVE_RAM),
  GAME_MEMORY_SNES_SUFAMI_TURBO_B_RAM = ((4 << 8) | GAME_MEMORY_SAVE_RAM), GAME_MEMORY_SNES_GAME_BOY_RAM = ((5 << 8) | GAME_MEMORY_SAVE_RAM), GAME_MEMORY_SNES_GAME_BOY_RTC = ((6 << 8) | GAME_MEMORY_RTC)
}
 
enum  GAME_SIMD {
  GAME_SIMD_SSE = (1 << 0), GAME_SIMD_SSE2 = (1 << 1), GAME_SIMD_VMX = (1 << 2), GAME_SIMD_VMX128 = (1 << 3),
  GAME_SIMD_AVX = (1 << 4), GAME_SIMD_NEON = (1 << 5), GAME_SIMD_SSE3 = (1 << 6), GAME_SIMD_SSSE3 = (1 << 7),
  GAME_SIMD_MMX = (1 << 8), GAME_SIMD_MMXEXT = (1 << 9), GAME_SIMD_SSE4 = (1 << 10), GAME_SIMD_SSE42 = (1 << 11),
  GAME_SIMD_AVX2 = (1 << 12), GAME_SIMD_VFPU = (1 << 13)
}
 
typedef enum GAME_REGION GAME_REGION
 
typedef enum SPECIAL_GAME_TYPE SPECIAL_GAME_TYPE
 
typedef enum GAME_MEMORY GAME_MEMORY
 
typedef enum GAME_SIMD GAME_SIMD
 

Input types

}

{

enum  GAME_INPUT_EVENT_SOURCE {
  GAME_INPUT_EVENT_DIGITAL_BUTTON, GAME_INPUT_EVENT_ANALOG_BUTTON, GAME_INPUT_EVENT_AXIS, GAME_INPUT_EVENT_ANALOG_STICK,
  GAME_INPUT_EVENT_ACCELEROMETER, GAME_INPUT_EVENT_KEY, GAME_INPUT_EVENT_RELATIVE_POINTER, GAME_INPUT_EVENT_ABSOLUTE_POINTER,
  GAME_INPUT_EVENT_MOTOR
}
 
enum  GAME_KEY_MOD {
  GAME_KEY_MOD_NONE = 0x0000, GAME_KEY_MOD_SHIFT = 0x0001, GAME_KEY_MOD_CTRL = 0x0002, GAME_KEY_MOD_ALT = 0x0004,
  GAME_KEY_MOD_META = 0x0008, GAME_KEY_MOD_SUPER = 0x0010, GAME_KEY_MOD_NUMLOCK = 0x0100, GAME_KEY_MOD_CAPSLOCK = 0x0200,
  GAME_KEY_MOD_SCROLLOCK = 0x0400
}
 
enum  GAME_PORT_TYPE { GAME_PORT_UNKNOWN, GAME_PORT_KEYBOARD, GAME_PORT_MOUSE, GAME_PORT_CONTROLLER }
 Type of port on the virtual game console. More...
 
typedef enum GAME_INPUT_EVENT_SOURCE GAME_INPUT_EVENT_SOURCE
 
typedef enum GAME_KEY_MOD GAME_KEY_MOD
 
typedef enum GAME_PORT_TYPE GAME_PORT_TYPE
 Type of port on the virtual game console. More...
 
typedef struct game_controller game_controller
 
typedef struct game_input_device game_input_device
 Device that can provide input. More...
 
typedef struct game_input_port game_input_port
 Port that can provide input. More...
 
typedef struct game_input_topology game_input_topology
 The input topology is the possible ways to connect input devices. More...
 
typedef struct game_digital_button_event game_digital_button_event
 
typedef struct game_analog_button_event game_analog_button_event
 
typedef struct game_axis_event game_axis_event
 
typedef struct game_analog_stick_event game_analog_stick_event
 
typedef struct game_accelerometer_event game_accelerometer_event
 
typedef struct game_key_event game_key_event
 
typedef struct game_rel_pointer_event game_rel_pointer_event
 
typedef struct game_abs_pointer_event game_abs_pointer_event
 
typedef struct game_motor_event game_motor_event
 
typedef struct game_input_event game_input_event
 

Macro Definition Documentation

§ ATTRIBUTE_PACKED

§ DEFAULT_PORT_ID

#define DEFAULT_PORT_ID   "1"

Port ID used when topology is unknown

§ PRAGMA_PACK

#define PRAGMA_PACK   1

Typedef Documentation

§ AddonInstance_Game

§ AddonProps_Game

}

Properties passed to the ADDON_Create() method of a game client

§ AddonToKodiFuncTable_Game

Structure to transfer the methods from kodi_game_dll.h to Kodi

§ game_abs_pointer_event

§ game_accelerometer_event

§ game_analog_button_event

§ game_analog_stick_event

§ GAME_AUDIO_CHANNEL

§ game_axis_event

§ game_client_properties

§ game_controller

§ game_digital_button_event

§ GAME_ERROR

typedef enum GAME_ERROR GAME_ERROR

Game add-on error codes

§ GAME_HW_CONTEXT_TYPE

§ game_input_device

Device that can provide input.

§ game_input_event

§ GAME_INPUT_EVENT_SOURCE

§ game_input_port

Port that can provide input.

Ports can accept multiple devices and devices can have multiple ports, so the topology of possible configurations is a tree structure of alternating port and device nodes.

§ game_input_topology

The input topology is the possible ways to connect input devices.

This represents the logical topology, which is the possible connections that the game client's logic can handle. It is strictly a subset of the physical topology. Loops are not allowed.

§ game_key_event

§ GAME_KEY_MOD

typedef enum GAME_KEY_MOD GAME_KEY_MOD

§ GAME_MEMORY

typedef enum GAME_MEMORY GAME_MEMORY

§ game_motor_event

§ GAME_PCM_FORMAT

§ GAME_PIXEL_FORMAT

§ GAME_PORT_TYPE

Type of port on the virtual game console.

§ game_proc_address_t

typedef void(* game_proc_address_t) (void)

§ GAME_REGION

typedef enum GAME_REGION GAME_REGION

Returned from game_get_region()

§ game_rel_pointer_event

§ GAME_SIMD

typedef enum GAME_SIMD GAME_SIMD

ID values for SIMD CPU features

§ game_stream_audio_packet

§ game_stream_audio_properties

§ game_stream_buffer

Stream buffers for hardware rendering and zero-copy support.

§ game_stream_hw_framebuffer_buffer

§ game_stream_hw_framebuffer_packet

§ game_stream_hw_framebuffer_properties

§ game_stream_packet

Stream packet and ephemeral metadata.

This packet contains stream data and accompanying metadata. The metadata is ephemeral, meaning it only applies to the current packet and can change from packet to packet in the same stream.

§ game_stream_properties

Immutable stream metadata.

This metadata is provided when the stream is opened. If any stream properties change, a new stream must be opened.

§ game_stream_sw_framebuffer_buffer

§ game_stream_sw_framebuffer_packet

§ game_stream_sw_framebuffer_properties

§ GAME_STREAM_TYPE

§ game_stream_video_packet

§ game_stream_video_properties

§ GAME_VIDEO_ROTATION

§ KodiToAddonFuncTable_Game

§ SPECIAL_GAME_TYPE

Special game types passed into game_load_game_special(). Only used when multiple ROMs are required.

Enumeration Type Documentation

§ GAME_AUDIO_CHANNEL

Enumerator
GAME_CH_NULL 
GAME_CH_FL 
GAME_CH_FR 
GAME_CH_FC 
GAME_CH_LFE 
GAME_CH_BL 
GAME_CH_BR 
GAME_CH_FLOC 
GAME_CH_FROC 
GAME_CH_BC 
GAME_CH_SL 
GAME_CH_SR 
GAME_CH_TFL 
GAME_CH_TFR 
GAME_CH_TFC 
GAME_CH_TC 
GAME_CH_TBL 
GAME_CH_TBR 
GAME_CH_TBC 
GAME_CH_BLOC 
GAME_CH_BROC 

§ GAME_ERROR

enum GAME_ERROR

Game add-on error codes

Enumerator
GAME_ERROR_NO_ERROR 
GAME_ERROR_UNKNOWN 
GAME_ERROR_NOT_IMPLEMENTED 
GAME_ERROR_REJECTED 
GAME_ERROR_INVALID_PARAMETERS 
GAME_ERROR_FAILED 
GAME_ERROR_NOT_LOADED 
GAME_ERROR_RESTRICTED 

§ GAME_HW_CONTEXT_TYPE

Enumerator
GAME_HW_CONTEXT_NONE 
GAME_HW_CONTEXT_OPENGL 
GAME_HW_CONTEXT_OPENGLES2 
GAME_HW_CONTEXT_OPENGL_CORE 
GAME_HW_CONTEXT_OPENGLES3 
GAME_HW_CONTEXT_OPENGLES_VERSION 
GAME_HW_CONTEXT_VULKAN 

§ GAME_INPUT_EVENT_SOURCE

Enumerator
GAME_INPUT_EVENT_DIGITAL_BUTTON 
GAME_INPUT_EVENT_ANALOG_BUTTON 
GAME_INPUT_EVENT_AXIS 
GAME_INPUT_EVENT_ANALOG_STICK 
GAME_INPUT_EVENT_ACCELEROMETER 
GAME_INPUT_EVENT_KEY 
GAME_INPUT_EVENT_RELATIVE_POINTER 
GAME_INPUT_EVENT_ABSOLUTE_POINTER 
GAME_INPUT_EVENT_MOTOR 

§ GAME_KEY_MOD

Enumerator
GAME_KEY_MOD_NONE 
GAME_KEY_MOD_SHIFT 
GAME_KEY_MOD_CTRL 
GAME_KEY_MOD_ALT 
GAME_KEY_MOD_META 
GAME_KEY_MOD_SUPER 
GAME_KEY_MOD_NUMLOCK 
GAME_KEY_MOD_CAPSLOCK 
GAME_KEY_MOD_SCROLLOCK 

§ GAME_MEMORY

Enumerator
GAME_MEMORY_MASK 

Passed to game_get_memory_data/size(). If the memory type doesn't apply to the implementation NULL/0 can be returned.

GAME_MEMORY_SAVE_RAM 

Regular save ram. This ram is usually found on a game cartridge, backed up by a battery. If save game data is too complex for a single memory buffer, the SYSTEM_DIRECTORY environment callback can be used.

GAME_MEMORY_RTC 

Some games have a built-in clock to keep track of time. This memory is usually just a couple of bytes to keep track of time.

GAME_MEMORY_SYSTEM_RAM 

System ram lets a frontend peek into a game systems main RAM

GAME_MEMORY_VIDEO_RAM 

Video ram lets a frontend peek into a game systems video RAM (VRAM)

GAME_MEMORY_SNES_BSX_RAM 

Special memory types

GAME_MEMORY_SNES_BSX_PRAM 
GAME_MEMORY_SNES_SUFAMI_TURBO_A_RAM 
GAME_MEMORY_SNES_SUFAMI_TURBO_B_RAM 
GAME_MEMORY_SNES_GAME_BOY_RAM 
GAME_MEMORY_SNES_GAME_BOY_RTC 

§ GAME_PCM_FORMAT

Enumerator
GAME_PCM_FORMAT_UNKNOWN 
GAME_PCM_FORMAT_S16NE 

§ GAME_PIXEL_FORMAT

Enumerator
GAME_PIXEL_FORMAT_UNKNOWN 
GAME_PIXEL_FORMAT_0RGB8888 
GAME_PIXEL_FORMAT_RGB565 
GAME_PIXEL_FORMAT_0RGB1555 

§ GAME_PORT_TYPE

Type of port on the virtual game console.

Enumerator
GAME_PORT_UNKNOWN 
GAME_PORT_KEYBOARD 
GAME_PORT_MOUSE 
GAME_PORT_CONTROLLER 

§ GAME_REGION

Returned from game_get_region()

Enumerator
GAME_REGION_UNKNOWN 
GAME_REGION_NTSC 
GAME_REGION_PAL 

§ GAME_SIMD

enum GAME_SIMD

ID values for SIMD CPU features

Enumerator
GAME_SIMD_SSE 
GAME_SIMD_SSE2 
GAME_SIMD_VMX 
GAME_SIMD_VMX128 
GAME_SIMD_AVX 
GAME_SIMD_NEON 
GAME_SIMD_SSE3 
GAME_SIMD_SSSE3 
GAME_SIMD_MMX 
GAME_SIMD_MMXEXT 
GAME_SIMD_SSE4 
GAME_SIMD_SSE42 
GAME_SIMD_AVX2 
GAME_SIMD_VFPU 

§ GAME_STREAM_TYPE

Enumerator
GAME_STREAM_UNKNOWN 
GAME_STREAM_AUDIO 
GAME_STREAM_VIDEO 
GAME_STREAM_HW_FRAMEBUFFER 
GAME_STREAM_SW_FRAMEBUFFER 

§ GAME_VIDEO_ROTATION

Enumerator
GAME_VIDEO_ROTATION_0 
GAME_VIDEO_ROTATION_90_CCW 
GAME_VIDEO_ROTATION_180_CCW 
GAME_VIDEO_ROTATION_270_CCW 

§ SPECIAL_GAME_TYPE

Special game types passed into game_load_game_special(). Only used when multiple ROMs are required.

Enumerator
SPECIAL_GAME_TYPE_BSX 
SPECIAL_GAME_TYPE_BSX_SLOTTED 
SPECIAL_GAME_TYPE_SUFAMI_TURBO 
SPECIAL_GAME_TYPE_SUPER_GAME_BOY