mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 09:09:18 +01:00
Linux: Always use libpng from system (#381)
* Always use system libpng on Linux * Remove dependency on boost-crc in DSU (reuse existing implementation)
This commit is contained in:
parent
753040f73a
commit
665a34e518
@ -1,6 +1,5 @@
|
|||||||
#include "input/api/DSU/DSUMessages.h"
|
#include "input/api/DSU/DSUMessages.h"
|
||||||
|
#include "util/crypto/crc32.h"
|
||||||
#include <boost/crc.hpp>
|
|
||||||
|
|
||||||
constexpr uint32_t kMagicClient = 'CUSD';
|
constexpr uint32_t kMagicClient = 'CUSD';
|
||||||
constexpr uint32_t kMagicServer = 'SUSD';
|
constexpr uint32_t kMagicServer = 'SUSD';
|
||||||
@ -17,15 +16,7 @@ void MessageHeader::Finalize(size_t size)
|
|||||||
|
|
||||||
uint32_t MessageHeader::CRC32(size_t size) const
|
uint32_t MessageHeader::CRC32(size_t size) const
|
||||||
{
|
{
|
||||||
const auto tmp = m_crc32;
|
return crc32_calc(this, size);
|
||||||
m_crc32 = 0;
|
|
||||||
|
|
||||||
boost::crc_32_type crc;
|
|
||||||
crc.process_bytes(this, size);
|
|
||||||
const auto result = crc.checksum();
|
|
||||||
|
|
||||||
m_crc32 = tmp;
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MessageHeader::IsClientMessage() const { return m_magic == kMagicClient; }
|
bool MessageHeader::IsClientMessage() const { return m_magic == kMagicClient; }
|
||||||
|
@ -234,6 +234,7 @@ void ppcAsmTest();
|
|||||||
void gx2CopySurfaceTest();
|
void gx2CopySurfaceTest();
|
||||||
void ExpressionParser_test();
|
void ExpressionParser_test();
|
||||||
void FSTVolumeTest();
|
void FSTVolumeTest();
|
||||||
|
void CRCTest();
|
||||||
|
|
||||||
void unitTests()
|
void unitTests()
|
||||||
{
|
{
|
||||||
@ -241,6 +242,7 @@ void unitTests()
|
|||||||
gx2CopySurfaceTest();
|
gx2CopySurfaceTest();
|
||||||
ppcAsmTest();
|
ppcAsmTest();
|
||||||
FSTVolumeTest();
|
FSTVolumeTest();
|
||||||
|
CRCTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
int mainEmulatorHLE()
|
int mainEmulatorHLE()
|
||||||
|
@ -382,4 +382,13 @@ unsigned int crc32_calc(unsigned int c, const void* data, int length)
|
|||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
return ~c;
|
return ~c;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CRCTest()
|
||||||
|
{
|
||||||
|
std::vector<uint8> testData;
|
||||||
|
for (uint8 i = 0; i < 89; i++)
|
||||||
|
testData.emplace_back(i);
|
||||||
|
uint32 r = crc32_calc(0, testData.data(), testData.size());
|
||||||
|
cemu_assert(r == 0x3fc61683);
|
||||||
}
|
}
|
@ -1,3 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
unsigned int crc32_calc(unsigned int c, const void* data, int length);
|
unsigned int crc32_calc(unsigned int c, const void* data, int length);
|
||||||
|
|
||||||
|
inline unsigned int crc32_calc(const void* data, int length)
|
||||||
|
{
|
||||||
|
return crc32_calc(0, data, length);
|
||||||
|
}
|
@ -5,8 +5,11 @@
|
|||||||
"dependencies": [
|
"dependencies": [
|
||||||
"pugixml",
|
"pugixml",
|
||||||
"zlib",
|
"zlib",
|
||||||
"libpng",
|
"zstd",
|
||||||
"zstd",
|
{
|
||||||
|
"name": "libpng",
|
||||||
|
"platform": "!linux"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "libzip",
|
"name": "libzip",
|
||||||
"default-features": false
|
"default-features": false
|
||||||
@ -23,7 +26,6 @@
|
|||||||
"boost-dll",
|
"boost-dll",
|
||||||
"boost-optional",
|
"boost-optional",
|
||||||
"boost-signals2",
|
"boost-signals2",
|
||||||
"boost-crc",
|
|
||||||
"boost-asio",
|
"boost-asio",
|
||||||
"boost-ptr-container",
|
"boost-ptr-container",
|
||||||
"boost-property-tree",
|
"boost-property-tree",
|
||||||
|
Loading…
Reference in New Issue
Block a user