diff --git a/src/game/credits.c b/src/game/credits.c index df3b17ac2..c93a2a198 100644 --- a/src/game/credits.c +++ b/src/game/credits.c @@ -17,6 +17,7 @@ #include "game/credits.h" #include "game/game_1531a0.h" #include "game/game_166e40.h" +#include "game/gfxmemory.h" #include "game/core.h" #include "game/music.h" #include "game/lang.h" @@ -352,7 +353,7 @@ u32 var8007f6cc = 0x41400000; u32 var8007f6d0 = 0x41800000; u32 var8007f6d4 = 0x00000000; u32 var8007f6d8 = 0x0000ffff; -u32 var8007f6dc = 0x00000000; +u32 var8007f6dc = 0; GLOBAL_ASM( glabel func0f1371b0 @@ -1284,7 +1285,7 @@ glabel func0f137ea8 ); GLOBAL_ASM( -glabel func0f137f24 +glabel creditsRenderBackground .late_rodata glabel var7f1b57f4 .word 0x3e4ccccd @@ -2671,7 +2672,7 @@ glabel var7f1b5844 ); GLOBAL_ASM( -glabel func0f139290 +glabel creditsRenderSprites .late_rodata glabel var7f1b5848 .word 0xc58ca000 @@ -4696,7 +4697,7 @@ glabel func0f13ae04 ); GLOBAL_ASM( -glabel func0f13ae0c +glabel creditsTick .late_rodata glabel var7f1b5930 .word 0x3c23d70a @@ -4926,7 +4927,7 @@ glabel var7f1b5948 /* f13b110: 318d0fff */ andi $t5,$t4,0xfff /* f13b114: 000d7300 */ sll $t6,$t5,0xc /* f13b118: 012e7825 */ or $t7,$t1,$t6 -/* f13b11c: 0fc4eb83 */ jal func0f13ae0c +/* f13b11c: 0fc4eb83 */ jal creditsTick /* f13b120: af0f0004 */ sw $t7,0x4($t8) /* f13b124: 3c07800a */ lui $a3,%hi(g_CreditsData) /* f13b128: 24e74170 */ addiu $a3,$a3,%lo(g_CreditsData) @@ -5077,9 +5078,9 @@ glabel var7f1b5948 /* f13b358: e7a00060 */ swc1 $f0,0x60($sp) /* f13b35c: e7a6004c */ swc1 $f6,0x4c($sp) /* f13b360: e7b20050 */ swc1 $f18,0x50($sp) -/* f13b364: 0fc4dfc9 */ jal func0f137f24 +/* f13b364: 0fc4dfc9 */ jal creditsRenderBackground /* f13b368: e7a40054 */ swc1 $f4,0x54($sp) -/* f13b36c: 0fc4e4a4 */ jal func0f139290 +/* f13b36c: 0fc4e4a4 */ jal creditsRenderSprites /* f13b370: 00402025 */ or $a0,$v0,$zero /* f13b374: 3c07800a */ lui $a3,%hi(g_CreditsData) /* f13b378: 24e74170 */ addiu $a3,$a3,%lo(g_CreditsData) @@ -5173,6 +5174,121 @@ glabel var7f1b5948 /* f13b4c0: 27bd00a8 */ addiu $sp,$sp,0xa8 ); +// Mismatch: Come back to to this when more is known about these symbols +//Gfx *creditsRender(Gfx *gdl) +//{ +// Mtxf sp68; +// Mtxf *matrix = gfxAllocateMatrix(); +// volatile struct coord sp58; +// volatile struct coord sp4c; +// +// func0f1531dc(false); +// +// g_ScreenWidthMultiplier = 1; +// +// gdl = func0000b280(gdl); +// gdl = func0000b1d0(gdl); +// gdl = func0f1384b4(gdl, 0xff); +// +// gDPSetScissorFrac(gdl++, G_SC_NON_INTERLACE, 0, 120, viGetX() * 4.0f, (viGetY() - 30) * 4.0f); +// +// creditsTick(); +// +// if (g_CreditsData->unk41f4 || g_CreditsData->unk4204 < 60 || g_CreditsData->unk4204 > 1200) { +// if (g_CreditsData->unk41f4 == 0 && g_CreditsData->unk4204 > 1200) { +// if (var8007f130 == 0) { +// var8007f130 = 1; +// var8007f6dc = 0; +// +// func0f0f37a4(&g_CreditsData->unk2ef0); +// } +// +// var8007f6dc += g_Vars.diffframe240; +// +// if (var8007f6dc > 14400) { +// var8007f6dc = 0; +// } +// +// g_CreditsData->unk343c = 0; +// g_CreditsData->unk3414 = 0; +// g_CreditsData->unk3438 = -0.26175770163536; +// g_CreditsData->unk3410 = g_CreditsData->unk3438; +// g_CreditsData->unk3428 = 833.0f - (var8007f6dc / 14400.0f) * 2413.0f; +// g_CreditsData->unk3440 = 0; +// g_CreditsData->unk3418 = g_CreditsData->unk3440; +// g_CreditsData->unk342c = 70.86; +// g_CreditsData->unk3430 = -2050; +// g_CreditsData->unk3434 = 1.467; +// +// g_CreditsData->unk2efc = 1200; +// g_CreditsData->unk34a1 |= 0x02; +// g_CreditsData->unk34a4 = 0; +// +// gdl = func0f0f38b0(gdl, &g_CreditsData->unk2ef0, 4); +// +// gSPMatrix(gdl++, osVirtualToPhysical(matrix), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); +// +// gdl = func0f1384b4(gdl, 0xd8); +// } +// +// func000159b0(&sp68); +// func00016054(&sp68, matrix); +// currentPlayerSetMatrix1740(&sp68); +// +// gSPMatrix(gdl++, osVirtualToPhysical(matrix), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); +// +// sp58.x = -1000; +// sp58.y = -1000; +// sp58.z = -1000; +// +// sp4c.x = 0; +// sp4c.y = 0; +// sp4c.z = -100; +// +// gdl = creditsRenderBackground(gdl); +// gdl = creditsRenderSprites(gdl); +// +// if (g_CreditsData->unk41f4) { +// // Render text +// gdl = func0f0d479c(gdl); +// gdl = func0f13a3ec(gdl); +// } +// +// if (g_CreditsData->unk41f4 == 0) { +// u32 uVar1 = g_CreditsData->unk4204; +// u32 uVar11 = 0; +// +// if (uVar1 < 60) { +// uVar11 = (uVar1 * 0xff) / 60; +// } +// +// if (uVar1 > 1200 && uVar1 < 1260) { +// uVar11 = 0xff - ((uVar1 - 1200) * 0xff) / 60; +// } +// +// if (uVar11) { +// gdl = func0f1384b4(gdl, uVar11); +// } +// } +// } +// +// if (var8007f138 && contGetButtonsPressedThisFrame(0, 0xffcf)) { +// g_TitleNextStage = STAGE_CITRAINING; +// +// setNumPlayers(1); +// mainSetStageNum(g_TitleNextStage); +// +// g_Vars.bondplayernum = 0; +// g_Vars.coopplayernum = -1; +// g_Vars.antiplayernum = -1; +// +// coreSetDifficulty(DIFF_A); +// func00009ec4(1); +// } +// +// return gdl; +//} + void creditsInit(void) { var800a4164 = 0; diff --git a/src/include/game/credits.h b/src/include/game/credits.h index 6bb4dd1db..4a522b149 100644 --- a/src/include/game/credits.h +++ b/src/include/game/credits.h @@ -8,22 +8,22 @@ u32 func0f1377d0(void); u32 func0f137874(void); u32 func0f137b4c(void); void func0f137ea8(s32 arg0, s32 arg1, s32 arg2); -u32 func0f137f24(void); +Gfx *creditsRenderBackground(Gfx *gdl); u32 func0f1382e0(void); void func0f13838c(s32 arg0); -u32 func0f1384b4(void); +Gfx *func0f1384b4(Gfx *gdl, u32 arg1); u32 func0f13870c(void); u32 func0f13899c(void); u32 func0f138e6c(void); -u32 func0f139290(void); +Gfx *creditsRenderSprites(Gfx *gdl); u32 func0f1399d0(void); u32 func0f139d9c(void); u32 func0f139fe0(void); u32 func0f13a0e4(void); u32 func0f13a164(void); -u32 func0f13a3ec(void); +Gfx *func0f13a3ec(Gfx *gdl); u32 func0f13ae04(void); -u32 func0f13ae0c(void); +void creditsTick(void); Gfx *creditsRender(Gfx *gdl); void creditsInit(void); void func0f13b660(void); @@ -3364,19 +3364,19 @@ struct creditsdata { /*0x3404*/ f32 unk3404; /*0x3408*/ u32 unk3408; /*0x340c*/ f32 unk340c; - /*0x3410*/ u32 unk3410; + /*0x3410*/ f32 unk3410; /*0x3414*/ f32 unk3414; - /*0x3418*/ u32 unk3418; + /*0x3418*/ f32 unk3418; /*0x341c*/ u32 unk341c; /*0x3420*/ u32 unk3420; /*0x3424*/ u32 unk3424; - /*0x3428*/ u32 unk3428; + /*0x3428*/ f32 unk3428; /*0x342c*/ f32 unk342c; - /*0x3430*/ u32 unk3430; - /*0x3434*/ u32 unk3434; - /*0x3438*/ u32 unk3438; + /*0x3430*/ f32 unk3430; + /*0x3434*/ f32 unk3434; + /*0x3438*/ f32 unk3438; /*0x343c*/ f32 unk343c; - /*0x3440*/ u32 unk3440; + /*0x3440*/ f32 unk3440; /*0x3444*/ u32 unk3444; /*0x3448*/ u32 unk3448; /*0x344c*/ u32 unk344c; @@ -3400,7 +3400,8 @@ struct creditsdata { /*0x3494*/ u32 unk3494; /*0x3498*/ u32 unk3498; /*0x349c*/ u32 unk349c; - /*0x34a0*/ u32 unk34a0; + /*0x34a0*/ u8 unk34a0; + /*0x34a1*/ u8 unk34a1; // flags? /*0x34a4*/ u32 unk34a4; /*0x34a8*/ u32 unk34a8; /*0x34ac*/ u32 unk34ac; diff --git a/src/include/game/game_0f09f0.h b/src/include/game/game_0f09f0.h index 09989548a..d377416c8 100644 --- a/src/include/game/game_0f09f0.h +++ b/src/include/game/game_0f09f0.h @@ -45,7 +45,7 @@ void menuPopDialog(void); void func0f0f3704(struct menudialog *dialog); void func0f0f372c(u8 *arg0, f32 x, f32 y, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, s32 arg8); void func0f0f37a4(u8 *arg0); -u32 func0f0f38b0(void); +Gfx *func0f0f38b0(Gfx *gdl, u8 *arg1, u32 arg2); u32 func0f0f5004(void); Gfx *func0f0f50fc(Gfx *gdl); u32 func0f0f5360(void); diff --git a/src/include/lib/lib_159b0.h b/src/include/lib/lib_159b0.h index aec1431ea..8cd5612bd 100644 --- a/src/include/lib/lib_159b0.h +++ b/src/include/lib/lib_159b0.h @@ -27,6 +27,6 @@ void func00015f04(f32 scale, Mtxf *arg1); u32 func00015f4c(void); u32 func00015f88(void); u32 func00015fd0(void); -void func00016054(f32 *matrix, f32 *arg1); +void func00016054(Mtxf *matrix, Mtxf *arg1); #endif