From 054d54c02da801f124e513070d304f6550d6cd01 Mon Sep 17 00:00:00 2001 From: Unreference <87878910+unreference@users.noreply.github.com> Date: Thu, 7 May 2026 22:31:59 -0700 Subject: [PATCH 1/6] feat(ZRom): Expose RomVersion as a member with public getter --- ZAPD/ZRom.cpp | 5 ++++- ZAPD/ZRom.h | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ZAPD/ZRom.cpp b/ZAPD/ZRom.cpp index f6016ae..a1b1d12 100644 --- a/ZAPD/ZRom.cpp +++ b/ZAPD/ZRom.cpp @@ -112,10 +112,13 @@ bool ZRom::IsMQ() { return true; } } +const RomVersion& ZRom::GetVersion() const +{ + return version; +} ZRom::ZRom(std::string romPath) { - RomVersion version; romData = DiskFile::ReadAllBytes(romPath); BitConverter::RomToBigEndian(romData.data(), romData.size()); diff --git a/ZAPD/ZRom.h b/ZAPD/ZRom.h index 6225a1a..e7bc8cf 100644 --- a/ZAPD/ZRom.h +++ b/ZAPD/ZRom.h @@ -5,6 +5,15 @@ #include #include +struct RomVersion +{ + std::string version = "None"; + std::string error = "None"; + std::string listPath = "None"; + int offset; + uint32_t crc; +}; + class ZRom { public: @@ -12,17 +21,10 @@ class ZRom std::vector GetFile(std::string fileName); bool IsMQ(); + [[nodiscard]] const RomVersion& GetVersion() const; protected: std::vector romData; std::map> files; -}; - -struct RomVersion -{ - std::string version = "None"; - std::string error = "None"; - std::string listPath = "None"; - int offset; - uint32_t crc; + RomVersion version; }; \ No newline at end of file From c0b34a6e1a0e47188a199d4e5f95d008b7f32086 Mon Sep 17 00:00:00 2001 From: Unreference <87878910+unreference@users.noreply.github.com> Date: Sun, 10 May 2026 08:51:54 -0700 Subject: [PATCH 2/6] feat(ZRom): IsPal and IsDebug ROM version queries --- ZAPD/ZRom.cpp | 28 ++++++++++++++++++++++++++++ ZAPD/ZRom.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/ZAPD/ZRom.cpp b/ZAPD/ZRom.cpp index a1b1d12..26101ac 100644 --- a/ZAPD/ZRom.cpp +++ b/ZAPD/ZRom.cpp @@ -112,6 +112,34 @@ bool ZRom::IsMQ() { return true; } } + +bool ZRom::IsPal() const +{ + switch (BitConverter::ToInt32BE(romData, 0x10)) { // crc + case OOT_PAL_10: + case OOT_PAL_11: + case OOT_PAL_GC: + case OOT_PAL_GC_DBG1: + case OOT_PAL_GC_DBG2: + case OOT_PAL_GC_MQ_DBG: + return true; + default: + return false; + } +} + +bool ZRom::IsDebug() const +{ + switch (BitConverter::ToInt32BE(romData, 0x10)) { // crc + case OOT_PAL_GC_DBG1: + case OOT_PAL_GC_DBG2: + case OOT_PAL_GC_MQ_DBG: + return true; + default: + return false; + } +} + const RomVersion& ZRom::GetVersion() const { return version; diff --git a/ZAPD/ZRom.h b/ZAPD/ZRom.h index e7bc8cf..137d8f3 100644 --- a/ZAPD/ZRom.h +++ b/ZAPD/ZRom.h @@ -21,6 +21,8 @@ class ZRom std::vector GetFile(std::string fileName); bool IsMQ(); + bool IsPal() const; + bool IsDebug() const; [[nodiscard]] const RomVersion& GetVersion() const; protected: From 7fa0fc16cf87a92e15e656502df3647e81887bf2 Mon Sep 17 00:00:00 2001 From: Unreference <87878910+unreference@users.noreply.github.com> Date: Sun, 10 May 2026 20:23:58 -0700 Subject: [PATCH 3/6] feat(ZRom): IsN64 ROM platform query --- ZAPD/ZRom.cpp | 16 ++++++++++++++++ ZAPD/ZRom.h | 1 + 2 files changed, 17 insertions(+) diff --git a/ZAPD/ZRom.cpp b/ZAPD/ZRom.cpp index 26101ac..6a228b9 100644 --- a/ZAPD/ZRom.cpp +++ b/ZAPD/ZRom.cpp @@ -140,6 +140,22 @@ bool ZRom::IsDebug() const } } +bool ZRom::IsN64() const +{ + switch (BitConverter::ToInt32BE(romData, 0x10)) { // crc + case OOT_NTSC_10: + case OOT_NTSC_11: + case OOT_NTSC_12: + case OOT_PAL_10: + case OOT_PAL_11: + case OOT_IQUE_TW: + case OOT_IQUE_CN: + return true; + default: + return false; + } +} + const RomVersion& ZRom::GetVersion() const { return version; diff --git a/ZAPD/ZRom.h b/ZAPD/ZRom.h index 137d8f3..7e90d10 100644 --- a/ZAPD/ZRom.h +++ b/ZAPD/ZRom.h @@ -23,6 +23,7 @@ class ZRom bool IsMQ(); bool IsPal() const; bool IsDebug() const; + bool IsN64() const; [[nodiscard]] const RomVersion& GetVersion() const; protected: From 36540c67ed4bdeb0ad47970eea5487b54363deba Mon Sep 17 00:00:00 2001 From: Unreference <87878910+unreference@users.noreply.github.com> Date: Sun, 10 May 2026 21:37:43 -0700 Subject: [PATCH 4/6] fix(ZRom): Remove redundant IsN64 --- ZAPD/ZRom.cpp | 16 ---------------- ZAPD/ZRom.h | 1 - 2 files changed, 17 deletions(-) diff --git a/ZAPD/ZRom.cpp b/ZAPD/ZRom.cpp index 6a228b9..26101ac 100644 --- a/ZAPD/ZRom.cpp +++ b/ZAPD/ZRom.cpp @@ -140,22 +140,6 @@ bool ZRom::IsDebug() const } } -bool ZRom::IsN64() const -{ - switch (BitConverter::ToInt32BE(romData, 0x10)) { // crc - case OOT_NTSC_10: - case OOT_NTSC_11: - case OOT_NTSC_12: - case OOT_PAL_10: - case OOT_PAL_11: - case OOT_IQUE_TW: - case OOT_IQUE_CN: - return true; - default: - return false; - } -} - const RomVersion& ZRom::GetVersion() const { return version; diff --git a/ZAPD/ZRom.h b/ZAPD/ZRom.h index 7e90d10..137d8f3 100644 --- a/ZAPD/ZRom.h +++ b/ZAPD/ZRom.h @@ -23,7 +23,6 @@ class ZRom bool IsMQ(); bool IsPal() const; bool IsDebug() const; - bool IsN64() const; [[nodiscard]] const RomVersion& GetVersion() const; protected: From eb43232b3174a2b02dc6b4ac4b9fd0c6b6a1494b Mon Sep 17 00:00:00 2001 From: Unreference <87878910+unreference@users.noreply.github.com> Date: Sun, 10 May 2026 23:55:14 -0700 Subject: [PATCH 5/6] Revert "fix(ZRom): Remove redundant IsN64" This reverts commit 36540c67ed4bdeb0ad47970eea5487b54363deba. --- ZAPD/ZRom.cpp | 16 ++++++++++++++++ ZAPD/ZRom.h | 1 + 2 files changed, 17 insertions(+) diff --git a/ZAPD/ZRom.cpp b/ZAPD/ZRom.cpp index 26101ac..6a228b9 100644 --- a/ZAPD/ZRom.cpp +++ b/ZAPD/ZRom.cpp @@ -140,6 +140,22 @@ bool ZRom::IsDebug() const } } +bool ZRom::IsN64() const +{ + switch (BitConverter::ToInt32BE(romData, 0x10)) { // crc + case OOT_NTSC_10: + case OOT_NTSC_11: + case OOT_NTSC_12: + case OOT_PAL_10: + case OOT_PAL_11: + case OOT_IQUE_TW: + case OOT_IQUE_CN: + return true; + default: + return false; + } +} + const RomVersion& ZRom::GetVersion() const { return version; diff --git a/ZAPD/ZRom.h b/ZAPD/ZRom.h index 137d8f3..7e90d10 100644 --- a/ZAPD/ZRom.h +++ b/ZAPD/ZRom.h @@ -23,6 +23,7 @@ class ZRom bool IsMQ(); bool IsPal() const; bool IsDebug() const; + bool IsN64() const; [[nodiscard]] const RomVersion& GetVersion() const; protected: From 3310bd2ecd090666d94f3fae4a9fc68e6fa7efbe Mon Sep 17 00:00:00 2001 From: Unreference <87878910+unreference@users.noreply.github.com> Date: Mon, 11 May 2026 08:46:42 -0700 Subject: [PATCH 6/6] fix(ZRom): Remove unused IsPal function --- ZAPD/ZRom.cpp | 15 --------------- ZAPD/ZRom.h | 1 - 2 files changed, 16 deletions(-) diff --git a/ZAPD/ZRom.cpp b/ZAPD/ZRom.cpp index 6a228b9..027263c 100644 --- a/ZAPD/ZRom.cpp +++ b/ZAPD/ZRom.cpp @@ -113,21 +113,6 @@ bool ZRom::IsMQ() { } } -bool ZRom::IsPal() const -{ - switch (BitConverter::ToInt32BE(romData, 0x10)) { // crc - case OOT_PAL_10: - case OOT_PAL_11: - case OOT_PAL_GC: - case OOT_PAL_GC_DBG1: - case OOT_PAL_GC_DBG2: - case OOT_PAL_GC_MQ_DBG: - return true; - default: - return false; - } -} - bool ZRom::IsDebug() const { switch (BitConverter::ToInt32BE(romData, 0x10)) { // crc diff --git a/ZAPD/ZRom.h b/ZAPD/ZRom.h index 7e90d10..1df423a 100644 --- a/ZAPD/ZRom.h +++ b/ZAPD/ZRom.h @@ -21,7 +21,6 @@ class ZRom std::vector GetFile(std::string fileName); bool IsMQ(); - bool IsPal() const; bool IsDebug() const; bool IsN64() const; [[nodiscard]] const RomVersion& GetVersion() const;