mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-08 15:30:14 +00:00
git subrepo pull (merge) tools/fado (#1501)
subrepo: subdir: "tools/fado" merged: "8d896ee97" upstream: origin: "git@github.com:EllipticEllipsis/fado.git" branch: "master" commit: "8d896ee97" git-subrepo: version: "0.4.5" origin: "git@github.com:ingydotnet/git-subrepo.git" commit: "dbb99be"
This commit is contained in:
parent
9f0b7bb8a3
commit
d4a6b21d46
11 changed files with 160 additions and 101 deletions
|
@ -40,8 +40,7 @@ void Fado_ConstructStringVectors(vc_vector** stringVectors, FairyFileInfo* fileI
|
|||
stringVectors[currentFile] = vc_vector_create(0x40, sizeof(char**), NULL);
|
||||
|
||||
/* Build a vector of pointers to defined symbols' names */
|
||||
for (currentSym = 0; currentSym < fileInfo[currentFile].symtabInfo.sectionSize / sizeof(FairySym);
|
||||
currentSym++) {
|
||||
for (currentSym = 0; currentSym < fileInfo[currentFile].symtabInfo.sectionEntryCount; currentSym++) {
|
||||
if ((symtab[currentSym].st_shndx != STN_UNDEF) &&
|
||||
Fado_CheckInProgBitsSections(symtab[currentSym].st_shndx, fileInfo[currentFile].progBitsSections)) {
|
||||
/* Have to pass a double pointer so it copies the pointer instead of the start of the string */
|
||||
|
@ -86,7 +85,7 @@ typedef struct {
|
|||
} FadoRelocInfo;
|
||||
|
||||
/* Construct the Zelda64ovl-compatible reloc word from an ELF reloc */
|
||||
FadoRelocInfo Fado_MakeReloc(int file, FairySection section, FairyRel* data) {
|
||||
FadoRelocInfo Fado_MakeReloc(int file, FairySection section, FairyRela* data) {
|
||||
FadoRelocInfo relocInfo = { 0 };
|
||||
uint32_t sectionPrefix = 0;
|
||||
|
||||
|
@ -223,11 +222,10 @@ void Fado_Relocs(FILE* outputFile, int inputFilesCount, FILE** inputFiles, const
|
|||
relocList[section] = vc_vector_create(0x100, sizeof(FadoRelocInfo), NULL);
|
||||
|
||||
for (currentFile = 0; currentFile < inputFilesCount; currentFile++) {
|
||||
FairyRel* relSection = fileInfos[currentFile].relocTablesInfo[section].sectionData;
|
||||
if (relSection != NULL) {
|
||||
FairyRela* relSection = fileInfos[currentFile].relocTablesInfo[section].sectionData;
|
||||
|
||||
for (relocIndex = 0;
|
||||
relocIndex < fileInfos[currentFile].relocTablesInfo[section].sectionSize / sizeof(FairyRel);
|
||||
if (relSection != NULL) {
|
||||
for (relocIndex = 0; relocIndex < fileInfos[currentFile].relocTablesInfo[section].sectionEntryCount;
|
||||
relocIndex++) {
|
||||
FadoRelocInfo currentReloc = Fado_MakeReloc(currentFile, section, &relSection[relocIndex]);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "version.inc"
|
||||
|
||||
void PrintVersion() {
|
||||
void PrintVersion(void) {
|
||||
printf("Fado (Fairy-Assisted relocations for Decompiled Overlays), version %s\n", versionNumber);
|
||||
printf("Copyright (C) 2021 Elliptic Ellipsis\n");
|
||||
printf("%s\n", credits);
|
||||
|
@ -88,7 +88,7 @@ static size_t posArgCount = ARRAY_COUNT(posArgInfo);
|
|||
static size_t optCount = ARRAY_COUNT(optInfo);
|
||||
static struct option longOptions[ARRAY_COUNT(optInfo)];
|
||||
|
||||
void ConstructLongOpts() {
|
||||
void ConstructLongOpts(void) {
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < optCount; i++) {
|
||||
|
@ -133,14 +133,15 @@ int main(int argc, char** argv) {
|
|||
outputFileName = optarg;
|
||||
outputFile = fopen(optarg, "wb");
|
||||
if (outputFile == NULL) {
|
||||
fprintf(stderr, "error: unable to open output file '%s' for writing", optarg);
|
||||
fprintf(stderr, "error: unable to open output file '%s' for writing\n", optarg);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
if (sscanf(optarg, "%u", &gVerbosity) == 0) {
|
||||
fprintf(stderr, "warning: verbosity argument '%s' should be a nonnegative decimal integer", optarg);
|
||||
fprintf(stderr, "warning: verbosity argument '%s' should be a nonnegative decimal integer\n",
|
||||
optarg);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -182,7 +183,7 @@ int main(int argc, char** argv) {
|
|||
FAIRY_INFO_PRINTF("Using input file %s\n", argv[optind + i]);
|
||||
inputFiles[i] = fopen(argv[optind + i], "rb");
|
||||
if (inputFiles[i] == NULL) {
|
||||
fprintf(stderr, "error: unable to open input file '%s' for reading", argv[optind + i]);
|
||||
fprintf(stderr, "error: unable to open input file '%s' for reading\n", argv[optind + i]);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
@ -214,14 +215,14 @@ int main(int argc, char** argv) {
|
|||
FILE* dependencyFile = fopen(dependencyFileName, "w");
|
||||
|
||||
if (dependencyFile == NULL) {
|
||||
fprintf(stderr, "error: unable to open dependency file '%s' for writing", dependencyFileName);
|
||||
fprintf(stderr, "error: unable to open dependency file '%s' for writing\n", dependencyFileName);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
strcpy(objectFile, outputFileName);
|
||||
extensionStart = strrchr(objectFile, '.');
|
||||
if (extensionStart == objectFile + fileNameLength) {
|
||||
fprintf(stderr, "error: file name should not end in a '.'");
|
||||
fprintf(stderr, "error: file name should not end in a '.'\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
strcpy(extensionStart, ".o");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (C) 2021 Elliptic Ellipsis */
|
||||
/* SPDX-License-Identifier: AGPL-3.0-only */
|
||||
const char versionNumber[] = "1.2.1";
|
||||
const char credits[] = "Written by Elliptic Ellipsis\nand AngheloAlf";
|
||||
const char versionNumber[] = "1.3.1";
|
||||
const char credits[] = "Written by Elliptic Ellipsis\nwith additions from AngheloAlf and Tharo";
|
||||
const char repo[] = "https://github.com/EllipticEllipsis/fado/";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue