From 52502dc568f9e9af347cf31cb0db7b2b4d97b572 Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 10 Aug 2024 21:46:08 -0400 Subject: [PATCH] output rom size in hex longlong format --- src/app/core/labeling.cc | 4 ++++ src/app/core/labeling.h | 1 + src/app/editor/editor_manager.cc | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/core/labeling.cc b/src/app/core/labeling.cc index b8b4be4e..8198a752 100644 --- a/src/app/core/labeling.cc +++ b/src/app/core/labeling.cc @@ -34,6 +34,10 @@ std::string UppercaseHexLong(uint32_t dword) { std::string result = absl::StrFormat("0x%06X", dword); return result; } +std::string UppercaseHexLongLong(uint64_t qword) { + std::string result = absl::StrFormat("0x%08X", qword); + return result; +} bool StringReplace(std::string& str, const std::string& from, const std::string& to) { diff --git a/src/app/core/labeling.h b/src/app/core/labeling.h index 2f051a51..8116620d 100644 --- a/src/app/core/labeling.h +++ b/src/app/core/labeling.h @@ -20,6 +20,7 @@ namespace core { std::string UppercaseHexByte(uint8_t byte, bool leading = false); std::string UppercaseHexWord(uint16_t word); std::string UppercaseHexLong(uint32_t dword); +std::string UppercaseHexLongLong(uint64_t qword); bool StringReplace(std::string& str, const std::string& from, const std::string& to); diff --git a/src/app/editor/editor_manager.cc b/src/app/editor/editor_manager.cc index cf3d3288..24125ade 100644 --- a/src/app/editor/editor_manager.cc +++ b/src/app/editor/editor_manager.cc @@ -376,7 +376,7 @@ void EditorManager::DrawInfoPopup() { if (BeginPopupModal("ROM Information", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { Text("Title: %s", rom()->title().c_str()); - Text("ROM Size: %ld", rom()->size()); + Text("ROM Size: %s", core::UppercaseHexLongLong(rom()->size()).c_str()); if (Button("Close", gui::kDefaultModalSize) || IsKeyPressed(GetKeyIndex(ImGuiKey_Space))) {