Initial Linux/GCC support commit

This commit is contained in:
Random06457 2022-03-23 16:41:00 +09:00
parent 4a05b32755
commit 7e4fb41f8f
92 changed files with 1673 additions and 504 deletions

36
Dockerfile Normal file
View File

@ -0,0 +1,36 @@
FROM ubuntu:21.04 as build
ENV LANG C.UTF-8
ARG DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
binutils:i386 \
gcc-10:i386 \
g++-10:i386 \
python3 \
python \
make \
cmake \
git \
lld \
libsdl2-dev:i386 \
zlib1g-dev:i386 \
libbz2-dev:i386 \
libpng-dev:i386 \
libgles2-mesa-dev && \
ln -s /usr/bin/gcc-10 /usr/bin/gcc && \
ln -s /usr/bin/gcc-10 /usr/bin/cc && \
ln -s /usr/bin/g++-10 /usr/bin/g++ && \
ln -s /usr/bin/g++-10 /usr/bin/c++
RUN git clone https://github.com/nigels-com/glew.git && \
make -C /glew extensions -j$(nproc) && \
make -C /glew install ARCH64=false
RUN mkdir /soh
WORKDIR /soh

View File

@ -49,12 +49,12 @@ void OTRExporter_Animation::Save(ZResource* res, const fs::path& outPath, Binary
writer->Write((uint32_t)normalAnim->rotationValues.size());
for (int i = 0; i < normalAnim->rotationValues.size(); i++)
for (size_t i = 0; i < normalAnim->rotationValues.size(); i++)
writer->Write(normalAnim->rotationValues[i]);
writer->Write((uint32_t)normalAnim->rotationIndices.size());
for (int i = 0; i < normalAnim->rotationIndices.size(); i++)
for (size_t i = 0; i < normalAnim->rotationIndices.size(); i++)
{
writer->Write(normalAnim->rotationIndices[i].x);
writer->Write(normalAnim->rotationIndices[i].y);

View File

@ -10,7 +10,7 @@ void OTRExporter_Array::Save(ZResource* res, const fs::path& outPath, BinaryWrit
writer->Write((uint32_t)arr->resList[0]->GetResourceType());
writer->Write((uint32_t)arr->arrayCnt);
for (int i = 0; i < arr->arrayCnt; i++)
for (size_t i = 0; i < arr->arrayCnt; i++)
{
if (arr->resList[i]->GetResourceType() == ZResourceType::Vertex)
{
@ -32,7 +32,7 @@ void OTRExporter_Array::Save(ZResource* res, const fs::path& outPath, BinaryWrit
writer->Write((uint32_t)vec->scalarType);
writer->Write((uint32_t)vec->dimensions);
for (int k = 0; k < vec->dimensions; k++)
for (uint32_t k = 0; k < vec->dimensions; k++)
{
// OTRTODO: Duplicate code here. Cleanup at a later date...
switch (vec->scalarType)
@ -62,6 +62,8 @@ void OTRExporter_Array::Save(ZResource* res, const fs::path& outPath, BinaryWrit
writer->Write(vec->scalars[k].scalarData.u64);
break;
// OTRTODO: ADD OTHER TYPES
default:
break;
}
}
}
@ -98,6 +100,8 @@ void OTRExporter_Array::Save(ZResource* res, const fs::path& outPath, BinaryWrit
writer->Write(scal->scalarData.u64);
break;
// OTRTODO: ADD OTHER TYPES
default:
break;
}
}
}

View File

@ -29,7 +29,7 @@ void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryW
for (auto& e : ((CutsceneCommandSetCameraPos*)cs->commands[i])->entries)
{
writer->Write(CMD_BBH(e->continueFlag, e->cameraRoll, e->nextPointFrame));
writer->Write(CMD_F(e->viewAngle));
writer->Write(e->viewAngle);
writer->Write(CMD_HH(e->posX, e->posY));
writer->Write(CMD_HH(e->posZ, e->unused));
}
@ -46,7 +46,7 @@ void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryW
for (auto& e : ((CutsceneCommandSetCameraPos*)cs->commands[i])->entries)
{
writer->Write(CMD_BBH(e->continueFlag, e->cameraRoll, e->nextPointFrame));
writer->Write(CMD_F(e->viewAngle));
writer->Write(e->viewAngle);
writer->Write(CMD_HH(e->posX, e->posY));
writer->Write(CMD_HH(e->posZ, e->unused));
}
@ -105,7 +105,7 @@ void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryW
for (auto& e : ((CutsceneCommandSetCameraPos*)cs->commands[i])->entries)
{
writer->Write(CMD_BBH(e->continueFlag, e->cameraRoll, e->nextPointFrame));
writer->Write(CMD_F(e->viewAngle));
writer->Write(e->viewAngle);
writer->Write(CMD_HH(e->posX, e->posY));
writer->Write(CMD_HH(e->posZ, e->unused));
}
@ -122,7 +122,7 @@ void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryW
for (auto& e : ((CutsceneCommandSetCameraPos*)cs->commands[i])->entries)
{
writer->Write(CMD_BBH(e->continueFlag, e->cameraRoll, e->nextPointFrame));
writer->Write(CMD_F(e->viewAngle));
writer->Write(e->viewAngle);
writer->Write(CMD_HH(e->posX, e->posY));
writer->Write(CMD_HH(e->posZ, e->unused));
}

View File

@ -29,20 +29,6 @@
Ab1, Ad1)) \
}
typedef int32_t Mtx_t[4][4];
typedef union Mtx
{
//_Alignas(8)
Mtx_t m;
int32_t l[16];
struct
{
int16_t i[16];
uint16_t f[16];
};
} Mtx;
#define gsSPBranchLessZraw2(dl, vtx, zval) \
{ _SHIFTL(G_BRANCH_Z,24,8)|_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12),\
(unsigned int)(zval), }
@ -71,7 +57,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
// DEBUG: Write in a marker
Declaration* dbgDecl = dList->parent->GetDeclaration(dList->GetRawDataIndex());
std::string dbgName = StringHelper::Sprintf("%s\\%s", GetParentFolderName(res).c_str(), dbgDecl->varName.c_str());
std::string dbgName = StringHelper::Sprintf("%s/%s", GetParentFolderName(res).c_str(), dbgDecl->varName.c_str());
uint64_t hash = CRC64(dbgName.c_str());
writer->Write((uint32_t)(G_MARKER << 24));
writer->Write((uint32_t)0xBEEFBEEF);
@ -81,7 +67,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
auto dlStart = std::chrono::steady_clock::now();
//for (auto data : dList->instructions)
for (int dataIdx = 0; dataIdx < dList->instructions.size(); dataIdx++)
for (size_t dataIdx = 0; dataIdx < dList->instructions.size(); dataIdx++)
{
auto data = dList->instructions[dataIdx];
uint32_t word0 = 0;
@ -216,7 +202,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
pp ^= G_MTX_PUSH;
mm = (mm & 0x0FFFFFFF) + 0xF0000000;
mm = (mm & 0x0FFFFFFF) + 1;
Gfx value = gsSPMatrix(mm, pp);
word0 = value.words.w0;
@ -243,7 +229,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
if (mtxDecl != nullptr)
{
std::string vName = StringHelper::Sprintf("%s\\%s", (GetParentFolderName(res).c_str()), mtxDecl->varName.c_str());
std::string vName = StringHelper::Sprintf("%s/%s", (GetParentFolderName(res).c_str()), mtxDecl->varName.c_str());
uint64_t hash = CRC64(vName.c_str());
@ -347,7 +333,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
if (dListDecl != nullptr)
{
std::string vName = StringHelper::Sprintf("%s\\%s", (GetParentFolderName(res).c_str()), dListDecl->varName.c_str());
std::string vName = StringHelper::Sprintf("%s/%s", (GetParentFolderName(res).c_str()), dListDecl->varName.c_str());
uint64_t hash = CRC64(vName.c_str());
@ -370,7 +356,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
//std::string fName = StringHelper::Sprintf("%s\\%s", GetParentFolderName(res).c_str(), dListDecl2->varName.c_str());
std::string fName = OTRExporter_DisplayList::GetPathToRes(res, dListDecl2->varName.c_str());
if (!File::Exists("Extract\\" + fName))
if (!File::Exists("Extract/" + fName))
{
MemoryStream* dlStream = new MemoryStream();
BinaryWriter dlWriter = BinaryWriter(dlStream);
@ -382,7 +368,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
//otrArchive->RemoveFile(fName);
#endif
File::WriteAllBytes("Extract\\" + fName, dlStream->ToVector());
File::WriteAllBytes("Extract/" + fName, dlStream->ToVector());
//otrArchive->AddFile(fName, (uintptr_t)dlStream->ToVector().data(), dlWriter.GetBaseAddress());
}
@ -408,7 +394,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
Gfx value;
u32 dListVal = (data & 0x0FFFFFFF) + 0xF0000000;
u32 dListVal = (data & 0x0FFFFFFF) + 1;
if (pp != 0)
value = gsSPBranchList(dListVal);
@ -441,7 +427,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
if (dListDecl != nullptr)
{
std::string vName = StringHelper::Sprintf("%s\\%s", (GetParentFolderName(res).c_str()), dListDecl->varName.c_str());
std::string vName = StringHelper::Sprintf("%s/%s", (GetParentFolderName(res).c_str()), dListDecl->varName.c_str());
uint64_t hash = CRC64(vName.c_str());
@ -464,14 +450,14 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
//std::string fName = StringHelper::Sprintf("%s\\%s", GetParentFolderName(res).c_str(), dListDecl2->varName.c_str());
std::string fName = OTRExporter_DisplayList::GetPathToRes(res, dListDecl2->varName.c_str());
if (!File::Exists("Extract\\" + fName))
if (!File::Exists("Extract/" + fName))
{
MemoryStream* dlStream = new MemoryStream();
BinaryWriter dlWriter = BinaryWriter(dlStream);
Save(dList->otherDLists[i], outPath, &dlWriter);
File::WriteAllBytes("Extract\\" + fName, dlStream->ToVector());
File::WriteAllBytes("Extract/" + fName, dlStream->ToVector());
}
}
else
@ -683,7 +669,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
uint32_t fmt = (__ & 0xE0) >> 5;
uint32_t siz = (__ & 0x18) >> 3;
Gfx value = gsDPSetTextureImage(fmt, siz, www - 1, (seg & 0x0FFFFFFF) + 0xF0000000);
Gfx value = gsDPSetTextureImage(fmt, siz, www - 1, (seg & 0x0FFFFFFF) + 1);
word0 = value.words.w0;
word1 = value.words.w1;
@ -747,7 +733,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
Gfx value = gsSPVertex(data & 0xFFFFFFFF, nn, ((aa >> 1) - nn));
word0 = value.words.w0;
word1 = value.words.w1 | 0xF0000000;
word1 = value.words.w1 | 1;
}
else
//if (dList->vertices.size() > 0)
@ -822,7 +808,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
word0 = hash >> 32;
word1 = hash & 0xFFFFFFFF;
if (!File::Exists("Extract\\" + fName))
if (!File::Exists("Extract/" + fName))
{
//printf("Exporting VTX Data %s\n", fName.c_str());
// Write vertices to file
@ -833,7 +819,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
auto split = StringHelper::Split(vtxDecl->text, "\n");
for (int i = 0; i < split.size(); i++)
for (size_t i = 0; i < split.size(); i++)
{
std::string line = split[i];
@ -878,7 +864,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
}
}
File::WriteAllBytes("Extract\\" + fName, vtxStream->ToVector());
File::WriteAllBytes("Extract/" + fName, vtxStream->ToVector());
auto end = std::chrono::steady_clock::now();
size_t diff = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
@ -918,7 +904,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
std::string OTRExporter_DisplayList::GetPathToRes(ZResource* res, std::string varName)
{
std::string prefix = GetPrefix(res);
std::string fName = StringHelper::Sprintf("%s\\%s", GetParentFolderName(res).c_str(), varName.c_str());
std::string fName = StringHelper::Sprintf("%s/%s", GetParentFolderName(res).c_str(), varName.c_str());
return fName;
}
@ -932,7 +918,7 @@ std::string OTRExporter_DisplayList::GetParentFolderName(ZResource* res)
{
auto split = StringHelper::Split(oName, "_");
oName = "";
for (int i = 0; i < split.size() - 1; i++)
for (size_t i = 0; i < split.size() - 1; i++)
oName += split[i] + "_";
oName += "scene";
@ -943,7 +929,7 @@ std::string OTRExporter_DisplayList::GetParentFolderName(ZResource* res)
}
if (prefix != "")
oName = prefix + "\\" + oName;
oName = prefix + "/" + oName;
return oName;
}

View File

@ -49,7 +49,7 @@ static void ExporterParseFileMode(const std::string& buildMode, ZFileMode& fileM
for (auto item : lst)
{
auto fileData = File::ReadAllBytes(item);
otrArchive->AddFile(StringHelper::Split(item, "Extract\\")[1], (uintptr_t)fileData.data(), fileData.size());
otrArchive->AddFile(StringHelper::Split(item, "Extract/")[1], (uintptr_t)fileData.data(), fileData.size());
}
}
}
@ -85,6 +85,7 @@ static void ExporterFileBegin(ZFile* file)
static void ExporterFileEnd(ZFile* file)
{
delete fileWriter;
}
static void ExporterResourceEnd(ZResource* res, BinaryWriter& writer)
@ -107,7 +108,7 @@ static void ExporterResourceEnd(ZResource* res, BinaryWriter& writer)
{
auto split = StringHelper::Split(oName, "_");
oName = "";
for (int i = 0; i < split.size() - 1; i++)
for (size_t i = 0; i < split.size() - 1; i++)
oName += split[i] + "_";
oName += "scene";
@ -120,11 +121,11 @@ static void ExporterResourceEnd(ZResource* res, BinaryWriter& writer)
std::string fName = "";
if (prefix != "")
fName = StringHelper::Sprintf("%s\\%s\\%s", prefix.c_str(), oName.c_str(), rName.c_str());
fName = StringHelper::Sprintf("%s/%s/%s", prefix.c_str(), oName.c_str(), rName.c_str());
else
fName = StringHelper::Sprintf("%s\\%s", oName.c_str(), rName.c_str());
fName = StringHelper::Sprintf("%s/%s", oName.c_str(), rName.c_str());
File::WriteAllBytes("Extract\\" + fName, strem->ToVector());
File::WriteAllBytes("Extract/" + fName, strem->ToVector());
}
auto end = std::chrono::steady_clock::now();

View File

@ -39,13 +39,13 @@ D_FILES := $(O_FILES:%.o=%.d)
LIB := OTRExporter.a
INC_DIRS := $(addprefix -I, \
../../ZAPD/ZAPD \
../../ZAPD/lib/tinyxml2 \
../../ZAPD/lib/libgfxd \
../../ZAPD/ZAPDUtils \
../../OtrLib/otrlib \
../../OtrLib/otrlib/Lib/spdlog/include \
../../OtrLib/otrlib/Lib/Fast3D/U64 \
../../ZAPDTR/ZAPD \
../../ZAPDTR/lib/tinyxml2 \
../../ZAPDTR/lib/libgfxd \
../../ZAPDTR/ZAPDUtils \
../../libultraship/libultraship \
../../libultraship/libultraship/Lib/spdlog/include \
../../libultraship/libultraship/Lib/Fast3D/U64 \
)
# create build directories

View File

@ -9,11 +9,11 @@ void OTRExporter_Path::Save(ZResource* res, const fs::path& outPath, BinaryWrite
writer->Write((uint32_t)path->pathways.size());
for (int k = 0; k < path->pathways.size(); k++)
for (size_t k = 0; k < path->pathways.size(); k++)
{
writer->Write((uint32_t)path->pathways[k].points.size());
for (int i = 0; i < path->pathways[k].points.size(); i++)
for (size_t i = 0; i < path->pathways[k].points.size(); i++)
{
writer->Write(path->pathways[k].points[i].scalars[0].scalarData.s16);
writer->Write(path->pathways[k].points[i].scalars[1].scalarData.s16);

View File

@ -172,7 +172,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite
writer->Write((uint32_t)cmdCsCam->points.size());
for (int i = 0; i < cmdCsCam->points.size(); i++)
for (size_t i = 0; i < cmdCsCam->points.size(); i++)
{
writer->Write(cmdCsCam->points[i].scalars[0].scalarData.s16);
writer->Write(cmdCsCam->points[i].scalars[1].scalarData.s16);
@ -207,12 +207,12 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite
Declaration* dListDeclXlu = poly->parent->GetDeclaration(GETSEGOFFSET(test->xlu));
if (test->opa != 0)
writer->Write(StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclOpa->varName.c_str()));
writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclOpa->varName.c_str()));
else
writer->Write("");
if (test->xlu != 0)
writer->Write(StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclXlu->varName.c_str()));
writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclXlu->varName.c_str()));
else
writer->Write("");
@ -338,7 +338,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite
for (size_t i = 0;i < cmdRoom->romfile->numRooms; i++)
{
//std::string roomName = StringHelper::Sprintf("%s\\%s_room_%i", (StringHelper::Split(room->GetName(), "_")[0] + "_scene").c_str(), StringHelper::Split(room->GetName(), "_scene")[0].c_str(), i);
//std::string roomName = StringHelper::Sprintf("%s/%s_room_%i", (StringHelper::Split(room->GetName(), "_")[0] + "_scene").c_str(), StringHelper::Split(room->GetName(), "_scene")[0].c_str(), i);
std::string roomName = OTRExporter_DisplayList::GetPathToRes(room, StringHelper::Sprintf("%s_room_%i", StringHelper::Split(room->GetName(), "_scene")[0].c_str(), i));
writer->Write(roomName);
writer->Write(cmdRoom->romfile->rooms[i].virtualAddressStart);
@ -453,7 +453,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite
OTRExporter_Cutscene cs;
cs.Save(cmdSetCutscenes->cutscenes[0], "", &csWriter);
File::WriteAllBytes("Extract\\" + fName, csStream->ToVector());
File::WriteAllBytes("Extract/" + fName, csStream->ToVector());
//std::string fName = OTRExporter_DisplayList::GetPathToRes(res, vtxDecl->varName);
//otrArchive->AddFile(fName, (uintptr_t)csStream->ToVector().data(), csWriter.GetBaseAddress());
@ -465,7 +465,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite
writer->Write((uint32_t)cmdSetPathways->pathwayList.pathways.size());
for (int i = 0; i < cmdSetPathways->pathwayList.pathways.size(); i++)
for (size_t i = 0; i < cmdSetPathways->pathwayList.pathways.size(); i++)
{
Declaration* decl = room->parent->GetDeclaration(GETSEGOFFSET(cmdSetPathways->pathwayList.pathways[i].listSegmentAddress));
//std::string path = StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), decl->varName.c_str());
@ -477,7 +477,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite
OTRExporter_Path pathExp;
pathExp.Save(&cmdSetPathways->pathwayList, outPath, &pathWriter);
File::WriteAllBytes("Extract\\" + path, pathStream->ToVector());
File::WriteAllBytes("Extract/" + path, pathStream->ToVector());
//otrArchive->AddFile(path, (uintptr_t)pathStream->ToVector().data(), pathWriter.GetBaseAddress());
@ -508,12 +508,12 @@ void OTRExporter_Room::WritePolyDList(BinaryWriter* writer, ZRoom* room, Polygon
writer->Write(dlist->unk_06);
[[fallthrough]];
default:
//writer->Write(StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclOpa->varName.c_str()));
//writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclOpa->varName.c_str()));
if (dlist->opaDList != nullptr)
{
auto opaDecl = room->parent->GetDeclaration(GETSEGOFFSET(dlist->opaDList->GetRawDataIndex()));
writer->Write(StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(room).c_str(), opaDecl->varName.c_str()));
writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(room).c_str(), opaDecl->varName.c_str()));
}
else
writer->Write("");
@ -521,7 +521,7 @@ void OTRExporter_Room::WritePolyDList(BinaryWriter* writer, ZRoom* room, Polygon
if (dlist->xluDList != nullptr)
{
auto xluDecl = room->parent->GetDeclaration(GETSEGOFFSET(dlist->xluDList->GetRawDataIndex()));
writer->Write(StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(room).c_str(), xluDecl->varName.c_str()));
writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(room).c_str(), xluDecl->varName.c_str()));
}
else
writer->Write("");

