Decompile w45 func_ptr_80170010 (#1332)

Another one of these weapon functions that needs to return s32, so they
all got changed over.
This commit is contained in:
bismurphy 2024-06-16 19:08:37 -04:00 committed by GitHub
parent b5678baf97
commit b01fe2b36b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
57 changed files with 141 additions and 57 deletions

View File

@ -18,7 +18,7 @@ void EntityWeaponAttack(Entity* self);
s32 func_ptr_80170004(Entity* self);
void func_ptr_80170008(Entity* self);
void func_ptr_8017000C(Entity* self);
void func_ptr_80170010(Entity* self);
s32 func_ptr_80170010(Entity* self);
s32 func_ptr_80170014(Entity* self);
int GetWeaponId(void);
void LoadWeaponPalette(s32 clutIndex);

View File

@ -580,7 +580,7 @@ void EntityWeaponAttack(Entity* self) { NOT_IMPLEMENTED; }
s32 func_ptr_80170004(Entity* self) { NOT_IMPLEMENTED; }
void func_ptr_80170008(Entity* self) { NOT_IMPLEMENTED; }
void func_ptr_8017000C(Entity* self) { NOT_IMPLEMENTED; }
void func_ptr_80170010(Entity* self) { NOT_IMPLEMENTED; }
s32 func_ptr_80170010(Entity* self) { NOT_IMPLEMENTED; }
s32 func_ptr_80170014(Entity* self) { NOT_IMPLEMENTED; }
int GetWeaponId(void) {
NOT_IMPLEMENTED;

View File

@ -246,7 +246,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -58,7 +58,7 @@ void func_ptr_80170008(Entity* self) {
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -61,7 +61,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -63,7 +63,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -63,7 +63,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -112,7 +112,7 @@ INCLUDE_ASM("weapon/nonmatchings/w_006", func_ptr_80170008);
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -61,7 +61,7 @@ INCLUDE_ASM("weapon/nonmatchings/w_007", func_ptr_80170008);
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -33,7 +33,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ INCLUDE_ASM("weapon/nonmatchings/w_012", func_ptr_80170008);
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -84,7 +84,7 @@ INCLUDE_ASM("weapon/nonmatchings/w_013", func_ptr_80170008);
INCLUDE_ASM("weapon/nonmatchings/w_013", func_ptr_8017000C);
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -34,7 +34,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ INCLUDE_ASM("weapon/nonmatchings/w_020", func_ptr_80170008);
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -528,7 +528,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -52,7 +52,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -20,7 +20,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -169,7 +169,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -146,7 +146,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -193,7 +193,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -62,7 +62,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -63,7 +63,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -62,7 +62,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -263,7 +263,7 @@ INCLUDE_ASM("weapon/nonmatchings/w_037", func_ptr_80170008);
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -232,7 +232,7 @@ void func_ptr_8017000C(Entity* self) {
}
}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -202,7 +202,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -291,7 +291,7 @@ void func_ptr_8017000C(Entity* self) {
}
}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ INCLUDE_ASM("weapon/nonmatchings/w_043", func_ptr_80170008);
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -3,6 +3,10 @@
#include "weapon_private.h"
#include "shared.h"
extern SpriteParts D_13F000_8017A040[];
extern s32 D_13F000_8017B3B8;
extern s32 D_13F000_8017B3BC;
int func_13F000_8017A718() {
int var;
if (!(g_Player.unk44 & 2)) {
@ -41,7 +45,87 @@ INCLUDE_ASM("weapon/nonmatchings/w_045", func_ptr_80170008);
INCLUDE_ASM("weapon/nonmatchings/w_045", func_ptr_8017000C);
INCLUDE_ASM("weapon/nonmatchings/w_045", func_ptr_80170010);
s32 func_ptr_80170010(Entity* self) {
D_13F000_8017B3BC += 0x80;
SetSpriteBank1(D_13F000_8017A040);
if (g_HandId != 0) {
g_CurrentEntity->animSet = ANIMSET_OVL(0x12);
g_CurrentEntity->palette = 0x128;
g_CurrentEntity->unk5A = 0x66;
} else {
g_CurrentEntity->animSet = ANIMSET_OVL(0x10);
g_CurrentEntity->palette = 0x110;
g_CurrentEntity->unk5A = 0x64;
}
PLAYER.drawFlags = DRAW_COLORS;
switch (PLAYER.step_s) {
case 0:
if (PLAYER.entityRoomIndex == PLAYER.facingLeft) {
PLAYER.rotZ = -0x200;
} else {
PLAYER.rotZ = 0x200;
}
PLAYER.rotPivotY = 0x14;
PLAYER.step_s++;
return;
case 1:
PLAYER.velocityY += FIX(22.0 / 128);
if (PLAYER.velocityY > FIX(7)) {
PLAYER.velocityY = FIX(7);
}
if (g_Player.pl_vram_flag & 2) {
PLAYER.velocityY = FIX(1);
}
if (g_Player.pl_vram_flag & 1) {
if (PLAYER.entityRoomIndex == PLAYER.facingLeft) {
PLAYER.rotZ = -0x380;
} else {
PLAYER.rotZ = 0x380;
}
PLAYER.step_s = 2;
PLAYER.velocityY = 0;
D_13F000_8017B3B8 = 0x30;
g_api.PlaySfx(0x64B);
// Blueprint 0 makes child 2, func_8011B5A4
g_api.CreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 0), 0);
return;
}
return;
case 2:
PLAYER.drawFlags = DRAW_HIDE | DRAW_COLORS;
PLAYER.unk6C = (rsin(D_13F000_8017B3BC) >> 7) - 0x40;
if (!(g_Player.pl_vram_flag & 1)) {
PLAYER.step = Player_AxearmorJump;
PLAYER.step_s = 0;
PLAYER.velocityY = 0;
PLAYER.ext.player.anim = 0xD0;
PLAYER.animFrameIdx = 0;
PLAYER.animFrameDuration = 0;
PLAYER.rotZ = 0;
PLAYER.drawFlags = 0;
return;
}
DecelerateX(FIX(16.0 / 128));
if (D_13F000_8017B3B8 == 5) {
if (PLAYER.entityRoomIndex == PLAYER.facingLeft) {
PLAYER.rotZ = -0x200;
} else {
PLAYER.rotZ = 0x200;
}
}
if (!--D_13F000_8017B3B8) {
PLAYER.step = Player_AxearmorStand;
PLAYER.step_s = 0;
PLAYER.velocityY = 0;
PLAYER.ext.player.anim = 0xCF;
PLAYER.animFrameIdx = 0;
PLAYER.animFrameDuration = 0;
PLAYER.rotZ = 0;
PLAYER.drawFlags = 0;
}
break;
}
}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -40,7 +40,7 @@ INCLUDE_ASM("weapon/nonmatchings/w_048", func_ptr_80170008);
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -559,7 +559,7 @@ void func_ptr_80170008(Entity* self) {
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -9,7 +9,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -12,7 +12,7 @@ INCLUDE_ASM("weapon/nonmatchings/w_053", func_ptr_80170008);
INCLUDE_ASM("weapon/nonmatchings/w_053", func_ptr_8017000C);
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -63,7 +63,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -11,7 +11,7 @@ void func_ptr_80170008(Entity* self) {}
void func_ptr_8017000C(Entity* self) {}
void func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170010(Entity* self) {}
s32 func_ptr_80170014(Entity* self) {}

View File

@ -20,7 +20,7 @@ void LoadWeaponPalette(s32 clutIndex);
s32 func_ptr_80170004(Entity* self);
void func_ptr_80170008(Entity* self);
void func_ptr_8017000C(Entity* self);
void func_ptr_80170010(Entity* self);
s32 func_ptr_80170010(Entity* self);
s32 func_ptr_80170014(Entity* self);
int GetWeaponId(void);
void EntityWeaponShieldSpell(Entity* self);