mirror of https://github.com/zeldaret/tmc.git
Match sub_08018BB4 and adjust types
This commit is contained in:
parent
854e623bf9
commit
ffdec50c76
|
@ -892,55 +892,3 @@ _08018B8A:
|
||||||
.align 2, 0
|
.align 2, 0
|
||||||
_08018BAC: .4byte gUnk_080FE320
|
_08018BAC: .4byte gUnk_080FE320
|
||||||
_08018BB0: .4byte 0x00000219
|
_08018BB0: .4byte 0x00000219
|
||||||
|
|
||||||
thumb_func_start sub_08018BB4
|
|
||||||
sub_08018BB4: @ 0x08018BB4
|
|
||||||
push {r4, r5, lr}
|
|
||||||
sub sp, #8
|
|
||||||
adds r4, r0, #0
|
|
||||||
lsls r0, r4, #3
|
|
||||||
ldr r1, _08018C14 @ =gUnk_080FEAC8
|
|
||||||
adds r0, r0, r1
|
|
||||||
mov r5, sp
|
|
||||||
mov r1, sp
|
|
||||||
movs r2, #8
|
|
||||||
bl MemCopy
|
|
||||||
lsls r0, r4, #2
|
|
||||||
adds r0, r0, r4
|
|
||||||
lsls r0, r0, #2
|
|
||||||
ldr r1, _08018C18 @ =gUnk_080FE320
|
|
||||||
adds r0, r0, r1
|
|
||||||
ldrh r1, [r0, #8]
|
|
||||||
lsrs r1, r1, #4
|
|
||||||
movs r2, #0x3f
|
|
||||||
ands r1, r2
|
|
||||||
ldrh r0, [r0, #0xa]
|
|
||||||
lsrs r0, r0, #4
|
|
||||||
ands r0, r2
|
|
||||||
lsls r0, r0, #6
|
|
||||||
orrs r1, r0
|
|
||||||
strh r1, [r5, #4]
|
|
||||||
mov r0, sp
|
|
||||||
bl sub_0804B3C4
|
|
||||||
ldrb r0, [r5, #1]
|
|
||||||
bl CheckLocalFlag
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08018C10
|
|
||||||
ldrh r3, [r5, #4]
|
|
||||||
ldrb r1, [r5, #6]
|
|
||||||
movs r0, #1
|
|
||||||
ands r0, r1
|
|
||||||
movs r2, #2
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08018C08
|
|
||||||
movs r2, #1
|
|
||||||
_08018C08:
|
|
||||||
movs r0, #0x73
|
|
||||||
adds r1, r3, #0
|
|
||||||
bl SetTileType
|
|
||||||
_08018C10:
|
|
||||||
add sp, #8
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08018C14: .4byte gUnk_080FEAC8
|
|
||||||
_08018C18: .4byte gUnk_080FE320
|
|
||||||
|
|
|
@ -190,15 +190,17 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u8 type;
|
u8 type;
|
||||||
u8 _1;
|
u8 localFlag;
|
||||||
u8 _2;
|
u8 _2;
|
||||||
u8 _3;
|
u8 _3;
|
||||||
u16 _4;
|
u16 tilePos;
|
||||||
u8 _6;
|
u8 _6;
|
||||||
u8 _7;
|
u8 _7;
|
||||||
} TileEntity;
|
} TileEntity;
|
||||||
extern TileEntity gSmallChests[8];
|
extern TileEntity gSmallChests[8];
|
||||||
|
|
||||||
|
extern TileEntity gUnk_080FEAC8[];
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
NONE,
|
NONE,
|
||||||
ROOM_VISIT_MARKER,
|
ROOM_VISIT_MARKER,
|
||||||
|
@ -230,7 +232,7 @@ void LoadRoomEntityList(EntityData* listPtr);
|
||||||
|
|
||||||
bool32 LoadFixedGFX(Entity*, u32);
|
bool32 LoadFixedGFX(Entity*, u32);
|
||||||
void UnloadGFXSlots(Entity*);
|
void UnloadGFXSlots(Entity*);
|
||||||
void sub_0804B3C4(void*);
|
void sub_0804B3C4(TileEntity*);
|
||||||
void sub_0804B0B0(u32 arg0, u32 arg1);
|
void sub_0804B0B0(u32 arg0, u32 arg1);
|
||||||
|
|
||||||
void DoExitTransition(const ScreenTransitionData* data);
|
void DoExitTransition(const ScreenTransitionData* data);
|
||||||
|
|
|
@ -1,5 +1,29 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "room.h"
|
#include "room.h"
|
||||||
|
#include "subtask.h"
|
||||||
|
#include "common.h"
|
||||||
|
#include "flags.h"
|
||||||
|
|
||||||
|
void sub_08018BB4(int param_1) {
|
||||||
|
u32 layer;
|
||||||
|
TileEntity tile;
|
||||||
|
struct_080FE320* ptr;
|
||||||
|
u32 position;
|
||||||
|
|
||||||
|
MemCopy(gUnk_080FEAC8 + param_1, &tile, sizeof(TileEntity));
|
||||||
|
ptr = &gUnk_080FE320[param_1];
|
||||||
|
tile.tilePos = (ptr->x >> 4 & 0x3f) | (((ptr->y) >> 4 & 0x3f) << 6);
|
||||||
|
sub_0804B3C4(&tile);
|
||||||
|
if (CheckLocalFlag(tile.localFlag) == 0) {
|
||||||
|
position = tile.tilePos;
|
||||||
|
if ((tile._6 & 1) == 0) {
|
||||||
|
layer = 1;
|
||||||
|
} else {
|
||||||
|
layer = 2;
|
||||||
|
}
|
||||||
|
SetTileType(0x73, position, layer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CreateMinishEntrance(u32 tilePos) {
|
void CreateMinishEntrance(u32 tilePos) {
|
||||||
u32 x, y;
|
u32 x, y;
|
||||||
|
|
|
@ -294,9 +294,9 @@ void sub_080971E0(ObjectOnPillarEntity* this) {
|
||||||
bool32 sub_08097348(u32 tilePosition) {
|
bool32 sub_08097348(u32 tilePosition) {
|
||||||
u32 index;
|
u32 index;
|
||||||
TileEntity* tileEntity = gSmallChests;
|
TileEntity* tileEntity = gSmallChests;
|
||||||
for (index = 0; index < 8; index++, tileEntity++) {
|
for (index = 0; index < ARRAY_COUNT(gSmallChests); index++, tileEntity++) {
|
||||||
if (tileEntity->_4 == tilePosition) {
|
if (tileEntity->tilePos == tilePosition) {
|
||||||
return CheckLocalFlag(tileEntity->_1);
|
return CheckLocalFlag(tileEntity->localFlag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -56,14 +56,14 @@ void sub_080A7C8C(u32 pos, u32 layer) {
|
||||||
u32 found = 0;
|
u32 found = 0;
|
||||||
u32 i;
|
u32 i;
|
||||||
for (i = 0; i < 8; ++i, ++t) {
|
for (i = 0; i < 8; ++i, ++t) {
|
||||||
if (*(u16*)&t->_4 == pos) {
|
if (*(u16*)&t->tilePos == pos) {
|
||||||
found = 1;
|
found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((layer >> 1) == ((u32)(t->_6 << 31) >> 31)) {
|
if ((layer >> 1) == ((u32)(t->_6 << 31) >> 31)) {
|
||||||
if (found) {
|
if (found) {
|
||||||
SetLocalFlag(t->_1);
|
SetLocalFlag(t->localFlag);
|
||||||
CreateItemEntity(t->_2, t->_3, 0);
|
CreateItemEntity(t->_2, t->_3, 0);
|
||||||
} else {
|
} else {
|
||||||
CreateItemEntity(0x60, 0, 0);
|
CreateItemEntity(0x60, 0, 0);
|
||||||
|
@ -81,7 +81,7 @@ u32 sub_080A7CFC(u32 a1) {
|
||||||
TileEntity* t = GetCurrentRoomProperty(3);
|
TileEntity* t = GetCurrentRoomProperty(3);
|
||||||
if (t != 0) {
|
if (t != 0) {
|
||||||
do {
|
do {
|
||||||
if (t->_4 == a1) {
|
if (t->tilePos == a1) {
|
||||||
switch (t->type) {
|
switch (t->type) {
|
||||||
case SIGN:
|
case SIGN:
|
||||||
hint = FALSE;
|
hint = FALSE;
|
||||||
|
@ -95,7 +95,7 @@ u32 sub_080A7CFC(u32 a1) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
t++;
|
t++;
|
||||||
} while (t->_4 != 0);
|
} while (t->tilePos != 0);
|
||||||
}
|
}
|
||||||
InitTileMessage(msg, hint);
|
InitTileMessage(msg, hint);
|
||||||
}
|
}
|
||||||
|
|
28
src/room.c
28
src/room.c
|
@ -251,8 +251,8 @@ void* GetCurrentRoomProperty(u32 idx) {
|
||||||
void sub_0804B16C(void) {
|
void sub_0804B16C(void) {
|
||||||
TileEntity* tile = gSmallChests;
|
TileEntity* tile = gSmallChests;
|
||||||
do {
|
do {
|
||||||
if (tile->_4 != 0 && CheckLocalFlag(tile->_1)) {
|
if (tile->tilePos != 0 && CheckLocalFlag(tile->localFlag)) {
|
||||||
SetTileType(0x74, tile->_4, tile->_6 & 1 ? 2 : 1);
|
SetTileType(0x74, tile->tilePos, tile->_6 & 1 ? 2 : 1);
|
||||||
}
|
}
|
||||||
} while (++tile < gSmallChests + 8);
|
} while (++tile < gSmallChests + 8);
|
||||||
}
|
}
|
||||||
|
@ -297,28 +297,28 @@ void LoadRoomTileEntities(TileEntity* list) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LoadGrassDropTile(TileEntity* tile) {
|
static void LoadGrassDropTile(TileEntity* tile) {
|
||||||
MemCopy(&gAreaDroptables[tile->_1], &gRoomVars.currentAreaDroptable, 0x20);
|
MemCopy(&gAreaDroptables[tile->localFlag], &gRoomVars.currentAreaDroptable, 0x20);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LoadLocationTile(TileEntity* tile) {
|
static void LoadLocationTile(TileEntity* tile) {
|
||||||
gArea.locationIndex = tile->_1;
|
gArea.locationIndex = tile->localFlag;
|
||||||
sub_08054524();
|
sub_08054524();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LoadRoomVisitTile(TileEntity* tile) {
|
static void LoadRoomVisitTile(TileEntity* tile) {
|
||||||
SetLocalFlag(tile->_1);
|
SetLocalFlag(tile->localFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LoadSmallChestTile(TileEntity* tile) {
|
static void LoadSmallChestTile(TileEntity* tile) {
|
||||||
TileEntity* t = gSmallChests;
|
TileEntity* t = gSmallChests;
|
||||||
u32 i = 0;
|
u32 i = 0;
|
||||||
for (i = 0; i < 8; ++i, ++t) {
|
for (i = 0; i < 8; ++i, ++t) {
|
||||||
if (!t->_4) {
|
if (!t->tilePos) {
|
||||||
MemCopy(tile, t, sizeof(TileEntity));
|
MemCopy(tile, t, sizeof(TileEntity));
|
||||||
if ((t->_6 & 1) && (gRoomControls.scroll_flags & 2) && !CheckLocalFlag(t->_1)) {
|
if ((t->_6 & 1) && (gRoomControls.scroll_flags & 2) && !CheckLocalFlag(t->localFlag)) {
|
||||||
Entity* e = CreateObject(OBJECT_52, t->_1, 0);
|
Entity* e = CreateObject(OBJECT_52, t->localFlag, 0);
|
||||||
if (e != NULL) {
|
if (e != NULL) {
|
||||||
sub_0806F704(e, t->_4);
|
sub_0806F704(e, t->tilePos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -331,10 +331,10 @@ static void LoadBombableWallTile(TileEntity* tile) {
|
||||||
if (mgr != NULL) {
|
if (mgr != NULL) {
|
||||||
mgr->manager.type = 9;
|
mgr->manager.type = 9;
|
||||||
mgr->manager.subtype = 0x24;
|
mgr->manager.subtype = 0x24;
|
||||||
mgr->x = tile->_4;
|
mgr->x = tile->tilePos;
|
||||||
mgr->y = *(u16*)&tile->_6;
|
mgr->y = *(u16*)&tile->_6;
|
||||||
mgr->field_0x35 = tile->_2;
|
mgr->field_0x35 = tile->_2;
|
||||||
mgr->field_0x3e = tile->_1;
|
mgr->field_0x3e = tile->localFlag;
|
||||||
AppendEntityToList((Entity*)mgr, 6);
|
AppendEntityToList((Entity*)mgr, 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -345,7 +345,7 @@ static void LoadDarknessTile(TileEntity* tile) {
|
||||||
|
|
||||||
static void LoadDestructibleTile(TileEntity* tile) {
|
static void LoadDestructibleTile(TileEntity* tile) {
|
||||||
if (CheckLocalFlag(*(u16*)&tile->_2)) {
|
if (CheckLocalFlag(*(u16*)&tile->_2)) {
|
||||||
SetTileType(*(u16*)&tile->_6, tile->_4, tile->_1);
|
SetTileType(*(u16*)&tile->_6, tile->tilePos, tile->localFlag);
|
||||||
} else if (!gRoomVars.filler_0x1) {
|
} else if (!gRoomVars.filler_0x1) {
|
||||||
Manager* mgr;
|
Manager* mgr;
|
||||||
gRoomVars.filler_0x1 = 1;
|
gRoomVars.filler_0x1 = 1;
|
||||||
|
@ -369,6 +369,6 @@ void sub_0804B388(u32 a1, u32 a2) {
|
||||||
sub_080526F8(-1);
|
sub_080526F8(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0804B3C4(void* arg0) {
|
void sub_0804B3C4(TileEntity* tile) {
|
||||||
LoadSmallChestTile(arg0);
|
LoadSmallChestTile(tile);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4681,10 +4681,7 @@ u32 sub_unk3_SimonsSimulation_Main(void) {
|
||||||
extern u8* gUnk_080F0D58[4];
|
extern u8* gUnk_080F0D58[4];
|
||||||
extern Entity* gUnk_080F0CB8[15];
|
extern Entity* gUnk_080F0CB8[15];
|
||||||
extern u8* gUnk_080F0E08[];
|
extern u8* gUnk_080F0E08[];
|
||||||
extern struct {
|
extern TileEntity gUnk_080F0E1C[];
|
||||||
u32 unk_00;
|
|
||||||
u32 unk_04;
|
|
||||||
} gUnk_080F0E1C[];
|
|
||||||
|
|
||||||
void sub_StateChange_SimonsSimulation_Main(void) {
|
void sub_StateChange_SimonsSimulation_Main(void) {
|
||||||
u32 r;
|
u32 r;
|
||||||
|
|
|
@ -90,13 +90,6 @@ extern void (*const gUnk_080FF330[])(void);
|
||||||
|
|
||||||
void sub_08055994(void);
|
void sub_08055994(void);
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
u8 unk_0[6];
|
|
||||||
u8 unk_6;
|
|
||||||
u8 unk_7;
|
|
||||||
} struct_080FEAC8;
|
|
||||||
extern struct_080FEAC8 gUnk_080FEAC8[];
|
|
||||||
|
|
||||||
extern void (*const gUnk_080FF35C[])(void);
|
extern void (*const gUnk_080FF35C[])(void);
|
||||||
|
|
||||||
extern const EntityData gUnk_080FF33C[];
|
extern const EntityData gUnk_080FF33C[];
|
||||||
|
@ -676,8 +669,8 @@ void sub_08055978(void) {
|
||||||
|
|
||||||
void sub_08055994(void) {
|
void sub_08055994(void) {
|
||||||
u32 layer;
|
u32 layer;
|
||||||
struct_080FEAC8* ptr = &gUnk_080FEAC8[gMenu.field_0x4];
|
TileEntity* ptr = &gUnk_080FEAC8[gMenu.field_0x4];
|
||||||
if ((ptr->unk_6 & 1) != 0) {
|
if ((ptr->_6 & 1) != 0) {
|
||||||
layer = 2;
|
layer = 2;
|
||||||
} else {
|
} else {
|
||||||
layer = 1;
|
layer = 1;
|
||||||
|
|
Loading…
Reference in New Issue