Fixed the flashing problems in MP3

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1413 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2008-12-06 11:13:57 +00:00
parent 5712a74ffd
commit 5a3ee9d7af
2 changed files with 27 additions and 15 deletions

View File

@ -164,17 +164,24 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
} }
break; break;
// DVDLowGetCoverReg - called by "Legend of Spyro" // DVDLowGetCoverReg - Called by "Legend of Spyro" and MP3
case 0x7a: case 0x7a:
{ {
LOG(WII_IPC_DVD, "%s executes DVDLowGetCoverReg (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize); 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 // Write zeroes to the out buffer just in case there is some nonsense data there
static u8 coverByte = 0;
Memory::Memset(_BufferOut, 0, _BufferOutSize); 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); u8* buffer = Memory::GetPointer(_BufferOut);
buffer[3] = coverByte; buffer[3] = coverByte;
@ -184,6 +191,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32
coverByte = 0x01; coverByte = 0x01;
return 1; return 1;
*/
} }
break; break;

View File

@ -104,8 +104,9 @@ public:
switch(Buffer.Parameter) 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); u32 TitleID = VolumeHandler::Read32(0);
if (TitleID == 0) if (TitleID == 0)
TitleID = 0xF00DBEEF; TitleID = 0xF00DBEEF;
@ -113,24 +114,27 @@ public:
char* pTitleID = (char*)&TitleID; char* pTitleID = (char*)&TitleID;
char* Path = (char*)Memory::GetPointer(Buffer.PayloadBuffer[0].m_Address); 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; 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); u32 TitleID = VolumeHandler::Read32(0);
if (TitleID == 0) if (TitleID == 0)
TitleID = 0xF00DBEEF; TitleID = 0xF00DBEEF;
// Write the Title ID to 0x00000000 /* This seems to be the right address to write the Title ID to
Memory::Write_U32(TitleID, OutBuffer); because then it shows up in the InBuffer of IOCTL_ES_GETTITLEDIR
//Memory::Write_U32(0x00000000, OutBuffer); 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); LOG(WII_IPC_ES, "ES: IOCTL_ES_GETTITLEID: 0x%x", TitleID);
} }
break; break;