fix animation (#60)

* fix animation

* Update update_objects.c
This commit is contained in:
coco875 2024-08-23 01:53:05 +02:00 committed by GitHub
parent 8054960948
commit 3781ce2830
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 33 additions and 28 deletions

View File

@ -166,14 +166,14 @@ const Gfx *sherbet_land_dls_2[] = {
d_course_sherbet_land_dl_4B20,
};
u32 d_course_sherbet_land_unk_data1[] = {
uintptr_t d_course_sherbet_land_unk_data1[] = {
0x00000001,
0x00000002,
0x00000000,
0x00000007,
0x00000000,
0x06008D00,
d_course_sherbet_land_dl_8D00,
0x00000000,
0x00000000,
0x00000000,
@ -195,7 +195,7 @@ u32 d_course_sherbet_land_unk_data1[] = {
0x00000000,
0x00000007,
0x00000000,
0x06008730,
d_course_sherbet_land_dl_8730,
0x00000000,
0x00000000,
0x00000000,
@ -217,7 +217,7 @@ u32 d_course_sherbet_land_unk_data1[] = {
0x00000000,
0x00000007,
0x00000000,
0x06008808,
d_course_sherbet_land_dl_8808,
0x00000000,
0x00000000,
0x00000000,
@ -239,7 +239,7 @@ u32 d_course_sherbet_land_unk_data1[] = {
0x00000000,
0x00000007,
0x00000000,
0x06008930,
d_course_sherbet_land_dl_8930,
0x00000000,
0x00000000,
0x00000000,
@ -261,7 +261,7 @@ u32 d_course_sherbet_land_unk_data1[] = {
0x00000000,
0x00000007,
0x00000000,
0x06008A78,
d_course_sherbet_land_dl_8A78,
0x00000000,
0x00000000,
0x00000000,
@ -283,7 +283,7 @@ u32 d_course_sherbet_land_unk_data1[] = {
0x00000000,
0x00000007,
0x00000000,
0x06008E00,
d_course_sherbet_land_dl_8E00,
0x00000000,
0x00000000,
0x00000000,

View File

@ -15,7 +15,7 @@ typedef struct
u32 padding; // always zero
} course_texture;
extern u32 d_course_sherbet_land_unk_data1[];
extern uintptr_t d_course_sherbet_land_unk_data1[];
extern s16 d_course_sherbet_land_unk_data2[];
extern animation_type_3_triplet d_course_sherbet_land_unk_data3[];
extern animation_type_2 d_course_sherbet_land_unk_data4;
@ -52,7 +52,7 @@ extern animation_type_2 *d_course_yoshi_valley_unk4[];
extern uintptr_t d_course_yoshi_valley_unk5[];
extern u32 d_course_yoshi_valley_unk6[];
extern u32 d_course_sherbet_land_unk_data1[];
extern uintptr_t d_course_sherbet_land_unk_data1[];
extern s16 d_course_sherbet_land_unk_data2[];
extern animation_type_3_triplet d_course_sherbet_land_unk_data3[];
extern animation_type_2 d_course_sherbet_land_unk_data4;

View File

@ -146,7 +146,7 @@ void func_80004C30(animation_type_1 *arg0, animation_type_2 *arg1, s16 timeCycle
temp_v0++;
break;
}
arg0 = (animation_type_1 *) ((u32 *) arg0 + arg0->size);
arg0 = (animation_type_1 *) ((uintptr_t *) arg0 + arg0->size);
} while (new_var != 3);
}

View File

@ -159,11 +159,11 @@ D_80162D70 is a Vec3s that is used to set values in the some Vec3f that goes on
*/
typedef struct {
/* 0x00 */ s32 type;
/* 0x04 */ s32 size;
/* 0x08 */ s32 always_zero_never_used;
/* 0x00 */ s64 type;
/* 0x04 */ s64 size;
/* 0x08 */ s64 always_zero_never_used;
/* 0x0C */ Gfx *optional_segmented_dl_address;
/* 0x10 */ s32 thing[3];
/* 0x10 */ s64 thing[3];
} animation_type_1;
typedef struct {

View File

@ -740,10 +740,10 @@ void render_object_for_player(s32 cameraId) {
if (gGamestate != CREDITS_SEQUENCE) {
if ((gPlayerCount == 1) || (gPlayerCount == 2)) {
//render_object_seagulls(cameraId);
render_object_seagulls(cameraId);
}
} else {
//render_object_seagulls(cameraId);
render_object_seagulls(cameraId);
}
break;
case COURSE_ROYAL_RACEWAY:
@ -1637,12 +1637,12 @@ void update_object(void) {
if (gGamestate != CREDITS_SEQUENCE) {
func_800842C8();
}
//update_penguins();
update_penguins();
break;
case COURSE_RAINBOW_ROAD:
if (gGamestate != CREDITS_SEQUENCE) {
update_neon();
//update_chain_chomps();
update_chain_chomps();
}
break;
case COURSE_DK_JUNGLE:

View File

@ -102,6 +102,7 @@ void *get_segment_base_addr(s32 segment) {
* @brief converts an RSP segment + offset address to a normal memory address
*/
void *segmented_to_virtual(const void *addr) {
return addr;
size_t segment = (uintptr_t) addr >> 24;
size_t offset = (uintptr_t) addr & 0x00FFFFFF;

View File

@ -6818,16 +6818,16 @@ void update_crabs(void) {
// Stack issue caused by the `test` variable, but removing it causes much, much larger differences
//! @todo Fix flag animations
void func_80082F1C(s32 objectIndex, s32 arg1) {
// YVFlagPoleSpawn *test;
// gObjectList[objectIndex].model = (Gfx *) d_course_yoshi_valley_unk5;
// gObjectList[objectIndex].vertex = (Vtx *) d_course_yoshi_valley_unk4;
// gObjectList[objectIndex].sizeScaling = 0.027f;
// //if (test->rot && test->rot) {}
// test = &D_800E5DF4[arg1];
// func_80072488(objectIndex);
// set_obj_origin_pos(objectIndex, test->pos[0] * xOrientation, test->pos[1], test->pos[2]);
// set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
// set_obj_direction_angle(objectIndex, 0U, test->rot, 0U);
YVFlagPoleSpawn *test;
gObjectList[objectIndex].model = (Gfx *) d_course_yoshi_valley_unk5;
gObjectList[objectIndex].vertex = (Vtx *) d_course_yoshi_valley_unk4;
gObjectList[objectIndex].sizeScaling = 0.027f;
//if (test->rot && test->rot) {}
test = &D_800E5DF4[arg1];
func_80072488(objectIndex);
set_obj_origin_pos(objectIndex, test->pos[0] * xOrientation, test->pos[1], test->pos[2]);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
set_obj_direction_angle(objectIndex, 0U, test->rot, 0U);
}
#else
GLOBAL_ASM("asm/non_matchings/update_objects/func_80082F1C.s")

View File

@ -730,6 +730,10 @@ d_course_sherbet_land_penguin_unknown_model:
type: vtx
offset: 0x8768
count: 10
d_course_sherbet_land_dl_8808:
symbol: d_course_sherbet_land_dl_8808
type: gfx
offset: 0x8808
d_course_sherbet_land_dl_8810:
symbol: d_course_sherbet_land_dl_8810
type: gfx