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:
Anghelo Carvajal
2021-05-18 20:00:36 -04:00
committed by GitHub
parent 091219d742
commit c56934038a
639 changed files with 2535 additions and 2310 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ shopt -s globstar
if (( $# > 0 )); then
echo "Formatting file(s) $*"
echo "Running clang-format..."
clang-format ${FORMAT_OPTS} "$@"
clang-format-11 ${FORMAT_OPTS} "$@"
echo "Running clang-tidy..."
clang-tidy ${TIDY_OPTS} "$@" -- ${COMPILER_OPTS} &> /dev/null
echo "Adding missing final new lines..."
@@ -20,7 +20,7 @@ fi
echo "Formatting C files. This will take a bit"
echo "Running clang-format..."
clang-format ${FORMAT_OPTS} src/**/*.c
clang-format-11 ${FORMAT_OPTS} src/**/*.c
echo "Running clang-tidy..."
clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null
echo "Adding missing final new lines..."
+2 -4
View File
@@ -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;
+4 -8
View File
@@ -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
View File
@@ -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);
+1 -1
View File
@@ -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);
}
-1
View File
@@ -92,4 +92,3 @@ void PadUtils_UpdateRelXY(Input* input) {
PadUtils_SetRelXY(input, relX, relY);
}
+3 -2
View File
@@ -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;
+4 -2
View File
@@ -1,9 +1,11 @@
#include <ultra64.h>
#include <global.h>
void CIC6105_Nop80081820(void) {}
void CIC6105_Nop80081820(void) {
}
void CIC6105_Nop80081828(void) {}
void CIC6105_Nop80081828(void) {
}
void CIC6105_PrintRomInfo(void) {
FaultDrawer_DrawText(80, 200, "SP_STATUS %08x", (UNK_PTR)(*(u32*)0xA4040010));
+6 -3
View File
@@ -3,6 +3,9 @@
// This file contains print functions that are used by fault.c, so they are placed in the fault module
void Fault_Nop80081920(UNK_TYPE4 param_1, ...) {}
void Fault_Log(char* str, ...) {}
void Fault_Nop80081958(UNK_TYPE4 param_1, ...) {}
void Fault_Nop80081920(UNK_TYPE4 param_1, ...) {
}
void Fault_Log(char* str, ...) {
}
void Fault_Nop80081958(UNK_TYPE4 param_1, ...) {
}
+1 -1
View File
@@ -11,7 +11,7 @@ s32 func_800968B0(const char* str1, const char* str2) {
currentCharStr1 = *str1++;
currentCharStr2 = *str2++;
if (currentCharStr1 != currentCharStr2) {
return currentCharStr1 - currentCharStr2;
return currentCharStr1 - currentCharStr2;
}
} while (currentCharStr1);
+2 -1
View File
@@ -9,6 +9,7 @@ void bootproc(void) {
osUnmapTLBAll();
gCartHandle = osCartRomInit();
StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, sIdleThreadStack + sizeof(sIdleThreadStack), 0, 256, "idle");
osCreateThread(&sIdleThread, Z_THREAD_ID_IDLE, Idle_ThreadEntry, NULL, sIdleThreadStack + sizeof(sIdleThreadStack), Z_PRIORITY_IDLE);
osCreateThread(&sIdleThread, Z_THREAD_ID_IDLE, Idle_ThreadEntry, NULL, sIdleThreadStack + sizeof(sIdleThreadStack),
Z_PRIORITY_IDLE);
osStartThread(&sIdleThread);
}
+20 -16
View File
@@ -52,7 +52,8 @@ void Idle_InitCodeAndMemory(void) {
oldSize = sDmaMgrDmaBuffSize;
sDmaMgrDmaBuffSize = 0;
DmaMgr_SendRequestImpl(&dmaReq, (u32)&code_text_start, (u32)_codeSegmentRomStart, (u32)_codeSegmentRomEnd - (u32)_codeSegmentRomStart, 0, &queue, 0);
DmaMgr_SendRequestImpl(&dmaReq, (u32)&code_text_start, (u32)_codeSegmentRomStart,
(u32)_codeSegmentRomEnd - (u32)_codeSegmentRomStart, 0, &queue, 0);
Idle_InitScreen();
Idle_InitMemory();
osRecvMesg(&queue, NULL, 1);
@@ -82,19 +83,19 @@ void Idle_InitVideo(void) {
gViConfigYScale = 1.0;
switch (osTvType) {
case 1:
D_8009B290 = 2;
gViConfigMode = osViModeNtscLan1;
break;
case 2:
D_8009B290 = 30;
gViConfigMode = osViModeMpalLan1;
break;
case 0:
D_8009B290 = 44;
gViConfigMode = osViModeFpalLan1;
gViConfigYScale = 0.833f;
break;
case 1:
D_8009B290 = 2;
gViConfigMode = osViModeNtscLan1;
break;
case 2:
D_8009B290 = 30;
gViConfigMode = osViModeMpalLan1;
break;
case 0:
D_8009B290 = 44;
gViConfigMode = osViModeFpalLan1;
gViConfigYScale = 0.833f;
break;
}
D_80096B20 = 1;
@@ -104,9 +105,12 @@ void Idle_ThreadEntry(void* arg) {
Idle_InitVideo();
osCreatePiManager(150, &gPiMgrCmdQ, sPiMgrCmdBuff, ARRAY_COUNT(sPiMgrCmdBuff));
StackCheck_Init(&sMainStackInfo, sMainStack, sMainStack + sizeof(sMainStack), 0, 1024, "main");
osCreateThread(&gMainThread, Z_THREAD_ID_MAIN, Main_ThreadEntry, arg, sMainStack + sizeof(sMainStack), Z_PRIORITY_MAIN);
osCreateThread(&gMainThread, Z_THREAD_ID_MAIN, Main_ThreadEntry, arg, sMainStack + sizeof(sMainStack),
Z_PRIORITY_MAIN);
osStartThread(&gMainThread);
osSetThreadPri(NULL, 0);
for(;;);
for (;;) {
;
}
}
+23 -21
View File
@@ -2,9 +2,9 @@
#include <global.h>
// TODO move out
#define OS_CLOCK_RATE 62500000LL
#define OS_CPU_COUNTER (OS_CLOCK_RATE*3/4)
#define OS_USEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625LL))/(1000000LL/15625LL))
#define OS_CLOCK_RATE 62500000LL
#define OS_CPU_COUNTER (OS_CLOCK_RATE * 3 / 4)
#define OS_USEC_TO_CYCLES(n) (((u64)(n) * (OS_CPU_COUNTER / 15625LL)) / (1000000LL / 15625LL))
vs32 gIrqMgrResetStatus = 0;
volatile OSTime sIrqMgrResetTime = 0;
@@ -122,7 +122,7 @@ void IrqMgr_HandleRetrace(IrqMgr* irqmgr) {
}
sIrqMgrRetraceCount += 1;
IrqMgr_SendMesgForClient(irqmgr,irqmgr);
IrqMgr_SendMesgForClient(irqmgr, irqmgr);
}
void IrqMgr_ThreadEntry(IrqMgr* irqmgr) {
@@ -132,25 +132,27 @@ void IrqMgr_ThreadEntry(IrqMgr* irqmgr) {
interrupt = 0;
stop = 0;
while (stop == 0) {
if (stop);
if (stop) {
;
}
osRecvMesg(&irqmgr->irqQueue, (OSMesg*)&interrupt, 1);
switch (interrupt) {
case 0x29A:
IrqMgr_HandleRetrace(irqmgr);
break;
case 0x29D:
IrqMgr_HandlePreNMI(irqmgr);
break;
case 0x29F:
IrqMgr_HandlePRENMI450(irqmgr);
break;
case 0x2A0:
IrqMgr_HandlePRENMI480(irqmgr);
break;
case 0x2A1:
IrqMgr_HandlePRENMI500(irqmgr);
break;
case 0x29A:
IrqMgr_HandleRetrace(irqmgr);
break;
case 0x29D:
IrqMgr_HandlePreNMI(irqmgr);
break;
case 0x29F:
IrqMgr_HandlePRENMI450(irqmgr);
break;
case 0x2A0:
IrqMgr_HandlePRENMI480(irqmgr);
break;
case 0x2A1:
IrqMgr_HandlePRENMI500(irqmgr);
break;
}
}
}
@@ -163,7 +165,7 @@ void IrqMgr_Init(IrqMgr* irqmgr, void* stack, OSPri pri, u8 retraceCount) {
irqmgr->prenmiStage = 0;
irqmgr->lastPrenmiTime = 0;
osCreateMesgQueue(&irqmgr->irqQueue,(OSMesg *)irqmgr->irqBuffer,8);
osCreateMesgQueue(&irqmgr->irqQueue, (OSMesg*)irqmgr->irqBuffer, 8);
osSetEventMesg(0xE, &irqmgr->irqQueue, (OSMesg)0x29D);
osViSetEvent(&irqmgr->irqQueue, (OSMesg)0x29A, retraceCount);
+9 -10
View File
@@ -4,16 +4,16 @@
void ViConfig_UpdateVi(u32 mode) {
if (mode != 0) {
switch (osTvType) {
case 2:
osViSetMode(&osViModeMpalLan1);
break;
case 0:
osViSetMode(&osViModePalLan1);
break;
case 1:
case 2:
osViSetMode(&osViModeMpalLan1);
break;
case 0:
osViSetMode(&osViModePalLan1);
break;
case 1:
default:
osViSetMode(&osViModeNtscLan1);
break;
osViSetMode(&osViModeNtscLan1);
break;
}
if (gViConfigFeatures != 0) {
@@ -46,7 +46,6 @@ void ViConfig_UpdateVi(u32 mode) {
gViConfigUseDefault = mode;
}
void ViConfig_UpdateBlack(void) {
if (gViConfigUseDefault != 0) {
osViBlack(1);
+2 -2
View File
@@ -60,9 +60,9 @@ void* Yaz0_NextDMA(void* curSrcPos) {
typedef struct {
/* 0x00 */ u32 magic; // Yaz0
/* 0x04 */ u32 decSize;
/* 0x08 */ u32 compInfoOffset; // only used in mio0
/* 0x08 */ u32 compInfoOffset; // only used in mio0
/* 0x0C */ u32 uncompDataOffset; // only used in mio0
} Yaz0Header; // size = 0x10
} Yaz0Header; // size = 0x10
#define YAZ0_MAGIC 0x59617A30 // "Yaz0"
+37 -26
View File
@@ -21,7 +21,9 @@ s32 DmaMgr_DMARomToRam(u32 rom, void* ram, u32 size) {
ioMsg.dramAddr = ram;
ioMsg.size = buffSize;
ret = osEPiStartDma(gCartHandle, &ioMsg, 0);
if (ret) goto END;
if (ret) {
goto END;
}
osRecvMesg(&queue, NULL, 1);
size -= buffSize;
@@ -35,7 +37,9 @@ s32 DmaMgr_DMARomToRam(u32 rom, void* ram, u32 size) {
ioMsg.dramAddr = ram;
ioMsg.size = (u32)size;
ret = osEPiStartDma(gCartHandle, &ioMsg, 0);
if (ret) goto END;
if (ret) {
goto END;
}
osRecvMesg(&queue, NULL, 1);
@@ -53,8 +57,12 @@ DmaEntry* DmaMgr_FindDmaEntry(u32 vrom) {
DmaEntry* curr;
for (curr = dmadata; curr->vromEnd != 0; curr++) {
if (vrom < curr->vromStart) continue;
if (vrom >= curr->vromEnd) continue;
if (vrom < curr->vromStart) {
continue;
}
if (vrom >= curr->vromEnd) {
continue;
}
return curr;
}
@@ -84,7 +92,7 @@ s32 DmaMgr_FindDmaIndex(u32 vrom) {
DmaEntry* entry = DmaMgr_FindDmaEntry(vrom);
if (entry != NULL) {
return entry - dmadata;
return entry - dmadata;
}
return -1;
@@ -149,17 +157,17 @@ void DmaMgr_ThreadEntry(void* a0) {
break;
}
req = (DmaRequest *)msg;
req = (DmaRequest*)msg;
DmaMgr_ProcessMsg(req);
if (req->notifyQueue) {
osSendMesg(req->notifyQueue, req->notifyMsg, OS_MESG_NOBLOCK);
}
}
}
s32 DmaMgr_SendRequestImpl(DmaRequest* request, void* vramStart, u32 vromStart, u32 size, UNK_TYPE4 unused, OSMesgQueue* queue, OSMesg msg) {
s32 DmaMgr_SendRequestImpl(DmaRequest* request, void* vramStart, u32 vromStart, u32 size, UNK_TYPE4 unused,
OSMesgQueue* queue, OSMesg msg) {
if (gIrqMgrResetStatus >= 2) {
return -2;
}
@@ -177,22 +185,22 @@ s32 DmaMgr_SendRequestImpl(DmaRequest* request, void* vramStart, u32 vromStart,
}
s32 DmaMgr_SendRequest0(void* vramStart, u32 vromStart, u32 size) {
DmaRequest req;
DmaRequest req;
OSMesgQueue queue;
OSMesg msg[1];
s32 ret;
s32 ret;
osCreateMesgQueue(&queue, msg, ARRAY_COUNT(msg));
ret = DmaMgr_SendRequestImpl(&req, vramStart, vromStart, size, 0, &queue, NULL);
ret = DmaMgr_SendRequestImpl(&req, vramStart, vromStart, size, 0, &queue, NULL);
if (ret == -1) {
return ret;
} else {
osRecvMesg(&queue, NULL, OS_MESG_BLOCK);
}
if (ret == -1) {
return ret;
} else {
osRecvMesg(&queue, NULL, OS_MESG_BLOCK);
}
return 0;
return 0;
}
const char dmamgrThreadName[] = "dmamgr";
@@ -200,19 +208,22 @@ const char dmamgrThreadName[] = "dmamgr";
#ifdef NON_MATCHING
// TODO missing a useless move initializing v0, and some reorderings
void DmaMgr_Start() {
DmaEntry* iter;
u32 idx;
DmaEntry* iter;
u32 idx;
DmaMgr_DMARomToRam((u32)_dmadataSegmentRomStart, dmadata, (u32)(_dmadataSegmentRomEnd - _dmadataSegmentRomStart));
DmaMgr_DMARomToRam((u32)_dmadataSegmentRomStart, dmadata, (u32)(_dmadataSegmentRomEnd - _dmadataSegmentRomStart));
for (iter = dmadata, idx = 0; iter->vromEnd != 0; iter++, idx++);
for (iter = dmadata, idx = 0; iter->vromEnd != 0; iter++, idx++) {
;
}
numDmaEntries = idx;
numDmaEntries = idx;
osCreateMesgQueue(&sDmaMgrMsgQueue, sDmaMgrMsgs, ARRAY_COUNT(sDmaMgrMsgs));
StackCheck_Init(&sDmaMgrStackInfo, sDmaMgrStack, sDmaMgrStack + sizeof(sDmaMgrStack), 0, 256, dmamgrThreadName);
osCreateThread(&sDmaMgrThread, Z_THREAD_ID_DMAMGR, DmaMgr_ThreadEntry, NULL, sDmaMgrStack + sizeof(sDmaMgrStack), Z_PRIORITY_DMAMGR);
osStartThread(&sDmaMgrThread);
osCreateMesgQueue(&sDmaMgrMsgQueue, sDmaMgrMsgs, ARRAY_COUNT(sDmaMgrMsgs));
StackCheck_Init(&sDmaMgrStackInfo, sDmaMgrStack, sDmaMgrStack + sizeof(sDmaMgrStack), 0, 256, dmamgrThreadName);
osCreateThread(&sDmaMgrThread, Z_THREAD_ID_DMAMGR, DmaMgr_ThreadEntry, NULL, sDmaMgrStack + sizeof(sDmaMgrStack),
Z_PRIORITY_DMAMGR);
osStartThread(&sDmaMgrThread);
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/boot/z_std_dma/DmaMgr_Start.asm")
+7 -7
View File
@@ -742,17 +742,17 @@ void Fault_SetOptionsFromController3(void) {
graphRA = graphOSThread.context.ra;
graphSP = graphOSThread.context.sp;
if (CHECK_BTN_ALL(input3->press.button, BTN_R)) {
faultCopyToLog = !faultCopyToLog;
FaultDrawer_SetOsSyncPrintfEnabled(faultCopyToLog);
faultCopyToLog = !faultCopyToLog;
FaultDrawer_SetOsSyncPrintfEnabled(faultCopyToLog);
}
if (CHECK_BTN_ALL(input3->press.button, BTN_A)) {
Fault_Log(D_80098A44, graphPC, graphRA, graphSP);
Fault_Log(D_80098A44, graphPC, graphRA, graphSP);
}
if (CHECK_BTN_ALL(input3->press.button, BTN_B)) {
FaultDrawer_SetDrawerFB(osViGetNextFramebuffer(), 0x140, 0xF0);
Fault_DrawRec(0, 0xD7, 0x140, 9, 1);
FaultDrawer_SetCharPad(-2, 0);
FaultDrawer_DrawText(0x20, 0xD8, D_80098A68, graphPC, graphRA, graphSP);
FaultDrawer_SetDrawerFB(osViGetNextFramebuffer(), 0x140, 0xF0);
Fault_DrawRec(0, 0xD7, 0x140, 9, 1);
FaultDrawer_SetCharPad(-2, 0);
FaultDrawer_DrawText(0x20, 0xD8, D_80098A68, graphPC, graphRA, graphSP);
}
}
}
+10 -8
View File
@@ -19,7 +19,8 @@ FaultDrawer sFaultDrawerDefault = {
8, // charH
0, // charWPad
0, // charHPad
{ // printColors
{
// printColors
GPACK_RGBA5551(0, 0, 0, 1),
GPACK_RGBA5551(255, 0, 0, 1),
GPACK_RGBA5551(0, 255, 0, 1),
@@ -40,7 +41,6 @@ void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) {
sFaultDrawContext->osSyncPrintfEnabled = enabled;
}
void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 color) {
u16* fb;
s32 x, y;
@@ -110,7 +110,7 @@ void FaultDrawer_SetBackColor(u16 color) {
}
void FaultDrawer_SetFontColor(u16 color) {
FaultDrawer_SetForeColor(color | 1); //force alpha to be set
FaultDrawer_SetForeColor(color | 1); // force alpha to be set
}
void FaultDrawer_SetCharPad(s8 padW, s8 padH) {
@@ -120,7 +120,9 @@ void FaultDrawer_SetCharPad(s8 padW, s8 padH) {
void FaultDrawer_SetCursor(s32 x, s32 y) {
if (sFaultDrawContext->osSyncPrintfEnabled) {
Fault_Log(D_80099064, (y - sFaultDrawContext->yStart) / (sFaultDrawContext->charH + sFaultDrawContext->charHPad), (x - sFaultDrawContext->xStart) / (sFaultDrawContext->charW + sFaultDrawContext->charWPad));
Fault_Log(D_80099064,
(y - sFaultDrawContext->yStart) / (sFaultDrawContext->charH + sFaultDrawContext->charHPad),
(x - sFaultDrawContext->xStart) / (sFaultDrawContext->charW + sFaultDrawContext->charWPad));
}
sFaultDrawContext->cursorX = x;
sFaultDrawContext->cursorY = y;
@@ -131,13 +133,14 @@ void FaultDrawer_FillScreen() {
Fault_Log(D_80099070);
}
FaultDrawer_DrawRecImpl(sFaultDrawContext->xStart, sFaultDrawContext->yStart, sFaultDrawContext->xEnd, sFaultDrawContext->yEnd, sFaultDrawContext->backColor | 1);
FaultDrawer_DrawRecImpl(sFaultDrawContext->xStart, sFaultDrawContext->yStart, sFaultDrawContext->xEnd,
sFaultDrawContext->yEnd, sFaultDrawContext->backColor | 1);
FaultDrawer_SetCursor(sFaultDrawContext->xStart, sFaultDrawContext->yStart);
}
#pragma GLOBAL_ASM("./asm/non_matchings/boot/fault_drawer/FaultDrawer_FormatStringFunc.asm")
void FaultDrawer_VPrintf(char* str, char* args) { //va_list
void FaultDrawer_VPrintf(char* str, char* args) { // va_list
_Printf((printf_func)FaultDrawer_FormatStringFunc, sFaultDrawContext, str, args);
}
@@ -162,7 +165,7 @@ void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h) {
sFaultDrawContext->h = h;
}
void FaultDrawer_SetInputCallback(void(*callback)()) {
void FaultDrawer_SetInputCallback(void (*callback)()) {
sFaultDrawContext->inputCallback = callback;
}
@@ -171,4 +174,3 @@ void FaultDrawer_Init() {
bcopy(&sFaultDrawerDefault, sFaultDrawContext, sizeof(FaultDrawer));
sFaultDrawContext->fb = (u16*)((osMemSize | 0x80000000) - 0x25800);
}
+1 -1
View File
@@ -27,7 +27,7 @@ void EnAObj_Update1(ActorEnAObj* this, GlobalContext* ctxt) {
this->update = (ActorFunc)EnAObj_Update2;
} else {
v0 = this->base.yawTowardsPlayer - this->base.shape.rot.y;
v1 = (v0 < 0)? -v0 : v0;
v1 = (v0 < 0) ? -v0 : v0;
if ((v1 < 10240) || ((this->base.params == 1) && (v1 > 22528))) {
func_800B863C((Actor*)this, ctxt);
}
+45 -46
View File
@@ -128,51 +128,51 @@ void Effect_Add(GlobalContext* ctxt, s32* index, s32 type, u8 param_4, u8 param_
if (func_8016A01C(ctxt) != 1) {
slotFound = 0;
switch (type) {
case 0:
for (i = 0; i < 3; i++) {
if (sEffTable.sparks[i].base.active == 0) {
slotFound = 1;
*index = i;
params = &sEffTable.sparks[i].params;
common = &sEffTable.sparks[i].base;
break;
case 0:
for (i = 0; i < 3; i++) {
if (sEffTable.sparks[i].base.active == 0) {
slotFound = 1;
*index = i;
params = &sEffTable.sparks[i].params;
common = &sEffTable.sparks[i].base;
break;
}
}
}
break;
case 1:
case 2:
for (i = 0; i < 25; i++) {
if (sEffTable.blures[i].base.active == 0) {
slotFound = 1;
*index = i + 3;
params = &sEffTable.blures[i].params;
common = &sEffTable.blures[i].base;
break;
break;
case 1:
case 2:
for (i = 0; i < 25; i++) {
if (sEffTable.blures[i].base.active == 0) {
slotFound = 1;
*index = i + 3;
params = &sEffTable.blures[i].params;
common = &sEffTable.blures[i].base;
break;
}
}
}
break;
case 3:
for (i = 0; i < 3; i++) {
if (sEffTable.shieldParticles[i].base.active == 0) {
slotFound = 1;
*index = i + 28;
params = &sEffTable.shieldParticles[i].params;
common = &sEffTable.shieldParticles[i].base;
break;
break;
case 3:
for (i = 0; i < 3; i++) {
if (sEffTable.shieldParticles[i].base.active == 0) {
slotFound = 1;
*index = i + 28;
params = &sEffTable.shieldParticles[i].params;
common = &sEffTable.shieldParticles[i].base;
break;
}
}
}
break;
case 4:
for (i = 0; i < 15; i++) {
if (sEffTable.tireMarks[i].base.active == 0) {
slotFound = 1;
*index = i + 31;
params = &sEffTable.tireMarks[i].params;
common = &sEffTable.tireMarks[i].base;
break;
break;
case 4:
for (i = 0; i < 15; i++) {
if (sEffTable.tireMarks[i].base.active == 0) {
slotFound = 1;
*index = i + 31;
params = &sEffTable.tireMarks[i].params;
common = &sEffTable.tireMarks[i].base;
break;
}
}
}
break;
break;
}
if (slotFound) {
@@ -264,28 +264,28 @@ void Effect_Destroy(GlobalContext* ctxt, s32 index) {
}
if (index < 3) {
sEffTable.sparks[index].base.active = 0 ;
sEffTable.sparks[index].base.active = 0;
sEffInfoTable[0].destroy(&sEffTable.sparks[index].params);
return;
}
index -= 3;
if (index < 25) {
sEffTable.blures[index].base.active = 0 ;
sEffTable.blures[index].base.active = 0;
sEffInfoTable[1].destroy(&sEffTable.blures[index].params);
return;
}
index -= 25;
if (index < 3) {
sEffTable.shieldParticles[index].base.active = 0 ;
sEffTable.shieldParticles[index].base.active = 0;
sEffInfoTable[3].destroy(&sEffTable.shieldParticles[index].params);
return;
}
index -= 3;
if (index < 15) {
sEffTable.tireMarks[index].base.active = 0 ;
sEffTable.tireMarks[index].base.active = 0;
sEffInfoTable[4].destroy(&sEffTable.tireMarks[index].params);
return;
}
@@ -314,4 +314,3 @@ void Effect_DestroyAll(GlobalContext* ctxt) {
sEffInfoTable[4].destroy(&sEffTable.tireMarks[i].params);
}
}

Some files were not shown because too many files have changed in this diff Show More