mirror of https://github.com/zeldaret/mm.git
Document EnAob01 (doggy racetrack owner) and use macros for weekEventRegs in all dog racing files (#1234)
* Document EnAob01 (doggy racetrack owner) and use macros for weekEventRegs in all dog racing files * Respond to first review * Respond to anon's review * Forgot a _FLAG_ on one of my flags * Respond to anon's review * Respond to engineer's review * Delete extra period * Undo the EVENTINF stuff I goofed up * Update comment * Fix bss * Respond to engineer's review
This commit is contained in:
parent
7bdbca10a5
commit
389a2bf33c
|
|
@ -594,7 +594,7 @@ typedef enum {
|
|||
#define WEEKEVENTREG_08_04 PACK_WEEKEVENTREG_FLAG(8, 0x04)
|
||||
#define WEEKEVENTREG_08_08 PACK_WEEKEVENTREG_FLAG(8, 0x08)
|
||||
#define WEEKEVENTREG_08_10 PACK_WEEKEVENTREG_FLAG(8, 0x10)
|
||||
#define WEEKEVENTREG_08_20 PACK_WEEKEVENTREG_FLAG(8, 0x20)
|
||||
#define WEEKEVENTREG_RECEIVED_DOGGY_RACETRACK_HEART_PIECE PACK_WEEKEVENTREG_FLAG(8, 0x20)
|
||||
|
||||
// Related to final hours
|
||||
#define WEEKEVENTREG_08_40 PACK_WEEKEVENTREG_FLAG(8, 0x40)
|
||||
|
|
@ -857,7 +857,7 @@ typedef enum {
|
|||
|
||||
#define WEEKEVENTREG_34_02 PACK_WEEKEVENTREG_FLAG(34, 0x02)
|
||||
#define WEEKEVENTREG_34_04 PACK_WEEKEVENTREG_FLAG(34, 0x04)
|
||||
#define WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED PACK_WEEKEVENTREG_FLAG(34, 0x08)
|
||||
#define WEEKEVENTREG_TALKED_SWAMP_SPIDER_HOUSE_MAN PACK_WEEKEVENTREG_FLAG(34, 0x08)
|
||||
#define WEEKEVENTREG_34_10 PACK_WEEKEVENTREG_FLAG(34, 0x10)
|
||||
#define WEEKEVENTREG_34_20 PACK_WEEKEVENTREG_FLAG(34, 0x20)
|
||||
#define WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH PACK_WEEKEVENTREG_FLAG(34, 0x40)
|
||||
|
|
@ -924,62 +924,11 @@ typedef enum {
|
|||
#define WEEKEVENTREG_41_20 PACK_WEEKEVENTREG_FLAG(41, 0x20)
|
||||
#define WEEKEVENTREG_41_40 PACK_WEEKEVENTREG_FLAG(41, 0x40)
|
||||
#define WEEKEVENTREG_41_80 PACK_WEEKEVENTREG_FLAG(41, 0x80)
|
||||
#define WEEKEVENTREG_42_01 PACK_WEEKEVENTREG_FLAG(42, 0x01)
|
||||
#define WEEKEVENTREG_42_02 PACK_WEEKEVENTREG_FLAG(42, 0x02)
|
||||
#define WEEKEVENTREG_42_04 PACK_WEEKEVENTREG_FLAG(42, 0x04)
|
||||
#define WEEKEVENTREG_42_08 PACK_WEEKEVENTREG_FLAG(42, 0x08)
|
||||
#define WEEKEVENTREG_42_10 PACK_WEEKEVENTREG_FLAG(42, 0x10)
|
||||
#define WEEKEVENTREG_42_20 PACK_WEEKEVENTREG_FLAG(42, 0x20)
|
||||
#define WEEKEVENTREG_42_40 PACK_WEEKEVENTREG_FLAG(42, 0x40)
|
||||
#define WEEKEVENTREG_42_80 PACK_WEEKEVENTREG_FLAG(42, 0x80)
|
||||
#define WEEKEVENTREG_43_01 PACK_WEEKEVENTREG_FLAG(43, 0x01)
|
||||
#define WEEKEVENTREG_43_02 PACK_WEEKEVENTREG_FLAG(43, 0x02)
|
||||
#define WEEKEVENTREG_43_04 PACK_WEEKEVENTREG_FLAG(43, 0x04)
|
||||
#define WEEKEVENTREG_43_08 PACK_WEEKEVENTREG_FLAG(43, 0x08)
|
||||
#define WEEKEVENTREG_43_10 PACK_WEEKEVENTREG_FLAG(43, 0x10)
|
||||
#define WEEKEVENTREG_43_20 PACK_WEEKEVENTREG_FLAG(43, 0x20)
|
||||
#define WEEKEVENTREG_43_40 PACK_WEEKEVENTREG_FLAG(43, 0x40)
|
||||
#define WEEKEVENTREG_43_80 PACK_WEEKEVENTREG_FLAG(43, 0x80)
|
||||
#define WEEKEVENTREG_44_01 PACK_WEEKEVENTREG_FLAG(44, 0x01)
|
||||
#define WEEKEVENTREG_44_02 PACK_WEEKEVENTREG_FLAG(44, 0x02)
|
||||
#define WEEKEVENTREG_44_04 PACK_WEEKEVENTREG_FLAG(44, 0x04)
|
||||
#define WEEKEVENTREG_44_08 PACK_WEEKEVENTREG_FLAG(44, 0x08)
|
||||
#define WEEKEVENTREG_44_10 PACK_WEEKEVENTREG_FLAG(44, 0x10)
|
||||
#define WEEKEVENTREG_44_20 PACK_WEEKEVENTREG_FLAG(44, 0x20)
|
||||
#define WEEKEVENTREG_44_40 PACK_WEEKEVENTREG_FLAG(44, 0x40)
|
||||
#define WEEKEVENTREG_44_80 PACK_WEEKEVENTREG_FLAG(44, 0x80)
|
||||
#define WEEKEVENTREG_45_01 PACK_WEEKEVENTREG_FLAG(45, 0x01)
|
||||
#define WEEKEVENTREG_45_02 PACK_WEEKEVENTREG_FLAG(45, 0x02)
|
||||
#define WEEKEVENTREG_45_04 PACK_WEEKEVENTREG_FLAG(45, 0x04)
|
||||
#define WEEKEVENTREG_45_08 PACK_WEEKEVENTREG_FLAG(45, 0x08)
|
||||
#define WEEKEVENTREG_45_10 PACK_WEEKEVENTREG_FLAG(45, 0x10)
|
||||
#define WEEKEVENTREG_45_20 PACK_WEEKEVENTREG_FLAG(45, 0x20)
|
||||
#define WEEKEVENTREG_45_40 PACK_WEEKEVENTREG_FLAG(45, 0x40)
|
||||
#define WEEKEVENTREG_45_80 PACK_WEEKEVENTREG_FLAG(45, 0x80)
|
||||
#define WEEKEVENTREG_46_01 PACK_WEEKEVENTREG_FLAG(46, 0x01)
|
||||
#define WEEKEVENTREG_46_02 PACK_WEEKEVENTREG_FLAG(46, 0x02)
|
||||
#define WEEKEVENTREG_46_04 PACK_WEEKEVENTREG_FLAG(46, 0x04)
|
||||
#define WEEKEVENTREG_46_08 PACK_WEEKEVENTREG_FLAG(46, 0x08)
|
||||
#define WEEKEVENTREG_46_10 PACK_WEEKEVENTREG_FLAG(46, 0x10)
|
||||
#define WEEKEVENTREG_46_20 PACK_WEEKEVENTREG_FLAG(46, 0x20)
|
||||
#define WEEKEVENTREG_46_40 PACK_WEEKEVENTREG_FLAG(46, 0x40)
|
||||
#define WEEKEVENTREG_46_80 PACK_WEEKEVENTREG_FLAG(46, 0x80)
|
||||
#define WEEKEVENTREG_47_01 PACK_WEEKEVENTREG_FLAG(47, 0x01)
|
||||
#define WEEKEVENTREG_47_02 PACK_WEEKEVENTREG_FLAG(47, 0x02)
|
||||
#define WEEKEVENTREG_47_04 PACK_WEEKEVENTREG_FLAG(47, 0x04)
|
||||
#define WEEKEVENTREG_47_08 PACK_WEEKEVENTREG_FLAG(47, 0x08)
|
||||
#define WEEKEVENTREG_47_10 PACK_WEEKEVENTREG_FLAG(47, 0x10)
|
||||
#define WEEKEVENTREG_47_20 PACK_WEEKEVENTREG_FLAG(47, 0x20)
|
||||
#define WEEKEVENTREG_47_40 PACK_WEEKEVENTREG_FLAG(47, 0x40)
|
||||
#define WEEKEVENTREG_47_80 PACK_WEEKEVENTREG_FLAG(47, 0x80)
|
||||
#define WEEKEVENTREG_48_01 PACK_WEEKEVENTREG_FLAG(48, 0x01)
|
||||
#define WEEKEVENTREG_48_02 PACK_WEEKEVENTREG_FLAG(48, 0x02)
|
||||
#define WEEKEVENTREG_48_04 PACK_WEEKEVENTREG_FLAG(48, 0x04)
|
||||
#define WEEKEVENTREG_48_08 PACK_WEEKEVENTREG_FLAG(48, 0x08)
|
||||
#define WEEKEVENTREG_48_10 PACK_WEEKEVENTREG_FLAG(48, 0x10)
|
||||
#define WEEKEVENTREG_48_20 PACK_WEEKEVENTREG_FLAG(48, 0x20)
|
||||
#define WEEKEVENTREG_48_40 PACK_WEEKEVENTREG_FLAG(48, 0x40)
|
||||
#define WEEKEVENTREG_48_80 PACK_WEEKEVENTREG_FLAG(48, 0x80)
|
||||
|
||||
// Used for storing the text ID offsets for the dogs in the Doggy Racetrack (56 entries)
|
||||
// The number of weekEventRegs used needs to be kept in sync with RACEDOG_COUNT in z_en_aob_01.h
|
||||
// PACK_WEEKEVENTREG_FLAG(42, 0x01) to PACK_WEEKEVENTREG_FLAG(48, 0x80)
|
||||
|
||||
#define WEEKEVENTREG_49_01 PACK_WEEKEVENTREG_FLAG(49, 0x01)
|
||||
#define WEEKEVENTREG_49_02 PACK_WEEKEVENTREG_FLAG(49, 0x02)
|
||||
#define WEEKEVENTREG_49_04 PACK_WEEKEVENTREG_FLAG(49, 0x04)
|
||||
|
|
@ -1013,10 +962,7 @@ typedef enum {
|
|||
#define WEEKEVENTREG_52_04 PACK_WEEKEVENTREG_FLAG(52, 0x04)
|
||||
#define WEEKEVENTREG_52_08 PACK_WEEKEVENTREG_FLAG(52, 0x08)
|
||||
#define WEEKEVENTREG_52_10 PACK_WEEKEVENTREG_FLAG(52, 0x10)
|
||||
|
||||
// cleared Stone Tower Temple
|
||||
#define WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE PACK_WEEKEVENTREG_FLAG(52, 0x20)
|
||||
|
||||
#define WEEKEVENTREG_52_40 PACK_WEEKEVENTREG_FLAG(52, 0x40)
|
||||
#define WEEKEVENTREG_52_80 PACK_WEEKEVENTREG_FLAG(52, 0x80)
|
||||
#define WEEKEVENTREG_53_01 PACK_WEEKEVENTREG_FLAG(53, 0x01)
|
||||
|
|
@ -1130,12 +1076,12 @@ typedef enum {
|
|||
#define WEEKEVENTREG_64_10 PACK_WEEKEVENTREG_FLAG(64, 0x10)
|
||||
#define WEEKEVENTREG_64_20 PACK_WEEKEVENTREG_FLAG(64, 0x20)
|
||||
#define WEEKEVENTREG_64_40 PACK_WEEKEVENTREG_FLAG(64, 0x40)
|
||||
#define WEEKEVENTREG_64_80 PACK_WEEKEVENTREG_FLAG(64, 0x80)
|
||||
#define WEEKEVENTREG_65_01 PACK_WEEKEVENTREG_FLAG(65, 0x01)
|
||||
#define WEEKEVENTREG_65_02 PACK_WEEKEVENTREG_FLAG(65, 0x02)
|
||||
#define WEEKEVENTREG_65_04 PACK_WEEKEVENTREG_FLAG(65, 0x04)
|
||||
#define WEEKEVENTREG_65_08 PACK_WEEKEVENTREG_FLAG(65, 0x08)
|
||||
#define WEEKEVENTREG_65_10 PACK_WEEKEVENTREG_FLAG(65, 0x10)
|
||||
#define WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_DAY_1 PACK_WEEKEVENTREG_FLAG(64, 0x80)
|
||||
#define WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_NIGHT_1 PACK_WEEKEVENTREG_FLAG(65, 0x01)
|
||||
#define WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_DAY_2 PACK_WEEKEVENTREG_FLAG(65, 0x02)
|
||||
#define WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_NIGHT_2 PACK_WEEKEVENTREG_FLAG(65, 0x04)
|
||||
#define WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_DAY_3 PACK_WEEKEVENTREG_FLAG(65, 0x08)
|
||||
#define WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_NIGHT_3 PACK_WEEKEVENTREG_FLAG(65, 0x10)
|
||||
#define WEEKEVENTREG_65_20 PACK_WEEKEVENTREG_FLAG(65, 0x20)
|
||||
#define WEEKEVENTREG_65_40 PACK_WEEKEVENTREG_FLAG(65, 0x40)
|
||||
#define WEEKEVENTREG_65_80 PACK_WEEKEVENTREG_FLAG(65, 0x80)
|
||||
|
|
@ -1385,10 +1331,8 @@ typedef enum {
|
|||
#define WEEKEVENTREG_91_40 PACK_WEEKEVENTREG_FLAG(91, 0x40)
|
||||
#define WEEKEVENTREG_91_80 PACK_WEEKEVENTREG_FLAG(91, 0x80)
|
||||
|
||||
// RACE_FLAGS
|
||||
//#define WEEKEVENTREG_92_01 PACK_WEEKEVENTREG_FLAG(92, 0x01)
|
||||
//#define WEEKEVENTREG_92_02 PACK_WEEKEVENTREG_FLAG(92, 0x02)
|
||||
//#define WEEKEVENTREG_92_04 PACK_WEEKEVENTREG_FLAG(92, 0x04)
|
||||
// HORSE_RACE_STATE (3 entries)
|
||||
// WEEKEVENTREG_92_01 to WEEKEVENTREG_92_04
|
||||
|
||||
#define WEEKEVENTREG_92_08 PACK_WEEKEVENTREG_FLAG(92, 0x08)
|
||||
#define WEEKEVENTREG_92_10 PACK_WEEKEVENTREG_FLAG(92, 0x10)
|
||||
|
|
@ -1460,34 +1404,52 @@ typedef enum {
|
|||
#define SET_WEEKEVENTREG(flag) (WEEKEVENTREG((flag) >> 8) = GET_WEEKEVENTREG((flag) >> 8) | ((flag) & 0xFF))
|
||||
#define CLEAR_WEEKEVENTREG(flag) (WEEKEVENTREG((flag) >> 8) = GET_WEEKEVENTREG((flag) >> 8) & (u8)~((flag) & 0xFF))
|
||||
|
||||
#define WEEKEVENTREG_RACE_FLAG_END 0
|
||||
#define WEEKEVENTREG_RACE_FLAG_START 1
|
||||
#define WEEKEVENTREG_RACE_FLAG_2 2
|
||||
#define WEEKEVENTREG_RACE_FLAG_3 3
|
||||
#define WEEKEVENTREG_RACE_FLAG_4 4
|
||||
#define WEEKEVENTREG_RACE_FLAGS 7
|
||||
typedef enum {
|
||||
/* 0 */ WEEKEVENTREG_HORSE_RACE_STATE_END,
|
||||
/* 1 */ WEEKEVENTREG_HORSE_RACE_STATE_START,
|
||||
/* 2 */ WEEKEVENTREG_HORSE_RACE_STATE_2,
|
||||
/* 3 */ WEEKEVENTREG_HORSE_RACE_STATE_3,
|
||||
/* 4 */ WEEKEVENTREG_HORSE_RACE_STATE_4,
|
||||
/* 7 */ WEEKEVENTREG_HORSE_RACE_STATE_MAX = 7
|
||||
} WeekEventRegHorseRaceState;
|
||||
|
||||
#define GET_WEEKEVENTREG_RACE_FLAGS (WEEKEVENTREG(92) & WEEKEVENTREG_RACE_FLAGS)
|
||||
#define GET_WEEKEVENTREG_HORSE_RACE_STATE (WEEKEVENTREG(92) & WEEKEVENTREG_HORSE_RACE_STATE_MAX)
|
||||
|
||||
#define SET_WEEKEVENTREG_RACE_FLAGS(flag) \
|
||||
{ \
|
||||
WEEKEVENTREG(92) &= (u8)~WEEKEVENTREG_RACE_FLAGS; \
|
||||
WEEKEVENTREG(92) = WEEKEVENTREG(92) | (u8)((WEEKEVENTREG(92) & ~WEEKEVENTREG_RACE_FLAGS) | (flag)); \
|
||||
} \
|
||||
#define SET_WEEKEVENTREG_HORSE_RACE_STATE(state) \
|
||||
{ \
|
||||
WEEKEVENTREG(92) &= (u8)~WEEKEVENTREG_HORSE_RACE_STATE_MAX; \
|
||||
WEEKEVENTREG(92) = WEEKEVENTREG(92) | (u8)((WEEKEVENTREG(92) & ~WEEKEVENTREG_HORSE_RACE_STATE_MAX) | (state)); \
|
||||
} \
|
||||
(void)0
|
||||
|
||||
#define GET_WEEKEVENTREG_DOG_RACE_TEXT(index, baseTextId) \
|
||||
(index % 2) ? (baseTextId + (((WEEKEVENTREG(42 + (index / 2))) & 0xF0) >> 4)) \
|
||||
: (baseTextId + ((WEEKEVENTREG(42 + (index / 2))) & 0x0F));
|
||||
|
||||
#define SET_WEEKEVENTREG_DOG_RACE_TEXT_OFFSETS(index, packedOffsets) \
|
||||
{ \
|
||||
WEEKEVENTREG(42 + index) = ((void)0, WEEKEVENTREG(42 + index)) | packedOffsets; \
|
||||
}
|
||||
|
||||
#define CLEAR_WEEKEVENTREG_DOG_RACE_TEXT_OFFSETS(index) \
|
||||
{ \
|
||||
WEEKEVENTREG(42 + index) = 0; \
|
||||
}
|
||||
|
||||
/**
|
||||
* gSaveContext.eventInf
|
||||
*/
|
||||
|
||||
#define EVENTINF_00 0x00
|
||||
#define EVENTINF_01 0x01
|
||||
#define EVENTINF_02 0x02
|
||||
#define EVENTINF_03 0x03
|
||||
#define EVENTINF_04 0x04
|
||||
#define EVENTINF_05 0x05
|
||||
#define EVENTINF_06 0x06
|
||||
#define EVENTINF_07 0x07
|
||||
// gSaveContext.eventInf[0] is used to dog race information
|
||||
// #define EVENTINF_00 0x00
|
||||
// #define EVENTINF_01 0x01
|
||||
// #define EVENTINF_02 0x02
|
||||
// #define EVENTINF_03 0x03
|
||||
// #define EVENTINF_04 0x04
|
||||
// #define EVENTINF_05 0x05
|
||||
// #define EVENTINF_06 0x06
|
||||
// #define EVENTINF_07 0x07
|
||||
|
||||
#define EVENTINF_10 0x10
|
||||
#define EVENTINF_11 0x11
|
||||
#define EVENTINF_12 0x12
|
||||
|
|
@ -1561,6 +1523,25 @@ typedef enum {
|
|||
#define CLEAR_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] &= (u8)~(1 << ((flag) & 0xF)))
|
||||
#define CLEAR_EVENTINF_ALT(flag) (gSaveContext.eventInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF)))
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ EVENTINF_DOG_RACE_STATE_NOT_STARTED,
|
||||
/* 2 */ EVENTINF_DOG_RACE_STATE_STARTED = 2,
|
||||
/* 3 */ EVENTINF_DOG_RACE_STATE_ENDED,
|
||||
/* 7 */ EVENTINF_DOG_RACE_STATE_MAX = 7
|
||||
} EventInfDogRaceState;
|
||||
|
||||
#define GET_EVENTINF_DOG_RACE_STATE (gSaveContext.eventInf[0] & EVENTINF_DOG_RACE_STATE_MAX)
|
||||
#define SET_EVENTINF_DOG_RACE_STATE(state) \
|
||||
(gSaveContext.eventInf[0] = ((gSaveContext.eventInf[0] & (u8)~EVENTINF_DOG_RACE_STATE_MAX) | (state)))
|
||||
|
||||
#define GET_EVENTINF_DOG_RACE_SELECTED_DOG_INDEX ((gSaveContext.eventInf[0] & (u8)~EVENTINF_DOG_RACE_STATE_MAX) >> 3)
|
||||
#define SET_EVENTINF_DOG_RACE_SELECTED_DOG_INDEX(selectedDogIndex) \
|
||||
(gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & EVENTINF_DOG_RACE_STATE_MAX) | (selectedDogIndex << 3))
|
||||
|
||||
// This is exactly the same as the selected dog index; they never need both of them at the same time.
|
||||
#define GET_EVENTINF_DOG_RACE_RACE_STANDING ((gSaveContext.eventInf[0] & (u8)~EVENTINF_DOG_RACE_STATE_MAX) >> 3)
|
||||
#define SET_EVENTINF_DOG_RACE_RACE_STANDING(raceStanding) \
|
||||
(gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & EVENTINF_DOG_RACE_STATE_MAX) | (raceStanding << 3))
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ DUNGEON_INDEX_WOODFALL_TEMPLE,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "stack.h"
|
||||
#include "stackcheck.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "buffers.h"
|
||||
#include "z64debug_display.h"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -8,38 +8,56 @@ struct EnAob01;
|
|||
|
||||
typedef void (*EnAob01ActionFunc)(struct EnAob01*, PlayState*);
|
||||
|
||||
#define ENAOB01_GET_7E00_1(thisx) ((thisx)->params & 0x7E00)
|
||||
#define ENAOB01_GET_7E00_2(thisx) (((thisx)->params & 0x7E00) >> 9)
|
||||
// This needs to be kept in sync with the number of weekEventRegs used to store the text ID offsets for
|
||||
// the race dogs. In particular, there needs to be one weekEventReg for every two dogs. This needs to be
|
||||
// an even number to ensure that all text ID offsets are created (see EnAob01_InitializeDogTextOffsets).
|
||||
#define RACEDOG_COUNT 14
|
||||
|
||||
#define ENAOB01_GET_STARTING_DOG_PATH_INDEX(thisx) (((thisx)->params & 0x7E00) >> 9)
|
||||
|
||||
//! @bug This should be shifted up by 1 to match how EnRacedog expects the path index to be supplied.
|
||||
//! It doesn't cause any problems in the final game because every time EnAob01 is spawned, all the
|
||||
//! bits here are zero.
|
||||
#define ENAOB01_GET_RACEDOG_PATH_INDEX(thisx) ((thisx)->params & 0x7E00)
|
||||
|
||||
#define ENAOB01_FLAG_PLAYER_CONFIRMED_CHOICE (1 << 1)
|
||||
#define ENAOB01_FLAG_PLAYER_TOLD_TO_PICK_A_DOG (1 << 2)
|
||||
#define ENAOB01_FLAG_TALKING_TO_PLAYER_HOLDING_DOG (1 << 3)
|
||||
#define ENAOB01_FLAG_CONVERSATION_OVER (1 << 4)
|
||||
#define ENAOB01_FLAG_STARTED_RACE (1 << 5)
|
||||
#define ENAOB01_FLAG_LAUGH (1 << 6)
|
||||
#define ENAOB01_FLAG_SURPRISE (1 << 7)
|
||||
#define ENAOB01_FLAG_PLAYER_CAN_TALK (1 << 8)
|
||||
|
||||
typedef struct EnAob01 {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ EnAob01ActionFunc actionFunc;
|
||||
/* 0x148 */ SkelAnime skelAnime;
|
||||
/* 0x18C */ ColliderCylinder collider;
|
||||
/* 0x1D8 */ Path* unk_1D8[14];
|
||||
/* 0x210 */ u16 unk_210;
|
||||
/* 0x1D8 */ Path* dogPaths[RACEDOG_COUNT];
|
||||
/* 0x210 */ u16 textId;
|
||||
/* 0x212 */ Vec3s jointTable[MAMAMU_YAN_LIMB_MAX];
|
||||
/* 0x272 */ Vec3s morphTable[MAMAMU_YAN_LIMB_MAX];
|
||||
/* 0x2D2 */ u16 unk_2D2;
|
||||
/* 0x2D2 */ u16 stateFlags;
|
||||
/* 0x2D4 */ Vec3s trackTarget;
|
||||
/* 0x2DA */ Vec3s headRot;
|
||||
/* 0x2E0 */ Vec3s torsoRot;
|
||||
/* 0x2E6 */ Vec3s unk_2E6;
|
||||
/* 0x2EC */ Vec3s unk_2EC;
|
||||
/* 0x2F2 */ Vec3s unk_2F2;
|
||||
/* 0x2F8 */ s16 unk_2F8[MAMAMU_YAN_LIMB_MAX];
|
||||
/* 0x318 */ s16 unk_318[MAMAMU_YAN_LIMB_MAX];
|
||||
/* 0x2E6 */ Vec3s prevTrackTarget;
|
||||
/* 0x2EC */ Vec3s prevHeadRot;
|
||||
/* 0x2F2 */ Vec3s prevTorsoRot;
|
||||
/* 0x2F8 */ s16 limbRotTableY[MAMAMU_YAN_LIMB_MAX];
|
||||
/* 0x318 */ s16 limbRotTableZ[MAMAMU_YAN_LIMB_MAX];
|
||||
/* 0x338 */ UNK_TYPE1 unk338[0xB6];
|
||||
/* 0x3EE */ s16 eyeIndex;
|
||||
/* 0x3F0 */ s16 blinkTimer;
|
||||
/* 0x3F4 */ Actor* unk_3F4;
|
||||
/* 0x3F8 */ Actor* unk_3F8[14];
|
||||
/* 0x3F4 */ Actor* dogToFollow;
|
||||
/* 0x3F8 */ Actor* dogs[RACEDOG_COUNT];
|
||||
/* 0x430 */ s16 csId;
|
||||
/* 0x432 */ s16 unk_432;
|
||||
/* 0x434 */ s32 unk_434;
|
||||
/* 0x432 */ s16 selectedDogIndex;
|
||||
/* 0x434 */ s32 rupeesBet; // Also used for determining how many rupees to give to the player if they place 1st-5th in the race.
|
||||
/* 0x438 */ UNK_TYPE1 unk438[4];
|
||||
/* 0x43C */ s32 unk_43C;
|
||||
/* 0x440 */ s16 unk_440;
|
||||
/* 0x43C */ s32 animIndex;
|
||||
/* 0x440 */ s16 forceRaceEndTimer;
|
||||
} EnAob01; // size = 0x444
|
||||
|
||||
#endif // Z_EN_AOB_01_H
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
* Description: Bad Bat
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_en_bat.h"
|
||||
#include "objects/object_bat/object_bat.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -5,13 +5,12 @@
|
|||
*/
|
||||
|
||||
#include "z_en_dg.h"
|
||||
#include "overlays/actors/ovl_En_Aob_01/z_en_aob_01.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_800000)
|
||||
|
||||
#define THIS ((EnDg*)thisx)
|
||||
|
||||
//! TODO: this file require macros for its uses of weekEventReg
|
||||
|
||||
void EnDg_Init(Actor* thisx, PlayState* play);
|
||||
void EnDg_Destroy(Actor* thisx, PlayState* play);
|
||||
void EnDg_Update(Actor* thisx, PlayState* play);
|
||||
|
|
@ -417,20 +416,13 @@ void EnDg_SetupIdleMove(EnDg* this, PlayState* play) {
|
|||
|
||||
/**
|
||||
* Updates the text ID in sRacetrackDogInfo based on what was set in the weekEventRegs by
|
||||
* En_Aob_01. This makes it sp the proper message can be displayed when the player picks up
|
||||
* En_Aob_01. This makes it so the proper message can be displayed when the player picks up
|
||||
* the dog with the Mask of Truth equipped.
|
||||
*/
|
||||
void EnDg_UpdateTextId(EnDg* this) {
|
||||
if (this->index < 14) {
|
||||
// Assuming that the weekEventRegs haven't been tampered with, then this will produce a text ID in
|
||||
// the range of 0x3538 to 0x3545.
|
||||
if (this->index % 2) {
|
||||
sRacetrackDogInfo[this->index].textId =
|
||||
0x3538 + ((gSaveContext.save.saveInfo.weekEventReg[42 + (this->index / 2)] & 0xF0) >> 4);
|
||||
} else {
|
||||
sRacetrackDogInfo[this->index].textId =
|
||||
0x3538 + (gSaveContext.save.saveInfo.weekEventReg[42 + (this->index / 2)] & 0x0F);
|
||||
}
|
||||
if (this->index < RACEDOG_COUNT) {
|
||||
// This will produce a text ID in the range of 0x3538 to 0x3545.
|
||||
sRacetrackDogInfo[this->index].textId = GET_WEEKEVENTREG_DOG_RACE_TEXT(this->index, 0x3538);
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -792,7 +792,8 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
|
|||
this->stateFlags = 0;
|
||||
}
|
||||
|
||||
if (((play->sceneId == SCENE_KOEPONARACE) && (GET_WEEKEVENTREG_RACE_FLAGS == WEEKEVENTREG_RACE_FLAG_START)) ||
|
||||
if (((play->sceneId == SCENE_KOEPONARACE) &&
|
||||
(GET_WEEKEVENTREG_HORSE_RACE_STATE == WEEKEVENTREG_HORSE_RACE_STATE_START)) ||
|
||||
((gSaveContext.save.entrance == ENTRANCE(ROMANI_RANCH, 0)) && (Cutscene_GetSceneLayer(play) != 0))) {
|
||||
this->stateFlags |= ENHORSE_FLAG_25;
|
||||
}
|
||||
|
|
@ -2471,7 +2472,7 @@ void func_808819D8(EnHorse* this, PlayState* play) {
|
|||
func_8088168C(this);
|
||||
}
|
||||
|
||||
if (GET_WEEKEVENTREG_RACE_FLAGS == WEEKEVENTREG_RACE_FLAG_3) {
|
||||
if (GET_WEEKEVENTREG_HORSE_RACE_STATE == WEEKEVENTREG_HORSE_RACE_STATE_3) {
|
||||
this->rider->unk488 = 7;
|
||||
} else {
|
||||
EnHorse_SetIngoAnimation(this->animIndex, this->skin.skelAnime.curFrame, this->unk_394 & 1,
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ s32 func_808F8AA0(EnHorseGameCheck* this, PlayState* play) {
|
|||
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
|
||||
if (GET_WEEKEVENTREG_RACE_FLAGS != WEEKEVENTREG_RACE_FLAG_START) {
|
||||
if (GET_WEEKEVENTREG_HORSE_RACE_STATE != WEEKEVENTREG_HORSE_RACE_STATE_START) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ s32 func_808F8CCC(EnHorseGameCheck* this, PlayState* play2) {
|
|||
this->unk_168 = 0;
|
||||
this->unk_174 = 0;
|
||||
|
||||
if (GET_WEEKEVENTREG_RACE_FLAGS != WEEKEVENTREG_RACE_FLAG_START) {
|
||||
if (GET_WEEKEVENTREG_HORSE_RACE_STATE != WEEKEVENTREG_HORSE_RACE_STATE_START) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -156,14 +156,14 @@ s32 func_808F8EB0(EnHorseGameCheck* this, PlayState* play) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (GET_WEEKEVENTREG_RACE_FLAGS == WEEKEVENTREG_RACE_FLAG_3) {
|
||||
if (GET_WEEKEVENTREG_HORSE_RACE_STATE == WEEKEVENTREG_HORSE_RACE_STATE_3) {
|
||||
play->transitionType = TRANS_TYPE_64;
|
||||
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
|
||||
} else if (GET_WEEKEVENTREG_RACE_FLAGS == WEEKEVENTREG_RACE_FLAG_2) {
|
||||
} else if (GET_WEEKEVENTREG_HORSE_RACE_STATE == WEEKEVENTREG_HORSE_RACE_STATE_2) {
|
||||
play->transitionType = TRANS_TYPE_80;
|
||||
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
|
||||
} else if (GET_WEEKEVENTREG_RACE_FLAGS == WEEKEVENTREG_RACE_FLAG_4) {
|
||||
SET_WEEKEVENTREG_RACE_FLAGS(WEEKEVENTREG_RACE_FLAG_3);
|
||||
} else if (GET_WEEKEVENTREG_HORSE_RACE_STATE == WEEKEVENTREG_HORSE_RACE_STATE_4) {
|
||||
SET_WEEKEVENTREG_HORSE_RACE_STATE(WEEKEVENTREG_HORSE_RACE_STATE_3);
|
||||
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
||||
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
|
||||
}
|
||||
|
|
@ -252,7 +252,7 @@ s32 func_808F8FAC(EnHorseGameCheck* this, PlayState* play) {
|
|||
play_sound(NA_SE_SY_START_SHOT);
|
||||
this->unk_164 |= 0x40000;
|
||||
gSaveContext.timerStates[TIMER_ID_MINIGAME_2] = TIMER_STATE_6;
|
||||
SET_WEEKEVENTREG_RACE_FLAGS(WEEKEVENTREG_RACE_FLAG_4);
|
||||
SET_WEEKEVENTREG_HORSE_RACE_STATE(WEEKEVENTREG_HORSE_RACE_STATE_4);
|
||||
this->unk_174 = 60;
|
||||
}
|
||||
|
||||
|
|
@ -285,7 +285,7 @@ s32 func_808F8FAC(EnHorseGameCheck* this, PlayState* play) {
|
|||
play_sound(NA_SE_SY_START_SHOT);
|
||||
this->unk_164 |= 0x40000;
|
||||
gSaveContext.timerStates[TIMER_ID_MINIGAME_2] = TIMER_STATE_6;
|
||||
SET_WEEKEVENTREG_RACE_FLAGS(WEEKEVENTREG_RACE_FLAG_3);
|
||||
SET_WEEKEVENTREG_HORSE_RACE_STATE(WEEKEVENTREG_HORSE_RACE_STATE_3);
|
||||
this->unk_174 = 60;
|
||||
}
|
||||
|
||||
|
|
@ -318,7 +318,7 @@ s32 func_808F8FAC(EnHorseGameCheck* this, PlayState* play) {
|
|||
play_sound(NA_SE_SY_START_SHOT);
|
||||
this->unk_164 |= 0x02000000;
|
||||
gSaveContext.timerStates[TIMER_ID_MINIGAME_2] = TIMER_STATE_6;
|
||||
SET_WEEKEVENTREG_RACE_FLAGS(WEEKEVENTREG_RACE_FLAG_3);
|
||||
SET_WEEKEVENTREG_HORSE_RACE_STATE(WEEKEVENTREG_HORSE_RACE_STATE_3);
|
||||
this->unk_174 = 60;
|
||||
}
|
||||
|
||||
|
|
@ -347,7 +347,7 @@ s32 func_808F8FAC(EnHorseGameCheck* this, PlayState* play) {
|
|||
play_sound(NA_SE_SY_START_SHOT);
|
||||
this->unk_164 |= 0x800;
|
||||
gSaveContext.timerStates[TIMER_ID_MINIGAME_2] = TIMER_STATE_6;
|
||||
SET_WEEKEVENTREG_RACE_FLAGS(WEEKEVENTREG_RACE_FLAG_2);
|
||||
SET_WEEKEVENTREG_HORSE_RACE_STATE(WEEKEVENTREG_HORSE_RACE_STATE_2);
|
||||
this->unk_174 = 60;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ void func_808F38F8(EnIn* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_808F395C(EnIn* this, PlayState* play) {
|
||||
if (this->unk4B0 == WEEKEVENTREG_RACE_FLAG_END) {
|
||||
if (this->unk4B0 == WEEKEVENTREG_HORSE_RACE_STATE_END) {
|
||||
this->actionFunc = func_808F5A94;
|
||||
}
|
||||
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
|
||||
|
|
@ -352,30 +352,30 @@ void func_808F39DC(EnIn* this, PlayState* play) {
|
|||
u16 textId = 0;
|
||||
|
||||
if (gSaveContext.save.day != 3) {
|
||||
switch (GET_WEEKEVENTREG_RACE_FLAGS) {
|
||||
case WEEKEVENTREG_RACE_FLAG_2:
|
||||
switch (GET_WEEKEVENTREG_HORSE_RACE_STATE) {
|
||||
case WEEKEVENTREG_HORSE_RACE_STATE_2:
|
||||
textId = 0x347A;
|
||||
break;
|
||||
case WEEKEVENTREG_RACE_FLAG_3:
|
||||
case WEEKEVENTREG_HORSE_RACE_STATE_3:
|
||||
textId = 0x3476;
|
||||
break;
|
||||
}
|
||||
SET_WEEKEVENTREG_RACE_FLAGS(WEEKEVENTREG_RACE_FLAG_END);
|
||||
SET_WEEKEVENTREG_HORSE_RACE_STATE(WEEKEVENTREG_HORSE_RACE_STATE_END);
|
||||
} else {
|
||||
switch (GET_WEEKEVENTREG_RACE_FLAGS) {
|
||||
case WEEKEVENTREG_RACE_FLAG_2:
|
||||
switch (GET_WEEKEVENTREG_HORSE_RACE_STATE) {
|
||||
case WEEKEVENTREG_HORSE_RACE_STATE_2:
|
||||
textId = 0x349D;
|
||||
break;
|
||||
case WEEKEVENTREG_RACE_FLAG_3:
|
||||
case WEEKEVENTREG_HORSE_RACE_STATE_3:
|
||||
textId = 0x3499;
|
||||
break;
|
||||
}
|
||||
SET_WEEKEVENTREG_RACE_FLAGS(WEEKEVENTREG_RACE_FLAG_END);
|
||||
SET_WEEKEVENTREG_HORSE_RACE_STATE(WEEKEVENTREG_HORSE_RACE_STATE_END);
|
||||
}
|
||||
this->actor.flags |= ACTOR_FLAG_10000;
|
||||
this->actor.textId = textId;
|
||||
this->actionFunc = func_808F395C;
|
||||
if (this->unk4B0 == WEEKEVENTREG_RACE_FLAG_2) {
|
||||
if (this->unk4B0 == WEEKEVENTREG_HORSE_RACE_STATE_2) {
|
||||
Actor_PlaySfx(&this->actor, NA_SE_VO_IN_LOST);
|
||||
} else {
|
||||
Actor_PlaySfx(&this->actor, NA_SE_VO_IN_JOY0);
|
||||
|
|
@ -635,7 +635,7 @@ s32 func_808F4270(PlayState* play, EnIn* this, s32 arg2, MessageContext* msgCtx,
|
|||
s32 func_808F43E0(EnIn* this) {
|
||||
this->unk48C = 0;
|
||||
this->actor.textId = 0;
|
||||
SET_WEEKEVENTREG_RACE_FLAGS(WEEKEVENTREG_RACE_FLAG_END);
|
||||
SET_WEEKEVENTREG_HORSE_RACE_STATE(WEEKEVENTREG_HORSE_RACE_STATE_END);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -817,7 +817,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) {
|
|||
func_80151BB4(play, 0x11);
|
||||
break;
|
||||
case 0x3475:
|
||||
SET_WEEKEVENTREG_RACE_FLAGS(WEEKEVENTREG_RACE_FLAG_START);
|
||||
SET_WEEKEVENTREG_HORSE_RACE_STATE(WEEKEVENTREG_HORSE_RACE_STATE_START);
|
||||
func_800FD750(NA_BGM_HORSE);
|
||||
play->nextEntrance = ENTRANCE(GORMAN_TRACK, 5);
|
||||
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
|
||||
|
|
@ -1064,7 +1064,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) {
|
|||
ret = false;
|
||||
break;
|
||||
case 0x3475:
|
||||
SET_WEEKEVENTREG_RACE_FLAGS(WEEKEVENTREG_RACE_FLAG_START);
|
||||
SET_WEEKEVENTREG_HORSE_RACE_STATE(WEEKEVENTREG_HORSE_RACE_STATE_START);
|
||||
func_800FD750(NA_BGM_HORSE);
|
||||
play->nextEntrance = ENTRANCE(GORMAN_TRACK, 5);
|
||||
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
|
||||
|
|
@ -1322,7 +1322,7 @@ void func_808F5B58(EnIn* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_808F5C98(EnIn* this, PlayState* play) {
|
||||
if (this->unk4B0 == WEEKEVENTREG_RACE_FLAG_END) {
|
||||
if (this->unk4B0 == WEEKEVENTREG_HORSE_RACE_STATE_END) {
|
||||
this->actionFunc = func_808F5B58;
|
||||
}
|
||||
if ((Player_GetMask(play) == PLAYER_MASK_CIRCUS_LEADER && CHECK_WEEKEVENTREG(WEEKEVENTREG_63_40)) ||
|
||||
|
|
@ -1334,7 +1334,7 @@ void func_808F5C98(EnIn* this, PlayState* play) {
|
|||
}
|
||||
}
|
||||
if (this->unk4A8 == 2) {
|
||||
if (this->unk4B0 == WEEKEVENTREG_RACE_FLAG_2) {
|
||||
if (this->unk4B0 == WEEKEVENTREG_HORSE_RACE_STATE_2) {
|
||||
Actor_PlaySfx(&this->actor, NA_SE_VO_IN_LOST);
|
||||
} else {
|
||||
Actor_PlaySfx(&this->actor, NA_SE_VO_IN_JOY0);
|
||||
|
|
@ -1366,7 +1366,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) {
|
|||
this->unk48C = 0;
|
||||
this->unk4AC = 0;
|
||||
type = ENIN_GET_TYPE(thisx);
|
||||
this->unk4B0 = GET_WEEKEVENTREG_RACE_FLAGS;
|
||||
this->unk4B0 = GET_WEEKEVENTREG_HORSE_RACE_STATE;
|
||||
if (type == ENIN_HORSE_RIDER_BLUE_SHIRT || type == ENIN_BLUE_SHIRT) {
|
||||
this->unk4AC |= 8;
|
||||
}
|
||||
|
|
@ -1387,8 +1387,8 @@ void EnIn_Init(Actor* thisx, PlayState* play) {
|
|||
this->path = SubS_GetPathByIndex(play, ENIN_GET_PATH(&this->actor), 0x3F);
|
||||
this->unk23D = 0;
|
||||
if (type == ENIN_YELLOW_SHIRT || type == ENIN_BLUE_SHIRT) {
|
||||
if ((GET_WEEKEVENTREG_RACE_FLAGS == WEEKEVENTREG_RACE_FLAG_2) ||
|
||||
(GET_WEEKEVENTREG_RACE_FLAGS == WEEKEVENTREG_RACE_FLAG_3)) {
|
||||
if ((GET_WEEKEVENTREG_HORSE_RACE_STATE == WEEKEVENTREG_HORSE_RACE_STATE_2) ||
|
||||
(GET_WEEKEVENTREG_HORSE_RACE_STATE == WEEKEVENTREG_HORSE_RACE_STATE_3)) {
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_56_08);
|
||||
this->unk4A8 = 0;
|
||||
this->unk4AC |= 2;
|
||||
|
|
@ -1396,12 +1396,12 @@ void EnIn_Init(Actor* thisx, PlayState* play) {
|
|||
this->unk23C = 0;
|
||||
D_801BDAA0 = 0;
|
||||
|
||||
if (GET_WEEKEVENTREG_RACE_FLAGS == WEEKEVENTREG_RACE_FLAG_2) {
|
||||
if (GET_WEEKEVENTREG_HORSE_RACE_STATE == WEEKEVENTREG_HORSE_RACE_STATE_2) {
|
||||
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_6);
|
||||
} else {
|
||||
EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_4);
|
||||
}
|
||||
if (GET_WEEKEVENTREG_RACE_FLAGS == WEEKEVENTREG_RACE_FLAG_2) {
|
||||
if (GET_WEEKEVENTREG_HORSE_RACE_STATE == WEEKEVENTREG_HORSE_RACE_STATE_2) {
|
||||
this->skelAnime.curFrame = ((Rand_ZeroOne() * 0.6f) + 0.2f) * this->skelAnime.endFrame;
|
||||
}
|
||||
if (this->unk4AC & 8) {
|
||||
|
|
@ -1410,7 +1410,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) {
|
|||
this->actionFunc = func_808F5C98;
|
||||
}
|
||||
} else {
|
||||
if (GET_WEEKEVENTREG_RACE_FLAGS != WEEKEVENTREG_RACE_FLAG_START) {
|
||||
if (GET_WEEKEVENTREG_HORSE_RACE_STATE != WEEKEVENTREG_HORSE_RACE_STATE_START) {
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_56_08);
|
||||
this->unk23C = 0;
|
||||
this->unk4AC |= 2;
|
||||
|
|
|
|||
|
|
@ -9,14 +9,13 @@
|
|||
*/
|
||||
|
||||
#include "z_en_racedog.h"
|
||||
#include "overlays/actors/ovl_En_Aob_01/z_en_aob_01.h"
|
||||
#include "overlays/actors/ovl_En_Dg/z_en_dg.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_80000000)
|
||||
|
||||
#define THIS ((EnRacedog*)thisx)
|
||||
|
||||
//! TODO: this file require macros for its uses of weekEventReg
|
||||
|
||||
void EnRacedog_Init(Actor* thisx, PlayState* play);
|
||||
void EnRacedog_Destroy(Actor* thisx, PlayState* play);
|
||||
void EnRacedog_Update(Actor* thisx, PlayState* play);
|
||||
|
|
@ -317,7 +316,7 @@ void EnRacedog_Init(Actor* thisx, PlayState* play) {
|
|||
this->path = SubS_GetPathByIndex(play, ENRACEDOG_GET_PATH(&this->actor), 0x3F);
|
||||
Actor_SetScale(&this->actor, 0.0075f);
|
||||
this->actor.gravity = -3.0f;
|
||||
if (ENRACEDOG_GET_INDEX(&this->actor) < 14) {
|
||||
if (ENRACEDOG_GET_INDEX(&this->actor) < RACEDOG_COUNT) {
|
||||
this->index = ENRACEDOG_GET_INDEX(&this->actor);
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
|
|
@ -353,7 +352,7 @@ void EnRacedog_Init(Actor* thisx, PlayState* play) {
|
|||
this->actor.flags |= ACTOR_FLAG_10;
|
||||
this->actor.flags |= ACTOR_FLAG_20;
|
||||
|
||||
sSelectedDogInfo = sDogInfo[(s16)((gSaveContext.eventInf[0] & 0xF8) >> 3)];
|
||||
sSelectedDogInfo = sDogInfo[(s16)GET_EVENTINF_DOG_RACE_SELECTED_DOG_INDEX];
|
||||
this->selectedDogIndex = sSelectedDogInfo.index;
|
||||
|
||||
EnRacedog_ChangeAnim(&this->skelAnime, sAnimationInfo, RACEDOG_ANIM_IDLE);
|
||||
|
|
@ -439,15 +438,8 @@ void EnRacedog_Race(EnRacedog* this, PlayState* play) {
|
|||
* or an intentional choice to introduce a bit of extra variance to the race.
|
||||
*/
|
||||
void EnRacedog_UpdateTextId(EnRacedog* this) {
|
||||
// Assuming that the weekEventRegs haven't been tampered with, then this will produce a text ID in the
|
||||
// range of 0x3539 to 0x3546.
|
||||
if (this->index % 2) {
|
||||
sDogInfo[this->index].textId =
|
||||
(((gSaveContext.save.saveInfo.weekEventReg[42 + (this->index / 2)]) & 0xF0) >> 4) + 0x3539;
|
||||
} else {
|
||||
sDogInfo[this->index].textId =
|
||||
((gSaveContext.save.saveInfo.weekEventReg[42 + (this->index / 2)]) & 0x0F) + 0x3539;
|
||||
}
|
||||
// This will produce a text ID in the range of 0x3539 to 0x3546.
|
||||
sDogInfo[this->index].textId = GET_WEEKEVENTREG_DOG_RACE_TEXT(this->index, 0x3539);
|
||||
|
||||
// As a sanity check, this makes sure the text ID is something in the expected range of 0x3539 to 0x3546.
|
||||
if ((sDogInfo[this->index].textId > 0x3546) || (sDogInfo[this->index].textId < 0x3539)) {
|
||||
|
|
@ -593,7 +585,7 @@ void EnRacedog_CheckForFinish(EnRacedog* this) {
|
|||
|
||||
this->raceStatus = RACEDOG_RACE_STATUS_FINISHED;
|
||||
if (this->index == this->selectedDogIndex) {
|
||||
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & 7) | (sNumberOfDogsFinished * 8);
|
||||
SET_EVENTINF_DOG_RACE_RACE_STANDING(sNumberOfDogsFinished);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#define ENRACEDOG_GET_INDEX(thisx) (((thisx)->params & 0x3E0) >> 5)
|
||||
#define ENRACEDOG_GET_PATH(thisx) (((thisx)->params & 0xFC00) >> 10)
|
||||
#define ENRACEDOG_PARAMS(index, path) ((index << 5) | (path))
|
||||
|
||||
/**
|
||||
* The main point of this seems to be some very light anti-cheat detection. The dog
|
||||
|
|
|
|||
|
|
@ -708,11 +708,11 @@ void EnSsh_Talk(EnSsh* this, PlayState* play) {
|
|||
void func_809756D0(EnSsh* this, PlayState* play) {
|
||||
u16 nextTextId;
|
||||
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED)) {
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_TALKED_SWAMP_SPIDER_HOUSE_MAN)) {
|
||||
nextTextId = 0x914; // In here, cursed spiders, defeat them to make me normal
|
||||
} else {
|
||||
nextTextId = 0x910; // Help me! I am not a monster, I was cursed this way
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED);
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_TALKED_SWAMP_SPIDER_HOUSE_MAN);
|
||||
}
|
||||
Message_StartTextbox(play, nextTextId, &this->actor);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
this->actor.textId = 0;
|
||||
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH) ||
|
||||
!CHECK_WEEKEVENTREG(WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED)) {
|
||||
!CHECK_WEEKEVENTREG(WEEKEVENTREG_TALKED_SWAMP_SPIDER_HOUSE_MAN)) {
|
||||
this->sthFlags |= STH_FLAG_DRAW_MASK_OF_TRUTH;
|
||||
}
|
||||
break;
|
||||
|
|
@ -479,7 +479,7 @@ void EnSth_GetInitialSwampSpiderHouseText(EnSth* this, PlayState* play) {
|
|||
nextTextId = 0x90F; // (does not exist)
|
||||
EnSth_ChangeAnim(this, STH_ANIM_TALK);
|
||||
} else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH)) {
|
||||
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED)) {
|
||||
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_TALKED_SWAMP_SPIDER_HOUSE_MAN)) {
|
||||
nextTextId = 0x91B; // As soon as I calm down, getting rid of it
|
||||
} else {
|
||||
nextTextId = 0x918; // I've had enough of this, going home
|
||||
|
|
@ -525,7 +525,7 @@ void EnSth_SwampSpiderHouseGiveMask(EnSth* this, PlayState* play) {
|
|||
} else {
|
||||
this->sthFlags &= ~STH_FLAG_DRAW_MASK_OF_TRUTH;
|
||||
// This flag is used to keep track if the player has already spoken to the actor, triggering secondary dialogue.
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED);
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_TALKED_SWAMP_SPIDER_HOUSE_MAN);
|
||||
Actor_OfferGetItem(&this->actor, play, GI_MASK_TRUTH, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
|
|
@ -566,7 +566,7 @@ void EnSth_HandleSwampSpiderHouseConversation(EnSth* this, PlayState* play) {
|
|||
|
||||
case 0x91A: // Someone gave me this mask and said it would make me rich, getting rid of it
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH);
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED);
|
||||
CLEAR_WEEKEVENTREG(WEEKEVENTREG_TALKED_SWAMP_SPIDER_HOUSE_MAN);
|
||||
|
||||
case 0x902: // (does not exist)
|
||||
case 0x903: // (does not exist)
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ void EnSuttari_TriggerTransition(PlayState* play, u16 entrance) {
|
|||
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||
}
|
||||
|
||||
void EnSuttari_UpdateTime(void) {
|
||||
void EnSuttari_AdvanceTime(void) {
|
||||
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.timeSpeedOffset);
|
||||
}
|
||||
|
|
@ -1483,7 +1483,7 @@ void EnSuttari_Update(Actor* thisx, PlayState* play) {
|
|||
func_80BAB4F0(this, play);
|
||||
}
|
||||
if (this->flags2 & 2) {
|
||||
EnSuttari_UpdateTime();
|
||||
EnSuttari_AdvanceTime();
|
||||
}
|
||||
if (this->unk428 != 0) {
|
||||
if (this->animIndex == 2 || this->animIndex == 6) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Description: Sakon's Hideout Objects (Sun's Mask, doors, etc)
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_obj_nozoki.h"
|
||||
#include "objects/object_secom_obj/object_secom_obj.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -8997,37 +8997,37 @@
|
|||
0x809C0E30:("EnWarpTag_GrottoReturn",),
|
||||
0x809C0F18:("EnWarptag_Update",),
|
||||
0x809C0F3C:("EnWarpTag_Draw",),
|
||||
0x809C10B0:("func_809C10B0",),
|
||||
0x809C1124:("func_809C1124",),
|
||||
0x809C1158:("func_809C1158",),
|
||||
0x809C11EC:("func_809C11EC",),
|
||||
0x809C1304:("func_809C1304",),
|
||||
0x809C1424:("func_809C1424",),
|
||||
0x809C14D0:("func_809C14D0",),
|
||||
0x809C15BC:("func_809C15BC",),
|
||||
0x809C165C:("func_809C165C",),
|
||||
0x809C16DC:("func_809C16DC",),
|
||||
0x809C1C9C:("func_809C1C9C",),
|
||||
0x809C1D64:("func_809C1D64",),
|
||||
0x809C1EC8:("func_809C1EC8",),
|
||||
0x809C2060:("func_809C2060",),
|
||||
0x809C21E0:("func_809C21E0",),
|
||||
0x809C2504:("func_809C2504",),
|
||||
0x809C2594:("func_809C2594",),
|
||||
0x809C25E4:("func_809C25E4",),
|
||||
0x809C2680:("func_809C2680",),
|
||||
0x809C26E4:("func_809C26E4",),
|
||||
0x809C2730:("func_809C2730",),
|
||||
0x809C2788:("func_809C2788",),
|
||||
0x809C2824:("func_809C2824",),
|
||||
0x809C28B8:("func_809C28B8",),
|
||||
0x809C2A64:("func_809C2A64",),
|
||||
0x809C2BE4:("func_809C2BE4",),
|
||||
0x809C2C9C:("func_809C2C9C",),
|
||||
0x809C2D0C:("func_809C2D0C",),
|
||||
0x809C2EC4:("func_809C2EC4",),
|
||||
0x809C2F34:("func_809C2F34",),
|
||||
0x809C2FA0:("func_809C2FA0",),
|
||||
0x809C10B0:("EnAob01_Blink",),
|
||||
0x809C1124:("EnAob01_AdvanceTime",),
|
||||
0x809C1158:("EnAob01_InitializeDogPaths",),
|
||||
0x809C11EC:("EnAob01_SpawnDogs",),
|
||||
0x809C1304:("EnAob01_SpawnRacedogs",),
|
||||
0x809C1424:("EnAob01_ProcessLaughAnim",),
|
||||
0x809C14D0:("EnAob01_ProcessSurpriseAnim",),
|
||||
0x809C15BC:("EnAob01_ProcessIdleAnim",),
|
||||
0x809C165C:("EnAob01_UpdateCollision",),
|
||||
0x809C16DC:("EnAob01_BeforeRace_HandleConversation",),
|
||||
0x809C1C9C:("EnAob01_BeforeRace_StartRace",),
|
||||
0x809C1D64:("EnAob01_BeforeRace_RespondToPlayAgainQuestion",),
|
||||
0x809C1EC8:("EnAob01_UpdateCommon",),
|
||||
0x809C2060:("EnAob01_BeforeRace_Idle",),
|
||||
0x809C21E0:("EnAob01_BeforeRace_Talk",),
|
||||
0x809C2504:("EnAob01_Race_DogHasReachedNextCutsceneTrigger",),
|
||||
0x809C2594:("EnAob01_Race_FollowSelectedDog",),
|
||||
0x809C25E4:("EnAob01_Race_IsRaceOver",),
|
||||
0x809C2680:("EnAob01_Race_CurrentCutsceneHasEnded",),
|
||||
0x809C26E4:("EnAob01_Race_SkipNonRaceCutscene",),
|
||||
0x809C2730:("EnAob01_Race_HandleRaceCutscene",),
|
||||
0x809C2788:("EnAob01_Race_HandleRaceEndCutscene",),
|
||||
0x809C2824:("EnAob01_Race_StartCutscene",),
|
||||
0x809C28B8:("EnAob01_AfterRace_GiveRaceResult",),
|
||||
0x809C2A64:("EnAob01_AfterRace_GiveReward",),
|
||||
0x809C2BE4:("EnAob01_AfterRace_AfterGivingReward",),
|
||||
0x809C2C9C:("EnAob01_AfterRace_AskToPlayAgain",),
|
||||
0x809C2D0C:("EnAob01_AfterRace_Talk",),
|
||||
0x809C2EC4:("EnAob01_PlayerIsHoldingDog",),
|
||||
0x809C2F34:("EnAob01_Race_HidePlayer",),
|
||||
0x809C2FA0:("EnAob01_InitializeDogTextOffsets",),
|
||||
0x809C3190:("EnAob01_Init",),
|
||||
0x809C3350:("EnAob01_Destroy",),
|
||||
0x809C339C:("EnAob01_Update",),
|
||||
|
|
@ -15199,7 +15199,7 @@
|
|||
0x80BAA6D0:("EnSuttari_UpdateCollider",),
|
||||
0x80BAA848:("EnSuttari_GetActorById",),
|
||||
0x80BAA88C:("EnSuttari_TriggerTransition",),
|
||||
0x80BAA8D0:("EnSuttari_UpdateTime",),
|
||||
0x80BAA8D0:("EnSuttari_AdvanceTime",),
|
||||
0x80BAA904:("func_80BAA904",),
|
||||
0x80BAA9B4:("func_80BAA9B4",),
|
||||
0x80BAAA94:("func_80BAAA94",),
|
||||
|
|
|
|||
|
|
@ -9860,11 +9860,11 @@
|
|||
0x809C3770:("En_Aob_01_InitVars","UNK_TYPE1","",0x1),
|
||||
0x809C3790:("sAnimationInfo","UNK_TYPE4","",0x4),
|
||||
0x809C3820:("D_809C3820","UNK_TYPE1","",0x1),
|
||||
0x809C384C:("D_809C384C","UNK_TYPE4","",0x4),
|
||||
0x809C384C:("sDogInfo","UNK_TYPE4","",0x4),
|
||||
0x809C392C:("D_809C392C","UNK_TYPE1","",0x1),
|
||||
0x809C394C:("D_809C394C","UNK_TYPE4","",0x4),
|
||||
0x809C395C:("D_809C395C","UNK_PTR","",0x4),
|
||||
0x809C3968:("D_809C3968","UNK_TYPE1","",0x1),
|
||||
0x809C3968:("sFocusOffset","UNK_TYPE1","",0x1),
|
||||
0x809C3980:("D_809C3980","f32","",0x4),
|
||||
0x809C3984:("D_809C3984","f32","",0x4),
|
||||
0x809C3988:("D_809C3988","f32","",0x4),
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ weekEventReg = {
|
|||
( 8 << 8) | 0x04: "WEEKEVENTREG_08_04",
|
||||
( 8 << 8) | 0x08: "WEEKEVENTREG_08_08",
|
||||
( 8 << 8) | 0x10: "WEEKEVENTREG_08_10",
|
||||
( 8 << 8) | 0x20: "WEEKEVENTREG_08_20",
|
||||
( 8 << 8) | 0x20: "WEEKEVENTREG_RECEIVED_DOGGY_RACETRACK_HEART_PIECE",
|
||||
( 8 << 8) | 0x40: "WEEKEVENTREG_08_40",
|
||||
( 8 << 8) | 0x80: "WEEKEVENTREG_08_80",
|
||||
( 9 << 8) | 0x01: "WEEKEVENTREG_09_01",
|
||||
|
|
@ -279,7 +279,7 @@ weekEventReg = {
|
|||
(34 << 8) | 0x01: "WEEKEVENTREG_34_01",
|
||||
(34 << 8) | 0x02: "WEEKEVENTREG_34_02",
|
||||
(34 << 8) | 0x04: "WEEKEVENTREG_34_04",
|
||||
(34 << 8) | 0x08: "WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED",
|
||||
(34 << 8) | 0x08: "WEEKEVENTREG_TALKED_SWAMP_SPIDER_HOUSE_MAN",
|
||||
(34 << 8) | 0x10: "WEEKEVENTREG_34_10",
|
||||
(34 << 8) | 0x20: "WEEKEVENTREG_34_20",
|
||||
(34 << 8) | 0x40: "WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH",
|
||||
|
|
@ -523,12 +523,12 @@ weekEventReg = {
|
|||
(64 << 8) | 0x10: "WEEKEVENTREG_64_10",
|
||||
(64 << 8) | 0x20: "WEEKEVENTREG_64_20",
|
||||
(64 << 8) | 0x40: "WEEKEVENTREG_64_40",
|
||||
(64 << 8) | 0x80: "WEEKEVENTREG_64_80",
|
||||
(65 << 8) | 0x01: "WEEKEVENTREG_65_01",
|
||||
(65 << 8) | 0x02: "WEEKEVENTREG_65_02",
|
||||
(65 << 8) | 0x04: "WEEKEVENTREG_65_04",
|
||||
(65 << 8) | 0x08: "WEEKEVENTREG_65_08",
|
||||
(65 << 8) | 0x10: "WEEKEVENTREG_65_10",
|
||||
(64 << 8) | 0x80: "WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_DAY_1",
|
||||
(65 << 8) | 0x01: "WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_NIGHT_1",
|
||||
(65 << 8) | 0x02: "WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_DAY_2",
|
||||
(65 << 8) | 0x04: "WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_NIGHT_2",
|
||||
(65 << 8) | 0x08: "WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_DAY_3",
|
||||
(65 << 8) | 0x10: "WEEKEVENTREG_TALKED_DOGGY_RACETRACK_OWNER_NIGHT_3",
|
||||
(65 << 8) | 0x20: "WEEKEVENTREG_65_20",
|
||||
(65 << 8) | 0x40: "WEEKEVENTREG_65_40",
|
||||
(65 << 8) | 0x80: "WEEKEVENTREG_65_80",
|
||||
|
|
|
|||
Loading…
Reference in New Issue