Skip to content

Commit

Permalink
Patch NPDP-GDEV IPL.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Oct 6, 2021
1 parent 495f182 commit 4777344
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mkgbi/mkgbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static void default_apploader_header(struct gcm_apploader_header *ah)
{
memset(ah, 0, sizeof(*ah));

memcpy(ah->date, "2021/04/17", 10);
memcpy(ah->date, "2021/10/06", 10);
ah->entry_point = 0x81200000; /* gets proper endianness later */
}

Expand Down
Binary file modified ppc/apploader/apploader.bin
Binary file not shown.
21 changes: 21 additions & 0 deletions ppc/apploader/apploader.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ enum ipl_revision {
IPL_UNKNOWN,
IPL_NTSC_10_001,
IPL_NTSC_10_002,
IPL_DEV_10,
IPL_NTSC_11_001,
IPL_PAL_10_001,
IPL_PAL_10_002,
Expand All @@ -554,6 +555,8 @@ static enum ipl_revision get_ipl_revision(void)
return IPL_NTSC_10_001;
if (sdata2 == 0x81468fc0 && sdata == 0x814685c0)
return IPL_NTSC_10_002;
if (sdata2 == 0x814695e0 && sdata == 0x81468bc0)
return IPL_DEV_10;
if (sdata2 == 0x81489c80 && sdata == 0x81489120)
return IPL_NTSC_11_001;
if (sdata2 == 0x814b5b20 && sdata == 0x814b4fc0)
Expand Down Expand Up @@ -623,6 +626,18 @@ static void patch_ipl(void)
invalidate_icache_range(start, end);
}
break;
case IPL_DEV_10:
start = (uint32_t *)0x81300dfc;
end = (uint32_t *)0x81301424;
if (start[0] == 0x7c0802a6 && end[-1] == 0x4e800020) {
address = (uint32_t *)0x8130121c;
if (*address == 0x38000000)
*address |= 1;

flush_dcache_range(start, end);
invalidate_icache_range(start, end);
}
break;
case IPL_NTSC_11_001:
case IPL_PAL_10_001:
case IPL_MPAL_11:
Expand Down Expand Up @@ -729,6 +744,12 @@ static void skip_ipl_animation(void)
&& *(uint32_t *)0x814609e0 == 0x81468ac8)
*(uint8_t *)0x81468ae7 = 1;
break;
case IPL_DEV_10:
if (*(uint32_t *)0x81460fe0 == 1
&& !(*(uint16_t *)0x81462b0c & 0x0100)
&& *(uint32_t *)0x81461000 == 0x814690e8)
*(uint8_t *)0x81469107 = 1;
break;
case IPL_NTSC_11_001:
if (*(uint32_t *)0x81481518 == 1
&& !(*(uint16_t *)0x8148370c & 0x0100)
Expand Down

0 comments on commit 4777344

Please sign in to comment.