From a3c4d99b882cb93196ebd9d3947d3c104c853bf5 Mon Sep 17 00:00:00 2001 From: Antonio Date: Wed, 13 Apr 2022 20:15:46 -0700 Subject: [PATCH] Name unnamed Object_64 types. --- include/structs.h | 192 ++++++++++++++++------------------------- src/object_functions.c | 84 +++++++++--------- src/racer.c | 26 +++--- 3 files changed, 128 insertions(+), 174 deletions(-) diff --git a/include/structs.h b/include/structs.h index a575bff4..e30e9a50 100644 --- a/include/structs.h +++ b/include/structs.h @@ -656,16 +656,16 @@ typedef struct Object_Original { // from object_functions.c -typedef struct Object_80034860 { +typedef struct Object_Laser { s16 unk0; u8 unk4[0x185]; s8 unk187; -} Object_80034860; +} Object_Laser; -typedef struct Object_80034E9C { +typedef struct Object_TrophyCabinet { s32 unk0; s16 unk4; -} Object_80034E9C; +} Object_TrophyCabinet; typedef struct Object_Animator { /* 0x00 */ s16 segmentId; @@ -676,11 +676,11 @@ typedef struct Object_Animator { /* 0x0A */ s16 ySpeed; } Object_Animator; -typedef struct Object_8003DFCC { +typedef struct Object_WeaponBalloon { f32 unk0; s16 unk4; s8 unk6[0x2]; -} Object_8003DFCC; +} Object_WeaponBalloon; typedef struct Object_Butterfly { /* 0x00 */ Triangle triangles[8]; @@ -698,23 +698,23 @@ typedef struct Object_Butterfly { // from object_functions.h -typedef struct Object_80034B74 { +typedef struct Object_EffectBox { u8 pad0[0x1FE]; u8 unk1FE; u8 unk1FF; -} Object_80034B74; +} Object_EffectBox; -typedef struct Object_8003564C { +typedef struct Object_EggCreator { u8 pad0[4]; struct Object *unk4; -} Object_8003564C; +} Object_EggCreator; -typedef struct Object_80035E34 { +typedef struct Object_UnkId58 { u8 pad0[0x1D6]; s8 unk1D6; -} Object_80035E34; +} Object_UnkId58; -typedef struct Object_80035F6C { +typedef struct Object_CharacterFlag { s32 unk0; s32 unk4; s32 unk8; @@ -725,22 +725,13 @@ typedef struct Object_80035F6C { s32 unk1C; s16 *unk20; u8 *unk24; -} Object_80035F6C; +} Object_CharacterFlag; typedef struct Object_80035F6C_2 { u8 pad0[3]; s8 unk3; } Object_80035F6C_2; -typedef struct Object_800376E0 { - s16 segmentId; - s16 unk2; - s16 unk4; - s16 unk6; - s16 unk8; - s16 unkA; -} Object_800376E0; - typedef struct Object_Snowball { u8 pad0[0x20]; u32 unk20; @@ -749,32 +740,23 @@ typedef struct Object_Snowball { s8 unk38; } Object_Snowball; -typedef struct Object_80038710 { +typedef struct Object_AnimCamera { u8 pad0[0x30]; s8 unk30; u8 pad31[0x13]; s8 unk44; -} Object_80038710; +} Object_AnimCamera; -typedef struct Object_800387CC { +typedef struct Object_AnimCar { u8 pad0[0x148]; struct Object *unk148; -} Object_800387CC; +} Object_AnimCar; -typedef struct Object_800388D4 { +typedef struct Object_InfoPoint { s16 unk0; -} Object_800388D4; +} Object_InfoPoint; -typedef struct Object_80038E3C { - f32 unk0; - f32 unk4; - f32 unk8; - f32 unkC; - s32 unk10; - s8 unk14; -} Object_80038E3C; - -typedef struct Object_8003C1E0 { +typedef struct Object_TTDoor { f32 unk0; u8 pad4[4]; s32 unk8; @@ -783,13 +765,13 @@ typedef struct Object_8003C1E0 { u8 pad10[2]; u8 unk12; u8 unk13; -} Object_8003C1E0; +} Object_TTDoor; -typedef struct Object_8003DF08 { +typedef struct Object_WorldKey { s16 unk0; -} Object_8003DF08; +} Object_WorldKey; -typedef struct Object_8003FEF4 { +typedef struct Object_AudioLine { u8 unk0; u8 pad1; u16 unk2; @@ -811,25 +793,25 @@ typedef struct Object_8003FEF4 { u8 unk10; u8 unk11; u8 unk12; -} Object_8003FEF4; +} Object_AudioLine; -typedef struct Object_8004001C { +typedef struct Object_AudioReverb { u16 pad0; s16 unk2; u8 unk4; u8 unk5; -} Object_8004001C; +} Object_AudioReverb; -typedef struct Object_800400A4 { +typedef struct Object_TexScroll { s16 unk0; s16 pad2; s16 unk4; s16 unk6; s16 unk8; s16 unkA; -} Object_800400A4; +} Object_TexScroll; -typedef struct Object_80042210 { +typedef struct Object_Frog { f32 unk0; f32 unk4; f32 unk8; @@ -844,7 +826,7 @@ typedef struct Object_80042210 { f32 unk24; u8 pad28[8]; f32 unk30; -} Object_80042210; +} Object_Frog; typedef struct Object_Wizpig2 { u8 pad0[0x70]; @@ -868,7 +850,10 @@ typedef struct Object_Racer { /* 0x000 */ s16 playerIndex; // -1 = AI Controlled, 0 to 3 = Object controlled /* 0x002 */ u8 pad2; /* 0x003 */ s8 characterId; // Affects minimap color, horn, voice, etc. - /* 0x004 */ u8 pad4[0x28]; + /* 0x004 */ u8 pad4[0x20]; + /* 0x024 */ s32 unk24; + /* 0x028 */ u16 unk28; + /* 0x02A */ u16 unk2A; /* 0x02C */ f32 velocity; /* 0x030 */ f32 lateral_velocity; /* 0x034 */ u8 pad34[0x28]; @@ -892,9 +877,11 @@ typedef struct Object_Racer { /* 0x128 */ u32 lap_times[3]; /* 0x134 */ u8 pad134[0x10]; /* 0x144 */ struct Object *held_obj; - /* 0x148 */ u8 pad148[0x4]; + /* 0x148 */ struct Object *unk148; /* 0x14C */ struct Object *unk14C; - /* 0x150 */ u8 pad150[0x22]; + /* 0x150 */ u8 pad150[0x4]; + /* 0x154 */ s32 unk154; + /* 0x158 */ u8 pad158[0x1A]; /* 0x172 */ u8 balloon_type; /* 0x173 */ u8 balloon_quantity; /* 0x174 */ u8 balloon_level; @@ -902,7 +889,15 @@ typedef struct Object_Racer { /* 0x183 */ s8 unk183; /* 0x184 */ s8 pad184; /* 0x185 */ s8 bananas; - /* 0x186 */ u8 pad186[0x4D]; + /* 0x186 */ u8 pad186[0x1A]; + /* 0x1A0 */ s16 unk1A0; + /* 0x1A2 */ s16 unk1A2; + /* 0x1A4 */ s16 unk1A4; + /* 0x1A6 */ u8 pad1A6[0x24]; + /* 0x1CA */ s8 unk1CA; + /* 0x1CB */ u8 pad1CB[0x3]; + /* 0x1CE */ u8 unk1CE; + /* 0x1CF */ u8 pad1CF[0x4]; /* 0x1D3 */ s8 unk1D3; /* 0x1D4 */ u8 pad1D4[0x4]; /* 0x1D8 */ s8 unk1D8; @@ -917,7 +912,9 @@ typedef struct Object_Racer { /* 0x1ED */ s8 squish_timer; /* 0x1EE */ u8 pad1EE[0x1]; /* 0x1EF */ u8 boost_sound; - /* 0x1F0 */ u8 pad1F1[0x5]; + /* 0x1F0 */ u8 pad1F0[0x2]; + /* 0x1F2 */ s8 unk1F2; + /* 0x1F3 */ u8 pad1F3[0x2]; /* 0x1F5 */ u8 unk1F5; /* 0x1F6 */ u8 pad1F6[0x1]; /* 0x1F7 */ u8 transparency; @@ -931,7 +928,11 @@ typedef struct Object_Racer { /* 0x20C */ u8 unk20C; /* 0x20D */ u8 pad20D[0x1]; /* 0x20E */ u16 unk20E; - /* 0x210 */ u8 pad210[0xC]; + /* 0x210 */ u8 pad210[0x3]; + /* 0x213 */ s8 unk213; + /* 0x214 */ s8 unk214; + /* 0x215 */ s8 unk215; + /* 0x216 */ u8 pad216[0x6]; /* 0x21C */ u8 unk21C; } Object_Racer; @@ -1040,73 +1041,29 @@ typedef struct Object_Banana { // from racer.c -typedef struct Object_80044170 { - char unk0[0x2C]; - f32 unk2C; - char unk30[0x124]; - s32 unk154; - char unk158[0x72]; - s8 unk1CA; - char unk1CB[0x3]; - u8 unk1CE; - char unk1CF[0x13]; - s8 unk1E2; - char unk1E3[0x30]; - s8 unk213; - s8 unk214; - s8 unk215; -} Object_80044170; - -typedef struct Object_80050754 { - u8 unk0[0x2C]; - f32 unk2C; - f32 unk30; - u8 unk34[0x114]; - /* 0x148 */ struct Object *someObj; - u8 unk14C[0x54]; - /* 0x1A0 */ s16 unk1A0; - /* 0x1A2 */ s16 unk1A2; - /* 0x1A4 */ s16 unk1A4; - u8 unk1A6[0x4C]; - /* 0x1F2 */ s8 unk1F2; -} Object_80050754; - -typedef struct Object_800570B8 { - u8 pad0[3]; - s8 unk3; - u8 pad4[0x20]; - s32 unk24; - u16 unk28; - u16 unk2A; - u8 pad2C[0xDC]; - s32 unk108; -} Object_800570B8; - typedef struct Object_64 { union { Object_Original original; - Object_80034860 obj80034860; - Object_80034E9C obj80034E9C; + Object_Laser laser; + Object_TrophyCabinet trophy_cabinet; Object_Animator animator; - Object_8003DFCC obj8003DFCC; + Object_WeaponBalloon weapon_balloon; Object_Butterfly butterfly; - Object_80034B74 obj80034B74; - Object_8003564C obj8003564C; - Object_80035E34 obj80035E34; - Object_80035F6C obj80035F6C; + Object_EffectBox effect_box; + Object_EggCreator egg_creator; + Object_UnkId58 unkid58; + Object_CharacterFlag character_flag; Object_80035F6C_2 obj80035F6C_2; - Object_800376E0 obj800376E0; Object_Snowball snowball; - Object_80038710 obj80038710; - Object_800387CC obj800387CC; - Object_800388D4 obj800388D4; - Object_80038E3C obj80038E3C; - Object_8003C1E0 obj8003C1E0; - Object_8003DF08 obj8003DF08; - Object_8003FEF4 obj8003FEF4; - Object_8004001C obj8004001C; - Object_800400A4 obj800400A4; - Object_80042210 obj80042210; + Object_AnimCamera anim_camera; + Object_AnimCar anim_car; + Object_InfoPoint info_point; + Object_TTDoor tt_door; + Object_WorldKey world_key; + Object_AudioLine audio_line; + Object_AudioReverb audio_reverb; + Object_TexScroll tex_scroll; + Object_Frog frog; Object_Wizpig2 wizpig2; Object_Exit exit; Object_Racer racer; @@ -1120,9 +1077,6 @@ typedef struct Object_64 { Object_MidiFadePoint midi_fade_point; Object_PosArrow pos_arrow; Object_Banana banana; - Object_80044170 obj80044170; - Object_80050754 obj80050754; - Object_800570B8 obj800570B8; }; } Object_64; diff --git a/src/object_functions.c b/src/object_functions.c index 739a8066..0246d7a4 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -372,7 +372,7 @@ void obj_loop_laserbolt(Object *obj, s32 speed) { Object *obj4C_obj; Object_7C_80034860 *obj7C; - Object_80034860 *obj4C_obj64; + Object_Laser *obj4C_obj64; s8 sp4F; // Boolean s8 sp4E; @@ -416,7 +416,7 @@ void obj_loop_laserbolt(Object *obj, s32 speed) { if (obj->unk4C->unk13 < 80) { obj4C_obj = (Object*)obj->unk4C->unk0; if (obj4C_obj && (obj4C_obj->behaviorId == 1)) { - obj4C_obj64 = &obj4C_obj->unk64->obj80034860; + obj4C_obj64 = &obj4C_obj->unk64->laser; sp4F = TRUE; if (obj4C_obj64->unk0 != -1) { obj4C_obj64->unk187 = 1; @@ -462,7 +462,7 @@ Object **get_object_struct_array(s32 *count); void obj_loop_effectbox(Object *obj, s32 speed) { Object **objList; Object_3C_80034B74 *obj3C; - Object_80034B74 *curObj64; + Object_EffectBox *curObj64; s32 i; s32 numberOfObjects; f32 xDiff; @@ -498,7 +498,7 @@ void obj_loop_effectbox(Object *obj, s32 speed) { if (((-temp4) < (((-xDiff) * temp1) + (zDiff * temp0))) && (temp5 < temp4)) { temp5 = temp3 / 2; - curObj64 = objList[i]->unk64; + curObj64 = &objList[i]->unk64->effect_box; curObj64->unk1FE = obj3C->unkC; curObj64->unk1FF = obj3C->unkD; if ((temp5 < yDiff) && (curObj64->unk1FE == 1)) @@ -562,7 +562,7 @@ void obj_loop_trophycab(Object *obj, s32 speed) { unk80027FC4 sp44; Settings *settings; LevelHeader *curLevelHeader; - Object_80034E9C *obj64; + Object_TrophyCabinet *obj64; Object *trophyObj; Object *playerObj; f32 xDiff; @@ -571,7 +571,7 @@ void obj_loop_trophycab(Object *obj, s32 speed) { settings = get_settings(); curLevelHeader = get_current_level_header(); - obj64 = &obj->unk64->obj80034E9C; + obj64 = &obj->unk64->trophy_cabinet; // Show trophy inside the cabinet if (obj->unk7C.word == 0) { @@ -709,7 +709,7 @@ void obj_loop_eggcreator(Object *obj, UNUSED s32 speed) { sp20.unk0 = 0x34; someObj = spawn_object(&sp20, 1); if (someObj != NULL) { - Object_8003564C *someObj64 = &someObj->unk64->obj8003564C; + Object_EggCreator *someObj64 = &someObj->unk64->egg_creator; someObj64->unk4 = obj; obj->unk78 = someObj; someObj->segment.unk3C_a.unk3C = 0; @@ -893,7 +893,7 @@ void obj_init_unknown58(Object *obj, LevelObjectEntry_Unknown58 *entry) { void obj_loop_unknown58(Object *obj, s32 speed) { Object *someObj; Object *someOtherObj; - Object_80035E34 *someOtherObj64; + Object_UnkId58 *someOtherObj64; Object_60 *obj60; obj->segment.unk3B = 0; @@ -904,7 +904,7 @@ void obj_loop_unknown58(Object *obj, s32 speed) { set_ghost_position_and_rotation(obj); func_800AFC3C(obj, speed); someOtherObj = get_object_struct(0); - someOtherObj64 = &someOtherObj->unk64->obj80035E34; + someOtherObj64 = &someOtherObj->unk64->unkid58; obj60 = obj->unk60; if (obj60->unk0 == 1) { s8 temp = someOtherObj64->unk1D6; @@ -934,13 +934,13 @@ void obj_loop_characterflag(Object *obj, UNUSED s32 speed) { s32 temp_t4; s32 temp_t5; Object *someObj; - Object_80035F6C *obj64; + Object_CharacterFlag *obj64; Object_80035F6C_2 *someObj64; if (obj->unk7C.word < 0) { someObj = get_object_struct(obj->unk78); if (someObj != NULL) { - obj64 = &obj->unk64->obj80035F6C; + obj64 = &obj->unk64->character_flag; someObj64 = &someObj->unk64->obj80035F6C_2; obj->unk7C.word = someObj64->unk3; if (obj->unk7C.word < 0 || obj->unk7C.word >= 0xA) { @@ -1034,27 +1034,27 @@ void obj_loop_posarrow(Object *obj, UNUSED s32 speed) { } void obj_init_animator(Object *obj, LevelObjectEntry_Animator *entry, s32 arg2) { - Object_800376E0 *obj64; + Object_Animator *obj64; LevelModel *levelModel; s16 segmentBatchCount; - obj64 = &obj->unk64->obj800376E0; + obj64 = &obj->unk64->animator; levelModel = func_8002C7C4(); - obj64->unk2 = entry->unk8; - obj64->unk4 = entry->unk9; - obj64->unk6 = entry->unkA; + obj64->batchId = entry->unk8; + obj64->xSpeedFactor = entry->unk9; + obj64->ySpeedFactor = entry->unkA; obj64->segmentId = get_level_segment_index_from_position(obj->segment.trans.x_position, obj->segment.trans.y_position, obj->segment.trans.z_position); if (arg2 == 0) { - obj64->unk8 = 0; - obj64->unkA = 0; + obj64->xSpeed = 0; + obj64->ySpeed = 0; } if (obj64->segmentId != -1) { - if (obj64->unk2 < 0) { - obj64->unk2 = 0; + if (obj64->batchId < 0) { + obj64->batchId = 0; } segmentBatchCount = levelModel->segments[obj64->segmentId].numberOfBatches; - if (obj64->unk2 >= segmentBatchCount) { - obj64->unk2 = segmentBatchCount - 1; + if (obj64->batchId >= segmentBatchCount) { + obj64->batchId = segmentBatchCount - 1; } } obj_loop_animator(obj, 0x20000); @@ -1316,11 +1316,11 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_char_select.s") void obj_loop_animcamera(Object *obj, s32 speed) { s32 temp_v0; s32 phi_v1; - Object_80038710 *obj64; + Object_AnimCamera *obj64; temp_v0 = func_8001F460(obj, speed, obj); obj->segment.trans.unk6 |= 0x4000; - obj64 = &obj->unk64->obj80038710; + obj64 = &obj->unk64->anim_camera; if (temp_v0 == 0) { if (get_viewport_count() == VIEWPORTS_COUNT_1_PLAYER) { phi_v1 = func_800210CC(obj64->unk44); @@ -1347,7 +1347,7 @@ void obj_loop_animcar(Object *obj, s32 speed) { obj->unk7C.word = func_8001F460(obj, speed, obj); obj->segment.trans.unk6 |= 0x4000; if (obj->unk7C.word == 0 && someObj != NULL) { - Object_800387CC *someObj64 = &someObj->unk64->obj800387CC; + Object_AnimCar *someObj64 = &someObj->unk64->anim_car; someObj64->unk148 = obj; } } @@ -1381,7 +1381,7 @@ void obj_loop_infopoint(Object *obj, UNUSED s32 speed) { if (obj4C->unk13 < ((obj->unk78 >> 16) & 0xFF)) { playerObj = obj4C->unk0; if (playerObj->segment.header->behaviorId == 1) { - Object_800388D4 *playerObj64 = &playerObj->unk64->obj800388D4; + Object_InfoPoint *playerObj64 = &playerObj->unk64->info_point; temp_a0 = playerObj64->unk0; if ((temp_a0 != -1) && (get_buttons_pressed_from_player(temp_a0) & Z_TRIG)) { func_800C31EC(obj->unk78 & 0xFF); @@ -1477,12 +1477,12 @@ void obj_loop_teleport(Object *obj, UNUSED s32 speed) { void obj_init_exit(Object *obj, LevelObjectEntry_Exit *entry) { f32 phi_f0; - Object_80038E3C *obj64; + Object_Exit *obj64; phi_f0 = entry->unk10 & 0xFF; if (phi_f0 < 5) { phi_f0 = 5; } - obj64 = &obj->unk64->obj80038E3C; + obj64 = &obj->unk64->exit; phi_f0 /= 128; obj->segment.trans.scale = phi_f0; obj->segment.trans.y_rotation = entry->unk11 << 6 << 4; @@ -1722,8 +1722,8 @@ void obj_loop_bonus(Object *obj, UNUSED s32 speed) { if ((sqrtf((xDiff * xDiff) + (yDiff * yDiff) + (zDiff * zDiff)) < dist)) { f32 temp = (obj64->unk0 * racerObj->segment.trans.x_position) + (obj64->unk8 * racerObj->segment.trans.z_position) + obj64->unkC; if (temp < 0.0f) { - if ((s32) racerObj64->unk185 < 10) { - racerObj64->unk185 = 10; + if ((s32) racerObj64->bananas < 10) { + racerObj64->bananas = 10; func_80009558(34, racerObj->segment.trans.x_position, racerObj->segment.trans.y_position, racerObj->segment.trans.z_position, 4, NULL); func_80001EA8(racerObj64->characterId + 123, racerObj->segment.trans.x_position, racerObj->segment.trans.y_position, racerObj->segment.trans.z_position, NULL); } @@ -1905,11 +1905,11 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_door.s") void obj_init_ttdoor(Object *obj, LevelObjectEntry_TTDoor *entry) { f32 temp_f0; - Object_8003C1E0 *obj64; + Object_TTDoor *obj64; f32 phi_f0; obj->segment.unk3A = 0; - obj64 = &obj->unk64->obj8003C1E0; + obj64 = &obj->unk64->tt_door; obj->segment.trans.y_rotation = entry->unk8 << 6 << 4; obj64->unkF = entry->unkE; obj64->unk13 = entry->unkB; @@ -2167,7 +2167,7 @@ void obj_loop_worldkey(Object *worldKeyObj, s32 speed) { playerObj = worldKeyObj->unk4C->unk0; if (playerObj != NULL) { if (playerObj->segment.header->behaviorId == 1) { // Is the player a racer? - Object_8003DF08 *obj64 = &playerObj->unk64->obj8003DF08; + Object_WorldKey *obj64 = &playerObj->unk64->world_key; if (obj64->unk0 != -1) { // Player has grabbed the key! play_sound(SOUND_WORLD_KEY_GRAB); @@ -2185,7 +2185,7 @@ void obj_loop_worldkey(Object *worldKeyObj, s32 speed) { void obj_init_weaponballoon(Object *obj, LevelObjectEntry_WeaponBalloon *entry) { s32 cheats; - Object_8003DFCC *obj64; + Object_WeaponBalloon *obj64; f32 scalef; obj->unk4C->unk14 = 2; @@ -2224,7 +2224,7 @@ void obj_init_weaponballoon(Object *obj, LevelObjectEntry_WeaponBalloon *entry) } scalef /= 64; - obj64 = &obj->unk64->obj8003DFCC; + obj64 = &obj->unk64->weapon_balloon; obj->segment.trans.scale = obj->segment.header->scale * scalef; obj64->unk0 = obj->segment.trans.scale; @@ -2338,9 +2338,9 @@ void obj_init_audio(Object *obj, LevelObjectEntry_Audio *entry) { } void obj_init_audioline(Object *obj, LevelObjectEntry_AudioLine *entry) { - Object_8003FEF4 *obj64; + Object_AudioLine *obj64; - obj64 = &obj->unk64->obj8003FEF4; + obj64 = &obj->unk64->audio_line; obj64->unk0 = entry->unk8; obj64->unk2 = entry->unkA; obj64->unkC = entry->unkC; @@ -2360,7 +2360,7 @@ void obj_init_audioline(Object *obj, LevelObjectEntry_AudioLine *entry) { void obj_init_audioreverb(Object *obj, LevelObjectEntry_AudioReverb *entry) { s32 temp; - Object_8004001C *obj64 = &obj->unk64->obj8004001C; + Object_AudioReverb *obj64 = &obj->unk64->audio_reverb; obj64->unk2 = entry->unk8; temp = entry->unk9; obj64->unk4 = temp & 0xFF; @@ -2370,11 +2370,11 @@ void obj_init_audioreverb(Object *obj, LevelObjectEntry_AudioReverb *entry) { } void obj_init_texscroll(Object *obj, LevelObjectEntry_TexScroll *entry, s32 arg2) { - Object_800400A4 *obj64; + Object_TexScroll *obj64; LevelModel *levelModel; s16 numberOfTexturesInLevel; - obj64 = &obj->unk64->obj800400A4; + obj64 = &obj->unk64->tex_scroll; levelModel = func_8002C7C4(); obj64->unk0 = entry->unk8; if (obj64->unk0 < 0) { @@ -2673,9 +2673,9 @@ void obj_loop_rangetrigger(Object *obj, s32 speed) { } void obj_init_frog(Object *obj, LevelObjectEntry_Frog *entry) { - Object_80042210 *obj64; + Object_Frog *obj64; - obj64 = &obj->unk64->obj80042210; + obj64 = &obj->unk64->frog; obj64->unk15 = entry->unkA; obj64->unk0 = obj->segment.trans.x_position; obj64->unk4 = obj->segment.trans.y_position; diff --git a/src/racer.c b/src/racer.c index 09576ba5..5ad03d6e 100644 --- a/src/racer.c +++ b/src/racer.c @@ -197,7 +197,7 @@ s8 D_8011D5BC; GLOBAL_ASM("asm/non_matchings/racer/func_80042D20.s") GLOBAL_ASM("asm/non_matchings/racer/func_80043ECC.s") -void func_80044170(Object *arg0, Object_80044170 *arg1, s32 arg2) { +void func_80044170(Object *arg0, Object_Racer *arg1, s32 arg2) { s32 raceType; raceType = get_current_level_race_type(); @@ -216,14 +216,14 @@ void func_80044170(Object *arg0, Object_80044170 *arg1, s32 arg2) { break; } - if (arg1->unk214 == 0 && arg1->unk2C < -0.5) { + if (arg1->unk214 == 0 && arg1->velocity < -0.5) { arg1->unk215 -= arg2; if (arg1->unk215 < 0) { arg1->unk215 = 0; } } - if (arg1->unk2C > -1.0 && arg1->unk214 == 0 && D_8011D540 == 0 && D_8011D544 == 0.0f && arg1->unk1E2 != 0 && arg1->unk215 == 0) { + if (arg1->velocity > -1.0 && arg1->unk214 == 0 && D_8011D540 == 0 && D_8011D544 == 0.0f && arg1->unk1E2 != 0 && arg1->unk215 == 0) { arg1->unk213 += arg2; if (arg1->unk213 > 60) { @@ -436,28 +436,28 @@ GLOBAL_ASM("asm/non_matchings/racer/func_8004F7F4.s") #ifdef NON_EQUIVALENT // Mainly has regalloc issues. -void func_80050754(Object *obj, Object_80050754 *obj64, f32 arg2) { +void func_80050754(Object *obj, Object_Racer *obj64, f32 arg2) { f32 xDiff, yDiff, zDiff; Object *someObj; obj->segment.unk3B = 0; obj->segment.unk18 = 0x28; - someObj = obj64->someObj; + someObj = obj64->unk148; xDiff = someObj->segment.trans.x_position - obj->segment.trans.x_position; yDiff = someObj->segment.trans.y_position - obj->segment.trans.y_position; zDiff = someObj->segment.trans.z_position - obj->segment.trans.z_position; func_80011570(obj, xDiff, yDiff, zDiff); - obj->segment.trans.y_rotation = obj64->someObj->segment.trans.y_rotation; - obj->segment.trans.x_rotation = obj64->someObj->segment.trans.x_rotation; - obj->segment.trans.z_rotation = obj64->someObj->segment.trans.z_rotation; + obj->segment.trans.y_rotation = obj64->unk148->segment.trans.y_rotation; + obj->segment.trans.x_rotation = obj64->unk148->segment.trans.x_rotation; + obj->segment.trans.z_rotation = obj64->unk148->segment.trans.z_rotation; obj64->unk1A4 = obj->segment.trans.z_rotation; obj64->unk1A0 = obj->segment.trans.y_rotation; obj->segment.x_velocity = xDiff / arg2; obj->segment.y_velocity = yDiff / arg2; obj->segment.z_velocity = zDiff / arg2; obj64->unk1F2 = 0; - obj64->unk2C = 0.0f; - obj64->unk30 = 0.0f; + obj64->velocity = 0.0f; + obj64->lateral_velocity = 0.0f; } #else GLOBAL_ASM("asm/non_matchings/racer/func_80050754.s") @@ -651,9 +651,9 @@ void func_800570A4(Object *obj, s32 arg1, s32 arg2) { #ifdef NON_EQUIVALENT void func_800570B8(Object *obj, s32 arg1, s32 arg2, s32 arg3) { s32 phi_t0; - Object_800570B8 *obj64; + Object_Racer *obj64; - obj64 = &obj->unk64->obj800570B8; + obj64 = &obj->unk64->racer; if ((obj64->unk108 == 0) && ((!(arg3 & 0x80)) || (D_8011D55C != -1))) { if (arg3 == 2) { if ((obj64->unk24 != 0) && (arg1 != obj64->unk2A)) { @@ -664,7 +664,7 @@ void func_800570B8(Object *obj, s32 arg1, s32 arg2, s32 arg3) { if (obj64->unk24 == 0) { if (arg3 != 3 || get_random_number_from_range(0, 1) != 0) { obj64->unk2A = arg1; - arg1 += obj64->unk3; + arg1 += obj64->characterId; arg2--; phi_t0 = (get_random_number_from_range(0, arg2) * 12) + arg1; if (arg2 > 0) {