mirror of https://github.com/zeldaret/tmc.git
Merge pull request #34 from huderlem:heartContainer
Finish decompiling heartContainer.c
This commit is contained in:
commit
cbf02a618e
|
@ -1,76 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
thumb_func_start sub_0808E714
|
|
||||||
sub_0808E714: @ 0x0808E714
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldrb r3, [r4, #0xf]
|
|
||||||
lsls r0, r3, #3
|
|
||||||
movs r1, #0x80
|
|
||||||
lsls r1, r1, #3
|
|
||||||
subs r2, r1, r0
|
|
||||||
movs r0, #0x80
|
|
||||||
lsls r0, r0, #1
|
|
||||||
cmp r2, r0
|
|
||||||
ble _0808E73A
|
|
||||||
adds r0, r3, #1
|
|
||||||
strb r0, [r4, #0xf]
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r1, r2, #0
|
|
||||||
movs r3, #0
|
|
||||||
bl sub_0805EC9C
|
|
||||||
b _0808E756
|
|
||||||
_0808E73A:
|
|
||||||
movs r0, #3
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
adds r2, r4, #0
|
|
||||||
adds r2, #0x3c
|
|
||||||
ldrb r1, [r2]
|
|
||||||
movs r0, #0x10
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r2]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0805EC60
|
|
||||||
ldr r0, _0808E760 @ =0x00000141
|
|
||||||
bl PlaySFX
|
|
||||||
_0808E756:
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08080CB4
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_0808E760: .4byte 0x00000141
|
|
||||||
|
|
||||||
thumb_func_start sub_0808E764
|
|
||||||
sub_0808E764: @ 0x0808E764
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_08080CB4
|
|
||||||
ldr r0, _0808E79C @ =gLinkState
|
|
||||||
ldr r0, [r0, #0x30]
|
|
||||||
movs r1, #0x80
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0808E79A
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08017850
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0808E79A
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x84
|
|
||||||
ldrh r0, [r0]
|
|
||||||
bl SetFlag
|
|
||||||
movs r0, #0x62
|
|
||||||
movs r1, #0
|
|
||||||
movs r2, #0
|
|
||||||
bl CreateItemEntity
|
|
||||||
bl DeleteThisEntity
|
|
||||||
_0808E79A:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_0808E79C: .4byte gLinkState
|
|
|
@ -1,7 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
23301
data/data_081208A0.s
23301
data/data_081208A0.s
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -741,7 +741,6 @@ SECTIONS {
|
||||||
asm/object45.o(.text);
|
asm/object45.o(.text);
|
||||||
asm/giantBookLadder.o(.text);
|
asm/giantBookLadder.o(.text);
|
||||||
src/object/heartContainer.o(.text);
|
src/object/heartContainer.o(.text);
|
||||||
asm/heartContainer.o(.text);
|
|
||||||
asm/object48.o(.text);
|
asm/object48.o(.text);
|
||||||
src/object/object49.o(.text);
|
src/object/object49.o(.text);
|
||||||
asm/object49.o(.text);
|
asm/object49.o(.text);
|
||||||
|
@ -917,6 +916,8 @@ SECTIONS {
|
||||||
src/object/greatFairy.o(.rodata);
|
src/object/greatFairy.o(.rodata);
|
||||||
data/greatFairyAnimations.o(.rodata);
|
data/greatFairyAnimations.o(.rodata);
|
||||||
data/data_081208A0.o(.rodata);
|
data/data_081208A0.o(.rodata);
|
||||||
|
src/object/heartContainer.o(.rodata);
|
||||||
|
data/data_08121C58.o(.rodata);
|
||||||
data/strings.o(.rodata);
|
data/strings.o(.rodata);
|
||||||
data/data_089FC6C4.o(.rodata);
|
data/data_089FC6C4.o(.rodata);
|
||||||
} >rom
|
} >rom
|
||||||
|
|
|
@ -1,21 +1,33 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "entity.h"
|
#include "entity.h"
|
||||||
#include "flags.h"
|
#include "flags.h"
|
||||||
|
#include "functions.h"
|
||||||
|
|
||||||
extern void DeleteThisEntity();
|
extern void DeleteThisEntity();
|
||||||
extern void sub_0808E714(Entity*);
|
extern void sub_08080CB4(Entity*);
|
||||||
|
extern int sub_08017850(Entity*);
|
||||||
|
extern void CreateItemEntity(u32, u32, u32);
|
||||||
|
|
||||||
extern void (*const gUnk_08121C48[])(Entity*);
|
static void sub_0808E6A0(Entity*);
|
||||||
|
static void sub_0808E6E4(Entity*);
|
||||||
|
static void sub_0808E714(Entity*);
|
||||||
|
static void sub_0808E764(Entity*);
|
||||||
|
|
||||||
|
static void (*const gHeartContainerActions[])(Entity*) = {
|
||||||
|
sub_0808E6A0,
|
||||||
|
sub_0808E6E4,
|
||||||
|
sub_0808E714,
|
||||||
|
sub_0808E764,
|
||||||
|
};
|
||||||
|
|
||||||
extern BoundingBox gUnk_08121C58;
|
extern BoundingBox gUnk_08121C58;
|
||||||
|
|
||||||
void HeartContainer(Entity* this) {
|
void HeartContainer(Entity* this) {
|
||||||
gUnk_08121C48[this->action](this);
|
gHeartContainerActions[this->action](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0808E6A0(Entity* this) {
|
static void sub_0808E6A0(Entity* this) {
|
||||||
|
if (CheckFlags(this->cutsceneBeh.HWORD)) {
|
||||||
if (CheckFlags(*(u16*)&this->cutsceneBeh)) {
|
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
|
@ -26,7 +38,7 @@ void sub_0808E6A0(Entity* this) {
|
||||||
this->scriptedScene = 3;
|
this->scriptedScene = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0808E6E4(Entity* this) {
|
static void sub_0808E6E4(Entity* this) {
|
||||||
if (CheckFlags(this->field_0x86)) {
|
if (CheckFlags(this->field_0x86)) {
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
this->spriteSettings.b.draw = 1;
|
this->spriteSettings.b.draw = 1;
|
||||||
|
@ -34,3 +46,26 @@ void sub_0808E6E4(Entity* this) {
|
||||||
sub_0808E714(this);
|
sub_0808E714(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void sub_0808E714(Entity* this) {
|
||||||
|
int var0 = 0x400 - this->field_0xf * 8;
|
||||||
|
if (var0 > 0x100) {
|
||||||
|
this->field_0xf++;
|
||||||
|
sub_0805EC9C(this, var0, var0, 0);
|
||||||
|
} else {
|
||||||
|
this->action = 3;
|
||||||
|
this->field_0x3c |= 0x10;
|
||||||
|
sub_0805EC60(this);
|
||||||
|
PlaySFX(0x141);
|
||||||
|
}
|
||||||
|
sub_08080CB4(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sub_0808E764(Entity* this) {
|
||||||
|
sub_08080CB4(this);
|
||||||
|
if (!(gLinkState.flags.all & 0x80) && sub_08017850(this)) {
|
||||||
|
SetFlag(this->cutsceneBeh.HWORD);
|
||||||
|
CreateItemEntity(0x62, 0, 0);
|
||||||
|
DeleteThisEntity();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue