New code style refactor

reviewable/pr43/r1
Jack Andersen 5 years ago
parent e1b29fda7a
commit 7243c687a8
  1. 53
      Example/main.cpp
  2. 2394
      atdna/main.cpp
  3. 35
      atdna/test.cpp
  4. 130
      atdna/test.hpp
  5. 60
      include/LZ77/LZBase.hpp
  6. 41
      include/LZ77/LZLookupTable.hpp
  7. 11
      include/LZ77/LZType10.hpp
  8. 13
      include/LZ77/LZType11.hpp
  9. 17
      include/aes.hpp
  10. 116
      include/athena/ALTTPEnums.hpp
  11. 96
      include/athena/ALTTPFile.hpp
  12. 52
      include/athena/ALTTPFileReader.hpp
  13. 58
      include/athena/ALTTPFileWriter.hpp
  14. 1299
      include/athena/ALTTPQuest.hpp
  15. 314
      include/athena/ALTTPStructs.hpp
  16. 8
      include/athena/Checksums.hpp
  17. 311
      include/athena/ChecksumsLiterals.hpp
  18. 5
      include/athena/Compression.hpp
  19. 184
      include/athena/DNA.hpp
  20. 1765
      include/athena/DNAOp.hpp
  21. 160
      include/athena/DNAYaml.hpp
  22. 36
      include/athena/Dir.hpp
  23. 63
      include/athena/FileInfo.hpp
  24. 81
      include/athena/FileReader.hpp
  25. 133
      include/athena/FileWriter.hpp
  26. 206
      include/athena/Global.hpp
  27. 37
      include/athena/IStream.hpp
  28. 2380
      include/athena/IStreamReader.hpp
  29. 2134
      include/athena/IStreamWriter.hpp
  30. 26
      include/athena/MCFile.hpp
  31. 56
      include/athena/MCFileReader.hpp
  32. 63
      include/athena/MCFileWriter.hpp
  33. 11
      include/athena/MCSlot.hpp
  34. 178
      include/athena/MemoryReader.hpp
  35. 252
      include/athena/MemoryWriter.hpp
  36. 83
      include/athena/PHYSFSFileReader.hpp
  37. 25
      include/athena/SakuraGlobal.hpp
  38. 46
      include/athena/SkywardSwordFile.hpp
  39. 20
      include/athena/SkywardSwordFileReader.hpp
  40. 19
      include/athena/SkywardSwordFileWriter.hpp
  41. 81
      include/athena/SkywardSwordQuest.hpp
  42. 112
      include/athena/Socket.hpp
  43. 94
      include/athena/Sprite.hpp
  44. 326
      include/athena/SpriteFile.hpp
  45. 26
      include/athena/SpriteFileReader.hpp
  46. 24
      include/athena/SpriteFileWriter.hpp
  47. 56
      include/athena/SpriteFrame.hpp
  48. 198
      include/athena/SpritePart.hpp
  49. 27
      include/athena/Types.hpp
  50. 231
      include/athena/Utility.hpp
  51. 77
      include/athena/VectorWriter.hpp
  52. 311
      include/athena/WiiBanner.hpp
  53. 398
      include/athena/WiiFile.hpp
  54. 107
      include/athena/WiiImage.hpp
  55. 99
      include/athena/WiiSave.hpp
  56. 60
      include/athena/WiiSaveReader.hpp
  57. 56
      include/athena/WiiSaveWriter.hpp
  58. 180
      include/athena/YAMLCommon.hpp
  59. 304
      include/athena/YAMLDocReader.hpp
  60. 238
      include/athena/YAMLDocWriter.hpp
  61. 261
      include/athena/ZQuestFile.hpp
  62. 49
      include/athena/ZQuestFileReader.hpp
  63. 51
      include/athena/ZQuestFileWriter.hpp
  64. 424
      include/athena/simd/parallelism_v2_simd.hpp
  65. 27
      include/athena/simd/simd.hpp
  66. 65
      include/athena/simd/simd_avx.hpp
  67. 119
      include/athena/simd/simd_sse.hpp
  68. 6
      include/bn.hpp
  69. 7
      include/ec.hpp
  70. 962
      include/optional.hpp
  71. 163
      src/LZ77/LZBase.cpp
  72. 209
      src/LZ77/LZLookupTable.cpp
  73. 211
      src/LZ77/LZType10.cpp
  74. 398
      src/LZ77/LZType11.cpp
  75. 949
      src/aes.cpp
  76. 51
      src/athena/ALTTPFile.cpp
  77. 416
      src/athena/ALTTPFileReader.cpp
  78. 389
      src/athena/ALTTPFileWriter.cpp
  79. 920
      src/athena/ALTTPQuest.cpp
  80. 392
      src/athena/Checksums.cpp
  81. 554
      src/athena/Compression.cpp
  82. 2037
      src/athena/DNAYaml.cpp
  83. 111
      src/athena/Dir.cpp
  84. 239
      src/athena/FileInfo.cpp
  85. 303
      src/athena/FileReader.cpp
  86. 351
      src/athena/FileReaderWin32.cpp
  87. 47
      src/athena/FileWriterGeneric.cpp
  88. 173
      src/athena/FileWriterNix.cpp
  89. 192
      src/athena/FileWriterWin32.cpp
  90. 111
      src/athena/Global.cpp
  91. 57
      src/athena/MCFile.cpp
  92. 34
      src/athena/MCFileReader.cpp
  93. 58
      src/athena/MCFileWriter.cpp
  94. 9
      src/athena/MCSlot.cpp
  95. 272
      src/athena/MemoryReader.cpp
  96. 472
      src/athena/MemoryWriter.cpp
  97. 228
      src/athena/PHYSFSFileReader.cpp
  98. 61
      src/athena/SkywardSwordFile.cpp
  99. 100
      src/athena/SkywardSwordFileReader.cpp
  100. 90
      src/athena/SkywardSwordFileWriter.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

