ovl_select: ZELDA MAP SELECT matched and documented (#310)

* basic functions

* errr

* Progress, kinda

* func_808016E8

* func_808019FC and func_80801A64

* Import data

* Format

* some progress

* func_808013B8

* func_80801620

* fix stuff

* func_80800930

* improve func_80800A44 a bit

* At least it is equivalent now

* matches!

* small renames

* Use generated reloc

* move functions

* Renaming a lot of stuff

* Some functions renames

* Rename members

* Add translations for everything

* Run formatter

* Update include/alloca.h

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

* Update src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c

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

* review changes

* review comments

* Update src/overlays/gamestates/ovl_select/z_select.h

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/overlays/gamestates/ovl_select/z_select.h

Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com>

Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com>
This commit is contained in:
Anghelo Carvajal
2021-09-28 22:23:08 -04:00
committed by GitHub
co-authored by EllipticEllipsis engineer124 Kenix3
parent ddc643f708
commit 2f000058f5
21 changed files with 1013 additions and 68 deletions
+7
View File
@@ -0,0 +1,7 @@
#ifndef ALLOCA_H
#define ALLOCA_H
void* alloca(u32);
#define alloca __builtin_alloca
#endif
+6
View File
@@ -0,0 +1,6 @@
#ifndef BGM_H
#define BGM_H
#define NA_BGM_STOP 0x100000FF
#endif
+15 -15
View File
@@ -139,22 +139,22 @@ void StackCheck_Cleanup(StackEntry* entry);
StackStatus StackCheck_GetState(StackEntry* entry);
u32 StackCheck_CheckAll(void);
u32 StackCheck_Check(StackEntry* entry);
// void GfxPrint_InitDlist(void);
// void GfxPrint_SetColor(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void GfxPrint_SetPosPx(void);
// void GfxPrint_SetPos(void);
void GfxPrint_InitDlist(GfxPrint*);
void GfxPrint_SetColor(GfxPrint*, u32, u32, u32, u32);
void GfxPrint_SetPosPx(GfxPrint*, s32, s32);
void GfxPrint_SetPos(GfxPrint*, s32, s32);
void GfxPrint_SetBasePosPx(GfxPrint* this, s32 param_2, s32 param_3);
void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c);
void GfxPrint_PrintChar(GfxPrint* this, u8 c);
// void GfxPrint_PrintStringWithSize(void);
// void GfxPrint_PrintString(void);
// void GfxPrint_Callback(void);
// void GfxPrint_Init(void);
// void GfxPrint_Destroy(void);
// void GfxPrint_Open(void);
// void GfxPrint_Close(void);
// void GfxPrint_VPrintf(void);
// void GfxPrint_Printf(void);
void GfxPrint_PrintStringWithSize(GfxPrint*, const void*, size_t, size_t);
void GfxPrint_PrintString(GfxPrint*, const char*);
GfxPrint* GfxPrint_Callback(GfxPrint*, const char*, size_t);
void GfxPrint_Init(GfxPrint*);
void GfxPrint_Destroy(GfxPrint*);
void GfxPrint_Open(GfxPrint*, Gfx*);
Gfx* GfxPrint_Close(GfxPrint*);
void GfxPrint_VPrintf(GfxPrint*, const char*, va_list);
void GfxPrint_Printf(GfxPrint*, const char*, ...);
// void MtxConv_F2L(void);
// void MtxConv_L2F(void);
void __assert(const char* file, u32 lineNum);
@@ -2821,7 +2821,7 @@ u32 Sram_CalcChecksum(u8* data, u32 length);
// void func_80144628(void);
// void Sram_GenerateRandomSaveFields(void);
void func_80144890(void);
// void func_80144968(void);
void Sram_InitDebugSave(void);
// void func_80144A94(void);
// void func_80144E78(void);
// void func_8014546C(void);
@@ -4014,7 +4014,7 @@ void func_801A7794(u32 param_1, u32 param_2, u32 param_3);
// void func_801A7B10(void);
// void func_801A7D04(void);
// void func_801A7D84(void);
void func_801A89A8(s32 arg0);
void Audio_QueueSeqCmd(u32 arg0);
// void func_801A89D0(void);
s32 func_801A8A50(s32 param1);
// void func_801A8ABC(void);
+11
View File
@@ -26,6 +26,17 @@
(curState)->nextGameStateInit = (GameStateFunc)newInit; \
(curState)->nextGameStateSize = sizeof(newStruct)
#define SET_FULLSCREEN_VIEWPORT(view) \
{ \
Viewport viewport; \
viewport.bottomY = SCREEN_HEIGHT; \
viewport.rightX = SCREEN_WIDTH; \
viewport.topY = 0; \
viewport.leftX = 0; \
View_SetViewport(view, &viewport); \
} \
(void)0
#define PLAYER ((Player*)globalCtx->actorCtx.actorList[ACTORCAT_PLAYER].first)
#define FIRST_ENEMY ((Actor*)globalCtx->actorCtx.actorList[ACTORCAT_ENEMY].first)
+1 -1
View File
@@ -977,7 +977,7 @@ extern u8 kanfontOrdering[92];
// extern UNK_TYPE1 D_801BDBA0;
// extern UNK_TYPE1 D_801BDBA4;
// extern UNK_TYPE1 D_801BDBA8;
// extern UNK_TYPE1 D_801BDBB0;
extern u8 D_801BDBB0;
// extern UNK_TYPE1 D_801BDBB4;
// extern UNK_TYPE1 D_801BDBB8;
// extern UNK_TYPE1 D_801BDBBC;
+1
View File
@@ -16,6 +16,7 @@
#include "xstdio.h"
#include "unk.h"
#include "bgm.h"
#include "sfx.h"
#include "color.h"
#include "ichain.h"
+1 -2
View File
@@ -704,8 +704,7 @@ beginseg
name "ovl_select"
compress
include "build/src/overlays/gamestates/ovl_select/z_select.o"
include "build/data/ovl_select/ovl_select.data.o"
include "build/data/ovl_select/ovl_select.reloc.o"
include "build/src/overlays/gamestates/ovl_select/ovl_select_reloc.o"
endseg
beginseg
+1 -1
View File
@@ -6,7 +6,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A7D84.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A89A8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/Audio_QueueSeqCmd.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A89D0.s")
+1 -1
View File
@@ -18,7 +18,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sram_NES/func_80144890.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sram_NES/func_80144968.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sram_NES/Sram_InitDebugSave.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sram_NES/func_80144A94.s")
@@ -304,7 +304,7 @@ void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx) {
void func_809CD634(EnBji01* this, GlobalContext* globalCtx) {
func_801A5BD0(0x6F);
func_801A89A8(0xE0000101);
Audio_QueueSeqCmd(0xE0000101);
globalCtx->nextEntranceIndex = 0x54A0; /* Termina Field from telescope */
gSaveContext.respawn[0].entranceIndex = globalCtx->nextEntranceIndex;
func_80169EFC(globalCtx); /* Load new entrance? */
@@ -363,7 +363,7 @@ void EnBji01_Init(Actor* thisx, GlobalContext* globalCtx) {
case 0x4C20: /* Observatory from Termina Field telescope */
this->actor.flags |= 0x10000;
func_801A5BD0(0);
func_801A89A8(0xE0000100);
Audio_QueueSeqCmd(0xE0000100);
this->actor.params = ENBJI01_PARAMS_LOOKED_THROUGH_TELESCOPE;
func_809CCE98(this, globalCtx);
break;
+1 -1
View File
@@ -76,7 +76,7 @@ const ActorInit En_Fsn_InitVars = {
(ActorFunc)EnFsn_Draw,
};
ActorAnimationEntryS sAnimations[] = {
static ActorAnimationEntryS sAnimations[] = {
{ &D_06012C34, 1.0f, 0, -1, 0, 0 }, { &D_060131FC, 1.0f, 0, -1, 0, 0 }, { &D_0600C58C, 1.0f, 0, -1, 2, 0 },
{ &D_0600C58C, -1.0f, 0, -1, 2, 0 }, { &D_0600E3EC, 1.0f, 0, -1, 2, 0 }, { &D_0600F00C, 1.0f, 0, -1, 0, 0 },
{ &D_0600CB3C, 1.0f, 0, -1, 2, 0 }, { &D_0600D354, 1.0f, 0, -1, 0, 0 }, { &D_060138B0, 1.0f, 0, -1, 2, 0 },
@@ -1699,7 +1699,7 @@ void func_80B4627C(EnInvadepoh* this, GlobalContext* globalCtx) {
} else {
func_80B454BC(this, globalCtx);
func_80B452EC(this, globalCtx);
func_801A89A8(0x800D);
Audio_QueueSeqCmd(0x800D);
func_80B46F88(this);
}
} else if (D_80B4E940 == 3) {
@@ -1987,7 +1987,7 @@ void func_80B46EE8(EnInvadepoh* this, GlobalContext* globalCtx) {
this->actionTimer--;
if (this->actionTimer <= 0) {
ActorCutscene_Stop(D_80B50404[0]);
func_801A89A8(0x800D);
Audio_QueueSeqCmd(0x800D);
func_80B46F88(this);
}
}
+2 -2
View File
@@ -750,8 +750,8 @@ void EnMa4_HorsebackGameWait(EnMa4* this, GlobalContext* globalCtx) {
void EnMa4_SetupHorsebackGameEnd(EnMa4* this, GlobalContext* globalCtx) {
gSaveContext.weekEventReg[0x8] &= (u8)~0x01;
this->actionFunc = EnMa4_HorsebackGameEnd;
func_801A89A8(0x100000FF);
func_801A89A8(0x8041);
Audio_QueueSeqCmd(NA_BGM_STOP);
Audio_QueueSeqCmd(0x8041);
}
void EnMa4_HorsebackGameEnd(EnMa4* this, GlobalContext* globalCtx) {
@@ -1144,7 +1144,7 @@ void func_80BAD230(EnSuttari* this, GlobalContext* globalCtx) {
this->textId = 0x2A31;
func_801518B0(globalCtx, this->textId, &this->actor);
this->flags1 |= 0x4000;
func_801A89A8(0x8003);
Audio_QueueSeqCmd(0x8003);
this->actionFunc = func_80BAD380;
} else {
ActorCutscene_SetIntentToPlay(this->cutscenes[1]);
@@ -1205,7 +1205,7 @@ void func_80BAD380(EnSuttari* this, GlobalContext* globalCtx) {
gSaveContext.weekEventReg[0x21] |= 8;
}
this->actor.speedXZ = 0.0f;
func_801A89A8(0x101400FF);
Audio_QueueSeqCmd(0x101400FF);
this->flags2 |= 4;
EnSuttari_SetNextEntrance(globalCtx, 0xD670);
} else {
@@ -1438,7 +1438,7 @@ void EnSuttari_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnSuttari* this = THIS;
if ((globalCtx->sceneNum == SCENE_BACKTOWN) && !(this->flags2 & 4)) {
func_801A89A8(0x101400FF);
Audio_QueueSeqCmd(0x101400FF);
}
Collider_DestroyCylinder(globalCtx, &this->collider);
}
@@ -44,7 +44,6 @@ const ActorInit En_Weather_Tag_InitVars = {
extern f32 D_801F4E74;
extern u8 D_801BDBB8;
extern u8 D_801BDBB4;
extern u8 D_801BDBB0;
extern u8 D_801F4E30;
extern s16 D_801F4E7A;
File diff suppressed because it is too large Load Diff
+29 -2
View File
@@ -3,12 +3,39 @@
#include "global.h"
struct SelectContext;
void Select_Init(GameState* thisx);
void Select_Destroy(GameState* thisx);
typedef void (*Select_LoadFunc)(struct SelectContext*, u32, s32);
typedef struct {
GameState state;
char unk_A4[0x1DC];
/* 0x00 */ char* name;
/* 0x04 */ Select_LoadFunc loadFunc;
/* 0x08 */ s32 entranceIndex;
} SceneSelectEntry; // size = 0xC
typedef struct SelectContext {
/* 0x000 */ GameState state;
/* 0x0A8 */ View view;
/* 0x210 */ s32 count;
/* 0x214 */ SceneSelectEntry* scenes;
/* 0x218 */ s32 currentScene;
/* 0x21C */ s32 pageDownIndex; // Index of pageDownStops
/* 0x220 */ s32 pageDownStops[7];
/* 0x23C */ char unk_23C[0xC];
/* 0x248 */ s32 opt; // (Option): This name is the one the menu uses to show this value. It can be used to change in which entrance the player spawns in the selected scene
/* 0x24C */ s32 topDisplayedScene; // The scene which is currently at the top of the screen
/* 0x250 */ char unk_250[0xC];
/* 0x25C */ s32 verticalInputAccumulator;
/* 0x260 */ s32 verticalInput;
/* 0x264 */ s32 timerUp;
/* 0x268 */ s32 timerDown;
/* 0x26C */ s32 lockUp;
/* 0x270 */ s32 lockDown;
/* 0x274 */ s32 unk_274; // unused
/* 0x278 */ UNK_TYPE1 unk_278[0x08];
} SelectContext; // size = 0x280
#endif
+1
View File
@@ -20,6 +20,7 @@ animdict ={
"func_800F0568": "Audio_PlaySoundAtPosition",
"func_8016970C": "Play_CameraSetAtEye",
"func_800BBA88": "Enemy_StartFinishingBlow",
"func_801A89A8": "Audio_QueueSeqCmd",
}
def replace_anim(file):
+12 -12
View File
@@ -2796,7 +2796,7 @@
0x80144628:("func_80144628",),
0x80144684:("Sram_GenerateRandomSaveFields",),
0x80144890:("func_80144890",),
0x80144968:("func_80144968",),
0x80144968:("Sram_InitDebugSave",),
0x80144A94:("func_80144A94",),
0x80144E78:("func_80144E78",),
0x8014546C:("func_8014546C",),
@@ -4059,7 +4059,7 @@
0x801A7B10:("func_801A7B10",),
0x801A7D04:("func_801A7D04",),
0x801A7D84:("func_801A7D84",),
0x801A89A8:("func_801A89A8",),
0x801A89A8:("Audio_QueueSeqCmd",),
0x801A89D0:("func_801A89D0",),
0x801A8A50:("func_801A8A50",),
0x801A8ABC:("func_801A8ABC",),
@@ -4093,16 +4093,16 @@
0x8080066C:("Title_Main",),
0x8080071C:("Title_Destroy",),
0x8080074C:("Title_Init",),
0x80800910:("func_80800910",),
0x80800930:("func_80800930",),
0x80800A44:("func_80800A44",),
0x808013B8:("func_808013B8",),
0x80801594:("func_80801594",),
0x80801620:("func_80801620",),
0x808016E8:("func_808016E8",),
0x8080194C:("func_8080194C",),
0x808019FC:("func_808019FC",),
0x80801A64:("func_80801A64",),
0x80800910:("Select_LoadTitle",),
0x80800930:("Select_LoadGame",),
0x80800A44:("Select_UpdateMenu",),
0x808013B8:("Select_PrintMenu",),
0x80801594:("Select_PrintLoadingMessage",),
0x80801620:("Select_PrintAgeSetting",),
0x808016E8:("Select_PrintCutsceneSetting",),
0x8080194C:("Select_DrawMenu",),
0x808019FC:("Select_DrawLoadingScreen",),
0x80801A64:("Select_Draw",),
0x80801AFC:("Select_Main",),
0x80801B28:("Select_Destroy",),
0x80801B4C:("Select_Init",),
+3 -3
View File
@@ -4609,9 +4609,9 @@
0x80800868:("D_80800868","UNK_TYPE1","",0x1),
0x80800870:("D_80800870","UNK_TYPE1","",0x1),
0x80800880:("titleUnknownVector3f","Vec3f","",0xc),
0x80801C80:("D_80801C80","UNK_PTR","",0x4),
0x80802334:("D_80802334","UNK_PTR","",0x4),
0x80802364:("D_80802364","UNK_PTR","",0x4),
0x80801C80:("sScenes","UNK_PTR","",0x4),
0x80802334:("sLoadingMessages","UNK_PTR","",0x4),
0x80802364:("sFormLabel","UNK_PTR","",0x4),
0x80802390:("D_80802390","char","[]",0x1),
0x808023AC:("D_808023AC","char","[]",0x1),
0x808023C4:("D_808023C4","char","[]",0x1),

Some files were not shown because too many files have changed in this diff Show More