Update StarSpawn to StarCloudData (#578)

* Update StarSpawn to StarCloudData

Add and better specify the struct used to control how stars and
 clouds are handled in various courses.
This commit is contained in:
Tyler McGavran 2024-03-04 21:28:31 -05:00 committed by GitHub
parent 0ac8284fb2
commit 6f4decf6b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 474 additions and 536 deletions

View File

@ -1,41 +0,0 @@
glabel func_800789AC
/* 0795AC 800789AC 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 0795B0 800789B0 AFB40028 */ sw $s4, 0x28($sp)
/* 0795B4 800789B4 3C148019 */ lui $s4, %hi(D_8018D1F0) # $s4, 0x8019
/* 0795B8 800789B8 2694D1F0 */ addiu $s4, %lo(D_8018D1F0) # addiu $s4, $s4, -0x2e10
/* 0795BC 800789BC 8E8E0000 */ lw $t6, ($s4)
/* 0795C0 800789C0 AFB30024 */ sw $s3, 0x24($sp)
/* 0795C4 800789C4 AFB20020 */ sw $s2, 0x20($sp)
/* 0795C8 800789C8 AFB00018 */ sw $s0, 0x18($sp)
/* 0795CC 800789CC 00C09025 */ move $s2, $a2
/* 0795D0 800789D0 00A09825 */ move $s3, $a1
/* 0795D4 800789D4 AFBF002C */ sw $ra, 0x2c($sp)
/* 0795D8 800789D8 AFB1001C */ sw $s1, 0x1c($sp)
/* 0795DC 800789DC 19C00011 */ blez $t6, .L80078A24
/* 0795E0 800789E0 00008025 */ move $s0, $zero
/* 0795E4 800789E4 3C188019 */ lui $t8, %hi(D_8018CC80) # $t8, 0x8019
/* 0795E8 800789E8 2718CC80 */ addiu $t8, %lo(D_8018CC80) # addiu $t8, $t8, -0x3380
/* 0795EC 800789EC 00047880 */ sll $t7, $a0, 2
/* 0795F0 800789F0 01F88821 */ addu $s1, $t7, $t8
/* 0795F4 800789F4 0010C8C0 */ sll $t9, $s0, 3
.L800789F8:
/* 0795F8 800789F8 03324021 */ addu $t0, $t9, $s2
/* 0795FC 800789FC 8E240000 */ lw $a0, ($s1)
/* 079600 80078A00 95050000 */ lhu $a1, ($t0)
/* 079604 80078A04 0C01E23E */ jal func_800788F8
/* 079608 80078A08 02603025 */ move $a2, $s3
/* 07960C 80078A0C 8E890000 */ lw $t1, ($s4)
/* 079610 80078A10 26100001 */ addiu $s0, $s0, 1
/* 079614 80078A14 26310004 */ addiu $s1, $s1, 4
/* 079618 80078A18 0209082A */ slt $at, $s0, $t1
/* 07961C 80078A1C 5420FFF6 */ bnel $at, $zero, .L800789F8
/* 079620 80078A20 0010C8C0 */ sll $t9, $s0, 3
.L80078A24:
/* 079624 80078A24 8FBF002C */ lw $ra, 0x2c($sp)
/* 079628 80078A28 8FB00018 */ lw $s0, 0x18($sp)
/* 07962C 80078A2C 8FB1001C */ lw $s1, 0x1c($sp)
/* 079630 80078A30 8FB20020 */ lw $s2, 0x20($sp)
/* 079634 80078A34 8FB30024 */ lw $s3, 0x24($sp)
/* 079638 80078A38 8FB40028 */ lw $s4, 0x28($sp)
/* 07963C 80078A3C 03E00008 */ jr $ra
/* 079640 80078A40 27BD0030 */ addiu $sp, $sp, 0x30

View File

@ -289,13 +289,6 @@ extern Vec3s gHedgehogPatrolPoints[];
*/
extern s32 indexObjectList2[];
// This struct is used by a lot of different objects
// Stars, clouds, exahust smoke (I think?)
typedef struct {
Vec3su pos;
u16 id;
} StarSpawn;
#define NUM_BOOS 0xA
#define NUM_FIRE_BREATHS 4
@ -407,6 +400,22 @@ extern s32 gLeafParticle[];
//! Next free spot in gLeafParticle? Wraps back around to 0 if it gets bigger than gLeafParticle_SIZE
extern s32 gNextFreeLeafParticle;
// Struct used for clouds and stars
// See `func_80070328` and `func_80070250` for cloud initialization
// See `func_800704A0` and `func_800703E0` for star initialization
typedef struct {
// rotY and posY seem relative to the camera.
// See `func_800788F8` to see how rotY is used to decide whether and where to display clouds/stars
// See `func_80078A44` and `func_800789AC` to see how stars and clouds (respectively) are looped over
/* 0x00 */ u16 rotY;
/* 0x02 */ u16 posY;
// Can be bigger than 100!
/* 0x04 */ u16 scalePercent;
// There are a couple different cloud shapes, this decides which one is used
// For stars, this is always 0 since they don't have multiple textures
/* 0x06 */ u16 subType;
} StarData, CloudData; // size = 0x8
#define D_8018CC80_SIZE 0x64
/**

View File

@ -22,6 +22,7 @@
#include "data/other_textures.h"
#include "render_objects.h"
#include "code_80091750.h"
#include "src/data/some_data.h"
void init_hud(void) {
@ -604,30 +605,30 @@ void init_object_list_index(void) {
}
}
void func_80070250(s32 objectIndex, s32 arg1, StarSpawn *arg2) {
void init_cloud_object(s32 objectIndex, s32 arg1, CloudData *arg2) {
ItemWindowObjects *temp_v0;
init_object(objectIndex, arg1);
temp_v0 = &gObjectList[objectIndex];
temp_v0->unk_0D5 = arg2->id;
temp_v0->unk_0D5 = arg2->subType;
temp_v0->currentItem = ITEM_NONE;
temp_v0->direction_angle[1] = arg2->pos[0];
temp_v0->unk_09E = arg2->pos[1];
temp_v0->sizeScaling = (f32) arg2->pos[2] / 100.0;
temp_v0->activeTexture = &D_8018D220[arg2->id];
temp_v0->direction_angle[1] = arg2->rotY;
temp_v0->unk_09E = arg2->posY;
temp_v0->sizeScaling = (f32) arg2->scalePercent / 100.0;
temp_v0->activeTexture = &D_8018D220[arg2->subType];
func_80073404(objectIndex, 0x40U, 0x20U, &D_0D005FB0);
temp_v0->primAlpha = 0x00FF;
}
void func_80070328(StarSpawn *arg0) {
void init_clouds(CloudData *cloudList) {
s32 var_s0 = 0;
StarSpawn *test = arg0;
CloudData *test = &cloudList[0];
do {
if(1) {}
func_80070250(find_unused_obj_index(&D_8018CC80[D_8018D1F8 + var_s0]), 1, test);
init_cloud_object(find_unused_obj_index(&D_8018CC80[D_8018D1F8 + var_s0]), 1, test);
var_s0++;
test++;
} while (test->pos[0] != 0xFFFF);
} while (test->rotY != 0xFFFF);
D_8018D1F8 += var_s0;
D_8018D1F0 = var_s0;
D_8018D230 = 0;
@ -642,34 +643,34 @@ void func_80070328(StarSpawn *arg0) {
* The stars in Wario's Stadium, Toad's Turnpike, and Rainbow Road are not part of the skybox.
* They are instead objects that seemingly hover in the air around the player
* They have no true x/y/z position, instead they seem to be kept in a position relative to the
* player they hang around. There is however an x/y position for where they should be on screen
* player they hang around. There is however an y rotation and y position for where they should be on screen
* when they are visbile (unk_09E[0] and [1]).
* sizeScaling is some sort of size scaling on the start texture.
* unk_0A2 is an alpha value, used to make the star twinkle.
**/
void func_800703E0(s32 objectIndex, s32 arg1, StarSpawn *arg2) {
void init_star_object(s32 objectIndex, s32 arg1, StarData *arg2) {
ItemWindowObjects *temp_v0;
init_object(objectIndex, arg1);
temp_v0 = &gObjectList[objectIndex];
temp_v0->unk_0D5 = arg2->id; // No idea, all 0's for stars
temp_v0->unk_0D5 = arg2->subType;
temp_v0->currentItem = ITEM_BANANA;
temp_v0->direction_angle[1] = arg2->pos[0]; // No idea
temp_v0->unk_09E = arg2->pos[1]; // screen Y position
temp_v0->sizeScaling = (f32)arg2->pos[2] / 100.0; // some type of scaling on the texture
temp_v0->direction_angle[1] = arg2->rotY;
temp_v0->unk_09E = arg2->posY; // screen Y position
temp_v0->sizeScaling = (f32) arg2->scalePercent / 100.0; // some type of scaling on the texture
temp_v0->activeTexture = D_0D0293D8;
func_80073404(objectIndex, 0x10U, 0x10U, common_vtx_rectangle);
}
void func_800704A0(StarSpawn *arg0) {
void init_stars(StarData *starList) {
s32 var_s0 = 0;
StarSpawn *test = arg0;
StarData *test = &starList[0];
do {
if(1) {}
func_800703E0(find_unused_obj_index(&D_8018CC80[D_8018D1F8 + var_s0]), 1, test);
init_star_object(find_unused_obj_index(&D_8018CC80[D_8018D1F8 + var_s0]), 1, test);
var_s0++;
test++;
} while (test->pos[0] != 0xFFFF);
} while (test->rotY != 0xFFFF);
D_8018D1F8 += var_s0;
D_8018D1F0 = var_s0;
D_8018D230 = 1;
@ -681,10 +682,11 @@ void func_8007055C(void) {
switch (gCurrentCourseId) {
case COURSE_MARIO_RACEWAY:
func_80070328(&D_800E6C10);
// Uses Kalimari Desert's clouds for initialization?
init_clouds(gKalimariDesertClouds);
break;
case COURSE_YOSHI_VALLEY:
func_80070328(&D_800E6AA8);
init_clouds(gYoshiValleyMooMooFarmClouds);
break;
case COURSE_FRAPPE_SNOWLAND:
if (gPlayerCount == 1) {
@ -699,31 +701,31 @@ void func_8007055C(void) {
D_8018D1F0 = var_s0;
break;
case COURSE_KOOPA_BEACH:
func_80070328(D_800E6B00);
init_clouds(gKoopaTroopaBeachClouds);
break;
case COURSE_ROYAL_RACEWAY:
func_80070328(D_800E6B38);
init_clouds(gRoyalRacewayClouds);
break;
case COURSE_LUIGI_RACEWAY:
func_80070328(D_800E6A38);
init_clouds(gLuigiRacewayClouds);
break;
case COURSE_MOO_MOO_FARM:
func_80070328(D_800E6AA8);
init_clouds(gYoshiValleyMooMooFarmClouds);
break;
case COURSE_TOADS_TURNPIKE:
func_800704A0(D_800E6C80);
init_stars(gToadsTurnpikeRainbowRoadStars);
break;
case COURSE_KALAMARI_DESERT:
func_80070328(D_800E6C10);
init_clouds(gKalimariDesertClouds);
break;
case COURSE_SHERBET_LAND:
func_80070328(D_800E6BA8);
init_clouds(gSherbetLandClouds);
break;
case COURSE_RAINBOW_ROAD:
func_800704A0(D_800E6C80);
init_stars(gToadsTurnpikeRainbowRoadStars);
break;
case COURSE_WARIO_STADIUM:
func_800704A0(D_800E6DE0);
init_stars(gWarioStadiumStars);
break;
}
func_8008C23C();

View File

@ -19,10 +19,10 @@ void func_8006F8CC(void);
void func_8006FA94(void);
void func_80070148(void);
void init_object_list_index(void);
void func_80070250(s32, s32, StarSpawn*);
void func_80070328(StarSpawn*);
void func_800703E0(s32, s32, StarSpawn*);
void func_800704A0(StarSpawn*);
void init_cloud_object(s32, s32, CloudData*);
void init_clouds(CloudData*);
void init_star_object(s32, s32, StarData*);
void init_stars(StarData*);
void func_8007055C(void);
void func_80070714(void);
void init_course_object(void);
@ -35,14 +35,4 @@ extern s16 D_800E5520[];
extern s16 D_800E5548[];
extern u8 *gCourseOutlineTextures[0x14]; // 800e54d0
// These are found in data_update_objects
extern StarSpawn D_800E6A38[]; /* unable to generate initializer */
extern StarSpawn D_800E6AA8[]; /* unable to generate initializer */
extern StarSpawn D_800E6B00[]; /* unable to generate initializer */
extern StarSpawn D_800E6B38[]; /* unable to generate initializer */
extern StarSpawn D_800E6BA8[]; /* unable to generate initializer */
extern StarSpawn D_800E6C10[]; /* unable to generate initializer */
extern StarSpawn D_800E6C80[]; /* unable to generate initializer */
extern StarSpawn D_800E6DE0[]; /* unable to generate initializer */
#endif

View File

@ -1071,187 +1071,187 @@ SplineData8 D_800E69F4 = {
}
};
StarSpawn D_800E6A38[] = {
{{ 0x04fa, 0xfff6, 0x0096 }, 0x0000 },
{{ 0x4718, 0x003c, 0x007d }, 0x0000 },
{{ 0x5550, 0x0046, 0x0096 }, 0x0000 },
{{ 0x954c, 0x002d, 0x004b }, 0x0000 },
{{ 0xae2e, 0x0028, 0x004b }, 0x0000 },
{{ 0x0e38, 0x001e, 0x0032 }, 0x0001 },
{{ 0xa384, 0x0032, 0x0064 }, 0x0001 },
{{ 0xd548, 0x001e, 0x0032 }, 0x0001 },
{{ 0x31c4, 0x0032, 0x0064 }, 0x0002 },
{{ 0x7ff8, 0x0037, 0x0064 }, 0x0002 },
{{ 0xaaa0, 0x004b, 0x0096 }, 0x0002 },
{{ 0xb8d8, 0xfff9, 0x0064 }, 0x0002 },
{{ 0xee2a, 0x003c, 0x0050 }, 0x0002 },
{{ 0xffff, 0x0000, 0x0000 }, 0x0000 },
CloudData gLuigiRacewayClouds[] = {
{ 0x04fa, 0xfff6, 0x0096, 0x0000 },
{ 0x4718, 0x003c, 0x007d, 0x0000 },
{ 0x5550, 0x0046, 0x0096, 0x0000 },
{ 0x954c, 0x002d, 0x004b, 0x0000 },
{ 0xae2e, 0x0028, 0x004b, 0x0000 },
{ 0x0e38, 0x001e, 0x0032, 0x0001 },
{ 0xa384, 0x0032, 0x0064, 0x0001 },
{ 0xd548, 0x001e, 0x0032, 0x0001 },
{ 0x31c4, 0x0032, 0x0064, 0x0002 },
{ 0x7ff8, 0x0037, 0x0064, 0x0002 },
{ 0xaaa0, 0x004b, 0x0096, 0x0002 },
{ 0xb8d8, 0xfff9, 0x0064, 0x0002 },
{ 0xee2a, 0x003c, 0x0050, 0x0002 },
{ 0xffff, 0x0000, 0x0000, 0x0000 },
};
StarSpawn D_800E6AA8[] = {
{{ 0x00b6, 0x0050, 0x0041 }, 0x0000 },
{{ 0x4718, 0x003c, 0x0064 }, 0x0000 },
{{ 0x18e2, 0x0032, 0x004b }, 0x0000 },
{{ 0x7ff8, 0x0037, 0x0064 }, 0x0000 },
{{ 0x9ff6, 0x002d, 0x0032 }, 0x0000 },
{{ 0xc710, 0x0046, 0x003c }, 0x0000 },
{{ 0x0aaa, 0x001e, 0x0064 }, 0x0001 },
{{ 0x5c6c, 0x0046, 0x0046 }, 0x0001 },
{{ 0x31c4, 0x0028, 0x0050 }, 0x0002 },
{{ 0xf1b8, 0x0028, 0x004b }, 0x0002 },
{{ 0xffff, 0x0000, 0x0000 }, 0x0000 },
CloudData gYoshiValleyMooMooFarmClouds[] = {
{ 0x00b6, 0x0050, 0x0041, 0x0000 },
{ 0x4718, 0x003c, 0x0064, 0x0000 },
{ 0x18e2, 0x0032, 0x004b, 0x0000 },
{ 0x7ff8, 0x0037, 0x0064, 0x0000 },
{ 0x9ff6, 0x002d, 0x0032, 0x0000 },
{ 0xc710, 0x0046, 0x003c, 0x0000 },
{ 0x0aaa, 0x001e, 0x0064, 0x0001 },
{ 0x5c6c, 0x0046, 0x0046, 0x0001 },
{ 0x31c4, 0x0028, 0x0050, 0x0002 },
{ 0xf1b8, 0x0028, 0x004b, 0x0002 },
{ 0xffff, 0x0000, 0x0000, 0x0000 },
};
StarSpawn D_800E6B00[] = {
{{ 0x1554, 0x001e, 0x00c8 }, 0x0000 },
{{ 0xce2c, 0x001e, 0x00c8 }, 0x0000 },
{{ 0xa384, 0x001e, 0x00c8 }, 0x0001 },
{{ 0x070c, 0x001e, 0x00c8 }, 0x0001 },
{{ 0x4718, 0x001e, 0x00c8 }, 0x0002 },
{{ 0x8714, 0x001e, 0x00c8 }, 0x0003 },
{{ 0xffff, 0x0000, 0x0000 }, 0x0000 },
CloudData gKoopaTroopaBeachClouds[] = {
{ 0x1554, 0x001e, 0x00c8, 0x0000 },
{ 0xce2c, 0x001e, 0x00c8, 0x0000 },
{ 0xa384, 0x001e, 0x00c8, 0x0001 },
{ 0x070c, 0x001e, 0x00c8, 0x0001 },
{ 0x4718, 0x001e, 0x00c8, 0x0002 },
{ 0x8714, 0x001e, 0x00c8, 0x0003 },
{ 0xffff, 0x0000, 0x0000, 0x0000 },
};
StarSpawn D_800E6B38[] = {
{{ 0x60b0, 0x003c, 0x007d }, 0x0000 },
{{ 0xb8d8, 0x0037, 0x0064 }, 0x0000 },
{{ 0xd548, 0x000a, 0x0082 }, 0x0000 },
{{ 0xf1b8, 0x0023, 0x0064 }, 0x0000 },
{{ 0x04fa, 0x0046, 0x0096 }, 0x0001 },
{{ 0x4718, 0x003c, 0x007d }, 0x0001 },
{{ 0x954c, 0x002d, 0x004b }, 0x0001 },
{{ 0x0e38, 0x001e, 0x0032 }, 0x0002 },
{{ 0x8880, 0x0046, 0x0096 }, 0x0002 },
{{ 0x31c4, 0x0032, 0x0064 }, 0x0003 },
{{ 0x5056, 0x0028, 0x004b }, 0x0003 },
{{ 0x7ff8, 0x0037, 0x0064 }, 0x0003 },
{{ 0xaaa0, 0x004b, 0x0096 }, 0x0003 },
{{ 0xffff, 0x0000, 0x0000 }, 0x0000 },
CloudData gRoyalRacewayClouds[] = {
{ 0x60b0, 0x003c, 0x007d, 0x0000 },
{ 0xb8d8, 0x0037, 0x0064, 0x0000 },
{ 0xd548, 0x000a, 0x0082, 0x0000 },
{ 0xf1b8, 0x0023, 0x0064, 0x0000 },
{ 0x04fa, 0x0046, 0x0096, 0x0001 },
{ 0x4718, 0x003c, 0x007d, 0x0001 },
{ 0x954c, 0x002d, 0x004b, 0x0001 },
{ 0x0e38, 0x001e, 0x0032, 0x0002 },
{ 0x8880, 0x0046, 0x0096, 0x0002 },
{ 0x31c4, 0x0032, 0x0064, 0x0003 },
{ 0x5056, 0x0028, 0x004b, 0x0003 },
{ 0x7ff8, 0x0037, 0x0064, 0x0003 },
{ 0xaaa0, 0x004b, 0x0096, 0x0003 },
{ 0xffff, 0x0000, 0x0000, 0x0000 },
};
StarSpawn D_800E6BA8[] = {
{{ 0x4718, 0x003c, 0x007d }, 0x0000 },
{{ 0x5550, 0x0046, 0x0096 }, 0x0000 },
{{ 0x954c, 0x002d, 0x004b }, 0x0000 },
{{ 0xf546, 0x0028, 0x004b }, 0x0000 },
{{ 0x0e38, 0x001e, 0x0032 }, 0x0001 },
{{ 0x0222, 0x0032, 0x0064 }, 0x0002 },
{{ 0x1ffe, 0x0028, 0x004b }, 0x0002 },
{{ 0x31c4, 0x0032, 0x0064 }, 0x0002 },
{{ 0x7ff8, 0x0037, 0x0064 }, 0x0002 },
{{ 0xaaa0, 0x004b, 0x0096 }, 0x0002 },
{{ 0xb8d8, 0x0037, 0x0064 }, 0x0002 },
{{ 0xdff2, 0x001e, 0x0032 }, 0x0002 },
{{ 0xffff, 0x0000, 0x0000 }, 0x0000 },
CloudData gSherbetLandClouds[] = {
{ 0x4718, 0x003c, 0x007d, 0x0000 },
{ 0x5550, 0x0046, 0x0096, 0x0000 },
{ 0x954c, 0x002d, 0x004b, 0x0000 },
{ 0xf546, 0x0028, 0x004b, 0x0000 },
{ 0x0e38, 0x001e, 0x0032, 0x0001 },
{ 0x0222, 0x0032, 0x0064, 0x0002 },
{ 0x1ffe, 0x0028, 0x004b, 0x0002 },
{ 0x31c4, 0x0032, 0x0064, 0x0002 },
{ 0x7ff8, 0x0037, 0x0064, 0x0002 },
{ 0xaaa0, 0x004b, 0x0096, 0x0002 },
{ 0xb8d8, 0x0037, 0x0064, 0x0002 },
{ 0xdff2, 0x001e, 0x0032, 0x0002 },
{ 0xffff, 0x0000, 0x0000, 0x0000 },
};
StarSpawn D_800E6C10[] = {
{{ 0x1ffe, 0x0028, 0x004b }, 0x0000 },
{{ 0x60b0, 0x003c, 0x007d }, 0x0000 },
{{ 0xb8d8, 0x0037, 0x0064 }, 0x0000 },
{{ 0x4718, 0x003c, 0x007d }, 0x0001 },
{{ 0x954c, 0x002d, 0x004b }, 0x0001 },
{{ 0xf546, 0x0028, 0x004b }, 0x0001 },
{{ 0x0e38, 0x001e, 0x0032 }, 0x0002 },
{{ 0xa384, 0x0032, 0x0064 }, 0x0002 },
{{ 0xddd0, 0x0046, 0x0096 }, 0x0002 },
{{ 0x0222, 0x0032, 0x0064 }, 0x0003 },
{{ 0x31c4, 0x0032, 0x0064 }, 0x0003 },
{{ 0x7ff8, 0x0037, 0x0064 }, 0x0003 },
{{ 0xaaa0, 0x004b, 0x0096 }, 0x0003 },
{{ 0xffff, 0x0000, 0x0000 }, 0x0000 },
CloudData gKalimariDesertClouds[] = {
{ 0x1ffe, 0x0028, 0x004b, 0x0000 },
{ 0x60b0, 0x003c, 0x007d, 0x0000 },
{ 0xb8d8, 0x0037, 0x0064, 0x0000 },
{ 0x4718, 0x003c, 0x007d, 0x0001 },
{ 0x954c, 0x002d, 0x004b, 0x0001 },
{ 0xf546, 0x0028, 0x004b, 0x0001 },
{ 0x0e38, 0x001e, 0x0032, 0x0002 },
{ 0xa384, 0x0032, 0x0064, 0x0002 },
{ 0xddd0, 0x0046, 0x0096, 0x0002 },
{ 0x0222, 0x0032, 0x0064, 0x0003 },
{ 0x31c4, 0x0032, 0x0064, 0x0003 },
{ 0x7ff8, 0x0037, 0x0064, 0x0003 },
{ 0xaaa0, 0x004b, 0x0096, 0x0003 },
{ 0xffff, 0x0000, 0x0000, 0x0000 },
};
StarSpawn D_800E6C80[] = {
{{ 0x0222, 0x0032, 0x000a }, 0x0000 },
{{ 0x04fa, 0x0046, 0x000f }, 0x0000 },
{{ 0x093e, 0x000a, 0x0014 }, 0x0000 },
{{ 0x0e38, 0x001e, 0x000f }, 0x0000 },
{{ 0x11c6, 0x0028, 0x0014 }, 0x0000 },
{{ 0x1554, 0xfff6, 0x000f }, 0x0000 },
{{ 0x1ddc, 0x000a, 0x0011 }, 0x0000 },
{{ 0x1ffe, 0x0030, 0x0019 }, 0x0000 },
{{ 0x271a, 0x0046, 0x0014 }, 0x0000 },
{{ 0x27d0, 0xfff1, 0x0016 }, 0x0000 },
{{ 0x2c14, 0x0014, 0x000f }, 0x0000 },
{{ 0x31c4, 0x0032, 0x0016 }, 0x0000 },
{{ 0x327a, 0x0000, 0x000a }, 0x0000 },
{{ 0x3a4c, 0x000f, 0x0016 }, 0x0000 },
{{ 0x3ffc, 0x002d, 0x0011 }, 0x0000 },
{{ 0x40b2, 0xffdd, 0x0016 }, 0x0000 },
{{ 0x4440, 0x0037, 0x0014 }, 0x0000 },
{{ 0x4718, 0x003c, 0x000c }, 0x0000 },
{{ 0x4718, 0x0050, 0x000c }, 0x0000 },
{{ 0x4aa6, 0xfff6, 0x000f }, 0x0000 },
{{ 0x5056, 0x0028, 0x000a }, 0x0000 },
{{ 0x5550, 0x0046, 0x000f }, 0x0000 },
{{ 0x60b0, 0x003c, 0x0016 }, 0x0000 },
{{ 0x6388, 0xffdd, 0x0019 }, 0x0000 },
{{ 0x64f4, 0x0023, 0x0011 }, 0x0000 },
{{ 0x6aa4, 0x004b, 0x0014 }, 0x0000 },
{{ 0x7054, 0x002d, 0x0019 }, 0x0000 },
{{ 0x7498, 0x0014, 0x0012 }, 0x0000 },
{{ 0x7bb4, 0xfff1, 0x001b }, 0x0000 },
{{ 0x7ff8, 0x0037, 0x000a }, 0x0000 },
{{ 0x8386, 0x0041, 0x0014 }, 0x0000 },
{{ 0x8880, 0x0046, 0x000f }, 0x0000 },
{{ 0x954c, 0x002d, 0x0011 }, 0x0000 },
{{ 0x98da, 0x003c, 0x000f }, 0x0000 },
{{ 0x9dd4, 0x0000, 0x000a }, 0x0000 },
{{ 0xa384, 0x0046, 0x000f }, 0x0000 },
{{ 0xa43a, 0x0032, 0x0017 }, 0x0000 },
{{ 0xaaa0, 0x004b, 0x000f }, 0x0000 },
{{ 0xae2e, 0x0028, 0x0011 }, 0x0000 },
{{ 0xb1bc, 0x0023, 0x0014 }, 0x0000 },
{{ 0xb8d8, 0xfff1, 0x000a }, 0x0000 },
{{ 0xbc66, 0xffe2, 0x000f }, 0x0000 },
{{ 0xc710, 0x001e, 0x000c }, 0x0000 },
{{ 0xffff, 0x0000, 0x0000 }, 0x0000 },
StarData gToadsTurnpikeRainbowRoadStars[] = {
{ 0x0222, 0x0032, 0x000a, 0x0000 },
{ 0x04fa, 0x0046, 0x000f, 0x0000 },
{ 0x093e, 0x000a, 0x0014, 0x0000 },
{ 0x0e38, 0x001e, 0x000f, 0x0000 },
{ 0x11c6, 0x0028, 0x0014, 0x0000 },
{ 0x1554, 0xfff6, 0x000f, 0x0000 },
{ 0x1ddc, 0x000a, 0x0011, 0x0000 },
{ 0x1ffe, 0x0030, 0x0019, 0x0000 },
{ 0x271a, 0x0046, 0x0014, 0x0000 },
{ 0x27d0, 0xfff1, 0x0016, 0x0000 },
{ 0x2c14, 0x0014, 0x000f, 0x0000 },
{ 0x31c4, 0x0032, 0x0016, 0x0000 },
{ 0x327a, 0x0000, 0x000a, 0x0000 },
{ 0x3a4c, 0x000f, 0x0016, 0x0000 },
{ 0x3ffc, 0x002d, 0x0011, 0x0000 },
{ 0x40b2, 0xffdd, 0x0016, 0x0000 },
{ 0x4440, 0x0037, 0x0014, 0x0000 },
{ 0x4718, 0x003c, 0x000c, 0x0000 },
{ 0x4718, 0x0050, 0x000c, 0x0000 },
{ 0x4aa6, 0xfff6, 0x000f, 0x0000 },
{ 0x5056, 0x0028, 0x000a, 0x0000 },
{ 0x5550, 0x0046, 0x000f, 0x0000 },
{ 0x60b0, 0x003c, 0x0016, 0x0000 },
{ 0x6388, 0xffdd, 0x0019, 0x0000 },
{ 0x64f4, 0x0023, 0x0011, 0x0000 },
{ 0x6aa4, 0x004b, 0x0014, 0x0000 },
{ 0x7054, 0x002d, 0x0019, 0x0000 },
{ 0x7498, 0x0014, 0x0012, 0x0000 },
{ 0x7bb4, 0xfff1, 0x001b, 0x0000 },
{ 0x7ff8, 0x0037, 0x000a, 0x0000 },
{ 0x8386, 0x0041, 0x0014, 0x0000 },
{ 0x8880, 0x0046, 0x000f, 0x0000 },
{ 0x954c, 0x002d, 0x0011, 0x0000 },
{ 0x98da, 0x003c, 0x000f, 0x0000 },
{ 0x9dd4, 0x0000, 0x000a, 0x0000 },
{ 0xa384, 0x0046, 0x000f, 0x0000 },
{ 0xa43a, 0x0032, 0x0017, 0x0000 },
{ 0xaaa0, 0x004b, 0x000f, 0x0000 },
{ 0xae2e, 0x0028, 0x0011, 0x0000 },
{ 0xb1bc, 0x0023, 0x0014, 0x0000 },
{ 0xb8d8, 0xfff1, 0x000a, 0x0000 },
{ 0xbc66, 0xffe2, 0x000f, 0x0000 },
{ 0xc710, 0x001e, 0x000c, 0x0000 },
{ 0xffff, 0x0000, 0x0000, 0x0000 },
};
StarSpawn D_800E6DE0[] = {
{{ 0x0222, 0x0050, 0x000a }, 0x0000 },
{{ 0x04fa, 0x0064, 0x000f }, 0x0000 },
{{ 0x093e, 0x005a, 0x0014 }, 0x0000 },
{{ 0x0e38, 0x003c, 0x000f }, 0x0000 },
{{ 0x11c6, 0x0046, 0x0014 }, 0x0000 },
{{ 0x1554, 0x0078, 0x000f }, 0x0000 },
{{ 0x1c70, 0x001e, 0x0011 }, 0x0000 },
{{ 0x1ffe, 0x0046, 0x0011 }, 0x0000 },
{{ 0x271a, 0x0064, 0x0014 }, 0x0000 },
{{ 0x2c14, 0x0032, 0x000f }, 0x0000 },
{{ 0x31c4, 0x0050, 0x000a }, 0x0000 },
{{ 0x3996, 0x0019, 0x000c }, 0x0000 },
{{ 0x3a4c, 0x0037, 0x0016 }, 0x0000 },
{{ 0x3bb8, 0x0019, 0x000c }, 0x0000 },
{{ 0x3ffc, 0x004b, 0x0011 }, 0x0000 },
{{ 0x4440, 0x0055, 0x0014 }, 0x0000 },
{{ 0x4718, 0x005a, 0x000c }, 0x0000 },
{{ 0x4aa6, 0x003c, 0x000f }, 0x0000 },
{{ 0x5056, 0x0046, 0x000a }, 0x0000 },
{{ 0x5550, 0x0064, 0x000f }, 0x0000 },
{{ 0x60b0, 0x005a, 0x0016 }, 0x0000 },
{{ 0x64f4, 0x0041, 0x0014 }, 0x0000 },
{{ 0x6aa4, 0x0069, 0x0014 }, 0x0000 },
{{ 0x7054, 0x004b, 0x0014 }, 0x0000 },
{{ 0x71c0, 0x0078, 0x0012 }, 0x0000 },
{{ 0x7498, 0x003c, 0x0012 }, 0x0000 },
{{ 0x7ff8, 0x0055, 0x000a }, 0x0000 },
{{ 0x8714, 0x0073, 0x000a }, 0x0000 },
{{ 0x8880, 0x0064, 0x000f }, 0x0000 },
{{ 0x954c, 0x004b, 0x0011 }, 0x0000 },
{{ 0x98da, 0x003c, 0x000f }, 0x0000 },
{{ 0x9dd4, 0x0032, 0x000a }, 0x0000 },
{{ 0xa384, 0x0050, 0x000a }, 0x0000 },
{{ 0xa43a, 0x006e, 0x000a }, 0x0000 },
{{ 0xaaa0, 0x0069, 0x000f }, 0x0000 },
{{ 0xae2e, 0x0046, 0x0011 }, 0x0000 },
{{ 0xb1bc, 0x0041, 0x0014 }, 0x0000 },
{{ 0xb8d8, 0x0055, 0x000a }, 0x0000 },
{{ 0xbc66, 0x003c, 0x000f }, 0x0000 },
{{ 0xc710, 0x0064, 0x000a }, 0x0000 },
{{ 0xffff, 0x0000, 0x0000 }, 0x0000 },
{{ 0x0000, 0x0000, 0x0000 }, 0x0000 },
StarData gWarioStadiumStars[] = {
{ 0x0222, 0x0050, 0x000a, 0x0000 },
{ 0x04fa, 0x0064, 0x000f, 0x0000 },
{ 0x093e, 0x005a, 0x0014, 0x0000 },
{ 0x0e38, 0x003c, 0x000f, 0x0000 },
{ 0x11c6, 0x0046, 0x0014, 0x0000 },
{ 0x1554, 0x0078, 0x000f, 0x0000 },
{ 0x1c70, 0x001e, 0x0011, 0x0000 },
{ 0x1ffe, 0x0046, 0x0011, 0x0000 },
{ 0x271a, 0x0064, 0x0014, 0x0000 },
{ 0x2c14, 0x0032, 0x000f, 0x0000 },
{ 0x31c4, 0x0050, 0x000a, 0x0000 },
{ 0x3996, 0x0019, 0x000c, 0x0000 },
{ 0x3a4c, 0x0037, 0x0016, 0x0000 },
{ 0x3bb8, 0x0019, 0x000c, 0x0000 },
{ 0x3ffc, 0x004b, 0x0011, 0x0000 },
{ 0x4440, 0x0055, 0x0014, 0x0000 },
{ 0x4718, 0x005a, 0x000c, 0x0000 },
{ 0x4aa6, 0x003c, 0x000f, 0x0000 },
{ 0x5056, 0x0046, 0x000a, 0x0000 },
{ 0x5550, 0x0064, 0x000f, 0x0000 },
{ 0x60b0, 0x005a, 0x0016, 0x0000 },
{ 0x64f4, 0x0041, 0x0014, 0x0000 },
{ 0x6aa4, 0x0069, 0x0014, 0x0000 },
{ 0x7054, 0x004b, 0x0014, 0x0000 },
{ 0x71c0, 0x0078, 0x0012, 0x0000 },
{ 0x7498, 0x003c, 0x0012, 0x0000 },
{ 0x7ff8, 0x0055, 0x000a, 0x0000 },
{ 0x8714, 0x0073, 0x000a, 0x0000 },
{ 0x8880, 0x0064, 0x000f, 0x0000 },
{ 0x954c, 0x004b, 0x0011, 0x0000 },
{ 0x98da, 0x003c, 0x000f, 0x0000 },
{ 0x9dd4, 0x0032, 0x000a, 0x0000 },
{ 0xa384, 0x0050, 0x000a, 0x0000 },
{ 0xa43a, 0x006e, 0x000a, 0x0000 },
{ 0xaaa0, 0x0069, 0x000f, 0x0000 },
{ 0xae2e, 0x0046, 0x0011, 0x0000 },
{ 0xb1bc, 0x0041, 0x0014, 0x0000 },
{ 0xb8d8, 0x0055, 0x000a, 0x0000 },
{ 0xbc66, 0x003c, 0x000f, 0x0000 },
{ 0xc710, 0x0064, 0x000a, 0x0000 },
{ 0xffff, 0x0000, 0x0000, 0x0000 },
{ 0x0000, 0x0000, 0x0000, 0x0000 },
};
u8 D_800E6F30[][3] = {

View File

@ -76,14 +76,14 @@ extern SplineDataUnused13 D_800E68E0;
extern SplineData12 D_800E694C;
extern SplineData8 D_800E69B0;
extern SplineData8 D_800E69F4;
extern StarSpawn D_800E6A38[];
extern StarSpawn D_800E6AA8[];
extern StarSpawn D_800E6B00[];
extern StarSpawn D_800E6B38[];
extern StarSpawn D_800E6BA8[];
extern StarSpawn D_800E6C10[];
extern StarSpawn D_800E6C80[];
extern StarSpawn D_800E6DE0[];
extern CloudData gLuigiRacewayClouds[];
extern CloudData gYoshiValleyMooMooFarmClouds[];
extern CloudData gKoopaTroopaBeachClouds[];
extern CloudData gRoyalRacewayClouds[];
extern CloudData gSherbetLandClouds[];
extern CloudData gKalimariDesertClouds[];
extern StarData gToadsTurnpikeRainbowRoadStars[];
extern StarData gWarioStadiumStars[];
extern u8 D_800E6F30[][3];
extern u8 D_800E6F48[][3];

View File

@ -2741,52 +2741,28 @@ void func_800788F8(s32 objectIndex, u16 rot, Camera *camera) {
set_object_flag_status_false(objectIndex, 0x00000010);
}
#ifdef MIPS_TO_C
//generated by m2c commit beb457dabfc7a01ec6540a5404a6a05097a13602 on Nov-13-2023
void func_800789AC(s32 arg0, Camera *arg1, s16 (*arg2)[4]) {
s32 *var_s1;
s32 var_s0;
void update_clouds(s32 arg0, Camera *arg1, CloudData *cloudList) {
s32 cloudIndex;
s32 objectIndex;
CloudData *cloud;
var_s0 = 0;
if (D_8018D1F0 > 0) {
var_s1 = &D_8018CC80[arg0];
do {
func_800788F8(*var_s1, (u16) *arg2[var_s0], arg1);
var_s0 += 1;
var_s1 += 4;
} while (var_s0 < D_8018D1F0);
for (cloudIndex = 0; cloudIndex < D_8018D1F0; cloudIndex++) {
cloud = &cloudList[cloudIndex];
objectIndex = D_8018CC80[arg0 + cloudIndex];
func_800788F8(objectIndex, cloud->rotY, arg1);
}
/*
s32 var_s0;
for (var_s0 = 0; var_s0 < D_8018D1F0; var_s0++) {
func_800788F8(D_8018CC80[arg0 + var_s0], arg2[0][var_s0], arg1);
}
*/
}
#else
GLOBAL_ASM("asm/non_matchings/update_objects/func_800789AC.s")
#endif
typedef struct {
Vec3su unk0;
u16 pad;
Vec3su unkA;
u16 pad2;
} test;
void update_stars(s32 arg0, Camera *camera, StarData *starList) {
s32 starIndex;
s32 objectIndex;
StarData *star;
typedef u16 testA[44][4];
void func_80078A44(s32 arg0, Camera *camera, u16 rot[][4]) {
s32 objectIndex;
s32 i;
for (i = 0; i < D_8018D1F0; i++, arg0++) {
objectIndex = D_8018CC80[arg0];
// rot[i][0]
func_800788F8(objectIndex, *(u16 *)(rot + i), camera);
switch (i % 5U) {
for (starIndex = 0; starIndex < D_8018D1F0; starIndex++) {
star = &starList[starIndex];
objectIndex = D_8018CC80[arg0 + starIndex];
func_800788F8(objectIndex, star->rotY, camera);
switch (starIndex % 5U) {
case 0:
func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0x00000028, 0x000000B4, 0x000000FF, 0, -1);
break;
@ -2849,40 +2825,41 @@ void func_80078C70(s32 arg0) {
D_8018D218 = 0xA0;
switch (gCurrentCourseId) { /* switch 2 */
case COURSE_MARIO_RACEWAY: /* switch 2 */
func_800789AC(sp1C, camera, D_800E6A38);
// Uses Luigi Raceway's clouds for display purposes?
update_clouds(sp1C, camera, gLuigiRacewayClouds);
break;
case COURSE_YOSHI_VALLEY: /* switch 2 */
func_800789AC(sp1C, camera, D_800E6AA8);
update_clouds(sp1C, camera, gYoshiValleyMooMooFarmClouds);
break;
case COURSE_FRAPPE_SNOWLAND: /* switch 2 */
func_80078170(sp1C, camera);
break;
case COURSE_KOOPA_BEACH: /* switch 2 */
func_800789AC(sp1C, camera, D_800E6B00);
update_clouds(sp1C, camera, gKoopaTroopaBeachClouds);
break;
case COURSE_ROYAL_RACEWAY: /* switch 2 */
func_800789AC(sp1C, camera, D_800E6B38);
update_clouds(sp1C, camera, gRoyalRacewayClouds);
break;
case COURSE_LUIGI_RACEWAY: /* switch 2 */
func_800789AC(sp1C, camera, D_800E6A38);
update_clouds(sp1C, camera, gLuigiRacewayClouds);
break;
case COURSE_MOO_MOO_FARM: /* switch 2 */
func_800789AC(sp1C, camera, D_800E6AA8);
update_clouds(sp1C, camera, gYoshiValleyMooMooFarmClouds);
break;
case COURSE_TOADS_TURNPIKE: /* switch 2 */
func_80078A44(sp1C, camera, D_800E6C80);
update_stars(sp1C, camera, gToadsTurnpikeRainbowRoadStars);
break;
case COURSE_KALAMARI_DESERT: /* switch 2 */
func_800789AC(sp1C, camera, D_800E6C10);
update_clouds(sp1C, camera, gKalimariDesertClouds);
break;
case COURSE_SHERBET_LAND: /* switch 2 */
func_800789AC(sp1C, camera, D_800E6BA8);
update_clouds(sp1C, camera, gSherbetLandClouds);
break;
case COURSE_RAINBOW_ROAD: /* switch 2 */
func_80078A44(sp1C, camera, D_800E6C80);
update_stars(sp1C, camera, gToadsTurnpikeRainbowRoadStars);
break;
case COURSE_WARIO_STADIUM: /* switch 2 */
func_80078A44(sp1C, camera, D_800E6DE0);
update_stars(sp1C, camera, gWarioStadiumStars);
break;
}
}

View File

@ -176,7 +176,8 @@ void func_800786EC(s32);
void func_80078790(void);
void update_snowflakes(void);
void func_800788F8(s32, u16, Camera*);
void func_800789AC(s32, Camera*, Vec4s*);
void update_clouds(s32, Camera*, CloudData*);
void update_stars(s32, Camera*, StarData*);
void func_80078C68(void);
void func_80078C70(s32);
void func_80078F64(void);

File diff suppressed because it is too large Load Diff