mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
necessary struct reworks
actually in pain rn
This commit is contained in:
+44
-46
@@ -885,10 +885,7 @@ typedef struct Object_Racer {
|
||||
/* 0x176 */ s16 unk176;
|
||||
/* 0x178 */ s32 unk178;
|
||||
/* 0x17C */ s32 unk17C;
|
||||
/* 0x180 */ s8 unk180;
|
||||
/* 0x181 */ s8 unk181;
|
||||
/* 0x182 */ s8 unk182;
|
||||
/* 0x183 */ s8 unk183;
|
||||
/* 0x180 */ s32 unk180;
|
||||
/* 0x184 */ s8 pad184;
|
||||
/* 0x185 */ s8 bananas;
|
||||
/* 0x186 */ u8 unk186;
|
||||
@@ -899,7 +896,8 @@ typedef struct Object_Racer {
|
||||
/* 0x190 */ u16 unk190;
|
||||
/* 0x192 */ u8 unk192;
|
||||
/* 0x193 */ u8 unk193;
|
||||
/* 0x194 */ s16 unk194;
|
||||
/* 0x194 */ s8 unk194;
|
||||
/* 0x195 */ s8 unk195;
|
||||
/* 0x196 */ s16 unk196;
|
||||
/* 0x198 */ s32 unk198;
|
||||
/* 0x19C */ s32 unk19C;
|
||||
@@ -908,12 +906,10 @@ typedef struct Object_Racer {
|
||||
/* 0x1A4 */ s16 unk1A4;
|
||||
/* 0x1A6 */ s16 unk1A6;
|
||||
/* 0x1A8 */ s16 unk1A8;
|
||||
/* 0x1AA */ u8 unk1AA;
|
||||
/* 0x1AB */ u8 unk1AB;
|
||||
/* 0x1AA */ u16 unk1AA;
|
||||
/* 0x1AC */ u8 unk1AC;
|
||||
/* 0x1AD */ u8 unk1AD;
|
||||
/* 0x1AE */ u8 unk1AE;
|
||||
/* 0x1AF */ u8 unk1AF;
|
||||
/* 0x1AE */ s16 unk1AE;
|
||||
/* 0x1B0 */ s32 unk1B0;
|
||||
/* 0x1B4 */ s32 unk1B4;
|
||||
/* 0x1B8 */ s16 unk1B8;
|
||||
@@ -972,7 +968,7 @@ typedef struct Object_Racer {
|
||||
/* 0x1FA */ s8 unk1FA;
|
||||
/* 0x1FB */ s8 unk1FB;
|
||||
/* 0x1FC */ s8 unk1FC;
|
||||
/* 0x1FD */ s8 unk1FD;
|
||||
/* 0x1FD */ u8 unk1FD;
|
||||
/* 0x1FE */ s8 unk1FE;
|
||||
/* 0x1FF */ s8 unk1FF;
|
||||
/* 0x200 */ s8 unk200;
|
||||
@@ -994,14 +990,8 @@ typedef struct Object_Racer {
|
||||
/* 0x215 */ s8 unk215;
|
||||
/* 0x216 */ u8 unk216;
|
||||
/* 0x217 */ u8 unk217;
|
||||
/* 0x218 */ u8 unk218;
|
||||
/* 0x219 */ u8 unk219;
|
||||
/* 0x21A */ u8 unk21A;
|
||||
/* 0x21B */ u8 unk21B;
|
||||
/* 0x21C */ u8 unk21C;
|
||||
/* 0x21D */ u8 unk21D;
|
||||
/* 0x21E */ u8 unk21E;
|
||||
/* 0x21F */ u8 unk21F;
|
||||
/* 0x218 */ s32 unk218;
|
||||
/* 0x21C */ s32 unk21C;
|
||||
/* 0x220 */ s32 unk220;
|
||||
} Object_Racer;
|
||||
|
||||
@@ -1220,46 +1210,54 @@ typedef struct ObjectTransform {
|
||||
|
||||
/* Size: 0x44 bytes */
|
||||
typedef struct ObjectSegment {
|
||||
/* 0x0000 */ ObjectTransform trans;
|
||||
/* 0x0018 */ s16 unk18;
|
||||
/* 0x001A */ s16 unk1A;
|
||||
/* 0x001C */ f32 x_velocity;
|
||||
/* 0x0020 */ f32 y_velocity;
|
||||
/* 0x0024 */ f32 z_velocity;
|
||||
/* 0x0028 */ f32 unk28;
|
||||
|
||||
ObjectTransform trans;
|
||||
union {
|
||||
struct {
|
||||
/* 0x002C */ s16 upper;
|
||||
/* 0x002E */ s16 lower;
|
||||
s16 upper;
|
||||
s16 lower;
|
||||
} half;
|
||||
/* 0x002C */ f32 word;
|
||||
f32 word;
|
||||
} unk18;
|
||||
f32 x_velocity;
|
||||
f32 y_velocity;
|
||||
f32 z_velocity;
|
||||
f32 unk28;
|
||||
union {
|
||||
struct {
|
||||
s16 upper;
|
||||
s16 lower;
|
||||
} half;
|
||||
f32 word;
|
||||
} unk2C;
|
||||
|
||||
/* 0x0030 */ f32 unk30;
|
||||
|
||||
f32 unk30;
|
||||
union {
|
||||
/* 0x0034 */ f32 unk34;
|
||||
/* 0x0034 */ s16 levelSegmentIndex;
|
||||
f32 unk34;
|
||||
s16 levelSegmentIndex;
|
||||
struct h {
|
||||
s16 h0;
|
||||
s16 h1;
|
||||
} h;
|
||||
} unk34_a;
|
||||
|
||||
union {
|
||||
struct {
|
||||
/* 0x0038 */ u8 upper;
|
||||
/* 0x0039 */ u8 lower;
|
||||
u8 upper;
|
||||
u8 lower;
|
||||
} half;
|
||||
/* 0x0038 */ s16 word;
|
||||
s16 word;
|
||||
} unk38;
|
||||
|
||||
/* 0x003A */ s8 unk3A;
|
||||
/* 0x003B */ s8 unk3B;
|
||||
|
||||
s8 unk3A;
|
||||
s8 unk3B;
|
||||
union {
|
||||
/* 0x003C */ Object_3C* unk3C;
|
||||
/* 0x003C */ f32 unk3C_f;
|
||||
Object_3C* unk3C;
|
||||
f32 unk3C_f;
|
||||
struct {
|
||||
u8 b0;
|
||||
u8 b1;
|
||||
u8 b2;
|
||||
u8 b3;
|
||||
} byte;
|
||||
} unk3C_a;
|
||||
|
||||
/* 0x0040 */ ObjectHeader *header;
|
||||
ObjectHeader *header;
|
||||
} ObjectSegment;
|
||||
|
||||
/* Size: 0x0630 bytes */
|
||||
|
||||
+22
-22
@@ -276,7 +276,7 @@ void obj_loop_fireball_octoweapon(Object *obj, s32 speed) {
|
||||
obj->segment.trans.y_position = sp4C[0];
|
||||
}
|
||||
}
|
||||
obj->segment.unk18 += speed * 10;
|
||||
obj->segment.unk18.half.upper += speed * 10;
|
||||
obj64 = obj->unk64;
|
||||
obj4C = obj->unk4C;
|
||||
obj4C_obj = (Object*)obj4C->unk0; // This should be a0, not v1!
|
||||
@@ -445,7 +445,7 @@ void obj_init_torch_mist(Object *obj, LevelObjectEntry_Torch_Mist *entry) {
|
||||
}
|
||||
|
||||
void obj_loop_torch_mist(Object *obj, s32 speed) {
|
||||
obj->segment.unk18 += obj->unk78 * speed;
|
||||
obj->segment.unk18.half.upper += obj->unk78 * speed;
|
||||
}
|
||||
|
||||
void obj_init_effectbox(UNUSED Object *obj, UNUSED LevelObjectEntry_EffectBox *entry) {
|
||||
@@ -897,7 +897,7 @@ void obj_loop_unknown58(Object *obj, s32 speed) {
|
||||
Object_60 *obj60;
|
||||
|
||||
obj->segment.unk3B = 0;
|
||||
obj->segment.unk18 = 0x28;
|
||||
obj->segment.unk18.half.upper = 0x28;
|
||||
if (func_8001139C() == 0) {
|
||||
obj->unk78 += speed;
|
||||
}
|
||||
@@ -1002,9 +1002,9 @@ void obj_loop_lavaspurt(Object *obj, s32 speed) {
|
||||
obj->segment.trans.unk6 |= 0x4000;
|
||||
} else {
|
||||
obj->segment.trans.unk6 &= ~0x4000;
|
||||
obj->segment.unk18 += speed * 4;
|
||||
if (obj->segment.unk18 >= 256) {
|
||||
obj->segment.unk18 = 0;
|
||||
obj->segment.unk18.half.upper += speed * 4;
|
||||
if (obj->segment.unk18.half.upper >= 256) {
|
||||
obj->segment.unk18.half.upper = 0;
|
||||
obj->unk78 = get_random_number_from_range(0, 30) + obj->unk7C.word;
|
||||
}
|
||||
}
|
||||
@@ -1029,7 +1029,7 @@ void obj_loop_posarrow(Object *obj, UNUSED s32 speed) {
|
||||
obj->segment.trans.unk6 &= ~0x4000;
|
||||
someObj64->unk150 = obj;
|
||||
}
|
||||
obj->segment.unk18 = obj->unk78 * 127;
|
||||
obj->segment.unk18.half.upper = obj->unk78 * 127;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1399,12 +1399,12 @@ void obj_loop_smoke(Object *obj, s32 speed) {
|
||||
temp_f2 *= 1.2;
|
||||
}
|
||||
obj->segment.trans.x_position += obj->segment.x_velocity * temp_f2;
|
||||
obj->segment.unk18 += speed * 16;
|
||||
obj->segment.unk18.half.upper += speed * 16;
|
||||
obj->segment.trans.y_position += obj->segment.y_velocity * temp_f2;
|
||||
obj->segment.trans.z_position += obj->segment.z_velocity * temp_f2;
|
||||
if (obj->segment.unk18 >= 256) {
|
||||
if (obj->segment.unk18.half.upper >= 256) {
|
||||
gParticlePtrList_addObject(obj);
|
||||
obj->segment.unk18 = 255;
|
||||
obj->segment.unk18.half.upper = 255;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1412,10 +1412,10 @@ void obj_init_unknown25(UNUSED Object *obj, UNUSED LevelObjectEntry_Unknown25 *e
|
||||
}
|
||||
|
||||
void obj_loop_unknown25(Object *obj, s32 speed) {
|
||||
obj->segment.unk18 += speed * 8;
|
||||
if (obj->segment.unk18 >= 256) {
|
||||
obj->segment.unk18.half.upper += speed * 8;
|
||||
if (obj->segment.unk18.half.upper >= 256) {
|
||||
gParticlePtrList_addObject(obj);
|
||||
obj->segment.unk18 = 255;
|
||||
obj->segment.unk18.half.upper = 255;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1429,17 +1429,17 @@ void obj_loop_wardensmoke(Object *obj, s32 speed) {
|
||||
if (osTvType == TV_TYPE_PAL) {
|
||||
temp_f2 *= 1.2;
|
||||
}
|
||||
obj->segment.unk18 += speed * 4;
|
||||
obj->segment.unk18.half.upper += speed * 4;
|
||||
obj->segment.trans.y_position += temp_f2 * 0.25;
|
||||
if (obj->segment.unk18 >= 256) {
|
||||
if (obj->segment.unk18.half.upper >= 256) {
|
||||
gParticlePtrList_addObject(obj);
|
||||
obj->segment.unk18 = 255;
|
||||
obj->segment.unk18.half.upper = 255;
|
||||
}
|
||||
}
|
||||
|
||||
void obj_init_bombexplosion(Object *obj, LevelObjectEntry_BombExplosion *entry) {
|
||||
LevelObjectEntry_BombExplosion *entry2;
|
||||
obj->segment.unk18 = 0;
|
||||
obj->segment.unk18.half.upper = 0;
|
||||
obj->segment.trans.scale = 0.5f;
|
||||
obj->segment.unk3A = get_random_number_from_range(0, obj->segment.header->numberOfModelIds - 1);
|
||||
entry2 = entry; // Needed for a match.
|
||||
@@ -1581,7 +1581,7 @@ void obj_loop_dino_whale(Object *obj, s32 speed) {
|
||||
} else {
|
||||
obj->unk78 = 0;
|
||||
}
|
||||
sp2C = obj->segment.unk18;
|
||||
sp2C = obj->segment.unk18.half.upper;
|
||||
func_8001F460(obj, speed, obj);
|
||||
func_800113CC(obj, 0, sp2C, 0xAC, 0xAD);
|
||||
if (obj->unk4C->unk13 < 0xFF) {
|
||||
@@ -2041,7 +2041,7 @@ void obj_loop_ainode(UNUSED Object *obj, UNUSED s32 speed) {
|
||||
}
|
||||
|
||||
void obj_init_treasuresucker(Object *obj, LevelObjectEntry_TreasureSucker *entry) {
|
||||
obj->segment.unk18 = 0x78;
|
||||
obj->segment.unk18.half.upper = 0x78;
|
||||
obj->unk78 = (entry->unk8 - 1) & 3;
|
||||
}
|
||||
|
||||
@@ -2053,7 +2053,7 @@ void obj_init_flycoin(UNUSED Object *obj, UNUSED LevelObjectEntry_FlyCoin *entry
|
||||
GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_flycoin.s")
|
||||
|
||||
void obj_init_bananacreator(Object *obj, UNUSED LevelObjectEntry_BananaCreator *entry) {
|
||||
obj->segment.unk18 = 100;
|
||||
obj->segment.unk18.half.upper = 100;
|
||||
}
|
||||
|
||||
void obj_loop_bananacreator(Object *obj, s32 speed) {
|
||||
@@ -2410,7 +2410,7 @@ void obj_loop_buoy_pirateship(Object *obj, s32 speed) {
|
||||
if (obj->unk64 != NULL) {
|
||||
obj->segment.trans.y_position = func_800BEEB4(obj->unk64);
|
||||
}
|
||||
obj->segment.unk18 += speed * 8;
|
||||
obj->segment.unk18.half.upper += speed * 8;
|
||||
}
|
||||
|
||||
void obj_init_log(Object *obj, LevelObjectEntry_Log *entry, UNUSED s32 arg2) {
|
||||
@@ -2738,6 +2738,6 @@ GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_levelname.s")
|
||||
|
||||
void obj_loop_wizghosts(Object *obj, s32 speed) {
|
||||
func_8001F460(obj, speed, obj);
|
||||
obj->segment.unk18 = (obj->segment.unk18 + (speed * 8)) & 0xFF;
|
||||
obj->segment.unk18.half.upper = (obj->segment.unk18.half.upper + (speed * 8)) & 0xFF;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -545,7 +545,7 @@ void func_800AF6E4(Object *obj, s32 arg1) {
|
||||
obj6C = &obj->unk6C[arg1];
|
||||
|
||||
obj6C->unk4 &= 0x7FFF;
|
||||
obj->segment.unk1A--;
|
||||
obj->segment.unk18.half.lower--;
|
||||
}
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/particles/func_800AF714.s")
|
||||
|
||||
+24
-24
@@ -390,7 +390,7 @@ void func_8004C0A0(s32 arg0, Object *planeObj, Object_Racer *planeObj64) {
|
||||
if (phi_v0 >= 0x4A) {
|
||||
phi_v0 = 0x49;
|
||||
}
|
||||
temp_v1 = phi_v0 - planeObj->segment.unk18;
|
||||
temp_v1 = phi_v0 - planeObj->segment.unk18.half.upper;
|
||||
phi_v0 = 0;
|
||||
if (temp_v1 > 0) {
|
||||
phi_v0 = arg0 * 3;
|
||||
@@ -404,7 +404,7 @@ void func_8004C0A0(s32 arg0, Object *planeObj, Object_Racer *planeObj64) {
|
||||
phi_v0 = temp_v1;
|
||||
}
|
||||
}
|
||||
planeObj->segment.unk18 += phi_v0;
|
||||
planeObj->segment.unk18.half.upper += phi_v0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,7 +469,7 @@ void func_8004D95C(s32 arg0, s32 arg1, Object *obj, Object_Racer *obj64) {
|
||||
if ((func_8002341C() != 0) && (obj64->unk1D6 == 0xA)) {
|
||||
obj->unk4C->unk14 = 0;
|
||||
}
|
||||
sp26 = obj->segment.unk18;
|
||||
sp26 = obj->segment.unk18.half.upper;
|
||||
obj64->unk1D6 = 0xA;
|
||||
func_80049794(arg0, arg1, obj, obj64);
|
||||
obj64->unk1D6 = obj64->unk1D7;
|
||||
@@ -484,7 +484,7 @@ void func_8004D95C(s32 arg0, s32 arg1, Object *obj, Object_Racer *obj64) {
|
||||
obj64->unk154->segment.trans.x_rotation = obj->segment.trans.x_rotation;
|
||||
obj64->unk154->segment.trans.z_rotation = obj->segment.trans.z_rotation;
|
||||
obj->segment.unk3B = 0;
|
||||
obj->segment.unk18 = sp26 + arg0;
|
||||
obj->segment.unk18.half.upper = sp26 + arg0;
|
||||
func_80061C0C(obj);
|
||||
}
|
||||
}
|
||||
@@ -527,7 +527,7 @@ void func_80050754(Object *obj, Object_Racer *obj64, f32 arg2) {
|
||||
Object *someObj;
|
||||
|
||||
obj->segment.unk3B = 0;
|
||||
obj->segment.unk18 = 0x28;
|
||||
obj->segment.unk18.half.upper = 0x28;
|
||||
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;
|
||||
@@ -720,62 +720,62 @@ void func_80052988(Object *arg0, Object_Racer *arg1, s32 action, s32 arg3, s32 d
|
||||
//render_printf("set0\n");
|
||||
} else if (arg0->segment.unk3B == 0) {
|
||||
if (arg6 & 1) {
|
||||
if (arg0->segment.unk18 >= 41) {
|
||||
arg0->segment.unk18 -= arg7 * 4;
|
||||
if (arg0->segment.unk18 < 41) {
|
||||
if (arg0->segment.unk18.half.upper >= 41) {
|
||||
arg0->segment.unk18.half.upper -= arg7 * 4;
|
||||
if (arg0->segment.unk18.half.upper < 41) {
|
||||
arg0->segment.unk3B = action;
|
||||
arg0->segment.unk18 = arg3;
|
||||
arg0->segment.unk18.half.upper = arg3;
|
||||
}
|
||||
//render_printf("set1\n");
|
||||
} else {
|
||||
arg0->segment.unk18 += arg7 * 4;
|
||||
if (arg0->segment.unk18 >= 40) {
|
||||
arg0->segment.unk18.half.upper += arg7 * 4;
|
||||
if (arg0->segment.unk18.half.upper >= 40) {
|
||||
arg0->segment.unk3B = action;
|
||||
arg0->segment.unk18 = arg3;
|
||||
arg0->segment.unk18.half.upper = arg3;
|
||||
}
|
||||
//render_printf("set2\n");
|
||||
}
|
||||
} else { // Set active flag, whether it's from just crashing, or beginning to honk.
|
||||
arg0->segment.unk3B = action;
|
||||
arg0->segment.unk18 = arg3;
|
||||
arg0->segment.unk18.half.upper = arg3;
|
||||
arg1->unk1F3 &= ~0x80;
|
||||
}
|
||||
} else if (arg0->segment.unk3B == action) {
|
||||
if (arg6 & 2) {
|
||||
if (arg1->unk1F3 & 0x80) { // Stop honking or reversing.
|
||||
arg0->segment.unk18 -= arg5;
|
||||
if (arg0->segment.unk18 <= 0) {
|
||||
arg0->segment.unk18.half.upper -= arg5;
|
||||
if (arg0->segment.unk18.half.upper <= 0) {
|
||||
arg0->segment.unk3B = 0;
|
||||
arg1->unk1F2 = 0;
|
||||
arg0->segment.unk18 = 40;
|
||||
arg0->segment.unk18.half.upper = 40;
|
||||
arg1->unk1F3 = 0;
|
||||
}
|
||||
} else { // Actively reversing or honking or boosting, possibly a velocity modifier, have found it's also set when recovering from getting hit by a rocket or spike trap
|
||||
arg0->segment.unk18 += arg5;
|
||||
arg0->segment.unk18.half.upper += arg5;
|
||||
// Keeps the timer below the duration value, while actively held.
|
||||
if (arg0->segment.unk18 >= duration) {
|
||||
arg0->segment.unk18 = duration - 1;
|
||||
if (arg0->segment.unk18.half.upper >= duration) {
|
||||
arg0->segment.unk18.half.upper = duration - 1;
|
||||
if ((arg6 & 4) == 0) {
|
||||
arg1->unk1F3 |= 0x80;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else { // Crash recoil
|
||||
arg0->segment.unk18 += arg5;
|
||||
if (arg0->segment.unk18 >= duration) {
|
||||
arg0->segment.unk18.half.upper += arg5;
|
||||
if (arg0->segment.unk18.half.upper >= duration) {
|
||||
arg0->segment.unk3B = 0;
|
||||
arg1->unk1F2 = 0;
|
||||
arg0->segment.unk18 = 40;
|
||||
arg0->segment.unk18.half.upper = 40;
|
||||
arg1->unk1F3 = 0;
|
||||
}
|
||||
}
|
||||
} else { // Haven't seen this trigger yet.
|
||||
arg0->segment.unk18 = arg3;
|
||||
arg0->segment.unk18.half.upper = arg3;
|
||||
arg0->segment.unk3B = action;
|
||||
}
|
||||
/*render_printf("D_8011D55C %d\n", D_8011D55C);
|
||||
render_printf("action %d\n", action);
|
||||
render_printf("unk18 %d\n", arg0->segment.unk18);
|
||||
render_printf("unk18 %d\n", arg0->segment.unk18.half.upper);
|
||||
render_printf("unk3B %d\n", arg0->segment.unk3B);
|
||||
render_printf("arg6 %d\n", arg6);
|
||||
render_printf("arg7 %d\n", arg7);*/
|
||||
|
||||
Reference in New Issue
Block a user