code_801323D0 (z_schedule) (#509)

* OK

* Initial documentation pass

* Pass 2. Add script by Tharo

* Renamed source file

* Documentation cleanup

* Update to latest master

* Feedback

* Bad merge

* Permissions

* Clang format

* Feedback

* format

* Use calculation instead of constant

* Rename as per suggestions

* Fix bss ordering and minor merge conflicts (from Maide)

* Update to current codebase and address feedback

* Fixup names to match new enums

* Format

* Fix duplicate include

* BSS shenanigans
This commit is contained in:
Rozelette
2022-05-21 12:08:19 -04:00
committed by GitHub
parent 0ccd71c2da
commit e67fb5cf16
32 changed files with 1872 additions and 506 deletions
+3 -22
View File
@@ -2007,7 +2007,7 @@ s32 func_80123810(GlobalContext* globalCtx);
void func_80123AA4(Player* player, s32 arg1);
// void func_80123BD4(void);
// void func_80123C58(void);
void Player_SetEquipmentData(GlobalContext* globalCtx, Player* this);
void Player_SetEquipmentData(GlobalContext* globalCtx, Player* this);
void func_80123D50(GlobalContext* globalCtx, Player* player, UNK_TYPE arg2, UNK_TYPE arg3);
void func_80123DA4(Player* player);
// void func_80123DC0(void);
@@ -2299,26 +2299,7 @@ s32 Entrance_GetSceneNum(u16 entranceIndex);
s32 Entrance_GetSceneNumAbsolute(u16 entranceIndex);
s32 Entrance_GetSpawnNum(u16 entranceIndex);
s32 Entrance_GetTransitionFlags(u16 entranceIndex);
// void func_801323D0(void);
// void func_80132428(void);
// void func_80132494(void);
// void func_801326B8(void);
// void func_801328F0(void);
// void func_80132920(void);
// void func_80132938(void);
// void func_80132954(void);
// void func_8013296C(void);
// void func_80132A18(void);
// void func_80132A3C(void);
// void func_80132A80(void);
// void func_80132AD8(void);
// void func_80132B24(void);
// void func_80132B84(void);
// void func_80132D70(void);
// void func_80132E9C(void);
// void func_80132FDC(void);
// void func_80133000(void);
UNK_TYPE func_80133038(GlobalContext* globalCtx, UNK_TYPE* arg1, struct_80133038_arg2* arg2);
s32 Schedule_RunScript(GlobalContext* globalCtx, u8* script, ScheduleResult* result);
void SkelAnime_DrawLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, s32 lod);
void SkelAnime_DrawLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, s32 lod);
void SkelAnime_DrawFlexLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor, s32 lod, Mtx** mtx);
@@ -2566,7 +2547,7 @@ s32 func_80142440(SkyboxContext* skyboxCtx, Vtx* vtx, s32 arg2, s32 arg3, s32 ar
void func_80143148(SkyboxContext* skyboxCtx, s32 arg1);
void func_801431E8(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyType);
void func_80143324(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyType);
void func_801434E4(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyType);
void func_801434E4(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyType);
Mtx* SkyboxDraw_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z);
void SkyboxDraw_SetColors(SkyboxContext* skyboxCtx, u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB);
void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z);
+3 -8
View File
@@ -39,6 +39,7 @@
#include "z64player.h"
#include "z64save.h"
#include "z64scene.h"
#include "z64schedule.h"
#include "z64skin.h"
#include "z64subs.h"
#include "z64transition.h"
@@ -883,7 +884,7 @@ typedef struct {
/* 0x12070 */ s32 unk12070;
/* 0x12074 */ UNK_TYPE1 pad12074[0x4];
/* 0x12078 */ s32 bankRupeesSelected;
/* 0x1207C */ s32 bankRupees;
/* 0x1207C */ s32 bankRupees;
/* 0x12080 */ MessageTableEntry* messageEntryTable;
/* 0x12084 */ MessageTableEntry* messageEntryTableNes;
/* 0x12088 */ UNK_TYPE4 unk12088;
@@ -1223,7 +1224,7 @@ typedef struct {
/* 0x12C */ UNK_TYPE1 pad_12C[0x4];
/* 0x130 */ OSThread thread;
} AudioMgr; // size = 0x2E0
typedef struct {
/* 0x00 */ MtxF displayMatrix;
/* 0x40 */ Actor* actor;
@@ -1397,12 +1398,6 @@ typedef struct {
/* 0x24 */ s16 unk_24;
} struct_800BD888_arg1; // size = 0x28
typedef struct {
/* 0x0 */ u8 unk0;
/* 0x4 */ s32 unk4;
/* 0x8 */ s32 unk8; // game script pointer?
} struct_80133038_arg2; // size = 0xC
typedef struct {
/* 0x00 */ u32 type;
/* 0x04 */ u32 setScissor;
+248
View File
@@ -0,0 +1,248 @@
#ifndef Z64SCHEDULE_H
#define Z64SCHEDULE_H
#include "ultra64.h"
/*
Schedule is a subsystem that acts as a way to make decisions based on the
time and scene (and a limited selection of items). It is utilized by writing
a script that is encoded into bytecode and ran, returning the result in a
struct. The returned result can be a value or a encoded time value.
The scripts contain 2 kinds of instructions:
- Checks with branches (relative offsets, either 1-byte offsets (short, *_S),
or 2-byte offsets (long, *_L))
- Returns
Scripts are stored as u8[]. They are built using the macros are the bottom of
this file. The scheduledis.py script can be used to convert any scripts in
actor data into the macros.
*/
// Macro to convert the time format used in the save struct into the format used in Schedule
#define SCHEDULE_CONVERT_TIME(time) ((time) - 0x10000 / 360 * 90)
#define SCHEDULE_TIME_NOW SCHEDULE_CONVERT_TIME(gSaveContext.save.time)
typedef enum {
/* 00 */ SCHEDULE_CMD_ID_CHECK_FLAG_S, // Checks if a weekEventReg flag is set and branches if so, short range branch
/* 01 */ SCHEDULE_CMD_ID_CHECK_FLAG_L, // Checks if a weekEventReg flag is set and branches if so, long range branch
/* 02 */ SCHEDULE_CMD_ID_CHECK_TIME_RANGE_S, // Checks if the current time is within the range of the two provided times and branches if so, short range branch
/* 03 */ SCHEDULE_CMD_ID_CHECK_TIME_RANGE_L, // Checks if the current time is within the range of the two provided times and branches if so, long range branch
/* 04 */ SCHEDULE_CMD_ID_RET_VAL_L, // Ends script and returns 2-byte value (Note: bugged as the return value size is only 1 byte in the struct)
/* 05 */ SCHEDULE_CMD_ID_RET_NONE, // Ends script without returning anything
/* 06 */ SCHEDULE_CMD_ID_RET_EMPTY, // Ends script and indicates return without changing existing value
/* 07 */ SCHEDULE_CMD_ID_NOP, // No-Op
/* 08 */ SCHEDULE_CMD_ID_CHECK_MISC_S, // Special check based on items or masks and branches if check passes, short range branch
/* 09 */ SCHEDULE_CMD_ID_RET_VAL_S, // Ends script and returns byte value
/* 10 */ SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_S, // Checks if the current scene is not SceneNum and branches if so, short range branch
/* 11 */ SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_L, // Checks if the current scene is not SceneNum and branches if so, long range branch
/* 12 */ SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_S, // Checks if the current day is not Day and branches if so, short range branch
/* 13 */ SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_L, // Checks if the current day is not Day and branches if so, long range branch
/* 14 */ SCHEDULE_CMD_ID_RET_TIME, // Returns 2 time values
/* 15 */ SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_S, // Branches if the current time is less than the command time, short range branch
/* 16 */ SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_L, // Branches if the current time is less than the command time, long range branch
/* 17 */ SCHEDULE_CMD_ID_BRANCH_S, // Always branch, short range branch
/* 18 */ SCHEDULE_CMD_ID_BRANCH_L, // Always branch, long range branch
} ScheduleCommandId;
typedef enum {
/* 0 */ SCHEDULE_CHECK_MISC_ROOM_KEY,
/* 1 */ SCHEDULE_CHECK_MISC_LETTER_TO_KAFEI,
/* 2 */ SCHEDULE_CHECK_MISC_MASK_ROMANI,
} ScheduleCheckMisc;
typedef struct {
/* 0x0 */ u8 result;
/* 0x4 */ s32 time0;
/* 0x8 */ s32 time1;
/* 0xC */ s32 hasResult;
} ScheduleResult; // size = 0x10
typedef struct {
/* 0x0 */ u8 cmd;
} ScheduleCmdBase; // size = 0x1
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 flagByte;
/* 0x2 */ u8 flagMask;
/* 0x3 */ s8 offset;
} ScheduleCmdCheckFlagS; // size = 0x4
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 flagByte;
/* 0x2 */ u8 flagMask;
/* 0x3 */ u8 offsetH;
/* 0x4 */ u8 offsetL;
} ScheduleCmdCheckFlagL; // size = 0x5
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 startHr;
/* 0x2 */ u8 startMin;
/* 0x3 */ u8 endHr;
/* 0x4 */ u8 endMin;
/* 0x5 */ s8 offset;
} ScheduleCmdCheckTimeRangeS; // size = 0x6
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 startHr;
/* 0x2 */ u8 startMin;
/* 0x3 */ u8 endHr;
/* 0x4 */ u8 endMin;
/* 0x5 */ u8 offsetH;
/* 0x6 */ u8 offsetL;
} ScheduleCmdCheckTimeRangeL; // size = 0x7
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 retH;
/* 0x2 */ u8 retL;
} ScheduleCmdReturnValueL; // size = 0x3
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 unk1;
/* 0x2 */ u8 unk2;
/* 0x3 */ u8 unk3;
} ScheduleCmdNop; // size = 0x4
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 which;
/* 0x2 */ s8 offset;
} ScheduleCmdCheckMiscS; // size = 0x3
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 result;
} ScheduleCmdReturnValueS; // size = 0x2
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 sceneH;
/* 0x2 */ u8 sceneL;
/* 0x3 */ s8 offset;
} ScheduleCmdCheckNotInSceneS; // size = 0x4
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 sceneH;
/* 0x2 */ u8 sceneL;
/* 0x3 */ u8 offsetH;
/* 0x4 */ u8 offsetL;
} ScheduleCmdCheckNotInSceneL; // size = 0x5
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 dayH;
/* 0x2 */ u8 dayL;
/* 0x3 */ s8 offset;
} ScheduleCmdCheckNotInDayS; // size = 0x4
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 dayH;
/* 0x2 */ u8 dayL;
/* 0x3 */ u8 offsetH;
/* 0x4 */ u8 offsetL;
} ScheduleCmdCheckNotInDayL; // size = 0x5
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 time0Hr;
/* 0x2 */ u8 time0Min;
/* 0x3 */ u8 time1Hr;
/* 0x4 */ u8 time1Min;
/* 0x5 */ u8 result;
} ScheduleCmdReturnTime; // size = 0x6
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 timeHr;
/* 0x2 */ u8 timeMin;
/* 0x3 */ s8 offset;
} ScheduleCmdCheckBeforeTimeS; // size = 0x4
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 timeHr;
/* 0x2 */ u8 timeMin;
/* 0x3 */ u8 offsetH;
/* 0x4 */ u8 offsetL;
} ScheduleCmdCheckBeforeTimeL; // size = 0x5
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ s8 offset;
} ScheduleCmdBranchS; // size = 0x2
typedef struct {
/* 0x0 */ ScheduleCmdBase base;
/* 0x1 */ u8 offsetH;
/* 0x2 */ u8 offsetL;
} ScheduleCmdBranchL; // size = 0x3
#define SCHEDULE_PACK_S16(val) \
((val) >> 8) & 0xFF, (val) & 0xFF
#define SCHEDULE_CMD_CHECK_FLAG_S(index, mask, offset) \
SCHEDULE_CMD_ID_CHECK_FLAG_S, (index), (mask), (offset)
#define SCHEDULE_CMD_CHECK_FLAG_L(index, mask, offset) \
SCHEDULE_CMD_ID_CHECK_FLAG_L, (index), (mask), SCHEDULE_PACK_S16(offset)
#define SCHEDULE_CMD_CHECK_TIME_RANGE_S(startHr, startMin, endHr, endMin, offset) \
SCHEDULE_CMD_ID_CHECK_TIME_RANGE_S, (startHr), (startMin), (endHr), (endMin), (offset)
#define SCHEDULE_CMD_CHECK_TIME_RANGE_L(startHr, startMin, endHr, endMin, offset) \
SCHEDULE_CMD_ID_CHECK_TIME_RANGE_L, (startHr), (startMin), (endHr), (endMin), SCHEDULE_PACK_S16(offset)
#define SCHEDULE_CMD_RET_VAL_L(result) \
SCHEDULE_CMD_ID_RET_VAL_L, SCHEDULE_PACK_S16(result)
#define SCHEDULE_CMD_RET_NONE() \
SCHEDULE_CMD_ID_RET_NONE
#define SCHEDULE_CMD_RET_EMPTY() \
SCHEDULE_CMD_ID_RET_EMPTY,
#define SCHEDULE_CMD_NOP(unk0, unk1, unk2) \
SCHEDULE_CMD_ID_NOP, (unk0), (unk1), (unk2)
#define SCHEDULE_CMD_CHECK_MISC_S(which, offset) \
SCHEDULE_CMD_ID_CHECK_MISC_S, (which), (offset)
#define SCHEDULE_CMD_RET_VAL_S(result) \
SCHEDULE_CMD_ID_RET_VAL_S, (result)
#define SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(scene, offset) \
SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_S, SCHEDULE_PACK_S16(scene), (offset)
#define SCHEDULE_CMD_CHECK_NOT_IN_SCENE_L(scene, offset) \
SCHEDULE_CMD_ID_CHECK_NOT_IN_SCENE_L, SCHEDULE_PACK_S16(scene), SCHEDULE_PACK_S16(offset)
#define SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(day, offset) \
SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_S, SCHEDULE_PACK_S16(day), (offset)
#define SCHEDULE_CMD_CHECK_NOT_IN_DAY_L(day, offset) \
SCHEDULE_CMD_ID_CHECK_NOT_IN_DAY_L, SCHEDULE_PACK_S16(day), SCHEDULE_PACK_S16(offset)
#define SCHEDULE_CMD_RET_TIME(time0Hr, time0Min, time1Hr, time1Min, result) \
SCHEDULE_CMD_ID_RET_TIME, (time0Hr), (time0Min), (time1Hr), (time1Min), (result)
#define SCHEDULE_CMD_CHECK_BEFORE_TIME_S(timeHr, timeMin, offset) \
SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_S, (timeHr), (timeMin), (offset)
#define SCHEDULE_CMD_CHECK_BEFORE_TIME_L(timeHr, timeMin, offset) \
SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_L, (timeHr), (timeMin), SCHEDULE_PACK_S16(offset)
#define SCHEDULE_CMD_BRANCH_S(offset) \
SCHEDULE_CMD_ID_BRANCH_S, (offset)
#define SCHEDULE_CMD_BRANCH_L(offset) \
SCHEDULE_CMD_ID_BRANCH_L, SCHEDULE_PACK_S16(offset)
#endif
+1 -2
View File
@@ -522,8 +522,7 @@ beginseg
include "build/data/code/code_801C2730.data.o"
include "build/src/code/z_scene_proc.o"
include "build/src/code/z_scene_table.o"
include "build/src/code/code_801323D0.o"
include "build/data/code/code_801C5C50.data.o"
include "build/src/code/z_schedule.o"
include "build/src/code/z_skelanime.o"
include "build/src/code/z_skin.o"
include "build/src/code/z_skin_awb.o"
+1
View File
@@ -1,3 +1,4 @@
#include "prevent_bss_reordering.h"
#include "global.h"
u8 D_80096B20 = 1;
-41
View File
@@ -1,41 +0,0 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_801323D0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132428.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132494.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_801326B8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_801328F0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132920.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132938.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132954.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_8013296C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132A18.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132A3C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132A80.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132AD8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132B24.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132B84.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132D70.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132E9C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80132FDC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80133000.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801323D0/func_80133038.s")
-1
View File
@@ -1,4 +1,3 @@
#include "prevent_bss_reordering.h"
#include "global.h"
#include "system_malloc.h"
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
-1
View File
@@ -1,4 +1,3 @@
#include "prevent_bss_reordering.h"
#include "global.h"
#include "vt.h"
-1
View File
@@ -1,4 +1,3 @@
#include "prevent_bss_reordering.h"
#include "global.h"
Vec3f D_801EDE00;
-1
View File
@@ -1,4 +1,3 @@
#include "prevent_bss_reordering.h"
#include "global.h"
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
+283
View File
@@ -0,0 +1,283 @@
#include "global.h"
#define SCHEDULE_CALC_TIME(hour, minute, dest, temp) \
(temp) = (hour)*60.0f; \
(temp) += (minute); \
(dest) = (temp) * (0x10000 / 60 / 24.0f); \
(dest) = SCHEDULE_CONVERT_TIME(dest);
s32 Schedule_CheckFlagS(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdCheckFlagS* cmd = (ScheduleCmdCheckFlagS*)*script;
u16 flag = (cmd->flagByte << 8) | cmd->flagMask;
if (gSaveContext.save.weekEventReg[flag >> 8] & (flag & 0xFF)) {
*script += cmd->offset;
}
return false;
}
s32 Schedule_CheckFlagL(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdCheckFlagL* cmd = (ScheduleCmdCheckFlagL*)*script;
u16 flag = (cmd->flagByte << 8) | cmd->flagMask;
if (gSaveContext.save.weekEventReg[flag >> 8] & (flag & 0xFF)) {
*script += (s16)((cmd->offsetH << 8) | cmd->offsetL);
}
return false;
}
s32 Schedule_CheckTimeRangeS(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
s32 inRange = false;
ScheduleCmdCheckTimeRangeS* cmd = (ScheduleCmdCheckTimeRangeS*)*script;
f32 f;
u16 start;
u16 end;
u16 now;
SCHEDULE_CALC_TIME(cmd->startHr, cmd->startMin, start, f);
SCHEDULE_CALC_TIME(cmd->endHr, cmd->endMin, end, f);
end--;
now = SCHEDULE_TIME_NOW;
if ((start <= now) && (now <= end)) {
inRange = true;
}
if (inRange == true) {
*script += cmd->offset;
}
return false;
}
s32 Schedule_CheckTimeRangeL(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
s32 inRange = false;
ScheduleCmdCheckTimeRangeL* cmd = (ScheduleCmdCheckTimeRangeL*)*script;
f32 f;
u16 start;
u16 end;
u16 now;
SCHEDULE_CALC_TIME(cmd->startHr, cmd->startMin, start, f);
SCHEDULE_CALC_TIME(cmd->endHr, cmd->endMin, end, f);
end--;
now = SCHEDULE_TIME_NOW;
if ((start <= now) && (now <= end)) {
inRange = true;
}
if (inRange == true) {
*script += (s16)((cmd->offsetH << 8) | cmd->offsetL);
}
return false;
}
s32 Schedule_ReturnValueL(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdReturnValueL* cmd = (ScheduleCmdReturnValueL*)*script;
//! @bug result is a u8, value is truncated
result->result = (cmd->retH << 8) | cmd->retL;
result->hasResult = true;
return true;
}
s32 Schedule_ReturnNone(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
result->hasResult = false;
return true;
}
s32 Schedule_ReturnEmpty(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
result->hasResult = true;
return true;
}
s32 Schedule_Nop(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
return false;
}
s32 Schedule_CheckMiscS(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdCheckMiscS* cmd = (ScheduleCmdCheckMiscS*)*script;
if (((cmd->which == SCHEDULE_CHECK_MISC_ROOM_KEY) && (INV_CONTENT(ITEM_ROOM_KEY) == ITEM_ROOM_KEY)) ||
((cmd->which == SCHEDULE_CHECK_MISC_LETTER_TO_KAFEI) &&
(INV_CONTENT(ITEM_LETTER_TO_KAFEI) == ITEM_LETTER_TO_KAFEI)) ||
((cmd->which == SCHEDULE_CHECK_MISC_MASK_ROMANI) && (Player_GetMask(globalCtx) == PLAYER_MASK_ROMANI))) {
*script += cmd->offset;
}
return false;
}
s32 Schedule_ReturnValueS(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdReturnValueS* cmd = (ScheduleCmdReturnValueS*)*script;
result->result = cmd->result;
result->hasResult = true;
return true;
}
s32 Schedule_CheckNotInSceneS(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdCheckNotInSceneS* cmd = (ScheduleCmdCheckNotInSceneS*)*script;
s16 scene = (cmd->sceneH << 8) | cmd->sceneL;
if (scene != globalCtx->sceneNum) {
*script += cmd->offset;
}
return false;
}
s32 Schedule_CheckNotInSceneL(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdCheckNotInSceneL* cmd = (ScheduleCmdCheckNotInSceneL*)*script;
s16 scene = (cmd->sceneH << 8) | cmd->sceneL;
if (scene != globalCtx->sceneNum) {
*script = *script + (s16)((cmd->offsetH << 8) | cmd->offsetL);
}
return false;
}
s32 Schedule_CheckNotInDayS(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdCheckNotInDayS* cmd = (ScheduleCmdCheckNotInDayS*)*script;
s16 day = (cmd->dayH << 8) | cmd->dayL;
if (day != (s16)gSaveContext.save.day) {
*script += cmd->offset;
}
return false;
}
s32 Schedule_CheckNotInDayL(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdCheckNotInDayL* cmd = (ScheduleCmdCheckNotInDayL*)*script;
s16 day = (cmd->dayH << 8) | cmd->dayL;
if (day != (s16)gSaveContext.save.day) {
*script += (s16)((cmd->offsetH << 8) | cmd->offsetL);
}
return false;
}
s32 Schedule_ReturnTime(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdReturnTime* cmd = (ScheduleCmdReturnTime*)*script;
f32 f;
u16 time0;
u16 time1;
SCHEDULE_CALC_TIME(cmd->time0Hr, cmd->time0Min, time0, f);
SCHEDULE_CALC_TIME(cmd->time1Hr, cmd->time1Min, time1, f);
time1--;
result->result = cmd->result;
result->time0 = time0;
result->time1 = time1;
result->hasResult = true;
return true;
}
s32 Schedule_CheckBeforeTimeS(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdCheckBeforeTimeS* cmd = (ScheduleCmdCheckBeforeTimeS*)*script;
f32 f;
u16 testTime;
u16 now;
SCHEDULE_CALC_TIME(cmd->timeHr, cmd->timeMin, testTime, f);
now = SCHEDULE_TIME_NOW;
if (now < testTime) {
*script += cmd->offset;
}
return false;
}
s32 Schedule_CheckBeforeTimeL(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdCheckBeforeTimeL* cmd = (ScheduleCmdCheckBeforeTimeL*)*script;
f32 f;
u16 testTime;
u16 now;
SCHEDULE_CALC_TIME(cmd->timeHr, cmd->timeMin, testTime, f);
now = SCHEDULE_TIME_NOW;
if (now < testTime) {
*script += (s16)((cmd->offsetH << 8) | cmd->offsetL);
}
return false;
}
s32 Schedule_BranchS(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdBranchS* cmd = (ScheduleCmdBranchS*)*script;
*script += cmd->offset;
return false;
}
s32 Schedule_BranchL(GlobalContext* globalCtx, u8** script, ScheduleResult* result) {
ScheduleCmdBranchL* cmd = (ScheduleCmdBranchL*)*script;
*script += (s16)((cmd->offsetH << 8) | cmd->offsetL);
return false;
}
static s32 (*sScheduleCmdFuncs[])(GlobalContext*, u8**, ScheduleResult*) = {
Schedule_CheckFlagS, Schedule_CheckFlagL, Schedule_CheckTimeRangeS, Schedule_CheckTimeRangeL,
Schedule_ReturnValueL, Schedule_ReturnNone, Schedule_ReturnEmpty, Schedule_Nop,
Schedule_CheckMiscS, Schedule_ReturnValueS, Schedule_CheckNotInSceneS, Schedule_CheckNotInSceneL,
Schedule_CheckNotInDayS, Schedule_CheckNotInDayL, Schedule_ReturnTime, Schedule_CheckBeforeTimeS,
Schedule_CheckBeforeTimeL, Schedule_BranchS, Schedule_BranchL,
};
static u8 sScheduleCmdSizes[] = {
sizeof(ScheduleCmdCheckFlagS),
sizeof(ScheduleCmdCheckFlagL),
sizeof(ScheduleCmdCheckTimeRangeS),
sizeof(ScheduleCmdCheckTimeRangeL),
sizeof(ScheduleCmdReturnValueL),
sizeof(ScheduleCmdBase),
sizeof(ScheduleCmdBase),
sizeof(ScheduleCmdNop),
sizeof(ScheduleCmdCheckMiscS),
sizeof(ScheduleCmdReturnValueS),
sizeof(ScheduleCmdCheckNotInSceneS),
sizeof(ScheduleCmdCheckNotInSceneL),
sizeof(ScheduleCmdCheckNotInDayS),
sizeof(ScheduleCmdCheckNotInDayL),
sizeof(ScheduleCmdReturnTime),
sizeof(ScheduleCmdCheckBeforeTimeS),
sizeof(ScheduleCmdCheckBeforeTimeL),
sizeof(ScheduleCmdBranchS),
sizeof(ScheduleCmdBranchL),
};
s32 Schedule_RunScript(GlobalContext* globalCtx, u8* script, ScheduleResult* result) {
u8 size;
s32 stop;
do {
size = sScheduleCmdSizes[*script];
stop = (*sScheduleCmdFuncs[*script])(globalCtx, &script, result);
script += size;
} while (!stop);
return result->hasResult;
}
@@ -4,6 +4,7 @@
* Description: Igos du Ikana window - curtains and ray effects
*/
#include "prevent_bss_reordering.h"
#include "z_boss_06.h"
#include "overlays/actors/ovl_En_Knight/z_en_knight.h"
#include "objects/gameplay_keep/gameplay_keep.h"
+28 -14
View File
@@ -19,9 +19,24 @@ void EnAh_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80BD36B8(EnAh* this, GlobalContext* globalCtx);
void func_80BD3768(EnAh* this, GlobalContext* globalCtx);
s32 D_80BD3DB0[] = {
0x0A00611D, 0x0C000303, 0x0400010C, 0x00021102, 0x15001700, 0x08003220, 0x03040001,
0x05040003, 0x050A0010, 0x120C0003, 0x0D021200, 0x06000105, 0x0E120006, 0x00020505,
static u8 D_80BD3DB0[] = {
/* 0x00 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_YADOYA, 0x21 - 0x04),
/* 0x04 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(3, 0x0B - 0x08),
/* 0x08 */ SCHEDULE_CMD_RET_VAL_L(1),
/* 0x0B */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(2, 0x20 - 0x0F),
/* 0x0F */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(21, 0, 23, 0, 0x1D - 0x15),
/* 0x15 */ SCHEDULE_CMD_CHECK_FLAG_S(0x32, 0x20, 0x1C - 0x19),
/* 0x19 */ SCHEDULE_CMD_RET_VAL_L(1),
/* 0x1C */ SCHEDULE_CMD_RET_NONE(),
/* 0x1D */ SCHEDULE_CMD_RET_VAL_L(3),
/* 0x20 */ SCHEDULE_CMD_RET_NONE(),
/* 0x21 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_OMOYA, 0x37 - 0x25),
/* 0x25 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(3, 0x36 - 0x29),
/* 0x29 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(18, 0, 6, 0, 0x30 - 0x2F),
/* 0x2F */ SCHEDULE_CMD_RET_NONE(),
/* 0x30 */ SCHEDULE_CMD_RET_TIME(18, 0, 6, 0, 2),
/* 0x36 */ SCHEDULE_CMD_RET_NONE(),
/* 0x37 */ SCHEDULE_CMD_RET_NONE(),
};
s32 D_80BD3DE8[] = { 0x0E28FF0C, 0x10000000 };
@@ -361,7 +376,7 @@ s32 func_80BD3320(EnAh* this, GlobalContext* globalCtx, u8 actorCat, s16 actorId
return ret;
}
s32 func_80BD3374(EnAh* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80BD3374(EnAh* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
s32 pad;
Math_Vec3f_Copy(&this->actor.world.pos, &D_80BD3EC4.pos);
@@ -373,7 +388,7 @@ s32 func_80BD3374(EnAh* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return true;
}
s32 func_80BD33FC(EnAh* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80BD33FC(EnAh* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
s32 pad;
Math_Vec3f_Copy(&this->actor.world.pos, &D_80BD3ED8.pos);
@@ -385,7 +400,7 @@ s32 func_80BD33FC(EnAh* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return true;
}
s32 func_80BD3484(EnAh* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80BD3484(EnAh* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
s32 ret = false;
if (func_80BD3320(this, globalCtx, ACTORCAT_NPC, ACTOR_EN_AN)) {
@@ -404,12 +419,12 @@ s32 func_80BD3484(EnAh* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return ret;
}
s32 func_80BD3548(EnAh* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80BD3548(EnAh* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
s32 ret;
this->unk_2D8 = 0;
switch (arg2->unk0) {
switch (arg2->result) {
default:
ret = false;
break;
@@ -457,19 +472,18 @@ void func_80BD3658(EnAh* this, GlobalContext* globalCtx) {
}
void func_80BD36B8(EnAh* this, GlobalContext* globalCtx) {
s32 pad;
struct_80133038_arg2 sp18;
ScheduleResult sp18;
if (!func_80133038(globalCtx, D_80BD3DB0, &sp18) ||
((this->unk_1DC != sp18.unk0) && !func_80BD3548(this, globalCtx, &sp18))) {
if (!Schedule_RunScript(globalCtx, D_80BD3DB0, &sp18) ||
((this->unk_1DC != sp18.result) && !func_80BD3548(this, globalCtx, &sp18))) {
this->actor.shape.shadowDraw = NULL;
this->actor.flags &= ~ACTOR_FLAG_1;
sp18.unk0 = 0;
sp18.result = 0;
} else {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
this->actor.flags |= ACTOR_FLAG_1;
}
this->unk_1DC = sp18.unk0;
this->unk_1DC = sp18.result;
func_80BD3658(this, globalCtx);
}
+27 -16
View File
@@ -19,10 +19,22 @@ void EnAl_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80BDF5E8(EnAl* this, GlobalContext* globalCtx);
void func_80BDF6C4(EnAl* this, GlobalContext* globalCtx);
s32 D_80BDFC70[] = {
0x0C00030D, 0x02120006, 0x0001050E, 0x12000600, 0x02020800, 0x0A002F02, 0x0A000A37,
0x23020A37, 0x0B2D0D02, 0x0B2D1400, 0x01050E0B, 0x2D140001, 0x0C000206, 0x0E0A370B,
0x2D010E0A, 0x370B2D03, 0x0E0A000A, 0x37010400, 0x01000000,
static u8 D_80BDFC70[] = {
/* 0x00 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(3, 0x11 - 0x04),
/* 0x04 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(18, 0, 6, 0, 0x0B - 0x0A),
/* 0x0A */ SCHEDULE_CMD_RET_NONE(),
/* 0x0B */ SCHEDULE_CMD_RET_TIME(18, 0, 6, 0, 2),
/* 0x11 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(8, 0, 10, 0, 0x46 - 0x17),
/* 0x17 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(10, 0, 10, 55, 0x40 - 0x1D),
/* 0x1D */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(10, 55, 11, 45, 0x30 - 0x23),
/* 0x23 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(11, 45, 20, 0, 0x2A - 0x29),
/* 0x29 */ SCHEDULE_CMD_RET_NONE(),
/* 0x2A */ SCHEDULE_CMD_RET_TIME(11, 45, 20, 0, 1),
/* 0x30 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(2, 0x3A - 0x34),
/* 0x34 */ SCHEDULE_CMD_RET_TIME(10, 55, 11, 45, 1),
/* 0x3A */ SCHEDULE_CMD_RET_TIME(10, 55, 11, 45, 3),
/* 0x40 */ SCHEDULE_CMD_RET_TIME(10, 0, 10, 55, 1),
/* 0x46 */ SCHEDULE_CMD_RET_VAL_L(1),
};
s32 D_80BDFCBC[] = {
@@ -623,7 +635,7 @@ s32 func_80BDF064(EnAl* this, GlobalContext* globalCtx) {
return false;
}
s32 func_80BDF244(EnAl* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80BDF244(EnAl* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
s32 ret = false;
Actor* sp20 = func_80BDE1A0(this, globalCtx, ACTORCAT_NPC, ACTOR_EN_GM);
Actor* temp_v0 = func_80BDE1A0(this, globalCtx, ACTORCAT_NPC, ACTOR_EN_TOTO);
@@ -638,10 +650,10 @@ s32 func_80BDF244(EnAl* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return ret;
}
s32 func_80BDF308(EnAl* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80BDF308(EnAl* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
SubS_UpdateFlags(&this->unk_4C2, 3, 7);
switch (arg2->unk0) {
switch (arg2->result) {
case 1:
func_80BDE27C(this, 0);
break;
@@ -655,7 +667,7 @@ s32 func_80BDF308(EnAl* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return true;
}
s32 func_80BDF390(EnAl* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80BDF390(EnAl* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
s32 ret;
this->actor.flags |= ACTOR_FLAG_1;
@@ -664,7 +676,7 @@ s32 func_80BDF390(EnAl* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_4C2 = 0;
this->unk_4D4 = 40.0f;
switch (arg2->unk0) {
switch (arg2->result) {
case 3:
ret = func_80BDF244(this, globalCtx, arg2);
break;
@@ -734,20 +746,19 @@ void func_80BDF578(EnAl* this, GlobalContext* globalCtx) {
}
void func_80BDF5E8(EnAl* this, GlobalContext* globalCtx) {
u32* unk14 = &gSaveContext.save.daySpeed;
struct_80133038_arg2 sp20;
ScheduleResult sp20;
this->unk_4E0 = REG(15) + *unk14;
if (!func_80133038(globalCtx, D_80BDFC70, &sp20) ||
((this->unk_35C != sp20.unk0) && !func_80BDF390(this, globalCtx, &sp20))) {
this->unk_4E0 = REG(15) + ((void)0, gSaveContext.save.daySpeed);
if (!Schedule_RunScript(globalCtx, D_80BDFC70, &sp20) ||
((this->unk_35C != sp20.result) && !func_80BDF390(this, globalCtx, &sp20))) {
this->actor.shape.shadowDraw = NULL;
this->actor.flags &= ~ACTOR_FLAG_1;
sp20.unk0 = 0;
sp20.result = 0;
} else {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
this->actor.flags |= ACTOR_FLAG_1;
}
this->unk_35C = sp20.unk0;
this->unk_35C = sp20.result;
this->unk_368 = func_80BDE384(this, globalCtx);
func_80BDF578(this, globalCtx);
}
+25 -18
View File
@@ -107,8 +107,16 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
s32 D_80BAA488[] = {
0x0C000119, 0x0A006E14, 0x02000000, 0x1E080F00, 0x1E030400, 0x01050E00, 0x00001E02, 0x05050000,
static u8 D_80BAA488[] = {
/* 0x00 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(1, 0x1D - 0x04),
/* 0x04 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_BACKTOWN, 0x1C - 0x08),
/* 0x08 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(0, 0, 0, 30, 0x16 - 0x0E),
/* 0x0E */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(0, 30, 0x15 - 0x12),
/* 0x12 */ SCHEDULE_CMD_RET_VAL_L(1),
/* 0x15 */ SCHEDULE_CMD_RET_NONE(),
/* 0x16 */ SCHEDULE_CMD_RET_TIME(0, 0, 0, 30, 2),
/* 0x1C */ SCHEDULE_CMD_RET_NONE(),
/* 0x1D */ SCHEDULE_CMD_RET_NONE(),
};
s32 D_80BAA4A8[] = { -1, -1, 0 };
@@ -305,13 +313,13 @@ void func_80BA8DF4(EnBaba* this, GlobalContext* globalCtx) {
}
}
s32 func_80BA8F88(EnBaba* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80BA8F88(EnBaba* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
u16 sp26 = (u16)(gSaveContext.save.time - 0x3FFC);
u16 temp;
u8 sp23 = ENBABA_GET_3F00(&this->actor);
if (D_80BAA4A8[arg2->unk0] >= 0) {
this->unk_410 = SubS_GetAdditionalPath(globalCtx, sp23, D_80BAA4A8[arg2->unk0]);
if (D_80BAA4A8[arg2->result] >= 0) {
this->unk_410 = SubS_GetAdditionalPath(globalCtx, sp23, D_80BAA4A8[arg2->result]);
}
if (this->unk_410 == NULL) {
@@ -321,13 +329,13 @@ s32 func_80BA8F88(EnBaba* this, GlobalContext* globalCtx, struct_80133038_arg2*
if ((this->unk_434 != 0) && (this->unk_436 >= 0)) {
temp = sp26;
} else {
temp = arg2->unk4;
temp = arg2->time0;
}
if (arg2->unk8 < temp) {
this->unk_424 = (temp - arg2->unk8) + 0xFFFF;
if (arg2->time1 < temp) {
this->unk_424 = (temp - arg2->time1) + 0xFFFF;
} else {
this->unk_424 = arg2->unk8 - temp;
this->unk_424 = arg2->time1 - temp;
}
this->unk_430 = sp26 - temp;
@@ -339,10 +347,10 @@ s32 func_80BA8F88(EnBaba* this, GlobalContext* globalCtx, struct_80133038_arg2*
return true;
}
s32 func_80BA9110(EnBaba* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80BA9110(EnBaba* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
s32 ret;
switch (arg2->unk0) {
switch (arg2->result) {
default:
ret = false;
break;
@@ -583,21 +591,20 @@ void func_80BA9B24(EnBaba* this, GlobalContext* globalCtx) {
}
void func_80BA9B80(EnBaba* this, GlobalContext* globalCtx) {
u32* unk14 = &gSaveContext.save.daySpeed;
struct_80133038_arg2 sp20;
ScheduleResult sp20;
this->unk_436 = REG(15) + *unk14;
this->unk_436 = REG(15) + ((void)0, gSaveContext.save.daySpeed);
if (!func_80133038(globalCtx, D_80BAA488, &sp20) ||
((this->unk_434 != sp20.unk0) && !func_80BA9110(this, globalCtx, &sp20))) {
if (!Schedule_RunScript(globalCtx, D_80BAA488, &sp20) ||
((this->unk_434 != sp20.result) && !func_80BA9110(this, globalCtx, &sp20))) {
this->unk_40A &= ~0x80;
this->actor.flags &= ~ACTOR_FLAG_1;
sp20.unk0 = false;
sp20.result = false;
} else {
this->unk_40A |= 0x80;
this->actor.flags |= ACTOR_FLAG_1;
}
this->unk_434 = sp20.unk0;
this->unk_434 = sp20.result;
func_80BA93AC(this, globalCtx);
+193 -55
View File
@@ -38,104 +38,243 @@ void func_808670F0(EnDoor*, GlobalContext*);
void func_80866A5C(EnDoor*, GlobalContext*);
u8 D_808675D0[] = {
0x0C, 0x00, 0x03, 0x0E, 0x02, 0x06, 0x00, 0x17, 0x00, 0x08,
0x02, 0x00, 0x00, 0x06, 0x00, 0x02, 0x09, 0x07, 0x05, 0x00,
/* 0x00 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(3, 0x12 - 0x04),
/* 0x04 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(6, 0, 23, 0, 0x12 - 0x0A),
/* 0x0A */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(0, 0, 6, 0, 0x12 - 0x10),
/* 0x10 */ SCHEDULE_CMD_RET_VAL_S(7),
/* 0x12 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_808675E4[] = {
0x0F, 0x09, 0x00, 0x47, 0x0F, 0x0C, 0x00, 0x15, 0x0C, 0x00, 0x01, 0x13, 0x11, 0x00, 0x0F, 0x0D,
0x00, 0x0A, 0x0F, 0x0F, 0x00, 0x07, 0x0F, 0x00, 0x00, 0x02, 0x09, 0x09, 0x05, 0x09, 0x08, 0x0C,
0x00, 0x02, 0x19, 0x00, 0x1C, 0x08, 0x07, 0x0F, 0x0D, 0x00, 0x02, 0x09, 0x09, 0x05, 0x0F, 0x0D,
0x00, 0xEA, 0x0F, 0x11, 0x00, 0xE7, 0x0F, 0x00, 0x00, 0xE2, 0x09, 0x09, 0x0F, 0x0D, 0x00, 0xDC,
0x0F, 0x0D, 0x00, 0xD9, 0x0F, 0x12, 0x00, 0x01, 0x05, 0x09, 0x09, 0x09, 0x09, 0x00, 0x00, 0x00,
/* 0x00 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(9, 0, 0x4B - 0x04),
/* 0x04 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(12, 0, 0x1D - 0x08),
/* 0x08 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(1, 0x1F - 0x0C),
/* 0x0C */ SCHEDULE_CMD_BRANCH_S(0x0),
/* 0x0E */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(13, 0, 0x1C - 0x12),
/* 0x12 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(15, 0, 0x1D - 0x16),
/* 0x16 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(0, 0, 0x1C - 0x1A),
/* 0x1A */ SCHEDULE_CMD_RET_VAL_S(9),
/* 0x1C */ SCHEDULE_CMD_RET_NONE(),
/* 0x1D */ SCHEDULE_CMD_RET_VAL_S(8),
/* 0x1F */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(2, 0x3C - 0x23),
/* 0x23 */ SCHEDULE_CMD_CHECK_FLAG_S(0x1C, 0x08, 0x2E - 0x27),
/* 0x27 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(13, 0, 0x2D - 0x2B),
/* 0x2B */ SCHEDULE_CMD_RET_VAL_S(9),
/* 0x2D */ SCHEDULE_CMD_RET_NONE(),
/* 0x2E */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(13, 0, 0x1C - 0x32),
/* 0x32 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(17, 0, 0x1D - 0x36),
/* 0x36 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(0, 0, 0x1C - 0x3A),
/* 0x3A */ SCHEDULE_CMD_RET_VAL_S(9),
/* 0x3C */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(13, 0, 0x1C - 0x40),
/* 0x40 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(13, 0, 0x1D - 0x44),
/* 0x44 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(18, 0, 0x49 - 0x48),
/* 0x48 */ SCHEDULE_CMD_RET_NONE(),
/* 0x49 */ SCHEDULE_CMD_RET_VAL_S(9),
/* 0x4B */ SCHEDULE_CMD_RET_VAL_S(9),
};
u8 D_80867634[] = {
0x02, 0x06, 0x00, 0x17, 0x00, 0x02, 0x09, 0x1C, 0x05, 0x00, 0x00, 0x00,
/* 0x0 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(6, 0, 23, 0, 0x8 - 0x6),
/* 0x6 */ SCHEDULE_CMD_RET_VAL_S(28),
/* 0x8 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_80867640[] = {
0x02, 0x15, 0x00, 0x16, 0x00, 0x01, 0x05, 0x09, 0x0B, 0x00, 0x00, 0x00,
/* 0x0 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(21, 0, 22, 0, 0x7 - 0x6),
/* 0x6 */ SCHEDULE_CMD_RET_NONE(),
/* 0x7 */ SCHEDULE_CMD_RET_VAL_S(11),
};
u8 D_8086764C[] = {
0x02, 0x16, 0x00, 0x05, 0x00, 0x02, 0x09, 0x0A, 0x05, 0x00, 0x00, 0x00,
/* 0x0 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(22, 0, 5, 0, 0x8 - 0x6),
/* 0x6 */ SCHEDULE_CMD_RET_VAL_S(10),
/* 0x8 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_80867658[] = {
0x0C, 0x00, 0x02, 0x0F, 0x00, 0x1C, 0x08, 0x02, 0x09, 0x0C, 0x02, 0x0F, 0x0A, 0x16, 0x00,
0x02, 0x09, 0x0C, 0x05, 0x0C, 0x00, 0x03, 0x11, 0x0F, 0x0D, 0x00, 0x0D, 0x00, 0x33, 0x08,
0x02, 0x09, 0x0C, 0x0F, 0x16, 0x00, 0x02, 0x09, 0x0C, 0x05, 0x09, 0x0C, 0x00, 0x00,
/* 0x00 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(2, 0x13 - 0x04),
/* 0x04 */ SCHEDULE_CMD_CHECK_FLAG_S(0x1C, 0x08, 0x0A - 0x08),
/* 0x08 */ SCHEDULE_CMD_RET_VAL_S(12),
/* 0x0A */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(15, 10, 22, 0, 0x12 - 0x10),
/* 0x10 */ SCHEDULE_CMD_RET_VAL_S(12),
/* 0x12 */ SCHEDULE_CMD_RET_NONE(),
/* 0x13 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(3, 0x28 - 0x17),
/* 0x17 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(13, 0, 0x28 - 0x1B),
/* 0x1B */ SCHEDULE_CMD_CHECK_FLAG_S(0x33, 0x08, 0x21 - 0x1F),
/* 0x1F */ SCHEDULE_CMD_RET_VAL_S(12),
/* 0x21 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(22, 0, 0x27 - 0x25),
/* 0x25 */ SCHEDULE_CMD_RET_VAL_S(12),
/* 0x27 */ SCHEDULE_CMD_RET_NONE(),
/* 0x28 */ SCHEDULE_CMD_RET_VAL_S(12),
};
u8 D_80867684[] = { 0x05, 0x00, 0x00, 0x00 };
u8 D_80867684[] = {
/* 0x0 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_80867688[] = { 0x0F, 0x16, 0x00, 0x02, 0x09, 0x0F, 0x05, 0x00 };
u8 D_80867688[] = {
/* 0x0 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(22, 0, 0x6 - 0x4),
/* 0x4 */ SCHEDULE_CMD_RET_VAL_S(15),
/* 0x6 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_80867690[] = { 0x0F, 0x16, 0x00, 0x02, 0x09, 0x10, 0x05, 0x00 };
u8 D_80867690[] = {
/* 0x0 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(22, 0, 0x6 - 0x4),
/* 0x4 */ SCHEDULE_CMD_RET_VAL_S(16),
/* 0x6 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_80867698[] = { 0x0F, 0x16, 0x00, 0x02, 0x09, 0x11, 0x05, 0x00 };
u8 D_80867698[] = {
/* 0x0 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(22, 0, 0x6 - 0x4),
/* 0x4 */ SCHEDULE_CMD_RET_VAL_S(17),
/* 0x6 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_808676A0[] = {
0x02, 0x0A, 0x00, 0x15, 0x00, 0x0F, 0x02, 0x16, 0x00, 0x05, 0x00, 0x02,
0x09, 0x12, 0x08, 0x02, 0x02, 0x09, 0x22, 0x09, 0x21, 0x05, 0x00, 0x00,
/* 0x00 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(10, 0, 21, 0, 0x15 - 0x06),
/* 0x06 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(22, 0, 5, 0, 0x0E - 0x0C),
/* 0x0C */ SCHEDULE_CMD_RET_VAL_S(18),
/* 0x0E */ SCHEDULE_CMD_CHECK_MISC_S(SCHEDULE_CHECK_MISC_MASK_ROMANI, 0x13 - 0x11),
/* 0x11 */ SCHEDULE_CMD_RET_VAL_S(34),
/* 0x13 */ SCHEDULE_CMD_RET_VAL_S(33),
/* 0x15 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_808676B8[] = {
0x08, 0x00, 0x14, 0x0C, 0x00, 0x03, 0x07, 0x0F, 0x08, 0x00, 0x01, 0x05,
0x09, 0x13, 0x02, 0x08, 0x00, 0x14, 0x1E, 0x02, 0x09, 0x13, 0x05, 0x05,
/* 0x00 */ SCHEDULE_CMD_CHECK_MISC_S(SCHEDULE_CHECK_MISC_ROOM_KEY, 0x17 - 0x03),
/* 0x03 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(3, 0x0E - 0x07),
/* 0x07 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(8, 0, 0x0C - 0x0B),
/* 0x0B */ SCHEDULE_CMD_RET_NONE(),
/* 0x0C */ SCHEDULE_CMD_RET_VAL_S(19),
/* 0x0E */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(8, 0, 20, 30, 0x16 - 0x14),
/* 0x14 */ SCHEDULE_CMD_RET_VAL_S(19),
/* 0x16 */ SCHEDULE_CMD_RET_NONE(),
/* 0x17 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_808676D0[] = { 0x05, 0x00, 0x00, 0x00 };
u8 D_808676D0[] = {
/* 0x0 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_808676D4[] = { 0x05, 0x00, 0x00, 0x00 };
u8 D_808676D4[] = {
/* 0x0 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_808676D8[] = { 0x0C, 0x00, 0x03, 0x05, 0x0F, 0x12, 0x00, 0x01, 0x05, 0x09, 0x14, 0x00 };
u8 D_808676D8[] = {
/* 0x0 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(3, 0x9 - 0x4),
/* 0x4 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(18, 0, 0x9 - 0x8),
/* 0x8 */ SCHEDULE_CMD_RET_NONE(),
/* 0x9 */ SCHEDULE_CMD_RET_VAL_S(20),
};
u8 D_808676E4[] = { 0x08, 0x00, 0x02, 0x09, 0x16, 0x05, 0x00, 0x00 };
u8 D_808676E4[] = {
/* 0x0 */ SCHEDULE_CMD_CHECK_MISC_S(SCHEDULE_CHECK_MISC_ROOM_KEY, 0x5 - 0x3),
/* 0x3 */ SCHEDULE_CMD_RET_VAL_S(22),
/* 0x5 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_808676EC[] = { 0x05, 0x00, 0x00, 0x00 };
u8 D_808676EC[] = {
/* 0x0 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_808676F0[] = {
0x0C, 0x00, 0x03, 0x05, 0x0F, 0x0A, 0x00, 0x07, 0x05, 0x02,
0x0A, 0x00, 0x14, 0x00, 0xF9, 0x09, 0x15, 0x00, 0x00, 0x00,
/* 0x0 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(3, 0x9 - 0x4),
/* 0x4 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(10, 0, 0xF - 0x8),
/* 0x8 */ SCHEDULE_CMD_RET_NONE(),
/* 0x9 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(10, 0, 20, 0, 0x8 - 0xF),
/* 0xF */ SCHEDULE_CMD_RET_VAL_S(21),
};
u8 D_80867704[] = { 0x05, 0x00, 0x00, 0x00 };
u8 D_80867708[] = { 0x05, 0x00, 0x00, 0x00 };
u8 D_8086770C[] = { 0x05, 0x00, 0x00, 0x00 };
u8 D_80867710[] = { 0x05, 0x00, 0x00, 0x00 };
u8 D_80867704[] = {
/* 0x0 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_80867714[] = { 0x0F, 0x14, 0x00, 0x02, 0x09, 0x17, 0x05, 0x00 };
u8 D_80867708[] = {
/* 0x0 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_8086770C[] = {
/* 0x0 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_80867710[] = {
/* 0x0 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_80867714[] = {
/* 0x0 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(20, 0, 0x6 - 0x4),
/* 0x4 */ SCHEDULE_CMD_RET_VAL_S(23),
/* 0x6 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_8086771C[] = {
0x0C, 0x00, 0x01, 0x07, 0x0F, 0x02, 0x1E, 0x02, 0x09, 0x18, 0x05, 0x0C,
0x00, 0x03, 0xFB, 0x0F, 0x14, 0x00, 0xF7, 0x09, 0x0C, 0x00, 0x00, 0x00,
/* 0x00 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(1, 0x0B - 0x04),
/* 0x04 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(2, 30, 0x0A - 0x08),
/* 0x08 */ SCHEDULE_CMD_RET_VAL_S(24),
/* 0x0A */ SCHEDULE_CMD_RET_NONE(),
/* 0x0B */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(3, 0x0A - 0x0F),
/* 0x0F */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(20, 0, 0x0A - 0x13),
/* 0x13 */ SCHEDULE_CMD_RET_VAL_S(12),
};
u8 D_80867734[] = { 0x0F, 0x14, 0x00, 0x02, 0x09, 0x19, 0x05, 0x00 };
u8 D_80867734[] = {
/* 0x0 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(20, 0, 0x6 - 0x4),
/* 0x4 */ SCHEDULE_CMD_RET_VAL_S(25),
/* 0x6 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_8086773C[] = { 0x0F, 0x14, 0x00, 0x02, 0x09, 0x1A, 0x05, 0x00 };
u8 D_8086773C[] = {
/* 0x0 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(20, 0, 0x6 - 0x4),
/* 0x4 */ SCHEDULE_CMD_RET_VAL_S(26),
/* 0x6 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_80867744[] = {
0x0C, 0x00, 0x02, 0x04, 0x00, 0x63, 0x80, 0x06, 0x0F, 0x14, 0x00, 0x08,
0x09, 0x1B, 0x0F, 0x12, 0x00, 0x02, 0x09, 0x1B, 0x05, 0x00, 0x00, 0x00,
/* 0x00 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(2, 0x08 - 0x04),
/* 0x04 */ SCHEDULE_CMD_CHECK_FLAG_S(0x63, 0x80, 0x0E - 0x08),
/* 0x08 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(20, 0, 0x14 - 0x0C),
/* 0x0C */ SCHEDULE_CMD_RET_VAL_S(27),
/* 0x0E */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(18, 0, 0x14 - 0x12),
/* 0x12 */ SCHEDULE_CMD_RET_VAL_S(27),
/* 0x14 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_8086775C[] = {
0x00, 0x34, 0x20, 0x17, 0x00, 0x4B, 0x20, 0x13, 0x00, 0x0E, 0x04, 0x02, 0x09, 0x1D,
0x00, 0x3B, 0x01, 0x08, 0x00, 0x3D, 0x02, 0x02, 0x09, 0x1E, 0x09, 0x1F, 0x05, 0x05,
/* 0x00 */ SCHEDULE_CMD_CHECK_FLAG_S(0x34, 0x20, 0x1B - 0x04),
/* 0x04 */ SCHEDULE_CMD_CHECK_FLAG_S(0x4B, 0x20, 0x1B - 0x08),
/* 0x08 */ SCHEDULE_CMD_CHECK_FLAG_S(0x0E, 0x04, 0x0E - 0x0C),
/* 0x0C */ SCHEDULE_CMD_RET_VAL_S(29),
/* 0x0E */ SCHEDULE_CMD_CHECK_FLAG_S(0x3B, 0x01, 0x1A - 0x12),
/* 0x12 */ SCHEDULE_CMD_CHECK_FLAG_S(0x3D, 0x02, 0x18 - 0x16),
/* 0x16 */ SCHEDULE_CMD_RET_VAL_S(30),
/* 0x18 */ SCHEDULE_CMD_RET_VAL_S(31),
/* 0x1A */ SCHEDULE_CMD_RET_NONE(),
/* 0x1B */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_80867778[] = { 0x09, 0x20, 0x00, 0x00 };
u8 D_8086777C[] = { 0x05, 0x00, 0x00, 0x00 };
u8 D_80867780[] = { 0x05, 0x00, 0x00, 0x00 };
u8 D_80867784[] = { 0x0F, 0x16, 0x00, 0x02, 0x09, 0x23, 0x05, 0x00 };
u8 D_80867778[] = {
/* 0x0 */ SCHEDULE_CMD_RET_VAL_S(32),
};
// void* seems to keep the compiler happy.
void* D_8086778C[] = {
&D_808675D0, &D_808675E4, &D_80867634, &D_80867640, &D_8086764C, &D_80867658, &D_80867684, &D_80867688,
&D_80867690, &D_80867698, &D_808676A0, &D_808676B8, &D_808676D0, &D_808676D4, &D_808676D8, &D_808676E4,
&D_808676EC, &D_808676F0, &D_80867704, &D_80867708, &D_8086770C, &D_80867710, &D_80867714, &D_8086771C,
&D_80867734, &D_8086773C, &D_80867744, &D_8086775C, &D_80867778, &D_8086777C, &D_80867780, &D_80867784,
u8 D_8086777C[] = {
/* 0x0 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_80867780[] = {
/* 0x0 */ SCHEDULE_CMD_RET_NONE(),
};
u8 D_80867784[] = {
/* 0x0 */ SCHEDULE_CMD_CHECK_BEFORE_TIME_S(22, 0, 0x6 - 0x4),
/* 0x4 */ SCHEDULE_CMD_RET_VAL_S(35),
/* 0x6 */ SCHEDULE_CMD_RET_NONE(),
};
u8* D_8086778C[] = {
D_808675D0, D_808675E4, D_80867634, D_80867640, D_8086764C, D_80867658, D_80867684, D_80867688,
D_80867690, D_80867698, D_808676A0, D_808676B8, D_808676D0, D_808676D4, D_808676D8, D_808676E4,
D_808676EC, D_808676F0, D_80867704, D_80867708, D_8086770C, D_80867710, D_80867714, D_8086771C,
D_80867734, D_8086773C, D_80867744, D_8086775C, D_80867778, D_8086777C, D_80867780, D_80867784,
};
const ActorInit En_Door_InitVars = {
@@ -336,7 +475,6 @@ void func_80866B20(EnDoor* this, GlobalContext* globalCtx) {
s32 temp_a1_2;
s32 temp_t0;
u8 temp_a1;
s32 pad;
if (Actor_ProcessTalkRequest(&this->dyna.actor, &globalCtx->state) && (this->dyna.actor.textId == 0x1821)) {
D_80867BC0[0] = 1;
@@ -396,10 +534,10 @@ void func_80866B20(EnDoor* this, GlobalContext* globalCtx) {
this->dyna.actor.textId = baseTextId + textIdOffset;
}
} else if ((this->unk_1A4 == 5) && (playerPosRelToDoor.z > 0.0f)) {
struct_80133038_arg2 sp30;
ScheduleResult sp30;
if (func_80133038(globalCtx, D_8086778C[this->switchFlag], &sp30) != 0) {
this->dyna.actor.textId = sp30.unk0 + 0x1800;
if (Schedule_RunScript(globalCtx, D_8086778C[this->switchFlag], &sp30) != 0) {
this->dyna.actor.textId = sp30.result + 0x1800;
player->doorType = ((this->dyna.actor.textId == 0x1821) && (D_80867BC0[0] != 0)) ? 5 : -1;
}
+131 -51
View File
@@ -20,21 +20,102 @@ void EnGm_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80950CDC(EnGm* this, GlobalContext* globalCtx);
void func_80950DB8(EnGm* this, GlobalContext* globalCtx);
static u32 D_80951820[] = {
0x0D000101, 0x360A0061, 0x25020600, 0x09001902, 0x0900090A, 0x0D02090A, 0x090F0105, 0x0E090A09, 0x0F0F0E09,
0x00090A18, 0x0E060009, 0x00060A00, 0x6C490209, 0x0A090F3D, 0x02090F0A, 0x0031020A, 0x000A0525, 0x020C0F0C,
0x1419020C, 0x140C320D, 0x020C320C, 0x3701050E, 0x0C320C37, 0x0C0E0C14, 0x0C32160E, 0x0C0F0C14, 0x0B0E0A00,
0x0A050A0E, 0x090F0A00, 0x150E090A, 0x090F090B, 0x00120085, 0x020A000A, 0x0579020A, 0x050A0A6D, 0x020A0A0A,
0x1E61020A, 0x1E0A2855, 0x020A280A, 0x2D49020A, 0x2D0A373D, 0x020A370B, 0x2D31020B, 0x2D0B3725, 0x020B370C,
0x0019020C, 0x000C0F0D, 0x020C0F0C, 0x1401050E, 0x0C0F0C14, 0x110E0C00, 0x0C0F1D0E, 0x0B370C00, 0x130E0B2D,
0x0B371C0E, 0x0A370B2D, 0x020E0A2D, 0x0A371B0E, 0x0A280A2D, 0x120E0A1E, 0x0A281A0E, 0x0A0A0A1E, 0x010E0A05,
0x0A0A190E, 0x0A000A05, 0x100A0015, 0x31020C37, 0x0D002502, 0x0D000D19, 0x19020D19, 0x15050D02, 0x15370505,
0x01050E15, 0x37050505, 0x0E0D1915, 0x05030E0D, 0x000D191E, 0x0E0C370D, 0x0014050D, 0x000200AB, 0x01320100,
0x880A0061, 0x31020600, 0x12002502, 0x12001500, 0x19021500, 0x150A0D02, 0x150A150F, 0x01050E15, 0x0A150F0F,
0x0E150015, 0x0A180E12, 0x00150006, 0x0E060012, 0x00070A00, 0x6C250215, 0x0A150F19, 0x02150F15, 0x190D0215,
0x19151E01, 0x050E1519, 0x151E0E0E, 0x150F1519, 0x170E150A, 0x150F0D0A, 0x00152502, 0x151E152D, 0x1902152D,
0x160A0D02, 0x160A0600, 0x01050E16, 0x0A060005, 0x0E152D16, 0x0A1E0E15, 0x1E152D14, 0x050A0061, 0x19020600,
0x12000D02, 0x12000600, 0x01050E00, 0x00000008, 0x0E060012, 0x00070505,
static u8 D_80951820[] = {
/* 0x000 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_L(1, 0x13B - 0x005),
/* 0x005 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_YADOYA, 0x02E - 0x009),
/* 0x009 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(6, 0, 9, 0, 0x028 - 0x00F),
/* 0x00F */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(9, 0, 9, 10, 0x022 - 0x015),
/* 0x015 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(9, 10, 9, 15, 0x01C - 0x01B),
/* 0x01B */ SCHEDULE_CMD_RET_NONE(),
/* 0x01C */ SCHEDULE_CMD_RET_TIME(9, 10, 9, 15, 15),
/* 0x022 */ SCHEDULE_CMD_RET_TIME(9, 0, 9, 10, 24),
/* 0x028 */ SCHEDULE_CMD_RET_TIME(6, 0, 9, 0, 6),
/* 0x02E */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_TOWN, 0x07B - 0x032),
/* 0x032 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(9, 10, 9, 15, 0x075 - 0x038),
/* 0x038 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(9, 15, 10, 0, 0x06F - 0x03E),
/* 0x03E */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(10, 0, 10, 5, 0x069 - 0x044),
/* 0x044 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(12, 15, 12, 20, 0x063 - 0x04A),
/* 0x04A */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(12, 20, 12, 50, 0x05D - 0x050),
/* 0x050 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(12, 50, 12, 55, 0x057 - 0x056),
/* 0x056 */ SCHEDULE_CMD_RET_NONE(),
/* 0x057 */ SCHEDULE_CMD_RET_TIME(12, 50, 12, 55, 12),
/* 0x05D */ SCHEDULE_CMD_RET_TIME(12, 20, 12, 50, 22),
/* 0x063 */ SCHEDULE_CMD_RET_TIME(12, 15, 12, 20, 11),
/* 0x069 */ SCHEDULE_CMD_RET_TIME(10, 0, 10, 5, 10),
/* 0x06F */ SCHEDULE_CMD_RET_TIME(9, 15, 10, 0, 21),
/* 0x075 */ SCHEDULE_CMD_RET_TIME(9, 10, 9, 15, 9),
/* 0x07B */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_L(SCENE_SONCHONOIE, 0x105 - 0x080),
/* 0x080 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(10, 0, 10, 5, 0x0FF - 0x086),
/* 0x086 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(10, 5, 10, 10, 0x0F9 - 0x08C),
/* 0x08C */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(10, 10, 10, 30, 0x0F3 - 0x092),
/* 0x092 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(10, 30, 10, 40, 0x0ED - 0x098),
/* 0x098 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(10, 40, 10, 45, 0x0E7 - 0x09E),
/* 0x09E */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(10, 45, 10, 55, 0x0E1 - 0x0A4),
/* 0x0A4 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(10, 55, 11, 45, 0x0DB - 0x0AA),
/* 0x0AA */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(11, 45, 11, 55, 0x0D5 - 0x0B0),
/* 0x0B0 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(11, 55, 12, 0, 0x0CF - 0x0B6),
/* 0x0B6 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(12, 0, 12, 15, 0x0C9 - 0x0BC),
/* 0x0BC */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(12, 15, 12, 20, 0x0C3 - 0x0C2),
/* 0x0C2 */ SCHEDULE_CMD_RET_NONE(),
/* 0x0C3 */ SCHEDULE_CMD_RET_TIME(12, 15, 12, 20, 17),
/* 0x0C9 */ SCHEDULE_CMD_RET_TIME(12, 0, 12, 15, 29),
/* 0x0CF */ SCHEDULE_CMD_RET_TIME(11, 55, 12, 0, 19),
/* 0x0D5 */ SCHEDULE_CMD_RET_TIME(11, 45, 11, 55, 28),
/* 0x0DB */ SCHEDULE_CMD_RET_TIME(10, 55, 11, 45, 2),
/* 0x0E1 */ SCHEDULE_CMD_RET_TIME(10, 45, 10, 55, 27),
/* 0x0E7 */ SCHEDULE_CMD_RET_TIME(10, 40, 10, 45, 18),
/* 0x0ED */ SCHEDULE_CMD_RET_TIME(10, 30, 10, 40, 26),
/* 0x0F3 */ SCHEDULE_CMD_RET_TIME(10, 10, 10, 30, 1),
/* 0x0F9 */ SCHEDULE_CMD_RET_TIME(10, 5, 10, 10, 25),
/* 0x0FF */ SCHEDULE_CMD_RET_TIME(10, 0, 10, 5, 16),
/* 0x105 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_MILK_BAR, 0x13A - 0x109),
/* 0x109 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(12, 55, 13, 0, 0x134 - 0x10F),
/* 0x10F */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(13, 0, 13, 25, 0x12E - 0x115),
/* 0x115 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(13, 25, 21, 5, 0x128 - 0x11B),
/* 0x11B */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(21, 55, 5, 5, 0x122 - 0x121),
/* 0x121 */ SCHEDULE_CMD_RET_NONE(),
/* 0x122 */ SCHEDULE_CMD_RET_TIME(21, 55, 5, 5, 5),
/* 0x128 */ SCHEDULE_CMD_RET_TIME(13, 25, 21, 5, 3),
/* 0x12E */ SCHEDULE_CMD_RET_TIME(13, 0, 13, 25, 30),
/* 0x134 */ SCHEDULE_CMD_RET_TIME(12, 55, 13, 0, 20),
/* 0x13A */ SCHEDULE_CMD_RET_NONE(),
/* 0x13B */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_L(2, 0x1EB - 0x140),
/* 0x140 */ SCHEDULE_CMD_CHECK_FLAG_L(0x32, 0x01, 0x1CD - 0x145),
/* 0x145 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_YADOYA, 0x17A - 0x149),
/* 0x149 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(6, 0, 18, 0, 0x174 - 0x14F),
/* 0x14F */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(18, 0, 21, 0, 0x16E - 0x155),
/* 0x155 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(21, 0, 21, 10, 0x168 - 0x15B),
/* 0x15B */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(21, 10, 21, 15, 0x162 - 0x161),
/* 0x161 */ SCHEDULE_CMD_RET_NONE(),
/* 0x162 */ SCHEDULE_CMD_RET_TIME(21, 10, 21, 15, 15),
/* 0x168 */ SCHEDULE_CMD_RET_TIME(21, 0, 21, 10, 24),
/* 0x16E */ SCHEDULE_CMD_RET_TIME(18, 0, 21, 0, 6),
/* 0x174 */ SCHEDULE_CMD_RET_TIME(6, 0, 18, 0, 7),
/* 0x17A */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_TOWN, 0x1A3 - 0x17E),
/* 0x17E */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(21, 10, 21, 15, 0x19D - 0x184),
/* 0x184 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(21, 15, 21, 25, 0x197 - 0x18A),
/* 0x18A */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(21, 25, 21, 30, 0x191 - 0x190),
/* 0x190 */ SCHEDULE_CMD_RET_NONE(),
/* 0x191 */ SCHEDULE_CMD_RET_TIME(21, 25, 21, 30, 14),
/* 0x197 */ SCHEDULE_CMD_RET_TIME(21, 15, 21, 25, 23),
/* 0x19D */ SCHEDULE_CMD_RET_TIME(21, 10, 21, 15, 13),
/* 0x1A3 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_MILK_BAR, 0x1CC - 0x1A7),
/* 0x1A7 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(21, 30, 21, 45, 0x1C6 - 0x1AD),
/* 0x1AD */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(21, 45, 22, 10, 0x1C0 - 0x1B3),
/* 0x1B3 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(22, 10, 6, 0, 0x1BA - 0x1B9),
/* 0x1B9 */ SCHEDULE_CMD_RET_NONE(),
/* 0x1BA */ SCHEDULE_CMD_RET_TIME(22, 10, 6, 0, 5),
/* 0x1C0 */ SCHEDULE_CMD_RET_TIME(21, 45, 22, 10, 30),
/* 0x1C6 */ SCHEDULE_CMD_RET_TIME(21, 30, 21, 45, 20),
/* 0x1CC */ SCHEDULE_CMD_RET_NONE(),
/* 0x1CD */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_YADOYA, 0x1EA - 0x1D1),
/* 0x1D1 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(6, 0, 18, 0, 0x1E4 - 0x1D7),
/* 0x1D7 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(18, 0, 6, 0, 0x1DE - 0x1DD),
/* 0x1DD */ SCHEDULE_CMD_RET_NONE(),
/* 0x1DE */ SCHEDULE_CMD_RET_TIME(0, 0, 0, 0, 8),
/* 0x1E4 */ SCHEDULE_CMD_RET_TIME(6, 0, 18, 0, 7),
/* 0x1EA */ SCHEDULE_CMD_RET_NONE(),
/* 0x1EB */ SCHEDULE_CMD_RET_NONE(),
};
static s32 D_80951A0C[] = {
@@ -889,7 +970,7 @@ s32 func_8094F53C(EnGm* this, GlobalContext* globalCtx) {
return false;
}
s32 func_8094F7D0(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2, u8 arg3, s16 arg4) {
s32 func_8094F7D0(EnGm* this, GlobalContext* globalCtx, ScheduleResult* arg2, u8 arg3, s16 arg4) {
u8 sp4F = ENGM_GET_FF(&this->actor);
Vec3s* sp48;
Vec3f sp3C;
@@ -901,8 +982,8 @@ s32 func_8094F7D0(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_234 = NULL;
actor = func_8094DEE0(this, globalCtx, arg3, arg4);
if (D_80951A0C[arg2->unk0] >= 0) {
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80951A0C[arg2->unk0]);
if (D_80951A0C[arg2->result] >= 0) {
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80951A0C[arg2->result]);
}
if ((actor != NULL) && (actor->update != NULL)) {
@@ -919,8 +1000,8 @@ s32 func_8094F7D0(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return ret;
}
s32 func_8094F904(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
u16 sp56 = gSaveContext.save.time - 0x3FFC;
s32 func_8094F904(EnGm* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
u16 sp56 = SCHEDULE_TIME_NOW;
u8 sp55 = ENGM_GET_FF(&this->actor);
EnDoor* door;
Vec3s* sp4C;
@@ -930,10 +1011,10 @@ s32 func_8094F904(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
s32 ret = false;
this->unk_234 = NULL;
door = func_8094DF90(globalCtx, arg2->unk0);
door = func_8094DF90(globalCtx, arg2->result);
if (D_80951A0C[arg2->unk0] >= 0) {
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp55, D_80951A0C[arg2->unk0]);
if (D_80951A0C[arg2->result] >= 0) {
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp55, D_80951A0C[arg2->result]);
}
if ((door != NULL) && (door->dyna.actor.update != NULL)) {
@@ -952,8 +1033,8 @@ s32 func_8094F904(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_261 = 75;
}
this->unk_3B8 = arg2->unk8 - arg2->unk4;
this->unk_3BA = sp56 - arg2->unk4;
this->unk_3B8 = arg2->time1 - arg2->time0;
this->unk_3BA = sp56 - arg2->time0;
this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_3A4 |= 0x100;
this->unk_3A4 |= 0x200;
@@ -965,16 +1046,16 @@ s32 func_8094F904(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return ret;
}
s32 func_8094FAC4(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
u16 sp2E = gSaveContext.save.time - 0x3FFC;
s32 func_8094FAC4(EnGm* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
u16 sp2E = SCHEDULE_TIME_NOW;
u16 phi_v1;
u8 sp2B = ENGM_GET_FF(&this->actor);
s32 pad;
s32 ret = false;
this->unk_234 = NULL;
if (D_80951A0C[arg2->unk0] >= 0) {
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp2B, D_80951A0C[arg2->unk0]);
if (D_80951A0C[arg2->result] >= 0) {
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp2B, D_80951A0C[arg2->result]);
}
if ((this->unk_234 != NULL) && (this->unk_234->count < 3)) {
@@ -985,13 +1066,13 @@ s32 func_8094FAC4(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
if ((this->unk_258 < 9) && (this->unk_258 != 0) && (this->unk_3C4 >= 0)) {
phi_v1 = sp2E;
} else {
phi_v1 = arg2->unk4;
phi_v1 = arg2->time0;
}
if (arg2->unk8 < phi_v1) {
this->unk_248 = (phi_v1 - arg2->unk8) + 0xFFFF;
if (arg2->time1 < phi_v1) {
this->unk_248 = (phi_v1 - arg2->time1) + 0xFFFF;
} else {
this->unk_248 = arg2->unk8 - phi_v1;
this->unk_248 = arg2->time1 - phi_v1;
}
this->unk_254 = sp2E - phi_v1;
@@ -1010,7 +1091,7 @@ s32 func_8094FAC4(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return ret;
}
s32 func_8094FCC4(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_8094FCC4(EnGm* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
static Vec3f D_80951D90 = { 64.0f, 0.0f, -122.0f };
s32 ret = false;
@@ -1030,7 +1111,7 @@ s32 func_8094FCC4(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return ret;
}
s32 func_8094FD88(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_8094FD88(EnGm* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
s32 ret = false;
if (func_8094F7D0(this, globalCtx, arg2, ACTORCAT_NPC, ACTOR_EN_RECEPGIRL)) {
@@ -1043,7 +1124,7 @@ s32 func_8094FD88(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return ret;
}
s32 func_8094FE10(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_8094FE10(EnGm* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
s32 ret = false;
Actor* al;
@@ -1064,7 +1145,7 @@ s32 func_8094FE10(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return ret;
}
s32 func_8094FF04(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_8094FF04(EnGm* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
static Vec3f D_80951D9C = { 64.0f, 0.0f, -122.0f };
u8 sp4F = ENGM_GET_FF(&this->actor);
Vec3s* sp48;
@@ -1075,8 +1156,8 @@ s32 func_8094FF04(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_234 = NULL;
if (D_80951A0C[arg2->unk0] >= 0) {
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80951A0C[arg2->unk0]);
if (D_80951A0C[arg2->result] >= 0) {
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80951A0C[arg2->result]);
}
if (this->unk_234 != NULL) {
@@ -1106,7 +1187,7 @@ s32 func_8094FF04(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return ret;
}
s32 func_80950088(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80950088(EnGm* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
static Vec3f D_80951DA8 = { 278.0f, 0.0f, 223.0f };
static Vec3s D_80951DB4 = { 0x0000, 0xC000, 0x0000 };
s32 pad;
@@ -1121,7 +1202,7 @@ s32 func_80950088(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return true;
}
s32 func_80950120(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80950120(EnGm* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
static Vec3f D_80951DBC = { -525.0f, 214.0f, 515.0f };
static Vec3s D_80951DC8 = { 0x0000, 0x38E0, 0x0000 };
s32 pad;
@@ -1136,7 +1217,7 @@ s32 func_80950120(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return true;
}
s32 func_809501B8(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_809501B8(EnGm* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
static Vec3f D_80951DD0 = { -334.0f, 225.0f, 903.0f };
static Vec3s D_80951DDC = { 0x0000, 0x7FFF, 0x0000 };
s32 pad;
@@ -1157,7 +1238,7 @@ s32 func_809501B8(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return true;
}
s32 func_80950280(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80950280(EnGm* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
s32 phi_v1;
this->actor.flags |= ACTOR_FLAG_1;
@@ -1168,7 +1249,7 @@ s32 func_80950280(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_3CC = 8;
this->unk_3B4 = 40.0f;
switch (arg2->unk0) {
switch (arg2->result) {
case 1:
phi_v1 = func_8094FD88(this, globalCtx, arg2);
break;
@@ -1493,21 +1574,20 @@ void func_80950C24(EnGm* this, GlobalContext* globalCtx) {
}
void func_80950CDC(EnGm* this, GlobalContext* globalCtx) {
u32* unk_14 = &gSaveContext.save.daySpeed;
struct_80133038_arg2 sp20;
ScheduleResult sp20;
this->unk_3C4 = REG(15) + *unk_14;
this->unk_3C4 = REG(15) + ((void)0, gSaveContext.save.daySpeed);
if (!func_80133038(globalCtx, (void*)&D_80951820, &sp20) ||
((this->unk_258 != sp20.unk0) && !func_80950280(this, globalCtx, &sp20))) {
if (!Schedule_RunScript(globalCtx, D_80951820, &sp20) ||
((this->unk_258 != sp20.result) && !func_80950280(this, globalCtx, &sp20))) {
this->actor.shape.shadowDraw = NULL;
this->actor.flags &= ~ACTOR_FLAG_1;
sp20.unk0 = 0;
sp20.result = 0;
} else {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
this->actor.flags |= ACTOR_FLAG_1;
}
this->unk_258 = sp20.unk0;
this->unk_258 = sp20.result;
this->unk_268 = func_8094F074(this, globalCtx);
func_80950C24(this, globalCtx);
}
+83 -53
View File
@@ -20,13 +20,44 @@ void EnIg_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80BF2AF8(EnIg* this, GlobalContext* globalCtx);
void func_80BF2BD4(EnIg* this, GlobalContext* globalCtx);
static s32 D_80BF3260[] = {
0x0D000100, 0xB10A006C, 0x4E020F19, 0x0F2D4202, 0x0F2D0F32, 0x36004B10, 0x1050210, 0x32103725,
0x02103711, 0x0F190211, 0x0F12000D, 0x02120006, 0x0001050E, 0x12000600, 0x040E110F, 0x0600020E,
0x1037110F, 0x0B0E1032, 0x1037060E, 0x0F2D0F32, 0x050E0F19, 0x0F2D0A0A, 0x00615A02, 0x0F2D0F32,
0x4E020F32, 0x100A4202, 0x100A101E, 0x36004B10, 0x1902101E, 0x10320D02, 0x10321037, 0x01050E10,
0x32103708, 0x0E101E10, 0x320D0210, 0x1E10320D, 0x02103210, 0x3701050E, 0x10321037, 0x090E101E,
0x10320E0E, 0x100A101E, 0x030E0F32, 0x100A0C0E, 0x0F2D0F32, 0x07050500,
static u8 D_80BF3260[] = {
/* 0x00 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_L(1, 0xB6 - 0x05),
/* 0x05 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_TOWN, 0x57 - 0x09),
/* 0x09 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(15, 25, 15, 45, 0x51 - 0x0F),
/* 0x0F */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(15, 45, 15, 50, 0x4B - 0x15),
/* 0x15 */ SCHEDULE_CMD_CHECK_FLAG_S(0x4B, 0x10, 0x1A - 0x19),
/* 0x19 */ SCHEDULE_CMD_RET_NONE(),
/* 0x1A */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(16, 50, 16, 55, 0x45 - 0x20),
/* 0x20 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(16, 55, 17, 15, 0x3F - 0x26),
/* 0x26 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(17, 15, 18, 0, 0x39 - 0x2C),
/* 0x2C */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(18, 0, 6, 0, 0x33 - 0x32),
/* 0x32 */ SCHEDULE_CMD_RET_NONE(),
/* 0x33 */ SCHEDULE_CMD_RET_TIME(18, 0, 6, 0, 4),
/* 0x39 */ SCHEDULE_CMD_RET_TIME(17, 15, 6, 0, 2),
/* 0x3F */ SCHEDULE_CMD_RET_TIME(16, 55, 17, 15, 11),
/* 0x45 */ SCHEDULE_CMD_RET_TIME(16, 50, 16, 55, 6),
/* 0x4B */ SCHEDULE_CMD_RET_TIME(15, 45, 15, 50, 5),
/* 0x51 */ SCHEDULE_CMD_RET_TIME(15, 25, 15, 45, 10),
/* 0x57 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_YADOYA, 0xB5 - 0x5B),
/* 0x5B */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(15, 45, 15, 50, 0xAF - 0x61),
/* 0x61 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(15, 50, 16, 10, 0xA9 - 0x67),
/* 0x67 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(16, 10, 16, 30, 0xA3 - 0x6D),
/* 0x6D */ SCHEDULE_CMD_CHECK_FLAG_S(0x4B, 0x10, 0x8A - 0x71),
/* 0x71 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(16, 30, 16, 50, 0x84 - 0x77),
/* 0x77 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(16, 50, 16, 55, 0x7E - 0x7D),
/* 0x7D */ SCHEDULE_CMD_RET_NONE(),
/* 0x7E */ SCHEDULE_CMD_RET_TIME(16, 50, 16, 55, 8),
/* 0x84 */ SCHEDULE_CMD_RET_TIME(16, 30, 16, 50, 13),
/* 0x8A */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(16, 30, 16, 50, 0x9D - 0x90),
/* 0x90 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(16, 50, 16, 55, 0x97 - 0x96),
/* 0x96 */ SCHEDULE_CMD_RET_NONE(),
/* 0x97 */ SCHEDULE_CMD_RET_TIME(16, 50, 16, 55, 9),
/* 0x9D */ SCHEDULE_CMD_RET_TIME(16, 30, 16, 50, 14),
/* 0xA3 */ SCHEDULE_CMD_RET_TIME(16, 10, 16, 30, 3),
/* 0xA9 */ SCHEDULE_CMD_RET_TIME(15, 50, 16, 10, 12),
/* 0xAF */ SCHEDULE_CMD_RET_TIME(15, 45, 15, 50, 7),
/* 0xB5 */ SCHEDULE_CMD_RET_NONE(),
/* 0xB6 */ SCHEDULE_CMD_RET_NONE(),
};
static s32 D_80BF3318[] = { -1, -1, 3, 1, 3, 1, 2, 0, 3, 5, 0, 3, 1, 2, 4 };
@@ -233,7 +264,7 @@ void func_80BF13E4(EnIg* this) {
Actor* func_80BF146C(EnIg* this, GlobalContext* globalCtx) {
Actor* retActor;
if (this->unk_298.unk0 == 3) {
if (this->scheduleResult == 3) {
retActor = func_80BF1150(this, globalCtx, ACTORCAT_NPC, ACTOR_EN_AN);
} else {
retActor = &GET_PLAYER(globalCtx)->actor;
@@ -361,7 +392,7 @@ s32 func_80BF17BC(EnIg* this, GlobalContext* globalCtx) {
}
s32* func_80BF1920(EnIg* this, GlobalContext* globalCtx) {
switch (this->unk_298.unk0) {
switch (this->scheduleResult) {
case 3:
this->unk_3F8 = func_80BF17BC;
return D_80BF335C;
@@ -395,8 +426,8 @@ s32 func_80BF19A0(EnIg* this, GlobalContext* globalCtx) {
this->unk_3F6 = 0;
this->unk_3F8 = NULL;
this->actor.child = this->unk_2A8;
this->unk_298.unk4 = func_80BF1920(this, globalCtx);
if ((this->unk_298.unk0 != 2) && (this->unk_298.unk0 != 3) && (this->unk_298.unk0 != 4)) {
this->unk_29C = func_80BF1920(this, globalCtx);
if ((this->scheduleResult != 2) && (this->scheduleResult != 3) && (this->scheduleResult != 4)) {
this->unk_3D0 |= 0x20;
}
this->actionFunc = func_80BF2BD4;
@@ -417,7 +448,7 @@ void func_80BF1A60(EnIg* this, GlobalContext* globalCtx) {
}
s32 func_80BF1AE0(EnIg* this, GlobalContext* globalCtx) {
switch (this->unk_298.unk0) {
switch (this->scheduleResult) {
case 3:
func_80BF1284(this, 0);
break;
@@ -465,7 +496,7 @@ s32 func_80BF1B40(EnIg* this, GlobalContext* globalCtx) {
return false;
}
s32 func_80BF1C44(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2, s32 arg3, s32 arg4) {
s32 func_80BF1C44(EnIg* this, GlobalContext* globalCtx, ScheduleResult* arg2, s32 arg3, s32 arg4) {
u8 sp4F = ENIG_GET_FF(&this->actor);
Vec3s* sp48;
Vec3f sp3C;
@@ -477,8 +508,8 @@ s32 func_80BF1C44(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
sp2C = func_80BF1150(this, globalCtx, arg3, arg4);
this->unk_274 = NULL;
if (D_80BF3318[arg2->unk0] >= 0) {
this->unk_274 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80BF3318[arg2->unk0]);
if (D_80BF3318[arg2->result] >= 0) {
this->unk_274 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80BF3318[arg2->result]);
}
if ((sp2C != NULL) && (sp2C->update != NULL)) {
@@ -495,7 +526,7 @@ s32 func_80BF1C44(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return sp24;
}
s32 func_80BF1D78(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80BF1D78(EnIg* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
s32 sp2C = 0;
if (func_80BF1C44(this, globalCtx, arg2, ACTORCAT_NPC, ACTOR_EN_AN)) {
@@ -508,8 +539,8 @@ s32 func_80BF1D78(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return sp2C;
}
s32 func_80BF1DF4(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
u16 sp56 = gSaveContext.save.time - 0x3FFC;
s32 func_80BF1DF4(EnIg* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
u16 sp56 = SCHEDULE_TIME_NOW;
u8 sp55 = ENIG_GET_FF(&this->actor);
EnDoor* door;
Vec3s* sp4C;
@@ -519,10 +550,10 @@ s32 func_80BF1DF4(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
s32 ret = false;
this->unk_274 = NULL;
door = func_80BF1200(globalCtx, arg2->unk0);
door = func_80BF1200(globalCtx, arg2->result);
if (D_80BF3318[arg2->unk0] >= 0) {
this->unk_274 = SubS_GetAdditionalPath(globalCtx, sp55, D_80BF3318[arg2->unk0]);
if (D_80BF3318[arg2->result] >= 0) {
this->unk_274 = SubS_GetAdditionalPath(globalCtx, sp55, D_80BF3318[arg2->result]);
}
if ((door != NULL) && (door->dyna.actor.update != NULL)) {
@@ -541,8 +572,8 @@ s32 func_80BF1DF4(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_2A4 = 75;
}
this->unk_3E0 = arg2->unk8 - arg2->unk4;
this->unk_3E2 = sp56 - arg2->unk4;
this->unk_3E0 = arg2->time1 - arg2->time0;
this->unk_3E2 = sp56 - arg2->time0;
this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_3D0 |= 0x100;
func_80BF1284(this, 3);
@@ -553,8 +584,8 @@ s32 func_80BF1DF4(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return ret;
}
s32 func_80BF1FA8(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
u16 sp2E = gSaveContext.save.time - 0x3FFC;
s32 func_80BF1FA8(EnIg* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
u16 sp2E = SCHEDULE_TIME_NOW;
u16 phi_v1;
u8 sp2B = ENIG_GET_FF(&this->actor);
s32 temp_t8;
@@ -562,8 +593,8 @@ s32 func_80BF1FA8(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_274 = NULL;
if (D_80BF3318[arg2->unk0] >= 0) {
this->unk_274 = SubS_GetAdditionalPath(globalCtx, sp2B, D_80BF3318[arg2->unk0]);
if (D_80BF3318[arg2->result] >= 0) {
this->unk_274 = SubS_GetAdditionalPath(globalCtx, sp2B, D_80BF3318[arg2->result]);
}
if ((this->unk_274 != NULL) && (this->unk_274->count < 3)) {
@@ -571,17 +602,17 @@ s32 func_80BF1FA8(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
}
if (this->unk_274 != NULL) {
temp_t8 = this->unk_298.unk0;
temp_t8 = this->scheduleResult;
if ((temp_t8 < 10) && (temp_t8 != 0) && (this->unk_3EC >= 0)) {
phi_v1 = sp2E;
} else {
phi_v1 = arg2->unk4;
phi_v1 = arg2->time0;
}
if (arg2->unk8 < phi_v1) {
this->unk_288 = (phi_v1 - arg2->unk8) + 0xFFFF;
if (arg2->time1 < phi_v1) {
this->unk_288 = (phi_v1 - arg2->time1) + 0xFFFF;
} else {
this->unk_288 = arg2->unk8 - phi_v1;
this->unk_288 = arg2->time1 - phi_v1;
}
this->unk_294 = sp2E - phi_v1;
@@ -602,7 +633,7 @@ s32 func_80BF1FA8(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return ret;
}
s32 func_80BF219C(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80BF219C(EnIg* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
u8 sp4F = ENIG_GET_FF(&this->actor);
Vec3f sp40;
Vec3f sp34;
@@ -612,8 +643,8 @@ s32 func_80BF219C(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_274 = NULL;
if (D_80BF3318[arg2->unk0] >= 0) {
this->unk_274 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80BF3318[arg2->unk0]);
if (D_80BF3318[arg2->result] >= 0) {
this->unk_274 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80BF3318[arg2->result]);
}
if ((this->unk_274 != 0) && (this->unk_274->count >= 2)) {
@@ -625,7 +656,7 @@ s32 func_80BF219C(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
Math_Vec3f_Copy(&this->actor.world.pos, &sp40);
Math_Vec3f_Copy(&this->actor.prevPos, &sp40);
switch (arg2->unk0) {
switch (arg2->result) {
case 2:
this->actor.home.rot.y = this->actor.world.rot.y;
this->actor.home.rot.y += 0x8000;
@@ -647,14 +678,14 @@ s32 func_80BF219C(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
return ret;
}
s32 func_80BF2368(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 func_80BF2368(EnIg* this, GlobalContext* globalCtx, ScheduleResult* arg2) {
s32 ret = false;
this->actor.targetMode = 0;
this->unk_3D0 = 0;
this->actor.flags |= ACTOR_FLAG_1;
switch (arg2->unk0) {
switch (arg2->result) {
case 5:
case 6:
case 7:
@@ -697,7 +728,7 @@ s32 func_80BF2400(EnIg* this, GlobalContext* globalCtx) {
}
s32 func_80BF2470(EnIg* this, GlobalContext* globalCtx) {
EnDoor* door = func_80BF1200(globalCtx, this->unk_298.unk0);
EnDoor* door = func_80BF1200(globalCtx, this->scheduleResult);
Vec3f sp38;
f32 temp;
s32 pad;
@@ -807,7 +838,7 @@ s32 func_80BF293C(EnIg* this, GlobalContext* globalCtx) {
}
void func_80BF2A50(EnIg* this, GlobalContext* globalCtx) {
switch (this->unk_298.unk0) {
switch (this->scheduleResult) {
case 10:
case 11:
case 12:
@@ -840,22 +871,21 @@ void func_80BF2A50(EnIg* this, GlobalContext* globalCtx) {
}
void func_80BF2AF8(EnIg* this, GlobalContext* globalCtx) {
u32* unk_14 = &gSaveContext.save.daySpeed;
struct_80133038_arg2 sp20;
ScheduleResult sp20;
this->unk_3EC = REG(15) + *unk_14;
this->unk_3EC = REG(15) + ((void)0, gSaveContext.save.daySpeed);
if (!func_80133038(globalCtx, D_80BF3260, &sp20) ||
((this->unk_298.unk0 != sp20.unk0) && !func_80BF2368(this, globalCtx, &sp20))) {
if (!Schedule_RunScript(globalCtx, D_80BF3260, &sp20) ||
((this->scheduleResult != sp20.result) && !func_80BF2368(this, globalCtx, &sp20))) {
this->actor.shape.shadowDraw = NULL;
this->actor.flags &= ~ACTOR_FLAG_1;
sp20.unk0 = 0;
sp20.result = 0;
} else {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
this->actor.flags |= ACTOR_FLAG_1;
}
this->unk_2A8 = func_80BF146C(this, globalCtx);
this->unk_298.unk0 = sp20.unk0;
this->scheduleResult = sp20.result;
func_80BF2A50(this, globalCtx);
}
@@ -864,14 +894,14 @@ void func_80BF2BD4(EnIg* this, GlobalContext* globalCtx) {
Vec3f sp38;
Vec3f sp2C;
if (func_8010BF58(&this->actor, globalCtx, this->unk_298.unk4, this->unk_3F8, &this->unk_298.unk8)) {
if (func_8010BF58(&this->actor, globalCtx, this->unk_29C, this->unk_3F8, &this->unk_2A0)) {
SubS_UpdateFlags(&this->unk_3D0, 3, 7);
this->unk_3D0 &= ~0x20;
this->unk_3D0 |= 0x200;
this->unk_3EE = 20;
this->unk_298.unk8 = 0;
this->unk_2A0 = 0;
this->actionFunc = func_80BF2AF8;
} else if (((this->unk_298.unk0 != 2) && (this->unk_298.unk0 != 4)) &&
} else if (((this->scheduleResult != 2) && (this->scheduleResult != 4)) &&
((this->unk_2A8 != NULL) && (this->unk_2A8->update != NULL))) {
Math_Vec3f_Copy(&sp38, &this->unk_2A8->world.pos);
Math_Vec3f_Copy(&sp2C, &this->actor.world.pos);
@@ -892,7 +922,7 @@ void EnIg_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitAndSetSphere(globalCtx, &this->collider2, &this->actor, &sSphereInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
Actor_SetScale(&this->actor, 0.01f);
this->unk_298.unk0 = 0;
this->scheduleResult = 0;
this->actor.gravity = 0.0f;
this->actionFunc = func_80BF2AF8;
this->actionFunc(this, globalCtx);
@@ -914,7 +944,7 @@ void EnIg_Update(Actor* thisx, GlobalContext* globalCtx) {
func_80BF1B40(this, globalCtx);
if (this->unk_298.unk0 != 0) {
if (this->scheduleResult != 0) {
func_80BF1258(this);
func_80BF13E4(this);
func_80BF15EC(this);
@@ -1003,7 +1033,7 @@ void EnIg_Draw(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnIg* this = THIS;
if (this->unk_298.unk0 != 0) {
if (this->scheduleResult != 0) {
func_8012C28C(globalCtx->state.gfxCtx);
OPEN_DISPS(globalCtx->state.gfxCtx);
+3 -1
View File
@@ -26,7 +26,9 @@ typedef struct EnIg {
/* 0x028C */ s32 unk_28C;
/* 0x0290 */ s32 unk_290;
/* 0x0294 */ s32 unk_294;
/* 0x0298 */ struct_80133038_arg2 unk_298;
/* 0x0298 */ u8 scheduleResult;
/* 0x029C */ s32* unk_29C;
/* 0x02A0 */ s32 unk_2A0;
/* 0x02A4 */ s8 unk_2A4;
/* 0x02A8 */ Actor* unk_2A8;
/* 0x02AC */ UNK_TYPE1 unk2AC[0x4];
@@ -3,6 +3,8 @@
* Overlay: ovl_En_Invadepoh
* Description: Ranch nighttime actors
*/
#include "prevent_bss_reordering.h"
#include "z_en_invadepoh.h"
#include "overlays/actors/ovl_En_Door/z_en_door.h"
#include "objects/gameplay_keep/gameplay_keep.h"

Some files were not shown because too many files have changed in this diff Show More