Match bss in podium ceremony (#403)

This commit is contained in:
MegaMech 2023-09-07 11:44:13 -06:00 committed by GitHub
parent cef186304e
commit bba223ffa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 103 additions and 233 deletions

View File

@ -1,152 +0,0 @@
.include "macros.inc"
.section .bss
glabel D_802874A0
.skip 30
glabel D_802874BE
.skip 6
glabel D_802874C4
.skip 2
glabel D_802874C6
.skip 2
glabel D_802874C8
.skip 2
glabel D_802874CA
.skip 6
glabel D_802874D0
.skip 4
glabel D_802874D4
.skip 4
glabel D_802874D8
.skip 8
glabel sActorTimer
.skip 20
glabel D_802874F4
.skip 1
glabel D_802874F5
.skip 1
glabel D_802874F6
.skip 2
glabel sPodiumActorList
.skip 4
glabel D_802874FC
.skip 4
#glabel D_80287500
#.skip 64
#glabel D_80287540
#.skip 16
#glabel gMenuSelectionFromEndingSequence
#.skip 4
#glabel D_80287554
#.skip 12
#glabel D_80287560 80281C40.c
#.skip 368
#glabel sCutsceneShot # Begin 80281fa0.c
#.skip 2
#glabel gCutsceneShotTimer
#.skip 2
#glabel D_802876D4
#.skip 4
#glabel D_802876D8
#.skip 8
#glabel D_802876E0
#.skip 12
#glabel D_802876EC
#.skip 12
#glabel D_802876F8
#.skip 4
#glabel D_802876FC
#.skip 4
#glabel D_80287700
#.skip 4
#glabel D_80287704
#.skip 12
#glabel D_80287710
#.skip 12
#glabel D_8028771C
#.skip 12
#glabel D_80287728
#.skip 6
#glabel D_8028772E
#.skip 6
#glabel D_80287734
#.skip 6
#glabel D_8028773A
#.skip 6
#glabel D_80287740
#.skip 4
#glabel D_80287744
#.skip 4
#glabel D_80287748
#.skip 4
#glabel D_8028774C
#.skip 2
#glabel D_8028774E
#.skip 2
#glabel D_80287750
#.skip 12
#glabel D_8028775C # Compiler Generated
#.skip 188
#glabel D_80287818
#.skip 12
#glabel D_80287824 # compiler Gen
#.skip 372
#glabel D_80287998
#.skip 384
#glabel D_80287B18
#.skip 4
#glabel D_80287B1C
#.skip 2
#glabel D_80287B1E
#.skip 2
#glabel D_80287B20

View File

@ -29,10 +29,10 @@ glabel func_8001C14C
/* 01CDB4 8001C1B4 56D90015 */ bnel $s6, $t9, .L8001C20C
/* 01CDB8 8001C1B8 3C013FF0 */ lui $at, 0x3ff0
/* 01CDBC 8001C1BC 95083E2C */ lhu $t0, %lo(D_80163E2C)($t0)
/* 01CDC0 8001C1C0 3C098028 */ lui $t1, %hi(D_802874F5) # $t1, 0x8028
/* 01CDC0 8001C1C0 3C098028 */ lui $t1, %hi(D_802874D8+0x1D) # $t1, 0x8028
/* 01CDC4 8001C1C4 55000011 */ bnel $t0, $zero, .L8001C20C
/* 01CDC8 8001C1C8 3C013FF0 */ lui $at, 0x3ff0
/* 01CDCC 8001C1CC 812974F5 */ lb $t1, %lo(D_802874F5)($t1)
/* 01CDCC 8001C1CC 812974F5 */ lb $t1, %lo(D_802874D8+0x1D)($t1)
/* 01CDD0 8001C1D0 3C1E8016 */ lui $fp, %hi(D_80163484) # $fp, 0x8016
/* 01CDD4 8001C1D4 27DE3484 */ addiu $fp, %lo(D_80163484) # addiu $fp, $fp, 0x3484
/* 01CDD8 8001C1D8 29210003 */ slti $at, $t1, 3

View File

@ -10,8 +10,8 @@ glabel func_80086604
/* 087224 80086624 AFB10018 */ sw $s1, 0x18($sp)
/* 087228 80086628 11C00016 */ beqz $t6, .L80086684
/* 08722C 8008662C AFB00014 */ sw $s0, 0x14($sp)
/* 087230 80086630 3C0F8028 */ lui $t7, %hi(D_802874F5) # $t7, 0x8028
/* 087234 80086634 81EF74F5 */ lb $t7, %lo(D_802874F5)($t7)
/* 087230 80086630 3C0F8028 */ lui $t7, %hi(D_802874D8+0x1D) # $t7, 0x8028
/* 087234 80086634 81EF74F5 */ lb $t7, %lo(D_802874D8+0x1D)($t7)
/* 087238 80086638 3C138016 */ lui $s3, %hi(D_801658C6) # $s3, 0x8016
/* 08723C 8008663C 267358C6 */ addiu $s3, %lo(D_801658C6) # addiu $s3, $s3, 0x58c6
/* 087240 80086640 29E10003 */ slti $at, $t7, 3

View File

@ -80,10 +80,10 @@ glabel L80086A18
/* 08763C 80086A3C 44818000 */ mtc1 $at, $f16
/* 087640 80086A40 3C014270 */ li $at, 0x42700000 # 60.000000
/* 087644 80086A44 44819000 */ mtc1 $at, $f18
/* 087648 80086A48 3C028028 */ lui $v0, %hi(D_802874F5) # $v0, 0x8028
/* 087648 80086A48 3C028028 */ lui $v0, %hi(D_802874D8+0x1D) # $v0, 0x8028
/* 08764C 80086A4C E6100014 */ swc1 $f16, 0x14($s0)
/* 087650 80086A50 E612002C */ swc1 $f18, 0x2c($s0)
/* 087654 80086A54 804274F5 */ lb $v0, %lo(D_802874F5)($v0)
/* 087654 80086A54 804274F5 */ lb $v0, %lo(D_802874D8+0x1D)($v0)
/* 087658 80086A58 24010001 */ li $at, 1
/* 08765C 80086A5C 10410005 */ beq $v0, $at, .L80086A74
/* 087660 80086A60 24010002 */ li $at, 2

View File

@ -38,14 +38,14 @@ glabel func_8009CE64
/* 09DA88 8009CE88 24060002 */ li $a2, 2
/* 09DA8C 8009CE8C 24070003 */ li $a3, 3
/* 09DA90 8009CE90 10660006 */ beq $v1, $a2, .L8009CEAC
/* 09DA94 8009CE94 3C0E8028 */ lui $t6, %hi(D_802874F5) # $t6, 0x8028
/* 09DA94 8009CE94 3C0E8028 */ lui $t6, %hi(D_802874D8+0x1D) # $t6, 0x8028
/* 09DA98 8009CE98 24070003 */ li $a3, 3
/* 09DA9C 8009CE9C 10670003 */ beq $v1, $a3, .L8009CEAC
/* 09DAA0 8009CEA0 00000000 */ nop
/* 09DAA4 8009CEA4 1000000B */ b .L8009CED4
/* 09DAA8 8009CEA8 00000000 */ nop
.L8009CEAC:
/* 09DAAC 8009CEAC 81CE74F5 */ lb $t6, %lo(D_802874F5)($t6)
/* 09DAAC 8009CEAC 81CE74F5 */ lb $t6, %lo(D_802874D8+0x1D)($t6)
/* 09DAB0 8009CEB0 3C028019 */ lui $v0, %hi(gCupSelection) # $v0, 0x8019
/* 09DAB4 8009CEB4 2442EE09 */ addiu $v0, %lo(gCupSelection) # addiu $v0, $v0, -0x11f7
/* 09DAB8 8009CEB8 29C10003 */ slti $at, $t6, 3

View File

@ -1410,10 +1410,10 @@ glabel L800A083C
/* 0A1448 800A0848 8FBF0034 */ lw $ra, 0x34($sp)
glabel L800A084C
/* 0A144C 800A084C 8E2F0004 */ lw $t7, 4($s1)
/* 0A1450 800A0850 3C188028 */ lui $t8, %hi(D_802874F6) # $t8, 0x8028
/* 0A1450 800A0850 3C188028 */ lui $t8, %hi(D_802874D8+0x1E) # $t8, 0x8028
/* 0A1454 800A0854 51E0001C */ beql $t7, $zero, .L800A08C8
/* 0A1458 800A0858 8FBF0034 */ lw $ra, 0x34($sp)
/* 0A145C 800A085C 831874F6 */ lb $t8, %lo(D_802874F6)($t8)
/* 0A145C 800A085C 831874F6 */ lb $t8, %lo(D_802874D8+0x1E)($t8)
/* 0A1460 800A0860 3C06800F */ lui $a2, %hi(D_800EFD64) # 0x800f
/* 0A1464 800A0864 3C04800E */ lui $a0, %hi(D_800E7D54)
/* 0A1468 800A0868 00D83021 */ addu $a2, $a2, $t8

View File

@ -377,12 +377,6 @@ typedef struct {
/* 0x0DD4 */ // s16 unk_DD4;
} Player; // size = 0xDD8
typedef struct {
/* 0x00 */ char unk_00[0x1D];
/* 0x1D */ s8 unk_1D;
/* 0x1E */ s8 unk_1E;
} struct_D_802874D8;
typedef struct {
s16 unk_00;
char unk_02[0xE];

View File

@ -79,7 +79,6 @@ extern struct_8018CA70_entry D_8018CA70[];
extern Mtx D_80183D60[];
extern struct_D_8018CE10 D_8018CE10[];
extern struct_D_802874D8 D_802874D8;
//extern struct GfxPool *gGfxPool; // D_8014EF40

12
mk64.ld
View File

@ -115,11 +115,11 @@ SECTIONS
BUILD_DIR/src/audio/seqplayer.o(.text);
BUILD_DIR/src/audio/external.o(.text);
BUILD_DIR/src/audio/port_eu.o(.text);
#if DEBUG
BUILD_DIR/src/debug/crash_screen_enhancement.o(.text);
BUILD_DIR/src/debug/debug.o(.text);
BUILD_DIR/src/os/sprintf.o(.text);
#endif
#if DEBUG
BUILD_DIR/src/debug/crash_screen_enhancement.o(.text);
BUILD_DIR/src/debug/debug.o(.text);
BUILD_DIR/src/os/sprintf.o(.text);
#endif
BUILD_DIR/src/os/osCreateThread.o(.text);
BUILD_DIR/src/os/osInitialize.o(.text);
BUILD_DIR/src/os/osStartThread.o(.text);
@ -447,7 +447,7 @@ SECTIONS
END_SEG(code_80280000)
BEGIN_NOLOAD(code_80280000) {
BUILD_DIR/asm/bss_credits.o(.bss);
BUILD_DIR/src/code_80280000.o(.bss);
BUILD_DIR/src/podium_ceremony_actors.o(.bss);
BUILD_DIR/src/code_80281C40.o(.bss);
BUILD_DIR/src/ceremony_and_credits.o(.bss);

View File

@ -489,7 +489,6 @@ s32 func_80283330(s32 arg0) {
return D_802876D8;
}
extern s8 D_802874F5;
extern s32 D_802876D8;
// todo: Does this match as a return of s8?
@ -502,7 +501,7 @@ s32 func_8028336C(UNUSED struct CinematicCamera *arg0, UNUSED Camera *camera) {
switch (gGamestate)
{
case ENDING_SEQUENCE:
D_802876D8 = sp20[D_802874F5];
D_802876D8 = sp20[D_802874D8.unk1D];
break;
case CREDITS_SEQUENCE:
@ -988,7 +987,7 @@ void func_80284308(struct CinematicCamera *camera) {
cutscene_event((CameraEvent)play_sound_congratulation, camera, 140, 140);
func_80282D90(camera, (struct struct_80286A04 *) D_802858E0, (struct struct_80286A04 *) D_802858F8, 0);
ply = *(sp30[0] + D_802874F5);
ply = *(sp30[0] + D_802874D8.unk1D);
x = ply->pos[0] - gPlayerOne->pos[0];
y = ply->pos[1] - gPlayerOne->pos[1];

View File

@ -10564,7 +10564,7 @@ void func_8001C14C(void) {
if (D_8016347C == 1) {
D_80163480 += 1;
}
if ((D_8016347E == 1) && (D_80163E2C == 0) && (D_802874F5 >= 3)) {
if ((D_8016347E == 1) && (D_80163E2C == 0) && (D_802874D8.unk1D >= 3)) {
temp_t3 = D_80163484 + 1;
D_80163484 = temp_t3;
if (temp_t3 >= 0xF) {

View File

@ -22,6 +22,7 @@
#include "code_8008C1D0.h"
#include "code_80091440.h"
#include "code_80091750.h"
#include "podium_ceremony_actors.h"
s32 find_unused_obj_index(s32* arg0) {
@ -8345,7 +8346,7 @@ void func_80086604(void) {
s32 temp_s0;
s32 var_s2;
if ((D_8016347C != 0) && (D_802874F5 < 3)) {
if ((D_8016347C != 0) && (D_802874D8.unk1D < 3)) {
var_s1 = D_80183EA0;
if (D_801658C6 == 0) {
do {
@ -8373,7 +8374,7 @@ GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80086604.s")
void func_80086700(s32 objectIndex) {
if (gCCSelection < CC_150) {
switch (D_802874F5) { /* switch 1; irregular */
switch (D_802874D8.unk1D) { /* switch 1; irregular */
case 0: /* switch 1 */
D_80165C18[objectIndex].unk_070 = D_0B0069D8;
break;
@ -8387,7 +8388,7 @@ void func_80086700(s32 objectIndex) {
break;
}
} else {
switch (D_802874F5) { /* irregular */
switch (D_802874D8.unk1D) { /* irregular */
case 0:
D_80165C18[objectIndex].unk_070 = D_0B006A28;
break;
@ -8442,8 +8443,7 @@ void func_80086940(s32 objectIndex) {
func_80086FD4(objectIndex);
temp_s0->unk_010[1] = 90.0f;
temp_s0->unk_028[1] = 60.0f;
temp_v0 = D_802874F5;
switch (temp_v0) { /* switch 1; irregular */
switch (D_802874D8.unk1D) {
case 1: /* switch 1 */
temp_s0->unk_010[0] = (f32) ((f64) temp_s0->unk_010[0] - 3.0);
temp_s0->unk_010[2] = (f32) ((f64) temp_s0->unk_010[2] + 15.0);

View File

@ -22,6 +22,7 @@
#include "common_textures.h"
#include "math_util.h"
#include "save_data.h"
#include "podium_ceremony_actors.h"
// TODO: Move gGfxPool out of main.h
// Unfortunately that's not a small effort due to weird import structure in this project
#include "main.h"
@ -6382,7 +6383,7 @@ void func_8009CE64(s32 arg0) {
if (gGamestate == (s32) 5) {
if ((gCCSelection != 2) && (gCCSelection != 3)) {
} else if ((D_802874F5 < 3) && (gCupSelection == 3)) {
} else if ((D_802874D8.unk1D < 3) && (gCupSelection == 3)) {
var_a1 = 1;
}
if (var_a1 != 0) {
@ -7763,7 +7764,6 @@ Gfx *func_80096CD8(Gfx *, ?, ?, ?, s32); /* extern */
? func_800A1780(struct_8018D9E0_entry *); /* extern */
? func_800A1FB0(struct_8018D9E0_entry *); /* extern */
? func_800A638C(struct_8018D9E0_entry *); /* extern */
extern s8 D_802874F6;
s16 gCurrentCourseId; /* unable to generate initializer */
void func_8009F5E0(struct_8018D9E0_entry *arg0) {
@ -8291,7 +8291,7 @@ block_58:
return;
case 0x130: /* switch 6 */
if (arg0->unk4 != 0) {
gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E7D54[D_800EFD64[D_802874F6]]), arg0->column, arg0->row);
gDisplayListHead = func_8009BA74(gDisplayListHead, segmented_to_virtual_dupe(D_800E7D54[D_800EFD64[D_802874D8.unk1E]]), arg0->column, arg0->row);
func_8009A7EC(arg0->D_8018DEE0_index, arg0->column, arg0->row, 0, arg0->unk1C);
return;
}
@ -10471,7 +10471,7 @@ void func_800A7448(struct_8018D9E0_entry *arg0) {
UNUSED s32 pad;
s32 sp40;
s32 sp3C;
s32 thing = D_802874F5;
s32 thing = D_802874D8.unk1D;
if (thing >= 3) {
set_text_color(TEXT_YELLOW);
draw_text(arg0->column, arg0->row, D_800E7A98, 0, 0.75f, 0.75f);
@ -10489,7 +10489,7 @@ void func_800A75A0(struct_8018D9E0_entry *arg0) {
UNUSED s32 pad;
s32 topThree;
if (D_802874F5 < 3) {
if (D_802874D8.unk1D < 3) {
topThree = 0;
} else {
topThree = 1;
@ -10507,7 +10507,7 @@ void func_800A761C(struct_8018D9E0_entry *arg0) {
s8 sp3C[3];
s32 temp_a0;
temp_a0 = D_802874F5 + 1;
temp_a0 = D_802874D8.unk1D + 1;
func_800A79F4(temp_a0, sp3C);
sp48 = ((get_string_width(D_800E7AA4[0]) + 5) * 1.2f) / 2;
sp44 = ((get_string_width(D_800E7AA4[temp_a0]) + 5) * 1.2f) / 2;
@ -14182,7 +14182,7 @@ void func_800AF004(struct_8018D9E0_entry *arg0) {
if ((arg0->unk1C >= 0x65) && ((gControllerFive->buttonPressed != 0) || (gControllerFive->stickPressed != 0))) {
arg0->unk4 = 6;
arg0->unk1C = 0;
if (D_802874F5 < 3) {
if (D_802874D8.unk1D < 3) {
play_sound2(SOUND_MENU_OK_CLICKED);
} else {
play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN);
@ -14231,7 +14231,7 @@ void func_800AF270(struct_8018D9E0_entry *arg0) {
Unk_D_800E70A0 *thing;
temp_v1 = arg0->type - 0x12C;
sp30 = D_802874D8.unk_1E;
sp30 = D_802874D8.unk1E;
temp_v0 = D_800EFD64[sp30];
switch (arg0->unk4) {
case 0:
@ -14251,7 +14251,7 @@ void func_800AF270(struct_8018D9E0_entry *arg0) {
case 2:
arg0->unk20++;
if (arg0->unk20 >= 0x1F) {
if (D_802874D8.unk_1D >= 3) {
if (D_802874D8.unk1D >= 3) {
arg0->unk4 = 4;
func_800CA0B8();
func_800C90F4(0U, (sp30 * 0x10) + 0x29008003);

View File

@ -373,7 +373,6 @@ extern f32 D_8018EDD4;
extern f32 D_8018EDD8;
extern f32 D_8018EDDC;
extern s8 D_8018EE08;
extern s8 D_802874F5;
extern u8 _textures_0aSegmentRomStart[];
extern u8 _textures_0bSegmentRomStart[];

View File

@ -18,11 +18,16 @@
#include "code_8006E9C0.h"
#include "code_800029B0.h"
#include "ceremony_and_credits.h"
#include "podium_ceremony_actors.h"
#include "code_80281C40.h"
#include "code_80057C60.h"
#include "actors.h"
#include "render_courses.h"
s32 D_802874A0;
//s32 D_802874A4[5];
void func_80280000(void) {
func_802966A0();
func_80059AC8();

View File

@ -24,7 +24,6 @@ extern s32 D_802874A0;
extern u16 D_80164714, D_80164716, D_80164718;
extern u16 D_800DC5E4;
extern s32 D_802874FC;
extern u16 D_800DC518;

View File

@ -68,19 +68,19 @@ void func_802818BC(void) {
s32 temp_v0_2;
if (D_8018EDF3 != TWO_PLAYERS_SELECTED) {
D_802874D8.unk_1D = func_80281880(0);
D_802874D8.unk_1E = gCharacterSelections[0];
D_802874D8.unk1D = func_80281880(0);
D_802874D8.unk1E = gCharacterSelections[0];
return;
}
// weird pattern but if it matches it matches
temp_v0 = sp1C = func_80281880(0);
temp_v0_2 = func_80281880(1);
if (sp1C < temp_v0_2) {
D_802874D8.unk_1E = gCharacterSelections[0];
D_802874D8.unk_1D = temp_v0;
D_802874D8.unk1E = gCharacterSelections[0];
D_802874D8.unk1D = temp_v0;
} else {
D_802874D8.unk_1E = gCharacterSelections[1];
D_802874D8.unk_1D = temp_v0_2;
D_802874D8.unk1E = gCharacterSelections[1];
D_802874D8.unk1D = temp_v0_2;
}
}

View File

@ -10,6 +10,7 @@
#include "podium_ceremony_actors.h"
#include "code_80281C40.h"
#include "ceremony_and_credits.h"
#include "podium_ceremony_actors.h"
#include "code_8001F980.h"
struct UnkStruct80287560 {

View File

@ -7,8 +7,6 @@ void func_80281C40(void);
void func_80281CB4(s32, s32, s32, s32);
void func_80281D00(void);
extern s32 D_802874FC;
extern u32 gMenuSelectionFromEndingSequence;
extern u16 gIsInQuitToMenuTransition;
extern Gfx D_00284F70[];

View File

@ -913,7 +913,7 @@ f32 func_802B79B8(f32 arg0, f32 arg1) {
return atan2s(arg0, arg1);
}
f32 func_802B79F0(f32 arg0, f32 arg1) {
UNUSED f32 func_802B79F0(f32 arg0, f32 arg1) {
f64 halfpi;
f32 temp_f0;
UNUSED f32 pad;

View File

@ -64,6 +64,24 @@ ActorInitParams initDummy = {
0, 0, 0, 0,
};
// This array appears to always be zero.
// This may not be an array, it appears to contain uninitialized random values to seed the random generator.
// The first index used; D_802874BE (7), requires to be an array.
// Based on that, the whole thing is now an array.
s16 D_802874B0[17];
Gfx *D_802874D4; // ptr to gDisplayListHead
struct_D_802874D8 D_802874D8; // 31 bytes
//s32 sActorTimer;
//u8 D_802874F4;
//u8 D_802874F5;
//u8 D_802874F6;
CeremonyActor *sPodiumActorList;
s32 D_802874FC;
void func_80280650(void) {
}
@ -159,7 +177,7 @@ void func_80280884(void) {
}
extern s16 D_802874CA;
//extern s16 D_802874CA;
void balloon_update(CeremonyActor *actor) {
render_balloon(actor->pos, 1.0f, actor->unk2E, actor->unk2C);
@ -172,7 +190,7 @@ void balloon_update(CeremonyActor *actor) {
if (actor->timer > 800) {
actor->isActive = 0;
}
if (D_802874CA == 1) {
if (D_802874B0[13] == 1) {
actor->isActive = 0;
}
}
@ -286,14 +304,14 @@ void unused_80280FA8(UNUSED CeremonyActor *actor) {
}
void balloons_and_fireworks_init(void) {
sActorTimer = 0;
D_802874D8.actorTimer = 0;
sPodiumActorList = (CeremonyActor *) get_next_available_memory_addr(sizeof(CeremonyActor) * 200);
bzero(sPodiumActorList, (sizeof(CeremonyActor) * 200));
new_actor(&initDummy);
}
void func_80280FFC(void) {
D_802874F4 = 1;
D_802874D8.unk1C = 1;
}
void func_8028100C(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED s32 arg2) {
@ -320,25 +338,26 @@ void spawn_balloons(s32 arg0, s32 arg1, s32 arg2) {
}
}
extern s16 D_802874BE[];
extern s16 D_802874C6;
extern s16 D_802874C8;
//extern s16 D_802874BE[3];
//extern s16 D_802874C6;
//extern s16 D_802874C8;
extern s32 fireworkColour[];
/**
* The explosive effect when the firework's charge detonates
* resulting in a small variety of amusing colours.
* D_802874BE appears to be zero.
*/
void spawn_firework_cone(s32 arg0, s32 arg1, s32 arg2) {
f32 num;
static u32 D_80287540;
if (((f32) random_float_between_0_and_1() * (D_802874BE[0] + 0xD)) < 1.0f) {
if (((f32) random_float_between_0_and_1() * (D_802874B0[7] + 0xD)) < 1.0f) {
Firework *cone;
cone = (Firework *) new_actor(&initBurst);
cone->pos[0] = random_who_knows(0.0f) + arg0;
cone->pos[1] = random_who_knows((f32) (D_802874C6 + 100)) + (f32) arg1;
cone->pos[2] = random_who_knows((f32) (D_802874C8 + 700)) + (f32) arg2;
cone->pos[1] = random_who_knows((f32) (D_802874B0[11] + 100)) + (f32) arg1;
cone->pos[2] = random_who_knows((f32) (D_802874B0[12] + 700)) + (f32) arg2;
num = 1.1f;
@ -353,12 +372,10 @@ void spawn_firework_cone(s32 arg0, s32 arg1, s32 arg2) {
}
}
extern s16 D_802874C4;
extern s32 sActorTimer;
//extern s16 D_802874C4;
//extern s32 sActorTimer;
extern Mat4 D_80287500;
extern s8 D_802874F5;
/**
* Allegedly controls fireworks movement.
*/
@ -367,19 +384,19 @@ void spawn_timer(void) {
f32 lookAtY;
guLookAtF(D_80287500, camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]);
if (D_802874F5 < 3) {
if (sActorTimer < 300) {
if (D_802874D8.unk1D < 3) {
if (D_802874D8.actorTimer < 300) {
lookAtY = camera->lookAt[1];
spawn_firework_cone(-0xE0E, (s32) (((lookAtY - camera->pos[1]) * 1.5f) + lookAtY), -0x258);
}
if (sActorTimer == 120) {
spawn_balloons(-0xC6C, (s32) ((f32) D_802874C4 + 210.0f), -0x1EF);
if (D_802874D8.actorTimer == 120) {
spawn_balloons(-0xC6C, (s32) ((f32) D_802874B0[10] + 210.0f), -0x1EF);
}
} else if (sActorTimer == 2) {
spawn_balloons(-0xC6C, (s32) ((f32) D_802874C4 + 210.0f), -0x1EF);
} else if (D_802874D8.actorTimer == 2) {
spawn_balloons(-0xC6C, (s32) ((f32) D_802874B0[10] + 210.0f), -0x1EF);
}
sActorTimer += 1;
D_802874D8.actorTimer += 1;
}
void *sUpdate[][3] = {
@ -393,14 +410,14 @@ void *sUpdate[][3] = {
{firework_cone_update_and_spawn_burst, 0, firework_update},
};
extern s16 D_802874D0;
//extern s16 D_802874D0;
void update_actors_loop(void) {
void (*func)(void *);
s32 i;
s32 j;
spawn_timer();
D_802874D0 = 0;
D_802874B0[16] = 0;
// Why do we loop over the actor list three times?
// Actors don't with no loop. fireworks don't spawn if the iterator is 2.
@ -453,7 +470,7 @@ void podium_ceremony_loop(void) {
func_80059AC8();
func_80059AC8();
func_8005A070();
if (D_802874F4 != 0) {
if (D_802874D8.unk1C != 0) {
func_8001C14C();
func_800097E0();
}

View File

@ -10,6 +10,17 @@ enum ActorType {
FireworkBurst,
};
// unk
typedef struct {
/* 0x00 */ s32 unk0;
/* 0x04 */ s32 unk4;
/* 0x08 */ s32 actorTimer;
/* 0x0C */ u8 unk[16]; // 10 bytes
/* 0x1C */ s8 unk1C;
/* 0x1D */ s8 unk1D;
/* 0x1E */ s8 unk1E; // gCharacterSelections
} struct_D_802874D8;
typedef struct {
s16 type;
Vec3s unk2;
@ -94,16 +105,15 @@ void func_80281538(void);
void func_80281540(void);
void podium_ceremony_loop(void);
extern struct_D_802874D8 D_802874D8;
extern CeremonyActor *sPodiumActorList;
extern s32 D_802874FC;
extern ActorInitParams initBalloon;
extern ActorInitParams initCone;
extern ActorInitParams initInitUnk;
extern ActorInitParams initBurst;
extern s32 sActorTimer;
extern s8 D_802874F4;
extern Gfx *D_802874D4;
extern s32 D_802874FC;
extern Mat4 D_80287500;

View File

@ -14,6 +14,7 @@
#include "spawn_players.h"
#include "staff_ghosts.h"
#include "code_80005FD0.h"
#include "podium_ceremony_actors.h"
// arg4 is height? Or something like that?
void spawn_player(Player *player, s8 playerIndex, f32 startingRow, f32 startingColumn, f32 arg4, f32 arg5, u16 characterId, s16 playerType) {
@ -686,8 +687,8 @@ void func_8003BE30(void) {
spawn_player(gPlayerOne, 0, -2770.774f, -345.187f, -34.6f, 0.0f, gCharacterIdByGPOverallRank[0], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
spawn_player(gPlayerTwo, 1, -3691.506f, -6.822f, -6.95f, 36400.0f, gCharacterIdByGPOverallRank[1], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
spawn_player(gPlayerThree, 2, -3475.028f, -998.485f, -8.059f, 45500.0f, gCharacterIdByGPOverallRank[2], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
if (D_802874D8.unk_1D >= 3) {
spawn_player(gPlayerFour, 3, -3025.772f, 110.039f, -23.224f, 28210.0f, D_802874D8.unk_1E, PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
if (D_802874D8.unk1D >= 3) {
spawn_player(gPlayerFour, 3, -3025.772f, 110.039f, -23.224f, 28210.0f, D_802874D8.unk1E, PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
} else {
spawn_player(gPlayerFour, 3, -3025.772f, 110.039f, -23.224f, 28210.0f, gCharacterIdByGPOverallRank[3], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
}