2015-05-23 22:55:12 -06:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-17 17:08:10 -06:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 21:43:35 -06:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2014-02-22 15:36:30 -07:00
|
|
|
#include <cstring>
|
2008-12-08 22:29:14 -07:00
|
|
|
#include <wx/grid.h>
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2014-09-07 19:06:58 -06:00
|
|
|
#include "Common/CommonTypes.h"
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2009-01-20 12:15:33 -07:00
|
|
|
// New register view:
|
|
|
|
// R0 0x8000000 F0 0.0000 F0_PS1 0.0000
|
|
|
|
// R1 0x8000000 F1 0.0000 F1_PS1 0.0000
|
|
|
|
// R31 0x8000000 F31 0.0000 F31_PS1 0.0000
|
|
|
|
// PC (specials)
|
|
|
|
// LR
|
|
|
|
// CTR
|
2009-06-13 08:10:10 -06:00
|
|
|
// CR0-7
|
|
|
|
// FPSCR
|
2009-10-17 01:17:49 -06:00
|
|
|
// MSR
|
2009-01-20 12:15:33 -07:00
|
|
|
// SRR0
|
|
|
|
// SRR1
|
2009-06-13 08:10:10 -06:00
|
|
|
// Exceptions
|
2009-10-17 01:17:49 -06:00
|
|
|
// Interrupt Mask (PI)
|
|
|
|
// Interrupt Cause(PI)
|
2009-01-20 12:15:33 -07:00
|
|
|
|
2014-10-23 07:47:00 -06:00
|
|
|
#define NUM_SPECIALS 14
|
|
|
|
|
2009-01-20 06:13:03 -07:00
|
|
|
class CRegTable : public wxGridTableBase
|
2008-12-08 22:29:14 -07:00
|
|
|
{
|
2009-01-20 12:15:33 -07:00
|
|
|
|
2009-01-20 06:13:03 -07:00
|
|
|
public:
|
2014-10-23 07:47:00 -06:00
|
|
|
|
2014-08-30 15:01:19 -06:00
|
|
|
CRegTable()
|
|
|
|
{
|
2009-01-20 12:15:33 -07:00
|
|
|
memset(m_CachedRegs, 0, sizeof(m_CachedRegs));
|
|
|
|
memset(m_CachedSpecialRegs, 0, sizeof(m_CachedSpecialRegs));
|
|
|
|
memset(m_CachedFRegs, 0, sizeof(m_CachedFRegs));
|
|
|
|
memset(m_CachedRegHasChanged, 0, sizeof(m_CachedRegHasChanged));
|
|
|
|
memset(m_CachedSpecialRegHasChanged, 0, sizeof(m_CachedSpecialRegHasChanged));
|
|
|
|
memset(m_CachedFRegHasChanged, 0, sizeof(m_CachedFRegHasChanged));
|
|
|
|
}
|
2014-08-30 15:01:19 -06:00
|
|
|
|
2014-10-12 03:03:29 -06:00
|
|
|
int GetNumberCols() override { return 9; }
|
2014-08-30 10:41:21 -06:00
|
|
|
int GetNumberRows() override { return 32 + NUM_SPECIALS; }
|
|
|
|
bool IsEmptyCell(int row, int col) override { return row > 31 && col > 2; }
|
|
|
|
wxString GetValue(int row, int col) override;
|
|
|
|
void SetValue(int row, int col, const wxString &) override;
|
2014-03-07 17:54:44 -07:00
|
|
|
wxGridCellAttr *GetAttr(int, int, wxGridCellAttr::wxAttrKind) override;
|
2009-01-20 12:15:33 -07:00
|
|
|
void UpdateCachedRegs();
|
2009-01-20 06:13:03 -07:00
|
|
|
|
|
|
|
private:
|
2009-01-20 12:15:33 -07:00
|
|
|
u32 m_CachedRegs[32];
|
2009-09-08 15:16:05 -06:00
|
|
|
u32 m_CachedSpecialRegs[NUM_SPECIALS];
|
2010-10-19 07:35:25 -06:00
|
|
|
u64 m_CachedFRegs[32][2];
|
2009-01-20 12:15:33 -07:00
|
|
|
bool m_CachedRegHasChanged[32];
|
2009-09-08 15:16:05 -06:00
|
|
|
bool m_CachedSpecialRegHasChanged[NUM_SPECIALS];
|
2009-01-20 12:15:33 -07:00
|
|
|
bool m_CachedFRegHasChanged[32][2];
|
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(CRegTable);
|
2008-12-08 22:29:14 -07:00
|
|
|
};
|
|
|
|
|
2009-01-20 06:13:03 -07:00
|
|
|
class CRegisterView : public wxGrid
|
2008-12-07 21:46:09 -07:00
|
|
|
{
|
2009-01-20 06:13:03 -07:00
|
|
|
public:
|
2015-02-24 06:31:50 -07:00
|
|
|
CRegisterView(wxWindow* parent, wxWindowID id = wxID_ANY);
|
2014-03-07 17:54:44 -07:00
|
|
|
void Update() override;
|
2015-04-27 18:36:09 -06:00
|
|
|
|
|
|
|
private:
|
2014-10-23 07:47:00 -06:00
|
|
|
void OnMouseDownR(wxGridEvent& event);
|
|
|
|
void OnPopupMenu(wxCommandEvent& event);
|
|
|
|
|
2014-10-24 00:16:54 -06:00
|
|
|
u32 m_selectedAddress = 0;
|
2015-03-24 07:37:20 -06:00
|
|
|
|
|
|
|
// Owned by wx. Deleted implicitly upon destruction.
|
|
|
|
CRegTable* m_register_table;
|
2008-12-07 21:46:09 -07:00
|
|
|
};
|