1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-29 03:34:07 +00:00

Almost done

This commit is contained in:
Ethan Roseman 2020-03-23 01:31:03 -04:00
parent d879f2acb0
commit 4c3b764461
10 changed files with 101 additions and 184 deletions

View file

@ -1,16 +0,0 @@
glabel BgHakaMegane_Destroy
/* 000B4 8087DAF4 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 000B8 8087DAF8 AFA40018 */ sw $a0, 0x0018($sp)
/* 000BC 8087DAFC 8FAE0018 */ lw $t6, 0x0018($sp)
/* 000C0 8087DB00 AFBF0014 */ sw $ra, 0x0014($sp)
/* 000C4 8087DB04 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 000C8 8087DB08 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810
/* 000CC 8087DB0C 0C00FB56 */ jal DynaPolyInfo_Free
## DynaPolyInfo_delReserve
/* 000D0 8087DB10 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C
/* 000D4 8087DB14 8FBF0014 */ lw $ra, 0x0014($sp)
/* 000D8 8087DB18 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 000DC 8087DB1C 03E00008 */ jr $ra
/* 000E0 8087DB20 00000000 */ nop

View file

@ -1,57 +0,0 @@
glabel BgHakaMegane_Init
/* 00000 8087DA40 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0
/* 00004 8087DA44 AFA50024 */ sw $a1, 0x0024($sp)
/* 00008 8087DA48 AFBF001C */ sw $ra, 0x001C($sp)
/* 0000C 8087DA4C AFB00018 */ sw $s0, 0x0018($sp)
/* 00010 8087DA50 3C058088 */ lui $a1, %hi(D_8087DD50) ## $a1 = 80880000
/* 00014 8087DA54 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 00018 8087DA58 0C01E037 */ jal Actor_ProcessInitChain
/* 0001C 8087DA5C 24A5DD50 */ addiu $a1, $a1, %lo(D_8087DD50) ## $a1 = 8087DD50
/* 00020 8087DA60 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00024 8087DA64 0C010D20 */ jal DynaPolyInfo_SetActorMove
/* 00028 8087DA68 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000
/* 0002C 8087DA6C 860E001C */ lh $t6, 0x001C($s0) ## 0000001C
/* 00030 8087DA70 8FA40024 */ lw $a0, 0x0024($sp)
/* 00034 8087DA74 24050069 */ addiu $a1, $zero, 0x0069 ## $a1 = 00000069
/* 00038 8087DA78 29C10003 */ slti $at, $t6, 0x0003
/* 0003C 8087DA7C 5020000A */ beql $at, $zero, .L8087DAA8
/* 00040 8087DA80 3C010001 */ lui $at, 0x0001 ## $at = 00010000
/* 00044 8087DA84 8FA40024 */ lw $a0, 0x0024($sp)
/* 00048 8087DA88 3C010001 */ lui $at, 0x0001 ## $at = 00010000
/* 0004C 8087DA8C 342117A4 */ ori $at, $at, 0x17A4 ## $at = 000117A4
/* 00050 8087DA90 2405008D */ addiu $a1, $zero, 0x008D ## $a1 = 0000008D
/* 00054 8087DA94 0C02604B */ jal Object_GetIndex
## ObjectIndex
/* 00058 8087DA98 00812021 */ addu $a0, $a0, $at
/* 0005C 8087DA9C 10000006 */ beq $zero, $zero, .L8087DAB8
/* 00060 8087DAA0 A2020169 */ sb $v0, 0x0169($s0) ## 00000169
/* 00064 8087DAA4 3C010001 */ lui $at, 0x0001 ## $at = 00010000
.L8087DAA8:
/* 00068 8087DAA8 342117A4 */ ori $at, $at, 0x17A4 ## $at = 000117A4
/* 0006C 8087DAAC 0C02604B */ jal Object_GetIndex
## ObjectIndex
/* 00070 8087DAB0 00812021 */ addu $a0, $a0, $at
/* 00074 8087DAB4 A2020169 */ sb $v0, 0x0169($s0) ## 00000169
.L8087DAB8:
/* 00078 8087DAB8 820F0169 */ lb $t7, 0x0169($s0) ## 00000169
/* 0007C 8087DABC 3C188088 */ lui $t8, %hi(func_8087DB24) ## $t8 = 80880000
/* 00080 8087DAC0 2718DB24 */ addiu $t8, $t8, %lo(func_8087DB24) ## $t8 = 8087DB24
/* 00084 8087DAC4 05E30006 */ bgezl $t7, .L8087DAE0
/* 00088 8087DAC8 AE180164 */ sw $t8, 0x0164($s0) ## 00000164
/* 0008C 8087DACC 0C00B55C */ jal Actor_Kill
/* 00090 8087DAD0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00094 8087DAD4 10000003 */ beq $zero, $zero, .L8087DAE4
/* 00098 8087DAD8 8FBF001C */ lw $ra, 0x001C($sp)
/* 0009C 8087DADC AE180164 */ sw $t8, 0x0164($s0) ## 00000164
.L8087DAE0:
/* 000A0 8087DAE0 8FBF001C */ lw $ra, 0x001C($sp)
.L8087DAE4:
/* 000A4 8087DAE4 8FB00018 */ lw $s0, 0x0018($sp)
/* 000A8 8087DAE8 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000
/* 000AC 8087DAEC 03E00008 */ jr $ra
/* 000B0 8087DAF0 00000000 */ nop

View file

@ -1,12 +0,0 @@
glabel BgHakaMegane_Update
/* 00230 8087DC70 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00234 8087DC74 AFBF0014 */ sw $ra, 0x0014($sp)
/* 00238 8087DC78 8C990164 */ lw $t9, 0x0164($a0) ## 00000164
/* 0023C 8087DC7C 0320F809 */ jalr $ra, $t9
/* 00240 8087DC80 00000000 */ nop
/* 00244 8087DC84 8FBF0014 */ lw $ra, 0x0014($sp)
/* 00248 8087DC88 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 0024C 8087DC8C 03E00008 */ jr $ra
/* 00250 8087DC90 00000000 */ nop

View file

@ -1,34 +0,0 @@
glabel func_8087DBF0
/* 001B0 8087DBF0 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0
/* 001B4 8087DBF4 AFBF001C */ sw $ra, 0x001C($sp)
/* 001B8 8087DBF8 AFB00018 */ sw $s0, 0x0018($sp)
/* 001BC 8087DBFC 90AE1C27 */ lbu $t6, 0x1C27($a1) ## 00001C27
/* 001C0 8087DC00 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000
/* 001C4 8087DC04 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000
/* 001C8 8087DC08 11C0000A */ beq $t6, $zero, .L8087DC34
/* 001CC 8087DC0C 2401FF7F */ addiu $at, $zero, 0xFF7F ## $at = FFFFFF7F
/* 001D0 8087DC10 8C8F0004 */ lw $t7, 0x0004($a0) ## 00000004
/* 001D4 8087DC14 35F80080 */ ori $t8, $t7, 0x0080 ## $t8 = 00000080
/* 001D8 8087DC18 AC980004 */ sw $t8, 0x0004($a0) ## 00000004
/* 001DC 8087DC1C 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 001E0 8087DC20 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810
/* 001E4 8087DC24 0C00FAFE */ jal func_8003EBF8
/* 001E8 8087DC28 8CE6014C */ lw $a2, 0x014C($a3) ## 0000014C
/* 001EC 8087DC2C 10000009 */ beq $zero, $zero, .L8087DC54
/* 001F0 8087DC30 8FBF001C */ lw $ra, 0x001C($sp)
.L8087DC34:
/* 001F4 8087DC34 8CF90004 */ lw $t9, 0x0004($a3) ## 00000004
/* 001F8 8087DC38 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 001FC 8087DC3C 26050810 */ addiu $a1, $s0, 0x0810 ## $a1 = 00000810
/* 00200 8087DC40 03214024 */ and $t0, $t9, $at
/* 00204 8087DC44 ACE80004 */ sw $t0, 0x0004($a3) ## 00000004
/* 00208 8087DC48 0C00FB14 */ jal func_8003EC50
/* 0020C 8087DC4C 8CE6014C */ lw $a2, 0x014C($a3) ## 0000014C
/* 00210 8087DC50 8FBF001C */ lw $ra, 0x001C($sp)
.L8087DC54:
/* 00214 8087DC54 8FB00018 */ lw $s0, 0x0018($sp)
/* 00218 8087DC58 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000
/* 0021C 8087DC5C 03E00008 */ jr $ra
/* 00220 8087DC60 00000000 */ nop

View file

@ -1,6 +0,0 @@
glabel func_8087DC64
/* 00224 8087DC64 AFA40000 */ sw $a0, 0x0000($sp)
/* 00228 8087DC68 03E00008 */ jr $ra
/* 0022C 8087DC6C AFA50004 */ sw $a1, 0x0004($sp)

View file

@ -1,47 +0,0 @@
glabel func_8087DC94
/* 00254 8087DC94 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00258 8087DC98 AFBF0014 */ sw $ra, 0x0014($sp)
/* 0025C 8087DC9C AFA5001C */ sw $a1, 0x001C($sp)
/* 00260 8087DCA0 8C8E0004 */ lw $t6, 0x0004($a0) ## 00000004
/* 00264 8087DCA4 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000
/* 00268 8087DCA8 24010080 */ addiu $at, $zero, 0x0080 ## $at = 00000080
/* 0026C 8087DCAC 31CF0080 */ andi $t7, $t6, 0x0080 ## $t7 = 00000000
/* 00270 8087DCB0 15E1000B */ bne $t7, $at, .L8087DCE0
/* 00274 8087DCB4 8FA4001C */ lw $a0, 0x001C($sp)
/* 00278 8087DCB8 84D8001C */ lh $t8, 0x001C($a2) ## 0000001C
/* 0027C 8087DCBC 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 00280 8087DCC0 3C058088 */ lui $a1, %hi(D_8087DD88) ## $a1 = 80880000
/* 00284 8087DCC4 0018C880 */ sll $t9, $t8, 2
/* 00288 8087DCC8 00B92821 */ addu $a1, $a1, $t9
/* 0028C 8087DCCC 8CA5DD88 */ lw $a1, %lo(D_8087DD88)($a1)
/* 00290 8087DCD0 0C00D4C9 */ jal Draw_DListXlu
/* 00294 8087DCD4 AFA60018 */ sw $a2, 0x0018($sp)
/* 00298 8087DCD8 10000009 */ beq $zero, $zero, .L8087DD00
/* 0029C 8087DCDC 8FAA0018 */ lw $t2, 0x0018($sp)
.L8087DCE0:
/* 002A0 8087DCE0 84C8001C */ lh $t0, 0x001C($a2) ## 0000001C
/* 002A4 8087DCE4 3C058088 */ lui $a1, %hi(D_8087DD88) ## $a1 = 80880000
/* 002A8 8087DCE8 AFA60018 */ sw $a2, 0x0018($sp)
/* 002AC 8087DCEC 00084880 */ sll $t1, $t0, 2
/* 002B0 8087DCF0 00A92821 */ addu $a1, $a1, $t1
/* 002B4 8087DCF4 0C00D498 */ jal Draw_DListOpa
/* 002B8 8087DCF8 8CA5DD88 */ lw $a1, %lo(D_8087DD88)($a1)
/* 002BC 8087DCFC 8FAA0018 */ lw $t2, 0x0018($sp)
.L8087DD00:
/* 002C0 8087DD00 8FA4001C */ lw $a0, 0x001C($sp)
/* 002C4 8087DD04 3C050600 */ lui $a1, 0x0600 ## $a1 = 06000000
/* 002C8 8087DD08 854B001C */ lh $t3, 0x001C($t2) ## 0000001C
/* 002CC 8087DD0C 55600004 */ bnel $t3, $zero, .L8087DD20
/* 002D0 8087DD10 8FBF0014 */ lw $ra, 0x0014($sp)
/* 002D4 8087DD14 0C00D4C9 */ jal Draw_DListXlu
/* 002D8 8087DD18 24A51250 */ addiu $a1, $a1, 0x1250 ## $a1 = 06001250
/* 002DC 8087DD1C 8FBF0014 */ lw $ra, 0x0014($sp)
.L8087DD20:
/* 002E0 8087DD20 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 002E4 8087DD24 03E00008 */ jr $ra
/* 002E8 8087DD28 00000000 */ nop
/* 002EC 8087DD2C 00000000 */ nop

1
spec
View file

@ -866,7 +866,6 @@ 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.data.o"
include "build/data/overlays/actors/z_bg_haka_megane.reloc.o" include "build/data/overlays/actors/z_bg_haka_megane.reloc.o"
endseg endseg

View file

