summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorRachel Bryk <RachelBryk@gmail.com>2013-01-01 16:18:52 -0500
committerRachel Bryk <RachelBryk@gmail.com>2013-01-01 16:34:07 -0500
commit5fbce28bbce934bbe01cb8cd9acb853e6c8f1707 (patch)
treed67a8f05aab14f76fbedf42b4b83e2c3f5318c21 /Source/Core
parentc728ef2cd30ef803210d5db0a1ecab6b198a2c65 (diff)
Save git hash to .dtm header.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/Movie.cpp8
-rw-r--r--Source/Core/Core/Src/Movie.h3
2 files changed, 10 insertions, 1 deletions
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");