1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-27 07:07:09 +00:00

git subrepo pull --force tools/ZAPD (#742)

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "c4773301a"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "c4773301a"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"
This commit is contained in:
fig02 2021-03-27 23:57:14 -04:00 committed by GitHub
parent b338f12498
commit 71bbaab485
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 66 additions and 21 deletions

View file

@ -6,7 +6,7 @@
[subrepo] [subrepo]
remote = https://github.com/zeldaret/ZAPD.git remote = https://github.com/zeldaret/ZAPD.git
branch = master branch = master
commit = 4751db5c9ee0a25a26379ca5b44efad72215d256 commit = c4773301a17a5a9f9c964a3e7ba6dfbf0730a94b
parent = 77ec4d491610620338e592a0f853b7c59af7fba5 parent = 97f80eeb3f79bafac383fa6dd17765ae291e05d7
method = merge method = merge
cmdver = 0.4.3 cmdver = 0.4.3

View file

@ -66,7 +66,7 @@ std::string ZNormalAnimation::GetSourceOutputCode(const std::string& prefix)
string headerStr = string headerStr =
StringHelper::Sprintf("{ %i }, %sFrameData, %sJointIndices, %i", frameCount, StringHelper::Sprintf("{ %i }, %sFrameData, %sJointIndices, %i", frameCount,
defaultPrefix.c_str(), defaultPrefix.c_str(), limit); defaultPrefix.c_str(), defaultPrefix.c_str(), limit);
parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, 16, "AnimationHeader", parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, GetRawDataSize(), GetSourceTypeName(),
StringHelper::Sprintf("%s", name.c_str()), headerStr); StringHelper::Sprintf("%s", name.c_str()), headerStr);
string indicesStr = ""; string indicesStr = "";
@ -111,6 +111,11 @@ int ZNormalAnimation::GetRawDataSize()
return 16; return 16;
} }
std::string ZNormalAnimation::GetSourceTypeName()
{
return "AnimationHeader";
}
ZNormalAnimation* ZNormalAnimation::ExtractFromXML(tinyxml2::XMLElement* reader, ZNormalAnimation* ZNormalAnimation::ExtractFromXML(tinyxml2::XMLElement* reader,
std::vector<uint8_t> nRawData, int rawDataIndex, std::vector<uint8_t> nRawData, int rawDataIndex,
const std::string& nRelPath) const std::string& nRelPath)
@ -170,7 +175,7 @@ std::string ZLinkAnimation::GetSourceOutputCode(const std::string& prefix)
segmentAddress, StringHelper::Sprintf("%sSeg%06X", name.c_str(), segmentAddress, StringHelper::Sprintf("%sSeg%06X", name.c_str(),
segmentAddress)); segmentAddress));
string headerStr = StringHelper::Sprintf("{ %i }, 0x%08X", frameCount, segmentAddress); string headerStr = StringHelper::Sprintf("{ %i }, 0x%08X", frameCount, segmentAddress);
parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, 16, "LinkAnimationHeader", parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, GetRawDataSize(), GetSourceTypeName(),
StringHelper::Sprintf("%s", name.c_str()), headerStr); StringHelper::Sprintf("%s", name.c_str()), headerStr);
} }
@ -182,6 +187,11 @@ int ZLinkAnimation::GetRawDataSize()
return 8; return 8;
} }
std::string ZLinkAnimation::GetSourceTypeName()
{
return "LinkAnimationHeader";
}
ZLinkAnimation* ZLinkAnimation::ExtractFromXML(tinyxml2::XMLElement* reader, ZLinkAnimation* ZLinkAnimation::ExtractFromXML(tinyxml2::XMLElement* reader,
std::vector<uint8_t> nRawData, int rawDataIndex, std::vector<uint8_t> nRawData, int rawDataIndex,
const std::string& nRelPath) const std::string& nRelPath)

View file

