mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
time, button, misc docs
This commit is contained in:
+1
-1
@@ -1837,7 +1837,7 @@ void Inventory_UpdateItem(PlayState* play, s16 slot, s16 item);
|
||||
void Interface_SetAButtonDoAction(PlayState* play, u16 aButtonDoAction);
|
||||
void Interface_SetBButtonDoAction(PlayState* play, s16 bButtonDoAction);
|
||||
void Interface_SetTatlCall(PlayState* play, u16 tatlCallState);
|
||||
void func_80115844(PlayState* play, s16 arg1);
|
||||
void Interface_LoadBButtonDoActionLabel(PlayState* play, s16 bButtonDoAction);
|
||||
s32 Health_ChangeBy(PlayState* play, s16 healthChange);
|
||||
void Health_GiveHearts(s16 hearts);
|
||||
void Rupees_ChangeBy(s16 rupeeChange);
|
||||
|
||||
+4
-1
@@ -43,8 +43,9 @@
|
||||
#define bREG(r) BASE_REG(28, r)
|
||||
|
||||
/* TODO: Actually confirm these, in case of miss-match it's at least a simple list to `sed` */
|
||||
#define R_ENABLE_ARENA_DBG SREG(0) // Same as OoT
|
||||
#define R_TIME_SPEED REG(15)
|
||||
#define R_RUN_SPEED_LIMIT REG(45)
|
||||
#define R_ENABLE_ARENA_DBG SREG(0) // Same as OoT
|
||||
#define R_UPDATE_RATE SREG(30)
|
||||
#define R_PAUSE_MENU_MODE SREG(94)
|
||||
#define R_C_UP_ICON_X YREG(88)
|
||||
@@ -65,11 +66,13 @@
|
||||
#define R_ITEM_ICON_X(i) ZREG(82 + i)
|
||||
#define R_ITEM_ICON_Y(i) ZREG(86 + i)
|
||||
#define R_ITEM_ICON_DD(i) ZREG(90 + i)
|
||||
#define R_MAGIC_DBG_SET_UPGRADE XREG(4)
|
||||
#define R_A_BTN_Y XREG(16)
|
||||
#define R_A_BTN_X XREG(17)
|
||||
#define R_A_ICON_Y XREG(19)
|
||||
#define R_A_ICON_X XREG(20)
|
||||
#define R_A_BTN_COLOR(i) XREG(22 + i)
|
||||
#define R_A_BTN_Y_OFFSET XREG(31)
|
||||
#define R_MAGIC_CONSUME_TIMER_GIANTS_MASK XREG(41)
|
||||
#define R_MOON_CRASH_TIMER_Y XREG(80)
|
||||
#define R_MOON_CRASH_TIMER_X XREG(81)
|
||||
|
||||
+6
-6
@@ -1099,11 +1099,11 @@ extern UNK_PTR D_801BF5C0;
|
||||
// extern UNK_TYPE1 D_801BFB14;
|
||||
// extern UNK_TYPE1 D_801BFB1C;
|
||||
// extern UNK_TYPE1 D_801BFB24;
|
||||
// extern UNK_TYPE2 D_801BFB2C;
|
||||
// extern UNK_TYPE2 sThreeDayClockAlpha;
|
||||
// extern UNK_TYPE2 D_801BFB30;
|
||||
// extern UNK_TYPE2 D_801BFB34;
|
||||
// extern UNK_TYPE1 D_801BFB38;
|
||||
// extern UNK_TYPE1 D_801BFB6C;
|
||||
// extern UNK_TYPE1 sThreeDayClockHours;
|
||||
// extern UNK_TYPE1 sThreeDayClockHourTextures;
|
||||
// extern UNK_TYPE2 D_801BFBCC;
|
||||
// extern UNK_TYPE2 D_801BFBD0;
|
||||
// extern UNK_TYPE2 D_801BFBD4;
|
||||
@@ -1122,7 +1122,7 @@ extern UNK_PTR D_801BF5C0;
|
||||
// extern UNK_TYPE1 D_801BFC08;
|
||||
// extern UNK_TYPE1 D_801BFC0C;
|
||||
// extern UNK_TYPE1 D_801BFC10;
|
||||
// extern UNK_TYPE1 D_801BFC14;
|
||||
// extern UNK_TYPE1 sFinalHoursDigitTextures;
|
||||
// extern UNK_TYPE1 D_801BFC40;
|
||||
// extern UNK_TYPE2 D_801BFC50;
|
||||
// extern UNK_TYPE2 sMinigamePerfectType1PrimColorTargets;
|
||||
@@ -1155,8 +1155,8 @@ extern UNK_PTR D_801BF5C0;
|
||||
// extern UNK_TYPE2 sMinigameCountdownPrimColors;
|
||||
// extern UNK_TYPE1 gStoryTextures;
|
||||
// extern UNK_TYPE1 gStoryTLUTs;
|
||||
// extern UNK_TYPE1 D_801BFD94;
|
||||
// extern UNK_TYPE2 D_801BFD98;
|
||||
// extern UNK_TYPE1 sIsSunsPlayedAtDay;
|
||||
// extern UNK_TYPE2 sPrevTimeSpeed;
|
||||
|
||||
// extern UNK_TYPE1 D_801BFDD0;
|
||||
// extern UNK_TYPE1 D_801BFE00;
|
||||
|
||||
+1
-1
@@ -495,7 +495,7 @@ typedef enum {
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 unk_0;
|
||||
/* 0x02 */ u16 timeIncrement;
|
||||
/* 0x02 */ u16 sceneTimeSpeed; // time speed value from the scene file
|
||||
/* 0x04 */ f32 unk_4;
|
||||
/* 0x08 */ f32 unk_8;
|
||||
/* 0x0C */ f32 unk_C;
|
||||
|
||||
+13
-5
@@ -4,6 +4,14 @@
|
||||
#include "ultra64.h"
|
||||
#include "z64view.h"
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ A_BTN_STATE_0,
|
||||
/* 1 */ A_BTN_STATE_1,
|
||||
/* 2 */ A_BTN_STATE_2,
|
||||
/* 3 */ A_BTN_STATE_3,
|
||||
/* 4 */ A_BTN_STATE_4
|
||||
} AButtonState;
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ DO_ACTION_ATTACK,
|
||||
/* 0x01 */ DO_ACTION_CHECK,
|
||||
@@ -118,10 +126,10 @@ typedef struct {
|
||||
/* 0x1E4 */ OSMesgQueue loadQueue;
|
||||
/* 0x1FC */ OSMesg loadMsg;
|
||||
/* 0x200 */ Viewport viewport;
|
||||
/* 0x210 */ s16 unk_210;
|
||||
/* 0x212 */ u16 unk_212;
|
||||
/* 0x214 */ u16 unk_214;
|
||||
/* 0x218 */ f32 unk_218;
|
||||
/* 0x210 */ s16 aButtonState;
|
||||
/* 0x212 */ u16 aButtonHorseDoAction; // TODO: Confirm. Only seems to be used for Epona and "DO_ACTION_FASTER"
|
||||
/* 0x214 */ u16 aButtonDoAction;
|
||||
/* 0x218 */ f32 aButtonRoll;
|
||||
/* 0x21C */ s16 bButtonDoActionActive;
|
||||
/* 0x21E */ s16 bButtonDoAction;
|
||||
/* 0x220 */ s16 tatlCalling;
|
||||
@@ -138,7 +146,7 @@ typedef struct {
|
||||
/* 0x246 */ s16 heartsEnvG[2];
|
||||
/* 0x24A */ s16 heartsEnvB[2];
|
||||
/* 0x24E */ s16 health;
|
||||
/* 0x250 */ s16 unkTimer;
|
||||
/* 0x250 */ s16 healthTimer;
|
||||
/* 0x252 */ s16 lifeSizeChange;
|
||||
/* 0x254 */ s16 lifeSizeChangeDirection; // 1 means shrinking, 0 growing
|
||||
/* 0x256 */ s16 unk_256;
|
||||
|
||||
@@ -56,6 +56,11 @@ typedef enum {
|
||||
#define MAGIC_NORMAL_METER 0x30
|
||||
#define MAGIC_DOUBLE_METER (2 * MAGIC_NORMAL_METER)
|
||||
|
||||
// See `R_MAGIC_DBG_SET_UPGRADE`
|
||||
#define MAGIC_DBG_SET_UPGRADE_NO_ACTION 0
|
||||
#define MAGIC_DBG_SET_UPGRADE_NORMAL_METER -1
|
||||
#define MAGIC_DBG_SET_UPGRADE_DOUBLE_METER 1
|
||||
|
||||
#define SECONDS_TO_TIMER(seconds) ((seconds) * 100)
|
||||
|
||||
#define OSTIME_TO_TIMER(osTime) ((osTime) * 64 / 3000 / 10000)
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ typedef struct {
|
||||
/* 0x2 */ UNK_TYPE1 pad2[2];
|
||||
/* 0x4 */ u8 hour;
|
||||
/* 0x5 */ u8 min;
|
||||
/* 0x6 */ u8 unk6;
|
||||
/* 0x6 */ u8 timeSpeed;
|
||||
} SCmdTimeSettings; // size = 0x7
|
||||
|
||||
typedef struct {
|
||||
|
||||
+4
-4
@@ -251,9 +251,9 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
|
||||
break;
|
||||
case 0x12:
|
||||
if (!gSaveContext.save.isNight) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) - (u16)REG(15);
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) - (u16)R_TIME_SPEED;
|
||||
} else {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) - (u16)(2 * REG(15));
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) - (u16)(2 * R_TIME_SPEED);
|
||||
}
|
||||
break;
|
||||
case 0x13:
|
||||
@@ -325,8 +325,8 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
|
||||
if (csCtx->frames != D_801BB15C) {
|
||||
D_801BB15C = csCtx->frames;
|
||||
|
||||
if (REG(15) != 0) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)REG(15);
|
||||
if (R_TIME_SPEED != 0) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)R_TIME_SPEED;
|
||||
gSaveContext.save.time =
|
||||
((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.daySpeed);
|
||||
}
|
||||
|
||||
+15
-10
@@ -36,7 +36,7 @@ TexturePtr HeartDDTextures[] = {
|
||||
void LifeMeter_Init(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
interfaceCtx->unkTimer = 320;
|
||||
interfaceCtx->healthTimer = 320;
|
||||
|
||||
interfaceCtx->health = gSaveContext.save.playerData.health;
|
||||
|
||||
@@ -167,39 +167,44 @@ void LifeMeter_UpdateColors(PlayState* play) {
|
||||
sBeatingHeartsDDEnv[2] = (u8)(bFactor + 0) & 0xFF;
|
||||
}
|
||||
|
||||
// Unused
|
||||
s32 LifeMeter_SaveInterfaceHealth(PlayState* play) {
|
||||
gSaveContext.save.playerData.health = play->interfaceCtx.health;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
gSaveContext.save.playerData.health = interfaceCtx->health;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Unused
|
||||
s32 LifeMeter_IncreaseInterfaceHealth(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
interfaceCtx->unkTimer = 320;
|
||||
interfaceCtx->healthTimer = 320;
|
||||
interfaceCtx->health += 0x10;
|
||||
if (play->interfaceCtx.health >= gSaveContext.save.playerData.health) {
|
||||
play->interfaceCtx.health = gSaveContext.save.playerData.health;
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Unused
|
||||
s32 LifeMeter_DecreaseInterfaceHealth(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
if (interfaceCtx->unkTimer != 0) {
|
||||
interfaceCtx->unkTimer--;
|
||||
if (interfaceCtx->healthTimer != 0) {
|
||||
interfaceCtx->healthTimer--;
|
||||
} else {
|
||||
interfaceCtx->unkTimer = 320;
|
||||
interfaceCtx->healthTimer = 320;
|
||||
interfaceCtx->health -= 0x10;
|
||||
if (interfaceCtx->health <= 0) {
|
||||
interfaceCtx->health = 0;
|
||||
play->damagePlayer(play, -(((void)0, gSaveContext.save.playerData.health) + 1));
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
void LifeMeter_Draw(PlayState* play) {
|
||||
|
||||
+206
-194
File diff suppressed because it is too large
Load Diff
+7
-7
@@ -380,25 +380,25 @@ void Scene_HeaderCmdTimeSettings(PlayState* play, SceneCmd* cmd) {
|
||||
(u16)(((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f);
|
||||
}
|
||||
|
||||
if (cmd->timeSettings.unk6 != 0xFF) {
|
||||
play->envCtx.timeIncrement = cmd->timeSettings.unk6;
|
||||
if (cmd->timeSettings.timeSpeed != 0xFF) {
|
||||
play->envCtx.sceneTimeSpeed = cmd->timeSettings.timeSpeed;
|
||||
} else {
|
||||
play->envCtx.timeIncrement = 0;
|
||||
play->envCtx.sceneTimeSpeed = 0;
|
||||
}
|
||||
|
||||
if ((gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) && (play->envCtx.timeIncrement != 0)) {
|
||||
play->envCtx.timeIncrement = 5;
|
||||
if ((gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) && (play->envCtx.sceneTimeSpeed != 0)) {
|
||||
play->envCtx.sceneTimeSpeed = 5;
|
||||
}
|
||||
|
||||
if (gSaveContext.sunsSongState == SUNSSONG_INACTIVE) {
|
||||
REG(15) = play->envCtx.timeIncrement;
|
||||
R_TIME_SPEED = play->envCtx.sceneTimeSpeed;
|
||||
}
|
||||
|
||||
play->envCtx.unk_4 = -(Math_SinS(((void)0, gSaveContext.save.time) - 0x8000) * 120.0f) * 25.0f;
|
||||
play->envCtx.unk_8 = (Math_CosS(((void)0, gSaveContext.save.time) - 0x8000) * 120.0f) * 25.0f;
|
||||
play->envCtx.unk_C = (Math_CosS(((void)0, gSaveContext.save.time) - 0x8000) * 20.0f) * 25.0f;
|
||||
|
||||
if ((play->envCtx.timeIncrement == 0) && (gSaveContext.save.cutscene < 0xFFF0)) {
|
||||
if ((play->envCtx.sceneTimeSpeed == 0) && (gSaveContext.save.cutscene < 0xFFF0)) {
|
||||
gSaveContext.skyboxTime = gSaveContext.save.time;
|
||||
|
||||
if ((gSaveContext.skyboxTime >= CLOCK_TIME(4, 0)) && (gSaveContext.skyboxTime < CLOCK_TIME(6, 30))) {
|
||||
|
||||
@@ -1816,8 +1816,8 @@ void DmStk_Update(Actor* thisx, PlayState* play) {
|
||||
(play->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(&play->state) &&
|
||||
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (ActorCutscene_GetCurrentIndex() == -1) &&
|
||||
(play->csCtx.state == 0)) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)REG(15);
|
||||
if (REG(15) != 0) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)R_TIME_SPEED;
|
||||
if (R_TIME_SPEED != 0) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.daySpeed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -748,7 +748,7 @@ void func_80BDF578(EnAl* this, PlayState* play) {
|
||||
void func_80BDF5E8(EnAl* this, PlayState* play) {
|
||||
ScheduleOutput sp20;
|
||||
|
||||
this->unk_4E0 = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->unk_4E0 = R_TIME_SPEED + ((void)0, gSaveContext.save.daySpeed);
|
||||
if (!Schedule_RunScript(play, D_80BDFC70, &sp20) ||
|
||||
((this->unk_35C != sp20.result) && !func_80BDF390(this, play, &sp20))) {
|
||||
this->actor.shape.shadowDraw = NULL;
|
||||
|
||||
@@ -100,7 +100,7 @@ void func_809C10B0(EnAob01* this, s32 arg1) {
|
||||
}
|
||||
|
||||
void func_809C1124(void) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)REG(15);
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)R_TIME_SPEED;
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.daySpeed);
|
||||
}
|
||||
|
||||
|
||||
@@ -654,7 +654,7 @@ void EnBaba_GaveBlastMask(EnBaba* this, PlayState* play) {
|
||||
void EnBaba_FollowSchedule(EnBaba* this, PlayState* play) {
|
||||
ScheduleOutput scheduleOutput;
|
||||
|
||||
this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.daySpeed);
|
||||
|
||||
if (!Schedule_RunScript(play, sSchedule, &scheduleOutput) ||
|
||||
((this->scheduleResult != scheduleOutput.result) &&
|
||||
|
||||
@@ -846,7 +846,7 @@ void EnFishing_Init(Actor* thisx, PlayState* play2) {
|
||||
|
||||
D_8090CD04 = 20;
|
||||
play->specialEffects = sFishingEffects;
|
||||
REG(15) = 1; // gTimeIncrement in OoT
|
||||
R_TIME_SPEED = 1;
|
||||
D_809171FC = 0;
|
||||
D_809171F6 = 10;
|
||||
|
||||
|
||||
@@ -1582,7 +1582,7 @@ void func_80950C24(EnGm* this, PlayState* play) {
|
||||
void func_80950CDC(EnGm* this, PlayState* play) {
|
||||
ScheduleOutput sp20;
|
||||
|
||||
this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.daySpeed);
|
||||
|
||||
if (!Schedule_RunScript(play, D_80951820, &sp20) ||
|
||||
((this->unk_258 != sp20.result) && !func_80950280(this, play, &sp20))) {
|
||||
|
||||
@@ -3993,9 +3993,9 @@ void func_80886C00(EnHorse* this, PlayState* play) {
|
||||
|
||||
if (((this->action == ENHORSE_ACTION_MOUNTED_WALK) || (this->action == ENHORSE_ACTION_MOUNTED_TROT) ||
|
||||
(this->action == ENHORSE_ACTION_MOUNTED_GALLOP)) &&
|
||||
(CHECK_BTN_ALL(input->press.button, BTN_A) || (func_801A5100() == 5)) && (play->interfaceCtx.unk_212 == 8) &&
|
||||
!(this->stateFlags & ENHORSE_BOOST) && !(this->stateFlags & ENHORSE_FLAG_8) &&
|
||||
!(this->stateFlags & ENHORSE_FLAG_9)) {
|
||||
(CHECK_BTN_ALL(input->press.button, BTN_A) || (func_801A5100() == 5)) &&
|
||||
(play->interfaceCtx.aButtonHorseDoAction == DO_ACTION_FASTER) && !(this->stateFlags & ENHORSE_BOOST) &&
|
||||
!(this->stateFlags & ENHORSE_FLAG_8) && !(this->stateFlags & ENHORSE_FLAG_9)) {
|
||||
if (this->numBoosts > 0) {
|
||||
Rumble_Request(0.0f, 180, 20, 100);
|
||||
this->stateFlags |= ENHORSE_BOOST;
|
||||
|
||||
@@ -876,7 +876,7 @@ void func_80BF2A50(EnIg* this, PlayState* play) {
|
||||
void func_80BF2AF8(EnIg* this, PlayState* play) {
|
||||
ScheduleOutput sp20;
|
||||
|
||||
this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
this->timePathTimeSpeed = R_TIME_SPEED + ((void)0, gSaveContext.save.daySpeed);
|
||||
|
||||
if (!Schedule_RunScript(play, D_80BF3260, &sp20) ||
|
||||
((this->scheduleResult != sp20.result) && !func_80BF2368(this, play, &sp20))) {
|
||||
|
||||
@@ -3015,7 +3015,7 @@ void func_80B49C38(EnInvadepoh* this, PlayState* play) {
|
||||
if (this->unk378 == 0) {
|
||||
temp_v0_2 = func_800FE620(play);
|
||||
if (temp_v0_2 > 0) {
|
||||
temp_v0_2 = (REG(15) * -16.0f / temp_v0_2) - 0.5f;
|
||||
temp_v0_2 = (R_TIME_SPEED * -16.0f / temp_v0_2) - 0.5f;
|
||||
this->unk378 = func_80B45550(this, play, SQ(80.0f), temp_v0_2);
|
||||
}
|
||||
}
|
||||
@@ -3967,7 +3967,7 @@ void func_80B4C730(EnInvadepoh* this, PlayState* play) {
|
||||
if (this->unk378 == 0) {
|
||||
temp_v0_2 = func_800FE620(play);
|
||||
if (temp_v0_2 > 0) {
|
||||
temp_v0_2 = (REG(15) * -23.0f / temp_v0_2) - 0.5f;
|
||||
temp_v0_2 = (R_TIME_SPEED * -23.0f / temp_v0_2) - 0.5f;
|
||||
this->unk378 = func_80B45550(this, play, SQ(80.0f), temp_v0_2);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user