-
Notifications
You must be signed in to change notification settings - Fork 36
Watergun decomp #69
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
base: main
Are you sure you want to change the base?
Watergun decomp #69
Conversation
Report for GMSJ01 (6940483 - cdc29ce)📈 Matched code: 25.58% (+0.02%, +568 bytes) ✅ 11 new matches
📈 32 improvements in unmatched functions
...and 2 more improvements in unmatched functions |
include/M3DUtil/MActor.hpp
Outdated
|
|
||
| class MActor { | ||
| public: | ||
| enum AnimationType { BCK, BLK, BPK, BTP, BTK, BRK }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer a global enum with prefixed names, i.e. ANM_TYPE_BCK. That makes more sense when seen in code than MActor::BCK
include/Player/MarioMain.hpp
Outdated
| #define ATTR_IS_SHALLOW_WATER 0x10000 | ||
| #define ATTR_IS_WATER 0x20000 | ||
| #define ATTR_HAS_SHIRT 0x100000 | ||
| #define ATTR_IS_PERFORMING 0x200000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use an enum and give a more descriptive prefix than just ATTR_, something like MARIO_FLAG_* with the corresponding function/field being called checkMarioFlag & mMarioFlag (as other flags exist in the mario hierarchy)
include/Player/MarioMain.hpp
Outdated
| } else { | ||
| condition = false; | ||
| } | ||
| return condition; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does a simple return unk118 & attribute ? true : false not match? other "check" functions have all been like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, thanks for the heads up. Sometimes i get blinded by stupid shit trying to get it to match lmao.
include/Player/MarioMain.hpp
Outdated
| /* 0x38A */ char unk38A[0x5A]; | ||
|
|
||
| /* 0x3E4 */ void* mWaterGun; // TWaterGun | ||
| /* 0x3E4 */ TWaterGun* mWaterGun; // TWaterGun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the // TWaterGun comment
include/Player/MarioMain.hpp
Outdated
| /* 0x3EC */ u32 unk3EC; | ||
|
|
||
| /* 0x3F0 */ void* mYoshi; // TYoshi 0x3F0 | ||
| /* 0x3F0 */ TYoshi* mYoshi; // TYoshi 0x3F0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the // TYoshi 0x3F0 comment
include/gpMarDirector.hpp
Outdated
| u32 _080[0x29]; | ||
| u8 mGameState; | ||
|
|
||
| }* gpMarDirector; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't define classes & variables in one line, this is a C person fetish that makes new people very, very confused 😭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lmao, looking closer at this. This entire hpp is mute now since there is stuff decompiled for MarDirector :)
src/Player/WaterGun.cpp
Outdated
|
|
||
| extern size_t gpMarioAddress; | ||
|
|
||
| // Define the global variable in .data section |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless comment
src/Player/WaterGun.cpp
Outdated
| extern size_t gpMarioAddress; | ||
|
|
||
| // Define the global variable in .data section | ||
| TNozzleBmdData nozzleBmdData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use oxford commas to make formatting nicer, i.e.
{
{ a, b, c },
{ d, e },
{ f }, // oxford comma!
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL, i hated how it autoformatted it lmao, thanks :)
src/Player/WaterGun.cpp
Outdated
| // Unused stack space | ||
| // volatile u32 unused2[6]; | ||
| MsMtxSetRotRPH(mtx, 0.0f, 0.0f, 0.005493164f * gunAngle); | ||
| PSMTXConcat(J3DSys::mCurrentMtx, mtx, J3DSys::mCurrentMtx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use MTXConcat macro and others, the original code probably used these, and they will make porting easier
src/Player/WaterGun.cpp
Outdated
| } | ||
| } | ||
| } | ||
| return 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use true for bools here and in other places too please
I have been gatekeeping this for far too long. I am very sorry that this has taken so long, and it is probably a bit messy since i have worked so on and off on it.
I do really suspect that each nozzle was their own class, but the map says nothing of it. Idk if fully inlined classes is possible or not? On the other hand it wouldn't make sense bcs of the getNozzleKind 🤔 Idk, something in here is very puzzling to me still.
I dislike the way NozzleTypes work rn, but i'm not sure how to do it "properly". Suggestions are appreciated :)
Any other remarks are also appreciated, again, sorry for this being mega huge. Especially WaterGun.cpp