mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Add possibility to modify memory values
Optim time when parsing DList for debug.
This commit is contained in:
parent
9e0bc2ae89
commit
ec8d32378a
@ -6,6 +6,7 @@
|
||||
#include <QMessageBox>
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QInputDialog>
|
||||
|
||||
#include "EmuThread.h"
|
||||
#include "Core/MemMap.h"
|
||||
@ -221,6 +222,10 @@ void CtrlMemView::contextMenu(const QPoint &pos)
|
||||
connect(copyValue, SIGNAL(triggered()), this, SLOT(CopyValue()));
|
||||
menu.addAction(copyValue);
|
||||
|
||||
QAction *changeValue = new QAction(tr("C&hange value"), this);
|
||||
connect(changeValue, SIGNAL(triggered()), this, SLOT(Change()));
|
||||
menu.addAction(changeValue);
|
||||
|
||||
QAction *dump = new QAction(tr("Dump..."), this);
|
||||
connect(dump, SIGNAL(triggered()), this, SLOT(Dump()));
|
||||
menu.addAction(dump);
|
||||
@ -230,7 +235,9 @@ void CtrlMemView::contextMenu(const QPoint &pos)
|
||||
|
||||
void CtrlMemView::CopyValue()
|
||||
{
|
||||
EmuThread_LockDraw(true);
|
||||
QApplication::clipboard()->setText(QString("%1").arg(Memory::ReadUnchecked_U32(selection),8,16,QChar('0')));
|
||||
EmuThread_LockDraw(false);
|
||||
}
|
||||
|
||||
void CtrlMemView::Dump()
|
||||
@ -238,6 +245,27 @@ void CtrlMemView::Dump()
|
||||
QMessageBox::information(this,"Sorry","This feature has not been implemented.",QMessageBox::Ok);
|
||||
}
|
||||
|
||||
|
||||
void CtrlMemView::Change()
|
||||
{
|
||||
EmuThread_LockDraw(true);
|
||||
QString curVal = QString("%1").arg(Memory::ReadUnchecked_U32(selection),8,16,QChar('0'));
|
||||
EmuThread_LockDraw(false);
|
||||
|
||||
bool ok;
|
||||
QString text = QInputDialog::getText(this, tr("Set new value"),
|
||||
tr("Set new value:"), QLineEdit::Normal,
|
||||
curVal, &ok);
|
||||
if (ok && !text.isEmpty())
|
||||
{
|
||||
EmuThread_LockDraw(true);
|
||||
Memory::WriteUnchecked_U32(text.toInt(0,16),selection);
|
||||
EmuThread_LockDraw(false);
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int CtrlMemView::yToAddress(int y)
|
||||
{
|
||||
int ydiff=y-rect().bottom()/2-rowHeight/2;
|
||||
|
@ -72,6 +72,7 @@ signals:
|
||||
public slots:
|
||||
void CopyValue();
|
||||
void Dump();
|
||||
void Change();
|
||||
private:
|
||||
int curAddress;
|
||||
int align;
|
||||
|
@ -309,6 +309,8 @@ void Debugger_DisplayList::ShowDLCode()
|
||||
}
|
||||
usedIdxAddr.insert(iaddr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(int i = 0; i < ui->texturesList->columnCount(); i++)
|
||||
ui->texturesList->resizeColumnToContents(i);
|
||||
@ -316,7 +318,6 @@ void Debugger_DisplayList::ShowDLCode()
|
||||
ui->vertexList->resizeColumnToContents(i);
|
||||
for(int i = 0; i < ui->indexList->columnCount(); i++)
|
||||
ui->indexList->resizeColumnToContents(i);
|
||||
}
|
||||
|
||||
UpdateVertexInfo();
|
||||
UpdateIndexInfo();
|
||||
|
Loading…
Reference in New Issue
Block a user