Merge pull request #70 from lioncash/fifo-unsigned
Kill off some casting in the FifoPlayer.
This commit is contained in:
commit
48798d8d34
|
@ -64,8 +64,8 @@ public:
|
||||||
u32 *GetXFRegs() { return m_XFRegs; }
|
u32 *GetXFRegs() { return m_XFRegs; }
|
||||||
|
|
||||||
void AddFrame(const FifoFrameInfo &frameInfo);
|
void AddFrame(const FifoFrameInfo &frameInfo);
|
||||||
const FifoFrameInfo &GetFrame(int frame) const { return m_Frames[frame]; }
|
const FifoFrameInfo &GetFrame(size_t frame) const { return m_Frames[frame]; }
|
||||||
int GetFrameCount() { return (int)m_Frames.size(); }
|
size_t GetFrameCount() { return m_Frames.size(); }
|
||||||
|
|
||||||
bool Save(const char *filename);
|
bool Save(const char *filename);
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ void FifoPlaybackAnalyzer::AnalyzeFrames(FifoDataFile *file, std::vector<Analyze
|
||||||
frameInfo.clear();
|
frameInfo.clear();
|
||||||
frameInfo.resize(file->GetFrameCount());
|
frameInfo.resize(file->GetFrameCount());
|
||||||
|
|
||||||
for (int frameIdx = 0; frameIdx < file->GetFrameCount(); ++frameIdx)
|
for (size_t frameIdx = 0; frameIdx < file->GetFrameCount(); ++frameIdx)
|
||||||
{
|
{
|
||||||
const FifoFrameInfo& frame = file->GetFrame(frameIdx);
|
const FifoFrameInfo& frame = file->GetFrame(frameIdx);
|
||||||
AnalyzedFrameInfo& analyzed = frameInfo[frameIdx];
|
AnalyzedFrameInfo& analyzed = frameInfo[frameIdx];
|
||||||
|
|
|
@ -260,7 +260,7 @@ void FifoPlayer::WriteAllMemoryUpdates()
|
||||||
{
|
{
|
||||||
_assert_(m_File);
|
_assert_(m_File);
|
||||||
|
|
||||||
for (int frameNum = 0; frameNum < m_File->GetFrameCount(); ++frameNum)
|
for (size_t frameNum = 0; frameNum < m_File->GetFrameCount(); ++frameNum)
|
||||||
{
|
{
|
||||||
const FifoFrameInfo &frame = m_File->GetFrame(frameNum);
|
const FifoFrameInfo &frame = m_File->GetFrame(frameNum);
|
||||||
for (auto& update : frame.memoryUpdates)
|
for (auto& update : frame.memoryUpdates)
|
||||||
|
|
|
@ -845,12 +845,12 @@ void FifoPlayerDlg::UpdateAnalyzerGui()
|
||||||
FifoPlayer &player = FifoPlayer::GetInstance();
|
FifoPlayer &player = FifoPlayer::GetInstance();
|
||||||
FifoDataFile* file = player.GetFile();
|
FifoDataFile* file = player.GetFile();
|
||||||
|
|
||||||
int num_frames = (file) ? player.GetFile()->GetFrameCount() : 0;
|
size_t num_frames = (file) ? player.GetFile()->GetFrameCount() : 0U;
|
||||||
if ((int)m_framesList->GetCount() != num_frames)
|
if (m_framesList->GetCount() != num_frames)
|
||||||
{
|
{
|
||||||
m_framesList->Clear();
|
m_framesList->Clear();
|
||||||
|
|
||||||
for (int i = 0; i < num_frames; ++i)
|
for (size_t i = 0; i < num_frames; ++i)
|
||||||
{
|
{
|
||||||
m_framesList->Append(wxString::Format(wxT("Frame %i"), i));
|
m_framesList->Append(wxString::Format(wxT("Frame %i"), i));
|
||||||
}
|
}
|
||||||
|
@ -897,8 +897,8 @@ wxString FifoPlayerDlg::CreateRecordingFifoSizeLabel() const
|
||||||
|
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
int fifoBytes = 0;
|
size_t fifoBytes = 0;
|
||||||
for (int i = 0; i < file->GetFrameCount(); ++i)
|
for (size_t i = 0; i < file->GetFrameCount(); ++i)
|
||||||
fifoBytes += file->GetFrame(i).fifoDataSize;
|
fifoBytes += file->GetFrame(i).fifoDataSize;
|
||||||
|
|
||||||
return CreateIntegerLabel(fifoBytes, _("FIFO Byte"));
|
return CreateIntegerLabel(fifoBytes, _("FIFO Byte"));
|
||||||
|
@ -913,8 +913,8 @@ wxString FifoPlayerDlg::CreateRecordingMemSizeLabel() const
|
||||||
|
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
int memBytes = 0;
|
size_t memBytes = 0;
|
||||||
for (int frameNum = 0; frameNum < file->GetFrameCount(); ++frameNum)
|
for (size_t frameNum = 0; frameNum < file->GetFrameCount(); ++frameNum)
|
||||||
{
|
{
|
||||||
const vector<MemoryUpdate>& memUpdates = file->GetFrame(frameNum).memoryUpdates;
|
const vector<MemoryUpdate>& memUpdates = file->GetFrame(frameNum).memoryUpdates;
|
||||||
for (auto& memUpdate : memUpdates)
|
for (auto& memUpdate : memUpdates)
|
||||||
|
@ -933,20 +933,20 @@ wxString FifoPlayerDlg::CreateRecordingFrameCountLabel() const
|
||||||
|
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
int numFrames = file->GetFrameCount();
|
size_t numFrames = file->GetFrameCount();
|
||||||
return CreateIntegerLabel(numFrames, _("Frame"));
|
return CreateIntegerLabel(numFrames, _("Frame"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return wxEmptyString;
|
return wxEmptyString;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString FifoPlayerDlg::CreateIntegerLabel(int size, const wxString& label) const
|
wxString FifoPlayerDlg::CreateIntegerLabel(size_t size, const wxString& label) const
|
||||||
{
|
{
|
||||||
wxString postfix;
|
wxString postfix;
|
||||||
if (size != 1)
|
if (size != 1)
|
||||||
postfix = _("s");
|
postfix = _("s");
|
||||||
|
|
||||||
return wxString::Format(wxT("%i"), size) + wxT(" ") + label + postfix;
|
return wxString::Format(wxT("%u"), size) + wxT(" ") + label + postfix;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FifoPlayerDlg::GetSaveButtonEnabled() const
|
bool FifoPlayerDlg::GetSaveButtonEnabled() const
|
||||||
|
|
|
@ -56,7 +56,7 @@ private:
|
||||||
wxString CreateRecordingFifoSizeLabel() const;
|
wxString CreateRecordingFifoSizeLabel() const;
|
||||||
wxString CreateRecordingMemSizeLabel() const;
|
wxString CreateRecordingMemSizeLabel() const;
|
||||||
wxString CreateRecordingFrameCountLabel() const;
|
wxString CreateRecordingFrameCountLabel() const;
|
||||||
wxString CreateIntegerLabel(int size, const wxString& label) const;
|
wxString CreateIntegerLabel(size_t size, const wxString& label) const;
|
||||||
|
|
||||||
bool GetSaveButtonEnabled() const;
|
bool GetSaveButtonEnabled() const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue