Save git hash to .dtm header.
This commit is contained in:
parent
c728ef2cd3
commit
5fbce28bbc
|
@ -36,6 +36,7 @@
|
||||||
#include "HW/DVDInterface.h"
|
#include "HW/DVDInterface.h"
|
||||||
#include "../../Common/Src/NandPaths.h"
|
#include "../../Common/Src/NandPaths.h"
|
||||||
#include "Crypto/md5.h"
|
#include "Crypto/md5.h"
|
||||||
|
#include "scmrev.h"
|
||||||
|
|
||||||
// The chunk to allocate movie data in multiples of.
|
// The chunk to allocate movie data in multiples of.
|
||||||
#define DTM_BASE_LENGTH (1024)
|
#define DTM_BASE_LENGTH (1024)
|
||||||
|
@ -72,6 +73,7 @@ std::string author = "";
|
||||||
u64 g_titleID = 0;
|
u64 g_titleID = 0;
|
||||||
unsigned char MD5[16];
|
unsigned char MD5[16];
|
||||||
u8 bongos;
|
u8 bongos;
|
||||||
|
u8 revision[20];
|
||||||
|
|
||||||
bool g_bRecordingFromSaveState = false;
|
bool g_bRecordingFromSaveState = false;
|
||||||
bool g_bPolled = false;
|
bool g_bPolled = false;
|
||||||
|
@ -687,6 +689,7 @@ void ReadHeader()
|
||||||
g_bClearSave = tmpHeader.bClearSave;
|
g_bClearSave = tmpHeader.bClearSave;
|
||||||
bMemcard = tmpHeader.bMemcard;
|
bMemcard = tmpHeader.bMemcard;
|
||||||
bongos = tmpHeader.bongos;
|
bongos = tmpHeader.bongos;
|
||||||
|
memcpy(revision, tmpHeader.revision, ARRAYSIZE(revision));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1132,6 +1135,7 @@ void SaveRecording(const char *filename)
|
||||||
strncpy((char *)header.author, author.c_str(),ARRAYSIZE(header.author));
|
strncpy((char *)header.author, author.c_str(),ARRAYSIZE(header.author));
|
||||||
memcpy(header.md5,MD5,16);
|
memcpy(header.md5,MD5,16);
|
||||||
header.bongos = bongos;
|
header.bongos = bongos;
|
||||||
|
memcpy(header.revision, revision, ARRAYSIZE(header.revision));
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
header.uniqueID = 0;
|
header.uniqueID = 0;
|
||||||
|
@ -1189,6 +1193,10 @@ void GetSettings()
|
||||||
if (!Core::g_CoreStartupParameter.bWii)
|
if (!Core::g_CoreStartupParameter.bWii)
|
||||||
g_bClearSave = !File::Exists(SConfig::GetInstance().m_strMemoryCardA);
|
g_bClearSave = !File::Exists(SConfig::GetInstance().m_strMemoryCardA);
|
||||||
bMemcard = SConfig::GetInstance().m_EXIDevice[0] == EXIDEVICE_MEMORYCARD;
|
bMemcard = SConfig::GetInstance().m_EXIDevice[0] == EXIDEVICE_MEMORYCARD;
|
||||||
|
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << std::hex << SCM_REV_STR;
|
||||||
|
ss >> revision;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckMD5()
|
void CheckMD5()
|
||||||
|
|
|
@ -121,7 +121,8 @@ struct DTMHeader {
|
||||||
u8 bongos;
|
u8 bongos;
|
||||||
u8 reserved[15]; // Padding for any new config options
|
u8 reserved[15]; // Padding for any new config options
|
||||||
u8 discChange[40]; // Name of iso file to switch to, for two disc games.
|
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");
|
static_assert(sizeof(DTMHeader) == 256, "DTMHeader should be 256 bytes");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue