From 0a6db683f6600f45ca23e26c503d1930bcc8bbe4 Mon Sep 17 00:00:00 2001 From: Justin Scofield Date: Sun, 24 Jul 2022 00:22:34 -0400 Subject: [PATCH] housekeeping inline ROM functions --- src/app/editor/master_editor.cc | 6 +++--- src/app/rom.h | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/app/editor/master_editor.cc b/src/app/editor/master_editor.cc index ef3dd713..a2c74253 100644 --- a/src/app/editor/master_editor.cc +++ b/src/app/editor/master_editor.cc @@ -168,7 +168,7 @@ void MasterEditor::DrawViewMenu() { if (show_memory_editor) { static MemoryEditor mem_edit; - mem_edit.DrawWindow("Memory Editor", (void *)rom_.data(), rom_.getSize()); + mem_edit.DrawWindow("Memory Editor", (void *)rom_.data(), rom_.GetSize()); } if (show_imgui_demo) { @@ -209,8 +209,8 @@ void MasterEditor::DrawHelpMenu() const { if (ImGui::MenuItem("About")) { // insert the about window here } - ImGui::Text("Title: %s", rom_.getTitle()); - ImGui::Text("ROM Size: %ld", rom_.getSize()); + ImGui::Text("Title: %s", rom_.GetTitle()); + ImGui::Text("ROM Size: %ld", rom_.GetSize()); ImGui::EndMenu(); } } diff --git a/src/app/rom.h b/src/app/rom.h index 124adb12..909485d4 100644 --- a/src/app/rom.h +++ b/src/app/rom.h @@ -66,15 +66,16 @@ class ROM { SDL_Texture* DrawGraphicsSheet(int offset); - long getSize() const { return size_; } - uchar* data() { return current_rom_; } - const uchar* getTitle() const { return title; } - bool isLoaded() const { return is_loaded_; } + auto data() { return rom_data_.data(); } + auto isLoaded() const { return is_loaded_; } + auto GetSize() const { return size_; } + auto GetTitle() const { return title; } auto Renderer() { return renderer_; } auto GetGraphicsBin() const { return graphics_bin_; } auto GetGraphicsBinV2() const { return graphics_bin_v2_; } auto GetMasterGraphicsBin() const { return master_gfx_bin_; } auto GetVRAM() const { return pseudo_vram_; } + auto GetBytes() const { return rom_data_; } private: int num_sheets_ = 0; @@ -87,7 +88,7 @@ class ROM { ImVec4 display_palette_[8]; gfx::pseudo_vram pseudo_vram_; - std::vector rom_data_; + Bytes rom_data_; std::vector decompressed_graphic_sheets_; std::vector converted_graphic_sheets_;