You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on the reimplementation of some CPC games for ScummVM and I needed some debugging to change registers during the execution. Caprice32 allows to see the registers in the developer's tool and the fields are editable, but changing them will not do anything, so I did a quick patch:
diff --git a/src/gui/includes/cap_register.h b/src/gui/includes/cap_register.h
index d1fbd13..09973ff 100644
--- a/src/gui/includes/cap_register.h+++ b/src/gui/includes/cap_register.h@@ -35,6 +35,10 @@ public:
//! Set the value of the register
//! \param c The value to assign to the control
void SetValue(const unsigned int c);
+ unsigned int GetValue() const {+ std::string x = m_pHexValue->GetWindowText();+ return stoi(x, nullptr, 16);+ }
protected:
diff --git a/src/gui/src/CapriceDevTools.cpp b/src/gui/src/CapriceDevTools.cpp
index e8487cb..5f6e01a 100644
--- a/src/gui/src/CapriceDevTools.cpp+++ b/src/gui/src/CapriceDevTools.cpp@@ -854,6 +854,7 @@ void CapriceDevTools::ResumeExecution()
{
CPC.paused = false;
m_pButtonPause->SetWindowText("Pause");
+ z80.AF.b.h = m_pZ80RegA->GetValue();
}
void CapriceDevTools::LoadSymbols(const std::string& filename)
If you think this approach looks good, I can complete this code and create a small PR. Otherwise, this is a small feature request to make the debugger more useful.
The text was updated successfully, but these errors were encountered:
Having the option to edit the registers is definitely a good idea and I was planning to support it (hence the editable field) but then forgot about it !
One concern I have is the risk of changing the values by mistake. An option could be to have a confirmation button. On the other hand, having to click an extra button can be a pain... This option is fine so far IMO.
More problematic is the fact that the value is displayed in 3 fields (hex, dec and char) but only one is read when resuming the execution. An easy fix is to have only the hex field editable and make the others read-only. Alternatively (I don't remember how hard it would be to do), updating one field would directly update the others.
Note to self: I double checked and changing ResumeExecution should be enough to cover all the cases (resume, step-in, step-over, ...).
So in a nutshell, please do proceed with a PR. If you can make the dec & char fields read-only or ensure updating one of the 3 fields update the other 2 it would be nice.
I'm working on the reimplementation of some CPC games for ScummVM and I needed some debugging to change registers during the execution. Caprice32 allows to see the registers in the developer's tool and the fields are editable, but changing them will not do anything, so I did a quick patch:
If you think this approach looks good, I can complete this code and create a small PR. Otherwise, this is a small feature request to make the debugger more useful.
The text was updated successfully, but these errors were encountered: