mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Decomp Message_GetState, add TextState enum and some header reorganization (#919)
* Message_GetState * Rename msgCtx->msgLength * Replace some enums * TEXT_STATE_CLOSING * use enum on switches * use enum when assigning to a variable * some minor cleanups * minor cleanup * TEXT_STATE_CHOICE * remove unused temp * z64message.h and z64view.h * steal some stuff from OoT * add some stuff to namefixer * fix shift * minor doc comment * Update MessageContext struct from andzura's branch Co-authored-by: Andzura <11079691+Andzura@users.noreply.github.com> * some other TextState uses I missed * format * statetimer in dec * review Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * review Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * review Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * format * Batch () commit Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * review Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * format * bss * use text state defines on new actors * fix matching * bss Co-authored-by: Andzura <11079691+Andzura@users.noreply.github.com> Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
This commit is contained in:
co-authored by
Andzura
engineer124
Derek Hensley
EllipticEllipsis
parent
f2b628241d
commit
addfe3a613
@@ -25,17 +25,6 @@
|
||||
(curState)->nextGameStateInit = (GameStateFunc)newInit; \
|
||||
(curState)->nextGameStateSize = sizeof(newStruct)
|
||||
|
||||
#define SET_FULLSCREEN_VIEWPORT(view) \
|
||||
{ \
|
||||
Viewport viewport; \
|
||||
viewport.bottomY = SCREEN_HEIGHT; \
|
||||
viewport.rightX = SCREEN_WIDTH; \
|
||||
viewport.topY = 0; \
|
||||
viewport.leftX = 0; \
|
||||
View_SetViewport(view, &viewport); \
|
||||
} \
|
||||
(void)0
|
||||
|
||||
#define GET_PLAYER(play) ((Player*)(play)->actorCtx.actorLists[ACTORCAT_PLAYER].first)
|
||||
|
||||
#define GET_FIRST_ENEMY(play) ((Actor*)(play)->actorCtx.actorLists[ACTORCAT_ENEMY].first)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
typedef struct MessageTableEntry{
|
||||
typedef struct MessageTableEntry {
|
||||
/* 0x0 */ u16 textId;
|
||||
/* 0x2 */ u8 typePos;
|
||||
/* 0x4 */ const char* segment;
|
||||
|
||||
+2
-151
@@ -39,6 +39,7 @@
|
||||
#include "z64light.h"
|
||||
#include "z64map.h"
|
||||
#include "z64math.h"
|
||||
#include "z64message.h"
|
||||
#include "z64object.h"
|
||||
#include "z64ocarina.h"
|
||||
#include "z64player.h"
|
||||
@@ -48,6 +49,7 @@
|
||||
#include "z64skin.h"
|
||||
#include "z64subs.h"
|
||||
#include "z64transition.h"
|
||||
#include "z64view.h"
|
||||
#include "regs.h"
|
||||
|
||||
#define Z_THREAD_ID_IDLE 1
|
||||
@@ -168,25 +170,6 @@ typedef struct FireObjLightParams {
|
||||
/* 0x5 */ Color_RGB8 maxColorAdj;
|
||||
} FireObjLightParams; // size = 0x8
|
||||
|
||||
#define FONT_CHAR_TEX_WIDTH 16
|
||||
#define FONT_CHAR_TEX_HEIGHT 16
|
||||
//! @TODO: Make this use `sizeof(AnyFontTextureSymbol)`
|
||||
#define FONT_CHAR_TEX_SIZE ((16 * 16) / 2) // 16x16 I4 texture
|
||||
|
||||
// Font textures are loaded into here
|
||||
typedef struct {
|
||||
/* 0x00000 */ u8 charBuf[2][FONT_CHAR_TEX_SIZE * 120];
|
||||
/* 0x07800 */ u8 iconBuf[FONT_CHAR_TEX_SIZE];
|
||||
/* 0x07880 */ u8 fontBuf[FONT_CHAR_TEX_SIZE * 320];
|
||||
/* 0x11880 */ union {
|
||||
u8 schar[640];
|
||||
u16 wchar[640];
|
||||
} msgBuf;
|
||||
/* 0x11D80 */ u8* messageStart;
|
||||
/* 0x11D84 */ u8* messageEnd;
|
||||
/* 0x11D88 */ u8 unk_11D88; // current Char Buffer ?
|
||||
} Font; // size = 0x11D8C
|
||||
|
||||
// Game Info aka. Static Context
|
||||
// Data normally accessed through REG macros (see regs.h)
|
||||
typedef struct {
|
||||
@@ -310,13 +293,6 @@ typedef struct {
|
||||
/* 0x3 */ s8 pillarboxMagnitude;
|
||||
} ShrinkWindowContext; // size = 0x4
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ s32 topY;
|
||||
/* 0x4 */ s32 bottomY;
|
||||
/* 0x8 */ s32 leftX;
|
||||
/* 0xC */ s32 rightX;
|
||||
} Viewport; // size = 0x10
|
||||
|
||||
typedef void(*osCreateThread_func)(void*);
|
||||
|
||||
typedef enum {
|
||||
@@ -422,34 +398,6 @@ typedef struct {
|
||||
/* 0x10 */ Vec3f projectedPos;
|
||||
} SoundSource; // size = 0x1C
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ u32 magic;
|
||||
/* 0x004 */ GraphicsContext* gfxCtx;
|
||||
/* 0x008 */ Viewport viewport;
|
||||
/* 0x018 */ f32 fovy;
|
||||
/* 0x01C */ f32 zNear;
|
||||
/* 0x020 */ f32 zFar;
|
||||
/* 0x024 */ f32 scale;
|
||||
/* 0x028 */ Vec3f eye;
|
||||
/* 0x034 */ Vec3f at;
|
||||
/* 0x040 */ Vec3f up;
|
||||
/* 0x04C */ UNK_TYPE1 pad4C[0x4];
|
||||
/* 0x050 */ Vp vp;
|
||||
/* 0x060 */ Mtx projection;
|
||||
/* 0x0A0 */ Mtx viewing;
|
||||
/* 0x0E0 */ Mtx unkE0;
|
||||
/* 0x120 */ Mtx* projectionPtr;
|
||||
/* 0x124 */ Mtx* viewingPtr;
|
||||
/* 0x128 */ Vec3f distortionDirRot;
|
||||
/* 0x134 */ Vec3f distortionScale;
|
||||
/* 0x140 */ f32 distortionSpeed;
|
||||
/* 0x144 */ Vec3f curDistortionDirRot;
|
||||
/* 0x150 */ Vec3f curDistortionScale;
|
||||
/* 0x15C */ u16 normal;
|
||||
/* 0x160 */ u32 flags; // bit 3: Render to an orthographic perspective
|
||||
/* 0x164 */ s32 unk164;
|
||||
} View; // size = 0x168
|
||||
|
||||
typedef void(*fault_update_input_func)(Input* input);
|
||||
|
||||
typedef struct {
|
||||
@@ -791,103 +739,6 @@ typedef struct {
|
||||
/* 0x24 */ u32 flags;
|
||||
} PreRenderParams; // size = 0x28
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 unk00;
|
||||
/* 0x01 */ u8 unk01;
|
||||
} MsgCtx11F00;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00000 */ View view;
|
||||
/* 0x00168 */ Font font;
|
||||
/* 0x11EF4 */ char unk_11EF4[0x4];
|
||||
/* 0x11EF8 */ UNK_PTR unk11EF8;
|
||||
/* 0x11EFC */ UNK_TYPE1 unk11EFC[0x4];
|
||||
/* 0x11F00 */ MsgCtx11F00* unk11F00;
|
||||
/* 0x11F04 */ u16 currentTextId;
|
||||
/* 0x11F06 */ UNK_TYPE1 pad11F06[0x4];
|
||||
/* 0x11F0A */ u8 unk11F0A;
|
||||
/* 0x11F0B */ UNK_TYPE1 pad11F0B[0x5];
|
||||
/* 0x11F10 */ s32 unk11F10;
|
||||
/* 0x11F14 */ UNK_TYPE1 pad11F14[0x6];
|
||||
/* 0x11F1A */ s16 unk11F1A[3];
|
||||
/* 0x11F20 */ UNK_TYPE1 pad11F20[0x2];
|
||||
/* 0x11F22 */ u8 msgMode;
|
||||
/* 0x11F23 */ UNK_TYPE1 pad11F23;
|
||||
/* 0x11F24 */ union {
|
||||
u8 schar[206];
|
||||
u16 wchar[103];
|
||||
} decodedBuffer;
|
||||
/* 0x11FF2 */ u16 unk11FF2;
|
||||
/* 0x11FF4 */ s16 unk11FF4;
|
||||
/* 0x11FF6 */ s16 unk11FF6;
|
||||
/* 0x11FF8 */ UNK_TYPE1 unk11FF8[0x6];
|
||||
/* 0x11FFE */ s16 unk11FFE[0x3];
|
||||
/* 0x12004 */ s16 unk12004;
|
||||
/* 0x12006 */ s16 unk12006;
|
||||
/* 0x12008 */ u8 unk12008[0x16];
|
||||
/* 0x1201E */ s16 unk1201E;
|
||||
/* 0x12020 */ u8 unk12020;
|
||||
/* 0x12021 */ u8 choiceIndex;
|
||||
/* 0x12022 */ u8 unk12022;
|
||||
/* 0x12023 */ u8 unk12023;
|
||||
/* 0x12024 */ s16 unk12024;
|
||||
/* 0x12026 */ u16 unk12026;
|
||||
/* 0x12028 */ u16 songPlayed;
|
||||
/* 0x1202A */ u16 ocarinaMode;
|
||||
/* 0x1202C */ u16 ocarinaAction;
|
||||
/* 0x1202E */ u16 unk1202E;
|
||||
/* 0x12030 */ s16 unk_12030;
|
||||
/* 0x12032 */ UNK_TYPE1 unk_12032[0x2];
|
||||
/* 0x12034 */ UNK_TYPE1 pad12034[0x6];
|
||||
/* 0x1203A */ s16 unk1203A;
|
||||
/* 0x1203C */ s16 unk1203C;
|
||||
/* 0x1203E */ s16 pad1203E;
|
||||
/* 0x12040 */ Actor* unkActor;
|
||||
/* 0x12044 */ s16 unk12044;
|
||||
/* 0x12046 */ s16 unk12046;
|
||||
/* 0x12048 */ u8 unk12048; // EnKakasi
|
||||
/* 0x12049 */ UNK_TYPE1 pad12049[0x1];
|
||||
/* 0x1204A */ s16 unk1204A[0x5];
|
||||
/* 0x12054 */ s16 unk12054[3]; // First, second and third digits in lottery code guess
|
||||
/* 0x1205A */ UNK_TYPE1 pad1205A[0xE];
|
||||
/* 0x12068 */ s16 unk12068;
|
||||
/* 0x1206A */ s16 unk1206A;
|
||||
/* 0x1206C */ s32 unk1206C;
|
||||
/* 0x12070 */ s32 unk12070;
|
||||
/* 0x12074 */ UNK_TYPE1 pad12074[0x4];
|
||||
/* 0x12078 */ s32 bankRupeesSelected;
|
||||
/* 0x1207C */ s32 bankRupees;
|
||||
/* 0x12080 */ MessageTableEntry* messageEntryTable;
|
||||
/* 0x12084 */ MessageTableEntry* messageEntryTableNes;
|
||||
/* 0x12088 */ UNK_TYPE4 unk12088;
|
||||
/* 0x1208C */ MessageTableEntry* messageTableStaff;
|
||||
/* 0x12090 */ s16 unk12090;
|
||||
/* 0x12092 */ s16 unk12092;
|
||||
/* 0x12094 */ s8 unk12094;
|
||||
/* 0x12095 */ UNK_TYPE1 unk12095[0x3];
|
||||
/* 0x12098 */ f32 unk12098; // Text_Scale?
|
||||
/* 0x1209C */ s16 unk1209C;
|
||||
/* 0x1209E */ UNK_TYPE1 unk1209E[0x2];
|
||||
/* 0x120A0 */ s32 unk120A0;
|
||||
/* 0x120A4 */ UNK_TYPE1 unk120A4[0xC];
|
||||
/* 0x120B0 */ u8 unk120B0;
|
||||
/* 0x120B1 */ u8 unk120B1;
|
||||
/* 0x120B2 */ u8 unk120B2[0xC];
|
||||
/* 0x120BE */ s16 unk120BE;
|
||||
/* 0x120C0 */ s16 unk120C0;
|
||||
/* 0x120C2 */ s16 unk120C2;
|
||||
/* 0x120C4 */ s32 unk120C4;
|
||||
/* 0x120C8 */ s16 unk120C8;
|
||||
/* 0x120CA */ s16 unk120CA;
|
||||
/* 0x120CC */ s16 unk120CC;
|
||||
/* 0x120CE */ s16 unk120CE;
|
||||
/* 0x120D0 */ s16 unk120D0;
|
||||
/* 0x120D2 */ s16 unk120D2;
|
||||
/* 0x120D4 */ s16 unk120D4;
|
||||
/* 0x120D6 */ s16 unk120D6;
|
||||
/* 0x120D8 */ UNK_TYPE1 pad120D8[0x8];
|
||||
} MessageContext; // size = 0x120E0
|
||||
|
||||
#define TRANS_TRIGGER_OFF 0 // transition is not active
|
||||
#define TRANS_TRIGGER_START 20 // start transition (exiting an area)
|
||||
#define TRANS_TRIGGER_END -20 // transition is ending (arriving in a new area)
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
#ifndef Z64MESSAGE_H
|
||||
#define Z64MESSAGE_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "z64view.h"
|
||||
#include "unk.h"
|
||||
|
||||
struct Actor;
|
||||
struct MessageTableEntry;
|
||||
struct OcarinaStaff;
|
||||
|
||||
typedef enum TextState {
|
||||
/* 0 */ TEXT_STATE_NONE,
|
||||
/* 1 */ TEXT_STATE_1,
|
||||
/* 2 */ TEXT_STATE_CLOSING,
|
||||
/* 3 */ TEXT_STATE_3,
|
||||
/* 4 */ TEXT_STATE_CHOICE,
|
||||
/* 5 */ TEXT_STATE_5,
|
||||
/* 6 */ TEXT_STATE_DONE,
|
||||
/* 7 */ TEXT_STATE_7,
|
||||
/* 8 */ TEXT_STATE_8,
|
||||
/* 9 */ TEXT_STATE_9,
|
||||
/* 10 */ TEXT_STATE_10,
|
||||
/* 11 */ TEXT_STATE_11,
|
||||
/* 12 */ TEXT_STATE_12,
|
||||
/* 13 */ TEXT_STATE_13,
|
||||
/* 14 */ TEXT_STATE_14,
|
||||
/* 15 */ TEXT_STATE_15,
|
||||
/* 16 */ TEXT_STATE_16,
|
||||
/* 17 */ TEXT_STATE_17,
|
||||
/* 18 */ TEXT_STATE_18
|
||||
} TextState;
|
||||
|
||||
|
||||
#define FONT_CHAR_TEX_WIDTH 16
|
||||
#define FONT_CHAR_TEX_HEIGHT 16
|
||||
//! @TODO: Make this use `sizeof(AnyFontTextureSymbol)`
|
||||
#define FONT_CHAR_TEX_SIZE ((16 * 16) / 2) // 16x16 I4 texture
|
||||
|
||||
// TODO: should Font be in its own header or is it fine to have it here?
|
||||
// Font textures are loaded into here
|
||||
typedef struct {
|
||||
/* 0x00000 */ union {
|
||||
u8 charBuf[2][FONT_CHAR_TEX_SIZE * 120];
|
||||
u64 force_structure_alignment_charTex;
|
||||
};
|
||||
/* 0x07800 */ union {
|
||||
u8 iconBuf[FONT_CHAR_TEX_SIZE];
|
||||
u64 force_structure_alignment_icon;
|
||||
};
|
||||
/* 0x07880 */ union {
|
||||
u8 fontBuf[FONT_CHAR_TEX_SIZE * 320];
|
||||
u64 force_structure_alignment_font;
|
||||
};
|
||||
/* 0x11880 */ union {
|
||||
char schar[1280]; // msgBuf
|
||||
u16 wchar[640]; // msgBufWide
|
||||
u64 force_structure_alignment_msg;
|
||||
} msgBuf;
|
||||
/* 0x11D80 */ u8* messageStart;
|
||||
/* 0x11D84 */ u8* messageEnd;
|
||||
/* 0x11D88 */ u8 unk_11D88; // current Char Buffer ?
|
||||
} Font; // size = 0x11D90
|
||||
|
||||
typedef struct MessageContext {
|
||||
/* 0x00000 */ View view;
|
||||
/* 0x00168 */ Font font;
|
||||
/* 0x11EF8 */ UNK_PTR unk11EF8;
|
||||
/* 0x11EFC */ UNK_TYPE1 unk11EFC[0x4];
|
||||
/* 0x11F00 */ struct OcarinaStaff* unk11F00;
|
||||
/* 0x11F04 */ u16 currentTextId;
|
||||
/* 0x11F06 */ UNK_TYPE1 unk11F06[0x2];
|
||||
/* 0x11F08 */ u16 unk11F08;
|
||||
/* 0x11F0A */ u8 unk11F0A;
|
||||
/* 0x11F0B */ s8 unk11F0B;
|
||||
/* 0x11F0C */ s8 unk11F0C;
|
||||
/* 0x11F0B */ UNK_TYPE1 unk11F0D[0x3];
|
||||
/* 0x11F10 */ s32 msgLength;
|
||||
/* 0x11F14 */ u16 unk11F14;
|
||||
/* 0x11F16 */ u16 unk11F16;
|
||||
/* 0x11F18 */ s8 unk11F18;
|
||||
/* 0x11F19 */ UNK_TYPE1 unk11F19[0x1];
|
||||
/* 0x11F1A */ s16 unk11F1A[3];
|
||||
/* 0x11F20 */ UNK_TYPE1 unk11F20[0x2];
|
||||
/* 0x11F22 */ u8 msgMode; // TODO: MessageMode enum
|
||||
/* 0x11F23 */ UNK_TYPE1 unk11F23;
|
||||
/* 0x11F24 */ union {
|
||||
char schar[200];
|
||||
u16 wchar[100];
|
||||
} decodedBuffer;
|
||||
/* 0x11FEC */ u16 msgBufPos;
|
||||
/* 0x11FEE */ s16 unk11FEE;
|
||||
/* 0x11FF0 */ s16 unk11FF0;
|
||||
/* 0x11FF2 */ u16 unk11FF2;
|
||||
/* 0x11FF4 */ s16 unk11FF4;
|
||||
/* 0x11FF6 */ s16 unk11FF6;
|
||||
/* 0x11FF8 */ s16 unk11FF8;
|
||||
/* 0x11FFA */ s16 unk11FFA;
|
||||
/* 0x11FFC */ s16 unk11FFC;
|
||||
/* 0x11FFE */ s16 unk11FFE[0x3];
|
||||
/* 0x12004 */ s16 unk12004;
|
||||
/* 0x12006 */ s16 unk12006;
|
||||
/* 0x12008 */ s16 unk12008;
|
||||
/* 0x1200A */ UNK_TYPE2 unk1200A;
|
||||
/* 0x1200C */ s16 unk1200C;
|
||||
/* 0x1200E */ s16 unk1200E;
|
||||
/* 0x12010 */ s16 unk12010;
|
||||
/* 0x12012 */ s16 unk12012;
|
||||
/* 0x12014 */ s16 unk12014;
|
||||
/* 0x12014 */ s16 unk12016;
|
||||
/* 0x12018 */ s16 unk12018; // messageR
|
||||
/* 0x1201A */ s16 unk1201A; // messageG
|
||||
/* 0x1201C */ s16 unk1201C; // messageB
|
||||
/* 0x1201E */ s16 unk1201E; // messageA
|
||||
/* 0x12020 */ u8 unk12020; // probably textboxEndType
|
||||
/* 0x12021 */ u8 choiceIndex;
|
||||
/* 0x12022 */ u8 unk12022;
|
||||
/* 0x12023 */ u8 stateTimer;
|
||||
/* 0x12024 */ s16 unk12024;
|
||||
/* 0x12026 */ u16 unk12026;
|
||||
/* 0x12028 */ u16 songPlayed;
|
||||
/* 0x1202A */ u16 ocarinaMode;
|
||||
/* 0x1202C */ u16 ocarinaAction;
|
||||
/* 0x1202E */ u16 unk1202E;
|
||||
/* 0x12030 */ s16 unk_12030;
|
||||
/* 0x12032 */ UNK_TYPE1 unk_12032[0x2];
|
||||
/* 0x12034 */ s16 unk12034;
|
||||
/* 0x12036 */ s16 unk12036;
|
||||
/* 0x12038 */ s16 unk12038;
|
||||
/* 0x1203A */ s16 unk1203A;
|
||||
/* 0x1203C */ s16 unk1203C;
|
||||
/* 0x1203E */ s16 unk1203E;
|
||||
/* 0x12040 */ struct Actor* unkActor;
|
||||
/* 0x12044 */ s16 unk12044;
|
||||
/* 0x12046 */ s16 unk12046;
|
||||
/* 0x12048 */ u8 unk12048; // EnKakasi
|
||||
/* 0x12049 */ UNK_TYPE1 unk12049[0x1];
|
||||
/* 0x1204A */ s16 unk1204A[0x5];
|
||||
/* 0x12054 */ s16 unk12054[6]; // First, second and third digits in lottery code guess
|
||||
/* 0x1205A */ UNK_TYPE1 unk12060[0x8];
|
||||
/* 0x12068 */ s16 unk12068;
|
||||
/* 0x1206A */ s16 unk1206A;
|
||||
/* 0x1206C */ s32 unk1206C;
|
||||
/* 0x12070 */ s32 unk12070;
|
||||
/* 0x12074 */ s32 unk12074;
|
||||
/* 0x12078 */ s32 bankRupeesSelected;
|
||||
/* 0x1207C */ s32 bankRupees;
|
||||
/* 0x12080 */ struct MessageTableEntry* messageEntryTable;
|
||||
/* 0x12084 */ struct MessageTableEntry* messageEntryTableNes;
|
||||
/* 0x12088 */ UNK_TYPE4 unk12088;
|
||||
/* 0x1208C */ struct MessageTableEntry* messageTableStaff;
|
||||
/* 0x12090 */ s16 unk12090;
|
||||
/* 0x12092 */ s16 unk12092;
|
||||
/* 0x12094 */ s8 unk12094;
|
||||
/* 0x12095 */ UNK_TYPE1 unk12095[0x3];
|
||||
/* 0x12098 */ f32 unk12098; // Text_Scale?
|
||||
/* 0x1209C */ s16 unk1209C;
|
||||
/* 0x1209E */ UNK_TYPE1 unk1209E[0x2];
|
||||
/* 0x120A0 */ s32 unk120A0;
|
||||
/* 0x120A4 */ s16 unk120A4[6];
|
||||
/* 0x120B0 */ u8 unk120B0;
|
||||
/* 0x120B1 */ u8 unk120B1;
|
||||
/* 0x120B2 */ u8 unk120B2[0xC];
|
||||
/* 0x120BE */ s16 unk120BE;
|
||||
/* 0x120C0 */ s16 unk120C0;
|
||||
/* 0x120C2 */ s16 unk120C2;
|
||||
/* 0x120C4 */ s32 unk120C4;
|
||||
/* 0x120C8 */ s16 unk120C8;
|
||||
/* 0x120CA */ s16 unk120CA;
|
||||
/* 0x120CC */ s16 unk120CC;
|
||||
/* 0x120CE */ s16 unk120CE;
|
||||
/* 0x120D0 */ s16 unk120D0;
|
||||
/* 0x120D2 */ s16 unk120D2;
|
||||
/* 0x120D4 */ s16 unk120D4;
|
||||
/* 0x120D6 */ s16 unk120D6;
|
||||
/* 0x120D8 */ UNK_TYPE1 unk120D8[0x8];
|
||||
} MessageContext; // size = 0x120E0
|
||||
|
||||
#endif
|
||||
@@ -116,7 +116,7 @@ typedef struct {
|
||||
/* 0x1 */ u8 buttonIndex[8];
|
||||
} OcarinaSongButtons; // size = 0x9
|
||||
|
||||
typedef struct {
|
||||
typedef struct OcarinaStaff {
|
||||
/* 0x0 */ u8 buttonIndex;
|
||||
/* 0x1 */ u8 state; // original name: "status"
|
||||
/* 0x2 */ u8 pos; // original name: "locate"
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
#ifndef Z64VIEW_H
|
||||
#define Z64VIEW_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "PR/gbi.h"
|
||||
#include "z64math.h"
|
||||
#include "unk.h"
|
||||
|
||||
struct GraphicsContext;
|
||||
|
||||
typedef struct Viewport {
|
||||
/* 0x00 */ s32 topY; // uly (upper left y)
|
||||
/* 0x04 */ s32 bottomY; // lry (lower right y)
|
||||
/* 0x08 */ s32 leftX; // ulx (upper left x)
|
||||
/* 0x0C */ s32 rightX; // lrx (lower right x)
|
||||
} Viewport; // size = 0x10
|
||||
|
||||
typedef struct View {
|
||||
/* 0x000 */ u32 magic; // string literal "VIEW" / 0x56494557
|
||||
/* 0x004 */ struct GraphicsContext* gfxCtx;
|
||||
/* 0x008 */ Viewport viewport;
|
||||
/* 0x018 */ f32 fovy; // vertical field of view in degrees
|
||||
/* 0x01C */ f32 zNear; // distance to near clipping plane
|
||||
/* 0x020 */ f32 zFar; // distance to far clipping plane
|
||||
/* 0x024 */ f32 scale; // scale for matrix elements
|
||||
/* 0x028 */ Vec3f eye;
|
||||
/* 0x034 */ Vec3f at;
|
||||
/* 0x040 */ Vec3f up;
|
||||
/* 0x04C */ UNK_TYPE1 pad4C[0x4];
|
||||
/* 0x050 */ Vp vp;
|
||||
/* 0x060 */ Mtx projection;
|
||||
/* 0x0A0 */ Mtx viewing;
|
||||
/* 0x0E0 */ Mtx unkE0;
|
||||
/* 0x120 */ Mtx* projectionPtr;
|
||||
/* 0x124 */ Mtx* viewingPtr;
|
||||
/* 0x128 */ Vec3f distortionDirRot;
|
||||
/* 0x134 */ Vec3f distortionScale;
|
||||
/* 0x140 */ f32 distortionSpeed;
|
||||
/* 0x144 */ Vec3f curDistortionDirRot;
|
||||
/* 0x150 */ Vec3f curDistortionScale;
|
||||
/* 0x15C */ u16 normal; // used to normalize the projection matrix
|
||||
/* 0x160 */ u32 flags; // bit 3: Render to an orthographic perspective
|
||||
/* 0x164 */ s32 unk164;
|
||||
} View; // size = 0x168
|
||||
|
||||
#define SET_FULLSCREEN_VIEWPORT(view) \
|
||||
{ \
|
||||
Viewport viewport; \
|
||||
viewport.bottomY = SCREEN_HEIGHT; \
|
||||
viewport.rightX = SCREEN_WIDTH; \
|
||||
viewport.topY = 0; \
|
||||
viewport.leftX = 0; \
|
||||
View_SetViewport(view, &viewport); \
|
||||
} \
|
||||
(void)0
|
||||
|
||||
#endif
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
|
||||
u8 sYaz0DataBuffer[0x400];
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
|
||||
u32 sDmaMgrDmaBuffSize = 0x2000;
|
||||
|
||||
+1
-1
@@ -1886,7 +1886,7 @@ s32 func_800B863C(Actor* actor, PlayState* play) {
|
||||
}
|
||||
|
||||
s32 Actor_TextboxIsClosing(Actor* actor, PlayState* play) {
|
||||
if (Message_GetState(&play->msgCtx) == 2) {
|
||||
if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) {
|
||||
actor->flags &= ~ACTOR_FLAG_100;
|
||||
return true;
|
||||
}
|
||||
|
||||
+7
-6
@@ -998,7 +998,7 @@ s32 Cutscene_CountNormalMasks(void) {
|
||||
// Command 0xA: Textbox
|
||||
void Cutscene_Command_Textbox(PlayState* play, CutsceneContext* csCtx, CsCmdTextbox* cmd) {
|
||||
static s32 D_801BB160 = CS_TEXTBOX_TYPE_DEFAULT;
|
||||
u8 dialogState;
|
||||
u8 talkState;
|
||||
s32 pad;
|
||||
u16 originalCsFrames;
|
||||
s32 pad2;
|
||||
@@ -1048,10 +1048,11 @@ void Cutscene_Command_Textbox(PlayState* play, CutsceneContext* csCtx, CsCmdText
|
||||
// a textbox that is expected to be closed by the user is still open.
|
||||
|
||||
originalCsFrames = csCtx->frames;
|
||||
dialogState = Message_GetState(&play->msgCtx);
|
||||
if ((dialogState != 2) && (dialogState != 0) && (dialogState != 7) && (dialogState != 8)) {
|
||||
talkState = Message_GetState(&play->msgCtx);
|
||||
if ((talkState != TEXT_STATE_CLOSING) && (talkState != TEXT_STATE_NONE) && (talkState != TEXT_STATE_7) &&
|
||||
(talkState != TEXT_STATE_8)) {
|
||||
csCtx->frames--;
|
||||
if ((dialogState == 4) && Message_ShouldAdvance(play)) {
|
||||
if ((talkState == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) {
|
||||
if (play->msgCtx.choiceIndex == 0) {
|
||||
if (cmd->base == 0x33BD) {
|
||||
func_8019F230();
|
||||
@@ -1089,12 +1090,12 @@ void Cutscene_Command_Textbox(PlayState* play, CutsceneContext* csCtx, CsCmdText
|
||||
}
|
||||
}
|
||||
|
||||
if (dialogState == 5 && Message_ShouldAdvance(play)) {
|
||||
if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
|
||||
func_80152434(play, cmd->base);
|
||||
}
|
||||
}
|
||||
|
||||
if ((dialogState == 2) && (D_801BB160 == CS_TEXTBOX_TYPE_3)) {
|
||||
if ((talkState == TEXT_STATE_CLOSING) && (D_801BB160 == CS_TEXTBOX_TYPE_3)) {
|
||||
csCtx->frames--;
|
||||
D_801BB124++;
|
||||
}
|
||||
|
||||
+77
-11
@@ -99,8 +99,8 @@ s32 Message_ShouldAdvanceSilent(PlayState* play) {
|
||||
void func_801477B4(PlayState* play) {
|
||||
MessageContext* msgCtx = &play->msgCtx;
|
||||
|
||||
if (play->msgCtx.unk11F10 != 0) {
|
||||
msgCtx->unk12023 = 2;
|
||||
if (play->msgCtx.msgLength != 0) {
|
||||
msgCtx->stateTimer = 2;
|
||||
msgCtx->msgMode = 0x43;
|
||||
msgCtx->unk12020 = 0;
|
||||
play_sound(NA_SE_PL_WALK_GROUND - SFX_FLAG);
|
||||
@@ -325,7 +325,7 @@ void Message_StartTextbox(PlayState* play, u16 textId, Actor* Actor) {
|
||||
func_80150D08(play, textId);
|
||||
msgCtx->unkActor = Actor;
|
||||
msgCtx->msgMode = 1;
|
||||
msgCtx->unk12023 = 0;
|
||||
msgCtx->stateTimer = 0;
|
||||
msgCtx->unk12024 = 0;
|
||||
play->msgCtx.ocarinaMode = 0;
|
||||
}
|
||||
@@ -334,11 +334,11 @@ void func_80151938(PlayState* play, u16 textId) {
|
||||
MessageContext* msgCtx = &play->msgCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
msgCtx->unk11F10 = 0;
|
||||
msgCtx->msgLength = 0;
|
||||
func_80150D08(play, textId);
|
||||
func_80150A84(play);
|
||||
msgCtx->msgMode = 5;
|
||||
msgCtx->unk12023 = 8;
|
||||
msgCtx->stateTimer = 8;
|
||||
msgCtx->unk12024 = 0;
|
||||
|
||||
if (interfaceCtx->unk_222 == 0) {
|
||||
@@ -354,24 +354,24 @@ void func_80151938(PlayState* play, u16 textId) {
|
||||
msgCtx->unk12004 = 0x22;
|
||||
msgCtx->unk12006 = 0x15E;
|
||||
func_80149C18(play);
|
||||
msgCtx->unk12023 = 1;
|
||||
msgCtx->stateTimer = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80151A68(PlayState* play, u16 textId) {
|
||||
MessageContext* msgCtx = &play->msgCtx;
|
||||
|
||||
msgCtx->unk11F10 = 0;
|
||||
msgCtx->msgLength = 0;
|
||||
func_80150D08(play, textId);
|
||||
func_80150A84(play);
|
||||
func_8015B198(play);
|
||||
msgCtx->msgMode = 0x45;
|
||||
msgCtx->unk12024 = 0;
|
||||
msgCtx->unk1203C = msgCtx->unk1203A = msgCtx->unk1201E = 0;
|
||||
msgCtx->unk12023 = 0x1E;
|
||||
msgCtx->stateTimer = 30;
|
||||
|
||||
// Day/Dawn/Night.. Messages
|
||||
if ((msgCtx->currentTextId >= 0x1BB2) && (msgCtx->currentTextId < 0x1BB7)) {
|
||||
if ((msgCtx->currentTextId >= 0x1BB2) && (msgCtx->currentTextId <= 0x1BB6)) {
|
||||
XREG(74) = 0x6A;
|
||||
XREG(75) = 0;
|
||||
XREG(77) = 0x58;
|
||||
@@ -439,7 +439,73 @@ void func_80152464(PlayState* play, u16 arg1) {
|
||||
func_80151DA4(play, arg1);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/Message_GetState.s")
|
||||
/**
|
||||
* @return u8 A value of the TextState enum representing the current state of the on-screen message
|
||||
*/
|
||||
u8 Message_GetState(MessageContext* msgCtx) {
|
||||
if (msgCtx->msgLength == 0) {
|
||||
return TEXT_STATE_NONE;
|
||||
}
|
||||
|
||||
if (msgCtx->msgMode == 0x42) {
|
||||
if (msgCtx->unk11F14 != 0xFFFF) {
|
||||
return TEXT_STATE_1;
|
||||
}
|
||||
|
||||
if ((msgCtx->unk12020 == 0x10) || (msgCtx->unk12020 == 0x11)) {
|
||||
return TEXT_STATE_CHOICE;
|
||||
}
|
||||
if ((msgCtx->unk12020 == 0x40) || (msgCtx->unk12020 == 0x42) || (msgCtx->unk12020 == 0x30)) {
|
||||
return TEXT_STATE_5;
|
||||
}
|
||||
if (msgCtx->unk12020 == 0x41) {
|
||||
return TEXT_STATE_16;
|
||||
}
|
||||
if ((msgCtx->unk12020 >= 0x50) && (msgCtx->unk12020 < 0x58)) {
|
||||
return TEXT_STATE_3;
|
||||
}
|
||||
if ((msgCtx->unk12020 == 0x60) || (msgCtx->unk12020 == 0x61)) {
|
||||
return TEXT_STATE_14;
|
||||
}
|
||||
if (msgCtx->unk12020 == 0x62) {
|
||||
return TEXT_STATE_15;
|
||||
}
|
||||
if (msgCtx->unk12020 == 0x63) {
|
||||
return TEXT_STATE_17;
|
||||
}
|
||||
if (msgCtx->unk12020 == 0x12) {
|
||||
return TEXT_STATE_18;
|
||||
}
|
||||
return TEXT_STATE_DONE;
|
||||
}
|
||||
|
||||
if (msgCtx->msgMode == 0x41) {
|
||||
return TEXT_STATE_10;
|
||||
}
|
||||
if (msgCtx->msgMode == 0x1B) {
|
||||
return TEXT_STATE_7;
|
||||
}
|
||||
if ((msgCtx->ocarinaMode == 3) || (msgCtx->msgMode == 0x37)) {
|
||||
return TEXT_STATE_8;
|
||||
}
|
||||
if (msgCtx->msgMode == 0x20) {
|
||||
return TEXT_STATE_9;
|
||||
}
|
||||
if ((msgCtx->msgMode == 0x21) || (msgCtx->msgMode == 0x3A)) {
|
||||
return TEXT_STATE_11;
|
||||
}
|
||||
if (msgCtx->msgMode == 0x3D) {
|
||||
return TEXT_STATE_12;
|
||||
}
|
||||
if (msgCtx->msgMode == 0x40) {
|
||||
return TEXT_STATE_13;
|
||||
}
|
||||
if ((msgCtx->msgMode == 0x43) && (msgCtx->stateTimer == 1) && (msgCtx->unk120B1 == 0)) {
|
||||
return TEXT_STATE_CLOSING;
|
||||
}
|
||||
|
||||
return TEXT_STATE_3;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_8015268C.s")
|
||||
|
||||
@@ -523,7 +589,7 @@ void Message_Init(PlayState* play) {
|
||||
func_801586A4(play);
|
||||
play->msgCtx.ocarinaMode = 0;
|
||||
messageCtx->msgMode = 0;
|
||||
messageCtx->unk11F10 = 0;
|
||||
messageCtx->msgLength = 0;
|
||||
messageCtx->currentTextId = 0;
|
||||
messageCtx->unk12020 = 0;
|
||||
messageCtx->choiceIndex = 0;
|
||||
|
||||
@@ -273,7 +273,7 @@ void func_80954340(BgIngate* this, PlayState* play) {
|
||||
void func_809543D4(BgIngate* this, PlayState* play) {
|
||||
u8 talkState = Message_GetState(&play->msgCtx);
|
||||
|
||||
if (((talkState == 4) || (talkState == 5)) && Message_ShouldAdvance(play)) {
|
||||
if (((talkState == TEXT_STATE_CHOICE) || (talkState == TEXT_STATE_5)) && Message_ShouldAdvance(play)) {
|
||||
switch (this->dyna.actor.textId) {
|
||||
case 0x9E4:
|
||||
this->dyna.actor.textId = 0x9E5;
|
||||
|
||||
@@ -356,7 +356,7 @@ void func_808B93A0(DoorWarp1* this, PlayState* play) {
|
||||
s32 pad;
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (Message_GetState(&play->msgCtx) == 4 && Message_ShouldAdvance(play)) {
|
||||
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) {
|
||||
func_801477B4(play);
|
||||
if (play->msgCtx.choiceIndex == 0) {
|
||||
func_8019F208();
|
||||
@@ -579,7 +579,7 @@ void func_808B9CE8(DoorWarp1* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_808B9E94(DoorWarp1* this, PlayState* play) {
|
||||
if (Message_GetState(&play->msgCtx) == 2) {
|
||||
if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) {
|
||||
this->unk_1CE = 110;
|
||||
DoorWarp1_SetupAction(this, func_808B9ED8);
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ void func_80BED3BC(EnAkindonuts* this, PlayState* play) {
|
||||
this->unk_32C &= ~0x1;
|
||||
this->unk_32C |= 0x40;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->unk_33C = 0x15EF;
|
||||
this->actionFunc = func_80BEF360;
|
||||
return;
|
||||
@@ -509,7 +509,7 @@ void func_80BED680(EnAkindonuts* this, PlayState* play) {
|
||||
this->unk_32C |= 0x40;
|
||||
this->unk_32C &= ~0x1;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->unk_33C = 0x15EF;
|
||||
this->actionFunc = func_80BEF360;
|
||||
return;
|
||||
@@ -604,7 +604,7 @@ void func_80BED8A4(EnAkindonuts* this, PlayState* play) {
|
||||
this->unk_32C |= 0x40;
|
||||
this->unk_32C &= ~0x1;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->unk_33C = 0x15EF;
|
||||
this->actionFunc = func_80BEF360;
|
||||
return;
|
||||
@@ -687,7 +687,7 @@ void func_80BEDB88(EnAkindonuts* this, PlayState* play) {
|
||||
this->unk_32C |= 0x40;
|
||||
this->unk_32C &= ~0x1;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->unk_33C = 0x15EF;
|
||||
this->actionFunc = func_80BEF360;
|
||||
return;
|
||||
@@ -777,7 +777,7 @@ void func_80BEDDAC(EnAkindonuts* this, PlayState* play) {
|
||||
this->unk_32C |= 0x40;
|
||||
this->unk_32C &= ~0x1;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->unk_33C = 0x15EF;
|
||||
this->actionFunc = func_80BEF360;
|
||||
return;
|
||||
@@ -855,7 +855,7 @@ void func_80BEE070(EnAkindonuts* this, PlayState* play) {
|
||||
this->unk_32C |= 0x40;
|
||||
this->unk_32C &= ~0x1;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->unk_33C = 0x161A;
|
||||
this->actionFunc = func_80BEF360;
|
||||
return;
|
||||
@@ -938,7 +938,7 @@ void func_80BEE274(EnAkindonuts* this, PlayState* play) {
|
||||
this->unk_32C |= 0x40;
|
||||
this->unk_32C &= ~0x1;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->unk_33C = 0x1629;
|
||||
this->actionFunc = func_80BEF360;
|
||||
return;
|
||||
@@ -1016,7 +1016,7 @@ void func_80BEE530(EnAkindonuts* this, PlayState* play) {
|
||||
this->unk_32C |= 0x40;
|
||||
this->unk_32C &= ~0x1;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->unk_33C = 0x15EF;
|
||||
this->actionFunc = func_80BEF360;
|
||||
return;
|
||||
@@ -1240,14 +1240,14 @@ void func_80BEEE10(EnAkindonuts* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80BEEFA8(EnAkindonuts* this, PlayState* play) {
|
||||
u8 temp_v0 = Message_GetState(&play->msgCtx);
|
||||
u8 talkState = Message_GetState(&play->msgCtx);
|
||||
|
||||
if (temp_v0 == 5) {
|
||||
if (talkState == TEXT_STATE_5) {
|
||||
if (Message_ShouldAdvance(play)) {
|
||||
if (this->unk_32C & 1) {
|
||||
this->unk_32C &= ~0x1;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->unk_33C = 0;
|
||||
this->actionFunc = func_80BEEE10;
|
||||
} else if (this->unk_32C & 0x20) {
|
||||
@@ -1255,7 +1255,7 @@ void func_80BEEFA8(EnAkindonuts* this, PlayState* play) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_1;
|
||||
this->unk_32C &= ~0x4;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->unk_338 = 8;
|
||||
this->unk_33C = 0;
|
||||
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338);
|
||||
@@ -1264,7 +1264,7 @@ void func_80BEEFA8(EnAkindonuts* this, PlayState* play) {
|
||||
this->unk_2DC(this, play);
|
||||
}
|
||||
}
|
||||
} else if (temp_v0 == 4) {
|
||||
} else if (talkState == TEXT_STATE_CHOICE) {
|
||||
if (Message_ShouldAdvance(play)) {
|
||||
switch (play->msgCtx.choiceIndex) {
|
||||
case 0:
|
||||
@@ -1279,22 +1279,22 @@ void func_80BEEFA8(EnAkindonuts* this, PlayState* play) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (temp_v0 == 16) {
|
||||
} else if (talkState == TEXT_STATE_16) {
|
||||
func_80BEE73C(this, play);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80BEF18C(EnAkindonuts* this, PlayState* play) {
|
||||
if ((Message_GetState(&play->msgCtx) == 5) && Message_ShouldAdvance(play)) {
|
||||
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->unk_33C = 0;
|
||||
this->actionFunc = func_80BEEE10;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80BEF20C(EnAkindonuts* this, PlayState* play) {
|
||||
u8 sp27 = Message_GetState(&play->msgCtx);
|
||||
u8 talkState = Message_GetState(&play->msgCtx);
|
||||
s16 sp24 = this->skelAnime.curFrame;
|
||||
s16 sp22 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common);
|
||||
|
||||
@@ -1310,11 +1310,11 @@ void func_80BEF20C(EnAkindonuts* this, PlayState* play) {
|
||||
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 6);
|
||||
}
|
||||
|
||||
if ((sp27 == 5) && Message_ShouldAdvance(play)) {
|
||||
if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
|
||||
if (this->unk_32C & 1) {
|
||||
this->unk_32C &= ~0x1;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->actionFunc = func_80BEF360;
|
||||
} else {
|
||||
this->unk_2DC(this, play);
|
||||
@@ -1341,7 +1341,7 @@ void func_80BEF360(EnAkindonuts* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80BEF450(EnAkindonuts* this, PlayState* play) {
|
||||
if ((Message_GetState(&play->msgCtx) == 6) && Message_ShouldAdvance(play)) {
|
||||
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
|
||||
func_800B85E0(&this->actor, play, 400.0f, -1);
|
||||
this->actionFunc = func_80BEF4B8;
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ void EnAni_IdleStanding(EnAni* this, PlayState* play) {
|
||||
|
||||
void EnAni_Talk(EnAni* this, PlayState* play) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Message_GetState(&play->msgCtx) == 2 && play->msgCtx.currentTextId == 0x6DE) {
|
||||
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) && play->msgCtx.currentTextId == 0x6DE) {
|
||||
this->actionFunc = EnAni_IdleInPain;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ void func_809C16DC(EnAob01* this, PlayState* play) {
|
||||
Rupees_ChangeBy(-this->unk_434);
|
||||
func_800B7298(play, NULL, 7);
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->actionFunc = func_809C1C9C;
|
||||
return;
|
||||
}
|
||||
@@ -426,9 +426,9 @@ void func_809C1C9C(EnAob01* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_809C1D64(EnAob01* this, PlayState* play) {
|
||||
u8 temp_v0 = Message_GetState(&play->msgCtx);
|
||||
u8 talkState = Message_GetState(&play->msgCtx);
|
||||
|
||||
if (temp_v0 == 4) {
|
||||
if (talkState == TEXT_STATE_CHOICE) {
|
||||
if (Message_ShouldAdvance(play)) {
|
||||
switch (play->msgCtx.choiceIndex) {
|
||||
case 0:
|
||||
@@ -453,9 +453,9 @@ void func_809C1D64(EnAob01* this, PlayState* play) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ((temp_v0 == 5) && Message_ShouldAdvance(play)) {
|
||||
} else if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->unk_210 = 0;
|
||||
this->actionFunc = func_809C2060;
|
||||
}
|
||||
@@ -521,7 +521,7 @@ void func_809C2060(EnAob01* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_809C21E0(EnAob01* this, PlayState* play) {
|
||||
u8 sp2F = Message_GetState(&play->msgCtx);
|
||||
u8 talkState = Message_GetState(&play->msgCtx);
|
||||
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 4000, 1);
|
||||
|
||||
@@ -561,7 +561,7 @@ void func_809C21E0(EnAob01* this, PlayState* play) {
|
||||
}
|
||||
this->unk_2D2 &= ~8;
|
||||
}
|
||||
} else if (sp2F == 4) {
|
||||
} else if (talkState == TEXT_STATE_CHOICE) {
|
||||
if (Message_ShouldAdvance(play)) {
|
||||
this->unk_2D2 &= ~0x40;
|
||||
switch (play->msgCtx.choiceIndex) {
|
||||
@@ -577,19 +577,19 @@ void func_809C21E0(EnAob01* this, PlayState* play) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (sp2F == 5) {
|
||||
} else if (talkState == TEXT_STATE_5) {
|
||||
if (Message_ShouldAdvance(play)) {
|
||||
this->unk_2D2 &= ~0x40;
|
||||
if (this->unk_2D2 & 0x10) {
|
||||
this->unk_2D2 &= ~0x10;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->actionFunc = func_809C2060;
|
||||
} else {
|
||||
func_809C16DC(this, play);
|
||||
}
|
||||
}
|
||||
} else if ((sp2F == 14) && Message_ShouldAdvance(play)) {
|
||||
} else if ((talkState == TEXT_STATE_14) && Message_ShouldAdvance(play)) {
|
||||
this->unk_2D2 &= ~0x40;
|
||||
this->unk_434 = play->msgCtx.bankRupeesSelected;
|
||||
func_809C16DC(this, play);
|
||||
@@ -746,13 +746,13 @@ void func_809C28B8(EnAob01* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_809C2A64(EnAob01* this, PlayState* play) {
|
||||
u8 sp2F = Message_GetState(&play->msgCtx);
|
||||
u8 talkState = Message_GetState(&play->msgCtx);
|
||||
|
||||
if (func_809C15BC(this)) {
|
||||
if ((sp2F == 5) && Message_ShouldAdvance(play)) {
|
||||
if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
|
||||
this->unk_434 = 0;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
}
|
||||
|
||||
if (Actor_HasParent(&this->actor, play)) {
|
||||
@@ -776,9 +776,9 @@ void func_809C2A64(EnAob01* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_809C2BE4(EnAob01* this, PlayState* play) {
|
||||
u8 temp_v0 = Message_GetState(&play->msgCtx);
|
||||
u8 talkState = Message_GetState(&play->msgCtx);
|
||||
|
||||
if (((temp_v0 == 5) || (temp_v0 == 6)) && Message_ShouldAdvance(play)) {
|
||||
if (((talkState == TEXT_STATE_5) || (talkState == TEXT_STATE_DONE)) && Message_ShouldAdvance(play)) {
|
||||
if (gSaveContext.save.weekEventReg[63] & 2) {
|
||||
gSaveContext.save.weekEventReg[63] &= (u8)~2;
|
||||
}
|
||||
@@ -805,7 +805,7 @@ void func_809C2C9C(EnAob01* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_809C2D0C(EnAob01* this, PlayState* play) {
|
||||
u8 sp2F = Message_GetState(&play->msgCtx);
|
||||
u8 talkState = Message_GetState(&play->msgCtx);
|
||||
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 4000, 1);
|
||||
|
||||
@@ -819,7 +819,7 @@ void func_809C2D0C(EnAob01* this, PlayState* play) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((sp2F == 5) && Message_ShouldAdvance(play)) {
|
||||
if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
|
||||
this->unk_2D2 &= ~0x40;
|
||||
this->unk_2D2 &= ~0x80;
|
||||
if (this->unk_434 >= 150) {
|
||||
|
||||
@@ -582,9 +582,9 @@ void EnBaba_Idle(EnBaba* this, PlayState* play) {
|
||||
void EnBaba_FollowSchedule_Talk(EnBaba* this, PlayState* play) {
|
||||
u8 talkState = Message_GetState(&play->msgCtx);
|
||||
|
||||
if (((talkState == 5) || (talkState == 6)) && Message_ShouldAdvance(play)) {
|
||||
if (((talkState == TEXT_STATE_5) || (talkState == TEXT_STATE_DONE)) && Message_ShouldAdvance(play)) {
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->actionFunc = EnBaba_FollowSchedule;
|
||||
}
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x100);
|
||||
@@ -593,12 +593,12 @@ void EnBaba_FollowSchedule_Talk(EnBaba* this, PlayState* play) {
|
||||
void EnBaba_Talk(EnBaba* this, PlayState* play) {
|
||||
u8 talkState = Message_GetState(&play->msgCtx);
|
||||
|
||||
if (talkState == 5) {
|
||||
if (talkState == TEXT_STATE_5) {
|
||||
if (Message_ShouldAdvance(play)) {
|
||||
if (this->stateFlags & BOMB_SHOP_LADY_STATE_END_CONVERSATION) {
|
||||
this->stateFlags &= ~BOMB_SHOP_LADY_STATE_END_CONVERSATION;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
if (this->stateFlags & BOMB_SHOP_LADY_STATE_AUTOTALK) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) {
|
||||
if (play->msgCtx.unk120B1 == 0) {
|
||||
@@ -617,13 +617,13 @@ void EnBaba_Talk(EnBaba* this, PlayState* play) {
|
||||
} else if (this->stateFlags & BOMB_SHOP_LADY_STATE_GIVE_BLAST_MASK) {
|
||||
this->stateFlags &= ~BOMB_SHOP_LADY_STATE_GIVE_BLAST_MASK;
|
||||
play->msgCtx.msgMode = 0x43;
|
||||
play->msgCtx.unk12023 = 4;
|
||||
play->msgCtx.stateTimer = 4;
|
||||
this->actionFunc = EnBaba_GiveBlastMask;
|
||||
} else {
|
||||
EnBaba_HandleConversation(this, play);
|
||||
}
|
||||
}
|
||||
} else if (talkState == 6) {
|
||||
} else if (talkState == TEXT_STATE_DONE) {
|
||||
if (Message_ShouldAdvance(play) && (play->msgCtx.unk120B1 == 0)) {
|
||||
gSaveContext.save.weekEventReg[81] |= 2;
|
||||
EnBaba_TriggerTransition(play, 0xD670);
|
||||
|
||||
@@ -222,7 +222,7 @@ void func_80BE8AAC(EnBaisen* this, PlayState* play) {
|
||||
EnBaisen_ChangeAnimation(this, 0);
|
||||
}
|
||||
}
|
||||
if ((Message_GetState(&play->msgCtx) == 5) && Message_ShouldAdvance(play)) {
|
||||
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
|
||||
func_801477B4(play);
|
||||
this->textIdIndex++;
|
||||
if (this->textIdIndex < 6) {
|
||||
|
||||
@@ -185,17 +185,19 @@ void EnBba01_Talk(EnHy* this, PlayState* play) {
|
||||
u8 talkState;
|
||||
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xFA0, 1);
|
||||
|
||||
talkState = Message_GetState(&play->msgCtx);
|
||||
this->inMsgState3 = (talkState == 3) ? true : false;
|
||||
this->inMsgState3 = (talkState == TEXT_STATE_3) ? true : false;
|
||||
|
||||
switch (talkState) {
|
||||
case 0:
|
||||
case TEXT_STATE_NONE:
|
||||
yaw = ABS_ALT(this->actor.shape.rot.y - this->actor.yawTowardsPlayer);
|
||||
if (yaw < 0x64) {
|
||||
Message_StartTextbox(play, this->textId, NULL);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
|
||||
case TEXT_STATE_CLOSING:
|
||||
this->actor.textId = 0;
|
||||
this->trackTarget = this->prevTrackTarget;
|
||||
this->headRot = this->prevHeadRot;
|
||||
|
||||
@@ -99,7 +99,7 @@ void func_809CCEE8(EnBji01* this, PlayState* play) {
|
||||
}
|
||||
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
|
||||
play->msgCtx.msgMode = 0;
|
||||
play->msgCtx.unk11F10 = 0;
|
||||
play->msgCtx.msgLength = 0;
|
||||
func_809CD028(this, play);
|
||||
} else {
|
||||
if (this->moonsTear != NULL) {
|
||||
@@ -198,14 +198,14 @@ void func_809CD028(EnBji01* this, PlayState* play) {
|
||||
|
||||
void EnBji01_DialogueHandler(EnBji01* this, PlayState* play) {
|
||||
switch (Message_GetState(&play->msgCtx)) {
|
||||
case 0:
|
||||
case TEXT_STATE_NONE:
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x444);
|
||||
func_809CCDE0(this, play);
|
||||
if (this->actor.shape.rot.y == this->actor.yawTowardsPlayer) {
|
||||
Message_StartTextbox(play, this->textId, &this->actor);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case TEXT_STATE_CHOICE:
|
||||
if (Message_ShouldAdvance(play)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_10000;
|
||||
this->actor.params = ENBJI01_PARAMS_FINISHED_CONVERSATION;
|
||||
@@ -233,7 +233,7 @@ void EnBji01_DialogueHandler(EnBji01* this, PlayState* play) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
case TEXT_STATE_5:
|
||||
if (Message_ShouldAdvance(play)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_10000;
|
||||
switch (play->msgCtx.currentTextId) {
|
||||
@@ -282,7 +282,7 @@ void EnBji01_DialogueHandler(EnBji01* this, PlayState* play) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
case TEXT_STATE_DONE:
|
||||
this->actor.params = ENBJI01_PARAMS_FINISHED_CONVERSATION;
|
||||
this->actor.flags &= ~ACTOR_FLAG_10000;
|
||||
func_809CCE98(this, play);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user