-
Notifications
You must be signed in to change notification settings - Fork 58
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
Finish w_046 and import data #1511
Conversation
Any reason for creating the new Ext for weapon 46? I was able to do a find and replace to make it all use the normal |
src/weapon/w_046.c
Outdated
|
||
a1 = var_i >> 1; | ||
a0 = a1 + 1; | ||
var_a0 = D_146000_8017ABD0[a0 - ((a0 / 16) * 0x10)]; |
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.
This pattern is a0 % 16
. This comes up somewhat rarely but it's nice to be able to recognize it. You have it in a couple other places too.
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.
Helpful, thank you! Worth opening an issue on https://github.com/matt-kempster/m2c/issues to identify more of these automatically?
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 don't really know anything about m2c but sure, if you would want to open an issue I don't see why that would be a problem
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.
Done! matt-kempster/m2c#282
Ah I modified |
Got it, silly me, should have checked on that. Sad that it doesn't match up, these weapons are super weird. Looks good then, at least for now while we're still learning weapons. Once we get all the weapons decompiled hopefully we can find a unified solution to the Ext problem for them. |
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.
Looking great! Since you imported the data, could you link this weapon? There is an example here: https://github.com/Xeeynamo/sotn-decomp/pull/1493/files
src/weapon/w_046.c
Outdated
extern u16* g_WeaponCluts[]; | ||
extern s32 g_HandId; | ||
#include "shared.h" |
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.
extern u16* g_WeaponCluts[]; | |
extern s32 g_HandId; | |
#include "shared.h" | |
#include "shared.h" |
you should be able to delete these two lines
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 think they're referenced in shared.h
— should I move the includes down below the data defines?
...but I can get rid of these lines!
extern u16 D_146000_8017A2B0[];
extern u16 D_146000_8017A530[];
extern u16 D_146000_8017A670[];
extern u16 D_146000_8017A3F0[];
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.
Yeah, you would need to move shared.h
right before static void EntityWeaponAttack(Entity* self)
like the PR I linked above
Not sure about the extern u16 D_146000_*
, you should be able to delete them!
In order to get the linking working I had to decompile the last |
11afc59
to
b38ca7e
Compare
https://decomp.me/scratch/dKGxs
https://decomp.me/scratch/YGyQp