(finish_worldmap) Renames

This commit is contained in:
Eebit 2024-03-17 17:41:15 -04:00
parent 0132ae654e
commit 206d158f1b
13 changed files with 210 additions and 212 deletions

View File

@ -1134,12 +1134,12 @@ Pal_WmPlaceDot_Standard: @ 0x08AA11B0
gUnknown_08AA11D0: @ 0x08AA11D0
.incbin "baserom.gba", 0xAA11D0, 0xB0
.global gUnknown_08AA1280
gUnknown_08AA1280: @ 0x08AA1280
.global Img_WorldmapMinimap
Img_WorldmapMinimap: @ 0x08AA1280
.incbin "baserom.gba", 0xAA1280, 0x60C
.global gUnknown_08AA188C
gUnknown_08AA188C: @ 0x08AA188C
.global Pal_WorldmapMinimap
Pal_WorldmapMinimap: @ 0x08AA188C
.incbin "baserom.gba", 0xAA188C, 0x20
.global gUnknown_08AA18AC

View File

@ -16,7 +16,7 @@ struct SoundSt {
extern struct SoundSt gSoundSt;
int GetCurrentBgmSong(void);
// ??? IsBgmPlaying(???);
s8 IsBgmPlaying(void);
void Sound_SetBGMVolume(int volume);
void Sound_SetSEVolume(int vol);
void Sound_FadeOutBGM(int speed);

View File

@ -1284,9 +1284,9 @@ extern u8 Img_WorldMapPlaceDot[];
extern u16 Pal_WmPlaceDot_Highlight[];
extern u16 Pal_WmPlaceDot_Standard[];
extern u8 gUnknown_08AA11D0[]; // tsa?
// extern ??? gUnknown_08AA1280
// extern ??? gUnknown_08AA188C
// extern ??? gUnknown_08AA18AC
extern u8 Img_WorldmapMinimap[];
extern u16 Pal_WorldmapMinimap[];
extern u8 gUnknown_08AA18AC[];
// extern ??? gUnknown_08AA1930
// extern ??? gUnknown_08AA1950
extern u8 gImg_WorldmapSkirmish[]; // gfx

View File

@ -607,9 +607,9 @@ void Worlmap_WaitGmapSogu(ProcPtr proc);
// ??? sub_80B9E64(???);
void ResetWorldMapScreen(void);
void NULL_080B9F08(void);
void sub_80B9F14(ProcPtr proc);
void sub_80B9F24(ProcPtr proc);
void sub_80B9F34(ProcPtr proc);
void WorldMap_StartArmory(ProcPtr proc);
void WorldMap_StartVendor(ProcPtr proc);
void WorldMap_StartSecretShop(ProcPtr proc);
void sub_80B9F44(ProcPtr proc);
void sub_80B9F54(ProcPtr unused);
void sub_80B9FC0(void);
@ -1192,13 +1192,13 @@ bool IsGmAutoMuActiveFor(int);
/* worldmap_text.h */
// ??? sub_80C34D0(???);
// ??? sub_80C3590(???);
// ??? sub_80C35C4(???);
// ??? sub_80C35EC(???);
void StartWmText(u8);
void RemoveWmText(void);
ProcPtr sub_80C368C(ProcPtr);
void sub_80C36A0(int);
// ??? ClearWmTextVram(???);
// ??? WmText_Init(???);
// ??? WmText_Loop_DrawText(???);
void ShowWmText(u8);
void HideWmText(void);
ProcPtr StartWmTextHandler(ProcPtr);
void StartWmTextMsg(int);
/* worldmap_radar.h */
@ -1216,52 +1216,52 @@ struct GMapRadarProc
/* 34 */ int unk_34;
};
// ??? sub_80C36E8(???);
// ??? sub_80C3770(???);
// ??? sub_80C380C(???);
// ??? sub_80C38BC(???);
// ??? sub_80C3A28(???);
// ??? sub_80C3A64(???);
// ??? sub_80C3A8C(???);
// ??? sub_80C3AB8(???);
// ??? sub_80C3B40(???);
// ??? sub_80C3BE4(???);
// ??? sub_80C3D24(???);
// ??? sub_80C3D5C(???);
// ??? sub_80C3D9C(???);
// ??? sub_80C3DAC(???);
ProcPtr sub_80C3E80(ProcPtr);
void sub_80C3E94(void);
// ??? WmMinimap_PutCursorIcon(???);
// ??? WmMinimap_PutStoryNodeIcon(???);
// ??? WmMinimap_PutLordIcon(???);
// ??? WmMinimap_PutSkirmishIcons(???);
// ??? WmMinimap_BlinkPalette(???);
// ??? PutWmMinimapSprites(???);
// ??? GMapRadar_80C3A8C(???);
// ??? GMapRadar_80C3AB8(???);
// ??? GMapRadar_80C3B40(???);
// ??? PutWmMinimapGfx(???);
// ??? GMapRadar_SlideIn(???);
// ??? GMapRadar_SlideOut(???);
// ??? GMapRadar_Init(???);
// ??? StartWorldMapMinimapCore(???);
ProcPtr StartWorldmapMinimap(ProcPtr);
void EndWorldmapMinimap(void);
/* worldmap_basemenu.h */
struct GMapBaseMenuProc
{
/* 00 */ PROC_HEADER;
/* 29 */ u8 unk_29;
/* 29 */ u8 kind;
/* 2A */ u8 unk_2a;
/* 2B */ u8 unk_2b;
/* 2C */ int unk_2c;
/* 30 */ s8 unk_30;
/* 2C */ int pid;
/* 30 */ s8 wasBgmPlaying;
STRUCT_PAD(0x31, 0x34);
/* 34 */ int unk_34;
/* 34 */ int bgmSongId;
};
// ??? nullsub_71(???);
// ??? sub_80C3EC8(???);
// ??? sub_80C3EDC(???);
// ??? sub_80C3F04(???);
// ??? sub_80C3F24(???);
// ??? sub_80C3F88(???);
// ??? sub_80C3FB4(???);
// ??? sub_80C3FE0(???);
ProcPtr sub_80C400C(int, ProcPtr);
// ??? sub_80C4038(???);
struct GMapBaseMenuProc * sub_80C4048(void);
// ??? sub_80C4058(???);
int sub_80C4070(void);
int sub_80C4088();
void sub_80C409C(int);
// ??? GMapBaseMenu_OnEnd_Null(???);
// ??? GMapBaseMenu_Init(???);
// ??? GMapBaseMenu_StartItemScreen(???);
// ??? GMapBaseMenu_RestoreBgm(???);
// ??? GMapBaseMenu_ShopFromItemScreen(???);
// ??? GMapBaseMenu_StartArmory(???);
// ??? GMapBaseMenu_StartVendor(???);
// ??? GMapBaseMenu_StartSecretShop(???);
ProcPtr StartGMapBaseMenu(int, ProcPtr);
// ??? EndGMapBaseMenu(???);
struct GMapBaseMenuProc * FindGMapBaseMenu(void);
// ??? IsGMapBaseMenuActive(???);
int GetGMapBaseMenuKind(void);
int GetGMapBaseMenuPid();
void SetGMapBaseMenuPid(int);
// extern ??? gFont_0201AFC0
// extern ??? gUnknown_0201AFF0
@ -1349,12 +1349,12 @@ extern struct ProcCmd ProcScr_WmDotPalAnim[];
// extern ??? Sprite_WmPlaceDot
// extern ??? ProcScr_WmPlaceDot
// extern ??? ProcScr_GmapAutoMu
// extern ??? gUnknown_08A3EE28
// extern ??? gUnknown_08A3EE44
// extern ??? Sprite_WmText
// extern ??? ProcScr_WorldMapTextHandler
// extern ??? gUnknown_08A3EE6C
// extern ??? gUnknown_08A3EE70
// extern ??? ProcScr_GmapRader
// extern ??? gUnknown_08A3EED4
// extern ??? ProcScr_WorldmapMinimapWrapper
// extern ??? ProcScr_GmapBaseMenu
#endif // GUARD_WORLDMAP_H

