This commit is contained in:
twinaphex 2020-03-01 21:57:57 +01:00
parent 5b2ed8a08d
commit cc50cefd30
3 changed files with 15 additions and 20 deletions

View File

@ -338,9 +338,7 @@ static bool input_autoconfigure_joypad_from_conf_internal(
return true;
}
if (string_is_empty(params->autoconfig_directory))
return true;
return false;
return string_is_empty(params->autoconfig_directory);
}
static void input_autoconfigure_params_free(autoconfig_params_t *params)

View File

@ -136,7 +136,7 @@ static int detect_ps1_game_sub(intfstream_t *fp,
is_mode1 = 0;
if (intfstream_seek(fp, 0, SEEK_END) == -1)
goto error;
return 0;
if (!sub_channel_mixed)
{
@ -145,7 +145,7 @@ static int detect_ps1_game_sub(intfstream_t *fp,
unsigned int mode_test = 0;
if (intfstream_seek(fp, 0, SEEK_SET) == -1)
goto error;
return 0;
intfstream_read(fp, &mode_test, 4);
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;
if (intfstream_seek(fp, 156 + skip + 16 * frame_size, SEEK_SET) == -1)
goto error;
return 0;
intfstream_read(fp, buffer, 6);
cd_sector = buffer[2] | (buffer[3] << 8) | (buffer[4] << 16);
if (intfstream_seek(fp, skip + cd_sector * frame_size, SEEK_SET) == -1)
goto error;
return 0;
intfstream_read(fp, buffer, 2048 * 2);
tmp = buffer;
while (tmp < (buffer + 2048 * 2))
{
if (!*tmp)
goto error;
return 0;
if (!strncasecmp((const char*)(tmp + 33), "SYSTEM.CNF;1", 12))
break;
@ -180,11 +180,11 @@ static int detect_ps1_game_sub(intfstream_t *fp,
}
if (tmp >= (buffer + 2048 * 2))
goto error;
return 0;
cd_sector = tmp[2] | (tmp[3] << 8) | (tmp[4] << 16);
if (intfstream_seek(fp, skip + cd_sector * frame_size, SEEK_SET) == -1)
goto error;
return 0;
intfstream_read(fp, buffer, 256);
buffer[256] = '\0';
@ -194,7 +194,7 @@ static int detect_ps1_game_sub(intfstream_t *fp,
tmp++;
if (!*tmp)
goto error;
return 0;
boot_file = tmp;
while(*tmp && *tmp != '\n')
@ -225,9 +225,6 @@ static int detect_ps1_game_sub(intfstream_t *fp,
*game_id = 0;
return 1;
error:
return 0;
}
int detect_ps1_game(intfstream_t *fd, char *game_id)