diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp index 94352abca0..aacdb7ba1e 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp @@ -164,17 +164,24 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32 } break; - // DVDLowGetCoverReg - called by "Legend of Spyro" + // DVDLowGetCoverReg - Called by "Legend of Spyro" and MP3 case 0x7a: { LOG(WII_IPC_DVD, "%s executes DVDLowGetCoverReg (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize); - // HACK - switching the 4th byte between 0 and 1 gets through this check - - static u8 coverByte = 0; - + // Write zeroes to the out buffer just in case there is some nonsense data there Memory::Memset(_BufferOut, 0, _BufferOutSize); + // -------------------------------------------------------------------- + /* Hack for Legend of Spyro. Switching the 4th byte between 0 and 1 gets + through this check. The out buffer address remains the same all the + time so we don't have to bother making a global function. + + TODO: Make this compatible with MP3 */ + // ------------------------- + /* + static u8 coverByte = 0; + u8* buffer = Memory::GetPointer(_BufferOut); buffer[3] = coverByte; @@ -184,6 +191,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32 coverByte = 0x01; return 1; + */ } break; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.h index c6219436a7..5e886136cb 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.h @@ -104,8 +104,9 @@ public: switch(Buffer.Parameter) { - case IOCTL_ES_GETTITLEDIR: // ES_GetDataDir in DevKitPro + case IOCTL_ES_GETTITLEDIR: // (0x1d) ES_GetDataDir in DevKitPro { + u32 TitleID_ = Memory::Read_U32(Buffer.InBuffer[0].m_Address);; u32 TitleID = VolumeHandler::Read32(0); if (TitleID == 0) TitleID = 0xF00DBEEF; @@ -113,24 +114,27 @@ public: char* pTitleID = (char*)&TitleID; char* Path = (char*)Memory::GetPointer(Buffer.PayloadBuffer[0].m_Address); - sprintf(Path, "/00010000/%02x%02x%02x%02x/data", (u8)pTitleID[3], (u8)pTitleID[2], (u8)pTitleID[1], (u8)pTitleID[0]); + sprintf(Path, "/00010000/%02x%02x%02x%02x/data", + (u8)pTitleID[3], (u8)pTitleID[2], (u8)pTitleID[1], (u8)pTitleID[0]); - LOG(WII_IPC_ES, "ES: IOCTL_ES_GETTITLEDIR: %s ", Path); + LOG(WII_IPC_ES, "ES: IOCTL_ES_GETTITLEDIR: %s (TitleID: %08x)", Path, TitleID_); } break; - case IOCTL_ES_GETTITLEID: // ES_GetTitleID in DevKitPro + case IOCTL_ES_GETTITLEID: // (0x20) ES_GetTitleID in DevKitPro { - u32 OutBuffer = Memory::Read_U32(Buffer.PayloadBuffer[0].m_Address); - u32 TitleID = VolumeHandler::Read32(0); if (TitleID == 0) TitleID = 0xF00DBEEF; - // Write the Title ID to 0x00000000 - Memory::Write_U32(TitleID, OutBuffer); - //Memory::Write_U32(0x00000000, OutBuffer); - + /* This seems to be the right address to write the Title ID to + because then it shows up in the InBuffer of IOCTL_ES_GETTITLEDIR + that is called right after this. However, I have not seen that this + have any effect by itself, perhaps because it's really only + IOCTL_ES_GETTITLEDIR that matters, and since we ignore the InBuffer in + IOCTL_ES_GETTITLEDIR and read the title from the disc instead + this has no effect. */ + Memory::Write_U32(TitleID, Buffer.PayloadBuffer[0].m_Address); LOG(WII_IPC_ES, "ES: IOCTL_ES_GETTITLEID: 0x%x", TitleID); } break;