View File

@ -9,7 +9,7 @@ void OTRExporter_Text::Save(ZResource* res, const fs::path& outPath, BinaryWrite
writer->Write((uint32_t)txt->messages.size());
for (int i = 0; i < txt->messages.size(); i++)
for (size_t i = 0; i < txt->messages.size(); i++)
{
writer->Write(txt->messages[i].id);
writer->Write(txt->messages[i].textboxType);

View File

@ -5,21 +5,23 @@ std::map<Ship::ResourceType, uint32_t> resourceVersions;
void InitVersionInfo()
{
resourceVersions[Ship::ResourceType::Animation] = 0;
resourceVersions[Ship::ResourceType::Model] = 0;
resourceVersions[Ship::ResourceType::Texture] = 0;
resourceVersions[Ship::ResourceType::Material] = 0;
resourceVersions[Ship::ResourceType::PlayerAnimation] = 0;
resourceVersions[Ship::ResourceType::DisplayList] = 0;
resourceVersions[Ship::ResourceType::Room] = 0;
resourceVersions[Ship::ResourceType::CollisionHeader] = 0;
resourceVersions[Ship::ResourceType::Skeleton] = 0;
resourceVersions[Ship::ResourceType::SkeletonLimb] = 0;
resourceVersions[Ship::ResourceType::Matrix] = 0;
resourceVersions[Ship::ResourceType::Path] = 0;
resourceVersions[Ship::ResourceType::Vertex] = 0;
resourceVersions[Ship::ResourceType::Cutscene] = 0;
resourceVersions[Ship::ResourceType::Array] = 0;
resourceVersions[Ship::ResourceType::Text] = 0;
resourceVersions[Ship::ResourceType::Blob] = 0;
resourceVersions = {
{ Ship::ResourceType::Animation, 0 },
{ Ship::ResourceType::Model, 0 },
{ Ship::ResourceType::Texture, 0 },
{ Ship::ResourceType::Material, 0 },
{ Ship::ResourceType::PlayerAnimation, 0 },
{ Ship::ResourceType::DisplayList, 0 },
{ Ship::ResourceType::Room, 0 },
{ Ship::ResourceType::CollisionHeader, 0 },
{ Ship::ResourceType::Skeleton, 0 },
{ Ship::ResourceType::SkeletonLimb, 0 },
{ Ship::ResourceType::Matrix, 0 },
{ Ship::ResourceType::Path, 0 },
{ Ship::ResourceType::Vertex, 0 },
{ Ship::ResourceType::Cutscene, 0 },
{ Ship::ResourceType::Array, 0 },
{ Ship::ResourceType::Text, 0 },
{ Ship::ResourceType::Blob, 0 },
};
}

View File

@ -10,13 +10,13 @@ def SignalHandler(sig, frame):
# Don't exit immediately to update the extracted assets file.
def BuildOTR():
shutil.copyfile("baserom/Audiobank", "Extract/Audiobank")
shutil.copyfile("baserom/Audioseq", "Extract/Audioseq")
shutil.copyfile("baserom/Audiotable", "Extract/Audiotable")
shutil.copyfile("../soh/baserom/Audiobank", "Extract/Audiobank")
shutil.copyfile("../soh/baserom/Audioseq", "Extract/Audioseq")
shutil.copyfile("../soh/baserom/Audiotable", "Extract/Audiotable")
shutil.copytree("assets", "Extract/assets")
execStr = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPD/ZAPD.out"
execStr = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out"
execStr += " botr -se OTR"
@ -29,8 +29,8 @@ def BuildOTR():
print("\n")
def ExtractFile(xmlPath, outputPath, outputSourcePath):
execStr = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPD/ZAPD.out"
execStr += " e -eh -i %s -b baserom/ -o %s -osf %s -gsf 1 -rconf CFG/Config.xml -se OTR" % (xmlPath, outputPath, outputSourcePath)
execStr = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out"
execStr += " e -eh -i %s -b ../soh/baserom/ -o %s -osf %s -gsf 1 -rconf CFG/Config.xml -se OTR" % (xmlPath, outputPath, outputSourcePath)
if "overlays" in xmlPath:
execStr += " --static"
@ -48,7 +48,7 @@ def ExtractFunc(fullPath):
*pathList, xmlName = fullPath.split(os.sep)
objectName = os.path.splitext(xmlName)[0]
outPath = os.path.join("..\\soh\\assets\\", *pathList[4:], objectName)
outPath = os.path.join("../soh/assets/", *pathList[4:], objectName)
os.makedirs(outPath, exist_ok=True)
outSourcePath = outPath
@ -75,7 +75,7 @@ def main():
asset_path = args.single
if asset_path is not None:
fullPath = os.path.join("..\\soh\\assets", "xml", asset_path + ".xml")
fullPath = os.path.join("../soh/assets", "xml", asset_path + ".xml")
if not os.path.exists(fullPath):
print(f"Error. File {fullPath} doesn't exists.", file=os.sys.stderr)
exit(1)
@ -90,7 +90,7 @@ def main():
extract_staff_text_path = None
xmlFiles = []
for currentPath, _, files in os.walk(os.path.join("..\\soh\\assets", "xml")):
for currentPath, _, files in os.walk(os.path.join("../soh/assets", "xml")):
for file in files:
fullPath = os.path.join(currentPath, file)
if file.endswith(".xml"):

View File

@ -1,6 +1,6 @@
#include "CollisionExporter.h"
void ExporterExample_Collision::Save(ZResource* res, [[maybe_unused]] fs::path outPath,
void ExporterExample_Collision::Save(ZResource* res, [[maybe_unused]] const fs::path& outPath,
BinaryWriter* writer)
{
ZCollisionHeader* col = (ZCollisionHeader*)res;

View File

@ -6,5 +6,5 @@
class ExporterExample_Collision : public ZResourceExporter
{
public:
void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override;
void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -20,7 +20,7 @@
#include "ZRoom/Commands/SetTimeSettings.h"
#include "ZRoom/Commands/SetWind.h"
void ExporterExample_Room::Save(ZResource* res, fs::path outPath, BinaryWriter* writer)
void ExporterExample_Room::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZRoom* room = dynamic_cast<ZRoom*>(res);

View File

@ -6,5 +6,5 @@
class ExporterExample_Room : public ZResourceExporter
{
public:
void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override;
void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,7 +1,7 @@
#include "TextureExporter.h"
#include "../ZAPD/ZFile.h"
void ExporterExample_Texture::Save(ZResource* res, [[maybe_unused]] fs::path outPath,
void ExporterExample_Texture::Save(ZResource* res, [[maybe_unused]] const fs::path& outPath,
BinaryWriter* writer)
{
ZTexture* tex = (ZTexture*)res;

View File

@ -7,5 +7,5 @@
class ExporterExample_Texture : public ZResourceExporter
{
public:
void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override;
void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -44,7 +44,8 @@ ifneq ($(DEPRECATION_ON),0)
endif
# CXXFLAGS += -DTEXTURE_DEBUG
LDFLAGS := -lm -ldl -lpng
LDFLAGS := -lm -ldl -lpng \
-L../external -L../libultraship -lz -lbz2 -pthread -lultraship -lstorm -lSDL2 -lGLEW -lGL -lX11
# Use LLD if available. Set LLD=0 to not use it
ifeq ($(shell command -v ld.lld >/dev/null 2>&1; echo $$?),0)
@ -59,9 +60,9 @@ UNAME := $(shell uname)
UNAMEM := $(shell uname -m)
ifneq ($(UNAME), Darwin)
LDFLAGS += -Wl,-export-dynamic -lstdc++fs
EXPORTERS := -Wl,--whole-archive ExporterTest/ExporterTest.a -Wl,--no-whole-archive
EXPORTERS := -Wl,--whole-archive ../OTRExporter/OTRExporter/OTRExporter.a -Wl,--no-whole-archive
else
EXPORTERS := -Wl,-force_load ExporterTest/ExporterTest.a
EXPORTERS := -Wl,-force_load ../OTRExporter/OTRExporter/OTRExporter.a
ifeq ($(UNAMEM),arm64)
ifeq ($(shell brew list libpng > /dev/null 2>&1; echo $$?),0)
LDFLAGS += -L $(shell brew --prefix)/lib

View File

@ -27,6 +27,21 @@
//extern const char gBuildHash[];
const char gBuildHash[] = "";
// linux todo: remove, those are because of soh <-> lus dependency problems
float divisor_num = 0.0f;
extern "C" void Audio_SetGameVolume(int player_id, float volume)
{
}
extern "C" int ResourceMgr_OTRSigCheck(char* imgData)
{
}
bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path& outPath,
ZFileMode fileMode);

View File

@ -15,6 +15,124 @@
#include "WarningHandler.h"
#include "gfxd.h"
#define G_MDSFT_ALPHACOMPARE 0
#define G_MDSFT_ZSRCSEL 2
#define G_MDSFT_RENDERMODE 3
#define G_MDSFT_BLENDER 16
#define G_RM_FOG_SHADE_A 0xC8000000
#define G_RM_FOG_PRIM_A 0xC4000000
#define G_RM_PASS 0x0C080000
#define G_RM_AA_ZB_OPA_SURF 0x442078
#define G_RM_AA_ZB_OPA_SURF2 0x112078
#define G_RM_AA_ZB_XLU_SURF 0x4049D8
#define G_RM_AA_ZB_XLU_SURF2 0x1049D8
#define G_RM_AA_ZB_OPA_DECAL 0x442D58
#define G_RM_AA_ZB_OPA_DECAL2 0x112D58
#define G_RM_AA_ZB_XLU_DECAL 0x404DD8
#define G_RM_AA_ZB_XLU_DECAL2 0x104DD8
#define G_RM_AA_ZB_OPA_INTER 0x442478
#define G_RM_AA_ZB_OPA_INTER2 0x112478
#define G_RM_AA_ZB_XLU_INTER 0x4045D8
#define G_RM_AA_ZB_XLU_INTER2 0x1045D8
#define G_RM_AA_ZB_XLU_LINE 0x407858
#define G_RM_AA_ZB_XLU_LINE2 0x107858
#define G_RM_AA_ZB_DEC_LINE 0x407F58
#define G_RM_AA_ZB_DEC_LINE2 0x107F58
#define G_RM_AA_ZB_TEX_EDGE 0x443078
#define G_RM_AA_ZB_TEX_EDGE2 0x113078
#define G_RM_AA_ZB_TEX_INTER 0x443478
#define G_RM_AA_ZB_TEX_INTER2 0x113478
#define G_RM_AA_ZB_SUB_SURF 0x442878
#define G_RM_AA_ZB_SUB_SURF2 0x112278
#define G_RM_AA_ZB_PCL_SURF 0x40007B
#define G_RM_AA_ZB_PCL_SURF2 0x10007B
#define G_RM_AA_ZB_OPA_TERR 0x402078
#define G_RM_AA_ZB_OPA_TERR2 0x102078
#define G_RM_AA_ZB_TEX_TERR 0x403078
#define G_RM_AA_ZB_TEX_TERR2 0x103078
#define G_RM_AA_ZB_SUB_TERR 0x402278
#define G_RM_AA_ZB_SUB_TERR2 0x102278
#define G_RM_RA_ZB_OPA_SURF 0x442038
#define G_RM_RA_ZB_OPA_SURF2 0x112038
#define G_RM_RA_ZB_OPA_DECAL 0x442D18
#define G_RM_RA_ZB_OPA_DECAL2 0x112D18
#define G_RM_RA_ZB_OPA_INTER 0x442438
#define G_RM_RA_ZB_OPA_INTER2 0x112438
#define G_RM_AA_OPA_SURF 0x442048
#define G_RM_AA_OPA_SURF2 0x112048
#define G_RM_AA_XLU_SURF 0x4041C8
#define G_RM_AA_XLU_SURF2 0x1041C8
#define G_RM_AA_XLU_LINE 0x407048
#define G_RM_AA_XLU_LINE2 0x107048
#define G_RM_AA_DEC_LINE 0x407248
#define G_RM_AA_DEC_LINE2 0x107248
#define G_RM_AA_TEX_EDGE 0x443048
#define G_RM_AA_TEX_EDGE2 0x113048
#define G_RM_AA_SUB_SURF 0x442248
#define G_RM_AA_SUB_SURF2 0x112248
#define G_RM_AA_PCL_SURF 0x40004B
#define G_RM_AA_PCL_SURF2 0x10004B
#define G_RM_AA_OPA_TERR 0x402048
#define G_RM_AA_OPA_TERR2 0x102048
#define G_RM_AA_TEX_TERR 0x403048
#define G_RM_AA_TEX_TERR2 0x103048
#define G_RM_AA_SUB_TERR 0x402248
#define G_RM_AA_SUB_TERR2 0x102248
#define G_RM_RA_OPA_SURF 0x442008
#define G_RM_RA_OPA_SURF2 0x112008
#define G_RM_ZB_OPA_SURF 0x442230
#define G_RM_ZB_OPA_SURF2 0x112230
#define G_RM_ZB_XLU_SURF 0x404A50
#define G_RM_ZB_XLU_SURF2 0x104A50
#define G_RM_ZB_OPA_DECAL 0x442E10
#define G_RM_ZB_OPA_DECAL2 0x112E10
#define G_RM_ZB_XLU_DECAL 0x404E50
#define G_RM_ZB_XLU_DECAL2 0x104E50
#define G_RM_ZB_CLD_SURF 0x404B50
#define G_RM_ZB_CLD_SURF2 0x104B50
#define G_RM_ZB_OVL_SURF 0x404F50
#define G_RM_ZB_OVL_SURF2 0x104F50
#define G_RM_ZB_PCL_SURF 0x0C080233
#define G_RM_ZB_PCL_SURF2 0x03020233
#define G_RM_OPA_SURF 0x0C084000
#define G_RM_OPA_SURF2 0x03024000
#define G_RM_XLU_SURF 0x00404200
#define G_RM_XLU_SURF2 0x00104240
#define G_RM_CLD_SURF 0x00404340
#define G_RM_CLD_SURF2 0x00104340
#define G_RM_TEX_EDGE 0x0C087008
#define G_RM_TEX_EDGE2 0x03027008
#define G_RM_PCL_SURF 0x0C084203
#define G_RM_PCL_SURF2 0x03024203
#define G_RM_ADD 0x04484340
#define G_RM_ADD2 0x01124340
#define G_RM_NOOP 0x00000000
#define G_RM_NOOP2 0x00000000
#define G_RM_VISCVG 0x0C844040
#define G_RM_VISCVG2 0x03214040
#define G_RM_OPA_CI 0x0C080000
#define G_RM_OPA_CI2 0x03020000
#define AA_EN 0x8
#define Z_CMP 0x10
#define Z_UPD 0x20
#define IM_RD 0x40
#define CLR_ON_CVG 0x80
#define CVG_DST_CLAMP 0
#define CVG_DST_WRAP 0x100
#define CVG_DST_FULL 0x200
#define CVG_DST_SAVE 0x300
#define ZMODE_OPA 0
#define ZMODE_INTER 0x400
#define ZMODE_XLU 0x800
#define ZMODE_DEC 0xc00
#define CVG_X_ALPHA 0x1000
#define ALPHA_CVG_SEL 0x2000
#define FORCE_BL 0x4000
#define TEX_EDGE 0x0000
REGISTER_ZFILENODE(DList, ZDisplayList);
ZDisplayList::ZDisplayList(ZFile* nParent) : ZResource(nParent)

View File

@ -166,122 +166,6 @@ enum class OoTSegments
FrameBuffer = 16,
};
#define G_MDSFT_ALPHACOMPARE 0
#define G_MDSFT_ZSRCSEL 2
#define G_MDSFT_RENDERMODE 3
#define G_MDSFT_BLENDER 16
#define G_RM_FOG_SHADE_A 0xC8000000
#define G_RM_FOG_PRIM_A 0xC4000000
#define G_RM_PASS 0x0C080000
#define G_RM_AA_ZB_OPA_SURF 0x442078
#define G_RM_AA_ZB_OPA_SURF2 0x112078
#define G_RM_AA_ZB_XLU_SURF 0x4049D8
#define G_RM_AA_ZB_XLU_SURF2 0x1049D8
#define G_RM_AA_ZB_OPA_DECAL 0x442D58
#define G_RM_AA_ZB_OPA_DECAL2 0x112D58
#define G_RM_AA_ZB_XLU_DECAL 0x404DD8
#define G_RM_AA_ZB_XLU_DECAL2 0x104DD8
#define G_RM_AA_ZB_OPA_INTER 0x442478
#define G_RM_AA_ZB_OPA_INTER2 0x112478
#define G_RM_AA_ZB_XLU_INTER 0x4045D8
#define G_RM_AA_ZB_XLU_INTER2 0x1045D8
#define G_RM_AA_ZB_XLU_LINE 0x407858
#define G_RM_AA_ZB_XLU_LINE2 0x107858
#define G_RM_AA_ZB_DEC_LINE 0x407F58
#define G_RM_AA_ZB_DEC_LINE2 0x107F58
#define G_RM_AA_ZB_TEX_EDGE 0x443078
#define G_RM_AA_ZB_TEX_EDGE2 0x113078
#define G_RM_AA_ZB_TEX_INTER 0x443478
#define G_RM_AA_ZB_TEX_INTER2 0x113478
#define G_RM_AA_ZB_SUB_SURF 0x442878
#define G_RM_AA_ZB_SUB_SURF2 0x112278
#define G_RM_AA_ZB_PCL_SURF 0x40007B
#define G_RM_AA_ZB_PCL_SURF2 0x10007B
#define G_RM_AA_ZB_OPA_TERR 0x402078
#define G_RM_AA_ZB_OPA_TERR2 0x102078
#define G_RM_AA_ZB_TEX_TERR 0x403078
#define G_RM_AA_ZB_TEX_TERR2 0x103078
#define G_RM_AA_ZB_SUB_TERR 0x402278
#define G_RM_AA_ZB_SUB_TERR2 0x102278
#define G_RM_RA_ZB_OPA_SURF 0x442038
#define G_RM_RA_ZB_OPA_SURF2 0x112038
#define G_RM_RA_ZB_OPA_DECAL 0x442D18
#define G_RM_RA_ZB_OPA_DECAL2 0x112D18
#define G_RM_RA_ZB_OPA_INTER 0x442438
#define G_RM_RA_ZB_OPA_INTER2 0x112438
#define G_RM_AA_OPA_SURF 0x442048
#define G_RM_AA_OPA_SURF2 0x112048
#define G_RM_AA_XLU_SURF 0x4041C8
#define G_RM_AA_XLU_SURF2 0x1041C8
#define G_RM_AA_XLU_LINE 0x407048
#define G_RM_AA_XLU_LINE2 0x107048
#define G_RM_AA_DEC_LINE 0x407248
#define G_RM_AA_DEC_LINE2 0x107248
#define G_RM_AA_TEX_EDGE 0x443048
#define G_RM_AA_TEX_EDGE2 0x113048
#define G_RM_AA_SUB_SURF 0x442248
#define G_RM_AA_SUB_SURF2 0x112248
#define G_RM_AA_PCL_SURF 0x40004B
#define G_RM_AA_PCL_SURF2 0x10004B
#define G_RM_AA_OPA_TERR 0x402048
#define G_RM_AA_OPA_TERR2 0x102048
#define G_RM_AA_TEX_TERR 0x403048
#define G_RM_AA_TEX_TERR2 0x103048
#define G_RM_AA_SUB_TERR 0x402248
#define G_RM_AA_SUB_TERR2 0x102248
#define G_RM_RA_OPA_SURF 0x442008
#define G_RM_RA_OPA_SURF2 0x112008
#define G_RM_ZB_OPA_SURF 0x442230
#define G_RM_ZB_OPA_SURF2 0x112230
#define G_RM_ZB_XLU_SURF 0x404A50
#define G_RM_ZB_XLU_SURF2 0x104A50
#define G_RM_ZB_OPA_DECAL 0x442E10
#define G_RM_ZB_OPA_DECAL2 0x112E10
#define G_RM_ZB_XLU_DECAL 0x404E50
#define G_RM_ZB_XLU_DECAL2 0x104E50
#define G_RM_ZB_CLD_SURF 0x404B50
#define G_RM_ZB_CLD_SURF2 0x104B50
#define G_RM_ZB_OVL_SURF 0x404F50
#define G_RM_ZB_OVL_SURF2 0x104F50
#define G_RM_ZB_PCL_SURF 0x0C080233
#define G_RM_ZB_PCL_SURF2 0x03020233
#define G_RM_OPA_SURF 0x0C084000
#define G_RM_OPA_SURF2 0x03024000
#define G_RM_XLU_SURF 0x00404200
#define G_RM_XLU_SURF2 0x00104240
#define G_RM_CLD_SURF 0x00404340
#define G_RM_CLD_SURF2 0x00104340
#define G_RM_TEX_EDGE 0x0C087008
#define G_RM_TEX_EDGE2 0x03027008
#define G_RM_PCL_SURF 0x0C084203
#define G_RM_PCL_SURF2 0x03024203
#define G_RM_ADD 0x04484340
#define G_RM_ADD2 0x01124340
#define G_RM_NOOP 0x00000000
#define G_RM_NOOP2 0x00000000
#define G_RM_VISCVG 0x0C844040
#define G_RM_VISCVG2 0x03214040
#define G_RM_OPA_CI 0x0C080000
#define G_RM_OPA_CI2 0x03020000
#define AA_EN 0x8
#define Z_CMP 0x10
#define Z_UPD 0x20
#define IM_RD 0x40
#define CLR_ON_CVG 0x80
#define CVG_DST_CLAMP 0
#define CVG_DST_WRAP 0x100
#define CVG_DST_FULL 0x200
#define CVG_DST_SAVE 0x300
#define ZMODE_OPA 0
#define ZMODE_INTER 0x400
#define ZMODE_XLU 0x800
#define ZMODE_DEC 0xc00
#define CVG_X_ALPHA 0x1000
#define ALPHA_CVG_SEL 0x2000
#define FORCE_BL 0x4000
#define TEX_EDGE 0x0000
class ZDisplayList : public ZResource
{

View File

@ -25,19 +25,19 @@ public:
ZLimbSkinType skinSegmentType = ZLimbSkinType::SkinType_0; // Skin only
segptr_t skinSegment = 0; // Skin only
Struct_800A5E28 segmentStruct; // Skin only
Struct_800A5E28 segmentStruct = {0}; // Skin only
// Legacy only
float legTransX, legTransY, legTransZ; // Vec3f
uint16_t rotX, rotY, rotZ; // Vec3s
segptr_t childPtr; // LegacyLimb*
segptr_t siblingPtr; // LegacyLimb*
float legTransX = 0, legTransY = 0, legTransZ = 0; // Vec3f
uint16_t rotX = 0, rotY = 0, rotZ = 0; // Vec3s
segptr_t childPtr = 0; // LegacyLimb*
segptr_t siblingPtr = 0; // LegacyLimb*
segptr_t dListPtr = 0;
segptr_t dList2Ptr = 0; // LOD and Curve Only
int16_t transX, transY, transZ;
uint8_t childIndex, siblingIndex;
int16_t transX = 0, transY = 0, transZ = 0;
uint8_t childIndex = 0, siblingIndex = 0;
ZLimb(ZFile* nParent);

View File

@ -21,7 +21,7 @@ void ZText::ParseRawData()
const auto& rawData = parent->GetRawData();
uint32_t currentPtr = StringHelper::StrToL(registeredAttributes.at("CodeOffset").value, 16);
std::vector<uint8_t> codeData = File::ReadAllBytes(Globals::Instance->baseRomPath.string() + "\\code");
std::vector<uint8_t> codeData = File::ReadAllBytes((Globals::Instance->baseRomPath / "code").string());
// In some cases with the multi-process extractor it seems that it fails to read the code file if something else is reading from it at the same time.
while (codeData.size() == 0)

View File

@ -3,6 +3,10 @@
#pragma optimize("2", on)
#define _CRT_SECURE_NO_WARNINGS
#ifndef _MSC_VER
#define vsprintf_s vsprintf
#endif
std::vector<std::string> StringHelper::Split(std::string s, const std::string& delimiter)
{
std::vector<std::string> result;

View File

@ -354,3 +354,5 @@ MigrationBackup/
!libultraship/Lib/**
libultraship/DebugObj/*
build/
libultraship.a

View File

@ -1,15 +1,148 @@
# Only used for standalone compilation, usually inherits these from the main makefile
CXXFLAGS ?= -Wall -Wextra -O2 -g -std=c++17
CXX := g++
CC := gcc
AR := ar
FORMAT := clang-format-11
ASAN ?= 0
DEBUG ?= 1
OPTFLAGS ?= -O0
LTO ?= 0
WARN := -Wall -Wextra -Werror \
-Wno-unused-variable \
-Wno-unused-parameter \
-Wno-unused-function \
-Wno-parentheses \
-Wno-narrowing \
-Wno-missing-field-initializers
CXXFLAGS := $(WARN) -std=c++20 -D_GNU_SOURCE -DENABLE_OPENGL -m32
CFLAGS := $(WARN) -std=c99 -D_GNU_SOURCE -DENABLE_OPENGL -m32
CPPFLAGS := -MMD
ifneq ($(DEBUG),0)
CXXFLAGS += -g -D_DEBUG
CFLAGS += -g -D_DEBUG
endif
ifneq ($(ASAN),0)
CXXFLAGS += -fsanitize=address
CFLAGS += -fsanitize=address
endif
ifneq ($(LTO),0)
CXXFLAGS += -flto
CFLAGS += -flto
endif
SRC_DIRS := $(shell find -type d -not -path "*build*")
CPP_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp))
H_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.h))
O_FILES := $(foreach f,$(CPP_FILES:.cpp=.o),build/$f)
LIB := otrlib.a
CXX_FILES := \
libultraship/Blob.cpp \
libultraship/Cvar.cpp \
libultraship/Environment.cpp \
libultraship/GameSettings.cpp \
libultraship/luslog.cpp \
libultraship/ModManager.cpp \
libultraship/SDLAudioPlayer.cpp \
libultraship/SohConsole.cpp \
libultraship/Factories/AnimationFactory.cpp \
libultraship/Factories/ArrayFactory.cpp \
libultraship/Factories/BlobFactory.cpp \
libultraship/Factories/CutsceneFactory.cpp \
libultraship/Factories/MtxFactory.cpp \
libultraship/Factories/PathFactory.cpp \
libultraship/Animation.cpp \
libultraship/Factories/TextFactory.cpp \
libultraship/Factories/TextureFactory.cpp \
libultraship/Factories/VtxFactory.cpp \
libultraship/Array.cpp \
libultraship/ConfigFile.cpp \
libultraship/Controller.cpp \
libultraship/SohHooks.cpp \
libultraship/SohImGuiImpl.cpp \
libultraship/KeyboardController.cpp \
libultraship/Factories/CollisionHeaderFactory.cpp \
libultraship/Factories/DisplayListFactory.cpp \
libultraship/Factories/MaterialFactory.cpp \
libultraship/Factories/PlayerAnimationFactory.cpp \
libultraship/Factories/ResourceLoader.cpp \
libultraship/Factories/SceneFactory.cpp \
libultraship/Factories/SkeletonFactory.cpp \
libultraship/Factories/SkeletonLimbFactory.cpp \
libultraship/Lib/Fast3D/gfx_cc.cpp \
libultraship/Lib/Fast3D/gfx_direct3d11.cpp \
libultraship/Lib/Fast3D/gfx_direct3d12.cpp \
libultraship/Lib/Fast3D/gfx_direct3d_common.cpp \
libultraship/Lib/Fast3D/gfx_dxgi.cpp \
libultraship/Lib/Fast3D/gfx_glx.cpp \
libultraship/Lib/Fast3D/gfx_opengl.cpp \
libultraship/Lib/Fast3D/gfx_pc.cpp \
libultraship/Lib/Fast3D/gfx_sdl2.cpp \
libultraship/Lib/ImGui/backends/imgui_impl_opengl3.cpp \
libultraship/Lib/ImGui/backends/imgui_impl_sdl.cpp \
libultraship/Lib/ImGui/imgui.cpp \
libultraship/Lib/ImGui/imgui_demo.cpp \
libultraship/Lib/ImGui/imgui_draw.cpp \
libultraship/Lib/ImGui/imgui_tables.cpp \
libultraship/Lib/ImGui/imgui_widgets.cpp \
libultraship/Lib/StrHash64.cpp \
libultraship/Lib/tinyxml2/tinyxml2.cpp \
libultraship/Archive.cpp \
libultraship/CollisionHeader.cpp \
libultraship/ControllerAttachment.cpp \
libultraship/Cutscene.cpp \
libultraship/DisplayList.cpp \
libultraship/GlobalCtx2.cpp \
libultraship/File.cpp \
libultraship/Material.cpp \
libultraship/Matrix.cpp \
libultraship/MemoryPack.cpp \
libultraship/Model.cpp \
libultraship/Path.cpp \
libultraship/PlayerAnimation.cpp \
libultraship/Resource.cpp \
libultraship/ResourceMgr.cpp \
libultraship/RumblePack.cpp \
libultraship/Scene.cpp \
libultraship/Skeleton.cpp \
libultraship/SkeletonLimb.cpp \
libultraship/Text.cpp \
libultraship/Texture.cpp \
libultraship/TextureMod.cpp \
libultraship/Utils.cpp \
libultraship/Vertex.cpp \
libultraship/Window.cpp \
libultraship/WindowShim.cpp \
libultraship/stox.cpp \
libultraship/SDLController.cpp
C_FILES := \
libultraship/mixer.c \
libultraship/Lib/stb/stb_impl.c
FMT_FILES := $(shell find libultraship/ -type f \( -name *.cpp -o -name *.h \) -a -not -path "libultraship/Lib/*")
O_FILES := \
$(CXX_FILES:%.cpp=build/%.o) \
$(C_FILES:%.c=build/%.o)
D_FILES := $(O_FILES:%.o=%.d)
LIB := libultraship.a
INC_DIRS := $(addprefix -I, \
../ZAPDTR/ZAPDUtils \
libultraship/Lib/Fast3D/U64 \
libultraship/Lib/spdlog \
libultraship/Lib/spdlog/include \
libultraship \
)
# create build directories
$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir)))
$(shell mkdir -p $(SRC_DIRS:%=build/%))
all: $(LIB)
@ -17,12 +150,17 @@ clean:
rm -rf build $(LIB)
format:
clang-format-11 -i $(CPP_FILES) $(H_FILES)
$(FORMAT) -i $(FMT_FILES)
.PHONY: all clean format
build/%.o: %.cpp
$(CXX) $(CXXFLAGS) $(OPTFLAGS) -I ./ -I ../ZAPD/ZAPD -I ../ZAPD/ZAPDUtils -I ../../ZAPD/lib/tinyxml2 -I otrlib/Lib/spdlog/include -c $(OUTPUT_OPTION) $<
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPTFLAGS) $(INC_DIRS) -c $< -o $@
build/%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(OPTFLAGS) $(INC_DIRS) -c $< -o $@
$(LIB): $(O_FILES)
$(AR) rcs $@ $^
-include $(D_FILES)

View File

@ -21,7 +21,7 @@ void Ship::AnimationV0::ParseFileBinary(BinaryReader* reader, Resource* res)
uint32_t rotIndCnt = reader->ReadUInt32();
anim->rotationIndices.reserve(rotIndCnt);
for (int i = 0; i < rotIndCnt; i++)
for (size_t i = 0; i < rotIndCnt; i++)
{
uint16_t x = reader->ReadUInt16();
uint16_t y = reader->ReadUInt16();

View File

@ -28,7 +28,7 @@ namespace Ship {
std::shared_ptr<Archive> Archive::CreateArchive(const std::string& archivePath, int fileCapacity)
{
Archive* archive = new Archive(archivePath, true);
auto archive = std::make_shared<Archive>(archivePath, true);
TCHAR* t_filename = new TCHAR[archivePath.size() + 1];
t_filename[archivePath.size()] = 0;
@ -37,10 +37,15 @@ namespace Ship {
bool success = SFileCreateArchive(t_filename, MPQ_CREATE_LISTFILE | MPQ_CREATE_ATTRIBUTES | MPQ_CREATE_ARCHIVE_V2, fileCapacity, &archive->mainMPQ);
int error = GetLastError();
if (success) {
delete[] t_filename;
if (success)
{
archive->mpqHandles[archivePath] = archive->mainMPQ;
return std::make_shared<Archive>(*archive);
} else {
return archive;
}
else
{
SPDLOG_ERROR("({}) We tried to create an archive, but it has fallen and cannot get up.");
return nullptr;
}
@ -139,13 +144,16 @@ namespace Ship {
bool Archive::AddFile(const std::string& path, uintptr_t fileData, DWORD dwFileSize) {
HANDLE hFile;
#ifdef _MSC_VER
SYSTEMTIME sysTime;
GetSystemTime(&sysTime);
FILETIME t;
SystemTimeToFileTime(&sysTime, &t);
ULONGLONG stupidHack = static_cast<uint64_t>(t.dwHighDateTime) << (sizeof(t.dwHighDateTime) * 8) | t.dwLowDateTime;
#else
time_t stupidHack;
time(&stupidHack);
#endif
if (!SFileCreateFile(mainMPQ, path.c_str(), stupidHack, dwFileSize, 0, MPQ_FILE_COMPRESS, &hFile)) {
SPDLOG_ERROR("({}) Failed to create file of {} bytes {} in archive {}", GetLastError(), dwFileSize, path.c_str(), MainPath.c_str());
return false;
@ -302,11 +310,16 @@ namespace Ship {
bool Archive::LoadMainMPQ(bool enableWriting, bool genCRCMap) {
HANDLE mpqHandle = NULL;
#ifdef _MSC_VER
std::wstring wfullPath = std::filesystem::absolute(MainPath).wstring();
#endif
std::string fullPath = std::filesystem::absolute(MainPath).string();
std::wstring wFileName = std::filesystem::absolute(MainPath).wstring();
if (!SFileOpenArchive(wFileName.c_str(), 0, enableWriting ? 0 : MPQ_OPEN_READ_ONLY, &mpqHandle)) {
#ifdef _MSC_VER
if (!SFileOpenArchive(wfullPath.c_str(), 0, enableWriting ? 0 : MPQ_OPEN_READ_ONLY, &mpqHandle)) {
#else
if (!SFileOpenArchive(fullPath.c_str(), 0, enableWriting ? 0 : MPQ_OPEN_READ_ONLY, &mpqHandle)) {
#endif
SPDLOG_ERROR("({}) Failed to open main mpq file {}.", GetLastError(), fullPath.c_str());
return false;
}
@ -340,12 +353,19 @@ namespace Ship {
std::wstring wPath = std::filesystem::absolute(path).wstring();
#ifdef _MSC_VER
if (!SFileOpenArchive(wPath.c_str(), 0, MPQ_OPEN_READ_ONLY, &patchHandle)) {
#else
if (!SFileOpenArchive(fullPath.c_str(), 0, MPQ_OPEN_READ_ONLY, &patchHandle)) {
#endif
SPDLOG_ERROR("({}) Failed to open patch mpq file {} while applying to {}.", GetLastError(), path.c_str(), MainPath.c_str());
return false;
}
#ifdef _MSC_VER
if (!SFileOpenPatchArchive(mainMPQ, wPath.c_str(), "", 0)) {
#else
if (!SFileOpenPatchArchive(mainMPQ, fullPath.c_str(), "", 0)) {
#endif
SPDLOG_ERROR("({}) Failed to apply patch mpq file {} to main mpq {}.", GetLastError(), path.c_str(), MainPath.c_str());
return false;
}

View File

@ -51,6 +51,8 @@ namespace Ship
data.u16 = reader->ReadUInt16();
break;
// OTRTODO: IMPLEMENT OTHER TYPES!
default:
break;
}
arr->scalars.push_back(data);

View File

@ -29,9 +29,9 @@ namespace Ship {
bool CreateDefaultConfig();
private:
mINI::INIFile File;
mINI::INIStructure Val;
std::weak_ptr<GlobalCtx2> Context;
std::string Path;
mINI::INIFile File;
};
}

View File

@ -1,4 +1,4 @@
#include "cvar.h"
#include "Cvar.h"
#include <map>
#include <string>
#include <PR/ultra64/gbi.h>

View File

@ -1,10 +1,11 @@
#include "GameSettings.h"
// Audio
#include <cstddef>
#include <PR/ultra64/types.h>
#include <PR/ultra64/sptask.h>
#include <PR/ultra64/pi.h>
#include <PR/ultra64/message.h>
#include <PR/ultra64/types.h>
#include "ConfigFile.h"
#include "Cvar.h"

View File

@ -54,7 +54,11 @@ namespace Ship {
if (!ResMan->DidLoadSuccessfully())
{
#ifdef _MSC_VER
MessageBox(NULL, L"Main OTR file not found!", L"Uh oh", MB_OK);
#else
SPDLOG_ERROR("Main OTR file not found!");
#endif
exit(1);
}
INSTANCE = new ModManager(ResMan);

View File

@ -998,7 +998,7 @@
#define G_DL_PUSH 0x00
#define G_DL_NOPUSH 0x01
#if _MSC_VER
#if defined(_MSC_VER) || defined(__GNUC__)
#define _LANGUAGE_C
#endif
@ -3118,7 +3118,7 @@ _DW({ \
#endif
*/
#ifdef _MSC_VER
#if defined(_MSC_VER)
#define CALL_2(A,B) A B
#define CALL_3(A,B,C) A B C
@ -3129,12 +3129,12 @@ _DW({ \
#define gsDPSetCombineMode(a, b) gsDPSetCombineLERP(a, b)
#endif
#if _MSC_VER
#if defined(_MSC_VER) || defined(__GNUC__)
#define CALL_2(A,B) A B
#define CALL_3(A,B,C) A B C
#define gsDPSetCombineMode(a, b) CALL_2(gsDPSetCombineLERP, (a, b))
//#define gsDPSetCombineMode(a, b) _SHIFTL(0, 24, 8), 0
// #define gsDPSetCombineMode(a, b) CALL_2(gsDPSetCombineLERP, (a, b))
// #define gsDPSetCombineMode(a, b) _SHIFTL(0, 24, 8), 0
#else
#define gsDPSetCombineMode(a, b) gsDPSetCombineLERP(a, b)
#endif

View File

@ -33,6 +33,7 @@
#define G_OFF (0)
#include <stdint.h>
#include "types.h"
#include "gbi.h"
#include "abi.h"

View File

@ -276,7 +276,7 @@ static void gfx_glx_set_fullscreen_state(bool on, bool call_callback) {
xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0;
XSendEvent(glx.dpy, glx.root, 0, SubstructureNotifyMask | SubstructureRedirectMask, &xev);
gfx_glx_ShowHideMouse(on);
gfx_glx_show_cursor(on);
if (glx.on_fullscreen_changed != NULL && call_callback) {
glx.on_fullscreen_changed(on);
@ -439,7 +439,7 @@ static void gfx_glx_handle_events(void) {
}
}
}
if (xev.type == ClientMessage && xev.xclient.data.l[0] == glx.atom_wm_delete_window) {
if (xev.type == ClientMessage && (Atom)xev.xclient.data.l[0] == glx.atom_wm_delete_window) {
exit(0);
}
}
@ -458,7 +458,7 @@ static void gfx_glx_swap_buffers_begin(void) {
uint64_t target = glx.wanted_ust / FRAME_INTERVAL_US_DENOMINATOR;
uint64_t now;
while (target > (now = (uint64_t)get_time() - glx.ust0)) {
struct timespec ts = {(target - now) / 1000000, ((target - now) % 1000000) * 1000};
struct timespec ts = {(time_t)((target - now) / 1000000), (time_t)(((target - now) % 1000000) * 1000)};
if (nanosleep(&ts, NULL) == 0) {
break;
}
@ -600,6 +600,10 @@ static double gfx_glx_get_time(void) {
return 0.0;
}
static void gfx_glx_set_frame_divisor(int divisor) {
// TODO
}
struct GfxWindowManagerAPI gfx_glx = {
gfx_glx_init,
gfx_glx_set_keyboard_callbacks,
@ -612,7 +616,8 @@ struct GfxWindowManagerAPI gfx_glx = {
gfx_glx_start_frame,
gfx_glx_swap_buffers_begin,
gfx_glx_swap_buffers_end,
gfx_glx_get_time
gfx_glx_get_time,
gfx_glx_set_frame_divisor,
};
#endif

View File

@ -3,6 +3,6 @@
#include "gfx_window_manager_api.h"
struct GfxWindowManagerAPI gfx_glx;
extern struct GfxWindowManagerAPI gfx_glx;
#endif

View File

@ -29,8 +29,9 @@
#include "SDL_opengl.h"
#else
#include <SDL2/SDL.h>
#include <GL/glew.h>
#define GL_GLEXT_PROTOTYPES 1
#include <SDL2/SDL_opengles2.h>
// #include <SDL2/SDL_opengles2.h>
#endif
#include "gfx_cc.h"
@ -163,6 +164,7 @@ static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_
return "texel.a";
}
}
return "";
}
static void append_formula(char *buf, size_t *len, uint8_t c[2][4], bool do_single, bool do_multiply, bool do_mix, bool with_alpha, bool only_alpha, bool opt_alpha) {
@ -510,6 +512,7 @@ static uint32_t gfx_cm_to_opengl(uint32_t val) {
case G_TX_NOMIRROR | G_TX_WRAP:
return GL_REPEAT;
}
return 0;
}
static void gfx_opengl_set_sampler_parameters(int tile, bool linear_filter, uint32_t cms, uint32_t cmt) {

View File

@ -9,6 +9,7 @@
#include <map>
#include <unordered_map>
#include <vector>
#include <list>
#ifndef _LANGUAGE_C
#define _LANGUAGE_C
@ -435,15 +436,15 @@ static void gfx_generate_cc(struct ColorCombiner *comb, uint64_t cc_id) {
val = SHADER_COMBINED;
break;
}
// fallthrough for G_ACMUX_LOD_FRACTION
c[i][1][j] = G_CCMUX_LOD_FRACTION;
[[fallthrough]]; // for G_ACMUX_LOD_FRACTION
case G_ACMUX_1:
//case G_ACMUX_PRIM_LOD_FRAC: same numerical value
if (j != 2) {
val = SHADER_1;
break;
}
// fallthrough for G_ACMUX_PRIM_LOD_FRAC
[[fallthrough]]; // for G_ACMUX_PRIM_LOD_FRAC
case G_ACMUX_PRIMITIVE:
case G_ACMUX_SHADE:
case G_ACMUX_ENVIRONMENT:
@ -538,7 +539,7 @@ static void gfx_texture_cache_delete(const uint8_t* orig_addr)
if (it->first.texture_addr == orig_addr) {
gfx_texture_cache.lru.erase(*(list<TextureCacheMap::iterator>::iterator*)&it->second.lru_location);
gfx_texture_cache.free_texture_ids.push_back(it->second.texture_id);
gfx_texture_cache.map.erase(it);
gfx_texture_cache.map.erase(it->first);
again = true;
break;
}
@ -1671,7 +1672,7 @@ static void gfx_dp_load_block(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t
SUPPORT_CHECK(ult == 0);
// The lrs field rather seems to be number of pixels to load
uint32_t word_size_shift;
uint32_t word_size_shift = 0;
switch (rdp.texture_to_load.siz) {
case G_IM_SIZ_4b:
word_size_shift = 0; // Or -1? It's unused in SM64 anyway.
@ -1699,7 +1700,7 @@ static void gfx_dp_load_block(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t
static void gfx_dp_load_tile(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t lrs, uint32_t lrt) {
SUPPORT_CHECK(tile == G_TX_LOADTILE);
uint32_t word_size_shift;
uint32_t word_size_shift = 0;
switch (rdp.texture_to_load.siz) {
case G_IM_SIZ_4b:
word_size_shift = 0;
@ -2030,12 +2031,11 @@ static void gfx_s2dex_bg_copy(const uObjBg* bg) {
static inline void* seg_addr(uintptr_t w1)
{
// Segmented?
if (w1 >= 0xF0000000)
if (w1 & 1)
{
uint32_t segNum = (w1 >> 24);
segNum -= 0xF0;
uint32_t offset = w1 & 0x00FFFFFF;
uint32_t offset = w1 & 0x00FFFFFE;
//offset = 0; // Cursed Malon bug
if (segmentPointers[segNum] != 0)
@ -2052,7 +2052,7 @@ static inline void* seg_addr(uintptr_t w1)
#define C0(pos, width) ((cmd->words.w0 >> (pos)) & ((1U << width) - 1))
#define C1(pos, width) ((cmd->words.w1 >> (pos)) & ((1U << width) - 1))
int dListBP;
unsigned int dListBP;
int matrixBP;
uintptr_t clearMtx;
@ -2220,7 +2220,7 @@ static void gfx_run_dl(Gfx* cmd) {
cmd--;
if (ourHash != -1)
if (ourHash != (uint64_t)-1)
ResourceMgr_RegisterResourcePatch(ourHash, cmd - dListStart, cmd->words.w1);
cmd->words.w1 = (uintptr_t)vtx;
@ -2338,7 +2338,7 @@ static void gfx_run_dl(Gfx* cmd) {
case G_QUAD:
{
int bp = 0;
// fallthrough
[[fallthrough]];
}
#endif
#if defined(F3DEX_GBI) || defined(F3DLP_GBI)
@ -2368,7 +2368,7 @@ static void gfx_run_dl(Gfx* cmd) {
char* imgData = (char*)i;
if ((i & 0xF0000000) != 0xF0000000)
if ((i & 1) != 1)
if (ResourceMgr_OTRSigCheck(imgData) == 1)
i = (uintptr_t)ResourceMgr_LoadTexByName(imgData);
@ -2389,7 +2389,7 @@ static void gfx_run_dl(Gfx* cmd) {
//printf("G_SETTIMG_OTR: %s, %08X\n", fileName, hash);
#endif
if (addr != NULL)
if (addr != 0)
{
tex = (char*)addr;
}
@ -2403,7 +2403,7 @@ static void gfx_run_dl(Gfx* cmd) {
uintptr_t oldData = cmd->words.w1;
cmd->words.w1 = (uintptr_t)tex;
if (ourHash != -1)
if (ourHash != (uint64_t)-1)
ResourceMgr_RegisterResourcePatch(ourHash, cmd - dListStart, oldData);
cmd++;
@ -2607,7 +2607,7 @@ void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, co
gfx_current_dimensions.height = SCREEN_HEIGHT;
for (int i = 0; i < 16; i++)
segmentPointers[i] = NULL;
segmentPointers[i] = 0;
// Used in the 120 star TAS
static uint32_t precomp_shaders[] = {

View File

@ -4,6 +4,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <unordered_map>
#include <list>
struct GfxRenderingAPI;
struct GfxWindowManagerAPI;

View File

@ -1,6 +1,6 @@
#include <stdio.h>
#if !defined(__linux__) && defined(ENABLE_OPENGL)
#if defined(ENABLE_OPENGL)
#ifdef __MINGW32__
#define FOR_WINDOWS 1
@ -23,7 +23,9 @@
#include "gfx_window_manager_api.h"
#include "gfx_screen_config.h"
#ifdef _MSC_VER
#include <WTypesbase.h>
#endif
#include <time.h>
#define GFX_API_NAME "SDL2 - OpenGL"
@ -117,7 +119,9 @@ static void set_fullscreen(bool on, bool call_callback) {
}
static uint64_t previous_time;
#ifndef __linux__
static HANDLE timer;
#endif
static int frameDivisor = 1;
@ -131,7 +135,9 @@ static void gfx_sdl_init(const char *game_name, bool start_in_fullscreen) {
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
#ifndef __linux
timer = CreateWaitableTimer(nullptr, false, nullptr);
#endif
//SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
//SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);

View File

@ -86,14 +86,8 @@
#include <stdint.h>
#define u8 uint8_t
#define u16 uint16_t
#define u32 uint32_t
#define u64 uint64_t
#define unint uint32_t
#define INITIAL_CRC64 0xffffffffffffffffULL
extern uint64_t update_crc64(const void* buf, unint len, u64 crc);
extern u64 crc64(const void* buf, unint len);
extern u64 CRC64(const char* t);
extern uint64_t update_crc64(const void* buf, uint32_t len, uint64_t crc);
extern uint64_t crc64(const void* buf, uint32_t len);
extern uint64_t CRC64(const char* t);

View File

@ -46,7 +46,7 @@ protected:
formatted.push_back('\0');
const char *msg_output = formatted.data();
if (Game::Settings.debug.soh_sink && SohImGui::console->opened)
SohImGui::console->Append("SoH Logging", priority, msg_output);
SohImGui::console->Append("SoH Logging", priority, "%s", msg_output);
}
void flush_() override {}
@ -66,6 +66,8 @@ private:
return Priority::ERROR_LVL;
case spdlog::level::critical:
return Priority::ERROR_LVL;
default:
break;
}
return Priority::LOG_LVL;
}

View File

@ -39,7 +39,7 @@ namespace Ship
Vertex* vtxData = new Vertex[numVerts];
uint32_t* indicesData = new uint32_t[numPolys];
if (vertices != NULL)
if (vertices != 0)
{
reader->Seek(headerStart + vertices, SeekOffsetType::Start);
@ -47,7 +47,7 @@ namespace Ship
vtxData[i].pos = reader->ReadVec3f();
}
if (normals != NULL)
if (normals != 0)
{
reader->Seek(headerStart + normals, SeekOffsetType::Start);
@ -55,7 +55,7 @@ namespace Ship
vtxData[i].normal = reader->ReadVec3f();
}
if (vertexColors != NULL)
if (vertexColors != 0)
{
reader->Seek(headerStart + vertexColors, SeekOffsetType::Start);
@ -63,7 +63,7 @@ namespace Ship
vtxData[i].color = reader->ReadColor3b();
}
if (uvCoords != NULL)
if (uvCoords != 0)
{
reader->Seek(headerStart + uvCoords, SeekOffsetType::Start);
@ -71,7 +71,7 @@ namespace Ship
vtxData[i].uv = reader->ReadVec2f();
}
if (boneWeights != NULL)
if (boneWeights != 0)
{
reader->Seek(headerStart + boneWeights, SeekOffsetType::Start);
@ -81,7 +81,7 @@ namespace Ship
mdl->boneWeights[i] = reader->ReadVec2f();
}
if (faces != NULL)
if (faces != 0)
{
reader->Seek(headerStart + faces, SeekOffsetType::Start);
reader->Read((char*)indicesData, numPolys * sizeof(uint32_t));

View File

@ -2,8 +2,8 @@
#include "DisplayList.h"
#include "ResourceMgr.h"
#include "Utils/BinaryReader.h"
#include "lib/tinyxml2/tinyxml2.h"
#include "lib/Fast3D/U64/PR/ultra64/gbi.h"
#include "Lib/tinyxml2/tinyxml2.h"
#include "Lib/Fast3D/U64/PR/ultra64/gbi.h"
namespace Ship
{
@ -38,7 +38,7 @@ namespace Ship
free(cachedGameAsset);
cachedGameAsset = nullptr;
for (int i = 0; i < patches.size(); i++)
for (size_t i = 0; i < patches.size(); i++)
{
std::string hashStr = resMgr->HashToString(patches[i].crc);
auto resShared = resMgr->GetCachedFile(hashStr);

View File

@ -6,7 +6,7 @@
#include "GlobalCtx2.h"
#include "StrHash.h"
#include "File.h"
#include "lib/tinyxml2/tinyxml2.h"
#include "Lib/tinyxml2/tinyxml2.h"
namespace Ship
{
@ -101,10 +101,10 @@ namespace Ship
class ResourcePromise {
public:
std::shared_ptr<Resource> Resource;
std::shared_ptr<File> File;
std::condition_variable ResourceLoadNotifier;
std::mutex ResourceLoadMutex;
std::shared_ptr<Resource> resource;
std::shared_ptr<File> file;
std::condition_variable resourceLoadNotifier;
std::mutex resourceLoadMutex;
bool bHasResourceLoaded = false;
};
}

View File

@ -118,13 +118,13 @@ namespace Ship {
// Wait for the underlying File to complete loading
{
std::unique_lock<std::mutex> FileLock(ToLoad->File->FileLoadMutex);
while (!ToLoad->File->bIsLoaded && !ToLoad->File->bHasLoadError) {
ToLoad->File->FileLoadNotifier.wait(FileLock);
std::unique_lock<std::mutex> FileLock(ToLoad->file->FileLoadMutex);
while (!ToLoad->file->bIsLoaded && !ToLoad->file->bHasLoadError) {
ToLoad->file->FileLoadNotifier.wait(FileLock);
}
}
auto UnmanagedRes = ResourceLoader::LoadResource(ToLoad->File);
auto UnmanagedRes = ResourceLoader::LoadResource(ToLoad->file);
if (UnmanagedRes != nullptr)
{
@ -132,13 +132,13 @@ namespace Ship {
auto Res = std::shared_ptr<Resource>(UnmanagedRes);
if (Res != nullptr) {
std::unique_lock<std::mutex> Lock(ToLoad->ResourceLoadMutex);
std::unique_lock<std::mutex> Lock(ToLoad->resourceLoadMutex);
ToLoad->bHasResourceLoaded = true;
ToLoad->Resource = Res;
ToLoad->resource = Res;
ResourceCache[Res->file->path] = Res;
SPDLOG_DEBUG("Loaded Resource {} on ResourceMgr thread", ToLoad->File->path);
SPDLOG_DEBUG("Loaded Resource {} on ResourceMgr thread", ToLoad->file->path);
// Disabled for now because it can cause random crashes
//FileCache[Res->File->path] = nullptr;
@ -147,15 +147,15 @@ namespace Ship {
}
else {
ToLoad->bHasResourceLoaded = false;
ToLoad->Resource = nullptr;
ToLoad->resource = nullptr;
SPDLOG_ERROR("Resource load FAILED {} on ResourceMgr thread", ToLoad->File->path);
SPDLOG_ERROR("Resource load FAILED {} on ResourceMgr thread", ToLoad->file->path);
}
//ResLock.lock();
//ResLock.unlock();
ToLoad->ResourceLoadNotifier.notify_all();
ToLoad->resourceLoadNotifier.notify_all();
}
}
@ -205,17 +205,22 @@ namespace Ship {
if (!Promise->bHasResourceLoaded)
{
std::unique_lock<std::mutex> Lock(Promise->ResourceLoadMutex);
std::unique_lock<std::mutex> Lock(Promise->resourceLoadMutex);
while (!Promise->bHasResourceLoaded) {
Promise->ResourceLoadNotifier.wait(Lock);
Promise->resourceLoadNotifier.wait(Lock);
}
}
return Promise->Resource;
return Promise->resource;
}
std::shared_ptr<ResourcePromise> ResourceMgr::LoadResourceAsync(std::string FilePath) {
// todo: what?
#ifdef _MSC_VER
StringHelper::ReplaceOriginal(FilePath, "/", "\\");
#else
StringHelper::ReplaceOriginal(FilePath, "\\", "/");
#endif
if (StringHelper::StartsWith(FilePath, "__OTR__"))
FilePath = StringHelper::Split(FilePath, "__OTR__")[1];
@ -230,14 +235,14 @@ namespace Ship {
}
std::shared_ptr<File> FileData = LoadFile(FilePath);
Promise->File = FileData;
Promise->file = FileData;
Promise->bHasResourceLoaded = false;
ResourceLoadQueue.push(Promise);
ResourceLoadNotifier.notify_all();
} else {
Promise->bHasResourceLoaded = true;
Promise->Resource = resCacheFind->second;
Promise->resource = resCacheFind->second;
}
return Promise;
@ -261,15 +266,15 @@ namespace Ship {
auto PromiseList = CacheDirectoryAsync(SearchMask);
auto LoadedList = std::make_shared<std::vector<std::shared_ptr<Resource>>>();
for (int32_t i = 0; i < PromiseList->size(); i++) {
for (size_t i = 0; i < PromiseList->size(); i++) {
auto Promise = PromiseList->at(i);
std::unique_lock<std::mutex> Lock(Promise->ResourceLoadMutex);
std::unique_lock<std::mutex> Lock(Promise->resourceLoadMutex);
while (!Promise->bHasResourceLoaded) {
Promise->ResourceLoadNotifier.wait(Lock);
Promise->resourceLoadNotifier.wait(Lock);
}
LoadedList->push_back(Promise->Resource);
LoadedList->push_back(Promise->resource);
}
return LoadedList;
@ -280,18 +285,18 @@ namespace Ship {
auto PromiseList = CacheDirectoryAsync(SearchMask);
auto LoadedList = std::make_shared<std::vector<std::shared_ptr<Resource>>>();
for (int32_t i = 0; i < PromiseList->size(); i++) {
for (size_t i = 0; i < PromiseList->size(); i++) {
auto Promise = PromiseList->at(i);
std::unique_lock<std::mutex> Lock(Promise->ResourceLoadMutex);
std::unique_lock<std::mutex> Lock(Promise->resourceLoadMutex);
while (!Promise->bHasResourceLoaded) {
Promise->ResourceLoadNotifier.wait(Lock);
Promise->resourceLoadNotifier.wait(Lock);
}
if (Promise->Resource != nullptr)
Promise->Resource->isDirty = true;
if (Promise->resource != nullptr)
Promise->resource->isDirty = true;
LoadedList->push_back(Promise->Resource);
LoadedList->push_back(Promise->resource);
}
return LoadedList;

View File

@ -46,6 +46,7 @@ namespace Ship
private:
std::weak_ptr<GlobalCtx2> Context;
volatile bool bIsRunning;
std::map<std::string, std::shared_ptr<File>> FileCache;
std::map<std::string, std::shared_ptr<Resource>> ResourceCache;
std::queue<std::shared_ptr<File>> FileLoadQueue;
@ -57,6 +58,5 @@ namespace Ship
std::mutex ResourceLoadMutex;
std::condition_variable FileLoadNotifier;
std::condition_variable ResourceLoadNotifier;
volatile bool bIsRunning;
};
}

View File

@ -333,11 +333,12 @@ namespace Ship {
void SDLController::WriteToSource(ControllerCallback* controller)
{
if (SDL_GameControllerHasRumble(Cont)) {
if (controller->rumble > 0) {
SDL_GameControllerRumble(Cont, 0xFFFF * Game::Settings.controller.rumble_strength, 0xFFFF * Game::Settings.controller.rumble_strength, 1);
}
}
// MERGETODO
// if (SDL_GameControllerHasRumble(Cont)) {
// if (controller->rumble > 0) {
// SDL_GameControllerRumble(Cont, 0xFFFF * Game::Settings.controller.rumble_strength, 0xFFFF * Game::Settings.controller.rumble_strength, 1);
// }
// }
if (SDL_GameControllerHasLED(Cont)) {
if (controller->ledColor == 1) {

View File

@ -24,8 +24,8 @@ namespace Ship {
static bool IsGuidInUse(const std::string& guid);
private:
std::string guid;
SDL_GameController* Cont;
std::string guid;
std::map<int32_t, int16_t> ThresholdMapping;
void LoadAxisThresholds();

View File

@ -137,8 +137,8 @@ namespace Ship
y = 0;
z = 0;
unk_06 = 0;
opa;
xlu;
// opa;
// xlu;
}
SetMesh::SetMesh(BinaryReader* reader) : SceneCommand(reader)

View File

@ -15,7 +15,7 @@ namespace Ship
limb->skinVtxCnt = reader->ReadUInt16();
uint32_t skinCnt = reader->ReadUInt32();
for (int i = 0; i < skinCnt; i++)
for (size_t i = 0; i < skinCnt; i++)
{
Struct_800A598C struc;

View File

@ -16,7 +16,7 @@ std::map<ImGuiKey, std::string> BindingToggle;
static bool HelpCommand(const std::vector<std::string>&) {
INFO("SoH Commands:");
for(const auto& cmd : SohImGui::console->Commands) {
INFO((" - " + cmd.first).c_str());
INFO("%s", (" - " + cmd.first).c_str());
}
return CMD_SUCCESS;
}
@ -35,7 +35,7 @@ std::string toLowerCase(std::string in) {
static bool BindCommand(const std::vector<std::string>& args) {
if(args.size() > 2) {
const ImGuiIO* io = &ImGui::GetIO();;
for (int k = 0; k < std::size(io->KeysData); k++) {
for (size_t k = 0; k < std::size(io->KeysData); k++) {
std::string key(ImGui::GetKeyName(k));
if(toLowerCase(args[1]) == toLowerCase(key)) {
@ -55,7 +55,7 @@ static bool BindCommand(const std::vector<std::string>& args) {
static bool BindToggleCommand(const std::vector<std::string>& args) {
if (args.size() > 2) {
const ImGuiIO* io = &ImGui::GetIO();;
for (int k = 0; k < std::size(io->KeysData); k++) {
for (size_t k = 0; k < std::size(io->KeysData); k++) {
std::string key(ImGui::GetKeyName(k));
if (toLowerCase(args[1]) == toLowerCase(key)) {
@ -177,9 +177,11 @@ void Console::Draw() {
for (const auto& filter : priority_filters) {
const bool is_selected = (filter == std::string(this->level_filter));
if (ImGui::Selectable(filter.c_str(), is_selected))
{
this->level_filter = filter;
if (is_selected) ImGui::SetItemDefaultFocus();
}
}
ImGui::EndCombo();
}
ImGui::SameLine();
@ -194,7 +196,7 @@ void Console::Draw() {
if (ImGui::BeginTable("History", 1)) {
if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow)))
if (this->selectedId < this->Log.size() - 1) ++this->selectedId;
if (this->selectedId < (int)this->Log.size() - 1) ++this->selectedId;
if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow)))
if (this->selectedId > 0) --this->selectedId;
@ -317,7 +319,7 @@ int Console::CallbackStub(ImGuiInputTextCallbackData* data) {
return 0;
}
void Console::Append(const std::string& channel, Priority priority, const char* fmt, ...) IM_FMTARGS(4) {
void Console::Append(const std::string& channel, Priority priority, const char* fmt, ...) {
char buf[1024];
va_list args;
va_start(args, fmt);

View File

@ -7,10 +7,10 @@
#include "Lib/ImGui/imgui.h"
#define LOG(msg, ...) SohImGui::console->Append("Main", Priority::LOG_LVL, msg, __VA_ARGS__)
#define INFO(msg, ...) SohImGui::console->Append("Main", Priority::INFO_LVL, msg, __VA_ARGS__)
#define WARNING(msg, ...) SohImGui::console->Append("Main", Priority::WARNING_LVL, msg, __VA_ARGS__)
#define ERROR(msg, ...) SohImGui::console->Append("Main", Priority::ERROR_LVL, msg, __VA_ARGS__)
#define LOG(msg, ...) SohImGui::console->Append("Main", Priority::LOG_LVL, msg, ##__VA_ARGS__)
#define INFO(msg, ...) SohImGui::console->Append("Main", Priority::INFO_LVL, msg, ##__VA_ARGS__)
#define WARNING(msg, ...) SohImGui::console->Append("Main", Priority::WARNING_LVL, msg, ##__VA_ARGS__)
#define ERROR(msg, ...) SohImGui::console->Append("Main", Priority::ERROR_LVL, msg, ##__VA_ARGS__)
#define CMD_SUCCESS true
#define CMD_FAILED false
#define MAX_BUFFER_SIZE 255
@ -75,7 +75,7 @@ public:
void Init();
void Update();
void Draw();
void Append(const std::string& channel, Priority priority, const char* fmt, ...);
void Append(const std::string& channel, Priority priority, const char* fmt, ...) IM_FMTARGS(4);
void Dispatch(const std::string& line);
static int CallbackStub(ImGuiInputTextCallbackData* data);
};

View File

@ -24,7 +24,7 @@ namespace ModInternal {
bool handleHook(std::shared_ptr<HookCall> call) {
std::string hookName = std::string(call->name);
for (int l = 0; l < listeners[hookName].size(); l++) {
for (size_t l = 0; l < listeners[hookName].size(); l++) {
(listeners[hookName][l])(call);
}
return call->cancelled;

View File

@ -47,6 +47,7 @@ struct HookParameter {
#include <functional>
#include <string>
#include <map>
#include <memory>
struct HookCall {
std::string name;

View File

@ -56,9 +56,13 @@ namespace SohImGui {
case Backend::SDL:
ImGui_ImplSDL2_InitForOpenGL(static_cast<SDL_Window*>(impl.sdl.window), impl.sdl.context);
break;
#if defined(ENABLE_DX11) || defined(ENABLE_DX12)
case Backend::DX11:
ImGui_ImplWin32_Init(impl.dx11.window);
break;
#endif
default:
break;
}
}
@ -67,9 +71,14 @@ namespace SohImGui {
case Backend::SDL:
ImGui_ImplOpenGL3_Init("#version 120");
break;
#if defined(ENABLE_DX11) || defined(ENABLE_DX12)
case Backend::DX11:
ImGui_ImplDX11_Init(static_cast<ID3D11Device*>(impl.dx11.device), static_cast<ID3D11DeviceContext*>(impl.dx11.device_context));
break;
#endif
default:
break;
}
}
@ -78,9 +87,13 @@ namespace SohImGui {
case Backend::SDL:
ImGui_ImplSDL2_ProcessEvent(static_cast<const SDL_Event*>(event.sdl.event));
break;
#if defined(ENABLE_DX11) || defined(ENABLE_DX12)
case Backend::DX11:
ImGui_ImplWin32_WndProcHandler(static_cast<HWND>(event.win32.handle), event.win32.msg, event.win32.wparam, event.win32.lparam);
break;
#endif
default:
break;
}
}
@ -89,9 +102,13 @@ namespace SohImGui {
case Backend::SDL:
ImGui_ImplSDL2_NewFrame(static_cast<SDL_Window*>(impl.sdl.window));
break;
#if defined(ENABLE_DX11) || defined(ENABLE_DX12)
case Backend::DX11:
ImGui_ImplWin32_NewFrame();
break;
#endif
default:
break;
}
}
@ -100,9 +117,13 @@ namespace SohImGui {
case Backend::SDL:
ImGui_ImplOpenGL3_NewFrame();
break;
#if defined(ENABLE_DX11) || defined(ENABLE_DX12)
case Backend::DX11:
ImGui_ImplDX11_NewFrame();
break;
#endif
default:
break;
}
}
@ -111,9 +132,13 @@ namespace SohImGui {
case Backend::SDL:
ImGui_ImplOpenGL3_RenderDrawData(data);
break;
#if defined(ENABLE_DX11) || defined(ENABLE_DX12)
case Backend::DX11:
ImGui_ImplDX11_RenderDrawData(data);
break;
#endif
default:
break;
}
}
@ -121,19 +146,21 @@ namespace SohImGui {
switch (impl.backend) {
case Backend::SDL:
return true;
}
default:
return false;
}
}
bool UseViewports() {
switch (impl.backend) {
case Backend::DX11:
return true;
}
default:
return false;
}
}
void SohImGui::ShowCursor(bool hide, Dialogues d) {
void ShowCursor(bool hide, Dialogues d) {
if (d == Dialogues::dLoadSettings) {
GlobalCtx2::GetInstance()->GetWindow()->ShowCursor(hide);
return;
@ -219,8 +246,11 @@ namespace SohImGui {
ImGuiProcessEvent(event);
}
#ifdef ENABLE_DX11
#define BindButton(btn, status) ImGui::Image(impl.backend == Backend::DX11 ? GetTextureByID(DefaultAssets[btn]->textureId) : (ImTextureID)(DefaultAssets[btn]->textureId), ImVec2(16.0f * scale, 16.0f * scale), ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, (status) ? 255 : 0));
#else
#define BindButton(btn, status) ImGui::Image((ImTextureID)(DefaultAssets[btn]->textureId), ImVec2(16.0f * scale, 16.0f * scale), ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, (status) ? 255 : 0));
#endif
void BindAudioSlider(const char* name, const char* key, float* value, SeqPlayers playerId) {
ImGui::Text(name, static_cast<int>(100 * *(value)));
if (ImGui::SliderFloat((std::string("##") + key).c_str(), value, 0.0f, 1.0f, "")) {
@ -278,7 +308,11 @@ namespace SohImGui {
if (ImGui::BeginMenuBar()) {
if (DefaultAssets.contains("Game_Icon")) {
ImGui::SetCursorPos(ImVec2(5, 2.5f));
#ifdef ENABLE_DX11
ImGui::Image(impl.backend == Backend::DX11 ? GetTextureByID(DefaultAssets["Game_Icon"]->textureId) : reinterpret_cast<ImTextureID>(DefaultAssets["Game_Icon"]->textureId), ImVec2(16.0f, 16.0f));
#else
ImGui::Image(reinterpret_cast<ImTextureID>(DefaultAssets["Game_Icon"]->textureId), ImVec2(16.0f, 16.0f));
#endif
ImGui::SameLine();
ImGui::SetCursorPos(ImVec2(25, 0));
}
@ -407,7 +441,11 @@ namespace SohImGui {
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
ImGui::Begin("Debug Stats", nullptr, ImGuiWindowFlags_None);
#ifdef _MSC_VER
ImGui::Text("Platform: Windows");
#else
ImGui::Text("Platform: Linux");
#endif
ImGui::Text("Status: %.3f ms/frame (%.1f FPS)", 1000.0f / framerate, framerate);
if (UseInternalRes()) {
ImGui::Text("Internal Resolution:");

View File

@ -1,9 +1,14 @@
#include "Utils.h"
#include <cstring>
#ifdef _MSC_VER
#define strdup _strdup
#endif
namespace Utils {
std::vector<std::string> SplitText(const std::string text, char separator = ' ', bool keep_quotes = false) {
std::vector<std::string> args;
char* input = _strdup(text.c_str());
char* input = strdup(text.c_str());
const size_t length = strlen(input);
bool inQuotes = false;

View File

@ -11,7 +11,11 @@
#include "Blob.h"
#include "Matrix.h"
#include "AudioPlayer.h"
#ifdef _MSC_VER
#include "WasapiAudioPlayer.h"
#else
#include "SDLAudioPlayer.h"
#endif
#include "Lib/Fast3D/gfx_pc.h"
#include "Lib/Fast3D/gfx_sdl.h"
#include "Lib/Fast3D/gfx_opengl.h"
@ -40,7 +44,7 @@ extern "C" {
}
// TODO: This for loop is debug. Burn it with fire.
for (size_t i = 0; i < SDL_NumJoysticks(); i++) {
for (int i = 0; i < SDL_NumJoysticks(); i++) {
if (SDL_IsGameController(i)) {
// Get the GUID from SDL
char buf[33];
@ -199,7 +203,7 @@ extern "C" {
return (char*)res->imageData;
}
void ResourceMgr_WriteTexS16ByName(char* texPath, int index, s16 value) {
void ResourceMgr_WriteTexS16ByName(char* texPath, size_t index, s16 value) {
const auto res = static_cast<Ship::Texture*>(Ship::GlobalCtx2::GetInstance()->GetResourceManager()->LoadResource(texPath).get());
if (res != nullptr)
@ -229,7 +233,7 @@ extern "C" {
}
}
extern "C" GfxWindowManagerAPI gfx_sdl;
extern GfxWindowManagerAPI gfx_sdl;
void SetWindowManager(GfxWindowManagerAPI** WmApi, GfxRenderingAPI** RenderingApi, const std::string& gfx_backend);
namespace Ship {
@ -382,6 +386,10 @@ namespace Ship {
}
void Window::SetAudioPlayer() {
#ifdef _MSC_VER
APlayer = std::make_shared<WasapiAudioPlayer>();
#else
APlayer = std::make_shared<SDLAudioPlayer>();
#endif
}
}

View File

@ -23,7 +23,9 @@ void SetWindowManager(struct GfxWindowManagerAPI** WmApi, struct GfxRenderingAPI
#ifdef ENABLE_OPENGL
*RenderingApi = &gfx_opengl_api;
#if defined(__linux__)
*WmApi = &gfx_glx;
// MERGETODO:
// *WmApi = &gfx_glx;
*WmApi = &gfx_sdl;
#else
*WmApi = &gfx_sdl;
#endif

View File

@ -449,7 +449,10 @@ void aFilterImpl(uint8_t flags, uint16_t count_or_buf, int16_t *state_or_filter)
int16_t *buf = BUF_S16(count_or_buf);
if (flags == A_INIT) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmemset-elt-size"
memset(tmp, 0, 8 * sizeof(int16_t));
#pragma GCC diagnostic pop
memset(tmp2, 0, 8 * sizeof(int16_t));
} else {
memcpy(tmp, state_or_filter, 8 * sizeof(int16_t));

View File

@ -1,3 +1,4 @@
#include <sstream>
#include "stox.h"
#include "spdlog/spdlog.h"

4
soh/.gitignore vendored
View File

@ -25,6 +25,10 @@ docs/doxygen/
*.map
*.dump
out.txt
shipofharkinian.ini
imgui.ini
oot.otr
oot_save.sav
# Tool artifacts
tools/mipspro7.2_compiler/

834
soh/Makefile Normal file
View File

@ -0,0 +1,834 @@
CXX := g++
CC := gcc
LD := lld
AR := ar
FORMAT := clang-format-11
ZAPD := ../ZAPDTR/ZAPD.out
LIBULTRASHIP := ../libultraship/libultraship.a
ZAPDUTILS := ../ZAPDTR/ZAPDUtils/ZAPDUtils.a
ASAN ?= 0
DEBUG ?= 1
OPTFLAGS ?= -O0
LTO ?= 0
WARN := \
-Wno-return-type \
-funsigned-char \
-m32 -mhard-float -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-strict-aliasing -fno-inline-functions -fno-inline-small-functions -fno-toplevel-reorder -ffreestanding -fwrapv \
CXXFLAGS := $(WARN) -std=c++20 -D_GNU_SOURCE -fpermissive -no-pie -nostdlib -march=i386
CFLAGS := $(WARN) -std=c99 -D_GNU_SOURCE -no-pie -nostdlib -march=i386
LDFLAGS := -m32
CPPFLAGS := -MMD
ifneq ($(DEBUG),0)
CXXFLAGS += -g
CFLAGS += -g
endif
ifneq ($(ASAN),0)
CXXFLAGS += -fsanitize=address
LDFLAGS += -fsanitize=address
endif
ifneq ($(LTO),0)
CXXFLAGS += -flto
LDFLAGS += -flto
endif
TARGET := soh.elf
INC_DIRS := $(addprefix -I, \
. \
assets \
build \
include \
src \
../ZAPDTR/ZAPDUtils \
../libultraship/libultraship \
../libultraship/libultraship/Lib/spdlog/include \
../libultraship/libultraship/Lib/Fast3D/U64 \
../libultraship/libultraship/Lib/Fast3D/U64/PR \
)
LDDIRS := $(addprefix -L, \
../external \
../libultraship/ \
)
LDLIBS := \
$(ZAPDUTILS) \
$(addprefix -l, \
X11 \
dl \
bz2 \
z \
pthread \
atomic \
SDL2 \
GL \
GLEW \
storm \
ultraship \
) \
ASSET_BIN_DIRS := $(shell find assets/* -type d -not -path "assets/xml*")
ASSET_FILES_XML := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.xml))
ASSET_FILES_BIN := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.bin))
ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_XML:.xml=.c),$f) \
$(foreach f,$(ASSET_FILES_BIN:.bin=.bin.inc.c),build/$f)
TEXTURE_FILES_PNG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.png))
TEXTURE_FILES_JPG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.jpg))
TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG:.png=.inc.c),build/$f) \
$(foreach f,$(TEXTURE_FILES_JPG:.jpg=.jpg.inc.c),build/$f) \
CXX_FILES := \
soh/Enhancements/debugconsole.cpp \
soh/GbiWrap.cpp \
soh/OTRGlobals.cpp \
soh/z_message_OTR.cpp \
soh/z_play_otr.cpp \
soh/z_scene_otr.cpp
C_FILES := \
soh/Enhancements/bootcommands.c \
soh/Enhancements/gameconsole.c \
soh/gu_pc.c \
soh/stubs.c \
src/boot/assert.c \
src/boot/boot_main.c \
src/boot/build.c \
src/boot/idle.c \
src/boot/is_debug.c \
src/boot/logutils.c \
src/boot/missing_gcc_functions.c \
src/boot/stackcheck.c \
src/boot/viconfig.c \
src/boot/yaz0.c \
src/boot/z_locale.c \
src/boot/z_std_dma.c \
src/buffers/gfxbuffers.c \
src/buffers/heaps.c \
src/buffers/zbuffer.c \
src/code/audioMgr.c \
src/code/audio_data.c \
src/code/audio_effects.c \
src/code/audio_heap.c \
src/code/audio_init_params.c \
src/code/audio_load.c \
src/code/audio_playback.c \
src/code/audio_seqplayer.c \
src/code/audio_sound_params.c \
src/code/audio_synthesis.c \
src/code/code_800430A0.c \
src/code/code_80043480.c \
src/code/code_8006C3A0.c \
src/code/code_8006C510.c \
src/code/code_80097A00.c \
src/code/code_800A9F30.c \
src/code/code_800ACE70.c \
src/code/code_800AD920.c \
src/code/code_800BB0A0.c \
src/code/code_800C3C20.c \
src/code/code_800D2E30.c \
src/code/code_800D31A0.c \
src/code/code_800E4FE0.c \
src/code/code_800E6840.c \
src/code/code_800EC960.c \
src/code/code_800F7260.c \
src/code/code_800F9280.c \
src/code/code_800FBCE0.c \
src/code/code_800FC620.c \
src/code/code_800FCE80.c \
src/code/code_800FD970.c \
src/code/code_801067F0.c \
src/code/code_801068B0.c \
src/code/db_camera.c \
src/code/debug_malloc.c \
src/code/fault.c \
src/code/fault_drawer.c \
src/code/flg_set.c \
src/code/game.c \
src/code/gamealloc.c \
src/code/gfxprint.c \
src/code/graph.c \
src/code/irqmgr.c \
src/code/jpegdecoder.c \
src/code/jpegutils.c \
src/code/listalloc.c \
src/code/loadfragment2.c \
src/code/logseverity.c \
src/code/main.c \
src/code/mempak.c \
src/code/mtxuty-cvt.c \
src/code/padmgr.c \
src/code/padsetup.c \
src/code/padutils.c \
src/code/PreRender.c \
src/code/printutils.c \
src/code/relocation.c \
src/code/sched.c \
src/code/shrink_window.c \
src/code/sleep.c \
src/code/speed_meter.c \
src/code/system_malloc.c \
src/code/sys_cfb.c \
src/code/sys_math.c \
src/code/sys_math3d.c \
src/code/sys_math_atan.c \
src/code/sys_matrix.c \
src/code/sys_ucode.c \
src/code/title_setup.c \
src/code/TwoHeadArena.c \
src/code/ucode_disas.c \
src/code/z_actor.c \
src/code/z_actor_dlftbls.c \
src/code/z_bgcheck.c \
src/code/z_camera.c \
src/code/z_collision_btltbls.c \
src/code/z_collision_check.c \
src/code/z_common_data.c \
src/code/z_construct.c \
src/code/z_debug.c \
src/code/z_debug_display.c \
src/code/z_demo.c \
src/code/z_DLF.c \
src/code/z_draw.c \
src/code/z_effect.c \
src/code/z_effect_soft_sprite.c \
src/code/z_effect_soft_sprite_dlftbls.c \
src/code/z_effect_soft_sprite_old_init.c \
src/code/z_eff_blure.c \
src/code/z_eff_shield_particle.c \
src/code/z_eff_spark.c \
src/code/z_eff_ss_dead.c \
src/code/z_elf_message.c \
src/code/z_en_a_keep.c \
src/code/z_en_item00.c \
src/code/z_face_reaction.c \
src/code/z_fbdemo.c \
src/code/z_fbdemo_circle.c \
src/code/z_fbdemo_fade.c \
src/code/z_fbdemo_triforce.c \
src/code/z_fbdemo_wipe1.c \
src/code/z_fcurve_data_skelanime.c \
src/code/z_frame_advance.c \
src/code/z_game_dlftbls.c \
src/code/z_game_over.c \
src/code/z_horse.c \
src/code/z_jpeg.c \
src/code/z_kaleido_manager.c \
src/code/z_kaleido_scope_call.c \
src/code/z_kaleido_setup.c \
src/code/z_kanfont.c \
src/code/z_kankyo.c \
src/code/z_lib.c \
src/code/z_lifemeter.c \
src/code/z_lights.c \
src/code/z_malloc.c \
src/code/z_map_data.c \
src/code/z_map_exp.c \
src/code/z_map_mark.c \
src/code/z_message_PAL.c \
src/code/z_moji.c \
src/code/z_msgevent.c \
src/code/z_olib.c \
src/code/z_onepointdemo.c \
src/code/z_onepointdemo_data.c \
src/code/z_parameter.c \
src/code/z_path.c \
src/code/z_play.c \
src/code/z_player_call.c \
src/code/z_player_lib.c \
src/code/z_prenmi.c \
src/code/z_prenmi_buff.c \
src/code/z_quake.c \
src/code/z_rcp.c \
src/code/z_room.c \
src/code/z_sample.c \
src/code/z_scene.c \
src/code/z_scene_table.c \
src/code/z_skelanime.c \
src/code/z_skin.c \
src/code/z_skin_awb.c \
src/code/z_skin_matrix.c \
src/code/z_sound_source.c \
src/code/z_sram.c \
src/code/z_ss_sram.c \
src/code/z_view.c \
src/code/z_vimode.c \
src/code/z_vismono.c \
src/code/z_vr_box.c \
src/code/z_vr_box_draw.c \
src/code/__osMalloc.c \
src/libultra/gu/coss.c \
src/libultra/gu/guLookAt.c \
src/libultra/gu/guLookAtHilite.c \
src/libultra/gu/guPerspectiveF.c \
src/libultra/gu/guPosition.c \
src/libultra/gu/guS2DInitBg.c \
src/libultra/gu/ortho.c \
src/libultra/gu/rotate.c \
src/libultra/gu/sins.c \
src/libultra/gu/sintable.c \
src/libultra/libc/sprintf.c \
src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c \
src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c \
src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c \
src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c \
src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c \
src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c \
src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c \
src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c \
src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c \
src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c \
src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c \
src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c \
src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c \
src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c \
src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c \
src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c \
src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c \
src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c \
src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c \
src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c \
src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c \
src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c \
src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c \
src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c \
src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c \
src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c \
src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c \
src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c \
src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c \
src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c \
src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c \
src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c \
src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c \
src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c \
src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c \
src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c \
src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c \
src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c \
src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c \
src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c \
src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c \
src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c \
src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c \
src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c \
src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c \
src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c \
src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c \
src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c \
src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c \
src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c \
src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c \
src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c \
src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c \
src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c \
src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c \
src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c \
src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c \
src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c \
src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c \
src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c \
src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c \
src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c \
src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c \
src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c \
src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c \
src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c \
src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c \
src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c \
src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c \
src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c \
src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c \
src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c \
src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c \
src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c \
src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c \
src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c \
src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c \
src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c \
src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c \
src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c \
src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c \
src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c \
src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c \
src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c \
src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c \
src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c \
src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c \
src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c \
src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c \
src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c \
src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c \
src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c \
src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c \
src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c \
src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c \
src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c \
src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c \
src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c \
src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c \
src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c \
src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c \
src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c \
src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c \
src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c \
src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c \
src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c \
src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c \
src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c \
src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c \
src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c \
src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c \
src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c \
src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c \
src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c \
src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c \
src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c \
src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c \
src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c \
src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c \
src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c \
src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.c \
src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.c \
src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_3.c \
src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c \
src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.c \
src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c \
src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c \
src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c \
src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c \
src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c \
src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c \
src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c \
src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo_data.c \
src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c \
src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2_colchk.c \
src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c \
src/overlays/actors/ovl_Boss_Fd/z_boss_fd_colchk.c \
src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c \
src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2_data.c \
src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c \
src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c \
src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c \
src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c \
src/overlays/actors/ovl_Boss_Mo/z_boss_mo_colchk.c \
src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c \
src/overlays/actors/ovl_Boss_Sst/z_boss_sst_colchk.c \
src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c \
src/overlays/actors/ovl_Boss_Va/z_boss_va.c \
src/overlays/actors/ovl_Demo_6K/z_demo_6k.c \
src/overlays/actors/ovl_Demo_Du/z_demo_du.c \
src/overlays/actors/ovl_Demo_Du/z_demo_du_cutscene_data.c \
src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c \
src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c \
src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c \
src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c \
src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c \
src/overlays/actors/ovl_Demo_Go/z_demo_go.c \
src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c \
src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c \
src/overlays/actors/ovl_Demo_Im/z_demo_im.c \
src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c \
src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c \
src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data1.c \
src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data2.c \
src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data3.c \
src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data4.c \
src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data5.c \
src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data6.c \
src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data7.c \
src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo_cutscene_data8.c \
src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c \
src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c \
src/overlays/actors/ovl_Demo_Sa/z_demo_sa_cutscene_data.c \
src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c \
src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c \
src/overlays/actors/ovl_Door_Ana/z_door_ana.c \
src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c \
src/overlays/actors/ovl_Door_Killer/z_door_killer.c \
src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c \
src/overlays/actors/ovl_Door_Toki/z_door_toki.c \
src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c \
src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c \
src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c \
src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c \
src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c \
src/overlays/actors/ovl_End_Title/z_end_title.c \
src/overlays/actors/ovl_En_Am/z_en_am.c \
src/overlays/actors/ovl_En_Ani/z_en_ani.c \
src/overlays/actors/ovl_En_Anubice/z_en_anubice.c \
src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c \
src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c \
src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c \
src/overlays/actors/ovl_En_Arrow/z_en_arrow.c \
src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c \
src/overlays/actors/ovl_En_Ba/z_en_ba.c \
src/overlays/actors/ovl_En_Bb/z_en_bb.c \
src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c \
src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c \
src/overlays/actors/ovl_En_Bili/z_en_bili.c \
src/overlays/actors/ovl_En_Bird/z_en_bird.c \
src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c \
src/overlays/actors/ovl_En_Bombf/z_en_bombf.c \
src/overlays/actors/ovl_En_Bom/z_en_bom.c \
src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c \
src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c \
src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c \
src/overlays/actors/ovl_En_Boom/z_en_boom.c \
src/overlays/actors/ovl_En_Box/z_en_box.c \
src/overlays/actors/ovl_En_Brob/z_en_brob.c \
src/overlays/actors/ovl_En_Bubble/z_en_bubble.c \
src/overlays/actors/ovl_En_Butte/z_en_butte.c \
src/overlays/actors/ovl_En_Bw/z_en_bw.c \
src/overlays/actors/ovl_En_Bx/z_en_bx.c \
src/overlays/actors/ovl_En_Changer/z_en_changer.c \
src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c \
src/overlays/actors/ovl_En_Cow/z_en_cow.c \
src/overlays/actors/ovl_En_Crow/z_en_crow.c \
src/overlays/actors/ovl_En_Cs/z_en_cs.c \
src/overlays/actors/ovl_En_Daiku/z_en_daiku.c \
src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c \
src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c \
src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c \
src/overlays/actors/ovl_En_Dha/z_en_dha.c \
src/overlays/actors/ovl_En_Dh/z_en_dh.c \
src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c \
src/overlays/actors/ovl_En_Dns/z_en_dns.c \
src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c \
src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c \
src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c \
src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c \
src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c \
src/overlays/actors/ovl_En_Dog/z_en_dog.c \
src/overlays/actors/ovl_En_Door/z_en_door.c \
src/overlays/actors/ovl_En_Ds/z_en_ds.c \
src/overlays/actors/ovl_En_Du/z_en_du.c \
src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c \
src/overlays/actors/ovl_En_Eg/z_en_eg.c \
src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c \
src/overlays/actors/ovl_En_Elf/z_en_elf.c \
src/overlays/actors/ovl_En_Encount1/z_en_encount1.c \
src/overlays/actors/ovl_En_Encount2/z_en_encount2.c \
src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c \
src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c \
src/overlays/actors/ovl_En_Fd/z_en_fd.c \
src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c \
src/overlays/actors/ovl_En_fHG/z_en_fhg.c \
src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c \
src/overlays/actors/ovl_En_Firefly/z_en_firefly.c \
src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c \
src/overlays/actors/ovl_En_Fish/z_en_fish.c \
src/overlays/actors/ovl_En_Floormas/z_en_floormas.c \
src/overlays/actors/ovl_En_Fr/z_en_fr.c \
src/overlays/actors/ovl_En_Fu/z_en_fu.c \
src/overlays/actors/ovl_En_Fw/z_en_fw.c \
src/overlays/actors/ovl_En_Fz/z_en_fz.c \
src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c \
src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c \
src/overlays/actors/ovl_En_Gb/z_en_gb.c \
src/overlays/actors/ovl_En_Ge1/z_en_ge1.c \
src/overlays/actors/ovl_En_Ge2/z_en_ge2.c \
src/overlays/actors/ovl_En_Ge3/z_en_ge3.c \
src/overlays/actors/ovl_En_GeldB/z_en_geldb.c \
src/overlays/actors/ovl_En_GirlA/z_en_girla.c \
src/overlays/actors/ovl_En_Gm/z_en_gm.c \
src/overlays/actors/ovl_En_Go2/z_en_go2.c \
src/overlays/actors/ovl_En_Goma/z_en_goma.c \
src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c \
src/overlays/actors/ovl_En_Go/z_en_go.c \
src/overlays/actors/ovl_En_Gs/z_en_gs.c \
src/overlays/actors/ovl_En_Guest/z_en_guest.c \
src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c \
src/overlays/actors/ovl_En_Hata/z_en_hata.c \
src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c \
src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c \
src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c \
src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c \
src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c \
src/overlays/actors/ovl_En_Holl/z_en_holl.c \
src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c \
src/overlays/actors/ovl_En_Horse/z_en_horse.c \
src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c \
src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c \
src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c \
src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c \
src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c \
src/overlays/actors/ovl_En_Hs2/z_en_hs2.c \
src/overlays/actors/ovl_En_Hs/z_en_hs.c \
src/overlays/actors/ovl_En_Hy/z_en_hy.c \
src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c \
src/overlays/actors/ovl_En_Ik/z_en_ik.c \
src/overlays/actors/ovl_En_Insect/z_en_insect.c \
src/overlays/actors/ovl_En_In/z_en_in.c \
src/overlays/actors/ovl_En_Ishi/z_en_ishi.c \
src/overlays/actors/ovl_En_It/z_en_it.c \
src/overlays/actors/ovl_En_Jj/z_en_jj.c \
src/overlays/actors/ovl_En_Jj/z_en_jj_cutscene_data.c \
src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c \
src/overlays/actors/ovl_En_Js/z_en_js.c \
src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c \
src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c \
src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c \
src/overlays/actors/ovl_En_Kanban/z_en_kanban.c \
src/overlays/actors/ovl_En_Kanban/z_en_kanban_gfx.c \
src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c \
src/overlays/actors/ovl_En_Ko/z_en_ko.c \
src/overlays/actors/ovl_En_Kusa/z_en_kusa.c \
src/overlays/actors/ovl_En_Kz/z_en_kz.c \
src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c \
src/overlays/actors/ovl_En_Light/z_en_light.c \
src/overlays/actors/ovl_En_Ma1/z_en_ma1.c \
src/overlays/actors/ovl_En_Ma2/z_en_ma2.c \
src/overlays/actors/ovl_En_Ma3/z_en_ma3.c \
src/overlays/actors/ovl_En_Mag/z_en_mag.c \
src/overlays/actors/ovl_En_Mb/z_en_mb.c \
src/overlays/actors/ovl_En_Md/z_en_md.c \
src/overlays/actors/ovl_En_Mk/z_en_mk.c \
src/overlays/actors/ovl_En_Mm2/z_en_mm2.c \
src/overlays/actors/ovl_En_Mm/z_en_mm.c \
src/overlays/actors/ovl_En_Ms/z_en_ms.c \
src/overlays/actors/ovl_En_Mu/z_en_mu.c \
src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c \
src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c \
src/overlays/actors/ovl_En_Nb/z_en_nb.c \
src/overlays/actors/ovl_En_Nb/z_en_nb_cutscene_data.c \
src/overlays/actors/ovl_En_Niw/z_en_niw.c \
src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c \
src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c \
src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c \
src/overlays/actors/ovl_En_Nwc/z_en_nwc.c \
src/overlays/actors/ovl_En_Ny/z_en_ny.c \
src/overlays/actors/ovl_En_OE2/z_en_oe2.c \
src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c \
src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c \
src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag_cutscene_data.c \
src/overlays/actors/ovl_En_Okuta/z_en_okuta.c \
src/overlays/actors/ovl_En_Ossan/z_en_ossan.c \
src/overlays/actors/ovl_En_Owl/z_en_owl.c \
src/overlays/actors/ovl_En_Part/z_en_part.c \
src/overlays/actors/ovl_En_Peehat/z_en_peehat.c \
src/overlays/actors/ovl_En_Poh/z_en_poh.c \
src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c \
src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c \
src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c \
src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c \
src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c \
src/overlays/actors/ovl_En_Rd/z_en_rd.c \
src/overlays/actors/ovl_En_Reeba/z_en_reeba.c \
src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c \
src/overlays/actors/ovl_En_Rl/z_en_rl.c \
src/overlays/actors/ovl_En_Rr/z_en_rr.c \
src/overlays/actors/ovl_En_Ru1/z_en_ru1.c \
src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.c \
src/overlays/actors/ovl_En_Ru2/z_en_ru2.c \
src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.c \
src/overlays/actors/ovl_En_Sa/z_en_sa.c \
src/overlays/actors/ovl_En_Sb/z_en_sb.c \
src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c \
src/overlays/actors/ovl_En_Sda/z_en_sda.c \
src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c \
src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c \
src/overlays/actors/ovl_En_Si/z_en_si.c \
src/overlays/actors/ovl_En_Skb/z_en_skb.c \
src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c \
src/overlays/actors/ovl_En_Skj/z_en_skj.c \
src/overlays/actors/ovl_En_Ssh/z_en_ssh.c \
src/overlays/actors/ovl_En_Sth/z_en_sth.c \
src/overlays/actors/ovl_En_Stream/z_en_stream.c \
src/overlays/actors/ovl_En_St/z_en_st.c \
src/overlays/actors/ovl_En_Sw/z_en_sw.c \
src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c \
src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c \
src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c \
src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c \
src/overlays/actors/ovl_En_Tana/z_en_tana.c \
src/overlays/actors/ovl_En_Ta/z_en_ta.c \
src/overlays/actors/ovl_En_Test/z_en_test.c \
src/overlays/actors/ovl_En_Tg/z_en_tg.c \
src/overlays/actors/ovl_En_Tite/z_en_tite.c \
src/overlays/actors/ovl_En_Tk/z_en_tk.c \
src/overlays/actors/ovl_En_Torch2/z_en_torch2.c \
src/overlays/actors/ovl_En_Torch/z_en_torch.c \
src/overlays/actors/ovl_En_Toryo/z_en_toryo.c \
src/overlays/actors/ovl_En_Tp/z_en_tp.c \
src/overlays/actors/ovl_En_Trap/z_en_trap.c \
src/overlays/actors/ovl_En_Tr/z_en_tr.c \
src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c \
src/overlays/actors/ovl_En_Vali/z_en_vali.c \
src/overlays/actors/ovl_En_Vase/z_en_vase.c \
src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c \
src/overlays/actors/ovl_En_Viewer/z_en_viewer.c \
src/overlays/actors/ovl_En_Vm/z_en_vm.c \
src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c \
src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c \
src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c \
src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c \
src/overlays/actors/ovl_En_Wf/z_en_wf.c \
src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c \
src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c \
src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c \
src/overlays/actors/ovl_En_Wood02/z_en_wood02.c \
src/overlays/actors/ovl_En_Xc/z_en_xc.c \
src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c \
src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c \
src/overlays/actors/ovl_En_Zf/z_en_zf.c \
src/overlays/actors/ovl_En_Zl1/z_en_zl1.c \
src/overlays/actors/ovl_En_Zl1/z_en_zl1_camera_data.c \
src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.c \
src/overlays/actors/ovl_En_Zl2/z_en_zl2.c \
src/overlays/actors/ovl_En_Zl3/z_en_zl3.c \
src/overlays/actors/ovl_En_Zl4/z_en_zl4.c \
src/overlays/actors/ovl_En_Zl4/z_en_zl4_cutscene_data.c \
src/overlays/actors/ovl_En_Zo/z_en_zo.c \
src/overlays/actors/ovl_Fishing/z_fishing.c \
src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c \
src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c \
src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c \
src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c \
src/overlays/actors/ovl_Item_Shield/z_item_shield.c \
src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c \
src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c \
src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c \
src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c \
src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c \
src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c \
src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c \
src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c \
src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c \
src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c \
src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c \
src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c \
src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c \
src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c \
src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c \
src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c \
src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c \
src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c \
src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c \
src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c \
src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c \
src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c \
src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c \
src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c \
src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c \
src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c \
src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c \
src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c \
src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c \
src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c \
src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c \
src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c \
src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c \
src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c \
src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c \
src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c \
src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c \
src/overlays/actors/ovl_player_actor/z_player.c \
src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c \
src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c \
src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.c \
src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.c \
src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c \
src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.c \
src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.c \
src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.c \
src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.c \
src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.c \
src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c \
src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c \
src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c \
src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c \
src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c \
src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c \
src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c \
src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c \
src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.c \
src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c \
src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.c \
src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.c \
src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c \
src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c \
src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c \
src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c \
src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.c \
src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c \
src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c \
src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.c \
src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.c \
src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.c \
src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.c \
src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c \
src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c \
src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c \
src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c \
src/overlays/gamestates/ovl_file_choose/z_file_choose.c \
src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c \
src/overlays/gamestates/ovl_file_choose/z_file_nameset_data.c \
src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c \
src/overlays/gamestates/ovl_opening/z_opening.c \
src/overlays/gamestates/ovl_select/z_select.c \
src/overlays/gamestates/ovl_title/z_title.c \
src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c \
src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c \
src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c \
src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c \
src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c \
src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c \
src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c \
src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c \
src/overlays/misc/ovl_kaleido_scope/z_lmap_mark_data.c \
src/overlays/misc/ovl_map_mark_data/z_map_mark_data.c
O_FILES := \
$(C_FILES:%.c=build/%.o) \
$(CXX_FILES:%.cpp=build/%.o)
D_FILES := $(O_FILES:%.o=%.d)
# create build directory
SRC_DIRS := $(shell find . -type d -a -not -path "*build*")
$(shell mkdir -p $(SRC_DIRS:%=build/%))
all:
$(MAKE) -C ../libultraship
$(MAKE) $(TARGET)
setup:
python3 extract_baserom.py
$(MAKE) mpq
mpq:
$(MAKE) -C ../libultraship
$(MAKE) -C ../OTRExporter/OTRExporter
$(MAKE) -C ../ZAPDTR
rm -rf ../OTRExporter/oot.otr
cd ../OTRExporter && python3 extract_assets.py
cp ../OTRExporter/oot.otr .
distclean: clean
$(RM) -r baserom/
clean:
rm -rf build $(TARGET)
.PHONY: all clean distclean setup mpq
build/%.o: %.cpp
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $(OPTFLAGS) $(INC_DIRS) $< -o $@
build/%.o: %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(OPTFLAGS) $(INC_DIRS) $< -o $@
# make soh depend on libultraship
$(TARGET): $(LIBULTRASHIP)
$(TARGET): $(O_FILES)
$(CXX) $^ -o $@ $(LDFLAGS) -fuse-ld=$(LD) $(LDDIRS) $(LDLIBS)
-include $(D_FILES)

View File

@ -1,7 +1,7 @@
#ifndef ALLOCA_H
#define ALLOCA_H
void* alloca(u32);
// void* alloca(u32);
//#define alloca __builtin_alloca
#define alloca malloc

View File

@ -14,7 +14,7 @@ extern "C"
#if defined(INCLUDE_GAME_PRINTF) && !defined(NDEBUG)
#define osSyncPrintf(fmt, ...) lusprintf(__FILE__, __LINE__, 0, fmt, __VA_ARGS__)
#else
#define osSyncPrintf(fmt, ...) osSyncPrintfUnused(fmt, __VA_ARGS__)
#define osSyncPrintf(fmt, ...) osSyncPrintfUnused(fmt, ##__VA_ARGS__)
#endif
f32 fabsf(f32 f);
@ -382,7 +382,7 @@ s32 Flags_GetCollectible(GlobalContext* globalCtx, s32 flag);
void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag);
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width,
u8 height);
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 x, s32 y,
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, char* texture, s32 x, s32 y,
s32 width, s32 height, s32 delay);
s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx);
void Actor_Kill(Actor* actor);

View File

@ -4,8 +4,8 @@
#include "functions.h"
#include "variables.h"
#include "macros.h"
#include "soh\OTRGlobals.h"
#include "soh\Enhancements\gameconsole.h"
#include "soh/OTRGlobals.h"
#include "soh/Enhancements/gameconsole.h"
#include "Cvar.h"

View File

@ -204,6 +204,14 @@ extern GraphicsContext* __gfxCtx;
#define ALIGNED8
#endif
#define SEG_ADDR(seg, addr) (addr | (seg << 24) | 0xF0000000)
#define SEG_ADDR(seg, addr) (addr | (seg << 24) | 1)
#ifdef _MSC_VER
#define BOMSWAP16 _byteswap_ushort
#define BOMSWAP32 _byteswap_ulong
#else
#define BOMSWAP16 __builtin_bswap16
#define BOMSWAP32 __builtin_bswap32
#endif
#endif

View File

@ -1,6 +1,9 @@
#ifndef ULTRA64_H
#define ULTRA64_H
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include "ultra64/types.h"
#include "unk.h"

View File

@ -18,7 +18,7 @@ extern "C" {
extern GlobalContext* gGlobalCtx;
}
#include "cvar.h"
#include "Cvar.h"
#define CMD_REGISTER SohImGui::BindCmd

View File

@ -3,7 +3,7 @@
#include <ultra64.h>
#include <z64.h>
#include "cvar.h"
#include "Cvar.h"
#define MAX_CVARS 2048

View File

@ -10,10 +10,14 @@
#include "Window.h"
#include "z64animation.h"
#include "z64bgcheck.h"
#include "../soh/enhancements/gameconsole.h"
#include "Enhancements/gameconsole.h"
#include <ultra64/gbi.h>
#include <Animation.h>
#ifdef _MSC_VER
#include <Windows.h>
#else
#include <time.h>
#endif
#include <Vertex.h>
#include <CollisionHeader.h>
#include <Array.h>
@ -21,7 +25,8 @@
#include <Texture.h>
#include "Lib/stb/stb_image.h"
#include "AudioPlayer.h"
#include "../soh/Enhancements/debugconsole.h"
#include "Enhancements/debugconsole.h"
#include "macros.h"
OTRGlobals* OTRGlobals::Instance;
@ -46,6 +51,7 @@ extern "C" void InitOTR() {
DebugConsole_Init();
}
#ifdef _MSC_VER
extern "C" uint64_t GetFrequency() {
LARGE_INTEGER nFreq;
@ -60,6 +66,21 @@ extern "C" uint64_t GetPerfCounter() {
return ticks.QuadPart;
}
#else
extern "C" uint64_t GetFrequency() {
return 1000; // sec -> ms
}
extern "C" uint64_t GetPerfCounter() {
struct timespec monotime;
clock_gettime(CLOCK_MONOTONIC, &monotime);
uint64_t remainingMs = (monotime.tv_nsec / 1000000);
// in milliseconds
return monotime.tv_sec * 1000 + remainingMs;
}
#endif
// C->C++ Bridge
extern "C" void Graph_ProcessFrame(void (*run_one_game_iter)(void)) {
@ -328,7 +349,7 @@ extern "C" int ResourceMgr_OTRSigCheck(char* imgData)
{
uintptr_t i = (uintptr_t)(imgData);
if (i == 0xD9000000 || i == 0xE7000000 || (i & 0xF0000000) == 0xF0000000)
if (i == 0xD9000000 || i == 0xE7000000 || (i & 1) == 1)
return 0;
if ((i & 0xFF000000) != 0xAB000000 && (i & 0xFF000000) != 0xCD000000 && i != 0) {
@ -722,24 +743,24 @@ extern "C" int16_t OTRGetRectDimensionFromRightEdge(float v) {
}
extern "C" void bswapSoundFontSound(SoundFontSound* swappable) {
swappable->sample = (SoundFontSample*)_byteswap_ulong((u32)swappable->sample);
swappable->tuningAsU32 = _byteswap_ulong((u32)swappable->tuningAsU32);
swappable->sample = (SoundFontSample*)BOMSWAP32((u32)swappable->sample);
swappable->tuningAsU32 = BOMSWAP32((u32)swappable->tuningAsU32);
}
extern "C" void bswapDrum(Drum* swappable) {
bswapSoundFontSound(&swappable->sound);
swappable->envelope = (AdsrEnvelope*)_byteswap_ulong((u32)swappable->envelope);
swappable->envelope = (AdsrEnvelope*)BOMSWAP32((u32)swappable->envelope);
}
extern "C" void bswapInstrument(Instrument* swappable) {
swappable->envelope = (AdsrEnvelope*)_byteswap_ulong((u32)swappable->envelope);
swappable->envelope = (AdsrEnvelope*)BOMSWAP32((u32)swappable->envelope);
bswapSoundFontSound(&swappable->lowNotesSound);
bswapSoundFontSound(&swappable->normalNotesSound);
bswapSoundFontSound(&swappable->highNotesSound);
}
extern "C" void bswapSoundFontSample(SoundFontSample* swappable) {
u32 origBitfield = _byteswap_ulong(swappable->asU32);
u32 origBitfield = BOMSWAP32(swappable->asU32);
swappable->codec = (origBitfield >> 28) & 0x0F;
swappable->medium = (origBitfield >> 24) & 0x03;
@ -747,29 +768,29 @@ extern "C" void bswapSoundFontSample(SoundFontSample* swappable) {
swappable->unk_bit25 = (origBitfield >> 21) & 0x01;
swappable->size = (origBitfield) & 0x00FFFFFF;
swappable->sampleAddr = (u8*)_byteswap_ulong((u32)swappable->sampleAddr);
swappable->loop = (AdpcmLoop*)_byteswap_ulong((u32)swappable->loop);
swappable->book = (AdpcmBook*)_byteswap_ulong((u32)swappable->book);
swappable->sampleAddr = (u8*)BOMSWAP32((u32)swappable->sampleAddr);
swappable->loop = (AdpcmLoop*)BOMSWAP32((u32)swappable->loop);
swappable->book = (AdpcmBook*)BOMSWAP32((u32)swappable->book);
}
extern "C" void bswapAdpcmLoop(AdpcmLoop* swappable) {
swappable->start = (u32)_byteswap_ulong((u32)swappable->start);
swappable->end = (u32)_byteswap_ulong((u32)swappable->end);
swappable->count = (u32)_byteswap_ulong((u32)swappable->count);
swappable->start = (u32)BOMSWAP32((u32)swappable->start);
swappable->end = (u32)BOMSWAP32((u32)swappable->end);
swappable->count = (u32)BOMSWAP32((u32)swappable->count);
if (swappable->count != 0) {
for (int i = 0; i < 16; i++) {
swappable->state[i] = (s16)_byteswap_ushort(swappable->state[i]);
swappable->state[i] = (s16)BOMSWAP16(swappable->state[i]);
}
}
}
extern "C" void bswapAdpcmBook(AdpcmBook* swappable) {
swappable->order = (u32)_byteswap_ulong((u32)swappable->order);
swappable->npredictors = (u32)_byteswap_ulong((u32)swappable->npredictors);
swappable->order = (u32)BOMSWAP32((u32)swappable->order);
swappable->npredictors = (u32)BOMSWAP32((u32)swappable->npredictors);
for (int i = 0; i < swappable->npredictors * swappable->order * sizeof(s16) * 4; i++)
swappable->book[i] = (s16)_byteswap_ushort(swappable->book[i]);
swappable->book[i] = (s16)BOMSWAP16(swappable->book[i]);
}
extern "C" bool AudioPlayer_Init(void) {

View File

@ -12,12 +12,12 @@ OSViMode osViModeNtscLan1;
OSViMode osViModeMpalLan1;
OSViMode osViModeFpalLan1;
OSViMode osViModePalLan1;
AudioContext gAudioContext;
unk_D_8016E750 D_8016E750[4];
// AudioContext gAudioContext;
// unk_D_8016E750 D_8016E750[4];
u8 gLetterTLUT[4][32];
u8 gFontFF[999];
DmaEntry gDmaDataTable[0x60C];
u8 D_80133418;
// u8 D_80133418;
u16 gAudioSEFlagSwapSource[64];
u16 gAudioSEFlagSwapTarget[64];
u8 gAudioSEFlagSwapMode[64];

View File

@ -28,7 +28,7 @@ extern "C" void OTRGameplay_SpawnScene(GlobalContext* globalCtx, s32 sceneNum, s
//osSyncPrintf("\nSCENE SIZE %fK\n", (scene->sceneFile.vromEnd - scene->sceneFile.vromStart) / 1024.0f);
std::string scenePath = StringHelper::Sprintf("scenes\\%s\\%s", scene->sceneFile.fileName, scene->sceneFile.fileName);
std::string scenePath = StringHelper::Sprintf("scenes/%s/%s", scene->sceneFile.fileName, scene->sceneFile.fileName);
globalCtx->sceneSegment = (Ship::Scene*)OTRGameplay_LoadFile(globalCtx, scenePath.c_str());
scene->unk_13 = 0;

View File

@ -246,7 +246,7 @@ f32 Audio_AdsrUpdate(AdsrState* adsr) {
retry:
case ADSR_STATE_LOOP:
adsr->delay = (s16)_byteswap_ushort(adsr->envelope[adsr->envIndex].delay);
adsr->delay = (s16)BOMSWAP16(adsr->envelope[adsr->envIndex].delay);
switch (adsr->delay) {
case ADSR_DISABLE:
adsr->action.s.state = ADSR_STATE_DISABLED;
@ -255,7 +255,7 @@ f32 Audio_AdsrUpdate(AdsrState* adsr) {
adsr->action.s.state = ADSR_STATE_HANG;
break;
case ADSR_GOTO:
adsr->envIndex = (s16)_byteswap_ushort(adsr->envelope[adsr->envIndex].arg);
adsr->envIndex = (s16)BOMSWAP16(adsr->envelope[adsr->envIndex].arg);
goto retry;
case ADSR_RESTART:
adsr->action.s.state = ADSR_STATE_INITIAL;
@ -266,7 +266,7 @@ f32 Audio_AdsrUpdate(AdsrState* adsr) {
if (adsr->delay == 0) {
adsr->delay = 1;
}
adsr->target = (s16)_byteswap_ushort(adsr->envelope[adsr->envIndex].arg) / 32767.0f;
adsr->target = (s16)BOMSWAP16(adsr->envelope[adsr->envIndex].arg) / 32767.0f;
adsr->target = adsr->target * adsr->target;
adsr->velocity = (adsr->target - adsr->current) / adsr->delay;
adsr->action.s.state = ADSR_STATE_FADE;

View File

@ -1110,12 +1110,12 @@ void AudioLoad_InitSwapFont(void) {
numInstruments = font->numInstruments;
// drums
ptrs[0] = (void*)_byteswap_ulong((uintptr_t)ptrs[0]);
ptrs[0] = (void*)BOMSWAP32((uintptr_t)ptrs[0]);
if ((ptrs[0] != NULL) && (numDrums != 0)) {
drumList = (Drum**)BASE_ROM_OFFSET(ptrs[0]);
for (i = 0; i < numDrums; i++) {
drumList[i] = (Drum*)_byteswap_ulong((uintptr_t)drumList[i]);
drumList[i] = (Drum*)BOMSWAP32((uintptr_t)drumList[i]);
if (drumList[i] != NULL) {
drum = (Drum*)BASE_ROM_OFFSET(drumList[i]);
@ -1128,7 +1128,7 @@ void AudioLoad_InitSwapFont(void) {
}
// sfxs
ptrs[1] = (void*)_byteswap_ulong((u32)ptrs[1]);
ptrs[1] = (void*)BOMSWAP32((u32)ptrs[1]);
if ((ptrs[1] != NULL) && (numSfxs != 0)) {
sfxList = (SoundFontSound*)BASE_ROM_OFFSET(ptrs[1]);
@ -1151,7 +1151,7 @@ void AudioLoad_InitSwapFont(void) {
instList = (Instrument**)(&ptrs[2]);
for (i = 0; i < numInstruments; i++) {
instList[i] = (Instrument*)_byteswap_ulong((uintptr_t)instList[i]);
instList[i] = (Instrument*)BOMSWAP32((uintptr_t)instList[i]);
if (instList[i] != NULL) {
inst = BASE_ROM_OFFSET(instList[i]);

View File

@ -1323,14 +1323,14 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
case 0xB2:
offset = (u16)parameters[0];
// OTRTODO: Byteswap added for quick audio
channel->unk_22 = _byteswap_ushort(*(u16*)(seqPlayer->seqData + (uintptr_t)(offset + scriptState->value * 2)));
channel->unk_22 = BOMSWAP16(*(u16*)(seqPlayer->seqData + (uintptr_t)(offset + scriptState->value * 2)));
break;
case 0xB4:
channel->dynTable = (void*)&seqPlayer->seqData[channel->unk_22];
break;
case 0xB5:
// OTRTODO: Byteswap added for quick audio
channel->unk_22 = _byteswap_ushort(((u16*)(channel->dynTable))[scriptState->value]);
channel->unk_22 = BOMSWAP16(((u16*)(channel->dynTable))[scriptState->value]);
break;
case 0xB6:
scriptState->value = (*channel->dynTable)[0][scriptState->value];

View File

@ -1162,7 +1162,7 @@ Acmd* AudioSynth_LoadWaveSamples(Acmd* cmd, NoteSubEu* noteSubEu, NoteSynthesisS
if (temp_v0 < nSamplesToLoad) {
repeats = ((nSamplesToLoad - temp_v0 + 0x3F) / 0x40);
if (repeats != 0) {
aDuplicate(cmd++, repeats, DMEM_UNCOMPRESSED_NOTE, DMEM_UNCOMPRESSED_NOTE + 0x80, 0x80);
aDuplicate(cmd++, repeats, DMEM_UNCOMPRESSED_NOTE, DMEM_UNCOMPRESSED_NOTE + 0x80);
}
}
synthState->samplePosInt = samplePosInt;
@ -1225,6 +1225,6 @@ Acmd* AudioSynth_NoteApplyHeadsetPanEffects(Acmd* cmd, NoteSubEu* noteSubEu, Not
aSaveBuffer(cmd++, DMEM_NOTE_PAN_TEMP + bufLen, &synthState->synthesisBuffers->panResampleState[0x8],
ALIGN16(panShift));
}
aAddMixer(cmd++, ALIGN64(bufLen), DMEM_NOTE_PAN_TEMP, dest, 0x7FFF);
aAddMixer(cmd++, ALIGN64(bufLen), DMEM_NOTE_PAN_TEMP, dest);
return cmd;
}

View File

@ -3,7 +3,9 @@
//#include <string.h>
#ifdef _MSC_VER
extern void* __cdecl memset(_Out_writes_bytes_all_(_Size) void* _Dst, _In_ int _Val, _In_ size_t _Size);
#endif
s32 D_8012D280 = 1;

View File

@ -7,13 +7,13 @@
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#include "objects/object_bdoor/object_bdoor.h"
#ifdef _MSC_VER
#if defined(_MSC_VER) || defined(__GNUC__)
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#endif
#ifdef _MSC_VER
#if defined(_MSC_VER) || defined(__GNUC__)
#include "textures/place_title_cards/g_pn_49.h"
#include "textures/place_title_cards/g_pn_01.h"
#include "textures/place_title_cards/g_pn_02.h"

View File

@ -56,7 +56,8 @@ void func_801109B0(GlobalContext* globalCtx) {
doActionOffset = 0x5700;
}
memcpy(interfaceCtx->doActionSegment, ResourceMgr_LoadTexByName(gAttackDoActionENGTex), 0x300);
memcpy(interfaceCtx->doActionSegment, ResourceMgr_LoadTexByName(gAttackDoActionENGTex), 0x180);
memcpy(interfaceCtx->doActionSegment + 0x180, ResourceMgr_LoadTexByName(gCheckDoActionENGTex), 0x180);
//DmaMgr_SendRequest1(interfaceCtx->doActionSegment, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, 0x300,
//"../z_construct.c", 174);

View File

@ -19,9 +19,9 @@ Gfx __sCircleDList[] = {
G_AC_NONE | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2), // 4
gsDPSetCombineMode(G_CC_BLENDPEDECALA, G_CC_BLENDPEDECALA), // 5
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), // 6
gsDPLoadTextureBlock(0xF8000000, G_IM_FMT_I, G_IM_SIZ_8b, 16, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, // 7
gsDPLoadTextureBlock(0x08000001, G_IM_FMT_I, G_IM_SIZ_8b, 16, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, // 7
G_TX_NOMIRROR | G_TX_CLAMP, 4, 6, G_TX_NOLOD, G_TX_NOLOD),
gsSPDisplayList(0xF9000000), // 8
gsSPDisplayList(0x09000001), // 8
gsSPVertex(sCircleWipeVtx, 32, 0), // 9
gsSP2Triangles(0, 1, 2, 0, 1, 3, 4, 0), // 10
gsSP2Triangles(3, 5, 6, 0, 5, 7, 8, 0), // 11

View File

@ -654,7 +654,7 @@ u8 sEyeMouthIndexes[][2] = {
* from adult Link's object are used here.
*/
#if defined(MODDING) || (_MSC_VER)
#if defined(MODDING) || defined(_MSC_VER) || defined(__GNUC__)
//TODO: Formatting
void* sEyeTextures[2][8] = {
{ gLinkAdultEyesOpenTex, gLinkAdultEyesHalfTex, gLinkAdultEyesClosedfTex, gLinkAdultEyesRollLeftTex,
@ -670,7 +670,7 @@ void* sEyeTextures[] = {
};
#endif
#if defined(modding) || defined(_MSC_VER)
#if defined(MODDING) || defined(_MSC_VER) || defined(__GNUC__)
void* sMouthTextures[2][4] = {
{
gLinkAdultMouth1Tex,
@ -726,7 +726,7 @@ void func_8008F470(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
if (eyeIndex > 7)
eyeIndex = 7;
#if defined(MODDING) || (_MSC_VER)
#if defined(MODDING) || defined(_MSC_VER) || defined(__GNUC__)
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[gSaveContext.linkAge][eyeIndex]));
#else
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[eyeIndex]));
@ -738,7 +738,7 @@ void func_8008F470(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
if (mouthIndex > 3)
mouthIndex = 3;
#if defined(MODDING) || (_MSC_VER)
#if defined(MODDING) || defined(_MSC_VER) || defined(__GNUC__)
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[gSaveContext.linkAge][mouthIndex]));
#else
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[eyeIndex]));

View File

@ -863,7 +863,7 @@ void AnimationContext_SetLoadFrame(GlobalContext* globalCtx, LinkAnimationHeader
char animPath[2048];
sprintf(animPath, "misc\\link_animetion\\gPlayerAnimData_%06X", (((uintptr_t)linkAnimHeader->segment - 0x07000000)));
sprintf(animPath, "misc/link_animetion/gPlayerAnimData_%06X", (((uintptr_t)linkAnimHeader->segment - 0x07000000)));
//printf("Streaming %s, seg = %08X\n", animPath, linkAnimHeader->segment);

View File

@ -1506,9 +1506,9 @@ void FileChoose_LoadGame(GameState* thisx) {
(gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KNIFE)) {
gSaveContext.equips.buttonItems[0] = ITEM_NONE;
swordEquipMask = _byteswap_ushort(gEquipMasks[EQUIP_SWORD]) & gSaveContext.equips.equipment;
swordEquipMask = BOMSWAP16(gEquipMasks[EQUIP_SWORD]) & gSaveContext.equips.equipment;
gSaveContext.equips.equipment &= gEquipNegMasks[EQUIP_SWORD];
gSaveContext.inventory.equipment ^= (gBitFlags[swordEquipMask - 1] << _byteswap_ushort(gEquipShifts[EQUIP_SWORD]));
gSaveContext.inventory.equipment ^= (gBitFlags[swordEquipMask - 1] << BOMSWAP16(gEquipShifts[EQUIP_SWORD]));
}
}
}

View File

@ -624,10 +624,10 @@ void Select_Init(GameState* thisx) {
this->pageDownIndex = dREG(82);
}
R_UPDATE_RATE = 1;
#ifndef _MSC_VER
#if !defined(_MSC_VER) && !defined(__GNUC__)
this->staticSegment = GameState_Alloc(&this->state, size, "../z_select.c", 1114);
DmaMgr_SendRequest1(this->staticSegment, _z_select_staticSegmentRomStart, size, "../z_select.c", 1115);
#endif
#endif
gSaveContext.cutsceneIndex = 0x8000;
gSaveContext.linkAge = 1;
}

View File

@ -29,7 +29,7 @@ void Title_PrintBuildInfo(Gfx** gfxp) {
#ifdef _MSC_VER
GfxPrint_Printf(&printer, "MSVC SHIP");
#else
GfxPrint_Printf(printer, "GCC SHIP");
GfxPrint_Printf(&printer, "GCC SHIP");
#endif
GfxPrint_SetColor(&printer, 255, 255, 255, 255);

View File

@ -119,7 +119,7 @@ void KaleidoScope_DrawPlayerWork(GlobalContext* globalCtx) {
func_8009214C(globalCtx, pauseCtx->playerSegment, &pauseCtx->playerSkelAnime, &pos, &rot, scale,
CUR_EQUIP_VALUE(EQUIP_SWORD), CUR_EQUIP_VALUE(EQUIP_TUNIC) - 1, CUR_EQUIP_VALUE(EQUIP_SHIELD),
CUR_EQUIP_VALUE(EQUIP_BOOTS) - 1);
gsSPResetFB(globalCtx->state.gfxCtx->polyOpa.p++, fbTest);
gsSPResetFB(globalCtx->state.gfxCtx->polyOpa.p++);
}
void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) {