mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-10 08:50:23 +00:00
ZAPD update: libpng, zroom improvements and others (#811)
* git subrepo pull --force tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "769f5702a" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "769f5702a" git-subrepo: version: "0.4.3" origin: "???" commit: "???" * Add `libpng` to readme * Remove `-ifp` since it doesn't exists anymore in ZAPD * Remove extra print I added * Add UNK_09 macro and other minor fixes * Simplify PNG rules * simplify gitignore * Update README.md Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * Update dockerfile * basic instructions for cygwin and mac * git subrepo pull --force tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "86160be69" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "86160be69" git-subrepo: version: "0.4.3" origin: "???" commit: "???" * Change nanoseconds to seconds in extract_assets.py Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
parent
676ecf06c5
commit
515ebdce9d
142 changed files with 5922 additions and 14735 deletions
|
@ -4,16 +4,15 @@
|
|||
#include "../Path.h"
|
||||
#include "../StringHelper.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace ELFIO;
|
||||
|
||||
ZOverlay::ZOverlay()
|
||||
{
|
||||
name = "";
|
||||
entries = vector<RelocationEntry*>();
|
||||
entries = std::vector<RelocationEntry*>();
|
||||
}
|
||||
|
||||
ZOverlay::ZOverlay(string nName) : ZOverlay()
|
||||
ZOverlay::ZOverlay(std::string nName) : ZOverlay()
|
||||
{
|
||||
name = nName;
|
||||
}
|
||||
|
@ -26,26 +25,27 @@ ZOverlay::~ZOverlay()
|
|||
entries.clear();
|
||||
}
|
||||
|
||||
ZOverlay* ZOverlay::FromBuild(string buildPath, string cfgFolderPath)
|
||||
ZOverlay* ZOverlay::FromBuild(std::string buildPath, std::string cfgFolderPath)
|
||||
{
|
||||
string cfgText = File::ReadAllText(cfgFolderPath + "/overlay.cfg");
|
||||
vector<string> cfgLines = StringHelper::Split(cfgText, "\n");
|
||||
std::string cfgText = File::ReadAllText(cfgFolderPath + "/overlay.cfg");
|
||||
std::vector<std::string> cfgLines = StringHelper::Split(cfgText, "\n");
|
||||
|
||||
ZOverlay* ovl = new ZOverlay(StringHelper::Strip(cfgLines[0], "\r"));
|
||||
|
||||
vector<string> relSections = {".rel.text", ".rel.data", ".rel.rodata"};
|
||||
vector<string> sections = {".text", ".data", ".rodata"};
|
||||
std::vector<std::string> relSections = {".rel.text", ".rel.data", ".rel.rodata"};
|
||||
std::vector<std::string> sections = {".text", ".data", ".rodata"};
|
||||
|
||||
int32_t sectionOffs[5] = {0};
|
||||
vector<RelocationEntry*> textRelocs;
|
||||
vector<RelocationEntry*> dataRelocs;
|
||||
vector<RelocationEntry*> rodataRelocs;
|
||||
std::vector<RelocationEntry*> textRelocs;
|
||||
std::vector<RelocationEntry*> dataRelocs;
|
||||
std::vector<RelocationEntry*> rodataRelocs;
|
||||
|
||||
// get the elf files
|
||||
vector<elfio*> readers;
|
||||
std::vector<elfio*> readers;
|
||||
for (size_t i = 1; i < cfgLines.size(); i++)
|
||||
{
|
||||
string elfPath = buildPath + "/" + cfgLines[i].substr(0, cfgLines[i].size() - 2) + ".o";
|
||||
std::string elfPath =
|
||||
buildPath + "/" + cfgLines[i].substr(0, cfgLines[i].size() - 2) + ".o";
|
||||
elfio* reader = new elfio();
|
||||
|
||||
if (!reader->load(elfPath))
|
||||
|
@ -88,7 +88,7 @@ ZOverlay* ZOverlay::FromBuild(string buildPath, string cfgFolderPath)
|
|||
relocs.get_entry(j, offset, symbol, type, addend);
|
||||
}
|
||||
|
||||
string curSymName;
|
||||
std::string curSymName;
|
||||
Elf_Half curSymShndx = SHN_UNDEF;
|
||||
{
|
||||
symbol_section_accessor symbols(
|
||||
|
@ -124,7 +124,7 @@ ZOverlay* ZOverlay::FromBuild(string buildPath, string cfgFolderPath)
|
|||
{
|
||||
Elf_Half shndx = SHN_UNDEF;
|
||||
Elf64_Addr value;
|
||||
string name;
|
||||
std::string name;
|
||||
Elf_Xword size;
|
||||
unsigned char bind;
|
||||
unsigned char type;
|
||||
|
@ -189,9 +189,9 @@ ZOverlay* ZOverlay::FromBuild(string buildPath, string cfgFolderPath)
|
|||
return ovl;
|
||||
}
|
||||
|
||||
string ZOverlay::GetSourceOutputCode(const std::string& prefix)
|
||||
std::string ZOverlay::GetSourceOutputCode(const std::string& prefix)
|
||||
{
|
||||
string output = "";
|
||||
std::string output = "";
|
||||
|
||||
output += ".section .ovl\n";
|
||||
|
||||
|
@ -220,7 +220,7 @@ string ZOverlay::GetSourceOutputCode(const std::string& prefix)
|
|||
return output;
|
||||
}
|
||||
|
||||
SectionType ZOverlay::GetSectionTypeFromStr(string sectionName)
|
||||
SectionType ZOverlay::GetSectionTypeFromStr(std::string sectionName)
|
||||
{
|
||||
if (sectionName == ".rel.text" || sectionName == ".text")
|
||||
return SectionType::Text;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue