Fix style nits.
This commit is contained in:
parent
95636d4f04
commit
0f010cf3d2
|
@ -49,7 +49,7 @@ static bool find_float_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* __alsa_init(const char* device, unsigned rate, unsigned latency)
|
static void *__alsa_init(const char *device, unsigned rate, unsigned latency)
|
||||||
{
|
{
|
||||||
alsa_t *alsa = calloc(1, sizeof(alsa_t));
|
alsa_t *alsa = calloc(1, sizeof(alsa_t));
|
||||||
if (!alsa)
|
if (!alsa)
|
||||||
|
|
|
@ -95,7 +95,7 @@ static OSStatus audio_cb(void *userdata, AudioUnitRenderActionFlags *action_flag
|
||||||
return noErr;
|
return noErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* coreaudio_init(const char* device, unsigned rate, unsigned latency)
|
static void *coreaudio_init(const char *device, unsigned rate, unsigned latency)
|
||||||
{
|
{
|
||||||
(void)device;
|
(void)device;
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ error:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t coreaudio_write(void* data, const void* buf_, size_t size)
|
static ssize_t coreaudio_write(void *data, const void *buf_, size_t size)
|
||||||
{
|
{
|
||||||
coreaudio_t *dev = data;
|
coreaudio_t *dev = data;
|
||||||
|
|
||||||
|
|
|
@ -249,7 +249,7 @@ static void dsound_free(void *data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* dsound_init(const char *device, unsigned rate, unsigned latency)
|
static void *dsound_init(const char *device, unsigned rate, unsigned latency)
|
||||||
{
|
{
|
||||||
dsound_t *ds = calloc(1, sizeof(*ds));
|
dsound_t *ds = calloc(1, sizeof(*ds));
|
||||||
if (!ds)
|
if (!ds)
|
||||||
|
|
|
@ -45,7 +45,7 @@ static void audio_ext_free(void *data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* audio_ext_init(const char *device, unsigned rate, unsigned latency)
|
static void *audio_ext_init(const char *device, unsigned rate, unsigned latency)
|
||||||
{
|
{
|
||||||
if (!(*g_settings.audio.external_driver))
|
if (!(*g_settings.audio.external_driver))
|
||||||
{
|
{
|
||||||
|
|
|
@ -61,7 +61,7 @@ typedef struct ssnes_audio_driver_info
|
||||||
typedef struct ssnes_audio_driver
|
typedef struct ssnes_audio_driver
|
||||||
{
|
{
|
||||||
// Initializes the device.
|
// Initializes the device.
|
||||||
void* (*init)(const ssnes_audio_driver_info_t *info);
|
void *(*init)(const ssnes_audio_driver_info_t *info);
|
||||||
|
|
||||||
// Write data in buffer to audio driver.
|
// Write data in buffer to audio driver.
|
||||||
// A frame here is defined as one combined sample of left and right
|
// A frame here is defined as one combined sample of left and right
|
||||||
|
|
|
@ -87,7 +87,7 @@ typedef struct ssnes_dsp_input
|
||||||
typedef struct ssnes_dsp_plugin
|
typedef struct ssnes_dsp_plugin
|
||||||
{
|
{
|
||||||
// Creates a handle of the plugin. Returns NULL if failed.
|
// Creates a handle of the plugin. Returns NULL if failed.
|
||||||
void* (*init)(const ssnes_dsp_info_t *info);
|
void *(*init)(const ssnes_dsp_info_t *info);
|
||||||
|
|
||||||
// Processes input data.
|
// Processes input data.
|
||||||
// The plugin is allowed to return variable sizes for output data.
|
// The plugin is allowed to return variable sizes for output data.
|
||||||
|
|
|
@ -207,7 +207,7 @@ static void generate_filter_coeffs(float * restrict fir_out, float * restrict ii
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void* dsp_init(const ssnes_dsp_info_t *info)
|
static void *dsp_init(const ssnes_dsp_info_t *info)
|
||||||
{
|
{
|
||||||
(void)info;
|
(void)info;
|
||||||
dsp_state *state = calloc(1, sizeof(*state));
|
dsp_state *state = calloc(1, sizeof(*state));
|
||||||
|
|
|
@ -124,7 +124,7 @@ static size_t find_buffersize(jack_t *jd, int latency)
|
||||||
return buffer_frames * sizeof(jack_default_audio_sample_t);
|
return buffer_frames * sizeof(jack_default_audio_sample_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* __jack_init(const char* device, unsigned rate, unsigned latency)
|
static void *__jack_init(const char *device, unsigned rate, unsigned latency)
|
||||||
{
|
{
|
||||||
jack_t *jd = calloc(1, sizeof(jack_t));
|
jack_t *jd = calloc(1, sizeof(jack_t));
|
||||||
if (!jd)
|
if (!jd)
|
||||||
|
@ -246,7 +246,7 @@ static size_t write_buffer(jack_t *jd, const float *buf, size_t size)
|
||||||
return written * sizeof(float) * 2;
|
return written * sizeof(float) * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t __jack_write(void* data, const void* buf, size_t size)
|
static ssize_t __jack_write(void *data, const void *buf, size_t size)
|
||||||
{
|
{
|
||||||
jack_t *jd = data;
|
jack_t *jd = data;
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ typedef struct al
|
||||||
|
|
||||||
} al_t;
|
} al_t;
|
||||||
|
|
||||||
static void* __al_init(const char* device, unsigned rate, unsigned latency)
|
static void *__al_init(const char *device, unsigned rate, unsigned latency)
|
||||||
{
|
{
|
||||||
(void)device;
|
(void)device;
|
||||||
al_t *al = calloc(1, sizeof(al_t));
|
al_t *al = calloc(1, sizeof(al_t));
|
||||||
|
@ -153,7 +153,7 @@ static bool al_get_buffer(al_t *al, ALuint *buffer)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t al_fill_internal_buf(al_t *al, const void* buf, size_t size)
|
static size_t al_fill_internal_buf(al_t *al, const void *buf, size_t size)
|
||||||
{
|
{
|
||||||
size_t read_size = (BUFSIZE - al->tmpbuf_ptr > size) ? size : (BUFSIZE - al->tmpbuf_ptr);
|
size_t read_size = (BUFSIZE - al->tmpbuf_ptr > size) ? size : (BUFSIZE - al->tmpbuf_ptr);
|
||||||
memcpy(al->tmpbuf + al->tmpbuf_ptr, buf, read_size);
|
memcpy(al->tmpbuf + al->tmpbuf_ptr, buf, read_size);
|
||||||
|
@ -161,7 +161,7 @@ static size_t al_fill_internal_buf(al_t *al, const void* buf, size_t size)
|
||||||
return read_size;
|
return read_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t __al_write(void* data, const void* buf, size_t size)
|
static ssize_t __al_write(void *data, const void *buf, size_t size)
|
||||||
{
|
{
|
||||||
al_t *al = data;
|
al_t *al = data;
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#define DEFAULT_OSS_DEV "/dev/dsp"
|
#define DEFAULT_OSS_DEV "/dev/dsp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void* __oss_init(const char* device, unsigned rate, unsigned latency)
|
static void *__oss_init(const char *device, unsigned rate, unsigned latency)
|
||||||
{
|
{
|
||||||
int *fd = calloc(1, sizeof(int));
|
int *fd = calloc(1, sizeof(int));
|
||||||
if (fd == NULL)
|
if (fd == NULL)
|
||||||
|
@ -96,7 +96,7 @@ static void* __oss_init(const char* device, unsigned rate, unsigned latency)
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t __oss_write(void* data, const void* buf, size_t size)
|
static ssize_t __oss_write(void *data, const void *buf, size_t size)
|
||||||
{
|
{
|
||||||
int *fd = data;
|
int *fd = data;
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ static void stream_latency_update_cb(pa_stream *s, void *data)
|
||||||
pa_threaded_mainloop_signal(pa->mainloop, 0);
|
pa_threaded_mainloop_signal(pa->mainloop, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* __pulse_init(const char* device, unsigned rate, unsigned latency)
|
static void *__pulse_init(const char *device, unsigned rate, unsigned latency)
|
||||||
{
|
{
|
||||||
pa_t *pa = calloc(1, sizeof(*pa));
|
pa_t *pa = calloc(1, sizeof(*pa));
|
||||||
if (!pa)
|
if (!pa)
|
||||||
|
@ -172,7 +172,7 @@ error:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t __pulse_write(void* data, const void* buf, size_t size)
|
static ssize_t __pulse_write(void *data, const void *buf, size_t size)
|
||||||
{
|
{
|
||||||
pa_t *pa = data;
|
pa_t *pa = data;
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ typedef struct
|
||||||
bool nonblocking;
|
bool nonblocking;
|
||||||
} roar_t;
|
} roar_t;
|
||||||
|
|
||||||
static void* __roar_init(const char* device, unsigned rate, unsigned latency)
|
static void *__roar_init(const char *device, unsigned rate, unsigned latency)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
roar_t *roar = calloc(1, sizeof(roar_t));
|
roar_t *roar = calloc(1, sizeof(roar_t));
|
||||||
|
@ -51,7 +51,7 @@ static void* __roar_init(const char* device, unsigned rate, unsigned latency)
|
||||||
return roar;
|
return roar;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t __roar_write(void* data, const void* buf, size_t size)
|
static ssize_t __roar_write(void *data, const void *buf, size_t size)
|
||||||
{
|
{
|
||||||
roar_t *roar = data;
|
roar_t *roar = data;
|
||||||
ssize_t rc;
|
ssize_t rc;
|
||||||
|
|
|
@ -54,7 +54,7 @@ static void err_cb(void *userdata)
|
||||||
SDL_CondSignal(rsd->cond);
|
SDL_CondSignal(rsd->cond);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* __rsd_init(const char* device, unsigned rate, unsigned latency)
|
static void *__rsd_init(const char *device, unsigned rate, unsigned latency)
|
||||||
{
|
{
|
||||||
rsd_t *rsd = calloc(1, sizeof(rsd_t));
|
rsd_t *rsd = calloc(1, sizeof(rsd_t));
|
||||||
if (!rsd)
|
if (!rsd)
|
||||||
|
@ -98,7 +98,7 @@ static void* __rsd_init(const char* device, unsigned rate, unsigned latency)
|
||||||
return rsd;
|
return rsd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t __rsd_write(void* data, const void* buf, size_t size)
|
static ssize_t __rsd_write(void *data, const void *buf, size_t size)
|
||||||
{
|
{
|
||||||
rsd_t *rsd = data;
|
rsd_t *rsd = data;
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ static inline int find_num_frames(int rate, int latency)
|
||||||
return next_pow2(frames);
|
return next_pow2(frames);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* sdl_audio_init(const char* device, unsigned rate, unsigned latency)
|
static void *sdl_audio_init(const char *device, unsigned rate, unsigned latency)
|
||||||
{
|
{
|
||||||
(void)device;
|
(void)device;
|
||||||
if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
|
if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
|
||||||
|
@ -109,7 +109,7 @@ static void* sdl_audio_init(const char* device, unsigned rate, unsigned latency)
|
||||||
return sdl;
|
return sdl;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t sdl_audio_write(void* data, const void* buf, size_t size)
|
static ssize_t sdl_audio_write(void *data, const void *buf, size_t size)
|
||||||
{
|
{
|
||||||
sdl_audio_t *sdl = data;
|
sdl_audio_t *sdl = data;
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ typedef struct XAUDIO2_BUFFER
|
||||||
UINT32 LoopBegin;
|
UINT32 LoopBegin;
|
||||||
UINT32 LoopLength;
|
UINT32 LoopLength;
|
||||||
UINT32 LoopCount;
|
UINT32 LoopCount;
|
||||||
void* pContext;
|
void *pContext;
|
||||||
} XAUDIO2_BUFFER;
|
} XAUDIO2_BUFFER;
|
||||||
|
|
||||||
typedef struct XAUDIO2_BUFFER_WMA
|
typedef struct XAUDIO2_BUFFER_WMA
|
||||||
|
@ -157,7 +157,7 @@ typedef struct XAUDIO2_BUFFER_WMA
|
||||||
|
|
||||||
typedef struct XAUDIO2_VOICE_STATE
|
typedef struct XAUDIO2_VOICE_STATE
|
||||||
{
|
{
|
||||||
void* pCurrentBufferContext;
|
void *pCurrentBufferContext;
|
||||||
UINT32 BuffersQueued;
|
UINT32 BuffersQueued;
|
||||||
UINT64 SamplesPlayed;
|
UINT64 SamplesPlayed;
|
||||||
} XAUDIO2_VOICE_STATE;
|
} XAUDIO2_VOICE_STATE;
|
||||||
|
@ -201,10 +201,10 @@ DECLARE_INTERFACE(IXAudio2VoiceCallback)
|
||||||
STDMETHOD_(void, OnVoiceProcessingPassStart) (THIS_ UINT32 BytesRequired) PURE;
|
STDMETHOD_(void, OnVoiceProcessingPassStart) (THIS_ UINT32 BytesRequired) PURE;
|
||||||
STDMETHOD_(void, OnVoiceProcessingPassEnd) (THIS) PURE;
|
STDMETHOD_(void, OnVoiceProcessingPassEnd) (THIS) PURE;
|
||||||
STDMETHOD_(void, OnStreamEnd) (THIS) PURE;
|
STDMETHOD_(void, OnStreamEnd) (THIS) PURE;
|
||||||
STDMETHOD_(void, OnBufferStart) (THIS_ void* pBufferContext) PURE;
|
STDMETHOD_(void, OnBufferStart) (THIS_ void *pBufferContext) PURE;
|
||||||
STDMETHOD_(void, OnBufferEnd) (THIS_ void* pBufferContext) PURE;
|
STDMETHOD_(void, OnBufferEnd) (THIS_ void *pBufferContext) PURE;
|
||||||
STDMETHOD_(void, OnLoopEnd) (THIS_ void* pBufferContext) PURE;
|
STDMETHOD_(void, OnLoopEnd) (THIS_ void *pBufferContext) PURE;
|
||||||
STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) PURE;
|
STDMETHOD_(void, OnVoiceError) (THIS_ void *pBufferContext, HRESULT Error) PURE;
|
||||||
};
|
};
|
||||||
|
|
||||||
DECLARE_INTERFACE(IXAudio2Voice)
|
DECLARE_INTERFACE(IXAudio2Voice)
|
||||||
|
@ -219,10 +219,10 @@ DECLARE_INTERFACE(IXAudio2Voice)
|
||||||
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
|
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
|
||||||
STDMETHOD_(void, GetEffectState) (THIS_ UINT32 EffectIndex, BOOL* pEnabled) PURE; \
|
STDMETHOD_(void, GetEffectState) (THIS_ UINT32 EffectIndex, BOOL* pEnabled) PURE; \
|
||||||
STDMETHOD(SetEffectParameters) (THIS_ UINT32 EffectIndex, \
|
STDMETHOD(SetEffectParameters) (THIS_ UINT32 EffectIndex, \
|
||||||
const void* pParameters, \
|
const void *pParameters, \
|
||||||
UINT32 ParametersByteSize, \
|
UINT32 ParametersByteSize, \
|
||||||
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
|
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
|
||||||
STDMETHOD(GetEffectParameters) (THIS_ UINT32 EffectIndex, void* pParameters, \
|
STDMETHOD(GetEffectParameters) (THIS_ UINT32 EffectIndex, void *pParameters, \
|
||||||
UINT32 ParametersByteSize) PURE; \
|
UINT32 ParametersByteSize) PURE; \
|
||||||
STDMETHOD(SetFilterParameters) (THIS_ const XAUDIO2_FILTER_PARAMETERS* pParameters, \
|
STDMETHOD(SetFilterParameters) (THIS_ const XAUDIO2_FILTER_PARAMETERS* pParameters, \
|
||||||
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
|
UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
|
||||||
|
@ -304,7 +304,7 @@ DECLARE_INTERFACE_(IXAudio2, IUnknown)
|
||||||
STDMETHOD(CommitChanges) (THIS_ UINT32 OperationSet) PURE;
|
STDMETHOD(CommitChanges) (THIS_ UINT32 OperationSet) PURE;
|
||||||
STDMETHOD_(void, GetPerformanceData) (THIS_ XAUDIO2_PERFORMANCE_DATA* pPerfData) PURE;
|
STDMETHOD_(void, GetPerformanceData) (THIS_ XAUDIO2_PERFORMANCE_DATA* pPerfData) PURE;
|
||||||
STDMETHOD_(void, SetDebugConfiguration) (THIS_ const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
|
STDMETHOD_(void, SetDebugConfiguration) (THIS_ const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
|
||||||
void* pReserved X2DEFAULT(NULL)) PURE;
|
void *pReserved X2DEFAULT(NULL)) PURE;
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline HRESULT XAudio2Create(IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0),
|
static inline HRESULT XAudio2Create(IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0),
|
||||||
|
|
|
@ -26,7 +26,7 @@ typedef struct
|
||||||
bool nonblock;
|
bool nonblock;
|
||||||
} xa_t;
|
} xa_t;
|
||||||
|
|
||||||
static void* __xa_init(const char* device, unsigned rate, unsigned latency)
|
static void *__xa_init(const char *device, unsigned rate, unsigned latency)
|
||||||
{
|
{
|
||||||
if (latency < 8)
|
if (latency < 8)
|
||||||
latency = 8; // Do not allow shenanigans.
|
latency = 8; // Do not allow shenanigans.
|
||||||
|
@ -49,7 +49,7 @@ static void* __xa_init(const char* device, unsigned rate, unsigned latency)
|
||||||
return xa;
|
return xa;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t __xa_write(void* data, const void* buf, size_t size)
|
static ssize_t __xa_write(void *data, const void *buf, size_t size)
|
||||||
{
|
{
|
||||||
xa_t *xa = data;
|
xa_t *xa = data;
|
||||||
if (xa->nonblock)
|
if (xa->nonblock)
|
||||||
|
|
2
cheats.c
2
cheats.c
|
@ -51,7 +51,7 @@ struct cheat_manager
|
||||||
unsigned buf_size;
|
unsigned buf_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
static char* strcat_alloc(char *dest, const char *input)
|
static char *strcat_alloc(char *dest, const char *input)
|
||||||
{
|
{
|
||||||
size_t dest_len = dest ? strlen(dest) : 0;
|
size_t dest_len = dest ? strlen(dest) : 0;
|
||||||
size_t input_len = strlen(input);
|
size_t input_len = strlen(input);
|
||||||
|
|
|
@ -89,7 +89,7 @@ static char *getaline(FILE *file)
|
||||||
return newline;
|
return newline;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char* extract_value(char *line, bool is_value)
|
static char *extract_value(char *line, bool is_value)
|
||||||
{
|
{
|
||||||
if (is_value)
|
if (is_value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -174,7 +174,7 @@ static const float in_rate = 31980.0;
|
||||||
static const float audio_rate_step = 0.25;
|
static const float audio_rate_step = 0.25;
|
||||||
|
|
||||||
// Audio device (e.g. hw:0,0 or /dev/audio). If NULL, will use defaults.
|
// Audio device (e.g. hw:0,0 or /dev/audio). If NULL, will use defaults.
|
||||||
static const char* audio_device = NULL;
|
static const char *audio_device = NULL;
|
||||||
|
|
||||||
// Desired audio latency in milliseconds. Might not be honored if driver can't provide given latency.
|
// Desired audio latency in milliseconds. Might not be honored if driver can't provide given latency.
|
||||||
static const int out_latency = 64;
|
static const int out_latency = 64;
|
||||||
|
|
|
@ -259,7 +259,7 @@ function_t dylib_proc(dylib_t lib, const char *proc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dirty hack to workaround the non-legality of void* -> fn-pointer casts.
|
// Dirty hack to workaround the non-legality of void *-> fn-pointer casts.
|
||||||
function_t sym;
|
function_t sym;
|
||||||
memcpy(&sym, &ptr_sym, sizeof(void*));
|
memcpy(&sym, &ptr_sym, sizeof(void*));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -41,7 +41,7 @@ extern void (*psnes_set_input_state)(snes_input_state_t);
|
||||||
extern void (*psnes_cheat_reset)(void);
|
extern void (*psnes_cheat_reset)(void);
|
||||||
extern void (*psnes_cheat_set)(unsigned, bool, const char*);
|
extern void (*psnes_cheat_set)(unsigned, bool, const char*);
|
||||||
|
|
||||||
extern const char* (*psnes_library_id)(void);
|
extern const char *(*psnes_library_id)(void);
|
||||||
extern unsigned (*psnes_library_revision_minor)(void);
|
extern unsigned (*psnes_library_revision_minor)(void);
|
||||||
extern unsigned (*psnes_library_revision_major)(void);
|
extern unsigned (*psnes_library_revision_major)(void);
|
||||||
|
|
||||||
|
|
2
file.c
2
file.c
|
@ -531,7 +531,7 @@ void save_ram_file(const char *path, int type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static char* load_xml_map(const char *path)
|
static char *load_xml_map(const char *path)
|
||||||
{
|
{
|
||||||
char *xml_buf = NULL;
|
char *xml_buf = NULL;
|
||||||
if (*path)
|
if (*path)
|
||||||
|
|
|
@ -181,20 +181,20 @@ typedef struct ssnes_input_driver
|
||||||
// The range of this is [0, 1],
|
// The range of this is [0, 1],
|
||||||
// where 0 means any displacement will register,
|
// where 0 means any displacement will register,
|
||||||
// and 1 means the axis has to be pressed all the way to register.
|
// and 1 means the axis has to be pressed all the way to register.
|
||||||
void* (*init)(const int joypad_index[5], float axis_threshold);
|
void *(*init)(const int joypad_index[5], float axis_threshold);
|
||||||
|
|
||||||
// Polls input. Called once every frame.
|
// Polls input. Called once every frame.
|
||||||
void (*poll)(void* data);
|
void (*poll)(void *data);
|
||||||
|
|
||||||
// Queries input state for a certain key on a certain player.
|
// Queries input state for a certain key on a certain player.
|
||||||
// Players are 1 - 5.
|
// Players are 1 - 5.
|
||||||
// For digital inputs, pressed key is 1, not pressed key is 0.
|
// For digital inputs, pressed key is 1, not pressed key is 0.
|
||||||
// Analog values have same range as a signed 16-bit integer.
|
// Analog values have same range as a signed 16-bit integer.
|
||||||
int (*input_state)(void* data, const struct ssnes_keybind *bind,
|
int (*input_state)(void *data, const struct ssnes_keybind *bind,
|
||||||
unsigned player);
|
unsigned player);
|
||||||
|
|
||||||
// Frees the input struct.
|
// Frees the input struct.
|
||||||
void (*free)(void* data);
|
void (*free)(void *data);
|
||||||
|
|
||||||
// Human readable indentification string.
|
// Human readable indentification string.
|
||||||
const char *ident;
|
const char *ident;
|
||||||
|
@ -208,7 +208,7 @@ typedef struct ssnes_video_driver
|
||||||
// Should the video driver request that a certain input driver is used,
|
// Should the video driver request that a certain input driver is used,
|
||||||
// it is possible to set the driver to *input.
|
// it is possible to set the driver to *input.
|
||||||
// If no certain driver is desired, set *input to NULL.
|
// If no certain driver is desired, set *input to NULL.
|
||||||
void* (*init)(const ssnes_video_info_t *video,
|
void *(*init)(const ssnes_video_info_t *video,
|
||||||
const ssnes_input_driver_t **input);
|
const ssnes_input_driver_t **input);
|
||||||
|
|
||||||
// Updates frame on the screen.
|
// Updates frame on the screen.
|
||||||
|
@ -218,13 +218,13 @@ typedef struct ssnes_video_driver
|
||||||
//
|
//
|
||||||
// When msg is non-NULL,
|
// When msg is non-NULL,
|
||||||
// it's a message that should be displayed to the user.
|
// it's a message that should be displayed to the user.
|
||||||
int (*frame)(void* data, const void* frame,
|
int (*frame)(void *data, const void *frame,
|
||||||
unsigned width, unsigned height, unsigned pitch, const char *msg);
|
unsigned width, unsigned height, unsigned pitch, const char *msg);
|
||||||
|
|
||||||
// Requests nonblocking operation.
|
// Requests nonblocking operation.
|
||||||
// True = VSync is turned off.
|
// True = VSync is turned off.
|
||||||
// False = VSync is turned on.
|
// False = VSync is turned on.
|
||||||
void (*set_nonblock_state)(void* data, int toggle);
|
void (*set_nonblock_state)(void *data, int toggle);
|
||||||
|
|
||||||
// This must return false when the user exits the emulator.
|
// This must return false when the user exits the emulator.
|
||||||
int (*alive)(void *data);
|
int (*alive)(void *data);
|
||||||
|
@ -233,7 +233,7 @@ typedef struct ssnes_video_driver
|
||||||
int (*focus)(void *data);
|
int (*focus)(void *data);
|
||||||
|
|
||||||
// Frees the video driver.
|
// Frees the video driver.
|
||||||
void (*free)(void* data);
|
void (*free)(void *data);
|
||||||
|
|
||||||
// A human-readable identification of the video driver.
|
// A human-readable identification of the video driver.
|
||||||
const char *ident;
|
const char *ident;
|
||||||
|
|
4
gfx/gl.c
4
gfx/gl.c
|
@ -847,7 +847,7 @@ static void check_window(gl_t *gl)
|
||||||
gl->should_resize = true;
|
gl->should_resize = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gl_frame(void *data, const void* frame, unsigned width, unsigned height, unsigned pitch, const char *msg)
|
static bool gl_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg)
|
||||||
{
|
{
|
||||||
gl_t *gl = data;
|
gl_t *gl = data;
|
||||||
|
|
||||||
|
@ -1150,7 +1150,7 @@ static void gl_set_nonblock_state(void *data, bool state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* gl_init(const video_info_t *video, const input_driver_t **input, void **input_data)
|
static void *gl_init(const video_info_t *video, const input_driver_t **input, void **input_data)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
gfx_set_dwm();
|
gfx_set_dwm();
|
||||||
|
|
|
@ -200,7 +200,7 @@ static char *dupe_newline(const char *str)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Need to make sure that first-line indentation is 0. :(
|
// Need to make sure that first-line indentation is 0. :(
|
||||||
static char* align_program(const char *program)
|
static char *align_program(const char *program)
|
||||||
{
|
{
|
||||||
char *prog = strdup(program);
|
char *prog = strdup(program);
|
||||||
if (!prog)
|
if (!prog)
|
||||||
|
|
|
@ -244,7 +244,7 @@ static void sdl_render_msg_32(sdl_video_t *vid, SDL_Surface *buffer, const char
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* sdl_gfx_init(const video_info_t *video, const input_driver_t **input, void **input_data)
|
static void *sdl_gfx_init(const video_info_t *video, const input_driver_t **input, void **input_data)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
gfx_set_dwm();
|
gfx_set_dwm();
|
||||||
|
@ -464,7 +464,7 @@ static void check_window(sdl_video_t *vid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool sdl_gfx_frame(void *data, const void* frame, unsigned width, unsigned height, unsigned pitch, const char *msg)
|
static bool sdl_gfx_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg)
|
||||||
{
|
{
|
||||||
sdl_video_t *vid = data;
|
sdl_video_t *vid = data;
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#define SDL_MODERN 0
|
#define SDL_MODERN 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Not legal to cast void* to fn-pointer. Need workaround to be compliant.
|
// Not legal to cast void *to fn-pointer. Need workaround to be compliant.
|
||||||
#define SDL_SYM_WRAP(sym, symbol) { \
|
#define SDL_SYM_WRAP(sym, symbol) { \
|
||||||
assert(sizeof(void*) == sizeof(void (*)(void))); \
|
assert(sizeof(void*) == sizeof(void (*)(void))); \
|
||||||
void *sym__ = SDL_GL_GetProcAddress(symbol); \
|
void *sym__ = SDL_GL_GetProcAddress(symbol); \
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
//#define SSNES_CG_DEBUG
|
//#define SSNES_CG_DEBUG
|
||||||
|
|
||||||
// Used when we call deactivate() since just unbinding the program didn't seem to work... :(
|
// Used when we call deactivate() since just unbinding the program didn't seem to work... :(
|
||||||
static const char* stock_cg_program =
|
static const char *stock_cg_program =
|
||||||
"void main_vertex"
|
"void main_vertex"
|
||||||
"("
|
"("
|
||||||
" float4 position : POSITION,"
|
" float4 position : POSITION,"
|
||||||
|
|
|
@ -693,7 +693,7 @@ static void xv_render_msg(xv_t *xv, const char *msg, unsigned width, unsigned he
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool xv_frame(void *data, const void* frame, unsigned width, unsigned height, unsigned pitch, const char *msg)
|
static bool xv_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg)
|
||||||
{
|
{
|
||||||
xv_t *xv = data;
|
xv_t *xv = data;
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ static void init_lut(void)
|
||||||
keysym_lut[lut_binds[i].sk] = lut_binds[i].sdl;
|
keysym_lut[lut_binds[i].sk] = lut_binds[i].sdl;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* sdl_input_init(void)
|
static void *sdl_input_init(void)
|
||||||
{
|
{
|
||||||
init_lut();
|
init_lut();
|
||||||
sdl_input_t *sdl = calloc(1, sizeof(*sdl));
|
sdl_input_t *sdl = calloc(1, sizeof(*sdl));
|
||||||
|
|
|
@ -133,7 +133,7 @@ static void init_lut(void)
|
||||||
keysym_lut[lut_binds[i].sk] = lut_binds[i].x;
|
keysym_lut[lut_binds[i].sk] = lut_binds[i].x;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* x_input_init(void)
|
static void *x_input_init(void)
|
||||||
{
|
{
|
||||||
x11_input_t *x11 = calloc(1, sizeof(*x11));
|
x11_input_t *x11 = calloc(1, sizeof(*x11));
|
||||||
if (!x11)
|
if (!x11)
|
||||||
|
|
Loading…
Reference in New Issue