we defeated tictoc (#327)

* Update score.py

* match func_80001FB8

* :)

* match func_8000232C

* label func

* match play_sound_global

* match func_800BF524

* match func_80061C0C

* match func_800BFE98

* match func_800BF3E4

* match func_800B8134

* match func_800BBE08

* match obj_loop_wavepower

* match func_800BFC54

* Update src/waves.c

Co-authored-by: David Benepe <benepe96@gmail.com>

* Update src/waves.c

Co-authored-by: David Benepe <benepe96@gmail.com>

* Update src/object_models.c

Co-authored-by: David Benepe <benepe96@gmail.com>

* Update src/object_models.c

Co-authored-by: David Benepe <benepe96@gmail.com>

* Update src/audio.c

Co-authored-by: David Benepe <benepe96@gmail.com>

* nonmatch

* label Taj's state behaviour

* taj updates

* match obj_loop_stopwatchman

* rename struct field

* Update m2ctx.py

* revert some names

* Update structs.h

* Update object_functions.h

* Update src/object_functions.c

Co-authored-by: David Benepe <benepe96@gmail.com>

* Update src/object_functions.c

Co-authored-by: David Benepe <benepe96@gmail.com>

* Update src/object_functions.c

Co-authored-by: David Benepe <benepe96@gmail.com>

* Update src/object_functions.c

Co-authored-by: David Benepe <benepe96@gmail.com>

* Update src/object_functions.c

Co-authored-by: David Benepe <benepe96@gmail.com>

* Update src/object_functions.c

Co-authored-by: David Benepe <benepe96@gmail.com>

* Update src/object_functions.c

Co-authored-by: David Benepe <benepe96@gmail.com>