View File

@ -1265,7 +1265,7 @@ u8 EventC6_WmDisplayText(struct EventEngineProc * proc)
a = EVT_CMD_ARGV(proc->pEventCurrent)[1];
b = EVT_CMD_ARGV(proc->pEventCurrent)[2];
sub_80C36A0(a | b);
StartWmTextMsg(a | b);
if (proc->evStateBits & EV_STATE_0020)
{
@ -1283,7 +1283,7 @@ u8 EventC7_(struct EventEngineProc * proc)
return EVC_ADVANCE_CONTINUE;
}
StartWmText(1);
ShowWmText(1);
return EVC_ADVANCE_YIELD;
}
@ -1296,7 +1296,7 @@ u8 EventC8_(struct EventEngineProc * proc)
return EVC_ADVANCE_CONTINUE;
}
StartWmText(0);
ShowWmText(0);
return EVC_ADVANCE_YIELD;
}
@ -1306,11 +1306,11 @@ u8 EventC9_RemoveWmText(struct EventEngineProc * proc)
{
if (EVENT_IS_SKIPPING(proc))
{
RemoveWmText();
HideWmText();
return EVC_ADVANCE_CONTINUE;
}
RemoveWmText();
HideWmText();
return EVC_ADVANCE_YIELD;
}

View File

