summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Bird <Archez@users.noreply.github.com>2023-09-10 19:20:58 +0200
committerGitHub <noreply@github.com>2023-09-10 12:20:58 -0500
commit1b2a755e47d470159445164da8384e3492178b94 (patch)
tree96fa350b99eb4d79d2254040d55e1ec35ab6ad04
parent9c01bfa5b2e6d0e6b7f7048a90699ace2eda3bd7 (diff)
Add extraction support for ByteSwapped and LittleEndian formats (#3042)
* add extraction support for byteswapped and littleendian formats * update linux/mac scripts to handle v64 and n64
-rw-r--r--OTRExporter/Main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/OTRExporter/Main.cpp b/OTRExporter/Main.cpp
index b5e634a..506f8bf 100644
--- a/OTRExporter/Main.cpp
+++ b/OTRExporter/Main.cpp
@@ -22,6 +22,7 @@
#include <Utils/Directory.h>
#include <Utils/MemoryStream.h>
#include <Utils/BinaryWriter.h>
+#include <Utils/BitConverter.h>
#include <bit>
#include <mutex>
@@ -70,7 +71,10 @@ static void ExporterProgramEnd()
if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory)
{
std::string romPath = Globals::Instance->baseRomPath.string();
- const std::vector<uint8_t>& romData = DiskFile::ReadAllBytes(romPath);
+ std::vector<uint8_t> romData = DiskFile::ReadAllBytes(romPath);
+
+ BitConverter::RomToBigEndian(romData.data(), romData.size());
+
crc = BitConverter::ToUInt32BE(romData, 0x10);
printf("Creating version file...\n");