RetroArch
Classes | Macros | Functions | Variables
net_retropad_core.c File Reference
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include <net/net_compat.h>
#include <net/net_socket.h>
#include <retro_miscellaneous.h>
#include <retro_timers.h>
#include <libretro.h>
#include "remotepad.h"
Include dependency graph for net_retropad_core.c:

Classes

struct  descriptor
 
struct  remote_joypad_message
 

Macros

#define SOCKET_ERROR   -1
 
#define NETRETROPAD_CORE_PREFIX(s)   s
 
#define DESC_NUM_PORTS(desc)   ((desc)->port_max - (desc)->port_min + 1)
 
#define DESC_NUM_INDICES(desc)   ((desc)->index_max - (desc)->index_min + 1)
 
#define DESC_NUM_IDS(desc)   ((desc)->id_max - (desc)->id_min + 1)
 
#define DESC_OFFSET(desc, port, index, id)
 

Functions

static retro_log_printf_t NETRETROPAD_CORE_PREFIX (log_cb)
 
static retro_video_refresh_t NETRETROPAD_CORE_PREFIX (video_cb)
 
static retro_audio_sample_t NETRETROPAD_CORE_PREFIX (audio_cb)
 
static retro_audio_sample_batch_t NETRETROPAD_CORE_PREFIX (audio_batch_cb)
 
static retro_environment_t NETRETROPAD_CORE_PREFIX (environ_cb)
 
static retro_input_poll_t NETRETROPAD_CORE_PREFIX (input_poll_cb)
 
static retro_input_state_t NETRETROPAD_CORE_PREFIX (input_state_cb)
 
void NETRETROPAD_CORE_PREFIX() retro_init (void)
 
void NETRETROPAD_CORE_PREFIX() retro_deinit (void)
 
unsigned NETRETROPAD_CORE_PREFIX() retro_api_version (void)
 
void NETRETROPAD_CORE_PREFIX() retro_set_controller_port_device (unsigned port, unsigned device)
 
void NETRETROPAD_CORE_PREFIX() retro_get_system_info (struct retro_system_info *info)
 
void NETRETROPAD_CORE_PREFIX() retro_get_system_av_info (struct retro_system_av_info *info)
 
static void retropad_update_input (void)
 
void NETRETROPAD_CORE_PREFIX() retro_set_environment (retro_environment_t cb)
 
static void netretropad_check_variables (void)
 
void NETRETROPAD_CORE_PREFIX() retro_set_audio_sample (retro_audio_sample_t cb)
 
void NETRETROPAD_CORE_PREFIX() retro_set_audio_sample_batch (retro_audio_sample_batch_t cb)
 
void NETRETROPAD_CORE_PREFIX() retro_set_input_poll (retro_input_poll_t cb)
 
void NETRETROPAD_CORE_PREFIX() retro_set_input_state (retro_input_state_t cb)
 
void NETRETROPAD_CORE_PREFIX() retro_set_video_refresh (retro_video_refresh_t cb)
 
void NETRETROPAD_CORE_PREFIX() retro_reset (void)
 
void NETRETROPAD_CORE_PREFIX() retro_run (void)
 
bool NETRETROPAD_CORE_PREFIX() retro_load_game (const struct retro_game_info *info)
 
void NETRETROPAD_CORE_PREFIX() retro_unload_game (void)
 
unsigned NETRETROPAD_CORE_PREFIX() retro_get_region (void)
 
bool NETRETROPAD_CORE_PREFIX() retro_load_game_special (unsigned type, const struct retro_game_info *info, size_t num)
 
size_t NETRETROPAD_CORE_PREFIX() retro_serialize_size (void)
 
bool NETRETROPAD_CORE_PREFIX() retro_serialize (void *data, size_t size)
 
bool NETRETROPAD_CORE_PREFIX() retro_unserialize (const void *data, size_t size)
 
void *NETRETROPAD_CORE_PREFIX() retro_get_memory_data (unsigned id)
 
size_t NETRETROPAD_CORE_PREFIX() retro_get_memory_size (unsigned id)
 