@ -27,7 +27,7 @@ void PrepItemList_Init(struct PrepItemListProc * proc)
proc->unk_34 = 0xff;
if (gGMData.state.bits.state_0) {
struct GMapBaseMenuProc* pGMapBaseMenuProc = sub_80C4048();
struct GMapBaseMenuProc* pGMapBaseMenuProc = FindGMapBaseMenu();
if (pGMapBaseMenuProc) {
proc->currentPage = pGMapBaseMenuProc->unk_2a;
@ -239,7 +239,7 @@ void PrepItemList_InitGfx(struct PrepItemListProc * proc)
void PrepItemList_OnEnd(struct PrepItemListProc * proc)
{
if (gGMData.state.bits.state_0) {
struct GMapBaseMenuProc* pGMapBaseMenuProc = sub_80C4048();
struct GMapBaseMenuProc* pGMapBaseMenuProc = FindGMapBaseMenu();
if (pGMapBaseMenuProc) {
pGMapBaseMenuProc->unk_2a = proc->currentPage;
}

View File

@ -436,7 +436,7 @@ void sub_8098A74(u16* tm) {
ClearText(&gPrepItemScreenTexts[11]);
ClearText(&gPrepItemScreenTexts[12]);
switch (sub_80C4070()) {
switch (GetGMapBaseMenuKind()) {
case 0:
textId = 0x0672; // TODO: msgid "Enter Armory"
break;
@ -468,7 +468,7 @@ void sub_8098B48(void) {
//! FE8U = 0x08098B68
void sub_8098B68(void) {
switch (sub_80C4070()) {
switch (GetGMapBaseMenuKind()) {
case 3:
PrepItemDrawPopupBox(136, 81, 9, 6, OAM2_CHR(0x40) + OAM2_LAYER(1) + OAM2_PAL(10));
break;
@ -716,7 +716,7 @@ void sub_8099120(struct PrepItemScreenProc* proc) {
if (gKeyStatusPtr->newKeys & A_BUTTON) {
if (gGMData.state.bits.state_0) {
switch (sub_80C4070()) {
switch (GetGMapBaseMenuKind()) {
case 3:
proc->selectedUnitIdx = proc->hoverUnitIdx;
@ -1279,7 +1279,7 @@ void sub_8099E68(struct PrepItemScreenProc * proc)
return;
}
sub_80C409C(0);
SetGMapBaseMenuPid(0);
return;
}
@ -1614,7 +1614,7 @@ void sub_809A114(struct PrepItemScreenProc* proc, u8 unk, s8 flag) {
idx = ((unk) * 3);
th = &gPrepItemTexts[idx % 0xf];
if (gGMData.state.bits.state_0 && sub_80C4070() == 2) {
if (gGMData.state.bits.state_0 && GetGMapBaseMenuKind() == 2) {
isWorldMapMaybe = 1;
} else {
isWorldMapMaybe = 0;
@ -1703,7 +1703,7 @@ void sub_809A274(struct PrepItemScreenProc* proc) {
continue;
}
if (((gGMData.state.bits.state_0)) && (sub_80C4070() == 2)) {
if (((gGMData.state.bits.state_0)) && (GetGMapBaseMenuKind() == 2)) {
sub_809A230(GetUnitFromPrepList(i), (x + 24) & 0xffff, (y + 4) & 0xff);
} else {
PutUnitSprite(0, (x + 24), (y + 4) & 0xff, GetUnitFromPrepList(i));

View File

@ -182,7 +182,7 @@ void PrepItemSupply_Init(struct PrepItemSupplyProc * proc)
}
if (gGMData.state.bits.state_0) {
struct GMapBaseMenuProc* pGMapBaseMenuProc = sub_80C4048();
struct GMapBaseMenuProc* pGMapBaseMenuProc = FindGMapBaseMenu();
if (pGMapBaseMenuProc) {
proc->currentPage = pGMapBaseMenuProc->unk_2b;
} else {
@ -1093,7 +1093,7 @@ void PrepItemSupply_Loop_UnitInvKeyHandler(struct PrepItemSupplyProc * proc)
void PrepItemSupply_OnEnd(struct PrepItemSupplyProc * proc)
{
if (gGMData.state.bits.state_0) {
struct GMapBaseMenuProc* pGMapBaseMenuProc = sub_80C4048();
struct GMapBaseMenuProc* pGMapBaseMenuProc = FindGMapBaseMenu();
if (pGMapBaseMenuProc) {
pGMapBaseMenuProc->unk_2b = proc->currentPage;
}

View File

@ -292,13 +292,13 @@ int PrepGetLatestCharId()
if (0 == (gGMData.state.bits.state_0))
return gPrepUnitList.latest_pid;
else
return sub_80C4088();
return GetGMapBaseMenuPid();
}
void PrepSetLatestCharId(int val)
{
if (gGMData.state.bits.state_0)
sub_80C409C(val);
SetGMapBaseMenuPid(val);
else
gPrepUnitList.latest_pid = val;
}

View File

@ -6,31 +6,29 @@
#include "worldmap.h"
s8 IsBgmPlaying(void);
//! FE8U = 0x080C3EC4
void nullsub_71(void)
void GMapBaseMenu_OnEnd_Null(void)
{
return;
}
//! FE8U = 0x080C3EC8
void sub_80C3EC8(struct GMapBaseMenuProc * proc)
void GMapBaseMenu_Init(struct GMapBaseMenuProc * proc)
{
proc->unk_2a = 0;
proc->unk_2b = 0;
proc->unk_2c = -1;
proc->pid = -1;
return;
}
//! FE8U = 0x080C3EDC
void sub_80C3EDC(struct GMapBaseMenuProc * proc)
void GMapBaseMenu_StartItemScreen(struct GMapBaseMenuProc * proc)
{
proc->unk_30 = IsBgmPlaying();
proc->wasBgmPlaying = IsBgmPlaying();
if (proc->unk_30 != 0)
if (proc->wasBgmPlaying != 0)
{
proc->unk_34 = GetCurrentBgmSong();
proc->bgmSongId = GetCurrentBgmSong();
}
StartPrepItemScreen(proc);
@ -39,23 +37,23 @@ void sub_80C3EDC(struct GMapBaseMenuProc * proc)
}
//! FE8U = 0x080C3F04
void sub_80C3F04(struct GMapBaseMenuProc * proc)
void GMapBaseMenu_RestoreBgm(struct GMapBaseMenuProc * proc)
{
if (proc->unk_30 != 0)
if (proc->wasBgmPlaying != 0)
{
StartBgmFadeIn(proc->unk_34, 1, 0);
StartBgmFadeIn(proc->bgmSongId, 1, 0);
}
return;
}
//! FE8U = 0x080C3F24
void sub_80C3F24(struct GMapBaseMenuProc * proc)
void GMapBaseMenu_ShopFromItemScreen(struct GMapBaseMenuProc * proc)
{
switch (proc->unk_29)
switch (proc->kind)
{
case 0:
if (proc->unk_2c != 0)
case SHOP_TYPE_ARMORY:
if (proc->pid != 0)
{
Proc_Goto(proc, 1);
return;
@ -65,8 +63,8 @@ void sub_80C3F24(struct GMapBaseMenuProc * proc)
break;
case 1:
if (proc->unk_2c != 0)
case SHOP_TYPE_VENDOR:
if (proc->pid != 0)
{
Proc_Goto(proc, 2);
return;
@ -76,8 +74,8 @@ void sub_80C3F24(struct GMapBaseMenuProc * proc)
break;
case 2:
if (proc->unk_2c != 0)
case SHOP_TYPE_SECRET_SHOP:
if (proc->pid != 0)
{
Proc_Goto(proc, 3);
return;
@ -96,23 +94,23 @@ void sub_80C3F24(struct GMapBaseMenuProc * proc)
}
//! FE8U = 0x080C3F88
void sub_80C3F88(struct GMapBaseMenuProc * proc)
void GMapBaseMenu_StartArmory(struct GMapBaseMenuProc * proc)
{
StartArmoryScreen(GetUnitFromCharId(proc->unk_2c), gGMData.units[0].location[gWMNodeData].armory, proc);
StartArmoryScreen(GetUnitFromCharId(proc->pid), gGMData.units[0].location[gWMNodeData].armory, proc);
return;
}
//! FE8U = 0x080C3FB4
void sub_80C3FB4(struct GMapBaseMenuProc * proc)
void GMapBaseMenu_StartVendor(struct GMapBaseMenuProc * proc)
{
StartVendorScreen(GetUnitFromCharId(proc->unk_2c), gGMData.units[0].location[gWMNodeData].vendor, proc);
StartVendorScreen(GetUnitFromCharId(proc->pid), gGMData.units[0].location[gWMNodeData].vendor, proc);
return;
}
//! FE8U = 0x080C3FE0
void sub_80C3FE0(struct GMapBaseMenuProc * proc)
void GMapBaseMenu_StartSecretShop(struct GMapBaseMenuProc * proc)
{
StartSecretShopScreen(GetUnitFromCharId(proc->unk_2c), gGMData.units[0].location[gWMNodeData].secretShop, proc);
StartSecretShopScreen(GetUnitFromCharId(proc->pid), gGMData.units[0].location[gWMNodeData].secretShop, proc);
return;
}
@ -123,38 +121,38 @@ struct ProcCmd CONST_DATA ProcScr_GmapBaseMenu[] =
PROC_NAME("Gmap Base Menu"),
PROC_MARK(PROC_MARK_8),
PROC_SET_END_CB(nullsub_71),
PROC_SET_END_CB(GMapBaseMenu_OnEnd_Null),
PROC_CALL(sub_80C3EC8),
PROC_CALL(GMapBaseMenu_Init),
PROC_LABEL(0),
PROC_CALL(sub_80C3EDC),
PROC_CALL(GMapBaseMenu_StartItemScreen),
PROC_YIELD,
PROC_CALL(sub_80C3F24),
PROC_CALL(GMapBaseMenu_ShopFromItemScreen),
// fallthrough
PROC_LABEL(1),
PROC_CALL(sub_80C3F88),
PROC_CALL(GMapBaseMenu_StartArmory),
PROC_YIELD,
PROC_GOTO(4),
PROC_LABEL(2),
PROC_CALL(sub_80C3FB4),
PROC_CALL(GMapBaseMenu_StartVendor),
PROC_YIELD,
PROC_GOTO(4),
PROC_LABEL(3),
PROC_CALL(sub_80C3FE0),
PROC_CALL(GMapBaseMenu_StartSecretShop),
PROC_YIELD,
PROC_GOTO(4),
PROC_LABEL(4),
PROC_CALL(sub_80C3F04),
PROC_CALL(GMapBaseMenu_RestoreBgm),
PROC_GOTO(0),
@ -165,7 +163,7 @@ PROC_LABEL(5),
// clang-format on
//! FE8U = 0x080C400C
ProcPtr sub_80C400C(int kind, ProcPtr parent)
ProcPtr StartGMapBaseMenu(int kind, ProcPtr parent)
{
struct GMapBaseMenuProc * proc;
@ -178,64 +176,64 @@ ProcPtr sub_80C400C(int kind, ProcPtr parent)
proc = Proc_Start(ProcScr_GmapBaseMenu, PROC_TREE_3);
}
proc->unk_29 = kind;
proc->kind = kind;
// return; BUG
}
//! FE8U = 0x080C4038
void sub_80C4038(void)
void EndGMapBaseMenu(void)
{
Proc_EndEach(ProcScr_GmapBaseMenu);
return;
}
//! FE8U = 0x080C4048
struct GMapBaseMenuProc * sub_80C4048(void)
struct GMapBaseMenuProc * FindGMapBaseMenu(void)
{
return Proc_Find(ProcScr_GmapBaseMenu);
}
//! FE8U = 0x080C4058
bool sub_80C4058(void)
bool IsGMapBaseMenuActive(void)
{
return Proc_Find(ProcScr_GmapBaseMenu) ? true : false;
}
//! FE8U = 0x080C4070
int sub_80C4070(void)
int GetGMapBaseMenuKind(void)
{
struct GMapBaseMenuProc * proc = sub_80C4048();
struct GMapBaseMenuProc * proc = FindGMapBaseMenu();
if (proc != NULL)
{
return proc->unk_29;
return proc->kind;
}
return 0;
}
//! FE8U = 0x080C4088
int sub_80C4088(void)
int GetGMapBaseMenuPid(void)
{
struct GMapBaseMenuProc * proc = sub_80C4048();
struct GMapBaseMenuProc * proc = FindGMapBaseMenu();
if (proc != NULL)
{
return proc->unk_2c;
return proc->pid;
}
return 0;
}
//! FE8U = 0x080C409C
void sub_80C409C(int pid)
void SetGMapBaseMenuPid(int pid)
{
struct GMapBaseMenuProc * proc = sub_80C4048();
struct GMapBaseMenuProc * proc = FindGMapBaseMenu();
if (proc != NULL)
{
proc->unk_2c = pid;
proc->pid = pid;
}
return;

View File

@ -19,6 +19,8 @@
#include "savemenu.h"
#include "sysutil.h"
#include "unitlistscreen.h"
#include "bmshop.h"
#include "worldmap.h"
// TODO: In "worldmap_scrollmanage.c", the signature returns a ProcPtr instead of s8/bool
@ -79,7 +81,7 @@ void WorldMap_Destruct(struct WorldMapMainProc * proc)
SetBlendConfig(3, 0, 0, 0x10);
sub_80BF15C();
sub_80C3E94();
EndWorldmapMinimap();
gGMData.state.bits.state_6 = 0;
gGMData.state.bits.state_7 = 0;
@ -530,7 +532,7 @@ void sub_80B9154(struct WorldMapMainProc * proc)
proc->unk_54 = StartGmMu(proc);
RefreshGmNodeLinks(&gGMData);
sub_80C368C(proc);
StartWmTextHandler(proc);
sub_80B8FEC(proc);
sub_80B90CC(proc);
@ -831,7 +833,7 @@ PROC_LABEL(3),
PROC_CALL(sub_80B9A34),
PROC_WHILE(FadeInExists),
PROC_CALL(sub_80BF13C),
PROC_CALL(sub_80C3E80),
PROC_CALL(StartWorldmapMinimap),
PROC_SLEEP(1),
// fallthrough
@ -844,7 +846,7 @@ PROC_LABEL(4),
PROC_LABEL(5),
PROC_CALL(sub_80BF15C),
PROC_CALL(sub_80C3E94),
PROC_CALL(EndWorldmapMinimap),
PROC_SLEEP(1),
PROC_CALL(StartWMGeneralMenu),
@ -852,7 +854,7 @@ PROC_LABEL(5),
PROC_LABEL(6),
PROC_CALL(sub_80BF15C),
PROC_CALL(sub_80C3E94),
PROC_CALL(EndWorldmapMinimap),
PROC_SLEEP(1),
PROC_CALL(sub_80B8A7C),
PROC_REPEAT(sub_80B8B3C),
@ -935,7 +937,7 @@ PROC_LABEL(13),
PROC_LABEL(14),
PROC_CALL(sub_80BF15C),
PROC_CALL(sub_80C3E94),
PROC_CALL(EndWorldmapMinimap),
// fallthrough
@ -948,7 +950,7 @@ PROC_LABEL(15),
PROC_LABEL(16),
PROC_CALL(sub_80BF15C),
PROC_CALL(sub_80C3E94),
PROC_CALL(EndWorldmapMinimap),
PROC_SLEEP(30),
PROC_CALL(sub_80B9A58),
PROC_REPEAT(Worldmap_WaitForSkirmishAnim),
@ -969,7 +971,7 @@ PROC_LABEL(17),
PROC_LABEL(18),
PROC_CALL(sub_80BF15C),
PROC_CALL(sub_80C3E94),
PROC_CALL(EndWorldmapMinimap),
PROC_SLEEP(1),
PROC_CALL(StartWMNodeMenu),
PROC_SLEEP(6),
@ -980,7 +982,7 @@ PROC_LABEL(19),
PROC_CALL_ARG(NewFadeOut, 16),
PROC_WHILE(FadeOutExists),
PROC_CALL(sub_80B9810),
PROC_CALL(sub_80B9F14),
PROC_CALL(WorldMap_StartArmory),
PROC_YIELD,
PROC_CALL(sub_80B9154),
@ -990,7 +992,7 @@ PROC_LABEL(20),
PROC_CALL_ARG(NewFadeOut, 16),
PROC_WHILE(FadeOutExists),
PROC_CALL(sub_80B9810),
PROC_CALL(sub_80B9F24),
PROC_CALL(WorldMap_StartVendor),
PROC_YIELD,
PROC_CALL(sub_80B9154),
@ -1000,7 +1002,7 @@ PROC_LABEL(21),
PROC_CALL_ARG(NewFadeOut, 16),
PROC_WHILE(FadeOutExists),
PROC_CALL(sub_80B9810),
PROC_CALL(sub_80B9F34),
PROC_CALL(WorldMap_StartSecretShop),
PROC_YIELD,
PROC_CALL(sub_80B9154),
@ -1412,7 +1414,7 @@ void sub_80B9AB0(void)
Sound_FadeOutBGM(4);
SetDispEnable(0, 0, 0, 0, 0);
sub_80B895C();
RemoveWmText();
HideWmText();
EndWMFaceCtrl();
return;
}
@ -1488,7 +1490,7 @@ void sub_80B9BA4(struct WorldMapMainProc * proc)
}
sub_80B895C();
RemoveWmText();
HideWmText();
EndWMFaceCtrl();
EndGmMuEntry();
EndGmapRM();
@ -1535,7 +1537,7 @@ void WorldMap_WaitForChapterIntroEvents(ProcPtr proc)
SetDispEnable(0, 0, 0, 0, 0);
sub_80B895C();
RemoveWmText();
HideWmText();
EndWMFaceCtrl();
EndGmMuEntry();
EndGmapRM();
@ -1646,7 +1648,7 @@ void sub_80B9E64(void)
s16 y;
sub_80B895C();
RemoveWmText();
HideWmText();
EndWMFaceCtrl();
*&x = (gGMData.xCamera);
@ -1681,30 +1683,30 @@ void NULL_080B9F08(void)
}
//! FE8U = 0x080B9F14
void sub_80B9F14(ProcPtr proc)
void WorldMap_StartArmory(ProcPtr proc)
{
sub_80C400C(0, proc);
StartGMapBaseMenu(SHOP_TYPE_ARMORY, proc);
return;
}
//! FE8U = 0x080B9F24
void sub_80B9F24(ProcPtr proc)
void WorldMap_StartVendor(ProcPtr proc)
{
sub_80C400C(1, proc);
StartGMapBaseMenu(SHOP_TYPE_VENDOR, proc);
return;
}
//! FE8U = 0x080B9F34
void sub_80B9F34(ProcPtr proc)
void WorldMap_StartSecretShop(ProcPtr proc)
{
sub_80C400C(2, proc);
StartGMapBaseMenu(SHOP_TYPE_SECRET_SHOP, proc);
return;
}
//! FE8U = 0x080B9F44
void sub_80B9F44(ProcPtr proc)
{
sub_80C400C(3, proc);
StartGMapBaseMenu(3, proc);
return;
}

View File

@ -7,7 +7,7 @@
#include "worldmap.h"
//! FE8U = 0x080C36E8
void sub_80C36E8(struct GMapRadarProc * proc)
void WmMinimap_PutCursorIcon(struct GMapRadarProc * proc)
{
int xTmp;
int yTmp;
@ -32,7 +32,7 @@ void sub_80C36E8(struct GMapRadarProc * proc)
}
//! FE8U = 0x080C3770
void sub_80C3770(struct GMapRadarProc * proc)
void WmMinimap_PutStoryNodeIcon(struct GMapRadarProc * proc)
{
int x;
int y;
@ -66,7 +66,7 @@ void sub_80C3770(struct GMapRadarProc * proc)
}
//! FE8U = 0x080C380C
void sub_80C380C(struct GMapRadarProc * proc)
void WmMinimap_PutLordIcon(struct GMapRadarProc * proc)
{
int xTmp;
int yTmp;
@ -92,6 +92,7 @@ void sub_80C380C(struct GMapRadarProc * proc)
xOam1 = xTmp - 3;
yOam0 = yTmp + 7;
if ((xTmp >= -0x1d) && (xTmp < 0x113) && (yOam0 >= -0x20) && (yOam0 < 0xc0))
{
PutSpriteExt(0, OAM1_X(xOam1), OAM0_Y(yOam0), gObject_8x8, OAM2_CHR(0xF4) + OAM2_PAL(9));
@ -101,7 +102,7 @@ void sub_80C380C(struct GMapRadarProc * proc)
}
//! FE8U = 0x080C38BC
void sub_80C38BC(struct GMapRadarProc * proc)
void WmMinimap_PutSkirmishIcons(struct GMapRadarProc * proc)
{
int i;
int j;
@ -173,7 +174,7 @@ extern u16 gUnknown_08AA1930[];
extern u16 gUnknown_08AA1950[];
//! FE8U = 0x080C3A28
void sub_80C3A28(struct GMapRadarProc * proc)
void WmMinimap_BlinkPalette(struct GMapRadarProc * proc)
{
int colorIdx = GM_MAIN->unk_50->unk_34;
@ -188,22 +189,22 @@ void sub_80C3A28(struct GMapRadarProc * proc)
}
//! FE8U = 0x080C3A64
void sub_80C3A64(struct GMapRadarProc * proc)
void PutWmMinimapSprites(struct GMapRadarProc * proc)
{
sub_80C3770(proc);
sub_80C38BC(proc);
sub_80C380C(proc);
sub_80C36E8(proc);
sub_80C3A28(proc);
WmMinimap_PutStoryNodeIcon(proc);
WmMinimap_PutSkirmishIcons(proc);
WmMinimap_PutLordIcon(proc);
WmMinimap_PutCursorIcon(proc);
WmMinimap_BlinkPalette(proc);
return;
}
extern u16 gUnknown_0201B458[];
extern u8 gUnknown_08AA18AC[];
//! FE8U = 0x080C3A8C
void sub_80C3A8C(struct GMapRadarProc * unused)
void GMapRadar_80C3A8C(struct GMapRadarProc * unused)
{
TileMap_FillRect(gUnknown_0201B458, 8, 8, 0);
CallARM_FillTileRect(gUnknown_0201B458, gUnknown_08AA18AC, 0x000071E0);
@ -221,7 +222,7 @@ u8 const gUnknown_08206B70[] =
// clang-format on
//! FE8U = 0x080C3AB8
void sub_80C3AB8(struct GMapRadarProc * proc)
void GMapRadar_80C3AB8(struct GMapRadarProc * proc)
{
int state;
@ -234,7 +235,7 @@ void sub_80C3AB8(struct GMapRadarProc * proc)
gGMData.state.bits.state_4_5 = 0;
gGMData.state.raw |= state;
sub_80C3A8C(proc);
GMapRadar_80C3A8C(proc);
*&proc->unk_2d = gGMData.ix >> 8;
*&proc->unk_2e = gGMData.iy >> 8;
@ -249,11 +250,11 @@ void sub_80C3AB8(struct GMapRadarProc * proc)
}
//! FE8U = 0x080C3B40
void sub_80C3B40(struct GMapRadarProc * proc)
void GMapRadar_80C3B40(struct GMapRadarProc * proc)
{
int var;
sub_80C3A64(proc);
PutWmMinimapSprites(proc);
proc->unk_2b = proc->unk_2d;
proc->unk_2c = proc->unk_2e;
@ -296,7 +297,7 @@ extern u16 gUnknown_0201B430[];
extern u16 gUnknown_0201B458[];
//! FE8U = 0x080C3BE4
void sub_80C3BE4(struct GMapRadarProc * proc, int b)
void PutWmMinimapGfx(struct GMapRadarProc * proc, int b)
{
switch (gUnknown_08206B70[proc->unk_2a + gGMData.state.bits.state_4_5 * 5])
{
@ -344,10 +345,10 @@ s8 CONST_DATA gUnknown_08A3EE6C[] =
};
//! FE8U = 0x080C3D24
void sub_80C3D24(struct GMapRadarProc * proc)
void GMapRadar_SlideIn(struct GMapRadarProc * proc)
{
sub_80C3BE4(proc, gUnknown_08A3EE6C[proc->unk_34]);
sub_80C3A64(proc);
PutWmMinimapGfx(proc, gUnknown_08A3EE6C[proc->unk_34]);
PutWmMinimapSprites(proc);
proc->unk_34++;
@ -366,10 +367,10 @@ s8 CONST_DATA gUnknown_08A3EE70[] =
};
//! FE8U = 0x080C3D5C
void sub_80C3D5C(struct GMapRadarProc * proc)
void GMapRadar_SlideOut(struct GMapRadarProc * proc)
{
sub_80C3BE4(proc, gUnknown_08A3EE70[proc->unk_34]);
sub_80C3A64(proc);
PutWmMinimapGfx(proc, gUnknown_08A3EE70[proc->unk_34]);
PutWmMinimapSprites(proc);
proc->unk_34++;
@ -384,7 +385,7 @@ void sub_80C3D5C(struct GMapRadarProc * proc)
}
//! FE8U = 0x080C3D9C
void sub_80C3D9C(struct GMapRadarProc * proc)
void GMapRadar_Init(struct GMapRadarProc * proc)
{
proc->unk_34 = 0;
proc->unk_29 = 0;
@ -392,9 +393,6 @@ void sub_80C3D9C(struct GMapRadarProc * proc)
return;
}
extern u8 gUnknown_08AA1280[];
extern u16 gUnknown_08AA188C[];
// clang-format off
struct ProcCmd CONST_DATA ProcScr_GmapRader[] =
@ -405,13 +403,13 @@ struct ProcCmd CONST_DATA ProcScr_GmapRader[] =
PROC_15,
PROC_YIELD,
PROC_CALL(sub_80C3D9C),
PROC_CALL(GMapRadar_Init),
PROC_LABEL(0),
PROC_REPEAT(sub_80C3AB8),
PROC_REPEAT(sub_80C3D24),
PROC_REPEAT(sub_80C3B40),
PROC_REPEAT(sub_80C3D5C),
PROC_REPEAT(GMapRadar_80C3AB8),
PROC_REPEAT(GMapRadar_SlideIn),
PROC_REPEAT(GMapRadar_80C3B40),
PROC_REPEAT(GMapRadar_SlideOut),
PROC_GOTO(0),
@ -421,7 +419,7 @@ PROC_LABEL(0),
// clang-format on
//! FE8U = 0x080C3DAC
void sub_80C3DAC(struct Proc * proc)
void StartWorldMapMinimapCore(struct Proc * proc)
{
SetWinEnable(0, 0, 0);
SetWOutLayers(1, 1, 1, 1, 1);
@ -437,9 +435,9 @@ void sub_80C3DAC(struct Proc * proc)
SetBlendTargetB(0, 0, 1, 1, 1);
SetBlendBackdropA(0);
Decompress(gUnknown_08AA1280, (void *)0x06003C00);
Decompress(Img_WorldmapMinimap, (void *)0x06003C00);
ApplyPalette(gUnknown_08AA188C, 7);
ApplyPalette(Pal_WorldmapMinimap, 7);
ApplyPalette(gPal_GMapPI_ShopIcons, 0x19);
EnablePaletteSync();
@ -450,10 +448,10 @@ void sub_80C3DAC(struct Proc * proc)
// clang-format off
struct ProcCmd CONST_DATA gUnknown_08A3EED4[] =
struct ProcCmd CONST_DATA ProcScr_WorldmapMinimapWrapper[] =
{
PROC_MARK(PROC_MARK_8),
PROC_CALL(sub_80C3DAC),
PROC_CALL(StartWorldMapMinimapCore),
PROC_END,
};
@ -461,16 +459,16 @@ struct ProcCmd CONST_DATA gUnknown_08A3EED4[] =
// clang-format on
//! FE8U = 0x080C3E80
ProcPtr sub_80C3E80(ProcPtr parent)
ProcPtr StartWorldmapMinimap(ProcPtr parent)
{
return Proc_Start(gUnknown_08A3EED4, parent);
return Proc_Start(ProcScr_WorldmapMinimapWrapper, parent);
}
//! FE8U = 0x080C3E94
void sub_80C3E94(void)
void EndWorldmapMinimap(void)
{
Proc_EndEach(ProcScr_GmapRader);
Proc_EndEach(gUnknown_08A3EED4);
Proc_EndEach(ProcScr_WorldmapMinimapWrapper);
SetDefaultColorEffects();

View File

@ -24,7 +24,7 @@ void sub_80C34D0(u16 * dstPal, int b, u16 colorA, u16 colorB)
}
//! FE8U = 0x080C3590
void sub_80C3590(void)
void ClearWmTextVram(void)
{
int i;
@ -36,20 +36,20 @@ void sub_80C3590(void)
return;
}
struct GMap8A3EE44Proc
struct GMapTextProc
{
/* 00 */ PROC_HEADER;
/* 29 */ u8 unk_29;
/* 2A */ u8 unk_2a;
/* 29 */ u8 drawAtBottom;
/* 2A */ u8 visible;
};
//! FE8U = 0x080C35C4
void sub_80C35C4(struct GMap8A3EE44Proc * proc)
void WmText_Init(struct GMapTextProc * proc)
{
proc->unk_29 = 1;
proc->unk_2a = 0;
proc->drawAtBottom = 1;
proc->visible = 0;
sub_80C3590();
ClearWmTextVram();
gWmHblankStatus &= ~1;
@ -58,7 +58,7 @@ void sub_80C35C4(struct GMap8A3EE44Proc * proc)
// clang-format off
u16 CONST_DATA gUnknown_08A3EE28[] =
u16 CONST_DATA Sprite_WmText[] =
{
4,
OAM0_SHAPE_64x32 + OAM0_Y(8), OAM1_SIZE_64x32 + OAM1_X(8), OAM2_CHR(0x200),
@ -70,37 +70,37 @@ u16 CONST_DATA gUnknown_08A3EE28[] =
// clang-format on
//! FE8U = 0x080C35EC
void sub_80C35EC(struct GMap8A3EE44Proc * proc)
void WmText_Loop_DrawText(struct GMapTextProc * proc)
{
int y;
if (proc->unk_2a == 0)
if (proc->visible == 0)
{
return;
}
y = 0;
if (proc->unk_29 == 1)
if (proc->drawAtBottom == 1)
{
y = 111;
}
PutSpriteExt(1, 0, y, gUnknown_08A3EE28, OAM2_PAL(2));
PutSpriteExt(1, 0, y, Sprite_WmText, OAM2_PAL(2));
return;
}
// clang-format off
struct ProcCmd CONST_DATA gUnknown_08A3EE44[] =
struct ProcCmd CONST_DATA ProcScr_WorldMapTextHandler[] =
{
PROC_MARK(PROC_MARK_8),
PROC_CALL(sub_80C35C4),
PROC_CALL(WmText_Init),
PROC_YIELD,
PROC_REPEAT(sub_80C35EC),
PROC_REPEAT(WmText_Loop_DrawText),
PROC_END,
};
@ -108,43 +108,43 @@ struct ProcCmd CONST_DATA gUnknown_08A3EE44[] =
// clang-format on
//! FE8U = 0x080C3624
void StartWmText(u8 flag)
void ShowWmText(u8 atBottom)
{
struct GMap8A3EE44Proc * proc = Proc_Find(gUnknown_08A3EE44);
struct GMapTextProc * proc = Proc_Find(ProcScr_WorldMapTextHandler);
if (proc != NULL)
{
sub_80C3590();
ClearWmTextVram();
gWmHblankStatus &= ~1;
proc->unk_29 = flag;
proc->unk_2a = 1;
proc->drawAtBottom = atBottom;
proc->visible = 1;
}
return;
}
//! FE8U = 0x0800CDC8
void RemoveWmText(void)
void HideWmText(void)
{
struct GMap8A3EE44Proc * proc = Proc_Find(gUnknown_08A3EE44);
struct GMapTextProc * proc = Proc_Find(ProcScr_WorldMapTextHandler);
if (proc != NULL)
{
gWmHblankStatus &= ~1;
proc->unk_2a = 0;
proc->visible = 0;
}
return;
}
//! FE8U = 0x080C368C
ProcPtr sub_80C368C(ProcPtr parent)
ProcPtr StartWmTextHandler(ProcPtr parent)
{
return Proc_Start(gUnknown_08A3EE44, parent);
return Proc_Start(ProcScr_WorldMapTextHandler, parent);
}
//! FE8U = 0x080C36A0
void sub_80C36A0(int textId)
void StartWmTextMsg(int textId)
{
EndTalk();