ZAPD Update (#2851)

* git subrepo clone --force --branch=rebase2 C:/ZeldaStuff/ZAPDTR ZAPDTR/

subrepo:
  subdir:   "ZAPDTR"
  merged:   "6aa54a551"
upstream:
  origin:   "C:/ZeldaStuff/ZAPDTR"
  branch:   "rebase2"
  commit:   "6aa54a551"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* git subrepo clone --force --branch=rebase2 C:/ZeldaStuff/ZAPDTR ZAPDTR/

subrepo:
  subdir:   "ZAPDTR"
  merged:   "88b012240"
upstream:
  origin:   "C:/ZeldaStuff/ZAPDTR"
  branch:   "rebase2"
  commit:   "88b012240"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* Update (its broken)

* fix the enum

* git subrepo push --remote=C:/ZeldaStuff/ZAPDTR/ ZAPDTR

subrepo:
  subdir:   "ZAPDTR"
  merged:   "b7b6e1c82"
upstream:
  origin:   "C:/ZeldaStuff/ZAPDTR/"
  branch:   "rebase2"
  commit:   "b7b6e1c82"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* New names for LUS actions

* git subrepo push --remote=C:/ZeldaStuff/ZAPDTR/ ZAPDTR

subrepo:
  subdir:   "ZAPDTR"
  merged:   "c5cfebeee"
upstream:
  origin:   "C:/ZeldaStuff/ZAPDTR/"
  branch:   "rebase2"
  commit:   "c5cfebeee"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* git subrepo clone (merge) --force --branch=rebase2 C:/ZeldaStuff/ZAPDTR ZAPDTR/

subrepo:
  subdir:   "ZAPDTR"
  merged:   "d5f4769b8"
upstream:
  origin:   "C:/ZeldaStuff/ZAPDTR"
  branch:   "rebase2"
  commit:   "d5f4769b8"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* Fix missing commands in the exporter.

* Cleanups.

* git subrepo pull --force --remote=https://github.com/harbourmasters/ZAPDTR --branch=master ZAPDTR

subrepo:
  subdir:   "ZAPDTR"
  merged:   "d4c35b90a"
upstream:
  origin:   "https://github.com/harbourmasters/ZAPDTR"
  branch:   "master"
  commit:   "d4c35b90a"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* Add unordered_map include to fix MacOS

* fix string_view

* Update Main.cpp

* fix string view

* So close I can almost taste it

* So close

* Fix missed git marker.

* Fix surface types and

* Update ZFile.cpp

* Delete Jenkinsfile

---------

Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
This commit is contained in:
louist103
2023-05-07 19:58:50 -04:00
committed by GitHub
parent 778f548b01
commit f31a841789
91 changed files with 4385 additions and 7506 deletions

View File

@@ -1,5 +1,4 @@
#include "Globals.h"
#include "Overlays/ZOverlay.h"
#include "Utils/Directory.h"
#include "Utils/File.h"
#include "Utils/Path.h"
@@ -72,15 +71,7 @@ ZRoom room(nullptr);
#include "ZFile.h"
#include "ZTexture.h"
#ifdef __linux__
#include <csignal>
#include <cstdlib>
#include <ctime>
#include <cxxabi.h> // for __cxa_demangle
#include <dlfcn.h> // for dladdr
#include <execinfo.h>
#include <unistd.h>
#endif
#include "CrashHandler.h"
#include <string>
#include <string_view>
@@ -90,8 +81,6 @@ ZRoom room(nullptr);
//extern const char gBuildHash[];
const char gBuildHash[] = "";
// LINUX_TODO: remove, those are because of soh <-> lus dependency problems
bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path& outPath,
ZFileMode fileMode, int workerID);
@@ -102,62 +91,6 @@ int ExtractFunc(int workerID, int fileListSize, std::string fileListItem, ZFileM
volatile int numWorkersLeft = 0;
#ifdef __linux__
#define ARRAY_COUNT(arr) (sizeof(arr) / sizeof(arr[0]))
void ErrorHandler(int sig)
{
void* array[4096];
const size_t nMaxFrames = sizeof(array) / sizeof(array[0]);
size_t size = backtrace(array, nMaxFrames);
char** symbols = backtrace_symbols(array, nMaxFrames);
fprintf(stderr, "\nZAPD crashed. (Signal: %i)\n", sig);
// Feel free to add more crash messages.
const char* crashEasterEgg[] = {
"\tYou've met with a terrible fate, haven't you?",
"\tSEA BEARS FOAM. SLEEP BEARS DREAMS. \n\tBOTH END IN THE SAME WAY: CRASSSH!",
"\tZAPD has fallen and cannot get up.",
};
srand(time(nullptr));
auto easterIndex = rand() % ARRAY_COUNT(crashEasterEgg);
fprintf(stderr, "\n%s\n\n", crashEasterEgg[easterIndex]);
fprintf(stderr, "Traceback:\n");
for (size_t i = 1; i < size; i++)
{
Dl_info info;
uint32_t gotAddress = dladdr(array[i], &info);
std::string functionName(symbols[i]);
if (gotAddress != 0 && info.dli_sname != nullptr)
{
int32_t status;
char* demangled = abi::__cxa_demangle(info.dli_sname, nullptr, nullptr, &status);
const char* nameFound = info.dli_sname;
if (status == 0)
{
nameFound = demangled;
}
functionName = StringHelper::Sprintf("%s (+0x%X)", nameFound,
(char*)array[i] - (char*)info.dli_saddr);
free(demangled);
}
fprintf(stderr, "%-3zd %s\n", i, functionName.c_str());
}
fprintf(stderr, "\n");
free(symbols);
exit(1);
}
#endif
extern void ImportExporters();
extern "C" int zapd_main(int argc, char* argv[])
@@ -246,12 +179,6 @@ extern "C" int zapd_main(int argc, char* argv[])
{
Globals::Instance->texType = ZTexture::GetTextureTypeFromString(argv[++i]);
}
else if (arg == "-cfg") // Set cfg path (for overlays)
// TODO: Change the name of this to something else so it doesn't
// get confused with XML config files.
{
Globals::Instance->cfgPath = argv[++i];
}
else if (arg == "-fl") // Set baserom filelist path
{
Globals::Instance->fileListPath = argv[++i];
@@ -262,16 +189,7 @@ extern "C" int zapd_main(int argc, char* argv[])
}
else if (arg == "-eh") // Enable Error Handler
{
#ifdef __linux__
signal(SIGSEGV, ErrorHandler);
signal(SIGABRT, ErrorHandler);
#else
// HANDLE_WARNING(WarningType::Always,
// "tried to set error handler, but this ZAPD build lacks support for one",
// "");
#endif
CrashHandler_Init();
}
else if (arg == "-v") // Verbose
{
@@ -326,8 +244,6 @@ extern "C" int zapd_main(int argc, char* argv[])
fileMode = ZFileMode::BuildTexture;
else if (buildMode == "bren")
fileMode = ZFileMode::BuildBackground;
else if (buildMode == "bovl")
fileMode = ZFileMode::BuildOverlay;
else if (buildMode == "bsf")
fileMode = ZFileMode::BuildSourceFile;
else if (buildMode == "bblb")