Through sub_808FE54

This commit is contained in:
PikalaxALT
2020-03-13 16:28:17 -04:00
parent 50e0630320
commit a89e8474fd
11 changed files with 1253 additions and 2497 deletions
+60 -60
View File
@@ -3,7 +3,7 @@
#include "box_party_pokemon_dropdown.h"
#include "malloc.h"
struct UnkStruct_203ABE4_Sub
struct BPPD_MapRect
{
s16 destX;
s16 destY;
@@ -13,10 +13,10 @@ struct UnkStruct_203ABE4_Sub
s16 destY2;
};
struct UnkStruct_203ABE4
struct BPPD_Struct
{
struct UnkStruct_203ABE4_Sub map1Rect;
struct UnkStruct_203ABE4_Sub map2Rect;
struct BPPD_MapRect map1Rect;
struct BPPD_MapRect map2Rect;
const void * src1;
const void * src2;
u16 src1Height;
@@ -29,11 +29,11 @@ struct UnkStruct_203ABE4
bool8 bgUpdateScheduled;
};
static EWRAM_DATA struct UnkStruct_203ABE4 * sBoxPartyPokemonDropdownPtr = NULL;
static EWRAM_DATA struct BPPD_Struct * sBoxPartyPokemonDropdownPtr = NULL;
static EWRAM_DATA u16 sBoxPartyPokemonDropdownCount = 0;
static void PushMap1(u8 a0);
static void PushMap2(u8 a0);
static void PushMap1(u8 idx);
static void PushMap2(u8 idx);
static const struct {
u16 height;
@@ -55,7 +55,7 @@ static const struct {
void AllocBoxPartyPokemonDropdowns(u8 num)
{
u16 i;
sBoxPartyPokemonDropdownPtr = Alloc(num * sizeof(struct UnkStruct_203ABE4));
sBoxPartyPokemonDropdownPtr = Alloc(num * sizeof(struct BPPD_Struct));
sBoxPartyPokemonDropdownCount = sBoxPartyPokemonDropdownPtr == NULL ? 0 : num;
for (i = 0; i < sBoxPartyPokemonDropdownCount; i++)
{
@@ -64,19 +64,19 @@ void AllocBoxPartyPokemonDropdowns(u8 num)
}
}
void sub_80F7B2C(void)
void FreeBoxPartyPokemonDropdowns(void)
{
Free(sBoxPartyPokemonDropdownPtr);
}
void sub_80F7B40(void)
void CopyAllBoxPartyPokemonDropdownsToVram(void)
{
int i;
for (i = 0; i < sBoxPartyPokemonDropdownCount; i++)
{
if (sBoxPartyPokemonDropdownPtr[i].bgUpdateScheduled == TRUE)
sub_80F7E54(i);
CopyBoxPartyPokemonDropdownToBgTilemapBuffer(i);
}
}
@@ -112,12 +112,12 @@ void SetBoxPartyPokemonDropdownMap2(u8 idx, u8 bgId, const void * src, u16 width
}
}
void sub_80F7C7C(u8 a0, const void * a1)
void SetBoxPartyPokemonDropdownMap1Tiles(u8 idx, const void * src)
{
if (a0 < sBoxPartyPokemonDropdownCount)
if (idx < sBoxPartyPokemonDropdownCount)
{
sBoxPartyPokemonDropdownPtr[a0].src1 = a1;
sBoxPartyPokemonDropdownPtr[a0].bgUpdateScheduled = TRUE;
sBoxPartyPokemonDropdownPtr[idx].src1 = src;
sBoxPartyPokemonDropdownPtr[idx].bgUpdateScheduled = TRUE;
}
}
@@ -131,82 +131,82 @@ void SetBoxPartyPokemonDropdownMap2Pos(u8 idx, u16 x, u16 y)
}
}
void sub_80F7CE8(u8 a0, u16 a1, u16 a2, u16 a3, u16 a4)
void SetBoxPartyPokemonDropdownMap2Rect(u8 idx, u16 x, u16 y, u16 width, u16 height)
{
if (a0 < sBoxPartyPokemonDropdownCount)
if (idx < sBoxPartyPokemonDropdownCount)
{
sBoxPartyPokemonDropdownPtr[a0].map2Rect.destX = a1;
sBoxPartyPokemonDropdownPtr[a0].map2Rect.destY = a2;
sBoxPartyPokemonDropdownPtr[a0].map2Rect.width = a3;
sBoxPartyPokemonDropdownPtr[a0].map2Rect.height = a4;
sBoxPartyPokemonDropdownPtr[a0].bgUpdateScheduled = TRUE;
sBoxPartyPokemonDropdownPtr[idx].map2Rect.destX = x;
sBoxPartyPokemonDropdownPtr[idx].map2Rect.destY = y;
sBoxPartyPokemonDropdownPtr[idx].map2Rect.width = width;
sBoxPartyPokemonDropdownPtr[idx].map2Rect.height = height;
sBoxPartyPokemonDropdownPtr[idx].bgUpdateScheduled = TRUE;
}
}
void sub_80F7D30(u8 a0, u8 a1, s8 a2)
void AdjustBoxPartyPokemonDropdownPos(u8 idx, u8 op, s8 param)
{
if (a0 < sBoxPartyPokemonDropdownCount)
if (idx < sBoxPartyPokemonDropdownCount)
{
switch (a1)
switch (op)
{
case 0:
sBoxPartyPokemonDropdownPtr[a0].map2Rect.destX2 += a2;
sBoxPartyPokemonDropdownPtr[a0].map2Rect.width -= a2;
case BPPD_MOVE_INNER_LEFT:
sBoxPartyPokemonDropdownPtr[idx].map2Rect.destX2 += param;
sBoxPartyPokemonDropdownPtr[idx].map2Rect.width -= param;
break;
case 1:
sBoxPartyPokemonDropdownPtr[a0].map2Rect.destX += a2;
sBoxPartyPokemonDropdownPtr[a0].map2Rect.width += a2;
case BPPD_MOVE_OUTER_LEFT:
sBoxPartyPokemonDropdownPtr[idx].map2Rect.destX += param;
sBoxPartyPokemonDropdownPtr[idx].map2Rect.width += param;
break;
case 2:
sBoxPartyPokemonDropdownPtr[a0].map2Rect.destY2 += a2;
sBoxPartyPokemonDropdownPtr[a0].map2Rect.height -= a2;
case BPPD_MOVE_INNER_TOP:
sBoxPartyPokemonDropdownPtr[idx].map2Rect.destY2 += param;
sBoxPartyPokemonDropdownPtr[idx].map2Rect.height -= param;
break;
case 3:
sBoxPartyPokemonDropdownPtr[a0].map2Rect.destY -= a2;
sBoxPartyPokemonDropdownPtr[a0].map2Rect.height += a2;
case BPPD_MOVE_OUTER_TOP:
sBoxPartyPokemonDropdownPtr[idx].map2Rect.destY -= param;
sBoxPartyPokemonDropdownPtr[idx].map2Rect.height += param;
break;
case 4:
sBoxPartyPokemonDropdownPtr[a0].map2Rect.destX2 += a2;
case BPPD_MOVE_INNER_X:
sBoxPartyPokemonDropdownPtr[idx].map2Rect.destX2 += param;
break;
case 5:
sBoxPartyPokemonDropdownPtr[a0].map2Rect.destY2 += a2;
case BPPD_MOVE_INNER_Y:
sBoxPartyPokemonDropdownPtr[idx].map2Rect.destY2 += param;
break;
}
sBoxPartyPokemonDropdownPtr[a0].bgUpdateScheduled = TRUE;
sBoxPartyPokemonDropdownPtr[idx].bgUpdateScheduled = TRUE;
}
}
void sub_80F7E54(u8 a0)
void CopyBoxPartyPokemonDropdownToBgTilemapBuffer(u8 idx)
{
if (a0 < sBoxPartyPokemonDropdownCount)
if (idx < sBoxPartyPokemonDropdownCount)
{
if (sBoxPartyPokemonDropdownPtr[a0].src1 != NULL)
PushMap1(a0);
PushMap2(a0);
sBoxPartyPokemonDropdownPtr[a0].map1Rect = sBoxPartyPokemonDropdownPtr[a0].map2Rect;
if (sBoxPartyPokemonDropdownPtr[idx].src1 != NULL)
PushMap1(idx);
PushMap2(idx);
sBoxPartyPokemonDropdownPtr[idx].map1Rect = sBoxPartyPokemonDropdownPtr[idx].map2Rect;
}
}
static void PushMap1(u8 a0)
static void PushMap1(u8 idx)
{
int i;
int r9 = sBoxPartyPokemonDropdownPtr[a0].mapSize * sBoxPartyPokemonDropdownPtr[a0].src1Height;
const void * addr = sBoxPartyPokemonDropdownPtr[a0].src1 + r9 * sBoxPartyPokemonDropdownPtr[a0].map1Rect.destY2 + sBoxPartyPokemonDropdownPtr[a0].map1Rect.destX2 * sBoxPartyPokemonDropdownPtr[a0].mapSize;
for (i = 0; i < sBoxPartyPokemonDropdownPtr[a0].map1Rect.height; i++)
int run = sBoxPartyPokemonDropdownPtr[idx].mapSize * sBoxPartyPokemonDropdownPtr[idx].src1Height;
const void * addr = sBoxPartyPokemonDropdownPtr[idx].src1 + run * sBoxPartyPokemonDropdownPtr[idx].map1Rect.destY2 + sBoxPartyPokemonDropdownPtr[idx].map1Rect.destX2 * sBoxPartyPokemonDropdownPtr[idx].mapSize;
for (i = 0; i < sBoxPartyPokemonDropdownPtr[idx].map1Rect.height; i++)
{
CopyToBgTilemapBufferRect(sBoxPartyPokemonDropdownPtr[a0].bgId, addr, sBoxPartyPokemonDropdownPtr[a0].map1Rect.destX2, sBoxPartyPokemonDropdownPtr[a0].map1Rect.destY2 + i, sBoxPartyPokemonDropdownPtr[a0].map1Rect.width, 1);
addr += r9;
CopyToBgTilemapBufferRect(sBoxPartyPokemonDropdownPtr[idx].bgId, addr, sBoxPartyPokemonDropdownPtr[idx].map1Rect.destX2, sBoxPartyPokemonDropdownPtr[idx].map1Rect.destY2 + i, sBoxPartyPokemonDropdownPtr[idx].map1Rect.width, 1);
addr += run;
}
}
static void PushMap2(u8 a0)
static void PushMap2(u8 idx)
{
int i;
int r9 = sBoxPartyPokemonDropdownPtr[a0].mapSize * sBoxPartyPokemonDropdownPtr[a0].src2Width;
const void * addr = sBoxPartyPokemonDropdownPtr[a0].src2 + r9 * sBoxPartyPokemonDropdownPtr[a0].map2Rect.destY + sBoxPartyPokemonDropdownPtr[a0].map2Rect.destX * sBoxPartyPokemonDropdownPtr[a0].mapSize;
for (i = 0; i < sBoxPartyPokemonDropdownPtr[a0].map2Rect.height; i++)
int run = sBoxPartyPokemonDropdownPtr[idx].mapSize * sBoxPartyPokemonDropdownPtr[idx].src2Width;
const void * addr = sBoxPartyPokemonDropdownPtr[idx].src2 + run * sBoxPartyPokemonDropdownPtr[idx].map2Rect.destY + sBoxPartyPokemonDropdownPtr[idx].map2Rect.destX * sBoxPartyPokemonDropdownPtr[idx].mapSize;
for (i = 0; i < sBoxPartyPokemonDropdownPtr[idx].map2Rect.height; i++)
{
CopyToBgTilemapBufferRect(sBoxPartyPokemonDropdownPtr[a0].bgId, addr, sBoxPartyPokemonDropdownPtr[a0].map2Rect.destX2, sBoxPartyPokemonDropdownPtr[a0].map2Rect.destY2 + i, sBoxPartyPokemonDropdownPtr[a0].map2Rect.width, 1);
addr += r9;
CopyToBgTilemapBufferRect(sBoxPartyPokemonDropdownPtr[idx].bgId, addr, sBoxPartyPokemonDropdownPtr[idx].map2Rect.destX2, sBoxPartyPokemonDropdownPtr[idx].map2Rect.destY2 + i, sBoxPartyPokemonDropdownPtr[idx].map2Rect.width, 1);
addr += run;
}
}
+2 -2
View File
@@ -1247,10 +1247,10 @@ const u32 gUnknown_8E9BF48[] = INCBIN_U32("graphics/interface/link_rfu_status.4b
const u16 gUnknown_8E9C14C[] = INCBIN_U16("graphics/interface/pokedex_abc.gbapal");
const u32 gUnknown_8E9C16C[] = INCBIN_U32("graphics/interface/pokedex_abc.4bpp.lz");
const u16 gUnknown_8E9C3D8[] = INCBIN_U16("graphics/interface/box_tiles_pal1.gbapal");
const u16 gPSSMenu_Pal[] = INCBIN_U16("graphics/interface/box_tiles_pal1.gbapal");
const u16 gUnknown_8E9C3F8[] = INCBIN_U16("graphics/interface/box_tiles_pal2.gbapal");
const u16 gUnknown_8E9C418[] = INCBIN_U16("graphics/interface/box_tiles_pal3.gbapal");
const u32 gUnknown_8E9C438[] = INCBIN_U32("graphics/interface/box_tiles.4bpp.lz");
const u32 gPSSMenu_Gfx[] = INCBIN_U32("graphics/interface/box_tiles.4bpp.lz");
const u32 gUnknown_8E9CAEC[] = INCBIN_U32("graphics/unknown/unknown_E9CAEC.bin.lz");
File diff suppressed because it is too large Load Diff
+30 -30
View File
@@ -601,36 +601,36 @@ const u8 gString_BattleRecords_4Dashes[] = _("----");
const u8 gFameCheckerText_FameCheckerWillBeClosed[] = _("The FAME CHECKER will be closed.");
const u8 gFameCheckerText_ClearTextbox[] = _("\n ");
const u8 gUnknown_8418204[] = _("やめる");
const u8 gUnknown_8418208[] = _("Exit from the BOX.");
const u8 gUnknown_841821B[] = _("What do you want to do?");
const u8 gUnknown_8418233[] = _("Please pick a theme.");
const u8 gUnknown_8418248[] = _("Pick the wallpaper.");
const u8 gUnknown_841825C[] = _("{DYNAMIC 0x00} is selected.");
const u8 gUnknown_841826C[] = _("Jump to which BOX?");
const u8 gUnknown_841827F[] = _("Deposit in which BOX?");
const u8 gUnknown_8418295[] = _("{DYNAMIC 0x00} was deposited.");
const u8 gUnknown_84182A7[] = _("The BOX is full.");
const u8 gUnknown_84182B8[] = _("Release this POKéMON?");
const u8 gUnknown_84182CE[] = _("{DYNAMIC 0x00} was released.");
const u8 gUnknown_84182DF[] = _("Bye-bye, {DYNAMIC 0x00}!");
const u8 gUnknown_84182EC[] = _("Mark your POKéMON.");
const u8 gUnknown_84182FF[] = _("That's your last POKéMON!");
const u8 gUnknown_8418319[] = _("Your party's full!");
const u8 gUnknown_841832C[] = _("You're holding a POKéMON!");
const u8 gUnknown_8418346[] = _("Which one will you take?");
const u8 gUnknown_841835F[] = _("You can't release an EGG.");
const u8 gUnknown_8418379[] = _("Continue BOX operations?");
const u8 gUnknown_8418392[] = _("{DYNAMIC 0x00} came back!");
const u8 gUnknown_84183A0[] = _("Was it worried about you?");
const u8 gUnknown_84183BA[] = _("‥ ‥ ‥ ‥ ‥!");
const u8 gUnknown_84183C5[] = _("Please remove the MAIL.");
const u8 gUnknown_84183DD[] = _("GIVE to a POKéMON?");
const u8 gUnknown_84183F0[] = _("Placed item in the BAG.");
const u8 gUnknown_8418408[] = _("The BAG is full.");
const u8 gUnknown_8418419[] = _("Put this item in the BAG?");
const u8 gUnknown_8418433[] = _("{DYNAMIC 0x00} is now held.");
const u8 gUnknown_8418443[] = _("Changed to {DYNAMIC 0x00}.");
const u8 gUnknown_8418452[] = _("MAIL can't be stored!");
const u8 gText_ExitFromBox[] = _("Exit from the BOX.");
const u8 gText_WhatDoYouWantToDo[] = _("What do you want to do?");
const u8 gText_PleasePickATheme[] = _("Please pick a theme.");
const u8 gText_PickTheWallpaper[] = _("Pick the wallpaper.");
const u8 gText_PkmnIsSelected[] = _("{DYNAMIC 0x00} is selected.");
const u8 gText_JumpToWhichBox[] = _("Jump to which BOX?");
const u8 gText_DepositInWhichBox[] = _("Deposit in which BOX?");
const u8 gText_PkmnWasDeposited[] = _("{DYNAMIC 0x00} was deposited.");
const u8 gText_BoxIsFull2[] = _("The BOX is full.");
const u8 gText_ReleaseThisPokemon[] = _("Release this POKéMON?");
const u8 gText_PkmnWasReleased[] = _("{DYNAMIC 0x00} was released.");
const u8 gText_ByeByePkmn[] = _("Bye-bye, {DYNAMIC 0x00}!");
const u8 gText_MarkYourPkmn[] = _("Mark your POKéMON.");
const u8 gText_ThatsYourLastPkmn[] = _("That's your last POKéMON!");
const u8 gText_YourPartysFull[] = _("Your party's full!");
const u8 gText_YoureHoldingAPkmn[] = _("You're holding a POKéMON!");
const u8 gText_WhichOneWillYouTake[] = _("Which one will you take?");
const u8 gText_YouCantReleaseAnEgg[] = _("You can't release an EGG.");
const u8 gText_ContinueBoxOperations[] = _("Continue BOX operations?");
const u8 gText_PkmnCameBack[] = _("{DYNAMIC 0x00} came back!");
const u8 gText_WasItWorriedAboutYou[] = _("Was it worried about you?");
const u8 gText_FourEllipsesExclamation[] = _("‥ ‥ ‥ ‥ ‥!");
const u8 gText_PleaseRemoveTheMail[] = _("Please remove the MAIL.");
const u8 gText_GiveToAPkmn[] = _("GIVE to a POKéMON?");
const u8 gText_PlacedItemInBag[] = _("Placed item in the BAG.");
const u8 gText_BagIsFull2[] = _("The BAG is full.");
const u8 gText_PutItemInBag[] = _("Put this item in the BAG?");
const u8 gText_ItemIsNowHeld[] = _("{DYNAMIC 0x00} is now held.");
const u8 gText_ChangedToNewItem[] = _("Changed to {DYNAMIC 0x00}.");
const u8 gText_MailCantBeStored[] = _("MAIL can't be stored!");
const u8 gUnknown_8418468[] = _("CANCEL");
const u8 gUnknown_841846F[] = _("STORE");
const u8 gUnknown_8418475[] = _("WITHDRAW");