Rename Object Timing Related Code (#673)

* start making models extraction with blender

* finishing extract model

* Update fast64

* extract course

* Update fast64

* Update fast64

* simplify import of course_displaylists and course_textures and remplace adress with texture

* Update fast64

* change data format and simplify the thread queue

* move in a blender folder

* remove fast64

* re add fast64

* add model_extract and fast64_blender in makefile

* multithread with make file split the models into multiple json and add course segment

* Update fast64

* remove old model_extract

* remove the error when he don't find blender

* start rename around course section

* rename around object

* update submodule fast64

* fix compilation issue and add some model to extract

* Update fast64

* remove fast64

* re add fast64

* update submodule

* fix compilation issue

* add other collision gfx and prepare reorganise file

* re arrange json

* Create README.MD

* Update README.MD

* Update README.MD

* update fast64

* rename to initiate_next_state

* Revert "Merge branch '3d-objects' into general-object"

This reverts commit f5347b38cc, reversing
changes made to a353c4d954.

* revert the revert...

* revert 3d-models PR

* finish some revert

* Update code_80005FD0.c

* fix code_80091750.c

* Update code_80091750.c

* rename isTimerRunning to isTimerActive and set_object_timer_running to set_object_timer_state

* rename to initialize_next_state

* rename to object_next_state

---------

Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
coco875 2024-09-15 23:03:40 +02:00 committed by GitHub
parent 39be31b758
commit 93aebabaa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 346 additions and 343 deletions

View File

@ -25,7 +25,7 @@ glabel func_80082F1C
/* 083B5C 80082F5C AFB00018 */ sw $s0, 0x18($sp)
/* 083B60 80082F60 00808025 */ move $s0, $a0
/* 083B64 80082F64 AFA5002C */ sw $a1, 0x2c($sp)
/* 083B68 80082F68 0C01C922 */ jal func_80072488
/* 083B68 80082F68 0C01C922 */ jal object_next_state
/* 083B6C 80082F6C E4440000 */ swc1 $f4, ($v0)
/* 083B70 80082F70 8FA9002C */ lw $t1, 0x2c($sp)
/* 083B74 80082F74 3C0B800E */ lui $t3, %hi(D_800E5DF4) # $t3, 0x800e

View File

@ -18,7 +18,7 @@ typedef struct {
/* 0x44 */ f32 surfaceHeight;
/* 0x48 */ s32 unk_048;
/* 0x4C */ s32 unk_04C;
/* 0x50 */ s32 unk_050;
/* 0x50 */ s32 timer;
/* 0x54 */ s32 status;
/* 0x58 */ s32 unk_058;
/* 0x5C */ s32 unk_05C;
@ -37,7 +37,7 @@ typedef struct {
/* 0x7C */ SplineControlPoint* controlPoints;
/* 0x80 */ SplineData* spline;
/* 0x84 */ s16 unk_084[0xA];
/* 0x98 */ u16 timer;
/* 0x98 */ u16 animationTimer;
/* 0x9A */ u16 unk_09A;
/* 0x9C */ s16 unk_09C;
/* 0x9E */ s16 unk_09E;
@ -57,14 +57,14 @@ typedef struct {
/* 0xC6 */ u16 unk_0C6;
/* 0xC8 */ u16 boundingBoxSize;
/* 0xCA */ s8 unk_0CA;
/* 0xCB */ s8 unk_0CB;
/* 0xCB */ bool8 isTimerActive;
/* 0xCC */ s8 unk_0CC;
/* 0xCD */ s8 unk_0CD;
/* 0xCE */ s8 unk_0CE;
/* 0xCF */ s8 unk_0CF;
/* 0xD0 */ s8 unk_0D0;
/* 0xD1 */ s8 unk_0D1;
/* 0xD2 */ s8 itemDisplay;
/* 0xD2 */ s8 textureListIndex;
/* 0xD3 */ s8 unk_0D3;
/* 0xD4 */ s8 unk_0D4;
/* 0xD5 */ u8 unk_0D5;
@ -93,7 +93,7 @@ typedef struct {
/* 0x44 */ f32 unk_044;
/* 0x48 */ s32 unk_048;
/* 0x4C */ s32 unk_04C;
/* 0x50 */ s32 unk_050;
/* 0x50 */ s32 timer;
/* 0x54 */ s32 status;
/* 0x58 */ s32 unk_058;
/* 0x5C */ s32 unk_05C;
@ -132,14 +132,14 @@ typedef struct {
/* 0xC6 */ u16 unk_0C6;
/* 0xC8 */ u16 unk_0C8;
/* 0xCA */ s8 unk_0CA;
/* 0xCB */ s8 unk_0CB;
/* 0xCB */ s8 isTimerActive;
/* 0xCC */ s8 unk_0CC;
/* 0xCD */ s8 unk_0CD;
/* 0xCE */ s8 unk_0CE;
/* 0xCF */ s8 unk_0CF;
/* 0xD0 */ s8 unk_0D0;
/* 0xD1 */ s8 unk_0D1;
/* 0xD2 */ s8 itemDisplay;
/* 0xD2 */ s8 textureListIndex;
/* 0xD3 */ s8 unk_0D3;
/* 0xD4 */ s8 unk_0D4;
/* 0xD5 */ u8 unk_0D5;

View File

@ -136,7 +136,7 @@ void init_item_window(s32 objectIndex) {
temp_v0 = (ItemWindowObjects*) &gObjectList[objectIndex];
temp_v0->currentItem = ITEM_NONE;
temp_v0->itemDisplay = temp_v0->currentItem;
temp_v0->textureListIndex = temp_v0->currentItem;
temp_v0->tlutList = (u8*) common_tlut_item_window_none;
temp_v0->activeTLUT = (u8*) common_tlut_item_window_none;
temp_v0->textureList = common_texture_item_window_none;

View File

@ -1497,7 +1497,7 @@ void func_8008A9B8(s32 objectIndex) {
object = &gObjectList[objectIndex];
object->controlPoints++;
object->unk_09A = (s16) (10000 / (s16) (object->controlPoints[0].velocity));
object->timer = 0;
object->animationTimer = 0;
func_8008A920(objectIndex);
}
@ -1506,7 +1506,7 @@ void func_8008AA3C(s32 objectIndex) {
object = &gObjectList[objectIndex];
object->controlPoints = object->spline->controlPoints;
object->unk_084[9] = 0;
object->timer = 0;
object->animationTimer = 0;
/*
This is INCREDIBLY stupid. This should really be
temp_v0->unk_084[8] = temp_v0->spline->numControlPoints;
@ -1529,8 +1529,8 @@ void func_8008AB10(s32 objectIndex) {
object->offset[0] += object->velocity[0];
object->offset[1] += object->velocity[1];
object->offset[2] += object->velocity[2];
object->timer += (u16) object->unk_09A;
if (object->timer >= 0x2710) {
object->animationTimer += (u16) object->unk_09A;
if (object->animationTimer >= 0x2710) {
object->unk_084[9] = (u16) object->unk_084[9] + 1;
if (((u16) object->unk_084[9] + 1) == (u16) object->unk_084[8]) {
object->unk_0AE += 1;
@ -1724,7 +1724,7 @@ void func_8008B3E4(s32 objectIndex) {
if (is_obj_index_flag_status_inactive(objectIndex, 8) != 0) {
object = &gObjectList[objectIndex];
object->unk_084[9] = 0;
object->timer = 0;
object->animationTimer = 0;
object->controlPoints = object->spline->controlPoints;
/*
This is INCREDIBLY stupid. This should really be
@ -1738,7 +1738,7 @@ void func_8008B3E4(s32 objectIndex) {
}
void func_8008B44C(s32 objectIndex) {
gObjectList[objectIndex].timer = 0;
gObjectList[objectIndex].animationTimer = 0;
gObjectList[objectIndex].controlPoints++;
}
@ -1758,7 +1758,7 @@ void func_8008B478(s32 objectIndex, s32 arg1) {
// I think the game treats each spline as being having a lenght of 10000
// This is getting the percent along the spline we want to reach,
// which is then treated as the `t` value given to the curve calculations
sp34 = ((f32) gObjectList[objectIndex].timer / 10000.0);
sp34 = ((f32) gObjectList[objectIndex].animationTimer / 10000.0);
// Calculate the curve at `t`
func_8008B17C(objectIndex, sp34);
if (is_obj_flag_status_active(objectIndex, 0x800) != 0) {
@ -1771,7 +1771,7 @@ void func_8008B478(s32 objectIndex, s32 arg1) {
temp = gObjectList[objectIndex].controlPoints[1].velocity;
gObjectList[objectIndex].unk_09A = 10000.0 / (((temp - var_f6) * sp34) + var_f6);
gObjectList[objectIndex].timer += gObjectList[objectIndex].unk_09A;
gObjectList[objectIndex].animationTimer += gObjectList[objectIndex].unk_09A;
}
void func_8008B620(s32 objectIndex) {
@ -1780,7 +1780,7 @@ void func_8008B620(s32 objectIndex) {
func_8008B478(objectIndex, 0);
object = &gObjectList[objectIndex];
if (object->timer >= 0x2710) {
if (object->animationTimer >= 0x2710) {
// Have to do it this way due to the u16 cast
object->unk_084[9] = (u16) object->unk_084[9] + 1;
if (((u16) object->unk_084[9] + 3) == (u16) object->unk_084[8]) {
@ -1796,7 +1796,7 @@ void func_8008B6A4(s32 objectIndex) {
func_8008B478(objectIndex, 1);
object = &gObjectList[objectIndex];
if (object->timer >= 0x2710) {
if (object->animationTimer >= 0x2710) {
// Have to do it this way due to the u16 cast
object->unk_084[9] = (u16) object->unk_084[9] + 1;
if ((u16) object->unk_084[9] == (u16) object->unk_084[8]) {

View File

@ -4215,7 +4215,7 @@ void func_800557B4(s32 objectIndex, u32 arg1, u32 arg2) {
object->sizeScaling);
gSPDisplayList(gDisplayListHead++, D_0D0077D0);
render_animated_model((Armature*) object->model, (Animation**) object->vertex,
(s16) object->unk_0D8, (s16) object->itemDisplay);
(s16) object->unk_0D8, (s16) object->textureListIndex);
}
} else if (arg1 < 0x15F91U) {
func_8004A7AC(objectIndex, 1.5f);
@ -4224,7 +4224,7 @@ void func_800557B4(s32 objectIndex, u32 arg1, u32 arg2) {
rsp_set_matrix_transformation(object->pos, object->orientation, object->sizeScaling);
gSPDisplayList(gDisplayListHead++, D_0D0077D0);
render_animated_model((Armature*) object->model, (Animation**) object->vertex, (s16) object->unk_0D8,
(s16) object->itemDisplay);
(s16) object->textureListIndex);
}
}
@ -4293,7 +4293,7 @@ void func_80055AB8(s32 objectIndex, s32 cameraId) {
gSPDisplayList(gDisplayListHead++, D_0D0077D0);
render_animated_model((Armature*) gObjectList[objectIndex].model,
(Animation**) gObjectList[objectIndex].vertex, 0,
(s16) gObjectList[objectIndex].itemDisplay);
(s16) gObjectList[objectIndex].textureListIndex);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -26,11 +26,11 @@ void func_800722CC(s32, s32);
void func_800722F8(s32, s32);
bool func_80072320(s32, s32);
bool func_80072354(s32, s32);
void set_object_unk_0CB(s32, s32);
void set_object_timer_state(s32, s32);
void init_object(s32, s32);
void func_80072408(s32);
void func_80072428(s32);
void func_80072488(s32);
void object_next_state(s32);
void func_800724DC(s32);
void func_800724F8(s32, s32);
s16 func_80072530(s32);
@ -41,7 +41,7 @@ void func_8007266C(s32);
void func_800726CC(s32, s32);
void func_8007271C(s32, s32);
void func_8007274C(s32);
s32 func_8007278C(s32, s32);
s32 set_and_run_timer_object(s32, s32);
s32 func_8007281C(s32, s32);
s32 func_800728B0(s32, s32, s32);
void func_80072950(s32, s32, s32, s32);