diff --git a/README.md b/README.md index 0b99043..a6cdffa 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ The release archive contains the following files: See the launcher [README](launcher/README.md) for more details. -## Key differences from FMCB 1.8: +## Key differences from FMCB 1.8 - All OSD initialization code is removed - USB support is dropped from the patcher, so only memory cards are checked for `OSDMENU.CNF` - No ESR support @@ -67,6 +67,9 @@ See the launcher [README](launcher/README.md) for more details. - ELF paths are not checked by the patcher, so every named entry from FMCB config file is displayed in hacked OSDSYS menu - Support for launching applications from MMCE, MX4SIO and APA- and exFAT-formatted HDDs - CD/DVD support was extended to support skipping PS2LOGO, mounting VMCs on MMCE devices, showing visual GameID for PixelFX devices and booting DKWDRV for PS1 discs +- Enhanced support for MechaPwn-patched systems: + - PS2LOGO is patched to always use the disc region + - OSDSYS disc key check is patched out to fix DVD master discs being detected as "invalid" - Integrated Neutrino GSM for disc games and applications - "Unlimited" number of paths for each entry - Support for 1080i and 480p (as line-doubled 240p) video modes @@ -102,6 +105,11 @@ See the MBR [README](mbr/README.md) for more details. OSDMenu comes with the fully-featured launcher that supports running applications from all devices supported by homebrew drivers. See the launcher [README](launcher/README.md) for more details. +## Known issues that will not be fixed + +- For master discs, `PS2LOGO` may appear "inverted". + This issue does not occur when using pressed retail copies. + ## Credits - Everyone involved in developing the original Free MC Boot and OSDSYS patches, especially Neme and jimmikaelkael diff --git a/patcher/include/patterns_fmcb.h b/patcher/include/patterns_fmcb.h index a9ef2d9..a04f3c5 100644 --- a/patcher/include/patterns_fmcb.h +++ b/patcher/include/patterns_fmcb.h @@ -117,7 +117,7 @@ static uint32_t patternDrawButtonPanel_3[] = { static uint32_t patternDrawButtonPanel_3_mask[] = {0xffffffff, 0xffffffff, 0xffffff00, 0xff00ffff, 0xffff0000, // 0xfc000000, 0xffffffff}; -// Patterns for patching the ExecuteDisc function to override the disc launch handlers +// Pattern for patching the ExecuteDisc function to override the disc launch handlers static uint32_t patternExecuteDisc[] = { // ExecuteDisc function 0x27bdfff0, // addiu sp, sp, $fff0 @@ -136,6 +136,16 @@ static uint32_t patternExecuteDisc[] = { static uint32_t patternExecuteDisc_mask[] = {0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffff0, 0xfffffff0, // 0xffffff00, 0x00000000, 0xffffffff, 0xfffffff0, 0xffffff00, 0xffff0000}; +// Pattern for patching DVD key check to always return 0 on ROM 1.60+ +// Used only for fixing master disc detecton on MechaPwn-patched consoles +static uint32_t patternCheckDVDKey[] = { + 0xae020000, // sw v0, 0x00??, s0 + 0x0c000000, // jal checkDVDKey <- patch target, replace with storing 0 into v0 + 0x00000000, // nop + 0xae000000, // sw zero, 0x00??, s0 +}; +static uint32_t patternCheckDVDKey_mask[] = {0xffffff00, 0xff000000, 0xffffffff, 0xffffff00}; + #ifndef HOSD // OSDMenu patterns for patching the disc detection to bypass automatic disc launch static uint32_t patternDetectDisc[] = { diff --git a/patcher/src/patches_fmcb.c b/patcher/src/patches_fmcb.c index ebdb99d..af800a0 100644 --- a/patcher/src/patches_fmcb.c +++ b/patcher/src/patches_fmcb.c @@ -543,6 +543,12 @@ void patchDiscLaunch(uint8_t *osd) { #ifdef HOSD discLaunchHandlers[7] = (uint32_t)launchHDDApplication; // Overwrite HDD application function pointer #endif + + // Patch DVD key check on ROM 1.60+ + ptr = findPatternWithMask(osd, 0x100000, (uint8_t *)patternCheckDVDKey, (uint8_t *)patternCheckDVDKey_mask, sizeof(patternCheckDVDKey)); + if (!ptr) + return; + _sw(0x24020000, (uint32_t)ptr + 4); // patch the function call to return 0 instead } // Patches automatic disc launch for OSDMenu diff --git a/utils/loader/src/loader.c b/utils/loader/src/loader.c index 734069b..72dee74 100644 --- a/utils/loader/src/loader.c +++ b/utils/loader/src/loader.c @@ -326,9 +326,12 @@ int loadELFFromFile(int argc, char *argv[]) { shutdownDEV9(dev9ShutdownType); if (!strcmp(argv[0], "rom0:PS2LOGO")) { - // Apply PS2LOGO patch, keep libcdvd initialized for PS2LOGO + // Apply PS2LOGO patch and force IOP reset patchPS2LOGO(elfdata.epc); - } else if (!strncmp(argv[0], "cdrom", 5)) + sceCdInit(SCECdEXIT); + doIOPReset = 1; + } + if (!strncmp(argv[0], "cdrom", 5)) // Deinit libcdvd if argv[0] points to cdrom sceCdInit(SCECdEXIT);