mirror of https://github.com/zeldaret/tmc.git
Merge pull request #346 from hatal175/sittingperson
This commit is contained in:
commit
67d369c53b
|
@ -1,49 +0,0 @@
|
||||||
.syntax unified
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldrb r0, [r4, #0xa]
|
|
||||||
lsls r1, r0, #1
|
|
||||||
adds r1, r1, r0
|
|
||||||
lsls r1, r1, #2
|
|
||||||
ldr r0, _08063794 @ =gUnk_0810CB78
|
|
||||||
adds r1, r1, r0
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl LoadExtraSpriteData
|
|
||||||
cmp r0, #0
|
|
||||||
beq _080637B4
|
|
||||||
movs r2, #1
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
ldrb r1, [r4, #0xe]
|
|
||||||
ands r1, r2
|
|
||||||
lsls r1, r1, #6
|
|
||||||
ldrb r2, [r4, #0x18]
|
|
||||||
subs r0, #0x42
|
|
||||||
ands r0, r2
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r4, #0x18]
|
|
||||||
lsls r0, r0, #0x19
|
|
||||||
cmp r0, #0
|
|
||||||
blt _08063798
|
|
||||||
movs r0, #6
|
|
||||||
b _0806379A
|
|
||||||
.align 2, 0
|
|
||||||
_08063794: .4byte gUnk_0810CB78
|
|
||||||
_08063798:
|
|
||||||
movs r0, #2
|
|
||||||
_0806379A:
|
|
||||||
strb r0, [r4, #0x14]
|
|
||||||
ldrb r0, [r4, #0x14]
|
|
||||||
movs r1, #0
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x69
|
|
||||||
strb r1, [r0]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0807DD50
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_080637B8
|
|
||||||
_080637B4:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
.syntax divided
|
|
|
@ -1,114 +0,0 @@
|
||||||
.syntax unified
|
|
||||||
push {r4, r5, r6, lr}
|
|
||||||
adds r6, r0, #0
|
|
||||||
movs r4, #3
|
|
||||||
.ifdef JP
|
|
||||||
movs r0, #0xd7
|
|
||||||
.else
|
|
||||||
.ifdef EU
|
|
||||||
movs r0, #0xd7
|
|
||||||
.else
|
|
||||||
.ifdef DEMO_JP
|
|
||||||
movs r0, #0xd7 @ TODO deduplicate
|
|
||||||
.else
|
|
||||||
movs r0, #0xda
|
|
||||||
.endif
|
|
||||||
.endif
|
|
||||||
.endif
|
|
||||||
bl CheckLocalFlag
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08063896
|
|
||||||
movs r4, #0
|
|
||||||
.ifdef JP
|
|
||||||
movs r0, #0xd7
|
|
||||||
.else
|
|
||||||
.ifdef EU
|
|
||||||
movs r0, #0xd7
|
|
||||||
.else
|
|
||||||
.ifdef DEMO_JP
|
|
||||||
movs r0, #0xd7 @ TODO deduplicate
|
|
||||||
.else
|
|
||||||
movs r0, #0xda
|
|
||||||
.endif
|
|
||||||
.endif
|
|
||||||
.endif
|
|
||||||
bl SetLocalFlag
|
|
||||||
b _080638D6
|
|
||||||
_08063896:
|
|
||||||
.ifdef JP
|
|
||||||
movs r0, #0xce
|
|
||||||
.else
|
|
||||||
.ifdef EU
|
|
||||||
movs r0, #0xce
|
|
||||||
.else
|
|
||||||
.ifdef DEMO_JP
|
|
||||||
movs r0, #0xce @ TODO deduplicate
|
|
||||||
.else
|
|
||||||
movs r0, #0xd1
|
|
||||||
.endif
|
|
||||||
.endif
|
|
||||||
.endif
|
|
||||||
bl CheckLocalFlag
|
|
||||||
cmp r0, #0
|
|
||||||
bne _080638D6
|
|
||||||
movs r5, #0
|
|
||||||
movs r4, #1
|
|
||||||
_080638A4:
|
|
||||||
ldr r0, _080638F8 @ =gUnk_02002B0E
|
|
||||||
adds r1, r4, #0
|
|
||||||
bl ReadBit
|
|
||||||
cmp r0, #0
|
|
||||||
beq _080638B2
|
|
||||||
adds r5, #1
|
|
||||||
_080638B2:
|
|
||||||
adds r4, #1
|
|
||||||
cmp r4, #0x82
|
|
||||||
ble _080638A4
|
|
||||||
movs r4, #1
|
|
||||||
cmp r5, #0x81
|
|
||||||
ble _080638D6
|
|
||||||
movs r4, #2
|
|
||||||
.ifdef JP
|
|
||||||
movs r0, #0xce
|
|
||||||
.else
|
|
||||||
.ifdef EU
|
|
||||||
movs r0, #0xce
|
|
||||||
.else
|
|
||||||
.ifdef DEMO_JP
|
|
||||||
movs r0, #0xce @ TODO deduplicate
|
|
||||||
.else
|
|
||||||
movs r0, #0xd1
|
|
||||||
.endif
|
|
||||||
.endif
|
|
||||||
.endif
|
|
||||||
bl SetLocalFlag
|
|
||||||
ldr r0, _080638FC @ =0x00000A17
|
|
||||||
movs r1, #1
|
|
||||||
bl sub_0807BA8C
|
|
||||||
ldr r0, _08063900 @ =0x00000A57
|
|
||||||
movs r1, #1
|
|
||||||
bl sub_0807BA8C
|
|
||||||
_080638D6:
|
|
||||||
ldr r0, _08063904 @ =gSave
|
|
||||||
ldrb r0, [r0, #8]
|
|
||||||
subs r1, r0, #6
|
|
||||||
cmp r1, #0
|
|
||||||
bge _080638E2
|
|
||||||
movs r1, #0
|
|
||||||
_080638E2:
|
|
||||||
ldr r2, _08063908 @ =gUnk_0810CBE4
|
|
||||||
lsls r0, r4, #1
|
|
||||||
lsls r1, r1, #3
|
|
||||||
adds r0, r0, r1
|
|
||||||
adds r0, r0, r2
|
|
||||||
ldrh r0, [r0]
|
|
||||||
adds r1, r6, #0
|
|
||||||
bl MessageNoOverlap
|
|
||||||
pop {r4, r5, r6, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_080638F8: .4byte gUnk_02002B0E
|
|
||||||
_080638FC: .4byte 0x00000A17
|
|
||||||
_08063900: .4byte 0x00000A57
|
|
||||||
_08063904: .4byte gSave
|
|
||||||
_08063908: .4byte gUnk_0810CBE4
|
|
||||||
.syntax divided
|
|
|
@ -1,51 +0,0 @@
|
||||||
.syntax unified
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
movs r5, #1
|
|
||||||
.ifdef JP
|
|
||||||
movs r0, #0xd6
|
|
||||||
.else
|
|
||||||
.ifdef EU
|
|
||||||
movs r0, #0xd6
|
|
||||||
.else
|
|
||||||
.ifdef DEMO_JP
|
|
||||||
movs r0, #0xd6 @ TODO deduplicate
|
|
||||||
.else
|
|
||||||
movs r0, #0xd9
|
|
||||||
.endif
|
|
||||||
.endif
|
|
||||||
.endif
|
|
||||||
bl CheckLocalFlag
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0806392E
|
|
||||||
movs r5, #0
|
|
||||||
.ifdef JP
|
|
||||||
movs r0, #0xd6
|
|
||||||
.else
|
|
||||||
.ifdef EU
|
|
||||||
movs r0, #0xd6
|
|
||||||
.else
|
|
||||||
.ifdef DEMO_JP
|
|
||||||
movs r0, #0xd6 @ TODO deduplicate
|
|
||||||
.else
|
|
||||||
movs r0, #0xd9
|
|
||||||
.endif
|
|
||||||
.endif
|
|
||||||
.endif
|
|
||||||
bl SetLocalFlag
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x84
|
|
||||||
ldr r1, [r0]
|
|
||||||
movs r0, #1
|
|
||||||
str r0, [r1, #0x14]
|
|
||||||
_0806392E:
|
|
||||||
ldr r0, _08063940 @ =gUnk_0810CC04
|
|
||||||
lsls r1, r5, #1
|
|
||||||
adds r1, r1, r0
|
|
||||||
ldrh r0, [r1]
|
|
||||||
adds r1, r4, #0
|
|
||||||
bl MessageNoOverlap
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08063940: .4byte gUnk_0810CC04
|
|
||||||
.syntax divided
|
|
|
@ -10,8 +10,8 @@ gUnk_0810CB78:: @ 0810CB78
|
||||||
gUnk_0810CBC0:: @ 0810CBC0
|
gUnk_0810CBC0:: @ 0810CBC0
|
||||||
.incbin "sittingPerson/gUnk_0810CBC0.bin"
|
.incbin "sittingPerson/gUnk_0810CBC0.bin"
|
||||||
|
|
||||||
gUnk_0810CBD8:: @ 0810CBD8
|
SittingPersion_Actions:: @ 0810CBD8
|
||||||
.4byte sub_08063758
|
.4byte SittingPersion_Init
|
||||||
.4byte sub_080637B8
|
.4byte sub_080637B8
|
||||||
.4byte sub_08063830
|
.4byte sub_08063830
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ script_0800ED20:
|
||||||
SetPlayerIdle
|
SetPlayerIdle
|
||||||
FacePlayer
|
FacePlayer
|
||||||
CallWithArg sub_08063850, 0x00000000
|
CallWithArg sub_08063850, 0x00000000
|
||||||
Call sub_08063944
|
Call SittingPersion_ShowDialogue
|
||||||
WaitUntilTextboxCloses
|
WaitUntilTextboxCloses
|
||||||
JumpIfNot script_0800ED46
|
JumpIfNot script_0800ED46
|
||||||
GiveKinstone 0x0070
|
GiveKinstone 0x0070
|
||||||
|
|
|
@ -1,17 +1,42 @@
|
||||||
#include "npc.h"
|
#include "npc.h"
|
||||||
|
#include "functions.h"
|
||||||
|
|
||||||
extern void (*gUnk_0810CBD8[])(Entity*);
|
extern void (*SittingPersion_Actions[])(Entity*);
|
||||||
|
|
||||||
extern Dialog gUnk_0810CC08[];
|
extern Dialog gUnk_0810CC08[];
|
||||||
|
|
||||||
extern SpriteLoadData gUnk_0810CB78[];
|
extern SpriteLoadData gUnk_0810CB78[];
|
||||||
|
extern u8 gUnk_02002B0E[];
|
||||||
|
extern u16 gUnk_0810CC04[];
|
||||||
|
extern u8 gUnk_02002B0E[];
|
||||||
|
extern u16 gUnk_0810CBE4[][4];
|
||||||
|
extern u8 gUnk_0810CBC0[];
|
||||||
|
extern u8 gUnk_0810CD88[][4];
|
||||||
|
|
||||||
extern void sub_08096208(Entity*, u32);
|
extern void sub_08096208(Entity*, u32);
|
||||||
|
void sub_080637B8(Entity* this);
|
||||||
|
|
||||||
void SittingPerson(Entity* this) {
|
void SittingPerson(Entity* this) {
|
||||||
gUnk_0810CBD8[this->action](this);
|
SittingPersion_Actions[this->action](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASM_FUNC("asm/non_matching/sittingPerson/sub_08063758.inc", void sub_08063758(Entity* this))
|
void SittingPersion_Init(Entity* this) {
|
||||||
|
if (LoadExtraSpriteData(this, &gUnk_0810CB78[this->type * 3])) {
|
||||||
|
this->action = 1;
|
||||||
|
this->spriteSettings.flipX = this->actionDelay;
|
||||||
|
|
||||||
|
if (this->spriteSettings.flipX == 0) {
|
||||||
|
this->animationState = 6;
|
||||||
|
} else {
|
||||||
|
this->animationState = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
this->actionDelay = this->animationState;
|
||||||
|
this->field_0x68.HALF.HI = 0;
|
||||||
|
sub_0807DD50(this);
|
||||||
|
sub_080637B8(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void sub_080637B8(Entity* this) {
|
void sub_080637B8(Entity* this) {
|
||||||
u32 tmp;
|
u32 tmp;
|
||||||
|
@ -50,11 +75,63 @@ void sub_08063874(Entity* this) {
|
||||||
this->animationState = this->actionDelay;
|
this->animationState = this->actionDelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASM_FUNC("asm/non_matching/sittingPerson/sub_0806387C.inc", void sub_0806387C(Entity* this))
|
#if defined(EU) || defined(DEMO_JP) || defined(JP)
|
||||||
|
#define SUB_0806387C_FLAG 0xd7
|
||||||
|
#define SUB_0806387C_FLAG2 0xce
|
||||||
|
#define SUB_0806390C_FLAG 0xd6
|
||||||
|
#else
|
||||||
|
#define SUB_0806387C_FLAG 0xda
|
||||||
|
#define SUB_0806387C_FLAG2 0xd1
|
||||||
|
#define SUB_0806390C_FLAG 0xd9
|
||||||
|
#endif
|
||||||
|
|
||||||
ASM_FUNC("asm/non_matching/sittingPerson/sub_0806390C.inc", void sub_0806390C(Entity* this))
|
void sub_0806387C(Entity* this) {
|
||||||
|
s32 r4 = 3;
|
||||||
|
s32 r5;
|
||||||
|
s32 val, val2;
|
||||||
|
u16* ptr;
|
||||||
|
if (CheckLocalFlag(SUB_0806387C_FLAG) == 0) {
|
||||||
|
r4 = 0;
|
||||||
|
SetLocalFlag(SUB_0806387C_FLAG);
|
||||||
|
} else {
|
||||||
|
if (CheckLocalFlag(SUB_0806387C_FLAG2) == 0) {
|
||||||
|
r5 = 0;
|
||||||
|
for (r4 = 1; r4 <= 0x82; r4++) {
|
||||||
|
if (ReadBit(gUnk_02002B0E, r4)) {
|
||||||
|
r5++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void sub_08063944(Entity* this, ScriptExecutionContext* context) {
|
r4 = 1;
|
||||||
|
if (r5 > 0x81) {
|
||||||
|
r4 = 2;
|
||||||
|
SetLocalFlag(SUB_0806387C_FLAG2);
|
||||||
|
sub_0807BA8C(0xa17, 1);
|
||||||
|
sub_0807BA8C(0xa57, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val = gSave.global_progress - 6;
|
||||||
|
if (val < 0) {
|
||||||
|
val = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageNoOverlap(gUnk_0810CBE4[val][r4], this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0806390C(Entity* this) {
|
||||||
|
u32 r5 = 1;
|
||||||
|
if (CheckLocalFlag(SUB_0806390C_FLAG) == 0) {
|
||||||
|
r5 = 0;
|
||||||
|
SetLocalFlag(SUB_0806390C_FLAG);
|
||||||
|
(*(u32**)&this->cutsceneBeh)[0x5] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageNoOverlap(gUnk_0810CC04[r5], this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SittingPersion_ShowDialogue(Entity* this, ScriptExecutionContext* context) {
|
||||||
s32 tmp;
|
s32 tmp;
|
||||||
|
|
||||||
context->condition = 0;
|
context->condition = 0;
|
||||||
|
@ -65,7 +142,13 @@ void sub_08063944(Entity* this, ScriptExecutionContext* context) {
|
||||||
ShowNPCDialogue(this, gUnk_0810CC08 + this->type2 * 8 + tmp);
|
ShowNPCDialogue(this, gUnk_0810CC08 + this->type2 * 8 + tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASM_FUNC("asm/non_matching/sittingPerson/SittingPerson_Head.inc", void SittingPerson_Head(Entity* this))
|
void SittingPerson_Head(Entity* this) {
|
||||||
|
u8* ptr = &gUnk_0810CBC0[this->type * 4];
|
||||||
|
SetExtraSpriteFrame(this, 0, *ptr + (this->frame & 0xf));
|
||||||
|
SetExtraSpriteFrame(this, 1, gUnk_0810CD88[this->type][this->frameIndex & 3] + *(ptr + 1));
|
||||||
|
SetSpriteSubEntryOffsetData1(this, 1, 0);
|
||||||
|
sub_0807000C(this);
|
||||||
|
}
|
||||||
|
|
||||||
void sub_080639D0(Entity* this) {
|
void sub_080639D0(Entity* this) {
|
||||||
this->field_0x68.HALF.LO = sub_0801E99C(this);
|
this->field_0x68.HALF.LO = sub_0801E99C(this);
|
||||||
|
|
Loading…
Reference in New Issue