Skip to content

RPGraphics stuff - #172

Open
Tanline666 wants to merge 4 commits into
doldecomp:masterfrom
Tanline666:graphics-rev0
Open

Tanline666 wants to merge 4 commits into
doldecomp:masterfrom
Tanline666:graphics-rev0

Conversation

@Tanline666

Copy link
Copy Markdown
Contributor

This is the work on RPGraphics and a few other related libraries. Some of the changes here are just documentation

@Tanline666

Copy link
Copy Markdown
Contributor Author

To be more specific, I just mean adding getters and setters to some EGG files, as well as adjusting RPSysKokeshiIcon a bit so that it compiles properly for rev 0

@decomp-dev

decomp-dev Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Report for RSPE01_01 (f5a1bb5 - 6f123a1)

📈 Matched code: 35.05% (+0.02%, +672 bytes)

✅ 9 new matches
Unit Item Bytes Before After
main/egg/gfxe/eggLightObject EGG::LightObject::CalcDirDist() +164 0.00% 100.00%
main/Pack/RPGraphics/RPGrpRenderer RPGrpRenderer::Begin() +152 0.00% 100.00%
main/Pack/RPGraphics/RPGrpRenderer RPGrpRenderer::StartDebugDraw() +128 0.00% 100.00%
main/Pack/RPGraphics/RPGrpModelScene RPGrpModelScene::g_calc_background() +64 0.00% 100.00%
main/egg/gfxe/eggLightObject EGG::LightObject::CalcAt() +56 0.00% 100.00%
main/Pack/RPGraphics/RPGrpModelScene RPGrpModelScene::CalcView() +56 0.00% 100.00%
main/Pack/RPGraphics/RPGrpDrawPathManager RPGrpDrawPath::Off() +20 0.00% 100.00%
main/Pack/RPGraphics/RPGrpDrawPathManager RPGrpDrawPath::On() +20 0.00% 100.00%
main/Pack/RPGraphics/RPGrpRenderer RPGrpRenderer::End() +12 0.00% 100.00%
📈 11 improvements in unmatched items
Unit Item Bytes Before After
main/egg/gfxe/eggLightObject EGG::LightObject::CalcView(const nw4r::math::MTX34&) +156 0.00% 27.82%
main/egg/gfxe/eggLightObject EGG::LightObject::InitGX(_GXLightObj*) const +136 0.00% 20.55%
main/Pack/RPGraphics/RPGrpRenderer RPGrpRenderer::CreateView3D(unsigned char, RPGrpCamera*, RPGrpScreen*) +104 0.00% 69.05%
main/Pack/RPGraphics/RPGrpModelScene RPGrpModelScene::~RPGrpModelScene() +62 0.00% 49.03%
main/Pack/RPGraphics/RPGrpRenderer .data +44 0.00% 18.33%
main/egg/gfxe/eggLightObject .rodata +41 0.00% 26.09%
main/egg/gfxe/eggLightObject EGG::LightObject::Calc() +32 0.00% 11.41%
main/Pack/RPGraphics/RPGrpRenderer RPGrpRenderer::AppendDrawObject(IRPGrpDrawObject*) +27 0.00% 76.56%
main/egg/gfxe/eggLightObject .sdata2 +19 0.00% 30.95%
main/Pack/RPGraphics/RPGrpRenderer .sdata2 +13 0.00% 41.67%
main/Pack/RPGraphics/RPGrpRenderer .sdata +6 0.00% 75.00%

Report for RSPE01_00 (f5a1bb5 - 6f123a1)

📈 Matched code: 8.05% (+0.10%, +3468 bytes)
📈 Linked code: 4.08% (+0.05%, +1732 bytes)
📈 Matched data: 6.30% (+0.01%, +268 bytes)
📈 Linked data: 6.27% (+0.02%, +272 bytes)

