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

d_wood (bushes) matching #682

Merged
merged 43 commits into from
Oct 31, 2024
Merged

d_wood (bushes) matching #682

merged 43 commits into from
Oct 31, 2024

Conversation

themikelester
Copy link
Contributor

Lago, I've been out of this scene for 5 years, but excited to be back and contributing. Please let me know if you see anything egregious in here, or anything I can do to match your style better.

include/d/d_wood.h Outdated Show resolved Hide resolved
include/d/d_tree.h Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
@LagoLunatic
Copy link
Collaborator

some general notes about the style:

  • you're using two spaces for indentation, this decomp uses four spaces.
  • you should keep the "Nonmatching" comments in until the function is matched. you said the TU is only 73% matched, so I assume several of the functions aren't at 100% yet, but all of the comments were removed.
  • it looks like you're using an autoformatter that limits line length, based on the comments containing the mangled symbol names (like cc_hit_before_cut__Q25dWood6Unit_cFPQ25dWood8Packet_c) getting split onto multiple lines instead of one. I'd recommend turning this off, we don't usually use an autoformatter and I find it easier if those automatically-generated comments don't get edited.

@themikelester
Copy link
Contributor Author

Thanks! Style replies:

  • A mistake. It appears something got tweaked in my vscode settings
  • Ah, I'll definitely keep Nonmatching comments until complete, good idea
  • Interesting! The line trimming was bothering me too 😅. I actually thought it was using the project's default settings because there is a default formatter set in settings.json (which I see that you just changed this week). I'll tweak my settings to avoid line trimming

@LagoLunatic
Copy link
Collaborator

I actually thought it was using the project's default settings because there is a default formatter set in settings.json (which I see that you just changed this week).

oh, I thought I removed that after copying it from dtk-template but I must have just disabled it locally, my mistake. I removed it now.

The only error is that g_dTree_shadowTexCoord is still using a 32-bit load instead of 16. the only way I know of to fix that is to define the data in this compilation unit. But that can't be right
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
src/d/d_wood.cpp Outdated Show resolved Hide resolved
- No one line function implementations
- Replaced instances of (SomeType*)0x0 (copy/pasted from Ghidra) with NULL
- Replaced a few instances of 0.0 with 0.0f
- Replaced one instance where a number was used instead of an enum value
- Removed unused variables from functions
- Removed unnecessary iVar1 loop variables (leftover Ghidra detritus)
- Fixed dtk function comments being wrapped by autoformatter. They now always appear on one line
This moves g_dTree_shadowTexCoord into .sdata which allows d_wood::Packet_c::draw() to load its address with a single instruction. This  makes a 100% match for draw()
g_dTree_shadowTexCoord now lives in the d_tree .sdata section, so its instruction can be loaded with a single instruction. This makes a 100% match with draw().
Also renamed mWindDir to mForceDir as it represents both wind and an actor pushing from a vector
The l_matDL display list is dynamically patched to reference the l_Txa_swood_bTEX texture at static initialization time. Is there a better way to represent this?
@themikelester themikelester changed the title d_wood (bushes) 73% matching d_wood (bushes) 99.9% matching Oct 29, 2024
@themikelester
Copy link
Contributor Author

Last bit that isn't matching is that the .data section is too long due to the vtables from collision system objects. I'm unsure as to why this is. See this post

Had to move Packet_c destructor to get the functions in the right order. See discussion: https://discord.com/channels/727908905392275526/873250400483024976/1300680009458913280
@themikelester themikelester changed the title d_wood (bushes) 99.9% matching d_wood (bushes) matching Oct 29, 2024
@LagoLunatic
Copy link
Collaborator

I think the build is failing because an enum was moved on the main branch - try adding an include for d_cc_d.h and see if it fixes it

@LagoLunatic
Copy link
Collaborator

looks like there's a version difference - if you don't have the japanese version to check what it is you can use MatchingFor("GZLE01", "GZLP01") in configure.py to mark it as matching for only the non-japanese versions of the game for now.

@LagoLunatic LagoLunatic merged commit 64cc277 into zeldaret:main Oct 31, 2024
4 checks passed
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.

3 participants