mirror of
https://github.com/zeldaret/tmc
synced 2026-09-07 03:19:39 -04:00
merge changes from master
This commit is contained in:
+5
-1
@@ -157,6 +157,9 @@ void PlayerUpdate(Entity* this) {
|
||||
}
|
||||
|
||||
// Responsible for some life things like low health beep and initiating the death sequence
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/HandlePlayerLife.inc", void HandlePlayerLife(Entity* this));
|
||||
#else
|
||||
void HandlePlayerLife(Entity* this) {
|
||||
u32 temp;
|
||||
|
||||
@@ -227,6 +230,7 @@ void HandlePlayerLife(Entity* this) {
|
||||
CreateFx(this, 0x55 + gSave.stats.effect, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_080171F0(void) {
|
||||
if (gPlayerState.field_0x1a[0] != 0)
|
||||
@@ -345,7 +349,7 @@ void ManagerUpdate(Entity* this) {
|
||||
}
|
||||
|
||||
// regalloc
|
||||
NONMATCH("asm/non_matching/arm_proxy/sub_08017530.inc", void NPCUpdate(Entity* this)) {
|
||||
NONMATCH("asm/non_matching/arm_proxy/NPCUpdate.inc", void NPCUpdate(Entity* this)) {
|
||||
if ((this->currentHealth & 0x7f) && !ReadBit(&gUnk_020342F8, this->currentHealth - 1))
|
||||
DeleteThisEntity();
|
||||
if ((this->action == 0) && ((this->flags & 1) == 0))
|
||||
|
||||
+10
@@ -24,7 +24,9 @@ void InitSoundPlayingInfo(void) {
|
||||
InitVolume();
|
||||
gSoundPlayingInfo.volumeSfx = 0x100;
|
||||
gSoundPlayingInfo.unk_04 = 0x100;
|
||||
#ifndef EU
|
||||
m4aMPlayAllStop();
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetMasterVolume(u32 volume) {
|
||||
@@ -933,7 +935,11 @@ const Song gSongTable[] = {
|
||||
[SFX_RUPEE_GET] = { &sfxRupeeGet, MUSIC_PLAYER_00, MUSIC_PLAYER_00 },
|
||||
[SFX_HEART_BOUNCE] = { &sfxHeartBounce, MUSIC_PLAYER_12, MUSIC_PLAYER_12 },
|
||||
[SFX_HEART_GET] = { &sfxHeartGet, MUSIC_PLAYER_00, MUSIC_PLAYER_00 },
|
||||
#ifdef EU
|
||||
[SFX_SECRET] = { &sfxSecret, MUSIC_PLAYER_10, MUSIC_PLAYER_10 },
|
||||
#else
|
||||
[SFX_SECRET] = { &sfxSecret, MUSIC_PLAYER_03, MUSIC_PLAYER_03 },
|
||||
#endif
|
||||
[SFX_SECRET_BIG] = { &sfxSecretBig, MUSIC_PLAYER_03, MUSIC_PLAYER_03 },
|
||||
[SFX_METAL_CLINK] = { &sfxMetalClink, MUSIC_PLAYER_0E, MUSIC_PLAYER_0E },
|
||||
[SFX_PLY_VO1] = { &sfxPlyVo1, MUSIC_PLAYER_PLY_VO, MUSIC_PLAYER_PLY_VO },
|
||||
@@ -1024,7 +1030,11 @@ const Song gSongTable[] = {
|
||||
[SFX_CA] = { &sfxCA, MUSIC_PLAYER_0E, MUSIC_PLAYER_0E },
|
||||
[SFX_CB] = { &sfxCB, MUSIC_PLAYER_0F, MUSIC_PLAYER_0F },
|
||||
[SFX_REM_SLEEP] = { &sfxRemSleep, MUSIC_PLAYER_10, MUSIC_PLAYER_10 },
|
||||
#ifdef EU
|
||||
[SFX_TASK_COMPLETE] = { &sfxTaskComplete, MUSIC_PLAYER_17, MUSIC_PLAYER_17 },
|
||||
#else
|
||||
[SFX_TASK_COMPLETE] = { &sfxTaskComplete, MUSIC_PLAYER_03, MUSIC_PLAYER_03 },
|
||||
#endif
|
||||
[SFX_KEY_APPEAR] = { &sfxKeyAppear, MUSIC_PLAYER_16, MUSIC_PLAYER_16 },
|
||||
[SFX_CF] = { &sfxCF, MUSIC_PLAYER_11, MUSIC_PLAYER_11 },
|
||||
[SFX_D0] = { &sfxD0, MUSIC_PLAYER_12, MUSIC_PLAYER_12 },
|
||||
|
||||
+38
-28
@@ -2,6 +2,8 @@
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "menu.h"
|
||||
#include "area.h"
|
||||
#include "utils.h"
|
||||
|
||||
typedef struct {
|
||||
u8 filler[0xa8];
|
||||
@@ -29,23 +31,32 @@ extern u8 gUnk_080FE1C6[];
|
||||
extern u32 gUnk_02034398;
|
||||
extern void (*const gUnk_080FE2A0[])();
|
||||
|
||||
void ForceEquipItem(u32, u8);
|
||||
extern void sub_0807CAA0(u32, u32);
|
||||
|
||||
/*
|
||||
Returns the slot the item is equipped in.
|
||||
0: A
|
||||
1: B
|
||||
2: Not equipped
|
||||
*/
|
||||
u32 IsItemEquipped(u32 itemID) {
|
||||
u32 ret;
|
||||
u32 itemSlot;
|
||||
|
||||
if (itemID == gSave.stats.itemOnA)
|
||||
ret = 0;
|
||||
itemSlot = 0;
|
||||
else if (itemID == gSave.stats.itemOnB)
|
||||
ret = 1;
|
||||
itemSlot = 1;
|
||||
else
|
||||
ret = 2;
|
||||
return ret;
|
||||
itemSlot = 2;
|
||||
return itemSlot;
|
||||
}
|
||||
|
||||
#if NON_MATCHING // reg-alloc
|
||||
void PutItemOnSlot(u32 itemID) {
|
||||
NONMATCH("asm/non_matching/PutItemOnSlot.inc", void PutItemOnSlot(u32 itemID)) {
|
||||
// reg-alloc
|
||||
u32 itemSlot;
|
||||
if (itemID < 0x47) {
|
||||
ModifyInventory(0, 1);
|
||||
sub_0807CAA0(0, 1);
|
||||
}
|
||||
if (itemID - 1 < 0x1f) {
|
||||
itemSlot = 2;
|
||||
@@ -70,12 +81,9 @@ void PutItemOnSlot(u32 itemID) {
|
||||
ForceEquipItem(itemID, itemSlot);
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void PutItemOnSlot(u32 itemID) {
|
||||
asm(".include \"asm/non_matching/putItemOnSlot.s\"");
|
||||
}
|
||||
#endif
|
||||
END_NONMATCH
|
||||
|
||||
ASM_FUNC("asm/non_matching/ForceEquipItem.inc", void ForceEquipItem(u32 itemID, u8 itemSlot))
|
||||
|
||||
u32 SetBottleContents(u32 itemID, u32 bottleIndex) {
|
||||
|
||||
@@ -146,8 +154,8 @@ u32 GetBottleContaining(u32 arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
#if NON_MATCHING // reg-alloc
|
||||
void sub_08054524(void) {
|
||||
NONMATCH("asm/non_matching/sub_08054524.inc", void sub_08054524(void)) {
|
||||
// reg-alloc
|
||||
u32 bVar1;
|
||||
|
||||
bVar1 = gArea.locationIndex;
|
||||
@@ -160,26 +168,26 @@ void sub_08054524(void) {
|
||||
|
||||
MemCopy(&gUnk_080015BC + gUnk_080FE1C6[bVar1] * 0x8, &gUnk_02034398, 0x20);
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_08054524(void) {
|
||||
asm(".include \"asm/non_matching/sub_08054524.inc\"");
|
||||
}
|
||||
#endif
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08054564(void) {
|
||||
gRoomVars.filler[2] = 1;
|
||||
gRoomVars.field_0x2 = 1;
|
||||
}
|
||||
|
||||
void sub_08054570(void) {
|
||||
gRoomVars.filler[2] = 0;
|
||||
gRoomVars.field_0x2 = 0;
|
||||
}
|
||||
|
||||
NAKED
|
||||
u32 sub_0805457C(u32 arg0, u32 arg1) {
|
||||
asm(".include \"asm/non_matching/code_0805457C.inc\"");
|
||||
}
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/sub_0805457C.inc", u32 sub_0805457C(u32 arg0, u32 arg1));
|
||||
#else
|
||||
ASM_FUNC("asm/non_matching/sub_0805457C.inc", u32 sub_0805457C(u32 arg0, u32 arg1));
|
||||
#endif
|
||||
|
||||
NONMATCH("asm/non_matching/CreateItemDrop.inc", u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter)) {
|
||||
// TODO see below
|
||||
}
|
||||
END_NONMATCH
|
||||
/*
|
||||
extern u8 gUnk_080FE1DD[];
|
||||
|
||||
@@ -267,5 +275,7 @@ u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter) {
|
||||
*/
|
||||
|
||||
void sub_08054870(void) {
|
||||
#ifndef DEMO
|
||||
gUnk_080FE2A0[gMenu.menuType]();
|
||||
#endif
|
||||
}
|
||||
|
||||
+1
-44
@@ -44,50 +44,7 @@ void sub_0805EC60(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
NAKED
|
||||
bool32 sub_0805EC9C(Entity* ent, u32 param_2, u32 param_3, u32 param_4) {
|
||||
asm_unified("\
|
||||
push {r4, r5, r6, r7, lr} \n\
|
||||
adds r4, r0, #0 \n\
|
||||
adds r5, r1, #0 \n\
|
||||
adds r6, r2, #0 \n\
|
||||
adds r7, r3, #0 \n\
|
||||
ldrb r0, [r4, #0x1b] \n\
|
||||
lsls r0, r0, #0x1a \n\
|
||||
lsrs r0, r0, #0x1b \n\
|
||||
cmp r0, #0 \n\
|
||||
bne _0805ECBE \n\
|
||||
adds r0, r4, #0 \n\
|
||||
bl sub_0805EC04 \n\
|
||||
cmp r0, #0 \n\
|
||||
bne _0805ECBE \n\
|
||||
movs r0, #0 \n\
|
||||
b _0805ECE0 \n\
|
||||
_0805ECBE: \n\
|
||||
ldr r1, _0805ECE4 @ =gUnk_03000000 \n\
|
||||
ldr r0, _0805ECE8 @ =0x00000427 \n\
|
||||
adds r2, r1, r0 \n\
|
||||
movs r0, #1 \n\
|
||||
strb r0, [r2] \n\
|
||||
ldrb r0, [r4, #0x1b] \n\
|
||||
lsls r0, r0, #0x1a \n\
|
||||
lsrs r0, r0, #0x1b \n\
|
||||
lsls r0, r0, #3 \n\
|
||||
movs r2, #0x84 \n\
|
||||
lsls r2, r2, #3 \n\
|
||||
adds r1, r1, r2 \n\
|
||||
adds r0, r0, r1 \n\
|
||||
strh r5, [r0] \n\
|
||||
strh r6, [r0, #2] \n\
|
||||
strh r7, [r0, #4] \n\
|
||||
movs r0, #1 \n\
|
||||
_0805ECE0: \n\
|
||||
pop {r4, r5, r6, r7, pc} \n\
|
||||
.align 2, 0 \n\
|
||||
_0805ECE4: .4byte gUnk_03000000 \n\
|
||||
_0805ECE8: .4byte 0x00000427 \n\
|
||||
");
|
||||
}
|
||||
ASM_FUNC("asm/non_matching/sub_0805EC9C.inc", bool32 sub_0805EC9C(Entity* ent, u32 param_2, u32 param_3, u32 param_4))
|
||||
|
||||
void sub_0805ECEC(int param_1, u32 param_2, u32 param_3, u32 param_4) {
|
||||
u16* temp;
|
||||
|
||||
+1
-1
@@ -4,8 +4,8 @@
|
||||
#include "functions.h"
|
||||
|
||||
extern u16 gUnk_081092D4;
|
||||
extern u8 gUnk_02036AD8;
|
||||
extern u8 gUnk_081094CE;
|
||||
extern u8 gUnk_02036AD8;
|
||||
extern u8 gUnk_02036A58;
|
||||
extern void* gUnk_081092AC[];
|
||||
|
||||
|
||||
+3
-5
@@ -25,7 +25,8 @@ void sub_08077B98(UnkItemStruct* unk) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08077BB8(UnkItemStruct* unk) {
|
||||
void sub_08077BB8(ItemBehavior* beh) {
|
||||
UnkItemStruct* unk = (UnkItemStruct*)beh; // @nocheckin
|
||||
u8* temp = sub_08077C54(unk);
|
||||
if (temp != NULL) {
|
||||
temp[0x10] = 0x20;
|
||||
@@ -121,7 +122,4 @@ Entity* sub_08077CF8(u32 subtype, u32 form, u32 parameter, u32 unk) {
|
||||
return ent;
|
||||
}
|
||||
|
||||
NAKED
|
||||
void sub_08077D38(ItemBehavior* beh, u32 arg1) {
|
||||
asm(".include \"asm/non_matching/sub_08077D38.inc\"");
|
||||
}
|
||||
ASM_FUNC("asm/non_matching/sub_08077D38.inc", void sub_08077D38(ItemBehavior* beh, u32 arg1))
|
||||
|
||||
+17
-17
@@ -14,34 +14,36 @@ typedef struct {
|
||||
u8 unk[16];
|
||||
} Unk_struct;
|
||||
|
||||
void sub_08077DF4(Entity* ent, u32 arg1) {
|
||||
void sub_08077DF4(ItemBehavior* beh, u32 arg1) {
|
||||
Entity* ent = (Entity*)beh; // @nocheckin
|
||||
*(u16*)&ent->flags = arg1;
|
||||
if ((arg1 & 0xff) > 0xb8) {
|
||||
arg1 += ent->type >> 1;
|
||||
}
|
||||
gPlayerEntity.spriteIndex = (short)(arg1 >> 8);
|
||||
InitAnimationForceUpdate(&gPlayerEntity, (u8)arg1);
|
||||
sub_08077E54(ent);
|
||||
sub_08077E54(beh);
|
||||
}
|
||||
|
||||
void UpdateItemAnim(Entity* ent) {
|
||||
void UpdateItemAnim(ItemBehavior* beh) {
|
||||
UpdateAnimationSingleFrame(&gPlayerEntity);
|
||||
sub_08077E54(ent);
|
||||
sub_08077E54(beh);
|
||||
}
|
||||
|
||||
void sub_08077E3C(Entity* ent, u32 idx) {
|
||||
void sub_08077E3C(ItemBehavior* ent, u32 idx) {
|
||||
sub_080042BA(&gPlayerEntity, idx);
|
||||
sub_08077E54(ent);
|
||||
}
|
||||
|
||||
void sub_08077E54(Entity* ent) {
|
||||
void sub_08077E54(ItemBehavior* beh) {
|
||||
Entity* ent = (Entity*)beh; // @nocheckin
|
||||
ent->action = gPlayerEntity.animIndex;
|
||||
*(u8*)&ent->spriteIndex = gPlayerEntity.frameIndex;
|
||||
ent->subAction = gPlayerEntity.frameDuration;
|
||||
ent->actionDelay = gPlayerEntity.frames.all;
|
||||
}
|
||||
|
||||
void sub_08077E78(void* arg0, u32 bits) {
|
||||
void sub_08077E78(ItemBehavior* arg0, u32 bits) {
|
||||
u8* pbVar1;
|
||||
u32 not ;
|
||||
|
||||
@@ -62,10 +64,11 @@ void sub_08077E78(void* arg0, u32 bits) {
|
||||
MemClear(arg0, 0x1c);
|
||||
}
|
||||
|
||||
u32 sub_08077EC8(Unk_struct* arg0) {
|
||||
u32 sub_08077EC8(ItemBehavior* beh) {
|
||||
Unk_struct* arg0 = (Unk_struct*)beh; // @nocheckin
|
||||
|
||||
if ((gPlayerState.field_0x1a[1] & 8) != 0) {
|
||||
sub_08077DF4((Entity*)arg0, 0x170);
|
||||
sub_08077DF4(beh, 0x170);
|
||||
arg0->unk[7] = 0x28;
|
||||
arg0->unk[4] = 7;
|
||||
arg0->unk[15] = 6;
|
||||
@@ -75,18 +78,15 @@ u32 sub_08077EC8(Unk_struct* arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08077EFC(ItemBehavior* arg0) {
|
||||
sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.LO);
|
||||
bool32 sub_08077EFC(ItemBehavior* arg0) {
|
||||
return sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.LO);
|
||||
}
|
||||
|
||||
void sub_08077F10(ItemBehavior* arg0) {
|
||||
sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.HI);
|
||||
bool32 sub_08077F10(ItemBehavior* arg0) {
|
||||
return sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.HI);
|
||||
}
|
||||
|
||||
NAKED
|
||||
void sub_08077F24(ItemBehavior* beh, u32 arg1) {
|
||||
asm(".include \"asm/non_matching/sub_08077F24.inc\"");
|
||||
}
|
||||
ASM_FUNC("asm/non_matching/sub_08077F24.inc", bool32 sub_08077F24(ItemBehavior* beh, u32 arg1))
|
||||
|
||||
void sub_08077F50(ItemBehavior* beh, u32 arg1) {
|
||||
sub_08079184();
|
||||
|
||||
+3
-9
@@ -6,14 +6,8 @@
|
||||
#include "save.h"
|
||||
|
||||
// these three functions use gRoomControls, maybe once that is understood better, these can be decompiled easier
|
||||
NONMATCH("asm/non_matching/code_0807CC3C/sub_0807D280.inc", void sub_0807D280(u32 unk_1, u32 unk_2)) {
|
||||
}
|
||||
END_NONMATCH
|
||||
ASM_FUNC("asm/non_matching/code_0807CC3C/sub_0807D280.inc", void sub_0807D280(u32 unk_1, u32 unk_2))
|
||||
|
||||
NONMATCH("asm/non_matching/code_0807CC3C/sub_0807D46C.inc", void sub_0807D46C(u32 unk_1, u32 unk_2)) {
|
||||
}
|
||||
END_NONMATCH
|
||||
ASM_FUNC("asm/non_matching/code_0807CC3C/sub_0807D46C.inc", void sub_0807D46C(u32 unk_1, u32 unk_2))
|
||||
|
||||
NONMATCH("asm/non_matching/code_0807CC3C/sub_0807D6D8.inc", void sub_0807D6D8(u32 unk_1, u32 unk_2)) {
|
||||
}
|
||||
END_NONMATCH
|
||||
ASM_FUNC("asm/non_matching/code_0807CC3C/sub_0807D6D8.inc", void sub_0807D6D8(u32 unk_1, u32 unk_2))
|
||||
|
||||
+1
-3
@@ -10,8 +10,6 @@ extern u32 gUnk_0200B650;
|
||||
extern u32 gUnk_02025EB0;
|
||||
extern u8 gUnk_02000070;
|
||||
|
||||
extern void DoExitTransition(ScreenTransitionData*);
|
||||
|
||||
void sub_080808D8(void) {
|
||||
gScreenTransition.transitionType = 0;
|
||||
}
|
||||
@@ -44,7 +42,7 @@ void sub_08080930(void)
|
||||
gRoomControls.unk3 = 5;
|
||||
gRoomControls.unk4 = 0;
|
||||
gRoomControls.unk2 = 2;
|
||||
gRoomControls.filler[0] = 0;
|
||||
gRoomControls.unk_10 = 0;
|
||||
sub_0805E5A8();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
#include "room.h"
|
||||
#include "object.h"
|
||||
|
||||
void sub_080A29BC(Entity* parent) { // TODO this is CreateDust, why is it here again? Fogot to delete file?
|
||||
CreateFx(parent, 2, 0);
|
||||
}
|
||||
|
||||
void sub_080A29C8(s32 xOff, s32 yOff, u32 layer) {
|
||||
Entity* pEVar1;
|
||||
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
#include "global.h"
|
||||
#include "functions.h"
|
||||
#include "main.h"
|
||||
#include "utils.h"
|
||||
#include "textbox.h"
|
||||
#include "fileScreen.h"
|
||||
#include "screen.h"
|
||||
|
||||
extern void (*const demoFunctions[])(void);
|
||||
void sub_080A30AC();
|
||||
|
||||
extern u8 gUnk_02000004;
|
||||
void sub_080A3198(u32, u32);
|
||||
|
||||
extern u8 gUnk_02017760[];
|
||||
extern u8 gUnk_08A05751[];
|
||||
|
||||
// sprite_table
|
||||
extern void gUnk_089FD1B4;
|
||||
extern void gUnk_089FD2F4;
|
||||
|
||||
extern u8 gUnk_02000006;
|
||||
|
||||
void HandleChooseDemoScreen(void) {
|
||||
FlushSprites();
|
||||
demoFunctions[gMain.funcIndex]();
|
||||
sub_080A30AC();
|
||||
sub_080AD918();
|
||||
}
|
||||
|
||||
void sub_080A2E40(void) {
|
||||
DispReset(1);
|
||||
InitSoundPlayingInfo();
|
||||
MemClear((void*)0x6000000, 0x80);
|
||||
MessageInitialize();
|
||||
EraseAllEntities();
|
||||
sub_080ADD30();
|
||||
sub_0801CFA8(0);
|
||||
MemClear(&gUnk_02032EC0, 0x3b4);
|
||||
MemClear(&gChooseFileState, 0x30);
|
||||
MemClear(&gBG0Buffer, 0x800);
|
||||
sub_08053320();
|
||||
LoadPaletteGroup(0xb5);
|
||||
LoadGfxGroup(0x56);
|
||||
MemCopy(&gUnk_089FD1B4, &gUnk_02017760[0], 0x100);
|
||||
MemCopy(&gUnk_089FD1B4, &gUnk_02017760[0x200], 0x100);
|
||||
MemCopy(&gUnk_089FD2F4, (void*)0x6000000, 0x8000);
|
||||
MemCopy(&gUnk_089FD2F4, (void*)0x6010000, 0x8000);
|
||||
MemCopy(&gUnk_08A05751, &gBG1Buffer, 0x800);
|
||||
MemCopy(&gUnk_08A05751[0x800], &gBG2Buffer, 0x800);
|
||||
gScreen.lcd.displayControl = 0x1f00;
|
||||
gScreen.bg.bg1Control = 0x1c81;
|
||||
gScreen.affine.bg2Control = 0x1d82;
|
||||
gScreen.affine.bg3Control = 0x1e0b;
|
||||
gScreen.bg.bg1Updated = 1;
|
||||
gScreen.affine.bg2Updated = 1;
|
||||
gScreen.affine.bg3Updated = 1;
|
||||
gScreen.controls.layerFXControl = 0x1044;
|
||||
gScreen.controls.alphaBlend = 0xb04;
|
||||
{
|
||||
// TODO write to 0x2000004
|
||||
u32 addr = (0x80 << 0x12);
|
||||
*(u8*)(addr + 4) = 0;
|
||||
}
|
||||
sub_080A3198(0, 0);
|
||||
gMain.funcIndex = 1;
|
||||
SoundReq(BGM_FILE_SELECT);
|
||||
DoFade(4, 8);
|
||||
}
|
||||
|
||||
void sub_080A2F8C(void) {
|
||||
if (gFadeControl.active == 0) {
|
||||
switch (gMain.transition) {
|
||||
case 0:
|
||||
gMain.transition = 1;
|
||||
{
|
||||
// TODO write to 0x2000005
|
||||
u32 addr = (0x80 << 0x12);
|
||||
*(u8*)(addr + 5) = 1;
|
||||
*(u8*)(addr + 6) = 1;
|
||||
}
|
||||
gMain.funcIndex = 2;
|
||||
DoFade(5, 8);
|
||||
break;
|
||||
case 1:
|
||||
InitScreen(2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/demoScreen/sub_080A2FD0.inc", void sub_080A2FD0(void))
|
||||
|
||||
ASM_FUNC("asm/non_matching/demoScreen/sub_080A30AC.inc", void sub_080A30AC(void))
|
||||
|
||||
ASM_FUNC("asm/non_matching/demoScreen/sub_080A3198.inc", void sub_080A3198(u32 param_1, u32 param_2))
|
||||
@@ -1,6 +1,10 @@
|
||||
#include "global.h"
|
||||
#include "gba/eeprom.h"
|
||||
|
||||
#ifdef DEMO
|
||||
const u8 unk[] = { 0xff, 0xff, 0xff, 0xff };
|
||||
const u8 padding[0x18] = {};
|
||||
#else
|
||||
typedef struct EEPROMConfig {
|
||||
u32 unk_00;
|
||||
u16 size;
|
||||
@@ -248,3 +252,5 @@ u16 EEPROMWrite0_8k_Check(u16 address, const u16* data) {
|
||||
}
|
||||
|
||||
const char thing[0x1c] = "\xff\xff\xff\xff";
|
||||
|
||||
#endif
|
||||
|
||||
+4
-4
@@ -4,7 +4,7 @@
|
||||
|
||||
// clang-format off
|
||||
void (*const gEnemyFunctions[])(Entity* ent) = {
|
||||
[OCTOROCK] = Octorok,
|
||||
[OCTOROK] = Octorok,
|
||||
[CHUCHU] = Chuchu,
|
||||
[LEEVER] = Leever,
|
||||
[PEAHAT] = Peahat,
|
||||
@@ -61,10 +61,10 @@ void (*const gEnemyFunctions[])(Entity* ent) = {
|
||||
[MAZAAL_HEAD] = MazaalHead,
|
||||
[MAZAAL_MACRO] = MazaalMacro,
|
||||
[MAZAAL_HAND] = MazaalHand,
|
||||
[OCTOROCK_BOSS] = OctorokBoss,
|
||||
[OCTOROK_BOSS] = OctorokBoss,
|
||||
[FLYING_POT] = FlyingPot,
|
||||
[GOBDO] = Gibdo,
|
||||
[OCTOROCK_GOLDEN] = OctorokGolden,
|
||||
[OCTOROK_GOLDEN] = OctorokGolden,
|
||||
[TEKTITE_GOLDEN] = TektiteGolden,
|
||||
[ROPE_GOLDEN] = RopeGolden,
|
||||
[CLOUD_PIRANHA] = CloudPiranha,
|
||||
@@ -89,7 +89,7 @@ void (*const gEnemyFunctions[])(Entity* ent) = {
|
||||
[VAATI_ARM] = VaatiArm,
|
||||
[DUST] = Dust,
|
||||
[VAATI_BALL] = VaatiBall,
|
||||
[OCTOROCK2] = Octorok,
|
||||
[OCTOROK2] = Octorok,
|
||||
[SLIME] = Slime,
|
||||
[MINI_SLIME] = MiniSlime,
|
||||
[FIREBALL_GUY] = FireballGuy,
|
||||
|
||||
+49
-8
@@ -105,14 +105,19 @@ void sub_0802A924(Entity* this) {
|
||||
this->actionDelay = 0;
|
||||
this->field_0xf = 0;
|
||||
this->hitbox = (Hitbox*)&gUnk_080CD16C;
|
||||
#ifdef EU
|
||||
this->field_0x3c |= 0x10;
|
||||
#endif
|
||||
this->height.HALF.HI = -0x30;
|
||||
this->field_0x80.HALF.LO = Random() & 1;
|
||||
this->field_0x82.HWORD = 0;
|
||||
this->field_0x7a.HALF.HI = 0;
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
this->field_0x7a.HALF.LO = 0;
|
||||
#ifndef EU
|
||||
this->field_0x78.HALF.LO = 0;
|
||||
this->field_0x78.HALF.HI = 0;
|
||||
#endif
|
||||
this->collisionLayer = 3;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
this->spriteRendering.b3 = 1;
|
||||
@@ -183,6 +188,9 @@ void sub_0802AA40(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/sub_0802AAC0.inc", void sub_0802AAC0(Entity* this))
|
||||
#else
|
||||
void sub_0802AAC0(Entity* this) {
|
||||
sub_0802AC40(this);
|
||||
if (--this->field_0xf == 0) {
|
||||
@@ -210,7 +218,11 @@ void sub_0802AAC0(Entity* this) {
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/sub_0802AB40.inc", void sub_0802AB40(Entity* this));
|
||||
#else
|
||||
void sub_0802AB40(Entity* this) {
|
||||
sub_0802AC40(this);
|
||||
switch (this->field_0x78.HALF.LO) {
|
||||
@@ -249,6 +261,7 @@ void sub_0802AB40(Entity* this) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_0802AC08(Entity* this) {
|
||||
if (this->frames.all & 0x80) {
|
||||
@@ -262,6 +275,9 @@ void sub_0802AC08(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/sub_0802AC40.inc", void sub_0802AC40(Entity* this))
|
||||
#else
|
||||
void sub_0802AC40(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_0806F69C(this);
|
||||
@@ -291,6 +307,7 @@ void sub_0802AC40(Entity* this) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_0802ACDC(Entity* this, u32 param_2) {
|
||||
u32 x;
|
||||
@@ -339,6 +356,10 @@ void sub_0802AD54(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef EU
|
||||
// TODO regalloc in EU version
|
||||
ASM_FUNC("asm/non_matching/eu/sub_0802ADDC.inc", void sub_0802ADDC(Entity* this))
|
||||
#else
|
||||
void sub_0802ADDC(Entity* this) {
|
||||
Entity* ent = CreateEnemy(BOMB_PEAHAT, this->type + 2);
|
||||
if (ent != NULL) {
|
||||
@@ -346,12 +367,16 @@ void sub_0802ADDC(Entity* this) {
|
||||
ent->parent = this;
|
||||
this->attachedEntity = ent;
|
||||
CopyPosition(this, ent);
|
||||
/*#ifdef EU
|
||||
this->height.HALF.HI += 8;
|
||||
#endif*/
|
||||
this->field_0x80.HALF.HI = 1;
|
||||
if (this->type == 0) {
|
||||
this->field_0x7a.HALF.LO++;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_0802AE24(Entity* this) {
|
||||
this->action = 1;
|
||||
@@ -366,6 +391,9 @@ void sub_0802AE24(Entity* this) {
|
||||
InitializeAnimation(this, 3);
|
||||
}
|
||||
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/sub_0802AE68.inc", void sub_0802AE68(Entity* this))
|
||||
#else
|
||||
void sub_0802AE68(Entity* this) {
|
||||
Entity* ent = sub_0802B250(this);
|
||||
if (ent == 0) {
|
||||
@@ -383,6 +411,7 @@ void sub_0802AE68(Entity* this) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_0802AEBC(Entity* this) {
|
||||
gUnk_080CD158[this->subAction](this);
|
||||
@@ -444,8 +473,7 @@ void sub_0802AF9C(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
#if NON_MATCHING
|
||||
void sub_0802AFC8(Entity* this) {
|
||||
NONMATCH("asm/non_matching/bombPeahat/sub_0802AFC8.inc", void sub_0802AFC8(Entity* this)) {
|
||||
u32 flag = 8;
|
||||
if (this->field_0xf < 0x29) {
|
||||
u32 tmp;
|
||||
@@ -470,12 +498,7 @@ void sub_0802AFC8(Entity* this) {
|
||||
this->palette.b.b0 = this->palette.b.b4;
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_0802AFC8(Entity* this) {
|
||||
asm(".include \"asm/non_matching/bombPeahat/sub_0802AFC8.inc\"");
|
||||
}
|
||||
#endif
|
||||
END_NONMATCH
|
||||
|
||||
void sub_0802B048(Entity* this) {
|
||||
Entity* ent;
|
||||
@@ -545,6 +568,9 @@ void sub_0802B1A0(Entity* this) {
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/sub_0802B1BC.inc", void sub_0802B1BC(Entity* this))
|
||||
#else
|
||||
void sub_0802B1BC(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
@@ -565,6 +591,7 @@ void sub_0802B1BC(Entity* this) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_0802B204(Entity* this) {
|
||||
if (sub_080044EC(this, 0x2800) == 1) {
|
||||
@@ -584,6 +611,7 @@ bool32 sub_0802B234(Entity* this) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifndef EU
|
||||
Entity* sub_0802B250(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
if (parent && parent->next == NULL) {
|
||||
@@ -602,6 +630,7 @@ void sub_0802B264(Entity* this) {
|
||||
}
|
||||
GetNextFrame(this);
|
||||
}
|
||||
#endif
|
||||
|
||||
// clang-format off
|
||||
void (*const gUnk_080CD0F0[])(Entity*) = {
|
||||
@@ -654,14 +683,26 @@ void (*const gUnk_080CD158[])(Entity*) = {
|
||||
};
|
||||
|
||||
const Hitbox gUnk_080CD16C = {
|
||||
#ifdef EU
|
||||
0x00, 0xFD, 0x05, 0x03, 0x03, 0x05, 0x06, 0x06,
|
||||
#else
|
||||
0x00, 0xFB, 0x05, 0x03, 0x03, 0x05, 0x06, 0x06,
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef EU
|
||||
const u8 unk_data[] = { // TODO
|
||||
0x0c, 0x0, 0x0, 0x0
|
||||
};
|
||||
#endif
|
||||
|
||||
const Hitbox gUnk_080CD174 = {
|
||||
0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x04, 0x04,
|
||||
};
|
||||
|
||||
|
||||
const Hitbox gUnk_080CD17C = {
|
||||
0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x16, 0x16,
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
@@ -138,7 +138,7 @@ void sub_08028A74(Entity* this) {
|
||||
unk = 1;
|
||||
sub_080290FC(this);
|
||||
if (this->frames.all & 1) {
|
||||
Entity* ent = sub_0804A98C(this, 4, 0);
|
||||
Entity* ent = CreateProjectileWithParent(this, 4, 0);
|
||||
if (ent != NULL) {
|
||||
ent->parent = this;
|
||||
ent->direction = this->direction;
|
||||
@@ -266,7 +266,9 @@ void sub_08028CE8(Entity* this) {
|
||||
this->actionDelay = 4;
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
sub_080290E0(this, 3);
|
||||
#if defined(USA) || defined(DEMO)
|
||||
SetLocalFlag(0x87);
|
||||
#endif
|
||||
return;
|
||||
case 1:
|
||||
CreateItemEntity(offer->field_0x8, offer->field_0x9, 0);
|
||||
@@ -523,8 +525,7 @@ bool32 sub_080291DC(Entity* this) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if NON_MATCHING
|
||||
void sub_0802922C(Entity* this) {
|
||||
NONMATCH("asm/non_matching/businessScrub/sub_0802925C.inc", void sub_0802922C(Entity* this)) {
|
||||
const struct SalesOffering* offer = (const struct SalesOffering*)this->field_0x7c.WORD;
|
||||
|
||||
this->action = 6;
|
||||
@@ -538,12 +539,7 @@ void sub_0802922C(Entity* this) {
|
||||
|
||||
sub_080290E0(this, 3);
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_0802922C(Entity* this) {
|
||||
asm(".include \"asm/non_matching/businessScrub/sub_0802925C.inc\"");
|
||||
}
|
||||
#endif
|
||||
END_NONMATCH
|
||||
|
||||
void sub_0802925C(Entity* this) {
|
||||
sub_08078784(this, sub_0801E99C(this));
|
||||
@@ -569,7 +565,11 @@ const struct SalesOffering gUnk_080CC954[] = {
|
||||
{0x04, 0x00, 0x0014, 0x2910, 0x2911, 0x1c, 0xff, 0xffff},
|
||||
{0x0c, 0x00, 0xffff, 0x2912, 0x2913, 0xff, 0xff, 0x0046},
|
||||
{0x04, 0x00, 0x0064, 0x2913, 0x2902, 0x5c, 0x75, 0xffff},
|
||||
#ifdef EU
|
||||
{0x00, 0x00, 0x0064, 0x290d, 0x2902, 0x5c, 0xff, 0xffff},
|
||||
#else
|
||||
{0x00, 0x00, 0x00C8, 0x290d, 0x2902, 0x5c, 0xff, 0xffff},
|
||||
#endif
|
||||
};
|
||||
|
||||
const u8 gUnk_080CC9C0[] = {
|
||||
|
||||
@@ -332,6 +332,9 @@ void sub_0801F3AC(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/sub_0801F428.inc", void sub_0801F428(Entity* this))
|
||||
#else
|
||||
void sub_0801F428(Entity* this) {
|
||||
sub_0804A720(this);
|
||||
this->action = 1;
|
||||
@@ -348,6 +351,7 @@ void sub_0801F428(Entity* this) {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
InitializeAnimation(this, 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_0801F48C(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
|
||||
+6
-9
@@ -224,7 +224,7 @@ void sub_08020F48(Entity* this) {
|
||||
|
||||
this->action = 14;
|
||||
sub_08021218(this, 13, uVar2 >> 3);
|
||||
pEVar3 = sub_0804A98C(this, 0, 1);
|
||||
pEVar3 = CreateProjectileWithParent(this, 0, 1);
|
||||
if (pEVar3) {
|
||||
pEVar3->parent = this;
|
||||
this->attachedEntity = pEVar3;
|
||||
@@ -270,7 +270,7 @@ void sub_08021010(Entity* this) {
|
||||
|
||||
void sub_08021038(Entity* this) {
|
||||
if (this->attachedEntity == NULL && this->frames.all) {
|
||||
Entity* pEVar2 = (Entity*)sub_0804A98C(this, 0, 0);
|
||||
Entity* pEVar2 = (Entity*)CreateProjectileWithParent(this, 0, 0);
|
||||
if (pEVar2) {
|
||||
pEVar2->parent = this;
|
||||
this->attachedEntity = pEVar2;
|
||||
@@ -309,7 +309,7 @@ void sub_080210E4(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
this->frames.all &= ~1;
|
||||
ent = sub_0804A98C(this, 0, 2);
|
||||
ent = CreateProjectileWithParent(this, 0, 2);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
this->attachedEntity = ent;
|
||||
@@ -391,10 +391,7 @@ void sub_0802124C(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
NAKED
|
||||
u32 sub_08021274(u32 a, u32 b) {
|
||||
asm(".include \"asm/non_matching/darkNut/sub_08021274.inc\"");
|
||||
}
|
||||
ASM_FUNC("asm/non_matching/darkNut/sub_08021274.inc", u32 sub_08021274(u32 a, u32 b))
|
||||
|
||||
void sub_080212B0(Entity* this) {
|
||||
u8 tmp;
|
||||
@@ -572,7 +569,7 @@ void sub_0802159C(Entity* this) {
|
||||
|
||||
this->frames.all = 0;
|
||||
this->damageType = 0x51;
|
||||
ent = sub_0804A98C(this, 0, 3);
|
||||
ent = CreateProjectileWithParent(this, 0, 3);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
this->attachedEntity = ent;
|
||||
@@ -593,7 +590,7 @@ void sub_08021600(Entity* this) {
|
||||
|
||||
this->frames.all = 0;
|
||||
this->damageType = 0x51;
|
||||
ent = sub_0804A98C(this, 0, 4);
|
||||
ent = CreateProjectileWithParent(this, 0, 4);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
this->attachedEntity = ent;
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ void sub_0803EB44(Entity* this) {
|
||||
Entity* pEVar1;
|
||||
|
||||
sub_0804A720(this);
|
||||
pEVar1 = sub_0804A98C(this, 0x19, 0);
|
||||
pEVar1 = CreateProjectileWithParent(this, 0x19, 0);
|
||||
if (pEVar1 != NULL) {
|
||||
pEVar1->parent = this;
|
||||
this->attachedEntity = pEVar1;
|
||||
|
||||
+1
-1
@@ -139,7 +139,7 @@ void sub_08048478(Entity* this) {
|
||||
} else {
|
||||
if (this->frames.b.f0 != 0) {
|
||||
this->frames.all &= 0xfe;
|
||||
pEVar3 = sub_080A7EE0(0x24);
|
||||
pEVar3 = CreateProjectile(0x24);
|
||||
if (pEVar3 != NULL) {
|
||||
pEVar3->parent = this;
|
||||
this->attachedEntity = pEVar3;
|
||||
|
||||
@@ -11,6 +11,8 @@ extern const u16 gUnk_080CD568[];
|
||||
extern const u8 gUnk_080CD580[];
|
||||
extern const s16 gUnk_080CD58C[];
|
||||
|
||||
extern void sub_080AEFB4(Entity*);
|
||||
|
||||
void FallingBoulder(Entity* this) {
|
||||
EnemyFunctionHandler(this, gUnk_080CD540);
|
||||
}
|
||||
@@ -58,8 +60,7 @@ void sub_0802C318(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
#if NON_MATCHING
|
||||
void sub_0802C334(Entity* this) {
|
||||
NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(Entity* this)) {
|
||||
if ((u16)this->field_0x7c.HALF.LO == 0) {
|
||||
u32 tmp = gRoomControls.roomOriginY;
|
||||
if (&gPlayerEntity == NULL)
|
||||
@@ -99,7 +100,7 @@ void sub_0802C334(Entity* this) {
|
||||
diff += 0x18;
|
||||
}
|
||||
sub_0802C62C(this);
|
||||
this->field_0x7a.HWORD = Random() & 0xff | 0x100;
|
||||
this->field_0x7a.HWORD = (Random() & 0xff) | 0x100;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -124,12 +125,7 @@ void sub_0802C334(Entity* this) {
|
||||
this->spritePriority.b0 = 1;
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_0802C334(Entity* this) {
|
||||
asm(".include \"asm/non_matching/fallingBoulder/sub_0802C334.inc\"");
|
||||
}
|
||||
#endif
|
||||
END_NONMATCH
|
||||
|
||||
void nullsub_148(Entity* this) {
|
||||
/* ... */
|
||||
|
||||
+6
-10
@@ -223,8 +223,8 @@ void sub_080377B0(Entity* this) {
|
||||
this->animationState = this->direction / 8;
|
||||
InitAnimationForceUpdate(this, this->animationState + 4);
|
||||
}
|
||||
// Nonmatching
|
||||
NONMATCH("asm/non_matching/gibdo/sub_08037810.inc", u32 sub_08037810(Entity* this)) {
|
||||
|
||||
u32 sub_08037810(Entity* this) {
|
||||
u32 x;
|
||||
u32 y;
|
||||
if (this->field_0x76.HALF.LO == 0) {
|
||||
@@ -236,9 +236,8 @@ NONMATCH("asm/non_matching/gibdo/sub_08037810.inc", u32 sub_08037810(Entity* thi
|
||||
this->actionDelay = 0x18;
|
||||
this->field_0xf = 0x8;
|
||||
this->speed = 0xc0;
|
||||
y = DirectionRoundUp(GetFacingDirection(this, gUnk_020000B0));
|
||||
this->direction = y;
|
||||
this->animationState = y / 8;
|
||||
this->direction = DirectionRoundUp(GetFacingDirection(this, gUnk_020000B0));
|
||||
this->animationState = this->direction >> 3;
|
||||
this->field_0x74.HWORD = 300;
|
||||
this->field_0x78.HWORD = gUnk_020000B0->x.HALF.HI;
|
||||
this->field_0x7a.HWORD = gUnk_020000B0->y.HALF.HI;
|
||||
@@ -252,7 +251,6 @@ NONMATCH("asm/non_matching/gibdo/sub_08037810.inc", u32 sub_08037810(Entity* thi
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
u32 sub_080378B0(Entity* this) {
|
||||
if (this->field_0x76.HALF.HI == 0) {
|
||||
@@ -333,12 +331,11 @@ void sub_08037A14(Entity* this) {
|
||||
CopyPosition(this, this->field_0x4c);
|
||||
InitAnimationForceUpdate(this, this->animationState + 0xc);
|
||||
}
|
||||
// Not match
|
||||
// Take Damage maybe?
|
||||
NONMATCH("asm/non_matching/gibdo/sub_08037A58.inc", void sub_08037A58(Entity* this)) {
|
||||
void sub_08037A58(Entity* this) {
|
||||
sub_08037ACC(this);
|
||||
this->action = 7;
|
||||
this->spritePriority.b0 = (this->spritePriority.b0 & 0xf8) | 4;
|
||||
this->spritePriority.b0 = 4;
|
||||
if (this->iframes == 0) {
|
||||
this->iframes = 0xec;
|
||||
}
|
||||
@@ -351,7 +348,6 @@ NONMATCH("asm/non_matching/gibdo/sub_08037A58.inc", void sub_08037A58(Entity* th
|
||||
this->field_0x76.HALF.LO = 0x3c;
|
||||
InitAnimationForceUpdate(this, this->animationState + 0x10);
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08037ACC(Entity* this) {
|
||||
gPlayerState.flags.all &= 0xFFFFFEFF;
|
||||
|
||||
+17
-3
@@ -109,7 +109,7 @@ void GyorgMale(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08046898(Entity* this) {
|
||||
Entity* tmp = sub_080A7EE0(0x22);
|
||||
Entity* tmp = CreateProjectile(0x22);
|
||||
u32 tmp2;
|
||||
if (!tmp)
|
||||
return;
|
||||
@@ -143,7 +143,11 @@ void sub_08046930(Entity* this) {
|
||||
if (this->type) {
|
||||
this->subAction = 5;
|
||||
this->direction = 0x20;
|
||||
#ifdef EU
|
||||
this->speed = 0x200;
|
||||
#else
|
||||
this->speed = 0x280;
|
||||
#endif
|
||||
}
|
||||
sub_08047D88(this);
|
||||
if (this->field_0x7c.BYTES.byte0 == 0)
|
||||
@@ -152,7 +156,11 @@ void sub_08046930(Entity* this) {
|
||||
this->actionDelay = 1;
|
||||
this->animationState = 0;
|
||||
this->direction = 0;
|
||||
#ifdef EU
|
||||
this->speed = 0x200;
|
||||
#else
|
||||
this->speed = 0x280;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sub_0804696C(Entity* this) {
|
||||
@@ -163,10 +171,16 @@ void sub_0804696C(Entity* this) {
|
||||
this->speed = 0x100;
|
||||
this->spriteOrientation.flipY = 3;
|
||||
this->spriteRendering.b3 = 3;
|
||||
#ifndef EU
|
||||
SoundReq(BGM_BOSS_THEME);
|
||||
#endif
|
||||
}
|
||||
if (this->actionDelay) {
|
||||
#ifdef EU
|
||||
if (gRoomControls.roomOriginY + 0x210 > this->y.HALF.HI) {
|
||||
#else
|
||||
if (gRoomControls.roomOriginY + 0x258 > this->y.HALF.HI) {
|
||||
#endif
|
||||
this->actionDelay = 0;
|
||||
SoundReq(SFX_APPARATE);
|
||||
}
|
||||
@@ -388,7 +402,7 @@ void sub_08046EF4(Entity* this) {
|
||||
if ((--this->field_0xf & 0xFF) == 0) {
|
||||
Entity* tmp;
|
||||
this->field_0xf = (Random() & 0x38) + 0x78;
|
||||
tmp = sub_080A7EE0(0x23);
|
||||
tmp = CreateProjectile(0x23);
|
||||
if (tmp) {
|
||||
tmp->collisionLayer = 2;
|
||||
tmp->parent = this;
|
||||
@@ -412,7 +426,7 @@ void sub_08046F64(Entity* this) {
|
||||
if (--this->field_0x7c.HALF.HI == 0) {
|
||||
Entity* tmp;
|
||||
this->field_0x7c.HALF.HI = 0x78;
|
||||
tmp = sub_080A7EE0(0x23);
|
||||
tmp = CreateProjectile(0x23);
|
||||
if (tmp) {
|
||||
tmp->collisionLayer = 2;
|
||||
tmp->parent = this;
|
||||
|
||||
+1
-1
@@ -232,7 +232,7 @@ void sub_08032794(Entity* this) {
|
||||
void sub_080327C8(Entity* this) {
|
||||
Entity* child;
|
||||
|
||||
child = sub_0804A98C(this, 11, 0);
|
||||
child = CreateProjectileWithParent(this, 11, 0);
|
||||
if (child != NULL) {
|
||||
child->parent = this;
|
||||
this->attachedEntity = child;
|
||||
|
||||
+2
-2
@@ -117,7 +117,7 @@ void sub_0803C86C(Entity* this) {
|
||||
}
|
||||
|
||||
void Lakitu_Initialize(Entity* this) {
|
||||
Entity* cloud = sub_0804A98C(this, 17, 0);
|
||||
Entity* cloud = CreateProjectileWithParent(this, 17, 0);
|
||||
if (cloud == NULL) {
|
||||
return;
|
||||
}
|
||||
@@ -303,7 +303,7 @@ void Lakitu_SpawnLightning(Entity* this) {
|
||||
Entity* lightning;
|
||||
const OffsetCoords* offset;
|
||||
|
||||
lightning = sub_0804A98C(this, 18, 0);
|
||||
lightning = CreateProjectileWithParent(this, 18, 0);
|
||||
|
||||
if (lightning == NULL) {
|
||||
return;
|
||||
|
||||
@@ -204,8 +204,7 @@ void sub_0802805C(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
#if NON_MATCHING
|
||||
void sub_0802810C(Entity* this) {
|
||||
NONMATCH("asm/non_matching/likeLike/sub_0802810C.inc", void sub_0802810C(Entity* this)) {
|
||||
gPlayerState.jumpStatus = 0x41;
|
||||
gPlayerState.field_0xa = 0;
|
||||
gPlayerState.flags.all &= 0xffffffef;
|
||||
@@ -224,12 +223,7 @@ void sub_0802810C(Entity* this) {
|
||||
this->iframes = -18;
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_0802810C(Entity* this) {
|
||||
asm(".include \"asm/non_matching/likeLike/sub_0802810C.inc\"");
|
||||
}
|
||||
#endif
|
||||
END_NONMATCH
|
||||
|
||||
void sub_080281A0(Entity* this) {
|
||||
this->field_0xf = 0x19;
|
||||
@@ -263,7 +257,11 @@ bool32 sub_080281E0(u32 param_1) {
|
||||
}
|
||||
|
||||
void sub_08028224(u32 param_1) {
|
||||
#ifdef EU
|
||||
CreateItemEntity(param_1, 0, 1);
|
||||
#else
|
||||
sub_080A7C18(param_1, 0, 1);
|
||||
#endif
|
||||
TextboxNoOverlapFollow(0x579);
|
||||
}
|
||||
|
||||
|
||||
@@ -318,10 +318,7 @@ void sub_08029DE4(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
NAKED
|
||||
void sub_08029E0C(Entity* this) {
|
||||
asm(".include \"asm/non_matching/madderpillar/sub_08029E0C.inc\"");
|
||||
}
|
||||
ASM_FUNC("asm/non_matching/madderpillar/sub_08029E0C.inc", void sub_08029E0C(Entity* this))
|
||||
|
||||
void sub_08029EEC(Entity* this) {
|
||||
u32 uVar1 = (this->direction >> 3) + this->field_0x74.HALF.HI;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "functions.h"
|
||||
|
||||
extern void UnloadOBJPalette(Entity*);
|
||||
extern void DoExitTransition(ScreenTransitionData*);
|
||||
|
||||
extern u8 gEntCount;
|
||||
|
||||
@@ -780,7 +779,7 @@ NONMATCH("asm/non_matching/mazaal/sub_08034B38.inc", void sub_08034B38(Entity* t
|
||||
this->action = 3;
|
||||
InitializeAnimation(this, this->type + 3);
|
||||
} else {
|
||||
target = sub_080A7EE0(0xe);
|
||||
target = CreateProjectile(0xe);
|
||||
if (target != NULL) {
|
||||
target->type -= 2;
|
||||
if (target->type == 0) {
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void DoExitTransition(ScreenTransitionData*);
|
||||
extern void sub_0807B600(u32);
|
||||
|
||||
extern const u16 script_08012E20[];
|
||||
|
||||
+5
-8
@@ -141,15 +141,12 @@ void sub_08022DE8(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
NAKED
|
||||
void sub_08022E40(Entity* this) {
|
||||
asm(".include \"asm/non_matching/moldorm/sub_08022E40.inc\"");
|
||||
}
|
||||
// this definition is only here, so clang-tidy does not mess gUnk_080CBBBC up.
|
||||
extern void sub_08022E40(Entity* this);
|
||||
|
||||
NAKED
|
||||
void sub_08022EAC(Entity* this) {
|
||||
asm(".include \"asm/non_matching/moldorm/sub_08022EAC.inc\"");
|
||||
}
|
||||
ASM_FUNC("asm/non_matching/moldorm/sub_08022E40.inc", void sub_08022E40(Entity* this))
|
||||
|
||||
ASM_FUNC("asm/non_matching/moldorm/sub_08022EAC.inc", void sub_08022EAC(Entity* this))
|
||||
|
||||
void sub_08022F14(Entity* this) {
|
||||
if (sub_08049FA0(this) == 0) {
|
||||
|
||||
+4
-16
@@ -27,8 +27,7 @@ extern void (*const gUnk_080CBC98[])(Entity*);
|
||||
extern void (*const gUnk_080CBCA8[])(Entity*);
|
||||
extern const s8 gUnk_080CBCB8[];
|
||||
|
||||
#if NON_MATCHING
|
||||
void Moldworm(Entity* this) {
|
||||
NONMATCH("asm/non_matching/moldworm/Moldworm.inc", void Moldworm(Entity* this)) {
|
||||
u16 prevX = this->x.HALF.HI;
|
||||
u16 prevY = this->y.HALF.HI;
|
||||
|
||||
@@ -56,12 +55,7 @@ void Moldworm(Entity* this) {
|
||||
(((this->x.HALF.HI - prevX + 8) & 0xf) << 4) | ((this->y.HALF.HI - prevY + 8U) & 0xf);
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void Moldworm(Entity* this) {
|
||||
asm(".include \"asm/non_matching/moldworm/moldworm.inc\"");
|
||||
}
|
||||
#endif
|
||||
END_NONMATCH
|
||||
|
||||
void sub_080230CC(Entity* this) {
|
||||
gUnk_080CBC50[this->action](this);
|
||||
@@ -472,10 +466,7 @@ void sub_08023990(Entity* this, u32 param_2, u32 param_3) {
|
||||
}
|
||||
|
||||
/* TODO: fix struct */
|
||||
NAKED
|
||||
void sub_080239F0(Entity* this) {
|
||||
asm(".include \"asm/non_matching/moldworm/sub_080239F0.inc\"");
|
||||
}
|
||||
ASM_FUNC("asm/non_matching/moldworm/sub_080239F0.inc", void sub_080239F0(Entity* this))
|
||||
|
||||
bool32 sub_08023A38(u32 unk) {
|
||||
if (unk == 0x1a || unk == 0x29) {
|
||||
@@ -522,10 +513,7 @@ void sub_08023AB0(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
NAKED
|
||||
bool32 sub_08023B38(Entity* this) {
|
||||
asm(".include \"asm/non_matching/moldworm/sub_08023B38.inc\"");
|
||||
}
|
||||
ASM_FUNC("asm/non_matching/moldworm/sub_08023B38.inc", bool32 sub_08023B38(Entity* this))
|
||||
|
||||
// clang-format off
|
||||
void (*const gUnk_080CBC38[])(Entity*) = {
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ void Octorok_Move(Entity* this) {
|
||||
void Octorok_ShootNut(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
Entity* ent = sub_0804A98C(this, 1, 0);
|
||||
Entity* ent = CreateProjectileWithParent(this, 1, 0);
|
||||
if (ent) {
|
||||
const s8* off;
|
||||
ent->direction = this->direction;
|
||||
|
||||
+10
-24
@@ -4,6 +4,7 @@
|
||||
#include "createObject.h"
|
||||
#include "game.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
extern u32 sub_080002E0(u16, u32);
|
||||
extern void sub_0800449C(Entity*, u32);
|
||||
@@ -169,7 +170,7 @@ void sub_080240B8(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
this->field_0x82.HALF.HI = 0;
|
||||
ent = sub_0804A98C(this, 6, this->field_0x82.HALF.HI);
|
||||
ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
|
||||
if (ent) {
|
||||
this->attachedEntity = ent;
|
||||
ent->parent = this;
|
||||
@@ -412,7 +413,7 @@ void sub_080244E8(Entity* this) {
|
||||
this->height.HALF.HI -= 0xe;
|
||||
this->field_0x78.HWORD -= 0xe;
|
||||
|
||||
ent = sub_0804A98C(this, 6, this->field_0x82.HALF.HI);
|
||||
ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
ent->height.HALF.HI += 0xe;
|
||||
@@ -435,7 +436,7 @@ void sub_080244E8(Entity* this) {
|
||||
this->height.HALF.HI -= 0xe;
|
||||
this->field_0x78.HWORD -= 0xe;
|
||||
|
||||
ent = sub_0804A98C(this, 6, this->field_0x82.HALF.HI);
|
||||
ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
ent->height.HALF.HI += 0xe;
|
||||
@@ -559,20 +560,14 @@ void sub_080249DC(Entity* this) {
|
||||
InitializeAnimation(this, this->animationState);
|
||||
}
|
||||
|
||||
#if NON_MATCHING
|
||||
void sub_080249F4(Entity* this) {
|
||||
NONMATCH("asm/non_matching/pesto/sub_080249F4.inc", void sub_080249F4(Entity* this)) {
|
||||
u8 direction = ((this->direction + 2) & 0x1c) >> 2;
|
||||
if (direction != this->animationState) {
|
||||
this->animationState = direction;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_080249F4(Entity* this) {
|
||||
asm(".include \"asm/non_matching/pesto/sub_080249F4.inc\"");
|
||||
}
|
||||
#endif
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08024A14(Entity* this, u32 param_2, u32 param_3) {
|
||||
u8 unk = FALSE;
|
||||
@@ -703,10 +698,7 @@ bool32 sub_08024B38(Entity* this) {
|
||||
return iVar4;
|
||||
}
|
||||
|
||||
NAKED
|
||||
bool32 sub_08024C48(Entity* this, bool32 unk) {
|
||||
asm(".include \"asm/non_matching/pesto/sub_08024C48.inc\"");
|
||||
}
|
||||
ASM_FUNC("asm/non_matching/pesto/sub_08024C48.inc", bool32 sub_08024C48(Entity* this, bool32 unk))
|
||||
|
||||
void sub_08024C7C(Entity* this) {
|
||||
this->action = 1;
|
||||
@@ -794,8 +786,7 @@ u32 sub_08024E34(void) {
|
||||
return gUnk_080CBF20[idx];
|
||||
}
|
||||
|
||||
#if NON_MATCHING
|
||||
void sub_08024E4C(Entity* this) {
|
||||
NONMATCH("asm/non_matching/pesto/sub_08024E4C.inc", void sub_08024E4C(Entity* this)) {
|
||||
if (this->field_0x82.HALF.HI == 3) {
|
||||
this->field_0xf++;
|
||||
this->field_0xf &= 0xff;
|
||||
@@ -829,7 +820,7 @@ void sub_08024E4C(Entity* this) {
|
||||
player->animationState = 4;
|
||||
player->spritePriority.b1 = 0;
|
||||
if (this->field_0xf == 0) {
|
||||
(this->field_0x86.HALF.HI++;
|
||||
this->field_0x86.HALF.HI++;
|
||||
player->iframes = 8;
|
||||
ModHealth(-2);
|
||||
sub_0800449C(player, 0x7a);
|
||||
@@ -837,12 +828,7 @@ void sub_08024E4C(Entity* this) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_08024E4C(Entity* this) {
|
||||
asm(".include \"asm/non_matching/pesto/sub_08024E4C.inc\"");
|
||||
}
|
||||
#endif
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08024F50(Entity* this) {
|
||||
gPlayerState.field_0xa = 0;
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
extern u32 sub_080002E0(u32, u32);
|
||||
extern u32 sub_080002C8(u16, u8);
|
||||
extern u16 sub_080002A8(u32, u32, u32);
|
||||
extern u16 sub_080002D4(u32, u32, u32);
|
||||
extern void sub_0804AA1C(Entity*);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
@@ -468,8 +467,7 @@ bool32 sub_080258C4(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
#if NON_MATCHING
|
||||
bool32 sub_0802594C(Entity* this, u32 param_2) {
|
||||
NONMATCH("asm/non_matching/puffstool/sub_0802594C.inc", bool32 sub_0802594C(Entity* this, u32 param_2)) {
|
||||
const s8* unk = gUnk_080CC090[param_2];
|
||||
u32 uVar1 = this->collisionLayer;
|
||||
RoomControls* ctrl = &gRoomControls;
|
||||
@@ -492,12 +490,7 @@ bool32 sub_0802594C(Entity* this, u32 param_2) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
bool32 sub_0802594C(Entity* this, u32 param_2) {
|
||||
asm(".include \"asm/non_matching/puffstool/sub_0802594C.inc\"");
|
||||
}
|
||||
#endif
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08025A54(Entity* this) {
|
||||
u32 layer = this->collisionLayer;
|
||||
|
||||
@@ -44,7 +44,9 @@ void sub_08022254(Entity* this) {
|
||||
ent = CreateEnemy(CHUCHU, 1);
|
||||
if (ent) {
|
||||
ent->type2 = 1;
|
||||
#ifndef EU
|
||||
ent->iframes = -8;
|
||||
#endif
|
||||
sub_0804A4E4(this, ent);
|
||||
this->action = 2;
|
||||
this->flags &= ~0x80;
|
||||
@@ -98,8 +100,10 @@ void sub_080223E4(Entity* this) {
|
||||
if (ent) {
|
||||
ent->bitfield = 0x94;
|
||||
ent->iframes = 0x10;
|
||||
#ifndef EU
|
||||
ent->field_0x42 = 0xc;
|
||||
ent->field_0x3e = this->direction;
|
||||
#endif
|
||||
}
|
||||
|
||||
DeleteEntity(this);
|
||||
|
||||
@@ -80,9 +80,7 @@ void sub_080382EC(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/ropeGolden/sub_08038304.inc", void sub_08038304(Entity* this)) {
|
||||
}
|
||||
END_NONMATCH
|
||||
ASM_FUNC("asm/non_matching/ropeGolden/sub_08038304.inc", void sub_08038304(Entity* this))
|
||||
|
||||
void sub_080383AC(Entity* this) {
|
||||
u32 v;
|
||||
|
||||
@@ -274,7 +274,11 @@ void sub_080297F0(Entity* this) {
|
||||
this->spriteSettings.b.draw = TRUE;
|
||||
this->damageType = 0x8e;
|
||||
sub_080AE068(this);
|
||||
#ifdef EU
|
||||
this->spriteIndex = 0x142;
|
||||
#else
|
||||
this->spriteIndex = 0x143;
|
||||
#endif
|
||||
temp = gUnk_080CCC47[this->type];
|
||||
this->palette.b.b0 = temp;
|
||||
this->spriteVramOffset = 9;
|
||||
|
||||
+5
-11
@@ -94,7 +94,7 @@ void sub_08028314(Entity* this) {
|
||||
sub_08028604(this);
|
||||
}
|
||||
|
||||
pEVar2 = sub_080A7EE0(3);
|
||||
pEVar2 = CreateProjectile(3);
|
||||
if (pEVar2 != NULL) {
|
||||
pEVar2->parent = this;
|
||||
this->attachedEntity = pEVar2;
|
||||
@@ -240,14 +240,13 @@ void sub_08028528(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
#if NON_MATCHING
|
||||
void sub_08028604(Entity* this) {
|
||||
NONMATCH("asm/non_matching/spearMoblin/sub_08028604.inc", void sub_08028604(Entity* this)) {
|
||||
this->field_0xf = 0;
|
||||
if (this->field_0x82.HALF.LO == 1) {
|
||||
this->actionDelay = gUnk_080CC7BC[Random() & 3];
|
||||
this->speed = 0x80;
|
||||
if (sub_08049FA0(this) != 0) {
|
||||
this->direction = gUnk_080CC7D0[Random() & 7] + 0x18 + this->direction & 0x18;
|
||||
this->direction = gUnk_080CC7D0[Random() & 7] + 0x18 + (this->direction & 0x18);
|
||||
} else {
|
||||
u32 iVar3 = sub_08049EE4(this);
|
||||
u32 uVar1;
|
||||
@@ -258,7 +257,7 @@ void sub_08028604(Entity* this) {
|
||||
this->actionDelay = this->actionDelay + 0x10;
|
||||
this->field_0x82.HALF.HI--;
|
||||
}
|
||||
this->direction = iVar3 + uVar1 + 4U & 0x18;
|
||||
this->direction = iVar3 + uVar1 + (4U & 0x18);
|
||||
}
|
||||
} else {
|
||||
this->actionDelay = 0xc;
|
||||
@@ -270,12 +269,7 @@ void sub_08028604(Entity* this) {
|
||||
sub_080287E0(this);
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_08028604(Entity* this) {
|
||||
asm(".include \"asm/non_matching/spearMoblin/sub_08028604.inc\"");
|
||||
}
|
||||
#endif
|
||||
END_NONMATCH
|
||||
|
||||
bool32 sub_080286CC(Entity* this) {
|
||||
if (this->field_0x80.HALF.HI == 0) {
|
||||
|
||||
+17
-1
@@ -545,9 +545,15 @@ void sub_08042C34(Entity* this) {
|
||||
if ((gRoomControls.roomOriginY + 0x20) > y) {
|
||||
y = gRoomControls.roomOriginY + 0x20;
|
||||
}
|
||||
#if defined EU || defined JP
|
||||
if (gRoomControls.roomOriginY + gRoomControls.height + -0x20 < y) {
|
||||
y = gRoomControls.roomOriginY + gRoomControls.height + -0x20;
|
||||
}
|
||||
#else
|
||||
if (gRoomControls.roomOriginY + gRoomControls.height + -0x40 < y) {
|
||||
y = gRoomControls.roomOriginY + gRoomControls.height + -0x40;
|
||||
}
|
||||
#endif
|
||||
if (((u32)((x - gRoomControls.roomOriginX) - 0x90) < 0x41) &&
|
||||
((u32)((y - gRoomControls.roomOriginY) - 8) < 0x41)) {
|
||||
x = gRoomControls.roomOriginX + 0xb0;
|
||||
@@ -704,7 +710,7 @@ void sub_08042FD8(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (!sub_08043C98(this)) {
|
||||
if ((this->frames.all & 1) != 0) {
|
||||
entity = sub_080A7EE0(0x20);
|
||||
entity = CreateProjectile(0x20);
|
||||
if (entity != NULL) {
|
||||
CopyPosition(this, entity);
|
||||
entity->height.HALF.HI -= 0x18;
|
||||
@@ -1280,6 +1286,15 @@ void sub_08043C40(Entity* this, VaatiArm_HeapStruct1* heapStruct) {
|
||||
}
|
||||
|
||||
u32 sub_08043C98(Entity* this) {
|
||||
#if defined EU || defined JP
|
||||
Entity* e1 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3];
|
||||
if ((e1->bitfield == 0x9d)) {
|
||||
sub_08043D08(this);
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
Entity* e1 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[2];
|
||||
Entity* e2 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3];
|
||||
if ((e1->bitfield == 0x9d) || (e2->bitfield == 0x9d)) {
|
||||
@@ -1289,6 +1304,7 @@ u32 sub_08043C98(Entity* this) {
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void sub_08043CD4(Entity* this) {
|
||||
|
||||
@@ -34,7 +34,11 @@ void VaatiBall(Entity* this) {
|
||||
ModHealth(-2);
|
||||
}
|
||||
|
||||
#ifdef EU
|
||||
if (this->currentHealth < 0xfa) {
|
||||
#else
|
||||
if (this->currentHealth < 0xfd) {
|
||||
#endif
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->flags &= 0x7f;
|
||||
this->currentHealth = -1;
|
||||
@@ -181,7 +185,7 @@ void sub_08044868(Entity* this) {
|
||||
if (*(u8*)&vaati->field_0x86 > 1) {
|
||||
u8 draw = this->spriteSettings.b.draw;
|
||||
if (draw == 1 && this->cutsceneBeh.HALF.LO == 0) {
|
||||
vaati = sub_0804A98C(this, 0x18, 0);
|
||||
vaati = CreateProjectileWithParent(this, 0x18, 0);
|
||||
if (vaati) {
|
||||
vaati->type2 = 1;
|
||||
vaati->parent = this;
|
||||
@@ -271,7 +275,7 @@ void sub_080449F8(Entity* this) {
|
||||
this->field_0x74.HALF.LO++;
|
||||
draw = this->spriteSettings.b.draw;
|
||||
if (draw) {
|
||||
vaati = sub_0804A98C(this, 0x1c, 0);
|
||||
vaati = CreateProjectileWithParent(this, 0x1c, 0);
|
||||
if (vaati) {
|
||||
vaati->y.HALF.HI += 4;
|
||||
vaati->parent = this;
|
||||
|
||||
@@ -54,7 +54,9 @@ void sub_0803E0DC(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
if (this->bitfield == 0x80) {
|
||||
#ifndef EU
|
||||
if (this->currentHealth != 0) {
|
||||
#endif
|
||||
this->action = 5;
|
||||
this->flags = this->flags & 0x7f;
|
||||
this->spritePriority.b1 = 0;
|
||||
@@ -62,6 +64,7 @@ void sub_0803E0DC(Entity* this) {
|
||||
gPlayerEntity.spriteOrientation.flipY = this->spriteOrientation.flipY;
|
||||
gPlayerEntity.spriteRendering.b3 = this->spriteRendering.b3;
|
||||
sub_0803E444(this);
|
||||
#ifndef EU
|
||||
sub_08078A90(2);
|
||||
entity = this->parent;
|
||||
if (entity != NULL) {
|
||||
@@ -72,6 +75,7 @@ void sub_0803E0DC(Entity* this) {
|
||||
entity = &gPlayerEntity;
|
||||
entity->flags = gPlayerEntity.flags | 0x80;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
sub_0804AA30(this, gUnk_080D0648);
|
||||
}
|
||||
@@ -233,6 +237,18 @@ void sub_0803E480(Entity* this) {
|
||||
}
|
||||
|
||||
bool32 sub_0803E4A0(Entity* this) {
|
||||
#ifdef EU
|
||||
bool32 ret;
|
||||
if (gScreenTransition.field_0x39 == 0) {
|
||||
return TRUE;
|
||||
} else {
|
||||
if (this->parent == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
ret = this->parent->next == NULL;
|
||||
}
|
||||
return ret;
|
||||
#else
|
||||
bool32 ret;
|
||||
if (gScreenTransition.field_0x39 != 0) {
|
||||
if (this->parent == NULL) {
|
||||
@@ -247,6 +263,7 @@ bool32 sub_0803E4A0(Entity* this) {
|
||||
return TRUE;
|
||||
}
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sub_0803E4D8(Entity* this) {
|
||||
|
||||
@@ -60,7 +60,11 @@ const Coords gUnk_080D04AC[] = { { .HALF = { 0x58, 0x60 } },
|
||||
{ .HALF = { 0xd8, 0x90 } } };
|
||||
const u8 gUnk_080D04C0[] = { 2, 0, 0, 2, 2, 2, 4, 4 };
|
||||
const xy gUnk_080D04C8[] = { { 10, -29 }, { -10, -29 }, { 15, -21 }, { -15, -21 } };
|
||||
#ifdef EU
|
||||
const u8 gUnk_080D04D0[] = { -12, -20, -32 };
|
||||
#else
|
||||
const u8 gUnk_080D04D0[] = { -24, -40, -48 };
|
||||
#endif
|
||||
const u8 gUnk_080D04D3[] = { 0, 1, 0, -1 };
|
||||
|
||||
void VaatiRebornEnemy(Entity* this) {
|
||||
@@ -346,7 +350,7 @@ void sub_0803D658(Entity* this) {
|
||||
this->field_0xf = 0;
|
||||
}
|
||||
if ((this->field_0xf < 0x10) &&
|
||||
(entity = sub_0804A98C(this, 0x1a, this->cutsceneBeh.HALF.LO), entity != NULL)) {
|
||||
(entity = CreateProjectileWithParent(this, 0x1a, this->cutsceneBeh.HALF.LO), entity != NULL)) {
|
||||
entity->field_0xf = this->field_0xf;
|
||||
entity->parent = this;
|
||||
entity->height.HALF.HI = this->height.HALF.HI;
|
||||
@@ -433,7 +437,7 @@ void sub_0803D830(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->field_0x74.HALF.LO++;
|
||||
SoundReq(SFX_150);
|
||||
target = sub_0804A98C(this, 0x18, 0);
|
||||
target = CreateProjectileWithParent(this, 0x18, 0);
|
||||
if (target != NULL) {
|
||||
PositionRelative(this, target, 0, -0x100000);
|
||||
target->parent = this;
|
||||
@@ -476,7 +480,9 @@ void sub_0803D8FC(Entity* this) {
|
||||
tmp = Random() & 0x3f3f;
|
||||
fx->x.HALF.HI = ((tmp & 0xff) - 0x20) + fx->x.HALF.HI;
|
||||
fx->y.HALF.HI = ((tmp >> 8) & 0xff) - 0x20 + fx->y.HALF.HI;
|
||||
#ifndef EU
|
||||
fx->spritePriority.b0 = 2;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,11 @@ typedef struct {
|
||||
} PACKED xy;
|
||||
extern u8 gEntCount;
|
||||
|
||||
#ifdef EU
|
||||
const u8 gUnk_080D0ABC[] = { 0xf0, 0xd0, 0xb0 };
|
||||
#else
|
||||
const u8 gUnk_080D0ABC[] = { 0xf0, 0xd0, 0xc0 };
|
||||
#endif
|
||||
const u8 gUnk_080D0ABF[] = { 0x3c, 0x3c, 0x1e, 0x14, 0x14, 0x14, 0, 0, 0 };
|
||||
void (*const gUnk_080D0AC8[])(Entity*) = {
|
||||
sub_0803F818, sub_0803F914, sub_0803FAC8, sub_0803FAD0, sub_0803FD50, sub_0803FE90, sub_0803FF7C, sub_0804006C,
|
||||
@@ -405,7 +409,7 @@ void sub_0803FD50(Entity* this) {
|
||||
this->actionDelay = gUnk_080D0ABF[((u32)this->animationState << 1 | 1)];
|
||||
} else {
|
||||
if ((this->actionDelay & 7) == 0) {
|
||||
sub_0804A98C(this, 0x1f, this->field_0xf);
|
||||
CreateProjectileWithParent(this, 0x1f, this->field_0xf);
|
||||
}
|
||||
if (((this->field_0xf != 0) && (1 < this->animationState)) && (this->actionDelay < 6)) {
|
||||
this->actionDelay = 0x80;
|
||||
@@ -451,7 +455,7 @@ void sub_0803FE90(Entity* this) {
|
||||
} else {
|
||||
if (this->field_0xf) {
|
||||
if ((this->actionDelay & 7) == 0) {
|
||||
sub_0804A98C(this, 0x1f, this->field_0xf);
|
||||
CreateProjectileWithParent(this, 0x1f, this->field_0xf);
|
||||
}
|
||||
if (this->actionDelay < 6) {
|
||||
this->actionDelay = 0x40;
|
||||
@@ -459,7 +463,7 @@ void sub_0803FE90(Entity* this) {
|
||||
}
|
||||
} else {
|
||||
if ((this->actionDelay & 0xf) == 0) {
|
||||
entity = sub_0804A98C(this, 0x1f, 2);
|
||||
entity = CreateProjectileWithParent(this, 0x1f, 2);
|
||||
if (entity != NULL) {
|
||||
entity->type2 = 0;
|
||||
if (this->field_0x80.HALF.HI != 0) {
|
||||
@@ -503,7 +507,7 @@ void sub_0803FF7C(Entity* this) {
|
||||
} else {
|
||||
if (this->field_0xf) {
|
||||
if ((this->actionDelay & 7) == 0) {
|
||||
sub_0804A98C(this, 0x1f, this->field_0xf);
|
||||
CreateProjectileWithParent(this, 0x1f, this->field_0xf);
|
||||
}
|
||||
if (this->actionDelay < 6) {
|
||||
this->actionDelay = 0x80;
|
||||
@@ -511,7 +515,7 @@ void sub_0803FF7C(Entity* this) {
|
||||
}
|
||||
} else {
|
||||
if ((this->actionDelay & 0x1f) == 0) {
|
||||
pEVar2 = sub_0804A98C(this, 0x1f, 2);
|
||||
pEVar2 = CreateProjectileWithParent(this, 0x1f, 2);
|
||||
if (pEVar2 != NULL) {
|
||||
pEVar2->type2 = 1;
|
||||
pEVar2->y.HALF.HI += -0x20;
|
||||
|
||||
@@ -114,7 +114,9 @@ void VaatiWrath(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080413A0(Entity* this) {
|
||||
#if !(defined EU || defined JP)
|
||||
sub_080423A4(this);
|
||||
#endif
|
||||
gUnk_080D0E2C[this->action](this);
|
||||
}
|
||||
|
||||
@@ -581,14 +583,14 @@ void sub_08041BE8(Entity* this) {
|
||||
entity->myHeap = NULL;
|
||||
DeleteEntity(entity);
|
||||
((VaatiWrathHeapStruct*)this->myHeap)->type3 = NULL;
|
||||
|
||||
#ifndef EU
|
||||
entity = ((VaatiWrathHeapStruct*)this->myHeap)->object5b;
|
||||
entity->myHeap = NULL;
|
||||
DeleteEntity(entity);
|
||||
((VaatiWrathHeapStruct*)this->myHeap)->object5b = NULL;
|
||||
|
||||
gRoomControls.cameraTarget = &gPlayerEntity;
|
||||
|
||||
#endif
|
||||
entity = ((VaatiWrathHeapStruct*)this->myHeap)->eyes[0];
|
||||
entity->myHeap = NULL;
|
||||
DeleteEntity(entity);
|
||||
@@ -951,7 +953,7 @@ u32 sub_080422C0(Entity* this, u32 unk1) {
|
||||
type1 = ((VaatiWrathHeapStruct*)this->myHeap)->type1;
|
||||
GetNextFrame(type1);
|
||||
if (unk1 + 1 == (tmp = type1->frames.all)) {
|
||||
child = sub_080A7EE0(0x21);
|
||||
child = CreateProjectile(0x21);
|
||||
if (child != NULL) {
|
||||
child->type = unk1;
|
||||
child->parent = this;
|
||||
@@ -992,11 +994,12 @@ void sub_0804235C(Entity* this) {
|
||||
InitializeAnimation(((VaatiWrathHeapStruct*)this->myHeap)->type3, 0x1b);
|
||||
}
|
||||
|
||||
#if defined USA || defined DEMO
|
||||
void sub_080423A4(Entity* this) {
|
||||
int temp;
|
||||
if ((gScreenTransition.field_0x38 & 2) == 0) {
|
||||
if (gSave.filler498 != 0) {
|
||||
gSave.filler498--;
|
||||
if (gSave.unk498 != 0) {
|
||||
gSave.unk498--;
|
||||
} else {
|
||||
temp = gPlayerState.field_0xa9;
|
||||
if (temp < 2) {
|
||||
@@ -1014,6 +1017,7 @@ void sub_080423A4(Entity* this) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_08042428(Entity* this) {
|
||||
if (((VaatiWrathHeapStruct*)this->myHeap)->type0->next == NULL) {
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
|
||||
extern void sub_08001328(Entity*);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
extern void DoExitTransition(u32*);
|
||||
|
||||
extern u32* gUnk_0813AB1C[];
|
||||
extern ScreenTransitionData* gUnk_0813AB1C[];
|
||||
|
||||
void sub_0802A78C(Entity*);
|
||||
void sub_0802A7D0(Entity*);
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
#include "functions.h"
|
||||
|
||||
extern void sub_08001328(Entity*);
|
||||
extern void DoExitTransition(u32*);
|
||||
|
||||
extern Entity* gUnk_020000B0;
|
||||
extern u32* gUnk_0813AB1C[];
|
||||
extern ScreenTransitionData* gUnk_0813AB1C[];
|
||||
|
||||
void sub_0802CF64(Entity*);
|
||||
void sub_0802CF8C(Entity*);
|
||||
@@ -160,10 +159,7 @@ void sub_0802CF64(Entity* this) {
|
||||
sub_0802CF8C(this);
|
||||
}
|
||||
|
||||
NAKED
|
||||
void sub_0802CF8C(Entity* this) {
|
||||
asm(".include \"asm/non_matching/wallMaster2/sub_0802CF8C.inc\"");
|
||||
}
|
||||
ASM_FUNC("asm/non_matching/wallMaster2/sub_0802CF8C.inc", void sub_0802CF8C(Entity* this))
|
||||
|
||||
void sub_0802CFD8(Entity* this) {
|
||||
u32 unk = gUnk_080CD740[(this->field_0x7a.HALF.LO++ >> 3) & 7];
|
||||
|
||||
+3
-4
@@ -48,12 +48,11 @@ typedef struct {
|
||||
|
||||
extern struct_03003DD0 gUnk_03003DD0;
|
||||
extern u32 _call_via_r0(u32*);
|
||||
extern u32 _EntUpdate;
|
||||
void DeleteEntityAny(Entity*);
|
||||
extern u32 _ClearAndUpdateEntities;
|
||||
|
||||
void DeleteThisEntity(void) {
|
||||
DeleteEntityAny(gUnk_03003DD0.field_0x8);
|
||||
_call_via_r0((u32*)&_EntUpdate);
|
||||
_call_via_r0((u32*)&_ClearAndUpdateEntities);
|
||||
}
|
||||
|
||||
void DeleteManager(OtherEntity*);
|
||||
@@ -76,7 +75,7 @@ extern void sub_0806FE84();
|
||||
extern void sub_080788E0();
|
||||
extern void sub_08078954();
|
||||
extern void sub_0805EC60();
|
||||
extern void sub_08017744();
|
||||
extern void sub_08017744(Entity*);
|
||||
extern void sub_0805E92C();
|
||||
extern void UnloadHitbox();
|
||||
extern void sub_0804AA1C();
|
||||
|
||||
+3
-39
@@ -34,10 +34,10 @@ void EzloNag(Element* arg0) {
|
||||
gUnk_080C904C[arg0->unk4](arg0);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING // REG SWAP
|
||||
extern u32 gUnk_080C9094;
|
||||
extern void sub_0801CAB8(Element*, u32*);
|
||||
|
||||
void sub_0801CED8(Element* arg0) {
|
||||
NONMATCH("asm/non_matching/sub_0801CED8.inc", void sub_0801CED8(Element* arg0)) {
|
||||
if (gUnk_0200AF00.ezloNagFuncIndex == 1) {
|
||||
gUnk_0200AF00.ezloNagFuncIndex = 2;
|
||||
arg0->unkC = 0x10;
|
||||
@@ -49,43 +49,7 @@ void sub_0801CED8(Element* arg0) {
|
||||
sub_0801CAB8(arg0, &gUnk_080C9094);
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_0801CED8(Element* arg0) {
|
||||
asm_unified("\
|
||||
push {r4, lr}\n\
|
||||
adds r3, r0, #0\n\
|
||||
ldr r0, _0801CF10 @ =gUnk_0200AF00\n\
|
||||
adds r1, r0, #0\n\
|
||||
adds r1, #0x24\n\
|
||||
ldrb r4, [r1]\n\
|
||||
cmp r4, #1\n\
|
||||
bne _0801CF0E\n\
|
||||
movs r2, #2\n\
|
||||
movs r0, #2\n\
|
||||
strb r0, [r1]\n\
|
||||
movs r1, #0\n\
|
||||
movs r0, #0x10\n\
|
||||
strh r0, [r3, #0xc]\n\
|
||||
movs r0, #0x90\n\
|
||||
strh r0, [r3, #0xe]\n\
|
||||
strb r1, [r3, #6]\n\
|
||||
movs r0, #7\n\
|
||||
strb r0, [r3, #1]\n\
|
||||
strb r4, [r3, #4]\n\
|
||||
ldrb r0, [r3]\n\
|
||||
orrs r0, r2\n\
|
||||
strb r0, [r3]\n\
|
||||
ldr r1, _0801CF14 @ =gUnk_080C9094\n\
|
||||
adds r0, r3, #0\n\
|
||||
bl sub_0801CAB8\n\
|
||||
_0801CF0E:\n\
|
||||
pop {r4, pc}\n\
|
||||
.align 2, 0\n\
|
||||
_0801CF10: .4byte gUnk_0200AF00\n\
|
||||
_0801CF14: .4byte gUnk_080C9094");
|
||||
}
|
||||
#endif
|
||||
END_NONMATCH
|
||||
|
||||
void sub_0801CF18(Element* arg0) {
|
||||
u32 temp;
|
||||
|
||||
+24
-1
@@ -271,10 +271,17 @@ static void sub_0805066C(void) {
|
||||
|
||||
if (loadNewPalette) {
|
||||
paletteOffset = &gGlobalGfxAndPalettes[gUnk_080FC8DE[gUnk_02019EE0.unk2]];
|
||||
#ifdef EU
|
||||
LoadPalettes(&paletteOffset[0x11A60], 11, 1);
|
||||
LoadPalettes(&paletteOffset[0x11B60], 12, 1);
|
||||
LoadPalettes(&paletteOffset[0x11C60], 13, 1);
|
||||
LoadPalettes(&paletteOffset[0x11D60], 14, 1);
|
||||
#else
|
||||
LoadPalettes(&paletteOffset[0x11AA0], 11, 1);
|
||||
LoadPalettes(&paletteOffset[0x11BA0], 12, 1);
|
||||
LoadPalettes(&paletteOffset[0x11CA0], 13, 1);
|
||||
LoadPalettes(&paletteOffset[0x11DA0], 14, 1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,7 +420,7 @@ void sub_08050940(void) {
|
||||
keys &= ~(DPAD_UP | DPAD_DOWN);
|
||||
}
|
||||
|
||||
num_rows = gUnk_02000000->gameLanguage > GAME_LANGUAGE ? NUM_SAVE_SLOTS + 1 : NUM_SAVE_SLOTS;
|
||||
num_rows = gUnk_02000000->gameLanguage > 1 ? NUM_SAVE_SLOTS + 1 : NUM_SAVE_SLOTS;
|
||||
mode = gUnk_02032EC0.lastState;
|
||||
switch (keys) {
|
||||
case DPAD_UP:
|
||||
@@ -475,22 +482,38 @@ void sub_08050A64(u32 idx) {
|
||||
if (GetInventoryValue(0x40)) {
|
||||
gOamCmd.x = 0xA2;
|
||||
gOamCmd.y = 0x36;
|
||||
#ifdef EU
|
||||
sub_080ADA14(0x144, 0x24);
|
||||
#else
|
||||
sub_080ADA14(0x145, 0x24);
|
||||
#endif
|
||||
}
|
||||
if (GetInventoryValue(0x41)) {
|
||||
gOamCmd.x = 0x96;
|
||||
gOamCmd.y = 0x3D;
|
||||
#ifdef EU
|
||||
sub_080ADA14(0x144, 0x22);
|
||||
#else
|
||||
sub_080ADA14(0x145, 0x22);
|
||||
#endif
|
||||
}
|
||||
if (GetInventoryValue(0x42)) {
|
||||
gOamCmd.x = 0xAE;
|
||||
gOamCmd.y = 0x3D;
|
||||
#ifdef EU
|
||||
sub_080ADA14(0x144, 0x23);
|
||||
#else
|
||||
sub_080ADA14(0x145, 0x23);
|
||||
#endif
|
||||
}
|
||||
if (GetInventoryValue(0x43)) {
|
||||
gOamCmd.x = 0xA2;
|
||||
gOamCmd.y = 0x44;
|
||||
#ifdef EU
|
||||
sub_080ADA14(0x144, 0x21);
|
||||
#else
|
||||
sub_080ADA14(0x145, 0x21);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+27
@@ -61,10 +61,15 @@ void sub_0805212C(void) {
|
||||
gMenu.transitionTimer--;
|
||||
if (gMenu.transitionTimer == 0) {
|
||||
sub_080520C4(2);
|
||||
#ifdef DEMO
|
||||
SoundReq(0x80080000);
|
||||
DoFade(7, 4);
|
||||
#else
|
||||
sub_08052418(0, 0);
|
||||
gScreen.lcd.displayControl |= 0x600;
|
||||
gFadeControl.field_0x4 = 0xffff;
|
||||
DoFade(4, 0x10);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -72,6 +77,13 @@ void sub_0805212C(void) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEMO
|
||||
void sub_080521A0(void) {
|
||||
if (gFadeControl.active == 0) {
|
||||
DoSoftReset();
|
||||
}
|
||||
}
|
||||
#else
|
||||
void sub_080521A0(void) {
|
||||
s32 temp3;
|
||||
u32 temp2;
|
||||
@@ -147,6 +159,7 @@ void sub_080521A0(void) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_080522F4(void) {
|
||||
switch (gMenu.menuType) {
|
||||
@@ -211,7 +224,11 @@ void sub_080523D4(void) {
|
||||
gOamCmd.y = gMenu.focusCoords[0];
|
||||
for (i = 0; i < 8; ++i) {
|
||||
gOamCmd.x = gUnk_080FCA84[i];
|
||||
#ifdef EU
|
||||
sub_080ADA14(0x1fc, i);
|
||||
#else
|
||||
sub_080ADA14(0x1fd, i);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,16 +306,26 @@ void InitializePlayer(void) {
|
||||
}
|
||||
|
||||
bool32 sub_08052620(u32 r0) {
|
||||
#ifdef EU
|
||||
return gArea == 0x01;
|
||||
#else
|
||||
return gArea == 0x81;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool32 sub_08052638(u32 r0) {
|
||||
#if EU
|
||||
return gUnk_08127D30[r0 * 4] == 0x01;
|
||||
#else
|
||||
return gUnk_08127D30[r0 * 4] == 0x81;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef EU
|
||||
u32 sub_08052654() {
|
||||
return (gArea >> 7) & 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
u32 CheckIsDungeon(void) {
|
||||
return (gArea >> 2) & 1;
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "gba/m4a.h"
|
||||
|
||||
#include "gba/gba.h"
|
||||
|
||||
// ASCII encoding of 'Smsh' in reverse
|
||||
@@ -1066,7 +1065,7 @@ void CgbModVol(CgbChannel* chan) {
|
||||
// Force chan->rightVolume and chan->leftVolume to be read from memory again,
|
||||
// even though there is no reason to do so.
|
||||
// The command line option "-fno-gcse" achieves the same result as this.
|
||||
#ifndef NONMATCHING
|
||||
#ifndef NON_MATCHING
|
||||
asm("" : : : "memory");
|
||||
#endif
|
||||
|
||||
|
||||
+61
-1
@@ -104,6 +104,22 @@ static void HandleNintendoCapcomLogos(void) {
|
||||
gScreen.bg.bg1Updated = 1;
|
||||
DoFade(6, 8);
|
||||
advance = ADVANCE_NONE;
|
||||
#ifdef DEMO
|
||||
if (gUnk_02000010.listenForKeyPresses == 0) {
|
||||
if ((gInput.heldKeys & 0x204) == 0x204) { // TODO
|
||||
gUnk_02000010.field_0x7 = 1;
|
||||
SoundReq(0x73);
|
||||
} else {
|
||||
if ((gInput.heldKeys & 0x104) == 0x104) { // TODO
|
||||
gUnk_02000010.field_0x7 = 2;
|
||||
SoundReq(0xcd);
|
||||
} else {
|
||||
gUnk_02000010.field_0x7 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
} else {
|
||||
if (advance == ADVANCE_TIMER_EXPIRED) {
|
||||
advance = ADVANCE_KEY_PRESSED;
|
||||
@@ -174,11 +190,17 @@ static void HandleTitlescreen(void) {
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
#if defined(JP) || defined(EU)
|
||||
if (GetAdvanceState()) {
|
||||
#else
|
||||
if (--gIntroState.timer == 0) {
|
||||
#endif
|
||||
gIntroState.timer = 3600;
|
||||
gIntroState.state++;
|
||||
}
|
||||
#if defined(USA) || defined(DEMO)
|
||||
UpdatePressStartIcon();
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
advance = GetAdvanceState();
|
||||
@@ -191,11 +213,31 @@ static void HandleTitlescreen(void) {
|
||||
AdvanceIntroSequence(advance);
|
||||
SoundReq(SONG_VOL_FADE_OUT);
|
||||
}
|
||||
UpdatePressStartIcon();
|
||||
#ifdef JP
|
||||
gOamCmd._4 = 0;
|
||||
gOamCmd._6 = 0;
|
||||
gOamCmd._8 = 0xE020;
|
||||
gOamCmd.x = 120;
|
||||
gOamCmd.y = 152;
|
||||
sub_080ADA14(511, 1);
|
||||
#elif defined(EU)
|
||||
gOamCmd._4 = 0;
|
||||
gOamCmd._6 = 0;
|
||||
gOamCmd._8 = 0xE020;
|
||||
gOamCmd.x = 120;
|
||||
gOamCmd.y = 152;
|
||||
sub_080ADA14(510, 1);
|
||||
#else
|
||||
UpdatePressStartIcon();
|
||||
#endif
|
||||
if ((gIntroState.timer & 0x20) == 0) {
|
||||
gOamCmd._8 = 0xe000;
|
||||
gOamCmd.y = 0x84;
|
||||
#ifdef EU
|
||||
sub_080ADA14(0x1fe, 0);
|
||||
#else
|
||||
sub_080ADA14(0x1ff, 0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (gIntroState.gameLanguage != gUnk_02000000->gameLanguage) {
|
||||
@@ -207,6 +249,7 @@ static void HandleTitlescreen(void) {
|
||||
sub_080AD9B0();
|
||||
}
|
||||
|
||||
#if defined(USA) || defined(DEMO)
|
||||
static void UpdatePressStartIcon(void) {
|
||||
gOamCmd._4 = 0;
|
||||
gOamCmd._6 = 0;
|
||||
@@ -215,6 +258,7 @@ static void UpdatePressStartIcon(void) {
|
||||
gOamCmd.y = 152;
|
||||
sub_080ADA14(511, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void UpdateSwordBgAffineData(void) {
|
||||
struct BgAffineSrcData aff;
|
||||
@@ -251,7 +295,11 @@ static void HandleJapaneseTitlescreenAnimationIntro(void) {
|
||||
if (!gFadeControl.active) {
|
||||
gFadeControl.field_0x4 = -1;
|
||||
gIntroState.subState++;
|
||||
#if defined(JP) || defined(EU)
|
||||
gIntroState.timer = 120;
|
||||
#else
|
||||
gIntroState.timer = 90;
|
||||
#endif
|
||||
pEVar2 = CreateObject(OBJECT_B4, 0, 0);
|
||||
if (pEVar2 != NULL) {
|
||||
pEVar2->x.HALF.HI = 0;
|
||||
@@ -262,7 +310,11 @@ static void HandleJapaneseTitlescreenAnimationIntro(void) {
|
||||
case 2:
|
||||
if (GetAdvanceState() != ADVANCE_NONE) {
|
||||
gIntroState.state++;
|
||||
#if defined(JP) || defined(EU)
|
||||
gIntroState.timer = 30;
|
||||
#else
|
||||
gIntroState.timer = 60;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -288,7 +340,11 @@ static void HandleTitlescreenAnimationIntro(void) {
|
||||
break;
|
||||
case 2:
|
||||
if (--gIntroState.timer == 0) {
|
||||
#if defined(JP) || defined(EU)
|
||||
gIntroState.timer = 360;
|
||||
#else
|
||||
gIntroState.timer = 300;
|
||||
#endif
|
||||
gIntroState.subState++;
|
||||
CreateObject(OBJECT_BD, 0, 0);
|
||||
DoFade(6, 16);
|
||||
@@ -298,7 +354,11 @@ static void HandleTitlescreenAnimationIntro(void) {
|
||||
default:
|
||||
if (!gFadeControl.active && GetAdvanceState() != ADVANCE_NONE) {
|
||||
gIntroState.state++;
|
||||
#if defined(JP) || defined(EU)
|
||||
gIntroState.timer = 30;
|
||||
#else
|
||||
gIntroState.timer = 60;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
#include "item.h"
|
||||
#include "coord.h"
|
||||
#include "audio.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0811BD98[])(ItemBehavior*, u32);
|
||||
|
||||
extern Entity* CreatePlayerBomb();
|
||||
extern s8 gUnk_0811BDAC[];
|
||||
extern void ModBombs(s32);
|
||||
|
||||
void ItemBomb(ItemBehavior* this, u32 arg1) {
|
||||
gUnk_0811BD98[this->stateID](this, arg1);
|
||||
}
|
||||
|
||||
void sub_08075FF8(ItemBehavior* this, u32 arg1) {
|
||||
Entity* entity;
|
||||
u32 maxBombs;
|
||||
u32 bombCount;
|
||||
s8* tmp;
|
||||
s32 x;
|
||||
s32 y;
|
||||
|
||||
if ((gPlayerState.jumpStatus | gPlayerState.field_0x3[1]) == 0) {
|
||||
bombCount = 0;
|
||||
for (entity = FindEntityByID(8, 2, 2); entity != NULL; entity = FindNextDuplicateID(entity, 2)) {
|
||||
bombCount += 1;
|
||||
}
|
||||
maxBombs = this->behaviorID == 7 ? 3 : 1;
|
||||
if (maxBombs > bombCount) {
|
||||
entity = CreatePlayerBomb(this, 2);
|
||||
if (entity != NULL) {
|
||||
tmp = &gUnk_0811BDAC[gPlayerEntity.animationState & 6];
|
||||
// TODO fix array access
|
||||
x = tmp[0] << 0x10;
|
||||
y = tmp[1] << 0x10;
|
||||
PositionRelative(&gPlayerEntity, entity, x, y);
|
||||
ModBombs(-1);
|
||||
SoundReq(SFX_104);
|
||||
}
|
||||
}
|
||||
}
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
|
||||
// TODO arg1 type not yet known, called by sub_080761C0 and sub_080762D8
|
||||
ASM_FUNC("asm/non_matching/itemBomb/sub_08076088.inc", void sub_08076088(ItemBehavior* this, void* arg1))
|
||||
@@ -0,0 +1,36 @@
|
||||
#include "item.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0811BD78[])(ItemBehavior*, u32);
|
||||
|
||||
extern void sub_08078F60(void);
|
||||
|
||||
void ItemBoomerang(ItemBehavior* this, u32 arg1) {
|
||||
gUnk_0811BD78[this->stateID](this, arg1);
|
||||
}
|
||||
|
||||
void sub_08075D2C(ItemBehavior* this, u32 arg1) {
|
||||
if (((gPlayerState.field_0x3[1] & 8) == 0) && (sub_08077C94(this, this->behaviorID) == NULL)) {
|
||||
this->field_0x5[4] |= 0xf;
|
||||
sub_0806F948(&gPlayerEntity);
|
||||
sub_08077C0C(this, 0xb);
|
||||
sub_08077D38(this, arg1);
|
||||
gPlayerState.field_0x3[1] |= 8;
|
||||
} else {
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08075D88(ItemBehavior* this, u32 arg1) {
|
||||
if ((gPlayerState.field_0x3[1] & 0x80) == 0) {
|
||||
if (((this->behaviorID == 0xc) && ((gPlayerState.field_0xa & 0x80) != 0)) && ((this->field_0x5[9] & 2) != 0)) {
|
||||
sub_08078F60();
|
||||
return;
|
||||
}
|
||||
UpdateItemAnim(this);
|
||||
if ((this->field_0x5[9] & 0x80) == 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
#include "item.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
extern void (*const gUnk_0811BD80[])(ItemBehavior*, u32);
|
||||
|
||||
extern void sub_08077E3C(ItemBehavior*, u32);
|
||||
|
||||
void ItemBow(ItemBehavior* this, u32 arg1) {
|
||||
gUnk_0811BD80[this->stateID](this, arg1);
|
||||
}
|
||||
|
||||
void sub_08075DF4(ItemBehavior* this, u32 arg1) {
|
||||
if ((gPlayerState.field_0x3[1] & 8) == 0) {
|
||||
this->field_0x5[4] |= 0x80;
|
||||
sub_0806F948(&gPlayerEntity);
|
||||
sub_08077BB8(this);
|
||||
sub_08077D38(this, arg1);
|
||||
gPlayerState.field_0x1d[4] = 1;
|
||||
} else {
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08075E40(ItemBehavior* this, u32 arg1) {
|
||||
u8 bVar1;
|
||||
|
||||
if (gPlayerState.field_0x1d[4] != 0) {
|
||||
bVar1 = gPlayerState.field_0x3[1] & 0x80;
|
||||
if (bVar1 == 0) {
|
||||
UpdateItemAnim(this);
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
this->stateID = 2;
|
||||
this->field_0x5[4] &= 0x7f;
|
||||
if (gSave.stats.arrowCount != 0) {
|
||||
this->field_0xf = bVar1;
|
||||
gPlayerState.field_0xa &= ~(8 >> arg1);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
gPlayerState.field_0x1d[4] = 0;
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
|
||||
void sub_08075EC0(ItemBehavior* this, u32 arg1) {
|
||||
u8 arrowCount;
|
||||
s32 iVar2;
|
||||
|
||||
arrowCount = gSave.stats.arrowCount;
|
||||
iVar2 = sub_08077EFC(this);
|
||||
if (iVar2 != 0 && arrowCount != 0) {
|
||||
if (((gPlayerState.field_0x3[1] & 0x80) != 0) || (gPlayerState.field_0x1d[4] == 0)) {
|
||||
gPlayerState.field_0x1d[4] = 0;
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
} else {
|
||||
gPlayerState.field_0xa = (8 >> arg1) | gPlayerState.field_0xa;
|
||||
sub_08077DF4(this, 0x27c);
|
||||
this->field_0xf = 0xf;
|
||||
this->field_0x5[4] |= 0xf;
|
||||
this->stateID = 3;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08075F38(ItemBehavior* this, u32 arg1) {
|
||||
if (((gPlayerState.field_0x3[1] & 0x80) == 0) && (gPlayerState.field_0x1d[4] != 0)) {
|
||||
UpdateItemAnim(this);
|
||||
if ((this->field_0x5[9] & 1) != 0) {
|
||||
this->stateID = 4;
|
||||
}
|
||||
} else {
|
||||
gPlayerState.field_0x1d[4] = 0;
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08075F84(ItemBehavior* this, u32 arg1) {
|
||||
if (((gPlayerState.field_0x3[1] & 0x80) == 0) && (gPlayerState.field_0x1d[4] != 0)) {
|
||||
if (GetInventoryValue(0x70) == 1) {
|
||||
sub_08077E3C(this, 5);
|
||||
} else {
|
||||
UpdateItemAnim(this);
|
||||
}
|
||||
if ((this->field_0x5[9] & 0x80) == 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
gPlayerState.field_0x1d[4] = 0;
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "item.h"
|
||||
|
||||
extern Entity* sub_08077BD4(ItemBehavior*);
|
||||
extern void sub_08077E78(ItemBehavior*, u32);
|
||||
|
||||
void ItemDebug(ItemBehavior* beh, u32 arg1) {
|
||||
sub_08077BD4(beh);
|
||||
sub_08077E78(beh, arg1);
|
||||
}
|
||||
+28
-2
@@ -1,10 +1,36 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "item.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0811BDF4[])(ItemBehavior* beh, u32);
|
||||
|
||||
void ItemGustJar(ItemBehavior* beh, u32 arg1) {
|
||||
void ItemGustJar(ItemBehavior* this, u32 arg1) {
|
||||
gPlayerState.field_0xa8 = 3;
|
||||
gUnk_0811BDF4[beh->stateID](beh, arg1);
|
||||
gUnk_0811BDF4[this->stateID](this, arg1);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/itemGustJar/sub_08076DF4.inc", void sub_08076DF4(ItemBehavior* this, u32 arg1))
|
||||
|
||||
void sub_08076E60(ItemBehavior* this, u32 arg1) {
|
||||
Entity* playerItem;
|
||||
|
||||
if ((gPlayerState.field_0x1c & 0xf) == 0) {
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
this->stateID = 2;
|
||||
sub_08077DF4(this, 0x504);
|
||||
gPlayerState.field_0xa = gPlayerState.field_0xa & ~(8 >> arg1);
|
||||
playerItem = CreatePlayerItem(0x10, 0, 0, 0);
|
||||
if (playerItem != NULL) {
|
||||
playerItem->parent = &gPlayerEntity;
|
||||
}
|
||||
} else {
|
||||
UpdateItemAnim(this);
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/itemGustJar/sub_08076EC8.inc", void sub_08076EC8(ItemBehavior* this, u32 arg1))
|
||||
|
||||
ASM_FUNC("asm/non_matching/itemGustJar/sub_08076F64.inc", void sub_08076F64(ItemBehavior* this, u32 arg1))
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
#include "item.h"
|
||||
#include "save.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0811BE28[])(ItemBehavior*, u32);
|
||||
|
||||
extern u8 gUnk_02002AC8[];
|
||||
extern void sub_08077BB8(ItemBehavior*);
|
||||
|
||||
void ItemJarEmpty(ItemBehavior* this, u32 arg1) {
|
||||
gUnk_0811BE28[this->stateID](this, arg1);
|
||||
}
|
||||
|
||||
void sub_08077534(ItemBehavior* this, u32 arg1) {
|
||||
u32 tmp;
|
||||
sub_08077D38(this, arg1);
|
||||
sub_0806F948(&gPlayerEntity);
|
||||
sub_08077BB8(this);
|
||||
this->field_0x5[4] |= 0xf;
|
||||
tmp = this->behaviorID;
|
||||
this->field_0x5[2] = gSave.filler86[tmp + 0x14];
|
||||
switch (this->field_0x5[2]) {
|
||||
case 0x20:
|
||||
sub_08077DF4(this, 0x614);
|
||||
return;
|
||||
case 0x21:
|
||||
case 0x22:
|
||||
case 0x23:
|
||||
case 0x24:
|
||||
case 0x25:
|
||||
case 0x29:
|
||||
case 0x2a:
|
||||
case 0x2b:
|
||||
case 0x2c:
|
||||
case 0x2d:
|
||||
case 0x2e:
|
||||
this->stateID = 3;
|
||||
gPlayerEntity.animationState = 4;
|
||||
gPlayerEntity.spriteSettings.b.flipX = 0;
|
||||
sub_08077DF4(this, 0x2df);
|
||||
break;
|
||||
case 0x2f:
|
||||
case 0x30:
|
||||
case 0x31:
|
||||
default:
|
||||
this->stateID = 3;
|
||||
sub_08077DF4(this, 0x610);
|
||||
break;
|
||||
}
|
||||
gPlayerEntity.flags &= 0x7f;
|
||||
}
|
||||
|
||||
void sub_08077618(ItemBehavior* this, u32 arg1) {
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
sub_08077DF4(this, 0x618);
|
||||
this->stateID += 1;
|
||||
} else {
|
||||
UpdateItemAnim(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08077640(ItemBehavior* this, u32 arg1) {
|
||||
UpdateItemAnim(this);
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
gPlayerEntity.flags |= 0x80;
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0807766C(ItemBehavior* this, u32 arg1) {
|
||||
UpdateItemAnim(this);
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
gPlayerEntity.flags |= 0x80;
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
#include "item.h"
|
||||
#include "functions.h"
|
||||
#include "audio.h"
|
||||
|
||||
extern void (*const gUnk_0811BD68[])(ItemBehavior*, u32);
|
||||
|
||||
extern s8 gUnk_08126EEC[];
|
||||
extern Entity* sub_08077BD4(ItemBehavior*);
|
||||
|
||||
extern bool32 sub_08077F10(ItemBehavior*);
|
||||
|
||||
extern void sub_0807AB44(Entity*, s32, s32);
|
||||
|
||||
void ItemLantern(ItemBehavior* this, u32 arg1) {
|
||||
gUnk_0811BD68[this->stateID](this, arg1);
|
||||
}
|
||||
|
||||
void sub_08075A0C(ItemBehavior* this, u32 arg1) {
|
||||
Entity* object;
|
||||
u32 itemSlot;
|
||||
s8* tmp;
|
||||
itemSlot = IsItemEquipped(this->behaviorID);
|
||||
if (gPlayerState.heldObject != 0 || gPlayerState.playerAction == 0x18 || gPlayerState.jumpStatus != 0 ||
|
||||
gPlayerState.field_0x2c != NULL || (gPlayerState.flags.all & 0x80) != 0) {
|
||||
ForceEquipItem(0xf, itemSlot);
|
||||
gPlayerState.flags.all &= 0xff7fffff;
|
||||
ForceEquipItem(0xf, itemSlot);
|
||||
sub_08077E78(this, arg1);
|
||||
} else {
|
||||
|
||||
this->field_0x5[4] |= 0x80;
|
||||
sub_08077D38(this, arg1);
|
||||
sub_08077BD4(this);
|
||||
sub_0806F948(&gPlayerEntity);
|
||||
this->behaviorID = 0x10;
|
||||
ForceEquipItem(0x10, itemSlot);
|
||||
tmp = &gUnk_08126EEC[gPlayerEntity.animationState & 6];
|
||||
object = CreateObjectWithParent(&gPlayerEntity, 0x45, 1, 0);
|
||||
if (object != NULL) {
|
||||
object->spriteVramOffset = gPlayerEntity.spriteVramOffset;
|
||||
object->x.HALF.HI = tmp[0] + object->x.HALF.HI;
|
||||
object->y.HALF.HI = tmp[1] + object->y.HALF.HI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/sub_08075ADC.inc", void sub_08075ADC(ItemBehavior* this, u32 arg1))
|
||||
#else
|
||||
void sub_08075ADC(ItemBehavior* this, u32 arg1) {
|
||||
u32 bVar1;
|
||||
|
||||
if (gPlayerState.field_0x2c != NULL || (this->field_0x5[9] & 1) == 0 || (gPlayerState.flags.all & 0x110) != 0 ||
|
||||
sub_08079D48() == 0) {
|
||||
this->field_0xf = 0;
|
||||
this->stateID += 1;
|
||||
gPlayerState.flags.all |= 0x800000;
|
||||
bVar1 = 8 >> arg1;
|
||||
gPlayerState.field_0x3[1] = gPlayerState.field_0x3[1] & ~((bVar1 << 4) | bVar1);
|
||||
bVar1 = ~bVar1;
|
||||
gPlayerState.field_0xa = bVar1 & gPlayerState.field_0xa;
|
||||
gPlayerState.keepFacing = bVar1 & gPlayerState.keepFacing;
|
||||
SoundReq(SFX_ITEM_LANTERN_ON);
|
||||
} else {
|
||||
UpdateItemAnim(this);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_08075B54(ItemBehavior* this, u32 arg1) {
|
||||
u32 bVar1;
|
||||
u32 itemSlot;
|
||||
Entity* object;
|
||||
s8* tmp;
|
||||
|
||||
if ((gPlayerState.flags.all & 0x110) == 0) {
|
||||
itemSlot = IsItemEquipped(this->behaviorID);
|
||||
if (!(((sub_08077F10(this) == 0) && (itemSlot < 2)) || (gPlayerState.jumpStatus != 0))) {
|
||||
ForceEquipItem(0xf, itemSlot);
|
||||
gPlayerState.flags.all &= 0xff7fffff;
|
||||
sub_08077E78(this, arg1);
|
||||
SoundReq(SFX_ITEM_LANTERN_OFF);
|
||||
} else {
|
||||
if (((gPlayerState.playerAction != 0x18) && (gPlayerEntity.frameIndex < 0x37)) &&
|
||||
((u16)gPlayerEntity.spriteIndex == 6)) {
|
||||
tmp = &gUnk_08126EEC[gPlayerEntity.animationState & 6];
|
||||
|
||||
if ((gPlayerState.jumpStatus == 0) &&
|
||||
(sub_080002F0(TILE(gPlayerEntity.x.HALF.HI + tmp[0], gPlayerEntity.y.HALF.HI + tmp[1]),
|
||||
gPlayerEntity.collisionLayer, 0x40) != 0)) {
|
||||
this->field_0xf = 0xf;
|
||||
this->stateID += 1;
|
||||
gPlayerEntity.field_0x7a.HWORD = 2;
|
||||
object = CreateObjectWithParent(&gPlayerEntity, 0x45, 1, 0);
|
||||
if (object != NULL) {
|
||||
object->spriteVramOffset = gPlayerEntity.spriteVramOffset;
|
||||
object->x.HALF.HI = tmp[0] + object->x.HALF.HI;
|
||||
object->y.HALF.HI = tmp[1] + object->y.HALF.HI;
|
||||
}
|
||||
sub_08077DF4(this, 0x60c);
|
||||
bVar1 = (8 >> (arg1));
|
||||
gPlayerState.field_0xa = bVar1 | gPlayerState.field_0xa;
|
||||
gPlayerState.keepFacing = bVar1 | gPlayerState.keepFacing;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08075C9C(ItemBehavior* this, u32 arg1) {
|
||||
s8* tmp;
|
||||
|
||||
UpdateItemAnim(this);
|
||||
if ((this->field_0x5[9] & 0x10) != 0) {
|
||||
tmp = &gUnk_08126EEC[gPlayerEntity.animationState & 6];
|
||||
sub_0807AB44(&gPlayerEntity, tmp[0], tmp[1]);
|
||||
}
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
this->field_0xf = 0;
|
||||
this->stateID -= 1;
|
||||
gPlayerState.field_0xa = (~(8 >> arg1)) & gPlayerState.field_0xa;
|
||||
gPlayerState.keepFacing = (~(8 >> arg1)) & gPlayerState.keepFacing;
|
||||
} else {
|
||||
gPlayerEntity.field_0x7a.HWORD += 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
|
||||
#include "item.h"
|
||||
#include "functions.h"
|
||||
#include "audio.h"
|
||||
|
||||
extern void (*const gUnk_0811BE04[])(ItemBehavior*, u32);
|
||||
|
||||
s32 sub_080774A0(void);
|
||||
|
||||
extern u8 gUnk_0811BE14[];
|
||||
extern s32 sub_0800875A(Entity*, u32, ItemBehavior*);
|
||||
|
||||
extern void sub_08079E08();
|
||||
|
||||
void ItemMoleMitts(ItemBehavior* this, u32 arg1) {
|
||||
gUnk_0811BE04[this->stateID](this, arg1);
|
||||
}
|
||||
|
||||
void sub_08077130(ItemBehavior* this, u32 arg1) {
|
||||
s32 iVar1;
|
||||
|
||||
if (gPlayerState.jumpStatus == 0) {
|
||||
sub_08077D38(this, arg1);
|
||||
gPlayerState.field_0x3c[1] = 1;
|
||||
this->field_0x5[4] |= 0x80;
|
||||
iVar1 = sub_080774A0();
|
||||
if (iVar1 != 0) {
|
||||
if (this->field_0x5[2] == 0) {
|
||||
sub_08077DF4(this, 0x50c);
|
||||
this->stateID = 2;
|
||||
if (iVar1 == 0x56) {
|
||||
if ((gPlayerEntity.animationState & 2) != 0) {
|
||||
gPlayerEntity.y.HALF.HI = (gPlayerEntity.y.HALF.HI & 0xfff0) | 6;
|
||||
} else {
|
||||
gPlayerEntity.x.HALF.HI = (gPlayerEntity.x.HALF.HI & 0xfff0) | 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sub_08077DF4(this, 0x508);
|
||||
this->stateID = 1;
|
||||
}
|
||||
} else {
|
||||
sub_08077E78(this, arg1);
|
||||
gPlayerState.field_0x3c[1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080771C8(ItemBehavior* this, u32 arg1) {
|
||||
Entity* object;
|
||||
|
||||
UpdateItemAnim(this);
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
sub_08077E78(this, arg1);
|
||||
gPlayerState.field_0x3c[1] = 0;
|
||||
} else {
|
||||
if (((this->field_0x5[9] & 0x20) != 0) && (this->field_0x5[3] == 0xff)) {
|
||||
CreateObjectWithParent(&gPlayerEntity, 0x1e, this->field_0x5[9], 1);
|
||||
}
|
||||
if ((this->field_0x5[9] & 0x10) != 0) {
|
||||
if (sub_0800875A(&gPlayerEntity, 0xd, this) == 0) {
|
||||
sub_08077DF4(this, 0x520);
|
||||
this->stateID = 3;
|
||||
SoundReq(SFX_107);
|
||||
} else {
|
||||
if (this->field_0x5[3] != 0xff) {
|
||||
object = CreateObjectWithParent(&gPlayerEntity, 0x1f, 0, this->field_0x2[1]);
|
||||
if (object != NULL) {
|
||||
object->actionDelay = this->field_0x5[2];
|
||||
object->field_0xf = this->field_0x5[3];
|
||||
object->animationState = gPlayerEntity.animationState & 6;
|
||||
gPlayerEntity.frames.all = 0;
|
||||
gPlayerEntity.frameDuration = gUnk_0811BE14[this->field_0x5[3]];
|
||||
}
|
||||
} else {
|
||||
if ((this->field_0x2[1] == 0x0f) && (this->field_0x5[2] == 0x17)) {
|
||||
this->field_0x5[3] = 0;
|
||||
}
|
||||
}
|
||||
SoundReq(SFX_108);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/itemMoleMitts/sub_080772A8.inc", void sub_080772A8(ItemBehavior* this, u32 arg1))
|
||||
|
||||
void sub_08077448(ItemBehavior* this, u32 arg1) {
|
||||
gPlayerEntity.direction = gPlayerEntity.animationState << 2 ^ 0x10;
|
||||
gPlayerEntity.speed = 0x100;
|
||||
if (((this->field_0x5[9] & 1) != 0) && (this->field_0x5[0] != 0)) {
|
||||
sub_08079E08();
|
||||
}
|
||||
UpdateItemAnim(this);
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
gPlayerState.field_0x3c[1] = 0;
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/itemMoleMitts/sub_080774A0.inc", s32 sub_080774A0(void))
|
||||
+42
-29
@@ -1,39 +1,52 @@
|
||||
#include "item.h"
|
||||
#include "audio.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gOcarinaStates[4])(ItemBehavior*, u32);
|
||||
|
||||
extern void sub_08078F60(void);
|
||||
extern void sub_0805E544(void);
|
||||
|
||||
#if 0
|
||||
void Ocarina(ItemBehavior* beh, u32 inputFlags) {
|
||||
gOcarinaStates[beh->stateID](beh, inputFlags);
|
||||
gPlayerEntity.field_0x7a++;
|
||||
extern void CreateBird(void);
|
||||
extern void UnfreezeTime(void);
|
||||
|
||||
void ItemOcarina(ItemBehavior* this, u32 arg1) {
|
||||
gOcarinaStates[this->stateID](this, arg1);
|
||||
gPlayerEntity.field_0x7a.HWORD += 1;
|
||||
}
|
||||
|
||||
void OcarinaUse(ItemBehavior *beh, u32 arg1)
|
||||
{
|
||||
u32 bVar1;
|
||||
|
||||
if (gPlayerState.playerAction == 0x18) {
|
||||
PlayerChangeState(beh, arg1);
|
||||
}
|
||||
else {
|
||||
beh->field_0x5[4] = beh->field_0x5[4] | 0xf;
|
||||
gPlayerEntity.animationState = 4;
|
||||
gPlayerEntity.spriteSettings.b.flipX = 0;
|
||||
gPlayerEntity.flags &= 0x7f;
|
||||
gPlayerEntity.field_0x7a = 2;
|
||||
gPlayerState.flags.all |= 0x10000000;
|
||||
gPlayerState.field_0x27[0] = 0xff;
|
||||
gUnk_02034490[0] = 1;
|
||||
bVar1 = (8 >> arg1);
|
||||
gPlayerState.field_0xa |= bVar1;
|
||||
gPlayerState.keepFacing |= bVar1;
|
||||
sub_08078F60();
|
||||
sub_08077D38(beh, arg1);
|
||||
SoundReq(0x216);
|
||||
sub_0805E544();
|
||||
}
|
||||
void OcarinaUse(ItemBehavior* this, u32 arg1) {
|
||||
if (gPlayerState.playerAction == 0x18) {
|
||||
sub_08077E78(this, arg1);
|
||||
} else {
|
||||
this->field_0x5[4] |= 0xf;
|
||||
gPlayerEntity.animationState = 0x04;
|
||||
gPlayerEntity.spriteSettings.b.flipX = 0;
|
||||
gPlayerEntity.flags &= 0x7f;
|
||||
gPlayerEntity.field_0x7a.HWORD = 2;
|
||||
gPlayerState.flags.all |= 0x10000000;
|
||||
gPlayerState.field_0x27[0] = -1;
|
||||
gUnk_02034490[0] = 1;
|
||||
gPlayerState.field_0xa = (8 >> arg1) | gPlayerState.field_0xa;
|
||||
gPlayerState.keepFacing = (8 >> arg1) | gPlayerState.keepFacing;
|
||||
sub_08078F60();
|
||||
sub_08077D38(this, arg1);
|
||||
SoundReq(SFX_216);
|
||||
sub_0805E544();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
NONMATCH("asm/non_matching/ocarina/OcarinaUpdate.inc", void OcarinaUpdate(ItemBehavior* this, u32 arg1)) {
|
||||
// TODO regalloc
|
||||
UpdateItemAnim(this);
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
gPlayerEntity.flags |= 0x80;
|
||||
gPlayerState.flags.all &= 0xefffffff;
|
||||
gPlayerState.field_0x27[0] = 0;
|
||||
gUnk_02034490[0] = 0;
|
||||
CreateBird();
|
||||
UnfreezeTime();
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
#include "item.h"
|
||||
#include "audio.h"
|
||||
#include "random.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0811BDCC[])(ItemBehavior* beh, u32);
|
||||
|
||||
void sub_08076964(ItemBehavior*, u32);
|
||||
|
||||
void ItemPegasusBoots(ItemBehavior* this, u32 arg1) {
|
||||
u32 bVar1;
|
||||
Entity* fx;
|
||||
u32 uVar4;
|
||||
|
||||
if (gPlayerEntity.field_0x7a.HWORD != 0) {
|
||||
gPlayerState.field_0x1d[1] = 0;
|
||||
gPlayerState.field_0xe = 0;
|
||||
sub_08077E78(this, arg1);
|
||||
|
||||
} else {
|
||||
bVar1 = this->field_0x5[2] - 1;
|
||||
this->field_0x5[2] = bVar1;
|
||||
if ((bVar1 & 7) == 0) {
|
||||
SoundReq(SFX_PLY_LAND);
|
||||
}
|
||||
if (((gPlayerState.flags.all & 0x80) == 0) && ((this->field_0x5[2] & 7) == 0)) {
|
||||
if (gPlayerState.field_0x10[2] == 0x11) {
|
||||
if (gPlayerEntity.spriteOffsetY == 0) {
|
||||
CreateFx(&gPlayerEntity, 0x52, 0);
|
||||
}
|
||||
} else {
|
||||
fx = CreateFx(&gPlayerEntity, 0x11, 0x40);
|
||||
if ((fx != NULL) && (fx->y.HALF.HI = fx->y.HALF.HI + 2, this->stateID != 2)) {
|
||||
uVar4 = Random() & 3;
|
||||
if ((Random() & 1) != 0) {
|
||||
uVar4 = -uVar4;
|
||||
}
|
||||
fx->y.HALF.HI += uVar4;
|
||||
uVar4 = Random() & 7;
|
||||
if ((Random() & 1) != 0) {
|
||||
uVar4 = -uVar4;
|
||||
}
|
||||
fx->x.HALF.HI += uVar4;
|
||||
}
|
||||
}
|
||||
}
|
||||
gUnk_0811BDCC[this->stateID](this, arg1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080768F8(ItemBehavior* this, u32 arg1) {
|
||||
u32 bVar1;
|
||||
u32 bVar2;
|
||||
|
||||
bVar1 = gPlayerState.field_0x1c | gPlayerState.field_0x3[1] | gPlayerState.heldObject | gPlayerState.jumpStatus;
|
||||
bVar2 = (gPlayerState.flags.all & 0x1000);
|
||||
bVar1 |= bVar2;
|
||||
if (bVar1 == 0) {
|
||||
gPlayerState.field_0x1d[1] = 1;
|
||||
gPlayerState.field_0x1d[4] = bVar1;
|
||||
if ((gPlayerState.flags.all & 0x80) == 0) {
|
||||
this->field_0x5[2] = 0x10;
|
||||
} else {
|
||||
gPlayerState.field_0x8 = 0xc14;
|
||||
}
|
||||
sub_08077D38(this, arg1);
|
||||
sub_08076964(this, arg1);
|
||||
} else {
|
||||
gPlayerState.field_0x1d[1] = 0;
|
||||
gPlayerState.field_0xe = 0;
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/itemPegasusBoots/sub_08076964.inc", void sub_08076964(ItemBehavior* this, u32 arg1))
|
||||
|
||||
ASM_FUNC("asm/non_matching/itemPegasusBoots/sub_08076A88.inc", void sub_08076A88(ItemBehavior* this, u32 arg1))
|
||||
@@ -0,0 +1,90 @@
|
||||
#include "item.h"
|
||||
#include "audio.h"
|
||||
#include "functions.h"
|
||||
|
||||
void sub_08076758(ItemBehavior*, u32);
|
||||
extern void sub_08077F84(void);
|
||||
|
||||
extern bool32 sub_08077EFC(ItemBehavior*);
|
||||
|
||||
/*void ItemRocsCape(ItemBehavior* this, u32 arg1) {
|
||||
if (this->stateID != 0) {
|
||||
sub_08076758(this, arg1);
|
||||
return;
|
||||
}
|
||||
if (gPlayerState.field_0x2c == NULL) {
|
||||
if (gPlayerState.field_0x0[1] == 0) {
|
||||
if (((u8)(gPlayerState.field_0x1a[1] | gPlayerState.field_0xa | gPlayerState.field_0x3[1] |
|
||||
gPlayerState.heldObject | gPlayerState.field_0x1c | gPlayerState.field_0x3c[1]) == 0) &&
|
||||
((((1 < (u8)(gPlayerState.field_0x10[2] - 0x12) && (gPlayerState.field_0x10[2] != 1)) ||
|
||||
(gPlayerEntity.height.WORD != 0)) ||
|
||||
(gPlayerState.field_0x14 != 0)))) {
|
||||
if ((gPlayerState.jumpStatus != 0) && ((gPlayerState.jumpStatus & 7) != 3))
|
||||
goto _08076710;
|
||||
if (-1 < gPlayerEntity.height.WORD) {
|
||||
gPlayerEntity.field_0x20 = 0x20000;
|
||||
gPlayerState.jumpStatus = 1;
|
||||
gPlayerState.field_0x2c = NULL;
|
||||
this->stateID += 1;
|
||||
goto _0807673C;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (((gPlayerState.heldObject | gPlayerState.field_0x3[1]) == 0) &&
|
||||
(((gPlayerState.field_0x10[2] != 0x12 && (gPlayerState.field_0x10[2] != 1)) ||
|
||||
((gPlayerEntity.height.WORD != 0 || (gPlayerState.field_0x14 != 0)))))) {
|
||||
if ((gPlayerState.jumpStatus != 0) && ((gPlayerState.jumpStatus & 7) != 3)) {
|
||||
_08076710:
|
||||
sub_08076758(this, arg1);
|
||||
return;
|
||||
}
|
||||
if (-1 < gPlayerEntity.height.WORD) {
|
||||
gPlayerState.field_0x0[1] = 0;
|
||||
this->stateID += 1;
|
||||
gPlayerState.keepFacing = 0;
|
||||
gPlayerState.jumpStatus = 1;
|
||||
gPlayerState.field_0xe = -1;
|
||||
gPlayerState.field_0x2c = NULL;
|
||||
gPlayerEntity.field_0x20 = 0x20000;
|
||||
_0807673C:
|
||||
sub_08077F84();
|
||||
SoundReq(SFX_PLY_VO4);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
*/
|
||||
ASM_FUNC("asm/non_matching/itemRocsCape/ItemRocsCape.inc", void ItemRocsCape(ItemBehavior* this, u32 arg1))
|
||||
|
||||
void sub_08076758(ItemBehavior* this, u32 arg1) {
|
||||
s32 iVar1;
|
||||
|
||||
gPlayerState.field_0xe = 0;
|
||||
if ((((gPlayerState.jumpStatus & 0x28) == 0) && (gPlayerState.jumpStatus != 0)) &&
|
||||
((gPlayerState.jumpStatus & 7) != 3)) {
|
||||
if (sub_08077EFC(this)) {
|
||||
if (this->stateID < 2) {
|
||||
if ((gPlayerEntity.field_0x20 < 1) && ((gPlayerState.jumpStatus & 0x10) == 0)) {
|
||||
this->stateID = 2;
|
||||
gPlayerEntity.field_0x7a.HWORD = 2;
|
||||
gPlayerEntity.field_0x20 = 0x20000;
|
||||
gPlayerState.jumpStatus |= 0x10;
|
||||
gPlayerState.field_0x8 = 0x288;
|
||||
SoundReq(SFX_172);
|
||||
}
|
||||
} else {
|
||||
gPlayerEntity.field_0x7a.HWORD += 1;
|
||||
}
|
||||
} else {
|
||||
if (this->stateID > 1) {
|
||||
gPlayerEntity.field_0x7a.HWORD += 1;
|
||||
gPlayerState.jumpStatus &= 0xef;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
#include "item.h"
|
||||
#include "functions.h"
|
||||
#include "audio.h"
|
||||
|
||||
extern void (*const gUnk_0811BD44[])(ItemBehavior*, u32);
|
||||
|
||||
void sub_080759B8(ItemBehavior*, u32);
|
||||
|
||||
extern u32 sub_08077EC8(ItemBehavior*);
|
||||
|
||||
void sub_08075694(ItemBehavior* this, u32 arg1);
|
||||
|
||||
void ItemSword(ItemBehavior* this, u32 arg1) {
|
||||
gPlayerState.field_0xa8 = 0x02;
|
||||
gUnk_0811BD44[this->stateID](this, arg1);
|
||||
}
|
||||
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/sub_08075338.inc", void sub_08075338(ItemBehavior* this, u32 arg1))
|
||||
#else
|
||||
ASM_FUNC("asm/non_matching/itemSword/sub_08075338.inc", void sub_08075338(ItemBehavior* this, u32 arg1))
|
||||
#endif
|
||||
|
||||
ASM_FUNC("asm/non_matching/itemSword/sub_080754B8.inc", void sub_080754B8(ItemBehavior* this, u32 arg1))
|
||||
|
||||
void sub_08075580(ItemBehavior* this, u32 arg1) {
|
||||
if ((sub_08077EFC(this) != 0) && (gPlayerState.jumpStatus == 0)) {
|
||||
gPlayerState.field_0xa = gPlayerState.field_0xa & ~(8 >> arg1);
|
||||
gPlayerState.field_0x1a[1] = 1;
|
||||
gPlayerState.field_0x2c[0x40] = 0xd;
|
||||
this->field_0xf = 0;
|
||||
this->stateID = 2;
|
||||
if ((gPlayerState.field_0xac & 0x200) != 0) {
|
||||
this->field_0x5[2] = 0x28;
|
||||
} else {
|
||||
this->field_0x5[2] = 0x50;
|
||||
}
|
||||
sub_08077DF4(this, 0x168);
|
||||
CreateObject(0x43, 0, 0);
|
||||
return;
|
||||
}
|
||||
sub_080759B8(this, arg1);
|
||||
}
|
||||
|
||||
void sub_080755F0(ItemBehavior* this, u32 arg1) {
|
||||
if (sub_08077EFC(this) != 0) {
|
||||
if (sub_08077EC8(this) == 0) {
|
||||
if ((gPlayerState.field_0x1a[1] | gPlayerState.field_0x3[1]) != 0) {
|
||||
if (--this->field_0x5[2] == 0) {
|
||||
this->stateID = 3;
|
||||
this->field_0x5[4] |= 0x80;
|
||||
gPlayerState.field_0x1a[1] = gPlayerState.field_0x1a[1] | 0x20;
|
||||
}
|
||||
} else {
|
||||
sub_080759B8(this, arg1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sub_080759B8(this, arg1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0807564C(ItemBehavior* this, u32 arg1) {
|
||||
if ((gPlayerState.field_0x1a[1] | gPlayerState.field_0x3[1]) == 0) {
|
||||
sub_080759B8(this, arg1);
|
||||
} else {
|
||||
if ((sub_08077EC8(this) == 0) && ((sub_08077EFC(this) == 0 || ((gPlayerState.field_0x1a[1] & 0x80) != 0)))) {
|
||||
sub_08075694(this, arg1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08075694(ItemBehavior* this, u32 arg1) {
|
||||
this->field_0x5[2] = 1;
|
||||
if ((gPlayerState.flags.all & 0x8000000) != 0) {
|
||||
gPlayerState.flags.all &= 0xf7ffffff;
|
||||
gPlayerState.flags.all &= 0xfffbffff;
|
||||
sub_08077DF4(this, 300);
|
||||
} else {
|
||||
gPlayerState.field_0xab = 1;
|
||||
sub_08077DF4(this, 0x124);
|
||||
}
|
||||
gPlayerState.field_0xa = (8 >> arg1) | gPlayerState.field_0xa;
|
||||
this->stateID = 4;
|
||||
this->field_0xf = 6;
|
||||
gPlayerEntity.field_0x40 = 0x1e;
|
||||
gPlayerState.field_0x1a[1] |= 0x40;
|
||||
gPlayerState.field_0x1a[1] &= 0xdf;
|
||||
if ((gPlayerState.field_0xa0[0] == 0x04) && ((gPlayerState.flags.all & 0x400000) == 0)) {
|
||||
gPlayerState.field_0xa0[0] = 0x01;
|
||||
sub_0807A108();
|
||||
}
|
||||
SoundReq(SFX_PLY_VO2);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/itemSword/sub_08075738.inc", void sub_08075738(ItemBehavior* this, u32 arg1))
|
||||
|
||||
void sub_08075898(ItemBehavior* this, u32 arg1) {
|
||||
if (gPlayerState.field_0x3[1] == 0) {
|
||||
sub_080759B8(this, arg1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080758B0(ItemBehavior* this, u32 arg1) {
|
||||
if (gPlayerState.field_0x3[1] == 0) {
|
||||
sub_080759B8(this, arg1);
|
||||
} else {
|
||||
UpdateItemAnim(this);
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
this->field_0xf = 0;
|
||||
if ((gPlayerState.field_0x1a[1] & 0x20) != 0) {
|
||||
this->stateID = 3;
|
||||
} else {
|
||||
this->stateID = 5;
|
||||
}
|
||||
gPlayerState.field_0x1a[1] &= 0xf7;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/itemSword/sub_08075900.inc", void sub_08075900(ItemBehavior* this, u32 arg1))
|
||||
|
||||
void sub_080759B8(ItemBehavior* this, u32 arg1) {
|
||||
if ((gPlayerState.flags.all & 0x80) == 0) {
|
||||
gPlayerEntity.field_0x40 = 0;
|
||||
}
|
||||
gPlayerState.flags.all &= 0xf7ffffff;
|
||||
gPlayerState.field_0x1a[1] = 0;
|
||||
gPlayerState.field_0x2c = NULL;
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
#include "item.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0811BDB4[])(ItemBehavior*, u32);
|
||||
|
||||
u32 sub_08077F64(ItemBehavior* arg0, u32 unk);
|
||||
|
||||
void ItemTryPickupObject(ItemBehavior* this, u32 arg1) {
|
||||
gUnk_0811BDB4[this->stateID](this, arg1);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/itemTryPickupObject/sub_080761C0.inc", void sub_080761C0(ItemBehavior* this, u32 arg1))
|
||||
|
||||
void sub_080762C4(ItemBehavior* this, u32 arg1, u8 arg2, u32 arg3) {
|
||||
this->field_0x18 = arg1;
|
||||
gPlayerState.heldObject = arg2;
|
||||
sub_08077D38(this, arg3);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/itemTryPickupObject/sub_080762D8.inc", void sub_080762D8(ItemBehavior* this, u32 arg1))
|
||||
|
||||
void sub_08076488(ItemBehavior* this, u32 arg1) {
|
||||
u32 bVar1;
|
||||
s32 iVar2;
|
||||
|
||||
if (this->field_0x5[2] == 0) {
|
||||
if (sub_08077F64(this, arg1) != 0) {
|
||||
if (((*(u8*)((this->field_0x18) + 0x16) & 0xf0) == 0x10) && ((gScreenTransition.frameCount & 1U) != 0)) {
|
||||
return;
|
||||
}
|
||||
UpdateItemAnim(this);
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
gPlayerEntity.flags |= 0x80;
|
||||
gPlayerState.heldObject = 4;
|
||||
bVar1 = ~(8 >> arg1);
|
||||
gPlayerState.keepFacing = bVar1 & gPlayerState.keepFacing;
|
||||
gPlayerState.field_0xa = bVar1 & gPlayerState.field_0xa;
|
||||
this->stateID += 1;
|
||||
this->field_0xf = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->field_0x5[2] -= 1;
|
||||
}
|
||||
gPlayerState.field_0xa8 = 4;
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/itemTryPickupObject/sub_08076518.inc", void sub_08076518(ItemBehavior* this, u32 arg1))
|
||||
|
||||
void sub_080765E0(ItemBehavior* this, u32 arg1) {
|
||||
if (sub_08077F64(this, arg1) != 0) {
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
sub_08077F50(this, arg1);
|
||||
} else {
|
||||
UpdateItemAnim(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0807660C(ItemBehavior* this, u32 arg1) {
|
||||
UpdateItemAnim(this);
|
||||
if ((--this->field_0x5[2] == 0xff) || (gPlayerState.field_0x0[1] == 0)) {
|
||||
gPlayerState.field_0x0[1] = 0;
|
||||
sub_08077E78(this, arg1);
|
||||
}
|
||||
}
|
||||
+8
-6
@@ -71,18 +71,20 @@ void sub_0804B0B0(u32 arg0, u32 arg1) {
|
||||
LoadRoomEntityList(GetRoomProperty(arg0, arg1, 1));
|
||||
}
|
||||
|
||||
void SetCurrentRoomPropertyList(u32 arg0, u32 arg1) {
|
||||
void SetCurrentRoomPropertyList(u32 area, u32 room) {
|
||||
u32** arr;
|
||||
gUnk_02017654 = 0;
|
||||
arr = &gAreaTable;
|
||||
if (arr[arg0] != 0) {
|
||||
gUnk_02017654 = arr[arg0][arg1];
|
||||
if (arr[area] != 0) {
|
||||
gUnk_02017654 = arr[area][room];
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0804B0E8(u32 arg0, u32 arg1) {
|
||||
void (*func)();
|
||||
|
||||
// init function at index 4 of room data
|
||||
|
||||
func = (void (*)())GetRoomProperty(arg0, arg1, 4);
|
||||
if (func != NULL) {
|
||||
func();
|
||||
@@ -90,13 +92,13 @@ void sub_0804B0E8(u32 arg0, u32 arg1) {
|
||||
}
|
||||
|
||||
// returns multiple types of data?
|
||||
void* GetRoomProperty(u32 arg0, u32 arg1, u32 arg2) {
|
||||
void* GetRoomProperty(u32 area, u32 room, u32 arg2) {
|
||||
u32 temp;
|
||||
u32** arr;
|
||||
temp = 0;
|
||||
arr = &gAreaTable;
|
||||
if (arr[arg0] != NULL) {
|
||||
temp = arr[arg0][arg1];
|
||||
if (arr[area] != NULL) {
|
||||
temp = arr[area][room];
|
||||
if (temp != 0) {
|
||||
temp = *(u32*)(arg2 * 4 + temp);
|
||||
}
|
||||
|
||||
+23
-3
@@ -12,15 +12,24 @@
|
||||
|
||||
extern void HandleIntroScreen(void);
|
||||
extern void HandleChooseFileScreen(void);
|
||||
extern void HandleChooseDemoScreen(void);
|
||||
extern void HandleGameplayScreen(void);
|
||||
extern void HandleGameOverScreen(void);
|
||||
extern void HandleCreditsScreen(void);
|
||||
extern void HandleDebugTextScreen(void);
|
||||
|
||||
static void (*const sScreenHandlers[])(void) = {
|
||||
[SCREEN_INTRO] = HandleIntroScreen, [SCREEN_CHOOSE_FILE] = HandleChooseFileScreen,
|
||||
[SCREEN_GAMEPLAY] = HandleGameplayScreen, [SCREEN_GAME_OVER] = HandleGameOverScreen,
|
||||
[SCREEN_CREDITS] = HandleCreditsScreen, [SCREEN_DEBUG_TEXT] = HandleDebugTextScreen,
|
||||
[SCREEN_INTRO] = HandleIntroScreen,
|
||||
#ifdef DEMO
|
||||
[SCREEN_CHOOSE_FILE] = HandleChooseDemoScreen,
|
||||
#else
|
||||
[SCREEN_CHOOSE_FILE] = HandleChooseFileScreen,
|
||||
#endif
|
||||
|
||||
[SCREEN_GAMEPLAY] = HandleGameplayScreen,
|
||||
[SCREEN_GAME_OVER] = HandleGameOverScreen,
|
||||
[SCREEN_CREDITS] = HandleCreditsScreen,
|
||||
[SCREEN_DEBUG_TEXT] = HandleDebugTextScreen,
|
||||
};
|
||||
|
||||
static void sub_080560B8(void);
|
||||
@@ -158,7 +167,11 @@ const Defaults sDefaultSettings = {
|
||||
.saveFileId = 0,
|
||||
.messageSpeed = 1,
|
||||
.brightnessPref = 1,
|
||||
#ifdef EU
|
||||
.gameLanguage = 2, // TODO in EU 2 is english?
|
||||
#else
|
||||
.gameLanguage = GAME_LANGUAGE,
|
||||
#endif
|
||||
.name = "LINK",
|
||||
._e = 0,
|
||||
._f = 0,
|
||||
@@ -197,9 +210,16 @@ NONMATCH("asm/non_matching/sub_080560B8.inc", static void sub_080560B8(void)) {
|
||||
END_NONMATCH
|
||||
|
||||
u32 sub_08056134(void) {
|
||||
#ifdef EU
|
||||
if ((gUnk_02000000->signature != SIGNATURE) || (gUnk_02000000->saveFileId >= NUM_SAVE_SLOTS) ||
|
||||
(gUnk_02000000->messageSpeed >= MAX_MSG_SPEED) || (gUnk_02000000->brightnessPref >= MAX_BRIGHTNESS) ||
|
||||
(gUnk_02000000->gameLanguage <= GAME_LANGUAGE) || (gUnk_02000000->gameLanguage >= 7) ||
|
||||
(gUnk_02000000->_e != 0))
|
||||
#else
|
||||
if ((gUnk_02000000->signature != SIGNATURE) || (gUnk_02000000->saveFileId >= NUM_SAVE_SLOTS) ||
|
||||
(gUnk_02000000->messageSpeed >= MAX_MSG_SPEED) || (gUnk_02000000->brightnessPref >= MAX_BRIGHTNESS) ||
|
||||
(gUnk_02000000->gameLanguage != GAME_LANGUAGE) || (gUnk_02000000->_e != 0))
|
||||
#endif
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
||||
+9
-9
@@ -2,13 +2,13 @@
|
||||
|
||||
// TODO: change all manager arguments to be Entity* and cast to specific type later.
|
||||
void (*const gManagerFunctions[])() = {
|
||||
NULL, Manager1, Manager2, sub_080576C0, sub_08057854, sub_08057AD0, sub_08057CB4,
|
||||
Manager7_Main, sub_08057ED0, sub_080581D8, sub_08058380, sub_080585F0, sub_0805884C, sub_08058DD0,
|
||||
sub_08058E60, sub_08058ECC, sub_08059570, sub_080599B8, sub_080599EC, sub_08059DAC, sub_08059E58,
|
||||
sub_0805A280, sub_0805AB4C, sub_0805AD48, sub_0805ADD8, sub_0805AF60, sub_0805B030, sub_0805B3B4,
|
||||
sub_0805B53C, sub_0805B5C8, Manager1E_Handler, sub_0805B6F4, sub_0805B7A0, sub_0805B820, sub_0805B8EC,
|
||||
sub_0805BC74, sub_0805BF18, sub_0805C61C, sub_0805C6B8, Manager27, Manager28_Entry, sub_0805CB90,
|
||||
sub_0805CFC0, sub_0805D014, sub_0805D174, sub_0805D1FC, sub_0805D250, sub_0805D3C8, Manager30_Main,
|
||||
sub_0805D630, sub_0805D7A4, sub_0805DAE8, sub_0805DB94, sub_0805DC84, sub_0805DDB4, sub_0805DE38,
|
||||
sub_0805E0A8, sub_0805E0FC
|
||||
NULL, Manager1_Main, Manager2_Main, Manager3_Main, Manager4_Main, Manager5_Main, Manager6_Main,
|
||||
Manager7_Main, Manager8_Main, Manager9_Main, ManagerA_Main, ManagerB_Main, ManagerC_Main, ManagerD_Main,
|
||||
ManagerE_Main, sub_08058ECC, Manager10_Main, Manager11_Main, Manager12_Main, Manager13_Main, Manager14_Main,
|
||||
Manager15_Main, Manager16_Main, Manager17_Main, Manager18_Main, Manager19_Main, Manager1A_Main, Manager1B_Main,
|
||||
Manager1C_Main, Manager1D_Main, Manager1E_Main, Manager1F_Main, Manager20_Main, Manager21_Main, Manager22_Main,
|
||||
Manager23_Main, Manager24_Main, Manager25_Main, Manager26_Main, Manager27_Main, Manager28_Main, Manager29_Main,
|
||||
Manager2A_Main, Manager2B_Main, Manager2C_Main, Manager2D_Main, Manager2E_Main, Manager2F_Main, Manager30_Main,
|
||||
Manager31_Main, Manager32_Main, Manager33_Main, Manager34_Main, Manager35_Main, Manager36_Main, Manager37_Main,
|
||||
Manager38_Main, Manager39_Main
|
||||
};
|
||||
|
||||
+15
-1
@@ -12,7 +12,7 @@ extern void (*const gUnk_08107C48[])(Entity*);
|
||||
|
||||
extern u8 gUnk_08107C40[];
|
||||
|
||||
void Manager1(Entity* this) {
|
||||
void Manager1_Main(Entity* this) {
|
||||
u8 bVar1;
|
||||
u8* pbVar2;
|
||||
|
||||
@@ -56,3 +56,17 @@ void sub_08057118(Entity* this) {
|
||||
gScreen.controls.alphaBlend = 0x1000;
|
||||
sub_08052D74(this, sub_080570B8, sub_080570F8);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager1/sub_08057174.inc", void sub_08057174())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager1/sub_0805728C.inc", void sub_0805728C())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager1/sub_080572D4.inc", void sub_080572D4())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager1/sub_0805732C.inc", void sub_0805732C())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager1/nullsub_494.inc", void nullsub_494())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager1/sub_080573AC.inc", void sub_080573AC())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager1/sub_08057450.inc", void sub_08057450())
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
#include "global.h"
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "area.h"
|
||||
#include "audio.h"
|
||||
#include "screen.h"
|
||||
#include "utils.h"
|
||||
#include "fileScreen.h"
|
||||
#include "functions.h"
|
||||
|
||||
void Manager10_Main(Manager10*);
|
||||
void sub_080595E4(Manager10*);
|
||||
void sub_08059608(Manager10*);
|
||||
void sub_08059690(Manager10*);
|
||||
void sub_080596E0(Manager10*);
|
||||
u32 sub_08059844(void);
|
||||
u32 sub_0805986C(void);
|
||||
void sub_08059894(const u16*, const u16*, u32);
|
||||
u32 sub_080598F8(u32, u32, u32);
|
||||
void sub_08059960(const u16*, const u16*, u16*, u8);
|
||||
void sub_08059994(void);
|
||||
|
||||
const u8 gUnk_08108390[6] = {
|
||||
0x0F, 0x1E, 0x2D, 0x3C, 0x01, 0x01,
|
||||
};
|
||||
|
||||
extern void* gUnk_0200B650;
|
||||
extern u16 gUnk_020176E0[];
|
||||
extern u8 gUnk_02017700[];
|
||||
|
||||
extern const u16 gUnk_085A7320[];
|
||||
|
||||
void Manager10_Main(Manager10* this) {
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
this->unk_21 = 0;
|
||||
this->unk_23 = 0;
|
||||
if (sub_0805986C()) {
|
||||
this->unk_20 = 1;
|
||||
this->unk_22 = 2;
|
||||
gUnk_0200B650 = 0;
|
||||
} else {
|
||||
this->unk_20 = 0x1F;
|
||||
this->unk_22 = 5;
|
||||
}
|
||||
gRoomVars.unk_10[0] = 0xFF;
|
||||
sub_08052D74(this, sub_080595E4, 0);
|
||||
}
|
||||
sub_08059608(this);
|
||||
sub_08059690(this);
|
||||
sub_080596E0(this);
|
||||
}
|
||||
|
||||
void sub_080595E4(Manager10* this) {
|
||||
gRoomVars.unk_10[0] = 0xFF;
|
||||
sub_08059690(this);
|
||||
sub_080596E0(this);
|
||||
sub_0805B4D0(0);
|
||||
}
|
||||
|
||||
void sub_08059608(Manager10* this) {
|
||||
if (this->unk_23) {
|
||||
if (!--this->unk_23) {
|
||||
gArea.musicIndex = gArea.pMusicIndex;
|
||||
SoundReq(gArea.musicIndex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (sub_0805986C()) {
|
||||
if (gArea.pMusicIndex != 0x1E) {
|
||||
gArea.pMusicIndex = 0x1E;
|
||||
this->unk_23 = 0x78;
|
||||
SoundReq(0x800d0000);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (gArea.pMusicIndex != 0x37) {
|
||||
gArea.pMusicIndex = 0x37;
|
||||
this->unk_23 = 0x78;
|
||||
SoundReq(0x800d0000);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08059690(Manager10* this) {
|
||||
if (sub_08059844()) {
|
||||
if (this->unk_20 == 0)
|
||||
return;
|
||||
sub_08059894(gUnk_085A7320, gUnk_085A7320 + 0xD0, this->unk_20);
|
||||
this->unk_20--;
|
||||
} else {
|
||||
if (this->unk_20 > 0x1F)
|
||||
return;
|
||||
sub_08059894(gUnk_085A7320, gUnk_085A7320 + 0xD0, this->unk_20);
|
||||
this->unk_20++;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080596E0(Manager10* this) {
|
||||
if ((gScreenTransition.frameCount & 7) == 0) {
|
||||
gScreen.bg.bg1xOffset += 8;
|
||||
gScreen.bg.bg1xOffset &= 0x1F;
|
||||
}
|
||||
if (sub_0805986C()) {
|
||||
if (this->unk_21 == 0 && this->unk_22 != 2) {
|
||||
this->unk_21 = 1;
|
||||
this->unk_22 = 3;
|
||||
this->manager.unk_0e = gUnk_08108390[3];
|
||||
gUnk_0200B650 = 0;
|
||||
}
|
||||
} else {
|
||||
if (this->unk_21 == 0 && this->unk_22 != 5) {
|
||||
this->unk_21 = 2;
|
||||
this->manager.unk_0e = gUnk_08108390[this->unk_22];
|
||||
}
|
||||
}
|
||||
switch (this->unk_21) {
|
||||
case 1:
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
this->manager.unk_0e = gUnk_08108390[--this->unk_22];
|
||||
if (this->unk_22 == 2) {
|
||||
this->unk_21 = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
this->manager.unk_0e = gUnk_08108390[++this->unk_22];
|
||||
if (this->unk_22 == 5) {
|
||||
this->unk_21 = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (gRoomVars.unk_10[0] != this->unk_22) {
|
||||
gRoomVars.unk_10[0] = this->unk_22;
|
||||
switch (this->unk_22) {
|
||||
case 0 ... 3:
|
||||
LoadGfxGroup(this->unk_22 + 0x2B);
|
||||
break;
|
||||
case 4:
|
||||
MemClear(gBG3Buffer, 0x800);
|
||||
LoadResourceAsync(gBG3Buffer, 0x600e800, 0x800);
|
||||
break;
|
||||
case 5:
|
||||
gUnk_0200B650 = &gScreen.bg.bg1Control;
|
||||
gScreen.lcd.displayControl |= 0x200;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_08059844() {
|
||||
return gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX > gRoomControls.width >> 1;
|
||||
}
|
||||
|
||||
u32 sub_0805986C() {
|
||||
return gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX > 0x200;
|
||||
}
|
||||
|
||||
void sub_08059894(const u16* unk1, const u16* unk2, u32 unk3) {
|
||||
const u16* tmp1;
|
||||
const u16* tmp2;
|
||||
u16* tmp3;
|
||||
u32 tmp4;
|
||||
u32 i;
|
||||
tmp1 = unk1;
|
||||
tmp2 = unk2;
|
||||
tmp3 = gUnk_020176E0;
|
||||
for (i = 0; i < 13; i++) {
|
||||
sub_08059960(tmp1, tmp2, tmp3, unk3);
|
||||
tmp1 += 0x10;
|
||||
tmp2 += 0x10;
|
||||
tmp3 += 0x10;
|
||||
}
|
||||
MemCopy(gUnk_02017700, gUnk_02017700 + 0x240, 0x20);
|
||||
gUsedPalettes |= 0x207ffc;
|
||||
}
|
||||
|
||||
u32 sub_080598F8(u32 unk1, u32 unk2, u32 unk3) {
|
||||
u32 tmp1, tmp2, tmp3;
|
||||
u32 tmp4, tmp5, tmp6;
|
||||
|
||||
tmp1 = (unk1 & 0x1F) << 8;
|
||||
tmp1 = (tmp1 * unk3) >> 5;
|
||||
tmp4 = (unk2 & 0x1F) << 8;
|
||||
tmp4 = (tmp4 * (0x20 - unk3)) >> 5;
|
||||
tmp1 = (tmp1 + tmp4) >> 8;
|
||||
|
||||
tmp2 = (unk1 & 0x3E0) << 3;
|
||||
tmp2 = (tmp2 * unk3) >> 5;
|
||||
tmp5 = (unk2 & 0x3E0) << 3;
|
||||
tmp5 = (tmp5 * (0x20 - unk3)) >> 5;
|
||||
tmp2 = (tmp2 + tmp5) >> 8;
|
||||
|
||||
tmp3 = (unk1 & 0x7C00) >> 2;
|
||||
tmp3 = (tmp3 * unk3) >> 5;
|
||||
tmp6 = (unk2 & 0x7C00) >> 2;
|
||||
tmp6 = (tmp6 * (0x20 - unk3)) >> 5;
|
||||
tmp3 = (tmp3 + tmp6) >> 8;
|
||||
|
||||
return tmp1 | (tmp2 << 5) | (tmp3 << 10);
|
||||
}
|
||||
|
||||
void sub_08059960(const u16* unk1, const u16* unk2, u16* unk3, u8 unk4) {
|
||||
u32 i;
|
||||
for (i = 0; i < 0x10; i++) {
|
||||
*unk3++ = sub_080598F8(*unk1++, *unk2++, unk4);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08059994() {
|
||||
if (sub_0805986C()) {
|
||||
LoadPaletteGroup(0x5B);
|
||||
gArea.pMusicIndex = 0x1E;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#include "global.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
|
||||
void Manager11_Main(Manager11* this) {
|
||||
if (!this->manager.action) {
|
||||
this->manager.action = 1;
|
||||
if (CheckFlags(this->unk_3c)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
} else {
|
||||
if (CheckFlags(this->unk_3e)) {
|
||||
SetFlag(this->unk_3c);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "functions.h"
|
||||
#include "flags.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 field_0x20;
|
||||
u8 field_0x21;
|
||||
u8 field_0x22;
|
||||
} Manager12;
|
||||
|
||||
void sub_08059A58(Manager12*);
|
||||
|
||||
void sub_08059A2C(Manager12*);
|
||||
|
||||
u32 sub_08056300(u16* arr);
|
||||
extern u16 gUnk_081083DA;
|
||||
extern u16 gUnk_081083F2;
|
||||
extern u16 gUnk_08108398;
|
||||
extern u16 gUnk_081083AE;
|
||||
extern u16 gUnk_081083C4;
|
||||
|
||||
void sub_08059CC0(u32, u32);
|
||||
void sub_08059B18();
|
||||
|
||||
bool32 sub_08059C8C(Manager12*, u32, u8*, u16*);
|
||||
|
||||
extern void sub_0807B9B8(s32, s32, s32);
|
||||
extern u32 gUnk_086E8460;
|
||||
|
||||
typedef struct {
|
||||
u32 field_0x0;
|
||||
u32 field_0x4;
|
||||
u32 field_0x8;
|
||||
u32 field_0xc;
|
||||
} Unknown;
|
||||
|
||||
extern Unknown gUnk_08108468[];
|
||||
extern Unknown gUnk_08108408[];
|
||||
extern const u8 gGlobalGfxAndPalettes[];
|
||||
|
||||
void Manager12_Main(Manager12* this) {
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
this->field_0x22 = 0xff;
|
||||
this->field_0x21 = 0xff;
|
||||
this->field_0x20 = 0xff;
|
||||
sub_08052D74(this, sub_08059A2C, NULL);
|
||||
sub_0805E3A0(this, 6);
|
||||
}
|
||||
sub_08059A58(this);
|
||||
}
|
||||
|
||||
void sub_08059A2C(Manager12* this) {
|
||||
gRoomVars.unk_10[2] = 0xff;
|
||||
gRoomVars.unk_10[1] = 0xff;
|
||||
gRoomVars.unk_10[0] = 0xff;
|
||||
this->field_0x22 = 0xff;
|
||||
this->field_0x21 = 0xff;
|
||||
this->field_0x20 = 0xff;
|
||||
sub_08059A58(this);
|
||||
}
|
||||
|
||||
void sub_08059A58(Manager12* this) {
|
||||
if (gRoomControls.areaID != 0x15) {
|
||||
if (sub_08059C8C(this, 0, &this->field_0x20, &gUnk_08108398) != 0) {
|
||||
sub_08059CC0(0, (u32)this->field_0x20);
|
||||
}
|
||||
if (sub_08059C8C(this, 1, &this->field_0x21, &gUnk_081083AE) != 0) {
|
||||
sub_08059CC0(1, this->field_0x21);
|
||||
if (this->field_0x21 == 2) {
|
||||
sub_08059B18();
|
||||
}
|
||||
}
|
||||
if (sub_08059C8C(this, 2, &this->field_0x22, &gUnk_081083C4) != 0) {
|
||||
sub_08059CC0(2, (u32)this->field_0x22);
|
||||
}
|
||||
} else {
|
||||
if (sub_08059C8C(this, 0, &this->field_0x20, &gUnk_081083DA) != 0) {
|
||||
sub_08059CC0(0, (u32)this->field_0x20);
|
||||
}
|
||||
if (sub_08059C8C(this, 2, &this->field_0x22, &gUnk_081083F2) != 0) {
|
||||
sub_08059CC0(2, (u32)this->field_0x22);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define COMMON(tmp2, tmp1) ((tmp2) >> 4 & 0x3f) | (((tmp1) + 0x188U) >> 4 & 0x3f) << 6
|
||||
void sub_08059B18(void) {
|
||||
u32 loopVar;
|
||||
u32 innerLoopVar;
|
||||
|
||||
if (CheckGlobalFlag(TATEKAKE_HOUSE) != 0) {
|
||||
for (loopVar = 0; loopVar < 4; ++loopVar) {
|
||||
for (innerLoopVar = 0; innerLoopVar < 4; ++innerLoopVar) {
|
||||
sub_0807B9B8(loopVar * 0x10 + 0x4ab + innerLoopVar, COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10),
|
||||
1);
|
||||
}
|
||||
}
|
||||
|
||||
for (loopVar = 0; loopVar < 3; ++loopVar) {
|
||||
for (innerLoopVar = 0; innerLoopVar < 4; ++innerLoopVar) {
|
||||
sub_0807B9B8(loopVar * 0x10 + 0x440 + innerLoopVar, COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10),
|
||||
2);
|
||||
}
|
||||
}
|
||||
sub_0807B9B8(0xd6, 0x5c2, 2);
|
||||
sub_0807B9B8(0xd7, 0x5c3, 2);
|
||||
LoadResourceAsync(&gUnk_086E8460, 0x6001800, 0x800);
|
||||
} else {
|
||||
if (CheckGlobalFlag(TATEKAKE_TOCHU) != 0) {
|
||||
for (loopVar = 0; loopVar < 5; ++loopVar) {
|
||||
for (innerLoopVar = 0; innerLoopVar < 4; ++innerLoopVar) {
|
||||
sub_0807B9B8(loopVar * 0x10 + 0x4a6 + innerLoopVar,
|
||||
COMMON(0x28 + 0x10 * innerLoopVar, loopVar * 0x10), 1);
|
||||
}
|
||||
}
|
||||
sub_0807B9B8(0x444, 0x602, 2);
|
||||
sub_0807B9B8(0x445, 0x605, 2);
|
||||
sub_0807B9B8(0x454, 0x642, 2);
|
||||
sub_0807B9B8(0x455, 0x645, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_08059C8C(Manager12* this, u32 param_2, u8* param_3, u16* param_4) {
|
||||
bool32 bVar2;
|
||||
|
||||
*param_3 = sub_08056300(param_4);
|
||||
if ((*param_3 != 0xff) && (gRoomVars.unk_10[param_2] != *param_3)) {
|
||||
gRoomVars.unk_10[param_2] = *param_3;
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08059CC0(u32 param_1, u32 param_2) {
|
||||
Unknown* unknown;
|
||||
|
||||
gRoomVars.unk_10[param_1] = param_2;
|
||||
if (gRoomControls.areaID != 0x15) {
|
||||
unknown = &gUnk_08108408[param_2];
|
||||
} else {
|
||||
unknown = &gUnk_08108468[param_2];
|
||||
}
|
||||
LoadResourceAsync((void*)&gGlobalGfxAndPalettes + unknown->field_0x0, unknown->field_0x4, 0x1000);
|
||||
LoadResourceAsync((void*)&gGlobalGfxAndPalettes + unknown->field_0x8, unknown->field_0xc, 0x1000);
|
||||
}
|
||||
|
||||
void TryLoadPrologueHyruleTown(void) {
|
||||
u32 tmp;
|
||||
|
||||
if (gRoomControls.areaID != 0x15) {
|
||||
tmp = sub_08056300(&gUnk_08108398);
|
||||
if (tmp != 0xff) {
|
||||
sub_08059CC0(0, tmp);
|
||||
}
|
||||
tmp = sub_08056300(&gUnk_081083AE);
|
||||
if ((tmp != 0xff) && (sub_08059CC0(1, tmp), tmp == 2)) {
|
||||
sub_08059B18();
|
||||
}
|
||||
tmp = sub_08056300(&gUnk_081083C4);
|
||||
if (tmp != 0xff) {
|
||||
sub_08059CC0(2, tmp);
|
||||
}
|
||||
} else {
|
||||
tmp = sub_08056300(&gUnk_081083DA);
|
||||
if (tmp != 0xff) {
|
||||
sub_08059CC0(0, tmp);
|
||||
}
|
||||
tmp = sub_08056300(&gUnk_081083F2);
|
||||
if (tmp != 0xff) {
|
||||
sub_08059CC0(2, tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "object.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u32 bitfield;
|
||||
} Manager13;
|
||||
|
||||
typedef struct {
|
||||
u16 x;
|
||||
u16 y;
|
||||
u8 type;
|
||||
u8 frameIndex;
|
||||
u8 collisionLayer;
|
||||
u8 _padding;
|
||||
} SpawnData;
|
||||
|
||||
extern SpawnData gUnk_081084C8[];
|
||||
extern SpawnData gUnk_08108530[];
|
||||
|
||||
extern u32 CheckRectOnScreen(u16, u16, u32, u32);
|
||||
|
||||
/*
|
||||
Keeps track in its bitfield of whether 0x10 x 0x10 rects at certain positions are on the screen.
|
||||
Spawns OBJECT_1C objects that check this and unsets the value in the bitfield.
|
||||
*/
|
||||
void Manager13_Main(Manager13* this) {
|
||||
SpawnData* spawnData;
|
||||
u32 type2;
|
||||
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
}
|
||||
if (gRoomControls.areaID == 0x15) {
|
||||
spawnData = gUnk_08108530;
|
||||
} else {
|
||||
spawnData = gUnk_081084C8;
|
||||
}
|
||||
type2 = 0;
|
||||
while ((spawnData->x != 0) && (type2 < 0x20)) {
|
||||
u32 bitfieldFlag = 1 << type2;
|
||||
if ((((this->bitfield & bitfieldFlag) == 0) &&
|
||||
(CheckRectOnScreen(spawnData->x, spawnData->y, 0x10, 0x10) != 0))) {
|
||||
Entity* object = CreateObject(OBJECT_1C, spawnData->type, type2);
|
||||
if (object != NULL) {
|
||||
object->frameIndex = spawnData->frameIndex;
|
||||
object->x.HALF.HI = gRoomControls.roomOriginX + spawnData->x;
|
||||
object->y.HALF.HI = gRoomControls.roomOriginY + spawnData->y;
|
||||
object->parent = (Entity*)this;
|
||||
object->field_0x80.HWORD = spawnData->x;
|
||||
object->field_0x82.HWORD = spawnData->y;
|
||||
object->collisionLayer = spawnData->collisionLayer;
|
||||
this->bitfield |= bitfieldFlag;
|
||||
}
|
||||
}
|
||||
spawnData += 1;
|
||||
type2 += 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#include "manager.h"
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager14/Manager14_Main.inc", void Manager14_Main())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager14/sub_08059E80.inc", void sub_08059E80())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager14/sub_08059EF8.inc", void sub_08059EF8())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager14/sub_08059F9C.inc", void sub_08059F9C())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager14/sub_0805A040.inc", void sub_0805A040())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager14/sub_0805A048.inc", void sub_0805A048())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager14/sub_0805A098.inc", void sub_0805A098())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager14/sub_0805A0C0.inc", void sub_0805A0C0())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager14/sub_0805A114.inc", void sub_0805A114())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager14/sub_0805A1D8.inc", void sub_0805A1D8())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager14/nullsub_495.inc", void nullsub_495())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager14/sub_0805A25C.inc", void sub_0805A25C())
|
||||
+6
-17
@@ -28,7 +28,7 @@ typedef struct {
|
||||
|
||||
extern void (*const gUnk_081085D8[])(Manager*);
|
||||
|
||||
void sub_0805A280(Manager* this) {
|
||||
void Manager15_Main(Manager* this) {
|
||||
gUnk_081085D8[this->unk_0a](this);
|
||||
}
|
||||
|
||||
@@ -296,8 +296,6 @@ void sub_0805A758(Manager15* this) {
|
||||
}
|
||||
}
|
||||
|
||||
extern void sub_0805E4E0(Manager*, u32);
|
||||
|
||||
void sub_0805A76C(Manager15* this) {
|
||||
if ((gPlayerEntity.currentHealth != 0) && (gPlayerEntity.height.HALF.HI == 0) && (!gPlayerState.field_0x2c)) {
|
||||
switch (gPlayerState.field_0xa9) {
|
||||
@@ -307,7 +305,7 @@ void sub_0805A76C(Manager15* this) {
|
||||
this->manager.action++;
|
||||
sub_08004168(&gPlayerEntity);
|
||||
gPlayerEntity.animationState = 4;
|
||||
sub_0805E4E0(&this->manager, 0x258);
|
||||
sub_0805E4E0((Entity*)this, 0x258);
|
||||
sub_08078A90(0xFF);
|
||||
gUnk_02034490[0] = 1;
|
||||
gRoomControls.cameraTarget = 0;
|
||||
@@ -427,7 +425,6 @@ void sub_0805A94C(Manager15* this) {
|
||||
gScreen.controls.window1VerticalDimensions = (tmp1 << 8 | tmp2);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void sub_0805A9CC(Manager15* this) {
|
||||
int tmp1, tmp2;
|
||||
void* tmp3;
|
||||
@@ -445,22 +442,14 @@ void sub_0805A9CC(Manager15* this) {
|
||||
gScreen.controls.window1HorizontalDimensions = tmp1 << 8 | tmp2;
|
||||
tmp1 = gRoomControls.roomScrollY - this->unk_26 + this->unk_36;
|
||||
gScreen.affine.bg3yOffset = tmp1 & 0x3F;
|
||||
if (tmp1 < 0)
|
||||
tmp1 += 0x3F;
|
||||
tmp3 = (&gBG3Buffer[(tmp1 >> 6 << 9)]);
|
||||
gScreen.affine.unk5 = (u32)tmp3;
|
||||
tmp3 = (&gBG3Buffer[((tmp1 / 0x40) << 8)]);
|
||||
gScreen.affine.bg3Tilemap = (u32*)tmp3;
|
||||
gScreen.controls.window1VerticalDimensions = 0xa0;
|
||||
if (this->unk_28 == tmp3)
|
||||
return;
|
||||
this->unk_28 = tmp3;
|
||||
gScreen.affine.unk4 = 1;
|
||||
gScreen.affine.bg3Updated = 1;
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_0805A9CC(Manager15* this) {
|
||||
asm(".include \"asm/non_matching/manager15/sub_0805A9CC.inc\"");
|
||||
}
|
||||
#endif
|
||||
|
||||
extern struct { u8 unk_00[0x20]; } gUnk_085A97A0[];
|
||||
extern u16 gUnk_081085B8[];
|
||||
@@ -483,7 +472,7 @@ void sub_0805AA58(Manager15* this) {
|
||||
|
||||
void sub_0805AAC8(Manager15* this) {
|
||||
sub_0805AAF0(this->unk_23);
|
||||
sub_0805A280(&this->manager);
|
||||
Manager15_Main(&this->manager);
|
||||
}
|
||||
|
||||
extern u16 gUnk_08108648[];
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
#include "manager.h"
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager16/Manager16_Main.inc", void Manager16_Main())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager16/sub_0805ACC0.inc", void sub_0805ACC0())
|
||||
@@ -0,0 +1,45 @@
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 field_0x20[0x15];
|
||||
u8 field_0x35;
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
s16 field_0x38;
|
||||
s16 field_0x3a;
|
||||
u16 field_0x3c;
|
||||
u16 field_0x3e;
|
||||
} Manager17;
|
||||
|
||||
extern void (*const gUnk_08108654[])(Manager17*);
|
||||
|
||||
void sub_0805AD80(Manager17*);
|
||||
|
||||
void Manager17_Main(Manager17* manager) {
|
||||
gUnk_08108654[manager->manager.action](manager);
|
||||
}
|
||||
|
||||
void sub_0805AD60(Manager17* manager) {
|
||||
manager->manager.action = 1;
|
||||
if (CheckFlags(manager->field_0x3c) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
sub_0805AD80(manager);
|
||||
}
|
||||
|
||||
void sub_0805AD80(Manager17* manager) {
|
||||
if (CheckFlags(manager->field_0x3e) != 0) {
|
||||
Entity* object = CreateObject(0, manager->manager.unk_0a, manager->manager.unk_0b);
|
||||
if (object != NULL) {
|
||||
object->actionDelay = manager->field_0x35;
|
||||
object->collisionLayer = manager->field_0x36;
|
||||
object->x.HALF.HI = manager->field_0x38 + gRoomControls.roomOriginX;
|
||||
object->y.HALF.HI = manager->field_0x3a + gRoomControls.roomOriginY;
|
||||
object->field_0x86.HWORD = manager->field_0x3c;
|
||||
}
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
#include "manager.h"
|
||||
#include "screen.h"
|
||||
#include "area.h"
|
||||
#include "functions.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u16 field_0x20;
|
||||
} Manager18;
|
||||
|
||||
void sub_0805AEDC(Manager18*);
|
||||
void sub_0805AF3C(Manager18*);
|
||||
extern u16 gUnk_0810865C[];
|
||||
|
||||
void Manager18_Main(Manager18* this) {
|
||||
if (this == NULL) {
|
||||
if (gArea.unk3 != (u32)sub_0805AEDC) {
|
||||
sub_0805AEDC(NULL);
|
||||
}
|
||||
} else {
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_10 |= 0x20;
|
||||
this->manager.unk_0e = 0;
|
||||
this->manager.unk_0f = 8;
|
||||
this->field_0x20 = gUnk_0810865C[0];
|
||||
sub_0805E3A0(this, 6);
|
||||
if (gArea.unk3 == 0) {
|
||||
sub_08052D74(this, sub_0805AEDC, sub_0805AF3C);
|
||||
} else {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
} else {
|
||||
if ((gUnk_0810865C[this->manager.unk_0e] != 0) && (--this->manager.unk_0f == 0)) {
|
||||
this->manager.unk_0f = 4;
|
||||
if (gUnk_0810865C[++this->manager.unk_0e] != 0) {
|
||||
this->field_0x20 = gUnk_0810865C[this->manager.unk_0e];
|
||||
gScreen.controls.alphaBlend = this->field_0x20;
|
||||
}
|
||||
}
|
||||
gRoomControls.bg3OffsetX.WORD -= 0x2000;
|
||||
gRoomControls.bg3OffsetY.WORD -= 0x1000;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805AEDC(Manager18* this) {
|
||||
gScreen.affine.bg3Control = 0x1e05;
|
||||
gScreen.lcd.displayControl |= 0x800;
|
||||
gScreen.controls.layerFXControl = 0x3648;
|
||||
gScreen.controls.alphaBlend = (this != NULL) ? this->field_0x20 : 0x1000;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
if (this != NULL) {
|
||||
Manager18_Main(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805AF3C(Manager18* this) {
|
||||
this->manager.unk_10 &= 0xdf;
|
||||
gScreen.lcd.displayControl &= 0xf7ff;
|
||||
gScreen.controls.layerFXControl = 0;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#include "manager.h"
|
||||
#include "area.h"
|
||||
#include "room.h"
|
||||
#include "functions.h"
|
||||
#include "screen.h"
|
||||
|
||||
void sub_0805AFFC(Manager*);
|
||||
|
||||
void Manager19_Main(Manager* this) {
|
||||
if (this == NULL) {
|
||||
if ((void*)gArea.unk3 != sub_0805AFFC) {
|
||||
sub_0805AFFC(this);
|
||||
}
|
||||
} else {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->unk_10 |= 0x20;
|
||||
sub_0805E3A0(this, 6);
|
||||
if (gArea.unk3 == 0) {
|
||||
sub_08052D74(this, sub_0805AFFC, NULL);
|
||||
} else {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
} else {
|
||||
gRoomControls.bg3OffsetX.WORD = gRoomControls.bg3OffsetX.WORD - 0x2000;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805AFFC(Manager* this) {
|
||||
gScreen.affine.bg3Control = 0x1e03;
|
||||
gScreen.lcd.displayControl |= 0x800;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ extern void (*const gUnk_08108668[])(Manager1A*);
|
||||
|
||||
extern u8 gGlobalGfxAndPalettes[];
|
||||
|
||||
void sub_0805B030(Manager1A* this) {
|
||||
void Manager1A_Main(Manager1A* this) {
|
||||
gUnk_08108668[this->manager.action](this);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
|
||||
#include "manager.h"
|
||||
#include "functions.h"
|
||||
#include "screen.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u32 field_0x20;
|
||||
} Manager1B;
|
||||
|
||||
extern u8 gUnk_08108C28[];
|
||||
extern void (*const gUnk_08108C54[])(Manager1B*);
|
||||
|
||||
void sub_0805B4B4(Manager1B*);
|
||||
|
||||
void sub_0806D0F8(void); // in bigGoron?
|
||||
|
||||
extern u8 gUnk_08108C5C[];
|
||||
extern u16 gUnk_08108C44[];
|
||||
|
||||
void Manager1B_Main(Manager1B* this) {
|
||||
s32 iVar3;
|
||||
u8* tmp;
|
||||
|
||||
if (EntityHasDuplicateID((Entity*)this) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
tmp = gUnk_08108C28 + this->manager.unk_0a * 4;
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_10 |= 0x20;
|
||||
sub_0805E3A0(this, 6);
|
||||
if (this->manager.unk_0a != 0) {
|
||||
sub_08052D74(this, sub_0805B4B4, NULL);
|
||||
}
|
||||
iVar3 = 0x100 - (u32)gRoomControls.height;
|
||||
if (iVar3 < 0) {
|
||||
iVar3 = 0;
|
||||
}
|
||||
this->field_0x20 = iVar3 + (s8)tmp[2];
|
||||
gUnk_08108C54[tmp[1]](this);
|
||||
}
|
||||
if (gRoomControls.unk2 == 0) {
|
||||
gUnk_08108C54[tmp[1]](this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805B448(Manager1B* this) {
|
||||
gScreen.affine.bg3xOffset = (gRoomControls.roomScrollX - gRoomControls.roomOriginX) >> 2;
|
||||
gScreen.affine.bg3yOffset = ((gRoomControls.roomScrollY - gRoomControls.roomOriginY) >> 1) + this->field_0x20;
|
||||
}
|
||||
|
||||
void sub_0805B474(Manager1B* this) {
|
||||
s32 tmp = ((gRoomControls.roomScrollY - gRoomControls.roomOriginY) * 0x60) / (gRoomControls.height - 0xa0);
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomOriginY + tmp;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX - ((gRoomControls.width - 0x100) / 2);
|
||||
}
|
||||
|
||||
void sub_0805B4B4(Manager1B* this) {
|
||||
sub_0805B4D0(this->manager.unk_0a);
|
||||
if (this->manager.unk_0a == 2) {
|
||||
sub_0806D0F8();
|
||||
}
|
||||
Manager1B_Main(this);
|
||||
}
|
||||
|
||||
void sub_0805B4D0(u32 param_1) {
|
||||
s32 iVar1;
|
||||
u32 uVar2;
|
||||
|
||||
LoadGfxGroup(gUnk_08108C5C[param_1]);
|
||||
gScreen.affine.bg3Control = 0x1e07;
|
||||
gScreen.lcd.displayControl |= 0x800;
|
||||
gScreen.affine.bg3xOffset = (gRoomControls.roomScrollX - gRoomControls.roomOriginX) >> 2;
|
||||
|
||||
uVar2 = (gRoomControls.roomScrollY - gRoomControls.roomOriginY) >> 1;
|
||||
iVar1 = 0x100 - gRoomControls.height;
|
||||
if (iVar1 < 0) {
|
||||
iVar1 = 0;
|
||||
}
|
||||
gScreen.affine.bg3yOffset = uVar2 + iVar1 + gUnk_08108C44[param_1];
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#include "manager.h"
|
||||
#include "random.h"
|
||||
#include "room.h"
|
||||
#include "enemy.h"
|
||||
|
||||
extern void (*const gUnk_08108C64[])(Manager*);
|
||||
|
||||
extern u16 gUnk_08108C6C[];
|
||||
extern s8 gUnk_08108C7C[];
|
||||
|
||||
void Manager1C_Main(Manager* manager) {
|
||||
gUnk_08108C64[manager->action](manager);
|
||||
}
|
||||
|
||||
// Initial setup
|
||||
void sub_0805B554(Manager* manager) {
|
||||
manager->action = 1;
|
||||
manager->unk_0e = 1;
|
||||
}
|
||||
|
||||
// Spawn water drops every 0xf frames
|
||||
void sub_0805B55C(Manager* manager) {
|
||||
if (--manager->unk_0e == 0) {
|
||||
Entity* waterDrop;
|
||||
manager->unk_0e = 0xf;
|
||||
waterDrop = CreateEnemy(WATER_DROP, 0);
|
||||
if (waterDrop != NULL) {
|
||||
waterDrop->x.HALF.HI = gRoomControls.roomScrollX + 0x78 + gUnk_08108C6C[Random() & 7];
|
||||
waterDrop->y.HALF.HI = gRoomControls.roomScrollY + 0x50 + gUnk_08108C7C[Random() & 3];
|
||||
waterDrop->height.HALF.HI = 0xff38;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
|
||||
extern void (*const gUnk_08108C80[])(Manager*);
|
||||
|
||||
extern u16 gUnk_08108C88[];
|
||||
|
||||
void Manager1D_Main(Manager* this) {
|
||||
gUnk_08108C80[this->action](this);
|
||||
}
|
||||
|
||||
void sub_0805B5E0(Manager* this) {
|
||||
this->action = 1;
|
||||
|
||||
gScreen.lcd.displayControl |= 0x800;
|
||||
gScreen.affine.bg3Control = gUnk_08108C88[this->unk_0a];
|
||||
gRoomControls.bg3OffsetY.WORD = 0;
|
||||
gRoomControls.bg3OffsetX.WORD = 0;
|
||||
|
||||
switch (this->unk_0a) {
|
||||
case 0:
|
||||
default:
|
||||
gScreen.affine.bg3yOffset = 0;
|
||||
gScreen.affine.bg3xOffset = 0;
|
||||
break;
|
||||
case 1:
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805B638(Manager* this) {
|
||||
if (this->unk_0a == 1) {
|
||||
gRoomControls.bg3OffsetX.WORD = gRoomControls.bg3OffsetX.WORD + 0x2000;
|
||||
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX + gRoomControls.bg3OffsetX.HALF.HI;
|
||||
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY + gRoomControls.bg3OffsetY.HALF.HI;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ void Manager1E_ObserveRegion(Manager1E*);
|
||||
|
||||
void (*const Manager1E_ActionFuncs[2])(Manager1E*) = { Manager1E_Init, Manager1E_ObserveRegion };
|
||||
|
||||
void Manager1E_Handler(Manager1E* this) {
|
||||
void Manager1E_Main(Manager1E* this) {
|
||||
Manager1E_ActionFuncs[this->manager.action](this);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 field_0x20[0x16];
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
s16 field_0x38;
|
||||
u16 field_0x3a;
|
||||
u8 field_0x3c;
|
||||
u8 field_0x3d;
|
||||
u16 field_0x3e;
|
||||
} Manager1F;
|
||||
extern void (*const gUnk_08108C94[])(Manager1F*);
|
||||
|
||||
void sub_0805B778(Manager1F*);
|
||||
|
||||
extern u16 gUnk_08108C9C[];
|
||||
|
||||
void Manager1F_Main(Manager1F* this) {
|
||||
gUnk_08108C94[this->manager.action](this);
|
||||
}
|
||||
|
||||
void sub_0805B70C(Manager1F* this) {
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
this->manager.unk_0b = 1;
|
||||
}
|
||||
this->manager.action = 1;
|
||||
this->field_0x38 = (this->field_0x38 >> 4 & 0x3fU) | (((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
sub_0805B778(this);
|
||||
}
|
||||
|
||||
void sub_0805B744(Manager1F* this) {
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
if (this->manager.unk_0b == 0) {
|
||||
this->manager.unk_0b = 1;
|
||||
sub_0805B778(this);
|
||||
}
|
||||
} else {
|
||||
if (this->manager.unk_0b == 1) {
|
||||
this->manager.unk_0b = 0;
|
||||
sub_0805B778(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805B778(Manager1F* this) {
|
||||
SetTileType(gUnk_08108C9C[this->manager.unk_0a * 2 + this->manager.unk_0b], this->field_0x38, this->field_0x36);
|
||||
}
|
||||
+77
-4
@@ -2,16 +2,89 @@
|
||||
#include "entity.h"
|
||||
#include "screen.h"
|
||||
#include "functions.h"
|
||||
#include "room.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u32 field_0x20[0x6];
|
||||
void* field_0x38;
|
||||
void* field_0x3c;
|
||||
} Manager2;
|
||||
|
||||
extern void sub_080576A0();
|
||||
extern void sub_0805754C(Entity*);
|
||||
extern void sub_0805754C(Manager2*);
|
||||
|
||||
void Manager2(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
extern u8 gMapDataTopSpecial[];
|
||||
|
||||
extern u32 gUnk_0200B650;
|
||||
|
||||
void Manager2_Main(Manager2* this) {
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
gScreen.affine.bg3Updated = 0;
|
||||
gScreen.bg.bg1Updated = 0;
|
||||
sub_08052D74(this, sub_080576A0, 0);
|
||||
}
|
||||
sub_0805754C(this);
|
||||
}
|
||||
|
||||
void sub_0805754C(Manager2* this) {
|
||||
s32 bgOffset;
|
||||
|
||||
bgOffset = (gRoomControls.roomScrollY - gRoomControls.roomOriginY);
|
||||
bgOffset += bgOffset >> 3;
|
||||
gScreen.affine.bg3yOffset = bgOffset & 0x3f;
|
||||
gScreen.affine.bg3Tilemap = gMapDataTopSpecial + (bgOffset / 0x40) * 0x200;
|
||||
if (this->field_0x38 != gScreen.affine.bg3Tilemap) {
|
||||
this->field_0x38 = gScreen.affine.bg3Tilemap;
|
||||
gScreen.affine.bg3Updated = 1;
|
||||
}
|
||||
bgOffset = (gRoomControls.roomScrollY - gRoomControls.roomOriginY);
|
||||
bgOffset += bgOffset >> 2;
|
||||
gScreen.bg.bg1yOffset = bgOffset & 0x3f;
|
||||
gScreen.bg.bg1Tilemap = gMapDataTopSpecial + 0x2000 + (bgOffset / 0x40) * 0x200;
|
||||
if (this->field_0x3c != gScreen.bg.bg1Tilemap) {
|
||||
this->field_0x3c = gScreen.bg.bg1Tilemap;
|
||||
gScreen.bg.bg1Updated = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080575C8(u32 param) {
|
||||
s32 bgOffset;
|
||||
|
||||
gUnk_0200B650 = 0;
|
||||
*(u16*)0x4000000 = 0;
|
||||
LoadGfxGroup(param);
|
||||
gRoomVars.unk_10[0] = param;
|
||||
|
||||
bgOffset = (gRoomControls.roomScrollY - gRoomControls.roomOriginY);
|
||||
bgOffset += bgOffset >> 3;
|
||||
gScreen.affine.bg3yOffset = bgOffset & 0x3f;
|
||||
gScreen.affine.bg3xOffset = 0;
|
||||
gScreen.affine.bg3Tilemap = &gMapDataTopSpecial[(bgOffset / 0x40) * 0x200];
|
||||
gScreen.affine.bg3Control = 0x1d49;
|
||||
gScreen.affine.bg3Updated = 1;
|
||||
|
||||
bgOffset = (gRoomControls.roomScrollY - gRoomControls.roomOriginY);
|
||||
bgOffset += bgOffset >> 2;
|
||||
gScreen.bg.bg1yOffset = bgOffset & 0x3f;
|
||||
gScreen.bg.bg1xOffset = 0;
|
||||
gScreen.bg.bg1Tilemap = &gMapDataTopSpecial[0x2000 + (bgOffset / 0x40) * 0x200];
|
||||
gScreen.bg.bg1Control = 0x1e49;
|
||||
gScreen.bg.bg1Updated = 1;
|
||||
gScreen.controls.layerFXControl = 0x3c48;
|
||||
gScreen.controls.alphaBlend = 0x609;
|
||||
gScreen.lcd.displayControl |= 0xa00;
|
||||
}
|
||||
|
||||
void sub_08057688(void) {
|
||||
gScreen.affine.bg3Control = 0x1d48;
|
||||
gScreen.bg.bg1Control = 0x1e48;
|
||||
}
|
||||
|
||||
void sub_080576A0(Manager2* this) {
|
||||
LoadGfxGroup(gRoomVars.unk_10[0]);
|
||||
this->field_0x38 = NULL;
|
||||
this->field_0x3c = NULL;
|
||||
sub_0805754C(this);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ typedef struct {
|
||||
u16 unk_3e;
|
||||
} Manager20;
|
||||
|
||||
void sub_0805B7A0(Manager20* this) {
|
||||
void Manager20_Main(Manager20* this) {
|
||||
Entity* tmp = CreateObject(this->manager.unk_0e, this->manager.unk_0a, this->manager.unk_0b);
|
||||
if (!tmp)
|
||||
return;
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
#include "flags.h"
|
||||
|
||||
extern bool32 CheckRectOnScreen(u16, u16, u32, u32);
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u32 field_0x20;
|
||||
} Manager21;
|
||||
|
||||
typedef struct {
|
||||
u16 x;
|
||||
u16 y;
|
||||
u16 field_0x4;
|
||||
u16 actionDelay;
|
||||
} MinishEntranceSpawnData;
|
||||
|
||||
bool32 sub_0805B8CC(u32);
|
||||
|
||||
/*
|
||||
Spawns MINISH_SIZED_ENTRANCE at the locations in the room property this->manager.unk_0a when they are visible on the
|
||||
screen.
|
||||
*/
|
||||
void Manager21_Main(Manager21* this) {
|
||||
MinishEntranceSpawnData* spawnData;
|
||||
u32 count;
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
this->field_0x20 = 0;
|
||||
}
|
||||
spawnData = (MinishEntranceSpawnData*)GetCurrentRoomProperty(this->manager.unk_0a);
|
||||
|
||||
for (count = 0; (spawnData->x != 0) && (count < 0x20); ++count) {
|
||||
if (CheckRectOnScreen(spawnData->x, spawnData->y, 4, 4) != 0) {
|
||||
if (((this->field_0x20 & (1 << count)) == 0) && (sub_0805B8CC(spawnData->field_0x4) != 0)) {
|
||||
Entity* object = CreateObject(MINISH_SIZED_ENTRANCE, 1, 0);
|
||||
if (object != NULL) {
|
||||
object->actionDelay = spawnData->actionDelay;
|
||||
object->field_0xf = count;
|
||||
object->x.HALF.HI = gRoomControls.roomOriginX + spawnData->x;
|
||||
object->y.HALF.HI = gRoomControls.roomOriginY + spawnData->y;
|
||||
object->parent = (Entity*)this;
|
||||
sub_08016A30(object);
|
||||
this->field_0x20 |= 1 << count;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->field_0x20 &= ~(1 << count);
|
||||
}
|
||||
spawnData += 1;
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_0805B8CC(u32 param_1) {
|
||||
if (param_1 == 4) {
|
||||
return CheckGlobalFlag(TATEKAKE_HOUSE);
|
||||
}
|
||||
if (param_1 < 5) {
|
||||
return TRUE;
|
||||
}
|
||||
if (param_1 > 6) {
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
#include "manager.h"
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager22/Manager22_Main.inc", void Manager22_Main())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager22/sub_0805BA78.inc", void sub_0805BA78())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager22/sub_0805BAD4.inc", void sub_0805BAD4())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager22/sub_0805BB00.inc", void sub_0805BB00())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager22/sub_0805BB74.inc", void sub_0805BB74())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager22/sub_0805BBBC.inc", void sub_0805BBBC())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager22/sub_0805BC04.inc", void sub_0805BC04())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager22/sub_0805BC4C.inc", void sub_0805BC4C())
|
||||
@@ -0,0 +1,155 @@
|
||||
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "functions.h"
|
||||
#include "flags.h"
|
||||
#include "object.h"
|
||||
|
||||
extern void (*const gUnk_08108CCC[])(Manager*);
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u16 field_0x20;
|
||||
u16 field_0x22;
|
||||
u8 field_0x24[0x12];
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
u16 field_0x38;
|
||||
u16 field_0x3a;
|
||||
u16 field_0x3c;
|
||||
u16 field_0x3e;
|
||||
} Manager23;
|
||||
|
||||
void sub_0805BE94(Manager23*);
|
||||
void sub_0805BEC4(Manager23*);
|
||||
|
||||
void sub_0805BE70(Manager23*, u32);
|
||||
|
||||
void Manager23_Main(Manager* this) {
|
||||
gUnk_08108CCC[this->unk_0a](this);
|
||||
}
|
||||
|
||||
void sub_0805BC8C(Manager23* this) {
|
||||
if (this->manager.action == 0) {
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_0f = 0x1e;
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
sub_0805BE94(this);
|
||||
}
|
||||
}
|
||||
if ((CheckFlags(this->field_0x3e) != 0) && (--this->manager.unk_0f == 0)) {
|
||||
sub_0805BEC4(this);
|
||||
sub_0805BE94(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BCD4(Manager23* this) {
|
||||
switch (this->manager.action) {
|
||||
case 0:
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_0f = 0x1e;
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
sub_0805BE70(this, 0x75);
|
||||
this->manager.action = 2;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (CheckFlags(this->field_0x3e) != 0 && --this->manager.unk_0f == 0) {
|
||||
this->manager.unk_0f = 0x1e;
|
||||
sub_0805BEC4(this);
|
||||
sub_0805BE70(this, 0x76);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (CheckFlags(this->field_0x3e) == 0 && --this->manager.unk_0f == 0) {
|
||||
this->manager.unk_0f = 0x1e;
|
||||
sub_0805BE70(this, 0x75);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BD5C(Manager23* this) {
|
||||
if (this->manager.action == 0) {
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
sub_0805BE94(this);
|
||||
}
|
||||
this->field_0x20 =
|
||||
((s16)this->field_0x38 >> 4 & 0x3fU) | ((s32)((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
this->manager.action = 1;
|
||||
} else {
|
||||
if (GetTileType(this->field_0x20, this->manager.unk_0b) == 0x76) {
|
||||
SetFlag(this->field_0x3e);
|
||||
sub_0805308C(this->manager.unk_0e);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BDB4(Manager23* this) {
|
||||
u8 bVar1;
|
||||
u16 uVar2;
|
||||
u32 uVar3;
|
||||
|
||||
switch (this->manager.action) {
|
||||
case 0:
|
||||
if (CheckFlags(this->field_0x3e) != 0 || CheckFlags(this->field_0x3c) != 0) {
|
||||
sub_0805BE94(this);
|
||||
}
|
||||
this->field_0x20 =
|
||||
((s16)this->field_0x38 >> 4 & 0x3fU) | (((s32)(this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
this->manager.action = 1;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (GetTileType(this->field_0x20, this->manager.unk_0b) != 0x76) {
|
||||
return;
|
||||
}
|
||||
SetFlag(this->field_0x3e);
|
||||
sub_0805308C(this->manager.unk_0e);
|
||||
this->manager.action = 2;
|
||||
this->field_0x22 = this->field_0x36 * 0x3c;
|
||||
return;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (--this->field_0x22 == 0) {
|
||||
CreateDustAt(*(s16*)&this->field_0x38, *(s16*)&this->field_0x3a, this->manager.unk_0b);
|
||||
ClearFlag(this->field_0x3e);
|
||||
sub_0807BA8C(this->field_0x20, this->manager.unk_0b);
|
||||
sub_0805308C(-this->manager.unk_0e);
|
||||
this->manager.action = 1;
|
||||
} else {
|
||||
if (CheckFlags(this->field_0x3c) == 0) {
|
||||
return;
|
||||
}
|
||||
sub_0805BEC4(this);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BE70(Manager23* this, u32 param_2) {
|
||||
SetTileType(param_2,
|
||||
((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6,
|
||||
this->manager.unk_0b);
|
||||
}
|
||||
|
||||
void sub_0805BE94(Manager23* this) {
|
||||
SetTileType(0x76, ((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6,
|
||||
this->manager.unk_0b);
|
||||
sub_0805308C(this->manager.unk_0e);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
void sub_0805BEC4(Manager23* this) {
|
||||
Entity* object = CreateObject(OBJECT_2A, 1, 0);
|
||||
if (object != NULL) {
|
||||
*(s8*)(&object->flags + 1) = ((*(s8*)(&object->flags + 1)) & (-0x10)) | 3;
|
||||
object->x.HALF.HI = this->field_0x38 + gRoomControls.roomOriginX;
|
||||
object->y.HALF.HI = this->field_0x3a + gRoomControls.roomOriginY;
|
||||
object->collisionLayer = this->manager.unk_0b;
|
||||
object->spritePriority.b0 = 2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,310 @@
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "flags.h"
|
||||
#include "audio.h"
|
||||
#include "game.h"
|
||||
#include "object.h"
|
||||
#include "area.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 field_0x20[0x15];
|
||||
u8 field_0x35;
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
s16 x;
|
||||
u16 y;
|
||||
u16 tile;
|
||||
u16 field_0x3e;
|
||||
} Manager24;
|
||||
|
||||
extern void (*const gUnk_08108CDC[])(Manager24*);
|
||||
|
||||
u32 sub_0805BFC4(u32, u32);
|
||||
void sub_0805C02C(Manager24*);
|
||||
|
||||
extern u32 sub_080002C8(u16, u8);
|
||||
|
||||
extern void (*const gUnk_08108CE8[])(u32, u32);
|
||||
|
||||
u32 sub_0805C608(void);
|
||||
extern u32 sub_08052670(void);
|
||||
|
||||
extern u8 gUnk_08108CFC[];
|
||||
|
||||
void Manager24_Main(Manager24* manager) {
|
||||
gUnk_08108CDC[manager->manager.action](manager);
|
||||
}
|
||||
|
||||
void sub_0805BF30(Manager24* manager) {
|
||||
manager->manager.action = 1;
|
||||
manager->tile = (manager->x >> 4 & 0x3fU) | (((manager->y << 0x10) >> 0x14 & 0x3fU) << 6);
|
||||
manager->manager.unk_0a = sub_0805BFC4(manager->tile, manager->field_0x35);
|
||||
if (CheckLocalFlag(manager->field_0x3e) != 0) {
|
||||
sub_0805C02C(manager);
|
||||
DeleteManager((Manager*)manager);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BF78(Manager24* this) {
|
||||
if (sub_080002C8(this->tile, this->field_0x35) != 0x2e) {
|
||||
this->manager.action = 2;
|
||||
this->manager.unk_0e = 0x5a;
|
||||
sub_0805C02C(this);
|
||||
SetLocalFlag(this->field_0x3e);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805BFA4(Manager24* this) {
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
SoundReq(SFX_SECRET);
|
||||
DeleteManager((Manager*)this);
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0805BFC4(u32 pos, u32 layer) {
|
||||
u32 tileType = GetTileType(pos, layer);
|
||||
|
||||
switch (tileType) {
|
||||
case 0xec:
|
||||
return 1;
|
||||
case 0xbf:
|
||||
return 4;
|
||||
case 0xaf:
|
||||
return 0;
|
||||
case 0xcc:
|
||||
return 2;
|
||||
case 0xdf:
|
||||
return 3;
|
||||
case 0xff:
|
||||
return 0;
|
||||
case 0x115:
|
||||
return 1;
|
||||
case 0x108:
|
||||
return 2;
|
||||
case 0x110:
|
||||
return 3;
|
||||
case 0x105:
|
||||
return 4;
|
||||
}
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
void sub_0805C02C(Manager24* this) {
|
||||
if (this->manager.unk_0a != 0xff) {
|
||||
gUnk_08108CE8[this->manager.unk_0a](this->tile, this->field_0x35);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C050(u32 pos, u32 layer) {
|
||||
SetTileType(0xb1, pos - 0x41, layer);
|
||||
SetTileType(0xb2, pos - 0x40, layer);
|
||||
SetTileType(0xb3, pos - 0x3f, layer);
|
||||
SetTileType(0xb4, pos - 1, layer);
|
||||
SetTileType(0xb7, pos + 1, layer);
|
||||
if (layer == 1) {
|
||||
if (sub_08052670() != 0) {
|
||||
Entity* object = CreateObject(ARCHWAY, 0xe, 0);
|
||||
if (object != NULL) {
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.roomOriginX;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) - 8 + gRoomControls.roomOriginY;
|
||||
}
|
||||
SetTileType(0xb5, pos, 1);
|
||||
} else {
|
||||
if (CheckIsDungeon() != 0) {
|
||||
SetTileType(0xb5, pos, 1);
|
||||
} else {
|
||||
SetTileType(0xb6, pos, 1);
|
||||
}
|
||||
}
|
||||
|
||||
SetTileType(0xb8, pos - 0x41, 2);
|
||||
SetTileType(0xb9, pos - 0x40, 2);
|
||||
SetTileType(0xba, pos - 0x3f, 2);
|
||||
} else {
|
||||
Entity* object;
|
||||
SetTileType(0xb5, pos, 2);
|
||||
if (CheckIsDungeon() == 0) {
|
||||
return;
|
||||
}
|
||||
object = CreateObject(ARCHWAY, sub_0805C608(), 6);
|
||||
if (object == NULL) {
|
||||
return;
|
||||
}
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.roomOriginX;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) - 0x10 + gRoomControls.roomOriginY;
|
||||
object->collisionLayer = 2;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C178(u32 pos, u32 layer) {
|
||||
Entity* object;
|
||||
|
||||
SetTileType(0xf1, pos - 0x40, layer);
|
||||
SetTileType(0xf5, pos - 0x3f, layer);
|
||||
SetTileType(0xf6, pos + 1, layer);
|
||||
SetTileType(0xf4, pos + 0x40, layer);
|
||||
SetTileType(0xf7, pos + 0x41, layer);
|
||||
if (layer == 1) {
|
||||
|
||||
if (sub_08052670() != 0) {
|
||||
|
||||
object = CreateObject(ARCHWAY, 0xe, 1);
|
||||
if (object != NULL) {
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + 0x18 + gRoomControls.roomOriginX;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.roomOriginY;
|
||||
}
|
||||
SetTileType(0xf2, pos, 1);
|
||||
} else {
|
||||
if (CheckIsDungeon() != 0) {
|
||||
SetTileType(0xf2, pos, 1);
|
||||
} else {
|
||||
SetTileType(0xf3, pos, 1);
|
||||
}
|
||||
}
|
||||
SetTileType(0xf8, pos - 0x3f, 2);
|
||||
SetTileType(0xf9, pos + 1, 2);
|
||||
SetTileType(0xfa, pos + 0x41, 2);
|
||||
} else {
|
||||
SetTileType(0xf2, pos, 2);
|
||||
if (CheckIsDungeon() == 0) {
|
||||
return;
|
||||
}
|
||||
object = CreateObject(ARCHWAY, sub_0805C608(), 7);
|
||||
if (object == NULL) {
|
||||
return;
|
||||
}
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + 0x20 + gRoomControls.roomOriginX;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.roomOriginY;
|
||||
object->collisionLayer = 2;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C294(u32 pos, u32 layer) {
|
||||
Entity* object;
|
||||
|
||||
SetTileType(0xd1, pos - 1, layer);
|
||||
SetTileType(0xd4, pos + 1, layer);
|
||||
SetTileType(0xd5, pos + 0x3f, layer);
|
||||
SetTileType(0xd6, pos + 0x40, layer);
|
||||
SetTileType(0xd7, pos + 0x41, layer);
|
||||
if (layer == 1) {
|
||||
if (sub_08052670() != 0) {
|
||||
object = CreateObject(0x4f, 0xe, 2);
|
||||
if (object != NULL) {
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.roomOriginX;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 0x20 + gRoomControls.roomOriginY;
|
||||
}
|
||||
SetTileType(0xd2, pos, 1);
|
||||
} else {
|
||||
if (CheckIsDungeon() != 0) {
|
||||
SetTileType(0xd2, pos, 1);
|
||||
} else {
|
||||
SetTileType(0xd3, pos, 1);
|
||||
}
|
||||
}
|
||||
SetTileType(0xd8, pos + 0x3f, 2);
|
||||
SetTileType(0xd9, pos + 0x40, 2);
|
||||
SetTileType(0xda, pos + 0x41, 2);
|
||||
} else {
|
||||
SetTileType(0xd2, pos, 2);
|
||||
if (CheckIsDungeon() == 0) {
|
||||
return;
|
||||
}
|
||||
object = CreateObject(0x4f, sub_0805C608(), 8);
|
||||
if (object == NULL) {
|
||||
return;
|
||||
}
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.roomOriginX;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 0x20 + gRoomControls.roomOriginY;
|
||||
object->collisionLayer = 2;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C3B4(u32 pos, u32 layer) {
|
||||
Entity* object;
|
||||
|
||||
SetTileType(0xe1, pos - 0x41, layer);
|
||||
SetTileType(0xe4, pos - 0x40, layer);
|
||||
SetTileType(0xe2, pos - 1, layer);
|
||||
SetTileType(0xe3, pos + 0x3f, layer);
|
||||
SetTileType(0xe7, pos + 0x40, layer);
|
||||
if (layer == 1) {
|
||||
if (sub_08052670() != 0) {
|
||||
object = CreateObject(ARCHWAY, 0xe, 3);
|
||||
if (object != NULL) {
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + -0x10 + gRoomControls.roomOriginX;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.roomOriginY;
|
||||
}
|
||||
SetTileType(0xe5, pos, 1);
|
||||
} else {
|
||||
if (CheckIsDungeon() != 0) {
|
||||
SetTileType(0xe5, pos, 1);
|
||||
} else {
|
||||
SetTileType(0xe6, pos, 1);
|
||||
}
|
||||
}
|
||||
SetTileType(0xe8, pos - 0x41, 2);
|
||||
SetTileType(0xe9, pos - 1, 2);
|
||||
SetTileType(0xea, pos + 0x3f, 2);
|
||||
} else {
|
||||
SetTileType(0xe5, pos, 2);
|
||||
if (CheckIsDungeon() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
object = CreateObject(ARCHWAY, sub_0805C608(), 9);
|
||||
if (object == NULL) {
|
||||
return;
|
||||
}
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + -0x10 + gRoomControls.roomOriginX;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.roomOriginY;
|
||||
object->collisionLayer = 2;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805C4E0(u32 pos, u32 layer) {
|
||||
Entity* object;
|
||||
|
||||
SetTileType(0xc1, pos - 0x41, layer);
|
||||
SetTileType(0xc2, pos - 0x40, layer);
|
||||
SetTileType(0xc3, pos - 0x3f, layer);
|
||||
SetTileType(0xc4, pos - 1, layer);
|
||||
SetTileType(0xc7, pos + 1, layer);
|
||||
if (layer == 1) {
|
||||
if (sub_08052670() != 0) {
|
||||
object = CreateObject(ARCHWAY, 0xe, 0);
|
||||
if (object != NULL) {
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.roomOriginX;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) + -0x10 + gRoomControls.roomOriginY;
|
||||
}
|
||||
SetTileType(0xc5, pos, 1);
|
||||
} else {
|
||||
if (CheckIsDungeon() != 0) {
|
||||
SetTileType(0xc5, pos, 1);
|
||||
} else {
|
||||
SetTileType(0xc6, pos, 1);
|
||||
}
|
||||
}
|
||||
SetTileType(0xc8, pos - 0x41, 2);
|
||||
SetTileType(0xc9, pos - 0x40, 2);
|
||||
SetTileType(0xca, pos - 0x3f, 2);
|
||||
} else {
|
||||
SetTileType(0xc5, pos, 2);
|
||||
if (CheckIsDungeon() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
object = CreateObject(ARCHWAY, sub_0805C608(), 6);
|
||||
if (object == NULL) {
|
||||
return;
|
||||
}
|
||||
object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.roomOriginX;
|
||||
object->y.HALF.HI = ((pos & 0xfc0) >> 2) + -0x10 + gRoomControls.roomOriginY;
|
||||
object->collisionLayer = 2;
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0805C608(void) {
|
||||
return gUnk_08108CFC[gArea.regret];
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "functions.h"
|
||||
|
||||
typedef struct {
|
||||
struct Manager manager;
|
||||
u8 field_0x20[0x18];
|
||||
s16 field_0x38;
|
||||
s16 field_0x3a;
|
||||
} Manager25;
|
||||
|
||||
void Manager25_Main(Manager25* this) {
|
||||
if (this->manager.action == 0) {
|
||||
this->field_0x38 = TILE(this->field_0x38, this->field_0x3a);
|
||||
if (GetTileType(this->field_0x38, 2) == 0x75) {
|
||||
this->manager.action = 1;
|
||||
SetTile(0x406a, this->field_0x38, 1);
|
||||
} else {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
if (GetTileType(this->field_0x38, 1) == 0x406b) {
|
||||
sub_0807B7D8(0x76, this->field_0x38, 2);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (GetTileType(this->field_0x38, 2) == 0x76) {
|
||||
SetTile(0x406b, this->field_0x38, 1);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ void (*const gUnk_08108D04[])(Manager26*) = { sub_0805C6D0, sub_0805C7A0, sub_08
|
||||
|
||||
void sub_0805C7CC(Manager26*);
|
||||
|
||||
void sub_0805C6B8(Manager26* this) {
|
||||
void Manager26_Main(Manager26* this) {
|
||||
gUnk_08108D04[this->manager.action](this);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ void (*const gUnk_08108D10[])(Entity*) = { sub_0805C874, sub_0805C894, sub_0805C
|
||||
|
||||
const u8 gUnk_08108D20[] = { 0x6F, 0x70, 0x71, 0x72, 0x71, 0x70 };
|
||||
|
||||
void Manager27(Entity* this) {
|
||||
void Manager27_Main(Entity* this) {
|
||||
|
||||
gUnk_08108D10[this->action](this);
|
||||
if (CheckLocalFlagByOffset(0x300, this->type + 0x67)) {
|
||||
|
||||
@@ -12,18 +12,18 @@ typedef struct {
|
||||
} Manager28;
|
||||
|
||||
void Manager28_Init(Manager28*);
|
||||
void Manager28_Main(Manager28*);
|
||||
void Manager28_Main2(Manager28*);
|
||||
u32 Manager28_FindMatchingEntities(Manager28*);
|
||||
Entity* Manager28_FindMatchingEntity(EntityData*);
|
||||
void Manager28_RemoveDeletedEntities(Manager28*);
|
||||
|
||||
void (*const Manager28_ActionFuncs[])(Manager28*) = { Manager28_Init, Manager28_Main };
|
||||
void (*const Manager28_ActionFuncs[])(Manager28*) = { Manager28_Init, Manager28_Main2 };
|
||||
|
||||
enum Manager28_Action { Init = 0, Main = 1 };
|
||||
|
||||
enum Manager28_InitState { DoInit = 0, DoNotInit = 1 };
|
||||
|
||||
void Manager28_Entry(Manager28* this) {
|
||||
void Manager28_Main(Manager28* this) {
|
||||
Manager28_ActionFuncs[this->manager.action](this);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ void Manager28_Init(Manager28* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void Manager28_Main(Manager28* this) {
|
||||
void Manager28_Main2(Manager28* this) {
|
||||
s32 n;
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
#include "manager.h"
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager29/Manager29_Main.inc", void Manager29_Main())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager29/sub_0805CBD0.inc", void sub_0805CBD0())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager29/sub_0805CC3C.inc", void sub_0805CC3C())
|
||||
|
||||
ASM_FUNC("asm/non_matching/manager29/sub_0805CF80.inc", void sub_0805CF80())
|
||||
@@ -0,0 +1,39 @@
|
||||
#include "manager.h"
|
||||
#include "room.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
|
||||
typedef struct {
|
||||
u8 field_0x0;
|
||||
u8 tileLayer;
|
||||
u16 flag;
|
||||
u16 tilePos;
|
||||
u16 tileType; // If the tile type at tilePos, tileLayer is tileType, set the local flag.
|
||||
} Manager2A_unk; // TODO result of GetCurrentRoomProperty(3)?
|
||||
|
||||
void sub_0805CFF0(Manager2A_unk*);
|
||||
|
||||
void Manager2A_Main(Manager* manager) {
|
||||
Manager2A_unk* data;
|
||||
|
||||
if (manager->action == 0) {
|
||||
manager->action += 1;
|
||||
}
|
||||
data = (Manager2A_unk*)GetCurrentRoomProperty(3);
|
||||
if (data != NULL) {
|
||||
for (; data->field_0x0 != 0; data = data + 1) {
|
||||
if (data->field_0x0 == 10) {
|
||||
sub_0805CFF0(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805CFF0(Manager2A_unk* param_1) {
|
||||
if (CheckLocalFlag(param_1->flag) == 0) {
|
||||
u32 tileType = GetTileType(param_1->tilePos, param_1->tileLayer);
|
||||
if (param_1->tileType == tileType) {
|
||||
SetLocalFlag(param_1->flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "audio.h"
|
||||
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
Entity* field_0x20[4];
|
||||
u8 field_0x30;
|
||||
u8 field_0x31;
|
||||
u8 field_0x32;
|
||||
u8 field_0x33;
|
||||
u8 field_0x34;
|
||||
u8 field_0x35;
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
u8 field_0x38;
|
||||
u8 field_0x39;
|
||||
u8 field_0x3a;
|
||||
u8 field_0x3b;
|
||||
u8 field_0x3c;
|
||||
u8 field_0x3d;
|
||||
u16 field_0x3e;
|
||||
} Manager2B;
|
||||
|
||||
extern void (*const gUnk_08108D30[])(Manager2B*);
|
||||
|
||||
extern u8 gEntCount;
|
||||
|
||||
void sub_0805D11C(Manager2B*);
|
||||
|
||||
void Manager2B_Main(Manager2B* this) {
|
||||
gUnk_08108D30[this->manager.action](this);
|
||||
}
|
||||
|
||||
void sub_0805D02C(Manager2B* this) {
|
||||
u32 counter;
|
||||
u16* objectData;
|
||||
Entity* object;
|
||||
if (CheckFlags(this->field_0x3e)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (gEntCount < 0x44) {
|
||||
objectData = GetCurrentRoomProperty(this->manager.unk_0a);
|
||||
counter = 0;
|
||||
while (counter < 4) {
|
||||
object = CreateObject(OBJECT_A0, objectData[2], counter);
|
||||
object->x.HALF.HI = objectData[0] + gRoomControls.roomOriginX;
|
||||
object->y.HALF.HI = objectData[1] + gRoomControls.roomOriginY;
|
||||
object->parent = (Entity*)this;
|
||||
sub_08016A30(object);
|
||||
this->field_0x20[counter] = object;
|
||||
counter += 1;
|
||||
objectData += 3;
|
||||
}
|
||||
this->manager.action = 1;
|
||||
this->manager.unk_0f = 0x3c;
|
||||
this->field_0x36 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D0C4(Manager2B* this) {
|
||||
if (--this->manager.unk_0f == 0) {
|
||||
this->manager.unk_0f = 0xb4;
|
||||
}
|
||||
if (this->field_0x36 == 0xf) {
|
||||
this->manager.action = 2;
|
||||
this->manager.unk_0e = 8;
|
||||
SoundReq(SFX_SECRET);
|
||||
sub_0805D11C(this);
|
||||
}
|
||||
this->field_0x36 = 0;
|
||||
}
|
||||
|
||||
void sub_0805D0FC(Manager2B* this) {
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
SetFlag(this->field_0x3e);
|
||||
DeleteManager(&this->manager);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D11C(Manager2B* this) {
|
||||
Entity** entity_iterator;
|
||||
u32 counter;
|
||||
for (counter = 0; counter < 4; counter++) {
|
||||
Entity* entity;
|
||||
entity_iterator = &this->field_0x20[counter];
|
||||
entity = *entity_iterator;
|
||||
*entity_iterator = NULL;
|
||||
sub_0807BA8C(COORD_TO_TILE(entity), entity->collisionLayer);
|
||||
DeleteEntity(entity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#include "manager.h"
|
||||
#include "functions.h"
|
||||
#include "utils.h"
|
||||
|
||||
typedef struct {
|
||||
struct Manager manager;
|
||||
u8 field_0x20[0x16];
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
s16 field_0x38;
|
||||
s16 field_0x3a;
|
||||
u16 field_0x3c;
|
||||
u16 field_0x3e;
|
||||
} Manager2C;
|
||||
|
||||
void Manager2C_Main(Manager2C* manager) {
|
||||
if (manager->manager.action == 0) {
|
||||
manager->manager.action = 1;
|
||||
manager->field_0x3a = 0;
|
||||
}
|
||||
if (((CheckPlayerInRegion(manager->field_0x38, manager->field_0x3a, 0x14, 0x40) != 0) &&
|
||||
(((gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY) + gPlayerEntity.height.HALF.HI) < 0)) &&
|
||||
(gRoomControls.roomScrollY == gRoomControls.roomOriginY)) {
|
||||
MemClear(&gScreenTransition.areaID, 0x20);
|
||||
gScreenTransition.transitioningOut = 1;
|
||||
gScreenTransition.transitionType = 0;
|
||||
gScreenTransition.field_0xf = 0xb;
|
||||
gScreenTransition.areaID = manager->manager.unk_0b;
|
||||
gScreenTransition.roomID = manager->manager.unk_0e;
|
||||
gScreenTransition.playerState = manager->field_0x37;
|
||||
gScreenTransition.playerStartPos.HALF.x = manager->field_0x3c;
|
||||
gScreenTransition.playerStartPos.HALF.y = manager->field_0x3e;
|
||||
gScreenTransition.playerLayer = manager->field_0x36;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern u32 gUnk_03000BF8;
|
||||
extern u32 gUnk_03000BF6;
|
||||
|
||||
void Manager2D_Main(Entity* this) {
|
||||
SetTile(0x4014, 0x5c3, 1);
|
||||
if ((gRoomControls.roomOriginY + 200 < gPlayerEntity.y.HALF.HI) &&
|
||||
((u32)(gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX) - 0x30 < 0x11)) {
|
||||
gPlayerEntity.collisionLayer = 3;
|
||||
UpdateSpriteForCollisionLayer(&gPlayerEntity);
|
||||
}
|
||||
DeleteManager((Manager*)this);
|
||||
}
|
||||
+104
-6
@@ -1,13 +1,111 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "manager.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "audio.h"
|
||||
|
||||
extern void (*const gUnk_08108D3C[])(Entity*);
|
||||
extern void (*const gUnk_08108D44[])(Entity*);
|
||||
typedef struct {
|
||||
Manager manager;
|
||||
u8 field_0x20[0x18];
|
||||
s16 field_0x38;
|
||||
u8 field_0x3a;
|
||||
u8 field_0x3b;
|
||||
u16 field_0x3c;
|
||||
u16 field_0x3e;
|
||||
} Manager2E;
|
||||
|
||||
void sub_0805D250(Entity* this) {
|
||||
gUnk_08108D3C[this->type](this);
|
||||
extern void (*const gUnk_08108D3C[])(Manager2E*);
|
||||
extern void (*const gUnk_08108D44[])(Manager2E*);
|
||||
|
||||
void sub_0805D2F4(Manager2E*);
|
||||
|
||||
extern void (*const gUnk_08108D50[])(Manager2E*);
|
||||
|
||||
void Manager2E_Main(Manager2E* this) {
|
||||
gUnk_08108D3C[this->manager.unk_0a](this);
|
||||
}
|
||||
|
||||
void sub_0805D268(Entity* this) {
|
||||
gUnk_08108D44[this->action](this);
|
||||
void sub_0805D268(Manager2E* this) {
|
||||
gUnk_08108D44[this->manager.action](this);
|
||||
}
|
||||
|
||||
void sub_0805D280(Manager2E* this) {
|
||||
if (CheckFlags(this->field_0x3c) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
SetFlag(this->field_0x3c);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
this->manager.action = 1;
|
||||
if (this->manager.unk_0e == 0) {
|
||||
this->manager.unk_0e = 0x1e;
|
||||
}
|
||||
sub_0805E3A0(this, 6);
|
||||
}
|
||||
|
||||
void sub_0805D2C0(Manager2E* this) {
|
||||
if ((CheckFlags(this->field_0x3e) != 0) && (gUnk_03003DC0.unk_0xc < 2)) {
|
||||
this->manager.action = 2;
|
||||
if (this->manager.unk_0e == 1) {
|
||||
sub_0805D2F4(this);
|
||||
}
|
||||
sub_0805E4E0((Entity*)this, this->manager.unk_0e);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D2F4(Manager2E* this) {
|
||||
if (gUnk_03003DC0.unk_0xc == 0) {
|
||||
if (this->field_0x38 != SFX_NONE) {
|
||||
SoundReq(this->field_0x38);
|
||||
} else {
|
||||
SoundReq(SFX_SECRET);
|
||||
}
|
||||
if (this->field_0x3c != 0) {
|
||||
SetFlag(this->field_0x3c);
|
||||
}
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D32C(Manager2E* this) {
|
||||
gUnk_08108D50[this->manager.action](this);
|
||||
}
|
||||
|
||||
void sub_0805D344(Manager2E* this) {
|
||||
CheckFlags(this->field_0x3e);
|
||||
this->manager.action = 1;
|
||||
if (this->manager.unk_0e == 0) {
|
||||
this->manager.unk_0e = 0x1e;
|
||||
}
|
||||
this->manager.unk_0f = this->manager.unk_0e;
|
||||
sub_0805E3A0(this, 6);
|
||||
}
|
||||
|
||||
void sub_0805D36C(Manager2E* this) {
|
||||
if (CheckFlags(this->field_0x3e) != 0) {
|
||||
this->manager.action = 2;
|
||||
this->manager.unk_0e = this->manager.unk_0f;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805D384(Manager2E* this) {
|
||||
if (this->manager.unk_0e != 0) {
|
||||
if (--this->manager.unk_0e == 0) {
|
||||
Sound sound;
|
||||
if (this->field_0x38 != SFX_NONE) {
|
||||
sound = this->field_0x38;
|
||||
} else {
|
||||
sound = SFX_SECRET;
|
||||
}
|
||||
SoundReq(sound);
|
||||
SetFlag(this->field_0x3c);
|
||||
}
|
||||
} else {
|
||||
if (CheckFlags(this->field_0x3e) == 0) {
|
||||
this->manager.action = 1;
|
||||
ClearFlag(this->field_0x3c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user