Remove Windows ARM64 build configuration and delete unused generate-vs-projects.py script
- Removed the Windows ARM64 configuration from the GitHub Actions release workflow to streamline the build process. - Deleted the generate-vs-projects.py script as it was no longer needed for project setup, simplifying the codebase. - Updated the OverworldEditor header to improve clarity by renaming a method parameter for better understanding. - Refactored the Emulator class to enhance the rendering interface, improving the user experience in the emulator's GUI.
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
#include "app/emu/cpu/internal/opcodes.h"
|
||||
#include "app/gui/icons.h"
|
||||
#include "app/gui/input.h"
|
||||
#include "app/gui/zeml.h"
|
||||
#include "imgui/imgui.h"
|
||||
#include "imgui_memory_editor.h"
|
||||
|
||||
@@ -105,7 +104,76 @@ void Emulator::Run() {
|
||||
}
|
||||
}
|
||||
|
||||
gui::zeml::Render(emulator_node_);
|
||||
RenderEmulatorInterface();
|
||||
}
|
||||
|
||||
void Emulator::RenderEmulatorInterface() {
|
||||
if (ImGui::BeginTable("Emulator", 2, ImGuiTableFlags_Resizable | ImGuiTableFlags_ScrollY)) {
|
||||
ImGui::TableSetupColumn("CPU");
|
||||
ImGui::TableSetupColumn("PPU");
|
||||
ImGui::TableHeadersRow();
|
||||
|
||||
// CPU Column
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
// CPU Register Values
|
||||
if (ImGui::CollapsingHeader("Register Values", ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||
ImGui::BeginChild("##CpuState", ImVec2(0, 100), ImGuiChildFlags_None,
|
||||
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar);
|
||||
ImGui::Columns(2, "registersColumns");
|
||||
|
||||
ImGui::Text("A: 0x%04X", snes_.cpu().A);
|
||||
ImGui::Text("X: 0x%04X", snes_.cpu().X);
|
||||
ImGui::Text("Y: 0x%04X", snes_.cpu().Y);
|
||||
ImGui::Text("PC: 0x%04X", snes_.cpu().PC);
|
||||
ImGui::Text("SP: 0x%02X", snes_.memory().mutable_sp());
|
||||
|
||||
ImGui::NextColumn();
|
||||
|
||||
ImGui::Text("D: 0x%04X", snes_.cpu().D);
|
||||
ImGui::Text("DB: 0x%02X", snes_.cpu().DB);
|
||||
ImGui::Text("PB: 0x%02X", snes_.cpu().PB);
|
||||
ImGui::Text("PS: 0x%02X", snes_.cpu().status);
|
||||
ImGui::Text("Cycle: %llu", snes_.mutable_cycles());
|
||||
|
||||
ImGui::Columns(1);
|
||||
ImGui::EndChild();
|
||||
}
|
||||
|
||||
// SPC Registers
|
||||
if (ImGui::CollapsingHeader("SPC Registers", ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||
ImGui::BeginChild("##SpcState", ImVec2(0, 100), ImGuiChildFlags_None,
|
||||
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar);
|
||||
ImGui::Columns(2, "spcRegistersColumns");
|
||||
|
||||
ImGui::Text("A: 0x%02X", snes_.apu().spc700().A);
|
||||
ImGui::Text("X: 0x%02X", snes_.apu().spc700().X);
|
||||
ImGui::Text("Y: 0x%02X", snes_.apu().spc700().Y);
|
||||
|
||||
ImGui::NextColumn();
|
||||
|
||||
ImGui::Text("PC: 0x%04X", snes_.apu().spc700().PC);
|
||||
ImGui::Text("SP: 0x%02X", snes_.apu().spc700().SP);
|
||||
ImGui::Text("PSW: 0x%02X", snes_.apu().spc700().FlagsToByte(snes_.apu().spc700().PSW));
|
||||
|
||||
ImGui::Columns(1);
|
||||
ImGui::EndChild();
|
||||
}
|
||||
|
||||
// CPU Instruction Log
|
||||
RenderCpuInstructionLog(snes_.cpu().instruction_log_);
|
||||
|
||||
// PPU Column
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
// SNES PPU
|
||||
RenderSnesPpu();
|
||||
|
||||
// Breakpoint List
|
||||
RenderBreakpointList();
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
}
|
||||
|
||||
void Emulator::RenderSnesPpu() {
|
||||
@@ -132,18 +200,21 @@ void Emulator::RenderSnesPpu() {
|
||||
}
|
||||
|
||||
void Emulator::RenderNavBar() {
|
||||
std::string navbar_layout = R"(
|
||||
BeginMenuBar {
|
||||
BeginMenu title="Options" {
|
||||
MenuItem title="Input" {}
|
||||
MenuItem title="Audio" {}
|
||||
MenuItem title="Video" {}
|
||||
if (ImGui::BeginMenuBar()) {
|
||||
if (ImGui::BeginMenu("Options")) {
|
||||
if (ImGui::MenuItem("Input")) {
|
||||
// Input options logic
|
||||
}
|
||||
if (ImGui::MenuItem("Audio")) {
|
||||
// Audio options logic
|
||||
}
|
||||
if (ImGui::MenuItem("Video")) {
|
||||
// Video options logic
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
)";
|
||||
|
||||
static auto navbar_node = gui::zeml::Parse(navbar_layout);
|
||||
gui::zeml::Render(navbar_node);
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
|
||||
if (ImGui::Button(ICON_MD_PLAY_ARROW)) {
|
||||
running_ = true;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "app/emu/snes.h"
|
||||
#include "app/gui/zeml.h"
|
||||
#include "app/rom.h"
|
||||
#include "imgui/imgui.h"
|
||||
|
||||
@@ -38,74 +37,7 @@ struct EmulatorKeybindings {
|
||||
*/
|
||||
class Emulator {
|
||||
public:
|
||||
Emulator() {
|
||||
std::string emulator_layout = R"(
|
||||
Table id="Emulator" count="2" flags="Resizable|ScrollY" {
|
||||
TableSetupColumn title="CPU",
|
||||
TableSetupColumn title="PPU",
|
||||
|
||||
TableHeadersRow,
|
||||
TableNextColumn,
|
||||
|
||||
CollapsingHeader id="cpuState" title="Register Values" flags="DefaultOpen" {
|
||||
BeginChild id="##CpuState" size="0,100" flags="NoMove|NoScrollbar" {
|
||||
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="PS: 0x%02X" data="cpu.status",
|
||||
Text text="SP: 0x%02X" data="cpu.SP",
|
||||
Text text="Cycle: %d" data="snes.cycle_count",
|
||||
}
|
||||
}
|
||||
}
|
||||
CollapsingHeader id="spcState" title="SPC Registers" flags="DefaultOpen" {
|
||||
BeginChild id="##SpcState" size="0,100" flags="NoMove|NoScrollbar" {
|
||||
Columns id="spcRegistersColumns" count="2" {
|
||||
Text text="A: 0x%02X" data="spc.A",
|
||||
Text text="PC: 0x%04X" data="spc.PC",
|
||||
Text text="X: 0x%02X" data="spc.X",
|
||||
Text text="SP: 0x%02X" data="spc.SP",
|
||||
Text text="Y: 0x%02X" data="spc.Y",
|
||||
Text text="PSW: 0x%02X" data="spc.PSW",
|
||||
}
|
||||
}
|
||||
}
|
||||
Function id="CpuInstructionLog",
|
||||
|
||||
TableNextColumn,
|
||||
Function id="SnesPpu",
|
||||
Function id="BreakpointList"
|
||||
}
|
||||
)";
|
||||
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.status", &snes_.cpu().status},
|
||||
{"snes.cycle_count", &snes_.mutable_cycles()},
|
||||
{"cpu.SP", &snes_.memory().mutable_sp()},
|
||||
{"spc.A", &snes_.apu().spc700().A},
|
||||
{"spc.X", &snes_.apu().spc700().X},
|
||||
{"spc.Y", &snes_.apu().spc700().Y},
|
||||
{"spc.PC", &snes_.apu().spc700().PC},
|
||||
{"spc.SP", &snes_.apu().spc700().SP},
|
||||
{"spc.PSW", &snes_.apu().spc700().PSW}};
|
||||
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(); });
|
||||
}
|
||||
Emulator() = default;
|
||||
void Run();
|
||||
|
||||
auto snes() -> Snes& { return snes_; }
|
||||
@@ -121,6 +53,7 @@ class Emulator {
|
||||
private:
|
||||
void RenderNavBar();
|
||||
void HandleEvents();
|
||||
void RenderEmulatorInterface();
|
||||
|
||||
void RenderSnesPpu();
|
||||
void RenderBreakpointList();
|
||||
@@ -162,8 +95,6 @@ class Emulator {
|
||||
std::vector<uint8_t> rom_data_;
|
||||
|
||||
EmulatorKeybindings keybindings_;
|
||||
|
||||
gui::zeml::Node emulator_node_;
|
||||
};
|
||||
|
||||
} // namespace emu
|
||||
|
||||
Reference in New Issue
Block a user