mirror of https://github.com/zeldaret/tmc.git
Match GenerateAreaHint
This commit is contained in:
parent
a434a1bbb2
commit
99d14c6a29
|
|
@ -159,64 +159,3 @@ _08018620:
|
|||
.align 2, 0
|
||||
_08018624: .4byte gUnk_02033AB8
|
||||
_08018628: .4byte gUnk_080B3D20
|
||||
|
||||
thumb_func_start GenerateAreaHint
|
||||
GenerateAreaHint: @ 0x0801862C
|
||||
push {r4, r5, lr}
|
||||
ldr r1, _0801864C @ =gPlayerState
|
||||
movs r2, #0
|
||||
movs r0, #0x16
|
||||
strb r0, [r1, #0xc]
|
||||
ldr r5, _08018650 @ =gRoomTransition
|
||||
adds r0, r5, #0
|
||||
.ifdef JP
|
||||
adds r0, #0x34
|
||||
.else
|
||||
.ifdef EU
|
||||
adds r0, #0x34
|
||||
.else
|
||||
adds r0, #0x35
|
||||
.endif
|
||||
.endif
|
||||
strb r2, [r0]
|
||||
ldr r4, _08018654 @ =gUnk_02033AB8
|
||||
ldrb r0, [r4]
|
||||
cmp r0, #0xff
|
||||
bne _08018658
|
||||
ldrh r0, [r4, #4]
|
||||
strh r0, [r5, #0x36]
|
||||
b _0801868C
|
||||
.align 2, 0
|
||||
_0801864C: .4byte gPlayerState
|
||||
_08018650: .4byte gRoomTransition
|
||||
_08018654: .4byte gUnk_02033AB8
|
||||
_08018658:
|
||||
ldrb r0, [r4, #2]
|
||||
lsls r0, r0, #1
|
||||
adds r1, r4, #4
|
||||
adds r0, r0, r1
|
||||
ldrh r0, [r0]
|
||||
strh r0, [r5, #0x36]
|
||||
ldrb r0, [r4, #2]
|
||||
adds r0, #1
|
||||
strb r0, [r4, #2]
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
cmp r0, #7
|
||||
bls _0801868C
|
||||
movs r0, #0
|
||||
strb r0, [r4, #2]
|
||||
movs r0, #8
|
||||
bl sub_08018690
|
||||
ldrh r0, [r4, #4]
|
||||
ldrh r5, [r5, #0x36]
|
||||
cmp r0, r5
|
||||
bne _0801868C
|
||||
adds r1, r0, #0
|
||||
ldrh r0, [r4, #0x12]
|
||||
strh r0, [r4, #4]
|
||||
strh r1, [r4, #0x12]
|
||||
_0801868C:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,15 @@ typedef struct {
|
|||
} RoomResInfo;
|
||||
static_assert(sizeof(RoomResInfo) == 0x20);
|
||||
|
||||
typedef struct {
|
||||
u8 inventoryGfxIdx;
|
||||
u8 unk29;
|
||||
u8 unk2a;
|
||||
u8 unk2b;
|
||||
u16 unk2C[7];
|
||||
u16 unk3E;
|
||||
} struct_area_28;
|
||||
|
||||
typedef struct {
|
||||
u8 areaMetadata;
|
||||
u8 locationIndex;
|
||||
|
|
@ -43,10 +52,7 @@ typedef struct {
|
|||
bool8 portal_in_use;
|
||||
u8 unk1A;
|
||||
u8 filler2[13];
|
||||
u8 inventoryGfxIdx;
|
||||
u8 filler4[0x3];
|
||||
u16 unk2C;
|
||||
u8 filler5[0xe];
|
||||
struct_area_28 unk28;
|
||||
RoomResInfo roomResInfos[MAX_ROOMS];
|
||||
RoomResInfo currentRoomInfo;
|
||||
RoomResInfo* pCurrentRoomInfo;
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ static void GameMain_ChangeRoom(void) {
|
|||
SetPlayerControl(0);
|
||||
gPauseMenuOptions.disabled = 0;
|
||||
#if defined(USA) || defined(DEMO_USA)
|
||||
if (gArea.inventoryGfxIdx != 0xff) {
|
||||
if (gArea.unk28.inventoryGfxIdx != 0xff) {
|
||||
sub_0801855C();
|
||||
}
|
||||
CreateManagerF();
|
||||
|
|
@ -384,13 +384,13 @@ static void GameMain_ChangeRoom(void) {
|
|||
sub_0801855C();
|
||||
#elif defined(JP)
|
||||
CheckAreaDiscovery();
|
||||
if (gArea.inventoryGfxIdx != 0xff) {
|
||||
if (gArea.unk28.inventoryGfxIdx != 0xff) {
|
||||
sub_0801855C();
|
||||
}
|
||||
#elif defined(DEMO_JP)
|
||||
if (gRoomTransition.field_0x2c[4])
|
||||
CheckAreaDiscovery();
|
||||
if (gArea.inventoryGfxIdx != 0xff) {
|
||||
if (gArea.unk28.inventoryGfxIdx != 0xff) {
|
||||
sub_0801855C();
|
||||
}
|
||||
CreateManagerF();
|
||||
|
|
|
|||
|
|
@ -28,6 +28,36 @@ void sub_08018B50(int);
|
|||
void sub_080189EC(int);
|
||||
void sub_0801876C(int, int);
|
||||
void sub_08018738(u32, int);
|
||||
void sub_08018690(int param_1, u16* param_2);
|
||||
|
||||
void GenerateAreaHint(void) {
|
||||
u16 uVar1;
|
||||
struct_area_28* ptr;
|
||||
|
||||
gPlayerState.queued_action = 0x16;
|
||||
#if defined(EU) || defined(JP)
|
||||
// TODO what fields of the room transition are switched in these variants?
|
||||
gRoomTransition.field_0x2c[7] = 0;
|
||||
#else
|
||||
gRoomTransition.hint_height = 0;
|
||||
#endif
|
||||
ptr = &gArea.unk28;
|
||||
if (ptr->inventoryGfxIdx == 0xff) {
|
||||
gRoomTransition.hint_idx = ptr->unk2C[0];
|
||||
} else {
|
||||
gRoomTransition.hint_idx = ptr->unk2C[ptr->unk2a];
|
||||
ptr->unk2a++;
|
||||
if (ptr->unk2a > 7) {
|
||||
ptr->unk2a = 0;
|
||||
sub_08018690(8, ptr->unk2C);
|
||||
if (ptr->unk2C[0] == gRoomTransition.hint_idx) {
|
||||
uVar1 = ptr->unk2C[0];
|
||||
ptr->unk2C[0] = ptr->unk3E;
|
||||
ptr->unk3E = uVar1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08018690(int param_1, u16* param_2) {
|
||||
u32 uVar1;
|
||||
|
|
@ -54,12 +84,12 @@ void sub_08018690(int param_1, u16* param_2) {
|
|||
}
|
||||
|
||||
void sub_080186C0(u32 param_1) {
|
||||
gArea.inventoryGfxIdx = 0xff;
|
||||
gArea.unk2C = param_1;
|
||||
gArea.unk28.inventoryGfxIdx = 0xff;
|
||||
gArea.unk28.unk2C[0] = param_1;
|
||||
}
|
||||
|
||||
void sub_080186D4(void) {
|
||||
if (gArea.inventoryGfxIdx == 0xff) {
|
||||
if (gArea.unk28.inventoryGfxIdx == 0xff) {
|
||||
sub_0801855C();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ static void sub_08058514(ManagerA* this) {
|
|||
}
|
||||
|
||||
static void sub_080585B0(ManagerA* this) {
|
||||
if (gArea.inventoryGfxIdx != 0xFF) {
|
||||
if (gArea.unk28.inventoryGfxIdx != 0xFF) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (CheckFlags(this->flag1)) {
|
||||
|
|
|
|||
|
|
@ -414,10 +414,10 @@ void sub_080594DC(ManagerF* this) {
|
|||
break;
|
||||
case 2:
|
||||
default:
|
||||
if (gArea.inventoryGfxIdx != 0xFF) {
|
||||
if (gArea.unk28.inventoryGfxIdx != 0xFF) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (CheckLocalFlagByBank(0x8c0, 0x85)) {
|
||||
if (CheckLocalFlagByBank(FLAG_BANK_10, 0x85)) {
|
||||
sub_0801855C();
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue