mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-10 08:50:23 +00:00
Decompile Gameplay_Keep and fix all existing decompiled objects (#595)
* First batch of files * Add missing folders back * Fix missing folders again * Finish fixing existing texture files * Gameplay_Keep XML finished * Most actor gameplay_keep undefined syms removed * Only ~200 gkeep symbols remain * All gkeep symbols that ZAP supports are fixed * Cleanup, and make gkeep names more accurate * Starting to figure out what some unknown blobs are, merge zeldaret in * fix a few more things * refactor gkeep * Change how gitkeep is handled * gkeep xml cleanup * Gkeep finished, now just waiting up ZAP updates * 100 link animations finished * 150 link animations finished * 200 link animations finished * 250 link animations finished * 350 link animations finished * 400 link animations finished * 450 link animations finished * 500 link animations finished * 550 link animations finished * All Link animations finished cannot build yet because ZAP doesn't have LinkAnimationHeader yet * xml changes for new zap stuff * finish gameplay_keep * fixing existing objects * ready for pr besides zap padding issue * mostly ready for pr * format all c files * all conflicts fixed * make changes that roman requested * fix thing i didn't mean to change * some animation symbols renamed * fixed roman's stuff * lifemeter hardcoded pointers removed * fix issue with incorrect data in gameplay_keep * removed unused asm * fixed most of fig's comments * fix all of fig's comments * reformat files * Update assets/xml/textures/icon_item_static.xml Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * Update assets/xml/textures/icon_item_static.xml Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * fixed stuff * fixed most of roman's comments * remove leading zeroes * should build now * git subrepo pull --force tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "f84d8337b" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "f84d8337b" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * all of gkeep symbols fixed * compiler error fixed * format files * final changes Co-authored-by: Zelllll <elijah@DESKTOP-NMP1I89.localdomain> Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
parent
84195fcef6
commit
20c1f4e648
198 changed files with 4775 additions and 4232 deletions
|
@ -70,6 +70,24 @@ void ZFile::ParseXML(ZFileMode mode, XMLElement* reader, std::string filename, b
|
|||
|
||||
int segment = -1;
|
||||
|
||||
// TODO: This should be a variable on the ZFile, but it is a large change in order to force all ZResource types to have a parent ZFile.
|
||||
const char* gameStr = reader->Attribute("Game");
|
||||
if (reader->Attribute("Game") != nullptr)
|
||||
{
|
||||
if (string(gameStr) == "MM")
|
||||
{
|
||||
Globals::Instance->game = ZGame::MM_RETAIL;
|
||||
}
|
||||
else if (string(gameStr) == "SW97" || string(gameStr) == "OOTSW97")
|
||||
{
|
||||
Globals::Instance->game = ZGame::OOT_SW97;
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: Error here.
|
||||
}
|
||||
}
|
||||
|
||||
if (reader->Attribute("BaseAddress") != NULL)
|
||||
baseAddress = (uint32_t)strtoul(StringHelper::Split(reader->Attribute("BaseAddress"), "0x")[1].c_str(), NULL, 16);
|
||||
|
||||
|
@ -144,7 +162,7 @@ void ZFile::ParseXML(ZFileMode mode, XMLElement* reader, std::string filename, b
|
|||
ZResource* dList = nullptr;
|
||||
|
||||
if (mode == ZFileMode::Extract)
|
||||
dList = ZDisplayList::ExtractFromXML(child, rawData, rawDataIndex, ZDisplayList::GetDListLength(rawData, rawDataIndex), folderName);
|
||||
dList = ZDisplayList::ExtractFromXML(child, rawData, rawDataIndex, ZDisplayList::GetDListLength(rawData, rawDataIndex, Globals::Instance->game == ZGame::OOT_SW97 ? DListType::F3DEX : DListType::F3DZEX), folderName);
|
||||
//else
|
||||
//dList = ZDisplayList::BuildFromXML(child, folderName, mode == ZFileMode::Build);
|
||||
else
|
||||
|
@ -1014,6 +1032,9 @@ void ZFile::ProcessDeclarationText(Declaration* decl)
|
|||
|
||||
if (c == '@' && c2 == 'r')
|
||||
{
|
||||
if (refIndex >= decl->references.size())
|
||||
break;
|
||||
|
||||
Declaration* refDecl = GetDeclarationRanged(decl->references[refIndex]);
|
||||
uint32_t refDeclAddr = GetDeclarationRangedAddress(decl->references[refIndex]);
|
||||
|
||||
|
@ -1021,10 +1042,17 @@ void ZFile::ProcessDeclarationText(Declaration* decl)
|
|||
{
|
||||
if (refDecl->isArray)
|
||||
{
|
||||
int itemSize = refDecl->size / refDecl->arrayItemCnt;
|
||||
int itemIndex = (decl->references[refIndex] - refDeclAddr) / itemSize;
|
||||
if (refDecl->arrayItemCnt != 0)
|
||||
{
|
||||
int itemSize = refDecl->size / refDecl->arrayItemCnt;
|
||||
int itemIndex = (decl->references[refIndex] - refDeclAddr) / itemSize;
|
||||
|
||||
decl->text.replace(i, 2, StringHelper::Sprintf("&%s[%i]", refDecl->varName.c_str(), itemIndex));
|
||||
decl->text.replace(i, 2, StringHelper::Sprintf("&%s[%i]", refDecl->varName.c_str(), itemIndex));
|
||||
}
|
||||
else
|
||||
{
|
||||
decl->text.replace(i, 2, StringHelper::Sprintf("ERROR ARRAYITEMCNT = 0"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue