Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompiles z_bg_dodoago.c #334

Merged
merged 17 commits into from
Aug 24, 2020
Merged

Decompiles z_bg_dodoago.c #334

merged 17 commits into from
Aug 24, 2020

Conversation

i82orbom
Copy link
Contributor

No description provided.

@@ -22,7 +22,7 @@ typedef struct EnBom {

typedef enum {
/* 0x00 */ BOMB_BODY,
/* 0x01 */ BOMB_EXPLOSION,
/* 0x01 */ BOMB_EXPLOSION
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes a little warning from the compiler


#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Dodoago/func_8087227C.s")
if (this->dyna.actor.attachedA == NULL) {
if (((s32)(this->colliders[1].base.maskA & 2) != 0) || ((this->colliders[2].base.maskA & 2) != 0)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These casts are required, otherwise a temp has to be introduced

undefined_syms.txt Outdated Show resolved Hide resolved
src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c Outdated Show resolved Hide resolved
include/z64actor.h Outdated Show resolved Hide resolved
src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c Outdated Show resolved Hide resolved
src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c Outdated Show resolved Hide resolved
}
} else {
D_80872824++;
Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really looking for any changes here but this is interesting considering the function call is meaningless as is.
It was probably a if condition, followed by something that was optimized out, or &&'d with something that was always false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this was super weird 🤷‍♂️

@i82orbom i82orbom requested a review from Roman971 August 22, 2020 09:23
Comment on lines +50 to +54
Color_RGBA8_n D_8087259C = { 100, 100, 100, 0 };
Color_RGBA8_n D_808725A0 = { 40, 40, 40, 0 };

static Vec3f sVelocity = { 0.0f, -1.5f, 0.0f };
static Vec3f sAcceleration = { 0.0f, -0.2f, 0.0f };
Copy link
Collaborator

@fig02 fig02 Aug 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these would make alot more sense as inline data imo. for the colors you can put them right in without a temp, and you can inline the static vectors
(dont commit my suggestion directly, cause this really belongs below where the actual function is lol)

Suggested change
Color_RGBA8_n D_8087259C = { 100, 100, 100, 0 };
Color_RGBA8_n D_808725A0 = { 40, 40, 40, 0 };
static Vec3f sVelocity = { 0.0f, -1.5f, 0.0f };
static Vec3f sAcceleration = { 0.0f, -0.2f, 0.0f };
void func_80871A08(Vec3f* vec, GlobalContext* globalCtx) {
Vec3f pos;
Color_RGBA8_n primColor = { 100, 100, 100, 0 };
Color_RGBA8_n envColor = { 40, 40, 40, 0 };
static Vec3f velocity = { 0.0f, -1.5f, 0.0f };
static Vec3f acceleration = { 0.0f, -0.2f, 0.0f };
s32 i;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhmm this causes some mismatches in the function unfortunately... maybe I didn't got your suggestion right... could you elaborate?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont have to worry about it for now. ill go ahead and merge and take a look myself in a bit. Ill let you know if i figure it out

src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c Outdated Show resolved Hide resolved
@fig02 fig02 merged commit 9054fee into zeldaret:master Aug 24, 2020
@i82orbom i82orbom deleted the z_bg_dodoago branch August 24, 2020 16:06
louist103 pushed a commit to louist103/oot that referenced this pull request Jan 3, 2023
* Starts decompiling z_bg_dodoago.c

	* Removes data

* * BgDodoago_SetupAction

* * BgDodoago_Destroy

* * func_80872288

* * BgDodoago_Draw

* * func_80871A08

* * BgDodoago_Init

* WIP

* * func_80871CF4

* * func_80871CF4

* WIP

* * BgDodoago_Update

* Finishes z_bg_dodoago

* Addresses PR comments

* Addresses PR comments #2

* Removes Setup forward declared function

* Addresses PR comments #3

Co-authored-by: i82orbom <i82orbom i82orbom@github>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants