IOS/ES: Implement ES_AddTicket.

Refactor the existing DiscIO::AddTicket to not require the caller to
pass the requested title ID. We do not have the title ID in the ES case,
and it needs to be extracted from the ticket. Since this is always a
safe operation to do (title ID is always in the ticket), the
implementation is made default.
This commit is contained in:
Pierre Bourdon
2017-01-01 22:09:57 +01:00
parent c30635c70a
commit 2ed352698f
3 changed files with 42 additions and 3 deletions

View File

@ -264,6 +264,18 @@ IPCCommandResult CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
switch (Buffer.Parameter)
{
case IOCTL_ES_ADDTICKET:
{
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 3,
"IOCTL_ES_ADDTICKET wrong number of inputs");
INFO_LOG(WII_IPC_ES, "IOCTL_ES_ADDTICKET");
std::vector<u8> ticket(Buffer.InBuffer[0].m_Size);
Memory::CopyFromEmu(ticket.data(), Buffer.InBuffer[0].m_Address, Buffer.InBuffer[0].m_Size);
DiscIO::AddTicket(ticket);
break;
}
case IOCTL_ES_GETDEVICEID:
{
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1,