Let us start here, from square one. No, from Zero!

This commit is contained in:
smpn2
2022-09-30 22:45:51 +09:00
parent 14215af0d1
commit b7a60638a4
1005 changed files with 303069 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#pragma once
#include <cstdint>
#include <array>
namespace secplug {
constexpr std::array<uint8_t, 6> encode_secplug_model(const char model[8]) {
// 6-bit character code similar to the one used by avs in its binary xml format.
std::array<uint8_t, 6> packed {};
packed[0] = ((model[0] - 32)) | ((model[1] - 32) << 6);
packed[1] = ((model[1] - 32) >> 2) | ((model[2] - 32) << 4);
packed[2] = ((model[2] - 32) >> 4) | ((model[3] - 32) << 2);
packed[3] = ((model[4] - 32)) | ((model[5] - 32) << 6);
packed[4] = ((model[5] - 32) >> 2) | ((model[6] - 32) << 4);
packed[5] = ((model[6] - 32) >> 4) | ((model[7] - 32) << 2);
return packed;
}
};