✅ 29 new matches
Unit Item Bytes Before After
main/Pack/RPGraphics/RPGrpCpuTexture makeGradationTable(RPGrpCpuTexture::EGradationKind, _GXColor*, unsigned short, unsigned short, unsigned short, const _GXColor&, const _GXColor&) +1356 0.00% 100.00%
main/Pack/RPUtility/RPUtlDohMath RPUtlDohMath::MTX34Normalize(nw4r::math::MTX34*, const nw4r::math::MTX34*, RPUtlDohMath::AxisOrder) +664 0.00% 100.00%
main/Pack/RPUtility/RPUtlDohMath RPUtlDohMath::GetMidPoint(nw4r::math::VEC3*, float*, const nw4r::math::VEC3&, const nw4r::math::VEC3&, const nw4r::math::VEC3&, float, float) +508 0.00% 100.00%
main/Pack/RPUtility/RPUtlDohMath __sinit_\RPUtlDohMath_cpp +284 0.00% 100.00%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::RPGrpModel(unsigned char) +188 0.00% 100.00%
main/Pack/RPGraphics/RPGrpModelResManager .data +180 0.00% 100.00%
main/Pack/RPUtility/RPUtlShadowDrawer RPUtlShadowDrawer::initMtx() const +136 0.00% 100.00%
main/Pack/RPUtility/RPUtlShadowDrawer RPUtlShadowDrawer::drawShadow() +136 0.00% 100.00%
main/Pack/RPGraphics/RPGrpCpuTexture RPGrpCpuTexture::initResTIMG() const +132 0.00% 100.00%
main/Pack/RPGraphics/RPGrpCpuTexture RPGrpCpuTexture::getTexObj(_GXTexObj*) const +128 0.00% 100.00%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::CreateRecord(unsigned short) +100 0.00% 100.00%
main/Pack/RPGraphics/RPGrpCpuTexture RPGrpCpuTexture::invalidate() const +76 0.00% 100.00%
main/Pack/RPGraphics/RPGrpCpuTexture RPGrpCpuTexture::flush() const +76 0.00% 100.00%
main/Pack/RPGraphics/RPGrpCpuTexture RPGrpCpuTexture::load(_GXTexMapID) +72 0.00% 100.00%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::RemoveGenList() +68 0.00% 100.00%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::~RPGrpModel() +64 0.00% 100.00%
main/Pack/RPUtility/RPUtlShadowDrawer .bss +48 0.00% 100.00%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::Entry() +44 0.00% 100.00%
main/Pack/RPGraphics/RPGrpCpuTexture RPGrpCpuTexture::getTexBufferSize() const +28 0.00% 100.00%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::SetCallback(IRPGrpModelCallback*) +16 0.00% 100.00%
main/Pack/RPUtility/RPUtlDohMath .sdata2 +16 0.00% 100.00%
main/Pack/RPGraphics/RPGrpModelAnm .sdata2 +8 0.00% 100.00%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::GetViewMtxNum() const +8 0.00% 100.00%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::GetShapeNum() const +8 0.00% 100.00%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::GetJointNum() const +8 0.00% 100.00%
main/Pack/RPUtility/RPUtlDohMath .sbss +8 0.00% 100.00%
main/Pack/RPUtility/RPUtlDohMath .ctors +4 0.00% 100.00%
main/Pack/RPUtility/RPUtlShadowDrawer .ctors +4 0.00% 100.00%
main/Pack/RPUtility/RPUtlShadowDrawer __sinit_\RPUtlShadowDrawer_cpp +4 0.00% 100.00%
🥀 1 broken match
Unit Item Bytes Before After
main/Pack/RPGraphics/RPGrpModelAnm RPGrpModelAnm::CreateBuffer(RPGrpModelAnm::Anm, unsigned short) -1 100.00% 99.99%
📈 11 improvements in unmatched items
Unit Item Bytes Before After
main/Pack/RPGraphics/RPGrpCpuTexture RPGrpCpuTexture::fillGradationTable(RPGrpCpuTexture::EGradationKind, int, unsigned short, unsigned short, const _GXColor&, const _GXColor&, bool, bool) +875 0.00% 80.51%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::Configure() +199 0.00% 73.32%
main/Pack/RPUtility/RPUtlDohMath .bss +184 0.00% 95.83%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::SetReverseCulling(bool) +152 0.00% 61.56%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::CalcMaterial() +119 0.00% 99.97%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::Calc() +115 0.00% 99.97%
main/Pack/RPGraphics/RPGrpCpuTexture RPGrpCpuTexture::allocWithHeaderDebug() +107 0.00% 99.59%
main/Pack/RPGraphics/RPGrpCpuTexture RPGrpCpuTexture::alloc() +87 0.00% 99.55%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::CreateBoundingInfo(unsigned long) +70 0.00% 53.70%
main/Pack/RPGraphics/RPGrpModel RPGrpModel::UpdateFrame() +28 0.00% 31.22%
main/Pack/RPKernel/RPSysKokeshiIcon RPSysKokeshiIcon::SetupModel(RPGrpModel*) 0 98.17% 98.27%
📉 2 regressions in unmatched items
Unit Item Bytes Before After
main/Pack/RPKernel/RPSysKokeshiIcon RPSysKokeshiIcon::MakeTexture(RPGrpModel*, const RPSysKokeshiLocation&, EGG::Allocator*, unsigned short, unsigned short, _GXTexFmt, RFLIconBGType, _GXColor, RPSysKokeshiManager::IconView) -38 91.45% 86.32%
main/Pack/RPGraphics/RPGrpModelAnm .data -9 82.22% 75.55%

@kiwi515

kiwi515 commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

could the documentation for non-RP code be removed? id like to save that for later when we better understand the lower-level stuff

Comment thread include/egg/gfxe/eggFogManager.h Outdated
Comment thread include/egg/gfxe/eggLightObject.h Outdated
Comment thread include/egg/gfxe/eggLightObject.h Outdated
Comment thread include/egg/gfxe/eggStateGX.h
Comment thread src/Pack/RPGraphics/RPGrpModel.cpp Outdated
Comment thread src/egg/gfxe/eggLightObject.cpp Outdated
@kiwi515

kiwi515 commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

i think we should avoid adding inlined getters unless:

  • they are used in matching, decompiled code
  • an official symbol for the inline exists

the reason being that we dont know the actual API for sure yet. ive even seen instances where the programmers forget to make the return type a reference, which results in a copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants