1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-26 14:46:16 +00:00
This commit is contained in:
Ethan Roseman 2020-03-23 15:23:50 -04:00
parent c79cbf7d9c
commit 1042a72fd2
4 changed files with 36 additions and 63 deletions

View file

@ -1,22 +0,0 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purposee registers
.section .data
glabel Bg_Haka_Megane_InitVars
.word 0x00AE0600, 0x000000B0, 0x00010000, 0x0000016C
.word BgHakaMegane_Init
.word BgHakaMegane_Destroy
.word BgHakaMegane_Update
.word 0x00000000
glabel D_8087DD50
.word 0x48500064
glabel D_8087DD54
.word 0x06001830, 0x06001AB8, 0x00000000, 0x06004330, 0x060044D0, 0x00000000, 0x06004780, 0x06004940, 0x00000000, 0x06004B00, 0x00000000, 0x06004CC0, 0x00000000
glabel D_8087DD88
.word 0x06001060, 0x06001920, 0x060003F0, 0x060040F0, 0x060043B0, 0x06001120, 0x060045A0, 0x060047F0, 0x060018F0, 0x060049B0, 0x06003CF0, 0x06004B70, 0x06002ED0, 0x00000000

View file

@ -1,11 +0,0 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purposee registers
.section .rodata
glabel D_8087DDC0
.incbin "baserom/ovl_Bg_Haka_Megane", 0x380, 0x00000070

2
spec
View file

@ -866,7 +866,7 @@ endseg
beginseg beginseg
name "ovl_Bg_Haka_Megane" name "ovl_Bg_Haka_Megane"
include "build/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.o" include "build/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.o"
include "build/data/overlays/actors/z_bg_haka_megane.reloc.o" include "build/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane_reloc.o"
endseg endseg
beginseg beginseg

View file

@ -1,16 +1,22 @@
/*
* File: z_bg_haka_megane.c
* Overlay: ovl_Bg_Haka_Megane
* Description:
*/
#include "z_bg_haka_megane.h" #include "z_bg_haka_megane.h"
#define ROOM 0x00 #define ROOM 0x00
#define FLAGS 0x000000B0 #define FLAGS 0x000000B0
void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx); static void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx);
void BgHakaMegane_Destroy(BgHakaMegane* this, GlobalContext* globalCtx); static void BgHakaMegane_Destroy(BgHakaMegane* this, GlobalContext* globalCtx);
void BgHakaMegane_Update(BgHakaMegane* this, GlobalContext* globalCtx); static void BgHakaMegane_Update(BgHakaMegane* this, GlobalContext* globalCtx);
void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx); static void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx);
void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx); static void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx);
void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx); static void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx);
void func_8087DC94(BgHakaMegane* this, GlobalContext* globalCtx); static void func_8087DC94(BgHakaMegane* this, GlobalContext* globalCtx);
const ActorInit Bg_Haka_Megane_InitVars = const ActorInit Bg_Haka_Megane_InitVars =
{ {
@ -26,23 +32,23 @@ const ActorInit Bg_Haka_Megane_InitVars =
NULL, NULL,
}; };
InitChainEntry initChain[] = { static InitChainEntry initChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
}; };
UNK_TYPE D_8087DD54[] = { static UNK_TYPE collisions[] = {
0x06001830, 0x06001AB8, 0x00000000, 0x06004330, 0x060044D0, 0x00000000, 0x06004780, 0x06001830, 0x06001AB8, 0x00000000, 0x06004330, 0x060044D0, 0x00000000, 0x06004780,
0x06004940, 0x00000000, 0x06004B00, 0x00000000, 0x06004CC0, 0x00000000, 0x06004940, 0x00000000, 0x06004B00, 0x00000000, 0x06004CC0, 0x00000000,
}; };
UNK_TYPE D_8087DD88[] = { static UNK_TYPE dlists[] = {
0x06001060, 0x06001920, 0x060003F0, 0x060040F0, 0x060043B0, 0x06001120, 0x060045A0, 0x06001060, 0x06001920, 0x060003F0, 0x060040F0, 0x060043B0, 0x06001120, 0x060045A0,
0x060047F0, 0x060018F0, 0x060049B0, 0x06003CF0, 0x06004B70, 0x06002ED0, 0x00000000, 0x060047F0, 0x060018F0, 0x060049B0, 0x06003CF0, 0x06004B70, 0x06002ED0,
}; };
extern UNK_TYPE D_06001250; extern UNK_TYPE D_06001250;
void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx) { static void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
Actor_ProcessInitChain(thisx, initChain); Actor_ProcessInitChain(thisx, initChain);
@ -61,25 +67,25 @@ void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx) {
} }
} }
void BgHakaMegane_Destroy(BgHakaMegane* this, GlobalContext* globalCtx) { static void BgHakaMegane_Destroy(BgHakaMegane* this, GlobalContext* globalCtx) {
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
} }
void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) { static void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor; s32 localC;
s32 local_c; UNK_TYPE collision;
u32 collision;
if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) { if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) {
thisx->draw = (ActorFunc)func_8087DC94; this->dyna.actor.objBankIndex = this->objBankIndex;
thisx->objBankIndex = this->objBankIndex; this->dyna.actor.draw = (ActorFunc)func_8087DC94;
Actor_SetObjectDependency(globalCtx, thisx); Actor_SetObjectDependency(globalCtx, &this->dyna.actor);
if (globalCtx->roomCtx.curRoom.showInvisActors) { if (globalCtx->roomCtx.curRoom.showInvisActors) {
this->actionFunc = (ActorFunc)func_8087DBF0; this->actionFunc = (ActorFunc)func_8087DBF0;
collision = D_8087DD54[thisx->params]; collision = collisions[this->dyna.actor.params];
if (collision != 0) { if (collision != 0) {
DynaPolyInfo_Alloc(&collision, &local_c); DynaPolyInfo_Alloc(collision, &localC);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna,
&this->dyna.actor, localC);
} }
} else { } else {
this->actionFunc = (ActorFunc)func_8087DC64; this->actionFunc = (ActorFunc)func_8087DC64;
@ -87,7 +93,7 @@ void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) {
} }
} }
void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) { static void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
if (globalCtx->actorCtx.unk_03 != 0) { if (globalCtx->actorCtx.unk_03 != 0) {
thisx->flags |= 0x80; thisx->flags |= 0x80;
@ -98,21 +104,21 @@ void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) {
} }
} }
void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx) { static void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx) {
} }
void BgHakaMegane_Update(BgHakaMegane* this, GlobalContext* globalCtx) { static void BgHakaMegane_Update(BgHakaMegane* this, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx); this->actionFunc(this, globalCtx);
} }
void func_8087DC94(BgHakaMegane* this, GlobalContext* globalCtx) { static void func_8087DC94(BgHakaMegane* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
if ((thisx->flags & 0x80) == 0x80) { if ((thisx->flags & 0x80) == 0x80) {
Draw_DListXlu(globalCtx, D_8087DD88[thisx->params]); Draw_DListXlu(globalCtx, dlists[thisx->params]);
} else { } else {
Draw_DListOpa(globalCtx, D_8087DD88[thisx->params]); Draw_DListOpa(globalCtx, dlists[thisx->params]);
} }
if (thisx->params == 0) { if (thisx->params == 0) {