Add cycle information to the Disassembly output.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
5c96069a3f
commit
d8ebc8dc9f
5 changed files with 32 additions and 2 deletions
|
@ -190,4 +190,10 @@ namespace sa2
|
|||
SDLFrame::ProcessSingleEvent(event, quit);
|
||||
}
|
||||
|
||||
void SDLImGuiFrame::ResetSpeed()
|
||||
{
|
||||
SDLFrame::ResetSpeed();
|
||||
mySettings.resetDebuggerCycles();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ namespace sa2
|
|||
void UpdateTexture() override;
|
||||
void RenderPresent() override;
|
||||
|
||||
void ResetSpeed() override;
|
||||
|
||||
protected:
|
||||
|
||||
void ProcessSingleEvent(const SDL_Event & event, bool & quit) override;
|
||||
|
|
|
@ -755,7 +755,7 @@ namespace sa2
|
|||
void ImGuiSettings::drawDisassemblyTable(SDLFrame * frame)
|
||||
{
|
||||
const ImGuiTableFlags flags = ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_ScrollY;
|
||||
if (ImGui::BeginTable("Disassembly", 9, flags))
|
||||
if (ImGui::BeginTable("Disassembly", 10, flags))
|
||||
{
|
||||
ImGui::PushStyleCompact();
|
||||
// weigths proportional to column width (including header)
|
||||
|
@ -769,6 +769,7 @@ namespace sa2
|
|||
ImGui::TableSetupColumn("Value", 0, 6);
|
||||
ImGui::TableSetupColumn("Immediate", 0, 9);
|
||||
ImGui::TableSetupColumn("Branch", 0, 6);
|
||||
ImGui::TableSetupColumn("Cycles", 0, 6);
|
||||
ImGui::TableHeadersRow();
|
||||
|
||||
ImGuiListClipper clipper;
|
||||
|
@ -882,6 +883,15 @@ namespace sa2
|
|||
ImGui::TextUnformatted(line.sBranch);
|
||||
}
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
if (g_nAppMode == MODE_DEBUG)
|
||||
{
|
||||
if (myAddressCycles.find(nAddress) != myAddressCycles.end())
|
||||
{
|
||||
ImGui::Text("%d", myAddressCycles[nAddress]);
|
||||
}
|
||||
}
|
||||
|
||||
nAddress += line.nOpbyte;
|
||||
ImGui::PopID();
|
||||
}
|
||||
|
@ -949,8 +959,16 @@ namespace sa2
|
|||
}
|
||||
}
|
||||
|
||||
void ImGuiSettings::resetDebuggerCycles()
|
||||
{
|
||||
myAddressCycles.clear();
|
||||
myBaseDebuggerCycles = g_nCumulativeCycles;
|
||||
}
|
||||
|
||||
void ImGuiSettings::showDebugger(SDLFrame * frame)
|
||||
{
|
||||
myAddressCycles[regs.pc] = g_nCumulativeCycles - myBaseDebuggerCycles;
|
||||
|
||||
if (ImGui::Begin("Debugger", &myShowDebugger))
|
||||
{
|
||||
ImGui::BeginChild("Console", ImVec2(0, -ImGui::GetFrameHeightWithSpacing()));
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace sa2
|
|||
public:
|
||||
void show(SDLFrame* frame);
|
||||
float drawMenuBar(SDLFrame* frame);
|
||||
void resetDebuggerCycles();
|
||||
|
||||
bool windowed = false;
|
||||
|
||||
|
@ -32,6 +33,9 @@ namespace sa2
|
|||
int mySpeakerVolume;
|
||||
int myMockingboardVolume;
|
||||
|
||||
uint64_t myBaseDebuggerCycles;
|
||||
std::unordered_map<DWORD, uint64_t> myAddressCycles;
|
||||
|
||||
MemoryEditor myMainMemoryEditor;
|
||||
MemoryEditor myAuxMemoryEditor;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace sa2
|
|||
void Execute(const DWORD uCycles);
|
||||
void ExecuteOneFrame(const size_t msNextFrame);
|
||||
void ChangeMode(const AppMode_e mode);
|
||||
void ResetSpeed();
|
||||
virtual void ResetSpeed();
|
||||
|
||||
virtual void UpdateTexture() = 0;
|
||||
virtual void RenderPresent() = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue