Skip to content

Commit

Permalink
Merge branch 'main' into triforce-hunt
Browse files Browse the repository at this point in the history
  • Loading branch information
HylianFreddy committed Apr 23, 2024
2 parents 9b9780a + 7ef3233 commit 60d566d
Show file tree
Hide file tree
Showing 80 changed files with 3,268 additions and 789 deletions.
6 changes: 6 additions & 0 deletions code/include/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,10 @@ typedef struct {
#define CPAD_UP (1 << 30)
#define CPAD_DOWN (1 << 31)

// Generic catch-all directions
#define PAD_RIGHT (BUTTON_RIGHT | CPAD_RIGHT)
#define PAD_LEFT (BUTTON_LEFT | CPAD_LEFT)
#define PAD_UP (BUTTON_UP | CPAD_UP)
#define PAD_DOWN (BUTTON_DOWN | CPAD_DOWN)

#endif // HID_H
41 changes: 38 additions & 3 deletions code/include/z3D/z3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,12 @@ typedef struct {
/* 0x1594 */ char unk_1594[0x000C];
/* 0x15A0 */ u16 nextCutsceneIndex;
/* 0x15A2 */ u8 cutsceneTrigger;
/* 0x15A3 */ char unk_15A3[0x008];
/* 0x15A3 */ u8 chamberCutsceneNum;
/* 0x15A4 */ u16 nextDayTime; // "next_zelda_time"
/* 0x15A6 */ u8 transFadeDuration;
/* 0x15A7 */ u8 transWipeSpeed;
/* 0x15A8 */ u16 skyboxTime;
/* 0x15AA */ u8 dogIsLost;
/* 0x15AB */ u8 nextTransition;
/* 0x15AC */ char unk_15AC[0x006];
/* 0x15B2 */ s16 healthAccumulator;
Expand Down Expand Up @@ -403,7 +408,7 @@ typedef struct {
typedef struct {
/* 0x0000 */ u8 unk_00;
/* 0x0001 */ char unk_01[0x01];
/* 0x0002 */ u8 unk_02;
/* 0x0002 */ u8 hammerQuakeFlag;
/* 0x0003 */ u8 unk_03;
/* 0x0004 */ char unk_04[0x04];
/* 0x0008 */ u8 total; // total number of actors loaded
Expand Down Expand Up @@ -573,7 +578,8 @@ typedef struct GlobalContext {
/* 0x3A58 */ ObjectContext objectCtx;
/* 0x43DC */ char unk_43DC[0x0854];
/* 0x4C30 */ s8 roomNum;
/* 0x4C31 */ char unk_4C31[0x0FCF];
/* 0x4C31 */ char unk_4C31[0x0FCB];
/* 0x5BFC */ u32 gameplayFrames;
/* 0x5C00 */ u8 linkAgeOnLoad;
/* 0x5C01 */ u8 unk_5C01;
/* 0x5C02 */ u8 curSpawn;
Expand Down Expand Up @@ -655,6 +661,27 @@ typedef struct TargetContext {
// ... size unknown
} TargetContext;

typedef struct SAModelListEntry {
SkeletonAnimationModel* saModel;
u32 unk;
} SAModelListEntry;

typedef struct SubMainClass_180 {
/* 0x000 */ char unk_00[0x8];
/* 0x008 */ s32 saModelsCount1;
/* 0x00C */ s32 saModelsCount2;
/* 0x010 */ char unk_10[0x10];
/* 0x020 */ SAModelListEntry* saModelsList1; // 3D models
/* 0x024 */ SAModelListEntry* saModelsList2; // 2D billboards
/* ... size unknown*/
} SubMainClass_180;

typedef struct MainClass {
/* 0x000 */ char unk_00[0x180];
/* 0x180 */ SubMainClass_180 sub180;
/* ... size unknown*/
} MainClass;

extern GlobalContext* gGlobalContext;
extern const u32 ItemSlots[];
extern const char DungeonNames[][25];
Expand All @@ -672,6 +699,7 @@ extern const char DungeonNames[][25];
#define gDrawItemTable ((DrawItemTableEntry*)0x4D88C8)
#define gRestrictionFlags ((RestrictionFlags*)0x539DC4)
#define PLAYER ((Player*)gGlobalContext->actorCtx.actorList[ACTORTYPE_PLAYER].first)
#define gMainClass ((MainClass*)0x5BE5B8)
#define gIsBottomScreenDimmed (*(s32*)0x5043EC)

#define GearSlot(X) (X - ITEM_SWORD_KOKIRI)
Expand Down Expand Up @@ -864,6 +892,13 @@ typedef void (*Animation_Change_proc)(SkelAnime* anime, s32 animation_index, f32
#define Animation_Change_addr 0x375C08
#define Animation_Change ((Animation_Change_proc)Animation_Change_addr)

typedef void (*EffectSsDeadDb_Spawn_proc)(GlobalContext* globalCtx, Vec3f* position, Vec3f* velocity,
Vec3f* acceleration, s16 scale, s16 scale_step, s16 prim_r, s16 prim_g,
s16 prim_b, s16 prim_a, s16 env_r, s16 env_g, s16 env_b, s16 unused,
s32 frame_duration, s16 play_sound);
#define EffectSsDeadDb_Spawn_addr 0x3642F4
#define EffectSsDeadDb_Spawn ((EffectSsDeadDb_Spawn_proc)EffectSsDeadDb_Spawn_addr)

typedef void (*SaveGame_proc)(GlobalContext* globalCtx, u8 isSaveFileCreation);
#define SaveGame_addr 0x2FDAC8
#define SaveGame ((SaveGame_proc)SaveGame_addr)
Expand Down
6 changes: 3 additions & 3 deletions code/include/z3D/z3Dactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ typedef struct {

typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ // ColliderInfo info;
/* 0x40 */ // Cylinderf dim;
} ColliderCylinder; // size = 0x58
/* 0x18 */ char unk_18[0x28]; // ColliderInfo info;
/* 0x40 */ char unk_40[0x18]; // Cylinderf dim;
} ColliderCylinder; // size = 0x58

typedef struct {
/* 0x00 */ Vec3s rot; // Current actor shape rotation
Expand Down
55 changes: 55 additions & 0 deletions code/include/z3D/z3Ditem.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,61 @@ typedef enum {
/* 0xDC */ GI_FORTRESS_KEY_RING,
/* 0xDD */ GI_GANON_KEY_RING,
/* 0xDE */ GI_CHEST_GAME_KEY,

/* 0xDF */ GI_SOUL_POE,
/* 0xE0 */ GI_SOUL_OCTOROK,
/* 0xE1 */ GI_SOUL_KEESE,
/* 0xE2 */ GI_SOUL_TEKTITE,
/* 0xE3 */ GI_SOUL_LEEVER,
/* 0xE4 */ GI_SOUL_PEAHAT,
/* 0xE5 */ GI_SOUL_LIZALFOS,
/* 0xE6 */ GI_SOUL_SHABOM,
/* 0xE7 */ GI_SOUL_BIRI_BARI,
/* 0xE8 */ GI_SOUL_TAILPASARAN,
/* 0xE9 */ GI_SOUL_SKULLTULA,
/* 0xEA */ GI_SOUL_TORCH_SLUG,
/* 0xEB */ GI_SOUL_STINGER,
/* 0xEC */ GI_SOUL_MOBLIN,
/* 0xED */ GI_SOUL_ARMOS,
/* 0xEE */ GI_SOUL_DEKU_BABA,
/* 0xEF */ GI_SOUL_BUBBLE,
/* 0xF0 */ GI_SOUL_FLYING_TRAP,
/* 0xF1 */ GI_SOUL_BEAMOS,
/* 0xF2 */ GI_SOUL_WALLMASTER,
/* 0xF3 */ GI_SOUL_REDEAD_GIBDO,
/* 0xF4 */ GI_SOUL_SHELL_BLADE,
/* 0xF5 */ GI_SOUL_LIKE_LIKE,
/* 0xF6 */ GI_SOUL_TENTACLE,
/* 0xF7 */ GI_SOUL_ANUBIS,
/* 0xF8 */ GI_SOUL_SPIKE,
/* 0xF9 */ GI_SOUL_SKULL_KID,
/* 0xFA */ GI_SOUL_FREEZARD,
/* 0xFB */ GI_SOUL_DEKU_SCRUB,
/* 0xFC */ GI_SOUL_WOLFOS,
/* 0xFD */ GI_SOUL_STALCHILD,
/* 0xFE */ GI_SOUL_GUAY,
/* 0xFF */ GI_SOUL_DOOR_MIMIC,
/* 0x100 */ GI_SOUL_STALFOS,
/* 0x101 */ GI_SOUL_DARK_LINK,
/* 0x102 */ GI_SOUL_FLARE_DANCER,
/* 0x103 */ GI_SOUL_DEAD_HAND,
/* 0x104 */ GI_SOUL_GERUDO,
/* 0x105 */ GI_SOUL_GOHMA,
/* 0x106 */ GI_SOUL_DODONGO,
/* 0x107 */ GI_SOUL_BARINADE,
/* 0x108 */ GI_SOUL_PHANTOM_GANON,
/* 0x109 */ GI_SOUL_VOLVAGIA,
/* 0x10A */ GI_SOUL_MORPHA,
/* 0x10B */ GI_SOUL_BONGO_BONGO,
/* 0x10C */ GI_SOUL_TWINROVA,
/* 0x10D */ GI_SOUL_GANON,

/* 0x10E */ GI_OCARINA_BUTTON_L,
/* 0x10F */ GI_OCARINA_BUTTON_R,
/* 0x110 */ GI_OCARINA_BUTTON_X,
/* 0x111 */ GI_OCARINA_BUTTON_Y,
/* 0x112 */ GI_OCARINA_BUTTON_A,

} GetItemID;

typedef enum {
Expand Down
2 changes: 2 additions & 0 deletions code/object_and_gi_usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The following custom objectIds are currently being used:
126: GTG Small Key
127: Ganon Small Key
128: Boss Keys
228: Enemy Souls
291: Ocarina Note Buttons
366: Triforce Piece

To use a custom asset, currently:
Expand Down
36 changes: 34 additions & 2 deletions code/oot.ld
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ SECTIONS
*(.patch_ItemEtceteraModelDraw)
}

.patch_FlyingPotCollision 0x11DB34 : {
*(.patch_FlyingPotCollision)
}

.patch_DodongoAfterSwallowBomb 0x11E4B8 : {
*(.patch_DodongoAfterSwallowBomb)
}

.patch_SariasSongItemGive 0x12C84C : {
*(.patch_SariasSongItemGive)
}
Expand Down Expand Up @@ -396,6 +404,10 @@ SECTIONS
*(.patch_FishingSizeIgnoreAdult)
}

.patch_BabyDodongoAfterSwallowBomb 0x1C42DC : {
*(.patch_BabyDodongoAfterSwallowBomb)
}

.patch_BiggoronAfterGiveItem 0x1C4E4C : {
*(.patch_BiggoronAfterGiveItem)
}
Expand Down Expand Up @@ -596,6 +608,10 @@ SECTIONS
*(.patch_BoleroLocation)
}

.patch_FlyingTileCollision 0x26E730 : {
*(.patch_FlyingTileCollision)
}

.patch_RedBoulderExplode 0x26FE7C : {
*(.patch_RedBoulderExplode)
}
Expand Down Expand Up @@ -700,6 +716,10 @@ SECTIONS
*(.patch_GetCustomMessageTextOne)
}

.patch_ActorDraw 0x2D6310 : {
*(.patch_ActorDraw)
}

.patch_CamUpdate 0x2D84C8 : {
* (.patch_CamUpdate)
}
Expand Down Expand Up @@ -736,6 +756,10 @@ SECTIONS
*(.patch_OverrideDrawItemOne)
}

.patch_OcarinaNoteButtonsDraw 0x2F9430 : {
* (.patch_OcarinaNoteButtonsDraw)
}

.patch_SaveGame 0x2FBFA8 : {
*(.patch_SaveGame)
}
Expand Down Expand Up @@ -1008,6 +1032,10 @@ SECTIONS
*(.patch_GerudoArcheryOne)
}

.patch_ShabomAfterDamagePlayer 0x3B5060 : {
*(.patch_ShabomAfterDamagePlayer)
}

.patch_RandomGsLoc_CustomTokenSpawnOffset 0x3B94C4 : {
*(.patch_RandomGsLoc_CustomTokenSpawnOffset)
}
Expand Down Expand Up @@ -1212,6 +1240,10 @@ SECTIONS
*(.patch_SleepQueryCallback)
}

.patch_OcarinaNoteButtonsPress 0x41AAAC : {
* (.patch_OcarinaNoteButtonsPress)
}

.patch_CurseTrapDizzyStick 0x41AB24 : {
*(.patch_CurseTrapDizzyStick)
}
Expand Down Expand Up @@ -1436,8 +1468,8 @@ SECTIONS
*(.patch_AfterActorSetup_RoomChange)
}

.patch_HyperActors 0x461790 : {
*(.patch_HyperActors)
.patch_ActorUpdate 0x461790 : {
*(.patch_ActorUpdate)
}

.patch_TitleCardUpdate 0x4618B8 : {
Expand Down
36 changes: 34 additions & 2 deletions code/oot_e.ld
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ SECTIONS
*(.patch_ItemEtceteraModelDraw)
}

.patch_FlyingPotCollision 0x11DB34 : {
*(.patch_FlyingPotCollision)
}

.patch_DodongoAfterSwallowBomb 0x11E4B8 : {
*(.patch_DodongoAfterSwallowBomb)
}

.patch_SariasSongItemGive 0x12C84C : {
*(.patch_SariasSongItemGive)
}
Expand Down Expand Up @@ -396,6 +404,10 @@ SECTIONS
*(.patch_FishingSizeIgnoreAdult)
}

