Fake ticket views for missing IOS title.

This commit is contained in:
comex 2013-09-11 22:43:00 -04:00
parent 868ab1918b
commit 1f8237c570
1 changed files with 19 additions and 1 deletions

View File

@ -594,13 +594,18 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
ViewCount = FileSize / DiscIO::INANDContentLoader::TICKET_SIZE; ViewCount = FileSize / DiscIO::INANDContentLoader::TICKET_SIZE;
_dbg_assert_msg_(WII_IPC_ES, (ViewCount>0) && (ViewCount<=4), "IOCTL_ES_GETVIEWCNT ticket count seems to be wrong"); _dbg_assert_msg_(WII_IPC_ES, (ViewCount>0) && (ViewCount<=4), "IOCTL_ES_GETVIEWCNT ticket count seems to be wrong");
} }
else if (TitleID >> 32 == 0x00000001)
{
// Fake a ticket view to make IOS reload work.
ViewCount = 1;
}
else else
{ {
ViewCount = 0;
if (TitleID == TITLEID_SYSMENU) if (TitleID == TITLEID_SYSMENU)
{ {
PanicAlertT("There must be a ticket for 00000001/00000002. Your NAND dump is probably incomplete."); PanicAlertT("There must be a ticket for 00000001/00000002. Your NAND dump is probably incomplete.");
} }
ViewCount = 0;
//retVal = ES_NO_TICKET_INSTALLED; //retVal = ES_NO_TICKET_INSTALLED;
} }
} }
@ -651,6 +656,19 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
} }
} }
} }
else if (TitleID >> 32 == 0x00000001)
{
// For IOS titles, the ticket view isn't normally parsed by either the
// SDK or libogc, just passed to LaunchTitle, so this
// shouldn't matter at all. Just fill out some fields just
// to be on the safe side.
u32 Address = Buffer.PayloadBuffer[0].m_Address;
memset(Memory::GetPointer(Address), 0, 0xD8);
Memory::Write_U64(TitleID, Address + 4 + (0x1dc - 0x1d0)); // title ID
Memory::Write_U16(0xffff, Address + 4 + (0x1e4 - 0x1d0)); // unnnown
Memory::Write_U32(0xff00, Address + 4 + (0x1ec - 0x1d0)); // access mask
memset(Memory::GetPointer(Address + 4 + (0x222 - 0x1d0)), 0xff, 0x20); // content permissions
}
else else
{ {
//retVal = ES_NO_TICKET_INSTALLED; //retVal = ES_NO_TICKET_INSTALLED;