@ -5,54 +5,51 @@
#include <wiiuse/wpad.h>
#endif
static void *xfb = nullptr;
static void* xfb = nullptr;
static GXRModeObj* rmode = nullptr;
#endif
#include <athena/MemoryReader.hpp>
int main()
{
int main() {
#if GEKKO
VIDEO_Init();
VIDEO_Init();
#if HW_RVL
WPAD_Init();
WPAD_Init();
#endif
PAD_Init();
PAD_Init();
rmode = VIDEO_GetPreferredMode(nullptr);
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
rmode = VIDEO_GetPreferredMode(nullptr);
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
CON_Init(xfb, 20, 20, rmode->fbWidth, rmode->xfbHeight, rmode->fbWidth * VI_DISPLAY_PIX_SZ);
CON_EnableGecko(CARD_SLOTB, true);
CON_Init(xfb, 20, 20, rmode->fbWidth, rmode->xfbHeight, rmode->fbWidth * VI_DISPLAY_PIX_SZ);
CON_EnableGecko(CARD_SLOTB, true);
VIDEO_Configure(rmode);
VIDEO_SetBlack(false);
VIDEO_Configure(rmode);
VIDEO_SetBlack(false);
VIDEO_Flush();
VIDEO_Flush();
VIDEO_WaitVSync();
if (rmode->viTVMode & VI_NON_INTERLACE)
VIDEO_WaitVSync();
if (rmode->viTVMode & VI_NON_INTERLACE)
VIDEO_WaitVSync();
athena::io::MemoryCopyReader test("sd:/test.dat");
while(true)
{
athena::io::MemoryCopyReader test("sd:/test.dat");
while (true) {
#if HW_RVL
WPAD_ScanPads();
WPAD_ScanPads();
#endif
PAD_ScanPads();
if (PAD_ButtonsDown(0) & PAD_BUTTON_START)
break;
PAD_ScanPads();
if (PAD_ButtonsDown(0) & PAD_BUTTON_START)
break;
#if HW_RVL
if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME)
break;
if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME)
break;
#endif
VIDEO_WaitVSync();
}
VIDEO_WaitVSync();
}
#endif
return 0;
return 0;
}

File diff suppressed because it is too large Load Diff

