DiskIO: Clean up GetTMD() API.

This commit is contained in:
magumagu
2014-06-15 21:27:23 -07:00
committed by JosJuice
parent b1df4e5986
commit 4bb48d09dd
5 changed files with 20 additions and 15 deletions

View File

@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <cinttypes>
#include <memory>
#include "Common/CommonTypes.h"
#include "Common/Logging/LogManager.h"
@ -113,11 +114,10 @@ bool CWII_IPC_HLE_Device_di::IOCtlV(u32 _CommandAddress)
INFO_LOG(WII_IPC_DVD, "DVDLowOpenPartition: partition_offset 0x%016" PRIx64, partition_offset);
// Read TMD to the buffer
u8 pTMD[0x800];
u32 tmdSz;
VolumeHandler::GetVolume()->GetTMD(pTMD, &tmdSz);
Memory::CopyToEmu(CommandBuffer.PayloadBuffer[0].m_Address, pTMD, tmdSz);
WII_IPC_HLE_Interface::ES_DIVerify(pTMD, tmdSz);
u32 tmd_size;
std::unique_ptr<u8[]> tmd_buf = VolumeHandler::GetVolume()->GetTMD(&tmd_size);
Memory::CopyToEmu(CommandBuffer.PayloadBuffer[0].m_Address, tmd_buf.get(), tmd_size);
WII_IPC_HLE_Interface::ES_DIVerify(tmd_buf.get(), tmd_size);
ReturnValue = 1;
}