@ -51,6 +51,8 @@ public:
std::string GetSourceOutputCode(const std::string& prefix) override; std::string GetSourceOutputCode(const std::string& prefix) override;
int GetRawDataSize() override; int GetRawDataSize() override;
std::string GetSourceTypeName() override;
static ZNormalAnimation* ExtractFromXML(tinyxml2::XMLElement* reader, static ZNormalAnimation* ExtractFromXML(tinyxml2::XMLElement* reader,
std::vector<uint8_t> nRawData, int rawDataIndex, std::vector<uint8_t> nRawData, int rawDataIndex,
const std::string& nRelPath); const std::string& nRelPath);
@ -69,6 +71,8 @@ public:
std::string GetSourceOutputCode(const std::string& prefix) override; std::string GetSourceOutputCode(const std::string& prefix) override;
int GetRawDataSize() override; int GetRawDataSize() override;
std::string GetSourceTypeName() override;
static ZLinkAnimation* ExtractFromXML(tinyxml2::XMLElement* reader, static ZLinkAnimation* ExtractFromXML(tinyxml2::XMLElement* reader,
std::vector<uint8_t> nRawData, int rawDataIndex, std::vector<uint8_t> nRawData, int rawDataIndex,
const std::string& nRelPath); const std::string& nRelPath);

View file

@ -207,6 +207,10 @@ std::string ZSkeleton::GetSourceOutputCode(const std::string& prefix)
{ {
// Table // Table
string tblStr = ""; string tblStr = "";
string limbArrTypeStr = "static void*";
if (limbType == ZLimbType::Curve) {
limbArrTypeStr = StringHelper::Sprintf("static %s*", ZLimb::GetSourceTypeName(limbType));
}
for (size_t i = 0; i < limbs.size(); i++) for (size_t i = 0; i < limbs.size(); i++)
{ {
@ -222,7 +226,7 @@ std::string ZSkeleton::GetSourceOutputCode(const std::string& prefix)
tblStr += decl; tblStr += decl;
} }
parent->AddDeclarationArray(ptr, DeclarationAlignment::None, 4 * limbCount, "static void*", parent->AddDeclarationArray(ptr, DeclarationAlignment::None, 4 * limbCount, limbArrTypeStr,
StringHelper::Sprintf("%sLimbs", defaultPrefix.c_str()), StringHelper::Sprintf("%sLimbs", defaultPrefix.c_str()),
limbCount, tblStr); limbCount, tblStr);
} }

View file

@ -0,0 +1,12 @@
; DO NOT EDIT (unless you know what you are doing)
;
; This subdirectory is a git "subrepo", and this file is maintained by the
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
;
[subrepo]
remote = https://github.com/glankk/libgfxd.git
branch = master
commit = 2f00ff7dff14ae44c12ed421be54b9fec815541b
parent = a43a526c4296d7dc48852f6017fe069724465494
method = merge
cmdver = 0.4.3

View file

