mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Various formatting and consistency fixes
This commit is contained in:
@ -36,7 +36,7 @@ const u32 kBlobCookie = 0xB10BC001;
|
||||
struct CompressedBlobHeader // 32 bytes
|
||||
{
|
||||
u32 magic_cookie; //0xB10BB10B
|
||||
u32 sub_type; // gc image, whatever
|
||||
u32 sub_type; // GC image, whatever
|
||||
u64 compressed_data_size;
|
||||
u64 data_size;
|
||||
u32 block_size;
|
||||
|
@ -3,10 +3,10 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
||||
// DiscScrubber removes the garbage data from discs (currently wii only) which
|
||||
// DiscScrubber removes the garbage data from discs (currently Wii only) which
|
||||
// is on the disc due to encryption
|
||||
|
||||
// It could be adapted to gc discs, but the gain is most likely negligible,
|
||||
// It could be adapted to GameCube discs, but the gain is most likely negligible,
|
||||
// and having 1:1 backups of discs is always nice when they are reasonably sized
|
||||
|
||||
// Note: the technique is inspired by Wiiscrubber, but much simpler - intentionally :)
|
||||
|
@ -86,7 +86,7 @@ private:
|
||||
|
||||
u32 m_totalNameSize;
|
||||
|
||||
// gc has no shift, wii has 2 bit shift
|
||||
// GameCube has no shift, Wii has 2 bit shift
|
||||
u32 m_addressShift;
|
||||
|
||||
// first address on disk containing file data
|
||||
|
@ -46,18 +46,15 @@ bool CVolumeWiiCrypted::RAWRead( u64 _Offset, u64 _Length, u8* _pBuffer ) const
|
||||
// Medal Of Honor Heroes 2 read this DVD offset for PartitionsInfo
|
||||
// and, PartitionsInfo is not encrypted, let's read it directly.
|
||||
if (!m_pReader->Read(_Offset, _Length, _pBuffer))
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
return true;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVolumeWiiCrypted::Read(u64 _ReadOffset, u64 _Length, u8* _pBuffer) const
|
||||
{
|
||||
if (m_pReader == nullptr)
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
while (_Length > 0)
|
||||
{
|
||||
@ -118,16 +115,12 @@ void CVolumeWiiCrypted::GetTMD(u8* _pBuffer, u32 * _sz) const
|
||||
std::string CVolumeWiiCrypted::GetUniqueID() const
|
||||
{
|
||||
if (m_pReader == nullptr)
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
|
||||
char ID[7];
|
||||
|
||||
if (!Read(0, 6, (u8*)ID))
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
|
||||
ID[6] = '\0';
|
||||
|
||||
@ -149,16 +142,12 @@ IVolume::ECountry CVolumeWiiCrypted::GetCountry() const
|
||||
std::string CVolumeWiiCrypted::GetMakerID() const
|
||||
{
|
||||
if (m_pReader == nullptr)
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
|
||||
char makerID[3];
|
||||
|
||||
if (!Read(0x4, 0x2, (u8*)&makerID))
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
|
||||
makerID[2] = '\0';
|
||||
|
||||
@ -181,16 +170,12 @@ std::vector<std::string> CVolumeWiiCrypted::GetNames() const
|
||||
u32 CVolumeWiiCrypted::GetFSTSize() const
|
||||
{
|
||||
if (m_pReader == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 size;
|
||||
|
||||
if (!Read(0x428, 0x4, (u8*)&size))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
@ -198,16 +183,12 @@ u32 CVolumeWiiCrypted::GetFSTSize() const
|
||||
std::string CVolumeWiiCrypted::GetApploaderDate() const
|
||||
{
|
||||
if (m_pReader == nullptr)
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
|
||||
char date[16];
|
||||
|
||||
if (!Read(0x2440, 0x10, (u8*)&date))
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
|
||||
date[10] = '\0';
|
||||
|
||||
@ -217,25 +198,17 @@ std::string CVolumeWiiCrypted::GetApploaderDate() const
|
||||
u64 CVolumeWiiCrypted::GetSize() const
|
||||
{
|
||||
if (m_pReader)
|
||||
{
|
||||
return m_pReader->GetDataSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
u64 CVolumeWiiCrypted::GetRawSize() const
|
||||
{
|
||||
if (m_pReader)
|
||||
{
|
||||
return m_pReader->GetRawSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool CVolumeWiiCrypted::CheckIntegrity() const
|
||||
|
@ -62,7 +62,7 @@ u8* WiiWAD::CreateWADEntry(DiscIO::IBlobReader& _rReader, u32 _Size, u64 _Offset
|
||||
if (_Size > 0)
|
||||
{
|
||||
u8* pTmpBuffer = new u8[_Size];
|
||||
_dbg_assert_msg_(BOOT, pTmpBuffer!=nullptr, "WiiWAD: Cant allocate memory for WAD entry");
|
||||
_dbg_assert_msg_(BOOT, pTmpBuffer!=nullptr, "WiiWAD: Can't allocate memory for WAD entry");
|
||||
|
||||
if (!_rReader.Read(_Offset, _Size, pTmpBuffer))
|
||||
{
|
||||
@ -123,7 +123,7 @@ bool WiiWAD::IsWiiWAD(const std::string& name)
|
||||
CBlobBigEndianReader big_endian_reader(*blob_reader);
|
||||
bool result = false;
|
||||
|
||||
// check for wii wad
|
||||
// check for Wii wad
|
||||
if (big_endian_reader.Read32(0x00) == 0x20)
|
||||
{
|
||||
u32 wad_type = big_endian_reader.Read32(0x04);
|
||||
|
Reference in New Issue
Block a user