Skip to content

Commit

Permalink
added multi-softpatching support (#9947)
Browse files Browse the repository at this point in the history
  • Loading branch information
eadmaster authored and eadmaster committed Dec 31, 2020
1 parent c01b2de commit 9dd5924
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions tasks/task_patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,9 @@ bool patch_content(
bool is_ips_pref,
bool is_bps_pref,
bool is_ups_pref,
const char *name_ips,
const char *name_bps,
const char *name_ups,
char *name_ips,
char *name_bps,
char *name_ups,
uint8_t **buf,
void *data)
{
Expand All @@ -747,14 +747,24 @@ bool patch_content(
msg_hash_to_str(MSG_SEVERAL_PATCHES_ARE_EXPLICITLY_DEFINED));
return false;
}

if ( !try_ips_patch(allow_ips, name_ips, buf, size)
&& !try_bps_patch(allow_bps, name_bps, buf, size)
&& !try_ups_patch(allow_ups, name_ups, buf, size))

int i = 1;
while ( try_ips_patch(allow_ips, name_ips, buf, size)
|| try_bps_patch(allow_bps, name_bps, buf, size)
|| try_ups_patch(allow_ups, name_ups, buf, size))
{
/* a valid patch file was found, switch to the next patch by changing the last char of the string */
i++;
name_ips[strlen(name_ips)-1] = '0'+i;
name_bps[strlen(name_bps)-1] = '0'+i;
name_ups[strlen(name_ups)-1] = '0'+i;
}

if( i == 1 )
{
RARCH_LOG("%s\n",
msg_hash_to_str(MSG_DID_NOT_FIND_A_VALID_CONTENT_PATCH));
return false;
return false;
}

return true;
Expand Down

0 comments on commit 9dd5924

Please sign in to comment.