mirror of
https://github.com/zeldaret/tp
synced 2026-09-04 02:19:40 -04:00
some J3D/misc cleanup (#2628)
* some j3d cleanup * begin using uintptr_t * j3dgraphbase cleanup * j3dgraphanimator cleanup
This commit is contained in:
@@ -3064,18 +3064,18 @@ J3DModel* mDoExt_J3DModel__create(J3DModelData* i_modelData, u32 i_modelFlag, u3
|
||||
// Update the modelFlag if the model data passed in has a shared dlist object
|
||||
if (i_modelData->getMaterialNodePointer(0)->getSharedDisplayListObj() != NULL) {
|
||||
if (i_modelData->isLocked()) {
|
||||
i_modelFlag = J3DMdlFlag_Unk20000;
|
||||
} else if (i_modelFlag == J3DMdlFlag_Unk20000) {
|
||||
i_modelFlag |= J3DMdlFlag_Unk40000;
|
||||
i_modelFlag = J3DMdlFlag_UseSharedDL;
|
||||
} else if (i_modelFlag == J3DMdlFlag_UseSharedDL) {
|
||||
i_modelFlag |= J3DMdlFlag_UseSingleDL;
|
||||
} else {
|
||||
i_modelFlag = J3DMdlFlag_Unk80000;
|
||||
i_modelFlag = J3DMdlFlag_DifferedDLBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
// Set up the model
|
||||
if (!model->entryModelData(i_modelData, i_modelFlag, 1)) {
|
||||
if (i_modelFlag == J3DMdlFlag_Unk80000 &&
|
||||
model->newDifferedDisplayList(i_differedDlistFlag))
|
||||
if (model->entryModelData(i_modelData, i_modelFlag, 1) == kJ3DError_Success) {
|
||||
if (i_modelFlag == J3DMdlFlag_DifferedDLBuffer &&
|
||||
model->newDifferedDisplayList(i_differedDlistFlag) != kJ3DError_Success)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -415,7 +415,7 @@ static void my_PrintHeap(char const* heapName, u32 heapSize) {
|
||||
/* 8000BCF8-8000BD44 006638 004C+00 1/1 0/0 0/0 .text my_SysPrintHeap__FPCcPvUl */
|
||||
void my_SysPrintHeap(char const* message, void* start, u32 size) {
|
||||
OSReport_System("\x1b[32m%-24s = %08x-%08x size=%d KB\n\x1b[m", message, start,
|
||||
(u32)start + size, size / 1024);
|
||||
(uintptr_t)start + size, size / 1024);
|
||||
}
|
||||
|
||||
#if VERSION != VERSION_GCN_PAL
|
||||
@@ -552,15 +552,15 @@ int mDoMch_Create() {
|
||||
JFWSystem::setMaxStdHeap(1);
|
||||
|
||||
#ifndef DEBUG
|
||||
u32 arenaHi = (u32)OSGetArenaHi();
|
||||
u32 arenaLo =(u32)OSGetArenaLo();
|
||||
uintptr_t arenaHi = (uintptr_t)OSGetArenaHi();
|
||||
uintptr_t arenaLo = (uintptr_t)OSGetArenaLo();
|
||||
|
||||
if (arenaHi > 0x81800000 && arenaHi - 0x1800000 > arenaLo) {
|
||||
OSSetArenaHi((void*)(arenaHi - 0x1800000));
|
||||
}
|
||||
#endif
|
||||
|
||||
u32 arenaSize = ((u32)OSGetArenaHi() - (u32)OSGetArenaLo()) - 0xF0;
|
||||
u32 arenaSize = ((uintptr_t)OSGetArenaHi() - (uintptr_t)OSGetArenaLo()) - 0xF0;
|
||||
my_PrintHeap("アリーナ", arenaSize);
|
||||
|
||||
if (mDoMain::memMargin != -1) {
|
||||
|
||||
@@ -126,8 +126,8 @@ void mDoPrintf_vprintf_Interrupt(char const* fmt, va_list args) {
|
||||
s32 interruptStatus = OSDisableInterrupts();
|
||||
if (!data_80450BB5) {
|
||||
data_80450BB5 = true;
|
||||
OSSwitchFiberEx((u32)fmt, (u32)args, 0, 0, (u32)vprintf,
|
||||
(u32)&mDoPrintf_FiberStack + sizeof(mDoPrintf_FiberStack));
|
||||
OSSwitchFiberEx((uintptr_t)fmt, (uintptr_t)args, 0, 0, (uintptr_t)vprintf,
|
||||
(uintptr_t)&mDoPrintf_FiberStack + sizeof(mDoPrintf_FiberStack));
|
||||
data_80450BB5 = false;
|
||||
}
|
||||
OSRestoreInterrupts(interruptStatus);
|
||||
@@ -257,7 +257,7 @@ void OSPanic(const char* file, int line, const char* fmt, ...) {
|
||||
OSAttention(" in \"%s\" on line %d.\n", file, line);
|
||||
|
||||
OSAttention("\nAddress: Back Chain LR Save\n");
|
||||
for (i = 0, p = (u32*)OSGetStackPointer(); p && (u32)p != 0xFFFFFFFF && i++ < 16; p = (u32*)*p) {
|
||||
for (i = 0, p = (u32*)OSGetStackPointer(); p && (uintptr_t)p != 0xFFFFFFFF && i++ < 16; p = (u32*)*p) {
|
||||
OSAttention("0x%08x: 0x%08x 0x%08x\n", p, p[0], p[1]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user