diff --git a/Source/Core/Core/Src/Movie.cpp b/Source/Core/Core/Src/Movie.cpp index 5eb1660d8e..316181d449 100644 --- a/Source/Core/Core/Src/Movie.cpp +++ b/Source/Core/Core/Src/Movie.cpp @@ -36,6 +36,7 @@ #include "HW/DVDInterface.h" #include "../../Common/Src/NandPaths.h" #include "Crypto/md5.h" +#include "scmrev.h" // The chunk to allocate movie data in multiples of. #define DTM_BASE_LENGTH (1024) @@ -72,6 +73,7 @@ std::string author = ""; u64 g_titleID = 0; unsigned char MD5[16]; u8 bongos; +u8 revision[20]; bool g_bRecordingFromSaveState = false; bool g_bPolled = false; @@ -687,6 +689,7 @@ void ReadHeader() g_bClearSave = tmpHeader.bClearSave; bMemcard = tmpHeader.bMemcard; bongos = tmpHeader.bongos; + memcpy(revision, tmpHeader.revision, ARRAYSIZE(revision)); } else { @@ -1132,6 +1135,7 @@ void SaveRecording(const char *filename) strncpy((char *)header.author, author.c_str(),ARRAYSIZE(header.author)); memcpy(header.md5,MD5,16); header.bongos = bongos; + memcpy(header.revision, revision, ARRAYSIZE(header.revision)); // TODO header.uniqueID = 0; @@ -1189,6 +1193,10 @@ void GetSettings() if (!Core::g_CoreStartupParameter.bWii) g_bClearSave = !File::Exists(SConfig::GetInstance().m_strMemoryCardA); bMemcard = SConfig::GetInstance().m_EXIDevice[0] == EXIDEVICE_MEMORYCARD; + + std::stringstream ss; + ss << std::hex << SCM_REV_STR; + ss >> revision; } void CheckMD5() diff --git a/Source/Core/Core/Src/Movie.h b/Source/Core/Core/Src/Movie.h index 2cb4c78e23..79b5e72f29 100644 --- a/Source/Core/Core/Src/Movie.h +++ b/Source/Core/Core/Src/Movie.h @@ -121,7 +121,8 @@ struct DTMHeader { u8 bongos; u8 reserved[15]; // Padding for any new config options u8 discChange[40]; // Name of iso file to switch to, for two disc games. - u8 reserved2[47]; // Make heading 256 bytes, just because we can + u8 revision[20]; // Git hash + u8 reserved2[27]; // Make heading 256 bytes, just because we can }; static_assert(sizeof(DTMHeader) == 256, "DTMHeader should be 256 bytes");