Update emulator instruction log filtering
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "app/emu/snes.h"
|
||||
#include "app/gui/zeml.h"
|
||||
#include "app/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
@@ -24,13 +25,55 @@ namespace emu {
|
||||
*/
|
||||
class Emulator : public SharedRom {
|
||||
public:
|
||||
Emulator() {
|
||||
std::string emulator_layout = R"(
|
||||
Table id="Emulator" count="3" flags="Resizable|ScrollY" {
|
||||
TableSetupColumn title="CPU",
|
||||
TableSetupColumn title="PPU",
|
||||
|
||||
TableHeadersRow,
|
||||
TableNextColumn,
|
||||
Function id="CpuInstructionLog",
|
||||
|
||||
TableNextColumn,
|
||||
Function id="SnesPpu",
|
||||
Function id="BreakpointList",
|
||||
|
||||
TableNextColumn,
|
||||
BeginChild id="##" size="0,0" flags="NoMove|NoScrollbar" {
|
||||
CollapsingHeader id="cpuState" title="Register Values" open=true {
|
||||
Columns id="registersColumns" count="2" {
|
||||
Text text="A: 0x%04X" data="cpu.A",
|
||||
Text text="D: 0x%04X" data="cpu.D",
|
||||
Text text="X: 0x%04X" data="cpu.X",
|
||||
Text text="DB: 0x%02X" data="cpu.DB",
|
||||
Text text="Y: 0x%04X" data="cpu.Y",
|
||||
Text text="PB: 0x%02X" data="cpu.PB",
|
||||
Text text="PC: 0x%04X" data="cpu.PC",
|
||||
Text text="E: %d" data="cpu.E"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
)";
|
||||
const std::map<std::string, void*> data_bindings = {
|
||||
{"cpu.A", &snes_.cpu().A}, {"cpu.D", &snes_.cpu().D},
|
||||
{"cpu.X", &snes_.cpu().X}, {"cpu.DB", &snes_.cpu().DB},
|
||||
{"cpu.Y", &snes_.cpu().Y}, {"cpu.PB", &snes_.cpu().PB},
|
||||
{"cpu.PC", &snes_.cpu().PC}, {"cpu.E", &snes_.cpu().E}};
|
||||
emulator_node_ = gui::zeml::Parse(emulator_layout, data_bindings);
|
||||
Bind(emulator_node_.GetNode("CpuInstructionLog"),
|
||||
[&]() { RenderCpuInstructionLog(snes_.cpu().instruction_log_); });
|
||||
Bind(emulator_node_.GetNode("SnesPpu"), [&]() { RenderSnesPpu(); });
|
||||
Bind(emulator_node_.GetNode("BreakpointList"),
|
||||
[&]() { RenderBreakpointList(); });
|
||||
}
|
||||
void Run();
|
||||
|
||||
private:
|
||||
void RenderNavBar();
|
||||
void HandleEvents();
|
||||
|
||||
void RenderEmulator();
|
||||
void RenderSnesPpu();
|
||||
void RenderBreakpointList();
|
||||
void RenderMemoryViewer();
|
||||
@@ -47,6 +90,7 @@ class Emulator : public SharedRom {
|
||||
SNES snes_;
|
||||
uint16_t manual_pc_ = 0;
|
||||
uint8_t manual_pb_ = 0;
|
||||
gui::zeml::Node emulator_node_;
|
||||
|
||||
bool power_ = false;
|
||||
bool loading_ = false;
|
||||
|
||||
Reference in New Issue
Block a user