mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 17:43:02 +00:00
Style nits/cleanups
This commit is contained in:
parent
c699e47534
commit
cb0653137f
@ -238,18 +238,14 @@ static void mic_driver_microphone_handle_free(retro_microphone_t *microphone, bo
|
|||||||
microphone->resampler = NULL;
|
microphone->resampler = NULL;
|
||||||
microphone->resampler_data = NULL;
|
microphone->resampler_data = NULL;
|
||||||
|
|
||||||
|
/* If the mic driver is being reset and the microphone was already valid... */
|
||||||
if ((microphone->flags & MICROPHONE_FLAG_ACTIVE) && is_reset)
|
if ((microphone->flags & MICROPHONE_FLAG_ACTIVE) && is_reset)
|
||||||
{ /* If the mic driver is being reset and the microphone was already valid... */
|
|
||||||
|
|
||||||
microphone->flags |= MICROPHONE_FLAG_PENDING;
|
microphone->flags |= MICROPHONE_FLAG_PENDING;
|
||||||
/* ...then we need to keep the handle itself valid
|
/* ...then we need to keep the handle itself valid
|
||||||
* so it can be reinitialized.
|
* so it can be reinitialized.
|
||||||
* Otherwise the core will lose mic input. */
|
* Otherwise the core will lose mic input. */
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
memset(microphone, 0, sizeof(*microphone));
|
memset(microphone, 0, sizeof(*microphone));
|
||||||
}
|
|
||||||
/* Do NOT free the microphone handle itself! It's allocated statically! */
|
/* Do NOT free the microphone handle itself! It's allocated statically! */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,8 +264,9 @@ bool microphone_driver_init_internal(void *settings_data)
|
|||||||
bool verbosity_enabled = verbosity_is_enabled();
|
bool verbosity_enabled = verbosity_is_enabled();
|
||||||
size_t max_frames = AUDIO_CHUNK_SIZE_NONBLOCKING * AUDIO_MAX_RATIO;
|
size_t max_frames = AUDIO_CHUNK_SIZE_NONBLOCKING * AUDIO_MAX_RATIO;
|
||||||
|
|
||||||
|
/* If the user has mic support turned off... */
|
||||||
if (!settings->bools.microphone_enable)
|
if (!settings->bools.microphone_enable)
|
||||||
{ /* If the user has mic support turned off... */
|
{
|
||||||
mic_st->flags &= ~MICROPHONE_DRIVER_FLAG_ACTIVE;
|
mic_st->flags &= ~MICROPHONE_DRIVER_FLAG_ACTIVE;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -278,7 +275,7 @@ bool microphone_driver_init_internal(void *settings_data)
|
|||||||
convert_float_to_s16_init_simd();
|
convert_float_to_s16_init_simd();
|
||||||
|
|
||||||
if (!(microphone_driver_find_driver(settings,
|
if (!(microphone_driver_find_driver(settings,
|
||||||
"microphone driver", verbosity_enabled)))
|
"microphone driver", verbosity_enabled)))
|
||||||
{
|
{
|
||||||
RARCH_ERR("[Microphone]: Failed to initialize microphone driver. Will continue without mic input.\n");
|
RARCH_ERR("[Microphone]: Failed to initialize microphone driver. Will continue without mic input.\n");
|
||||||
goto error;
|
goto error;
|
||||||
@ -318,8 +315,7 @@ bool microphone_driver_init_internal(void *settings_data)
|
|||||||
if (!mic_st->driver || !mic_st->driver->init)
|
if (!mic_st->driver || !mic_st->driver->init)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
mic_st->driver_context = mic_st->driver->init();
|
if (!(mic_st->driver_context = mic_st->driver->init()))
|
||||||
if (!mic_st->driver_context)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!string_is_empty(settings->arrays.microphone_resampler))
|
if (!string_is_empty(settings->arrays.microphone_resampler))
|
||||||
@ -392,10 +388,9 @@ static bool mic_driver_open_mic_internal(retro_microphone_t* microphone)
|
|||||||
microphone->actual_params.rate
|
microphone->actual_params.rate
|
||||||
);
|
);
|
||||||
|
|
||||||
if (mic_driver->mic_use_float && mic_driver->mic_use_float(mic_st->driver_context, microphone->microphone_context))
|
if ( mic_driver->mic_use_float
|
||||||
{
|
&& mic_driver->mic_use_float(mic_st->driver_context, microphone->microphone_context))
|
||||||
microphone->flags |= MICROPHONE_FLAG_USE_FLOAT;
|
microphone->flags |= MICROPHONE_FLAG_USE_FLOAT;
|
||||||
}
|
|
||||||
|
|
||||||
microphone->original_ratio = (double)microphone->effective_params.rate / microphone->actual_params.rate;
|
microphone->original_ratio = (double)microphone->effective_params.rate / microphone->actual_params.rate;
|
||||||
|
|
||||||
@ -425,13 +420,11 @@ static void microphone_driver_close_mic_internal(retro_microphone_t *microphone,
|
|||||||
const microphone_driver_t *mic_driver = mic_st->driver;
|
const microphone_driver_t *mic_driver = mic_st->driver;
|
||||||
void *driver_context = mic_st->driver_context;
|
void *driver_context = mic_st->driver_context;
|
||||||
|
|
||||||
if ( microphone &&
|
if ( microphone
|
||||||
driver_context &&
|
&& driver_context
|
||||||
mic_driver &&
|
&& mic_driver
|
||||||
mic_driver->close_mic)
|
&& mic_driver->close_mic)
|
||||||
{
|
|
||||||
mic_driver_microphone_handle_free(microphone, is_reset);
|
mic_driver_microphone_handle_free(microphone, is_reset);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void microphone_driver_close_mic(retro_microphone_t *microphone)
|
void microphone_driver_close_mic(retro_microphone_t *microphone)
|
||||||
@ -453,11 +446,14 @@ bool microphone_driver_set_mic_state(retro_microphone_t *microphone, bool state)
|
|||||||
return false;
|
return false;
|
||||||
/* If the provided microphone was null or invalid, or the driver is incomplete, stop. */
|
/* If the provided microphone was null or invalid, or the driver is incomplete, stop. */
|
||||||
|
|
||||||
|
/* If the driver is initialized... */
|
||||||
if (driver_context && microphone->microphone_context)
|
if (driver_context && microphone->microphone_context)
|
||||||
{ /* If the driver is initialized... */
|
{
|
||||||
bool success;
|
bool success;
|
||||||
|
|
||||||
|
/* If we want to enable this mic... */
|
||||||
if (state)
|
if (state)
|
||||||
{ /* If we want to enable this mic... */
|
{
|
||||||
success = mic_driver->start_mic(driver_context, microphone->microphone_context);
|
success = mic_driver->start_mic(driver_context, microphone->microphone_context);
|
||||||
/* Enable the mic. (Enabling an active mic is a successful noop.) */
|
/* Enable the mic. (Enabling an active mic is a successful noop.) */
|
||||||
|
|
||||||
@ -474,8 +470,8 @@ bool microphone_driver_set_mic_state(retro_microphone_t *microphone, bool state)
|
|||||||
else
|
else
|
||||||
{ /* If we want to pause this mic... */
|
{ /* If we want to pause this mic... */
|
||||||
success = mic_driver->stop_mic(driver_context, microphone->microphone_context);
|
success = mic_driver->stop_mic(driver_context, microphone->microphone_context);
|
||||||
/* Disable the mic. (If the mic is already stopped, disabling it should still be successful.) */
|
|
||||||
|
|
||||||
|
/* Disable the mic. (If the mic is already stopped, disabling it should still be successful.) */
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
microphone->flags &= ~MICROPHONE_FLAG_ENABLED;
|
microphone->flags &= ~MICROPHONE_FLAG_ENABLED;
|
||||||
@ -493,13 +489,9 @@ bool microphone_driver_set_mic_state(retro_microphone_t *microphone, bool state)
|
|||||||
{ /* The driver's not ready yet, so we'll make a note
|
{ /* The driver's not ready yet, so we'll make a note
|
||||||
* of what the mic's state should be */
|
* of what the mic's state should be */
|
||||||
if (state)
|
if (state)
|
||||||
{
|
|
||||||
microphone->flags |= MICROPHONE_FLAG_ENABLED;
|
microphone->flags |= MICROPHONE_FLAG_ENABLED;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
microphone->flags &= ~MICROPHONE_FLAG_ENABLED;
|
microphone->flags &= ~MICROPHONE_FLAG_ENABLED;
|
||||||
}
|
|
||||||
|
|
||||||
RARCH_DBG("[Microphone]: Set pending state to %s.\n",
|
RARCH_DBG("[Microphone]: Set pending state to %s.\n",
|
||||||
state ? "enabled" : "disabled");
|
state ? "enabled" : "disabled");
|
||||||
@ -512,7 +504,6 @@ bool microphone_driver_get_mic_state(const retro_microphone_t *microphone)
|
|||||||
{
|
{
|
||||||
if (!microphone || !(microphone->flags & MICROPHONE_FLAG_ACTIVE))
|
if (!microphone || !(microphone->flags & MICROPHONE_FLAG_ACTIVE))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return microphone->flags & MICROPHONE_FLAG_ENABLED;
|
return microphone->flags & MICROPHONE_FLAG_ENABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -565,27 +556,25 @@ static size_t microphone_driver_flush(
|
|||||||
|
|
||||||
/* ...then skip the resampler, since it'll produce (more or less) identical results. */
|
/* ...then skip the resampler, since it'll produce (more or less) identical results. */
|
||||||
frames_to_enqueue = MIN(FIFO_WRITE_AVAIL(microphone->outgoing_samples), resampler_data.input_frames);
|
frames_to_enqueue = MIN(FIFO_WRITE_AVAIL(microphone->outgoing_samples), resampler_data.input_frames);
|
||||||
|
|
||||||
|
/* If this mic provides floating-point samples... */
|
||||||
if (microphone->flags & MICROPHONE_FLAG_USE_FLOAT)
|
if (microphone->flags & MICROPHONE_FLAG_USE_FLOAT)
|
||||||
{ /* If this mic provides floating-point samples... */
|
{
|
||||||
convert_float_to_s16(mic_st->final_frames, mic_st->input_frames, resampler_data.input_frames);
|
convert_float_to_s16(mic_st->final_frames, mic_st->input_frames, resampler_data.input_frames);
|
||||||
fifo_write(microphone->outgoing_samples, mic_st->final_frames, frames_to_enqueue * sizeof(int16_t));
|
fifo_write(microphone->outgoing_samples, mic_st->final_frames, frames_to_enqueue * sizeof(int16_t));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
fifo_write(microphone->outgoing_samples, mic_st->input_frames, frames_to_enqueue * sizeof(int16_t));
|
fifo_write(microphone->outgoing_samples, mic_st->input_frames, frames_to_enqueue * sizeof(int16_t));
|
||||||
}
|
|
||||||
|
|
||||||
return resampler_data.input_frames;
|
return resampler_data.input_frames;
|
||||||
}
|
}
|
||||||
/* Couldn't take the fast path, so let's resample the mic input */
|
/* Couldn't take the fast path, so let's resample the mic input */
|
||||||
|
|
||||||
/* First we need to format the input for the resampler. */
|
/* First we need to format the input for the resampler. */
|
||||||
|
/* If this mic provides floating-point samples... */
|
||||||
if (microphone->flags & MICROPHONE_FLAG_USE_FLOAT)
|
if (microphone->flags & MICROPHONE_FLAG_USE_FLOAT)
|
||||||
{/* If this mic provides floating-point samples... */
|
|
||||||
|
|
||||||
/* Samples are already in floating-point, so we just need to up-channel them. */
|
/* Samples are already in floating-point, so we just need to up-channel them. */
|
||||||
convert_to_dual_mono_float(mic_st->dual_mono_frames, mic_st->input_frames, resampler_data.input_frames);
|
convert_to_dual_mono_float(mic_st->dual_mono_frames, mic_st->input_frames, resampler_data.input_frames);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Samples are 16-bit, so we need to convert them first. */
|
/* Samples are 16-bit, so we need to convert them first. */
|
||||||
@ -615,30 +604,30 @@ int microphone_driver_read(retro_microphone_t *microphone, int16_t* frames, size
|
|||||||
size_t frames_remaining = num_frames;
|
size_t frames_remaining = num_frames;
|
||||||
microphone_driver_state_t *mic_st = &mic_driver_st;
|
microphone_driver_state_t *mic_st = &mic_driver_st;
|
||||||
const microphone_driver_t *driver = mic_st->driver;
|
const microphone_driver_t *driver = mic_st->driver;
|
||||||
bool core_paused = runloop_flags & RUNLOOP_FLAG_PAUSED;
|
bool core_paused = (runloop_flags & RUNLOOP_FLAG_PAUSED) ? true : false;
|
||||||
bool is_fastforward = runloop_flags & RUNLOOP_FLAG_FASTMOTION;
|
bool is_fastforward = (runloop_flags & RUNLOOP_FLAG_FASTMOTION) ? true : false;
|
||||||
bool is_slowmo = runloop_flags & RUNLOOP_FLAG_SLOWMOTION;
|
bool is_slowmo = (runloop_flags & RUNLOOP_FLAG_SLOWMOTION) ? true : false;
|
||||||
bool is_rewind = state_manager_frame_is_reversed();
|
bool is_rewind = state_manager_frame_is_reversed();
|
||||||
bool driver_active = mic_st->flags & MICROPHONE_DRIVER_FLAG_ACTIVE;
|
bool driver_active = (mic_st->flags & MICROPHONE_DRIVER_FLAG_ACTIVE) ? true : false;
|
||||||
|
|
||||||
|
/* If the provided arguments aren't valid... */
|
||||||
if (!frames || !microphone)
|
if (!frames || !microphone)
|
||||||
/* If the provided arguments aren't valid... */
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
/* If the microphone or driver aren't active... */
|
||||||
if (!driver_active || !(microphone->flags & MICROPHONE_FLAG_ACTIVE))
|
if (!driver_active || !(microphone->flags & MICROPHONE_FLAG_ACTIVE))
|
||||||
/* If the microphone or driver aren't active... */
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
/* If the driver is invalid or doesn't have the functions it needs... */
|
||||||
if (!driver || !driver->read || !driver->mic_alive)
|
if (!driver || !driver->read || !driver->mic_alive)
|
||||||
/* If the driver is invalid or doesn't have the functions it needs... */
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
/* If the core didn't actually ask for any frames... */
|
||||||
if (num_frames == 0)
|
if (num_frames == 0)
|
||||||
/* If the core didn't actually ask for any frames... */
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ((microphone->flags & MICROPHONE_FLAG_PENDING)
|
if ( (microphone->flags & MICROPHONE_FLAG_PENDING)
|
||||||
|| (microphone->flags & MICROPHONE_FLAG_SUSPENDED)
|
|| (microphone->flags & MICROPHONE_FLAG_SUSPENDED)
|
||||||
|| !(microphone->flags & MICROPHONE_FLAG_ENABLED)
|
|| !(microphone->flags & MICROPHONE_FLAG_ENABLED)
|
||||||
|| is_fastforward
|
|| is_fastforward
|
||||||
|| is_slowmo
|
|| is_slowmo
|
||||||
@ -657,18 +646,19 @@ int microphone_driver_read(retro_microphone_t *microphone, int16_t* frames, size
|
|||||||
* Because I couldn't think of anything useful for the mic to do.
|
* Because I couldn't think of anything useful for the mic to do.
|
||||||
* If you can, send a PR! */
|
* If you can, send a PR! */
|
||||||
|
|
||||||
|
/* If the driver or microphone's state haven't been allocated... */
|
||||||
if (!mic_st->driver_context || !microphone->microphone_context)
|
if (!mic_st->driver_context || !microphone->microphone_context)
|
||||||
/* If the driver or microphone's state haven't been allocated... */
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
/* If the mic isn't active like it should be at this point... */
|
||||||
if (!driver->mic_alive(mic_st->driver_context, microphone->microphone_context))
|
if (!driver->mic_alive(mic_st->driver_context, microphone->microphone_context))
|
||||||
{ /* If the mic isn't active like it should be at this point... */
|
{
|
||||||
RARCH_ERR("[Microphone]: Mic frontend has the mic enabled, but the backend has it disabled.\n");
|
RARCH_ERR("[Microphone]: Mic frontend has the mic enabled, but the backend has it disabled.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the core asked for more frames than we can fit... */
|
||||||
if (num_frames > microphone->outgoing_samples->size)
|
if (num_frames > microphone->outgoing_samples->size)
|
||||||
/* If the core asked for more frames than we can fit... */
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
retro_assert(mic_st->input_frames != NULL);
|
retro_assert(mic_st->input_frames != NULL);
|
||||||
@ -676,9 +666,10 @@ int microphone_driver_read(retro_microphone_t *microphone, int16_t* frames, size
|
|||||||
while (FIFO_READ_AVAIL(microphone->outgoing_samples) < num_frames * sizeof(int16_t))
|
while (FIFO_READ_AVAIL(microphone->outgoing_samples) < num_frames * sizeof(int16_t))
|
||||||
{ /* Until we can give the core the frames it asked for... */
|
{ /* Until we can give the core the frames it asked for... */
|
||||||
size_t frames_to_read = MIN(AUDIO_CHUNK_SIZE_NONBLOCKING, frames_remaining);
|
size_t frames_to_read = MIN(AUDIO_CHUNK_SIZE_NONBLOCKING, frames_remaining);
|
||||||
size_t frames_read = 0;
|
size_t frames_read = 0;
|
||||||
|
|
||||||
|
/* If the game is running and the mic driver is active... */
|
||||||
if (!core_paused)
|
if (!core_paused)
|
||||||
/* If the game is running and the mic driver is active... */
|
|
||||||
frames_read = microphone_driver_flush(mic_st, microphone, frames_to_read);
|
frames_read = microphone_driver_flush(mic_st, microphone, frames_to_read);
|
||||||
|
|
||||||
/* Otherwise, advance the counters. We're not gonna get new data,
|
/* Otherwise, advance the counters. We're not gonna get new data,
|
||||||
@ -692,16 +683,13 @@ int microphone_driver_read(retro_microphone_t *microphone, int16_t* frames, size
|
|||||||
|
|
||||||
bool microphone_driver_get_effective_params(const retro_microphone_t *microphone, retro_microphone_params_t *params)
|
bool microphone_driver_get_effective_params(const retro_microphone_t *microphone, retro_microphone_params_t *params)
|
||||||
{
|
{
|
||||||
|
/* If the arguments are null... */
|
||||||
if (!microphone || !params)
|
if (!microphone || !params)
|
||||||
/* If the arguments are null... */
|
|
||||||
return false;
|
return false;
|
||||||
|
/* If this isn't an opened microphone... */
|
||||||
if (!(microphone->flags & MICROPHONE_FLAG_ACTIVE))
|
if (!(microphone->flags & MICROPHONE_FLAG_ACTIVE))
|
||||||
/* If this isn't an opened microphone... */
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
*params = microphone->effective_params;
|
*params = microphone->effective_params;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -744,8 +732,9 @@ retro_microphone_t *microphone_driver_open_mic(const retro_microphone_params_t *
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the core has requested a second microphone... */
|
||||||
if (mic_st->microphone.flags & MICROPHONE_FLAG_ACTIVE)
|
if (mic_st->microphone.flags & MICROPHONE_FLAG_ACTIVE)
|
||||||
{ /* If the core has requested a second microphone... */
|
{
|
||||||
RARCH_ERR("[Microphone]: Failed to open a second microphone, frontend only supports one at a time right now.\n");
|
RARCH_ERR("[Microphone]: Failed to open a second microphone, frontend only supports one at a time right now.\n");
|
||||||
if (mic_st->microphone.flags & MICROPHONE_FLAG_PENDING)
|
if (mic_st->microphone.flags & MICROPHONE_FLAG_PENDING)
|
||||||
/* If that mic is pending... */
|
/* If that mic is pending... */
|
||||||
@ -765,7 +754,8 @@ retro_microphone_t *microphone_driver_open_mic(const retro_microphone_params_t *
|
|||||||
/* If driver_context is NULL, the handle won't have a valid microphone context (but we'll create one later) */
|
/* If driver_context is NULL, the handle won't have a valid microphone context (but we'll create one later) */
|
||||||
|
|
||||||
if (driver_context)
|
if (driver_context)
|
||||||
{ /* If the microphone driver is ready to open a microphone... */
|
{
|
||||||
|
/* If the microphone driver is ready to open a microphone... */
|
||||||
if (mic_driver_open_mic_internal(&mic_st->microphone)) /* If the microphone was successfully initialized... */
|
if (mic_driver_open_mic_internal(&mic_st->microphone)) /* If the microphone was successfully initialized... */
|
||||||
RARCH_LOG("[Microphone]: Opened the requested microphone successfully.\n");
|
RARCH_LOG("[Microphone]: Opened the requested microphone successfully.\n");
|
||||||
else
|
else
|
||||||
@ -789,7 +779,7 @@ static bool microphone_driver_free_devices_list(void)
|
|||||||
{
|
{
|
||||||
microphone_driver_state_t *mic_st = &mic_driver_st;
|
microphone_driver_state_t *mic_st = &mic_driver_st;
|
||||||
if (
|
if (
|
||||||
!mic_st->driver
|
!mic_st->driver
|
||||||
|| !mic_st->driver->device_list_free
|
|| !mic_st->driver->device_list_free
|
||||||
|| !mic_st->driver_context
|
|| !mic_st->driver_context
|
||||||
|| !mic_st->devices_list)
|
|| !mic_st->devices_list)
|
||||||
@ -818,32 +808,32 @@ bool microphone_driver_deinit(bool is_reset)
|
|||||||
|
|
||||||
if (mic_st->input_frames)
|
if (mic_st->input_frames)
|
||||||
memalign_free(mic_st->input_frames);
|
memalign_free(mic_st->input_frames);
|
||||||
mic_st->input_frames = NULL;
|
mic_st->input_frames = NULL;
|
||||||
mic_st->input_frames_length = 0;
|
mic_st->input_frames_length = 0;
|
||||||
|
|
||||||
if (mic_st->converted_input_frames)
|
if (mic_st->converted_input_frames)
|
||||||
memalign_free(mic_st->converted_input_frames);
|
memalign_free(mic_st->converted_input_frames);
|
||||||
mic_st->converted_input_frames = NULL;
|
mic_st->converted_input_frames = NULL;
|
||||||
mic_st->converted_input_frames_length = 0;
|
mic_st->converted_input_frames_length = 0;
|
||||||
|
|
||||||
if (mic_st->dual_mono_frames)
|
if (mic_st->dual_mono_frames)
|
||||||
memalign_free(mic_st->dual_mono_frames);
|
memalign_free(mic_st->dual_mono_frames);
|
||||||
mic_st->dual_mono_frames = NULL;
|
mic_st->dual_mono_frames = NULL;
|
||||||
mic_st->dual_mono_frames_length = 0;
|
mic_st->dual_mono_frames_length = 0;
|
||||||
|
|
||||||
if (mic_st->resampled_frames)
|
if (mic_st->resampled_frames)
|
||||||
memalign_free(mic_st->resampled_frames);
|
memalign_free(mic_st->resampled_frames);
|
||||||
mic_st->resampled_frames = NULL;
|
mic_st->resampled_frames = NULL;
|
||||||
mic_st->resampled_frames_length = 0;
|
mic_st->resampled_frames_length = 0;
|
||||||
|
|
||||||
if (mic_st->resampled_mono_frames)
|
if (mic_st->resampled_mono_frames)
|
||||||
memalign_free(mic_st->resampled_mono_frames);
|
memalign_free(mic_st->resampled_mono_frames);
|
||||||
mic_st->resampled_mono_frames = NULL;
|
mic_st->resampled_mono_frames = NULL;
|
||||||
mic_st->resampled_mono_frames_length = 0;
|
mic_st->resampled_mono_frames_length = 0;
|
||||||
|
|
||||||
if (mic_st->final_frames)
|
if (mic_st->final_frames)
|
||||||
memalign_free(mic_st->final_frames);
|
memalign_free(mic_st->final_frames);
|
||||||
mic_st->final_frames = NULL;
|
mic_st->final_frames = NULL;
|
||||||
mic_st->final_frames_length = 0;
|
mic_st->final_frames_length = 0;
|
||||||
|
|
||||||
mic_st->resampler_quality = RESAMPLER_QUALITY_DONTCARE;
|
mic_st->resampler_quality = RESAMPLER_QUALITY_DONTCARE;
|
||||||
|
@ -197,7 +197,7 @@ static int rcheevos_init_memory(rcheevos_locals_t* locals)
|
|||||||
mmap.descriptors = &descriptors[0];
|
mmap.descriptors = &descriptors[0];
|
||||||
mmap.num_descriptors = mmaps->num_descriptors;
|
mmap.num_descriptors = mmaps->num_descriptors;
|
||||||
|
|
||||||
/* RetroArch wraps the retro_memory_descriptor's
|
/* RetroArch wraps the retro_memory_descriptor's
|
||||||
* in rarch_memory_descriptor_t's, pull them back out */
|
* in rarch_memory_descriptor_t's, pull them back out */
|
||||||
for (i = 0; i < mmap.num_descriptors; ++i)
|
for (i = 0; i < mmap.num_descriptors; ++i)
|
||||||
memcpy(&descriptors[i], &mmaps->descriptors[i].core,
|
memcpy(&descriptors[i], &mmaps->descriptors[i].core,
|
||||||
@ -213,7 +213,7 @@ static int rcheevos_init_memory(rcheevos_locals_t* locals)
|
|||||||
|
|
||||||
uint8_t* rcheevos_patch_address(unsigned address)
|
uint8_t* rcheevos_patch_address(unsigned address)
|
||||||
{
|
{
|
||||||
/* Memory map was not previously initialized
|
/* Memory map was not previously initialized
|
||||||
* (no achievements for this game?), try now */
|
* (no achievements for this game?), try now */
|
||||||
if (rcheevos_locals.memory.count == 0)
|
if (rcheevos_locals.memory.count == 0)
|
||||||
rcheevos_init_memory(&rcheevos_locals);
|
rcheevos_init_memory(&rcheevos_locals);
|
||||||
@ -232,7 +232,7 @@ static unsigned rcheevos_peek(unsigned address,
|
|||||||
switch (num_bytes)
|
switch (num_bytes)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
return (data[3] << 24) | (data[2] << 16) |
|
return (data[3] << 24) | (data[2] << 16) |
|
||||||
(data[1] << 8) | (data[0]);
|
(data[1] << 8) | (data[0]);
|
||||||
case 3:
|
case 3:
|
||||||
return (data[2] << 16) | (data[1] << 8) | (data[0]);
|
return (data[2] << 16) | (data[1] << 8) | (data[0]);
|
||||||
@ -287,7 +287,7 @@ static void rcheevos_activate_achievements(void)
|
|||||||
static rcheevos_racheevo_t* rcheevos_find_cheevo(unsigned id)
|
static rcheevos_racheevo_t* rcheevos_find_cheevo(unsigned id)
|
||||||
{
|
{
|
||||||
rcheevos_racheevo_t* cheevo = rcheevos_locals.game.achievements;
|
rcheevos_racheevo_t* cheevo = rcheevos_locals.game.achievements;
|
||||||
rcheevos_racheevo_t* stop = cheevo
|
rcheevos_racheevo_t* stop = cheevo
|
||||||
+ rcheevos_locals.game.achievement_count;
|
+ rcheevos_locals.game.achievement_count;
|
||||||
|
|
||||||
for(; cheevo < stop; ++cheevo)
|
for(; cheevo < stop; ++cheevo)
|
||||||
@ -355,7 +355,7 @@ void rcheevos_award_achievement(rcheevos_locals_t* locals,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start the award task (unofficial achievement
|
/* Start the award task (unofficial achievement
|
||||||
* unlocks are not submitted). */
|
* unlocks are not submitted). */
|
||||||
if (!(cheevo->active & RCHEEVOS_ACTIVE_UNOFFICIAL))
|
if (!(cheevo->active & RCHEEVOS_ACTIVE_UNOFFICIAL))
|
||||||
rcheevos_client_award_achievement(cheevo->id);
|
rcheevos_client_award_achievement(cheevo->id);
|
||||||
@ -406,7 +406,7 @@ void rcheevos_award_achievement(rcheevos_locals_t* locals,
|
|||||||
static rcheevos_ralboard_t* rcheevos_find_lboard(unsigned id)
|
static rcheevos_ralboard_t* rcheevos_find_lboard(unsigned id)
|
||||||
{
|
{
|
||||||
rcheevos_ralboard_t* lboard = rcheevos_locals.game.leaderboards;
|
rcheevos_ralboard_t* lboard = rcheevos_locals.game.leaderboards;
|
||||||
rcheevos_ralboard_t* stop = lboard
|
rcheevos_ralboard_t* stop = lboard
|
||||||
+ rcheevos_locals.game.leaderboard_count;
|
+ rcheevos_locals.game.leaderboard_count;
|
||||||
|
|
||||||
for (; lboard < stop; ++lboard)
|
for (; lboard < stop; ++lboard)
|
||||||
@ -631,8 +631,8 @@ static void rcheevos_challenge_started(
|
|||||||
bool widgets_ready)
|
bool widgets_ready)
|
||||||
{
|
{
|
||||||
settings_t* settings = config_get_ptr();
|
settings_t* settings = config_get_ptr();
|
||||||
if ( cheevo
|
if ( cheevo
|
||||||
&& widgets_ready
|
&& widgets_ready
|
||||||
&& settings->bools.cheevos_challenge_indicators
|
&& settings->bools.cheevos_challenge_indicators
|
||||||
&& rcheevos_is_player_active())
|
&& rcheevos_is_player_active())
|
||||||
gfx_widgets_set_challenge_display(cheevo->id, cheevo->badge);
|
gfx_widgets_set_challenge_display(cheevo->id, cheevo->badge);
|
||||||
@ -741,7 +741,7 @@ void rcheevos_reset_game(bool widgets_ready)
|
|||||||
|
|
||||||
rc_runtime_reset(&rcheevos_locals.runtime);
|
rc_runtime_reset(&rcheevos_locals.runtime);
|
||||||
|
|
||||||
/* Some cores reallocate memory on reset,
|
/* Some cores reallocate memory on reset,
|
||||||
* make sure we update our pointers */
|
* make sure we update our pointers */
|
||||||
if (rcheevos_locals.memory.total_size > 0)
|
if (rcheevos_locals.memory.total_size > 0)
|
||||||
rcheevos_init_memory(&rcheevos_locals);
|
rcheevos_init_memory(&rcheevos_locals);
|
||||||
@ -777,7 +777,7 @@ bool rcheevos_unload(void)
|
|||||||
{
|
{
|
||||||
settings_t* settings = config_get_ptr();
|
settings_t* settings = config_get_ptr();
|
||||||
|
|
||||||
/* Immediately mark the game as unloaded
|
/* Immediately mark the game as unloaded
|
||||||
so the ping thread will terminate normally */
|
so the ping thread will terminate normally */
|
||||||
rcheevos_locals.game.id = -1;
|
rcheevos_locals.game.id = -1;
|
||||||
rcheevos_locals.game.console_id = 0;
|
rcheevos_locals.game.console_id = 0;
|
||||||
@ -877,7 +877,7 @@ bool rcheevos_unload(void)
|
|||||||
|
|
||||||
rc_runtime_destroy(&rcheevos_locals.runtime);
|
rc_runtime_destroy(&rcheevos_locals.runtime);
|
||||||
|
|
||||||
/* If the config-level token has been cleared,
|
/* If the config-level token has been cleared,
|
||||||
* we need to re-login on loading the next game */
|
* we need to re-login on loading the next game */
|
||||||
if (!settings->arrays.cheevos_token[0])
|
if (!settings->arrays.cheevos_token[0])
|
||||||
rcheevos_locals.token[0] = '\0';
|
rcheevos_locals.token[0] = '\0';
|
||||||
@ -889,7 +889,7 @@ bool rcheevos_unload(void)
|
|||||||
static void rcheevos_toggle_hardcore_achievements(
|
static void rcheevos_toggle_hardcore_achievements(
|
||||||
rcheevos_locals_t *locals)
|
rcheevos_locals_t *locals)
|
||||||
{
|
{
|
||||||
const unsigned active_mask =
|
const unsigned active_mask =
|
||||||
RCHEEVOS_ACTIVE_SOFTCORE | RCHEEVOS_ACTIVE_HARDCORE | RCHEEVOS_ACTIVE_UNSUPPORTED;
|
RCHEEVOS_ACTIVE_SOFTCORE | RCHEEVOS_ACTIVE_HARDCORE | RCHEEVOS_ACTIVE_UNSUPPORTED;
|
||||||
rcheevos_racheevo_t* cheevo = locals->game.achievements;
|
rcheevos_racheevo_t* cheevo = locals->game.achievements;
|
||||||
rcheevos_racheevo_t* stop = cheevo + locals->game.achievement_count;
|
rcheevos_racheevo_t* stop = cheevo + locals->game.achievement_count;
|
||||||
@ -956,7 +956,7 @@ static void rcheevos_activate_leaderboards(void)
|
|||||||
static void rcheevos_deactivate_leaderboards(void)
|
static void rcheevos_deactivate_leaderboards(void)
|
||||||
{
|
{
|
||||||
rcheevos_ralboard_t* lboard = rcheevos_locals.game.leaderboards;
|
rcheevos_ralboard_t* lboard = rcheevos_locals.game.leaderboards;
|
||||||
rcheevos_ralboard_t* stop = lboard +
|
rcheevos_ralboard_t* stop = lboard +
|
||||||
rcheevos_locals.game.leaderboard_count;
|
rcheevos_locals.game.leaderboard_count;
|
||||||
|
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
@ -1017,12 +1017,6 @@ void rcheevos_leaderboard_trackers_visibility_changed(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rcheevos_enforce_hardcore_settings(void)
|
|
||||||
{
|
|
||||||
/* disable slowdown */
|
|
||||||
runloop_state_get_ptr()->flags &= ~RUNLOOP_FLAG_SLOWMOTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rcheevos_toggle_hardcore_active(rcheevos_locals_t* locals)
|
static void rcheevos_toggle_hardcore_active(rcheevos_locals_t* locals)
|
||||||
{
|
{
|
||||||
settings_t* settings = config_get_ptr();
|
settings_t* settings = config_get_ptr();
|
||||||
@ -1053,7 +1047,7 @@ static void rcheevos_toggle_hardcore_active(rcheevos_locals_t* locals)
|
|||||||
runloop_msg_queue_push(msg, 0, 3 * 60, true, NULL,
|
runloop_msg_queue_push(msg, 0, 3 * 60, true, NULL,
|
||||||
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||||
|
|
||||||
rcheevos_enforce_hardcore_settings();
|
runloop_state_get_ptr()->flags &= ~RUNLOOP_FLAG_SLOWMOTION;
|
||||||
|
|
||||||
/* Reactivate leaderboards */
|
/* Reactivate leaderboards */
|
||||||
rcheevos_activate_leaderboards();
|
rcheevos_activate_leaderboards();
|
||||||
@ -1126,8 +1120,8 @@ void rcheevos_hardcore_enabled_changed(void)
|
|||||||
* (i.e. cheevos_enable, hardcore_mode_enable) to synchronize the internal state to the configs.
|
* (i.e. cheevos_enable, hardcore_mode_enable) to synchronize the internal state to the configs.
|
||||||
* also called when a game is first loaded to synchronize the internal state to the configs. */
|
* also called when a game is first loaded to synchronize the internal state to the configs. */
|
||||||
const settings_t* settings = config_get_ptr();
|
const settings_t* settings = config_get_ptr();
|
||||||
const bool enabled = settings
|
const bool enabled = settings
|
||||||
&& settings->bools.cheevos_enable
|
&& settings->bools.cheevos_enable
|
||||||
&& settings->bools.cheevos_hardcore_mode_enable;
|
&& settings->bools.cheevos_hardcore_mode_enable;
|
||||||
|
|
||||||
if (enabled != rcheevos_locals.hardcore_active)
|
if (enabled != rcheevos_locals.hardcore_active)
|
||||||
@ -1140,21 +1134,19 @@ void rcheevos_hardcore_enabled_changed(void)
|
|||||||
else
|
else
|
||||||
rcheevos_deactivate_leaderboards();
|
rcheevos_deactivate_leaderboards();
|
||||||
}
|
}
|
||||||
|
/* hardcore enabledness didn't change, but hardcore is active, so make
|
||||||
|
* sure to enforce the restrictions. */
|
||||||
else if (rcheevos_locals.hardcore_active && rcheevos_locals.loaded)
|
else if (rcheevos_locals.hardcore_active && rcheevos_locals.loaded)
|
||||||
{
|
runloop_state_get_ptr()->flags &= ~RUNLOOP_FLAG_SLOWMOTION;
|
||||||
/* hardcore enabledness didn't change, but hardcore is active, so make
|
|
||||||
* sure to enforce the restrictions. */
|
|
||||||
rcheevos_enforce_hardcore_settings();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void rcheevos_validate_config_settings(void)
|
void rcheevos_validate_config_settings(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const rc_disallowed_setting_t
|
const rc_disallowed_setting_t
|
||||||
*disallowed_settings = NULL;
|
*disallowed_settings = NULL;
|
||||||
core_option_manager_t* coreopts = NULL;
|
core_option_manager_t* coreopts = NULL;
|
||||||
struct retro_system_info *sysinfo =
|
struct retro_system_info *sysinfo =
|
||||||
&runloop_state_get_ptr()->system.info;
|
&runloop_state_get_ptr()->system.info;
|
||||||
const settings_t* settings = config_get_ptr();
|
const settings_t* settings = config_get_ptr();
|
||||||
|
|
||||||
@ -1171,7 +1163,7 @@ void rcheevos_validate_config_settings(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(disallowed_settings
|
if (!(disallowed_settings
|
||||||
= rc_libretro_get_disallowed_settings(sysinfo->library_name)))
|
= rc_libretro_get_disallowed_settings(sysinfo->library_name)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1184,7 +1176,7 @@ void rcheevos_validate_config_settings(void)
|
|||||||
const char* val = core_option_manager_get_val(coreopts, i);
|
const char* val = core_option_manager_get_val(coreopts, i);
|
||||||
if (!rc_libretro_is_setting_allowed(disallowed_settings, key, val))
|
if (!rc_libretro_is_setting_allowed(disallowed_settings, key, val))
|
||||||
{
|
{
|
||||||
char buffer[256];
|
char buffer[128];
|
||||||
snprintf(buffer, sizeof(buffer), "Hardcore paused. Setting not allowed: %s=%s", key, val);
|
snprintf(buffer, sizeof(buffer), "Hardcore paused. Setting not allowed: %s=%s", key, val);
|
||||||
CHEEVOS_LOG(RCHEEVOS_TAG "%s\n", buffer);
|
CHEEVOS_LOG(RCHEEVOS_TAG "%s\n", buffer);
|
||||||
rcheevos_pause_hardcore();
|
rcheevos_pause_hardcore();
|
||||||
@ -1308,12 +1300,12 @@ static void rcheevos_validate_memrefs(rcheevos_locals_t* locals)
|
|||||||
* first call to retro_run. in that case, there will be a total_size
|
* first call to retro_run. in that case, there will be a total_size
|
||||||
* of memory reported by the core, but init will return false, as
|
* of memory reported by the core, but init will return false, as
|
||||||
* all of the pointers were null. if we're still loading the game,
|
* all of the pointers were null. if we're still loading the game,
|
||||||
* just reset the memory count and we'll re-evaluate in
|
* just reset the memory count and we'll re-evaluate in
|
||||||
* rcheevos_test()
|
* rcheevos_test()
|
||||||
*/
|
*/
|
||||||
if (!locals->loaded)
|
if (!locals->loaded)
|
||||||
{
|
{
|
||||||
/* If no memory was exposed, report the error now
|
/* If no memory was exposed, report the error now
|
||||||
* instead of waiting */
|
* instead of waiting */
|
||||||
if (locals->memory.total_size != 0)
|
if (locals->memory.total_size != 0)
|
||||||
{
|
{
|
||||||
@ -1634,8 +1626,8 @@ void rcheevos_show_mastery_placard(void)
|
|||||||
rcheevos_locals.game.mastery_placard_shown = true;
|
rcheevos_locals.game.mastery_placard_shown = true;
|
||||||
|
|
||||||
snprintf(title, sizeof(title),
|
snprintf(title, sizeof(title),
|
||||||
msg_hash_to_str(rcheevos_locals.hardcore_active
|
msg_hash_to_str(rcheevos_locals.hardcore_active
|
||||||
? MSG_CHEEVOS_MASTERED_GAME
|
? MSG_CHEEVOS_MASTERED_GAME
|
||||||
: MSG_CHEEVOS_COMPLETED_GAME),
|
: MSG_CHEEVOS_COMPLETED_GAME),
|
||||||
rcheevos_locals.game.title);
|
rcheevos_locals.game.title);
|
||||||
title[sizeof(title) - 1] = '\0';
|
title[sizeof(title) - 1] = '\0';
|
||||||
@ -1689,7 +1681,7 @@ static void rcheevos_show_game_placard(void)
|
|||||||
char msg[256];
|
char msg[256];
|
||||||
const settings_t* settings = config_get_ptr();
|
const settings_t* settings = config_get_ptr();
|
||||||
const rcheevos_racheevo_t* cheevo = rcheevos_locals.game.achievements;
|
const rcheevos_racheevo_t* cheevo = rcheevos_locals.game.achievements;
|
||||||
const rcheevos_racheevo_t* end = cheevo
|
const rcheevos_racheevo_t* end = cheevo
|
||||||
+ rcheevos_locals.game.achievement_count;
|
+ rcheevos_locals.game.achievement_count;
|
||||||
int number_of_active = 0;
|
int number_of_active = 0;
|
||||||
int number_of_unsupported = 0;
|
int number_of_unsupported = 0;
|
||||||
@ -1798,7 +1790,7 @@ static void rcheevos_fetch_badges_callback(void* userdata)
|
|||||||
|
|
||||||
static void rcheevos_fetch_badges(void)
|
static void rcheevos_fetch_badges(void)
|
||||||
{
|
{
|
||||||
/* this function manages the
|
/* this function manages the
|
||||||
* RCHEEVOS_LOAD_STATE_FETCHING_BADGES state */
|
* RCHEEVOS_LOAD_STATE_FETCHING_BADGES state */
|
||||||
rcheevos_client_fetch_badges(rcheevos_fetch_badges_callback, NULL);
|
rcheevos_client_fetch_badges(rcheevos_fetch_badges_callback, NULL);
|
||||||
}
|
}
|
||||||
@ -1858,18 +1850,14 @@ static void rcheevos_start_session_async(retro_task_t* task)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* If there's nothing for the runtime to process,
|
||||||
|
* disable hardcore. */
|
||||||
if (!needs_runtime)
|
if (!needs_runtime)
|
||||||
{
|
|
||||||
/* if there's nothing for the runtime to process,
|
|
||||||
* disable hardcore. */
|
|
||||||
rcheevos_pause_hardcore();
|
rcheevos_pause_hardcore();
|
||||||
}
|
/* hardcore is active. we're going to start processing
|
||||||
|
* achievements. make sure restrictions are enforced */
|
||||||
else if (rcheevos_locals.hardcore_active)
|
else if (rcheevos_locals.hardcore_active)
|
||||||
{
|
runloop_state_get_ptr()->flags &= ~RUNLOOP_FLAG_SLOWMOTION;
|
||||||
/* hardcore is active. we're going to start processing
|
|
||||||
* achievements. make sure restrictions are enforced */
|
|
||||||
rcheevos_enforce_hardcore_settings();
|
|
||||||
}
|
|
||||||
|
|
||||||
task_set_finished(task, true);
|
task_set_finished(task, true);
|
||||||
|
|
||||||
@ -1915,7 +1903,7 @@ static void rcheevos_initialize_runtime_callback(void* userdata)
|
|||||||
|
|
||||||
static void rcheevos_fetch_game_data(void)
|
static void rcheevos_fetch_game_data(void)
|
||||||
{
|
{
|
||||||
if ( rcheevos_locals.load_info.state
|
if ( rcheevos_locals.load_info.state
|
||||||
== RCHEEVOS_LOAD_STATE_NETWORK_ERROR)
|
== RCHEEVOS_LOAD_STATE_NETWORK_ERROR)
|
||||||
{
|
{
|
||||||
rcheevos_locals.game.hash = NULL;
|
rcheevos_locals.game.hash = NULL;
|
||||||
@ -1990,7 +1978,7 @@ struct rcheevos_identify_game_data
|
|||||||
|
|
||||||
static void rcheevos_identify_game_callback(void* userdata)
|
static void rcheevos_identify_game_callback(void* userdata)
|
||||||
{
|
{
|
||||||
struct rcheevos_identify_game_data* data =
|
struct rcheevos_identify_game_data* data =
|
||||||
(struct rcheevos_identify_game_data*)userdata;
|
(struct rcheevos_identify_game_data*)userdata;
|
||||||
|
|
||||||
rcheevos_locals.load_info.hashes_tried++;
|
rcheevos_locals.load_info.hashes_tried++;
|
||||||
@ -2167,7 +2155,7 @@ void rcheevos_begin_load_state(enum rcheevos_load_state state)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Decrement and return the outstanding requests counter.
|
/* Decrement and return the outstanding requests counter.
|
||||||
* If non-zero, requests are still outstanding */
|
* If non-zero, requests are still outstanding */
|
||||||
int rcheevos_end_load_state(void)
|
int rcheevos_end_load_state(void)
|
||||||
{
|
{
|
||||||
@ -2192,10 +2180,10 @@ bool rcheevos_load_aborted(void)
|
|||||||
{
|
{
|
||||||
/* Unload has been called */
|
/* Unload has been called */
|
||||||
case RCHEEVOS_LOAD_STATE_ABORTED:
|
case RCHEEVOS_LOAD_STATE_ABORTED:
|
||||||
/* Unload quit waiting and ran to completion */
|
/* Unload quit waiting and ran to completion */
|
||||||
case RCHEEVOS_LOAD_STATE_NONE:
|
case RCHEEVOS_LOAD_STATE_NONE:
|
||||||
/* Login/resolve hash failed after several attempts */
|
/* Login/resolve hash failed after several attempts */
|
||||||
case RCHEEVOS_LOAD_STATE_NETWORK_ERROR:
|
case RCHEEVOS_LOAD_STATE_NETWORK_ERROR:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -2208,7 +2196,7 @@ bool rcheevos_load(const void *data)
|
|||||||
const struct retro_game_info *info = (const struct retro_game_info*)
|
const struct retro_game_info *info = (const struct retro_game_info*)
|
||||||
data;
|
data;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
bool cheevos_enable = settings
|
bool cheevos_enable = settings
|
||||||
&& settings->bools.cheevos_enable;
|
&& settings->bools.cheevos_enable;
|
||||||
|
|
||||||
memset(&rcheevos_locals.load_info, 0,
|
memset(&rcheevos_locals.load_info, 0,
|
||||||
@ -2226,7 +2214,7 @@ bool rcheevos_load(const void *data)
|
|||||||
#endif
|
#endif
|
||||||
rc_runtime_init(&rcheevos_locals.runtime);
|
rc_runtime_init(&rcheevos_locals.runtime);
|
||||||
|
|
||||||
/* If achievements are not enabled, or the core doesn't
|
/* If achievements are not enabled, or the core doesn't
|
||||||
* support achievements, disable hardcore and bail */
|
* support achievements, disable hardcore and bail */
|
||||||
if (!cheevos_enable || !rcheevos_locals.core_supports || !data)
|
if (!cheevos_enable || !rcheevos_locals.core_supports || !data)
|
||||||
{
|
{
|
||||||
@ -2289,11 +2277,11 @@ bool rcheevos_load(const void *data)
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Identify the game and log the user in.
|
/* Identify the game and log the user in.
|
||||||
* These will run asynchronously. */
|
* These will run asynchronously. */
|
||||||
if (!rcheevos_identify_game(info))
|
if (!rcheevos_identify_game(info))
|
||||||
{
|
{
|
||||||
/* No hashes could be generated for the game,
|
/* No hashes could be generated for the game,
|
||||||
* disable hardcore and bail */
|
* disable hardcore and bail */
|
||||||
rcheevos_locals.game.id = 0;
|
rcheevos_locals.game.id = 0;
|
||||||
rcheevos_end_load_state();
|
rcheevos_end_load_state();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user