mirror of
https://github.com/zeldaret/tmc
synced 2026-07-29 15:43:29 -04:00
Rename managers
This commit is contained in:
+18
-16
@@ -12,8 +12,9 @@
|
||||
#include "object.h"
|
||||
#include "screen.h"
|
||||
#include "structures.h"
|
||||
#include "manager/diggingCaveEntranceManager.h"
|
||||
#include "scroll.h"
|
||||
|
||||
extern void UpdateIsDiggingCave(void);
|
||||
extern void sub_0807C898(void);
|
||||
extern void sub_0805BB74(s32);
|
||||
extern void LoadRoomGfx(void);
|
||||
@@ -95,10 +96,10 @@ void sub_080197A0(void) {
|
||||
}
|
||||
|
||||
void SetBGDefaults(void) {
|
||||
gMapBottom.bgControlPtr = (u16*)&gScreen.bg2;
|
||||
*gMapBottom.bgControlPtr = gUnk_080B77C0[0];
|
||||
gMapTop.bgControlPtr = (u16*)&gScreen.bg1;
|
||||
*gMapTop.bgControlPtr = gUnk_080B77C0[1];
|
||||
gMapBottom.bgSettings = (BgSettings*)&gScreen.bg2;
|
||||
gMapBottom.bgSettings->control = gUnk_080B77C0[0];
|
||||
gMapTop.bgSettings = &gScreen.bg1;
|
||||
gMapTop.bgSettings->control = gUnk_080B77C0[1];
|
||||
}
|
||||
|
||||
void sub_080197D4(u32* param_1) {
|
||||
@@ -417,7 +418,7 @@ void sub_0801AD6C(u16* param_1, u32 param_2) {
|
||||
s32 tmpX2;
|
||||
s32 tmpY2;
|
||||
|
||||
if (param_1[1] != 9) {
|
||||
if (param_1[1] != MANAGER) {
|
||||
entity = GetEmptyEntity();
|
||||
if (entity != NULL) {
|
||||
entity->kind = (u8)param_1[1];
|
||||
@@ -435,15 +436,16 @@ void sub_0801AD6C(u16* param_1, u32 param_2) {
|
||||
} else {
|
||||
manager = GetEmptyManager();
|
||||
if (manager != NULL) {
|
||||
manager->type = (u8)param_1[1];
|
||||
manager->subtype = (u8)param_1[2];
|
||||
manager->unk_0a = (u8)param_1[3];
|
||||
manager->unk_0b = (u8)param_1[4];
|
||||
manager->kind = (u8)param_1[1];
|
||||
manager->id = (u8)param_1[2];
|
||||
manager->type = (u8)param_1[3];
|
||||
manager->type2 = (u8)param_1[4];
|
||||
// TODO are these fields common for all managers or does this usually create managers of certain types?
|
||||
tmpX2 = ((u16)param_2 & 0x3f) * 0x10 + 8;
|
||||
*(u16*)(&manager[1].unk_0e + 10) = tmpX2 + gRoomControls.origin_x;
|
||||
*(u16*)(&manager[1].timer + 10) = tmpX2 + gRoomControls.origin_x;
|
||||
tmpY2 = (s16)((param_2 & 0xfc0) >> 2) + 8;
|
||||
*(u16*)(&manager[1].unk_0e + 12) = tmpY2 + gRoomControls.origin_y;
|
||||
AppendEntityToList((Entity*)manager, gUnk_081091E4[manager->type]);
|
||||
*(u16*)(&manager[1].timer + 12) = tmpY2 + gRoomControls.origin_y;
|
||||
AppendEntityToList((Entity*)manager, gUnk_081091E4[manager->kind]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -476,14 +478,14 @@ void sub_0801AE44(s32 param_1) {
|
||||
if (func != NULL) {
|
||||
func();
|
||||
}
|
||||
if ((gUnk_03004030.isDiggingCave == 0) && (gArea.onEnter != NULL)) {
|
||||
if ((gDiggingCaveEntranceTransition.isDiggingCave == 0) && (gArea.onEnter != NULL)) {
|
||||
gArea.onEnter(gArea.transitionManager);
|
||||
}
|
||||
if ((gRoomControls.scroll_flags & 1) == 0) {
|
||||
if (gMapBottom.bgControlPtr != NULL) {
|
||||
if (gMapBottom.bgSettings != NULL) {
|
||||
sub_0801AB08(gMapDataBottomSpecial, &gMapBottom);
|
||||
}
|
||||
if (gMapTop.bgControlPtr != NULL) {
|
||||
if (gMapTop.bgSettings != NULL) {
|
||||
sub_0801AB08(gMapDataTopSpecial, &gMapTop);
|
||||
}
|
||||
} else {
|
||||
|
||||
+4
-5
@@ -59,7 +59,6 @@ typedef struct {
|
||||
u8 filler[0xA00];
|
||||
} struct_02017AA0;
|
||||
extern struct_02017AA0 gUnk_02017AA0[];
|
||||
extern u8 gUnk_03003DE4;
|
||||
|
||||
extern const PaletteGroup* gPaletteGroups[];
|
||||
extern const u8 gGlobalGfxAndPalettes[];
|
||||
@@ -509,9 +508,9 @@ void sub_0801E154(u32 a1) {
|
||||
}
|
||||
|
||||
void sub_0801E160(u32 a1, u32 a2, u32 a3) {
|
||||
MemClear(&gUnk_02017AA0[gUnk_03003DE4], sizeof(gUnk_02017AA0[gUnk_03003DE4]));
|
||||
MemClear(&gUnk_02017AA0[gUnk_03003DE4[0]], sizeof(gUnk_02017AA0[gUnk_03003DE4[0]]));
|
||||
sub_0801E290(a1, a2, a3);
|
||||
sub_0805622C(&gUnk_02017AA0[gUnk_03003DE4], 0x4000040, 0xA2600001);
|
||||
sub_0805622C((struct BgAffineDstData*)&gUnk_02017AA0[gUnk_03003DE4[0]], 0x4000040, 0xA2600001);
|
||||
}
|
||||
|
||||
void sub_0801E1B8(u32 a1, u32 a2) {
|
||||
@@ -523,10 +522,10 @@ void sub_0801E1B8(u32 a1, u32 a2) {
|
||||
}
|
||||
|
||||
void sub_0801E1EC(u32 a1, u32 a2, u32 a3) {
|
||||
MemClear(&gUnk_02017AA0[gUnk_03003DE4], sizeof(gUnk_02017AA0[gUnk_03003DE4]));
|
||||
MemClear(&gUnk_02017AA0[gUnk_03003DE4[0]], sizeof(gUnk_02017AA0[gUnk_03003DE4[0]]));
|
||||
sub_0801E24C(a3, 0);
|
||||
sub_0801E290(a1, a2, a3);
|
||||
sub_0805622C(&gUnk_02017AA0[gUnk_03003DE4], 0x4000040, 0xA2600001);
|
||||
sub_0805622C((struct BgAffineDstData*)&gUnk_02017AA0[gUnk_03003DE4[0]], 0x4000040, 0xA2600001);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/common/sub_0801E24C.inc", void sub_0801E24C(u32 a1, u32 a2));
|
||||
|
||||
@@ -102,9 +102,9 @@ void VaatiEyesMacroFunction0Type0Action0(Entity* this) {
|
||||
Entity* enemy;
|
||||
|
||||
if ((gEntCount < 0x47) && (manager = GetEmptyManager(), manager != NULL)) {
|
||||
manager->type = 9;
|
||||
manager->subtype = 0x34;
|
||||
manager->parent = (Manager*)this;
|
||||
manager->kind = MANAGER;
|
||||
manager->id = VAATI3_INSIDE_ARM_MANAGER;
|
||||
manager->parent = (Entity*)this;
|
||||
AppendEntityToList((Entity*)manager, 8);
|
||||
enemy = CreateEnemy(VAATI_EYES_MACRO, 2);
|
||||
enemy->parent = this;
|
||||
|
||||
+20
-19
@@ -4,6 +4,7 @@
|
||||
#include "area.h"
|
||||
#include "message.h"
|
||||
#include "npc.h"
|
||||
#include "manager/diggingCaveEntranceManager.h"
|
||||
|
||||
extern u8 gUnk_081091F8[];
|
||||
extern u8 gUnk_081091EE[];
|
||||
@@ -38,27 +39,27 @@ extern UpdateContext gUpdateContext;
|
||||
void sub_0805E248(void) {
|
||||
s32 v0;
|
||||
|
||||
v0 = gUnk_03004030.unk_00->unk_06;
|
||||
v0 = gDiggingCaveEntranceTransition.entrance->targetTilePosition;
|
||||
if (gRoomControls.area == AREA_VEIL_FALLS || gRoomControls.area == AREA_VEIL_FALLS_DIG_CAVE) {
|
||||
SetTileType(636, v0 - 65, 1);
|
||||
SetTileType(643, v0 - 65, 2);
|
||||
SetTileType(637, v0 - 64, 1);
|
||||
SetTileType(644, v0 - 64, 2);
|
||||
SetTileType(638, v0 - 63, 1);
|
||||
SetTileType(645, v0 - 63, 2);
|
||||
SetTileType(639, v0 - 1, 1);
|
||||
SetTileType(640, v0, 1);
|
||||
SetTileType(642, v0 + 1, 1);
|
||||
SetTileType(0x27c, v0 + TILE_POS(-1, -1), 1);
|
||||
SetTileType(0x283, v0 + TILE_POS(-1, -1), 2);
|
||||
SetTileType(0x27d, v0 + TILE_POS(0, -1), 1);
|
||||
SetTileType(0x284, v0 + TILE_POS(0, -1), 2);
|
||||
SetTileType(0x27e, v0 + TILE_POS(1, -1), 1);
|
||||
SetTileType(0x285, v0 + TILE_POS(1, -1), 2);
|
||||
SetTileType(0x27f, v0 + TILE_POS(-1, 0), 1);
|
||||
SetTileType(0x280, v0 + TILE_POS(0, 0), 1);
|
||||
SetTileType(0x282, v0 + TILE_POS(1, 0), 1);
|
||||
} else {
|
||||
SetTileType(620, v0 - 65, 1);
|
||||
SetTileType(627, v0 - 65, 2);
|
||||
SetTileType(621, v0 - 64, 1);
|
||||
SetTileType(628, v0 - 64, 2);
|
||||
SetTileType(622, v0 - 63, 1);
|
||||
SetTileType(629, v0 - 63, 2);
|
||||
SetTileType(623, v0 - 1, 1);
|
||||
SetTileType(624, v0, 1);
|
||||
SetTileType(626, v0 + 1, 1);
|
||||
SetTileType(0x26c, v0 + TILE_POS(-1, -1), 1);
|
||||
SetTileType(0x273, v0 + TILE_POS(-1, -1), 2);
|
||||
SetTileType(0x26d, v0 + TILE_POS(0, -1), 1);
|
||||
SetTileType(0x274, v0 + TILE_POS(0, -1), 2);
|
||||
SetTileType(0x26e, v0 + TILE_POS(1, -1), 1);
|
||||
SetTileType(0x275, v0 + TILE_POS(1, -1), 2);
|
||||
SetTileType(0x26f, v0 + TILE_POS(-1, 0), 1);
|
||||
SetTileType(0x270, v0 + TILE_POS(0, 0), 1);
|
||||
SetTileType(0x272, v0 + TILE_POS(1, 0), 1);
|
||||
}
|
||||
gUpdateVisibleTiles = 0;
|
||||
}
|
||||
|
||||
+11
-10
@@ -34,6 +34,7 @@
|
||||
#include "roomid.h"
|
||||
#include "ui.h"
|
||||
#include "kinstone.h"
|
||||
#include "manager/diggingCaveEntranceManager.h"
|
||||
|
||||
// Game task
|
||||
|
||||
@@ -97,7 +98,7 @@ extern void sub_0806FD8C(void);
|
||||
extern void sub_080300C4(void);
|
||||
extern u32 sub_0805BC04(void);
|
||||
extern void DeleteSleepingEntities(void);
|
||||
extern u32 UpdateLightLevel(void);
|
||||
extern bool32 UpdateLightLevel(void);
|
||||
extern void sub_080185F8(void);
|
||||
extern void UpdateDoorTransition(void);
|
||||
extern bool32 CheckInitPortal(void);
|
||||
@@ -132,7 +133,7 @@ static void sub_08052010(void);
|
||||
static void ResetTmpFlags(void);
|
||||
static void InitializeEntities(void);
|
||||
static void CheckAreaDiscovery(void);
|
||||
static void CreateManagerF(void);
|
||||
static void CreateMiscManager(void);
|
||||
static void UpdateWindcrests(void);
|
||||
static void UpdateFakeScroll(void);
|
||||
static void UpdatePlayerMapCoords(void);
|
||||
@@ -377,7 +378,7 @@ static void GameMain_ChangeRoom(void) {
|
||||
if (gArea.unk28.inventoryGfxIdx != 0xff) {
|
||||
sub_0801855C();
|
||||
}
|
||||
CreateManagerF();
|
||||
CreateMiscManager();
|
||||
CheckAreaDiscovery();
|
||||
#elif defined(EU)
|
||||
CheckAreaDiscovery();
|
||||
@@ -393,7 +394,7 @@ static void GameMain_ChangeRoom(void) {
|
||||
if (gArea.unk28.inventoryGfxIdx != 0xff) {
|
||||
sub_0801855C();
|
||||
}
|
||||
CreateManagerF();
|
||||
CreateMiscManager();
|
||||
#endif
|
||||
if (!gRoomVars.field_0x0) {
|
||||
RequestPriorityDuration(NULL, 1);
|
||||
@@ -496,7 +497,7 @@ static void InitializeEntities(void) {
|
||||
sub_0804AF90();
|
||||
CallRoomProp6();
|
||||
InitializePlayer();
|
||||
gUnk_03004030.unk_00 = NULL;
|
||||
gDiggingCaveEntranceTransition.entrance = NULL;
|
||||
InitializeCamera();
|
||||
gUpdateVisibleTiles = 1;
|
||||
LoadRoomBgm();
|
||||
@@ -1317,7 +1318,7 @@ void DisplayEzloMessage(void) {
|
||||
}
|
||||
|
||||
#if defined(USA) || defined(DEMO_USA) || defined(DEMO_JP)
|
||||
static void CreateManagerF(void) {
|
||||
static void CreateMiscManager(void) {
|
||||
Entity* e = NULL;
|
||||
|
||||
if (gRoomTransition.player_status.field_0x24[13])
|
||||
@@ -1330,7 +1331,7 @@ static void CreateManagerF(void) {
|
||||
if (e == NULL)
|
||||
return;
|
||||
e->kind = MANAGER;
|
||||
e->id = 15;
|
||||
e->id = MISC_MANAGER;
|
||||
e->type = 15;
|
||||
AppendEntityToList(e, 0);
|
||||
}
|
||||
@@ -1585,7 +1586,7 @@ static void CheckAreaDiscovery(void) {
|
||||
Entity* e = (Entity*)GetEmptyManager();
|
||||
if (e != NULL) {
|
||||
e->kind = MANAGER;
|
||||
e->id = 0x39;
|
||||
e->id = ENTER_ROOM_TEXTBOX_MANAGER;
|
||||
AppendEntityToList(e, 8);
|
||||
if (!gRoomVars.field_0x0 && !ReadBit(gSave.areaVisitFlags, gArea.locationIndex)) {
|
||||
e->type2 = 1;
|
||||
@@ -1871,8 +1872,8 @@ void sub_08053758(void) {
|
||||
gMenu.field_0xa = 0x1e;
|
||||
*((u8*)&gMenu + 0x10) = 0; // TODO
|
||||
gUI.field_0x6 = 1;
|
||||
gMapBottom.bgControlPtr = NULL;
|
||||
gMapTop.bgControlPtr = NULL;
|
||||
gMapBottom.bgSettings = NULL;
|
||||
gMapTop.bgSettings = NULL;
|
||||
gRoomControls.camera_target = NULL;
|
||||
gRoomControls.scroll_y = 0;
|
||||
gRoomControls.scroll_x = 0;
|
||||
|
||||
+4
-4
@@ -186,11 +186,11 @@ void WaitForNextFrame(void) {
|
||||
|
||||
if (gUpdateVisibleTiles) {
|
||||
gUpdateVisibleTiles = 0;
|
||||
if (gMapBottom.bgControlPtr != NULL)
|
||||
if (gMapBottom.bgSettings != NULL)
|
||||
// sizeof(BGBuffer) = 0x800, what are we omitting?
|
||||
DmaCopy32(3, &gBG1Buffer, VRAM + (*gMapBottom.bgControlPtr & 0x1f00) * 8, 0x5C0);
|
||||
if (gMapTop.bgControlPtr != NULL)
|
||||
DmaCopy32(3, &gBG2Buffer, VRAM + (*gMapTop.bgControlPtr & 0x1f00) * 8, 0x5C0);
|
||||
DmaCopy32(3, &gBG1Buffer, VRAM + (gMapBottom.bgSettings->control & 0x1f00) * 8, 0x5C0);
|
||||
if (gMapTop.bgSettings != NULL)
|
||||
DmaCopy32(3, &gBG2Buffer, VRAM + (gMapTop.bgSettings->control & 0x1f00) * 8, 0x5C0);
|
||||
}
|
||||
FadeVBlank();
|
||||
}
|
||||
|
||||
+6
-4
@@ -233,12 +233,12 @@ void sub_08056208(void) {
|
||||
gScreen._6d = 0;
|
||||
}
|
||||
|
||||
void sub_0805622C(void* a1, u32 a2, u32 a3) {
|
||||
void sub_0805622C(struct BgAffineDstData* a1, u32 a2, u32 a3) {
|
||||
gScreen._70 = a1;
|
||||
gScreen._74 = a2;
|
||||
gScreen._78 = a3;
|
||||
gScreen._6c = 1;
|
||||
gUnk_03003DE4 ^= 1;
|
||||
gUnk_03003DE4[0] ^= 1;
|
||||
}
|
||||
|
||||
void sub_08056250(void) {
|
||||
@@ -278,8 +278,10 @@ u32 CheckRegionOnScreen(u32 x0, u32 y0, u32 x1, u32 y1) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Iterate over array of AABBs and check if any fit on screen
|
||||
u16 CheckRegionsOnScreen(const u16* arr) {
|
||||
/**
|
||||
* Iterate over array of AABBs and check if any fit on screen
|
||||
*/
|
||||
u32 CheckRegionsOnScreen(const u16* arr) {
|
||||
const u16* i;
|
||||
for (i = arr; *i != 0xff; i += 5) {
|
||||
if (CheckRegionOnScreen(i[1], i[2], i[3], i[4]))
|
||||
|
||||
+59
-12
@@ -1,19 +1,66 @@
|
||||
#include "manager.h"
|
||||
|
||||
// TODO: change all manager arguments to be Entity* and cast to specific type later.
|
||||
void (*const gManagerFunctions[])() = {
|
||||
NULL, Manager1_Main, Manager2_Main, Manager3_Main, Manager4_Main, Manager5_Main, Manager6_Main,
|
||||
Manager7_Main, Manager8_Main, Manager9_Main, ManagerA_Main, ManagerB_Main, ManagerC_Main, ManagerD_Main,
|
||||
ManagerE_Main, sub_08058ECC, Manager10_Main, Manager11_Main, Manager12_Main, Manager13_Main, Manager14_Main,
|
||||
Manager15_Main, Manager16_Main, Manager17_Main, Manager18_Main, Manager19_Main, Manager1A_Main, Manager1B_Main,
|
||||
Manager1C_Main, Manager1D_Main, Manager1E_Main, Manager1F_Main, Manager20_Main, Manager21_Main, Manager22_Main,
|
||||
Manager23_Main, Manager24_Main, Manager25_Main, Manager26_Main, Manager27_Main, Manager28_Main, Manager29_Main,
|
||||
Manager2A_Main, Manager2B_Main, Manager2C_Main, Manager2D_Main, Manager2E_Main, Manager2F_Main, Manager30_Main,
|
||||
Manager31_Main, Manager32_Main, Manager33_Main, Manager34_Main, Manager35_Main, Manager36_Main, Manager37_Main,
|
||||
Manager38_Main, Manager39_Main
|
||||
};
|
||||
void (*const gMiscManagerunctions[])() = { NULL,
|
||||
LightRayManager_Main,
|
||||
VerticalMinishPathBackgroundManager_Main,
|
||||
MinishPortalManager_Main,
|
||||
DiggingCaveEntranceManager_Main,
|
||||
BridgeManager_Main,
|
||||
SpecialWarpManager_Main,
|
||||
MinishVillageTilesetManager_Main,
|
||||
HorizontalMinishPathBackgroundManager_Main,
|
||||
MinishRaftersBackgroundManager_Main,
|
||||
EzloHintManager_Main,
|
||||
FightManager_Main,
|
||||
RollingBarrelManager_Main,
|
||||
TileChangeObserveManager_Main,
|
||||
EntitySpawnManager_Main,
|
||||
MiscManager_Main,
|
||||
WeatherChangeManager_Main,
|
||||
FlagAndOperatorManager_Main,
|
||||
HyruleTownTilesetManager_Main,
|
||||
HouseSignManager_Main,
|
||||
SteamOverlayManager_Main,
|
||||
TempleOfDropletsManager_Main,
|
||||
DelayedEntityLoadManager_Main,
|
||||
FallingItemManager_Main,
|
||||
CloudOverlayManager_Main,
|
||||
PowBackgroundManager_Main,
|
||||
HoleManager_Main,
|
||||
StaticBackgroundManager_Main,
|
||||
RainfallManager_Main,
|
||||
AnimatedBackgroundManager_Main,
|
||||
RegionTriggerManager_Main,
|
||||
RailIntersectionManager_Main,
|
||||
MoveableObjectManager_Main,
|
||||
MinishSizedEntranceManager_Main,
|
||||
LightManager_Main,
|
||||
LightLevelSetManager_Main,
|
||||
BombableWallManager_Main,
|
||||
FlameManager_Main,
|
||||
PushableFurnitureManager_Main,
|
||||
ArmosInteriorManager_Main,
|
||||
EnemyInteractionManager_Main,
|
||||
Manager29_Main,
|
||||
DestructibleTileObserveManager_Main,
|
||||
AngryStatueManager_Main,
|
||||
CloudStaircaseTransitionManager_Main,
|
||||
WaterfallBottomManager_Main,
|
||||
SecretManager_Main,
|
||||
Vaati3BackgroundManager_Main,
|
||||
TilePuzzleManager_Main,
|
||||
GoronMerchantShopManager_Main,
|
||||
VaatiAppearingManager_Main,
|
||||
HyruleTownBellManager_Main,
|
||||
Vaati3InsideArmManager_Main,
|
||||
CameraTargetManager_Main,
|
||||
RepeatedSoundManager_Main,
|
||||
Vaati3StartManager_Main,
|
||||
FloatingPlatformManager_Main,
|
||||
EnterRoomTextboxManager_Main };
|
||||
|
||||
void ManagerUpdate(Entity* this) {
|
||||
if (!EntityIsDeleted(this))
|
||||
gManagerFunctions[this->id](this);
|
||||
gMiscManagerunctions[this->id](this);
|
||||
}
|
||||
|
||||
@@ -1,44 +1,30 @@
|
||||
#include "manager.h"
|
||||
/**
|
||||
* @file angryStatueManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Manages the synchronized shooting and destruction of the AngryStatues.
|
||||
*/
|
||||
#include "manager/angryStatueManager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
Entity* field_0x20[4];
|
||||
u8 field_0x30;
|
||||
u8 field_0x31;
|
||||
u8 field_0x32;
|
||||
u8 field_0x33;
|
||||
u8 field_0x34;
|
||||
u8 field_0x35;
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
u8 field_0x38;
|
||||
u8 field_0x39;
|
||||
u8 field_0x3a;
|
||||
u8 field_0x3b;
|
||||
u8 field_0x3c;
|
||||
u8 field_0x3d;
|
||||
u16 field_0x3e;
|
||||
} Manager2B;
|
||||
void sub_0805D11C(AngryStatueManager*);
|
||||
void AngryStatueManager_Init(AngryStatueManager*);
|
||||
void AngryStatueManager_Action1(AngryStatueManager*);
|
||||
void AngryStatueManager_Action2(AngryStatueManager*);
|
||||
|
||||
void sub_0805D11C(Manager2B*);
|
||||
void sub_0805D02C(Manager2B*);
|
||||
void sub_0805D0C4(Manager2B*);
|
||||
void sub_0805D0FC(Manager2B*);
|
||||
|
||||
void Manager2B_Main(Manager2B* this) {
|
||||
static void (*const gUnk_08108D30[])(Manager2B*) = {
|
||||
sub_0805D02C,
|
||||
sub_0805D0C4,
|
||||
sub_0805D0FC,
|
||||
void AngryStatueManager_Main(AngryStatueManager* this) {
|
||||
static void (*const AngryStatueManager_Actions[])(AngryStatueManager*) = {
|
||||
AngryStatueManager_Init,
|
||||
AngryStatueManager_Action1,
|
||||
AngryStatueManager_Action2,
|
||||
};
|
||||
gUnk_08108D30[this->manager.action](this);
|
||||
AngryStatueManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void sub_0805D02C(Manager2B* this) {
|
||||
void AngryStatueManager_Init(AngryStatueManager* this) {
|
||||
u32 counter;
|
||||
u16* objectData;
|
||||
Entity* object;
|
||||
@@ -46,7 +32,7 @@ void sub_0805D02C(Manager2B* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (gEntCount < 0x44) {
|
||||
objectData = GetCurrentRoomProperty(this->manager.unk_0a);
|
||||
objectData = GetCurrentRoomProperty(super->type);
|
||||
counter = 0;
|
||||
while (counter < 4) {
|
||||
object = CreateObject(ANGRY_STATUE, objectData[2], counter);
|
||||
@@ -58,33 +44,33 @@ void sub_0805D02C(Manager2B* this) {
|
||||
counter += 1;
|
||||
objectData += 3;
|
||||
}
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_0f = 0x3c;
|
||||
super->action = 1;
|
||||
super->subtimer = 0x3c;
|
||||
this->field_0x36 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D0C4(Manager2B* this) {
|
||||
if (--this->manager.unk_0f == 0) {
|
||||
this->manager.unk_0f = 0xb4;
|
||||
void AngryStatueManager_Action1(AngryStatueManager* this) {
|
||||
if (--super->subtimer == 0) {
|
||||
super->subtimer = 0xb4;
|
||||
}
|
||||
if (this->field_0x36 == 0xf) {
|
||||
this->manager.action = 2;
|
||||
this->manager.unk_0e = 8;
|
||||
super->action = 2;
|
||||
super->timer = 8;
|
||||
SoundReq(SFX_SECRET);
|
||||
sub_0805D11C(this);
|
||||
}
|
||||
this->field_0x36 = 0;
|
||||
}
|
||||
|
||||
void sub_0805D0FC(Manager2B* this) {
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
void AngryStatueManager_Action2(AngryStatueManager* this) {
|
||||
if (--super->timer == 0) {
|
||||
SetFlag(this->field_0x3e);
|
||||
DeleteManager(&this->manager);
|
||||
DeleteManager(super);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D11C(Manager2B* this) {
|
||||
void sub_0805D11C(AngryStatueManager* this) {
|
||||
Entity** entity_iterator;
|
||||
u32 counter;
|
||||
for (counter = 0; counter < 4; counter++) {
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @file animatedBackgroundManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Set up bg3 for cloud tops, vaati2 and some beanstalks.
|
||||
*/
|
||||
#include "manager/animatedBackgroundManager.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
|
||||
void AnimatedBackgroundManager_Init(AnimatedBackgroundManager*);
|
||||
void AnimatedBackgroundManager_Action1(AnimatedBackgroundManager*);
|
||||
|
||||
void AnimatedBackgroundManager_Main(AnimatedBackgroundManager* this) {
|
||||
static void (*const AnimatedBackgroundManager_Actions[])(AnimatedBackgroundManager*) = {
|
||||
AnimatedBackgroundManager_Init,
|
||||
AnimatedBackgroundManager_Action1,
|
||||
};
|
||||
AnimatedBackgroundManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void AnimatedBackgroundManager_Init(AnimatedBackgroundManager* this) {
|
||||
static const u16 gUnk_08108C88[] = { 0x1e07, 0x1e07 };
|
||||
super->action = 1;
|
||||
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||
gScreen.bg3.control = gUnk_08108C88[super->type];
|
||||
gRoomControls.bg3OffsetY.WORD = 0;
|
||||
gRoomControls.bg3OffsetX.WORD = 0;
|
||||
|
||||
switch (super->type) {
|
||||
case 0:
|
||||
default:
|
||||
gScreen.bg3.yOffset = 0;
|
||||
gScreen.bg3.xOffset = 0;
|
||||
break;
|
||||
case 1:
|
||||
gScreen.bg3.xOffset = gRoomControls.scroll_x + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.bg3.yOffset = gRoomControls.scroll_y + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void AnimatedBackgroundManager_Action1(AnimatedBackgroundManager* this) {
|
||||
if (super->type == 1) {
|
||||
gRoomControls.bg3OffsetX.WORD = gRoomControls.bg3OffsetX.WORD + 0x2000;
|
||||
gScreen.bg3.xOffset = gRoomControls.scroll_x + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.bg3.yOffset = gRoomControls.scroll_y + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/**
|
||||
* @file armosInteriorManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Armos Interior Manager.
|
||||
*/
|
||||
#include "manager/armosInteriorManager.h"
|
||||
#include "common.h"
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "sound.h"
|
||||
|
||||
bool32 sub_0805C920(ArmosInteriorManager*);
|
||||
void ArmosInteriorManager_Init(ArmosInteriorManager*);
|
||||
void ArmosInteriorManager_Action1(ArmosInteriorManager*);
|
||||
void ArmosInteriorManager_Action2(ArmosInteriorManager*);
|
||||
void ArmosInteriorManager_Action3(ArmosInteriorManager*);
|
||||
|
||||
void ArmosInteriorManager_Main(ArmosInteriorManager* this) {
|
||||
static void (*const ArmosInteriorManager_Actions[])(ArmosInteriorManager*) = {
|
||||
ArmosInteriorManager_Init,
|
||||
ArmosInteriorManager_Action1,
|
||||
ArmosInteriorManager_Action2,
|
||||
ArmosInteriorManager_Action3,
|
||||
};
|
||||
ArmosInteriorManager_Actions[super->action](this);
|
||||
if (CheckLocalFlagByBank(FLAG_BANK_3, super->type + 0x67)) {
|
||||
gRoomTransition.armos_data.field_0xac |= (1 << super->type);
|
||||
} else {
|
||||
gRoomTransition.armos_data.field_0xac &= ~(1 << super->type);
|
||||
}
|
||||
}
|
||||
|
||||
void ArmosInteriorManager_Init(ArmosInteriorManager* this) {
|
||||
if (sub_0805C920(this)) {
|
||||
super->action = 2;
|
||||
} else {
|
||||
super->action = 1;
|
||||
}
|
||||
|
||||
super->timer = 1;
|
||||
super->subtimer = 0;
|
||||
}
|
||||
|
||||
void ArmosInteriorManager_Action1(ArmosInteriorManager* this) {
|
||||
if (sub_0805C920(this)) {
|
||||
super->action = 2;
|
||||
super->timer = 1;
|
||||
SoundReq(SFX_EM_ARMOS_ON);
|
||||
}
|
||||
}
|
||||
|
||||
void ArmosInteriorManager_Action2(ArmosInteriorManager* this) {
|
||||
static const u8 gUnk_08108D20[] = { 0x6F, 0x70, 0x71, 0x72, 0x71, 0x70 };
|
||||
u8 bVar1;
|
||||
int iVar2;
|
||||
|
||||
if (--super->timer == 0) {
|
||||
super->timer = 0x14;
|
||||
|
||||
if (++super->subtimer > 5) {
|
||||
super->subtimer = 0;
|
||||
}
|
||||
LoadPaletteGroup(gUnk_08108D20[super->subtimer]);
|
||||
if (super->subtimer == 0) {
|
||||
SoundReq(SFX_EM_ARMOS_ON);
|
||||
}
|
||||
}
|
||||
if (sub_0805C920(this) == 0) {
|
||||
super->action = 3;
|
||||
}
|
||||
}
|
||||
|
||||
void ArmosInteriorManager_Action3(ArmosInteriorManager* this) {
|
||||
if (super->subtimer == 0) {
|
||||
super->action = 1;
|
||||
} else {
|
||||
ArmosInteriorManager_Action2(this);
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_0805C920(ArmosInteriorManager* this) {
|
||||
return CheckLocalFlagByBank(FLAG_BANK_3, super->type + 0x67);
|
||||
}
|
||||
@@ -1,55 +1,62 @@
|
||||
/**
|
||||
* @file bombableWallManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Manages bombable walls.
|
||||
*/
|
||||
#include "manager/bombableWallManager.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "flags.h"
|
||||
#include "sound.h"
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
#include "object.h"
|
||||
#include "sound.h"
|
||||
|
||||
u32 sub_0805BFC4(u32, u32);
|
||||
void sub_0805C02C(Manager24*);
|
||||
void sub_0805C02C(BombableWallManager*);
|
||||
|
||||
extern u32 sub_080B1AE0(u16, u8);
|
||||
|
||||
u32 getArchwayType(void);
|
||||
void sub_0805BF30(Manager24*);
|
||||
void sub_0805BF78(Manager24*);
|
||||
void sub_0805BFA4(Manager24*);
|
||||
void BombableWallManager_Init(BombableWallManager*);
|
||||
void BombableWallManager_Action1(BombableWallManager*);
|
||||
void BombableWallManager_Action2(BombableWallManager*);
|
||||
void sub_0805C050(u32, u32);
|
||||
void sub_0805C178(u32, u32);
|
||||
void sub_0805C294(u32, u32);
|
||||
void sub_0805C3B4(u32, u32);
|
||||
void sub_0805C4E0(u32, u32);
|
||||
|
||||
void Manager24_Main(Manager24* manager) {
|
||||
static void (*const actionFuncs[])(Manager24*) = {
|
||||
sub_0805BF30,
|
||||
sub_0805BF78,
|
||||
sub_0805BFA4,
|
||||
void BombableWallManager_Main(BombableWallManager* this) {
|
||||
static void (*const BombableWallManager_Actions[])(BombableWallManager*) = {
|
||||
BombableWallManager_Init,
|
||||
BombableWallManager_Action1,
|
||||
BombableWallManager_Action2,
|
||||
};
|
||||
actionFuncs[manager->manager.action](manager);
|
||||
BombableWallManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void sub_0805BF30(Manager24* manager) {
|
||||
manager->manager.action = 1;
|
||||
manager->tile = (manager->x >> 4 & 0x3fU) | (((manager->y << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
manager->manager.unk_0a = sub_0805BFC4(manager->tile, manager->field_0x35);
|
||||
if (CheckLocalFlag(manager->field_0x3e) != 0) {
|
||||
sub_0805C02C(manager);
|
||||
DeleteManager((Manager*)manager);
|
||||
void BombableWallManager_Init(BombableWallManager* this) {
|
||||
super->action = 1;
|
||||
this->tile = (this->x >> 4 & 0x3fU) | (((this->y << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
super->type = sub_0805BFC4(this->tile, this->field_0x35);
|
||||
if (CheckLocalFlag(this->field_0x3e) != 0) {
|
||||
sub_0805C02C(this);
|
||||
DeleteManager(super);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BF78(Manager24* this) {
|
||||
void BombableWallManager_Action1(BombableWallManager* this) {
|
||||
if (sub_080B1AE0(this->tile, this->field_0x35) != 0x2e) {
|
||||
this->manager.action = 2;
|
||||
this->manager.unk_0e = 0x5a;
|
||||
super->action = 2;
|
||||
super->timer = 0x5a;
|
||||
sub_0805C02C(this);
|
||||
SetLocalFlag(this->field_0x3e);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BFA4(Manager24* this) {
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
void BombableWallManager_Action2(BombableWallManager* this) {
|
||||
if (--super->timer == 0) {
|
||||
SoundReq(SFX_SECRET);
|
||||
DeleteManager((Manager*)this);
|
||||
}
|
||||
@@ -83,12 +90,12 @@ u32 sub_0805BFC4(u32 pos, u32 layer) {
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
void sub_0805C02C(Manager24* this) {
|
||||
void sub_0805C02C(BombableWallManager* this) {
|
||||
static void (*const gUnk_08108CE8[])(u32, u32) = {
|
||||
sub_0805C050, sub_0805C178, sub_0805C294, sub_0805C3B4, sub_0805C4E0,
|
||||
};
|
||||
if (this->manager.unk_0a != 0xff) {
|
||||
gUnk_08108CE8[this->manager.unk_0a](this->tile, this->field_0x35);
|
||||
if (super->type != 0xff) {
|
||||
gUnk_08108CE8[super->type](this->tile, this->field_0x35);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
* @file bridgeManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Manages spawn/removal of bridges
|
||||
*/
|
||||
#include "manager/bridgeManager.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "sound.h"
|
||||
|
||||
void BridgeManager_Init(BridgeManager*);
|
||||
void BridgeManager_Action1(BridgeManager*);
|
||||
void BridgeManager_Action2(BridgeManager*);
|
||||
|
||||
static const u16 gUnk_08108024[] = { 0, -1, 1, 0, 0, 1, -1, 0 };
|
||||
static const u16 gUnk_08108034[] = { 0, 1, -1, 0, 0, -1, 1, 0 };
|
||||
|
||||
void BridgeManager_Main(BridgeManager* this) {
|
||||
static void (*const BridgeManager_Actions[])(BridgeManager*) = {
|
||||
BridgeManager_Init,
|
||||
BridgeManager_Action1,
|
||||
BridgeManager_Action2,
|
||||
};
|
||||
BridgeManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void sub_08057CA4(BridgeManager*, u32, u32);
|
||||
|
||||
void BridgeManager_Init(BridgeManager* this) {
|
||||
u32 tmp;
|
||||
tmp = (super->type2 & 0x3) << 1;
|
||||
if (super->timer == 1) {
|
||||
this->unk_30 = 0x323;
|
||||
} else {
|
||||
this->unk_30 = tmp & 2 ? 0x37 : 0x36;
|
||||
}
|
||||
this->unk_28 = gUnk_08108024[tmp];
|
||||
this->unk_2a = gUnk_08108024[tmp + 1];
|
||||
this->unk_2c = gUnk_08108034[tmp];
|
||||
this->unk_2e = gUnk_08108034[tmp + 1];
|
||||
this->unk_32 = ((super->type2 >> 2) & 0xF) + 1;
|
||||
super->timer = 0x1C;
|
||||
super->subtimer = 0;
|
||||
super->action = (super->type2 & 0x80) ? 2 : 1;
|
||||
if (super->action != 2 || !CheckFlags(this->flags))
|
||||
return;
|
||||
for (; this->unk_32; this->unk_32--) {
|
||||
sub_08057CA4(this, this->unk_28, this->unk_2a);
|
||||
sub_0807B7D8(this->unk_30, this->x | (this->y << 6), this->unk_3c);
|
||||
}
|
||||
DeleteManager(super);
|
||||
}
|
||||
|
||||
void BridgeManager_Action1(BridgeManager* this) {
|
||||
if (--super->timer)
|
||||
return;
|
||||
super->timer = 8;
|
||||
if (CheckFlags(this->flags)) {
|
||||
if (this->unk_32 == super->subtimer)
|
||||
return;
|
||||
sub_08057CA4(this, this->unk_28, this->unk_2a);
|
||||
sub_0807B7D8(this->unk_30, this->x | (this->y << 6), this->unk_3c);
|
||||
super->subtimer++;
|
||||
SoundReq(SFX_HEART_GET);
|
||||
} else {
|
||||
if (!super->subtimer)
|
||||
return;
|
||||
RestorePrevTileEntity(this->x | (this->y << 6), this->unk_3c);
|
||||
sub_08057CA4(this, this->unk_2c, this->unk_2e);
|
||||
super->subtimer--;
|
||||
SoundReq(SFX_HEART_GET);
|
||||
}
|
||||
}
|
||||
|
||||
void BridgeManager_Action2(BridgeManager* this) {
|
||||
if (super->subAction == 0) {
|
||||
if (!CheckFlags(this->flags))
|
||||
return;
|
||||
super->subAction++;
|
||||
} else {
|
||||
if (--super->timer)
|
||||
return;
|
||||
super->timer = 8;
|
||||
if (this->unk_32 != super->subtimer) {
|
||||
sub_08057CA4(this, this->unk_28, this->unk_2a);
|
||||
sub_0807B7D8(this->unk_30, this->x | (this->y << 6), this->unk_3c);
|
||||
super->subtimer++;
|
||||
SoundReq(SFX_HEART_GET);
|
||||
} else {
|
||||
if (this->unk_30 != 0x323) {
|
||||
SoundReq(SFX_SECRET);
|
||||
}
|
||||
DeleteManager(super);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08057CA4(BridgeManager* this, u32 xOffset, u32 yOffset) {
|
||||
this->x += xOffset;
|
||||
this->y += yOffset;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/**
|
||||
* @file cameraTargetManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Creates a camera target object when a flag is set.
|
||||
*/
|
||||
#include "manager/cameraTargetManager.h"
|
||||
#include "flags.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
|
||||
void CameraTargetManager_Init(CameraTargetManager*);
|
||||
void CameraTargetManager_Action1(CameraTargetManager*);
|
||||
void CameraTargetManager_Action2(CameraTargetManager*);
|
||||
void CameraTargetManager_Action3(CameraTargetManager*);
|
||||
|
||||
void CameraTargetManager_Main(CameraTargetManager* this) {
|
||||
static void (*const CameraTargetManager_Actions[])(CameraTargetManager*) = {
|
||||
CameraTargetManager_Init,
|
||||
CameraTargetManager_Action1,
|
||||
CameraTargetManager_Action2,
|
||||
CameraTargetManager_Action3,
|
||||
};
|
||||
CameraTargetManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void CameraTargetManager_Init(CameraTargetManager* this) {
|
||||
if (CheckFlags(this->field_0x3c) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
SetFlag(this->field_0x3c);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
super->action = 1;
|
||||
}
|
||||
|
||||
void CameraTargetManager_Action1(CameraTargetManager* this) {
|
||||
Entity* object;
|
||||
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
super->action = 2;
|
||||
super->timer = this->field_0x35;
|
||||
if (super->timer == 0) {
|
||||
super->timer = 0x1e;
|
||||
}
|
||||
super->parent = gRoomControls.camera_target;
|
||||
object = CreateObject(OBJECT_69, 0, 0);
|
||||
if (object != NULL) {
|
||||
object->x.HALF.HI = this->field_0x38 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = this->field_0x3a + gRoomControls.origin_y;
|
||||
super->child = object;
|
||||
gRoomControls.camera_target = object;
|
||||
RequestPriorityDuration(object, 0x1e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CameraTargetManager_Action2(CameraTargetManager* this) {
|
||||
RequestPriorityDuration(0, 8);
|
||||
if ((gRoomControls.scroll_flags & 4) == 0 && --super->timer == 0) {
|
||||
super->action = 3;
|
||||
SetFlag(this->field_0x3c);
|
||||
if (this->field_0x36 == 0) {
|
||||
this->field_0x36 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CameraTargetManager_Action3(CameraTargetManager* this) {
|
||||
RequestPriorityDuration(0, 8);
|
||||
if (this->field_0x36 != 0) {
|
||||
if (--this->field_0x36 == 0) {
|
||||
gRoomControls.camera_target = super->parent;
|
||||
}
|
||||
} else {
|
||||
if ((gRoomControls.scroll_flags & 4) == 0) {
|
||||
Entity* entity = super->child;
|
||||
if (entity != NULL) {
|
||||
DeleteEntity(entity);
|
||||
}
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,18 @@
|
||||
#include "manager.h"
|
||||
#include "screen.h"
|
||||
/**
|
||||
* @file cloudOverlayManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Cloud bg overlay for Hyrule Fields.
|
||||
*/
|
||||
#include "manager/cloudOverlayManager.h"
|
||||
#include "area.h"
|
||||
#include "functions.h"
|
||||
#include "screen.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u16 field_0x20;
|
||||
} Manager18;
|
||||
void sub_0805AEDC(CloudOverlayManager*);
|
||||
void sub_0805AF3C(CloudOverlayManager*);
|
||||
|
||||
void sub_0805AEDC(Manager18*);
|
||||
void sub_0805AF3C(Manager18*);
|
||||
|
||||
void Manager18_Main(Manager18* this) {
|
||||
void CloudOverlayManager_Main(CloudOverlayManager* this) {
|
||||
static const u16 gUnk_0810865C[] = {
|
||||
0xf01, 0xe02, 0xe03, 0xe04, 0, 0,
|
||||
};
|
||||
@@ -20,11 +21,11 @@ void Manager18_Main(Manager18* this) {
|
||||
sub_0805AEDC(NULL);
|
||||
}
|
||||
} else {
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_10 |= 0x20;
|
||||
this->manager.unk_0e = 0;
|
||||
this->manager.unk_0f = 8;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
super->flags |= ENT_PERSIST;
|
||||
super->timer = 0;
|
||||
super->subtimer = 8;
|
||||
this->field_0x20 = gUnk_0810865C[0];
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
if (gArea.onEnter == NULL) {
|
||||
@@ -33,10 +34,10 @@ void Manager18_Main(Manager18* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
} else {
|
||||
if ((gUnk_0810865C[this->manager.unk_0e] != 0) && (--this->manager.unk_0f == 0)) {
|
||||
this->manager.unk_0f = 4;
|
||||
if (gUnk_0810865C[++this->manager.unk_0e] != 0) {
|
||||
this->field_0x20 = gUnk_0810865C[this->manager.unk_0e];
|
||||
if ((gUnk_0810865C[super->timer] != 0) && (--super->subtimer == 0)) {
|
||||
super->subtimer = 4;
|
||||
if (gUnk_0810865C[++super->timer] != 0) {
|
||||
this->field_0x20 = gUnk_0810865C[super->timer];
|
||||
gScreen.controls.alphaBlend = this->field_0x20;
|
||||
}
|
||||
}
|
||||
@@ -48,7 +49,7 @@ void Manager18_Main(Manager18* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805AEDC(Manager18* this) {
|
||||
void sub_0805AEDC(CloudOverlayManager* this) {
|
||||
gScreen.bg3.control = BGCNT_SCREENBASE(30) | BGCNT_PRIORITY(1) | BGCNT_CHARBASE(1);
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||
gScreen.controls.layerFXControl =
|
||||
@@ -57,12 +58,12 @@ void sub_0805AEDC(Manager18* this) {
|
||||
gScreen.bg3.xOffset = gRoomControls.scroll_x + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.bg3.yOffset = gRoomControls.scroll_y + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
if (this != NULL) {
|
||||
Manager18_Main(this);
|
||||
CloudOverlayManager_Main(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805AF3C(Manager18* this) {
|
||||
this->manager.unk_10 &= 0xdf;
|
||||
void sub_0805AF3C(CloudOverlayManager* this) {
|
||||
super->flags &= ~ENT_PERSIST;
|
||||
gScreen.lcd.displayControl &= ~DISPCNT_BG3_ON;
|
||||
gScreen.controls.layerFXControl = 0;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @file cloudStaircaseTransitionManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Manages the transition on top of a cloud staircase.
|
||||
*/
|
||||
#include "manager/cloudStaircaseTransitionManager.h"
|
||||
#include "asm.h"
|
||||
#include "common.h"
|
||||
#include "functions.h"
|
||||
|
||||
void CloudStaircaseTransitionManager_Main(CloudStaircaseTransitionManager* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
this->y = 0;
|
||||
}
|
||||
if (((CheckPlayerInRegion(this->x, this->y, 0x14, 0x40) != 0) &&
|
||||
(((gPlayerEntity.y.HALF.HI - gRoomControls.origin_y) + gPlayerEntity.z.HALF.HI) < 0)) &&
|
||||
(gRoomControls.scroll_y == gRoomControls.origin_y)) {
|
||||
MemClear(&gRoomTransition.player_status, sizeof(PlayerRoomStatus));
|
||||
gRoomTransition.transitioningOut = 1;
|
||||
gRoomTransition.type = TRANSITION_DEFAULT;
|
||||
gRoomTransition.player_status.spawn_type = PL_SPAWN_PARACHUTE_UP;
|
||||
gRoomTransition.player_status.area_next = super->type2;
|
||||
gRoomTransition.player_status.room_next = super->timer;
|
||||
gRoomTransition.player_status.start_anim = this->field_0x37;
|
||||
gRoomTransition.player_status.start_pos_x = this->field_0x3c;
|
||||
gRoomTransition.player_status.start_pos_y = this->field_0x3e;
|
||||
gRoomTransition.player_status.layer = this->field_0x36;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* @file delayedEntityLoadManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Delayed entity loader.
|
||||
*/
|
||||
#include "manager/delayedEntityLoadManager.h"
|
||||
|
||||
ASM_FUNC("asm/non_matching/delayedEntityLoadManager/DelayedEntityLoadManager_Main.inc",
|
||||
void DelayedEntityLoadManager_Main())
|
||||
|
||||
ASM_FUNC("asm/non_matching/delayedEntityLoadManager/sub_0805ACC0.inc", u32 sub_0805ACC0(Entity* ent))
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @file destructibleTileObserveManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Sets a flag when a tile changes, e.g. to remember that grass has been cut.
|
||||
*/
|
||||
#include "manager/destructibleTileObserveManager.h"
|
||||
#include "asm.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
|
||||
void sub_0805CFF0(DestructibleTileObserveManager_unk*);
|
||||
|
||||
void DestructibleTileObserveManager_Main(DestructibleTileObserveManager* this) {
|
||||
DestructibleTileObserveManager_unk* data;
|
||||
|
||||
if (super->action == 0) {
|
||||
super->action++;
|
||||
}
|
||||
data = (DestructibleTileObserveManager_unk*)GetCurrentRoomProperty(3);
|
||||
if (data != NULL) {
|
||||
for (; data->field_0x0 != 0; data = data + 1) {
|
||||
if (data->field_0x0 == 10) {
|
||||
sub_0805CFF0(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805CFF0(DestructibleTileObserveManager_unk* param_1) {
|
||||
if (!CheckLocalFlag(param_1->flag)) {
|
||||
u32 tileType = GetTileType(param_1->tilePos, param_1->tileLayer);
|
||||
if (param_1->tileType == tileType) {
|
||||
SetLocalFlag(param_1->flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,381 @@
|
||||
/**
|
||||
* @file diggingCaveEntranceManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Manages digging cave entrances
|
||||
*/
|
||||
#include "manager/diggingCaveEntranceManager.h"
|
||||
#include "area.h"
|
||||
#include "asm.h"
|
||||
#include "functions.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "scroll.h"
|
||||
|
||||
void DiggingCaveEntranceManager_Main(DiggingCaveEntranceManager*);
|
||||
void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager*);
|
||||
void DiggingCaveEntranceManager_Action1(DiggingCaveEntranceManager*);
|
||||
bool32 DiggingCaveEntranceManager_CheckEnterEntrance(DiggingCaveEntranceManager*, const DiggingCaveEntrance*);
|
||||
void DiggingCaveEntranceManager_EnterEntrance(DiggingCaveEntranceManager*, const DiggingCaveEntrance*);
|
||||
const DiggingCaveEntrance* GetDiggingCaveEntranceForRoom(const DiggingCaveEntrance*, int);
|
||||
|
||||
void DiggingCaveEntranceManager_Main(DiggingCaveEntranceManager* this) {
|
||||
static void (*const DiggingCaveEntranceManager_Actions[])(DiggingCaveEntranceManager*) = {
|
||||
DiggingCaveEntranceManager_Init,
|
||||
DiggingCaveEntranceManager_Action1,
|
||||
};
|
||||
DiggingCaveEntranceManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager* this) {
|
||||
const DiggingCaveEntrance* entrance;
|
||||
u8 room;
|
||||
u8 area;
|
||||
u16 tile = 0x81 << 7;
|
||||
UpdateIsDiggingCave();
|
||||
if (gDiggingCaveEntranceTransition.isDiggingCave) {
|
||||
if (gDiggingCaveEntranceTransition.entrance == NULL) {
|
||||
gDiggingCaveEntranceTransition.previousArea = 0xff;
|
||||
room = gRoomControls.room;
|
||||
entrance = diggingCaveEntrances[gRoomControls.area];
|
||||
entrance = GetDiggingCaveEntranceForRoom(entrance, room);
|
||||
if (entrance != 0) {
|
||||
room = entrance->targetRoom;
|
||||
entrance = diggingCaveEntrances[entrance->targetArea];
|
||||
entrance = GetDiggingCaveEntranceForRoom(entrance, room);
|
||||
if (entrance != 0) {
|
||||
gDiggingCaveEntranceTransition.entrance = entrance;
|
||||
}
|
||||
}
|
||||
}
|
||||
room = gRoomControls.room;
|
||||
entrance = diggingCaveEntrances[gRoomControls.area];
|
||||
tile = 0x81 << 7; // 0x4080
|
||||
for (entrance = GetDiggingCaveEntranceForRoom(entrance, room); entrance != 0;
|
||||
entrance = GetDiggingCaveEntranceForRoom(entrance, room)) {
|
||||
SetTile(tile, entrance->sourceTilePosition + TILE_POS(-1, 1), 1);
|
||||
SetTile(tile, entrance->sourceTilePosition + TILE_POS(0, 1), 1);
|
||||
SetTile(tile, entrance->sourceTilePosition + TILE_POS(1, 1), 1);
|
||||
entrance++;
|
||||
}
|
||||
}
|
||||
super->action = 1;
|
||||
}
|
||||
|
||||
void DiggingCaveEntranceManager_Action1(DiggingCaveEntranceManager* this) {
|
||||
const DiggingCaveEntrance* entrance;
|
||||
u8 room = gRoomControls.room;
|
||||
for (entrance = diggingCaveEntrances[gRoomControls.area];
|
||||
(entrance = GetDiggingCaveEntranceForRoom(entrance, room)) != NULL &&
|
||||
!DiggingCaveEntranceManager_CheckEnterEntrance(this, entrance);
|
||||
entrance++)
|
||||
;
|
||||
}
|
||||
|
||||
bool32 DiggingCaveEntranceManager_CheckEnterEntrance(DiggingCaveEntranceManager* this,
|
||||
const DiggingCaveEntrance* entr) {
|
||||
u16 offsetX, offsetY, offsetX2, offsetY2;
|
||||
u32 tmp, tmp2;
|
||||
if (gDiggingCaveEntranceTransition.isDiggingCave) {
|
||||
offsetX = gPlayerEntity.x.HALF.HI - gRoomControls.origin_x;
|
||||
offsetY = gPlayerEntity.y.HALF.HI - gRoomControls.origin_y;
|
||||
offsetX2 = (entr->sourceTilePosition & TILE_POS_X_COMPONENT) * 16 + 8;
|
||||
offsetY2 = ((entr->sourceTilePosition & TILE_POS_Y_COMPONENT) >> 6) * 16 + 0x18;
|
||||
tmp = offsetX - offsetX2;
|
||||
if (tmp + 0x18 > 0x30 || offsetY - offsetY2 + 8 > 0x10U)
|
||||
return FALSE;
|
||||
if (offsetY < offsetY2 && tmp + 0xC <= 0x18)
|
||||
return FALSE;
|
||||
DiggingCaveEntranceManager_EnterEntrance(this, entr);
|
||||
return TRUE;
|
||||
} else {
|
||||
if (COORD_TO_TILE(&gPlayerEntity) != entr->sourceTilePosition)
|
||||
return FALSE;
|
||||
offsetY2 = gRoomControls.origin_y + ((entr->sourceTilePosition >> 6) << 4) + 6;
|
||||
if (gPlayerEntity.y.HALF.HI >= offsetY2)
|
||||
return FALSE;
|
||||
DiggingCaveEntranceManager_EnterEntrance(this, entr);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void DiggingCaveEntranceManager_EnterEntrance(DiggingCaveEntranceManager* this, const DiggingCaveEntrance* entr) {
|
||||
u16 isDiggingCave;
|
||||
SetInitializationPriority();
|
||||
gDiggingCaveEntranceTransition.previousArea = gDiggingCaveEntranceTransition.currentArea;
|
||||
gDiggingCaveEntranceTransition.currentArea = gRoomControls.area;
|
||||
gRoomTransition.player_status.area_next = entr->targetArea;
|
||||
gRoomTransition.player_status.room_next = entr->targetRoom;
|
||||
gRoomControls.area = entr->targetArea;
|
||||
gRoomControls.room = entr->targetRoom;
|
||||
gDiggingCaveEntranceTransition.entrance = entr;
|
||||
gDiggingCaveEntranceTransition.offsetX =
|
||||
gPlayerEntity.x.HALF.HI - gRoomControls.origin_x - ((entr->sourceTilePosition & TILE_POS_X_COMPONENT) * 16);
|
||||
gDiggingCaveEntranceTransition.offsetY =
|
||||
gPlayerEntity.y.HALF.HI - gRoomControls.origin_y - ((entr->sourceTilePosition & TILE_POS_Y_COMPONENT) >> 2);
|
||||
|
||||
#ifndef EU
|
||||
isDiggingCave = gDiggingCaveEntranceTransition.isDiggingCave;
|
||||
if (!isDiggingCave) {
|
||||
if ((entr->targetRoom | 0x80) != gDiggingCaveEntranceTransition.targetRoom) {
|
||||
gUnk_02034480.unk_00 = gDiggingCaveEntranceTransition.isDiggingCave;
|
||||
}
|
||||
gDiggingCaveEntranceTransition.targetRoom = entr->targetRoom | 0x80;
|
||||
}
|
||||
#endif
|
||||
|
||||
sub_08080930(entr->type);
|
||||
DeleteManager(this);
|
||||
}
|
||||
|
||||
const DiggingCaveEntrance* GetDiggingCaveEntranceForRoom(const DiggingCaveEntrance* entr, int room) {
|
||||
for (; entr->sourceTilePosition != 0xffff; entr++) {
|
||||
if (entr->sourceRoom == room)
|
||||
return entr;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define END_OF_LIST \
|
||||
{ 0xffff, 0, 0, 0, 0 }
|
||||
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesEmpty[] = { END_OF_LIST };
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesMinishWoods[] = {
|
||||
{ TILE_POS(37, 19), ROOM_MINISH_WOODS_MAIN, 0x0, AREA_LAKE_WOODS_CAVE, ROOM_LAKE_WOODS_CAVE_MAIN,
|
||||
TILE_POS(37, 51) },
|
||||
{ TILE_POS(31, 15), ROOM_MINISH_WOODS_MAIN, 0x0, AREA_LAKE_WOODS_CAVE, ROOM_LAKE_WOODS_CAVE_MAIN,
|
||||
TILE_POS(31, 47) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyruleField[] = {
|
||||
{ TILE_POS(3, 11), ROOM_HYRULE_FIELD_EASTERN_HILLLS_NORTH, 0x4, AREA_DIG_CAVES, ROOM_DIG_CAVES_EASTERN_HILLS,
|
||||
TILE_POS(3, 11) },
|
||||
{ TILE_POS(35, 5), ROOM_HYRULE_FIELD_LON_LON_RANCH, 0x10, AREA_HYLIA_DIG_CAVES, ROOM_HYLIA_DIG_CAVES_1,
|
||||
TILE_POS(8, 17) },
|
||||
{ TILE_POS(5, 14), ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, 0xa, AREA_DIG_CAVES, ROOM_DIG_CAVES_TRILBY_HIGHLANDS,
|
||||
TILE_POS(5, 14) },
|
||||
{ TILE_POS(16, 14), ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS, 0xa, AREA_DIG_CAVES, ROOM_DIG_CAVES_TRILBY_HIGHLANDS,
|
||||
TILE_POS(16, 14) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyruleTown[] = { { TILE_POS(45, 24), ROOM_HYRULE_TOWN_MAIN, 0x2,
|
||||
AREA_HYRULE_DIG_CAVES,
|
||||
ROOM_HYRULE_DIG_CAVES_TOWN, TILE_POS(45, 40) },
|
||||
END_OF_LIST };
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesMtCrenel[] = {
|
||||
{ TILE_POS(3, 5), ROOM_MT_CRENEL_WALL_CLIMB, 0x6, AREA_CRENEL_DIG_CAVE, ROOM_CRENEL_DIG_CAVE_0, TILE_POS(3, 25) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesVeilFalls[] = {
|
||||
{ TILE_POS(26, 37), ROOM_VEIL_FALLS_MAIN, 0x8, AREA_VEIL_FALLS_DIG_CAVE, ROOM_VEIL_FALLS_DIG_CAVE_0,
|
||||
TILE_POS(26, 37) },
|
||||
{ TILE_POS(14, 39), ROOM_VEIL_FALLS_MAIN, 0x8, AREA_VEIL_FALLS_DIG_CAVE, ROOM_VEIL_FALLS_DIG_CAVE_0,
|
||||
TILE_POS(14, 39) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesCastorWilds[] = {
|
||||
{ TILE_POS(48, 25), ROOM_CASTOR_WILDS_MAIN, 0xc, AREA_CASTOR_WILDS_DIG_CAVE, ROOM_CASTOR_WILDS_DIG_CAVE_0,
|
||||
TILE_POS(48, 25) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesLakeHylia[] = {
|
||||
{ TILE_POS(30, 5), ROOM_LAKE_HYLIA_MAIN, 0xe, AREA_HYLIA_DIG_CAVES, ROOM_HYLIA_DIG_CAVES_1, TILE_POS(46, 17) },
|
||||
{ TILE_POS(30, 30), ROOM_LAKE_HYLIA_MAIN, 0x12, AREA_HYLIA_DIG_CAVES, ROOM_HYLIA_DIG_CAVES_0, TILE_POS(8, 9) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesLakeWoodsCave[] = {
|
||||
{ TILE_POS(37, 51), ROOM_LAKE_WOODS_CAVE_MAIN, 0x1, AREA_MINISH_WOODS, ROOM_MINISH_WOODS_MAIN, TILE_POS(37, 19) },
|
||||
{ TILE_POS(31, 47), ROOM_LAKE_WOODS_CAVE_MAIN, 0x1, AREA_MINISH_WOODS, ROOM_MINISH_WOODS_MAIN, TILE_POS(31, 15) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyruleDigCaves[] = {
|
||||
{ TILE_POS(45, 40), ROOM_HYRULE_DIG_CAVES_TOWN, 0x3, AREA_HYRULE_TOWN, ROOM_HYRULE_TOWN_MAIN, TILE_POS(45, 24) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesAreaDigCaves[] = {
|
||||
{ TILE_POS(3, 11), ROOM_DIG_CAVES_EASTERN_HILLS, 0x5, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_EASTERN_HILLLS_NORTH,
|
||||
TILE_POS(3, 11) },
|
||||
{ TILE_POS(5, 14), ROOM_DIG_CAVES_TRILBY_HIGHLANDS, 0xb, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS,
|
||||
TILE_POS(5, 14) },
|
||||
{ TILE_POS(16, 14), ROOM_DIG_CAVES_TRILBY_HIGHLANDS, 0xb, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_TRILBY_HIGHLANDS,
|
||||
TILE_POS(16, 14) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesCrenelDigCave[] = {
|
||||
{ TILE_POS(3, 25), ROOM_CRENEL_DIG_CAVE_0, 0x7, AREA_MT_CRENEL, ROOM_MT_CRENEL_WALL_CLIMB, TILE_POS(3, 5) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesVeilFallsDigCave[] = {
|
||||
{ TILE_POS(26, 37), ROOM_VEIL_FALLS_DIG_CAVE_0, 0x9, AREA_VEIL_FALLS, ROOM_VEIL_FALLS_MAIN, TILE_POS(26, 37) },
|
||||
{ TILE_POS(14, 39), ROOM_VEIL_FALLS_DIG_CAVE_0, 0x9, AREA_VEIL_FALLS, ROOM_VEIL_FALLS_MAIN, TILE_POS(14, 39) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesCastorWildsDigCave[] = {
|
||||
{ TILE_POS(48, 25), ROOM_CASTOR_WILDS_DIG_CAVE_0, 0xd, AREA_CASTOR_WILDS, ROOM_CASTOR_WILDS_MAIN,
|
||||
TILE_POS(48, 25) },
|
||||
END_OF_LIST
|
||||
};
|
||||
static const DiggingCaveEntrance diggingCaveEntrancesHyliaDigCaves[] = {
|
||||
{ TILE_POS(46, 17), ROOM_HYLIA_DIG_CAVES_1, 0xf, AREA_LAKE_HYLIA, ROOM_LAKE_HYLIA_MAIN, TILE_POS(30, 5) },
|
||||
{ TILE_POS(8, 17), ROOM_HYLIA_DIG_CAVES_1, 0x11, AREA_HYRULE_FIELD, ROOM_HYRULE_FIELD_LON_LON_RANCH,
|
||||
TILE_POS(35, 5) },
|
||||
{ TILE_POS(8, 9), ROOM_HYLIA_DIG_CAVES_0, 0x13, AREA_LAKE_HYLIA, ROOM_LAKE_HYLIA_MAIN, TILE_POS(30, 30) },
|
||||
END_OF_LIST
|
||||
};
|
||||
|
||||
/** Holds the lists of DiggingCaveEntrances indexed by area id. */
|
||||
static const DiggingCaveEntrance* const diggingCaveEntrances[] = {
|
||||
diggingCaveEntrancesMinishWoods,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesHyruleTown,
|
||||
diggingCaveEntrancesHyruleField,
|
||||
diggingCaveEntrancesCastorWilds,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesMtCrenel,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesVeilFalls,
|
||||
diggingCaveEntrancesLakeHylia,
|
||||
diggingCaveEntrancesLakeWoodsCave,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesHyruleDigCaves,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesAreaDigCaves,
|
||||
diggingCaveEntrancesCrenelDigCave,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesVeilFallsDigCave,
|
||||
diggingCaveEntrancesCastorWildsDigCave,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesHyliaDigCaves,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
diggingCaveEntrancesEmpty,
|
||||
};
|
||||
@@ -0,0 +1,137 @@
|
||||
/**
|
||||
* @file enemyInteractionManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Interaction between enemies. Makes them not overlap.
|
||||
*/
|
||||
#include "manager/enemyInteractionManager.h"
|
||||
#include "asm.h"
|
||||
#include "room.h"
|
||||
|
||||
void EnemyInteractionManager_Init(EnemyInteractionManager*);
|
||||
void EnemyInteractionManager_Action1(EnemyInteractionManager*);
|
||||
u32 EnemyInteractionManager_FindMatchingEntities(EnemyInteractionManager*);
|
||||
Entity* EnemyInteractionManager_FindMatchingEntity(EntityData*);
|
||||
void EnemyInteractionManager_RemoveDeletedEntities(EnemyInteractionManager*);
|
||||
|
||||
enum EnemyInteractionManager_Action { Init = 0, Main = 1 };
|
||||
|
||||
enum EnemyInteractionManager_InitState { DoInit = 0, DoNotInit = 1 };
|
||||
|
||||
void EnemyInteractionManager_Main(EnemyInteractionManager* this) {
|
||||
static void (*const EnemyInteractionManager_Actions[])(EnemyInteractionManager*) = {
|
||||
EnemyInteractionManager_Init,
|
||||
EnemyInteractionManager_Action1,
|
||||
};
|
||||
EnemyInteractionManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void EnemyInteractionManager_Init(EnemyInteractionManager* this) {
|
||||
if (super->type == DoInit) {
|
||||
s32 entityCount;
|
||||
int tmp4;
|
||||
for (tmp4 = 0; tmp4 < 8; tmp4++) {
|
||||
this->d.enemies[tmp4] = 0;
|
||||
}
|
||||
entityCount = EnemyInteractionManager_FindMatchingEntities(this);
|
||||
if (entityCount > 1) {
|
||||
EnemyInteractionManager* tmp3 = (EnemyInteractionManager*)GetEmptyManager();
|
||||
if (tmp3) {
|
||||
tmp3->base.kind = MANAGER;
|
||||
tmp3->base.id = ENEMY_INTERACTION_MANAGER;
|
||||
tmp3->base.type = DoNotInit;
|
||||
tmp3->base.timer = entityCount;
|
||||
/* for (tmp4 = 0; tmp4 < 8; tmp4++) { */
|
||||
/* tmp3->enemies[tmp4] = this->enemies[tmp4]; */
|
||||
/* } */
|
||||
tmp3->d = this->d;
|
||||
AppendEntityToList((Entity*)tmp3, 6);
|
||||
}
|
||||
}
|
||||
DeleteManager(super);
|
||||
} else {
|
||||
super->action = Main;
|
||||
super->subtimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void EnemyInteractionManager_Action1(EnemyInteractionManager* this) {
|
||||
s32 n;
|
||||
s32 i;
|
||||
s32 j;
|
||||
Entity* tmp;
|
||||
EnemyInteractionManager_RemoveDeletedEntities(this);
|
||||
n = super->timer - 1;
|
||||
if ((super->subtimer++) & 1) {
|
||||
for (i = 0; i < n; i++) {
|
||||
tmp = this->d.enemies[i];
|
||||
for (j = i + 1; j < super->timer; j++) {
|
||||
sub_08004484(tmp, this->d.enemies[j]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < n; i++) {
|
||||
tmp = this->d.enemies[i];
|
||||
for (j = i + 1; j < super->timer; j++) {
|
||||
sub_08004484(this->d.enemies[j], tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u32 EnemyInteractionManager_FindMatchingEntities(EnemyInteractionManager* this) {
|
||||
u32 re = 0;
|
||||
EntityData* tmp = GetCurrentRoomProperty(super->type2);
|
||||
if (!tmp)
|
||||
return 0;
|
||||
for (; *((u8*)tmp) != 0xFF && !((tmp->kind & 0xf) == 9 && tmp->id == 0x28); tmp++) {
|
||||
Entity* tmp2;
|
||||
u32 i;
|
||||
if ((tmp->kind & 0xf) != 3)
|
||||
continue;
|
||||
tmp2 = EnemyInteractionManager_FindMatchingEntity(tmp);
|
||||
if (!tmp2)
|
||||
continue;
|
||||
for (i = 0; i < re; i++) {
|
||||
if (this->d.enemies[i] == tmp2)
|
||||
break;
|
||||
}
|
||||
if (i != re)
|
||||
continue;
|
||||
this->d.enemies[re++] = tmp2;
|
||||
if (re == 8)
|
||||
return 8;
|
||||
}
|
||||
return re;
|
||||
}
|
||||
|
||||
Entity* EnemyInteractionManager_FindMatchingEntity(EntityData* unk1) {
|
||||
u32 x, y;
|
||||
Entity* i;
|
||||
LinkedList* tmp;
|
||||
x = unk1->xPos + gRoomControls.origin_x;
|
||||
y = unk1->yPos + gRoomControls.origin_y;
|
||||
tmp = &gEntityLists[4];
|
||||
for (i = tmp->first; (u32)i != (u32)tmp; i = i->next) {
|
||||
if (x == i->x.HALF.HI && y == i->y.HALF.HI && unk1->id == i->id && ENEMY == i->kind && unk1->type == i->type) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EnemyInteractionManager_RemoveDeletedEntities(EnemyInteractionManager* this) {
|
||||
s32 i;
|
||||
for (i = 0; i < super->timer; i++) {
|
||||
if (this->d.enemies[i]->next == 0) {
|
||||
if (super->timer - 1 == i) {
|
||||
this->d.enemies[i] = 0;
|
||||
} else {
|
||||
this->d.enemies[i] = this->d.enemies[super->timer - 1];
|
||||
}
|
||||
super->timer--;
|
||||
}
|
||||
}
|
||||
if (super->timer <= 1)
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -1,72 +1,65 @@
|
||||
#include "global.h"
|
||||
#include "manager.h"
|
||||
#include "screen.h"
|
||||
/**
|
||||
* @file enterRoomTextboxManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Shows textbox when entering the room.
|
||||
*/
|
||||
#include "manager/enterRoomTextboxManager.h"
|
||||
#include "area.h"
|
||||
#include "message.h"
|
||||
#include "common.h"
|
||||
#include "game.h"
|
||||
#include "functions.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 unk_20; // unused
|
||||
u8 unk_21[0x13]; // unused
|
||||
u16 unk_34; // unused
|
||||
u16 unk_36; // unused
|
||||
s16 unk_38; // unused
|
||||
s16 unk_3A; // unused
|
||||
u16 unk_3C; // unused
|
||||
u16 unk_3E; // unused
|
||||
} Manager39;
|
||||
#include "game.h"
|
||||
#include "message.h"
|
||||
#include "screen.h"
|
||||
|
||||
extern u8 gUnk_02034DF0[0x2F2];
|
||||
|
||||
extern const u16 gUnk_08108DE8[];
|
||||
extern void (*const gUnk_08108E28[])(Manager39*);
|
||||
extern void (*const EnterRoomTextboxManager_Actions[])(EnterRoomTextboxManager*);
|
||||
extern const u8 gUnk_08108E30[0x18];
|
||||
extern const u8 gUnk_08108E48[0x18];
|
||||
extern const u8 gUnk_08108E60[];
|
||||
|
||||
extern void sub_0805F46C(void*, const void*);
|
||||
|
||||
void sub_0805E140(Manager39*);
|
||||
void sub_0805E18C(Manager39*); // unused?
|
||||
void sub_0805E1D8(Manager39*);
|
||||
void sub_0805E140(EnterRoomTextboxManager*);
|
||||
void sub_0805E18C(EnterRoomTextboxManager*); // unused?
|
||||
void sub_0805E1D8(EnterRoomTextboxManager*);
|
||||
void sub_0805E1F8(u32, u32);
|
||||
|
||||
void Manager39_Main(Manager39* this) {
|
||||
gUnk_08108E28[this->manager.action](this);
|
||||
void EnterRoomTextboxManager_Main(EnterRoomTextboxManager* this) {
|
||||
EnterRoomTextboxManager_Actions[super->action](this);
|
||||
if ((gRoomControls.room != this->unk_20) || (gMessage.doTextBox & 0x7F)) {
|
||||
sub_0805E1D8(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805E140(Manager39* this) {
|
||||
this->manager.unk_10 |= 0x20;
|
||||
this->manager.action = 1;
|
||||
void sub_0805E140(EnterRoomTextboxManager* this) {
|
||||
super->flags |= ENT_PERSIST;
|
||||
super->action = 1;
|
||||
this->unk_20 = gRoomControls.room;
|
||||
this->manager.unk_0e = 0x78;
|
||||
this->manager.unk_0f = 0x3c;
|
||||
super->timer = 0x78;
|
||||
super->subtimer = 0x3c;
|
||||
SetDefaultPriority((Entity*)this, PRIO_HIGHEST);
|
||||
sub_0805E1F8(gUnk_08108DE8[gArea.locationIndex], AreaIsDungeon());
|
||||
}
|
||||
|
||||
void sub_0805E18C(Manager39* this) {
|
||||
void sub_0805E18C(EnterRoomTextboxManager* this) {
|
||||
if (gFadeControl.active)
|
||||
return;
|
||||
if (this->manager.unk_0b) {
|
||||
if (!--this->manager.unk_0f) {
|
||||
this->manager.unk_0b = 0;
|
||||
if (super->type2) {
|
||||
if (--super->subtimer == 0) {
|
||||
super->type2 = 0;
|
||||
gPlayerState.controlMode = CONTROL_1;
|
||||
ResetSystemPriority();
|
||||
}
|
||||
}
|
||||
if (!--this->manager.unk_0e) {
|
||||
if (--super->timer == 0) {
|
||||
sub_0805E1D8(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805E1D8(Manager39* this) {
|
||||
void sub_0805E1D8(EnterRoomTextboxManager* this) {
|
||||
MemClear(&gUnk_02034DF0, 0x80);
|
||||
gScreen.bg0.updated = 1;
|
||||
DeleteThisEntity();
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* @file entitySpawnManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Load a entity list when a flag is set.
|
||||
*
|
||||
* e.g. spawns the heart container and teleporter after getting the element in DWS
|
||||
*/
|
||||
#include "manager/entitySpawnManager.h"
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
|
||||
void EntitySpawnManager_Main(EntitySpawnManager* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
if (CheckFlags(this->flag)) {
|
||||
DeleteManager(super);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!CheckFlags(this->flag))
|
||||
return;
|
||||
if (super->type2 != 0) {
|
||||
super->type2 = 0;
|
||||
SetPlayerControl(0xff);
|
||||
sub_08078B48();
|
||||
}
|
||||
if (this->spawnTimer == 0) {
|
||||
if (this->sound != 0) {
|
||||
SoundReq(this->sound);
|
||||
}
|
||||
LoadRoomEntityList(GetCurrentRoomProperty(super->type));
|
||||
DeleteThisEntity();
|
||||
} else {
|
||||
this->spawnTimer--;
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,33 @@
|
||||
#include "global.h"
|
||||
/**
|
||||
* @file ezloHintManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Shows Ezlo hints
|
||||
*/
|
||||
#include "manager/ezloHintManager.h"
|
||||
#include "area.h"
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "player.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "area.h"
|
||||
#include "functions.h"
|
||||
|
||||
static void sub_08058398(ManagerA*);
|
||||
static void sub_080583EC(ManagerA*);
|
||||
static void sub_08058408(ManagerA*);
|
||||
static void sub_08058514(ManagerA*);
|
||||
static void sub_080585B0(ManagerA*);
|
||||
static void EzloHintManager_Init(EzloHintManager*);
|
||||
static void EzloHintManager_Action1(EzloHintManager*);
|
||||
static void EzloHintManager_Action2(EzloHintManager*);
|
||||
static void EzloHintManager_Action3(EzloHintManager*);
|
||||
static void EzloHintManager_Action4(EzloHintManager*);
|
||||
static u32 PlayerStateValid(EzloHintManager*);
|
||||
static void sub_080585DC(EzloHintManager*);
|
||||
|
||||
static u32 PlayerStateValid(ManagerA*);
|
||||
static void sub_080585DC(ManagerA*);
|
||||
|
||||
/**
|
||||
* Ezlo hint manager
|
||||
*/
|
||||
void ManagerA_Main(ManagerA* this) {
|
||||
static void (*const sActions[])(ManagerA*) = { sub_08058398, sub_080583EC, sub_08058408, sub_08058514,
|
||||
sub_080585B0 };
|
||||
|
||||
sActions[this->manager.action](this);
|
||||
void EzloHintManager_Main(EzloHintManager* this) {
|
||||
static void (*const EzloHintManager_Actions[])(EzloHintManager*) = {
|
||||
EzloHintManager_Init, EzloHintManager_Action1, EzloHintManager_Action2,
|
||||
EzloHintManager_Action3, EzloHintManager_Action4,
|
||||
};
|
||||
EzloHintManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
static void sub_08058398(ManagerA* this) {
|
||||
static void EzloHintManager_Init(EzloHintManager* this) {
|
||||
if (CheckFlags(this->flag1) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -34,33 +35,34 @@ static void sub_08058398(ManagerA* this) {
|
||||
this->ry = this->ry_raw << 3;
|
||||
this->x = this->rx + (this->x_raw << 4);
|
||||
this->y = this->ry + (this->y_raw << 4);
|
||||
SetDefaultPriority((Entity*)&this->manager, PRIO_PLAYER_EVENT);
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
if (this->flag2 == 0) {
|
||||
this->manager.action = 2;
|
||||
super->action = 2;
|
||||
} else {
|
||||
this->manager.action = 1;
|
||||
super->action = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_080583EC(ManagerA* this) {
|
||||
static void EzloHintManager_Action1(EzloHintManager* this) {
|
||||
if (CheckFlags(this->flag2)) {
|
||||
this->manager.action = 2;
|
||||
sub_08058408(this);
|
||||
super->action = 2;
|
||||
EzloHintManager_Action2(this);
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_08058408(ManagerA* this) {
|
||||
static void EzloHintManager_Action2(EzloHintManager* this) {
|
||||
if (gPlayerState.flags & PL_NO_CAP)
|
||||
return;
|
||||
if (!CheckPlayerInRegion(this->x, this->y, this->rx, this->ry))
|
||||
return;
|
||||
switch (this->manager.unk_0a) {
|
||||
switch (super->type) {
|
||||
case 1:
|
||||
return;
|
||||
case 2:
|
||||
sub_080585DC(this);
|
||||
if ((gPlayerState.flags & PL_MINISH) == 0)
|
||||
return;
|
||||
// fallthrough
|
||||
case 0:
|
||||
default:
|
||||
sub_080585DC(this);
|
||||
@@ -69,19 +71,19 @@ static void sub_08058408(ManagerA* this) {
|
||||
SetPlayerControl(3);
|
||||
sub_08078B48();
|
||||
SetPlayerEventPriority();
|
||||
this->manager.action = 3;
|
||||
this->manager.unk_0d = 0;
|
||||
this->manager.unk_0e = 30;
|
||||
super->action = 3;
|
||||
super->subAction = 0;
|
||||
super->timer = 30;
|
||||
return;
|
||||
case 3:
|
||||
this->manager.action = 4;
|
||||
this->manager.unk_0d = 0;
|
||||
super->action = 4;
|
||||
super->subAction = 0;
|
||||
sub_080186C0(this->msg_idx);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static u32 PlayerStateValid(ManagerA* this) {
|
||||
static u32 PlayerStateValid(EzloHintManager* this) {
|
||||
switch (gPlayerState.framestate) {
|
||||
case PL_STATE_THROW:
|
||||
case PL_STATE_SWIM:
|
||||
@@ -113,8 +115,8 @@ static u32 PlayerStateValid(ManagerA* this) {
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_08058514(ManagerA* this) {
|
||||
switch (this->manager.unk_0d) {
|
||||
static void EzloHintManager_Action3(EzloHintManager* this) {
|
||||
switch (super->subAction) {
|
||||
case 1:
|
||||
if (gPlayerState.flags &
|
||||
(PL_BUSY | PL_DROWNING | PL_USE_PORTAL | PL_FALLING | PL_IN_MINECART | PL_CAPTURED))
|
||||
@@ -123,13 +125,13 @@ static void sub_08058514(ManagerA* this) {
|
||||
return;
|
||||
gPlayerState.jump_status = 0;
|
||||
CreateEzloHint(this->msg_idx, this->msg_height);
|
||||
this->manager.unk_0d++;
|
||||
this->manager.unk_0e = 30;
|
||||
super->subAction++;
|
||||
super->timer = 30;
|
||||
return;
|
||||
case 0:
|
||||
case 2:
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
this->manager.unk_0d++;
|
||||
if (--super->timer == 0) {
|
||||
super->subAction++;
|
||||
}
|
||||
return;
|
||||
case 3:
|
||||
@@ -146,7 +148,7 @@ static void sub_08058514(ManagerA* this) {
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_080585B0(ManagerA* this) {
|
||||
static void EzloHintManager_Action4(EzloHintManager* this) {
|
||||
if (gArea.unk28.inventoryGfxIdx != 0xFF) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -155,7 +157,8 @@ static void sub_080585B0(ManagerA* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
static void sub_080585DC(ManagerA* this) {
|
||||
|
||||
static void sub_080585DC(EzloHintManager* this) {
|
||||
if (CheckFlags(this->flag1)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* @file fallingItemManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Item that is falling from the sky.
|
||||
*
|
||||
* If you leave the room without picking the item up and enter again, the item falls from the sky again.
|
||||
*/
|
||||
#include "manager/fallingItemManager.h"
|
||||
#include "flags.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
|
||||
void FallingItemManager_Init(FallingItemManager*);
|
||||
void FallingItemManager_Action1(FallingItemManager*);
|
||||
|
||||
void FallingItemManager_Main(FallingItemManager* this) {
|
||||
static void (*const FallingItemManager_Actions[])(FallingItemManager*) = {
|
||||
FallingItemManager_Init,
|
||||
FallingItemManager_Action1,
|
||||
};
|
||||
FallingItemManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void FallingItemManager_Init(FallingItemManager* this) {
|
||||
super->action = 1;
|
||||
if (CheckFlags(this->field_0x3c)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
FallingItemManager_Action1(this);
|
||||
}
|
||||
|
||||
void FallingItemManager_Action1(FallingItemManager* this) {
|
||||
if (CheckFlags(this->field_0x3e)) {
|
||||
Entity* object = CreateObject(GROUND_ITEM, super->type, super->type2);
|
||||
if (object != NULL) {
|
||||
object->timer = this->field_0x35;
|
||||
object->collisionLayer = this->field_0x36;
|
||||
object->x.HALF.HI = this->field_0x38 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = this->field_0x3a + gRoomControls.origin_y;
|
||||
object->field_0x86.HWORD = this->field_0x3c;
|
||||
}
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,58 @@
|
||||
#include "global.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
#include "area.h"
|
||||
#include "common.h"
|
||||
#include "sound.h"
|
||||
|
||||
/*
|
||||
* Manager B is used to create fights:
|
||||
/**
|
||||
* @file fightManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Manages fights with multiple enemies
|
||||
*
|
||||
* It possibly waits for an inhibitor flag to be set, then spawns a bunch of entities (based on room data).
|
||||
* Once all enemies created this way are dead, it sets a flag.
|
||||
* (There is also a part about changing the music and setting it back when the fight is done, which is song 0x33 (a
|
||||
* fight theme) by default but can be overridden through room data)
|
||||
*/
|
||||
#include "manager/fightManager.h"
|
||||
#include "area.h"
|
||||
#include "common.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
|
||||
void (*const ManagerB_ActionFuncs[])(Manager*);
|
||||
enum FightManager_State { Init, WaitForFlag, WaitForDone };
|
||||
|
||||
void ManagerB_Main(Manager* this) {
|
||||
void FightManager_LoadFight(FightManager*);
|
||||
FightManagerHelper* FightManager_CreateHelper(FightManager*);
|
||||
void FightManagerHelper_Monitor(FightManagerHelper*, Entity*, u32);
|
||||
void FightManager_Init(FightManager*);
|
||||
void FightManager_WaitForFlag(FightManager*);
|
||||
void FightManager_WaitForDone(FightManager*);
|
||||
void FightManager_Main2(FightManager*);
|
||||
void FightManagerHelper_Main(FightManagerHelper*);
|
||||
|
||||
void FightManager_Main(Manager* this) {
|
||||
static void (*const FightManager_ActionFuncs[])(Manager*) = {
|
||||
(void (*)(Manager*))FightManager_Main2,
|
||||
(void (*)(Manager*))FightManagerHelper_Main,
|
||||
};
|
||||
// make a distincion if this is a controller (volumeMasterTarget = 0) or a helper (volumeMasterTarget = 1)
|
||||
ManagerB_ActionFuncs[this->unk_0a](this);
|
||||
FightManager_ActionFuncs[this->type](this);
|
||||
}
|
||||
|
||||
enum ManagerB_State { Init, WaitForFlag, WaitForDone };
|
||||
|
||||
void (*const ManagerB_StateFuncs[])(ManagerB*);
|
||||
|
||||
void ManagerB_Main2(ManagerB* this) {
|
||||
void FightManager_Main2(FightManager* this) {
|
||||
// make a distinction based on the state of this controller
|
||||
ManagerB_StateFuncs[this->manager.action](this);
|
||||
static void (*const FightManager_Actions[])(FightManager*) = {
|
||||
FightManager_Init,
|
||||
FightManager_WaitForFlag,
|
||||
FightManager_WaitForDone,
|
||||
};
|
||||
FightManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void ManagerB_LoadFight(Manager*);
|
||||
|
||||
void ManagerB_Init(ManagerB* this) {
|
||||
void FightManager_Init(FightManager* this) {
|
||||
// check if the fight was already completed previously (checks the flag that gets set after the fight is done)
|
||||
if (!CheckFlags(this->unk_3e)) {
|
||||
this->manager.action = WaitForFlag;
|
||||
if (!CheckFlags(this->fightCompletedFlag)) {
|
||||
super->action = WaitForFlag;
|
||||
// if there is no flag that needs to be set before the fight is started, start it immediately
|
||||
if (!this->unk_3c) {
|
||||
ManagerB_LoadFight(&this->manager);
|
||||
if (!this->fightStartFlag) {
|
||||
FightManager_LoadFight(this);
|
||||
}
|
||||
SetDefaultPriority((Entity*)this, PRIO_NO_BLOCK);
|
||||
} else {
|
||||
@@ -46,10 +60,10 @@ void ManagerB_Init(ManagerB* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void ManagerB_WaitForFlag(ManagerB* this) {
|
||||
void FightManager_WaitForFlag(FightManager* this) {
|
||||
int tmp;
|
||||
if (CheckFlags(this->unk_3c)) {
|
||||
ManagerB_LoadFight(&this->manager);
|
||||
if (CheckFlags(this->fightStartFlag)) {
|
||||
FightManager_LoadFight(this);
|
||||
if (!this->unk_35) {
|
||||
tmp = gRoomVars.field_0x9 ? gRoomVars.field_0x9 : 0x33;
|
||||
this->unk_20 = gArea.bgm;
|
||||
@@ -60,15 +74,15 @@ void ManagerB_WaitForFlag(ManagerB* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void ManagerB_WaitForDone(ManagerB* this) {
|
||||
void FightManager_WaitForDone(FightManager* this) {
|
||||
// check if all helpers are done
|
||||
if (this->manager.unk_0e) {
|
||||
if (super->timer) {
|
||||
return;
|
||||
}
|
||||
// set the completion flag for the fight
|
||||
SetFlag(this->unk_3e);
|
||||
SetFlag(this->fightCompletedFlag);
|
||||
// restore music (if it was set, which apparently is only possible if there's a flag the fight waited for)
|
||||
if (this->unk_3c) {
|
||||
if (this->fightStartFlag) {
|
||||
if (!this->unk_35) {
|
||||
gArea.bgm = this->unk_20;
|
||||
SoundReq(gArea.bgm);
|
||||
@@ -78,35 +92,32 @@ void ManagerB_WaitForDone(ManagerB* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
ManagerBHelper* CreateHelper(Manager*);
|
||||
void ManagerBHelper_Monitor(ManagerBHelper*, Entity*, u32);
|
||||
|
||||
void ManagerB_LoadFight(Manager* this) {
|
||||
ManagerBHelper* monitor;
|
||||
void FightManager_LoadFight(FightManager* this) {
|
||||
FightManagerHelper* monitor;
|
||||
EntityData* prop;
|
||||
Entity* ent;
|
||||
u32 counter;
|
||||
|
||||
this->action = 2;
|
||||
this->unk_0e = 0;
|
||||
super->action = 2;
|
||||
super->timer = 0;
|
||||
counter = 0;
|
||||
// Create a helper to keep track of the created entities.
|
||||
monitor = CreateHelper(this);
|
||||
monitor = FightManager_CreateHelper(this);
|
||||
if (monitor == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
prop = (EntityData*)GetCurrentRoomProperty(this->unk_0b);
|
||||
prop = (EntityData*)GetCurrentRoomProperty(super->type2);
|
||||
if (prop != NULL) {
|
||||
while (prop->kind != 0xFF) {
|
||||
ent = LoadRoomEntity(prop++);
|
||||
if ((ent != NULL) && (ent->kind == ENEMY)) {
|
||||
ent->field_0x6c.HALF.HI |= 0x40;
|
||||
ManagerBHelper_Monitor(monitor, ent, counter++);
|
||||
FightManagerHelper_Monitor(monitor, ent, counter++);
|
||||
}
|
||||
if (counter >= 7) {
|
||||
counter = 0;
|
||||
monitor = CreateHelper(this);
|
||||
monitor = FightManager_CreateHelper(this);
|
||||
if (monitor == NULL)
|
||||
return;
|
||||
}
|
||||
@@ -114,48 +125,47 @@ void ManagerB_LoadFight(Manager* this) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Create a helper and increment the counter for the number of helpers (unk_0e).
|
||||
* The helper will decrease said counter when it deletes itself (when none of the enemies it monitors remain).
|
||||
*/
|
||||
ManagerBHelper* CreateHelper(Manager* this) {
|
||||
ManagerBHelper* extra;
|
||||
extra = (ManagerBHelper*)GetEmptyManager();
|
||||
FightManagerHelper* FightManager_CreateHelper(FightManager* this) {
|
||||
FightManagerHelper* extra;
|
||||
extra = (FightManagerHelper*)GetEmptyManager();
|
||||
if (extra) {
|
||||
extra->manager.type = 9;
|
||||
extra->manager.subtype = 0xB;
|
||||
extra->manager.unk_0a = 1;
|
||||
extra->manager.parent = this;
|
||||
this->unk_0e++;
|
||||
extra->base.kind = MANAGER;
|
||||
extra->base.id = FIGHT_MANAGER;
|
||||
extra->base.type = 1;
|
||||
extra->base.parent = (Entity*)this;
|
||||
super->timer++;
|
||||
MemClear(&extra->enemies, 0x20);
|
||||
AppendEntityToList((Entity*)extra, 8);
|
||||
}
|
||||
return extra;
|
||||
}
|
||||
|
||||
void ManagerBHelper_Monitor(ManagerBHelper* this, Entity* ent, u32 index) {
|
||||
void FightManagerHelper_Monitor(FightManagerHelper* this, Entity* ent, u32 index) {
|
||||
this->enemies[index] = ent;
|
||||
this->manager.unk_0e++;
|
||||
super->timer++;
|
||||
}
|
||||
|
||||
// case volumeMasterTarget is 1: The manager is a helper
|
||||
|
||||
void ManagerBHelper_Main(Manager* this) {
|
||||
void FightManagerHelper_Main(FightManagerHelper* this) {
|
||||
u8 i;
|
||||
bool32 anyRemaining;
|
||||
Entity* current;
|
||||
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
SetDefaultPriority((Entity*)this, PRIO_NO_BLOCK);
|
||||
}
|
||||
// go through and check all monitored enemies.
|
||||
anyRemaining = FALSE;
|
||||
for (i = 0; i < 8; i++) {
|
||||
current = ((ManagerBHelper*)this)->enemies[i];
|
||||
current = this->enemies[i];
|
||||
if (current != NULL) {
|
||||
if (current->next == NULL) {
|
||||
((ManagerBHelper*)this)->enemies[i] = 0;
|
||||
this->enemies[i] = 0;
|
||||
} else {
|
||||
anyRemaining = TRUE;
|
||||
}
|
||||
@@ -163,24 +173,24 @@ void ManagerBHelper_Main(Manager* this) {
|
||||
}
|
||||
if (!anyRemaining) {
|
||||
// inform the parent that we're done
|
||||
ManagerB* parent = (ManagerB*)this->parent;
|
||||
if (parent->manager.unk_0e != 0) {
|
||||
parent->manager.unk_0e--;
|
||||
FightManager* parent = (FightManager*)super->parent;
|
||||
if (parent->base.timer != 0) {
|
||||
parent->base.timer--;
|
||||
}
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Replace an entity that is currently being monitored with a new one
|
||||
*/
|
||||
void ReplaceMonitoredEntity(Entity* old, Entity* new) {
|
||||
ManagerBHelper* current;
|
||||
FightManagerHelper* current;
|
||||
Manager* end = (Manager*)&gEntityLists[8];
|
||||
u32 i;
|
||||
for (current = (ManagerBHelper*)end->next; (Manager*)current != end;
|
||||
current = (ManagerBHelper*)current->manager.next) {
|
||||
if (current->manager.type != 0x9 || current->manager.subtype != 0xB) {
|
||||
for (current = (FightManagerHelper*)end->next; (Manager*)current != end;
|
||||
current = (FightManagerHelper*)current->base.next) {
|
||||
if (current->base.kind != MANAGER || current->base.id != FIGHT_MANAGER) {
|
||||
continue;
|
||||
}
|
||||
for (i = 0; i < 8; i++) {
|
||||
@@ -191,7 +201,3 @@ void ReplaceMonitoredEntity(Entity* old, Entity* new) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void (*const ManagerB_ActionFuncs[])(Manager*) = { (void (*)(Manager*))ManagerB_Main2,
|
||||
(void (*)(Manager*))ManagerBHelper_Main };
|
||||
void (*const ManagerB_StateFuncs[])(ManagerB*) = { ManagerB_Init, ManagerB_WaitForFlag, ManagerB_WaitForDone };
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @file flagAndOperatorManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Sets a flag if all of the flags are set.
|
||||
*/
|
||||
#include "manager/flagAndOperatorManager.h"
|
||||
#include "flags.h"
|
||||
|
||||
void FlagAndOperatorManager_Main(FlagAndOperatorManager* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
if (CheckFlags(this->unk_3c)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
} else {
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
SetFlag(this->unk_3c);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,21 @@
|
||||
/**
|
||||
* @file flameManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Manages flame that can be ignited with the lamp.
|
||||
*
|
||||
* However, this manager is deleted when the flame is ignited the first time.
|
||||
*/
|
||||
#include "manager/flameManager.h"
|
||||
#include "asm.h"
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "functions.h"
|
||||
#include "room.h"
|
||||
|
||||
typedef struct {
|
||||
struct Manager manager;
|
||||
u8 field_0x20[0x18];
|
||||
s16 field_0x38;
|
||||
s16 field_0x3a;
|
||||
} Manager25;
|
||||
|
||||
void Manager25_Main(Manager25* this) {
|
||||
if (this->manager.action == 0) {
|
||||
void FlameManager_Main(FlameManager* this) {
|
||||
if (super->action == 0) {
|
||||
this->field_0x38 = TILE(this->field_0x38, this->field_0x3a);
|
||||
if (GetTileType(this->field_0x38, 2) == 0x75) {
|
||||
this->manager.action = 1;
|
||||
super->action = 1;
|
||||
SetTile(0x406a, this->field_0x38, 1);
|
||||
} else {
|
||||
DeleteThisEntity();
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @file floatingPlatformManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Spawns lists of floating platforms together.
|
||||
*/
|
||||
#include "manager/floatingPlatformManager.h"
|
||||
#include "entity.h"
|
||||
#include "room.h"
|
||||
|
||||
void FloatingPlatformManager_Init(FloatingPlatformManager*);
|
||||
void FloatingPlatformManager_Action1(FloatingPlatformManager*);
|
||||
|
||||
void FloatingPlatformManager_Main(FloatingPlatformManager* this) {
|
||||
static void (*const FloatingPlatformManager_Actions[])(FloatingPlatformManager*) = {
|
||||
FloatingPlatformManager_Init,
|
||||
FloatingPlatformManager_Action1,
|
||||
};
|
||||
FloatingPlatformManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void FloatingPlatformManager_Init(FloatingPlatformManager* this) {
|
||||
EntityData* entityData;
|
||||
Entity* entity;
|
||||
|
||||
super->action = 1;
|
||||
super->timer = 0;
|
||||
entityData = (EntityData*)GetCurrentRoomProperty(super->type);
|
||||
if (entityData == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
while (*(u8*)entityData != 0xff) {
|
||||
entity = LoadRoomEntity(entityData++);
|
||||
entity->parent = (Entity*)this;
|
||||
entity->timer = 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
void FloatingPlatformManager_Action1(FloatingPlatformManager* this) {
|
||||
super->timer = 0;
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
/**
|
||||
* @file goronMerchantShopManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Spawns the shop items for the kinstones for the goron merchant.
|
||||
*/
|
||||
#include "manager/goronMerchantShopManager.h"
|
||||
#include "asm.h"
|
||||
#include "flags.h"
|
||||
#include "object.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 itemActive[3];
|
||||
} Manager31;
|
||||
|
||||
typedef struct {
|
||||
u16 minType;
|
||||
u16 maxType;
|
||||
@@ -16,10 +16,7 @@ typedef struct {
|
||||
u16 y;
|
||||
} GoronShopSpawnData;
|
||||
|
||||
/*
|
||||
Spawns the shop items for the kinstones for the goron merchant.
|
||||
*/
|
||||
void Manager31_Main(Manager31* this) {
|
||||
void GoronMerchantShopManager_Main(GoronMerchantShopManager* this) {
|
||||
static const GoronShopSpawnData gUnk_08108D5C[3] = { { 0x6e, 0x3, 0x210, 0x210 },
|
||||
{ 0x71, 0x2, 0x220, 0x210 },
|
||||
{ 0x73, 0x3, 0x230, 0x210 } };
|
||||
@@ -27,8 +24,8 @@ void Manager31_Main(Manager31* this) {
|
||||
const GoronShopSpawnData* spawnData;
|
||||
s32 count;
|
||||
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action++;
|
||||
if (super->action == 0) {
|
||||
super->action++;
|
||||
if (CheckGlobalFlag(GORON_KAKERA_L) != 0 && CheckGlobalFlag(GORON_KAKERA_M) != 0 &&
|
||||
CheckGlobalFlag(GORON_KAKERA_R) != 0) {
|
||||
if (CheckGlobalFlag(GORON_KAKERA_LV2) == 0) {
|
||||
@@ -1,33 +1,23 @@
|
||||
#include "global.h"
|
||||
#include "manager.h"
|
||||
/**
|
||||
* @file holeManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Hole that you can fall into.
|
||||
*/
|
||||
#include "manager/holeManager.h"
|
||||
#include "common.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
#include "common.h"
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
s16 unk_20;
|
||||
s16 unk_22;
|
||||
u16 unk_24;
|
||||
u16 unk_26;
|
||||
u8 unk_28[8];
|
||||
u16 unk_30;
|
||||
u16 unk_32;
|
||||
u16 unk_34;
|
||||
u16 unk_36;
|
||||
u8 unk_38[7];
|
||||
u8 unk_3f;
|
||||
} Manager1A;
|
||||
|
||||
extern void (*const gUnk_08108668[])(Manager1A*);
|
||||
extern void (*const HoleManager_Actions[])(HoleManager*);
|
||||
|
||||
extern u8 gGlobalGfxAndPalettes[];
|
||||
|
||||
void Manager1A_Main(Manager1A* this) {
|
||||
gUnk_08108668[this->manager.action](this);
|
||||
void HoleManager_Main(HoleManager* this) {
|
||||
HoleManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
typedef struct struct_08108764 {
|
||||
@@ -59,19 +49,19 @@ typedef struct struct_08108764 {
|
||||
|
||||
extern struct_08108764 gUnk_08108764[];
|
||||
|
||||
u32 sub_0805B1CC(Manager1A*);
|
||||
void sub_0805B210(Manager1A*);
|
||||
void sub_0805B2B0(Manager1A*);
|
||||
void sub_0805B328(Manager1A*);
|
||||
u32 sub_0805B1CC(HoleManager*);
|
||||
void sub_0805B210(HoleManager*);
|
||||
void sub_0805B2B0(HoleManager*);
|
||||
void sub_0805B328(HoleManager*);
|
||||
|
||||
void sub_0805B048(Manager1A* this) {
|
||||
void sub_0805B048(HoleManager* this) {
|
||||
struct_08108764* tmp;
|
||||
Entity* obj;
|
||||
SetDefaultPriority((Entity*)&this->manager, PRIO_PLAYER_EVENT);
|
||||
SetDefaultPriority((Entity*)super, PRIO_PLAYER_EVENT);
|
||||
MemClear(&this->unk_20, 0x20);
|
||||
this->manager.action = 1;
|
||||
super->action = 1;
|
||||
this->unk_3f = gRoomControls.room;
|
||||
tmp = &gUnk_08108764[this->manager.unk_0a];
|
||||
tmp = &gUnk_08108764[super->type];
|
||||
if (!tmp->unk_0a) {
|
||||
this->unk_20 = gRoomControls.origin_x;
|
||||
this->unk_22 = gRoomControls.origin_y;
|
||||
@@ -83,9 +73,9 @@ void sub_0805B048(Manager1A* this) {
|
||||
this->unk_24 = (tmp->unk_0a << 4);
|
||||
this->unk_26 = (tmp->unk_0b << 4);
|
||||
}
|
||||
this->manager.unk_0b = tmp->unk_0c != 0;
|
||||
if (this->manager.unk_0b) {
|
||||
this->manager.unk_10 |= 0x20;
|
||||
super->type2 = tmp->unk_0c != 0;
|
||||
if (super->type2) {
|
||||
super->flags |= ENT_PERSIST;
|
||||
this->unk_34 = tmp->unk_0c->unk_04;
|
||||
this->unk_36 = tmp->unk_0c->unk_06;
|
||||
this->unk_30 = tmp->unk_0c->unk_08;
|
||||
@@ -102,7 +92,7 @@ void sub_0805B048(Manager1A* this) {
|
||||
obj->x.HALF.HI = tmp->unk_10->unk_04 + gRoomControls.origin_x;
|
||||
obj->y.HALF.HI = tmp->unk_10->unk_06 + gRoomControls.origin_y;
|
||||
}
|
||||
if (this->manager.unk_0a != 0xa || CheckLocalFlag(0x4B))
|
||||
if (super->type != 0xa || CheckLocalFlag(0x4B))
|
||||
return;
|
||||
obj = CreateObject(OBJECT_28, 3, 3);
|
||||
if (obj) {
|
||||
@@ -111,7 +101,7 @@ void sub_0805B048(Manager1A* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805B168(Manager1A* this) {
|
||||
void sub_0805B168(HoleManager* this) {
|
||||
if (sub_0805B1CC(this)) {
|
||||
sub_0805B210(this);
|
||||
DeleteThisEntity();
|
||||
@@ -119,21 +109,21 @@ void sub_0805B168(Manager1A* this) {
|
||||
}
|
||||
sub_0805B2B0(this);
|
||||
if (gRoomControls.reload_flags == 1) {
|
||||
this->manager.unk_0d = 1;
|
||||
super->subAction = 1;
|
||||
return;
|
||||
}
|
||||
if (!this->manager.unk_0d)
|
||||
if (super->subAction == 0)
|
||||
return;
|
||||
this->manager.unk_0d = 0;
|
||||
super->subAction = 0;
|
||||
if (this->unk_3f == gRoomControls.room)
|
||||
return;
|
||||
if (this->manager.unk_0b) {
|
||||
if (super->type2) {
|
||||
gScreen.lcd.displayControl &= ~0x800;
|
||||
}
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
u32 sub_0805B1CC(Manager1A* this) {
|
||||
u32 sub_0805B1CC(HoleManager* this) {
|
||||
u32 re = 0;
|
||||
if (CheckPlayerProximity(this->unk_20, this->unk_22, this->unk_24, this->unk_26)) {
|
||||
if ((gPlayerState.flags & PL_DROWNING) && (gPlayerState.flags & PL_BUSY)) {
|
||||
@@ -145,12 +135,12 @@ u32 sub_0805B1CC(Manager1A* this) {
|
||||
return re;
|
||||
}
|
||||
|
||||
void sub_0805B210(Manager1A* this) {
|
||||
void sub_0805B210(HoleManager* this) {
|
||||
struct_08108764* tmp;
|
||||
gRoomTransition.transitioningOut = 1;
|
||||
gRoomTransition.type = TRANSITION_CUT;
|
||||
gRoomTransition.player_status.start_anim = 4;
|
||||
tmp = &gUnk_08108764[this->manager.unk_0a];
|
||||
tmp = &gUnk_08108764[super->type];
|
||||
gRoomTransition.player_status.area_next = tmp->unk_01;
|
||||
gRoomTransition.player_status.room_next = tmp->unk_02;
|
||||
gRoomTransition.player_status.layer = tmp->unk_03;
|
||||
@@ -176,9 +166,9 @@ void sub_0805B210(Manager1A* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805B2B0(Manager1A* this) {
|
||||
void sub_0805B2B0(HoleManager* this) {
|
||||
s32 tmp, tmp2;
|
||||
if (!this->manager.unk_0b)
|
||||
if (!super->type2)
|
||||
return;
|
||||
tmp = (this->unk_30 - gRoomControls.scroll_x) / 4;
|
||||
tmp2 = (this->unk_32 - gRoomControls.scroll_y) / 4;
|
||||
@@ -201,11 +191,11 @@ void sub_0805B2B0(Manager1A* this) {
|
||||
gScreen.bg3.yOffset = gRoomControls.scroll_y + this->unk_36 + tmp2;
|
||||
}
|
||||
|
||||
void sub_0805B328(Manager1A* this) {
|
||||
void sub_0805B328(HoleManager* this) {
|
||||
struct_08108764* tmp;
|
||||
if (!this->manager.unk_0b)
|
||||
if (!super->type2)
|
||||
return;
|
||||
tmp = &gUnk_08108764[this->manager.unk_0a];
|
||||
tmp = &gUnk_08108764[super->type];
|
||||
LoadResourceAsync(&gGlobalGfxAndPalettes[tmp->unk_0c->unk_00], 0x0600F000, 0x800);
|
||||
gScreen.bg3.control = 0x1E07;
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||
@@ -214,12 +204,12 @@ void sub_0805B328(Manager1A* this) {
|
||||
gScreen.controls.layerFXControl &= ~0x8;
|
||||
}
|
||||
|
||||
void sub_0805B390(u32 unk1) {
|
||||
void CreateHoleManager(u32 type) {
|
||||
Manager* tmp = GetEmptyManager();
|
||||
if (!tmp)
|
||||
return;
|
||||
tmp->type = 0x9;
|
||||
tmp->subtype = 0x1A;
|
||||
tmp->unk_0a = unk1;
|
||||
tmp->kind = MANAGER;
|
||||
tmp->id = HOLE_MANAGER;
|
||||
tmp->type = type;
|
||||
AppendEntityToList((Entity*)tmp, 6);
|
||||
}
|
||||
@@ -1,46 +1,42 @@
|
||||
#include "manager.h"
|
||||
#include "screen.h"
|
||||
#include "functions.h"
|
||||
/**
|
||||
* @file horizontalMinishPathBackgroundManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Parallax scrolling for horizontal MinishPaths
|
||||
*/
|
||||
#include "manager/horizontalMinishPathBackgroundManager.h"
|
||||
#include "common.h"
|
||||
#include "functions.h"
|
||||
#include "screen.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 unk_20;
|
||||
u8 unk_21[0x17];
|
||||
u32 unk_38;
|
||||
u32 unk_3c;
|
||||
} Manager8;
|
||||
|
||||
void sub_08057F20(Manager8*);
|
||||
void sub_08057F20(HorizontalMinishPathBackgroundManager*);
|
||||
void sub_08057EFC(void*);
|
||||
void sub_08058034(void);
|
||||
void sub_08058084(u16*, u16*);
|
||||
void sub_08058004(u32, void*, void*);
|
||||
|
||||
extern u8 gUnk_02006F00[];
|
||||
extern u16 gMapDataTopSpecial[];
|
||||
|
||||
void Manager8_Main(Manager8* this) {
|
||||
void HorizontalMinishPathBackgroundManager_Main(HorizontalMinishPathBackgroundManager* this) {
|
||||
sub_08057F20(this);
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
gScreen.bg1.updated = 0;
|
||||
gScreen.bg3.updated = 0;
|
||||
RegisterTransitionManager(this, sub_08057EFC, 0);
|
||||
RegisterTransitionManager(this, sub_08057EFC, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08057EFC(void* this) {
|
||||
LoadGfxGroup((u32)gRoomVars.unk_10[0]);
|
||||
sub_08058034();
|
||||
((Manager8*)this)->unk_3c = 0;
|
||||
((Manager8*)this)->unk_38 = 0;
|
||||
sub_08057F20(((Manager8*)this));
|
||||
((HorizontalMinishPathBackgroundManager*)this)->unk_3c = 0;
|
||||
((HorizontalMinishPathBackgroundManager*)this)->unk_38 = 0;
|
||||
sub_08057F20(((HorizontalMinishPathBackgroundManager*)this));
|
||||
}
|
||||
|
||||
void sub_08058004(u32, void*, void*);
|
||||
|
||||
extern u8 gUnk_02006F00[];
|
||||
|
||||
void sub_08057F20(Manager8* this) {
|
||||
void sub_08057F20(HorizontalMinishPathBackgroundManager* this) {
|
||||
u32 tmp;
|
||||
tmp = gRoomControls.scroll_x - gRoomControls.origin_x;
|
||||
tmp = tmp + (tmp >> 3) + ((0x400 - gRoomControls.width) / 2);
|
||||
@@ -104,12 +100,12 @@ void sub_08058084(u16* unk1, u16* unk2) {
|
||||
|
||||
void sub_080580B0(u32 unk1) {
|
||||
s32 tmp;
|
||||
gMapTop.bgControlPtr = 0;
|
||||
gMapTop.bgSettings = 0;
|
||||
REG_DISPCNT = 0;
|
||||
LoadGfxGroup(unk1);
|
||||
gRoomVars.unk_10[0] = unk1;
|
||||
sub_08058034();
|
||||
tmp = gRoomControls.scroll_x - gRoomControls.origin_x; // r7
|
||||
tmp = gRoomControls.scroll_x - gRoomControls.origin_x;
|
||||
tmp = tmp + (tmp >> 3) + (0x400 - gRoomControls.width) / 2;
|
||||
sub_08058004(tmp, gUnk_02006F00, gBG3Buffer);
|
||||
gScreen.bg3.xOffset = tmp & 0xF;
|
||||
@@ -117,7 +113,7 @@ void sub_080580B0(u32 unk1) {
|
||||
gScreen.bg3.control = 0x1D09;
|
||||
gScreen.bg3.tilemap = gBG3Buffer;
|
||||
gScreen.bg3.updated = 1;
|
||||
tmp = gRoomControls.scroll_x - gRoomControls.origin_x; // r7
|
||||
tmp = gRoomControls.scroll_x - gRoomControls.origin_x;
|
||||
tmp = tmp + (tmp >> 2) + (0x400 - gRoomControls.width) / 2;
|
||||
sub_08058004(tmp, gUnk_02006F00 + 0x2000, gBG3Buffer + 0x400);
|
||||
gScreen.bg1.xOffset = tmp & 0xF;
|
||||
@@ -1,12 +1,16 @@
|
||||
/**
|
||||
* @file houseSignManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Keeps track in its bitfield of whether 0x10 x 0x10 rects at certain positions are on the screen.
|
||||
*
|
||||
* Spawns OBJECT_1C objects that check this and unsets the value in the bitfield.
|
||||
* Creates the signs on the houses in hyrule town.
|
||||
*/
|
||||
#include "manager/houseSignManager.h"
|
||||
#include "area.h"
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "object.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u32 bitfield;
|
||||
} Manager13;
|
||||
#include "room.h"
|
||||
|
||||
typedef struct {
|
||||
u16 x;
|
||||
@@ -19,11 +23,7 @@ typedef struct {
|
||||
|
||||
extern u32 CheckRectOnScreen(u16, u16, u32, u32);
|
||||
|
||||
/*
|
||||
Keeps track in its bitfield of whether 0x10 x 0x10 rects at certain positions are on the screen.
|
||||
Spawns OBJECT_1C objects that check this and unsets the value in the bitfield.
|
||||
*/
|
||||
void Manager13_Main(Manager13* this) {
|
||||
void HouseSignManager_Main(HouseSignManager* this) {
|
||||
static const SpawnData gUnk_081084C8[] = {
|
||||
{ 0x48, 0x90, 0x0, 0x0, 0x2, 0x0 }, { 0x138, 0x30, 0x1, 0x1, 0x2, 0x0 },
|
||||
{ 0x168, 0x90, 0x2, 0x2, 0x2, 0x0 }, { 0x2c8, 0x80, 0x3, 0x3, 0x2, 0x0 },
|
||||
@@ -44,8 +44,8 @@ void Manager13_Main(Manager13* this) {
|
||||
const SpawnData* spawnData;
|
||||
u32 type2;
|
||||
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
}
|
||||
if (gRoomControls.area == AREA_FESTIVAL_TOWN) {
|
||||
spawnData = gUnk_08108530;
|
||||
@@ -69,7 +69,7 @@ void Manager13_Main(Manager13* this) {
|
||||
this->bitfield |= bitfieldFlag;
|
||||
}
|
||||
}
|
||||
spawnData += 1;
|
||||
type2 += 1;
|
||||
spawnData++;
|
||||
type2++;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,29 @@
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "player.h"
|
||||
#include "sound.h"
|
||||
/**
|
||||
* @file hyruleTownBellManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Spawns the heart piece if the player jumps against the bell in Hyrule Town.
|
||||
*/
|
||||
#include "manager/hyruleTownBellManager.h"
|
||||
#include "object.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
|
||||
void Manager33_Main(Manager* this) {
|
||||
void HyruleTownBellManager_Main(HyruleTownBellManager* this) {
|
||||
RoomControls* roomControls = &gRoomControls;
|
||||
u32 a = roomControls->origin_x + 0x1f8;
|
||||
u32 x = (a - gPlayerEntity.x.HALF.HI) + 0x10;
|
||||
u32 b = roomControls->origin_y + 0x140;
|
||||
u32 y = (b - gPlayerEntity.y.HALF.HI) + 0x10;
|
||||
if (this->action == 0) {
|
||||
if (super->action == 0) {
|
||||
if (x < 0x20 && y < 0x20 && gPlayerEntity.z.HALF.HI < -0x18 && gPlayerState.framestate == PL_STATE_CAPE) {
|
||||
this->action += 1;
|
||||
this->unk_0e = 0x5a;
|
||||
super->action++;
|
||||
super->timer = 0x5a;
|
||||
SoundReq(SFX_10A);
|
||||
}
|
||||
} else {
|
||||
if (--this->unk_0e == 0) {
|
||||
if (--super->timer == 0) {
|
||||
Entity* object = CreateObject(OBJECT_96, 1, 0);
|
||||
if (object != NULL) {
|
||||
object->x.HALF.HI = roomControls->origin_x + 0x1f8;
|
||||
@@ -1,20 +1,19 @@
|
||||
/**
|
||||
* @file hyruleTownTilesetManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Swap tileset data in hyrule town depending on the position.
|
||||
*/
|
||||
#include "manager/hyruleTownTilesetManager.h"
|
||||
#include "area.h"
|
||||
#include "asm.h"
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "functions.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "main.h"
|
||||
#include "room.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 field_0x20;
|
||||
u8 field_0x21;
|
||||
u8 field_0x22;
|
||||
} Manager12;
|
||||
|
||||
void sub_08059A58(Manager12*);
|
||||
void sub_08059A2C(Manager12*);
|
||||
u32 CheckRegionsOnScreen(const u16* arr);
|
||||
void sub_08059A58(HyruleTownTilesetManager*);
|
||||
void sub_08059A2C(HyruleTownTilesetManager*);
|
||||
|
||||
static const u16 gUnk_08108398[] = { 0x0, 0x0, 0x0, 0x3f0, 0x200, 0x1, 0x0, 0x280, 0x3f0, 0x140, 0xff };
|
||||
static const u16 gUnk_081083AE[] = { 0x2, 0x0, 0x0, 0x180, 0x3c0, 0x3, 0x280, 0x0, 0x170, 0x3c0, 0xff };
|
||||
@@ -25,7 +24,7 @@ static const u16 gUnk_081083F2[] = { 0x5, 0x0, 0x1b0, 0x190, 0x140, 0x4, 0x0, 0x
|
||||
void sub_08059CC0(u32, u32);
|
||||
void sub_08059B18(void);
|
||||
|
||||
bool32 sub_08059C8C(Manager12*, u32, u8*, const u16*);
|
||||
bool32 sub_08059C8C(HyruleTownTilesetManager*, u32, u8*, const u16*);
|
||||
|
||||
extern u32 gUnk_086E8460;
|
||||
|
||||
@@ -60,9 +59,9 @@ static const Unknown gUnk_08108468[] = {
|
||||
};
|
||||
extern const u8 gGlobalGfxAndPalettes[];
|
||||
|
||||
void Manager12_Main(Manager12* this) {
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
void HyruleTownTilesetManager_Main(HyruleTownTilesetManager* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
this->field_0x22 = 0xff;
|
||||
this->field_0x21 = 0xff;
|
||||
this->field_0x20 = 0xff;
|
||||
@@ -72,7 +71,7 @@ void Manager12_Main(Manager12* this) {
|
||||
sub_08059A58(this);
|
||||
}
|
||||
|
||||
void sub_08059A2C(Manager12* this) {
|
||||
void sub_08059A2C(HyruleTownTilesetManager* this) {
|
||||
gRoomVars.unk_10[2] = 0xff;
|
||||
gRoomVars.unk_10[1] = 0xff;
|
||||
gRoomVars.unk_10[0] = 0xff;
|
||||
@@ -82,7 +81,7 @@ void sub_08059A2C(Manager12* this) {
|
||||
sub_08059A58(this);
|
||||
}
|
||||
|
||||
void sub_08059A58(Manager12* this) {
|
||||
void sub_08059A58(HyruleTownTilesetManager* this) {
|
||||
if (gRoomControls.area != AREA_FESTIVAL_TOWN) {
|
||||
if (sub_08059C8C(this, 0, &this->field_0x20, gUnk_08108398) != 0) {
|
||||
sub_08059CC0(0, (u32)this->field_0x20);
|
||||
@@ -144,7 +143,7 @@ void sub_08059B18(void) {
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_08059C8C(Manager12* this, u32 param_2, u8* param_3, const u16* param_4) {
|
||||
bool32 sub_08059C8C(HyruleTownTilesetManager* this, u32 param_2, u8* param_3, const u16* param_4) {
|
||||
bool32 bVar2;
|
||||
|
||||
*param_3 = CheckRegionsOnScreen(param_4);
|
||||
@@ -1,133 +1,124 @@
|
||||
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "functions.h"
|
||||
/**
|
||||
* @file lightLevelSetManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Changes the light level when a flag is set.
|
||||
*/
|
||||
#include "manager/lightLevelSetManager.h"
|
||||
#include "flags.h"
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u16 field_0x20;
|
||||
u16 field_0x22;
|
||||
u8 field_0x24[0x12];
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
u16 field_0x38;
|
||||
u16 field_0x3a;
|
||||
u16 field_0x3c;
|
||||
u16 field_0x3e;
|
||||
} Manager23;
|
||||
void sub_0805BE94(LightLevelSetManager*);
|
||||
void sub_0805BEC4(LightLevelSetManager*);
|
||||
void LightLevelSetManager_Type0(LightLevelSetManager*);
|
||||
void LightLevelSetManager_Type1(LightLevelSetManager*);
|
||||
void LightLevelSetManager_Type2(LightLevelSetManager*);
|
||||
void LightLevelSetManager_Type3(LightLevelSetManager*);
|
||||
void sub_0805BE70(LightLevelSetManager*, u32);
|
||||
|
||||
void sub_0805BE94(Manager23*);
|
||||
void sub_0805BEC4(Manager23*);
|
||||
void sub_0805BC8C(Manager23*);
|
||||
void sub_0805BCD4(Manager23*);
|
||||
void sub_0805BD5C(Manager23*);
|
||||
void sub_0805BDB4(Manager23*);
|
||||
|
||||
void sub_0805BE70(Manager23*, u32);
|
||||
|
||||
void Manager23_Main(Manager* this) {
|
||||
static void (*const gUnk_08108CCC[])(Manager23*) = {
|
||||
sub_0805BC8C,
|
||||
sub_0805BCD4,
|
||||
sub_0805BD5C,
|
||||
sub_0805BDB4,
|
||||
void LightLevelSetManager_Main(Manager* this) {
|
||||
static void (*const LightLevelSetManager_Types[])(LightLevelSetManager*) = {
|
||||
LightLevelSetManager_Type0,
|
||||
LightLevelSetManager_Type1,
|
||||
LightLevelSetManager_Type2,
|
||||
LightLevelSetManager_Type3,
|
||||
};
|
||||
gUnk_08108CCC[this->unk_0a]((Manager23*)this);
|
||||
LightLevelSetManager_Types[this->type]((LightLevelSetManager*)this);
|
||||
}
|
||||
|
||||
void sub_0805BC8C(Manager23* this) {
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_0f = 0x1e;
|
||||
void LightLevelSetManager_Type0(LightLevelSetManager* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
super->subtimer = 0x1e;
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
sub_0805BE94(this);
|
||||
}
|
||||
}
|
||||
if ((CheckFlags(this->field_0x3e) != 0) && (--this->manager.unk_0f == 0)) {
|
||||
if ((CheckFlags(this->field_0x3e) != 0) && (--super->subtimer == 0)) {
|
||||
sub_0805BEC4(this);
|
||||
sub_0805BE94(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BCD4(Manager23* this) {
|
||||
switch (this->manager.action) {
|
||||
void LightLevelSetManager_Type1(LightLevelSetManager* this) {
|
||||
switch (super->action) {
|
||||
case 0:
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_0f = 0x1e;
|
||||
super->action = 1;
|
||||
super->subtimer = 0x1e;
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
sub_0805BE70(this, 0x75);
|
||||
this->manager.action = 2;
|
||||
super->action = 2;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (CheckFlags(this->field_0x3e) != 0 && --this->manager.unk_0f == 0) {
|
||||
this->manager.unk_0f = 0x1e;
|
||||
if (CheckFlags(this->field_0x3e) != 0 && --super->subtimer == 0) {
|
||||
super->subtimer = 0x1e;
|
||||
sub_0805BEC4(this);
|
||||
sub_0805BE70(this, 0x76);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (CheckFlags(this->field_0x3e) == 0 && --this->manager.unk_0f == 0) {
|
||||
this->manager.unk_0f = 0x1e;
|
||||
if (CheckFlags(this->field_0x3e) == 0 && --super->subtimer == 0) {
|
||||
super->subtimer = 0x1e;
|
||||
sub_0805BE70(this, 0x75);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BD5C(Manager23* this) {
|
||||
if (this->manager.action == 0) {
|
||||
void LightLevelSetManager_Type2(LightLevelSetManager* this) {
|
||||
if (super->action == 0) {
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
sub_0805BE94(this);
|
||||
}
|
||||
this->field_0x20 =
|
||||
((s16)this->field_0x38 >> 4 & 0x3fU) | ((s32)((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
this->manager.action = 1;
|
||||
super->action = 1;
|
||||
} else {
|
||||
if (GetTileType(this->field_0x20, this->manager.unk_0b) == 0x76) {
|
||||
if (GetTileType(this->field_0x20, super->type2) == 0x76) {
|
||||
SetFlag(this->field_0x3e);
|
||||
ChangeLightLevel(this->manager.unk_0e);
|
||||
ChangeLightLevel(super->timer);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BDB4(Manager23* this) {
|
||||
void LightLevelSetManager_Type3(LightLevelSetManager* this) {
|
||||
u8 bVar1;
|
||||
u16 uVar2;
|
||||
u32 uVar3;
|
||||
|
||||
switch (this->manager.action) {
|
||||
switch (super->action) {
|
||||
case 0:
|
||||
if (CheckFlags(this->field_0x3e) != 0 || CheckFlags(this->field_0x3c) != 0) {
|
||||
sub_0805BE94(this);
|
||||
}
|
||||
this->field_0x20 =
|
||||
((s16)this->field_0x38 >> 4 & 0x3fU) | (((s32)(this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
this->manager.action = 1;
|
||||
super->action = 1;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (GetTileType(this->field_0x20, this->manager.unk_0b) != 0x76) {
|
||||
if (GetTileType(this->field_0x20, super->type2) != 0x76) {
|
||||
return;
|
||||
}
|
||||
SetFlag(this->field_0x3e);
|
||||
ChangeLightLevel(this->manager.unk_0e);
|
||||
this->manager.action = 2;
|
||||
ChangeLightLevel(super->timer);
|
||||
super->action = 2;
|
||||
this->field_0x22 = this->field_0x36 * 0x3c;
|
||||
return;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (--this->field_0x22 == 0) {
|
||||
CreateDustAt(*(s16*)&this->field_0x38, *(s16*)&this->field_0x3a, this->manager.unk_0b);
|
||||
CreateDustAt(*(s16*)&this->field_0x38, *(s16*)&this->field_0x3a, super->type2);
|
||||
ClearFlag(this->field_0x3e);
|
||||
RestorePrevTileEntity(this->field_0x20, this->manager.unk_0b);
|
||||
ChangeLightLevel(-this->manager.unk_0e);
|
||||
this->manager.action = 1;
|
||||
RestorePrevTileEntity(this->field_0x20, super->type2);
|
||||
ChangeLightLevel(-super->timer);
|
||||
super->action = 1;
|
||||
} else {
|
||||
if (CheckFlags(this->field_0x3c) == 0) {
|
||||
return;
|
||||
@@ -139,26 +130,26 @@ void sub_0805BDB4(Manager23* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BE70(Manager23* this, u32 param_2) {
|
||||
void sub_0805BE70(LightLevelSetManager* this, u32 param_2) {
|
||||
SetTileType(param_2,
|
||||
((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6,
|
||||
this->manager.unk_0b);
|
||||
super->type2);
|
||||
}
|
||||
|
||||
void sub_0805BE94(Manager23* this) {
|
||||
void sub_0805BE94(LightLevelSetManager* this) {
|
||||
SetTileType(0x76, ((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6,
|
||||
this->manager.unk_0b);
|
||||
ChangeLightLevel(this->manager.unk_0e);
|
||||
super->type2);
|
||||
ChangeLightLevel(super->timer);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
void sub_0805BEC4(Manager23* this) {
|
||||
void sub_0805BEC4(LightLevelSetManager* this) {
|
||||
Entity* object = CreateObject(OBJECT_2A, 1, 0);
|
||||
if (object != NULL) {
|
||||
*(s8*)(&object->flags + 1) = ((*(s8*)(&object->flags + 1)) & (-0x10)) | 3;
|
||||
object->x.HALF.HI = this->field_0x38 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = this->field_0x3a + gRoomControls.origin_y;
|
||||
object->collisionLayer = this->manager.unk_0b;
|
||||
object->collisionLayer = super->type2;
|
||||
object->spritePriority.b0 = 2;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +1,29 @@
|
||||
|
||||
#include "manager.h"
|
||||
/**
|
||||
* @file lightManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Manages the light in dark rooms.
|
||||
*/
|
||||
#include "manager/lightManager.h"
|
||||
#include "area.h"
|
||||
#include "common.h"
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
#include "main.h"
|
||||
#include "screen.h"
|
||||
#include "physics.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "physics.h"
|
||||
#include "functions.h"
|
||||
#include "common.h"
|
||||
#include "game.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
s32 unk20;
|
||||
} Manager22;
|
||||
#include "screen.h"
|
||||
|
||||
extern void sub_0801E120(void);
|
||||
extern void sub_0801E154(u32);
|
||||
extern u32 CheckRectOnScreen(s32, s32, u32, u32);
|
||||
extern void sub_0801E160(u32, u32, u32);
|
||||
|
||||
u32 sub_0805BA78();
|
||||
bool32 sub_0805BA78();
|
||||
void sub_0805BAD4();
|
||||
|
||||
void Manager22_Main(Manager22* this) {
|
||||
void LightManager_Main(LightManager* this) {
|
||||
s32 sVar1;
|
||||
u32 uVar3;
|
||||
|
||||
@@ -32,14 +32,14 @@ void Manager22_Main(Manager22* this) {
|
||||
gScreen.lcd.displayControl &= ~(DISPCNT_BG3_ON | DISPCNT_WIN0_ON);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_10 |= 0x20;
|
||||
this->manager.unk_0e = 17;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
super->flags |= ENT_PERSIST;
|
||||
super->timer = 17;
|
||||
this->unk20 = 0;
|
||||
SetDefaultPriority((Entity*)this, 6);
|
||||
sub_0801E120();
|
||||
sub_0801E154(this->manager.unk_0e);
|
||||
sub_0801E154(super->timer);
|
||||
}
|
||||
if (gMain.substate == GAMEMAIN_UPDATE) {
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||
@@ -55,15 +55,15 @@ void Manager22_Main(Manager22* this) {
|
||||
} else {
|
||||
gScreen.lcd.displayControl &= ~DISPCNT_WIN0_ON;
|
||||
}
|
||||
uVar3 = this->manager.unk_0e;
|
||||
uVar3 = super->timer;
|
||||
if (((gPlayerState.flags & PL_USE_LANTERN)) && (gArea.lightType)) {
|
||||
if (uVar3 < 0x48) {
|
||||
uVar3 += 4;
|
||||
sub_0801E154(uVar3);
|
||||
this->unk20 = 0;
|
||||
} else if ((gRoomTransition.frameCount & 3) == 0) {
|
||||
this->manager.unk_0f += 0x10;
|
||||
sVar1 = gSineTable[this->manager.unk_0f];
|
||||
super->subtimer += 0x10;
|
||||
sVar1 = gSineTable[super->subtimer];
|
||||
this->unk20 = sVar1 >> 7;
|
||||
sub_0801E154(uVar3 + this->unk20);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ void Manager22_Main(Manager22* this) {
|
||||
}
|
||||
}
|
||||
|
||||
this->manager.unk_0e = uVar3;
|
||||
super->timer = uVar3;
|
||||
sub_0801E160(gPlayerEntity.x.HALF.HI - gRoomControls.scroll_x,
|
||||
gPlayerEntity.y.HALF.HI - gRoomControls.scroll_y - 9 + gPlayerEntity.z.HALF.HI,
|
||||
uVar3 + this->unk20);
|
||||
@@ -87,7 +87,7 @@ void Manager22_Main(Manager22* this) {
|
||||
|
||||
#define ABS(x) ((unsigned)(x < 0 ? -(x) : x))
|
||||
|
||||
u32 sub_0805BA78() {
|
||||
bool32 sub_0805BA78() {
|
||||
u32 uVar1;
|
||||
s32 iVar1;
|
||||
s32 iVar2;
|
||||
@@ -117,9 +117,9 @@ u32 sub_0805BA78() {
|
||||
}
|
||||
gArea.lightLevel = iVar2;
|
||||
} else {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
extern u16 gUnk_08108CA8[];
|
||||
@@ -136,8 +136,8 @@ void sub_0805BB00(s32 lightLevel, s32 param_2) {
|
||||
if (gArea.lightType == 0) {
|
||||
Manager* pManager = GetEmptyManager();
|
||||
if (pManager != 0) {
|
||||
pManager->type = 9;
|
||||
pManager->subtype = 34;
|
||||
pManager->kind = MANAGER;
|
||||
pManager->id = LIGHT_MANAGER;
|
||||
AppendEntityToList((Entity*)pManager, 0);
|
||||
}
|
||||
}
|
||||
@@ -153,26 +153,26 @@ void sub_0805BB00(s32 lightLevel, s32 param_2) {
|
||||
}
|
||||
|
||||
void sub_0805BB74(s32 lightLevel) {
|
||||
Manager22* manager;
|
||||
LightManager* manager;
|
||||
|
||||
if (lightLevel < 0) {
|
||||
lightLevel = gRoomVars.lightLevel;
|
||||
}
|
||||
gArea.lightLevel = lightLevel;
|
||||
gRoomVars.lightLevel = gArea.lightLevel;
|
||||
manager = (Manager22*)DeepFindEntityByID(MANAGER, 0x22);
|
||||
manager = (LightManager*)DeepFindEntityByID(MANAGER, LIGHT_MANAGER);
|
||||
if (manager) {
|
||||
Manager22_Main(manager);
|
||||
LightManager_Main(manager);
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||
sub_0805BA78();
|
||||
sub_0805BAD4();
|
||||
}
|
||||
}
|
||||
|
||||
s32 UpdateLightLevel() {
|
||||
s32 iVar1;
|
||||
bool32 UpdateLightLevel() {
|
||||
bool32 iVar1;
|
||||
|
||||
iVar1 = 0;
|
||||
iVar1 = FALSE;
|
||||
if (gArea.lightType && gRoomVars.lightLevel < (s16)gArea.lightLevel) {
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||
iVar1 = sub_0805BA78();
|
||||
@@ -1,17 +1,25 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "screen.h"
|
||||
#include "functions.h"
|
||||
/**
|
||||
* @file lightRayManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Creates and updates light rays.
|
||||
*
|
||||
* Light rays at the left of minish woods
|
||||
* Light rays in the barrel minish house
|
||||
*/
|
||||
#include "manager/lightRayManager.h"
|
||||
#include "common.h"
|
||||
#include "functions.h"
|
||||
#include "main.h"
|
||||
#include "screen.h"
|
||||
|
||||
extern void sub_08056250(void);
|
||||
|
||||
void (*const gUnk_08107C5C[])(Entity*);
|
||||
void (*const gUnk_08107C48[])(Entity*);
|
||||
void (*const gUnk_08107C5C[])(LightRayManager*);
|
||||
void (*const gUnk_08107C48[])(LightRayManager*);
|
||||
const u16 gUnk_08107C1C[];
|
||||
const u16 gUnk_08107C30[];
|
||||
const u8 gManager1GfxGroups[];
|
||||
const u8 gLightRayManagerGfxGroups[];
|
||||
|
||||
extern u16 gUnk_02017AA0[];
|
||||
extern u16 gUnk_085B4180[];
|
||||
@@ -22,30 +30,29 @@ typedef struct {
|
||||
u8 unk2;
|
||||
u8 unk3;
|
||||
u8 unk4;
|
||||
} PACKED Manager1Prop;
|
||||
} PACKED LightRayManagerProp;
|
||||
|
||||
#define ZV(this) ((u8*)&this->zVelocity)
|
||||
#define ZS(this) ((u8*)&this->speed)
|
||||
|
||||
void Manager1_Main(Entity* this) {
|
||||
void LightRayManager_Main(LightRayManager* this) {
|
||||
u8 bVar1;
|
||||
u8* pbVar2;
|
||||
|
||||
gUnk_08107C5C[this->action](this);
|
||||
gUnk_08107C48[ZV(this)[1]](this);
|
||||
bVar1 = gManager1GfxGroups[ZV(this)[1]];
|
||||
if ((bVar1 != 0) && (ZV(this)[0] != bVar1)) {
|
||||
ZV(this)[0] = bVar1;
|
||||
gUnk_08107C5C[super->action](this);
|
||||
gUnk_08107C48[this->unk_21](this);
|
||||
bVar1 = gLightRayManagerGfxGroups[this->unk_21];
|
||||
if ((bVar1 != 0) && (this->unk_20 != bVar1)) {
|
||||
this->unk_20 = bVar1;
|
||||
LoadGfxGroup(bVar1);
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_080570B8(Entity* this) {
|
||||
static void sub_080570B8(LightRayManager* this) {
|
||||
u8* pbVar1;
|
||||
|
||||
LoadGfxGroup(ZV(this)[0]);
|
||||
this->z.WORD = 0;
|
||||
pbVar1 = &ZV(this)[1];
|
||||
LoadGfxGroup(this->unk_20);
|
||||
this->unk_34 = NULL;
|
||||
pbVar1 = &this->unk_21;
|
||||
if (*pbVar1 == 3) {
|
||||
gScreen.bg3.updated = 1;
|
||||
} else {
|
||||
@@ -59,12 +66,12 @@ static void sub_080570F8(void) {
|
||||
sub_08056250();
|
||||
}
|
||||
|
||||
void sub_08057118(Entity* this) {
|
||||
this->timer = 0;
|
||||
ZV(this)[0] = 0;
|
||||
ZV(this)[1] = 0;
|
||||
ZV(this)[2] = 0;
|
||||
this->action = 1;
|
||||
void sub_08057118(LightRayManager* this) {
|
||||
super->timer = 0;
|
||||
this->unk_20 = 0;
|
||||
this->unk_21 = 0;
|
||||
this->unk_22 = 0;
|
||||
super->action = 1;
|
||||
gScreen.bg3.control = 0x1e04;
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||
gScreen.controls.layerFXControl = 0x3648;
|
||||
@@ -73,8 +80,8 @@ void sub_08057118(Entity* this) {
|
||||
}
|
||||
|
||||
// regalloc
|
||||
NONMATCH("asm/non_matching/manager1/sub_08057174.inc", void sub_08057174(Entity* this)) {
|
||||
Manager1Prop* prop = GetCurrentRoomProperty(this->type);
|
||||
NONMATCH("asm/non_matching/lightRayManager/sub_08057174.inc", void sub_08057174(LightRayManager* this)) {
|
||||
LightRayManagerProp* prop = GetCurrentRoomProperty(super->type);
|
||||
s32 temp;
|
||||
s32 x;
|
||||
s32 y;
|
||||
@@ -95,56 +102,56 @@ NONMATCH("asm/non_matching/manager1/sub_08057174.inc", void sub_08057174(Entity*
|
||||
y = temp >> 4;
|
||||
|
||||
for (; prop->unk0 != 0xff; prop++) {
|
||||
if (prop->unk0 != ZV(this)[1]) {
|
||||
if (prop->unk0 != this->unk_21) {
|
||||
u32 x2 = (gRoomControls.origin_x >> 4) + prop->unk1;
|
||||
u32 y2 = (gRoomControls.origin_y >> 4) + prop->unk2;
|
||||
|
||||
if (y - y2 < prop->unk4 && x - x2 < prop->unk3) {
|
||||
switch (prop->unk0) {
|
||||
case 1:
|
||||
if (ZV(this)[1] == 2) {
|
||||
this->action = 3;
|
||||
this->timer = 9;
|
||||
if (this->unk_21 == 2) {
|
||||
super->action = 3;
|
||||
super->timer = 9;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (ZV(this)[1] == 6) {
|
||||
this->action = 3;
|
||||
this->timer = 9;
|
||||
if (this->unk_21 == 6) {
|
||||
super->action = 3;
|
||||
super->timer = 9;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (ZV(this)[1] == 0) {
|
||||
this->action = 2;
|
||||
this->timer = 0;
|
||||
ZV(this)[0] = 0;
|
||||
if (this->unk_21 == 0) {
|
||||
super->action = 2;
|
||||
super->timer = 0;
|
||||
this->unk_20 = 0;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (ZV(this)[1] == 0) {
|
||||
this->action = 2;
|
||||
this->timer = 0;
|
||||
if (this->unk_21 == 0) {
|
||||
super->action = 2;
|
||||
super->timer = 0;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (ZV(this)[1] == 0) {
|
||||
this->action = 2;
|
||||
this->timer = 0;
|
||||
this->z.WORD = 0;
|
||||
if (this->unk_21 == 0) {
|
||||
super->action = 2;
|
||||
super->timer = 0;
|
||||
this->unk_34 = NULL;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (ZV(this)[1] == 4) {
|
||||
this->action = 3;
|
||||
this->timer = 9;
|
||||
if (this->unk_21 == 4) {
|
||||
super->action = 3;
|
||||
super->timer = 9;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (this->action != 1) {
|
||||
this->subtimer = 8;
|
||||
ZV(this)[1] = prop->unk0;
|
||||
ZV(this)[2] = 1;
|
||||
if (super->action != 1) {
|
||||
super->subtimer = 8;
|
||||
this->unk_21 = prop->unk0;
|
||||
this->unk_22 = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -153,27 +160,27 @@ NONMATCH("asm/non_matching/manager1/sub_08057174.inc", void sub_08057174(Entity*
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_0805728C(Entity* this) {
|
||||
if (--this->subtimer == 0) {
|
||||
this->subtimer = 8;
|
||||
gScreen.controls.alphaBlend = gUnk_08107C1C[this->timer++];
|
||||
void sub_0805728C(LightRayManager* this) {
|
||||
if (--super->subtimer == 0) {
|
||||
super->subtimer = 8;
|
||||
gScreen.controls.alphaBlend = gUnk_08107C1C[super->timer++];
|
||||
|
||||
if (this->timer == 10) {
|
||||
this->action = 1;
|
||||
ZV(this)[2] = 0;
|
||||
if (super->timer == 10) {
|
||||
super->action = 1;
|
||||
this->unk_22 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080572D4(Entity* this) {
|
||||
if (--this->subtimer == 0) {
|
||||
this->subtimer = 8;
|
||||
gScreen.controls.alphaBlend = gUnk_08107C1C[this->timer--];
|
||||
void sub_080572D4(LightRayManager* this) {
|
||||
if (--super->subtimer == 0) {
|
||||
super->subtimer = 8;
|
||||
gScreen.controls.alphaBlend = gUnk_08107C1C[super->timer--];
|
||||
|
||||
if (this->timer == 0xff) {
|
||||
this->action = 1;
|
||||
ZV(this)[2] = 0;
|
||||
ZV(this)[1] = 0;
|
||||
if (super->timer == 0xff) {
|
||||
super->action = 1;
|
||||
this->unk_22 = 0;
|
||||
this->unk_21 = 0;
|
||||
gScreen._6c = 0;
|
||||
}
|
||||
}
|
||||
@@ -181,19 +188,19 @@ void sub_080572D4(Entity* this) {
|
||||
|
||||
void sub_0805732C(u32 param_1, u32 param_2) {
|
||||
u32 index;
|
||||
u16* ptr = &gUnk_02017AA0[gUnk_03003DE4 * 0x500];
|
||||
u16* ptr = &gUnk_02017AA0[gUnk_03003DE4[0] * 0x500];
|
||||
|
||||
for (index = 0; index < 0xa0; ptr++, index++) {
|
||||
*ptr = gSineTable[(param_2 + index) & 0xff] * param_1 / 0x100 + gScreen.bg3.xOffset;
|
||||
}
|
||||
|
||||
sub_0805622C(&gUnk_02017AA0[gUnk_03003DE4 * 0x500], REG_ADDR_BG3HOFS, 0xa2600001UL);
|
||||
sub_0805622C((struct BgAffineDstData*)&gUnk_02017AA0[gUnk_03003DE4[0] * 0x500], REG_ADDR_BG3HOFS, 0xa2600001UL);
|
||||
}
|
||||
|
||||
void nullsub_494() {
|
||||
}
|
||||
|
||||
void sub_080573AC(Entity* this) {
|
||||
void sub_080573AC(LightRayManager* this) {
|
||||
s32 sin, frameCount;
|
||||
gRoomControls.bg3OffsetX.WORD -= 0x2000;
|
||||
gRoomControls.bg3OffsetY.WORD -= 0x1000;
|
||||
@@ -201,15 +208,15 @@ void sub_080573AC(Entity* this) {
|
||||
gScreen.bg3.yOffset = ((gRoomControls.scroll_y - gRoomControls.origin_y) >> 1) + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
sin = gSineTable[(gRoomTransition.frameCount & 0xff) + 0x40];
|
||||
sub_0805732C((sin >> 5) + 0x10, gRoomTransition.frameCount);
|
||||
if (ZV(this)[2] == 0) {
|
||||
if (this->unk_22 == 0) {
|
||||
if ((gRoomTransition.frameCount & 0x1f) == 0) {
|
||||
ZS(this)[0] = (ZS(this)[0] + 1) & 7;
|
||||
gScreen.controls.alphaBlend = gUnk_08107C30[ZS(this)[0]];
|
||||
this->unk_24 = (this->unk_24 + 1) & 7;
|
||||
gScreen.controls.alphaBlend = gUnk_08107C30[this->unk_24];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08057450(Entity* this) {
|
||||
void sub_08057450(LightRayManager* this) {
|
||||
s32 y;
|
||||
gScreen.bg3.xOffset = 0x10;
|
||||
y = gRoomControls.scroll_y;
|
||||
@@ -218,26 +225,26 @@ void sub_08057450(Entity* this) {
|
||||
|
||||
gScreen.bg3.yOffset = y & 0x3f;
|
||||
gScreen.bg3.tilemap = &gBG3Buffer[(y / 0x40) << 8];
|
||||
if ((void*)this->z.WORD != gScreen.bg3.tilemap) {
|
||||
this->z.WORD = (u32)gScreen.bg3.tilemap;
|
||||
if (this->unk_34 != gScreen.bg3.tilemap) {
|
||||
this->unk_34 = gScreen.bg3.tilemap;
|
||||
gScreen.bg3.updated = 1;
|
||||
}
|
||||
|
||||
if (ZV(this)[2] == 0 && (gRoomTransition.frameCount & 0x1f) == 0) {
|
||||
ZS(this)[0] = (ZS(this)[0] + 1) & 7;
|
||||
gScreen.controls.alphaBlend = gUnk_08107C30[ZS(this)[0]];
|
||||
if (this->unk_22 == 0 && (gRoomTransition.frameCount & 0x1f) == 0) {
|
||||
this->unk_24 = (this->unk_24 + 1) & 7;
|
||||
gScreen.controls.alphaBlend = gUnk_08107C30[this->unk_24];
|
||||
}
|
||||
|
||||
if ((gRoomTransition.frameCount & 0x7) == 0) {
|
||||
u32 index;
|
||||
u16* ptr = &gUnk_085B4180[(ZV(this)[3] << 4)];
|
||||
u16* ptr = &gUnk_085B4180[(this->unk_23 << 4)];
|
||||
|
||||
for (index = 0, ptr = ptr + 7; index <= 3; index++) {
|
||||
SetColor(index + 0x87, *(ptr + index));
|
||||
SetColor(index + 0x8c, *(ptr + index + 5));
|
||||
}
|
||||
|
||||
ZV(this)[3] = (ZV(this)[3] + 1) & 3;
|
||||
this->unk_23 = (this->unk_23 + 1) & 3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,15 +256,15 @@ const u16 gUnk_08107C30[] = {
|
||||
0x909, 0xA08, 0xB07, 0xC06, 0xD05, 0xC06, 0xB07, 0xA08,
|
||||
};
|
||||
|
||||
const u8 gManager1GfxGroups[] = {
|
||||
const u8 gLightRayManagerGfxGroups[] = {
|
||||
0x25, 0x00, 0x24, 0x00, 0x25, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
void (*const gUnk_08107C48[])(Entity*) = {
|
||||
void (*const gUnk_08107C48[])(LightRayManager*) = {
|
||||
nullsub_494, nullsub_494, sub_080573AC, nullsub_494, sub_08057450,
|
||||
};
|
||||
|
||||
void (*const gUnk_08107C5C[])(Entity*) = {
|
||||
void (*const gUnk_08107C5C[])(LightRayManager*) = {
|
||||
sub_08057118,
|
||||
sub_08057174,
|
||||
sub_0805728C,
|
||||
@@ -1,16 +0,0 @@
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
|
||||
void Manager11_Main(Manager11* this) {
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
if (CheckFlags(this->unk_3c)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
} else {
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
SetFlag(this->unk_3c);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
#include "manager.h"
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager16/Manager16_Main.inc", void Manager16_Main())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager16/sub_0805ACC0.inc", u32 sub_0805ACC0(Entity* ent))
|
||||
@@ -1,49 +0,0 @@
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
#include "object.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 field_0x20[0x15];
|
||||
u8 field_0x35;
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
s16 field_0x38;
|
||||
s16 field_0x3a;
|
||||
u16 field_0x3c;
|
||||
u16 field_0x3e;
|
||||
} Manager17;
|
||||
|
||||
void sub_0805AD60(Manager17*);
|
||||
void sub_0805AD80(Manager17*);
|
||||
|
||||
void Manager17_Main(Manager17* manager) {
|
||||
static void (*const actionFuncs[])(Manager17*) = {
|
||||
sub_0805AD60,
|
||||
sub_0805AD80,
|
||||
};
|
||||
actionFuncs[manager->manager.action](manager);
|
||||
}
|
||||
|
||||
void sub_0805AD60(Manager17* manager) {
|
||||
manager->manager.action = 1;
|
||||
if (CheckFlags(manager->field_0x3c) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
sub_0805AD80(manager);
|
||||
}
|
||||
|
||||
void sub_0805AD80(Manager17* manager) {
|
||||
if (CheckFlags(manager->field_0x3e) != 0) {
|
||||
Entity* object = CreateObject(GROUND_ITEM, manager->manager.unk_0a, manager->manager.unk_0b);
|
||||
if (object != NULL) {
|
||||
object->timer = manager->field_0x35;
|
||||
object->collisionLayer = manager->field_0x36;
|
||||
object->x.HALF.HI = manager->field_0x38 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = manager->field_0x3a + gRoomControls.origin_y;
|
||||
object->field_0x86.HWORD = manager->field_0x3c;
|
||||
}
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
#include "manager.h"
|
||||
#include "asm.h"
|
||||
#include "room.h"
|
||||
#include "enemy.h"
|
||||
|
||||
void sub_0805B554(Manager*);
|
||||
void sub_0805B55C(Manager*);
|
||||
|
||||
void Manager1C_Main(Manager* manager) {
|
||||
static void (*const actionFuncs[])(Manager*) = {
|
||||
sub_0805B554,
|
||||
sub_0805B55C,
|
||||
};
|
||||
actionFuncs[manager->action](manager);
|
||||
}
|
||||
|
||||
// Initial setup
|
||||
void sub_0805B554(Manager* manager) {
|
||||
manager->action = 1;
|
||||
manager->unk_0e = 1;
|
||||
}
|
||||
|
||||
// Spawn water drops every 0xf frames
|
||||
void sub_0805B55C(Manager* manager) {
|
||||
static const s16 gUnk_08108C6C[] = { -0x64, -0x3c, -0x14, 0x14, 0x3c, 0x64, 0x8c, 0xb4 };
|
||||
static const s8 gUnk_08108C7C[] = { -0x32, -0x19, 0x0, 0x19 };
|
||||
|
||||
if (--manager->unk_0e == 0) {
|
||||
Entity* waterDrop;
|
||||
manager->unk_0e = 0xf;
|
||||
waterDrop = CreateEnemy(WATER_DROP, 0);
|
||||
if (waterDrop != NULL) {
|
||||
waterDrop->x.HALF.HI = gRoomControls.scroll_x + 0x78 + gUnk_08108C6C[Random() & 7];
|
||||
waterDrop->y.HALF.HI = gRoomControls.scroll_y + 0x50 + gUnk_08108C7C[Random() & 3];
|
||||
waterDrop->z.HALF.HI = 0xff38;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
|
||||
void sub_0805B5E0(Manager*);
|
||||
void sub_0805B638(Manager*);
|
||||
|
||||
void Manager1D_Main(Manager* this) {
|
||||
static void (*const actionFuncs[])(Manager*) = {
|
||||
sub_0805B5E0,
|
||||
sub_0805B638,
|
||||
};
|
||||
actionFuncs[this->action](this);
|
||||
}
|
||||
|
||||
void sub_0805B5E0(Manager* this) {
|
||||
static const u16 gUnk_08108C88[] = { 0x1e07, 0x1e07 };
|
||||
this->action = 1;
|
||||
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||
gScreen.bg3.control = gUnk_08108C88[this->unk_0a];
|
||||
gRoomControls.bg3OffsetY.WORD = 0;
|
||||
gRoomControls.bg3OffsetX.WORD = 0;
|
||||
|
||||
switch (this->unk_0a) {
|
||||
case 0:
|
||||
default:
|
||||
gScreen.bg3.yOffset = 0;
|
||||
gScreen.bg3.xOffset = 0;
|
||||
break;
|
||||
case 1:
|
||||
gScreen.bg3.xOffset = gRoomControls.scroll_x + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.bg3.yOffset = gRoomControls.scroll_y + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805B638(Manager* this) {
|
||||
if (this->unk_0a == 1) {
|
||||
gRoomControls.bg3OffsetX.WORD = gRoomControls.bg3OffsetX.WORD + 0x2000;
|
||||
gScreen.bg3.xOffset = gRoomControls.scroll_x + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.bg3.yOffset = gRoomControls.scroll_y + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "asm.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 unk_20[0x14]; // unused
|
||||
u16 radiusX;
|
||||
u16 radiusY;
|
||||
s16 posX;
|
||||
s16 posY;
|
||||
u8 unk_3c[2]; // unused
|
||||
u16 playerInRegionFlag;
|
||||
} Manager1E;
|
||||
|
||||
enum Manager1E_State { Init, ObserveRegion };
|
||||
|
||||
void Manager1E_Init(Manager1E*);
|
||||
void Manager1E_ObserveRegion(Manager1E*);
|
||||
|
||||
void (*const Manager1E_ActionFuncs[2])(Manager1E*) = { Manager1E_Init, Manager1E_ObserveRegion };
|
||||
|
||||
void Manager1E_Main(Manager1E* this) {
|
||||
Manager1E_ActionFuncs[this->manager.action](this);
|
||||
}
|
||||
|
||||
void Manager1E_Init(Manager1E* this) {
|
||||
this->manager.action = ObserveRegion;
|
||||
this->radiusX >>= 1;
|
||||
this->posX += this->radiusX;
|
||||
this->radiusY >>= 1;
|
||||
this->posY += this->radiusY;
|
||||
if (!this->manager.unk_0a) {
|
||||
if (CheckFlags(this->playerInRegionFlag)) {
|
||||
DeleteManager(&this->manager);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Manager1E_ObserveRegion(this);
|
||||
}
|
||||
|
||||
void Manager1E_ObserveRegion(Manager1E* this) {
|
||||
if (CheckPlayerInRegion(this->posX, this->posY, this->radiusX, this->radiusY)) {
|
||||
SetFlag(this->playerInRegionFlag);
|
||||
if (!this->manager.unk_0a) {
|
||||
DeleteManager(&this->manager);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
ClearFlag(this->playerInRegionFlag);
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 field_0x20[0x16];
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
s16 field_0x38;
|
||||
u16 field_0x3a;
|
||||
u8 field_0x3c;
|
||||
u8 field_0x3d;
|
||||
u16 field_0x3e;
|
||||
} Manager1F;
|
||||
|
||||
void sub_0805B778(Manager1F*);
|
||||
void sub_0805B70C(Manager1F*);
|
||||
void sub_0805B744(Manager1F*);
|
||||
|
||||
void Manager1F_Main(Manager1F* this) {
|
||||
static void (*const actionFuncs[])(Manager1F*) = {
|
||||
sub_0805B70C,
|
||||
sub_0805B744,
|
||||
};
|
||||
actionFuncs[this->manager.action](this);
|
||||
}
|
||||
|
||||
void sub_0805B70C(Manager1F* this) {
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
this->manager.unk_0b = 1;
|
||||
}
|
||||
this->manager.action = 1;
|
||||
this->field_0x38 = (this->field_0x38 >> 4 & 0x3fU) | (((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
sub_0805B778(this);
|
||||
}
|
||||
|
||||
void sub_0805B744(Manager1F* this) {
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
if (this->manager.unk_0b == 0) {
|
||||
this->manager.unk_0b = 1;
|
||||
sub_0805B778(this);
|
||||
}
|
||||
} else {
|
||||
if (this->manager.unk_0b == 1) {
|
||||
this->manager.unk_0b = 0;
|
||||
sub_0805B778(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805B778(Manager1F* this) {
|
||||
static const u16 gUnk_08108C9C[] = { 0x358, 0x359, 0x356, 0x35a, 0x35a, 0x357 };
|
||||
SetTileType(gUnk_08108C9C[this->manager.unk_0a * 2 + this->manager.unk_0b], this->field_0x38, this->field_0x36);
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 unk_20[0x12];
|
||||
u16 unk_32;
|
||||
u8 unk_34[2];
|
||||
u8 unk_36;
|
||||
u8 unk_37;
|
||||
u16 unk_38;
|
||||
u16 unk_3a;
|
||||
u16 unk_3c;
|
||||
u16 unk_3e;
|
||||
} Manager20;
|
||||
|
||||
void Manager20_Main(Manager20* this) {
|
||||
Entity* tmp = CreateObject(this->manager.unk_0e, this->manager.unk_0a, this->manager.unk_0b);
|
||||
if (!tmp)
|
||||
return;
|
||||
tmp->field_0x86.HWORD = this->unk_3e;
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
tmp->x.HALF.HI = this->unk_36 | (this->unk_37 & 0xF) << 8; // r1
|
||||
tmp->y.HALF.HI = this->unk_3c & 0xFFF;
|
||||
tmp->collisionLayer = this->unk_3c >> 0xC;
|
||||
} else {
|
||||
tmp->x.HALF.HI = this->unk_38;
|
||||
tmp->y.HALF.HI = this->unk_3a;
|
||||
tmp->collisionLayer = this->unk_37 >> 4;
|
||||
}
|
||||
tmp->x.HALF.HI += gRoomControls.origin_x;
|
||||
tmp->y.HALF.HI += gRoomControls.origin_y;
|
||||
DeleteManager((Manager*)this);
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
#include "object.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 unk_20[0x8];
|
||||
u8 unk_28;
|
||||
u8 unk_29;
|
||||
u16 unk_2a;
|
||||
} Manager26;
|
||||
|
||||
void sub_0805C6D0(Manager26*);
|
||||
void sub_0805C7A0(Manager26*);
|
||||
void sub_0805C7C4(Manager26*);
|
||||
|
||||
void (*const gUnk_08108D04[])(Manager26*) = { sub_0805C6D0, sub_0805C7A0, sub_0805C7C4 };
|
||||
|
||||
void sub_0805C7CC(Manager26*);
|
||||
|
||||
void Manager26_Main(Manager26* this) {
|
||||
gUnk_08108D04[this->manager.action](this);
|
||||
}
|
||||
|
||||
void sub_0805C6D0(Manager26* this) {
|
||||
UnkManager26HelperStruct* tmp = GetCurrentRoomProperty(this->manager.unk_0a);
|
||||
if (!tmp) {
|
||||
DeleteManager(&this->manager);
|
||||
return;
|
||||
}
|
||||
this->unk_2a = gRoomControls.origin_y + this->manager.unk_0e;
|
||||
this->manager.unk_0e = 0;
|
||||
this->unk_28 = 0;
|
||||
this->unk_29 = 0;
|
||||
while (tmp->unk_00 != 0xFF && this->manager.unk_0e < 0x20) {
|
||||
Entity* obj;
|
||||
obj = CreateObject(PUSHABLE_FURNITURE, tmp->unk_01, tmp->unk_02);
|
||||
if (obj) {
|
||||
obj->timer = tmp->unk_03;
|
||||
obj->x.HALF.HI = gRoomControls.origin_x + tmp->unk_04;
|
||||
obj->y.HALF.HI = gRoomControls.origin_y + tmp->unk_06;
|
||||
obj->parent = (Entity*)this;
|
||||
obj->collisionLayer = 1;
|
||||
obj->field_0x82.HALF.HI = this->manager.unk_0e;
|
||||
obj->field_0x82.HALF.LO = tmp->unk_00;
|
||||
this->unk_29 |= 1 << this->manager.unk_0e;
|
||||
}
|
||||
tmp++;
|
||||
this->manager.unk_0e++;
|
||||
}
|
||||
if (this->manager.unk_0b == 0xFF) {
|
||||
this->manager.action = 2;
|
||||
} else {
|
||||
if (CheckLocalFlag(this->manager.unk_0b)) {
|
||||
this->manager.action = 2;
|
||||
} else {
|
||||
this->manager.action = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C7A0(Manager26* this) {
|
||||
if (this->unk_28 == this->unk_29) {
|
||||
this->manager.action = 2;
|
||||
SetLocalFlag(this->manager.unk_0b);
|
||||
}
|
||||
sub_0805C7CC(this);
|
||||
}
|
||||
|
||||
void sub_0805C7C4(Manager26* this) {
|
||||
sub_0805C7CC(this);
|
||||
}
|
||||
|
||||
void sub_0805C7CC(Manager26* this) {
|
||||
if (gPlayerState.flags & PL_MINISH) {
|
||||
if (gPlayerEntity.y.HALF.HI < this->unk_2a + 0x10) {
|
||||
this->manager.unk_0d = 1;
|
||||
} else {
|
||||
this->manager.unk_0d = 0;
|
||||
}
|
||||
} else {
|
||||
if (gPlayerEntity.y.HALF.HI < this->unk_2a + 0x28) {
|
||||
this->manager.unk_0d = 3;
|
||||
} else {
|
||||
this->manager.unk_0d = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "sound.h"
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "common.h"
|
||||
|
||||
extern u32 sub_0805C920(Entity*);
|
||||
|
||||
void sub_0805C874(Entity*);
|
||||
void sub_0805C894(Entity*);
|
||||
void sub_0805C8B4(Entity*);
|
||||
void sub_0805C908(Entity*);
|
||||
|
||||
void (*const gUnk_08108D10[])(Entity*) = { sub_0805C874, sub_0805C894, sub_0805C8B4, sub_0805C908 };
|
||||
|
||||
const u8 gUnk_08108D20[] = { 0x6F, 0x70, 0x71, 0x72, 0x71, 0x70 };
|
||||
|
||||
void Manager27_Main(Entity* this) {
|
||||
|
||||
gUnk_08108D10[this->action](this);
|
||||
if (CheckLocalFlagByBank(FLAG_BANK_3, this->type + 0x67)) {
|
||||
gRoomTransition.armos_data.field_0xac |= (1 << this->type);
|
||||
} else {
|
||||
gRoomTransition.armos_data.field_0xac &= ~(1 << this->type);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C874(Entity* this) {
|
||||
u8 bVar1;
|
||||
|
||||
if (sub_0805C920(this)) {
|
||||
this->action = 2;
|
||||
} else {
|
||||
this->action = 1;
|
||||
}
|
||||
|
||||
this->timer = 1;
|
||||
this->subtimer = 0;
|
||||
}
|
||||
|
||||
void sub_0805C894(Entity* this) {
|
||||
if (sub_0805C920(this)) {
|
||||
this->action = 2;
|
||||
this->timer = 1;
|
||||
SoundReq(SFX_EM_ARMOS_ON);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C8B4(Entity* this) {
|
||||
u8 bVar1;
|
||||
int iVar2;
|
||||
|
||||
if (--this->timer == 0) {
|
||||
this->timer = 0x14;
|
||||
|
||||
if (5 < ++this->subtimer) {
|
||||
this->subtimer = 0;
|
||||
}
|
||||
LoadPaletteGroup(gUnk_08108D20[this->subtimer]);
|
||||
if (this->subtimer == 0) {
|
||||
SoundReq(SFX_EM_ARMOS_ON);
|
||||
}
|
||||
}
|
||||
if (sub_0805C920(this) == 0) {
|
||||
this->action = 3;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C908(Entity* this) {
|
||||
if (this->subtimer == 0) {
|
||||
this->action = 1;
|
||||
} else {
|
||||
sub_0805C8B4(this);
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0805C920(Entity* this) {
|
||||
return CheckLocalFlagByBank(FLAG_BANK_3, this->type + 0x67);
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "asm.h"
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
struct {
|
||||
Entity* enemies[8];
|
||||
} d;
|
||||
} Manager28;
|
||||
|
||||
void Manager28_Init(Manager28*);
|
||||
void Manager28_Main2(Manager28*);
|
||||
u32 Manager28_FindMatchingEntities(Manager28*);
|
||||
Entity* Manager28_FindMatchingEntity(EntityData*);
|
||||
void Manager28_RemoveDeletedEntities(Manager28*);
|
||||
|
||||
void (*const Manager28_ActionFuncs[])(Manager28*) = { Manager28_Init, Manager28_Main2 };
|
||||
|
||||
enum Manager28_Action { Init = 0, Main = 1 };
|
||||
|
||||
enum Manager28_InitState { DoInit = 0, DoNotInit = 1 };
|
||||
|
||||
void Manager28_Main(Manager28* this) {
|
||||
Manager28_ActionFuncs[this->manager.action](this);
|
||||
}
|
||||
|
||||
void Manager28_Init(Manager28* this) {
|
||||
if (this->manager.unk_0a == DoInit) {
|
||||
s32 tmp2;
|
||||
int tmp4;
|
||||
for (tmp4 = 0; tmp4 < 8; tmp4++) {
|
||||
this->d.enemies[tmp4] = 0;
|
||||
}
|
||||
tmp2 = Manager28_FindMatchingEntities(this);
|
||||
if (tmp2 > 1) {
|
||||
Manager28* tmp3 = (Manager28*)GetEmptyManager();
|
||||
if (tmp3) {
|
||||
tmp3->manager.type = 9;
|
||||
tmp3->manager.subtype = 0x28;
|
||||
tmp3->manager.unk_0a = DoNotInit;
|
||||
tmp3->manager.unk_0e = tmp2;
|
||||
/* for (tmp4 = 0; tmp4 < 8; tmp4++) { */
|
||||
/* tmp3->enemies[tmp4] = this->enemies[tmp4]; */
|
||||
/* } */
|
||||
tmp3->d = this->d;
|
||||
AppendEntityToList((Entity*)tmp3, 6);
|
||||
}
|
||||
}
|
||||
DeleteManager(&this->manager);
|
||||
} else {
|
||||
this->manager.action = Main;
|
||||
this->manager.unk_0f = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Manager28_Main2(Manager28* this) {
|
||||
s32 n;
|
||||
s32 i;
|
||||
s32 j;
|
||||
Entity* tmp;
|
||||
Manager28_RemoveDeletedEntities(this);
|
||||
n = this->manager.unk_0e - 1;
|
||||
if ((this->manager.unk_0f++) & 1) {
|
||||
for (i = 0; i < n; i++) {
|
||||
tmp = this->d.enemies[i];
|
||||
for (j = i + 1; j < this->manager.unk_0e; j++) {
|
||||
sub_08004484(tmp, this->d.enemies[j]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < n; i++) {
|
||||
tmp = this->d.enemies[i];
|
||||
for (j = i + 1; j < this->manager.unk_0e; j++) {
|
||||
sub_08004484(this->d.enemies[j], tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u32 Manager28_FindMatchingEntities(Manager28* this) {
|
||||
u32 re = 0;
|
||||
EntityData* tmp = GetCurrentRoomProperty(this->manager.unk_0b);
|
||||
if (!tmp)
|
||||
return 0;
|
||||
for (; *((u8*)tmp) != 0xFF && !((tmp->kind & 0xf) == 9 && tmp->id == 0x28); tmp++) {
|
||||
Entity* tmp2;
|
||||
u32 i;
|
||||
if ((tmp->kind & 0xf) != 3)
|
||||
continue;
|
||||
tmp2 = Manager28_FindMatchingEntity(tmp);
|
||||
if (!tmp2)
|
||||
continue;
|
||||
for (i = 0; i < re; i++) {
|
||||
if (this->d.enemies[i] == tmp2)
|
||||
break;
|
||||
}
|
||||
if (i != re)
|
||||
continue;
|
||||
this->d.enemies[re++] = tmp2;
|
||||
if (re == 8)
|
||||
return 8;
|
||||
}
|
||||
return re;
|
||||
}
|
||||
|
||||
Entity* Manager28_FindMatchingEntity(EntityData* unk1) {
|
||||
u32 x, y;
|
||||
Entity* i;
|
||||
LinkedList* tmp;
|
||||
x = unk1->xPos + gRoomControls.origin_x;
|
||||
y = unk1->yPos + gRoomControls.origin_y;
|
||||
tmp = &gEntityLists[4];
|
||||
for (i = tmp->first; (u32)i != (u32)tmp; i = i->next) {
|
||||
if (x == i->x.HALF.HI && y == i->y.HALF.HI && unk1->id == i->id && ENEMY == i->kind && unk1->type == i->type) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Manager28_RemoveDeletedEntities(Manager28* this) {
|
||||
s32 i;
|
||||
for (i = 0; i < this->manager.unk_0e; i++) {
|
||||
if (this->d.enemies[i]->next == 0) {
|
||||
if (this->manager.unk_0e - 1 == i) {
|
||||
this->d.enemies[i] = 0;
|
||||
} else {
|
||||
this->d.enemies[i] = this->d.enemies[this->manager.unk_0e - 1];
|
||||
}
|
||||
this->manager.unk_0e--;
|
||||
}
|
||||
}
|
||||
if (this->manager.unk_0e <= 1)
|
||||
DeleteThisEntity();
|
||||
}
|
||||
+11
-22
@@ -1,31 +1,20 @@
|
||||
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
/**
|
||||
* @file manager29.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Unused? Not yet encountered.
|
||||
*/
|
||||
#include "manager/manager29.h"
|
||||
#include "asm.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 unk_20[0x8];
|
||||
u16* unk_28;
|
||||
u16* unk_2c;
|
||||
u8 filler[0x4];
|
||||
u8 unk_34;
|
||||
u8 unk_35;
|
||||
u8 unk_36;
|
||||
u8 unk_37;
|
||||
s16 unk_38;
|
||||
u16 unk_3a;
|
||||
u16 unk_3c;
|
||||
u16 unk_3e;
|
||||
} Manager29;
|
||||
|
||||
bool32 sub_0805CF80(Manager29* this);
|
||||
void sub_0805CBD0(Manager29* this);
|
||||
void sub_0805CC3C(Manager29* this);
|
||||
|
||||
void Manager29_Main(Manager29* this) {
|
||||
if (this->manager.action == 0) {
|
||||
if (super->action == 0) {
|
||||
sub_0805CBD0(this);
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
sub_0805CC3C(this);
|
||||
@@ -40,7 +29,7 @@ void Manager29_Main(Manager29* this) {
|
||||
void sub_0805CBD0(Manager29* this) {
|
||||
LayerStruct* layer;
|
||||
|
||||
this->manager.action = 1;
|
||||
super->action = 1;
|
||||
this->unk_38 = (this->unk_38 >> 4 & 0x3fU) | (((this->unk_3a << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
this->unk_3a = (this->unk_3c >> 4 & 0x3f) | (((this->unk_36 + this->unk_37 * 0x100) >> 4 & 0x3fU) << 6);
|
||||
this->unk_3c = GetTileType(this->unk_38, this->unk_34);
|
||||
@@ -63,7 +52,7 @@ void sub_0805CC3C(Manager29* this) {
|
||||
uVar4 = 0x322;
|
||||
}
|
||||
|
||||
switch (this->manager.unk_0a) {
|
||||
switch (super->type) {
|
||||
default:
|
||||
sub_0807B7D8(uVar4, iVar3, this->unk_34);
|
||||
sub_0807B7D8(0x365, iVar2, this->unk_34);
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#include "asm.h"
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "flags.h"
|
||||
|
||||
typedef struct {
|
||||
u8 field_0x0;
|
||||
u8 tileLayer;
|
||||
u16 flag;
|
||||
u16 tilePos;
|
||||
u16 tileType; // If the tile type at tilePos, tileLayer is tileType, set the local flag.
|
||||
} Manager2A_unk; // TODO result of GetCurrentRoomProperty(3)?
|
||||
|
||||
void sub_0805CFF0(Manager2A_unk*);
|
||||
|
||||
void Manager2A_Main(Manager* manager) {
|
||||
Manager2A_unk* data;
|
||||
|
||||
if (manager->action == 0) {
|
||||
manager->action += 1;
|
||||
}
|
||||
data = (Manager2A_unk*)GetCurrentRoomProperty(3);
|
||||
if (data != NULL) {
|
||||
for (; data->field_0x0 != 0; data = data + 1) {
|
||||
if (data->field_0x0 == 10) {
|
||||
sub_0805CFF0(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805CFF0(Manager2A_unk* param_1) {
|
||||
if (CheckLocalFlag(param_1->flag) == 0) {
|
||||
u32 tileType = GetTileType(param_1->tilePos, param_1->tileLayer);
|
||||
if (param_1->tileType == tileType) {
|
||||
SetLocalFlag(param_1->flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
#include "manager.h"
|
||||
#include "asm.h"
|
||||
#include "functions.h"
|
||||
#include "common.h"
|
||||
|
||||
typedef struct {
|
||||
struct Manager manager;
|
||||
u8 field_0x20[0x16];
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
s16 field_0x38;
|
||||
s16 field_0x3a;
|
||||
u16 field_0x3c;
|
||||
u16 field_0x3e;
|
||||
} Manager2C;
|
||||
|
||||
void Manager2C_Main(Manager2C* manager) {
|
||||
if (manager->manager.action == 0) {
|
||||
manager->manager.action = 1;
|
||||
manager->field_0x3a = 0;
|
||||
}
|
||||
if (((CheckPlayerInRegion(manager->field_0x38, manager->field_0x3a, 0x14, 0x40) != 0) &&
|
||||
(((gPlayerEntity.y.HALF.HI - gRoomControls.origin_y) + gPlayerEntity.z.HALF.HI) < 0)) &&
|
||||
(gRoomControls.scroll_y == gRoomControls.origin_y)) {
|
||||
MemClear(&gRoomTransition.player_status, 0x20);
|
||||
gRoomTransition.transitioningOut = 1;
|
||||
gRoomTransition.type = TRANSITION_DEFAULT;
|
||||
gRoomTransition.player_status.spawn_type = PL_SPAWN_PARACHUTE_UP;
|
||||
gRoomTransition.player_status.area_next = manager->manager.unk_0b;
|
||||
gRoomTransition.player_status.room_next = manager->manager.unk_0e;
|
||||
gRoomTransition.player_status.start_anim = manager->field_0x37;
|
||||
gRoomTransition.player_status.start_pos_x = manager->field_0x3c;
|
||||
gRoomTransition.player_status.start_pos_y = manager->field_0x3e;
|
||||
gRoomTransition.player_status.layer = manager->field_0x36;
|
||||
}
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "sound.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 field_0x20[0x18];
|
||||
s16 field_0x38;
|
||||
u8 field_0x3a;
|
||||
u8 field_0x3b;
|
||||
u16 field_0x3c;
|
||||
u16 field_0x3e;
|
||||
} Manager2E;
|
||||
|
||||
void sub_0805D2F4(Manager2E*);
|
||||
void sub_0805D268(Manager2E*);
|
||||
void sub_0805D32C(Manager2E*);
|
||||
void sub_0805D280(Manager2E*);
|
||||
void sub_0805D2C0(Manager2E*);
|
||||
void sub_0805D2F4(Manager2E*);
|
||||
void sub_0805D384(Manager2E*);
|
||||
void sub_0805D36C(Manager2E*);
|
||||
void sub_0805D344(Manager2E*);
|
||||
|
||||
void Manager2E_Main(Manager2E* this) {
|
||||
static void (*const gUnk_08108D3C[])(Manager2E*) = {
|
||||
sub_0805D268,
|
||||
sub_0805D32C,
|
||||
};
|
||||
gUnk_08108D3C[this->manager.unk_0a](this);
|
||||
}
|
||||
|
||||
void sub_0805D268(Manager2E* this) {
|
||||
static void (*const actionFuncs[])(Manager2E*) = {
|
||||
sub_0805D280,
|
||||
sub_0805D2C0,
|
||||
sub_0805D2F4,
|
||||
};
|
||||
actionFuncs[this->manager.action](this);
|
||||
}
|
||||
|
||||
void sub_0805D280(Manager2E* this) {
|
||||
if (CheckFlags(this->field_0x3c) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
SetFlag(this->field_0x3c);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
this->manager.action = 1;
|
||||
if (this->manager.unk_0e == 0) {
|
||||
this->manager.unk_0e = 0x1e;
|
||||
}
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
}
|
||||
|
||||
void sub_0805D2C0(Manager2E* this) {
|
||||
if ((CheckFlags(this->field_0x3e) != 0) && (gPriorityHandler.priority_timer < 2)) {
|
||||
this->manager.action = 2;
|
||||
if (this->manager.unk_0e == 1) {
|
||||
sub_0805D2F4(this);
|
||||
}
|
||||
RequestPriorityDuration((Entity*)this, this->manager.unk_0e);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D2F4(Manager2E* this) {
|
||||
if (gPriorityHandler.priority_timer == 0) {
|
||||
if (this->field_0x38 != SFX_NONE) {
|
||||
SoundReq(this->field_0x38);
|
||||
} else {
|
||||
SoundReq(SFX_SECRET);
|
||||
}
|
||||
if (this->field_0x3c != 0) {
|
||||
SetFlag(this->field_0x3c);
|
||||
}
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D32C(Manager2E* this) {
|
||||
static void (*const actionFuncs[])(Manager2E*) = {
|
||||
sub_0805D344,
|
||||
sub_0805D36C,
|
||||
sub_0805D384,
|
||||
};
|
||||
actionFuncs[this->manager.action](this);
|
||||
}
|
||||
|
||||
void sub_0805D344(Manager2E* this) {
|
||||
CheckFlags(this->field_0x3e);
|
||||
this->manager.action = 1;
|
||||
if (this->manager.unk_0e == 0) {
|
||||
this->manager.unk_0e = 0x1e;
|
||||
}
|
||||
this->manager.unk_0f = this->manager.unk_0e;
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
}
|
||||
|
||||
void sub_0805D36C(Manager2E* this) {
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
this->manager.action = 2;
|
||||
this->manager.unk_0e = this->manager.unk_0f;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D384(Manager2E* this) {
|
||||
if (this->manager.unk_0e != 0) {
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
Sound sound;
|
||||
if (this->field_0x38 != SFX_NONE) {
|
||||
sound = this->field_0x38;
|
||||
} else {
|
||||
sound = SFX_SECRET;
|
||||
}
|
||||
SoundReq(sound);
|
||||
SetFlag(this->field_0x3c);
|
||||
}
|
||||
} else {
|
||||
if (CheckFlags(this->field_0x3e) == 0) {
|
||||
this->manager.action = 1;
|
||||
ClearFlag(this->field_0x3c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
#include "object.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 field_0x20[0x15];
|
||||
u8 field_0x35;
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
s16 field_0x38;
|
||||
s16 field_0x3a;
|
||||
u16 field_0x3c;
|
||||
u16 field_0x3e;
|
||||
} Manager35;
|
||||
|
||||
void sub_0805DC9C(Manager35*);
|
||||
void sub_0805DCC8(Manager35*);
|
||||
void sub_0805DD24(Manager35*);
|
||||
void sub_0805DD68(Manager35*);
|
||||
|
||||
void Manager35_Main(Manager35* this) {
|
||||
static void (*const actionFuncs[])(Manager35*) = {
|
||||
sub_0805DC9C,
|
||||
sub_0805DCC8,
|
||||
sub_0805DD24,
|
||||
sub_0805DD68,
|
||||
};
|
||||
actionFuncs[this->manager.action](this);
|
||||
}
|
||||
|
||||
void sub_0805DC9C(Manager35* this) {
|
||||
if (CheckFlags(this->field_0x3c) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
SetFlag(this->field_0x3c);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
this->manager.action = 1;
|
||||
}
|
||||
|
||||
void sub_0805DCC8(Manager35* this) {
|
||||
Entity* object;
|
||||
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
this->manager.action = 2;
|
||||
this->manager.unk_0e = this->field_0x35;
|
||||
if (this->manager.unk_0e == 0) {
|
||||
this->manager.unk_0e = 0x1e;
|
||||
}
|
||||
this->manager.parent = (Manager*)gRoomControls.camera_target;
|
||||
object = CreateObject(OBJECT_69, 0, 0);
|
||||
if (object != NULL) {
|
||||
object->x.HALF.HI = this->field_0x38 + gRoomControls.origin_x;
|
||||
object->y.HALF.HI = this->field_0x3a + gRoomControls.origin_y;
|
||||
*(Entity**)this->manager.unk_18 = object;
|
||||
gRoomControls.camera_target = object;
|
||||
RequestPriorityDuration(object, 0x1e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805DD24(Manager35* this) {
|
||||
RequestPriorityDuration(0, 8);
|
||||
if ((gRoomControls.scroll_flags & 4) == 0 && --this->manager.unk_0e == 0) {
|
||||
this->manager.action = 3;
|
||||
SetFlag(this->field_0x3c);
|
||||
if (this->field_0x36 == 0) {
|
||||
this->field_0x36 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805DD68(Manager35* this) {
|
||||
RequestPriorityDuration(0, 8);
|
||||
if (this->field_0x36 != 0) {
|
||||
if (--this->field_0x36 == 0) {
|
||||
gRoomControls.camera_target = (Entity*)this->manager.parent;
|
||||
}
|
||||
} else {
|
||||
if ((gRoomControls.scroll_flags & 4) == 0) {
|
||||
Entity* entity = *(Entity**)this->manager.unk_18;
|
||||
if (entity != NULL) {
|
||||
DeleteEntity(entity);
|
||||
}
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
#include "manager.h"
|
||||
#include "sound.h"
|
||||
#include "script.h"
|
||||
|
||||
typedef struct {
|
||||
u16 waitTime;
|
||||
u16 sound;
|
||||
} Manager36_unk;
|
||||
|
||||
// Repeatedly plays the same sound with a fixed wait time
|
||||
void Manager36_Main(Manager* manager) {
|
||||
static const Manager36_unk gUnk_08108DA8[] = {
|
||||
{ 0x10, SFX_ELEMENT_INFUSE }, { 0x20, SFX_1C8 }, { 0x20, SFX_1C8 }, { 0x40, SFX_1A9 }, { 0x20, SFX_21F }
|
||||
};
|
||||
const Manager36_unk* unk = &gUnk_08108DA8[manager->unk_0a];
|
||||
if (manager->action == 0) {
|
||||
manager->action += 1;
|
||||
manager->unk_0e = 0;
|
||||
}
|
||||
if (manager->unk_0e == 0) {
|
||||
manager->unk_0e = unk->waitTime;
|
||||
SoundReq(unk->sound);
|
||||
} else {
|
||||
manager->unk_0e -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
void CreateManager36(Entity* entity, ScriptExecutionContext* context) {
|
||||
Manager* manager = GetEmptyManager();
|
||||
if (manager != NULL) {
|
||||
manager->type = 9;
|
||||
manager->subtype = 0x36;
|
||||
manager->unk_0a = context->intVariable;
|
||||
AppendEntityToList((Entity*)manager, 6);
|
||||
SetDefaultPriority((Entity*)manager, PRIO_PLAYER_EVENT);
|
||||
}
|
||||
}
|
||||
|
||||
void DeleteManager36(Entity* entity, ScriptExecutionContext* context) {
|
||||
Entity* manager = FindEntity(MANAGER, 0x36, 6, context->intVariable, 0);
|
||||
if (manager != NULL) {
|
||||
DeleteEntityAny(manager);
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
#include "entity.h"
|
||||
#include "room.h"
|
||||
|
||||
void sub_0805E0C0(Entity*);
|
||||
void sub_0805E0F4(Entity*);
|
||||
|
||||
void Manager38_Main(Entity* this) {
|
||||
static void (*const actionFuncs[])(Entity*) = {
|
||||
sub_0805E0C0,
|
||||
sub_0805E0F4,
|
||||
};
|
||||
actionFuncs[this->action](this);
|
||||
}
|
||||
|
||||
void sub_0805E0C0(Entity* this) {
|
||||
EntityData* entityData;
|
||||
Entity* entity;
|
||||
|
||||
this->action = 1;
|
||||
this->timer = 0;
|
||||
entityData = (EntityData*)GetCurrentRoomProperty(this->type);
|
||||
if (entityData == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
while (*(u8*)entityData != 0xff) {
|
||||
entity = LoadRoomEntity(entityData++);
|
||||
entity->parent = this;
|
||||
entity->timer = 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805E0F4(Entity* this) {
|
||||
this->timer = 0;
|
||||
}
|
||||
@@ -1,199 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "asm.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "manager.h"
|
||||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
|
||||
void Manager4_Main(Manager*);
|
||||
void sub_0805786C(Manager*);
|
||||
void sub_08057920(Manager*);
|
||||
|
||||
void Manager4_Main(Manager* this) {
|
||||
static void (*const actionFuncs[])(Manager*) = {
|
||||
sub_0805786C,
|
||||
sub_08057920,
|
||||
};
|
||||
actionFuncs[this->action](this);
|
||||
}
|
||||
|
||||
extern void UpdateIsDiggingCave(void);
|
||||
|
||||
extern const DiggingCaveEntrance* sub_08057AA8(const DiggingCaveEntrance*, int);
|
||||
|
||||
void sub_0805786C(Manager* this) {
|
||||
const DiggingCaveEntrance* tmp;
|
||||
u8 room;
|
||||
u8 area;
|
||||
u16 uVar = 0x81 << 7;
|
||||
UpdateIsDiggingCave();
|
||||
if (gUnk_03004030.isDiggingCave != 0) {
|
||||
if (gUnk_03004030.unk_00 == 0) {
|
||||
gUnk_03004030.unk_0a = 0xFF;
|
||||
room = gRoomControls.room;
|
||||
tmp = diggingCaveEntrances[gRoomControls.area];
|
||||
tmp = sub_08057AA8(tmp, room);
|
||||
if (tmp != 0) {
|
||||
room = tmp->target_room;
|
||||
tmp = diggingCaveEntrances[tmp->target_area];
|
||||
tmp = sub_08057AA8(tmp, room);
|
||||
if (tmp != 0) {
|
||||
gUnk_03004030.unk_00 = tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
room = gRoomControls.room;
|
||||
tmp = diggingCaveEntrances[gRoomControls.area];
|
||||
uVar = 0x81 << 7;
|
||||
for (tmp = sub_08057AA8(tmp, room); tmp != 0; tmp = sub_08057AA8(tmp, room)) {
|
||||
SetTile(uVar, tmp->unk_00 + 0x3F, 1);
|
||||
SetTile(uVar, tmp->unk_00 + 0x40, 1);
|
||||
SetTile(uVar, tmp->unk_00 + 0x41, 1);
|
||||
tmp++;
|
||||
}
|
||||
}
|
||||
this->action = 1;
|
||||
}
|
||||
|
||||
extern u32 sub_0805795C(Manager*, const DiggingCaveEntrance*);
|
||||
|
||||
void sub_08057920(Manager* this) {
|
||||
const DiggingCaveEntrance* tmp;
|
||||
u8 room;
|
||||
room = gRoomControls.room;
|
||||
for (tmp = diggingCaveEntrances[gRoomControls.area];
|
||||
(tmp = sub_08057AA8(tmp, room)) != 0 && !sub_0805795C(this, tmp); tmp++)
|
||||
;
|
||||
}
|
||||
|
||||
void sub_08057A18(Manager*, const DiggingCaveEntrance*);
|
||||
|
||||
u32 sub_0805795C(Manager* this, const DiggingCaveEntrance* entr) {
|
||||
u16 offsetX, offsetY, offsetX2, offsetY2;
|
||||
u32 tmp, tmp2;
|
||||
if (gUnk_03004030.isDiggingCave) {
|
||||
offsetX = gPlayerEntity.x.HALF.HI - gRoomControls.origin_x;
|
||||
offsetY = gPlayerEntity.y.HALF.HI - gRoomControls.origin_y;
|
||||
offsetX2 = (entr->unk_00 & 0x3F) * 16 + 8;
|
||||
offsetY2 = ((entr->unk_00 & 0xFC0) >> 6) * 16 + 0x18;
|
||||
tmp = offsetX - offsetX2;
|
||||
if (tmp + 0x18 > 0x30 || offsetY - offsetY2 + 8 > 0x10U)
|
||||
return 0;
|
||||
if (offsetY < offsetY2 && tmp + 0xC <= 0x18)
|
||||
return 0;
|
||||
sub_08057A18(this, entr);
|
||||
return 1;
|
||||
} else {
|
||||
if (COORD_TO_TILE(&gPlayerEntity) != entr->unk_00)
|
||||
return 0;
|
||||
offsetY2 = gRoomControls.origin_y + ((entr->unk_00 >> 6) << 4) + 6;
|
||||
if (gPlayerEntity.y.HALF.HI >= offsetY2)
|
||||
return 0;
|
||||
sub_08057A18(this, entr);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
extern void sub_08080930(u32);
|
||||
|
||||
void sub_08057A18(Manager* this, const DiggingCaveEntrance* entr) {
|
||||
u16 tmp;
|
||||
SetInitializationPriority();
|
||||
gUnk_03004030.unk_0a = gUnk_03004030.unk_09;
|
||||
gUnk_03004030.unk_09 = gRoomControls.area;
|
||||
gRoomTransition.player_status.area_next = entr->target_area;
|
||||
gRoomTransition.player_status.room_next = entr->target_room;
|
||||
gRoomControls.area = entr->target_area;
|
||||
gRoomControls.room = entr->target_room;
|
||||
gUnk_03004030.unk_00 = entr;
|
||||
gUnk_03004030.unk_04 = gPlayerEntity.x.HALF.HI - gRoomControls.origin_x - ((entr->unk_00 & 0x3F) * 16);
|
||||
gUnk_03004030.unk_06 = gPlayerEntity.y.HALF.HI - gRoomControls.origin_y - ((entr->unk_00 & 0xFC0) >> 2);
|
||||
|
||||
#ifndef EU
|
||||
tmp = gUnk_03004030.isDiggingCave;
|
||||
if (!tmp) {
|
||||
if ((entr->target_room | 0x80) != gUnk_03004030.unk_0b) {
|
||||
gUnk_02034480.unk_00 = gUnk_03004030.isDiggingCave;
|
||||
}
|
||||
gUnk_03004030.unk_0b = entr->target_room | 0x80;
|
||||
}
|
||||
#endif
|
||||
|
||||
sub_08080930(entr->unk_03);
|
||||
DeleteManager(this);
|
||||
}
|
||||
|
||||
const DiggingCaveEntrance* sub_08057AA8(const DiggingCaveEntrance* entr, int room) {
|
||||
for (; entr->unk_00 != 0xFFFF; entr++) {
|
||||
if (entr->source_room == room)
|
||||
return entr;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const DiggingCaveEntrance gUnk_08107C78[] = { { -1, 0, 0, 0, 0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107C80[] = { { 0x4e5, 0x0, 0x0, 0xc, 0x0, 0xce5 },
|
||||
{ 0x3df, 0x0, 0x0, 0xc, 0x0, 0xbdf },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107C98[] = { { 0x2c3, 0x4, 0x4, 0x13, 0x0, 0x2c3 },
|
||||
{ 0x163, 0x5, 0x10, 0x19, 0x1, 0x448 },
|
||||
{ 0x385, 0x7, 0xa, 0x13, 0x3, 0x385 },
|
||||
{ 0x390, 0x7, 0xa, 0x13, 0x3, 0x390 },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107CC0[] = { { 0x62d, 0x0, 0x2, 0xf, 0x0, 0xa2d },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107CD0[] = { { 0x143, 0x1, 0x6, 0x14, 0x0, 0x643 },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107CE0[] = { { 0x95a, 0x0, 0x8, 0x16, 0x0, 0x95a },
|
||||
{ 0x9ce, 0x0, 0x8, 0x16, 0x0, 0x9ce },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107CF8[] = { { 0x670, 0x0, 0xc, 0x17, 0x0, 0x670 },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107D08[] = { { 0x15e, 0x0, 0xe, 0x19, 0x1, 0x46e },
|
||||
{ 0x79e, 0x0, 0x12, 0x19, 0x0, 0x248 },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107D20[] = { { 0xce5, 0x0, 0x1, 0x0, 0x0, 0x4e5 },
|
||||
{ 0xbdf, 0x0, 0x1, 0x0, 0x0, 0x3df },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107D38[] = { { 0xa2d, 0x0, 0x3, 0x2, 0x0, 0x62d },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107D48[] = { { 0x2c3, 0x0, 0x5, 0x3, 0x4, 0x2c3 },
|
||||
{ 0x385, 0x3, 0xb, 0x3, 0x7, 0x385 },
|
||||
{ 0x390, 0x3, 0xb, 0x3, 0x7, 0x390 },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107D68[] = { { 0x643, 0x0, 0x7, 0x6, 0x1, 0x143 },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107D78[] = { { 0x95a, 0x0, 0x9, 0xa, 0x0, 0x95a },
|
||||
{ 0x9ce, 0x0, 0x9, 0xa, 0x0, 0x9ce },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107D90[] = { { 0x670, 0x0, 0xd, 0x4, 0x0, 0x670 },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance gUnk_08107DA0[] = { { 0x46e, 0x1, 0xf, 0xb, 0x0, 0x15e },
|
||||
{ 0x448, 0x1, 0x11, 0x3, 0x5, 0x163 },
|
||||
{ 0x248, 0x0, 0x13, 0xb, 0x0, 0x79e },
|
||||
{ -0x1, 0x0, 0x0, 0x0, 0x0, 0x0 } };
|
||||
static const DiggingCaveEntrance* const diggingCaveEntrances[] = {
|
||||
gUnk_08107C80, gUnk_08107C78, gUnk_08107CC0, gUnk_08107C98, gUnk_08107CF8, gUnk_08107C78, gUnk_08107CD0,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107CE0, gUnk_08107D08, gUnk_08107D20, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107D38, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107D48, gUnk_08107D68,
|
||||
gUnk_08107C78, gUnk_08107D78, gUnk_08107D90, gUnk_08107C78, gUnk_08107DA0, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78, gUnk_08107C78,
|
||||
};
|
||||
@@ -1,110 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "sound.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 unk_20[0x08];
|
||||
u16 unk_28;
|
||||
u16 unk_2a;
|
||||
u16 unk_2c;
|
||||
u16 unk_2e;
|
||||
u16 unk_30;
|
||||
u16 unk_32;
|
||||
u8 unk_34[0x04];
|
||||
s16 unk_38;
|
||||
s16 unk_3a;
|
||||
u16 unk_3c;
|
||||
u16 unk_3e;
|
||||
} Manager5;
|
||||
|
||||
void sub_08057AE8(Manager5*);
|
||||
void sub_08057BA4(Manager5*);
|
||||
void sub_08057C28(Manager5*);
|
||||
|
||||
const u16 gUnk_08108024[] = { 0, -1, 1, 0, 0, 1, -1, 0 };
|
||||
const u16 gUnk_08108034[] = { 0, 1, -1, 0, 0, -1, 1, 0 };
|
||||
|
||||
void (*const gUnk_08108044[])(Manager5*) = { sub_08057AE8, sub_08057BA4, sub_08057C28 };
|
||||
|
||||
void Manager5_Main(Manager5* this) {
|
||||
gUnk_08108044[this->manager.action](this);
|
||||
}
|
||||
|
||||
void sub_08057CA4(Manager5*, u32, u32);
|
||||
|
||||
void sub_08057AE8(Manager5* this) {
|
||||
u32 tmp;
|
||||
tmp = (this->manager.unk_0b & 0x3) << 1;
|
||||
if (this->manager.unk_0e == 1) {
|
||||
this->unk_30 = 0x323;
|
||||
} else {
|
||||
this->unk_30 = tmp & 2 ? 0x37 : 0x36;
|
||||
}
|
||||
this->unk_28 = gUnk_08108024[tmp];
|
||||
this->unk_2a = gUnk_08108024[tmp + 1];
|
||||
this->unk_2c = gUnk_08108034[tmp];
|
||||
this->unk_2e = gUnk_08108034[tmp + 1];
|
||||
this->unk_32 = ((this->manager.unk_0b >> 2) & 0xF) + 1;
|
||||
this->manager.unk_0e = 0x1C;
|
||||
this->manager.unk_0f = 0;
|
||||
this->manager.action = (this->manager.unk_0b & 0x80) ? 2 : 1;
|
||||
if (this->manager.action != 2 || !CheckFlags(this->unk_3e))
|
||||
return;
|
||||
for (; this->unk_32; this->unk_32--) {
|
||||
sub_08057CA4(this, this->unk_28, this->unk_2a);
|
||||
sub_0807B7D8(this->unk_30, this->unk_38 | (this->unk_3a << 6), this->unk_3c);
|
||||
}
|
||||
DeleteManager(&this->manager);
|
||||
}
|
||||
|
||||
void sub_08057BA4(Manager5* this) {
|
||||
if (--this->manager.unk_0e)
|
||||
return;
|
||||
this->manager.unk_0e = 8;
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
if (this->unk_32 == this->manager.unk_0f)
|
||||
return;
|
||||
sub_08057CA4(this, this->unk_28, this->unk_2a);
|
||||
sub_0807B7D8(this->unk_30, this->unk_38 | (this->unk_3a << 6), this->unk_3c);
|
||||
this->manager.unk_0f++;
|
||||
SoundReq(SFX_HEART_GET);
|
||||
} else {
|
||||
if (!this->manager.unk_0f)
|
||||
return;
|
||||
RestorePrevTileEntity(this->unk_38 | (this->unk_3a << 6), this->unk_3c);
|
||||
sub_08057CA4(this, this->unk_2c, this->unk_2e);
|
||||
this->manager.unk_0f--;
|
||||
SoundReq(SFX_HEART_GET);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08057C28(Manager5* this) {
|
||||
if (!this->manager.unk_0d) {
|
||||
if (!CheckFlags(this->unk_3e))
|
||||
return;
|
||||
this->manager.unk_0d++;
|
||||
} else {
|
||||
if (--this->manager.unk_0e)
|
||||
return;
|
||||
this->manager.unk_0e = 8;
|
||||
if (this->unk_32 != this->manager.unk_0f) {
|
||||
sub_08057CA4(this, this->unk_28, this->unk_2a);
|
||||
sub_0807B7D8(this->unk_30, this->unk_38 | (this->unk_3a << 6), this->unk_3c);
|
||||
this->manager.unk_0f++;
|
||||
SoundReq(SFX_HEART_GET);
|
||||
} else {
|
||||
if (this->unk_30 != 0x323) {
|
||||
SoundReq(SFX_SECRET);
|
||||
}
|
||||
DeleteManager(&this->manager);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08057CA4(Manager5* this, u32 unk1, u32 unk2) {
|
||||
this->unk_38 += unk1;
|
||||
this->unk_3a += unk2;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "asm.h"
|
||||
#include "player.h"
|
||||
#include "manager.h"
|
||||
#include "functions.h"
|
||||
|
||||
void Manager6_Main(Manager6* this) {
|
||||
u32 tmp;
|
||||
Manager6WarpData* i;
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
this->warpList = GetCurrentRoomProperty(this->manager.unk_0a);
|
||||
if (!this->warpList) {
|
||||
DeleteManager(&this->manager);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this->manager.unk_0e == 0 || gPlayerState.floor_type == SURFACE_LADDER) {
|
||||
for (i = this->warpList; i->posX != 0xFFFF; i++) {
|
||||
tmp = (i->unk_07.all & 0x3);
|
||||
if (((tmp & (gPlayerEntity.collisionLayer)) != 0) &&
|
||||
(((gPlayerState.flags & PL_MINISH) != 0) || ((i->unk_07.b.unk2) != 0)) &&
|
||||
(CheckPlayerInRegion(i->posX, i->posY, i->width, i->height) != 0) && (gPlayerEntity.z.HALF.HI == 0)) {
|
||||
DoExitTransition(GetCurrentRoomProperty(i->unk_06));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
#include "functions.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 field_0x20;
|
||||
u8 field_0x21;
|
||||
u8 field_0x22;
|
||||
u8 field_0x23;
|
||||
u8 field_0x24;
|
||||
u8 field_0x25;
|
||||
u8 field_0x26;
|
||||
u8 field_0x27;
|
||||
u16 field_0x28;
|
||||
u8 field_0x2a;
|
||||
u8 field_0x2b;
|
||||
u8 field_0x2c;
|
||||
u8 field_0x2d;
|
||||
u8 field_0x2e;
|
||||
u8 field_0x2f;
|
||||
u16* field_0x30;
|
||||
u8 field_0x34;
|
||||
u8 field_0x35;
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
u16 field_0x38;
|
||||
u16 field_0x3a;
|
||||
u8 field_0x3c;
|
||||
u8 field_0x3d;
|
||||
u16 field_0x3e;
|
||||
} ManagerD;
|
||||
|
||||
void sub_08058DE8(ManagerD*);
|
||||
void sub_08058E18(ManagerD*);
|
||||
void sub_08058E34(ManagerD*);
|
||||
|
||||
void ManagerD_Main(ManagerD* this) {
|
||||
static void (*const actionFuncs[])(ManagerD*) = {
|
||||
sub_08058DE8,
|
||||
sub_08058E18,
|
||||
sub_08058E34,
|
||||
};
|
||||
actionFuncs[this->manager.action](this);
|
||||
}
|
||||
|
||||
void sub_08058DE8(ManagerD* this) {
|
||||
u16* puVar2;
|
||||
u16* puVar3;
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
DeleteThisEntity();
|
||||
} else {
|
||||
this->manager.action = 1;
|
||||
puVar2 = (u16*)GetLayerByIndex(this->field_0x3a);
|
||||
puVar3 = (this->field_0x38 + 2) + puVar2;
|
||||
this->field_0x30 = puVar3;
|
||||
this->field_0x28 = *puVar3;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08058E18(ManagerD* this) {
|
||||
if (this->field_0x28 != *this->field_0x30) {
|
||||
this->manager.action += 1;
|
||||
this->manager.unk_0e = 0xf;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08058E34(ManagerD* this) {
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
SetFlag(this->field_0x3e);
|
||||
if (this->manager.unk_0a != 0) {
|
||||
LoadRoomEntityList((EntityData*)GetCurrentRoomProperty(this->manager.unk_0a));
|
||||
}
|
||||
DeleteManager((Manager*)this);
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
#include "entity.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
#include "functions.h"
|
||||
|
||||
void ManagerE_Main(ManagerE* this) {
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
DeleteManager(&this->manager);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!CheckFlags(this->unk_3e))
|
||||
return;
|
||||
if (this->manager.unk_0b != 0) {
|
||||
this->manager.unk_0b = 0;
|
||||
SetPlayerControl(0xff);
|
||||
sub_08078B48();
|
||||
}
|
||||
if (this->unk_3a == 0) {
|
||||
if (this->unk_38 != 0) {
|
||||
SoundReq(this->unk_38);
|
||||
}
|
||||
LoadRoomEntityList(GetCurrentRoomProperty(this->manager.unk_0a));
|
||||
DeleteThisEntity();
|
||||
} else {
|
||||
this->unk_3a -= 1;
|
||||
}
|
||||
}
|
||||
@@ -1,47 +1,37 @@
|
||||
#include "global.h"
|
||||
#include "asm.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
/**
|
||||
* @file minishPortalManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Facilitates the usage of minish portals.
|
||||
*/
|
||||
#include "manager/minishPortalManager.h"
|
||||
#include "area.h"
|
||||
#include "room.h"
|
||||
#include "player.h"
|
||||
#include "sound.h"
|
||||
#include "object.h"
|
||||
#include "asm.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
|
||||
// Facilitates the usage of minish portals.
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u32 unk_20;
|
||||
u32 unk_24;
|
||||
u8 unk_28[0xC];
|
||||
u8 unk_34;
|
||||
u8 unk_35;
|
||||
u16 unk_36;
|
||||
u16 unk_38;
|
||||
u16 unk_3a;
|
||||
u16 unk_3c;
|
||||
u16 unk_3e;
|
||||
} Manager3;
|
||||
|
||||
extern u32 PortalReadyForMinish(void);
|
||||
extern u32 sub_080B1AC8(u16, u16, u8);
|
||||
|
||||
void Manager3_Main(Manager3* this) {
|
||||
bool32 PortalReadyForMinish(void);
|
||||
|
||||
void MinishPortalManager_Main(MinishPortalManager* this) {
|
||||
static const s8 gUnk_08107C6C[] = { -3, -3, -3, 0 };
|
||||
s8 tmp;
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
this->unk_20 = this->unk_38 + gRoomControls.origin_x - 0x20;
|
||||
this->unk_24 = this->unk_3a + gRoomControls.origin_y - 0x20;
|
||||
return;
|
||||
}
|
||||
if (CheckPlayerProximity(this->unk_20, this->unk_24, 0x40, 0x40)) {
|
||||
gArea.portal_x = this->unk_20 + 0x20;
|
||||
gArea.portal_y = this->unk_24 + 0x20 + gUnk_08107C6C[this->manager.unk_0a];
|
||||
gArea.portal_y = this->unk_24 + 0x20 + gUnk_08107C6C[super->type];
|
||||
gArea.portal_exit_dir = this->unk_34;
|
||||
gArea.portal_type = this->manager.unk_0a;
|
||||
gArea.portal_type = super->type;
|
||||
if (!CheckGlobalFlag(EZERO_1ST)) {
|
||||
gArea.portal_mode = 1;
|
||||
gArea.portal_type = 5;
|
||||
@@ -53,18 +43,18 @@ void Manager3_Main(Manager3* this) {
|
||||
gArea.portal_mode = 3;
|
||||
}
|
||||
}
|
||||
if (sub_080B1AC8(this->unk_38, this->unk_3a, this->manager.unk_0e) == 0x3d) {
|
||||
if (sub_080B1AC8(this->unk_38, this->unk_3a, super->timer) == 0x3d) {
|
||||
CreateMagicSparkles(this->unk_38 + gRoomControls.origin_x, this->unk_3a + gRoomControls.origin_y,
|
||||
this->manager.unk_0e);
|
||||
if (!this->manager.unk_0f) {
|
||||
this->manager.unk_0f = 1;
|
||||
super->timer);
|
||||
if (super->subtimer == 0) {
|
||||
super->subtimer = 1;
|
||||
SoundReq(SFX_NEAR_PORTAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
this->manager.unk_0f = 0;
|
||||
super->subtimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,14 +82,14 @@ void CreateMagicSparkles(u32 baseX, u32 baseY, u32 layer) {
|
||||
UpdateSpriteForCollisionLayer(spark);
|
||||
}
|
||||
|
||||
u32 PortalReadyForMinish(void) {
|
||||
bool32 PortalReadyForMinish(void) {
|
||||
if ((gPlayerState.flags & PL_MINISH) && !gPlayerState.field_0xaa && (gArea.portal_type != 0x6) &&
|
||||
(gPlayerState.heldObject == 0)) {
|
||||
switch (gPlayerState.framestate) {
|
||||
case PL_STATE_IDLE:
|
||||
case PL_STATE_WALK:
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1,41 +1,38 @@
|
||||
#include "global.h"
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
#include "functions.h"
|
||||
/**
|
||||
* @file minishRaftersBackgroundManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Parallax background for minish rafters
|
||||
*/
|
||||
#include "manager/minishRaftersBackgroundManager.h"
|
||||
#include "common.h"
|
||||
#include "functions.h"
|
||||
#include "room.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 unk_00[0x1C];
|
||||
u32 unk_3c;
|
||||
} Manager9;
|
||||
|
||||
void sub_08058204(Manager9*);
|
||||
void sub_08058210(Manager9*);
|
||||
void sub_08058204(MinishRaftersBackgroundManager*);
|
||||
void sub_08058210(MinishRaftersBackgroundManager*);
|
||||
u32 sub_08058244(int);
|
||||
void sub_080582A0(u32, u32*, u16*);
|
||||
void sub_080582F8(u8*, u8*);
|
||||
|
||||
extern u8 gMapDataTopSpecial[];
|
||||
extern u32 gUnk_02006F00[];
|
||||
|
||||
const u16 gUnk_081081EC[] = { 0x30, 0x30, 0x30, 0x38 };
|
||||
|
||||
void Manager9_Main(Manager9* this) {
|
||||
void MinishRaftersBackgroundManager_Main(MinishRaftersBackgroundManager* this) {
|
||||
sub_08058210(this);
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
gScreen.bg1.updated = 0;
|
||||
RegisterTransitionManager(this, sub_08058204, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08058204(Manager9* this) {
|
||||
sub_08058324(this->manager.unk_0a);
|
||||
void sub_08058204(MinishRaftersBackgroundManager* this) {
|
||||
sub_08058324(super->type);
|
||||
}
|
||||
|
||||
void sub_08058210(Manager9* this) {
|
||||
u32 tmp = sub_08058244(this->manager.unk_0a);
|
||||
void sub_08058210(MinishRaftersBackgroundManager* this) {
|
||||
u32 tmp = sub_08058244(super->type);
|
||||
if (this->unk_3c == tmp)
|
||||
return;
|
||||
this->unk_3c = tmp;
|
||||
@@ -44,6 +41,7 @@ void sub_08058210(Manager9* this) {
|
||||
}
|
||||
|
||||
u32 sub_08058244(int i) {
|
||||
static const u16 gUnk_081081EC[] = { 0x30, 0x30, 0x30, 0x38 };
|
||||
u32 tmp;
|
||||
s32 tmp2;
|
||||
u32 tmp3;
|
||||
@@ -65,8 +63,6 @@ void sub_080582A0(u32 unk, u32* unk2, u16* unk3) {
|
||||
}
|
||||
}
|
||||
|
||||
extern u8 gMapDataTopSpecial[];
|
||||
|
||||
void sub_080582D0(void) {
|
||||
u8* tmp = gMapDataTopSpecial;
|
||||
u8* tmp2 = tmp + 0x4000;
|
||||
@@ -84,7 +80,7 @@ void sub_080582F8(u8* unk, u8* unk2) {
|
||||
}
|
||||
|
||||
void sub_08058324(u32 unk) {
|
||||
gMapTop.bgControlPtr = 0;
|
||||
gMapTop.bgSettings = 0;
|
||||
LoadPaletteGroup(unk + 0x86);
|
||||
LoadGfxGroup(unk + 0x36);
|
||||
sub_080582D0();
|
||||
@@ -1,16 +1,17 @@
|
||||
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "object.h"
|
||||
/**
|
||||
* @file minishSizedEntranceManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Spawns MINISH_SIZED_ENTRANCE at the locations in the room property super->unk_0a when they are visible on the
|
||||
* screen.
|
||||
*/
|
||||
#include "manager/minishSizedEntranceManager.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
|
||||
extern bool32 CheckRectOnScreen(u16, u16, u32, u32);
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u32 field_0x20;
|
||||
} Manager21;
|
||||
|
||||
typedef struct {
|
||||
u16 x;
|
||||
u16 y;
|
||||
@@ -20,18 +21,14 @@ typedef struct {
|
||||
|
||||
bool32 sub_0805B8CC(u32);
|
||||
|
||||
/*
|
||||
Spawns MINISH_SIZED_ENTRANCE at the locations in the room property this->manager.unk_0a when they are visible on the
|
||||
screen.
|
||||
*/
|
||||
void Manager21_Main(Manager21* this) {
|
||||
void MinishSizedEntranceManager_Main(MinishSizedEntranceManager* this) {
|
||||
MinishEntranceSpawnData* spawnData;
|
||||
u32 count;
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
this->field_0x20 = 0;
|
||||
}
|
||||
spawnData = (MinishEntranceSpawnData*)GetCurrentRoomProperty(this->manager.unk_0a);
|
||||
spawnData = (MinishEntranceSpawnData*)GetCurrentRoomProperty(super->type);
|
||||
|
||||
for (count = 0; (spawnData->x != 0) && (count < 0x20); ++count) {
|
||||
if (CheckRectOnScreen(spawnData->x, spawnData->y, 4, 4) != 0) {
|
||||
@@ -1,20 +1,19 @@
|
||||
#include "manager.h"
|
||||
/**
|
||||
* @file minishVillageTilesetManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Swap tileset data in minish village depending on the position
|
||||
*/
|
||||
#include "manager/minishVillageTilesetManager.h"
|
||||
#include "asm.h"
|
||||
#include "functions.h"
|
||||
#include "common.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 unk_20;
|
||||
u8 unk_21[0x1F];
|
||||
} Manager7;
|
||||
#include "functions.h"
|
||||
#include "main.h"
|
||||
|
||||
void sub_08057E30(void*);
|
||||
u32 sub_08057E40(Manager7*);
|
||||
bool32 sub_08057E40(MinishVillageTilesetManager*);
|
||||
void sub_08057E7C(u32);
|
||||
|
||||
extern u32 CheckRegionsOnScreen(const u16*);
|
||||
|
||||
extern const u8 gGlobalGfxAndPalettes[];
|
||||
|
||||
const u16 gUnk_08108050[0x2A] = {
|
||||
@@ -55,13 +54,13 @@ const u32 gUnk_081080A4[0x50] = {
|
||||
const u8 gUnk_081081E4[] = { 0x16, 0x17, 0x17, 0x18, 0x18 };
|
||||
|
||||
#ifdef EU
|
||||
void Manager7_Main(Manager7* this) {
|
||||
void MinishVillageTilesetManager_Main(MinishVillageTilesetManager* this) {
|
||||
u32 tmp;
|
||||
const u32* tmp2;
|
||||
s32 tmp3;
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_0e = 8;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
super->timer = 8;
|
||||
this->unk_20 = 0xFF;
|
||||
|
||||
RegisterTransitionManager(this, sub_08057E30, 0);
|
||||
@@ -73,17 +72,17 @@ void Manager7_Main(Manager7* this) {
|
||||
tmp = (u32)gRoomVars.unk_10[0];
|
||||
if (this->unk_20 != tmp) {
|
||||
this->unk_20 = tmp;
|
||||
this->manager.unk_0e = 0;
|
||||
super->timer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
tmp2 = &gUnk_081080A4[tmp << 4];
|
||||
tmp3 = this->manager.unk_0e;
|
||||
tmp3 = super->timer;
|
||||
if (tmp3 == 0) {
|
||||
gPauseMenuOptions.disabled = 1;
|
||||
LoadResourceAsync(&gGlobalGfxAndPalettes[tmp2[0]], tmp2[1], 0x1000);
|
||||
LoadPaletteGroup(gUnk_081081E4[tmp]);
|
||||
this->manager.unk_0e++;
|
||||
super->timer++;
|
||||
} else {
|
||||
switch (tmp3) {
|
||||
case 0:
|
||||
@@ -94,9 +93,9 @@ void Manager7_Main(Manager7* this) {
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
LoadResourceAsync(&gGlobalGfxAndPalettes[tmp2[(this->manager.unk_0e << 1)]],
|
||||
tmp2[(this->manager.unk_0e << 1) + 1], 0x1000);
|
||||
this->manager.unk_0e++;
|
||||
LoadResourceAsync(&gGlobalGfxAndPalettes[tmp2[(super->timer << 1)]], tmp2[(super->timer << 1) + 1],
|
||||
0x1000);
|
||||
super->timer++;
|
||||
gPauseMenuOptions.disabled = 0;
|
||||
case 8:
|
||||
break;
|
||||
@@ -104,12 +103,12 @@ void Manager7_Main(Manager7* this) {
|
||||
}
|
||||
}
|
||||
#else
|
||||
void Manager7_Main(Manager7* this) {
|
||||
void MinishVillageTilesetManager_Main(MinishVillageTilesetManager* this) {
|
||||
u32 tmp;
|
||||
const u32* tmp2;
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_0e = 8;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
super->timer = 8;
|
||||
this->unk_20 = 0xFF;
|
||||
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
@@ -119,7 +118,7 @@ void Manager7_Main(Manager7* this) {
|
||||
tmp = (u32)gRoomVars.unk_10[0];
|
||||
if (this->unk_20 != tmp) {
|
||||
this->unk_20 = tmp;
|
||||
this->manager.unk_0e = 0;
|
||||
super->timer = 0;
|
||||
}
|
||||
}
|
||||
if (gRoomControls.reload_flags)
|
||||
@@ -128,12 +127,12 @@ void Manager7_Main(Manager7* this) {
|
||||
tmp = this->unk_20;
|
||||
#endif
|
||||
tmp2 = &gUnk_081080A4[tmp << 4];
|
||||
switch (this->manager.unk_0e) {
|
||||
switch (super->timer) {
|
||||
case 0:
|
||||
gPauseMenuOptions.disabled = 1;
|
||||
LoadResourceAsync(&gGlobalGfxAndPalettes[tmp2[0]], tmp2[1], 0x1000);
|
||||
LoadPaletteGroup(gUnk_081081E4[tmp]);
|
||||
this->manager.unk_0e++;
|
||||
super->timer++;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
@@ -142,13 +141,12 @@ void Manager7_Main(Manager7* this) {
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
LoadResourceAsync(&gGlobalGfxAndPalettes[tmp2[(this->manager.unk_0e << 1)]],
|
||||
tmp2[(this->manager.unk_0e << 1) + 1], 0x1000);
|
||||
this->manager.unk_0e++;
|
||||
LoadResourceAsync(&gGlobalGfxAndPalettes[tmp2[(super->timer << 1)]], tmp2[(super->timer << 1) + 1], 0x1000);
|
||||
super->timer++;
|
||||
break;
|
||||
case 8:
|
||||
gPauseMenuOptions.disabled = 0;
|
||||
this->manager.unk_0e++;
|
||||
super->timer++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -158,19 +156,18 @@ void sub_08057E30(void* this) {
|
||||
sub_08057E7C(gRoomVars.unk_10[0]);
|
||||
}
|
||||
|
||||
u32 sub_08057E40(Manager7* this) {
|
||||
bool32 sub_08057E40(MinishVillageTilesetManager* this) {
|
||||
u32 tmp = CheckRegionsOnScreen(gUnk_08108050);
|
||||
if (tmp != 0xFF) {
|
||||
gRoomVars.unk_10[0] = tmp;
|
||||
return 1;
|
||||
return TRUE;
|
||||
} else {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08057E64(void) {
|
||||
u32 tmp;
|
||||
tmp = CheckRegionsOnScreen(gUnk_08108050);
|
||||
u32 tmp = CheckRegionsOnScreen(gUnk_08108050);
|
||||
if (tmp != 0xFF) {
|
||||
sub_08057E7C(tmp);
|
||||
}
|
||||
@@ -1,58 +1,63 @@
|
||||
#include "global.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "sound.h"
|
||||
#include "room.h"
|
||||
#include "player.h"
|
||||
#include "functions.h"
|
||||
/**
|
||||
* @file miscManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Various different functionalities selected with paramA/unk_0a.
|
||||
*/
|
||||
#include "manager/miscManager.h"
|
||||
#include "area.h"
|
||||
#include "message.h"
|
||||
#include "common.h"
|
||||
#include "tiles.h"
|
||||
#include "object.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "message.h"
|
||||
#include "object.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void sub_08058EE4(ManagerF*);
|
||||
void sub_08058FB0(ManagerF*);
|
||||
void sub_08059094(ManagerF*);
|
||||
void sub_080590E0(ManagerF*);
|
||||
void sub_08059124(ManagerF*);
|
||||
void sub_080591CC(ManagerF*);
|
||||
void sub_08059220(ManagerF*);
|
||||
void sub_08059290(ManagerF*);
|
||||
void sub_080592A4(ManagerF*);
|
||||
void sub_08059368(ManagerF*);
|
||||
void sub_0805938C(ManagerF*);
|
||||
void sub_08059424(ManagerF*);
|
||||
void sub_0805947C(ManagerF*);
|
||||
void MiscManager_Type0(MiscManager*);
|
||||
void MiscManager_Type1(MiscManager*);
|
||||
void MiscManager_Type3(MiscManager*);
|
||||
void MiscManager_Type4(MiscManager*);
|
||||
void MiscManager_Type5(MiscManager*);
|
||||
void MiscManager_Type6(MiscManager*);
|
||||
void MiscManager_Type7(MiscManager*);
|
||||
void MiscManager_Type8(MiscManager*);
|
||||
void MiscManager_Type9(MiscManager*);
|
||||
void MiscManager_TypeA(MiscManager*);
|
||||
void MiscManager_TypeB(MiscManager*);
|
||||
void MiscManager_TypeC(MiscManager*);
|
||||
void MiscManager_TypeD(MiscManager*);
|
||||
#ifndef EU
|
||||
void sub_080594DC(ManagerF*);
|
||||
void MiscManager_TypeE(MiscManager*);
|
||||
#endif
|
||||
#if defined(USA) || defined(DEMO_USA) || defined(DEMO_JP)
|
||||
void sub_08059548(ManagerF*);
|
||||
void MiscManager_TypeF(MiscManager*);
|
||||
#endif
|
||||
|
||||
// clang-format off
|
||||
void (*const gUnk_08108314[])(ManagerF*) = {
|
||||
sub_08058EE4,
|
||||
sub_08058FB0,
|
||||
sub_08058FB0, // dup
|
||||
sub_08059094,
|
||||
sub_080590E0,
|
||||
sub_08059124,
|
||||
sub_080591CC,
|
||||
sub_08059220,
|
||||
sub_08059290,
|
||||
sub_080592A4,
|
||||
sub_08059368,
|
||||
sub_0805938C,
|
||||
sub_08059424,
|
||||
sub_0805947C,
|
||||
void (*const MiscManager_Types[])(MiscManager*) = {
|
||||
MiscManager_Type0,
|
||||
MiscManager_Type1,
|
||||
MiscManager_Type1, // dup
|
||||
MiscManager_Type3,
|
||||
MiscManager_Type4,
|
||||
MiscManager_Type5,
|
||||
MiscManager_Type6,
|
||||
MiscManager_Type7,
|
||||
MiscManager_Type8,
|
||||
MiscManager_Type9,
|
||||
MiscManager_TypeA,
|
||||
MiscManager_TypeB,
|
||||
MiscManager_TypeC,
|
||||
MiscManager_TypeD,
|
||||
#ifndef EU
|
||||
sub_080594DC,
|
||||
MiscManager_TypeE,
|
||||
#endif
|
||||
#if defined(USA) || defined(DEMO_USA) || defined(DEMO_JP)
|
||||
sub_08059548,
|
||||
MiscManager_TypeF,
|
||||
#endif
|
||||
};
|
||||
// clang-format on
|
||||
@@ -63,9 +68,9 @@ typedef struct {
|
||||
u16 width;
|
||||
u16 height;
|
||||
u16 unk_08;
|
||||
} PACKED __attribute__((aligned(2))) ManagerF_HelperStruct;
|
||||
} PACKED __attribute__((aligned(2))) MiscManager_HelperStruct;
|
||||
|
||||
const ManagerF_HelperStruct gUnk_08108354[] = {
|
||||
const MiscManager_HelperStruct gUnk_08108354[] = {
|
||||
{ 0xF0, 0xB0, 0xF0, 0xB0, 0x100 },
|
||||
{ 0x188, 0x190, 0x28, 0x30, 0x100 },
|
||||
{ 0xF0, 0x340, 0xF0, 0xB0, 0x80 },
|
||||
@@ -88,27 +93,27 @@ u16* const gUnk_08108380[] = {
|
||||
|
||||
void sub_08058F44(u32, u32, u32);
|
||||
void sub_08058F84(u32, u32);
|
||||
void sub_08059064(ManagerF*);
|
||||
void sub_080592EC(ManagerF*);
|
||||
void sub_0805930C(ManagerF*);
|
||||
u32 sub_080593CC(ManagerF*);
|
||||
void sub_08059064(MiscManager*);
|
||||
void sub_080592EC(MiscManager*);
|
||||
void sub_0805930C(MiscManager*);
|
||||
u32 sub_080593CC(MiscManager*);
|
||||
|
||||
// to be moved to headers
|
||||
extern EntityData gUnk_080F4B88[];
|
||||
|
||||
void sub_08058ECC(ManagerF* this) {
|
||||
gUnk_08108314[this->manager.unk_0a](this);
|
||||
void MiscManager_Main(MiscManager* this) {
|
||||
MiscManager_Types[super->type](this);
|
||||
}
|
||||
|
||||
void sub_08058EE4(ManagerF* this) {
|
||||
if (!this->manager.action)
|
||||
this->manager.action = 1;
|
||||
if (!CheckRoomFlag(this->manager.unk_0b))
|
||||
void MiscManager_Type0(MiscManager* this) {
|
||||
if (super->action == 0)
|
||||
super->action = 1;
|
||||
if (!CheckRoomFlag(super->type2))
|
||||
return;
|
||||
sub_08058F44(0x128, 0x68, this->manager.unk_0b + 1);
|
||||
sub_08058F44(0x158, 0x68, this->manager.unk_0b + 2);
|
||||
sub_08058F44(0x128, 0x98, this->manager.unk_0b + 3);
|
||||
sub_08058F44(0x158, 0x98, this->manager.unk_0b + 4);
|
||||
sub_08058F44(0x128, 0x68, super->type2 + 1);
|
||||
sub_08058F44(0x158, 0x68, super->type2 + 2);
|
||||
sub_08058F44(0x128, 0x98, super->type2 + 3);
|
||||
sub_08058F44(0x158, 0x98, super->type2 + 4);
|
||||
SoundReq(SFX_124);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -131,40 +136,40 @@ void sub_08058F84(u32 unk0, u32 unk1) {
|
||||
tmp->y.HALF.HI = gRoomControls.origin_y + unk1;
|
||||
}
|
||||
|
||||
void sub_08058FB0(ManagerF* this) {
|
||||
switch (this->manager.action) {
|
||||
void MiscManager_Type1(MiscManager* this) {
|
||||
switch (super->action) {
|
||||
case 0:
|
||||
this->manager.action = 1;
|
||||
if (this->manager.unk_0a == 1) {
|
||||
this->manager.unk_0d = 7;
|
||||
this->manager.unk_0f = 6;
|
||||
super->action = 1;
|
||||
if (super->type == 1) {
|
||||
super->subAction = 7;
|
||||
super->subtimer = 6;
|
||||
} else {
|
||||
this->manager.unk_0d = 8;
|
||||
this->manager.unk_0f = 2;
|
||||
super->subAction = 8;
|
||||
super->subtimer = 2;
|
||||
}
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
DeleteManager(&this->manager);
|
||||
DeleteManager(super);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
this->manager.action = 2;
|
||||
this->manager.unk_0e = 120;
|
||||
super->action = 2;
|
||||
super->timer = 120;
|
||||
RequestPriorityDuration((Entity*)this, 0xF0);
|
||||
sub_08059064(this);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (this->manager.unk_0e == 90) {
|
||||
if (super->timer == 90) {
|
||||
SetPlayerControl(2);
|
||||
PutAwayItems();
|
||||
}
|
||||
if (this->manager.unk_0e == 60) {
|
||||
gPlayerEntity.animationState = this->manager.unk_0f;
|
||||
if (super->timer == 60) {
|
||||
gPlayerEntity.animationState = super->subtimer;
|
||||
}
|
||||
if (!--this->manager.unk_0e) {
|
||||
this->manager.action = 3;
|
||||
MenuFadeIn(5, this->manager.unk_0d);
|
||||
if (!--super->timer) {
|
||||
super->action = 3;
|
||||
MenuFadeIn(5, super->subAction);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -174,7 +179,7 @@ void sub_08058FB0(ManagerF* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08059064(ManagerF* this) {
|
||||
void sub_08059064(MiscManager* this) {
|
||||
Entity* tmp;
|
||||
tmp = CreateObject(GROUND_ITEM, ITEM_SMALL_KEY, 0);
|
||||
if (!tmp)
|
||||
@@ -184,10 +189,10 @@ void sub_08059064(ManagerF* this) {
|
||||
tmp->y.HALF.HI = this->unk_3a + gRoomControls.origin_y;
|
||||
}
|
||||
|
||||
void sub_08059094(ManagerF* this) {
|
||||
void MiscManager_Type3(MiscManager* this) {
|
||||
u32 tmp = 0;
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
if (CheckLocalFlag(0x60)) {
|
||||
tmp = 1;
|
||||
} else {
|
||||
@@ -201,13 +206,13 @@ void sub_08059094(ManagerF* this) {
|
||||
}
|
||||
if (tmp) {
|
||||
LoadRoomEntityList(gUnk_080F4B88);
|
||||
DeleteManager(&this->manager);
|
||||
DeleteManager(super);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080590E0(ManagerF* this) {
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
void MiscManager_Type4(MiscManager* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
}
|
||||
if (CheckLocalFlag(0x6c)) {
|
||||
@@ -221,13 +226,12 @@ void sub_080590E0(ManagerF* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08059124(ManagerF* this) {
|
||||
switch (this->manager.action) {
|
||||
void MiscManager_Type5(MiscManager* this) {
|
||||
switch (super->action) {
|
||||
default:
|
||||
if (!--this->manager.unk_0e) {
|
||||
CreateDustAt(this->unk_38, this->unk_3a, this->manager.unk_0b);
|
||||
RestorePrevTileEntity(((this->unk_38 >> 4) & 0x3f) | ((this->unk_3a >> 4) & 0x3f) << 6,
|
||||
this->manager.unk_0b);
|
||||
if (!--super->timer) {
|
||||
CreateDustAt(this->unk_38, this->unk_3a, super->type2);
|
||||
RestorePrevTileEntity(((this->unk_38 >> 4) & 0x3f) | ((this->unk_3a >> 4) & 0x3f) << 6, super->type2);
|
||||
SoundReq(SFX_TASK_COMPLETE);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -236,31 +240,31 @@ void sub_08059124(ManagerF* this) {
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
this->manager.action = 1;
|
||||
SetTileType(0x365, ((this->unk_38 >> 4) & 0x3f) | ((this->unk_3a >> 4) & 0x3f) << 6, this->manager.unk_0b);
|
||||
super->action = 1;
|
||||
SetTileType(0x365, ((this->unk_38 >> 4) & 0x3f) | ((this->unk_3a >> 4) & 0x3f) << 6, super->type2);
|
||||
break;
|
||||
case 1:
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
RequestPriorityDuration((Entity*)this, 0x4b);
|
||||
this->manager.unk_0e = 0x2d;
|
||||
this->manager.action++;
|
||||
super->timer = 0x2d;
|
||||
super->action++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080591CC(ManagerF* this) {
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_0b = CheckFlags(this->unk_3e);
|
||||
if (this->manager.unk_0b) {
|
||||
void MiscManager_Type6(MiscManager* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
super->type2 = CheckFlags(this->unk_3e);
|
||||
if (super->type2) {
|
||||
gRoomVars.lightLevel = this->unk_3a;
|
||||
} else {
|
||||
gRoomVars.lightLevel = this->unk_38;
|
||||
}
|
||||
} else {
|
||||
u32 tmp = CheckFlags(this->unk_3e);
|
||||
if (this->manager.unk_0b != tmp) {
|
||||
this->manager.unk_0b = tmp;
|
||||
if (super->type2 != tmp) {
|
||||
super->type2 = tmp;
|
||||
if (tmp) {
|
||||
gRoomVars.lightLevel = this->unk_3a;
|
||||
} else {
|
||||
@@ -270,8 +274,8 @@ void sub_080591CC(ManagerF* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08059220(ManagerF* this) {
|
||||
const ManagerF_HelperStruct* data;
|
||||
void MiscManager_Type7(MiscManager* this) {
|
||||
const MiscManager_HelperStruct* data;
|
||||
gRoomVars.lightLevel = 0;
|
||||
|
||||
for (data = gUnk_08108354; data->x != 0xFFFF; data++) {
|
||||
@@ -279,28 +283,28 @@ void sub_08059220(ManagerF* this) {
|
||||
gRoomVars.lightLevel = data->unk_08;
|
||||
}
|
||||
}
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
gArea.lightLevel = gRoomVars.lightLevel;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08059278(void) {
|
||||
ManagerF* tmp;
|
||||
tmp = (ManagerF*)FindEntityByID(MANAGER, 0xF, 0x6);
|
||||
MiscManager* tmp;
|
||||
tmp = (MiscManager*)FindEntityByID(MANAGER, MISC_MANAGER, 0x6);
|
||||
if (tmp) {
|
||||
sub_08058ECC(tmp);
|
||||
MiscManager_Main(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08059290(ManagerF* this) {
|
||||
this->manager.action = 1;
|
||||
void MiscManager_Type8(MiscManager* this) {
|
||||
super->action = 1;
|
||||
gRoomControls.camera_target = &gPlayerEntity;
|
||||
}
|
||||
|
||||
void sub_080592A4(ManagerF* this) {
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
void MiscManager_Type9(MiscManager* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
sub_080592EC(this);
|
||||
DeleteThisEntity();
|
||||
@@ -317,11 +321,11 @@ void sub_080592A4(ManagerF* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080592EC(ManagerF* this) {
|
||||
void sub_080592EC(MiscManager* this) {
|
||||
SetDirtTile(((this->unk_38 >> 4) & 0x3F) | (((this->unk_3a >> 4) & 0x3F) << 6));
|
||||
}
|
||||
|
||||
void sub_0805930C(ManagerF* this) {
|
||||
void sub_0805930C(MiscManager* this) {
|
||||
Entity* tmp;
|
||||
#ifdef EU
|
||||
tmp = CreateObject(SPECIAL_FX, FX_BIG_EXPLOSION2, 0x0);
|
||||
@@ -341,25 +345,25 @@ void SetDirtTile(u32 tile) {
|
||||
SetTileType(0, tile - 0x40, 2);
|
||||
}
|
||||
|
||||
void sub_08059368(ManagerF* this) {
|
||||
this->manager.action = 1;
|
||||
void MiscManager_TypeA(MiscManager* this) {
|
||||
super->action = 1;
|
||||
if (this->unk_3c == gTextRender.curToken.textIndex) {
|
||||
SetFlag(this->unk_3e);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805938C(ManagerF* this) {
|
||||
void MiscManager_TypeB(MiscManager* this) {
|
||||
if (sub_080593CC(this)) {
|
||||
if (++this->manager.unk_0e >= 8) {
|
||||
if (++super->timer >= 8) {
|
||||
sub_080806BC(this->unk_38 - gRoomControls.origin_x, this->unk_3a - gRoomControls.origin_y, 0xFF, 0xA);
|
||||
}
|
||||
} else {
|
||||
this->manager.unk_0e = 0;
|
||||
super->timer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_080593CC(ManagerF* this) {
|
||||
u32 sub_080593CC(MiscManager* this) {
|
||||
if (!(gPlayerState.flags & PL_MINISH) && gPlayerState.swim_state != 0 && gPlayerEntity.animationState == 0 &&
|
||||
(gPlayerState.field_0x90 & 0xF00) == 0x400) {
|
||||
return EntityWithinDistance(&gPlayerEntity, this->unk_38, this->unk_3a + 0xC, 6);
|
||||
@@ -367,7 +371,7 @@ u32 sub_080593CC(ManagerF* this) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_08059424(ManagerF* this) {
|
||||
void MiscManager_TypeC(MiscManager* this) {
|
||||
Entity* tmp;
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
DeleteThisEntity();
|
||||
@@ -384,7 +388,7 @@ void sub_08059424(ManagerF* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
void sub_0805947C(ManagerF* this) {
|
||||
void MiscManager_TypeD(MiscManager* this) {
|
||||
if (!CheckFlags(this->unk_3e)) {
|
||||
SetPlayerControl(3);
|
||||
if (gRoomControls.reload_flags)
|
||||
@@ -399,17 +403,17 @@ void sub_0805947C(ManagerF* this) {
|
||||
}
|
||||
|
||||
#ifndef EU
|
||||
void sub_080594DC(ManagerF* this) {
|
||||
switch (this->manager.action) {
|
||||
void MiscManager_TypeE(MiscManager* this) {
|
||||
switch (super->action) {
|
||||
case 0:
|
||||
this->manager.action = 1;
|
||||
super->action = 1;
|
||||
// fall through
|
||||
case 1:
|
||||
if (!GetInventoryValue(ITEM_FOURSWORD))
|
||||
return;
|
||||
if (CheckLocalFlagByBank(FLAG_BANK_10, 0x85))
|
||||
return;
|
||||
this->manager.action = 2;
|
||||
super->action = 2;
|
||||
sub_080186C0(0xB0F);
|
||||
break;
|
||||
case 2:
|
||||
@@ -426,7 +430,7 @@ void sub_080594DC(ManagerF* this) {
|
||||
#endif
|
||||
|
||||
#if defined(USA) || defined(DEMO_USA) || defined(DEMO_JP)
|
||||
void sub_08059548(ManagerF* this) {
|
||||
void MiscManager_TypeF(MiscManager* this) {
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
if (gPlayerEntity.action == PLAYER_TALKEZLO) {
|
||||
DeleteThisEntity();
|
||||
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @file moveableObjectManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Create object at different place depending on if the flag is set.
|
||||
*
|
||||
* E.g. for pushable rock.
|
||||
*/
|
||||
#include "manager/moveableObjectManager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
|
||||
void MoveableObjectManager_Main(MoveableObjectManager* this) {
|
||||
Entity* object = CreateObject(super->timer, super->type, super->type2);
|
||||
if (!object)
|
||||
return;
|
||||
object->field_0x86.HWORD = this->flags;
|
||||
if (CheckFlags(this->flags)) {
|
||||
object->x.HALF.HI = this->unk_36 | (this->unk_37 & 0xF) << 8; // r1
|
||||
object->y.HALF.HI = this->unk_3c & 0xFFF;
|
||||
object->collisionLayer = this->unk_3c >> 0xC;
|
||||
} else {
|
||||
object->x.HALF.HI = this->unk_38;
|
||||
object->y.HALF.HI = this->unk_3a;
|
||||
object->collisionLayer = this->unk_37 >> 4;
|
||||
}
|
||||
object->x.HALF.HI += gRoomControls.origin_x;
|
||||
object->y.HALF.HI += gRoomControls.origin_y;
|
||||
DeleteManager(super);
|
||||
}
|
||||
@@ -1,19 +1,25 @@
|
||||
#include "manager.h"
|
||||
/**
|
||||
* @file powBackgroundManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Palace of Wind background animation.
|
||||
*/
|
||||
#include "manager/powBackgroundManager.h"
|
||||
#include "area.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
|
||||
void sub_0805AFFC(Manager*);
|
||||
void sub_0805AFFC(PowBackgroundManager*);
|
||||
|
||||
void Manager19_Main(Manager* this) {
|
||||
void PowBackgroundManager_Main(PowBackgroundManager* this) {
|
||||
if (this == NULL) {
|
||||
if ((void*)gArea.onEnter != sub_0805AFFC) {
|
||||
sub_0805AFFC(this);
|
||||
}
|
||||
} else {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->unk_10 |= 0x20;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
super->flags |= ENT_PERSIST;
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
if (gArea.onEnter == NULL) {
|
||||
RegisterTransitionManager(this, sub_0805AFFC, NULL);
|
||||
@@ -28,7 +34,7 @@ void Manager19_Main(Manager* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805AFFC(Manager* this) {
|
||||
void sub_0805AFFC(PowBackgroundManager* this) {
|
||||
gScreen.bg3.control = BGCNT_PRIORITY(3) | BGCNT_SCREENBASE(30);
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||
gScreen.bg3.xOffset = gRoomControls.scroll_x + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
* @file pushableFurnitureManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Creates pushable furniture based on a room property list.
|
||||
*/
|
||||
#include "manager/pushableFurnitureManager.h"
|
||||
#include "flags.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
|
||||
void PushableFurnitureManager_Init(PushableFurnitureManager*);
|
||||
void PushableFurnitureManager_Action1(PushableFurnitureManager*);
|
||||
void PushableFurnitureManager_Action2(PushableFurnitureManager*);
|
||||
|
||||
void sub_0805C7CC(PushableFurnitureManager*);
|
||||
|
||||
void PushableFurnitureManager_Main(PushableFurnitureManager* this) {
|
||||
static void (*const PushableFurnitureManager_Actions[])(PushableFurnitureManager*) = {
|
||||
PushableFurnitureManager_Init,
|
||||
PushableFurnitureManager_Action1,
|
||||
PushableFurnitureManager_Action2,
|
||||
};
|
||||
PushableFurnitureManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void PushableFurnitureManager_Init(PushableFurnitureManager* this) {
|
||||
UnkPushableFurnitureManagerHelperStruct* tmp = GetCurrentRoomProperty(super->type);
|
||||
if (!tmp) {
|
||||
DeleteManager(super);
|
||||
return;
|
||||
}
|
||||
this->unk_2a = gRoomControls.origin_y + super->timer;
|
||||
super->timer = 0;
|
||||
this->unk_28 = 0;
|
||||
this->unk_29 = 0;
|
||||
while (tmp->unk_00 != 0xFF && super->timer < 0x20) {
|
||||
Entity* obj;
|
||||
obj = CreateObject(PUSHABLE_FURNITURE, tmp->unk_01, tmp->unk_02);
|
||||
if (obj) {
|
||||
obj->timer = tmp->unk_03;
|
||||
obj->x.HALF.HI = gRoomControls.origin_x + tmp->unk_04;
|
||||
obj->y.HALF.HI = gRoomControls.origin_y + tmp->unk_06;
|
||||
obj->parent = (Entity*)this;
|
||||
obj->collisionLayer = 1;
|
||||
obj->field_0x82.HALF.HI = super->timer;
|
||||
obj->field_0x82.HALF.LO = tmp->unk_00;
|
||||
this->unk_29 |= 1 << super->timer;
|
||||
}
|
||||
tmp++;
|
||||
super->timer++;
|
||||
}
|
||||
if (super->type2 == 0xFF) {
|
||||
super->action = 2;
|
||||
} else {
|
||||
if (CheckLocalFlag(super->type2)) {
|
||||
super->action = 2;
|
||||
} else {
|
||||
super->action = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PushableFurnitureManager_Action1(PushableFurnitureManager* this) {
|
||||
if (this->unk_28 == this->unk_29) {
|
||||
super->action = 2;
|
||||
SetLocalFlag(super->type2);
|
||||
}
|
||||
sub_0805C7CC(this);
|
||||
}
|
||||
|
||||
void PushableFurnitureManager_Action2(PushableFurnitureManager* this) {
|
||||
sub_0805C7CC(this);
|
||||
}
|
||||
|
||||
void sub_0805C7CC(PushableFurnitureManager* this) {
|
||||
if (gPlayerState.flags & PL_MINISH) {
|
||||
if (gPlayerEntity.y.HALF.HI < this->unk_2a + 0x10) {
|
||||
super->subAction = 1;
|
||||
} else {
|
||||
super->subAction = 0;
|
||||
}
|
||||
} else {
|
||||
if (gPlayerEntity.y.HALF.HI < this->unk_2a + 0x28) {
|
||||
super->subAction = 3;
|
||||
} else {
|
||||
super->subAction = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* @file railIntersectionManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Change the rail next to the rotating rail so that it connects.
|
||||
*/
|
||||
#include "manager/railIntersectionManager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
|
||||
void sub_0805B778(RailIntersectionManager*);
|
||||
void RailIntersectionManager_Init(RailIntersectionManager*);
|
||||
void RailIntersectionManager_Action1(RailIntersectionManager*);
|
||||
|
||||
void RailIntersectionManager_Main(RailIntersectionManager* this) {
|
||||
static void (*const RailIntersectionManager_Actions[])(RailIntersectionManager*) = {
|
||||
RailIntersectionManager_Init,
|
||||
RailIntersectionManager_Action1,
|
||||
};
|
||||
RailIntersectionManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void RailIntersectionManager_Init(RailIntersectionManager* this) {
|
||||
if (CheckFlags(this->flags)) {
|
||||
super->type2 = 1;
|
||||
}
|
||||
super->action = 1;
|
||||
this->field_0x38 = (this->field_0x38 >> 4 & 0x3fU) | (((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
sub_0805B778(this);
|
||||
}
|
||||
|
||||
void RailIntersectionManager_Action1(RailIntersectionManager* this) {
|
||||
if (CheckFlags(this->flags)) {
|
||||
if (super->type2 == 0) {
|
||||
super->type2 = 1;
|
||||
sub_0805B778(this);
|
||||
}
|
||||
} else {
|
||||
if (super->type2 == 1) {
|
||||
super->type2 = 0;
|
||||
sub_0805B778(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805B778(RailIntersectionManager* this) {
|
||||
static const u16 gUnk_08108C9C[] = { 0x358, 0x359, 0x356, 0x35a, 0x35a, 0x357 };
|
||||
SetTileType(gUnk_08108C9C[super->type * 2 + super->type2], this->field_0x38, this->field_0x36);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @file rainfallManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Rainfall on the crenel minish path.
|
||||
*/
|
||||
#include "manager/rainfallManager.h"
|
||||
#include "asm.h"
|
||||
#include "room.h"
|
||||
#include "enemy.h"
|
||||
|
||||
void RainfallManager_Init(RainfallManager*);
|
||||
void RainfallManager_Action1(RainfallManager*);
|
||||
|
||||
void RainfallManager_Main(RainfallManager* this) {
|
||||
static void (*const RainfallManager_Actions[])(RainfallManager*) = {
|
||||
RainfallManager_Init,
|
||||
RainfallManager_Action1,
|
||||
};
|
||||
RainfallManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
// Initial setup
|
||||
void RainfallManager_Init(RainfallManager* this) {
|
||||
super->action = 1;
|
||||
super->timer = 1;
|
||||
}
|
||||
|
||||
// Spawn water drops every 0xf frames
|
||||
void RainfallManager_Action1(RainfallManager* this) {
|
||||
static const s16 gUnk_08108C6C[] = { -0x64, -0x3c, -0x14, 0x14, 0x3c, 0x64, 0x8c, 0xb4 };
|
||||
static const s8 gUnk_08108C7C[] = { -0x32, -0x19, 0x0, 0x19 };
|
||||
|
||||
if (--super->timer == 0) {
|
||||
Entity* waterDrop;
|
||||
super->timer = 0xf;
|
||||
waterDrop = CreateEnemy(WATER_DROP, 0);
|
||||
if (waterDrop != NULL) {
|
||||
waterDrop->x.HALF.HI = gRoomControls.scroll_x + 0x78 + gUnk_08108C6C[Random() & 7];
|
||||
waterDrop->y.HALF.HI = gRoomControls.scroll_y + 0x50 + gUnk_08108C7C[Random() & 3];
|
||||
waterDrop->z.HALF.HI = 0xff38;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* @file regionTriggerManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Set a flag if the player moves into a region.
|
||||
*/
|
||||
#include "manager/regionTriggerManager.h"
|
||||
#include "asm.h"
|
||||
#include "flags.h"
|
||||
|
||||
enum RegionTriggerManager_State { Init, ObserveRegion };
|
||||
|
||||
void RegionTriggerManager_Init(RegionTriggerManager*);
|
||||
void RegionTriggerManager_ObserveRegion(RegionTriggerManager*);
|
||||
|
||||
void RegionTriggerManager_Main(RegionTriggerManager* this) {
|
||||
static void (*const RegionTriggerManager_Actions[2])(RegionTriggerManager*) = {
|
||||
RegionTriggerManager_Init,
|
||||
RegionTriggerManager_ObserveRegion,
|
||||
};
|
||||
RegionTriggerManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void RegionTriggerManager_Init(RegionTriggerManager* this) {
|
||||
super->action = ObserveRegion;
|
||||
this->radiusX >>= 1;
|
||||
this->posX += this->radiusX;
|
||||
this->radiusY >>= 1;
|
||||
this->posY += this->radiusY;
|
||||
if (!super->type) {
|
||||
if (CheckFlags(this->playerInRegionFlag)) {
|
||||
DeleteManager(super);
|
||||
return;
|
||||
}
|
||||
}
|
||||
RegionTriggerManager_ObserveRegion(this);
|
||||
}
|
||||
|
||||
void RegionTriggerManager_ObserveRegion(RegionTriggerManager* this) {
|
||||
if (CheckPlayerInRegion(this->posX, this->posY, this->radiusX, this->radiusY)) {
|
||||
SetFlag(this->playerInRegionFlag);
|
||||
if (!super->type) {
|
||||
DeleteManager(super);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
ClearFlag(this->playerInRegionFlag);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* @file repeatedSoundManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Repeatedly plays the same sound with a fixed wait time.
|
||||
*/
|
||||
#include "manager/repeatedSoundManager.h"
|
||||
#include "script.h"
|
||||
#include "sound.h"
|
||||
|
||||
typedef struct {
|
||||
u16 waitTime;
|
||||
u16 sound;
|
||||
} RepeatedSoundManager_unk;
|
||||
|
||||
void RepeatedSoundManager_Main(RepeatedSoundManager* this) {
|
||||
static const RepeatedSoundManager_unk gUnk_08108DA8[] = {
|
||||
{ 0x10, SFX_ELEMENT_INFUSE }, { 0x20, SFX_1C8 }, { 0x20, SFX_1C8 }, { 0x40, SFX_1A9 }, { 0x20, SFX_21F }
|
||||
};
|
||||
const RepeatedSoundManager_unk* unk = &gUnk_08108DA8[super->type];
|
||||
if (super->action == 0) {
|
||||
super->action++;
|
||||
super->timer = 0;
|
||||
}
|
||||
if (super->timer == 0) {
|
||||
super->timer = unk->waitTime;
|
||||
SoundReq(unk->sound);
|
||||
} else {
|
||||
super->timer--;
|
||||
}
|
||||
}
|
||||
|
||||
void CreateRepeatedSoundManager(Entity* entity, ScriptExecutionContext* context) {
|
||||
Manager* manager = GetEmptyManager();
|
||||
if (manager != NULL) {
|
||||
manager->kind = MANAGER;
|
||||
manager->id = REPEATED_SOUND_MANAGER;
|
||||
manager->type = context->intVariable;
|
||||
AppendEntityToList((Entity*)manager, 6);
|
||||
SetDefaultPriority((Entity*)manager, PRIO_PLAYER_EVENT);
|
||||
}
|
||||
}
|
||||
|
||||
void DeleteRepeatedSoundManager(Entity* entity, ScriptExecutionContext* context) {
|
||||
Entity* manager = FindEntity(MANAGER, REPEATED_SOUND_MANAGER, 6, context->intVariable, 0);
|
||||
if (manager != NULL) {
|
||||
DeleteEntityAny(manager);
|
||||
}
|
||||
}
|
||||
@@ -1,53 +1,21 @@
|
||||
#include "global.h"
|
||||
#include "sound.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "structures.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
#include "physics.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
/**
|
||||
* @file rollingBarrelManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Rolling barrel in Deepwood Shrine
|
||||
*/
|
||||
#include "manager/rollingBarrelManager.h"
|
||||
#include "area.h"
|
||||
#include "common.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
s32 unk_20;
|
||||
union SplitWord unk_24;
|
||||
u32 unk_28;
|
||||
u32 unk_2c;
|
||||
u8 unk_30[0x10];
|
||||
} ManagerC;
|
||||
|
||||
typedef struct {
|
||||
u16 unk_0;
|
||||
u16 unk_2;
|
||||
u16 unk_4;
|
||||
u16 unk_6;
|
||||
} struct_08108228;
|
||||
|
||||
void sub_08058D34(void);
|
||||
|
||||
void (*const gUnk_0810821C[])(ManagerC*);
|
||||
const struct_08108228 gUnk_08108228[6];
|
||||
const struct_08108228 gUnk_08108258[6];
|
||||
const struct_08108228 gUnk_08108288[6];
|
||||
const struct_08108228 gUnk_081082B8[6];
|
||||
const u16 gUnk_081082E8[0xC];
|
||||
const u16 gUnk_08108300[4];
|
||||
|
||||
void sub_08058BC8(ManagerC*);
|
||||
void sub_08058CB0(ManagerC*);
|
||||
void sub_08058CFC(void);
|
||||
void sub_08058A04(ManagerC*);
|
||||
void sub_080588F8(ManagerC*);
|
||||
u32 sub_08058B08(ManagerC*, u32, u32, const struct_08108228*);
|
||||
void sub_08058B5C(ManagerC*, u32);
|
||||
|
||||
extern void sub_0805622C(struct BgAffineDstData*, u32, u32);
|
||||
|
||||
extern u8 gUnk_03003DE4[0xC];
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "main.h"
|
||||
#include "physics.h"
|
||||
#include "room.h"
|
||||
#include "save.h"
|
||||
#include "screen.h"
|
||||
#include "sound.h"
|
||||
#include "structures.h"
|
||||
|
||||
extern struct BgAffineDstData gUnk_02017AA0[];
|
||||
extern struct BgAffineDstData gUnk_02017BA0[];
|
||||
@@ -55,43 +23,54 @@ extern u8 gUnk_02017700[];
|
||||
extern u8 gUpdateVisibleTiles;
|
||||
extern u32 gUsedPalettes;
|
||||
|
||||
void sub_08058894(ManagerC*);
|
||||
void sub_080588CC(ManagerC*);
|
||||
void nullsub_108(ManagerC*);
|
||||
void sub_08058D34(void);
|
||||
void sub_08058BC8(RollingBarrelManager*);
|
||||
void sub_08058CB0(RollingBarrelManager*);
|
||||
void sub_08058CFC(void);
|
||||
void sub_08058A04(RollingBarrelManager*);
|
||||
void sub_080588F8(RollingBarrelManager*);
|
||||
u32 sub_08058B08(RollingBarrelManager*, u32, u32, const struct_08108228*);
|
||||
void sub_08058B5C(RollingBarrelManager*, u32);
|
||||
void RollingBarrelManager_Init(RollingBarrelManager*);
|
||||
void RollingBarrelManager_Action1(RollingBarrelManager*);
|
||||
void RollingBarrelManager_Action2(RollingBarrelManager*);
|
||||
|
||||
void (*const gUnk_0810821C[])(ManagerC*) = { sub_08058894, sub_080588CC, nullsub_108 };
|
||||
|
||||
void ManagerC_Main(ManagerC* this) {
|
||||
void RollingBarrelManager_Main(RollingBarrelManager* this) {
|
||||
static void (*const RollingBarrelManager_Actions[])(RollingBarrelManager*) = {
|
||||
RollingBarrelManager_Init,
|
||||
RollingBarrelManager_Action1,
|
||||
RollingBarrelManager_Action2,
|
||||
};
|
||||
u32 tmp;
|
||||
gUnk_0810821C[this->manager.action](this);
|
||||
RollingBarrelManager_Actions[super->action](this);
|
||||
sub_08058BC8(this);
|
||||
sub_0805622C(&gUnk_02017AA0[gUnk_03003DE4[0] * 0xA0], 0x04000020, 0xA2600008);
|
||||
}
|
||||
void sub_08058894(ManagerC* this) {
|
||||
this->manager.action = 1;
|
||||
void RollingBarrelManager_Init(RollingBarrelManager* this) {
|
||||
super->action = 1;
|
||||
this->unk_28 = 0x1234;
|
||||
this->manager.unk_0e = CheckLocalFlags(0x15, 0x2) != 0;
|
||||
super->timer = CheckLocalFlags(0x15, 0x2) != 0;
|
||||
sub_08058CB0(this);
|
||||
RegisterTransitionManager(this, sub_08058D34, 0);
|
||||
}
|
||||
|
||||
void sub_080588CC(ManagerC* this) {
|
||||
void RollingBarrelManager_Action1(RollingBarrelManager* this) {
|
||||
sub_08058CFC();
|
||||
sub_08058A04(this);
|
||||
if (gRoomTransition.transitioningOut) {
|
||||
this->manager.action = 2;
|
||||
super->action = 2;
|
||||
} else {
|
||||
sub_080588F8(this);
|
||||
}
|
||||
}
|
||||
|
||||
void nullsub_108(ManagerC* this) {
|
||||
void RollingBarrelManager_Action2(RollingBarrelManager* this) {
|
||||
}
|
||||
|
||||
#define ABS_DIFF_GT(a, b, c) ((signed)(a) - (b) >= 0 ? (a) - (b) > (c) : (b) - (a) > (c))
|
||||
|
||||
void sub_080588F8(ManagerC* this) {
|
||||
if (this->manager.unk_0f == 0) {
|
||||
void sub_080588F8(RollingBarrelManager* this) {
|
||||
if (super->subtimer == 0) {
|
||||
if (ABS_DIFF_GT(this->unk_28, this->unk_24.HALF.HI, 8)) {
|
||||
this->unk_28 = 0x1234;
|
||||
switch (this->unk_24.HALF.HI & 0xFFFE) {
|
||||
@@ -99,23 +78,23 @@ void sub_080588F8(ManagerC* this) {
|
||||
case 0xa0:
|
||||
case 0xf0:
|
||||
this->unk_28 = this->unk_24.HALF.HI;
|
||||
this->manager.unk_0f = 0x2D;
|
||||
super->subtimer = 0x2D;
|
||||
SoundReq(SFX_BARREL_ROLL_STOP);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->manager.unk_0f--;
|
||||
if (this->manager.unk_0f > 0x29) {
|
||||
super->subtimer--;
|
||||
if (super->subtimer > 0x29) {
|
||||
this->unk_24.HALF.HI = this->unk_28 - 2;
|
||||
} else {
|
||||
this->unk_24.HALF.HI = this->unk_28;
|
||||
}
|
||||
}
|
||||
if (this->manager.unk_0e) {
|
||||
if (super->timer) {
|
||||
s32 tmp = gPlayerEntity.y.HALF.HI - gRoomControls.origin_y;
|
||||
u32 tmp2;
|
||||
tmp2 = (((unsigned)(tmp - 0x50 < 0 ? 0x50 - tmp : tmp - 0x50) >> 3) * 0x3000) + 0x4000;
|
||||
if (this->manager.unk_0f == 0) {
|
||||
if (super->subtimer == 0) {
|
||||
if (tmp < 0x49) {
|
||||
this->unk_24.WORD -= tmp2;
|
||||
} else if (tmp > 0x57) {
|
||||
@@ -136,23 +115,23 @@ void sub_080588F8(ManagerC* this) {
|
||||
}
|
||||
}
|
||||
|
||||
const struct_08108228 gUnk_08108228[6] = { { 0x40, 0x2A, 0x1C, 0x10 }, { 0x3C, 0x24, 0x1C, 0x12 },
|
||||
{ 0x3C, 0x1C, 0x1A, 0x18 }, { 0x38, 0x16, 0x1C, 0x16 },
|
||||
{ 0x34, 0x16, 0x1E, 0x0E }, { 0x30, 0x16, 0x20, 0x0A } };
|
||||
void sub_08058A04(RollingBarrelManager* this) {
|
||||
static const struct_08108228 gUnk_08108228[6] = { { 0x40, 0x2A, 0x1C, 0x10 }, { 0x3C, 0x24, 0x1C, 0x12 },
|
||||
{ 0x3C, 0x1C, 0x1A, 0x18 }, { 0x38, 0x16, 0x1C, 0x16 },
|
||||
{ 0x34, 0x16, 0x1E, 0x0E }, { 0x30, 0x16, 0x20, 0x0A } };
|
||||
|
||||
const struct_08108228 gUnk_08108258[6] = { { 0x30, 0x88, 0x20, 0x0A }, { 0x34, 0x7E, 0x1E, 0x12 },
|
||||
{ 0x38, 0x78, 0x1A, 0x16 }, { 0x3A, 0x70, 0x1A, 0x18 },
|
||||
{ 0x3C, 0x64, 0x1E, 0x1E }, { 0x3E, 0x6A, 0x1C, 0x10 } };
|
||||
static const struct_08108228 gUnk_08108258[6] = { { 0x30, 0x88, 0x20, 0x0A }, { 0x34, 0x7E, 0x1E, 0x12 },
|
||||
{ 0x38, 0x78, 0x1A, 0x16 }, { 0x3A, 0x70, 0x1A, 0x18 },
|
||||
{ 0x3C, 0x64, 0x1E, 0x1E }, { 0x3E, 0x6A, 0x1C, 0x10 } };
|
||||
|
||||
const struct_08108228 gUnk_08108288[6] = { { 0x98, 0x2A, 0x1C, 0x10 }, { 0x98, 0x24, 0x1C, 0x12 },
|
||||
{ 0x9C, 0x1C, 0x1A, 0x18 }, { 0x9C, 0x16, 0x1C, 0x16 },
|
||||
{ 0xA0, 0x16, 0x1E, 0x0E }, { 0xA0, 0x16, 0x20, 0x0A } };
|
||||
static const struct_08108228 gUnk_08108288[6] = { { 0x98, 0x2A, 0x1C, 0x10 }, { 0x98, 0x24, 0x1C, 0x12 },
|
||||
{ 0x9C, 0x1C, 0x1A, 0x18 }, { 0x9C, 0x16, 0x1C, 0x16 },
|
||||
{ 0xA0, 0x16, 0x1E, 0x0E }, { 0xA0, 0x16, 0x20, 0x0A } };
|
||||
|
||||
const struct_08108228 gUnk_081082B8[6] = { { 0xA0, 0x88, 0x20, 0x0A }, { 0x9E, 0x7E, 0x1E, 0x12 },
|
||||
{ 0x9C, 0x78, 0x1A, 0x16 }, { 0x9A, 0x70, 0x1A, 0x18 },
|
||||
{ 0x98, 0x64, 0x1E, 0x1E }, { 0x98, 0x6A, 0x1C, 0x10 } };
|
||||
static const struct_08108228 gUnk_081082B8[6] = { { 0xA0, 0x88, 0x20, 0x0A }, { 0x9E, 0x7E, 0x1E, 0x12 },
|
||||
{ 0x9C, 0x78, 0x1A, 0x16 }, { 0x9A, 0x70, 0x1A, 0x18 },
|
||||
{ 0x98, 0x64, 0x1E, 0x1E }, { 0x98, 0x6A, 0x1C, 0x10 } };
|
||||
|
||||
void sub_08058A04(ManagerC* this) {
|
||||
s32 tmp = gPlayerEntity.x.HALF.HI - gRoomControls.origin_x;
|
||||
s32 tmp2 = gPlayerEntity.y.HALF.HI - gRoomControls.origin_y;
|
||||
if ((this->unk_20 - 0x118 < 0xDu) && CheckGlobalFlag(LV1TARU_OPEN) && (tmp - 0x6d < 0x17u) &&
|
||||
@@ -186,7 +165,7 @@ void sub_08058A04(ManagerC* this) {
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_08058B08(ManagerC* this, u32 unk1, u32 unk2, const struct_08108228* unk3) {
|
||||
u32 sub_08058B08(RollingBarrelManager* this, u32 unk1, u32 unk2, const struct_08108228* unk3) {
|
||||
u32 tmp = this->unk_20;
|
||||
if (tmp < unk1 || tmp > unk2) {
|
||||
return 0;
|
||||
@@ -201,9 +180,8 @@ u32 sub_08058B08(ManagerC* this, u32 unk1, u32 unk2, const struct_08108228* unk3
|
||||
}
|
||||
}
|
||||
|
||||
const u16 gUnk_081082E8[0xC] = { 0xB8, 0x80, 0x0, 0xB8, 0x110, 0x2, 0x118, 0x80, 0x2, 0x118, 0x110, 0x0 };
|
||||
|
||||
void sub_08058B5C(ManagerC* this, u32 unk1) {
|
||||
void sub_08058B5C(RollingBarrelManager* this, u32 unk1) {
|
||||
static const u16 gUnk_081082E8[0xC] = { 0xB8, 0x80, 0x0, 0xB8, 0x110, 0x2, 0x118, 0x80, 0x2, 0x118, 0x110, 0x0 };
|
||||
gRoomTransition.transitioningOut = 1;
|
||||
gRoomTransition.type = TRANSITION_DEFAULT;
|
||||
gRoomTransition.player_status.spawn_type = PL_SPAWN_STEP_IN;
|
||||
@@ -216,7 +194,7 @@ void sub_08058B5C(ManagerC* this, u32 unk1) {
|
||||
SoundReq(SFX_STAIRS);
|
||||
}
|
||||
|
||||
void sub_08058BC8(ManagerC* this) {
|
||||
void sub_08058BC8(RollingBarrelManager* this) {
|
||||
struct BgAffineDstData* tmp = &gUnk_02017AA0[gUnk_03003DE4[0] * 0xA0];
|
||||
struct BgAffineSrcData tmp2;
|
||||
s32 tmp3;
|
||||
@@ -248,9 +226,8 @@ void sub_08058BC8(ManagerC* this) {
|
||||
gScreen.controls.bg2.yPointMostSig = ((union SplitWord*)&tmp->dy)->HALF.HI;
|
||||
}
|
||||
|
||||
const u16 gUnk_08108300[4] = { 0xA4, 0x4C, 0xF4, 0x9C };
|
||||
|
||||
void sub_08058CB0(ManagerC* this) {
|
||||
void sub_08058CB0(RollingBarrelManager* this) {
|
||||
static const u16 gUnk_08108300[4] = { 0xA4, 0x4C, 0xF4, 0x9C };
|
||||
u32 tmp = gPlayerEntity.x.HALF.HI - gRoomControls.origin_x;
|
||||
u32 tmp2 = gPlayerEntity.y.HALF.HI - gRoomControls.origin_y;
|
||||
u32 tmp3;
|
||||
@@ -0,0 +1,125 @@
|
||||
/**
|
||||
* @file secretManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Sets a flag and plays a sound if another flag is set.
|
||||
*
|
||||
* unk_0a = 0 for testing one flag unk_0a = 1 for testing multiple flags
|
||||
*/
|
||||
#include "manager/secretManager.h"
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "sound.h"
|
||||
|
||||
void SecretManager_Type0_Action2(SecretManager*);
|
||||
void SecretManager_Type0(SecretManager*);
|
||||
void SecretManager_Type1(SecretManager*);
|
||||
void SecretManager_Type0_Init(SecretManager*);
|
||||
void SecretManager_Type0_Action1(SecretManager*);
|
||||
void SecretManager_Type0_Action2(SecretManager*);
|
||||
void SecretManager_Type1_Action2(SecretManager*);
|
||||
void SecretManager_Type1_Action1(SecretManager*);
|
||||
void SecretManager_Type1_Init(SecretManager*);
|
||||
|
||||
void SecretManager_Main(SecretManager* this) {
|
||||
static void (*const SecretManager_Types[])(SecretManager*) = {
|
||||
SecretManager_Type0,
|
||||
SecretManager_Type1,
|
||||
};
|
||||
SecretManager_Types[super->type](this);
|
||||
}
|
||||
|
||||
void SecretManager_Type0(SecretManager* this) {
|
||||
static void (*const SecretManager_Type0_Actions[])(SecretManager*) = {
|
||||
SecretManager_Type0_Init,
|
||||
SecretManager_Type0_Action1,
|
||||
SecretManager_Type0_Action2,
|
||||
};
|
||||
SecretManager_Type0_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void SecretManager_Type0_Init(SecretManager* this) {
|
||||
if (CheckFlags(this->field_0x3c) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
SetFlag(this->field_0x3c);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
super->action = 1;
|
||||
if (super->timer == 0) {
|
||||
super->timer = 0x1e;
|
||||
}
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
}
|
||||
|
||||
void SecretManager_Type0_Action1(SecretManager* this) {
|
||||
if ((CheckFlags(this->field_0x3e) != 0) && (gPriorityHandler.priority_timer < 2)) {
|
||||
super->action = 2;
|
||||
if (super->timer == 1) {
|
||||
SecretManager_Type0_Action2(this);
|
||||
}
|
||||
RequestPriorityDuration((Entity*)this, super->timer);
|
||||
}
|
||||
}
|
||||
|
||||
void SecretManager_Type0_Action2(SecretManager* this) {
|
||||
if (gPriorityHandler.priority_timer == 0) {
|
||||
if (this->field_0x38 != SFX_NONE) {
|
||||
SoundReq(this->field_0x38);
|
||||
} else {
|
||||
SoundReq(SFX_SECRET);
|
||||
}
|
||||
if (this->field_0x3c != 0) {
|
||||
SetFlag(this->field_0x3c);
|
||||
}
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void SecretManager_Type1(SecretManager* this) {
|
||||
static void (*const SecretManager_Type1_Actions[])(SecretManager*) = {
|
||||
SecretManager_Type1_Init,
|
||||
SecretManager_Type1_Action1,
|
||||
SecretManager_Type1_Action2,
|
||||
};
|
||||
SecretManager_Type1_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void SecretManager_Type1_Init(SecretManager* this) {
|
||||
CheckFlags(this->field_0x3e);
|
||||
super->action = 1;
|
||||
if (super->timer == 0) {
|
||||
super->timer = 0x1e;
|
||||
}
|
||||
super->subtimer = super->timer;
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
}
|
||||
|
||||
void SecretManager_Type1_Action1(SecretManager* this) {
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
super->action = 2;
|
||||
super->timer = super->subtimer;
|
||||
}
|
||||
}
|
||||
|
||||
void SecretManager_Type1_Action2(SecretManager* this) {
|
||||
if (super->timer != 0) {
|
||||
if (--super->timer == 0) {
|
||||
Sound sound;
|
||||
if (this->field_0x38 != SFX_NONE) {
|
||||
sound = this->field_0x38;
|
||||
} else {
|
||||
sound = SFX_SECRET;
|
||||
}
|
||||
SoundReq(sound);
|
||||
SetFlag(this->field_0x3c);
|
||||
}
|
||||
} else {
|
||||
if (CheckFlags(this->field_0x3e) == 0) {
|
||||
super->action = 1;
|
||||
ClearFlag(this->field_0x3c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* @file specialWarpManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Handles some special warps, like beanstalks, minish holes or the entrances into minish village
|
||||
*/
|
||||
#include "manager/specialWarpManager.h"
|
||||
#include "asm.h"
|
||||
#include "functions.h"
|
||||
|
||||
void SpecialWarpManager_Main(SpecialWarpManager* this) {
|
||||
u32 collisionLayer;
|
||||
SpecialWarpManagerWarpData* data;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
this->warpList = GetCurrentRoomProperty(super->type);
|
||||
if (this->warpList == NULL) {
|
||||
DeleteManager(super);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (super->timer == 0 || gPlayerState.floor_type == SURFACE_LADDER) {
|
||||
for (data = this->warpList; data->posX != 0xffff; data++) {
|
||||
collisionLayer = (data->unk_07.all & 0x3);
|
||||
if ((collisionLayer & gPlayerEntity.collisionLayer) != 0) {
|
||||
if ((gPlayerState.flags & PL_MINISH) != 0 || data->unk_07.b.unk2 != 0) {
|
||||
if (CheckPlayerInRegion(data->posX, data->posY, data->width, data->height) &&
|
||||
gPlayerEntity.z.HALF.HI == 0) {
|
||||
DoExitTransition(GetCurrentRoomProperty(data->roomProperty));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
|
||||
#include "manager.h"
|
||||
/**
|
||||
* @file staticBackgroundManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Sets up static bg 3 images?
|
||||
*/
|
||||
#include "manager/staticBackgroundManager.h"
|
||||
#include "common.h"
|
||||
#include "functions.h"
|
||||
#include "screen.h"
|
||||
#include "common.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u32 field_0x20;
|
||||
} Manager1B;
|
||||
|
||||
void sub_0805B4B4(Manager1B*);
|
||||
void sub_0805B448(Manager1B*);
|
||||
void sub_0805B474(Manager1B*);
|
||||
void sub_0805B4B4(StaticBackgroundManager*);
|
||||
void sub_0805B448(StaticBackgroundManager*);
|
||||
void sub_0805B474(StaticBackgroundManager*);
|
||||
|
||||
void sub_0806D0F8(void); // in bigGoron?
|
||||
|
||||
@@ -19,8 +19,8 @@ static const u8 gUnk_08108C28[] = { 0x14, 0x0, 0x0, 0x0, 0x15, 0x0, 0x0, 0x0,
|
||||
0x70, 0x0, 0x4b, 0x0, 0x0, 0x0, 0x4e, 0x0, 0x0, 0x0, 0x4d, 0x1, 0x0, 0x0 };
|
||||
static const u16 gUnk_08108C44[] = { 0, 0, -0x28, 0x70, 0, 0, 0, 0 };
|
||||
|
||||
void Manager1B_Main(Manager1B* this) {
|
||||
static void (*const gUnk_08108C54[])(Manager1B*) = {
|
||||
void StaticBackgroundManager_Main(StaticBackgroundManager* this) {
|
||||
static void (*const gUnk_08108C54[])(StaticBackgroundManager*) = {
|
||||
sub_0805B448,
|
||||
sub_0805B474,
|
||||
};
|
||||
@@ -31,12 +31,12 @@ void Manager1B_Main(Manager1B* this) {
|
||||
if (EntityHasDuplicateID((Entity*)this) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
tmp = gUnk_08108C28 + this->manager.unk_0a * 4;
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_10 |= 0x20;
|
||||
tmp = gUnk_08108C28 + super->type * 4;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
super->flags |= ENT_PERSIST;
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
if (this->manager.unk_0a != 0) {
|
||||
if (super->type != 0) {
|
||||
RegisterTransitionManager(this, sub_0805B4B4, NULL);
|
||||
}
|
||||
iVar3 = 0x100 - (u32)gRoomControls.height;
|
||||
@@ -51,23 +51,23 @@ void Manager1B_Main(Manager1B* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805B448(Manager1B* this) {
|
||||
void sub_0805B448(StaticBackgroundManager* this) {
|
||||
gScreen.bg3.xOffset = (gRoomControls.scroll_x - gRoomControls.origin_x) >> 2;
|
||||
gScreen.bg3.yOffset = ((gRoomControls.scroll_y - gRoomControls.origin_y) >> 1) + this->field_0x20;
|
||||
}
|
||||
|
||||
void sub_0805B474(Manager1B* this) {
|
||||
void sub_0805B474(StaticBackgroundManager* this) {
|
||||
s32 tmp = ((gRoomControls.scroll_y - gRoomControls.origin_y) * 0x60) / (gRoomControls.height - 0xa0);
|
||||
gScreen.bg3.yOffset = gRoomControls.origin_y + tmp;
|
||||
gScreen.bg3.xOffset = gRoomControls.scroll_x - ((gRoomControls.width - 0x100) / 2);
|
||||
}
|
||||
|
||||
void sub_0805B4B4(Manager1B* this) {
|
||||
sub_0805B4D0(this->manager.unk_0a);
|
||||
if (this->manager.unk_0a == 2) {
|
||||
void sub_0805B4B4(StaticBackgroundManager* this) {
|
||||
sub_0805B4D0(super->type);
|
||||
if (super->type == 2) {
|
||||
sub_0806D0F8();
|
||||
}
|
||||
Manager1B_Main(this);
|
||||
StaticBackgroundManager_Main(this);
|
||||
}
|
||||
|
||||
void sub_0805B4D0(u32 param_1) {
|
||||
@@ -1,19 +1,15 @@
|
||||
#include "global.h"
|
||||
#include "manager.h"
|
||||
#include "screen.h"
|
||||
#include "room.h"
|
||||
/**
|
||||
* @file steamOverlayManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Steamy overlay bg in Cave of Flames.
|
||||
*/
|
||||
#include "manager/steamOverlayManager.h"
|
||||
#include "flags.h"
|
||||
#include "physics.h"
|
||||
#include "main.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u16 unk_20;
|
||||
u8 unk_22;
|
||||
u8 unk_23[1];
|
||||
u8 unk_24;
|
||||
u8 unk_25[0x1B];
|
||||
} Manager14;
|
||||
#include "physics.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
|
||||
const u16 gUnk_08108588[] = { 0x1000, 0xF01, 0xE02, 0xD03, 0xC04, 0xB05, 0xA06, 0x907, 0x808 };
|
||||
|
||||
@@ -21,37 +17,38 @@ const u16 gUnk_0810859A[] = { 0x808, 0x907, 0xA06, 0x907 };
|
||||
|
||||
extern u16 gUnk_02017AA0[];
|
||||
|
||||
void sub_08059E80(Manager14*);
|
||||
void sub_08059EF8(Manager14*);
|
||||
u32 sub_08059F9C(Manager14*);
|
||||
void sub_0805A040(Manager14*);
|
||||
void sub_0805A048(Manager14*);
|
||||
void sub_0805A098(Manager14*);
|
||||
void sub_0805A0C0(Manager14*);
|
||||
void SteamOverlayManager_Init(SteamOverlayManager*);
|
||||
void SteamOverlayManager_Action4(SteamOverlayManager*);
|
||||
u32 sub_08059F9C(SteamOverlayManager*);
|
||||
void SteamOverlayManager_Action1(SteamOverlayManager*);
|
||||
void SteamOverlayManager_Action2(SteamOverlayManager*);
|
||||
void sub_0805A098(SteamOverlayManager*);
|
||||
void SteamOverlayManager_Action3(SteamOverlayManager*);
|
||||
void sub_0805A114(u32, u32);
|
||||
void sub_0805A1D8(Manager14*);
|
||||
void sub_0805A1D8(SteamOverlayManager*);
|
||||
void nullsub_495(void*);
|
||||
void sub_0805A25C(void*);
|
||||
|
||||
void Manager14_Main(Manager14* this) {
|
||||
static void (*const gUnk_081085A4[])(Manager14*) = {
|
||||
sub_08059E80, sub_0805A040, sub_0805A048, sub_0805A0C0, sub_08059EF8,
|
||||
void SteamOverlayManager_Main(SteamOverlayManager* this) {
|
||||
static void (*const SteamOverlayManager_Actions[])(SteamOverlayManager*) = {
|
||||
SteamOverlayManager_Init, SteamOverlayManager_Action1, SteamOverlayManager_Action2,
|
||||
SteamOverlayManager_Action3, SteamOverlayManager_Action4,
|
||||
};
|
||||
this->unk_20++;
|
||||
gUnk_081085A4[this->manager.action](this);
|
||||
SteamOverlayManager_Actions[super->action](this);
|
||||
sub_0805A1D8(this);
|
||||
}
|
||||
|
||||
void sub_08059E80(Manager14* this) {
|
||||
void SteamOverlayManager_Init(SteamOverlayManager* this) {
|
||||
if (EntityHasDuplicateID((Entity*)this)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
this->unk_22 = 1;
|
||||
this->unk_20 = 0;
|
||||
this->manager.unk_0e = 0;
|
||||
this->manager.unk_0f = 4;
|
||||
this->manager.action = 4;
|
||||
this->manager.unk_10 |= 0x20;
|
||||
super->timer = 0;
|
||||
super->subtimer = 4;
|
||||
super->action = 4;
|
||||
super->flags |= ENT_PERSIST;
|
||||
gScreen.bg3.control = 0x1E04;
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||
gScreen.controls.layerFXControl = 0x3E48;
|
||||
@@ -61,28 +58,28 @@ void sub_08059E80(Manager14* this) {
|
||||
RegisterTransitionManager(this, nullsub_495, sub_0805A25C);
|
||||
}
|
||||
|
||||
void sub_08059EF8(Manager14* this) {
|
||||
u32 tmp = --this->manager.unk_0f;
|
||||
void SteamOverlayManager_Action4(SteamOverlayManager* this) {
|
||||
u32 tmp = --super->subtimer;
|
||||
if (tmp == 0) {
|
||||
this->manager.unk_0f = 4;
|
||||
super->subtimer = 4;
|
||||
if (sub_08059F9C(this)) {
|
||||
if (gUnk_08108588[this->manager.unk_0e] != 0x808) {
|
||||
if (gUnk_08108588[super->timer] != 0x808) {
|
||||
this->unk_22 = 1;
|
||||
this->unk_24 = tmp;
|
||||
gScreen.controls.alphaBlend = gUnk_08108588[++this->manager.unk_0e];
|
||||
gScreen.controls.alphaBlend = gUnk_08108588[++super->timer];
|
||||
} else {
|
||||
this->unk_22 = tmp;
|
||||
}
|
||||
} else {
|
||||
this->unk_22 = 1;
|
||||
if (gUnk_08108588[this->manager.unk_0e] != 0x1000) {
|
||||
gScreen.controls.alphaBlend = gUnk_08108588[--this->manager.unk_0e];
|
||||
if (gUnk_08108588[super->timer] != 0x1000) {
|
||||
gScreen.controls.alphaBlend = gUnk_08108588[--super->timer];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_08059F9C(Manager14* this) {
|
||||
u32 sub_08059F9C(SteamOverlayManager* this) {
|
||||
switch (gRoomControls.room) {
|
||||
case 1:
|
||||
if (CheckLocalFlag(0x16)) {
|
||||
@@ -106,23 +103,23 @@ u32 sub_08059F9C(Manager14* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A040(Manager14* this) {
|
||||
void SteamOverlayManager_Action1(SteamOverlayManager* this) {
|
||||
sub_0805A098(this);
|
||||
}
|
||||
|
||||
void sub_0805A048(Manager14* this) {
|
||||
if (--this->manager.unk_0f == 0) {
|
||||
this->manager.unk_0f = 4;
|
||||
gScreen.controls.alphaBlend = gUnk_08108588[this->manager.unk_0e++];
|
||||
if (this->manager.unk_0e == 9) {
|
||||
this->manager.action = 1;
|
||||
void SteamOverlayManager_Action2(SteamOverlayManager* this) {
|
||||
if (--super->subtimer == 0) {
|
||||
super->subtimer = 4;
|
||||
gScreen.controls.alphaBlend = gUnk_08108588[super->timer++];
|
||||
if (super->timer == 9) {
|
||||
super->action = 1;
|
||||
this->unk_22 = 0;
|
||||
}
|
||||
}
|
||||
sub_0805A098(this);
|
||||
}
|
||||
|
||||
void sub_0805A098(Manager14* this) {
|
||||
void sub_0805A098(SteamOverlayManager* this) {
|
||||
switch (gRoomControls.room) {
|
||||
case 0:
|
||||
case 8:
|
||||
@@ -130,15 +127,15 @@ void sub_0805A098(Manager14* this) {
|
||||
case 0x17:
|
||||
return;
|
||||
default:
|
||||
this->manager.action = 3;
|
||||
super->action = 3;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A0C0(Manager14* this) {
|
||||
if (--this->manager.unk_0f == 0) {
|
||||
this->manager.unk_0f = 4;
|
||||
gScreen.controls.alphaBlend = gUnk_08108588[this->manager.unk_0e--];
|
||||
if (this->manager.unk_0e == 0xFF) {
|
||||
void SteamOverlayManager_Action3(SteamOverlayManager* this) {
|
||||
if (--super->subtimer == 0) {
|
||||
super->subtimer = 4;
|
||||
gScreen.controls.alphaBlend = gUnk_08108588[super->timer--];
|
||||
if (super->timer == 0xFF) {
|
||||
gScreen.lcd.displayControl &= ~DISPCNT_BG3_ON;
|
||||
sub_08056250();
|
||||
DeleteThisEntity();
|
||||
@@ -148,7 +145,7 @@ void sub_0805A0C0(Manager14* this) {
|
||||
|
||||
void sub_0805A114(u32 unk0, u32 unk1) {
|
||||
s32 i;
|
||||
u16* p = &gUnk_02017AA0[gUnk_03003DE4 * 0x500];
|
||||
u16* p = &gUnk_02017AA0[gUnk_03003DE4[0] * 0x500];
|
||||
for (i = 0; i < 0xA0; i++) {
|
||||
s32 tmp = i + gScreen.bg3.yOffset;
|
||||
switch ((tmp >> 3) & 7) {
|
||||
@@ -168,10 +165,10 @@ void sub_0805A114(u32 unk0, u32 unk1) {
|
||||
}
|
||||
*p++ = gScreen.bg3.xOffset + ((gSineTable[(unk1 + tmp) & 0xFF] * unk0) >> 8);
|
||||
}
|
||||
sub_0805622C(&gUnk_02017AA0[gUnk_03003DE4 * 0x500], 0x0400001C, 0xA2600001);
|
||||
sub_0805622C((struct BgAffineDstData*)&gUnk_02017AA0[gUnk_03003DE4[0] * 0x500], 0x0400001C, 0xA2600001);
|
||||
}
|
||||
|
||||
void sub_0805A1D8(Manager14* this) {
|
||||
void sub_0805A1D8(SteamOverlayManager* this) {
|
||||
gRoomControls.bg3OffsetX.WORD -= 0x1000;
|
||||
gScreen.bg3.xOffset = gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gRoomControls.bg3OffsetY.WORD -= 0x1000;
|
||||
@@ -1,76 +1,64 @@
|
||||
#include "global.h"
|
||||
#include "sound.h"
|
||||
#include "flags.h"
|
||||
#include "screen.h"
|
||||
#include "manager.h"
|
||||
#include "object.h"
|
||||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
/**
|
||||
* @file templeOfDropletsManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Various managers in Temple of Droplets, e.g. Light rays
|
||||
*/
|
||||
#include "manager/templeOfDropletsManager.h"
|
||||
#include "enemy.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 unk_20;
|
||||
u8 unk_21;
|
||||
u8 unk_22;
|
||||
u8 unk_23; // used
|
||||
u16 unk_24;
|
||||
u16 unk_26;
|
||||
void* unk_28;
|
||||
u16 unk_2c;
|
||||
u8 unk_2e[0x6];
|
||||
s16 unk_34;
|
||||
s16 unk_36;
|
||||
s16 unk_38;
|
||||
s16 unk_3a;
|
||||
u16 unk_3c;
|
||||
u16 unk_3e; // used
|
||||
} Manager15;
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "screen.h"
|
||||
#include "sound.h"
|
||||
#include "structures.h"
|
||||
|
||||
static const u16 gUnk_081085B8[] = { 0x1008, 0x1007, 0x1006, 0x1005, 0x1006, 0x1007, 0x1008, 0x1009,
|
||||
0x1008, 0x1007, 0x1006, 0x1005, 0x1006, 0x1007, 0x1008, 0x1009 };
|
||||
|
||||
void sub_0805A298(Manager15*);
|
||||
void sub_0805A2E4(Manager15*);
|
||||
void sub_0805A3D4(Manager15*);
|
||||
void sub_0805A3D4(Manager15*);
|
||||
void sub_0805A500(Manager15*);
|
||||
void sub_0805A660(Manager15*);
|
||||
void sub_0805A664(Manager15*);
|
||||
void sub_0805A804(Manager15*);
|
||||
void sub_0805A464(Manager15*);
|
||||
void sub_0805A370(Manager15*);
|
||||
void sub_0805A394(Manager15*);
|
||||
void nullsub_496(Manager15*);
|
||||
void sub_0805A89C(Manager15*);
|
||||
void sub_0805A8EC(Manager15*);
|
||||
void sub_0805A4B4(Manager15*);
|
||||
void sub_0805A498(Manager15*);
|
||||
void sub_0805A480(Manager15*);
|
||||
void sub_0805A464(Manager15*);
|
||||
void TempleOfDropletsManager_Type0(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type1(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type2(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type2(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type4(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type5(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type6(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type7(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type1_Action1(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type1_Action2(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type1_Action3(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type1_Action4(TempleOfDropletsManager*);
|
||||
void sub_0805A89C(TempleOfDropletsManager*);
|
||||
void sub_0805A8EC(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type2_Action4(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type2_Action3(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type2_Action2(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type1_Action1(TempleOfDropletsManager*);
|
||||
void sub_0805AAF0(u32);
|
||||
void sub_0805AA58(Manager15*);
|
||||
void sub_0805A9CC(Manager15*);
|
||||
void sub_0805A5FC(Manager15*);
|
||||
void sub_0805A618(Manager15*);
|
||||
void sub_0805A628(Manager15*);
|
||||
void sub_0805A64C(Manager15*);
|
||||
void sub_0805A65C(Manager15*);
|
||||
void sub_0805A68C(Manager15*);
|
||||
void sub_0805A7E4(Manager15*);
|
||||
void sub_0805A76C(Manager15*);
|
||||
void sub_0805A758(Manager15*);
|
||||
void sub_0805A6E8(Manager15*);
|
||||
void sub_0805AA58(TempleOfDropletsManager*);
|
||||
void sub_0805A9CC(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type4_Action1(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type4_Action2(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type4_Action3(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type4_Action4(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type4_Action5(TempleOfDropletsManager*);
|
||||
void sub_0805A68C(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type6_Action3(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type6_Action2(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type6_Action1(TempleOfDropletsManager*);
|
||||
void TempleOfDropletsManager_Type6_Init(TempleOfDropletsManager*);
|
||||
|
||||
void Manager15_Main(Manager* this) {
|
||||
static void (*const gUnk_081085D8[])(Manager15*) = {
|
||||
sub_0805A298, sub_0805A2E4, sub_0805A3D4, sub_0805A3D4, sub_0805A500, sub_0805A660, sub_0805A664, sub_0805A804,
|
||||
void TempleOfDropletsManager_Main(TempleOfDropletsManager* this) {
|
||||
static void (*const TempleOfDropletsManager_Types[])(TempleOfDropletsManager*) = {
|
||||
TempleOfDropletsManager_Type0, TempleOfDropletsManager_Type1, TempleOfDropletsManager_Type2,
|
||||
TempleOfDropletsManager_Type2, TempleOfDropletsManager_Type4, TempleOfDropletsManager_Type5,
|
||||
TempleOfDropletsManager_Type6, TempleOfDropletsManager_Type7,
|
||||
};
|
||||
gUnk_081085D8[this->unk_0a]((Manager15*)this);
|
||||
TempleOfDropletsManager_Types[super->type](this);
|
||||
}
|
||||
|
||||
void sub_0805A298(Manager15* this) {
|
||||
if (this->manager.action == 0) {
|
||||
void TempleOfDropletsManager_Type0(TempleOfDropletsManager* this) {
|
||||
if (super->action == 0) {
|
||||
sub_0805A89C(this);
|
||||
if (!CheckLocalFlag(this->unk_3e)) {
|
||||
this->unk_23 = 1;
|
||||
@@ -83,44 +71,48 @@ void sub_0805A298(Manager15* this) {
|
||||
sub_0805A8EC(this);
|
||||
}
|
||||
|
||||
void sub_0805A2E4(Manager15* this) {
|
||||
static void (*const actionFuncs[])(Manager15*) = {
|
||||
NULL, sub_0805A464, sub_0805A370, sub_0805A394, nullsub_496,
|
||||
void TempleOfDropletsManager_Type1(TempleOfDropletsManager* this) {
|
||||
static void (*const TempleOfDropletsManager_Type1_Actions[])(TempleOfDropletsManager*) = {
|
||||
NULL,
|
||||
TempleOfDropletsManager_Type1_Action1,
|
||||
TempleOfDropletsManager_Type1_Action2,
|
||||
TempleOfDropletsManager_Type1_Action3,
|
||||
TempleOfDropletsManager_Type1_Action4,
|
||||
};
|
||||
if (this->manager.action == 0) {
|
||||
if (super->action == 0) {
|
||||
sub_0805A89C(this);
|
||||
this->unk_23 = 1;
|
||||
sub_0805AAF0(1);
|
||||
if (!CheckLocalFlag(this->unk_3e)) {
|
||||
this->manager.action = 1;
|
||||
super->action = 1;
|
||||
gScreen.lcd.displayControl &= 0xB7FF;
|
||||
} else {
|
||||
if (CheckLocalFlag(0x48)) {
|
||||
this->manager.action = 4;
|
||||
super->action = 4;
|
||||
} else {
|
||||
this->manager.action = 3;
|
||||
super->action = 3;
|
||||
}
|
||||
gScreen.lcd.displayControl |= DISPCNT_WIN1_ON | DISPCNT_BG3_ON;
|
||||
}
|
||||
} else {
|
||||
actionFuncs[this->manager.action](this);
|
||||
TempleOfDropletsManager_Type1_Actions[super->action](this);
|
||||
}
|
||||
if (this->manager.next) {
|
||||
if (super->next) {
|
||||
sub_0805A8EC(this);
|
||||
}
|
||||
}
|
||||
|
||||
extern Entity gUnk_080E4C08;
|
||||
|
||||
void sub_0805A370(Manager15* this) {
|
||||
if (this->manager.unk_0d) {
|
||||
void TempleOfDropletsManager_Type1_Action2(TempleOfDropletsManager* this) {
|
||||
if (super->subAction != 0) {
|
||||
LoadRoomEntityList((EntityData*)&gUnk_080E4C08);
|
||||
this->manager.action = 3;
|
||||
super->action = 3;
|
||||
SoundReq(SONG_STOP_BGM);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A394(Manager15* this) {
|
||||
void TempleOfDropletsManager_Type1_Action3(TempleOfDropletsManager* this) {
|
||||
Entity* ent;
|
||||
if ((ent = FindEntityByID(ENEMY, CHUCHU_BOSS, 0x4))) {
|
||||
if (ent->type != 4) {
|
||||
@@ -133,16 +125,20 @@ void sub_0805A394(Manager15* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
void nullsub_496(Manager15* this) {
|
||||
void TempleOfDropletsManager_Type1_Action4(TempleOfDropletsManager* this) {
|
||||
}
|
||||
|
||||
void sub_0805A3D4(Manager15* this) {
|
||||
static void (*const gUnk_0810860C[])(Manager15*) = {
|
||||
NULL, sub_0805A464, sub_0805A480, sub_0805A498, sub_0805A4B4,
|
||||
void TempleOfDropletsManager_Type2(TempleOfDropletsManager* this) {
|
||||
static void (*const TempleOfDropletsManager_Type2_Actions[])(TempleOfDropletsManager*) = {
|
||||
NULL,
|
||||
TempleOfDropletsManager_Type1_Action1,
|
||||
TempleOfDropletsManager_Type2_Action2,
|
||||
TempleOfDropletsManager_Type2_Action3,
|
||||
TempleOfDropletsManager_Type2_Action4,
|
||||
};
|
||||
if (this->manager.action == 0) {
|
||||
if (super->action == 0) {
|
||||
sub_0805A89C(this);
|
||||
if (this->manager.unk_0a == 3) {
|
||||
if (super->type == 3) {
|
||||
this->unk_23 = 2;
|
||||
} else {
|
||||
this->unk_23 = 1;
|
||||
@@ -150,147 +146,153 @@ void sub_0805A3D4(Manager15* this) {
|
||||
sub_0805AAF0(this->unk_23);
|
||||
if (!CheckLocalFlag(this->unk_3e)) {
|
||||
ClearFlag(this->unk_3c);
|
||||
this->manager.action = 1;
|
||||
super->action = 1;
|
||||
gScreen.lcd.displayControl &= ~(DISPCNT_WIN1_ON | DISPCNT_BG3_ON);
|
||||
} else {
|
||||
SetFlag(this->unk_3c);
|
||||
this->manager.action = 3;
|
||||
super->action = 3;
|
||||
gScreen.lcd.displayControl |= DISPCNT_WIN1_ON | DISPCNT_BG3_ON;
|
||||
}
|
||||
} else {
|
||||
gUnk_0810860C[this->manager.action](this);
|
||||
TempleOfDropletsManager_Type2_Actions[super->action](this);
|
||||
}
|
||||
sub_0805A8EC(this);
|
||||
}
|
||||
|
||||
void sub_0805A4CC(Manager15*, u32);
|
||||
void sub_0805A4CC(TempleOfDropletsManager*, u32);
|
||||
|
||||
void sub_0805A464(Manager15* this) {
|
||||
void TempleOfDropletsManager_Type1_Action1(TempleOfDropletsManager* this) {
|
||||
if (CheckLocalFlag(this->unk_3e)) {
|
||||
this->manager.action = 2;
|
||||
super->action = 2;
|
||||
sub_0805A4CC(this, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A480(Manager15* this) {
|
||||
if (this->manager.unk_0d != 0) {
|
||||
this->manager.action = 3;
|
||||
void TempleOfDropletsManager_Type2_Action2(TempleOfDropletsManager* this) {
|
||||
if (super->subAction != 0) {
|
||||
super->action = 3;
|
||||
SetFlag(this->unk_3c);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A498(Manager15* this) {
|
||||
void TempleOfDropletsManager_Type2_Action3(TempleOfDropletsManager* this) {
|
||||
if (!CheckLocalFlag(this->unk_3e)) {
|
||||
this->manager.action = 4;
|
||||
super->action = 4;
|
||||
sub_0805A4CC(this, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A4B4(Manager15* this) {
|
||||
if (this->manager.unk_0d != 0) {
|
||||
this->manager.action = 1;
|
||||
void TempleOfDropletsManager_Type2_Action4(TempleOfDropletsManager* this) {
|
||||
if (super->subAction != 0) {
|
||||
super->action = 1;
|
||||
ClearFlag(this->unk_3c);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A4CC(Manager15* this, u32 unk_0) {
|
||||
void sub_0805A4CC(TempleOfDropletsManager* this, u32 unk_0) {
|
||||
Entity* tmp;
|
||||
tmp = CreateObject(OBJECT_8E, unk_0, 0);
|
||||
if (tmp) {
|
||||
tmp->x.HALF.HI = this->unk_38 + gRoomControls.origin_x;
|
||||
tmp->y.HALF.HI = this->unk_3a + gRoomControls.origin_y - 0x30;
|
||||
tmp->parent = (Entity*)this;
|
||||
this->manager.unk_0d = 0;
|
||||
super->subAction = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A500(Manager15* this) {
|
||||
static void (*const actionFuncs[])(Manager15*) = {
|
||||
NULL, sub_0805A5FC, sub_0805A618, sub_0805A628, sub_0805A64C, sub_0805A65C,
|
||||
void TempleOfDropletsManager_Type4(TempleOfDropletsManager* this) {
|
||||
static void (*const TempleOfDropletsManager_Type4_Actions[])(TempleOfDropletsManager*) = {
|
||||
NULL,
|
||||
TempleOfDropletsManager_Type4_Action1,
|
||||
TempleOfDropletsManager_Type4_Action2,
|
||||
TempleOfDropletsManager_Type4_Action3,
|
||||
TempleOfDropletsManager_Type4_Action4,
|
||||
TempleOfDropletsManager_Type4_Action5,
|
||||
};
|
||||
if (this->manager.action == 0) {
|
||||
if (super->action == 0) {
|
||||
sub_0805A89C(this);
|
||||
this->unk_28 = 0;
|
||||
if (CheckLocalFlag(0x36)) {
|
||||
this->unk_23 = 3;
|
||||
this->manager.action = 5;
|
||||
super->action = 5;
|
||||
gScreen.lcd.displayControl |= DISPCNT_WIN1_ON | DISPCNT_BG3_ON;
|
||||
} else {
|
||||
if (CheckLocalFlag(0x34)) {
|
||||
this->unk_23 = 4;
|
||||
this->manager.action = 3;
|
||||
super->action = 3;
|
||||
gScreen.lcd.displayControl |= DISPCNT_WIN1_ON | DISPCNT_BG3_ON;
|
||||
} else {
|
||||
this->unk_23 = 4;
|
||||
this->manager.action = 1;
|
||||
super->action = 1;
|
||||
gScreen.lcd.displayControl &= ~(DISPCNT_WIN1_ON | DISPCNT_BG3_ON);
|
||||
}
|
||||
}
|
||||
sub_0805AAF0(this->unk_23);
|
||||
} else {
|
||||
actionFuncs[this->manager.action](this);
|
||||
TempleOfDropletsManager_Type4_Actions[super->action](this);
|
||||
}
|
||||
sub_0805AA58(this);
|
||||
sub_0805A9CC(this);
|
||||
if (gRoomControls.reload_flags == 1) {
|
||||
gScreen.lcd.displayControl |= DISPCNT_WIN1_ON;
|
||||
this->manager.unk_0d = 1;
|
||||
super->subAction = 1;
|
||||
return;
|
||||
}
|
||||
if (!this->manager.unk_0d)
|
||||
if (super->subAction == 0)
|
||||
return;
|
||||
this->manager.unk_0d = 0;
|
||||
super->subAction = 0;
|
||||
if (this->unk_20 == gRoomControls.room)
|
||||
return;
|
||||
gScreen.lcd.displayControl &= ~(DISPCNT_WIN1_ON | DISPCNT_BG3_ON);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
void sub_0805A5FC(Manager15* this) {
|
||||
void TempleOfDropletsManager_Type4_Action1(TempleOfDropletsManager* this) {
|
||||
if (CheckLocalFlag(0x34)) {
|
||||
this->manager.action = 2;
|
||||
super->action = 2;
|
||||
sub_0805A4CC(this, 2);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A618(Manager15* this) {
|
||||
if (this->manager.unk_0d) {
|
||||
this->manager.action = 3;
|
||||
void TempleOfDropletsManager_Type4_Action2(TempleOfDropletsManager* this) {
|
||||
if (super->subAction != 0) {
|
||||
super->action = 3;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A628(Manager15* this) {
|
||||
void TempleOfDropletsManager_Type4_Action3(TempleOfDropletsManager* this) {
|
||||
if (CheckLocalFlag(0x36)) {
|
||||
this->manager.action = 4;
|
||||
super->action = 4;
|
||||
this->unk_23 = 3;
|
||||
sub_0805A4CC(this, 3);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A64C(Manager15* this) {
|
||||
if (this->manager.unk_0d) {
|
||||
this->manager.action = 5;
|
||||
void TempleOfDropletsManager_Type4_Action4(TempleOfDropletsManager* this) {
|
||||
if (super->subAction != 0) {
|
||||
super->action = 5;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A65C(Manager15* this) {
|
||||
}
|
||||
void sub_0805A660(Manager15* this) {
|
||||
void TempleOfDropletsManager_Type4_Action5(TempleOfDropletsManager* this) {
|
||||
}
|
||||
|
||||
void sub_0805A664(Manager15* this) {
|
||||
static void (*const gUnk_08108638[])(Manager15*) = {
|
||||
sub_0805A6E8,
|
||||
sub_0805A758,
|
||||
sub_0805A76C,
|
||||
sub_0805A7E4,
|
||||
void TempleOfDropletsManager_Type5(TempleOfDropletsManager* this) {
|
||||
}
|
||||
|
||||
void TempleOfDropletsManager_Type6(TempleOfDropletsManager* this) {
|
||||
static void (*const TempleOfDropletsManager_Type6_Actions[])(TempleOfDropletsManager*) = {
|
||||
TempleOfDropletsManager_Type6_Init,
|
||||
TempleOfDropletsManager_Type6_Action1,
|
||||
TempleOfDropletsManager_Type6_Action2,
|
||||
TempleOfDropletsManager_Type6_Action3,
|
||||
};
|
||||
gUnk_08108638[this->manager.action](this);
|
||||
TempleOfDropletsManager_Type6_Actions[super->action](this);
|
||||
sub_0805A8EC(this);
|
||||
sub_0805A68C(this);
|
||||
}
|
||||
|
||||
void sub_0805A68C(Manager15* this) {
|
||||
void sub_0805A68C(TempleOfDropletsManager* this) {
|
||||
if (CheckPlayerProximity(this->unk_38 - 0x18, this->unk_3a - 0x18, 0x30, 0x30)) {
|
||||
if (this->unk_2c <= 0x1007) {
|
||||
gScreen.controls.alphaBlend = ++this->unk_2c;
|
||||
@@ -304,9 +306,9 @@ void sub_0805A68C(Manager15* this) {
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0805A73C(Manager15*);
|
||||
u32 sub_0805A73C(TempleOfDropletsManager*);
|
||||
|
||||
void sub_0805A6E8(Manager15* this) {
|
||||
void TempleOfDropletsManager_Type6_Init(TempleOfDropletsManager* this) {
|
||||
u16 tmp;
|
||||
sub_0805A89C(this);
|
||||
this->unk_23 = 0;
|
||||
@@ -314,30 +316,30 @@ void sub_0805A6E8(Manager15* this) {
|
||||
this->unk_38 += gRoomControls.origin_x;
|
||||
this->unk_3a += gRoomControls.origin_y;
|
||||
if (!sub_0805A73C(this)) {
|
||||
this->manager.action++;
|
||||
super->action++;
|
||||
}
|
||||
this->unk_2c = 0x1000;
|
||||
tmp = gScreen.lcd.displayControl | DISPCNT_WIN1_ON | DISPCNT_BG3_ON;
|
||||
gScreen.lcd.displayControl = tmp;
|
||||
}
|
||||
|
||||
u32 sub_0805A73C(Manager15* this) {
|
||||
u32 sub_0805A73C(TempleOfDropletsManager* this) {
|
||||
return CheckPlayerProximity(this->unk_38 - 6, this->unk_3a - 6, 12, 12);
|
||||
}
|
||||
|
||||
void sub_0805A758(Manager15* this) {
|
||||
void TempleOfDropletsManager_Type6_Action1(TempleOfDropletsManager* this) {
|
||||
if (!sub_0805A73C(this)) {
|
||||
this->manager.action++;
|
||||
super->action++;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A76C(Manager15* this) {
|
||||
void TempleOfDropletsManager_Type6_Action2(TempleOfDropletsManager* this) {
|
||||
if ((gPlayerEntity.health != 0) && (gPlayerEntity.z.HALF.HI == 0) && (!gPlayerState.item)) {
|
||||
switch (gPlayerState.framestate_last) {
|
||||
case PL_STATE_IDLE:
|
||||
case PL_STATE_WALK:
|
||||
if (sub_0805A73C(this)) {
|
||||
this->manager.action++;
|
||||
super->action++;
|
||||
sub_08004168(&gPlayerEntity);
|
||||
gPlayerEntity.animationState = 4;
|
||||
RequestPriorityDuration((Entity*)this, 600);
|
||||
@@ -350,7 +352,7 @@ void sub_0805A76C(Manager15* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A7E4(Manager15* this) {
|
||||
void TempleOfDropletsManager_Type6_Action3(TempleOfDropletsManager* this) {
|
||||
if (gPlayerState.queued_action != PLAYER_WARP) {
|
||||
gPlayerState.queued_action = PLAYER_WARP;
|
||||
gPlayerState.field_0x38 = 0;
|
||||
@@ -358,38 +360,38 @@ void sub_0805A7E4(Manager15* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A804(Manager15* this) {
|
||||
switch (this->manager.action) {
|
||||
void TempleOfDropletsManager_Type7(TempleOfDropletsManager* this) {
|
||||
switch (super->action) {
|
||||
case 0:
|
||||
if (CheckLocalFlag(this->unk_3e)) {
|
||||
this->manager.action = 1;
|
||||
super->action = 1;
|
||||
} else {
|
||||
this->manager.action = 2;
|
||||
super->action = 2;
|
||||
}
|
||||
this->manager.unk_0d = 1;
|
||||
this->manager.unk_10 |= 0x20;
|
||||
super->subAction = 1;
|
||||
super->flags |= ENT_PERSIST;
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
break;
|
||||
case 1:
|
||||
if (CheckLocalFlag(this->unk_3e))
|
||||
break;
|
||||
this->manager.action = 2;
|
||||
super->action = 2;
|
||||
sub_0805A4CC(this, 4);
|
||||
break;
|
||||
case 2:
|
||||
if (this->manager.unk_0d) {
|
||||
this->manager.action = 3;
|
||||
if (super->subAction != 0) {
|
||||
super->action = 3;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (!CheckLocalFlag(this->unk_3e))
|
||||
break;
|
||||
this->manager.action = 4;
|
||||
super->action = 4;
|
||||
sub_0805A4CC(this, 4);
|
||||
break;
|
||||
case 4:
|
||||
if (this->manager.unk_0d) {
|
||||
this->manager.action = 1;
|
||||
if (super->subAction != 0) {
|
||||
super->action = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -397,14 +399,14 @@ void sub_0805A804(Manager15* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805AAC8(Manager15*);
|
||||
void sub_0805AAC8(TempleOfDropletsManager*);
|
||||
|
||||
void sub_0805A89C(Manager15* this) {
|
||||
void sub_0805A89C(TempleOfDropletsManager* this) {
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_10 |= 0x20;
|
||||
this->manager.unk_0e = 8;
|
||||
this->manager.unk_0f = 0x10;
|
||||
super->action = 1;
|
||||
super->flags |= ENT_PERSIST;
|
||||
super->timer = 8;
|
||||
super->subtimer = 0x10;
|
||||
this->unk_21 = 0;
|
||||
this->unk_22 = 0;
|
||||
this->unk_20 = gRoomControls.room;
|
||||
@@ -413,18 +415,18 @@ void sub_0805A89C(Manager15* this) {
|
||||
RegisterTransitionManager(this, sub_0805AAC8, 0);
|
||||
}
|
||||
|
||||
void sub_0805A94C(Manager15* this);
|
||||
void sub_0805A94C(TempleOfDropletsManager* this);
|
||||
|
||||
void sub_0805A8EC(Manager15* this) {
|
||||
void sub_0805A8EC(TempleOfDropletsManager* this) {
|
||||
sub_0805AA58(this);
|
||||
sub_0805A94C(this);
|
||||
if (gRoomControls.reload_flags == 1) {
|
||||
gScreen.lcd.displayControl |= DISPCNT_WIN1_ON;
|
||||
this->manager.unk_0d = 1;
|
||||
super->subAction = 1;
|
||||
} else {
|
||||
if (!this->manager.unk_0d)
|
||||
if (super->subAction == 0)
|
||||
return;
|
||||
this->manager.unk_0d = 0;
|
||||
super->subAction = 0;
|
||||
if (this->unk_20 == gRoomControls.room)
|
||||
return;
|
||||
gScreen.lcd.displayControl &= ~(DISPCNT_WIN1_ON | DISPCNT_BG3_ON);
|
||||
@@ -432,7 +434,7 @@ void sub_0805A8EC(Manager15* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805A94C(Manager15* this) {
|
||||
void sub_0805A94C(TempleOfDropletsManager* this) {
|
||||
int tmp1, tmp2;
|
||||
gScreen.bg3.xOffset = gRoomControls.scroll_x - this->unk_24 + this->unk_34;
|
||||
gScreen.bg3.yOffset = gRoomControls.scroll_y - this->unk_26 + this->unk_36;
|
||||
@@ -460,7 +462,7 @@ void sub_0805A94C(Manager15* this) {
|
||||
gScreen.controls.window1VerticalDimensions = (tmp1 << 8 | tmp2);
|
||||
}
|
||||
|
||||
void sub_0805A9CC(Manager15* this) {
|
||||
void sub_0805A9CC(TempleOfDropletsManager* this) {
|
||||
int tmp1, tmp2;
|
||||
void* tmp3;
|
||||
gScreen.bg3.xOffset = gRoomControls.scroll_x - this->unk_24 + this->unk_34;
|
||||
@@ -488,24 +490,24 @@ void sub_0805A9CC(Manager15* this) {
|
||||
|
||||
extern struct { u8 unk_00[0x20]; } gUnk_085A97A0[];
|
||||
|
||||
void sub_0805AA58(Manager15* this) {
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
this->manager.unk_0e = 8;
|
||||
void sub_0805AA58(TempleOfDropletsManager* this) {
|
||||
if (--super->timer == 0) {
|
||||
super->timer = 8;
|
||||
this->unk_21 += 1;
|
||||
this->unk_21 &= 3;
|
||||
LoadPalettes(gUnk_085A97A0[this->unk_21].unk_00, 5, 1);
|
||||
}
|
||||
if (--this->manager.unk_0f == 0) {
|
||||
this->manager.unk_0f = 0x10;
|
||||
if (--super->subtimer == 0) {
|
||||
super->subtimer = 0x10;
|
||||
this->unk_22 += 1;
|
||||
this->unk_22 &= 0xF;
|
||||
gScreen.controls.alphaBlend = gUnk_081085B8[this->unk_22];
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805AAC8(Manager15* this) {
|
||||
void sub_0805AAC8(TempleOfDropletsManager* this) {
|
||||
sub_0805AAF0(this->unk_23);
|
||||
Manager15_Main(&this->manager);
|
||||
TempleOfDropletsManager_Main(this);
|
||||
}
|
||||
|
||||
void sub_0805AADC(u32 unk0) {
|
||||
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* @file tileChangeObserveManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Loads entity lists when a tile changes
|
||||
*
|
||||
* e.g. Puffstools in DWS if you suck away the dirt
|
||||
* spawns the red portal in FoW if you move the stone
|
||||
*/
|
||||
#include "manager/tileChangeObserveManager.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "room.h"
|
||||
|
||||
void TileChangeObserveManager_Init(TileChangeObserveManager*);
|
||||
void TileChangeObserveManager_Action1(TileChangeObserveManager*);
|
||||
void TileChangeObserveManager_Action2(TileChangeObserveManager*);
|
||||
|
||||
void TileChangeObserveManager_Main(TileChangeObserveManager* this) {
|
||||
static void (*const TileChangeObserveManager_Actions[])(TileChangeObserveManager*) = {
|
||||
TileChangeObserveManager_Init,
|
||||
TileChangeObserveManager_Action1,
|
||||
TileChangeObserveManager_Action2,
|
||||
};
|
||||
TileChangeObserveManager_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void TileChangeObserveManager_Init(TileChangeObserveManager* this) {
|
||||
u16* tile;
|
||||
if (CheckFlags(this->flag) != 0) {
|
||||
DeleteThisEntity();
|
||||
} else {
|
||||
super->action = 1;
|
||||
tile = &GetLayerByIndex(this->field_0x3a)->mapData[this->tilePosition];
|
||||
this->observedTile = tile;
|
||||
this->initialTile = tile[0];
|
||||
}
|
||||
}
|
||||
|
||||
void TileChangeObserveManager_Action1(TileChangeObserveManager* this) {
|
||||
if (this->initialTile != this->observedTile[0]) {
|
||||
super->action++;
|
||||
super->timer = 0xf;
|
||||
}
|
||||
}
|
||||
|
||||
void TileChangeObserveManager_Action2(TileChangeObserveManager* this) {
|
||||
if (--super->timer == 0) {
|
||||
SetFlag(this->flag);
|
||||
if (super->type != 0) {
|
||||
LoadRoomEntityList((EntityData*)GetCurrentRoomProperty(super->type));
|
||||
}
|
||||
DeleteManager(super);
|
||||
}
|
||||
}
|
||||
@@ -1,42 +1,28 @@
|
||||
#include "global.h"
|
||||
#include "asm.h"
|
||||
#include "sound.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
|
||||
typedef struct Manager30 {
|
||||
Manager manager;
|
||||
u8 unk_20[8]; // unused
|
||||
u16 own_tile;
|
||||
u8 unk_2a[0x2]; // unused
|
||||
u16 player_previous_tile;
|
||||
u16 player_current_tile;
|
||||
u8 unk_30[0x6]; // unused
|
||||
u8 width;
|
||||
u8 height;
|
||||
s16 x;
|
||||
s16 y;
|
||||
u16 flag_succeeded;
|
||||
u16 flag_reset;
|
||||
} Manager30;
|
||||
|
||||
enum { INIT, IN_PROGRESS, FAILED, SUCCEEDED };
|
||||
|
||||
/*
|
||||
* Tile puzzles (step on all blue tiles exactly once).
|
||||
/**
|
||||
* @file tilePuzzleManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Tile puzzles (step on all blue tiles exactly once).
|
||||
*
|
||||
* The Manager's field 0xe is used for the remaining number of tiles to be changed.
|
||||
* field 0xf is used for the total number of tiles to be changed.
|
||||
*/
|
||||
void Manager30_Main(Manager30* this) {
|
||||
#include "manager/tilePuzzleManager.h"
|
||||
#include "asm.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "sound.h"
|
||||
|
||||
enum { INIT, IN_PROGRESS, FAILED, SUCCEEDED };
|
||||
|
||||
void TilePuzzleManager_Main(TilePuzzleManager* this) {
|
||||
u32 i, j, tmp, tmp2;
|
||||
switch (this->manager.action) {
|
||||
switch (super->action) {
|
||||
default:
|
||||
break;
|
||||
case INIT:
|
||||
this->manager.action = IN_PROGRESS;
|
||||
this->manager.unk_0f = this->manager.unk_0e;
|
||||
super->action = IN_PROGRESS;
|
||||
super->subtimer = super->timer;
|
||||
this->own_tile = (((this->x >> 4) & 0x3fU) | ((this->y >> 4) & 0x3fU) << 6);
|
||||
this->player_previous_tile = this->player_current_tile = COORD_TO_TILE((&gPlayerEntity));
|
||||
break;
|
||||
@@ -44,22 +30,22 @@ void Manager30_Main(Manager30* this) {
|
||||
this->player_current_tile = COORD_TO_TILE((&gPlayerEntity));
|
||||
if (this->player_current_tile != this->player_previous_tile) {
|
||||
this->player_previous_tile = this->player_current_tile;
|
||||
switch (GetTileType(this->player_current_tile, this->manager.unk_0b)) {
|
||||
switch (GetTileType(this->player_current_tile, super->type2)) {
|
||||
case 0x317:
|
||||
// stepped on a red tile again
|
||||
this->manager.action = FAILED;
|
||||
super->action = FAILED;
|
||||
SoundReq(SFX_MENU_ERROR);
|
||||
break;
|
||||
case 0x318:
|
||||
// stepped on a blue tile
|
||||
// turn the tile into a red tile
|
||||
sub_0807B7D8(0x317, this->player_current_tile, this->manager.unk_0b);
|
||||
sub_0807B7D8(0x317, this->player_current_tile, super->type2);
|
||||
SoundReq(SFX_6B);
|
||||
// decrease the number of remaining tiles and check if we're done
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
this->manager.action = SUCCEEDED;
|
||||
if (--super->timer == 0) {
|
||||
super->action = SUCCEEDED;
|
||||
// set up delay for setting the flag/playing the success sfx
|
||||
this->manager.unk_0e = 0x40;
|
||||
super->timer = 0x40;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -71,19 +57,19 @@ void Manager30_Main(Manager30* this) {
|
||||
if (!CheckFlags(this->flag_reset))
|
||||
return; // wait for the flag telling it to reset
|
||||
ClearFlag(this->flag_reset); // make sure the puzzle can be reset again later
|
||||
this->manager.action = IN_PROGRESS;
|
||||
this->manager.unk_0e = this->manager.unk_0f;
|
||||
super->action = IN_PROGRESS;
|
||||
super->timer = super->subtimer;
|
||||
for (i = 0; i < this->height; i++) {
|
||||
tmp = this->own_tile + (i << 6);
|
||||
for (j = 0; j < this->width; j++) {
|
||||
RestorePrevTileEntity(tmp + j, this->manager.unk_0b);
|
||||
RestorePrevTileEntity(tmp + j, super->type2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SUCCEEDED:
|
||||
if (this->manager.unk_0e == 0)
|
||||
if (super->timer == 0)
|
||||
return;
|
||||
tmp2 = --this->manager.unk_0e;
|
||||
tmp2 = --super->timer;
|
||||
if (tmp2) {
|
||||
if (tmp2 == 0x20) {
|
||||
SetFlag(this->flag_succeeded);
|
||||
@@ -1,22 +1,27 @@
|
||||
|
||||
#include "manager.h"
|
||||
/**
|
||||
* @file vaati3BackgroundManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Scrolling background during Vaati 3.
|
||||
*/
|
||||
#include "manager/vaati3BackgroundManager.h"
|
||||
#include "area.h"
|
||||
#include "common.h"
|
||||
#include "functions.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
#include "functions.h"
|
||||
#include "common.h"
|
||||
|
||||
void sub_0805D470(Manager*);
|
||||
void sub_0805D470(Vaati3BackgroundManager*);
|
||||
|
||||
void Manager2F_Main(Manager* this) {
|
||||
void Vaati3BackgroundManager_Main(Vaati3BackgroundManager* this) {
|
||||
if (this == NULL) {
|
||||
if (gArea.onEnter != sub_0805D470) {
|
||||
sub_0805D470(NULL);
|
||||
}
|
||||
} else {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->unk_10 |= 0x20;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
super->flags |= ENT_PERSIST;
|
||||
SetDefaultPriority((Entity*)this, PRIO_PLAYER_EVENT);
|
||||
if (gArea.onEnter == NULL) {
|
||||
RegisterTransitionManager(this, sub_0805D470, NULL);
|
||||
@@ -32,7 +37,7 @@ void Manager2F_Main(Manager* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D470(Manager* this) {
|
||||
void sub_0805D470(Vaati3BackgroundManager* this) {
|
||||
LoadGfxGroup(0x4c);
|
||||
gScreen.bg3.control = 0x1e07;
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||
@@ -1,47 +1,48 @@
|
||||
#include "manager.h"
|
||||
#include "structures.h"
|
||||
/**
|
||||
* @file vaati3InsideArmManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Manages the inside of the arms of Vaati3.
|
||||
*/
|
||||
#include "manager/vaati3InsideArmManager.h"
|
||||
#include "functions.h"
|
||||
#include "sound.h"
|
||||
#include "structures.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u16 field_0x20;
|
||||
} Manager34;
|
||||
|
||||
void sub_0805DBF0(Manager34*);
|
||||
void sub_0805DBB4(Manager34*);
|
||||
void sub_0805DBCC(Manager34*);
|
||||
void nullsub_498(Manager34*);
|
||||
void sub_0805DBF0(Vaati3InsideArmManager*);
|
||||
void Vaati3InsideArmManager_Init(Vaati3InsideArmManager*);
|
||||
void Vaati3InsideArmManager_Action1(Vaati3InsideArmManager*);
|
||||
void Vaati3InsideArmManager_Action2(Vaati3InsideArmManager*);
|
||||
|
||||
extern ScreenTransitionData gUnk_0813AC48;
|
||||
|
||||
void sub_0805DC70(void);
|
||||
|
||||
void Manager34_Main(Manager34* this) {
|
||||
static void (*const actionFuncs[])(Manager34*) = {
|
||||
sub_0805DBB4,
|
||||
sub_0805DBCC,
|
||||
nullsub_498,
|
||||
void Vaati3InsideArmManager_Main(Vaati3InsideArmManager* this) {
|
||||
static void (*const Vaati3InsideArmManager_Actions[])(Vaati3InsideArmManager*) = {
|
||||
Vaati3InsideArmManager_Init,
|
||||
Vaati3InsideArmManager_Action1,
|
||||
Vaati3InsideArmManager_Action2,
|
||||
};
|
||||
actionFuncs[this->manager.action](this);
|
||||
Vaati3InsideArmManager_Actions[super->action](this);
|
||||
sub_0805DBF0(this);
|
||||
}
|
||||
|
||||
void sub_0805DBB4(Manager34* this) {
|
||||
this->manager.action = 1;
|
||||
void Vaati3InsideArmManager_Init(Vaati3InsideArmManager* this) {
|
||||
super->action = 1;
|
||||
this->field_0x20 = gRoomTransition.field_0x3d * 0x3c;
|
||||
}
|
||||
|
||||
void sub_0805DBCC(Manager34* this) {
|
||||
if (((this->manager.parent)->next == NULL) && (this->manager.action = 2, 0x12d < this->field_0x20)) {
|
||||
void Vaati3InsideArmManager_Action1(Vaati3InsideArmManager* this) {
|
||||
if (((super->parent)->next == NULL) && (super->action = 2, 0x12d < this->field_0x20)) {
|
||||
this->field_0x20 = 0x12d;
|
||||
}
|
||||
}
|
||||
|
||||
void nullsub_498(Manager34* this) {
|
||||
void Vaati3InsideArmManager_Action2(Vaati3InsideArmManager* this) {
|
||||
}
|
||||
|
||||
void sub_0805DBF0(Manager34* this) {
|
||||
void sub_0805DBF0(Vaati3InsideArmManager* this) {
|
||||
if (--this->field_0x20 == 0) {
|
||||
sub_0805DC70();
|
||||
} else {
|
||||
@@ -1,48 +1,55 @@
|
||||
#include "manager.h"
|
||||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
#include "flags.h"
|
||||
#include "message.h"
|
||||
#include "sound.h"
|
||||
#include "save.h"
|
||||
#include "object.h"
|
||||
/**
|
||||
* @file vaati3StartManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Manages the transition to and start of Vaati3.
|
||||
*/
|
||||
#include "manager/vaati3StartManager.h"
|
||||
#include "area.h"
|
||||
#include "enemy.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "message.h"
|
||||
#include "object.h"
|
||||
#include "save.h"
|
||||
#include "screen.h"
|
||||
#include "sound.h"
|
||||
#include "structures.h"
|
||||
|
||||
extern ScreenTransitionData gUnk_0813AC34;
|
||||
|
||||
void sub_0805E094(void);
|
||||
void sub_0805DE50(Manager*);
|
||||
void sub_0805DFE8(Manager*);
|
||||
void sub_0805DE68(Manager*);
|
||||
void sub_0805DEB8(Manager*);
|
||||
void sub_0805DF4C(Manager*);
|
||||
void sub_0805DF98(Manager*);
|
||||
void sub_0805DFCC(Manager*);
|
||||
void sub_0805E078(Manager*);
|
||||
void sub_0805E000(Manager*);
|
||||
void Vaati3StartManager_Type0(Vaati3StartManager*);
|
||||
void Vaati3StartManager_Type1(Vaati3StartManager*);
|
||||
void Vaati3StartManager_Type0_Init(Vaati3StartManager*);
|
||||
void Vaati3StartManager_Type0_Action1(Vaati3StartManager*);
|
||||
void Vaati3StartManager_Type0_Action2(Vaati3StartManager*);
|
||||
void Vaati3StartManager_Type0_Action3(Vaati3StartManager*);
|
||||
void Vaati3StartManager_Type0_Action4(Vaati3StartManager*);
|
||||
void Vaati3StartManager_Type1_Action1(Vaati3StartManager*);
|
||||
void Vaati3StartManager_Type1_Init(Vaati3StartManager*);
|
||||
|
||||
void Manager37_Main(Manager* this) {
|
||||
static void (*const gUnk_08108DBC[])(Manager*) = {
|
||||
sub_0805DE50,
|
||||
sub_0805DFE8,
|
||||
void Vaati3StartManager_Main(Vaati3StartManager* this) {
|
||||
static void (*const Vaati3StartManager_Types[])(Vaati3StartManager*) = {
|
||||
Vaati3StartManager_Type0,
|
||||
Vaati3StartManager_Type1,
|
||||
};
|
||||
gUnk_08108DBC[this->unk_0a](this);
|
||||
Vaati3StartManager_Types[super->type](this);
|
||||
}
|
||||
|
||||
void sub_0805DE50(Manager* this) {
|
||||
static void (*const actionFuncs[])(Manager*) = {
|
||||
sub_0805DE68, sub_0805DEB8, sub_0805DF4C, sub_0805DF98, sub_0805DFCC,
|
||||
void Vaati3StartManager_Type0(Vaati3StartManager* this) {
|
||||
static void (*const Vaati3StartManager_Type0_Actions[])(Vaati3StartManager*) = {
|
||||
Vaati3StartManager_Type0_Init, Vaati3StartManager_Type0_Action1, Vaati3StartManager_Type0_Action2,
|
||||
Vaati3StartManager_Type0_Action3, Vaati3StartManager_Type0_Action4,
|
||||
};
|
||||
actionFuncs[this->action](this);
|
||||
Vaati3StartManager_Type0_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void sub_0805DE68(Manager* this) {
|
||||
void Vaati3StartManager_Type0_Init(Vaati3StartManager* this) {
|
||||
if (CheckLocalFlag(0x7b) == 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
this->action = 1;
|
||||
super->action = 1;
|
||||
gRoomTransition.field_0x38 = 0;
|
||||
gRoomTransition.field_0x39 = 0x0f;
|
||||
*(u8*)&gRoomTransition.field_0x3a = 0x20;
|
||||
@@ -52,7 +59,7 @@ void sub_0805DE68(Manager* this) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void sub_0805DEB8(Manager* this) {
|
||||
void Vaati3StartManager_Type0_Action1(Vaati3StartManager* this) {
|
||||
s32 distX;
|
||||
s32 distY;
|
||||
Entity* object;
|
||||
@@ -60,9 +67,9 @@ void sub_0805DEB8(Manager* this) {
|
||||
distX = gPlayerEntity.x.HALF.HI - (gRoomControls.origin_x + 0x88);
|
||||
distY = gPlayerEntity.y.HALF.HI - (gRoomControls.origin_y + 0x40);
|
||||
if (distX * distX + distY * distY < 0x901) {
|
||||
this->action = 2;
|
||||
this->unk_0d = 0;
|
||||
this->unk_0e = 0x78;
|
||||
super->action = 2;
|
||||
super->subAction = 0;
|
||||
super->timer = 0x78;
|
||||
SetPlayerControl(2);
|
||||
sub_08078B48();
|
||||
object = CreateObject(OBJECT_64, 0, 0);
|
||||
@@ -78,49 +85,49 @@ void sub_0805DEB8(Manager* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805DF4C(Manager* this) {
|
||||
void Vaati3StartManager_Type0_Action2(Vaati3StartManager* this) {
|
||||
gPlayerEntity.animationState = 0;
|
||||
if (gPlayerEntity.z.HALF.HI != 0) {
|
||||
if (gPlayerEntity.y.HALF.HI < (gRoomControls.origin_y + 0x48)) {
|
||||
gPlayerEntity.y.HALF.HI = gRoomControls.origin_y + 0x48;
|
||||
}
|
||||
} else {
|
||||
if (--this->unk_0e == 0) {
|
||||
this->action = 3;
|
||||
this->unk_0e = 0x1e;
|
||||
if (--super->timer == 0) {
|
||||
super->action = 3;
|
||||
super->timer = 0x1e;
|
||||
MessageFromTarget(TEXT_INDEX(TEXT_VAATI2, 0x4f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805DF98(Manager* this) {
|
||||
void Vaati3StartManager_Type0_Action3(Vaati3StartManager* this) {
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
if (this->unk_0e != 0) {
|
||||
this->unk_0e -= 1;
|
||||
if (super->timer != 0) {
|
||||
super->timer--;
|
||||
} else {
|
||||
this->action = 4;
|
||||
super->action = 4;
|
||||
SetFade(FADE_IN_OUT | FADE_BLACK_WHITE | FADE_INSTANT, 4);
|
||||
SoundReq(SFX_EVAPORATE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805DFCC(Manager* this) {
|
||||
void Vaati3StartManager_Type0_Action4(Vaati3StartManager* this) {
|
||||
if (gFadeControl.active == 0) {
|
||||
ClearGlobalFlag(ZELDA_CHASE);
|
||||
sub_0805E094();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805DFE8(Manager* this) {
|
||||
static void (*const actionFuncs[])(Manager*) = {
|
||||
sub_0805E000,
|
||||
sub_0805E078,
|
||||
void Vaati3StartManager_Type1(Vaati3StartManager* this) {
|
||||
static void (*const Vaati3StartManager_Type1_Actions[])(Vaati3StartManager*) = {
|
||||
Vaati3StartManager_Type1_Init,
|
||||
Vaati3StartManager_Type1_Action1,
|
||||
};
|
||||
actionFuncs[this->action](this);
|
||||
Vaati3StartManager_Type1_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void sub_0805E000(Manager* this) {
|
||||
void Vaati3StartManager_Type1_Init(Vaati3StartManager* this) {
|
||||
Entity* enemy = CreateEnemy(VAATI_WRATH, 0);
|
||||
if (enemy != NULL) {
|
||||
enemy->x.HALF.HI = gRoomControls.origin_x + 0xb0;
|
||||
@@ -130,8 +137,8 @@ void sub_0805E000(Manager* this) {
|
||||
if ((gRoomTransition.field_0x38 & 1) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
*(Entity**)this->unk_18 = enemy;
|
||||
this->action = 1;
|
||||
super->child = enemy;
|
||||
super->action = 1;
|
||||
SetPlayerControl(3);
|
||||
gArea.queued_bgm = 0x80010000;
|
||||
SetFade(FADE_BLACK_WHITE | FADE_INSTANT, 4);
|
||||
@@ -139,9 +146,9 @@ void sub_0805E000(Manager* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805E078(Manager* this) {
|
||||
void Vaati3StartManager_Type1_Action1(Vaati3StartManager* this) {
|
||||
if (gFadeControl.active == 0) {
|
||||
*(u8*)(((int*)this->unk_18)[0] + 0xd) = 1;
|
||||
super->child->subAction = 1;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,22 @@
|
||||
#include "manager.h"
|
||||
#include "screen.h"
|
||||
#include "room.h"
|
||||
#include "functions.h"
|
||||
/**
|
||||
* @file vaatiAppearingManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Handles the appearing and disappearing effect for Vaati.
|
||||
*/
|
||||
#include "manager/vaatiAppearingManager.h"
|
||||
#include "area.h"
|
||||
#include "common.h"
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u32 field_0x20;
|
||||
u32 field_0x24;
|
||||
u32 field_0x28;
|
||||
} Manager32;
|
||||
|
||||
void sub_0805D9D8(Manager32*);
|
||||
void sub_0805D98C(Manager32*);
|
||||
void sub_0805D900(Manager32*);
|
||||
void sub_0805D860(Manager32*);
|
||||
void sub_0805D7DC(Manager32*);
|
||||
void sub_0805D9D8(VaatiAppearingManager*);
|
||||
void VaatiAppearingManager_Action3(VaatiAppearingManager*);
|
||||
void VaatiAppearingManager_Action2(VaatiAppearingManager*);
|
||||
void VaatiAppearingManager_Action1(VaatiAppearingManager*);
|
||||
void VaatiAppearingManager_Init(VaatiAppearingManager*);
|
||||
void sub_0805DA08(u32, u32, u32);
|
||||
|
||||
static const u8 gUnk_08108D74[] = { 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x0 };
|
||||
@@ -26,23 +25,23 @@ extern struct BgAffineDstData gUnk_02017AA0[];
|
||||
extern u8 gUnk_03003DE4[0xC];
|
||||
extern void sub_0805622C(struct BgAffineDstData*, u32, u32);
|
||||
|
||||
void Manager32_Main(Manager32* this) {
|
||||
static void (*const actionFuncs[])(Manager32*) = {
|
||||
sub_0805D7DC,
|
||||
sub_0805D860,
|
||||
sub_0805D900,
|
||||
sub_0805D98C,
|
||||
void VaatiAppearingManager_Main(VaatiAppearingManager* this) {
|
||||
static void (*const VaatiAppearingManager_Actions[])(VaatiAppearingManager*) = {
|
||||
VaatiAppearingManager_Init,
|
||||
VaatiAppearingManager_Action1,
|
||||
VaatiAppearingManager_Action2,
|
||||
VaatiAppearingManager_Action3,
|
||||
};
|
||||
actionFuncs[this->manager.action](this);
|
||||
VaatiAppearingManager_Actions[super->action](this);
|
||||
this->field_0x24 = gRoomTransition.frameCount << 4;
|
||||
sub_0805D9D8(this);
|
||||
sub_0805DA08(this->field_0x20, this->field_0x28, this->field_0x24);
|
||||
}
|
||||
|
||||
void sub_0805D7DC(Manager32* this) {
|
||||
void VaatiAppearingManager_Init(VaatiAppearingManager* this) {
|
||||
u32 index;
|
||||
|
||||
this->manager.action = (this->manager.unk_0a == 0) ? 1 : 2;
|
||||
super->action = (super->type == 0) ? 1 : 2;
|
||||
this->field_0x20 = 0;
|
||||
this->field_0x24 = 0;
|
||||
switch (gRoomControls.area) {
|
||||
@@ -74,32 +73,32 @@ void sub_0805D7DC(Manager32* this) {
|
||||
gScreen.bg3.control = 0x1e04;
|
||||
}
|
||||
|
||||
void sub_0805D860(Manager32* this) {
|
||||
switch (this->manager.unk_0d) {
|
||||
void VaatiAppearingManager_Action1(VaatiAppearingManager* this) {
|
||||
switch (super->subAction) {
|
||||
case 0:
|
||||
this->manager.unk_0d = 1;
|
||||
super->subAction = 1;
|
||||
this->field_0x20 = 0x80;
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||
break;
|
||||
case 1:
|
||||
if (--this->field_0x20 == 0x10) {
|
||||
this->manager.unk_0d = 2;
|
||||
this->manager.unk_0e = 0x2d;
|
||||
super->subAction = 2;
|
||||
super->timer = 0x2d;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
this->manager.unk_0d = 3;
|
||||
if (--super->timer == 0) {
|
||||
super->subAction = 3;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (--this->field_0x20 == 0) {
|
||||
this->manager.unk_0d = 4;
|
||||
this->manager.unk_0e = 0x3c;
|
||||
super->subAction = 4;
|
||||
super->timer = 0x3c;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
if (--super->timer == 0) {
|
||||
sub_0801E104();
|
||||
gScreen.lcd.displayControl &= ~DISPCNT_BG3_ON;
|
||||
DeleteThisEntity();
|
||||
@@ -107,26 +106,26 @@ void sub_0805D860(Manager32* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D900(Manager32* this) {
|
||||
switch (this->manager.unk_0d) {
|
||||
void VaatiAppearingManager_Action2(VaatiAppearingManager* this) {
|
||||
switch (super->subAction) {
|
||||
case 0:
|
||||
this->manager.unk_0d = 1;
|
||||
this->manager.unk_0e = 0x2d;
|
||||
super->subAction = 1;
|
||||
super->timer = 0x2d;
|
||||
this->field_0x20 = 1;
|
||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||
break;
|
||||
case 1:
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
this->manager.unk_0d = 2;
|
||||
this->manager.unk_0e = 0x14;
|
||||
if (--super->timer == 0) {
|
||||
super->subAction = 2;
|
||||
super->timer = 0x14;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
this->field_0x20 += 1;
|
||||
if (--this->manager.unk_0e != 0) {
|
||||
if (--super->timer != 0) {
|
||||
return;
|
||||
}
|
||||
this->manager.unk_0d = 3;
|
||||
super->subAction = 3;
|
||||
break;
|
||||
default:
|
||||
this->field_0x20 += 4;
|
||||
@@ -139,7 +138,7 @@ void sub_0805D900(Manager32* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D98C(Manager32* this) {
|
||||
void VaatiAppearingManager_Action3(VaatiAppearingManager* this) {
|
||||
if ((gInput.heldKeys & 0x40) != 0) {
|
||||
this->field_0x20 -= 1;
|
||||
}
|
||||
@@ -154,12 +153,11 @@ void sub_0805D98C(Manager32* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D9D8(Manager32* this) {
|
||||
// TODO find out the actual type of the parent of this manager.
|
||||
Manager* pMVar1 = this->manager.parent;
|
||||
if (pMVar1 != NULL) {
|
||||
gScreen.bg3.xOffset = 0x80 - (*(s16*)&pMVar1[1].unk_0e - gRoomControls.scroll_x);
|
||||
gScreen.bg3.yOffset = 0x8c - (*(s16*)(pMVar1[1].unk_11 + 1) - gRoomControls.scroll_y);
|
||||
void sub_0805D9D8(VaatiAppearingManager* this) {
|
||||
Entity* vaati = super->parent;
|
||||
if (vaati != NULL) {
|
||||
gScreen.bg3.xOffset = 0x80 - (vaati->x.HALF.HI - gRoomControls.scroll_x);
|
||||
gScreen.bg3.yOffset = 0x8c - (vaati->y.HALF.HI - gRoomControls.scroll_y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,13 +171,13 @@ void sub_0805DA08(u32 x, u32 y, u32 param_3) {
|
||||
sub_0805622C(&gUnk_02017AA0[gUnk_03003DE4[0] * 0xa0], REG_ADDR_BG3HOFS, 0xa2600001);
|
||||
}
|
||||
|
||||
void sub_0805DA90(Manager32* this, u32 param_2) {
|
||||
void CreateVaatiApparateManager(VaatiAppearingManager* this, u32 type) {
|
||||
Manager* manager = GetEmptyManager();
|
||||
if (manager != NULL) {
|
||||
manager->type = 9;
|
||||
manager->subtype = 0x32;
|
||||
manager->unk_0a = param_2;
|
||||
manager->parent = &this->manager;
|
||||
manager->kind = MANAGER;
|
||||
manager->id = VAATI_APPARATE_MANAGER;
|
||||
manager->type = type;
|
||||
manager->parent = (Entity*)super;
|
||||
AppendEntityToList((Entity*)manager, 8);
|
||||
}
|
||||
if (gArea.onEnter != NULL) {
|
||||
@@ -1,32 +1,30 @@
|
||||
#include "global.h"
|
||||
#include "screen.h"
|
||||
/**
|
||||
* @file verticalMinishPathBackgroundManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Parallax scrolling for MinishPaths vertical.
|
||||
*/
|
||||
#include "manager/verticalMinishPathBackgroundManager.h"
|
||||
#include "common.h"
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
#include "common.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u32 field_0x20[0x6];
|
||||
void* field_0x38;
|
||||
void* field_0x3c;
|
||||
} Manager2;
|
||||
|
||||
#include "screen.h"
|
||||
extern void sub_080576A0(void*);
|
||||
extern void sub_0805754C(Manager2*);
|
||||
extern void sub_0805754C(VerticalMinishPathBackgroundManager*);
|
||||
|
||||
extern u8 gMapDataTopSpecial[];
|
||||
|
||||
void Manager2_Main(Manager2* this) {
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
void VerticalMinishPathBackgroundManager_Main(VerticalMinishPathBackgroundManager* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
gScreen.bg3.updated = 0;
|
||||
gScreen.bg1.updated = 0;
|
||||
RegisterTransitionManager(this, sub_080576A0, 0);
|
||||
RegisterTransitionManager(this, sub_080576A0, NULL);
|
||||
}
|
||||
sub_0805754C(this);
|
||||
}
|
||||
|
||||
void sub_0805754C(Manager2* this) {
|
||||
void sub_0805754C(VerticalMinishPathBackgroundManager* this) {
|
||||
s32 bgOffset;
|
||||
|
||||
bgOffset = (gRoomControls.scroll_y - gRoomControls.origin_y);
|
||||
@@ -50,7 +48,7 @@ void sub_0805754C(Manager2* this) {
|
||||
void sub_080575C8(u32 param) {
|
||||
s32 bgOffset;
|
||||
|
||||
gMapTop.bgControlPtr = 0;
|
||||
gMapTop.bgSettings = 0;
|
||||
REG_DISPCNT = 0;
|
||||
LoadGfxGroup(param);
|
||||
gRoomVars.unk_10[0] = param;
|
||||
@@ -83,7 +81,7 @@ void sub_08057688(void) {
|
||||
|
||||
void sub_080576A0(void* this) {
|
||||
LoadGfxGroup(gRoomVars.unk_10[0]);
|
||||
((Manager2*)this)->field_0x38 = NULL;
|
||||
((Manager2*)this)->field_0x3c = NULL;
|
||||
sub_0805754C((Manager2*)this);
|
||||
((VerticalMinishPathBackgroundManager*)this)->field_0x38 = NULL;
|
||||
((VerticalMinishPathBackgroundManager*)this)->field_0x3c = NULL;
|
||||
sub_0805754C((VerticalMinishPathBackgroundManager*)this);
|
||||
}
|
||||
@@ -1,13 +1,20 @@
|
||||
/**
|
||||
* @file waterfallBottomManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Sets a tile at the bottom of the climb next to the waterfall in Temple of Droplets.
|
||||
*/
|
||||
#include "manager/waterfallBottomManager.h"
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
|
||||
void Manager2D_Main(Entity* this) {
|
||||
void WaterfallBottomManager_Main(WaterfallBottomManager* this) {
|
||||
SetTile(0x4014, 0x5c3, 1);
|
||||
if ((gRoomControls.origin_y + 200 < gPlayerEntity.y.HALF.HI) &&
|
||||
((u32)(gPlayerEntity.x.HALF.HI - gRoomControls.origin_x) - 0x30 < 0x11)) {
|
||||
gPlayerEntity.collisionLayer = 3;
|
||||
UpdateSpriteForCollisionLayer(&gPlayerEntity);
|
||||
}
|
||||
DeleteManager((Manager*)this);
|
||||
DeleteManager(super);
|
||||
}
|
||||
@@ -1,18 +1,23 @@
|
||||
#include "global.h"
|
||||
#include "asm.h"
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
/**
|
||||
* @file weatherChangeManager.c
|
||||
* @ingroup Managers
|
||||
*
|
||||
* @brief Weather change on top of Mount Crenel.
|
||||
*/
|
||||
#include "manager/weatherChangeManager.h"
|
||||
#include "area.h"
|
||||
#include "sound.h"
|
||||
#include "screen.h"
|
||||
#include "asm.h"
|
||||
#include "common.h"
|
||||
#include "fileselect.h"
|
||||
#include "functions.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
#include "sound.h"
|
||||
|
||||
void sub_080595E4(Manager10*);
|
||||
void sub_08059608(Manager10*);
|
||||
void sub_08059690(Manager10*);
|
||||
void sub_080596E0(Manager10*);
|
||||
void sub_080595E4(WeatherChangeManager*);
|
||||
void sub_08059608(WeatherChangeManager*);
|
||||
void sub_08059690(WeatherChangeManager*);
|
||||
void sub_080596E0(WeatherChangeManager*);
|
||||
u32 sub_08059844(void);
|
||||
u32 sub_0805986C(void);
|
||||
void sub_08059894(const u16*, const u16*, u32);
|
||||
@@ -28,15 +33,15 @@ extern u8 gUnk_02017700[];
|
||||
|
||||
extern const u16 gPalette_549[];
|
||||
|
||||
void Manager10_Main(Manager10* this) {
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
void WeatherChangeManager_Main(WeatherChangeManager* this) {
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
this->unk_21 = 0;
|
||||
this->unk_23 = 0;
|
||||
if (sub_0805986C()) {
|
||||
this->unk_20 = 1;
|
||||
this->unk_22 = 2;
|
||||
gMapTop.bgControlPtr = 0;
|
||||
gMapTop.bgSettings = 0;
|
||||
} else {
|
||||
this->unk_20 = 0x1F;
|
||||
this->unk_22 = 5;
|
||||
@@ -49,14 +54,14 @@ void Manager10_Main(Manager10* this) {
|
||||
sub_080596E0(this);
|
||||
}
|
||||
|
||||
void sub_080595E4(Manager10* this) {
|
||||
void sub_080595E4(WeatherChangeManager* this) {
|
||||
gRoomVars.unk_10[0] = 0xFF;
|
||||
sub_08059690(this);
|
||||
sub_080596E0(this);
|
||||
sub_0805B4D0(0);
|
||||
}
|
||||
|
||||
void sub_08059608(Manager10* this) {
|
||||
void sub_08059608(WeatherChangeManager* this) {
|
||||
if (this->unk_23) {
|
||||
if (!--this->unk_23) {
|
||||
gArea.bgm = gArea.queued_bgm;
|
||||
@@ -79,7 +84,7 @@ void sub_08059608(Manager10* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08059690(Manager10* this) {
|
||||
void sub_08059690(WeatherChangeManager* this) {
|
||||
if (sub_08059844()) {
|
||||
if (this->unk_20 == 0)
|
||||
return;
|
||||
@@ -93,7 +98,7 @@ void sub_08059690(Manager10* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080596E0(Manager10* this) {
|
||||
void sub_080596E0(WeatherChangeManager* this) {
|
||||
if ((gRoomTransition.frameCount & 7) == 0) {
|
||||
gScreen.bg1.xOffset += 8;
|
||||
gScreen.bg1.xOffset &= 0x1F;
|
||||
@@ -102,27 +107,27 @@ void sub_080596E0(Manager10* this) {
|
||||
if (this->unk_21 == 0 && this->unk_22 != 2) {
|
||||
this->unk_21 = 1;
|
||||
this->unk_22 = 3;
|
||||
this->manager.unk_0e = gUnk_08108390[3];
|
||||
gMapTop.bgControlPtr = 0;
|
||||
super->timer = gUnk_08108390[3];
|
||||
gMapTop.bgSettings = 0;
|
||||
}
|
||||
} else {
|
||||
if (this->unk_21 == 0 && this->unk_22 != 5) {
|
||||
this->unk_21 = 2;
|
||||
this->manager.unk_0e = gUnk_08108390[this->unk_22];
|
||||
super->timer = gUnk_08108390[this->unk_22];
|
||||
}
|
||||
}
|
||||
switch (this->unk_21) {
|
||||
case 1:
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
this->manager.unk_0e = gUnk_08108390[--this->unk_22];
|
||||
if (--super->timer == 0) {
|
||||
super->timer = gUnk_08108390[--this->unk_22];
|
||||
if (this->unk_22 == 2) {
|
||||
this->unk_21 = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
this->manager.unk_0e = gUnk_08108390[++this->unk_22];
|
||||
if (--super->timer == 0) {
|
||||
super->timer = gUnk_08108390[++this->unk_22];
|
||||
if (this->unk_22 == 5) {
|
||||
this->unk_21 = 0;
|
||||
}
|
||||
@@ -140,7 +145,7 @@ void sub_080596E0(Manager10* this) {
|
||||
LoadResourceAsync(gBG3Buffer, 0x600e800, 0x800);
|
||||
break;
|
||||
case 5:
|
||||
gMapTop.bgControlPtr = &gScreen.bg1.control;
|
||||
gMapTop.bgSettings = &gScreen.bg1;
|
||||
gScreen.lcd.displayControl |= 0x200;
|
||||
break;
|
||||
}
|
||||
+1
-1
@@ -134,7 +134,7 @@ static void sub_0806D02C(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0806D0B0(Entity* this) {
|
||||
gMapTop.bgControlPtr = 0;
|
||||
gMapTop.bgSettings = 0;
|
||||
LoadGfxGroup(0x30);
|
||||
sub_0806D110();
|
||||
MemClear(&gMapDataTopSpecial, 0x2000);
|
||||
|
||||
@@ -83,11 +83,11 @@ void sub_08069660(Entity* this) {
|
||||
void sub_08069684(void) {
|
||||
Manager* mgr;
|
||||
|
||||
if (FindEntityByID(MANAGER, 0x31, 8) == NULL) {
|
||||
if (FindEntityByID(MANAGER, GORON_MERCHANT_SHOP_MANAGER, 8) == NULL) {
|
||||
mgr = GetEmptyManager();
|
||||
if (mgr != NULL) {
|
||||
mgr->type = 9;
|
||||
mgr->subtype = 0x31;
|
||||
mgr->kind = MANAGER;
|
||||
mgr->id = GORON_MERCHANT_SHOP_MANAGER;
|
||||
AppendEntityToList((Entity*)mgr, 8);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-9
@@ -5,9 +5,9 @@
|
||||
#include "functions.h"
|
||||
|
||||
extern void sub_08095CB0(Entity*);
|
||||
extern void CreateManager36(Entity*);
|
||||
extern void DeleteManager36(Entity*);
|
||||
extern void sub_0805DA90(Entity*, u32);
|
||||
extern void CreateRepeatedSoundManager(Entity*);
|
||||
extern void DeleteRepeatedSoundManager(Entity*);
|
||||
extern void CreateVaatiApparateManager(Entity*, u32);
|
||||
|
||||
void VaatiAction0(Entity*);
|
||||
void VaatiAction1(Entity*);
|
||||
@@ -49,12 +49,12 @@ void VaatiAction1(Entity* this) {
|
||||
case 3:
|
||||
tmp = (*(ScriptExecutionContext**)&this->cutsceneBeh);
|
||||
tmp->intVariable = 4;
|
||||
CreateManager36(this);
|
||||
CreateRepeatedSoundManager(this);
|
||||
break;
|
||||
case 4:
|
||||
tmp = (*(ScriptExecutionContext**)&this->cutsceneBeh);
|
||||
tmp->intVariable = 4;
|
||||
DeleteManager36(this);
|
||||
DeleteRepeatedSoundManager(this);
|
||||
EnqueueSFX(SFX_21D);
|
||||
break;
|
||||
}
|
||||
@@ -118,12 +118,12 @@ void sub_08066B74(Entity* this, ScriptExecutionContext* context) {
|
||||
HandlePostScriptActions(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
|
||||
}
|
||||
|
||||
void sub_08066C94(Entity* this) {
|
||||
sub_0805DA90(this, 0);
|
||||
void Vaati_Apparate(Entity* this) {
|
||||
CreateVaatiApparateManager(this, 0);
|
||||
SoundReq(SFX_APPARATE);
|
||||
}
|
||||
|
||||
void sub_08066CA4(Entity* this) {
|
||||
sub_0805DA90(this, 1);
|
||||
void Vaati_Evaporate(Entity* this) {
|
||||
CreateVaatiApparateManager(this, 1);
|
||||
SoundReq(SFX_EVAPORATE);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
extern u32 CheckRectOnScreen(s16, s16, u32, u32);
|
||||
|
||||
/*
|
||||
This object is created by Manager13.
|
||||
This object is created by HouseSignManager.
|
||||
It checks whether the 0x10 x 0x10 rect at field_0x80, field_0x82 is still on the screen.
|
||||
If not, then it deletes itselfs and unsets the this->type2 bit in the managers field_0x20 bitfield.
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ void sub_08099E10(Entity*);
|
||||
void sub_08099E58(Entity*);
|
||||
void sub_08099E8C(Entity*);
|
||||
void nullsub_534(Entity*);
|
||||
extern void sub_0805B390(u32);
|
||||
extern void CreateHoleManager(u32);
|
||||
|
||||
void Object86(Entity* this) {
|
||||
static void (*const actionFuncs[])(Entity*) = {
|
||||
@@ -63,7 +63,7 @@ void sub_08099E8C(Entity* this) {
|
||||
RequestPriorityDuration(this, 0x1e);
|
||||
}
|
||||
if (CheckLocalFlag(0x75)) {
|
||||
sub_0805B390(0x7);
|
||||
CreateHoleManager(0x7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "player.h"
|
||||
#include "physics.h"
|
||||
|
||||
extern void sub_0805B390(u32);
|
||||
extern void CreateHoleManager(u32);
|
||||
|
||||
void ObjectAB_Init(Entity*);
|
||||
void ObjectAB_Action1(Entity*);
|
||||
@@ -45,7 +45,7 @@ void ObjectAB_Action2(Entity* this) {
|
||||
sub_080A0190(this);
|
||||
RequestPriorityDuration(this, 0x1e);
|
||||
if (EntityInRectRadius(this, &gPlayerEntity, 0x10, 0x10)) {
|
||||
sub_0805B390(0x37);
|
||||
CreateHoleManager(0x37);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+210
-10
@@ -14,6 +14,9 @@
|
||||
#include "new_player.h"
|
||||
#include "item.h"
|
||||
#include "message.h"
|
||||
#include "screen.h"
|
||||
#include "screen.h"
|
||||
#include "manager/diggingCaveEntranceManager.h"
|
||||
|
||||
static void sub_08077E54(ItemBehavior* beh);
|
||||
|
||||
@@ -127,6 +130,43 @@ extern const u16* sub_0806FC50(u32 param_1, u32 param_2);
|
||||
|
||||
bool32 sub_08079F48(u32 param_1, u32 param_2);
|
||||
|
||||
extern void sub_08080B60(LayerStruct*);
|
||||
extern void sub_0801AB08(u16*, LayerStruct*);
|
||||
|
||||
extern u8 gUnk_02006F00[];
|
||||
extern u16 gUnk_080B77C0[];
|
||||
|
||||
void sub_0807BFA8(void);
|
||||
void sub_080197D4(const void*);
|
||||
void sub_0807C8B0(u16*, u32, u32);
|
||||
void sub_0807C69C(u8*, u32, u32);
|
||||
void sub_0807C460(void);
|
||||
void sub_0807BBE4(void);
|
||||
void sub_0807BC84(void);
|
||||
void sub_0807C5F4(u16*, u16*);
|
||||
void sub_0807C5B0(void);
|
||||
|
||||
// collisions for metatiles < 0x4000
|
||||
extern const u8 gUnk_080B3E80[];
|
||||
// collisions for tiles > 0x4000
|
||||
extern const u8 gUnk_080B79A7[];
|
||||
|
||||
extern void sub_08080B60(LayerStruct*);
|
||||
extern void sub_0801AB08(u16*, LayerStruct*);
|
||||
|
||||
extern u8 gUnk_02006F00[];
|
||||
extern u16 gUnk_080B77C0[];
|
||||
|
||||
void sub_0807BFA8(void);
|
||||
void sub_080197D4(const void*);
|
||||
void sub_0807C8B0(u16*, u32, u32);
|
||||
void sub_0807C69C(u8*, u32, u32);
|
||||
void sub_0807C460(void);
|
||||
void sub_0807BBE4(void);
|
||||
void sub_0807BC84(void);
|
||||
void sub_0807C5F4(u16*, u16*);
|
||||
void sub_0807C5B0(void);
|
||||
|
||||
void sub_08077698(PlayerEntity* this) {
|
||||
ItemBehavior* puVar2;
|
||||
u32 idx;
|
||||
@@ -2466,7 +2506,43 @@ void sub_0807BB98(s32 basePosition, u32 layer, u32 width, u32 height) {
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/playerUtils/sub_0807BBE4.inc", void sub_0807BBE4())
|
||||
void sub_0807BBE4(void) {
|
||||
u32 tile;
|
||||
u8* topCollision;
|
||||
u8* bottomCollision;
|
||||
u32 index;
|
||||
u16* topMap;
|
||||
u16* bottomMap;
|
||||
u16* bottomMetatiles;
|
||||
u16* topMetatiles;
|
||||
|
||||
bottomMetatiles = gMapBottom.metatileTypes;
|
||||
topMetatiles = gMapTop.metatileTypes;
|
||||
|
||||
bottomMap = gMapBottom.mapData;
|
||||
topMap = gMapTop.mapData;
|
||||
bottomCollision = gMapBottom.collisionData;
|
||||
topCollision = gMapTop.collisionData;
|
||||
index = 0;
|
||||
for (index = 0; index < 0x40 * 0x40; index++) {
|
||||
tile = *bottomMap;
|
||||
bottomMap++;
|
||||
if (tile < 0x4000) {
|
||||
*bottomCollision = gUnk_080B3E80[bottomMetatiles[tile]];
|
||||
} else {
|
||||
*bottomCollision = gUnk_080B79A7[tile - 0x4000];
|
||||
}
|
||||
bottomCollision++;
|
||||
tile = (u32)*topMap;
|
||||
topMap++;
|
||||
if (tile < 0x4000) {
|
||||
*topCollision = gUnk_080B3E80[topMetatiles[tile]];
|
||||
} else {
|
||||
*topCollision = gUnk_080B79A7[tile - 0x4000];
|
||||
}
|
||||
topCollision++;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0807BC84(void) {
|
||||
s32 height;
|
||||
@@ -2661,7 +2737,107 @@ void sub_0807BFA8(void) {
|
||||
|
||||
ASM_FUNC("asm/non_matching/playerUtils/sub_0807BFD0.inc", void sub_0807BFD0())
|
||||
|
||||
ASM_FUNC("asm/non_matching/playerUtils/LoadRoomGfx.inc", void LoadRoomGfx())
|
||||
void LoadRoomGfx(void) {
|
||||
RoomControls* roomControls;
|
||||
bool32 tmp;
|
||||
|
||||
sub_0807BFA8();
|
||||
roomControls = &gRoomControls;
|
||||
roomControls->scroll_flags &= 0xfc;
|
||||
MemClear(gMapTop.mapData, 0x2000);
|
||||
MemClear(gMapTop.collisionData, 0x1000);
|
||||
MemClear(&gMapDataBottomSpecial, 0x8000);
|
||||
MemClear(&gMapDataTopSpecial, 0x8000);
|
||||
sub_080197D4((gArea.pCurrentRoomInfo)->map);
|
||||
if (gMapBottom.mapData[0] != 0xffff) {
|
||||
sub_0807C8B0(gMapBottom.mapData, roomControls->width >> 4, roomControls->height >> 4);
|
||||
sub_0807C8B0(gMapTop.mapData, roomControls->width >> 4, roomControls->height >> 4);
|
||||
tmp = FALSE;
|
||||
} else {
|
||||
MemClear(gMapBottom.mapData, 0x2000);
|
||||
tmp = TRUE;
|
||||
}
|
||||
if (gRoomTransition.field_0x2c[0] == 0) {
|
||||
MemCopy(gMapBottom.mapData, gMapBottom.mapDataClone, 0x2000);
|
||||
MemCopy(gMapTop.mapData, gMapTop.mapDataClone, 0x2000);
|
||||
} else if (gRoomTransition.field_0x2c[0] == 2) {
|
||||
MemCopy(gMapBottom.mapData, gMapBottom.unkData3, 0x1000);
|
||||
MemCopy(gMapBottom.mapDataClone, gMapBottom.mapData, 0x1000);
|
||||
MemCopy(gMapBottom.unkData3, gMapBottom.mapDataClone, 0x1000);
|
||||
MemCopy(gMapBottom.mapData + 0x800, gMapBottom.unkData3, 0x1000);
|
||||
MemCopy(gMapBottom.mapDataClone + 0x800, gMapBottom.mapData + 0x800, 0x1000);
|
||||
MemCopy(gMapBottom.unkData3, gMapBottom.mapDataClone + 0x800, 0x1000);
|
||||
MemCopy(gMapTop.mapData, gMapTop.unkData3, 0x1000);
|
||||
MemCopy(gMapTop.mapDataClone, gMapTop.mapData, 0x1000);
|
||||
MemCopy(gMapTop.unkData3, gMapTop.mapDataClone, 0x1000);
|
||||
MemCopy(gMapTop.mapData + 0x800, gMapTop.unkData3, 0x1000);
|
||||
MemCopy(gMapTop.mapDataClone + 0x800, gMapTop.mapData + 0x800, 0x1000);
|
||||
MemCopy(gMapTop.unkData3, gMapTop.mapDataClone + 0x800, 0x1000);
|
||||
}
|
||||
if (!tmp) {
|
||||
sub_0807BBE4();
|
||||
} else {
|
||||
sub_0807C69C(gMapBottom.collisionData, roomControls->width >> 4, roomControls->height >> 4);
|
||||
sub_0807C69C(gMapTop.collisionData, roomControls->width >> 4, roomControls->height >> 4);
|
||||
sub_0807C460();
|
||||
}
|
||||
sub_0807BC84();
|
||||
sub_08080B60(&gMapBottom);
|
||||
sub_08080B60(&gMapTop);
|
||||
if (!tmp) {
|
||||
sub_0801AB08((u16*)&gMapDataBottomSpecial, &gMapBottom);
|
||||
sub_0801AB08((u16*)&gMapDataTopSpecial, &gMapTop);
|
||||
} else {
|
||||
MemCopy(&gMapDataBottomSpecial, &gMapDataBottomSpecial[0x2000], 0x4000); // TODO
|
||||
sub_0807C5F4((u16*)&gMapDataBottomSpecial, &gMapDataBottomSpecial[0x2000]);
|
||||
MemClear(&gMapDataBottomSpecial[0x2000], 0x4000);
|
||||
MemCopy(&gMapDataTopSpecial, &gMapDataTopSpecial[0x2000], 0x4000);
|
||||
sub_0807C5F4((u16*)&gMapDataTopSpecial, (u16*)&gMapDataTopSpecial[0x2000]);
|
||||
MemClear(&gMapDataTopSpecial[0x2000], 0x4000);
|
||||
}
|
||||
if (tmp || roomControls->area == 0x71) {
|
||||
roomControls->scroll_flags |= 1;
|
||||
}
|
||||
|
||||
switch (roomControls->area) {
|
||||
case 0x20:
|
||||
case 0x2d:
|
||||
if (gMapBottom.bgSettings != NULL) {
|
||||
gMapBottom.bgSettings->control |= 0x80;
|
||||
}
|
||||
gScreen.lcd.displayControl &= 0xfdff;
|
||||
break;
|
||||
case 0x21:
|
||||
case 0x22:
|
||||
case 0x23:
|
||||
case 0x24:
|
||||
case 0x25:
|
||||
case 0x27:
|
||||
case 0x28:
|
||||
case 0x30:
|
||||
case 0x38:
|
||||
if (gMapTop.bgSettings != NULL) {
|
||||
gMapTop.bgSettings->control = gUnk_080B77C0[2];
|
||||
}
|
||||
sub_0807C5B0();
|
||||
break;
|
||||
default:
|
||||
if (gMapBottom.bgSettings != NULL) {
|
||||
gMapBottom.bgSettings->control = gUnk_080B77C0[0];
|
||||
}
|
||||
if (gMapTop.bgSettings != NULL) {
|
||||
gMapTop.bgSettings->control = gUnk_080B77C0[1];
|
||||
}
|
||||
|
||||
gScreen.lcd.displayControl = (gScreen.lcd.displayControl & 0x800) | DISPCNT_OBJ_ON | DISPCNT_BG2_ON |
|
||||
DISPCNT_BG1_ON | DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP;
|
||||
|
||||
if (gArea.lightType != 0) {
|
||||
gScreen.lcd.displayControl |= DISPCNT_OBJWIN_ON | DISPCNT_WIN0_ON;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0807C460(void) {
|
||||
u32 x;
|
||||
@@ -2692,24 +2868,48 @@ void sub_0807C460(void) {
|
||||
|
||||
ASM_FUNC("asm/non_matching/playerUtils/sub_0807C4F8.inc", void sub_0807C4F8())
|
||||
|
||||
ASM_FUNC("asm/non_matching/playerUtils/sub_0807C5B0.inc", void sub_0807C5B0())
|
||||
void sub_0807C5B0(void) {
|
||||
u8 colTop;
|
||||
u8 colBot;
|
||||
u8* puVar2;
|
||||
u8* collisionTop = gMapTop.collisionData;
|
||||
u32 thousand = 0x1000;
|
||||
u32 index = 0;
|
||||
RoomControls* roomControls = &gRoomControls;
|
||||
u8* collisionBottom = gMapBottom.collisionData;
|
||||
while (index < thousand) {
|
||||
colTop = collisionTop[index];
|
||||
if (colTop != 0) {
|
||||
if (colTop < 0x10) {
|
||||
colBot = collisionBottom[index];
|
||||
if (colBot < 0x10) {
|
||||
collisionBottom[index] = colTop | colBot;
|
||||
}
|
||||
} else {
|
||||
collisionBottom[index] = collisionTop[index];
|
||||
}
|
||||
}
|
||||
index++;
|
||||
}
|
||||
roomControls->scroll_flags |= 2;
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/playerUtils/sub_0807C5F4.inc", void sub_0807C5F4())
|
||||
ASM_FUNC("asm/non_matching/playerUtils/sub_0807C5F4.inc", void sub_0807C5F4(u16* a, u16* b))
|
||||
|
||||
ASM_FUNC("asm/non_matching/playerUtils/sub_0807C69C.inc", void sub_0807C69C())
|
||||
ASM_FUNC("asm/non_matching/playerUtils/sub_0807C69C.inc", void sub_0807C69C(u8* a, u32 b, u32 c))
|
||||
|
||||
ASM_FUNC("asm/non_matching/playerUtils/sub_0807C740.inc", void InitializeCamera())
|
||||
|
||||
void sub_0807C810(void) {
|
||||
struct_03004030* ptr;
|
||||
DiggingCaveEntranceTransition* ptr;
|
||||
Entity* player;
|
||||
RoomControls* ctrls;
|
||||
sub_0807BFD0();
|
||||
ptr = &gUnk_03004030;
|
||||
ptr = &gDiggingCaveEntranceTransition;
|
||||
player = &gPlayerEntity;
|
||||
ctrls = &gRoomControls;
|
||||
player->x.HALF.HI = ((ptr->unk_00)->unk_06 & 0x3f) * 0x10 + ctrls->origin_x + ptr->unk_04;
|
||||
player->y.HALF.HI = (((ptr->unk_00)->unk_06 & 0xfc0) >> 2) + ctrls->origin_y + ptr->unk_06;
|
||||
player->x.HALF.HI = ((ptr->entrance)->targetTilePosition & 0x3f) * 0x10 + ctrls->origin_x + ptr->offsetX;
|
||||
player->y.HALF.HI = (((ptr->entrance)->targetTilePosition & 0xfc0) >> 2) + ctrls->origin_y + ptr->offsetY;
|
||||
sub_080809D4();
|
||||
gUpdateVisibleTiles = 0;
|
||||
}
|
||||
@@ -2729,7 +2929,7 @@ void sub_0807C898(void) {
|
||||
gRoomTransition.field_0x2c[0] = 0;
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/playerUtils/sub_0807C8B0.inc", void sub_0807C8B0())
|
||||
ASM_FUNC("asm/non_matching/playerUtils/sub_0807C8B0.inc", void sub_0807C8B0(u16* a, u32 b, u32 c))
|
||||
|
||||
void LoadCompressedMapData(void* dest, u32 offset) {
|
||||
void* src;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "physics.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
|
||||
extern u32 sub_080B1AE0(u16, u8);
|
||||
|
||||
|
||||
+11
-11
@@ -1,16 +1,16 @@
|
||||
#include "global.h"
|
||||
#include "area.h"
|
||||
#include "room.h"
|
||||
#include "common.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "common.h"
|
||||
#include "object.h"
|
||||
#include "game.h"
|
||||
#include "global.h"
|
||||
#include "manager/bombableWallManager.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
|
||||
static void sub_0804B058(EntityData* dat);
|
||||
extern void sub_0801AC98(void);
|
||||
extern u32 sub_08049D1C(u32);
|
||||
extern Entity* LoadRoomEntity(const EntityData*);
|
||||
extern void* GetRoomProperty(u32, u32, u32);
|
||||
|
||||
extern void** gCurrentRoomProperties;
|
||||
@@ -65,7 +65,7 @@ NONMATCH("asm/non_matching/LoadRoomEntity.inc", Entity* LoadRoomEntity(const Ent
|
||||
if ((dat->flags & 0xF0) != 16) {
|
||||
v5->type2 = dat->type2;
|
||||
v5->timer = (dat->type2 & 0xFF00) >> 8;
|
||||
if (kind == 9)
|
||||
if (kind == MANAGER)
|
||||
return v5;
|
||||
sub_0804AF0C(v5, dat);
|
||||
if (v5->next == NULL)
|
||||
@@ -327,10 +327,10 @@ static void LoadSmallChestTile(TileEntity* tile) {
|
||||
}
|
||||
|
||||
static void LoadBombableWallTile(TileEntity* tile) {
|
||||
Manager24* mgr = (Manager24*)GetEmptyManager();
|
||||
BombableWallManager* mgr = (BombableWallManager*)GetEmptyManager();
|
||||
if (mgr != NULL) {
|
||||
mgr->manager.type = 9;
|
||||
mgr->manager.subtype = 0x24;
|
||||
mgr->base.kind = MANAGER;
|
||||
mgr->base.id = BOMBABLE_WALL_MANAGER;
|
||||
mgr->x = tile->tilePos;
|
||||
mgr->y = *(u16*)&tile->_6;
|
||||
mgr->field_0x35 = tile->_2;
|
||||
@@ -351,8 +351,8 @@ static void LoadDestructibleTile(TileEntity* tile) {
|
||||
gRoomVars.filler_0x1 = 1;
|
||||
mgr = GetEmptyManager();
|
||||
if (mgr != NULL) {
|
||||
mgr->type = 9;
|
||||
mgr->subtype = 0x2a;
|
||||
mgr->kind = MANAGER;
|
||||
mgr->id = DESTRUCTIBLE_TILE_OBSERVE_MANAGER;
|
||||
AppendEntityToList((Entity*)mgr, 6);
|
||||
}
|
||||
}
|
||||
|
||||
+49
-49
@@ -2516,7 +2516,7 @@ extern EntityData gUnk_additional_a_CaveOfFlamesBoss_Main;
|
||||
void sub_StateChange_CaveOfFlamesBoss_Main(void) {
|
||||
|
||||
if (CheckGlobalFlag(LV2_CLEAR)) {
|
||||
gMapTop.bgControlPtr = 0;
|
||||
gMapTop.bgSettings = 0;
|
||||
gScreen.lcd.displayControl &= ~DISPCNT_BG1_ON;
|
||||
sub_0807AABC(&gPlayerEntity);
|
||||
LoadRoomEntityList(&gUnk_additional_a_CaveOfFlamesBoss_Main);
|
||||
@@ -3161,7 +3161,7 @@ extern EntityData gUnk_080E72C4;
|
||||
extern EntityData gUnk_additional_8_PalaceOfWinds_GyorgTornado;
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_GyorgTornado(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
if (CheckGlobalFlag(LV5_CLEAR)) {
|
||||
LoadRoomEntityList(&gUnk_additional_9_PalaceOfWinds_GyorgTornado);
|
||||
}
|
||||
@@ -3183,7 +3183,7 @@ u32 sub_unk3_PalaceOfWinds_BossKey(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_BossKey(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_BeforeBallAndChainSoldiers(void) {
|
||||
@@ -3191,7 +3191,7 @@ u32 sub_unk3_PalaceOfWinds_BeforeBallAndChainSoldiers(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_BeforeBallAndChainSoldiers(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_GyorgBossDoor(void) {
|
||||
@@ -3199,7 +3199,7 @@ u32 sub_unk3_PalaceOfWinds_GyorgBossDoor(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_GyorgBossDoor(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_EastChestFromGyorgBossDoor(void) {
|
||||
@@ -3207,7 +3207,7 @@ u32 sub_unk3_PalaceOfWinds_EastChestFromGyorgBossDoor(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_EastChestFromGyorgBossDoor(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_MoblinAndWizzrobeFight(void) {
|
||||
@@ -3215,7 +3215,7 @@ u32 sub_unk3_PalaceOfWinds_MoblinAndWizzrobeFight(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_MoblinAndWizzrobeFight(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_FourButtonStalfos(void) {
|
||||
@@ -3223,7 +3223,7 @@ u32 sub_unk3_PalaceOfWinds_FourButtonStalfos(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_FourButtonStalfos(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_FanAndKeyToBossKey(void) {
|
||||
@@ -3231,7 +3231,7 @@ u32 sub_unk3_PalaceOfWinds_FanAndKeyToBossKey(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_FanAndKeyToBossKey(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_BallAndChainSoldiers(void) {
|
||||
@@ -3239,7 +3239,7 @@ u32 sub_unk3_PalaceOfWinds_BallAndChainSoldiers(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_BallAndChainSoldiers(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_BombarossaPath(void) {
|
||||
@@ -3247,7 +3247,7 @@ u32 sub_unk3_PalaceOfWinds_BombarossaPath(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_BombarossaPath(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_HoleToDarknut(void) {
|
||||
@@ -3255,7 +3255,7 @@ u32 sub_unk3_PalaceOfWinds_HoleToDarknut(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_HoleToDarknut(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_ToBombarossaPath(void) {
|
||||
@@ -3263,7 +3263,7 @@ u32 sub_unk3_PalaceOfWinds_ToBombarossaPath(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_ToBombarossaPath(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_DarknutMiniboss(void) {
|
||||
@@ -3271,7 +3271,7 @@ u32 sub_unk3_PalaceOfWinds_DarknutMiniboss(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_DarknutMiniboss(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_BombWallInside(void) {
|
||||
@@ -3279,7 +3279,7 @@ u32 sub_unk3_PalaceOfWinds_BombWallInside(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_BombWallInside(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_BombWallOutside(void) {
|
||||
@@ -3287,7 +3287,7 @@ u32 sub_unk3_PalaceOfWinds_BombWallOutside(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_BombWallOutside(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_CloudJumps(void) {
|
||||
@@ -3295,7 +3295,7 @@ u32 sub_unk3_PalaceOfWinds_CloudJumps(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_CloudJumps(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_BlockMazeToBossDoor(void) {
|
||||
@@ -3303,7 +3303,7 @@ u32 sub_unk3_PalaceOfWinds_BlockMazeToBossDoor(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_BlockMazeToBossDoor(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_CrackedFloorLakitu(void) {
|
||||
@@ -3311,7 +3311,7 @@ u32 sub_unk3_PalaceOfWinds_CrackedFloorLakitu(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_CrackedFloorLakitu(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_HeartPieceBridge(void) {
|
||||
@@ -3319,7 +3319,7 @@ u32 sub_unk3_PalaceOfWinds_HeartPieceBridge(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_HeartPieceBridge(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_FanBridge(void) {
|
||||
@@ -3327,7 +3327,7 @@ u32 sub_unk3_PalaceOfWinds_FanBridge(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_FanBridge(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_ToFanBridge(void) {
|
||||
@@ -3335,7 +3335,7 @@ u32 sub_unk3_PalaceOfWinds_ToFanBridge(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_ToFanBridge(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_RedWarpHall(void) {
|
||||
@@ -3350,7 +3350,7 @@ u32 sub_unk3_PalaceOfWinds_PlatformCloneRide(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_PlatformCloneRide(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_PitCornerAfterKey(void) {
|
||||
@@ -3358,7 +3358,7 @@ u32 sub_unk3_PalaceOfWinds_PitCornerAfterKey(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_PitCornerAfterKey(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_CrowRide(void) {
|
||||
@@ -3366,7 +3366,7 @@ u32 sub_unk3_PalaceOfWinds_CrowRide(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_CrowRide(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_GratePlatformRide(void) {
|
||||
@@ -3374,7 +3374,7 @@ u32 sub_unk3_PalaceOfWinds_GratePlatformRide(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_GratePlatformRide(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_PotPush(void) {
|
||||
@@ -3382,7 +3382,7 @@ u32 sub_unk3_PalaceOfWinds_PotPush(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_PotPush(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_FloormasterLever(void) {
|
||||
@@ -3432,7 +3432,7 @@ u32 sub_unk3_PalaceOfWinds_GratesTo3F(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_GratesTo3F(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_SpinyFight(void) {
|
||||
@@ -3440,7 +3440,7 @@ u32 sub_unk3_PalaceOfWinds_SpinyFight(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_SpinyFight(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_PeahatSwitch(void) {
|
||||
@@ -3448,7 +3448,7 @@ u32 sub_unk3_PalaceOfWinds_PeahatSwitch(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_PeahatSwitch(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_WhirlwindBombarossa(void) {
|
||||
@@ -3456,7 +3456,7 @@ u32 sub_unk3_PalaceOfWinds_WhirlwindBombarossa(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_WhirlwindBombarossa(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_DoorToStalfosFirebar(void) {
|
||||
@@ -3506,7 +3506,7 @@ u32 sub_unk3_PalaceOfWinds_SpikeBarSmallKey(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_SpikeBarSmallKey(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_RocCape(void) {
|
||||
@@ -3516,7 +3516,7 @@ u32 sub_unk3_PalaceOfWinds_RocCape(void) {
|
||||
extern EntityData gUnk_080EA09C;
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_RocCape(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
if (!CheckLocalFlag(0x70)) {
|
||||
LoadRoomEntityList(&gUnk_080EA09C);
|
||||
}
|
||||
@@ -3527,7 +3527,7 @@ u32 sub_unk3_PalaceOfWinds_FireBarGrates(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_FireBarGrates(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_PlatformRideBombarossas(void) {
|
||||
@@ -3535,7 +3535,7 @@ u32 sub_unk3_PalaceOfWinds_PlatformRideBombarossas(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_PlatformRideBombarossas(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_BridgeAfterDarknut(void) {
|
||||
@@ -3543,7 +3543,7 @@ u32 sub_unk3_PalaceOfWinds_BridgeAfterDarknut(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_BridgeAfterDarknut(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_BridgeSwitchesCloneBlock(void) {
|
||||
@@ -3551,7 +3551,7 @@ u32 sub_unk3_PalaceOfWinds_BridgeSwitchesCloneBlock(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_BridgeSwitchesCloneBlock(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_EntranceRoom(void) {
|
||||
@@ -3559,7 +3559,7 @@ u32 sub_unk3_PalaceOfWinds_EntranceRoom(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_PalaceOfWinds_EntranceRoom(void) {
|
||||
Manager19_Main(NULL);
|
||||
PowBackgroundManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_PalaceOfWinds_DarkCompassHall(void) {
|
||||
@@ -3590,7 +3590,7 @@ u32 sub_unk3_Vaati3_Main(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_Vaati3_Main(void) {
|
||||
Manager2F_Main(NULL);
|
||||
Vaati3BackgroundManager_Main(NULL);
|
||||
|
||||
if ((gRoomTransition.field_0x38 & 1) && gRoomTransition.field_0x39) {
|
||||
if (gRoomTransition.field_0x3c == 1) {
|
||||
@@ -5630,7 +5630,7 @@ u32 sub_unk3_HyruleField_WesternWoodSouth(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_HyruleField_WesternWoodSouth(void) {
|
||||
Manager18_Main(0);
|
||||
CloudOverlayManager_Main(0);
|
||||
}
|
||||
|
||||
u32 sub_unk3_HyruleField_SouthHyruleField(void) {
|
||||
@@ -5646,7 +5646,7 @@ extern EntityData gUnk_080F70D8;
|
||||
extern EntityData gUnk_080F7088;
|
||||
|
||||
void sub_StateChange_HyruleField_SouthHyruleField(void) {
|
||||
Manager18_Main(NULL);
|
||||
CloudOverlayManager_Main(NULL);
|
||||
if (!CheckLocalFlag(SOUGEN_01_ZELDA)) {
|
||||
LoadRoomEntityList(&gUnk_080F70A8);
|
||||
ClearGlobalFlag(ZELDA_CHASE);
|
||||
@@ -5673,7 +5673,7 @@ u32 sub_unk3_HyruleField_EasternHillsSouth(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_HyruleField_EasternHillsSouth(void) {
|
||||
Manager18_Main(NULL);
|
||||
CloudOverlayManager_Main(NULL);
|
||||
}
|
||||
|
||||
u32 sub_unk3_HyruleField_EasternHillsCenter(void) {
|
||||
@@ -5681,7 +5681,7 @@ u32 sub_unk3_HyruleField_EasternHillsCenter(void) {
|
||||
}
|
||||
|
||||
void sub_StateChange_HyruleField_EasternHillsCenter(void) {
|
||||
Manager18_Main(NULL);
|
||||
CloudOverlayManager_Main(NULL);
|
||||
}
|
||||
|
||||
extern u32 gUnk_080F7680;
|
||||
@@ -5697,7 +5697,7 @@ extern EntityData gUnk_080F7500;
|
||||
extern EntityData gUnk_080F7550;
|
||||
|
||||
void sub_StateChange_HyruleField_EasternHillsNorth(void) {
|
||||
Manager18_Main(NULL);
|
||||
CloudOverlayManager_Main(NULL);
|
||||
if (gSave.global_progress > 3) {
|
||||
LoadRoomEntityList(&gUnk_080F7500);
|
||||
}
|
||||
@@ -5722,7 +5722,7 @@ extern EntityData gUnk_080F78A0;
|
||||
|
||||
void sub_StateChange_HyruleField_LonLonRanch(void) {
|
||||
|
||||
Manager18_Main(0);
|
||||
CloudOverlayManager_Main(0);
|
||||
if (CheckLocalFlagByBank(FLAG_BANK_2, 0x8f)) {
|
||||
if (!CheckGlobalFlag(INLOCK)) {
|
||||
LoadRoomEntityList(&gUnk_080F77C0);
|
||||
@@ -5767,7 +5767,7 @@ u32 sub_unk3_HyruleField_OutsideCastle(void) {
|
||||
}
|
||||
|
||||
void sub_0804F4E4(void) {
|
||||
Manager18_Main(NULL);
|
||||
CloudOverlayManager_Main(NULL);
|
||||
sub_0804F578();
|
||||
}
|
||||
|
||||
@@ -5947,7 +5947,7 @@ u32 sub_unk3_HyruleField_TrilbyHighlands(void) {
|
||||
extern EntityData gUnk_080F806C;
|
||||
|
||||
void sub_StateChange_HyruleField_TrilbyHighlands(void) {
|
||||
Manager18_Main(NULL);
|
||||
CloudOverlayManager_Main(NULL);
|
||||
if ((gSave.global_progress > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
|
||||
LoadRoomEntityList(&gUnk_080F806C);
|
||||
}
|
||||
@@ -5960,7 +5960,7 @@ u32 sub_unk3_HyruleField_WesternWoodsNorth(void) {
|
||||
extern EntityData gUnk_080F82E0;
|
||||
|
||||
void sub_StateChange_HyruleField_WesternWoodsNorth(void) {
|
||||
Manager18_Main(NULL);
|
||||
CloudOverlayManager_Main(NULL);
|
||||
if (CheckGlobalFlag(LV2_CLEAR) && GetInventoryValue(ITEM_RED_SWORD) && !CheckLocalFlag(SOUGEN_08_TORITSUKI)) {
|
||||
LoadRoomEntityList(&gUnk_080F82E0);
|
||||
}
|
||||
@@ -5973,7 +5973,7 @@ u32 sub_unk3_HyruleField_WesternWoodsCenter(void) {
|
||||
extern EntityData gUnk_080F8430;
|
||||
|
||||
void sub_StateChange_HyruleField_WesternWoodsCenter(void) {
|
||||
Manager18_Main(NULL);
|
||||
CloudOverlayManager_Main(NULL);
|
||||
if (CheckKinstoneFused(KINSTONE_21) && !CheckLocalFlagByBank(FLAG_BANK_2, 0x42)) {
|
||||
LoadRoomEntityList(&gUnk_080F8430);
|
||||
}
|
||||
|
||||
+10
-9
@@ -1,3 +1,4 @@
|
||||
#include "scroll.h"
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "structures.h"
|
||||
@@ -8,6 +9,7 @@
|
||||
#include "common.h"
|
||||
#include "fileselect.h"
|
||||
#include "screen.h"
|
||||
#include "manager/diggingCaveEntranceManager.h"
|
||||
|
||||
extern void sub_08080BC4(void);
|
||||
extern void sub_080197D4(const void*);
|
||||
@@ -45,7 +47,6 @@ void sub_08080040(RoomControls*);
|
||||
void sub_08080108(RoomControls*);
|
||||
void sub_08080198(RoomControls*);
|
||||
void sub_080801BC(RoomControls*);
|
||||
void UpdateIsDiggingCave(void);
|
||||
u32 sub_080803D0();
|
||||
u32 sub_08080278();
|
||||
void sub_08080C80(u32*);
|
||||
@@ -200,7 +201,7 @@ void sub_0807FF6C(RoomControls* controls) {
|
||||
gScreen.controls.window1VerticalDimensions = 0xf0;
|
||||
ResetPlayerItem();
|
||||
ResetPlayerAnimationAndAction();
|
||||
if (gUnk_03004030.isDiggingCave) {
|
||||
if (gDiggingCaveEntranceTransition.isDiggingCave) {
|
||||
gPlayerEntity.animationState = 4;
|
||||
} else {
|
||||
gPlayerEntity.animationState = 0;
|
||||
@@ -212,7 +213,7 @@ void sub_0807FFE4(RoomControls* controls) {
|
||||
controls->unk4 = 2;
|
||||
controls->filler2[0] = sub_080803D0() + 6;
|
||||
gUnk_0200B640 = sub_08080278();
|
||||
sub_080197D4(*gUnk_08109194[gUnk_03004030.unk_00->unk_03]);
|
||||
sub_080197D4(*gUnk_08109194[gDiggingCaveEntranceTransition.entrance->type]);
|
||||
sub_0807C8B0(gMapDataTop, controls->width >> 4, controls->height >> 4);
|
||||
sub_0801AB08(gMapDataTopSpecial, gMapDataTop - 4);
|
||||
}
|
||||
@@ -253,7 +254,7 @@ void sub_08080040(RoomControls* controls) {
|
||||
controls->unk4 = 3;
|
||||
DeleteSleepingEntities();
|
||||
sub_0807C810();
|
||||
sub_08080C80(*(gUnk_08109194[gUnk_03004030.unk_00->unk_03] + 1));
|
||||
sub_08080C80(*(gUnk_08109194[gDiggingCaveEntranceTransition.entrance->type] + 1));
|
||||
} else {
|
||||
gUpdateVisibleTiles = 4;
|
||||
}
|
||||
@@ -344,18 +345,18 @@ void UpdateIsDiggingCave(void) {
|
||||
case AREA_VEIL_FALLS_DIG_CAVE:
|
||||
case AREA_CASTOR_WILDS_DIG_CAVE:
|
||||
case AREA_HYLIA_DIG_CAVES:
|
||||
gUnk_03004030.isDiggingCave = 1;
|
||||
gDiggingCaveEntranceTransition.isDiggingCave = 1;
|
||||
return;
|
||||
}
|
||||
gUnk_03004030.isDiggingCave = 0;
|
||||
gDiggingCaveEntranceTransition.isDiggingCave = 0;
|
||||
}
|
||||
|
||||
void ClearTilemaps(void) {
|
||||
// Is gRoomControls 4 bytes bigger?
|
||||
MemClear(&gRoomControls, 0x38);
|
||||
MemClear(&gUnk_03004030, sizeof(gUnk_03004030));
|
||||
MemClear(&gDiggingCaveEntranceTransition, sizeof(gDiggingCaveEntranceTransition));
|
||||
gRoomControls.filler3 = 0xffff;
|
||||
gUnk_03004030.unk_0a = 0xff;
|
||||
gDiggingCaveEntranceTransition.previousArea = 0xff;
|
||||
gUnk_02034480.unk_00 = 0;
|
||||
MemClear(&gMapDataBottomSpecial, 0x8000);
|
||||
MemClear(&gMapDataTopSpecial, 0x8000);
|
||||
@@ -522,7 +523,7 @@ void sub_0808091C(const ScreenTransitionData* param_1, u32 param_2) {
|
||||
gRoomTransition.type = param_2;
|
||||
}
|
||||
|
||||
void sub_08080930(void) {
|
||||
void sub_08080930(u32 unused) {
|
||||
gRoomControls.unk3 = 5;
|
||||
gRoomControls.unk4 = 0;
|
||||
gRoomControls.reload_flags = 2;
|
||||
|
||||
+14
-13
@@ -1,18 +1,19 @@
|
||||
#include "global.h"
|
||||
#include "menu.h"
|
||||
#include "asm.h"
|
||||
#include "common.h"
|
||||
#include "effects.h"
|
||||
#include "fade.h"
|
||||
#include "flags.h"
|
||||
#include "sound.h"
|
||||
#include "room.h"
|
||||
#include "functions.h"
|
||||
#include "effects.h"
|
||||
#include "asm.h"
|
||||
#include "save.h"
|
||||
#include "global.h"
|
||||
#include "kinstone.h"
|
||||
#include "screen.h"
|
||||
#include "common.h"
|
||||
#include "object.h"
|
||||
#include "manager/bombableWallManager.h"
|
||||
#include "menu.h"
|
||||
#include "message.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
#include "save.h"
|
||||
#include "screen.h"
|
||||
#include "sound.h"
|
||||
|
||||
extern void (*const gUnk_080FEEB8[])(void);
|
||||
|
||||
@@ -212,10 +213,10 @@ void sub_08054E9C(void) {
|
||||
}
|
||||
|
||||
void sub_08054EB8(Entity* this, ScriptExecutionContext* context) {
|
||||
Manager24* manager = (Manager24*)GetEmptyManager();
|
||||
BombableWallManager* manager = (BombableWallManager*)GetEmptyManager();
|
||||
if (manager != NULL) {
|
||||
(manager->manager).type = 9;
|
||||
(manager->manager).subtype = 0x24;
|
||||
manager->base.kind = MANAGER;
|
||||
manager->base.id = BOMBABLE_WALL_MANAGER;
|
||||
manager->x = this->x.HALF.HI - gRoomControls.origin_x;
|
||||
manager->y = (this->y.HALF.HI - gRoomControls.origin_y) - 0x10;
|
||||
manager->field_0x35 = 1;
|
||||
|
||||
+6
-6
@@ -1244,7 +1244,7 @@ void sub_080A67C4(u32 param_1) {
|
||||
|
||||
LoadGfxGroup(iVar4);
|
||||
ptr = &gUnk_08128E94[param_1];
|
||||
puVar2 = &gUnk_02017AA0[gUnk_03003DE4 * 0x500];
|
||||
puVar2 = &gUnk_02017AA0[gUnk_03003DE4[0] * 0x500];
|
||||
|
||||
for (i = 0; i <= 7; puVar2++, i++) {
|
||||
*puVar2 = 0x1e0a;
|
||||
@@ -1258,7 +1258,7 @@ void sub_080A67C4(u32 param_1) {
|
||||
*puVar2 = 0x1e0a;
|
||||
}
|
||||
|
||||
sub_0805622C(&gUnk_02017AA0[gUnk_03003DE4 * 0x500], REG_ADDR_BG3CNT, 0xa2600001);
|
||||
sub_0805622C((struct BgAffineDstData*)&gUnk_02017AA0[gUnk_03003DE4[0] * 0x500], REG_ADDR_BG3CNT, 0xa2600001);
|
||||
gMenu.field_0xa = ptr->unk2 >> 1;
|
||||
MemClear(&gMapDataBottomSpecial, 0x400);
|
||||
}
|
||||
@@ -1791,8 +1791,8 @@ void Subtask_FadeIn(void) {
|
||||
gUI.unk_d = gRoomTransition.field_0x2c[2];
|
||||
gUI.controlMode = gPlayerState.controlMode;
|
||||
gUI.currentRoomProperties = gCurrentRoomProperties;
|
||||
gUI.mapBottomBgControlPtr = gMapBottom.bgControlPtr;
|
||||
gUI.mapTopBgControlPtr = gMapTop.bgControlPtr;
|
||||
gUI.mapBottomBgSettings = gMapBottom.bgSettings;
|
||||
gUI.mapTopBgSettings = gMapTop.bgSettings;
|
||||
gUI.nextToLoad = 1;
|
||||
}
|
||||
}
|
||||
@@ -1821,8 +1821,8 @@ void Subtask_FadeOut(void) {
|
||||
sub_0805E974();
|
||||
gCurrentRoomProperties = gUI.currentRoomProperties;
|
||||
gPlayerState.controlMode = gUI.controlMode;
|
||||
gMapBottom.bgControlPtr = gUI.mapBottomBgControlPtr;
|
||||
gMapTop.bgControlPtr = gUI.mapTopBgControlPtr;
|
||||
gMapBottom.bgSettings = gUI.mapBottomBgSettings;
|
||||
gMapTop.bgSettings = gUI.mapTopBgSettings;
|
||||
MemCopy(&gUI.activeScriptInfo, &gActiveScriptInfo, sizeof(ActiveScriptInfo));
|
||||
MemCopy(gUI.unk_2a8, gUnk_03000420, sizeof(gUI.unk_2a8));
|
||||
MemCopy(gUI.palettes, gPaletteList, sizeof(gUI.palettes));
|
||||
|
||||
Reference in New Issue
Block a user