mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
Cleanups
This commit is contained in:
parent
5b2ed8a08d
commit
cc50cefd30
@ -338,9 +338,7 @@ static bool input_autoconfigure_joypad_from_conf_internal(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string_is_empty(params->autoconfig_directory))
|
return string_is_empty(params->autoconfig_directory);
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void input_autoconfigure_params_free(autoconfig_params_t *params)
|
static void input_autoconfigure_params_free(autoconfig_params_t *params)
|
||||||
|
@ -1507,7 +1507,7 @@ static bool firmware_update_status(
|
|||||||
if (set_missing_firmware)
|
if (set_missing_firmware)
|
||||||
rarch_ctl(RARCH_CTL_SET_MISSING_BIOS, NULL);
|
rarch_ctl(RARCH_CTL_SET_MISSING_BIOS, NULL);
|
||||||
|
|
||||||
if(
|
if (
|
||||||
content_ctx->bios_is_missing &&
|
content_ctx->bios_is_missing &&
|
||||||
content_ctx->check_firmware_before_loading)
|
content_ctx->check_firmware_before_loading)
|
||||||
{
|
{
|
||||||
|
@ -136,7 +136,7 @@ static int detect_ps1_game_sub(intfstream_t *fp,
|
|||||||
is_mode1 = 0;
|
is_mode1 = 0;
|
||||||
|
|
||||||
if (intfstream_seek(fp, 0, SEEK_END) == -1)
|
if (intfstream_seek(fp, 0, SEEK_END) == -1)
|
||||||
goto error;
|
return 0;
|
||||||
|
|
||||||
if (!sub_channel_mixed)
|
if (!sub_channel_mixed)
|
||||||
{
|
{
|
||||||
@ -145,7 +145,7 @@ static int detect_ps1_game_sub(intfstream_t *fp,
|
|||||||
unsigned int mode_test = 0;
|
unsigned int mode_test = 0;
|
||||||
|
|
||||||
if (intfstream_seek(fp, 0, SEEK_SET) == -1)
|
if (intfstream_seek(fp, 0, SEEK_SET) == -1)
|
||||||
goto error;
|
return 0;
|
||||||
|
|
||||||
intfstream_read(fp, &mode_test, 4);
|
intfstream_read(fp, &mode_test, 4);
|
||||||
if (mode_test != MODETEST_VAL)
|
if (mode_test != MODETEST_VAL)
|
||||||
@ -157,21 +157,21 @@ static int detect_ps1_game_sub(intfstream_t *fp,
|
|||||||
frame_size = sub_channel_mixed? 2448: is_mode1? 2048: 2352;
|
frame_size = sub_channel_mixed? 2448: is_mode1? 2048: 2352;
|
||||||
|
|
||||||
if (intfstream_seek(fp, 156 + skip + 16 * frame_size, SEEK_SET) == -1)
|
if (intfstream_seek(fp, 156 + skip + 16 * frame_size, SEEK_SET) == -1)
|
||||||
goto error;
|
return 0;
|
||||||
|
|
||||||
intfstream_read(fp, buffer, 6);
|
intfstream_read(fp, buffer, 6);
|
||||||
|
|
||||||
cd_sector = buffer[2] | (buffer[3] << 8) | (buffer[4] << 16);
|
cd_sector = buffer[2] | (buffer[3] << 8) | (buffer[4] << 16);
|
||||||
|
|
||||||
if (intfstream_seek(fp, skip + cd_sector * frame_size, SEEK_SET) == -1)
|
if (intfstream_seek(fp, skip + cd_sector * frame_size, SEEK_SET) == -1)
|
||||||
goto error;
|
return 0;
|
||||||
intfstream_read(fp, buffer, 2048 * 2);
|
intfstream_read(fp, buffer, 2048 * 2);
|
||||||
|
|
||||||
tmp = buffer;
|
tmp = buffer;
|
||||||
while (tmp < (buffer + 2048 * 2))
|
while (tmp < (buffer + 2048 * 2))
|
||||||
{
|
{
|
||||||
if (!*tmp)
|
if (!*tmp)
|
||||||
goto error;
|
return 0;
|
||||||
|
|
||||||
if (!strncasecmp((const char*)(tmp + 33), "SYSTEM.CNF;1", 12))
|
if (!strncasecmp((const char*)(tmp + 33), "SYSTEM.CNF;1", 12))
|
||||||
break;
|
break;
|
||||||
@ -179,12 +179,12 @@ static int detect_ps1_game_sub(intfstream_t *fp,
|
|||||||
tmp += *tmp;
|
tmp += *tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tmp >= (buffer + 2048 * 2))
|
if (tmp >= (buffer + 2048 * 2))
|
||||||
goto error;
|
return 0;
|
||||||
|
|
||||||
cd_sector = tmp[2] | (tmp[3] << 8) | (tmp[4] << 16);
|
cd_sector = tmp[2] | (tmp[3] << 8) | (tmp[4] << 16);
|
||||||
if (intfstream_seek(fp, skip + cd_sector * frame_size, SEEK_SET) == -1)
|
if (intfstream_seek(fp, skip + cd_sector * frame_size, SEEK_SET) == -1)
|
||||||
goto error;
|
return 0;
|
||||||
|
|
||||||
intfstream_read(fp, buffer, 256);
|
intfstream_read(fp, buffer, 256);
|
||||||
buffer[256] = '\0';
|
buffer[256] = '\0';
|
||||||
@ -193,13 +193,13 @@ static int detect_ps1_game_sub(intfstream_t *fp,
|
|||||||
while(*tmp && strncasecmp((const char*)tmp, "boot", 4))
|
while(*tmp && strncasecmp((const char*)tmp, "boot", 4))
|
||||||
tmp++;
|
tmp++;
|
||||||
|
|
||||||
if(!*tmp)
|
if (!*tmp)
|
||||||
goto error;
|
return 0;
|
||||||
|
|
||||||
boot_file = tmp;
|
boot_file = tmp;
|
||||||
while(*tmp && *tmp != '\n')
|
while(*tmp && *tmp != '\n')
|
||||||
{
|
{
|
||||||
if((*tmp == '\\') || (*tmp == ':'))
|
if ((*tmp == '\\') || (*tmp == ':'))
|
||||||
boot_file = tmp + 1;
|
boot_file = tmp + 1;
|
||||||
|
|
||||||
tmp++;
|
tmp++;
|
||||||
@ -212,22 +212,19 @@ static int detect_ps1_game_sub(intfstream_t *fp,
|
|||||||
*game_id++ = toupper(*tmp++);
|
*game_id++ = toupper(*tmp++);
|
||||||
*game_id++ = '-';
|
*game_id++ = '-';
|
||||||
|
|
||||||
if(!isalnum(*tmp))
|
if (!isalnum(*tmp))
|
||||||
tmp++;
|
tmp++;
|
||||||
|
|
||||||
while(isalnum(*tmp))
|
while(isalnum(*tmp))
|
||||||
{
|
{
|
||||||
*game_id++ = *tmp++;
|
*game_id++ = *tmp++;
|
||||||
if(*tmp == '.')
|
if (*tmp == '.')
|
||||||
tmp++;
|
tmp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
*game_id = 0;
|
*game_id = 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
error:
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int detect_ps1_game(intfstream_t *fd, char *game_id)
|
int detect_ps1_game(intfstream_t *fd, char *game_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user