void NETRETROPAD_CORE_PREFIX() retro_cheat_reset (void)
 
void NETRETROPAD_CORE_PREFIX() retro_cheat_set (unsigned idx, bool enabled, const char *code)
 

Variables

static int s
 
static int port
 
static char server [64]
 
static struct sockaddr_in si_other
 
static struct retro_log_callback logger
 
static uint16_tframe_buf
 
static struct descriptor joypad
 
static struct descriptor analog
 
static struct descriptordescriptors []
 

Macro Definition Documentation

◆ DESC_NUM_IDS

#define DESC_NUM_IDS (   desc)    ((desc)->id_max - (desc)->id_min + 1)

◆ DESC_NUM_INDICES

#define DESC_NUM_INDICES (   desc)    ((desc)->index_max - (desc)->index_min + 1)

◆ DESC_NUM_PORTS

#define DESC_NUM_PORTS (   desc)    ((desc)->port_max - (desc)->port_min + 1)

◆ DESC_OFFSET

#define DESC_OFFSET (   desc,
  port,
  index,
  id 
)
Value:
( \
port * ((desc)->index_max - (desc)->index_min + 1) * ((desc)->id_max - (desc)->id_min + 1) + \
index * ((desc)->id_max - (desc)->id_min + 1) + \
id \
)

◆ NETRETROPAD_CORE_PREFIX

#define NETRETROPAD_CORE_PREFIX (   s)    s

◆ SOCKET_ERROR

#define SOCKET_ERROR   -1

Function Documentation

◆ netretropad_check_variables()

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

◆ NETRETROPAD_CORE_PREFIX() [1/7]

static retro_log_printf_t NETRETROPAD_CORE_PREFIX ( log_cb  )
static

◆ NETRETROPAD_CORE_PREFIX() [2/7]

static retro_video_refresh_t NETRETROPAD_CORE_PREFIX ( video_cb  )
static

◆ NETRETROPAD_CORE_PREFIX() [3/7]

static retro_audio_sample_t NETRETROPAD_CORE_PREFIX ( audio_cb  )
static

◆ NETRETROPAD_CORE_PREFIX() [4/7]

static retro_audio_sample_batch_t NETRETROPAD_CORE_PREFIX ( audio_batch_cb  )
static

◆ NETRETROPAD_CORE_PREFIX() [5/7]

static retro_environment_t NETRETROPAD_CORE_PREFIX ( environ_cb  )
static

◆ NETRETROPAD_CORE_PREFIX() [6/7]

static retro_input_poll_t NETRETROPAD_CORE_PREFIX ( input_poll_cb  )
static

◆ NETRETROPAD_CORE_PREFIX() [7/7]

static retro_input_state_t NETRETROPAD_CORE_PREFIX ( input_state_cb  )
static

◆ retro_api_version()

unsigned NETRETROPAD_CORE_PREFIX() retro_api_version ( void  )

◆ retro_cheat_reset()

void NETRETROPAD_CORE_PREFIX() retro_cheat_reset ( void  )

◆ retro_cheat_set()

void NETRETROPAD_CORE_PREFIX() retro_cheat_set ( unsigned  idx,
bool  enabled,
const char *  code 
)
Here is the call graph for this function:

◆ retro_deinit()

void NETRETROPAD_CORE_PREFIX() retro_deinit ( void  )
Here is the call graph for this function:

◆ retro_get_memory_data()

void* NETRETROPAD_CORE_PREFIX() retro_get_memory_data ( unsigned  id)
Here is the call graph for this function:

◆ retro_get_memory_size()

size_t NETRETROPAD_CORE_PREFIX() retro_get_memory_size ( unsigned  id)
Here is the call graph for this function:

◆ retro_get_region()

unsigned NETRETROPAD_CORE_PREFIX() retro_get_region ( void  )

◆ retro_get_system_av_info()

void NETRETROPAD_CORE_PREFIX() retro_get_system_av_info ( struct retro_system_av_info info)

◆ retro_get_system_info()

