Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Save git hash to .dtm header.
  • Loading branch information
RachelBryk committed Jan 1, 2013
1 parent c728ef2 commit 5fbce28
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Source/Core/Core/Src/Movie.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -687,6 +689,7 @@ void ReadHeader()
g_bClearSave = tmpHeader.bClearSave;
bMemcard = tmpHeader.bMemcard;
bongos = tmpHeader.bongos;
memcpy(revision, tmpHeader.revision, ARRAYSIZE(revision));
}
else
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Core/Src/Movie.h
Expand Up @@ -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");

Expand Down

0 comments on commit 5fbce28

Please sign in to comment.