.patch_BabyDodongoAfterSwallowBomb 0x1C42DC : {
*(.patch_BabyDodongoAfterSwallowBomb)
}

.patch_BiggoronAfterGiveItem 0x1C4E4C : {
*(.patch_BiggoronAfterGiveItem)
}
Expand Down Expand Up @@ -596,6 +608,10 @@ SECTIONS
*(.patch_BoleroLocation)
}

.patch_FlyingTileCollision 0x26E730 : {
*(.patch_FlyingTileCollision)
}

.patch_RedBoulderExplode 0x26FE7C : {
*(.patch_RedBoulderExplode)
}
Expand Down Expand Up @@ -700,6 +716,10 @@ SECTIONS
*(.patch_GetCustomMessageTextOne)
}

.patch_ActorDraw 0x2D6310 : {
*(.patch_ActorDraw)
}

.patch_CamUpdate 0x2D84C8 : {
* (.patch_CamUpdate)
}
Expand Down Expand Up @@ -736,6 +756,10 @@ SECTIONS
*(.patch_OverrideDrawItemOne)
}

.patch_OcarinaNoteButtonsDraw 0x2F9430 : {
* (.patch_OcarinaNoteButtonsDraw)
}

.patch_SaveGame 0x2FBFA8 : {
*(.patch_SaveGame)
}
Expand Down Expand Up @@ -1008,6 +1032,10 @@ SECTIONS
*(.patch_GerudoArcheryOne)
}

.patch_ShabomAfterDamagePlayer 0x3B5060 : {
*(.patch_ShabomAfterDamagePlayer)
}

.patch_RandomGsLoc_CustomTokenSpawnOffset 0x3B94C4 : {
*(.patch_RandomGsLoc_CustomTokenSpawnOffset)
}
Expand Down Expand Up @@ -1212,6 +1240,10 @@ SECTIONS
*(.patch_SleepQueryCallback)
}

.patch_OcarinaNoteButtonsPress 0x41AAD0 : {
* (.patch_OcarinaNoteButtonsPress)
}

.patch_CurseTrapDizzyStick 0x41AB48 : {
*(.patch_CurseTrapDizzyStick)
}
Expand Down Expand Up @@ -1436,8 +1468,8 @@ SECTIONS
*(.patch_AfterActorSetup_RoomChange)
}

.patch_HyperActors 0x4617B0 : {
*(.patch_HyperActors)
.patch_ActorUpdate 0x4617B0 : {
*(.patch_ActorUpdate)
}

.patch_TitleCardUpdate 0x4618D8 : {
Expand Down
Loading

0 comments on commit 60d566d

Please sign in to comment.