void NETRETROPAD_CORE_PREFIX() retro_get_system_info ( struct retro_system_info info)
Here is the call graph for this function:

◆ retro_init()

void NETRETROPAD_CORE_PREFIX() retro_init ( void  )
Here is the call graph for this function:

◆ retro_load_game()

bool NETRETROPAD_CORE_PREFIX() retro_load_game ( const struct retro_game_info info)
Here is the call graph for this function:

◆ retro_load_game_special()

bool NETRETROPAD_CORE_PREFIX() retro_load_game_special ( unsigned  type,
const struct retro_game_info info,
size_t  num 
)
Here is the call graph for this function:

◆ retro_reset()

void NETRETROPAD_CORE_PREFIX() retro_reset ( void  )

◆ retro_run()

void NETRETROPAD_CORE_PREFIX() retro_run ( void  )
Here is the call graph for this function:

◆ retro_serialize()

bool NETRETROPAD_CORE_PREFIX() retro_serialize ( void data,
size_t  size 
)
Here is the call graph for this function:

◆ retro_serialize_size()

size_t NETRETROPAD_CORE_PREFIX() retro_serialize_size ( void  )

◆ retro_set_audio_sample()

void NETRETROPAD_CORE_PREFIX() retro_set_audio_sample ( retro_audio_sample_t  cb)

◆ retro_set_audio_sample_batch()

void NETRETROPAD_CORE_PREFIX() retro_set_audio_sample_batch ( retro_audio_sample_batch_t  cb)

◆ retro_set_controller_port_device()

void NETRETROPAD_CORE_PREFIX() retro_set_controller_port_device ( unsigned  port,
unsigned  device 
)
Here is the call graph for this function:

◆ retro_set_environment()

void NETRETROPAD_CORE_PREFIX() retro_set_environment ( retro_environment_t  cb)

◆ retro_set_input_poll()

void NETRETROPAD_CORE_PREFIX() retro_set_input_poll ( retro_input_poll_t  cb)

◆ retro_set_input_state()

void NETRETROPAD_CORE_PREFIX() retro_set_input_state ( retro_input_state_t  cb)

◆ retro_set_video_refresh()

void NETRETROPAD_CORE_PREFIX() retro_set_video_refresh ( retro_video_refresh_t  cb)

◆ retro_unload_game()

void NETRETROPAD_CORE_PREFIX() retro_unload_game ( void  )

◆ retro_unserialize()

bool NETRETROPAD_CORE_PREFIX() retro_unserialize ( const void data,
size_t  size 
)
Here is the call graph for this function:

◆ retropad_update_input()

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

Variable Documentation

◆ analog

struct descriptor analog
static
Initial value:
= {
.port_min = 0,
.port_max = 0,
}
#define RETRO_DEVICE_ID_ANALOG_X
Definition: libretro.h:209
#define RETRO_DEVICE_ID_ANALOG_Y
Definition: libretro.h:210
#define RETRO_DEVICE_INDEX_ANALOG_RIGHT
Definition: libretro.h:207
#define RETRO_DEVICE_ANALOG
Definition: libretro.h:149
#define RETRO_DEVICE_INDEX_ANALOG_LEFT
Definition: libretro.h:206

◆ descriptors

struct descriptor* descriptors[]
static
Initial value:
= {
}
static struct descriptor joypad
Definition: net_retropad_core.c:88
static struct descriptor analog
Definition: net_retropad_core.c:98

◆ frame_buf

uint16_t* frame_buf
static

◆ joypad

struct descriptor joypad
static
Initial value:
= {
.port_min = 0,
.port_max = 0,
.index_min = 0,
.index_max = 0,
}
#define RETRO_DEVICE_ID_JOYPAD_R3
Definition: libretro.h:203
#define RETRO_DEVICE_ID_JOYPAD_B
Definition: libretro.h:188
#define RETRO_DEVICE_JOYPAD
Definition: libretro.h:110

◆ logger

struct retro_log_callback logger
static

◆ port

int port
static

◆ s

int s
static

◆ server

char server[64]
static

◆ si_other

struct sockaddr_in si_other
static