@ -3,22 +3,21 @@
#define EXPECTED_BYTES 281
int main(int argc, const char** argv)
{
TESTFile<atUint32, 2> file = {};
file.arrCount[0] = 2;
file.array.push_back(42);
file.array.push_back(64);
size_t binSize = 0;
file.binarySize(binSize);
athena::io::MemoryCopyWriter w(nullptr, binSize);
atInt64 pos = w.position();
file.write(w);
bool pass = !w.hasError() && w.position() - pos == binSize && binSize == EXPECTED_BYTES;
if (pass)
printf("[PASS] %" PRISize " bytes written\n", size_t(w.position() - pos));
else
printf("[FAIL] %" PRISize " bytes written; %" PRISize " bytes sized; %d bytes expected\n",
size_t(w.position() - pos), binSize, EXPECTED_BYTES);
return pass ? 0 : 1;
int main(int argc, const char** argv) {
TESTFile<atUint32, 2> file = {};
file.arrCount[0] = 2;
file.array.push_back(42);
file.array.push_back(64);
size_t binSize = 0;
file.binarySize(binSize);
athena::io::MemoryCopyWriter w(nullptr, binSize);
atInt64 pos = w.position();
file.write(w);
bool pass = !w.hasError() && w.position() - pos == binSize && binSize == EXPECTED_BYTES;
if (pass)
printf("[PASS] %" PRISize " bytes written\n", size_t(w.position() - pos));
else
printf("[FAIL] %" PRISize " bytes written; %" PRISize " bytes sized; %d bytes expected\n",
size_t(w.position() - pos), binSize, EXPECTED_BYTES);
return pass ? 0 : 1;
}

@ -3,87 +3,71 @@
using namespace athena;
typedef io::DNA<Big> BigDNA;
enum ETest : atUint8
{
ZERO,
ONE,
TWO,
THREE
};
enum ETest : atUint8 { ZERO, ONE, TWO, THREE };
template <ETest EVal>
struct AT_SPECIALIZE_PARMS(ETest::ZERO, ETest::ONE, ETest::TWO, ETest::THREE)
TESTSubFile : public BigDNA
{
AT_DECL_DNA
Value<ETest> varE = EVal;
Value<atUint32> sub1;
Value<atUint32> sub2;
struct AT_SPECIALIZE_PARMS(ETest::ZERO, ETest::ONE, ETest::TWO, ETest::THREE) TESTSubFile : public BigDNA {
AT_DECL_DNA
Value<ETest> varE = EVal;
Value<atUint32> sub1;
Value<atUint32> sub2;
};
struct TESTSubClassFile : public TESTSubFile<ETest::ONE>
{
AT_DECL_DNA
Value<atUint32> sub3;
Value<atUint16> sub4;
struct TESTSubClassFile : public TESTSubFile<ETest::ONE> {
AT_DECL_DNA
Value<atUint32> sub3;
Value<atUint16> sub4;
};
struct TESTSubSubClassFile : public TESTSubClassFile
{
AT_DECL_DNA
Value<atUint32> sub5;
Value<atUint32> sub6;
struct TESTSubSubClassFile : public TESTSubClassFile {
AT_DECL_DNA
Value<atUint32> sub5;
Value<atUint32> sub6;
};
template <class Var32Tp, int Var32Val>
struct AT_SPECIALIZE_PARMS(atUint16, 42, atUint32, 87, atUint32, 2)
TESTFile : public BigDNA
{
struct AT_SPECIALIZE_PARMS(atUint16, 42, atUint32, 87, atUint32, 2) TESTFile : public BigDNA {
AT_DECL_DNA
Value<bool> varBool;
AT_OVERRIDE_RCRC32(12345678) Value<Var32Tp> x4_var32 = Var32Val;
AT_OVERRIDE_RCRC32(deadbabe) Value<atUint16> x8_var16;
Value<atVec3f> vec3;
Value<atVec4f> vec4;
struct TESTNestedSubFile : public BigDNA {
AT_DECL_DNA
Value<bool> varBool;
AT_OVERRIDE_RCRC32(12345678) Value<Var32Tp> x4_var32 = Var32Val;
AT_OVERRIDE_RCRC32(deadbabe) Value<atUint16> x8_var16;
Value<atVec3f> vec3;
Value<atVec4f> vec4;
struct TESTNestedSubFile : public BigDNA
{
AT_DECL_DNA
Value<atUint32> nestSub1;
Value<atUint32> nestSub2;
} nestedSubFile;
using TESTSubFileUsing = TESTSubFile<ETest::TWO>;
TESTSubFileUsing subFile;
Align<4> align;
template <class NestedTp, int NestedVal>
struct AT_SPECIALIZE_PARMS(atInt32, 36, atInt64, 96)
TESTTemplateSubFile : public BigDNA
{
AT_DECL_DNA
Value<NestedTp> explSub1 = NestedVal;
Value<Var32Tp> explSub2 = Var32Val;
};
Value<TESTTemplateSubFile<atInt32, 36>> nestedTemplate1;
Value<TESTTemplateSubFile<atInt64, 96>> nestedTemplate2;
Value<atUint32, Little> arrCount[2];
Vector<atUint32, AT_DNA_COUNT(arrCount[0])> array;
Value<atUint32> arrAltCount;
Vector<atUint32, AT_DNA_COUNT(arrAltCount)> arrayAlt;
Seek<21, Current> seek;
Value<atUint32> arrCount2;
Vector<TESTSubFile<ETest::ZERO>, AT_DNA_COUNT(arrCount[1] + arrCount2)> array2;
Value<atUint32> bufSz;
Buffer<AT_DNA_COUNT(bufSz)> buf;
String<32> str;
WString<64> wstr;
};
Value<atUint32> nestSub1;
Value<atUint32> nestSub2;
} nestedSubFile;
using TESTSubFileUsing = TESTSubFile<ETest::TWO>;
TESTSubFileUsing subFile;
Align<4> align;
template <class NestedTp, int NestedVal>
struct AT_SPECIALIZE_PARMS(atInt32, 36, atInt64, 96) TESTTemplateSubFile : public BigDNA {
AT_DECL_DNA
Value<NestedTp> explSub1 = NestedVal;
Value<Var32Tp> explSub2 = Var32Val;
};
Value<TESTTemplateSubFile<atInt32, 36>> nestedTemplate1;
Value<TESTTemplateSubFile<atInt64, 96>> nestedTemplate2;
Value<atUint32, Little> arrCount[2];
Vector<atUint32, AT_DNA_COUNT(arrCount[0])> array;
Value<atUint32> arrAltCount;
Vector<atUint32, AT_DNA_COUNT(arrAltCount)> arrayAlt;
Seek<21, Current> seek;
Value<atUint32> arrCount2;
Vector<TESTSubFile<ETest::ZERO>, AT_DNA_COUNT(arrCount[1] + arrCount2)> array2;
Value<atUint32> bufSz;
Buffer<AT_DNA_COUNT(bufSz)> buf;
String<32> str;
WString<64> wstr;
};

@ -3,40 +3,38 @@
#include <string>
#include "LZ77/LZLookupTable.hpp"
class LZBase
{
class LZBase {
public:
explicit LZBase(atInt32 minimumOffset = 1, atInt32 slidingWindow = 4096, atInt32 minimumMatch = 3, atInt32 blockSize = 8);
virtual ~LZBase() {}
virtual atUint32 compress(const atUint8* src, atUint8** dest, atUint32 srcLength) = 0;
virtual atUint32 decompress(const atUint8* src, atUint8** dest, atUint32 srcLength) = 0;
void setSlidingWindow(atInt32 SlidingWindow);
atInt32 slidingWindow();
void setReadAheadBuffer(atInt32 ReadAheadBuffer);
atInt32 readAheadBuffer();
void setMinMatch(atInt32 minimumMatch);
atInt32 minMatch();
void setBlockSize(atInt32 BlockSize);
atInt32 blockSize();
void setMinimumOffset(atUint32 minimumOffset);
atUint32 minimumOffset();
explicit LZBase(atInt32 minimumOffset = 1, atInt32 slidingWindow = 4096, atInt32 minimumMatch = 3,
atInt32 blockSize = 8);
virtual ~LZBase() {}
virtual atUint32 compress(const atUint8* src, atUint8** dest, atUint32 srcLength) = 0;
virtual atUint32 decompress(const atUint8* src, atUint8** dest, atUint32 srcLength) = 0;
void setSlidingWindow(atInt32 SlidingWindow);
atInt32 slidingWindow();
void setReadAheadBuffer(atInt32 ReadAheadBuffer);
atInt32 readAheadBuffer();
void setMinMatch(atInt32 minimumMatch);
atInt32 minMatch();
void setBlockSize(atInt32 BlockSize);
atInt32 blockSize();
void setMinimumOffset(atUint32 minimumOffset);
atUint32 minimumOffset();
private:
atInt32 subMatch(const atUint8* str1, const uint8_t* str2, const atInt32 len);
LZLengthOffset windowSearch(atUint8* beginSearchPtr, atUint8* searchPosPtr, atUint8* endLABufferPtr,
atUint8* startLBPtr);
atInt32 subMatch(const atUint8* str1, const uint8_t* str2, const atInt32 len);
LZLengthOffset windowSearch(atUint8* beginSearchPtr, atUint8* searchPosPtr, atUint8* endLABufferPtr, atUint8* startLBPtr);
protected:
LZLengthOffset search(atUint8* posPtr, atUint8* dataBegin, atUint8* dataEnd);
atInt32 m_slidingWindow;
atInt32 m_readAheadBuffer;
atInt32 m_minMatch;//Minimum number of bytes that have to matched to go through with compression
atInt32 m_blockSize;
atUint32 m_minOffset;
LZLookupTable m_lookupTable;
LZLengthOffset search(atUint8* posPtr, atUint8* dataBegin, atUint8* dataEnd);
atInt32 m_slidingWindow;
atInt32 m_readAheadBuffer;
atInt32 m_minMatch; // Minimum number of bytes that have to matched to go through with compression
atInt32 m_blockSize;
atUint32 m_minOffset;
LZLookupTable m_lookupTable;
};

@ -6,32 +6,25 @@
#include <cstdint>
#include <athena/Types.hpp>
struct LZLengthOffset
{
atUint32 length;//The number of bytes compressed
atUint16 offset;//How far back in sliding window where bytes that match the lookAheadBuffer is located
bool compare_equal(const LZLengthOffset& lo_pair)
{
return length == lo_pair.length && offset == lo_pair.offset;
}
struct LZLengthOffset {
atUint32 length; // The number of bytes compressed
atUint16 offset; // How far back in sliding window where bytes that match the lookAheadBuffer is located
bool compare_equal(const LZLengthOffset& lo_pair) { return length == lo_pair.length && offset == lo_pair.offset; }
};
class LZLookupTable
{
class LZLookupTable {
public:
LZLookupTable();
LZLookupTable(atInt32 minimumMatch, atInt32 slidingWindow = 4096, atInt32 lookAheadWindow = 18);
~LZLookupTable();
LZLengthOffset search(atUint8* curPos, const atUint8* dataBegin, const atUint8* dataEnd);
void setLookAheadWindow(atInt32 lookAheadWindow);
private:
typedef std::multimap<std::vector<uint8_t>, int32_t> LookupTable;
LookupTable table;
atInt32 m_minimumMatch;
atInt32 m_slidingWindow;
atInt32 m_lookAheadWindow;
std::vector<uint8_t> m_buffer;
LZLookupTable();
LZLookupTable(atInt32 minimumMatch, atInt32 slidingWindow = 4096, atInt32 lookAheadWindow = 18);
~LZLookupTable();
LZLengthOffset search(atUint8* curPos, const atUint8* dataBegin, const atUint8* dataEnd);
void setLookAheadWindow(atInt32 lookAheadWindow);
private:
typedef std::multimap<std::vector<uint8_t>, int32_t> LookupTable;
LookupTable table;
atInt32 m_minimumMatch;
atInt32 m_slidingWindow;
atInt32 m_lookAheadWindow;
std::vector<uint8_t> m_buffer;
};

@ -2,11 +2,10 @@
#include "LZBase.hpp"
class LZType10 : public LZBase
{
class LZType10 : public LZBase {
public:
explicit LZType10(atInt32 minimumOffset = 1, atInt32 SlidingWindow = 4096, atInt32 MinimumMatch = 3, atInt32 BlockSize = 8);
atUint32 compress(const atUint8* src, atUint8** dest, atUint32 srcLength);
atUint32 decompress(const atUint8* src, atUint8** dst, atUint32 srcLen);
explicit LZType10(atInt32 minimumOffset = 1, atInt32 SlidingWindow = 4096, atInt32 MinimumMatch = 3,
atInt32 BlockSize = 8);
atUint32 compress(const atUint8* src, atUint8** dest, atUint32 srcLength);
atUint32 decompress(const atUint8* src, atUint8** dst, atUint32 srcLen);
};

@ -1,14 +1,11 @@
#pragma once
#include "LZBase.hpp"
class LZType11 : public LZBase
{
class LZType11 : public LZBase {
public:
explicit LZType11(atInt32 MinimumOffset = 1, atInt32 SlidingWindow = 4096, atInt32 MinimumMatch = 3, atInt32 BlockSize = 8);
atUint32 compress(const atUint8* src, atUint8** dest, atUint32 srcLength);
atUint32 decompress(const atUint8* src, atUint8** dest, atUint32 srcLength);
explicit LZType11(atInt32 MinimumOffset = 1, atInt32 SlidingWindow = 4096, atInt32 MinimumMatch = 3,
atInt32 BlockSize = 8);
atUint32 compress(const atUint8* src, atUint8** dest, atUint32 srcLength);
atUint32 decompress(const atUint8* src, atUint8** dest, atUint32 srcLength);
};

@ -4,19 +4,16 @@
#include <cstdlib>
#include <memory>
namespace athena
{
namespace athena {
class IAES
{
class IAES {
public:
virtual ~IAES() {}
virtual void encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len)=0;
virtual void decrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len)=0;
virtual void setKey(const uint8_t* key)=0;
virtual ~IAES() {}
virtual void encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len) = 0;
virtual void decrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len) = 0;
virtual void setKey(const uint8_t* key) = 0;
};
std::unique_ptr<IAES> NewAES();
}
} // namespace athena

@ -2,92 +2,56 @@
#include "Types.hpp"
namespace athena
{
namespace athena {
enum BowType : char
{
BowNone,
BowArrows,
BowSilverArrows
};
enum BowType : char { BowNone, BowArrows, BowSilverArrows };
enum BoomerangType : char
{
BoomerangNone,
BoomerangBlue,
BoomerangRed
};
enum BoomerangType : char { BoomerangNone, BoomerangBlue, BoomerangRed };
enum MagicType : char
{
MagicNone,
MagicMushroom,
MagicPowder
};
enum MagicType : char { MagicNone, MagicMushroom, MagicPowder };
enum ArmorType : char
{
GreenJerkin,
BlueMail,
RedMail
};
enum ArmorType : char { GreenJerkin, BlueMail, RedMail };
enum BottleType : char
{
BottleNone,
BottleMushroom, // No Use
BottleEmpty,
BottleRedPotion,
BottleBluePotion,
BottleFairy,
BottleBee,
BottleGoodBee
enum BottleType : char {
BottleNone,
BottleMushroom, // No Use
BottleEmpty,
BottleRedPotion,
BottleBluePotion,
BottleFairy,
BottleBee,
BottleGoodBee
};
enum ALTTPStartLocation { LinksHouse = 0x00, Sanctuary = 0x01, Any = 0x05 };
enum ALTTPStartLocation
{
LinksHouse = 0x00,
Sanctuary = 0x01,
Any = 0x05
};
enum ALTTPProgressIndicator
{
LinkInBed,
InCastleWithSword,
CompletedFirstDungeon,
BeatenAghanim
};
enum ALTTPProgressIndicator { LinkInBed, InCastleWithSword, CompletedFirstDungeon, BeatenAghanim };
enum ALTTPMapIcon
{
Nothing = 0x00, //?
CrossInKakariko = 0x01, //?
CrossAtFirstDungeon = 0x02, //
Pendant = 0x03,
MasterSword = 0x04,
AganhimCastle = 0x05,
Crystal1 = 0x06,
AllCrystals = 0x07,
AganhimGanonTower = 0x08
enum ALTTPMapIcon {
Nothing = 0x00, //?
CrossInKakariko = 0x01, //?
CrossAtFirstDungeon = 0x02, //
Pendant = 0x03,
MasterSword = 0x04,
AganhimCastle = 0x05,
Crystal1 = 0x06,
AllCrystals = 0x07,
AganhimGanonTower = 0x08
};
enum ALTTPTagAlong
{
Noone,
Zelda,
Unknown1,
Oldman,
ZeldaMessage,
Blind,
DwarfFrog,
DwarfLW,
Kiki,
Unknown2,
TheifsChest,
AfterBoss
enum ALTTPTagAlong {
Noone,
Zelda,
Unknown1,
Oldman,
ZeldaMessage,
Blind,
DwarfFrog,
DwarfLW,
Kiki,
Unknown2,
TheifsChest,
AfterBoss
};
} // zelda
} // namespace athena

@ -3,8 +3,7 @@
#include "athena/Global.hpp"
#include <vector>
namespace athena
{
namespace athena {
class ALTTPQuest;
@ -14,61 +13,58 @@ class ALTTPQuest;
* Contains all relevant data for an A Link to the Past
* SRM file.
*/
class ALTTPFile
{
class ALTTPFile {
public:
/*! \brief Quest Iterator
*
* An Iterator typedef for iterating through the Quest lists
*/
typedef std::vector<ALTTPQuest*>::iterator QuestIter;
/*! \brief Quest Iterator
*
* An Iterator typedef for iterating through the Quest lists
*/
typedef std::vector<ALTTPQuest*>::iterator QuestIter;
/*! \brief Default constructor
*
*
*/
ALTTPFile();
/*! \brief Default constructor
*
*
*/
ALTTPFile();
/*! \brief Constructor
*
* \param questList The primary quest list
* \param backupList The backup quest list
*/
ALTTPFile(std::vector<ALTTPQuest*> questList, std::vector<ALTTPQuest*> backupList);
/*! \brief Constructor
*
* \param questList The primary quest list
* \param backupList The backup quest list
*/
ALTTPFile(std::vector<ALTTPQuest*> questList, std::vector<ALTTPQuest*> backupList);
/*! \brief Sets a quest at the given index
*
* \param id Index to the given quest
* \param val The new quest to assign to the given index
* \throw InvalidOperationException on index out of range
*/
void setQuest(atUint32 id, ALTTPQuest* val);
/*! \brief Returns the primary quest list
*
* \return The primary quest list
*/
std::vector<ALTTPQuest*> questList() const;
/*! \brief Sets a quest at the given index
*
* \param id Index to the given quest
* \param val The new quest to assign to the given index
* \throw InvalidOperationException on index out of range
*/
void setQuest(atUint32 id, ALTTPQuest* val);
/*! \brief Returns the primary quest list
*
* \return The primary quest list
*/
std::vector<ALTTPQuest*> questList() const;
/*! \brief Returns a quest at the given index
*
* Returns a quest at the given index
*
* \return ALTTPQuest*
* \throw InvalidOperationException on index out of range
*/
ALTTPQuest* quest(atUint32 id) const;
/*! \brief Returns a quest at the given index
*
* Returns a quest at the given index
*
* \return ALTTPQuest*
* \throw InvalidOperationException on index out of range
*/
ALTTPQuest* quest(atUint32 id) const;
/*! \brief Returns the number of primary quests
*
* \return The number of quests
*/
atUint32 questCount() const;
/*! \brief Returns the number of primary quests
*
* \return The number of quests
*/
atUint32 questCount() const;
private:
std::vector<ALTTPQuest*> m_quests;
std::vector<ALTTPQuest*> m_backup;
std::vector<ALTTPQuest*> m_quests;
std::vector<ALTTPQuest*> m_backup;
};
} // zelda
} // namespace athena

@ -5,12 +5,10 @@
#include "athena/MemoryReader.hpp"
#include "athena/ALTTPQuest.hpp"
namespace athena
{
namespace athena {
class ALTTPFile;
namespace io
{
namespace io {
/*! \class ALTTPFileReader
* \brief A Link to the Past save data reader class
*
@ -18,32 +16,32 @@ namespace io
* all work is done using a memory buffer, and not read directly from the disk.
* \sa BinaryReader
*/
class ALTTPFileReader : protected MemoryCopyReader
{
class ALTTPFileReader : protected MemoryCopyReader {
public:
/*! \brief This constructor takes an existing buffer to read from.
*
* \param data The existing buffer
* \param length The length of the existing buffer
*/
ALTTPFileReader(atUint8*, atUint64);
/*! \brief This constructor takes an existing buffer to read from.
*
* \param data The existing buffer
* \param length The length of the existing buffer
*/
ALTTPFileReader(atUint8*, atUint64);
/*! \brief This constructor creates an instance from a file on disk.
*
* \param filename The file to create the stream from
*/
ALTTPFileReader(const std::string&);
/*! \brief This constructor creates an instance from a file on disk.
*
* \param filename The file to create the stream from
*/
ALTTPFileReader(const std::string&);
/*! \brief Reads the SRAM data from the buffer
*
* \return ALTTPFile* SRAM data
*/
ALTTPFile* readFile();
/*! \brief Reads the SRAM data from the buffer
*
* \return ALTTPFile* SRAM data
*/
ALTTPFile* readFile();
private:
ALTTPRoomFlags* readRoomFlags();
ALTTPOverworldEvent* readOverworldEvent();
ALTTPDungeonItemFlags readDungeonFlags();
ALTTPRoomFlags* readRoomFlags();
ALTTPOverworldEvent* readOverworldEvent();
ALTTPDungeonItemFlags readDungeonFlags();
};
} // io
} // zelda
} // namespace io
} // namespace athena

@ -4,12 +4,10 @@
#include "athena/MemoryWriter.hpp"
#include "athena/ALTTPQuest.hpp"
namespace athena
{
namespace athena {
class ALTTPFile;
namespace io
{
namespace io {
/*! \class ALTTPFileWriter
* \brief A Link to the Past save data writer class
*
@ -17,35 +15,33 @@ namespace io
* all work is done using a memory buffer, and not written directly to the disk.
* \sa BinaryReader
*/
class ALTTPFileWriter : protected MemoryCopyWriter
{
class ALTTPFileWriter : protected MemoryCopyWriter {
public:
/*! \brief This constructor takes an existing buffer to write to.
*
* \param data The existing buffer
* \param length The length of the existing buffer
*/
ALTTPFileWriter(atUint8*, atUint64);
/*! \brief This constructor creates an instance from a file on disk.
*
* \param filename The file to create the stream from
*/
ALTTPFileWriter(const std::string&);
/*! \brief Writes the given SRAM data to a file on disk
*
* \param file SRAM data to right
*/
void writeFile(ALTTPFile* file);
/*! \brief This constructor takes an existing buffer to write to.
*
* \param data The existing buffer
* \param length The length of the existing buffer
*/
ALTTPFileWriter(atUint8*, atUint64);
/*! \brief This constructor creates an instance from a file on disk.
*
* \param filename The file to create the stream from
*/
ALTTPFileWriter(const std::string&);
/*! \brief Writes the given SRAM data to a file on disk
*
* \param file SRAM data to right
*/
void writeFile(ALTTPFile* file);
private:
void writeRoomFlags(ALTTPRoomFlags*);
void writeOverworldEvent(ALTTPOverworldEvent*);
void writeDungeonItems(ALTTPDungeonItemFlags);
atUint16 calculateChecksum(atUint32 game);
void writeRoomFlags(ALTTPRoomFlags*);
void writeOverworldEvent(ALTTPOverworldEvent*);
void writeDungeonItems(ALTTPDungeonItemFlags);
atUint16 calculateChecksum(atUint32 game);
};
} // io
} // zelda
} // namespace io
} // namespace athena

File diff suppressed because it is too large Load Diff

@ -3,196 +3,176 @@
#include <string>
#include "athena/Types.hpp"
namespace athena
{
struct ALTTPRoomFlags
{
bool Chest1: 1;
bool Chest2: 1;
bool Chest3: 1;
bool Chest4: 1;
bool Quadrant1: 1;
bool Quadrant2: 1;
bool Quadrant3: 1;
bool Quadrant4: 1;
bool Door1: 1;
bool Door2: 1;
bool Door3: 1;
bool Door4: 1;
bool BossBattleWon: 1;
bool Key: 1;
bool KeyOrChest: 1;
bool ChestOrTile: 1;
namespace athena {
struct ALTTPRoomFlags {
bool Chest1 : 1;
bool Chest2 : 1;
bool Chest3 : 1;
bool Chest4 : 1;
bool Quadrant1 : 1;
bool Quadrant2 : 1;
bool Quadrant3 : 1;
bool Quadrant4 : 1;
bool Door1 : 1;
bool Door2 : 1;
bool Door3 : 1;
bool Door4 : 1;
bool BossBattleWon : 1;
bool Key : 1;
bool KeyOrChest : 1;
bool ChestOrTile : 1;
};
struct ALTTPOverworldEvent
{
bool Unused1: 1;
bool HeartPiece: 1;
bool Overlay: 1;
bool Unused2: 1;
bool Unused3: 1;
bool Unused4: 1;
bool Set: 1;
bool Unused5: 1;
struct ALTTPOverworldEvent {
bool Unused1 : 1;
bool HeartPiece : 1;
bool Overlay : 1;
bool Unused2 : 1;
bool Unused3 : 1;
bool Unused4 : 1;
bool Set : 1;
bool Unused5 : 1;
};
struct ALTTPInventory
{
char Bow;
char Boomerang;
bool Hookshot;
char Bombs; // Bomb count
char Magic;
bool FireRod;
bool IceRod;
bool Bombos;
bool Ether;
bool Quake;
bool Torch;
bool Hammer;
char Flute;
bool BugNet;
bool Book;
bool Bottles;
bool Somaria;
bool Byrna;
bool MagicCape;
char MagicMirror;
char Gloves;
char Boots;
bool Flippers;
bool MoonPearl;
char Unused; //?
char Sword;
char Shield;
char Armor;
char BottleTypes[4];
struct ALTTPInventory {
char Bow;
char Boomerang;
bool Hookshot;
char Bombs; // Bomb count
char Magic;
bool FireRod;
bool IceRod;
bool Bombos;
bool Ether;
bool Quake;
bool Torch;
bool Hammer;
char Flute;
bool BugNet;
bool Book;
bool Bottles;
bool Somaria;
bool Byrna;
bool MagicCape;
char MagicMirror;
char Gloves;
char Boots;
bool Flippers;
bool MoonPearl;
char Unused; //?
char Sword;
char Shield;
char Armor;
char BottleTypes[4];
};
/*! \struct ALTTPLightDarkWorldIndicator
*/
struct ALTTPLightDarkWorldIndicator
{
bool Unused1: 1;
bool Unused2: 1;
bool Unused3: 1;
bool Unused4: 1;
bool Unused5: 1;
bool Unused6: 1;
bool IsDarkWorld: 1;
bool Unused7: 1;
struct ALTTPLightDarkWorldIndicator {
bool Unused1 : 1;
bool Unused2 : 1;
bool Unused3 : 1;
bool Unused4 : 1;
bool Unused5 : 1;
bool Unused6 : 1;
bool IsDarkWorld : 1;
bool Unused7 : 1;
};
struct ALTTPDungeonItemFlags
{
union
{
struct
{
bool Unused1: 1;
bool Unused2: 1;
bool GanonsTower: 1;
bool TurtleRock: 1;
bool GargoylesDomain: 1;
bool TowerOfHera: 1;
bool IcePalace: 1;
bool SkullWoods: 1;
};
atUint8 flags1;
struct ALTTPDungeonItemFlags {
union {
struct {
bool Unused1 : 1;
bool Unused2 : 1;
bool GanonsTower : 1;
bool TurtleRock : 1;
bool GargoylesDomain : 1;
bool TowerOfHera : 1;
bool IcePalace : 1;
bool SkullWoods : 1;
};
union
{
struct
{
bool MiseryMire: 1;
bool DarkPalace: 1;
bool SwampPalace: 1;
bool HyruleCastle2: 1; // unused in orignal game
bool DesertPalace: 1;
bool EasternPalace: 1;
bool HyruleCastle: 1; // unused exist in original game
bool SewerPassage: 1; // unused exist in original game
};
atUint8 flags2;
atUint8 flags1;
};
union {
struct {
bool MiseryMire : 1;
bool DarkPalace : 1;
bool SwampPalace : 1;
bool HyruleCastle2 : 1; // unused in orignal game
bool DesertPalace : 1;
bool EasternPalace : 1;
bool HyruleCastle : 1; // unused exist in original game
bool SewerPassage : 1; // unused exist in original game
};
atUint8 flags2;
};
};
struct ALTTPPendants
{
bool Courage: 1;
bool Wisdom: 1;
bool Power: 1;
bool Unused1: 1;
bool Unused2: 1;
bool Unused3: 1;
bool Unused4: 1;
bool Unused5: 1;
struct ALTTPPendants {
bool Courage : 1;
bool Wisdom : 1;
bool Power : 1;
bool Unused1 : 1;
bool Unused2 : 1;
bool Unused3 : 1;
bool Unused4 : 1;
bool Unused5 : 1;
};
struct ALTTPAbilities
{
bool Nothing: 1; //?
bool Swim: 1;
bool Dash: 1;
bool Pull: 1;
bool Unknown1: 1; //---
bool Talk: 1;
bool Read: 1;
bool Unknown2: 1; //---
struct ALTTPAbilities {
bool Nothing : 1; //?
bool Swim : 1;
bool Dash : 1;
bool Pull : 1;
bool Unknown1 : 1; //---
bool Talk : 1;
bool Read : 1;
bool Unknown2 : 1; //---
};
struct ALTTPCrystals
{
bool MiseryMire: 1;
bool DarkPalace: 1;
bool IcePalace: 1;
bool TurtleRock: 1;
bool SwampPalace: 1;
bool GargoyleDomain: 1;
bool SkullWoods: 1;
struct ALTTPCrystals {
bool MiseryMire : 1;
bool DarkPalace : 1;
bool IcePalace : 1;
bool TurtleRock : 1;
bool SwampPalace : 1;
bool GargoyleDomain : 1;
bool SkullWoods : 1;
};
struct ALTTPMagicUsage
{
bool Normal: 1;
bool Half: 1;
bool Quarter: 1;
bool Unused1: 1;
bool Unused2: 1;
bool Unused3: 1;
bool Unused4: 1;
bool Unused5: 1;
struct ALTTPMagicUsage {
bool Normal : 1;
bool Half : 1;
bool Quarter : 1;
bool Unused1 : 1;
bool Unused2 : 1;
bool Unused3 : 1;
bool Unused4 : 1;
bool Unused5 : 1;
};
struct ALTTPProgressFlags1
{
bool UncleSecretPassage: 1;
bool DyingPriest: 1; //?
bool ZeldaSanctuary: 1; //?
bool Unused1: 1;
bool UncleLeftHouse: 1;
bool BookOfMudora: 1; //? Math says it's a guess need to investigate
bool DwarfPartner: 1; //?
bool Unused2: 1;
struct ALTTPProgressFlags1 {
bool UncleSecretPassage : 1;
bool DyingPriest : 1; //?
bool ZeldaSanctuary : 1; //?
bool Unused1 : 1;
bool UncleLeftHouse : 1;
bool BookOfMudora : 1; //? Math says it's a guess need to investigate
bool DwarfPartner : 1; //?
bool Unused2 : 1;
};
struct ALTTPProgressFlags2
{
bool BottleFromBum: 1;
bool BottleFromSalesMen: 1;
bool Unused1: 1; //?
bool FluteBoy: 1;
bool ThiefsChest: 1;
bool SavedSmithPartner: 1;
bool Unused2: 1; //?
bool SmithsHaveSword: 1;
struct ALTTPProgressFlags2 {
bool BottleFromBum : 1;
bool BottleFromSalesMen : 1;
bool Unused1 : 1; //?
bool FluteBoy : 1;
bool ThiefsChest : 1;
bool SavedSmithPartner : 1;
bool Unused2 : 1; //?
bool SmithsHaveSword : 1;
};
}
} // namespace athena

@ -2,10 +2,10 @@
#include "athena/Global.hpp"
namespace athena::checksums
{
atUint64 crc64(const atUint8* data, atUint64 length, atUint64 seed = 0xFFFFFFFFFFFFFFFF, atUint64 final = 0xFFFFFFFFFFFFFFFF);
namespace athena::checksums {
atUint64 crc64(const atUint8* data, atUint64 length, atUint64 seed = 0xFFFFFFFFFFFFFFFF,
atUint64 final = 0xFFFFFFFFFFFFFFFF);
atUint32 crc32(const atUint8* data, atUint64 length, atUint32 seed = 0xFFFFFFFF, atUint32 final = 0xFFFFFFFF);
atUint16 crc16CCITT(const atUint8* data, atUint64 length, atUint16 seed = 0xFFFF, atUint16 final = 0);
atUint16 crc16(const atUint8* data, atUint64 length, atUint16 seed = 0, atUint16 final = 0);
}
} // namespace athena::checksums

@ -2,196 +2,161 @@
#include <cstdint>
namespace athena::checksums::literals
{
constexpr uint32_t crc32_table[] =
{
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
namespace athena::checksums::literals {
constexpr uint32_t crc32_table[] = {
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832,
0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2,
0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A,
0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3,
0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423,
0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB,
0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4,
0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950,
0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074,
0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525,
0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81,
0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615,
0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76,
0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E,
0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6,
0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A