@ -7,7 +7,11 @@ void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx);
void BgHakaMegane_Destroy(BgHakaMegane* this, GlobalContext* globalCtx); void BgHakaMegane_Destroy(BgHakaMegane* this, GlobalContext* globalCtx);
void BgHakaMegane_Update(BgHakaMegane* this, GlobalContext* globalCtx); void BgHakaMegane_Update(BgHakaMegane* this, GlobalContext* globalCtx);
/* void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx);
void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx);
void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx);
void func_8087DC94(BgHakaMegane* this, GlobalContext* globalCtx);
const ActorInit Bg_Haka_Megane_InitVars = const ActorInit Bg_Haka_Megane_InitVars =
{ {
ACTOR_BG_HAKA_MEGANE, ACTOR_BG_HAKA_MEGANE,
@ -21,17 +25,97 @@ const ActorInit Bg_Haka_Megane_InitVars =
(ActorFunc)BgHakaMegane_Update, (ActorFunc)BgHakaMegane_Update,
NULL, NULL,
}; };
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Megane/BgHakaMegane_Init.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Megane/BgHakaMegane_Destroy.s") InitChainEntry initChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Megane/func_8087DB24.s") UNK_TYPE D_8087DD54[] = {
0x06001830, 0x06001AB8, 0x00000000, 0x06004330, 0x060044D0, 0x00000000, 0x06004780,
0x06004940, 0x00000000, 0x06004B00, 0x00000000, 0x06004CC0, 0x00000000,
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Megane/func_8087DBF0.s") UNK_TYPE D_8087DD88[] = {
0x06001060, 0x06001920, 0x060003F0, 0x060040F0, 0x060043B0, 0x06001120, 0x060045A0,
0x060047F0, 0x060018F0, 0x060049B0, 0x06003CF0, 0x06004B70, 0x06002ED0, 0x00000000,
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Megane/func_8087DC64.s") extern UNK_TYPE D_06001250;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Megane/BgHakaMegane_Update.s") void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Megane/func_8087DC94.s") Actor_ProcessInitChain(thisx, initChain);
DynaPolyInfo_SetActorMove(thisx, 0);
if (thisx->params < 3) {
this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_HAKACH_OBJECTS);
} else {
this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_HAKA_OBJECTS);
}
if (this->objBankIndex < 0) {
Actor_Kill(thisx);
} else {
this->actionFunc = (ActorFunc)func_8087DB24;
}
}
void BgHakaMegane_Destroy(BgHakaMegane* this, GlobalContext* globalCtx) {
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
}
void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor;
s32 local_c;
u32 collision;
if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) {
thisx->draw = (ActorFunc)func_8087DC94;
thisx->objBankIndex = this->objBankIndex;
Actor_SetObjectDependency(globalCtx, thisx);
if (globalCtx->roomCtx.curRoom.showInvisActors) {
this->actionFunc = (ActorFunc)func_8087DBF0;
collision = D_8087DD54[thisx->params];
if (collision != 0) {
DynaPolyInfo_Alloc(&collision, &local_c);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c);
}
} else {
this->actionFunc = (ActorFunc)func_8087DC64;
}
}
}
void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor;
if (globalCtx->actorCtx.unk_03 != 0) {
thisx->flags |= 0x80;
func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
} else {
thisx->flags &= -0x81;
func_8003EC50(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
}
}
void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx) {
}
void BgHakaMegane_Update(BgHakaMegane* this, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
}
void func_8087DC94(BgHakaMegane* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor;
if ((thisx->flags & 0x80) == 0x80) {
Draw_DListXlu(globalCtx, D_8087DD88[thisx->params]);
} else {
Draw_DListOpa(globalCtx, D_8087DD88[thisx->params]);
}
if (thisx->params == 0) {
Draw_DListXlu(globalCtx, &D_06001250);
}
}

View file

@ -5,8 +5,11 @@
#include <global.h> #include <global.h>
typedef struct { typedef struct {
/* 0x0000 */ Actor actor; /* 0x0000 */ DynaPolyActor dyna;
/* 0x014C */ char unk_14C[0x20]; /* 0x0164 */ ActorFunc actionFunc;
/* 0x0168 */ char unk_168[0x1];
/* 0x0169 */ s8 objBankIndex;
/* 0x016A */ char unk_16A[0x2];
} BgHakaMegane; // size = 0x016C } BgHakaMegane; // size = 0x016C
extern const ActorInit Bg_Haka_Megane_InitVars; extern const ActorInit Bg_Haka_Megane_InitVars;

View file

@ -258,6 +258,9 @@ D_060003C0 = 0x060003C0;
D_060030A0 = 0x060030A0; D_060030A0 = 0x060030A0;
D_06003158 = 0x06003158; D_06003158 = 0x06003158;
// z_bg_haka_megane
D_06001250 = 0x06001250;
// z_bg_haka_meganebg // z_bg_haka_meganebg
D_06005334 = 0x06005334; D_06005334 = 0x06005334;
D_06009168 = 0x06009168; D_06009168 = 0x06009168;