mirror of https://github.com/zeldaret/tmc.git
Merge pull request #371 from hatal175/newbranch
Decompile the rest of playeritem12
This commit is contained in:
commit
5c0b27788b
|
|
@ -1,121 +0,0 @@
|
|||
.syntax unified
|
||||
push {r4, r5, lr}
|
||||
adds r5, r0, #0
|
||||
movs r2, #1
|
||||
movs r3, #1
|
||||
strb r3, [r5, #0xc]
|
||||
ldrb r1, [r5, #0x18]
|
||||
movs r0, #4
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r1
|
||||
orrs r0, r2
|
||||
strb r0, [r5, #0x18]
|
||||
ldrb r1, [r5, #0x10]
|
||||
movs r0, #0x80
|
||||
orrs r0, r1
|
||||
strb r0, [r5, #0x10]
|
||||
ldrb r0, [r5, #0x14]
|
||||
lsls r0, r0, #2
|
||||
strb r0, [r5, #0x15]
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #2
|
||||
strh r0, [r5, #0x24]
|
||||
movs r0, #0x40
|
||||
str r0, [r5, #0x74]
|
||||
movs r0, #0xf0
|
||||
lsls r0, r0, #1
|
||||
str r0, [r5, #0x78]
|
||||
ldr r2, _0807017C @ =gPlayerEntity
|
||||
ldr r1, _08070180 @ =gUnk_0811B9A0
|
||||
ldrb r0, [r5, #0x14]
|
||||
adds r0, r0, r1
|
||||
ldrb r0, [r0]
|
||||
lsls r0, r0, #0x18
|
||||
asrs r0, r0, #0x18
|
||||
ldrh r4, [r2, #0x2e]
|
||||
adds r0, r0, r4
|
||||
strh r0, [r5, #0x2e]
|
||||
ldrb r0, [r5, #0x14]
|
||||
adds r0, #1
|
||||
adds r0, r0, r1
|
||||
ldrb r0, [r0]
|
||||
lsls r0, r0, #0x18
|
||||
asrs r0, r0, #0x18
|
||||
ldrh r1, [r2, #0x32]
|
||||
adds r0, r0, r1
|
||||
strh r0, [r5, #0x32]
|
||||
adds r1, r5, #0
|
||||
adds r1, #0x3c
|
||||
movs r0, #7
|
||||
strb r0, [r1]
|
||||
subs r1, #1
|
||||
movs r0, #0x8a
|
||||
strb r0, [r1]
|
||||
ldr r0, _08070184 @ =gUnk_0811B9D0
|
||||
str r0, [r5, #0x48]
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x38
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #2
|
||||
bne _08070188
|
||||
strb r3, [r5, #0xa]
|
||||
b _0807018C
|
||||
.align 2, 0
|
||||
_0807017C: .4byte gPlayerEntity
|
||||
_08070180: .4byte gUnk_0811B9A0
|
||||
_08070184: .4byte gUnk_0811B9D0
|
||||
_08070188:
|
||||
movs r0, #0
|
||||
strb r0, [r5, #0xa]
|
||||
_0807018C:
|
||||
ldrb r1, [r2, #0x1b]
|
||||
lsrs r1, r1, #6
|
||||
lsls r1, r1, #6
|
||||
ldrb r2, [r5, #0x1b]
|
||||
movs r0, #0x3f
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strb r0, [r5, #0x1b]
|
||||
ldrb r3, [r5, #0x14]
|
||||
lsrs r3, r3, #1
|
||||
lsls r3, r3, #3
|
||||
ldr r0, _080701F0 @ =gUnk_0811B9A8
|
||||
adds r3, r3, r0
|
||||
ldrb r1, [r3]
|
||||
movs r0, #1
|
||||
ands r1, r0
|
||||
lsls r1, r1, #6
|
||||
ldrb r2, [r5, #0x18]
|
||||
movs r0, #0x41
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strb r0, [r5, #0x18]
|
||||
ldrb r1, [r3, #1]
|
||||
lsls r1, r1, #7
|
||||
movs r2, #0x7f
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strb r0, [r5, #0x18]
|
||||
ldrb r0, [r3, #4]
|
||||
adds r4, r5, #0
|
||||
adds r4, #0x58
|
||||
strb r0, [r4]
|
||||
movs r0, #2
|
||||
ldrsb r0, [r3, r0]
|
||||
str r0, [r5, #0x6c]
|
||||
movs r0, #3
|
||||
ldrsb r0, [r3, r0]
|
||||
str r0, [r5, #0x70]
|
||||
adds r0, r5, #0
|
||||
bl sub_0801766C
|
||||
ldrb r1, [r4]
|
||||
adds r0, r5, #0
|
||||
bl InitializeAnimation
|
||||
ldr r0, _080701F4 @ =0x000001DD
|
||||
bl SoundReq
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
_080701F0: .4byte gUnk_0811B9A8
|
||||
_080701F4: .4byte 0x000001DD
|
||||
.syntax divided
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
.syntax unified
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
bl GetNextFrame
|
||||
movs r1, #0x2e
|
||||
ldrsh r0, [r4, r1]
|
||||
ldr r2, _08070404 @ =gRoomControls
|
||||
ldrh r1, [r2, #6]
|
||||
subs r0, r0, r1
|
||||
asrs r0, r0, #4
|
||||
movs r3, #0x3f
|
||||
ands r0, r3
|
||||
movs r5, #0x32
|
||||
ldrsh r1, [r4, r5]
|
||||
ldrh r2, [r2, #8]
|
||||
subs r1, r1, r2
|
||||
asrs r1, r1, #4
|
||||
ands r1, r3
|
||||
lsls r1, r1, #6
|
||||
orrs r0, r1
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x38
|
||||
ldrb r1, [r1]
|
||||
bl GetTileIndex
|
||||
adds r1, r0, #0
|
||||
ldr r0, _08070408 @ =0x00004021
|
||||
cmp r1, r0
|
||||
beq _0807042E
|
||||
cmp r1, r0
|
||||
bhi _0807040C
|
||||
subs r0, #1
|
||||
cmp r1, r0
|
||||
beq _08070420
|
||||
b _08070412
|
||||
.align 2, 0
|
||||
_08070404: .4byte gRoomControls
|
||||
_08070408: .4byte 0x00004021
|
||||
_0807040C:
|
||||
ldr r0, _08070418 @ =0x00004070
|
||||
cmp r1, r0
|
||||
beq _0807041C
|
||||
_08070412:
|
||||
movs r0, #0
|
||||
str r0, [r4, #0x7c]
|
||||
b _0807042E
|
||||
.align 2, 0
|
||||
_08070418: .4byte 0x00004070
|
||||
_0807041C:
|
||||
movs r0, #0xff
|
||||
str r0, [r4, #0x78]
|
||||
_08070420:
|
||||
ldr r0, [r4, #0x78]
|
||||
subs r0, #1
|
||||
str r0, [r4, #0x78]
|
||||
movs r1, #1
|
||||
rsbs r1, r1, #0
|
||||
cmp r0, r1
|
||||
bne _08070436
|
||||
_0807042E:
|
||||
adds r0, r4, #0
|
||||
bl sub_08070458
|
||||
b _08070454
|
||||
_08070436:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x41
|
||||
ldrb r1, [r0]
|
||||
cmp r1, #0
|
||||
beq _08070454
|
||||
movs r0, #0x7f
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _0807044E
|
||||
ldrb r0, [r4, #0xc]
|
||||
cmp r0, #0x1a
|
||||
bne _08070454
|
||||
_0807044E:
|
||||
adds r0, r4, #0
|
||||
bl sub_08070458
|
||||
_08070454:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
.syntax divided
|
||||
|
|
@ -41580,26 +41580,6 @@
|
|||
"size": 76,
|
||||
"type": "sprite_frame"
|
||||
},
|
||||
{
|
||||
"path": "playerItem12/gUnk_0811B9A0.bin",
|
||||
"start": 1161632,
|
||||
"size": 8
|
||||
},
|
||||
{
|
||||
"path": "playerItem12/gUnk_0811B9A8.bin",
|
||||
"start": 1161640,
|
||||
"size": 32
|
||||
},
|
||||
{
|
||||
"path": "playerItem12/gUnk_0811B9C8.bin",
|
||||
"start": 1161672,
|
||||
"size": 8
|
||||
},
|
||||
{
|
||||
"path": "playerItem12/gUnk_0811B9D0.bin",
|
||||
"start": 1161680,
|
||||
"size": 8
|
||||
},
|
||||
{
|
||||
"path": "itemBomb/gUnk_0811BDAC.bin",
|
||||
"start": 1162668,
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.section .rodata
|
||||
.align 2
|
||||
|
||||
gUnk_0811B98C:: @ 0811B98C
|
||||
.4byte sub_08070100
|
||||
.4byte sub_080701F8
|
||||
.4byte sub_0807037C
|
||||
.4byte sub_08070398
|
||||
.4byte sub_080703BC
|
||||
|
||||
gUnk_0811B9A0:: @ 0811B9A0
|
||||
.incbin "playerItem12/gUnk_0811B9A0.bin"
|
||||
|
||||
gUnk_0811B9A8:: @ 0811B9A8
|
||||
.incbin "playerItem12/gUnk_0811B9A8.bin"
|
||||
|
||||
gUnk_0811B9C8:: @ 0811B9C8
|
||||
.incbin "playerItem12/gUnk_0811B9C8.bin"
|
||||
|
||||
gUnk_0811B9D0:: @ 0811B9D0
|
||||
.incbin "playerItem12/gUnk_0811B9D0.bin"
|
||||
|
|
@ -1336,7 +1336,7 @@ SECTIONS {
|
|||
src/coord.o(.rodata);
|
||||
src/playerHitbox.o(.rodata);
|
||||
data/gfx/sprite_frames.o(.rodata);
|
||||
data/const/playerItem/playerItem12.o(.rodata);
|
||||
src/playerItem/playerItem12.o(.rodata);
|
||||
data/const/playerItem/playerItemPacciCane.o(.rodata);
|
||||
src/player.o(.rodata);
|
||||
src/item.o(.rodata);
|
||||
|
|
|
|||
|
|
@ -2,18 +2,133 @@
|
|||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "sound.h"
|
||||
#include "object.h"
|
||||
|
||||
extern void (*const gUnk_0811B98C[])(Entity*);
|
||||
static const Hitbox gUnk_0811B9D0;
|
||||
|
||||
void PlayerItem12_Init(Entity* this);
|
||||
void sub_080701F8(Entity* this);
|
||||
void sub_0807037C(Entity* this);
|
||||
void sub_08070398(Entity* this);
|
||||
void sub_080703BC(Entity* this);
|
||||
void sub_08070458(Entity* this);
|
||||
|
||||
extern void sub_08017744(Entity*);
|
||||
extern u8* sub_08008782(Entity*, u32, u32, u32);
|
||||
|
||||
void PlayerItem12(Entity* this) {
|
||||
gUnk_0811B98C[this->action](this);
|
||||
static void (*const PlayerItem12_Actions[])(Entity*) = {
|
||||
PlayerItem12_Init, sub_080701F8, sub_0807037C, sub_08070398, sub_080703BC,
|
||||
};
|
||||
PlayerItem12_Actions[this->action](this);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/playerItem12/sub_08070100.inc", void sub_08070100(Entity* this))
|
||||
extern u8 gUnk_08003E44;
|
||||
|
||||
ASM_FUNC("asm/non_matching/playerItem12/sub_080701F8.inc", void sub_080701F8(Entity* this))
|
||||
typedef struct {
|
||||
u8 flipX;
|
||||
u8 flipY;
|
||||
s8 unk2;
|
||||
s8 unk3;
|
||||
u8 animIndex;
|
||||
u8 filler[3];
|
||||
} gUnk_0811B9A8_struct;
|
||||
|
||||
void PlayerItem12_Init(Entity* this) {
|
||||
static const s8 gUnk_0811B9A0[] = {
|
||||
0, -18, 14, 0, 0, 14, -14, 0,
|
||||
};
|
||||
static const gUnk_0811B9A8_struct gUnk_0811B9A8[] = {
|
||||
{ 0, 0, 0, -5, 17, { 0, 0, 0 } },
|
||||
{ 1, 0, 5, 0, 18, { 0, 0, 0 } },
|
||||
{ 0, 1, 0, 5, 17, { 0, 0, 0 } },
|
||||
{ 0, 0, -5, 0, 18, { 0, 0, 0 } },
|
||||
};
|
||||
const gUnk_0811B9A8_struct* ptr;
|
||||
|
||||
this->action = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
COLLISION_ON(this);
|
||||
this->direction = this->animationState << 2;
|
||||
this->speed = 0x200;
|
||||
*(u32*)&this->field_0x74 = 0x40;
|
||||
*(u32*)&this->field_0x78 = 0x1e0;
|
||||
this->x.HALF.HI = gPlayerEntity.x.HALF.HI + gUnk_0811B9A0[this->animationState];
|
||||
this->y.HALF.HI = gPlayerEntity.y.HALF.HI + gUnk_0811B9A0[this->animationState + 1];
|
||||
this->field_0x3c = 7;
|
||||
this->flags2 = 0x8a;
|
||||
this->hitbox = (Hitbox*)&gUnk_0811B9D0;
|
||||
if (this->collisionLayer == 2) {
|
||||
this->type = 1;
|
||||
} else {
|
||||
this->type = 0;
|
||||
}
|
||||
this->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
|
||||
ptr = &gUnk_0811B9A8[(this->animationState >> 1)];
|
||||
this->spriteSettings.flipX = ptr->flipX;
|
||||
this->spriteSettings.flipY = ptr->flipY;
|
||||
this->animIndex = ptr->animIndex;
|
||||
*(int*)&this->field_0x6c = ptr->unk2;
|
||||
this->field_0x70.WORD = ptr->unk3;
|
||||
sub_0801766C(this);
|
||||
InitializeAnimation(this, this->animIndex);
|
||||
SoundReq(SFX_1DD);
|
||||
}
|
||||
|
||||
void sub_080701F8(Entity* this) {
|
||||
static const s8 gUnk_0811B9C8[] = {
|
||||
0, -4, 4, 0, 0, 4, -4, 0,
|
||||
};
|
||||
u32 cVar1;
|
||||
u32 cVar2;
|
||||
u8* iVar3;
|
||||
Entity* pEVar4;
|
||||
|
||||
cVar1 = gUnk_0811B9C8[this->animationState];
|
||||
cVar2 = gUnk_0811B9C8[this->animationState + 1];
|
||||
iVar3 = sub_08008782(this, 10, cVar1, cVar2);
|
||||
if (iVar3) {
|
||||
pEVar4 = CreateObject(OBJECT_53, iVar3[5], iVar3[2]);
|
||||
if (pEVar4) {
|
||||
pEVar4->actionDelay = iVar3[3];
|
||||
pEVar4->x.HALF.HI = this->x.HALF.HI + cVar1;
|
||||
pEVar4->y.HALF.HI = this->y.HALF.HI + cVar2;
|
||||
}
|
||||
|
||||
sub_08070458(this);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((--(*(int*)&this->field_0x74) == -1) || (--(*(int*)&this->field_0x78) == -1)) {
|
||||
sub_08070458(this);
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
LinearMoveUpdate(this);
|
||||
if (this->type == 0) {
|
||||
sub_0800451C(this);
|
||||
}
|
||||
if (sub_080002F0(COORD_TO_TILE(this), gPlayerEntity.collisionLayer, 0x80) == 0) {
|
||||
if (sub_080040D8(this, &gUnk_08003E44, this->x.HALF.HI, this->y.HALF.HI) == 0) {
|
||||
if (sub_080002B8(this) == 0x19) {
|
||||
this->action = 4;
|
||||
COLLISION_OFF(this);
|
||||
this->x.HALF.HI = (this->x.HALF.HI & 0xfff0) | 8;
|
||||
this->y.HALF.HI = (this->y.HALF.HI & 0xfff0) | 8;
|
||||
this->spritePriority.b0 = 7;
|
||||
this->field_0x7c.WORD = GetTileIndex(COORD_TO_TILE(this), this->collisionLayer);
|
||||
InitializeAnimation(this, 0x14);
|
||||
SetTile(0x4020, COORD_TO_TILE(this), this->collisionLayer);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
sub_08070458(this);
|
||||
}
|
||||
}
|
||||
if (this->bitfield != 0) {
|
||||
sub_08070458(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0807037C(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
|
|
@ -30,7 +145,34 @@ void sub_08070398(Entity* this) {
|
|||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/playerItem12/sub_080703BC.inc", void sub_080703BC(Entity* this))
|
||||
void sub_080703BC(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
switch (GetTileIndex(COORD_TO_TILE(this), this->collisionLayer)) {
|
||||
default:
|
||||
this->field_0x7c.WORD = 0;
|
||||
sub_08070458(this);
|
||||
break;
|
||||
case 0x4021:
|
||||
sub_08070458(this);
|
||||
break;
|
||||
case 0x4070:
|
||||
*(int*)&this->field_0x78 = 0xff;
|
||||
case 0x4020:
|
||||
if (--(*(int*)&this->field_0x78) == -1) {
|
||||
sub_08070458(this);
|
||||
} else {
|
||||
if (this->bitfield == 0) {
|
||||
return;
|
||||
}
|
||||
if (((this->bitfield & 0x7f) == 0) && (this->action != 0x1a)) {
|
||||
return;
|
||||
}
|
||||
sub_08070458(this);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08070458(Entity* this) {
|
||||
this->action = 2;
|
||||
|
|
@ -43,3 +185,5 @@ void sub_08070458(Entity* this) {
|
|||
sub_08017744(this);
|
||||
SoundReq(SFX_199);
|
||||
}
|
||||
|
||||
static const Hitbox gUnk_0811B9D0 = { 0, 0, 4, 2, 2, 4, 4, 4 };
|
||||
|
|
|
|||
Loading…
Reference in New Issue