RetroArch
Classes | Functions | Variables
dinput_joypad.c File Reference
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <windowsx.h>
#include <dinput.h>
#include <boolean.h>
#include <compat/strl.h>
#include <string/stdstring.h>
#include "../../tasks/tasks_internal.h"
#include "../../gfx/video_driver.h"
#include "../input_driver.h"
#include "../input_keymaps.h"
#include "../../verbosity.h"
#include "dinput_joypad.h"
Include dependency graph for dinput_joypad.c:

Classes

struct  dinput_joypad
 

Functions

void dinput_destroy_context (void)
 
bool dinput_init_context (void)
 
bool dinput_joypad_get_vidpid_from_xinput_index (int32_t index, int32_t *vid, int32_t *pid, int32_t *dinput_index)
 
static void dinput_joypad_destroy (void)
 
static void dinput_create_rumble_effects (struct dinput_joypad *pad)
 
static BOOL CALLBACK enum_axes_cb (const DIDEVICEOBJECTINSTANCE *inst, void *p)
 
static const char * dinput_joypad_name (unsigned pad)
 
static int32_t dinput_joypad_vid (unsigned pad)
 
static int32_t dinput_joypad_pid (unsigned pad)
 
static const char * dinput_joypad_friendly_name (unsigned pad)
 
static BOOL CALLBACK enum_joypad_cb (const DIDEVICEINSTANCE *inst, void *p)
 
static bool dinput_joypad_init (void *data)
 
static bool dinput_joypad_button (unsigned port_num, uint16_t joykey)
 
static int16_t dinput_joypad_axis (unsigned port_num, uint32_t joyaxis)
 
static void dinput_joypad_poll (void)
 
static bool dinput_joypad_query_pad (unsigned pad)
 
bool dinput_joypad_set_rumble (unsigned pad, enum retro_rumble_effect type, uint16_t strenght)
 

Variables

static struct dinput_joypad g_pads [MAX_USERS]
 
static unsigned g_joypad_cnt
 
static unsigned g_last_xinput_pad_idx
 
static const GUID common_xinput_guids []
 
bool g_xinput_block_pads
 
int g_xinput_pad_indexes [MAX_USERS]
 
LPDIRECTINPUT8 g_dinput_ctx
 
input_device_driver_t dinput_joypad
 

Function Documentation

◆ dinput_create_rumble_effects()

static void dinput_create_rumble_effects ( struct dinput_joypad pad)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dinput_destroy_context()

void dinput_destroy_context ( void  )
Here is the caller graph for this function:

◆ dinput_init_context()

bool dinput_init_context ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dinput_joypad_axis()

static int16_t dinput_joypad_axis ( unsigned  port_num,
uint32_t  joyaxis 
)
static

◆ dinput_joypad_button()

static bool dinput_joypad_button ( unsigned  port_num,
uint16_t  joykey 
)
static

◆ dinput_joypad_destroy()

static void dinput_joypad_destroy ( void  )
static
Here is the call graph for this function:

◆ dinput_joypad_friendly_name()

static const char* dinput_joypad_friendly_name ( unsigned  pad)
static
Here is the caller graph for this function:

◆ dinput_joypad_get_vidpid_from_xinput_index()

bool dinput_joypad_get_vidpid_from_xinput_index ( int32_t  index,
int32_t vid,
int32_t pid,
int32_t dinput_index 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dinput_joypad_init()

static bool dinput_joypad_init ( void data)
static
Here is the call graph for this function:

◆ dinput_joypad_name()

static const char* dinput_joypad_name ( unsigned  pad)
static
Here is the caller graph for this function:

◆ dinput_joypad_pid()

static int32_t dinput_joypad_pid ( unsigned  pad)
static
Here is the caller graph for this function:

◆ dinput_joypad_poll()

static void dinput_joypad_poll ( void  )
static
Here is the call graph for this function:

◆ dinput_joypad_query_pad()

static bool dinput_joypad_query_pad ( unsigned  pad)
static

◆ dinput_joypad_set_rumble()

bool dinput_joypad_set_rumble ( unsigned  pad,
enum retro_rumble_effect  type,
uint16_t  strenght 
)

◆ dinput_joypad_vid()

static int32_t dinput_joypad_vid ( unsigned  pad)
static
Here is the caller graph for this function:

◆ enum_axes_cb()

static BOOL CALLBACK enum_axes_cb ( const DIDEVICEOBJECTINSTANCE *  inst,
void p 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enum_joypad_cb()

static BOOL CALLBACK enum_joypad_cb ( const DIDEVICEINSTANCE *  inst,
void p 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ common_xinput_guids

const GUID common_xinput_guids[]
static
Initial value:
= {
{MAKELONG(0x28DE, 0x11FF),0x0000,0x0000,{0x00,0x00,0x50,0x49,0x44,0x56,0x49,0x44}},
{MAKELONG(0x045E, 0x02A1),0x0000,0x0000,{0x00,0x00,0x50,0x49,0x44,0x56,0x49,0x44}},
{MAKELONG(0x045E, 0x028E),0x0000,0x0000,{0x00,0x00,0x50,0x49,0x44,0x56,0x49,0x44}}
}

◆ dinput_joypad

Initial value:
= {
"dinput",
}
static void dinput_joypad_poll(void)
Definition: dinput_joypad.c:524
bool dinput_joypad_set_rumble(unsigned pad, enum retro_rumble_effect type, uint16_t strenght)
Definition: dinput_joypad.c:563
static bool dinput_joypad_init(void *data)
Definition: dinput_joypad.c:384
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static const char * dinput_joypad_name(unsigned pad)
Definition: dinput_joypad.c:265
static void dinput_joypad_destroy(void)
Definition: dinput_joypad.c:95
static bool dinput_joypad_query_pad(unsigned pad)
Definition: dinput_joypad.c:558
static bool dinput_joypad_button(unsigned port_num, uint16_t joykey)
Definition: dinput_joypad.c:409
static int16_t dinput_joypad_axis(unsigned port_num, uint32_t joyaxis)
Definition: dinput_joypad.c:462

◆ g_dinput_ctx

LPDIRECTINPUT8 g_dinput_ctx

◆ g_joypad_cnt

unsigned g_joypad_cnt
static

◆ g_last_xinput_pad_idx

unsigned g_last_xinput_pad_idx
static

◆ g_pads

struct dinput_joypad g_pads[MAX_USERS]
static

◆ g_xinput_block_pads

bool g_xinput_block_pads

◆ g_xinput_pad_indexes

int g_xinput_pad_indexes[MAX_USERS]