`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 23:23:08 -03:00 committed by GitHub
parent ddc643f708
commit 2f000058f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 1013 additions and 68 deletions

7
include/alloca.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef ALLOCA_H
#define ALLOCA_H
void* alloca(u32);
#define alloca __builtin_alloca
#endif

6
include/bgm.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef BGM_H
#define BGM_H
#define NA_BGM_STOP 0x100000FF
#endif

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);

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)

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;

View File

@ -16,6 +16,7 @@
#include "xstdio.h"
#include "unk.h"
#include "bgm.h"
#include "sfx.h"
#include "color.h"
#include "ichain.h"

3
spec
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

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")

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")

View File

@ -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;

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 },

View File

@ -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);
}
}

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) {

View File

@ -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);
}

View File

@ -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;

View File

@ -1,40 +1,934 @@
/*
* File: z_select.c
* Overlay: ovl_select
* Description:
* Description: Debug map select
*/
#include "z_select.h"
#include "alloca.h"
#include "overlays/gamestates/ovl_title/z_title.h"
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/D_80802390.s")
void Select_LoadTitle(SelectContext* this) {
{
GameState* gameState = &this->state;
gameState->running = false;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/func_80800910.s")
SET_NEXT_GAMESTATE(&this->state, Title_Init, TitleContext);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/func_80800930.s")
void Select_LoadGame(SelectContext* this, u32 entranceIndex, s32 opt) {
if (gSaveContext.fileNum == 0xFF) {
Sram_InitDebugSave();
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/func_80800A44.s")
gSaveContext.buttonStatus[0] = BTN_ENABLED;
gSaveContext.buttonStatus[1] = BTN_ENABLED;
gSaveContext.buttonStatus[2] = BTN_ENABLED;
gSaveContext.buttonStatus[3] = BTN_ENABLED;
gSaveContext.buttonStatus[4] = BTN_ENABLED;
gSaveContext.unk_3F1E = 0;
gSaveContext.unk_3F20 = 0;
gSaveContext.unk_3F22 = 0;
gSaveContext.unk_3F24 = 0;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/func_808013B8.s")
Audio_QueueSeqCmd(NA_BGM_STOP);
gSaveContext.entranceIndex = entranceIndex;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/D_8080343C.s")
if (opt != 0) {
gSaveContext.entranceIndex =
Entrance_CreateIndex((s32)gSaveContext.entranceIndex >> 9, opt, gSaveContext.entranceIndex & 0xF);
}
if (gSaveContext.entranceIndex == 0xC000) {
gSaveContext.day = 0;
gSaveContext.time = CLOCK_TIME(6, 0) - 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/func_80801594.s")
gSaveContext.respawn[0].entranceIndex = 0xFFFF;
gSaveContext.seqIndex = 0xFF;
gSaveContext.nightSeqIndex = 0xFF;
gSaveContext.showTitleCard = true;
gSaveContext.respawnFlag = 0;
gSaveContext.respawn[4].entranceIndex = 0xFF;
gSaveContext.respawn[5].entranceIndex = 0xFF;
gSaveContext.respawn[6].entranceIndex = 0xFF;
gSaveContext.respawn[7].entranceIndex = 0xFF;
D_801BDBB0 = 0;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/D_80803588.s")
do {
GameState* gameState = &this->state;
gameState->running = false;
} while (0);
SET_NEXT_GAMESTATE(&this->state, Play_Init, GlobalContext);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/func_80801620.s")
// "Translation" ("Actual name")
static SceneSelectEntry sScenes[] = {
// " 0: OP Woods for Cutscene Use" (" 0: Forest Opening Scene")
{ " 0:OP\x8Cデモ\x8Dヨウ シンリン", Select_LoadGame, 0x1C00 },
// " 0-0: Lost Woods" (" 0-0: Lost Woods")
{ " 0-0:\x8Dマヨイ ノ モリ", Select_LoadGame, 0xC400 },
// " 1: Town Outskirts" (" 1: Termina Field")
{ " 1:\x8Cタウン \x8Dコウガイ", Select_LoadGame, 0x5400 },
// " 1-0: Astral Observatory" (" 1-0: Astral Observatory")
{ " 1-0:\x8Dテンモンカンソクジョ", Select_LoadGame, 0x4C00 },
// " 1 - 1: Astral Observatory Telescope" (" 1 - 1: Astral Observatory - Telescope")
{ " 1-1:\x8Dテンモンカンソクジョ デ ボウエンキョウ", Select_LoadGame, 0x54A0 },
// " 1 - 2: Ikana Graveyard" (" 1 - 2: Ikana Canyon Graveyard")
{ " 1-2:\x8Cイカーナ \x8Dノ ハカバ", Select_LoadGame, 0x8000 },
// " 2: Romani Ranch" (" 2: Romani Ranch")
{ " 2:\x8Cロマニー \x8Dボクジョウ", Select_LoadGame, 0x6400 },
// " 3: Milk Road" (" 3: Milk Road")
{ " 3:\x8Cミルクロード", Select_LoadGame, 0x3E00 },
// " 4: Main Building" (" 4: Ranch House")
{ " 4:\x8Dオモヤ", Select_LoadGame, 0x610 },
// " 5: Cow Shed" (" 5: Cow Shed")
{ " 5:\x8Dウシゴヤ", Select_LoadGame, 0x600 },
// " 6: Cucco Shed" (" 6: Cucco Shed")
{ " 6:\x8Cコッコ \x8Dゴヤ", Select_LoadGame, 0x7E00 },
// " 7: Dog Racing Area" (" 7: Doggy Racetrack")
{ " 7:\x8Cドッグレース\x8Dジョウ", Select_LoadGame, 0x7C00 },
// " 8: Gorman Track" (" 8: Gorman Track")
{ " 8:\x8Cゴーマン トラック", Select_LoadGame, 0xCE00 },
// " 10: Mountain Village -Winter-" (" 10: Mountain Village - Winter")
{ " 10:\x8Dヤマザト -フユ-", Select_LoadGame, 0x9A00 },
// " 10 - 0: Mountain Village -Spring-" (" 10 - 0: Mountain Village - Spring")
{ " 10-0:\x8Dヤマザト -ハル-", Select_LoadGame, 0xAE00 },
// " 10 - 1: Mountain Village Blacksmith" (" 10 - 1: Mountain Smithy")
{ " 10-1:\x8Dヤマザト ノ カジヤ", Select_LoadGame, 0x5200 },
// " 11: Goron Village -Winter-" (" 11: Goron Village - Winter")
{ " 11:\x8Cゴロン\x8D ノ サト -フユ-", Select_LoadGame, 0x9400 },
// " 11-0: Goron Village -Spring-" (" 11-0: Goron Village - Spring")
{ " 11-0:\x8Cゴロン\x8D ノ サト -ハル-", Select_LoadGame, 0x8A00 },
// " 11-1: Goron Shrine" (" 11-1: Goron Shrine")
{ " 11-1:\x8Cゴロン\x8D ノ ホコラ", Select_LoadGame, 0x5E00 },
// " 11-2: Lone Peak Shrine" (" 11-2: Lone Peak Shrine")
{ " 11-2:\x8Dハナレヤマ ノ ホコラ", Select_LoadGame, 0x1500 },
// " 11-3: Goron Shop" (" 11-3: Goron Shop")
{ " 11-3:\x8Cゴロン \x8Dノ ミセ", Select_LoadGame, 0x7400 },
// " 12: Snowhead" (" 12: Snowhead")
{ " 12:\x8Cスノーヘッド", Select_LoadGame, 0xB200 },
// " 13: Blizzard Path" (" 13: Path to Goron Village - Part 1")
{ " 13:\x8Dフブキ ノ ミチ", Select_LoadGame, 0x3200 },
// " 14: Snowball Path" (" 14: Path to Goron Village - Part 2")
{ " 14:\x8Dユキダマ ノ ミチ", Select_LoadGame, 0xB000 },
// " 15: Goron Racetrack" (" 15: Goron Racetrack")
{ " 15:\x8Cゴロンレース \x8Dジョウ", Select_LoadGame, 0xD000 },
// " 16: Goron Grave" (" 16: Darmani's Grave")
{ " 16:\x8Cゴロン \x8Dノ ハカ", Select_LoadGame, 0x9600 },
// " 17: Snow Field Battle -Winter-" (" 17: Path to Goron Village - Winter")
{ " 17:\x8Dセツゲン \x8Cバトル \x8D-フユ-", Select_LoadGame, 0xB400 },
// " 17-0: Snow Field Battle -Spring-" (" 17-0: Path to Goron Village - Spring")
{ " 17-0:\x8Dセツゲン \x8Cバトル \x8D-ハル-", Select_LoadGame, 0xB600 },
// " 20: Swampland" (" 20: Southern Swamp")
{ " 20:\x8Dヌマチ", Select_LoadGame, 0x8400 },
// " 20-0: Swampland - Afterwards" (" 20-0: Southern Swamp - After Odolwa")
{ " 20-0:\x8Dヌマチ ソノゴ", Select_LoadGame, 0xC00 },
// " 20-1: Swamp Tourist Information" (" 20-1: Tourist Information")
{ " 20-1:\x8Dヌマ ノ カンコウアンナイ", Select_LoadGame, 0xA800 },
// " 20-2: Magic Hags' Potion Shop" (" 20-2: Magic Hags' Potion Shop")
{ " 20-2:\x8Dマホウオババ ノ クスリヤ", Select_LoadGame, 0x400 },
// " 21: Wood Mountain" (" 21: Woodfall")
{ " 21:\x8Cウッドマウンテン", Select_LoadGame, 0x8600 },
// " 21-0: Deku Princess's Prison" (" 21-0: Deku Princess's Prison [Cutscene: Tatl Apologizes]")
{ " 21-0:\x8Cデク\x8Dヒメ ノ ロウヤ", Select_LoadGame, 0x3010 },
// " 22: Deku Castle" (" 22: Deku Palace")
{ " 22:\x8Cデクナッツ \x8Dノ シロ", Select_LoadGame, 0x5000 },
// " 22-0: Boe Hole 0" (" 22-0: Deku Palace Grotto 0 - Deku Baba & Butterflies, Entrance 1")
{ " 22-0:\x8Cクロスケ \x8Dノ アナ0", Select_LoadGame, 0x1460 },
// " 22-1: Boe Hole 1" (" 22-1: Deku Palace Grotto 1 - Deku Baba & Butterflies, Entrance 2")
{ " 22-1:\x8Cクロスケ \x8Dノ アナ1", Select_LoadGame, 0x14E0 },
// " 22-2: Boe Hole 2" (" 22-2: Deku Palace Grotto 2 - Skullwalltula Wall, Lower Entrance")
{ " 22-2:\x8Cクロスケ \x8Dノ アナ2", Select_LoadGame, 0x1480 },
// " 22-3: Boe Hole 3" (" 22-3: Deku Palace Grotto 3 - Skullwalltula Wall, Upper Entrance")
{ " 22-3:\x8Cクロスケ \x8Dノ アナ3", Select_LoadGame, 0x14F0 },
// " 22-4: Boe Hole 4" (" 22-4: Deku Palace Grotto 4 - Bean Seller")
{ " 22-4:\x8Cクロスケ \x8Dノ アナ4", Select_LoadGame, 0x14C0 },
// " 24: Beast Path" (" 24: Road to Swamp")
{ " 24:\x8Dケモノミチ", Select_LoadGame, 0x7A00 },
// " 24-0: Forest Shooting Gallery" (" 24-0: Swamp Shooting Gallery")
{ " 24-0:\x8Dモリ ノ シャテキジョウ", Select_LoadGame, 0x4200 },
// " 25: Deku King's Chamber" (" 25: Deku Palace Throne Room")
{ " 25:\x8Cデク\x8Dオウ ノ マ", Select_LoadGame, 0x7600 },
// " 26: Woods of Mystery" (" 26: Woods of Mystery")
{ " 26:\x8Dフシギ ノ モリ", Select_LoadGame, 0xC200 },
// " 30: Great Bay Coast" (" 30: Great Bay Coast - Entrance Area")
{ " 30:\x8Cグレートベイ\x8D ノ カイガン", Select_LoadGame, 0x6800 },
// " 30-0: Ocean Laboratory" (" 30-0: Marine Research Lab")
{ " 30-0:\x8Dカイヨウ ケンキュウジョ", Select_LoadGame, 0x5800 },
// " 30-1: Fisherman's House" (" 30-1: Fisherman's Hut")
{ " 30-1:\x8Dリョウシ ノ イエ", Select_LoadGame, 0x7200 },
// " 30-2: Pointed Rock" (" 30-2: Twin Pillars")
{ " 30-2:\x8Dトンガリ イワ", Select_LoadGame, 0x4400 },
// " 31: Cape" (" 31: Great Bay Coast - River Area")
{ " 31:\x8Dミサキ", Select_LoadGame, 0x6A00 },
// " 32: Outside of Pirates' Fortress" (" 32: Pirates' Fortress - Exterior")
{ " 32:\x8Dカイゾクノトリデマエ", Select_LoadGame, 0x7000 },
// " 32-0: Pirates' Fortress" (" 32-0: Pirates' Fortress - Courtyard")
{ " 32-0:\x8Dカイゾクノトリデ", Select_LoadGame, 0x2200 },
// " 32-1: Pirates' Fortress - Telescope" (" 32-1: Pirates' Fortress - Secret Entrance (Looking Through
// Telescope)")
{ " 32-1:\x8Dカイゾクノトリデ ボウエンキョウ", Select_LoadGame, 0x22A0 },
// " 32-2: Pirates' Fortress - Interior 0" (" 32-2: Pirates' Fortress - Throne Room")
{ " 32-2:\x8Dカイゾクノトリデナイブ0", Select_LoadGame, 0x4000 },
// " 32-3: Pirates' Fortress - Interior 1" (" 32-3: Pirates' Fortress - View of Throne Room, Wasp Nest")
{ " 32-3:\x8Dカイゾクノトリデナイブ1", Select_LoadGame, 0x4010 },
// " 32-4: Pirates' Fortress - Interior 2" (" 32-4: Pirates' Fortress - Tempting Treasure Chest, Leading to 32-5")
{ " 32-4:\x8Dカイゾクノトリデナイブ2", Select_LoadGame, 0x4020 },
// " 32-5: Pirates' Fortress - Interior 3" (" 32-5: Pirates' Fortress - Zora Egg Room, One Shell Blade")
{ " 32-5:\x8Dカイゾクノトリデナイブ3", Select_LoadGame, 0x4030 },
// " 32-6: Pirates' Fortress - Interior 4" (" 32-6: Pirates' Fortress - Oil Drum Room, Leading to 32-7")
{ " 32-6:\x8Dカイゾクノトリデナイブ4", Select_LoadGame, 0x4040 },
// " 32-7: Pirates' Fortress - Interior 5" (" 32-7: Pirates' Fortress - Zora Egg Room, One Shell Blade")
{ " 32-7:\x8Dカイゾクノトリデナイブ5", Select_LoadGame, 0x4050 },
// " 32-8: Pirates' Fortress - Interior 6" (" 32-8: Pirates' Fortress - Fenced Indoor Walkway, Leading to 32-9")
{ " 32-8:\x8Dカイゾクノトリデナイブ6", Select_LoadGame, 0x4060 },
// " 32-9: Pirates' Fortress - Interior 7" (" 32-9: Pirates' Fortress - Zora Egg Room, One Desbreko & Treasure
// Chest")
{ " 32-9:\x8Dカイゾクノトリデナイブ7", Select_LoadGame, 0x4070 },
// " 32-10: Pirates' Fortress - Interior 8" (" 32-10: Pirates' Fortress - End of Secret Entrance (Telescope
// Room)")
{ " 32-10:\x8Dカイゾクノトリデナイブ8", Select_LoadGame, 0x4080 },
// " 32-11: Pirates' Fortress - Interior 9" (" 32-11: Pirates' Fortress - Start of Secret Entrance")
{ " 32-11:\x8Dカイゾクノトリデナイブ9", Select_LoadGame, 0x4090 },
// " 33: Zora Shrine" (" 33: Zora Hall")
{ " 33:\x8Cゾーラ \x8Dノ ホコラ", Select_LoadGame, 0x6000 },
// " 33-0: Zora Shop" (" 33-0: Zora Shop")
{ " 33-0:\x8Cゾーラ \x8Dノ ミセ", Select_LoadGame, 0x9250 },
// " 33-1: Zora Waiting Room" (" 33-1: Mikau & Tijo's Room")
{ " 33-1:\x8Cゾーラ \x8Dノ ヒカエシツ", Select_LoadGame, 0x9200 },
// " 34: Great Bay" (" 34: Great Bay [Cutscene: Pirates Approach Temple]")
{ " 34:\x8Cグレートベイ", Select_LoadGame, 0xBE00 },
// " 35: Mountain Stream Above Falls" (" 35: Waterfall Rapids")
{ " 35:\x8Dタキウエ ノ ケイリュウ", Select_LoadGame, 0x8E00 },
// " 40: Rock Building Shaft" (" 40: Stone Tower")
{ " 40:\x8Cロックビル\x8D ノ タテアナ", Select_LoadGame, 0xAA00 },
// " 40-0: Heaven & Earth Are Overturned" (" 40-0: Stone Tower [Cutscene: Tower is Flipped]")
{ " 40-0:\x8Dテンチ ギャクテン", Select_LoadGame, 0xAC00 },
// " 41: Road to Ikana" (" 41: Road to Ikana")
{ " 41:\x8Cイカーナ \x8Dヘノ ミチ", Select_LoadGame, 0xA000 },
// " 42: Ancient Castle of Ikana" (" 42: Ancient Castle of Ikana")
{ " 42:\x8Cイカーナ\x8D コジョウ", Select_LoadGame, 0x3400 },
// " 42-0: Ancient Castle of Ikana - Interior" (" 42-0: Ancient Castle of Ikana - Interior")
{ " 42-0:\x8Cイカーナ\x8D ノ コジョウ ナイブ", Select_LoadGame, 0x3430 },
// " 42-B: Ancient Castle of Ikana - Boss Room" (" 42-B: Ikana King's Throne")
{ " 42-B:\x8Cイカーナ\x8D ノ コジョウ \x8Cボス\x8Dベヤ", Select_LoadGame, 0xA600 },
// " 43: Ikana Canyon" (" 43: Ikana Canyon")
{ " 43:\x8Cイカーナ \x8Dケイコク", Select_LoadGame, 0x2000 },
// " 43-0: Ikana Canyon Cave" (" 43-0: Sharp's Cave")
{ " 43-0:\x8Cイカーナ \x8Dケイコク ドウクツ", Select_LoadGame, 0x20E0 },
// " 43-1: Secom's House" (" 43-1: Sakon's Hideout")
{ " 43-1:\x8Cセコム \x8Dノ イエ", Select_LoadGame, 0x9800 },
// " 43-2: Music Box House" (" 43-2: Music Box House")
{ " 43-2:\x8Cオルゴール ハウス", Select_LoadGame, 0xA400 },
// " 50: Clock Town -East-" (" 50: East Clock Town")
{ " 50:\x8Cクロックタウン \x8D-ヒガシ-", Select_LoadGame, 0xD200 },
// " 50-0: Town Target Range" (" 50-0: Shooting Gallery")
{ " 50-0:\x8Dマチ ノ シャテキジョウ", Select_LoadGame, 0x3A00 },
// " 50-1: Honey and Darling's Shop" (" 50-1: Honey & Darling's Shop")
{ " 50-1:\x8Cハニー アンド ダーリン \x8Dノ ミセ", Select_LoadGame, 0x800 },
// " 50-2: Treasure Chest Shop" (" 50-2: Treasure Chest Shop")
{ " 50-2:\x8Dタカラバコヤ", Select_LoadGame, 0x2800 },
// " 50-3: Pots 'n' Pans Inn" (" 50-3: Stockpot Inn")
{ " 50-3:\x8Cナベ\x8Dカマ テイ", Select_LoadGame, 0xBC00 },
// " 50-4: Mayor's House" (" 50-4: The Mayor's Residence")
{ " 50-4:\x8Dチョウチョウ ノ イエ", Select_LoadGame, 0 },
// " 50-5: Milk Bar" (" 50-5: Milk Bar")
{ " 50-5:\x8Cミルクバー", Select_LoadGame, 0x2400 },
// " 51: Clock Town -West-" (" 51: West Clock Town")
{ " 51:\x8Cクロックタウン \x8D-ニシ-", Select_LoadGame, 0xD400 },
// " 51-0: Bomb Shop" (" 51-0: Bomb Shop")
{ " 51-0:\x8Dバクダン ヤ", Select_LoadGame, 0xCA00 },
// " 51-1: Maniac Mart" (" 51-1: Curiosity Shop")
{ " 51-1:\x8Cマニ\x8D", Select_LoadGame, 0xE00 },
// " 51-2: General Store" (" 51-2: Trading Post")
{ " 51-2:\x8Dザッカ ヤ", Select_LoadGame, 0x6200 },
// " 51-3: Sword Dojo" (" 51-3: Swordsman's School")
{ " 51-3:\x8Dケンドウジョウ", Select_LoadGame, 0xA200 },
// " 51-4: Post House" (" 51-4: Post Office")
{ " 51-4:\x8Dポストハウス", Select_LoadGame, 0x5600 },
// " 51-5: Lottery Shop" (" 51-5: Lottery Shop")
{ " 51-5:\x8Dタカラクジヤ", Select_LoadGame, 0x6C00 },
// " 52: Clock Town -North-" (" 52: North Clock Town")
{ " 52:\x8Cクロックタウン \x8D-キタ-", Select_LoadGame, 0xD600 },
// " 53: Clocktown -South-" (" 53: South Clock Town")
{ " 53:\x8Cクロックタウン \x8D-ミナミ-", Select_LoadGame, 0xD800 },
// " 53-0: Clock Tower Interior" (" 53-0: Clock Tower Interior")
{ " 53-0:\x8Dトケイトウナイブ", Select_LoadGame, 0xC000 },
// " 54: Clock Tower Rooftop" (" 54: Clock Tower Rooftop")
{ " 54:\x8Dトケイトウ オクジョウ", Select_LoadGame, 0x2C00 },
// " 55: Laundry Area" (" 55: Laundry Pool")
{ " 55:\x8Dセンタクジョウ", Select_LoadGame, 0xDA00 },
// " 55-0: Maniac Mart - Rear Entrance" (" 55-0: Curiosity Shop - Back Room")
{ " 55-0:\x8Cマニ\x8Dヤ ノ ウラグチ", Select_LoadGame, 0xE10 },
// " 55-1: Maniac Mart - Peephole" (" 55-1: Curiosity Shop Back Room - Peephole")
{ " 55-1:\x8Cマニ\x8Dヤ ノ ノゾキアナ", Select_LoadGame, 0xE20 },
// "100: Wood Mountain Temple" ("100: Woodfall Temple")
{ "100:\x8Cウッドマウンテン \x8Dノ シンデン", Select_LoadGame, 0x3000 },
// "100-B: Wood Mountain Temple - Boss" ("100-B: Odolwa's Lair")
{ "100-B:\x8Cウッドマウンテン \x8Dノ シンデン\x8C-ボス-", Select_LoadGame, 0x3800 },
// "101: Snowhead Temple" ("101: Snowhead Temple")
{ "101:\x8Cスノーヘッド \x8Dノ シンデン", Select_LoadGame, 0x3C00 },
// "101-B: Snowhead Temple - Boss" ("101-B: Goht's Lair")
{ "101-B:\x8Cスノーヘッド \x8Dノ シンデン\x8C-ボス-", Select_LoadGame, 0x8200 },
// "102: Great Bay Temple" ("102: Great Bay Temple")
{ "102:\x8Cグレートベイ \x8Dノ シンデン", Select_LoadGame, 0x8C00 },
// "102-B: Great Bay Temple - Boss" ("102-B: Gyorg's Lair")
{ "102-B:\x8Cグレートベイ \x8Dノ シンデン\x8C-ボス-", Select_LoadGame, 0xB800 },
// "103: Rock Building Temple -Top Side-" ("103: Stone Tower Temple")
{ "103:\x8Cロックビル \x8Dノ シンデン-オモテー", Select_LoadGame, 0x2600 },
// "103-0: Rock Building Temple -Underside-" ("103-0: Stone Tower Temple - Flipped")
{ "103-0:\x8Cロックビル \x8Dノ シンデン-ウラー", Select_LoadGame, 0x2A00 },
// "103-B: Rock Building Temple - Boss" ("103-B: Twinmold's Lair")
{ "103-B:\x8Cロックビル \x8Dノ シンデン\x8C-ボス-", Select_LoadGame, 0x6600 },
// "104: Steppe" ("104: On the Moon")
{ "104:\x8Cソウゲン", Select_LoadGame, 0xC800 },
// "104-0: Last Deku Dungeon" ("104-0: Deku Trial")
{ "104-0:\x8Cラスト デク ダンジョン", Select_LoadGame, 0x4E00 },
// "104-1: Last Goron Dungeon" ("104-1: Goron Trial")
{ "104-1:\x8Cラスト ゴロン ダンジョン", Select_LoadGame, 0x7800 },
// "104-2: Last Zora Dungeon" ("104-2: Zora Trial")
{ "104-2:\x8Cラスト ゾーラ ダンジョン", Select_LoadGame, 0x8800 },
// "104-3: Last Link Dungeon" ("104-3: Link Trial")
{ "104-3:\x8Cラスト リンク ダンジョン", Select_LoadGame, 0xC600 },
// "104-B: Last Dungeon -Boss-" ("104-B: Majora's Lair")
{ "104-B:\x8Cラストダンジョン -ボス-", Select_LoadGame, 0x200 },
// "119: Deku Shrine" ("119: Deku Shrine")
{ "119:\x8Cデクナッツ \x8Dノ ホコラ", Select_LoadGame, 0x9E00 },
// "121: Secret Shrine" ("121: Secret Shrine")
{ "121:\x8Dヒミツ ノ ホコラ", Select_LoadGame, 0xBA00 },
// "122: Opening Dungeon" ("122: Pond Area [Cutscene: Falling of the Cliff]")
{ "122:\x8Cオープニング ダンジョン", Select_LoadGame, 0x2E00 },
// "123: Giants' Chamber" ("123: Giants' Chamber")
{ "123:\x8Dキョジン ノ マ", Select_LoadGame, 0xCC00 },
// "126: Deku Minigame" ("126: Deku Rupee Minigame")
{ "126:\x8Cデクナッツ ミニゲーム", Select_LoadGame, 0x3600 },
// "127-0: Fairy Fountain 0" ("127-0: Fairy Fountain - Clock Town")
{ "127-0:\x8Dヨウセイ ノ イズミ 0", Select_LoadGame, 0x4600 },
// "127-1: Fairy Fountain 1" ("127-1: Fairy Fountain - Woodfall")
{ "127-1:\x8Dヨウセイ ノ イズミ 1", Select_LoadGame, 0x4610 },
// "127-2: Fairy Fountain 2" ("127-2: Fairy Fountain - Snowhead")
{ "127-2:\x8Dヨウセイ ノ イズミ 2", Select_LoadGame, 0x4620 },
// "127-3: Fairy Fountain 3" ("127-3: Fairy Fountain - Great Bay Coast")
{ "127-3:\x8Dヨウセイ ノ イズミ 3", Select_LoadGame, 0x4630 },
// "127-4: Fairy Fountain 4" ("127-4: Fairy Fountain - Ikana Canyon")
{ "127-4:\x8Dヨウセイ ノ イズミ 4", Select_LoadGame, 0x4640 },
// "128: Swamp Spider Manor" ("128: Swamp Spider House")
{ "128:\x8Dヌマ ノ クモヤカタ", Select_LoadGame, 0x4800 },
// "129: Ocean Spider Manor" ("129: Oceanside Spider House")
{ "129:\x8Dウミ ノ クモヤカタ", Select_LoadGame, 0x4A00 },
// "130: Beneath the Graves - Dampe" ("130: Beneath the Graveyard")
{ "130:\x8Dハカ ノ シタ-\x8Cダンペイ-", Select_LoadGame, 0x5A00 },
// "131: Beneath the Well" ("131: Beneath the Well")
{ "131:\x8Dイド ノ シタ", Select_LoadGame, 0x9000 },
// "132: Ghost Hut" (" 132: Ghost Hut")
{ "132:\x8Dユウレイゴヤ", Select_LoadGame, 0x9C00 },
// "133-0: Beneath the Graves 0" ("133-0: Beneath the Graveyard - Part 1")
{ "133-0:\x8Dハカ ノ シタ0", Select_LoadGame, 0xA00 },
// "133-1: Beneath the Graves 1" ("133-1: Beneath the Graveyard - Part 2")
{ "133-1:\x8Dハカ ノ シタ1", Select_LoadGame, 0xA10 },
// "134-0: Secret Grotto 0" ("134-0: Secret Grotto - Four Gossip Stones")
{ "134-0:\x8Dカクシアナ 0", Select_LoadGame, 0x1400 },
// "134-1: Secret Grotto 1" ("134-1: Secret Grotto - Four Gossip Stones, Skulltula")
{ "134-1:\x8Dカクシアナ 1", Select_LoadGame, 0x1410 },
// "134-2: Secret Grotto 2" ("134-2: Secret Grotto - Four Gossip Stones, Water Puddles")
{ "134-2:\x8Dカクシアナ 2", Select_LoadGame, 0x1420 },
// "134-3: Secret Grotto 3" ("134-3: Secret Grotto - Four Gossip Stones, Water Puddle With Bugs")
{ "134-3:\x8Dカクシアナ 3", Select_LoadGame, 0x1430 },
// "134-4: Secret Grotto 4" ("134-4: Secret Grotto - Chest with Blue Rupee, Deku Babas")
{ "134-4:\x8Dカクシアナ 4", Select_LoadGame, 0x1440 },
// "134-5: Secret Grotto 5" ("134-5: Secret Grotto - Hot Spring, Deku Babas, Large Stones")
{ "134-5:\x8Dカクシアナ5", Select_LoadGame, 0x1450 },
// "134-7: Secret Grotto 7" ("134-7: Secret Grotto - Two Dondogos")
{ "134-7:\x8Dカクシアナ 7", Select_LoadGame, 0x1470 },
// "134-9: Secret Grotto 9" ("134-9: Secret Grotto - Tall Grass With Box, Pot, Bugs")
{ "134-9:\x8Dカクシアナ 9", Select_LoadGame, 0x1490 },
// "134-10: Secret Grotto 10" ("134-10: Secret Grotto - Two Cows Surrounded by Grass")
{ "134-10:\x8Dカクシアナ10", Select_LoadGame, 0x14A0 },
// "134-11: Secret Grotto 11" ("134-11: Secret Grotto - Watery Hole Filled with Underwater Babas, Fish")
{ "134-11:\x8Dカクシアナ11", Select_LoadGame, 0x14B0 },
// "134-13: Secret Grotto 13" ("134-13: Secret Grotto - Peahat in Center")
{ "134-13:\x8Dカクシアナ13", Select_LoadGame, 0x14D0 },
// "X 1: SPOT00" ("X 1: Opening [Cutscene: Opening Cutscene]")
{ "X 1:SPOT00", Select_LoadGame, 0x1C00 },
// "Title" ("Title Screen")
{ "title", (void*)Select_LoadTitle, 0x0000 },
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/func_808016E8.s")
void Select_UpdateMenu(SelectContext* this) {
s32 playerForm;
Input* controller1 = CONTROLLER1(this);
s32 stickY;
s32 pad[2];
s16 i;
s32 updateRate;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/func_8080194C.s")
if (this->verticalInputAccumulator == 0) {
if (CHECK_BTN_ALL(controller1->press.button, BTN_A) || CHECK_BTN_ALL(controller1->press.button, BTN_START)) {
for (i = 0; i < ARRAY_COUNT(gSaveContext.unk_3EC0); i++) {
gSaveContext.unk_3DD0[i] = 0;
gSaveContext.unk_3DE0[i] = 0;
gSaveContext.unk_3E18[i] = 0;
gSaveContext.unk_3E50[i] = 0;
gSaveContext.unk_3E88[i] = 0;
gSaveContext.unk_3EC0[i] = 0;
}
gSaveContext.minigameState = 0;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/func_808019FC.s")
if (this->scenes[this->currentScene].loadFunc != NULL) {
this->scenes[this->currentScene].loadFunc(this, this->scenes[this->currentScene].entranceIndex,
this->opt);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/func_80801A64.s")
if (CHECK_BTN_ALL(controller1->press.button, BTN_B)) {
playerForm = gSaveContext.playerForm - 1;
if (playerForm < PLAYER_FORM_FIERCE_DEITY) {
playerForm = PLAYER_FORM_HUMAN;
}
gSaveContext.playerForm = playerForm;
}
void Select_Main(GameState* thisx);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/Select_Main.s")
if (CHECK_BTN_ALL(controller1->press.button, BTN_Z)) {
if (gSaveContext.cutscene == 0x8000) {
gSaveContext.cutscene = 0;
} else if (gSaveContext.cutscene == 0) {
gSaveContext.cutscene = 0x8800;
} else if (gSaveContext.cutscene == 0x8800) {
gSaveContext.cutscene = 0xFFF0;
} else if (gSaveContext.cutscene == 0xFFF0) {
gSaveContext.cutscene = 0xFFF1;
} else if (gSaveContext.cutscene == 0xFFF1) {
gSaveContext.cutscene = 0xFFF2;
} else if (gSaveContext.cutscene == 0xFFF2) {
gSaveContext.cutscene = 0xFFF3;
} else if (gSaveContext.cutscene == 0xFFF3) {
gSaveContext.cutscene = 0xFFF4;
} else if (gSaveContext.cutscene == 0xFFF4) {
gSaveContext.cutscene = 0xFFF5;
} else if (gSaveContext.cutscene == 0xFFF5) {
gSaveContext.cutscene = 0xFFF6;
} else if (gSaveContext.cutscene == 0xFFF6) {
gSaveContext.cutscene = 0xFFF7;
} else if (gSaveContext.cutscene == 0xFFF7) {
gSaveContext.cutscene = 0xFFF8;
} else if (gSaveContext.cutscene == 0xFFF8) {
gSaveContext.cutscene = 0xFFF9;
} else if (gSaveContext.cutscene == 0xFFF9) {
gSaveContext.cutscene = 0xFFFA;
} else if (gSaveContext.cutscene == 0xFFFA) {
gSaveContext.cutscene = 0x8000;
}
} else if (CHECK_BTN_ALL(controller1->press.button, BTN_R)) {
if (gSaveContext.cutscene == 0x8000) {
gSaveContext.cutscene = 0xFFFA;
} else if (gSaveContext.cutscene == 0) {
gSaveContext.cutscene = 0x8000;
} else if (gSaveContext.cutscene == 0x8800) {
gSaveContext.cutscene = 0;
} else if (gSaveContext.cutscene == 0xFFF0) {
gSaveContext.cutscene = 0x8800;
} else if (gSaveContext.cutscene == 0xFFF1) {
gSaveContext.cutscene = 0xFFF0;
} else if (gSaveContext.cutscene == 0xFFF2) {
gSaveContext.cutscene = 0xFFF1;
} else if (gSaveContext.cutscene == 0xFFF3) {
gSaveContext.cutscene = 0xFFF2;
} else if (gSaveContext.cutscene == 0xFFF4) {
gSaveContext.cutscene = 0xFFF3;
} else if (gSaveContext.cutscene == 0xFFF5) {
gSaveContext.cutscene = 0xFFF4;
} else if (gSaveContext.cutscene == 0xFFF6) {
gSaveContext.cutscene = 0xFFF5;
} else if (gSaveContext.cutscene == 0xFFF7) {
gSaveContext.cutscene = 0xFFF6;
} else if (gSaveContext.cutscene == 0xFFF8) {
gSaveContext.cutscene = 0xFFF7;
} else if (gSaveContext.cutscene == 0xFFF9) {
gSaveContext.cutscene = 0xFFF8;
} else if (gSaveContext.cutscene == 0xFFFA) {
gSaveContext.cutscene = 0xFFF9;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/Select_Destroy.s")
gSaveContext.isNight = false;
if (gSaveContext.cutscene == 0x8800) {
gSaveContext.isNight = true;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_select/Select_Init.s")
if (CHECK_BTN_ALL(controller1->press.button, BTN_CUP)) {
this->opt--;
}
if (CHECK_BTN_ALL(controller1->press.button, BTN_CDOWN)) {
this->opt++;
}
if (CHECK_BTN_ALL(controller1->press.button, BTN_CLEFT)) {
if (gSaveContext.day > 1) {
gSaveContext.day--;
}
}
if (CHECK_BTN_ALL(controller1->press.button, BTN_CRIGHT)) {
if (gSaveContext.day < 4) {
gSaveContext.day++;
}
}
updateRate = R_UPDATE_RATE;
stickY = controller1->rel.stick_y;
if (stickY != 0) {
this->verticalInput = (updateRate * stickY) / 7;
} else {
if (CHECK_BTN_ALL(controller1->press.button, BTN_DUP)) {
if (this->lockUp == true) {
this->timerUp = 0;
}
if (this->timerUp == 0) {
this->timerUp = 20;
this->lockUp = true;
play_sound(NA_SE_IT_SWORD_IMPACT);
this->verticalInput = updateRate;
}
}
if (CHECK_BTN_ALL(controller1->cur.button, BTN_DUP) && (this->timerUp == 0)) {
play_sound(NA_SE_IT_SWORD_IMPACT);
this->verticalInput = updateRate * 3;
}
if (CHECK_BTN_ALL(controller1->press.button, BTN_DDOWN)) {
if (this->lockDown == true) {
this->timerDown = 0;
}
if (this->timerDown == 0) {
this->timerDown = 20;
this->lockDown = true;
play_sound(NA_SE_IT_SWORD_IMPACT);
this->verticalInput = -updateRate;
}
}
if (CHECK_BTN_ALL(controller1->cur.button, BTN_DDOWN) && (this->timerDown == 0)) {
play_sound(NA_SE_IT_SWORD_IMPACT);
this->verticalInput = -updateRate * 3;
}
if (CHECK_BTN_ALL(controller1->press.button, BTN_DLEFT) ||
CHECK_BTN_ALL(controller1->cur.button, BTN_DLEFT)) {
play_sound(NA_SE_IT_SWORD_IMPACT);
this->verticalInput = updateRate;
}
if (CHECK_BTN_ALL(controller1->press.button, BTN_DRIGHT) ||
CHECK_BTN_ALL(controller1->cur.button, BTN_DRIGHT)) {
play_sound(NA_SE_IT_SWORD_IMPACT);
this->verticalInput = -updateRate;
}
}
}
if (CHECK_BTN_ALL(controller1->press.button, BTN_L)) {
this->pageDownIndex++;
this->pageDownIndex =
(this->pageDownIndex + ARRAY_COUNT(this->pageDownStops)) % ARRAY_COUNT(this->pageDownStops);
this->currentScene = this->topDisplayedScene = this->pageDownStops[this->pageDownIndex];
}
this->verticalInputAccumulator += this->verticalInput;
if (this->verticalInputAccumulator < -7) {
this->verticalInput = 0;
this->verticalInputAccumulator = 0;
this->currentScene++;
this->currentScene = (this->currentScene + this->count) % this->count;
if (this->currentScene == ((this->topDisplayedScene + 19 + this->count) % this->count)) {
this->topDisplayedScene++;
this->topDisplayedScene = (this->topDisplayedScene + this->count) % this->count;
}
}
if (this->verticalInputAccumulator > 7) {
this->verticalInput = 0;
this->verticalInputAccumulator = 0;
if (this->currentScene == this->topDisplayedScene) {
this->topDisplayedScene -= 2;
this->topDisplayedScene = (this->topDisplayedScene + this->count) % this->count;
}
this->currentScene--;
this->currentScene = (this->currentScene + this->count) % this->count;
if (this->currentScene == ((this->topDisplayedScene + this->count) % this->count)) {
this->topDisplayedScene--;
this->topDisplayedScene = (this->topDisplayedScene + this->count) % this->count;
}
}
this->currentScene = (this->currentScene + this->count) % this->count;
this->topDisplayedScene = (this->topDisplayedScene + this->count) % this->count;
dREG(80) = this->currentScene;
dREG(81) = this->topDisplayedScene;
dREG(82) = this->pageDownIndex;
if (this->timerUp != 0) {
this->timerUp--;
}
if (this->timerUp == 0) {
this->lockUp = false;
}
if (this->timerDown != 0) {
this->timerDown--;
}
if (this->timerDown == 0) {
this->lockDown = false;
}
}
void Select_PrintMenu(SelectContext* this, GfxPrint* printer) {
s32 i;
GfxPrint_SetColor(printer, 255, 155, 150, 255);
GfxPrint_SetPos(printer, 12, 2);
GfxPrint_Printf(printer, "ZELDA MAP SELECT");
GfxPrint_SetColor(printer, 255, 255, 255, 255);
for (i = 0; i < 20; i++) {
s32 sceneIndex;
char* sceneName;
GfxPrint_SetPos(printer, 9, i + 4);
sceneIndex = (this->topDisplayedScene + i + this->count) % this->count;
if (sceneIndex == this->currentScene) {
GfxPrint_SetColor(printer, 255, 20, 20, 255);
} else {
GfxPrint_SetColor(printer, 200, 200, 55, 255);
}
sceneName = this->scenes[sceneIndex].name;
if (sceneName == NULL) {
sceneName = "**Null**";
}
GfxPrint_Printf(printer, "%s", sceneName);
}
GfxPrint_SetColor(printer, 155, 55, 150, 255);
GfxPrint_SetPos(printer, 20, 26);
GfxPrint_Printf(printer, "OPT=%d", this->opt);
}
// clang-format off
static const char* sLoadingMessages[] = {
// "Please wait a minute",
"\x8Dシバラクオマチクダサイ",
// "Hold on a sec",
"\x8Dチョット マッテネ",
// "Wait a moment",
"\x8Cウェイト ア モーメント",
// "Loading",
"\x8Cロード\x8Dチュウ",
// "Now working",
"\x8Dナウ ワーキング",
// "Now creating",
"\x8Dイマ ツクッテマス",
// "It's not broken",
"\x8Dコショウジャナイヨ",
// "Coffee Break",
"\x8Cコーヒー ブレイク",
// "Please set B side",
"\x8C" "Bメンヲセットシテクダサイ",
// "Be patient, now",
"\x8Dジット\x8Cガマン\x8D\x8C\x8Dデアッタ",
// "Please wait just a minute",
"\x8Dイマシバラクオマチクダサイ",
// "Don't worry, don't worry. Take a break, take a break",
"\x8Dアワテナイアワテナイ。ヒトヤスミヒトヤスミ。",
};
// clang-format on
void Select_PrintLoadingMessage(SelectContext* this, GfxPrint* printer) {
s32 index;
GfxPrint_SetPos(printer, 10, 15);
GfxPrint_SetColor(printer, 255, 255, 255, 255);
index = Rand_ZeroOne() * ARRAY_COUNT(sLoadingMessages);
GfxPrint_Printf(printer, "%s", sLoadingMessages[index]);
}
// clang-format off
// Second column is unused
static const char* sFormLabel[][2] = {
// "17 (Adult)" // 17 (Daitetsujin)
{"\x8D""17(オトナ)", "\x8D""17(ダイテツジン)"},
// "30 (Goron)" // 30 (Ice Cream -1)
{"\x8C""30(ゴロン)", "\x8C""30(アイスクリーム-1)"},
// "78 (Zora)" // 78 (Carmen +1)
{"\x8C""78(ゾーラ)", "\x8C""78(カルメン+1)"},
// "12 (Deku)" // 12 (Majestic)
{"\x8C""12(デクナッツ)", "\x8C""12(マジェスティック)"},
// "5 (Child)" // 5 (NTT Kodomo)
{"\x8D""5(コドモ)", "\x8C""5(NTTコドモ)"},
};
// clang-format on
void Select_PrintAgeSetting(SelectContext* this, GfxPrint* printer, s32 playerForm) {
s32 pad;
const char* age;
const char*(*ageTemp)[2];
const char*(*phi_v1)[2];
s32 phi_v0;
if ((playerForm >= PLAYER_FORM_FIERCE_DEITY) && (playerForm < PLAYER_FORM_MAX)) {
ageTemp = &sFormLabel[playerForm];
phi_v1 = ageTemp + 1;
// This loop doesn't do anything
for (phi_v0 = 8; phi_v0 >= 0; phi_v0 -= 8) {
if (phi_v1 != 0) {
break;
}
phi_v1--;
}
if (phi_v1) {}
age = (*ageTemp)[0];
} else {
age = NULL;
}
GfxPrint_SetPos(printer, 4, 26);
GfxPrint_SetColor(printer, 255, 255, 55, 255);
if (age != NULL) {
GfxPrint_Printf(printer, "Age:%s", age);
} else {
// clang-format off
GfxPrint_Printf(printer, "Age:" "???" "(%d)", playerForm);
// clang-format on
}
}
void Select_PrintCutsceneSetting(SelectContext* this, GfxPrint* printer, u16 csIndex) {
const char* stage;
const char* day;
GfxPrint_SetPos(printer, 4, 25);
GfxPrint_SetColor(printer, 255, 255, 55, 255);
// "-jara" used in these strings is a Kokiri speech quirk word
switch (csIndex) {
case 0:
// clang-format off
// "Afternoon-jara"
gSaveContext.time = CLOCK_TIME(12, 0); stage = "\x8Dオヒル\x8Cジャラ";
// clang-format on
break;
case 0x8000:
// clang-format off
// "Morning-jara"
gSaveContext.time = CLOCK_TIME(6, 0) + 1; stage = "\x8Dアサ \x8Cジャラ";
// clang-format on
break;
case 0x8800:
gSaveContext.time = CLOCK_TIME(18, 1);
// "Night-jara"
stage = "\x8Dヨル \x8Cジャラ";
break;
case 0xFFF0:
// clang-format off
// "Cutscene 00"
gSaveContext.time = CLOCK_TIME(12, 0); stage = "デモ00";
// clang-format on
break;
case 0xFFF1:
// "Cutscene 01"
stage = "デモ01";
break;
case 0xFFF2:
// "Cutscene 02"
stage = "デモ02";
break;
case 0xFFF3:
// "Cutscene 03"
stage = "デモ03";
break;
case 0xFFF4:
// "Cutscene 04"
stage = "デモ04";
break;
case 0xFFF5:
// "Cutscene 05"
stage = "デモ05";
break;
case 0xFFF6:
// "Cutscene 06"
stage = "デモ06";
break;
case 0xFFF7:
// "Cutscene 07"
stage = "デモ07";
break;
case 0xFFF8:
// "Cutscene 08"
stage = "デモ08";
break;
case 0xFFF9:
// "Cutscene 09"
stage = "デモ09";
break;
case 0xFFFA:
// "Cutscene 0A"
stage = "デモ0A";
break;
default:
stage = "???";
break;
}
gSaveContext.environmentTime = gSaveContext.time;
GfxPrint_Printf(printer, "Stage:\x8C%s", stage);
GfxPrint_SetPos(printer, 23, 25);
GfxPrint_SetColor(printer, 255, 255, 55, 255);
switch (gSaveContext.day) {
case 1:
// "The First Day"
day = "\x8Dサイショノヒ";
break;
case 2:
// "The Next Day"
day = "\x8Dツギノヒ";
break;
case 3:
// "The Final Day"
day = "\x8Dサイゴノヒ";
break;
case 4:
// "Clear Day"
day = "\x8Dクリアーノヒ";
break;
default:
gSaveContext.day = 1;
// "The First Day"
day = "\x8Dサイショノヒ";
break;
}
GfxPrint_Printf(printer, "Day:\x8D%s", day);
}
void Select_DrawMenu(SelectContext* this) {
GraphicsContext* gfxCtx = this->state.gfxCtx;
GfxPrint* printer;
OPEN_DISPS(gfxCtx);
func_8012C4C0(gfxCtx);
printer = alloca(sizeof(GfxPrint));
GfxPrint_Init(printer);
GfxPrint_Open(printer, POLY_OPA_DISP);
Select_PrintMenu(this, printer);
Select_PrintAgeSetting(this, printer, ((void)0, gSaveContext.playerForm));
Select_PrintCutsceneSetting(this, printer, ((void)0, gSaveContext.cutscene));
POLY_OPA_DISP = GfxPrint_Close(printer);
GfxPrint_Destroy(printer);
CLOSE_DISPS(gfxCtx);
}
void Select_DrawLoadingScreen(SelectContext* this) {
GraphicsContext* gfxCtx = this->state.gfxCtx;
GfxPrint printer;
OPEN_DISPS(gfxCtx);
func_8012C4C0(gfxCtx);
GfxPrint_Init(&printer);
GfxPrint_Open(&printer, POLY_OPA_DISP);
Select_PrintLoadingMessage(this, &printer);
POLY_OPA_DISP = GfxPrint_Close(&printer);
GfxPrint_Destroy(&printer);
CLOSE_DISPS(gfxCtx);
}
void Select_Draw(SelectContext* this) {
GraphicsContext* gfxCtx = this->state.gfxCtx;
func_8012CF0C(gfxCtx, 1, 1, 0, 0, 0);
SET_FULLSCREEN_VIEWPORT(&this->view);
View_RenderView(&this->view, 0xF);
if (!this->state.running) {
Select_DrawLoadingScreen(this);
} else {
Select_DrawMenu(this);
}
}
void Select_Main(GameState* thisx) {
SelectContext* this = (SelectContext*)thisx;
Select_UpdateMenu(this);
Select_Draw(this);
}
void Select_Destroy(GameState* thisx) {
ShrinkWindow_Fini();
}
void Select_Init(GameState* thisx) {
SelectContext* this = (SelectContext*)thisx;
this->state.main = Select_Main;
this->state.destroy = Select_Destroy;
this->scenes = sScenes;
this->topDisplayedScene = 0;
this->currentScene = 0;
this->pageDownStops[0] = 0;
this->pageDownStops[1] = 19;
this->pageDownStops[2] = 37;
this->pageDownStops[3] = 51;
this->pageDownStops[4] = 59;
this->pageDownStops[5] = 73;
this->pageDownStops[6] = 91;
this->pageDownIndex = 0;
this->opt = 0;
this->count = ARRAY_COUNT(sScenes);
ShrinkWindow_Init();
View_Init(&this->view, this->state.gfxCtx);
this->view.flags = (0x08 | 0x02);
this->verticalInputAccumulator = 0;
this->verticalInput = 0;
this->timerUp = 0;
this->timerDown = 0;
this->lockUp = false;
this->lockDown = false;
this->unk_274 = 0;
if ((dREG(80) >= 0) && (dREG(80) < this->count)) {
this->currentScene = dREG(80);
this->topDisplayedScene = dREG(81);
this->pageDownIndex = dREG(82);
}
Game_SetFramerateDivisor(&this->state, 1);
gSaveContext.cutscene = 0;
gSaveContext.playerForm = PLAYER_FORM_HUMAN;
gSaveContext.linkAge = 0;
}

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

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):

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",),

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),

View File

@ -2310,7 +2310,7 @@ asm/non_matchings/code/z_sram_NES/Sram_CalcChecksum.s,Sram_CalcChecksum,0x801445
asm/non_matchings/code/z_sram_NES/func_80144628.s,func_80144628,0x80144628,0x17
asm/non_matchings/code/z_sram_NES/Sram_GenerateRandomSaveFields.s,Sram_GenerateRandomSaveFields,0x80144684,0x83
asm/non_matchings/code/z_sram_NES/func_80144890.s,func_80144890,0x80144890,0x36
asm/non_matchings/code/z_sram_NES/func_80144968.s,func_80144968,0x80144968,0x4B
asm/non_matchings/code/z_sram_NES/Sram_InitDebugSave.s,Sram_InitDebugSave,0x80144968,0x4B
asm/non_matchings/code/z_sram_NES/func_80144A94.s,func_80144A94,0x80144A94,0xF9
asm/non_matchings/code/z_sram_NES/func_80144E78.s,func_80144E78,0x80144E78,0x17D
asm/non_matchings/code/z_sram_NES/func_8014546C.s,func_8014546C,0x8014546C,0x8B
@ -3573,7 +3573,7 @@ asm/non_matchings/code/code_801A5BD0/func_801A794C.s,func_801A794C,0x801A794C,0x
asm/non_matchings/code/code_801A7B10/func_801A7B10.s,func_801A7B10,0x801A7B10,0x7D
asm/non_matchings/code/code_801A7B10/func_801A7D04.s,func_801A7D04,0x801A7D04,0x20
asm/non_matchings/code/code_801A7B10/func_801A7D84.s,func_801A7D84,0x801A7D84,0x309
asm/non_matchings/code/code_801A7B10/func_801A89A8.s,func_801A89A8,0x801A89A8,0xA
asm/non_matchings/code/code_801A7B10/Audio_QueueSeqCmd.s,Audio_QueueSeqCmd,0x801A89A8,0xA
asm/non_matchings/code/code_801A7B10/func_801A89D0.s,func_801A89D0,0x801A89D0,0x20
asm/non_matchings/code/code_801A7B10/func_801A8A50.s,func_801A8A50,0x801A8A50,0x1B
asm/non_matchings/code/code_801A7B10/func_801A8ABC.s,func_801A8ABC,0x801A8ABC,0x16

1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
2310 asm/non_matchings/code/z_sram_NES/func_80144628.s func_80144628 0x80144628 0x17
2311 asm/non_matchings/code/z_sram_NES/Sram_GenerateRandomSaveFields.s Sram_GenerateRandomSaveFields 0x80144684 0x83
2312 asm/non_matchings/code/z_sram_NES/func_80144890.s func_80144890 0x80144890 0x36
2313 asm/non_matchings/code/z_sram_NES/func_80144968.s asm/non_matchings/code/z_sram_NES/Sram_InitDebugSave.s func_80144968 Sram_InitDebugSave 0x80144968 0x4B
2314 asm/non_matchings/code/z_sram_NES/func_80144A94.s func_80144A94 0x80144A94 0xF9
2315 asm/non_matchings/code/z_sram_NES/func_80144E78.s func_80144E78 0x80144E78 0x17D
2316 asm/non_matchings/code/z_sram_NES/func_8014546C.s func_8014546C 0x8014546C 0x8B
3573 asm/non_matchings/code/code_801A7B10/func_801A7B10.s func_801A7B10 0x801A7B10 0x7D
3574 asm/non_matchings/code/code_801A7B10/func_801A7D04.s func_801A7D04 0x801A7D04 0x20
3575 asm/non_matchings/code/code_801A7B10/func_801A7D84.s func_801A7D84 0x801A7D84 0x309
3576 asm/non_matchings/code/code_801A7B10/func_801A89A8.s asm/non_matchings/code/code_801A7B10/Audio_QueueSeqCmd.s func_801A89A8 Audio_QueueSeqCmd 0x801A89A8 0xA
3577 asm/non_matchings/code/code_801A7B10/func_801A89D0.s func_801A89D0 0x801A89D0 0x20
3578 asm/non_matchings/code/code_801A7B10/func_801A8A50.s func_801A8A50 0x801A8A50 0x1B
3579 asm/non_matchings/code/code_801A7B10/func_801A8ABC.s func_801A8ABC 0x801A8ABC 0x16