Merge decomp/main into dusk

Merges 44 upstream commits from zeldaret/tp decomp/main.

Conflict resolutions:
- .github/workflows/build.yml: keep deleted (not needed for PC port)
- README.md: keep PC port README
- J3DAnimation.h: keep OFFSET_PTR macro + add upstream forward decl
- J3DModelLoader.h: keep BE(u32) mBlockNum + add field_0x1c
- d_com_inf_game.h: keep PC port inlines + add upstream declarations
- global.h: keep MULTI_CHAR macro + add FABSF macro
- JUTConsole.cpp: keep uintptr_t cast for 64-bit
- JUTDbPrint.cpp: keep PC enter_() helper + add cstring include
- JUTResFont.cpp: take upstream loop/struct improvements with BE types
- JUTCacheFont.cpp: take upstream decomp fix
- float.h: use upstream !PLATFORM_GCN guard
- d_a_npc_bouS/theB.cpp: keep MULTI_CHAR() for PC portability
- d_a_npc_henna.cpp: keep uintptr_t + use upstream var name
- d_demo.cpp: keep near_/far_ field renames for PC
- d_resorce.cpp: keep uintptr_t + fix var name to res
- d_s_room.cpp, m_Do_graphic.cpp: keep dusk includes + add cstring
- m_Do_main.cpp: keep JHIComPortManager + use JAS_GLOBAL_INSTANCE_INIT
- angle_utils.h: remove redundant types.h include
This commit is contained in:
Luke Street
2026-02-28 13:28:42 -07:00
3803 changed files with 240344 additions and 16831 deletions
+7 -7
View File
@@ -7,6 +7,8 @@
#include "JSystem/JKernel/JKRAram.h"
#include <dolphin/gx.h>
#include <stdint.h>
#include <cstring>
#include "angle_utils.h"
JUTCacheFont::JUTCacheFont(ResFONT const* p_fontRes, u32 cacheSize, JKRHeap* p_heap) {
initialize_state();
@@ -70,7 +72,6 @@ int JUTCacheFont::getMemorySize(ResFONT const* p_font, u16* o_widCount, u32* o_w
u32 totalGlySize = 0;
u32 totalMapSize = 0;
u32 maxGlyTexSize = 0;
u32 glyTexSize;
u8* fontInf = (u8*)p_font->data;
for (int i = 0; i < (int)p_font->numBlocks; i++) {
@@ -84,11 +85,10 @@ int JUTCacheFont::getMemorySize(ResFONT const* p_font, u16* o_widCount, u32* o_w
widBlockCount++;
break;
case 'GLY1':
totalGlySize += blkSize;
glyTexSize = ((ResFONT::GLY1*)fontInf)->textureSize;
totalGlySize += ((BlockHeader*)fontInf)->size;
glyBlockCount++;
if (glyTexSize > maxGlyTexSize) {
maxGlyTexSize = glyTexSize;
if (((ResFONT::GLY1*)fontInf)->textureSize > maxGlyTexSize) {
maxGlyTexSize = ((ResFONT::GLY1*)fontInf)->textureSize;
}
break;
case 'MAP1':
@@ -185,7 +185,7 @@ bool JUTCacheFont::allocArea(void* cacheBuffer, u32 param_1, JKRHeap* heap) {
}
if (mGly1BlockNum != 0) {
field_0x80 = new (heap, 0) ResFONT::GLY1[mGly1BlockNum];
field_0x80 = new (heap, 0) u8[mGly1BlockNum * sizeof(ResFONT::GLY1)];
if (field_0x80 == NULL) {
return false;
}
@@ -350,7 +350,7 @@ void JUTCacheFont::getGlyphFromAram(JUTCacheFont::TGlyphCacheInfo* param_0,
prepend(pGylphCacheInfo);
int iVar3 = pGylphCacheInfo->field_0x16 * pGylphCacheInfo->field_0x18;
int iVar2 = *r30 / iVar3;
pGylphCacheInfo->field_0x8 += iVar2 * iVar3;
U16_ADD_2(pGylphCacheInfo->field_0x8, iVar2 * iVar3);
u16 local_30 = pGylphCacheInfo->field_0x8 + iVar3 - 1;
pGylphCacheInfo->field_0xa = pGylphCacheInfo->field_0xa < local_30 ? pGylphCacheInfo->field_0xa : local_30;
*param_3 = iVar2;