Skip to content

Commit

Permalink
Merge pull request #584 from Eebit/savedraw
Browse files Browse the repository at this point in the history
Decompile savedraw and merge with savedrawcursor
  • Loading branch information
RevoSucks authored Mar 4, 2024
2 parents 7dd2e48 + 93b9a98 commit 546c095
Show file tree
Hide file tree
Showing 11 changed files with 1,461 additions and 2,201 deletions.
1,435 changes: 0 additions & 1,435 deletions asm/savedraw.s

This file was deleted.

80 changes: 0 additions & 80 deletions data/data_A20050.s

This file was deleted.

83 changes: 54 additions & 29 deletions include/savemenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ enum {
struct SaveDrawProc {
/* 00 */ PROC_HEADER;
/* 29 */ bool unk_29;
/* 2A */ u16 unk_2a;
/* 2C */ u16 unk_2c;
/* 2E */ u16 unk_2e;
/* 30 */ u16 unk_30;
/* 32 */ s8 unk_32;
/* 33 */ u8 unk_33;
/* 34 */ ProcPtr unk_34;
/* 38 */ u8 unk_38;
/* 39 */ u8 unk_39;
/* 3A */ u8 unk_3a;
/* 3B */ u8 unk_3b;
/* 3C */ u8 unk_3c;
// 3D - unused?
/* 3E */ u16 unk_3e;
/* 40 */ u16 unk_40;
};

struct SaveMenuProc {
Expand Down Expand Up @@ -184,9 +199,9 @@ const char * GetWMNodeNameForSaveMenu(void);
void sub_80AA790(u16 *, u16 *, int);
void sub_80AA7AC(int a, int b);
// ??? sub_80AA7EC(???);
void sub_80AA9D8(ProcPtr);
// ??? sub_80AAA6C(???);
// ??? sub_80AAA78(???);
void sub_80AA9D8(struct SaveDrawProc *);
// ??? SaveDraw_OnEnd(???);
// ??? SaveDraw_Init(???);
// ??? sub_80AAB78(???);
// ??? sub_80AABC4(???);
// ??? sub_80AAC40(???);
Expand All @@ -195,7 +210,8 @@ void sub_80AA9D8(ProcPtr);
// ??? sub_80AAE90(???);
// ??? sub_80AAF6C(???);
// ??? sub_80AB05C(???);
// ??? sub_80AB2A0(???);
// ??? SaveDraw_Loop_Main(???);
struct SaveDrawProc * StartSaveDraw(ProcPtr);

struct SaveDrawCursorProc {
/* 00 */ PROC_HEADER;
Expand All @@ -213,23 +229,6 @@ struct SaveDrawCursorProc {
/* 3A */ u8 unk_3a;
};

struct SaveMenuUnusedProc {
/* 00 */ PROC_HEADER;

/* 2C */ int save_slot;
/* 30 */ int active_options;
/* 34 */ struct SaveDrawCursorProc* unk_34;
};

struct SaveMenu8A206F8Proc {
/* 00 */ PROC_HEADER;

/* 29 */ u8 _pad[0x3e - 0x29];

/* 3E */ u16 unk_3e;
/* 40 */ u16 unk_40;
};

struct SqMaskProc {
/* 00 */ PROC_HEADER;

Expand Down Expand Up @@ -261,18 +260,17 @@ struct Unknown03004990 {

extern struct Unknown03004990* gUnknown_03004990;

extern u16 gUnknown_08A20570[];
extern u16 gUnknown_08A20578[];
extern u16 gUnknown_08A20580[];
extern u16 Sprite_08A20570[];
extern u16 Sprite_08A20578[];
extern u16 Sprite_08A20580[];

ProcPtr New6C_savedraw(ProcPtr);
void SaveDrawCursor_Init(struct SaveDrawCursorProc * proc);
void SaveDrawCursor_Loop(struct SaveDrawCursorProc * proc);
void sub_80AB4F4(int a, s16 b, s16 c, struct SaveMenuUnusedProc * proc);
void sub_80AB514(int a, int b, struct SaveMenuUnusedProc * proc);
void sub_80AB4F4(int a, s16 b, s16 c, struct SaveDrawProc * proc);
void sub_80AB514(int a, u8 b, struct SaveDrawProc * proc);
struct SaveMenuCursorProc * StartSaveDrawCursor(ProcPtr parent);
// ??? sub_80AB548(???);
// ??? sub_80AB56C(???);
void sub_80AB548(void);
void sub_80AB56C(u32 a);
// ??? sub_80AB720(???);
void sub_80AB760(void*);
void sub_80AB77C(void);
Expand Down Expand Up @@ -311,4 +309,31 @@ void DrawDifficultySprites_Loop(struct DifficultyMenuSpritesProc * proc);
void sub_80AC680(struct DifficultyMenuSpritesProc *, int, int);
ProcPtr StartDrawDifficultyMenuSprites(ProcPtr);

// extern ??? gBgConfig_SaveMenu
// extern ??? gProcScr_08A20068
// extern ??? ProcScr_CallExtraMap
// extern ??? ProcScr_SaveMenu
// extern ??? gProcScr_SaveMenuPostChapter
// extern ??? gUnknown_08A204B8
// extern ??? gUnknown_08A204BC;
extern u16 Sprite_08A2051C[];
extern u16 Sprite_08A20536[];
extern u16 Sprite_08A20570[];
extern u16 Sprite_08A20578[];
extern u16 Sprite_08A20580[];
extern u16 Sprite_08A20588[];
extern u16 Sprite_08A20590[];
extern u16 * SpriteArray_08A20650[];
extern u16 * SpriteArray_08A2067C[];
// extern ??? ProcScr_savedraw
// extern ??? gProcScr_SaveDrawCursor
// extern ??? gProcScr_08A206F8
// extern ??? gUnknown_08A20720
// extern ??? gProcScr_SqMask
// extern ??? gProcScr_SaveBgUp
extern u16 * SpriteArray_08A2099C[];
extern u16 * SpriteArray_08A209B8[];
extern u16 * SpriteArray_08A209E4[];
extern u16 * SpriteArray_08A209F0[];

#endif // GUARD_SAVEMENU_H
28 changes: 1 addition & 27 deletions include/variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -1069,32 +1069,6 @@ extern u16 gTSA_GoalBox_OneLine[];
// extern ??? sSupportUnkLut
// extern ??? sArenaCpTeamNameLut
// extern ??? gpSramExtraData
// extern ??? gBgConfig_SaveMenu
// extern ??? gProcScr_08A20068
// extern ??? ProcScr_CallExtraMap
// extern ??? ProcScr_SaveMenu
// extern ??? gProcScr_SaveMenuPostChapter
// extern ??? gUnknown_08A204B8
// extern ??? gUnknown_08A204BC
// extern ??? gUnknown_08A2051C
// extern ??? gUnknown_08A20536
// extern ??? gUnknown_08A20570
// extern ??? gUnknown_08A20578
// extern ??? gUnknown_08A20580
// extern ??? gUnknown_08A20588
extern u16 Obj_08A20590[];
// extern ??? gUnknown_08A20650
extern u16 * Objs_08A2067C[];
// extern ??? ProcScr_savedraw
// extern ??? gProcScr_SaveDrawCursor
// extern ??? gProcScr_08A206F8
// extern ??? gUnknown_08A20720
// extern ??? gProcScr_SqMask
// extern ??? gProcScr_SaveBgUp
// extern ??? gUnknown_08A2099C
// extern ??? gUnknown_08A209B8
extern u16* gUnknown_08A209E4[];
extern u16* gUnknown_08A209F0[];

struct Unknown_08A209FC
{
Expand Down Expand Up @@ -1153,7 +1127,7 @@ extern u8 gUnknown_08A268F8[]; // tsa, fog overlay
extern u8 Img_SaveScreenSprits[]; // gfx
extern u16 Pal_SaveScreenSprits[]; // pal
extern u16 Pal_08A28088[];
// extern ??? gUnknown_08A280A8
extern u16 gUnknown_08A280A8[]; // ap
extern u8 Img_GameMainMenuObjs[];
// extern ??? Img_DifficultyMenuObjs
// extern ??? Pal_DifficultyMenuObjs
Expand Down
8 changes: 3 additions & 5 deletions ldscript.txt
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,7 @@ SECTIONS
src/bmsave-misc.o(.text);
src/minimap.o(.text);
src/savemenu.o(.text);
asm/savedraw.o(.text);
src/savedrawcursor.o(.text);
src/savedraw.o(.text);
src/difficultymenu.o(.text);
asm/code_80AC6AC.o(.text);
src/cursor_hand.o(.text);
Expand Down Expand Up @@ -815,7 +814,7 @@ SECTIONS
. = ALIGN(4); src/bmsave-misc.o(.rodata);
. = ALIGN(4); src/minimap.o(.rodata);
. = ALIGN(4); src/savemenu.o(.rodata);
. = ALIGN(4); src/savedrawcursor.o(.rodata);
. = ALIGN(4); src/savedraw.o(.rodata);
. = ALIGN(4); src/sysutil.o(.rodata);
. = ALIGN(4); src/uiconfig.o(.rodata);
. = ALIGN(4); src/colorfade.o(.rodata);
Expand Down Expand Up @@ -1126,8 +1125,7 @@ SECTIONS
. = ALIGN(4); src/minimap.o(.data);
. = ALIGN(4); data/data_minimap.o(.data);
. = ALIGN(4); src/savemenu.o(.data);
. = ALIGN(4); data/data_A20050.o(.data);
. = ALIGN(4); src/savedrawcursor.o(.data);
. = ALIGN(4); src/savedraw.o(.data);
. = ALIGN(4); src/savemenu_data.o(.data);
. = ALIGN(4); src/difficultymenu.o(.data);
. = ALIGN(4); src/cursor_hand.o(.data);
Expand Down
5 changes: 3 additions & 2 deletions src/bonusclaim.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "helpbox.h"
#include "bmlib.h"
#include "sysutil.h"
#include "savemenu.h"
#include "bonusclaim.h"

#include "constants/characters.h"
Expand All @@ -33,8 +34,8 @@ int LoadBonusContentData(void*);

//! FE8U = 0x080B0638
void PutChapterBannerSprites(void) {
PutSpriteExt(4, 24, 8, *gUnknown_08A209F0, 0x8000);
PutSpriteExt(4, 24, 16, *gUnknown_08A209E4, 0x9000);
PutSpriteExt(4, 24, 8, *SpriteArray_08A209F0, 0x8000);
PutSpriteExt(4, 24, 16, *SpriteArray_08A209E4, 0x9000);
return;
}

Expand Down
8 changes: 3 additions & 5 deletions src/extramenu_unk.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "hardware.h"
#include "ctc.h"
#include "bmlib.h"
#include "savemenu.h"

struct Proc8A21568 {
/* 00 */ PROC_HEADER;
Expand All @@ -16,9 +17,6 @@ extern u16 gUnknown_08A2C11C[]; // pal
extern u8 gUnknown_08A29A88[]; // gfx
extern u8 gUnknown_08A2B1E4[]; // gfx

extern u16 gUnknown_08A2051C[]; // sprite
extern u16* gUnknown_08A2099C[]; // sprite array

//! FE8U = 0x080B0458
void sub_80B0458(void) {
u16 vcount = (REG_VCOUNT + 1);
Expand Down Expand Up @@ -96,8 +94,8 @@ void nullsub_66(void) {
//! FE8U = 0x080B05C4
void sub_80B05C4(struct Proc8A21568* proc) {
if (proc->unk_58 >= 0) {
PutSpriteExt(4, 56, 8, gUnknown_08A2051C, 0x2000);
PutSpriteExt(4, 64, 16, gUnknown_08A2099C[proc->unk_58], 0x3000);
PutSpriteExt(4, 56, 8, Sprite_08A2051C, 0x2000);
PutSpriteExt(4, 64, 16, SpriteArray_08A2099C[proc->unk_58], 0x3000);
}
return;
}
Expand Down
Loading

0 comments on commit 546c095

Please sign in to comment.