Initial commit for GitHub migration based on spice2x-25-03-03

This commit is contained in:
sp2xdev
2025-03-10 19:16:49 -07:00
parent 94af8d32c9
commit ed8c72852f
1008 changed files with 296815 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;
}
};