mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
More warning fixes, and a few hardcoded values using the proper defines
This commit is contained in:
+4
-4
@@ -125,7 +125,7 @@ void thread0_Main(s32 arg0) { // Has regalloc issues
|
||||
|
||||
while (1) {
|
||||
while (1) {
|
||||
osRecvMesg(&D_80129790, &sp34, 1);
|
||||
osRecvMesg(&D_80129790, &sp34, OS_MESG_BLOCK);
|
||||
if (!(get_filtered_cheats() & CHEAT_EPC_LOCK_UP_DISPLAY)) {
|
||||
continue;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ void func_800B7144(void) {
|
||||
OSThread *node = __osGetActiveQueue();
|
||||
while (node->priority != -1) {
|
||||
if ((node->priority > 0) && (node->priority < 128)) {
|
||||
osStopThread(&node->next);
|
||||
osStopThread((OSThread *)&node->next);
|
||||
}
|
||||
node = node->tlnext;
|
||||
}
|
||||
@@ -218,7 +218,7 @@ s32 func_800B76DC(void) {
|
||||
s32 controllerIndex = 0;
|
||||
u8 *sp420[256];
|
||||
u8 *sp220[128];
|
||||
u8 *dataFromControllerPak[128];
|
||||
u8 dataFromControllerPak[512];
|
||||
|
||||
if (D_800E3020 != -1) {
|
||||
return D_800E3020;
|
||||
@@ -226,7 +226,7 @@ s32 func_800B76DC(void) {
|
||||
D_800E3020 = 0;
|
||||
if ((func_800758DC(controllerIndex) == 0) && //Rumble pack check?
|
||||
(func_800764E8(controllerIndex, &D_800E8EF4, &D_800E8EFC, &fileNum) == 0) &&
|
||||
(read_data_from_controller_pak(controllerIndex, fileNum, &dataFromControllerPak,
|
||||
(read_data_from_controller_pak(controllerIndex, fileNum, (u8 *)&dataFromControllerPak,
|
||||
sizeof(dataFromControllerPak) * MAXCONTROLLERS) == 0)) {
|
||||
bcopy(&dataFromControllerPak, &gEpcInfo, sizeof(dataFromControllerPak) - 80); //Why less 80 (0x50)?
|
||||
bcopy(&sp220, &D_801299B0, sizeof(sp220));
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ void thread30(void *arg) {
|
||||
while (TRUE) {
|
||||
// Wait for a signal from the main thread
|
||||
do {
|
||||
osRecvMesg(&gThread30MesgQueue, &mesg, 1);
|
||||
osRecvMesg(&gThread30MesgQueue, &mesg, OS_MESG_BLOCK);
|
||||
} while (mesg != (OSMesg)OS_MESG_TYPE_LOOPBACK);
|
||||
// -1 means there won't be any racers loaded.
|
||||
load_level_for_menu(gThread30LevelIdToLoad, -1, gThread30CutsceneIdToLoad);
|
||||
|
||||
@@ -1773,7 +1773,7 @@ s8 func_8006EAB0(void) {
|
||||
|
||||
s32 func_8006EAC0(void) {
|
||||
if (D_80123560[0] == 0) {
|
||||
D_80123560[0] = (s32)((osRecvMesg(&D_80123548, NULL, 0) + 1) != 0);
|
||||
D_80123560[0] = (s32)((osRecvMesg(&D_80123548, NULL, OS_MESG_NOBLOCK) + 1) != 0);
|
||||
}
|
||||
return D_80123560[0];
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ s32 func_80077A54(void) {
|
||||
if (D_800DE4DC == 0) {
|
||||
return 0;
|
||||
}
|
||||
osRecvMesg(&D_80125ED8, &sp1C, 1);
|
||||
osRecvMesg(&D_80125ED8, &sp1C, OS_MESG_BLOCK);
|
||||
D_800DE4DC = 0;
|
||||
return sp1C[1];
|
||||
}
|
||||
@@ -314,7 +314,7 @@ void func_800787F0(void) {
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/unknown_078050/func_800787FC.s")
|
||||
|
||||
void func_80078AAC(u32 arg0) {
|
||||
void func_80078AAC(void *arg0) {
|
||||
D_800DE4D0.ptr = arg0;
|
||||
}
|
||||
|
||||
|
||||
+9
-7
@@ -208,19 +208,21 @@ void init_framebuffer(s32 index) {
|
||||
}
|
||||
gVideoFbWidths[index] = gVideoModeResolutions[gVideoModeIndex & 7].width;
|
||||
gVideoFbHeights[index] = gVideoModeResolutions[gVideoModeIndex & 7].height;
|
||||
// TODO: All of the gVideoFramebuffers values are suspicious and probably not the right code.
|
||||
// The 0x3F is coincidentally sizeof(gVideoModeResolutions) - 1, but that might just be a coincidence
|
||||
if (gVideoModeIndex >= 2) {
|
||||
gVideoFramebuffers[index] = allocate_from_main_pool_safe((HIGH_RES_SCREEN_WIDTH * HIGH_RES_SCREEN_HEIGHT * 2) + 0x30, COLOR_TAG_WHITE);
|
||||
gVideoFramebuffers[index] = ((s32)gVideoFramebuffers[index] + 0x3F) & ~0x3F;
|
||||
gVideoFramebuffers[index] = (u16 *)(((s32)gVideoFramebuffers[index] + 0x3F) & ~0x3F);
|
||||
if (gVideoDepthBuffer == NULL) {
|
||||
gVideoDepthBuffer = allocate_from_main_pool_safe((HIGH_RES_SCREEN_WIDTH * HIGH_RES_SCREEN_HEIGHT * 2) + 0x30, COLOR_TAG_WHITE);
|
||||
gVideoDepthBuffer = ((s32)gVideoDepthBuffer + 0x3F) & ~0x3F;
|
||||
gVideoDepthBuffer = (u16 *)(((s32)gVideoDepthBuffer + 0x3F) & ~0x3F);
|
||||
}
|
||||
} else {
|
||||
gVideoFramebuffers[index] = allocate_from_main_pool_safe((gVideoFbWidths[index] * gVideoFbHeights[index] * 2) + 0x30, COLOR_TAG_WHITE);
|
||||
gVideoFramebuffers[index] = ((s32)gVideoFramebuffers[index] + 0x3F) & ~0x3F;
|
||||
gVideoFramebuffers[index] = (u16 *)(((s32)gVideoFramebuffers[index] + 0x3F) & ~0x3F);
|
||||
if (gVideoDepthBuffer == NULL) {
|
||||
gVideoDepthBuffer = allocate_from_main_pool_safe((gVideoFbWidths[index] * gVideoFbHeights[index] * 2) + 0x30, COLOR_TAG_WHITE);
|
||||
gVideoDepthBuffer = ((s32)gVideoDepthBuffer + 0x3F) & ~0x3F;
|
||||
gVideoDepthBuffer = (u16 *)(((s32)gVideoDepthBuffer + 0x3F) & ~0x3F);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -245,7 +247,7 @@ s32 func_8007A98C(s32 arg0) {
|
||||
if (arg0 != 8) {
|
||||
swap_framebuffers();
|
||||
}
|
||||
while (osRecvMesg(&D_801261A0, NULL, 0) != -1) {
|
||||
while (osRecvMesg(&D_801261A0, NULL, OS_MESG_NOBLOCK) != -1) {
|
||||
s0 += 1;
|
||||
s0 &= 0xFF;
|
||||
}
|
||||
@@ -265,12 +267,12 @@ s32 func_8007A98C(s32 arg0) {
|
||||
}
|
||||
}
|
||||
while (s0 < D_80126309) {
|
||||
osRecvMesg(&D_801261A0, NULL, 1);
|
||||
osRecvMesg(&D_801261A0, NULL, OS_MESG_BLOCK);
|
||||
s0 += 1;
|
||||
s0 &= 0xFF;
|
||||
}
|
||||
osViSwapBuffer(gVideoLastFramebuffer);
|
||||
osRecvMesg(&D_801261A0, NULL, 1);
|
||||
osRecvMesg(&D_801261A0, NULL, OS_MESG_BLOCK);
|
||||
return s0;
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user