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_spot01_objects2.c #357

Merged
merged 6 commits into from
Sep 4, 2020

Conversation

i82orbom
Copy link
Contributor

@i82orbom i82orbom commented Aug 28, 2020

Path* path -> Path* pathList refactored as discussed in Discord in the last commit

Thanks to @ethteck for checking the jump tables at the end... actually to everyone that helps in the channel πŸ™‡β€β™‚οΈ

Copy link
Collaborator

@Roman971 Roman971 left a comment

Choose a reason for hiding this comment

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

This was already mentioned in discord but to keep track of things in github I'll note here that this includes some incorrect changes to Path stuff.

And I'll probably wait for that to get reverted before doing a full review.

@i82orbom
Copy link
Contributor Author

i82orbom commented Sep 1, 2020

@Roman971 dropped the commit with the refactor to the Path stuff, if the Path refactor is required let's do it in a separate branch then

}

s32 func_808AC22C(Path* pathList, Vec3f* pos, s32 path, s32 waypoint) {
Vec3s* pointPos = &((Vec3s*)SEGMENTED_TO_VIRTUAL(((Path*)pathList + path)->points))[waypoint];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Vec3s* pointPos = &((Vec3s*)SEGMENTED_TO_VIRTUAL(((Path*)pathList + path)->points))[waypoint];
Vec3s* pointPos = &((Vec3s*)SEGMENTED_TO_VIRTUAL(pathList[path].points))[waypoint];

Copy link
Contributor Author

@i82orbom i82orbom Sep 1, 2020

Choose a reason for hiding this comment

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

Unfortunately doing it like this causes regalloc issues and a non matching function

I've changed to:

    Vec3s* pointPos = &((Vec3s*)SEGMENTED_TO_VIRTUAL((pathList + path)->points))[waypoint];

I've removed the cast to Path * and this matches, but accessing the path with [] breaks the function... pretty weird....

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, not very surprising but it's odd. We can go with it for now but it will probably be improved somehow later.

@ethteck ethteck merged commit 612980f into zeldaret:master Sep 4, 2020
@i82orbom i82orbom deleted the z_bg_spot01_objects2 branch September 26, 2020 09:15
louist103 pushed a commit to louist103/oot that referenced this pull request Jan 3, 2023
* Starts z_bg_spot01_objects2

* z_bg_spot01_objects2.c almost finished

* Finishes z_bg_spot01_objects2.c

* Removes unused asm

* PR comments and rebased to master

* Addresses PR comments #2

Co-authored-by: i82orbom <i82orbom i82orbom@github>
Co-authored-by: i82orbom <i82orbom@github.com>
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.

5 participants