1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-09 00:00:44 +00:00

z_collision_check.c (#73)

* func_8005B280 ok

* func_8005B65C OK

* split out func_8005BD50

* func_8005B7C0 OK

* func_8005B7F4 OK

* func_8005B824 OK

* func_8005B860 ok

* improve sanity

* func_8005B6B0 ok, ColliderInit_Actor structs added

* func_8005B884 ok

* func_8005BBF8 ok, split out func_8005BF50

* split more stuff out of func_8005C050.s

* func_8005C050 OK

* func_8005BA30 fakish OK, func_8005BAD8 real OK

* func_8005BB48 OK, func_8005BA84 almost decomp'd, but type issues

* func_8005BB10 Ok

* func_8005BF50 OK

* func_8005BE50 OK

* func_8005BD50 OK

* func_8005BCC8 Ok

* func_8005BC28

* func_8005BB8C func_8005BBB0 func_8005BBD4 Ok

* save my work commit

* func_8005C2BC fake OK

* func_8005C5B0 ok

* func_8005C608 ok

* func_8005C6C0 ok

* func_8005C6F8 ok

* func_8005C730 ok

* func_8005C774 func_8005C798 func_8005C7BC OK

* func_8005C7E0 ok, func_8005C810 split

* func_8005C810 OK

* func_8005C8C8 ok

* func_8005C964 OK

* func_8005CA88 ok

* func_8005CBAC ok

* func_8005C124 func_8005C1AC func_8005C234 func_8005CC98 OK

* func_8005CD34 func_8005CDD0 Ok

* func_8005CE6C ok

* func_8005CEC4 ok

* func_8005CEDC ok

* func_8005CF90 Ok

* standardize type names/vars more

* func_8005D3BC ok

* func_8005D40C OK, z64.h CollisionCheckContext

* func_8005D4B4 func_8005D4C8 ok

* partial data section migration

* improve function documentation, OT->OC

* Actor_CollisionCheck_SetOC ok

* Actor_CollisionCheck_SetAT Actor_CollisionCheck_SetAC Ok

* func_8005BA84 ok

* func_800611A0 ok

* func_80061274 ok

* clean up func_80061274

* func_8006139C ok

* func_8005E9C0 and dependencies OK

* minor cleanup to func_8005E9C0

* func_8005EC6C OK!

* func_8005E81C ok

* func_8005E604 ok

* func_8005E2EC func_8005E4F8 OK

* func_8005DE9C OK func_8005D8AC disassembled

* func_8006146C func_8006268C ok

* func_8005EEE0 ok

* func_8005F17C

* func_8005F39C ok

* func_8005F5B0 decompiled, not matching

* func_8005F7D0 decomp, func_8005D218 and func_8005D324 OK

* func_8005FA30 ok, split more functions

* func_8005FC04 ok

* func_8005FDCC k

* func_8005FF90 OK OK OK

* func_80060204 dead

* func_800604B0 ok

* func_80060704 func_80060994 ok, func_80060C2C somewhat disassembled. AT to AC matrix doneish

* func_800635D0 ok, func_80062ECC not so much

* OcLine oks

* D_8011DF28 functions disassembled

* D_8011DF5C functions OK

* setAT_SAC. setAC_SAC, setOC_SAC OK

* func_80061C98 decompiled, func_80061BF4, func_80061C18 OK

* func_800617D4 ok, func_800614A4 disassembled

* CollisionCheck_OC D_8011DFAC functions OK

* func_80062530 ok

* CollisionCheck_generalLineOcCheck subfunctions OK

* func_800622E4 ok

* after a long fought battle, func_80061F64 has fallen.

* func_800628A4 disassembled

* func_800627A0 func_8006285C OK

* ActorCollider_Cylinder_Update, func_80062718, func_80062734 ok

* func_80062CD4 decompiled, import EffShield/EffSpark types from MM

* various SubActor98 struct functions OK

* func_8005D4DC func_8005D62C ok

* .data section migrated, more OKs, fix NON_MATCHINGs to use effect structs

* func_80060C2C ok

* minor code tweaks

* func_80061C98 ok somehow

* Attempt to fix some unknowns, move types out of z64actor, add set3 ColliderInit types

* Apply changes

* formatting

* tweak a couple function names

* krim changes, func naming

* missed some things

* function renames

* Implement GenColliderInit.py utility

* Implement pr changes, GenColliderInit.py, DamageTable.py, z_collision_btltbls.c fully matching

* func_800614A4 ok

* Implement Roman's fixes, name Collider unknowns, rename COLTYPE -> COLSHAPE and define new COLTYPE

* collisionCheckCtx -> colChkCtx, fix small things
This commit is contained in:
mzxrules 2020-04-25 22:43:35 -04:00 committed by GitHub
parent f9bdb1d58a
commit aa91a7ee32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
873 changed files with 6121 additions and 10660 deletions

View file

@ -27,52 +27,10 @@ const ActorInit En_Boom_InitVars = {
(ActorFunc)EnBoom_Draw,
};
// Related to collision, should be moved somewhere else when collision_check is decompiled.
// Seems to be made up of a bunch of substructs, but I didnt do too much digging.
// This is probably not accurate.
typedef struct {
u8 unk_00;
u8 unk_01;
u8 unk_02;
u8 unk_03;
u8 unk_04;
u8 unk_05;
u16 pad_06;
u8 unk_08;
u8 pad_09;
u8 pad_0A;
u8 pad_0B;
u32 unk_0C;
u8 unk_10;
u8 unk_11;
u16 pad_12;
u32 unk_14;
u8 unk_18;
u8 unk_19;
u16 pad_1A;
u8 unk_1C;
u8 unk_1D;
u8 unk_1E;
u8 pad_1F;
u32 unk_20;
u32 unk_24;
u32 unk_28;
u32 unk_2C;
u32 unk_30;
u32 unk_34;
u32 unk_38;
u32 unk_3C;
u32 unk_40;
u32 unk_44;
u32 unk_48;
u32 unk_4C;
} unkCollision; // size = 0x50
static unkCollision col = {
0x0A, 0x09, 0x00, 0x00, 0x08, 0x03, 0x0000, 0x02, 0x00,
0x00, 0x00, 0x00000010, 0x00, 0x01, 0x0000, 0xFFCFFFFF, 0x00, 0x00,
0x0000, 0x05, 0x00, 0x00, 0x00, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
static ColliderQuadInit col = {
{ COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_QUAD },
{ 0x02, { 0x00000010, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x05, 0x00, 0x00 },
{ 0 },
};
static InitChainEntry initChain[] = {
@ -123,15 +81,15 @@ void EnBoom_Init(EnBoom* this, GlobalContext* globalCtx) {
Effect_Add(globalCtx, &this->effect, 1, 0, 0, &trail);
func_8005D018(globalCtx, &this->collider);
func_8005D104(globalCtx, &this->collider, this, &col);
Collider_InitQuad(globalCtx, &this->collider);
Collider_SetQuad(globalCtx, &this->collider, this, &col);
EnBoom_SetupAction(this, &EnBoom_Fly);
}
void EnBoom_Destroy(EnBoom* this, GlobalContext* globalCtx) {
func_8002709C(globalCtx, this->effect);
func_8005D060(globalCtx, &this->collider);
Collider_DestroyQuad(globalCtx, &this->collider);
}
void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
@ -183,13 +141,13 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
func_8002F974(this, 0x1010);
// If the boomerang collides with EnItem00 or a Skulltula token, set grabbed pointer to pick it up
collided = (this->collider.colliderFlags & 0x2);
collided = (this->collider.base.atFlags & 0x2);
collided = (!!(collided));
if (collided) {
if (((this->collider.at->id == ACTOR_EN_ITEM00) || (this->collider.at->id == ACTOR_EN_SI))) {
this->grabbed = this->collider.at;
if (this->collider.at->id == ACTOR_EN_SI) {
this->collider.at->flags |= 0x2000;
if (((this->collider.base.at->id == ACTOR_EN_ITEM00) || (this->collider.base.at->id == ACTOR_EN_SI))) {
this->grabbed = this->collider.base.at;
if (this->collider.base.at->id == ACTOR_EN_SI) {
this->collider.base.at->flags |= 0x2000;
}
}
}
@ -220,7 +178,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
Actor_Kill(&this->actor);
}
} else {
collided = (this->collider.colliderFlags & 0x2);
collided = (this->collider.base.atFlags & 0x2);
collided = (!!(collided));
if (collided) {
// Copy the position from the prevous frame to the boomerang to start the bounce back.

View file

@ -5,16 +5,15 @@
#include <global.h>
typedef struct {
/* 0x0000 */ Actor actor;
/* 0x014C */ Collider collider;
/* 0x0164 */ char unk_164[0x68];
/* 0x01CC */ Actor* moveTo; // actor boomerang moves toward
/* 0x01D0 */ Actor* grabbed; // actor grabbed by the boomerang
/* 0x01D4 */ u8 returnTimer; // returns to Link when 0
/* 0x01D5 */ u8 activeTimer; // increments once every update
/* 0x01D8 */ u32 effect; // set by Effect_Add
/* 0x01DC */ u32 unk_1DC[0x7];
/* 0x01F8 */ ActorFunc actionFunc;
/* 0x0000 */ Actor actor;
/* 0x014C */ ColliderQuad collider;
/* 0x01CC */ Actor* moveTo; // actor boomerang moves toward
/* 0x01D0 */ Actor* grabbed; // actor grabbed by the boomerang
/* 0x01D4 */ u8 returnTimer; // returns to Link when 0
/* 0x01D5 */ u8 activeTimer; // increments once every update
/* 0x01D8 */ u32 effect; // set by Effect_Add
/* 0x01DC */ u32 unk_1DC[0x7];
/* 0x01F8 */ ActorFunc actionFunc;
} EnBoom; // size = 0x01FC
extern const ActorInit En_Boom_InitVars;