1#ifndef YAZE_APP_EDITOR_CODE_MEMORY_EDITOR_H
2#define YAZE_APP_EDITOR_CODE_MEMORY_EDITOR_H
4#include "absl/status/status.h"
28#include "imgui/imgui.h"
29#include "imgui/misc/cpp/imgui_stdlib.h"
30#include "imgui_memory_editor.h"
40 void Update(
bool &show_memory_editor) {
41 static MemoryEditor mem_edit;
42 static MemoryEditor comp_edit;
43 static bool show_compare_rom =
false;
44 static Rom comparison_rom;
45 ImGui::Begin(
"Hex Editor", &show_memory_editor);
46 if (ImGui::Button(
"Compare Rom")) {
49 show_compare_rom =
true;
52 static uint64_t convert_address = 0;
53 gui::InputHex(
"SNES to PC", (
int *)&convert_address, 6, 200.f);
58 BEGIN_TABLE(
"Memory Comparison", 2, ImGuiTableFlags_Resizable);
63 Text(
"%s",
rom()->filename().data());
64 mem_edit.DrawContents((
void *)&(*
rom()),
rom()->size());
67 if (show_compare_rom) {
68 comp_edit.SetComparisonData((
void *)&(*
rom()));
70 ImGui::BeginChild(
"Comparison ROM");
71 Text(
"%s", comparison_rom.
filename().data());
72 comp_edit.DrawContents((
void *)&(comparison_rom), comparison_rom.
size());
The Rom class is used to load, save, and modify Rom data.
absl::Status LoadFromFile(const std::string &filename, bool z3_load=true)
A class to hold a shared pointer to a Rom object.
static std::string ShowOpenFileDialog()
#define BEGIN_TABLE(l, n, f)
#define PRINT_IF_ERROR(expression)
uint32_t SnesToPc(uint32_t addr) noexcept
bool InputHex(const char *label, uint64_t *data)
void Update(bool &show_memory_editor)