mirror of
https://github.com/open-goal/jak-project.git
synced 2025-01-31 02:33:51 +00:00
73561f10a3
Running reference tests/decompiler should now be possible on macos (arm). Most of the changes were just cleaning up places where we were sloppy with ifdefs, but there were two interesting ones: - `Printer.cpp` was updated to not use a recursive function for printing lists, to avoid stack overflow - I replaced xxhash with another version of the same library that supports arm (the one that comes in zstd). The interface is C instead of C++ but it's not bad to use. I confirmed that the extractor succeeds on jak 1 iso so it looks like this gives us the same results as the old library.
41 lines
913 B
C++
41 lines
913 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "common/util/FileUtil.h"
|
|
|
|
struct IsoFile {
|
|
struct Entry {
|
|
bool is_dir = false;
|
|
std::string name;
|
|
|
|
// if file
|
|
size_t offset_in_file = 0;
|
|
size_t size = 0;
|
|
|
|
// if dir
|
|
std::vector<Entry> children;
|
|
void print(std::string* result, const std::string& prefix) const;
|
|
};
|
|
|
|
std::string print() const;
|
|
|
|
Entry root;
|
|
|
|
int files_extracted = 0;
|
|
bool shouldHash = false;
|
|
// There is no reason to map to the files, as we don't retain mappings of each file's expected
|
|
// hash
|
|
std::vector<uint64_t> hashes = {};
|
|
|
|
IsoFile();
|
|
};
|
|
|
|
IsoFile find_files_in_iso(FILE* fp);
|
|
void unpack_iso_files(FILE* fp, IsoFile& layout, const fs::path& dest);
|
|
IsoFile unpack_iso_files(FILE* fp,
|
|
const fs::path& dest,
|
|
bool print_progress,
|
|
const bool hashFiles = false);
|