Make dolphin aware of disc revision numbers. Display them under game properties and use them in netplay.

Patch by johnwchadwick.
Fixed issue 6243.
This commit is contained in:
John Chadwick 2013-04-16 22:29:01 -05:00 committed by Jordan Woyak
parent 2316cb6876
commit 1e6dacf1e4
9 changed files with 39 additions and 8 deletions

View File

@ -34,7 +34,7 @@ struct Rpt : public std::vector<u8>
typedef std::vector<Rpt> NetWiimote;
#define NETPLAY_VERSION "Dolphin NetPlay 2013-03-03"
#define NETPLAY_VERSION "Dolphin NetPlay 2013-04-11"
// messages
enum

View File

@ -38,6 +38,7 @@ public:
virtual void GetTMD(u8*, u32 *_sz) const { *_sz=0; }
virtual std::string GetUniqueID() const = 0;
virtual std::string GetMakerID() const = 0;
virtual int GetRevision() const { return 0; }
// TODO: eliminate?
virtual std::string GetName() const;
virtual std::vector<std::string> GetNames() const = 0;

View File

@ -91,6 +91,18 @@ std::string CVolumeGC::GetMakerID() const
return makerID;
}
int CVolumeGC::GetRevision() const
{
if (!m_pReader)
return 0;
u8 Revision;
if (!Read(7, 1, &Revision))
return 0;
return Revision;
}
std::vector<std::string> CVolumeGC::GetNames() const
{
std::vector<std::string> names;

View File

@ -34,6 +34,7 @@ public:
bool RAWRead(u64 _Offset, u64 _Length, u8* _pBuffer) const;
std::string GetUniqueID() const;
std::string GetMakerID() const;
int GetRevision() const;
std::vector<std::string> GetNames() const;
u32 GetFSTSize() const;
std::string GetApploaderDate() const;

View File

@ -37,7 +37,7 @@
#include "ChunkFile.h"
#include "ConfigManager.h"
static const u32 CACHE_REVISION = 0x113;
static const u32 CACHE_REVISION = 0x114;
#define DVD_BANNER_WIDTH 96
#define DVD_BANNER_HEIGHT 32
@ -48,6 +48,7 @@ GameListItem::GameListItem(const std::string& _rFileName)
: m_FileName(_rFileName)
, m_emu_state(0)
, m_FileSize(0)
, m_Revision(0)
, m_Valid(false)
, m_BlobCompressed(false)
{
@ -77,6 +78,7 @@ GameListItem::GameListItem(const std::string& _rFileName)
m_UniqueID = pVolume->GetUniqueID();
m_BlobCompressed = DiscIO::IsCompressedBlob(_rFileName.c_str());
m_IsDiscTwo = pVolume->IsDiscTwo();
m_Revision = pVolume->GetRevision();
// check if we can get some infos from the banner file too
DiscIO::IFileSystem* pFileSystem = DiscIO::CreateFileSystem(pVolume);
@ -175,6 +177,7 @@ void GameListItem::DoState(PointerWrap &p)
p.Do(m_pImage);
p.Do(m_Platform);
p.Do(m_IsDiscTwo);
p.Do(m_Revision);
}
std::string GameListItem::CreateCacheFilename()

View File

@ -42,6 +42,7 @@ public:
std::string GetName(int index) const;
std::string GetCompany() const;
std::string GetDescription(int index = 0) const;
int GetRevision() const { return m_Revision; }
const std::string& GetUniqueID() const {return m_UniqueID;}
const std::string GetWiiFSPath() const;
DiscIO::IVolume::ECountry GetCountry() const {return m_Country;}
@ -87,6 +88,7 @@ private:
DiscIO::IVolume::ECountry m_Country;
int m_Platform;
int m_Revision;
#if defined(HAVE_WX) && HAVE_WX
wxImage m_Image;

View File

@ -208,6 +208,7 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
}
wxString temp = _T("0x") + StrToWxStr(OpenISO->GetMakerID());
m_MakerID->SetValue(temp);
m_Revision->SetValue(wxString::Format(wxT("%u"), OpenISO->GetRevision()));
m_Date->SetValue(StrToWxStr(OpenISO->GetApploaderDate()));
m_FST->SetValue(wxString::Format(wxT("%u"), OpenISO->GetFSTSize()));
@ -472,6 +473,10 @@ void CISOProperties::CreateGUIControls(bool IsWad)
new wxStaticText(m_Information, wxID_ANY, _("Maker ID:"));
m_MakerID = new wxTextCtrl(m_Information, ID_MAKERID, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
wxStaticText * const m_RevisionText =
new wxStaticText(m_Information, wxID_ANY, _("Revision:"));
m_Revision = new wxTextCtrl(m_Information, ID_REVISION, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
wxStaticText * const m_DateText =
new wxStaticText(m_Information, wxID_ANY, _("Date:"));
m_Date = new wxTextCtrl(m_Information, ID_DATE, wxEmptyString,
@ -509,10 +514,12 @@ void CISOProperties::CreateGUIControls(bool IsWad)
sISODetails->Add(m_Country, wxGBPosition(2, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_MakerIDText, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_MakerID, wxGBPosition(3, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_DateText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_Date, wxGBPosition(4, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_FSTText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_FST, wxGBPosition(5, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_RevisionText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_Revision, wxGBPosition(4, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_DateText, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_Date, wxGBPosition(5, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->Add(m_FSTText, wxGBPosition(6, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sISODetails->Add(m_FST, wxGBPosition(6, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sISODetails->AddGrowableCol(1);
wxStaticBoxSizer * const sbISODetails =
new wxStaticBoxSizer(wxVERTICAL, m_Information, _("ISO Details"));

View File

@ -98,6 +98,7 @@ private:
wxTextCtrl *m_GameID;
wxTextCtrl *m_Country;
wxTextCtrl *m_MakerID;
wxTextCtrl *m_Revision;
wxTextCtrl *m_Date;
wxTextCtrl *m_FST;
wxArrayString arrayStringFor_Lang;
@ -156,6 +157,7 @@ private:
ID_GAMEID,
ID_COUNTRY,
ID_MAKERID,
ID_REVISION,
ID_DATE,
ID_FST,
ID_VERSION,

View File

@ -46,6 +46,9 @@ std::string BuildGameName(const GameListItem& game)
if (name.empty())
name = game.GetVolumeName(lang);
if (game.GetRevision() != 0)
return name + " (" + game.GetUniqueID() + ", Revision " + std::to_string((long long)game.GetRevision()) + ")";
else
return name + " (" + game.GetUniqueID() + ")";
}