1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-28 19:25:27 +00:00

object_horse and object_hni (#772)

* object_horse_zelda

Signed-off-by: angie <angheloalf95@gmail.com>

* object_horse_normal

Signed-off-by: angie <angheloalf95@gmail.com>

* object_horse_link_child

Signed-off-by: angie <angheloalf95@gmail.com>

* object_horse_ganon

Signed-off-by: angie <angheloalf95@gmail.com>

* object_horse

Signed-off-by: angie <angheloalf95@gmail.com>

* object_hni

Signed-off-by: Angie <angheloalf95@gmail.com>

* ZAPD is falling to do vtx

Signed-off-by: Angie <angheloalf95@gmail.com>

* Testing

Signed-off-by: Angie <angheloalf95@gmail.com>

* Rename horse_link_child variables

Signed-off-by: angie <angheloalf95@gmail.com>

* horse_zelda with names

Signed-off-by: angie <angheloalf95@gmail.com>

* I'm suspecting that this game doesn't use z_en_horse_ganon

Signed-off-by: angie <angheloalf95@gmail.com>

* Child epona eye textures

Signed-off-by: Angie <angheloalf95@gmail.com>

* Extract eyes textures from Epona

Signed-off-by: Angie <angheloalf95@gmail.com>

* Small rename

Signed-off-by: Angie <angheloalf95@gmail.com>

* change references in EnHorseNormal

Signed-off-by: angie <angheloalf95@gmail.com>

* Rename a few HorseNormal animations

Signed-off-by: angie <angheloalf95@gmail.com>

* Add normal horse eye texture

Signed-off-by: angie <angheloalf95@gmail.com>

* Add some textures

Signed-off-by: angie <angheloalf95@gmail.com>

* change pointers in EnViewer

Signed-off-by: angie <angheloalf95@gmail.com>

* Rename some animations of HorseGanon

Signed-off-by: angie <angheloalf95@gmail.com>

* Add a few dlists in object_horse

Signed-off-by: Angie <angheloalf95@gmail.com>

* Add whinnies

Signed-off-by: Angie <angheloalf95@gmail.com>

* Rename last animations remaining in horse_normal and horse_ganon

Signed-off-by: angie <angheloalf95@gmail.com>

* remove the other horses from this branch

Signed-off-by: angie <angheloalf95@gmail.com>

* Rename Epona animations

Signed-off-by: angie <angheloalf95@gmail.com>

* rename animations of ingo's horse

Signed-off-by: angie <angheloalf95@gmail.com>

* add textures in hni

Signed-off-by: angie <angheloalf95@gmail.com>

* Give proper animation names

Signed-off-by: angie <angheloalf95@gmail.com>

* Update symbols

Signed-off-by: angie <angheloalf95@gmail.com>

* cutscenes

Signed-off-by: angie <angheloalf95@gmail.com>

* ./format.sh

Signed-off-by: angie <angheloalf95@gmail.com>

* Apply suggestions from code review

Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>

* Add most of epona's textures and some limbs

Signed-off-by: angie <angheloalf95@gmail.com>

* add a bunch of textures and limbs of hni

Signed-off-by: Angie <angheloalf95@gmail.com>

* typo

Signed-off-by: Angie <angheloalf95@gmail.com>

* trailling comma memes

Signed-off-by: Angie <angheloalf95@gmail.com>

* all textures from hni

Signed-off-by: angie <angheloalf95@gmail.com>

* The remaining epona's textures

Signed-off-by: Angie <angheloalf95@gmail.com>

* Use proper names for bridge cutscene

Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>
This commit is contained in:
Anghelo Carvajal 2021-04-14 17:12:00 -04:00 committed by GitHub
parent 1f6a74e636
commit 9e956cbe3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 162 additions and 140 deletions

View file

@ -0,0 +1,51 @@
<Root>
<File Name="object_hni" Segment="6">
<Skeleton Name="gHorseIngoSkel" Type="Normal" LimbType="Skin" Offset="0x4A24"/>
<Animation Name="gHorseIngoIdleAnim" Offset="0x9FC4"/>
<Animation Name="gHorseIngoWhinnyAnim" Offset="0xA6B4"/>
<Animation Name="gHorseIngoRefuseAnim" Offset="0x901C"/>
<Animation Name="gHorseIngoRearingAnim" Offset="0x85E0"/>
<Animation Name="gHorseIngoWalkingAnim" Offset="0xAF60"/>
<Animation Name="gHorseIngoTrottingAnim" Offset="0x7B54"/>
<Animation Name="gHorseIngoGallopingAnim" Offset="0x506C"/>
<Animation Name="gHorseIngoJumpingAnim" Offset="0x5684"/>
<Animation Name="gHorseIngoJumpingHighAnim" Offset="0x5E20"/>
<!-- Head -->
<Texture Name="gHorseIngoManeTex" OutName="horse_ingo_mane" Format="i8" Width="16" Height="16" Offset="0x740" />
<Texture Name="gHorseIngoNostrilsTex" OutName="horse_ingo_nostrils" Format="rgb5a1" Width="16" Height="16" Offset="0x440" />
<Texture Name="gHorseIngoNoseTex" OutName="horse_ingo_nose" Format="i8" Width="8" Height="8" Offset="0x400" />
<Texture Name="gHorseIngoForeheadTex" OutName="horse_ingo_forehead" Format="i8" Width="8" Height="8" Offset="0x840" />
<Limb Name="gHorseIngoHeadLimb" LimbType="Skin" Offset="0x4748" />
<!-- Body -->
<Texture Name="gHorseIngoNeckTex" OutName="horse_ingo_neck" Format="i8" Width="16" Height="16" Offset="0x6DD0" />
<Texture Name="gHorseIngoThighTex" OutName="horse_ingo_thigh" Format="i8" Width="16" Height="16" Offset="0x66D0" />
<Texture Name="gHorseIngoShoulderTex" OutName="horse_ingo_shoulder" Format="i8" Width="32" Height="32" Offset="0x67D0" />
<Texture Name="gHorseIngoSaddleGirthTex" OutName="horse_ingo_saddle_girth" Format="rgb5a1" Width="8" Height="16" Offset="0x6BD0" />
<Texture Name="gHorseIngoSaddlePadTex" OutName="horse_ingo_saddle_pad" Format="rgb5a1" Width="8" Height="16" Offset="0x6CD0" />
<Limb Name="gHorseIngoBodyLimb" LimbType="Skin" Offset="0x46C8" />
<!-- Saddle -->
<Texture Name="gHorseIngoSaddleTex" OutName="horse_ingo_saddle" Format="rgb5a1" Width="16" Height="16" Offset="0x8C0" />
<Texture Name="gHorseIngoSaddleFlapTex" OutName="horse_ingo_saddle_flap" Format="rgb5a1" Width="16" Height="32" Offset="0xAC0" />
<Limb Name="gHorseIngoSaddleLimb" LimbType="Skin" Offset="0x4858" />
<!-- Hooves -->
<Texture Name="gHorseIngoHorseshoeTex" OutName="horse_ingo_horseshoe" Format="rgb5a1" Width="8" Height="8" Offset="0x6C0" />
<Texture Name="gHorseIngoFeatheringTex" OutName="horse_ingo_feathering" Format="rgb5a1" Width="8" Height="8" Offset="0x640" />
<Limb Name="gHorseIngoHoof1Limb" LimbType="Skin" Offset="0x4838" />
<Limb Name="gHorseIngoHoof2Limb" LimbType="Skin" Offset="0x4948" />
<Limb Name="gHorseIngoHoof3Limb" LimbType="Skin" Offset="0x48C8" />
<Limb Name="gHorseIngoHoof4Limb" LimbType="Skin" Offset="0x47B8" />
<!-- Gerudo saddle -->
<DList Name="gHorseIngoGerudoSaddleDL" Offset="0x6530"/>
<Texture Name="gHorseIngoGerudoSaddleTex" OutName="horse_ingo_gerudo_saddle" Format="rgb5a1" Width="16" Height="16" Offset="0x5E30" />
<Texture Name="gHorseIngoGerudoSaddleFlapTex" OutName="horse_ingo_gerudo_saddle_flap" Format="rgb5a1" Width="16" Height="16" Offset="0x6030" />
<!-- Eye texture -->
<Texture Name="gHorseIngoEyeTex" OutName="horse_ingo_eye" Format="rgb5a1" Width="32" Height="16" Offset="0x0" />
</File>
</Root>

View file

@ -0,0 +1,67 @@
<Root>
<File Name="object_horse" Segment="6">
<Skeleton Name="gEponaSkel" Type="Normal" LimbType="Skin" Offset="0x9D74"/>
<Animation Name="gEponaIdleAnim" Offset="0x6D50"/>
<Animation Name="gEponaWhinnyAnim" Offset="0x5584"/>
<Animation Name="gEponaRefuseAnim" Offset="0x4DEC"/>
<Animation Name="gEponaRearingAnim" Offset="0x3CEC"/>
<Animation Name="gEponaWalkingAnim" Offset="0x75F0"/>
<Animation Name="gEponaTrottingAnim" Offset="0x32B0"/>
<Animation Name="gEponaGallopingAnim" Offset="0x1E2C"/>
<Animation Name="gEponaJumpingAnim" Offset="0x2470"/>
<Animation Name="gEponaJumpingHighAnim" Offset="0x2C38"/>
<Texture Name="gEponaFeatheringTex" OutName="epona_feathering" Format="rgb5a1" Width="16" Height="16" Offset="0xBF10" />
<Texture Name="gEponaHairTex" OutName="epona_hair" Format="rgb5a1" Width="8" Height="8" Offset="0xC190" />
<!-- Head -->
<Texture Name="gEponaCrestTex" OutName="epona_crest" Format="rgb5a1" Width="16" Height="8" Offset="0xCA10" />
<Texture Name="gEponaManeTex" OutName="epona_mane" Format="rgb5a1" Width="16" Height="16" Offset="0xC810" />
<Texture Name="gEponaNostrilsTex" OutName="epona_nostrils" Format="rgb5a1" Width="16" Height="32" Offset="0xC410" />
<Texture Name="gEponaForeheadTex" OutName="epona_forehead" Format="rgb5a1" Width="8" Height="32" Offset="0xC210" />
<Limb Name="gEponaHeadLimb" LimbType="Skin" Offset="0x9A98" />
<!-- Body -->
<Texture Name="gEponaNeckTex" OutName="epona_neck" Format="i8" Width="16" Height="16" Offset="0xDC10" />
<Texture Name="gEponaChestTex" OutName="epona_chest" Format="i8" Width="16" Height="16" Offset="0xDB10" />
<Texture Name="gEponaShoulderTex" OutName="epona_shoulder" Format="i8" Width="16" Height="16" Offset="0xDE10" />
<Texture Name="gEponaThighTex" OutName="epona_thigh" Format="i8" Width="16" Height="16" Offset="0xDD10" />
<Limb Name="gEponaBodyLimb" LimbType="Skin" Offset="0x9A18" />
<!-- Saddle -->
<Texture Name="gEponaSaddleTex" OutName="epona_saddle" Format="rgb5a1" Width="32" Height="32" Offset="0xCB10" />
<Texture Name="gEponaSaddleFlapTex" OutName="epona_saddle_flap" Format="rgb5a1" Width="16" Height="16" Offset="0xD510" />
<Texture Name="gEponaSaddleLipTex" OutName="epona_saddle_lip" Format="rgb5a1" Width="16" Height="16" Offset="0xD310" />
<Texture Name="gEponaSaddleGirthTex" OutName="epona_saddle_girth" Format="rgb5a1" Width="32" Height="16" Offset="0xD710" />
<Limb Name="gEponaSaddleLimb" LimbType="Skin" Offset="0x9BA8" />
<!-- Cannons -->
<Limb Name="gEponaCannon1Limb" LimbType="Skin" Offset="0x9B18" />
<Limb Name="gEponaCannon2Limb" LimbType="Skin" Offset="0x9B98" />
<Limb Name="gEponaCannon3Limb" LimbType="Skin" Offset="0x9C28" />
<Limb Name="gEponaCannon4Limb" LimbType="Skin" Offset="0x9CA8" />
<!-- Hooves -->
<Texture Name="gEponaHorseshoeTex" OutName="epona_horseshoe" Format="rgb5a1" Width="8" Height="8" Offset="0xC110" />
<Limb Name="gEponaHoof1Limb" LimbType="Skin" Offset="0x9B08" />
<Limb Name="gEponaHoof2Limb" LimbType="Skin" Offset="0x9B88" />
<Limb Name="gEponaHoof3Limb" LimbType="Skin" Offset="0x9C18" />
<Limb Name="gEponaHoof4Limb" LimbType="Skin" Offset="0x9C98" />
<!-- Eyes textures -->
<Texture Name="gEponaEyeTLUT" OutName="epona_eye_tlut" Format="rgb5a1" Width="16" Height="16" Offset="0x9D80" />
<Texture Name="gEponaEyeOpenTex" OutName="epona_eye_open" Format="ci8" Width="32" Height="16" Offset="0x9F80" />
<Texture Name="gEponaEyeHalfTex" OutName="epona_eye_half" Format="ci8" Width="32" Height="16" Offset="0xA180" />
<Texture Name="gEponaEyeClosedTex" OutName="epona_eye_closed" Format="ci8" Width="32" Height="16" Offset="0xA380" />
<DList Name="gEponaUnusedWhiteCubeDL" Offset="0x4C0"/>
<DList Name="gEponaUnusedWhiteRectangle1DL" Offset="0x580"/>
<DList Name="gEponaUnusedWhiteRectangle2DL" Offset="0x620"/>
<DList Name="gEponaUnusedWhiteRectangle3DL" Offset="0x6C0"/>
<DList Name="gEponaUnusedWhiteRectangle4DL" Offset="0x760"/>
<Blob Name="gEponaBlob_000000" Offset="0x0" Size="0x380" />
<Blob Name="gEponaBlob_0007C0" Offset="0x7C0" Size="0xB0" />
</File>
</Root>

View file

@ -3,8 +3,8 @@
<Scene Name="spot09_scene">
<PathHint Offset="0x2F60"/>
<PathHint Offset="0x2F68"/>
<CutsceneHint Offset="0x2AC0"/>
<CutsceneHint Offset="0x230"/>
<CutsceneHint Name="gGerudoValleyBridgeJumpFieldFortressCs" Offset="0x2AC0"/>
<CutsceneHint Name="gGerudoValleyBridgeJumpFortressToFieldCs" Offset="0x230"/>
</Scene>
</File>
<File Name="spot09_room_0">

6
spec
View file

@ -3583,7 +3583,8 @@ endseg
beginseg
name "object_horse"
romalign 0x1000
include "build/baserom/object_horse.o"
include "build/assets/objects/object_horse/object_horse.o"
number 6
endseg
beginseg
@ -4665,7 +4666,8 @@ endseg
beginseg
name "object_hni"
romalign 0x1000
include "build/baserom/object_hni.o"
include "build/assets/objects/object_hni/object_hni.o"
number 6
endseg
beginseg

View file

@ -1,5 +1,14 @@
/**
* File: z_en_horse.c
* Overlay: ovl_En_Horse
* Description: Rideable horses
*/
#include "z_en_horse.h"
#include "overlays/actors/ovl_En_In/z_en_in.h"
#include "objects/object_horse/object_horse.h"
#include "objects/object_hni/object_hni.h"
#include "scenes/overworld/spot09/spot09_scene.h"
#define FLAGS 0x00000010
@ -42,23 +51,22 @@ void EnHorse_CutsceneUpdate(EnHorse* this, GlobalContext* globalCtx);
void EnHorse_UpdateHorsebackArchery(EnHorse* this, GlobalContext* globalCtx);
void EnHorse_FleePlayer(EnHorse* this, GlobalContext* globalCtx);
extern CutsceneData D_02000230[];
extern CutsceneData D_02002AC0[];
extern Gfx D_06006530[];
static AnimationHeader* sEponaAnimHeaders[] = {
0x06006D50, 0x06005584, 0x06004DEC, 0x06003CEC, 0x060075F0, 0x060032B0, 0x06001E2C, 0x06002470, 0x06002C38,
&gEponaIdleAnim, &gEponaWhinnyAnim, &gEponaRefuseAnim, &gEponaRearingAnim, &gEponaWalkingAnim,
&gEponaTrottingAnim, &gEponaGallopingAnim, &gEponaJumpingAnim, &gEponaJumpingHighAnim,
};
static AnimationHeader* sHniAnimHeaders[] = {
0x06009FC4, 0x0600A6B4, 0x0600901C, 0x060085E0, 0x0600AF60, 0x06007B54, 0x0600506C, 0x06005684, 0x06005E20,
&gHorseIngoIdleAnim, &gHorseIngoWhinnyAnim, &gHorseIngoRefuseAnim,
&gHorseIngoRearingAnim, &gHorseIngoWalkingAnim, &gHorseIngoTrottingAnim,
&gHorseIngoGallopingAnim, &gHorseIngoJumpingAnim, &gHorseIngoJumpingHighAnim,
};
static AnimationHeader** sAnimationHeaders[] = { sEponaAnimHeaders, sHniAnimHeaders };
static f32 sPlaybackSpeeds[] = { 0.6666667f, 0.6666667f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.6666667f, 0.6666667f };
static SkeletonHeader* sSkeletonHeaders[] = { 0x06009D74, 0x06004A24 };
static SkeletonHeader* sSkeletonHeaders[] = { &gEponaSkel, &gHorseIngoSkel };
const ActorInit En_Horse_InitVars = {
ACTOR_EN_HORSE,
@ -318,7 +326,7 @@ static EnHorseSpawnpoint sHorseSpawns[] = {
{ SCENE_SPOT12, -966, 24, -761, 0 },
{ SCENE_SPOT12, -694, 174, -2820, 0 },
/* Lon Lon Ranch */
// Lon Lon Ranch
{ SCENE_SPOT20, 1039, 0, 2051, 0 },
{ SCENE_SPOT20, -1443, 0, 1429, 0 },
{ SCENE_SPOT20, 856, 0, -918, 0 }, // Hardcoded to always load in lon lon
@ -361,62 +369,9 @@ typedef struct {
} RaceInfo;
static RaceWaypoint sIngoRaceWaypoints[] = {
{
1056,
1,
-1540,
11,
0x2A8D,
},
{
1593,
1,
-985,
10,
0xFC27,
},
{
1645,
1,
-221,
11,
0xE891,
},
{
985,
1,
403,
10,
0xBB9C,
},
{
-1023,
1,
354,
11,
0xA37D,
},
{
-1679,
1,
-213,
10,
0x889C,
},
{
-1552,
1,
-1008,
11,
0x638D,
},
{
-947,
-1,
-1604,
10,
0x4002,
},
{ 1056, 1, -1540, 11, 0x2A8D }, { 1593, 1, -985, 10, 0xFC27 }, { 1645, 1, -221, 11, 0xE891 },
{ 985, 1, 403, 10, 0xBB9C }, { -1023, 1, 354, 11, 0xA37D }, { -1679, 1, -213, 10, 0x889C },
{ -1552, 1, -1008, 11, 0x638D }, { -947, -1, -1604, 10, 0x4002 },
};
static RaceInfo sIngoRace = { 8, sIngoRaceWaypoints };
@ -464,64 +419,12 @@ typedef struct {
} CsActionEntry;
static CsActionEntry sCsActionTable[] = {
{
36,
1,
},
{
37,
2,
},
{
38,
3,
},
{
64,
4,
},
{
65,
5,
},
{ 36, 1 }, { 37, 2 }, { 38, 3 }, { 64, 4 }, { 65, 5 },
};
static RaceWaypoint sHbaWaypoints[] = {
{
3600,
1413,
-5055,
11,
0x8001,
},
{
3360,
1413,
-5220,
5,
0xC000,
},
{
3100,
1413,
-4900,
5,
0x0000,
},
{
3600,
1413,
-4100,
11,
0x0000,
},
{
3600,
1413,
360,
11,
0x0000,
},
{ 3600, 1413, -5055, 11, 0x8001 }, { 3360, 1413, -5220, 5, 0xC000 }, { 3100, 1413, -4900, 5, 0x0000 },
{ 3600, 1413, -4100, 11, 0x0000 }, { 3600, 1413, 360, 11, 0x0000 },
};
static RaceInfo sHbaInfo = { 5, sHbaWaypoints };
@ -2850,10 +2753,10 @@ void EnHorse_BridgeJumpInit(EnHorse* this, GlobalContext* globalCtx) {
void EnHorse_StartBridgeJump(EnHorse* this, GlobalContext* globalCtx) {
this->postDrawFunc = EnHorse_BridgeJumpInit;
if (this->bridgeJumpIdx == 0) {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(D_02002AC0);
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGerudoValleyBridgeJumpFieldFortressCs);
gSaveContext.cutsceneTrigger = 1;
} else {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(D_02000230);
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGerudoValleyBridgeJumpFortressToFieldCs);
gSaveContext.cutsceneTrigger = 1;
}
}
@ -3885,24 +3788,28 @@ void EnHorse_SkinCallback1(Actor* thisx, GlobalContext* globalCtx, PSkinAwb* ski
}
static s32 unk_80A667DC[] = { 0, 3, 7, 14 };
static UNK_PTR D_80A667EC[] = { 0x06009F80, 0x0600A180, 0x0600A380 };
static u64* sEyeTextures[] = {
gEponaEyeOpenTex,
gEponaEyeHalfTex,
gEponaEyeClosedTex,
};
static u8 sBlinkTextures[] = { 0, 1, 2, 1 };
s32 EnHorse_SkinCallback2(Actor* thisx, GlobalContext* globalCtx, s32 arg2, PSkinAwb* arg3) {
s32 EnHorse_SkinCallback2(Actor* thisx, GlobalContext* globalCtx, s32 limbIndex, PSkinAwb* arg3) {
EnHorse* this = THIS;
s32 sp48;
s32 drawOriginalLimb = true;
sp48 = 1;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_horse.c", 8582);
if (arg2 == 13 && this->type == HORSE_EPONA) {
if (limbIndex == 13 && this->type == HORSE_EPONA) {
u8 index = sBlinkTextures[this->blinkTimer];
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80A667EC[index]));
} else if (this->type == HORSE_HNI && this->stateFlags & ENHORSE_FLAG_18 && arg2 == 30) {
func_800A5F60(globalCtx->state.gfxCtx, &this->skin, arg2, D_06006530, 0);
sp48 = 0;
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[index]));
} else if (this->type == HORSE_HNI && this->stateFlags & ENHORSE_FLAG_18 && limbIndex == 30) {
func_800A5F60(globalCtx->state.gfxCtx, &this->skin, limbIndex, gHorseIngoGerudoSaddleDL, 0);
drawOriginalLimb = false;
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_horse.c", 8601);
return sp48;
return drawOriginalLimb;
}
void EnHorse_Draw(Actor* thisx, GlobalContext* globalCtx) {

View file

@ -2097,11 +2097,6 @@ D_06001960 = 0x06001960;
// z_en_honotrap
D_05006810 = 0x05006810;
// z_en_horse
D_02000230 = 0x02000230;
D_02002AC0 = 0x02002AC0;
D_06006530 = 0x06006530;
// z_en_hs
D_06000304 = 0x06000304;
D_06000528 = 0x06000528;