Co-authored-by: David Benepe <benepe96@gmail.com>
This commit is contained in:
Fazana
2022-12-07 20:48:14 +00:00
committed by GitHub
co-authored by David Benepe
parent 147199ceab
commit 26483725eb
10 changed files with 375 additions and 817 deletions
File diff suppressed because it is too large Load Diff
+7 -6
View File
@@ -1264,7 +1264,7 @@ typedef struct Object_FogChanger {
/* 0x0 */ s16 unk0;
} Object_FogChanger;
typedef struct Object_Taj {
typedef struct Object_NPC {
/* 0x00 */ f32 unk0;
/* 0x04 */ f32 unk4;
/* 0x08 */ s32 unk8;
@@ -1282,14 +1282,14 @@ typedef struct Object_Taj {
/* 0x1E */ s16 unk1E;
/* 0x20 */ s16 unk20;
/* 0x22 */ s16 unk22;
/* 0x24 */ u8 pad24[0x4];
/* 0x24 */ s32 unk24;
/* 0x28 */ s16 unk28;
/* 0x2A */ u8 pad2A[0x2];
/* 0x2A */ s16 unk2A;
/* 0x2C */ s32 unk2C;
/* 0x30 */ s32 unk30;
/* 0x34 */ u16 unk34;
/* 0x36 */ s8 unk36;
} Object_Taj;
} Object_NPC;
typedef struct Object_TT {
/* 0x0 */ f32 unk0;
@@ -1369,7 +1369,7 @@ typedef struct Object_64 {
Object_PosArrow pos_arrow;
Object_Banana banana;
Object_FogChanger fog_changer;
Object_Taj taj;
Object_NPC npc;
Object_TT tt;
Object_Bridge_WhaleRamp bridge_whale_ramp;
Object_80011AD0 obj80011AD0;
@@ -1479,8 +1479,9 @@ typedef struct Object {
/* 0x0074 */ u32 unk74;
union {
/* 0x0078 */ ObjectTransform *trans78;
/* 0x0078 */ s32 unk78;
/* 0x0078 */ ObjectTransform *trans78;
/* 0x0078 */ s32 action;
/* 0x0078 */ f32 unk78f;
};
+330 -108
View File
File diff suppressed because it is too large Load Diff
+28
View File
@@ -11,6 +11,32 @@
#define TIME_JIFFIES_PER_SECOND 60
#define TIME_SECONDS(sec) sec * TIME_JIFFIES_PER_SECOND
enum TajBehaviours {
TAJ_MODE_ROAM,
TAJ_MODE_APPROACH_PLAYER,
TAJ_MODE_TURN_TOWARDS_PLAYER,
TAJ_MODE_GREET_PLAYER,
TAJ_MODE_DIALOGUE,
TAJ_MODE_TRANSFORM_BEGIN,
TAJ_MODE_TRANSFORM_END,
TAJ_MODE_END_DIALOGUE,
TAJ_MODE_END_DIALOGUE_UNUSED,
TAJ_MODE_TELEPORT_TO_PLAYER_BEGIN = 10,
TAJ_MODE_TELEPORT_TO_PLAYER_END,
TAJ_MODE_SET_CHALLENGE = 15,
TAJ_MODE_TELEPORT_AWAY_BEGIN = 20,
TAJ_MODE_TELEPORT_AWAY_END,
TAJ_MODE_RACE = 30
};
enum TTBehaviours {
TT_MODE_ROAM,
TT_MODE_APPROACH_PLAYER,
TT_MODE_TURN_TOWARDS_PLAYER,
TT_MODE_DIALOGUE,
TT_MODE_DIALOGUE_END
};
typedef struct Object78_80033DD0 {
s32 *unk0;
s16 unk4;
@@ -341,6 +367,8 @@ void obj_loop_silvercoin(Object *obj, s32 updateRate);
void obj_loop_bombexplosion(Object *obj, s32 updateRate);
void obj_loop_flycoin(Object *obj, s32 updateRate);
void func_8003FC44(f32 x, f32 y, f32 z, s32 objectID, s32 arg4, f32 scale, s32 arg6);
void obj_loop_stopwatchman(Object *obj, s32 updateRate);
void obj_loop_parkwarden(Object *obj, s32 updateRate);
//Non Matching
void obj_loop_lavaspurt(Object *obj, s32 speed);
+2 -6
View File
@@ -76,11 +76,7 @@ void func_8005F850(void) {
GLOBAL_ASM("asm/non_matchings/object_models/func_8005F99C.s")
GLOBAL_ASM("asm/non_matchings/object_models/func_8005FCD0.s")
#ifdef NON_EQUIVALENT
void free_object_model(ObjectModel *model);
void free_from_memory_pool(void*);
// Causes crashes after playing a little, and I don't know why.
#ifdef NON_MATCHING
void func_8005FF40(ObjectModel **modelPtr) {
s32 i;
s32 modelIndex;
@@ -90,7 +86,7 @@ void func_8005FF40(ObjectModel **modelPtr) {
model = *modelPtr;
model->unk30--;
if (model->unk30 > 0) {
free_from_memory_pool(model);
free_from_memory_pool(modelPtr);
return;
}
modelIndex = -1;
+1 -1
View File
@@ -2041,7 +2041,7 @@ void func_8001E36C(s32 arg0, f32 *arg1, f32 *arg2, f32 *arg3) {
if (current_obj != NULL
&& (current_obj->segment.trans.unk6 & 0x8000) == 0
&& current_obj->behaviorId == 39
&& current_obj->unk78 == arg0) {
&& current_obj->action == arg0) {
*arg1 = current_obj->segment.trans.x_position;
*arg2 = current_obj->segment.trans.y_position;
*arg3 = current_obj->segment.trans.z_position;
+1 -1
View File
@@ -3379,7 +3379,7 @@ void drop_bananas(Object *obj, Object_Racer *racer, s32 number) {
bananaObj->segment.y_velocity -= racer->oy3 * variance;
bananaObj->segment.z_velocity -= (racer->oz3 - racer->oz1) * variance;
}
bananaObj->unk78 = 1;
bananaObj->action = 1;
}
}
number--;
+4 -4
View File
@@ -363,7 +363,7 @@ void func_800BF524(Object *obj) {
GLOBAL_ASM("asm/non_matchings/waves/func_800BF634.s")
GLOBAL_ASM("asm/non_matchings/waves/func_800BF9F8.s")
void func_800BFC54(unk800BFC54_arg0 *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
UNUSED void func_800BFC54(unk800BFC54_arg0 *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
if (arg0 != NULL) {
arg0->unk10 = (arg0->unk10 + arg1);
if (arg0->unk10 < 1.0) {
@@ -372,10 +372,10 @@ void func_800BFC54(unk800BFC54_arg0 *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg
arg0->unk0 = (arg0->unkC - arg0->unk10);
arg0->unk4 = (arg0->unkC + arg0->unk10);
arg0->unk28 += arg2;
if (osTvType == 0) {
arg0->unk1C = arg0->unk28 * 20971.52;
if (osTvType == TV_TYPE_PAL) {
arg0->unk1C = arg0->unk28 * 20971.52;//(f64) (0x80000 / 25.0);
} else {
arg0->unk1C = arg0->unk28 * 17476.27;
arg0->unk1C = arg0->unk28 * 17476.27;//(f64) ((0x80000 / 1.2) / 25.0);
}
arg0->unk2C = (arg0->unk2C + arg3);
if (arg0->unk2C < 1.0) {
+1
View File
@@ -98,6 +98,7 @@ void func_800B8134(unk800B8134 *arg0);
void func_800BBE08();
void obj_loop_wavepower(Object *obj);
void func_800BFC54(unk800BFC54_arg0 *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4);
void func_800BF3E4(s32 arg0);
Object_64 *func_800BE654(s16, f32, f32); // Non Matching
f32 func_800BEEB4(Object_64 *); // Non Matching
+1 -1
View File
@@ -388,7 +388,7 @@ def write_output_functions(funcs):
# Writes all the preprocessor directives to the output file
def write_output_directives(directives):
directives['singleline'].append('#define NULL (void*)0\n') # Hack, since cleanup() will remove the original NULL definition.
directives['singleline'].append('#define NULL 0\n') # Hack, since cleanup() will remove the original NULL definition.
return [ '\n'.join(directives['singleline']) + '\n', '\n'.join(directives['all']) + '\n' ]
# Writes a variable to the output file