mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-17 23:01:00 -04:00
Format everything (#141)
* Add trailing comma * Run format and add some missing trailing commas * Enforce the same clang-format version for everybody * z_en_m_fire1
This commit is contained in:
@@ -82,7 +82,6 @@ void __osMallocAddBlock(Arena* arena, void* start, s32 size) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void __osMallocCleanup(Arena* arena) {
|
||||
bzero(arena, sizeof(*arena));
|
||||
}
|
||||
@@ -97,11 +96,11 @@ void* __osMalloc(Arena* arena, u32 size) {
|
||||
void* alloc;
|
||||
u32 blockSize;
|
||||
alloc = NULL;
|
||||
|
||||
|
||||
size = ALIGN16(size);
|
||||
ArenaImpl_Lock(arena);
|
||||
iter = arena->head;
|
||||
|
||||
|
||||
while (iter != NULL) {
|
||||
if (iter->isFree && iter->size >= size) {
|
||||
ArenaNode* next;
|
||||
@@ -134,7 +133,6 @@ void* __osMalloc(Arena* arena, u32 size) {
|
||||
return alloc;
|
||||
}
|
||||
|
||||
|
||||
void* __osMallocR(Arena* arena, u32 size) {
|
||||
ArenaNode* iter;
|
||||
ArenaNode* newNode;
|
||||
|
||||
@@ -99,15 +99,12 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) {
|
||||
|
||||
gSPTextureRectangle(this->dlist++, this->posX + 4, this->posY + 4, this->posX + 4 + 32, this->posY + 4 + 32,
|
||||
(c & 3) << 1, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1024, 1024);
|
||||
|
||||
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, this->color.rgba);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
gSPTextureRectangle(this->dlist++, this->posX, this->posY, this->posX + 32, this->posY + 32, (u16)(tile & 7),
|
||||
(u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1024, 1024);
|
||||
|
||||
|
||||
this->posX += 32;
|
||||
}
|
||||
@@ -133,7 +130,7 @@ void GfxPrint_PrintString(GfxPrint* this, const char* str) {
|
||||
}
|
||||
}
|
||||
|
||||
GfxPrint* GfxPrint_Callback(GfxPrint* this, const char* str, size_t size) {
|
||||
GfxPrint* GfxPrint_Callback(GfxPrint* this, const char* str, size_t size) {
|
||||
GfxPrint_PrintStringWithSize(this, str, sizeof(char), size);
|
||||
return this;
|
||||
}
|
||||
@@ -142,7 +139,7 @@ void GfxPrint_Init(GfxPrint* this) {
|
||||
this->flag &= ~GFXPRINT_OPEN;
|
||||
|
||||
this->callback = GfxPrint_Callback;
|
||||
|
||||
|
||||
this->dlist = NULL;
|
||||
this->posX = 0;
|
||||
this->posY = 0;
|
||||
@@ -156,7 +153,6 @@ void GfxPrint_Init(GfxPrint* this) {
|
||||
}
|
||||
|
||||
void GfxPrint_Destroy(GfxPrint* this) {
|
||||
|
||||
}
|
||||
|
||||
void GfxPrint_Open(GfxPrint* this, Gfx* dlist) {
|
||||
@@ -164,7 +160,7 @@ void GfxPrint_Open(GfxPrint* this, Gfx* dlist) {
|
||||
this->flag |= GFXPRINT_OPEN;
|
||||
this->dlist = dlist;
|
||||
GfxPrint_InitDlist(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Gfx* GfxPrint_Close(GfxPrint* this) {
|
||||
|
||||
+37
-30
@@ -4,9 +4,10 @@
|
||||
UNK_TYPE4 D_80096C30 = 2;
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// This needs lots of work. Mostly regalloc and getting the address of D_80096C30 placed in s5 at the beginning of the function
|
||||
// This needs lots of work. Mostly regalloc and getting the address of D_80096C30 placed in s5 at the beginning of the
|
||||
// function
|
||||
void Load2_Relocate(u32 allocatedVRamAddr, OverlayBlockSizes* overlayInfo, u32 vRamStart) {
|
||||
s32 sectionLocations [4];
|
||||
s32 sectionLocations[4];
|
||||
u32* regReferences[32];
|
||||
u32 regValues[32];
|
||||
u32 i;
|
||||
@@ -24,34 +25,36 @@ void Load2_Relocate(u32 allocatedVRamAddr, OverlayBlockSizes* overlayInfo, u32 v
|
||||
for (i = 0, relocationIndex = 0; i < overlayInfo->amountOfRelocations; relocationIndex++) {
|
||||
relocation = overlayInfo->relocations[relocationIndex];
|
||||
i++;
|
||||
inst = (u32 *)(sectionLocations[relocation >> 0x1e] + (relocation & 0xffffff));
|
||||
inst = (u32*)(sectionLocations[relocation >> 0x1e] + (relocation & 0xffffff));
|
||||
|
||||
switch (relocation & 0x3f000000) {
|
||||
case 0x2000000:
|
||||
if ((*inst & 0xf000000) == 0) {
|
||||
*inst = (*inst - vRamStart) + allocatedVRamAddr;
|
||||
} else {
|
||||
if (D_80096C30 > 2);
|
||||
}
|
||||
break;
|
||||
case 0x4000000:
|
||||
*inst = (*inst & 0xfc000000) |
|
||||
(((((*inst & 0x3ffffff) << 2 | 0x80000000) - vRamStart) + allocatedVRamAddr & 0xfffffff) >> 2);
|
||||
break;
|
||||
case 0x5000000:
|
||||
regReferences[*inst >> 0x10 & 0x1f] = inst;
|
||||
regValues[*inst >> 0x10 & 0x1f] = *inst;
|
||||
break;
|
||||
case 0x6000000:
|
||||
lastInst = regReferences[*inst >> 0x15 & 0x1f];
|
||||
signedOffset = (s16)*inst;
|
||||
if ((signedOffset + *lastInst * 0x10000 & 0xf000000) == 0) {
|
||||
relocatedAddress = ((signedOffset + regValues[*inst >> 0x15 & 0x1f] * 0x10000) - vRamStart) + allocatedVRamAddr;
|
||||
*lastInst = (((relocatedAddress >> 0x10) & 0xFFFF) + ((relocatedAddress & 0x8000)? 1 : 0)) |
|
||||
(*lastInst & 0xffff0000);
|
||||
*inst = *inst & 0xffff0000 | relocatedAddress & 0xffff;
|
||||
}
|
||||
break;
|
||||
case 0x2000000:
|
||||
if ((*inst & 0xf000000) == 0) {
|
||||
*inst = (*inst - vRamStart) + allocatedVRamAddr;
|
||||
} else {
|
||||
if (D_80096C30 > 2)
|
||||
;
|
||||
}
|
||||
break;
|
||||
case 0x4000000:
|
||||
*inst = (*inst & 0xfc000000) |
|
||||
(((((*inst & 0x3ffffff) << 2 | 0x80000000) - vRamStart) + allocatedVRamAddr & 0xfffffff) >> 2);
|
||||
break;
|
||||
case 0x5000000:
|
||||
regReferences[*inst >> 0x10 & 0x1f] = inst;
|
||||
regValues[*inst >> 0x10 & 0x1f] = *inst;
|
||||
break;
|
||||
case 0x6000000:
|
||||
lastInst = regReferences[*inst >> 0x15 & 0x1f];
|
||||
signedOffset = (s16)*inst;
|
||||
if ((signedOffset + *lastInst * 0x10000 & 0xf000000) == 0) {
|
||||
relocatedAddress =
|
||||
((signedOffset + regValues[*inst >> 0x15 & 0x1f] * 0x10000) - vRamStart) + allocatedVRamAddr;
|
||||
*lastInst = (((relocatedAddress >> 0x10) & 0xFFFF) + ((relocatedAddress & 0x8000) ? 1 : 0)) |
|
||||
(*lastInst & 0xffff0000);
|
||||
*inst = *inst & 0xffff0000 | relocatedAddress & 0xffff;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,14 +73,18 @@ s32 Load2_LoadOverlay(u32 vRomStart, u32 vRomEnd, u32 vRamStart, u32 vRamEnd, u3
|
||||
|
||||
size = vRomEnd - vRomStart;
|
||||
|
||||
if(1);
|
||||
if (1) {
|
||||
;
|
||||
}
|
||||
|
||||
DmaMgr_SendRequest0(allocatedVRamAddr, vRomStart, size);
|
||||
|
||||
end = (void*)(allocatedVRamAddr + size);
|
||||
overlayInfo = (OverlayBlockSizes*)((int)end - *(int*)((int)end + -4));
|
||||
|
||||
if(1);
|
||||
if (1) {
|
||||
;
|
||||
}
|
||||
|
||||
Load2_Relocate(allocatedVRamAddr, overlayInfo, vRamStart);
|
||||
|
||||
|
||||
@@ -15,5 +15,5 @@ void MtxConv_F2L(MatrixInternal* m1, MtxF* m2) {
|
||||
}
|
||||
|
||||
void MtxConv_L2F(MtxF* m1, MatrixInternal* m2) {
|
||||
guMtxL2F(m1, (Mtx *)m2);
|
||||
guMtxL2F(m1, (Mtx*)m2);
|
||||
}
|
||||
|
||||
@@ -92,4 +92,3 @@ void PadUtils_UpdateRelXY(Input* input) {
|
||||
|
||||
PadUtils_SetRelXY(input, relX, relY);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
StackEntry* sStackInfoListStart = NULL;
|
||||
StackEntry* sStackInfoListEnd = NULL;
|
||||
|
||||
void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace, const char* name) {
|
||||
void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace,
|
||||
const char* name) {
|
||||
StackEntry* iter;
|
||||
u32* addr;
|
||||
|
||||
@@ -99,7 +100,7 @@ u32 StackCheck_CheckAll() {
|
||||
u32 ret = 0;
|
||||
StackEntry* iter = sStackInfoListStart;
|
||||
|
||||
while(iter) {
|
||||
while (iter) {
|
||||
u32 state = StackCheck_GetState(iter);
|
||||
if (state) {
|
||||
ret = 1;
|
||||
|
||||
Reference in New Issue
Block a user