document filescreen

This commit is contained in:
theo3
2021-02-02 13:58:05 -08:00
parent f26c22b0bf
commit 32fc754306
39 changed files with 3159 additions and 3183 deletions
+77
View File
@@ -0,0 +1,77 @@
#ifndef FILESELECT_H
#define FILESELECT_H
#include "global.h"
#include "functions.h"
#include "main.h"
#include "player.h"
#include "readKeyInput.h"
#include "screen.h"
#include "menu.h"
#include "save.h"
typedef struct {
u8 filler0[0x5];
u8 state;
u8 subState;
u16 timer;
u8 fillerA[0x26];
} ChooseFileState;
// TODO: This occupies the same memory region as gMenu
extern ChooseFileState gChooseFileState;
typedef struct {
u8 filler0[0x1];
u8 unk1;
u8 charColor;
u8 bgColor;
u16 unk4;
u16 unk6;
u8* unk8;
} struct_02036540;
typedef struct {
u8 filler0[0x10];
u16 unk10;
u8 filler12[0x6];
} struct_080FC844;
typedef struct {
u8 filler0[0x4];
} struct_020227E8;
extern struct_020227E8 gUnk_020227E8;
extern SaveFile gSaveFiles[];
extern u32 gUsedPalettes;
extern u8 gUnk_02000D00[];
struct OAMCommand {
u16 x;
u16 y;
u16 _4;
u16 _6;
u16 _8;
} extern gUnk_03001010;
extern void sub_08056FEC(u32, struct_020227E8*);
extern void sub_0805F46C(u32, struct_080FC844*);
extern void sub_0801C4A0(u32, u32);
extern void sub_08080668(void);
extern void sub_0805194C(u32);
extern void LoadPalettes(const u8*, int, int);
extern struct_02036540* sub_0805F2C8(void);
extern void sub_0805F7DC(u32, struct_02036540*);
extern void sub_0805F300(struct_02036540*);
extern void sub_08050A64(u32);
extern void sub_08050AFC(u32);
extern const struct_080FC844 gUnk_080FC844;
extern const u16 gUnk_080FC85C[][3];
extern void (*const gUnk_080FC908[])(void);
extern const u16 gUnk_080FC8DE[];
extern const u8 gGlobalGfxAndPalettes[];
extern void (*const gUnk_080FC93C[])();
#endif
+7 -15
View File
@@ -65,12 +65,6 @@ extern u32 IsItemEquipped(u32);
extern void DeleteManager(Manager*);
extern bool32 CheckPlayerInRegion(u32 centerX, u32 centerY, u32 radiusX, u32 radiusY);
extern u32 CheckIsDungeon();
extern void HandleIntroScreen(void);
extern void HandleChooseFileScreen(void);
extern void HandleGameplayScreen(void);
extern void HandleGameOverScreen(void);
extern void HandleCreditsScreen(void);
extern void HandleDebugTextScreen(void);
extern u32 GetTileTypeByEntity(Entity*);
// Unidentified
@@ -136,7 +130,7 @@ extern s32 sub_0807887C(Entity*, u32, u32);
extern s32 sub_08078904();
extern void sub_0805E5A8(void);
extern void sub_0805E5C0(void);
extern void sub_080AD90C(void);
extern void FlushSprites(void);
extern void sub_080AD9B0(void);
extern void sub_080AD918(void);
extern void sub_0801E104(void);
@@ -190,7 +184,7 @@ extern void sub_0804F578(void);
extern void sub_08059994(void);
extern s32 sub_0801CFA8(u32);
extern void sub_080A3210(void);
extern void sub_080ADA14(u32, u32);
extern void sub_080ADA14(u32, u32); // trampoline to sub_080B27F4
extern void sub_0801E1B8(u32, u32);
extern void sub_0801E1EC(s32, s32, s32);
extern void sub_08050008(void);
@@ -203,7 +197,6 @@ extern u32 sub_080A4494(void);
extern void sub_080A4528(void);
extern void sub_080A4398(void);
extern void sub_0801E738(u32);
extern void sub_080A70AC(const void*);
extern void sub_080A7114(u32);
extern void sub_08001324(Entity*);
extern void sub_08001242(Entity*);
@@ -219,7 +212,7 @@ extern void sub_0807A108(void);
extern void sub_0801766C(Entity*);
extern void sub_08004168(Entity*);
extern u32 sub_08052638(u32);
extern void sub_0805616C(void);
extern void InitDMA(void);
extern u32 sub_0807CF08(u32, u8*);
extern void sub_0807CF48(u32);
extern u32 sub_0807CF10(u8*);
@@ -227,12 +220,11 @@ extern void sub_08056208(void);
extern void sub_08050384();
extern void sub_080B1520(u32);
extern struct_0807D1C4* sub_0807D1C4(u32);
extern u32 sub_0807D24C(u32, char*, u32);
extern u32 sub_0807D24C(u32, const char*, u32);
extern void sub_0807CF68(u32);
extern void sub_0807D20C(u32, char*, u32);
extern void sub_0807D20C(u32, const char*, u32);
extern u32 sub_0807CF88(u32, u8*);
extern u32 sub_0807D008(u32, void*);
extern void sub_0807D184(u32, char*);
extern void sub_0807D184(u32, const char*);
extern u32 sub_0806F520();
extern void sub_0806F4E8(Entity*);
extern u32 sub_0806F3E4(Entity*);
@@ -323,7 +315,7 @@ extern void sub_08008790(Entity*, u32);
extern void sub_0804ACF8();
extern void sub_08073904(Entity*);
extern u32 sub_08056134(void);
extern u32 sub_0807CF30(void*);
extern u32 sub_0807CF30(SaveFile*);
extern void sub_08004484(Entity*, Entity*);
extern void sub_080564C8(u32);
extern void sub_08056F70(void);
+33 -10
View File
@@ -13,6 +13,26 @@ typedef struct { // 0x03001000
u8 field_0xb;
u32 spritePriority;
} MainStruct;
#define SIGNATURE 'MCZ3'
#define MAX_MSG_SPEED 3
#define NUM_SAVE_SLOTS 3
#define MAX_BRIGHTNESS 3
typedef enum {
LANGUAGE_JP,
LANGUAGE_EN,
LANGUAGE_FR,
LANGUAGE_DE,
LANGUAGE_ES,
LANGUAGE_IT,
NUM_LANGUAGES,
} Language;
#ifdef ENGLISH
#define GAME_LANGUAGE LANGUAGE_EN
#else
#define GAME_LANGUAGE LANGUAGE_JP
#endif
enum {
SCREEN_INTRO,
@@ -23,13 +43,6 @@ enum {
SCREEN_DEBUG_TEXT,
};
#define GAME_LANGUAGE GAME_LANGUAGE_EN
#define SIGNATURE 'MCZ3'
#define GAME_LANGUAGE_EN 1
#define MAX_MSG_SPEED 3
#define MAX_SAVE_FILES 3
#define MAX_BRIGHTNESS 3
typedef struct {
u8 interruptFlag;
u8 field_0x1;
@@ -47,7 +60,7 @@ typedef struct {
typedef struct {
/*0x00*/ u16 nextToLoad;
/*0x02*/ u8 transitionType;
/*0x02*/ u8 lastState;
/*0x03*/ u8 field_0x3;
/*0x04*/ u8 state;
/*0x05*/ u8 field_0x5;
@@ -62,7 +75,7 @@ static_assert(sizeof(UI) == 0x3b4);
extern Main gUnk_03001000;
extern UI gUnk_02032EC0;
extern void sub_080A3204(void);
extern void InitSound(void);
extern void sub_0807CE90(void);
extern void sub_080560B8(void);
extern void sub_08056208(void);
@@ -76,9 +89,19 @@ extern void ReadKeyInput(void);
extern void DoSoftReset(void);
extern void sub_08056260(void);
extern void VBlankIntrWait();
extern s32 _call_via_r0(s32);
extern void sub_08056458(void);
extern void sub_08050154(void);
extern void sub_080A3480(void);
extern u8 gUnk_03003DE4;
extern void sub_0804FF84(u32);
extern u16 gPaletteBuffer[];
extern void VBlankInterruptWait(void);
extern void DisableInterruptsAndDMA(void);
extern void sub_08016B34(void);
static void sub_08055F70(void);
static bool32 SoftResetKeysPressed(void);
#endif
+22 -1
View File
@@ -17,9 +17,30 @@ typedef struct {
u32 filler3[3];
} MenuControls;
typedef struct {
u8 key;
u8 value;
} KeySetting;
typedef struct {
u8 aButtonX;
u8 aButtonY;
u8 aButtonText;
u8 bButtonX;
u8 bButtonY;
u8 bButtonText;
u8 rButtonX;
u8 rButtonY;
u8 rButtonText;
KeySetting settingDict[0];
u8 eof;
} PACKED KeyButtonLayout;
extern void sub_080A70AC(const KeyButtonLayout*);
typedef struct {
u8 field_0x0;
u8 field_0x1;
u8 column_idx;
u8 field_0x2;
u8 field_0x3;
u8 field_0x4;
+1 -1
View File
@@ -76,7 +76,7 @@ extern void Object44(Entity*);
extern void Object45(Entity*);
extern void GiantBookLadder(Entity*);
extern void HeartContainer(Entity*);
extern void Object48(Entity*);
extern void FileScreenObjects(Entity*);
extern void Object49(Entity*);
extern void BackgroundCloud(Entity*);
extern void Object4B(Entity*);
+24
View File
@@ -0,0 +1,24 @@
#ifndef SAVE_H
#define SAVE_H
#include "global.h"
#include "entity.h"
#include "functions.h"
#include "menu.h"
#include "structures.h"
typedef enum {
SAVE_BUSY = 0,
SAVE_OK = 1,
SAVE_ERROR = 0xFFFFFFFF,
} SaveResult;
typedef enum {
SAVE_INIT,
SAVE_IN_PROGRESS,
SAVE_DONE,
} SaveState;
extern u32 sub_0807CDA4(SaveState state);
#endif
+6 -4
View File
@@ -114,14 +114,15 @@ typedef struct {
} ScreenTransitionData;
typedef struct {
/*0x00*/ u8 unk0;
/*0x00*/ u8 isTransitioning;
/*0x01*/ u8 unk1;
/*0x02*/ u8 unk2;
/*0x03*/ u8 unk3;
/*0x04*/ u8 filler4[0x2];
/*0x06*/ u8 unk6;
/*0x07*/ u8 unk7;
/*0x08*/ s8 unk8[0xE20];
/*0x08*/ s8 saveStatus[3];
/*0x0b*/ u8 unkB[0xE1D];
} struct_02019EE0;
extern struct_02019EE0 gUnk_02019EE0;
@@ -147,9 +148,9 @@ extern struct_03000FD0 gFadeControl;
typedef struct {
u8 filler0[0x1A];
u16 unk1A;
u16 rButtonX;
u8 filler1C[0x4];
u16 unk20;
u16 rButtonY;
u8 filler22[0x2];
u8 ezloNagFuncIndex;
u8 filler25[0x30F];
@@ -200,6 +201,7 @@ typedef struct {
} BGBuffer;
extern BGBuffer gBG0Buffer;
extern BGBuffer gBG1Buffer;
extern BGBuffer gBG2Buffer;
static_assert(sizeof(BGBuffer) == 0x800);
/*
+39 -3
View File
@@ -19,10 +19,46 @@ typedef struct {
u16 field_0xe;
u32 field_0x10;
} TextBox;
extern TextBox gTextBox;
void TextboxNoOverlap(u32 index, Entity* ent);
typedef struct {
u8 _0;
u8 _1;
u8 _2;
u8 _3[5];
u16 _8;
u8 _b[0x16];
u8 _20;
u8 _21;
u8 _22[0xa];
void* _2c;
u8 _30[0x23];
u8 _53;
u16 _54;
u8 _56[0x2];
void* _58;
u8 _5c;
u8 _5d;
u8 _5e[24];
u8 _76;
u8 _77[0x11];
u8 _88;
u8 _89;
u8 _8a;
u8 _8b[0xe];
u8 _99;
u8 _9a;
u8 _9b;
u8 _9c;
u8 _9d;
u8 _9e[0xa];
} struct_02022780;
extern struct_02022780 gUnk_02022780;
static_assert(sizeof(struct_02022780) == 0xa8);
void ShowTextbox(u32 index);
void TextboxAtPosition(u32 index, u32 x, u32 y);
void TextboxNoOverlap(u32 index, Entity* ent);
void TextboxNoOverlapFollow(u32 index);
extern void TextboxNoOverlapFollow(u32 index);
#endif