@ -1,5 +1,5 @@
/** /**
* gbi.h version 0.3.3 * gbi.h version 0.3.4
* n64 graphics microcode interface library * n64 graphics microcode interface library
* compatible with fast3d, f3dex, f3dex2, s2dex, and s2dex2 * compatible with fast3d, f3dex, f3dex2, s2dex, and s2dex2
* *
@ -201,6 +201,10 @@
#define G_TX_LOADTILE 7 #define G_TX_LOADTILE 7
#define G_TX_RENDERTILE 0 #define G_TX_RENDERTILE 0
/* loadblock constants */
#define G_TX_DXT_FRAC 11
#define G_TX_LDBLK_MAX_TXL 2047
/* geometry mode */ /* geometry mode */
#define G_ZBUFFER (gI_(0b1) << 0) #define G_ZBUFFER (gI_(0b1) << 0)
#define G_SHADE (gI_(0b1) << 2) #define G_SHADE (gI_(0b1) << 2)
@ -1813,8 +1817,7 @@
gsDPLoadSync(), \ gsDPLoadSync(), \
gsDPLoadBlock( \ gsDPLoadBlock( \
G_TX_LOADTILE, 0, 0, \ G_TX_LOADTILE, 0, 0, \
(((width) * (height) + 1) * G_SIZ_BITS(siz) - 1) / \ G_LTB_LRS(width, height, siz), \
G_SIZ_BITS(G_SIZ_LDSIZ(siz)) - 1, \
dxt), \ dxt), \
gsDPPipeSync(), \ gsDPPipeSync(), \
gsDPSetTile( \ gsDPSetTile( \
@ -2112,7 +2115,7 @@
gF_(uls, 12, 12) | \ gF_(uls, 12, 12) | \
gF_(ult, 12, 0), \ gF_(ult, 12, 0), \
gF_(tile, 3, 24) | \ gF_(tile, 3, 24) | \
gF_(lrs, 12, 12) | \ gF_(G_LDBLK_TXL(lrs), 12, 12) | \
gF_(dxt, 12, 0)) gF_(dxt, 12, 0))
#define gsDPNoOp() \ #define gsDPNoOp() \
@ -3719,10 +3722,21 @@ typedef struct
#define G_SIZ_LDBITS(siz) ((siz) < G_IM_SIZ_16b ? G_SIZ_BITS(siz) : 16) #define G_SIZ_LDBITS(siz) ((siz) < G_IM_SIZ_16b ? G_SIZ_BITS(siz) : 16)
#define G_DXT(siz, width) \ #define G_DXT(siz, width) \
( \ ( \
(width) * G_SIZ_BITS(siz) <= 64 ? \ (width) * G_SIZ_BITS(siz) > 64 ? \
(1 << 11) : \
((1 << 11) + (width) * G_SIZ_BITS(siz) / 64 - 1) / \ ((1 << 11) + (width) * G_SIZ_BITS(siz) / 64 - 1) / \
((width) * G_SIZ_BITS(siz) / 64) \ ((width) * G_SIZ_BITS(siz) / 64) : \
(1 << 11) \
)
#define G_LTB_LRS(width, height, siz) \
( \
(((width) * (height) + 1) * G_SIZ_BITS(siz) - 1) / \
G_SIZ_BITS(G_SIZ_LDSIZ(siz)) - 1 \
)
#define G_LDBLK_TXL(txl) \
( \
(txl) > G_TX_LDBLK_MAX_TXL ? \
G_TX_LDBLK_MAX_TXL : \
(txl) \
) )
/* depth value macros */ /* depth value macros */

View file

@ -274,15 +274,10 @@ UCFUNC int c_ltb(gfxd_macro_t *m, int n_macro, int id, int mdxt, int mtmem,
} }
int width = (argvu(&m[6], 3) >> 2) + 1; int width = (argvu(&m[6], 3) >> 2) + 1;
int height = (argvu(&m[6], 4) >> 2) + 1; int height = (argvu(&m[6], 4) >> 2) + 1;
unsigned lrs = ((width * height + 1) * G_SIZ_BITS(siz) - 1) / unsigned lrs = G_LDBLK_TXL(G_LTB_LRS(width, height, siz));
G_SIZ_BITS(G_SIZ_LDSIZ(siz)) - 1;
unsigned dxt = 0; unsigned dxt = 0;
if (!mdxt) if (!mdxt)
{ dxt = G_DXT(siz, width);
dxt = (width * G_SIZ_BITS(siz) <= 64 ? (1 << 11) :
((1 << 11) + width * G_SIZ_BITS(siz) / 64 - 1) /
(width * G_SIZ_BITS(siz) / 64));
}
int line; int line;
if (myuv) if (myuv)
line = (width + 7) / 8; line = (width + 7) / 8;
@ -592,8 +587,14 @@ UCFUNC int d_DPLoadBlock(gfxd_macro_t *m, uint32_t hi, uint32_t lo)
argu(m, 2, "ult", getfield(hi, 12, 0), gfxd_Coordi); argu(m, 2, "ult", getfield(hi, 12, 0), gfxd_Coordi);
argu(m, 3, "lrs", getfield(lo, 12, 12), gfxd_Coordi); argu(m, 3, "lrs", getfield(lo, 12, 12), gfxd_Coordi);
argu(m, 4, "dxt", getfield(lo, 12, 0), gfxd_Dxt); argu(m, 4, "dxt", getfield(lo, 12, 0), gfxd_Dxt);
if (argvu(m, 3) > G_TX_LDBLK_MAX_TXL) {
badarg(m, 3);
return -1;
}
else {
return 0; return 0;
} }
}
UCFUNC int d_DPNoOp(gfxd_macro_t *m, uint32_t hi, uint32_t lo) UCFUNC int d_DPNoOp(gfxd_macro_t *m, uint32_t hi, uint32_t lo)
{ {