Address review comments; doc pc_screen_effect
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#ifndef GUARD_PC_SCREEN_EFFECT_H
|
||||
#define GUARD_PC_SCREEN_EFFECT_H
|
||||
|
||||
void sub_80A0A48(u16, u16, u8);
|
||||
void sub_80A0A70(u16, u16, u8);
|
||||
bool8 sub_80A0AAC(void);
|
||||
bool8 sub_80A0A98(void);
|
||||
void BeginPCScreenEffect_TurnOn(u16 xspeed, u16 yspeed, u8 priority);
|
||||
void BeginPCScreenEffect_TurnOff(u16 xspeed, u16 yspeed, u8 priority);
|
||||
bool8 IsPCScreenEffectRunning_TurnOff(void);
|
||||
bool8 IsPCScreenEffectRunning_TurnOn(void);
|
||||
|
||||
#endif //GUARD_PC_SCREEN_EFFECT_H
|
||||
|
||||
@@ -382,7 +382,7 @@ struct PokemonStorageSystemData
|
||||
/* 5abc */ u8 field_5AC4[0x800];
|
||||
}; // size=62bc
|
||||
|
||||
extern struct PokemonStorageSystemData *sPSSData;
|
||||
extern struct PokemonStorageSystemData *gPSSData;
|
||||
|
||||
void Cb2_EnterPSS(u8 a0);
|
||||
u8 GetCurrentBoxOption(void);
|
||||
|
||||
+4
-4
@@ -738,7 +738,7 @@ void CB2_InitHofPC(void)
|
||||
case 3:
|
||||
if (!DrawHofBackground())
|
||||
{
|
||||
sub_80A0A48(0, 0, 0);
|
||||
BeginPCScreenEffect_TurnOn(0, 0, 0);
|
||||
SetVBlankCallback(VBlankCB_HofIdle);
|
||||
gMain.state++;
|
||||
}
|
||||
@@ -748,7 +748,7 @@ void CB2_InitHofPC(void)
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
UpdatePaletteFade();
|
||||
if (!sub_80A0A98())
|
||||
if (!IsPCScreenEffectRunning_TurnOn())
|
||||
gMain.state++;
|
||||
break;
|
||||
case 5:
|
||||
@@ -946,13 +946,13 @@ static void Task_HofPC_HandlePaletteOnExit(u8 taskId)
|
||||
struct HallofFameTeam* fameTeam;
|
||||
|
||||
CpuCopy16(gPlttBufferFaded, gPlttBufferUnfaded, 0x400);
|
||||
sub_80A0A70(0, 0, 0);
|
||||
BeginPCScreenEffect_TurnOff(0, 0, 0);
|
||||
gTasks[taskId].func = Task_HofPC_HandleExit;
|
||||
}
|
||||
|
||||
static void Task_HofPC_HandleExit(u8 taskId)
|
||||
{
|
||||
if (!sub_80A0AAC())
|
||||
if (!IsPCScreenEffectRunning_TurnOff())
|
||||
{
|
||||
HideBg(0);
|
||||
HideBg(1);
|
||||
|
||||
+4
-4
@@ -378,7 +378,7 @@ static bool8 ItemPc_DoGfxSetup(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_80A0A48(0, 0, 0);
|
||||
BeginPCScreenEffect_TurnOn(0, 0, 0);
|
||||
ItemPc_SetInitializedFlag(1);
|
||||
PlaySE(SE_PC_LOGIN);
|
||||
}
|
||||
@@ -642,7 +642,7 @@ static void Task_ItemPcTurnOff1(u8 taskId)
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_80A0A70(0, 0, 0);
|
||||
BeginPCScreenEffect_TurnOff(0, 0, 0);
|
||||
PlaySE(SE_PC_OFF);
|
||||
}
|
||||
gTasks[taskId].func = Task_ItemPcTurnOff2;
|
||||
@@ -652,7 +652,7 @@ static void Task_ItemPcTurnOff2(u8 taskId)
|
||||
{
|
||||
s16 * data = gTasks[taskId].data;
|
||||
|
||||
if (!gPaletteFade.active && !sub_80A0AAC())
|
||||
if (!gPaletteFade.active && !IsPCScreenEffectRunning_TurnOff())
|
||||
{
|
||||
DestroyListMenuTask(data[0], &sListMenuState.scroll, &sListMenuState.row);
|
||||
if (sStateDataPtr->savedCallback != NULL)
|
||||
@@ -726,7 +726,7 @@ static void Task_ItemPcMain(u8 taskId)
|
||||
u16 row;
|
||||
s32 input;
|
||||
|
||||
if (!gPaletteFade.active && !sub_80A0A98())
|
||||
if (!gPaletteFade.active && !IsPCScreenEffectRunning_TurnOn())
|
||||
{
|
||||
if (JOY_NEW(SELECT_BUTTON))
|
||||
{
|
||||
|
||||
+89
-65
@@ -3,146 +3,160 @@
|
||||
#include "gpu_regs.h"
|
||||
#include "palette.h"
|
||||
|
||||
static void sub_80A0AC0(TaskFunc func, u16 a2, UNUSED u16 a3, u8 priority);
|
||||
static void sub_80A0B0C(u8 taskId);
|
||||
static void sub_80A0C78(u8 taskId);
|
||||
/*
|
||||
* Animates the screen as though it was a CRT monitor turning on or off.
|
||||
*/
|
||||
|
||||
void sub_80A0A48(u16 a1, u16 a2, u8 a3)
|
||||
#define tState data[0]
|
||||
#define tXSpeed data[1]
|
||||
#define tYSpeed data[2]
|
||||
#define tWin0Left data[3]
|
||||
#define tWin0Right data[4]
|
||||
#define tWin0Top data[5]
|
||||
#define tWin0Bottom data[6]
|
||||
#define tBldCntBak data[7]
|
||||
#define tBldYBak data[8]
|
||||
|
||||
static void BeginPCScreenEffect(TaskFunc func, u16 a2, UNUSED u16 a3, u8 priority);
|
||||
static void Task_PCScreenEffect_TurnOn(u8 taskId);
|
||||
static void Task_PCScreenEffect_TurnOff(u8 taskId);
|
||||
|
||||
void BeginPCScreenEffect_TurnOn(u16 xspeed, u16 yspeed, u8 priority)
|
||||
{
|
||||
sub_80A0AC0(sub_80A0B0C, a1, a2, a3);
|
||||
BeginPCScreenEffect(Task_PCScreenEffect_TurnOn, xspeed, yspeed, priority);
|
||||
}
|
||||
|
||||
void sub_80A0A70(u16 a1, u16 a2, u8 a3)
|
||||
void BeginPCScreenEffect_TurnOff(u16 xspeed, u16 yspeed, u8 priority)
|
||||
{
|
||||
sub_80A0AC0(sub_80A0C78, a1, a2, a3);
|
||||
BeginPCScreenEffect(Task_PCScreenEffect_TurnOff, xspeed, yspeed, priority);
|
||||
}
|
||||
|
||||
bool8 sub_80A0A98(void)
|
||||
bool8 IsPCScreenEffectRunning_TurnOn(void)
|
||||
{
|
||||
return FuncIsActiveTask(sub_80A0B0C);
|
||||
return FuncIsActiveTask(Task_PCScreenEffect_TurnOn);
|
||||
}
|
||||
|
||||
bool8 sub_80A0AAC(void)
|
||||
bool8 IsPCScreenEffectRunning_TurnOff(void)
|
||||
{
|
||||
return FuncIsActiveTask(sub_80A0C78);
|
||||
return FuncIsActiveTask(Task_PCScreenEffect_TurnOff);
|
||||
}
|
||||
|
||||
static void sub_80A0AC0(TaskFunc func, u16 a2, UNUSED u16 a3, u8 priority)
|
||||
static void BeginPCScreenEffect(TaskFunc func, u16 speed, UNUSED u16 unused, u8 priority)
|
||||
{
|
||||
u8 taskId = CreateTask(func, priority);
|
||||
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[1] = a2 == 0 ? 16 : a2;
|
||||
gTasks[taskId].data[2] = a2 == 0 ? 20 : a2;
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].tXSpeed = speed == 0 ? 16 : speed;
|
||||
gTasks[taskId].tYSpeed = speed == 0 ? 20 : speed; // Bug? should be the unused param, not speed
|
||||
gTasks[taskId].func(taskId);
|
||||
}
|
||||
|
||||
static void sub_80A0B0C(u8 taskId)
|
||||
static void Task_PCScreenEffect_TurnOn(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[0])
|
||||
switch (task->tState)
|
||||
{
|
||||
case 0:
|
||||
task->data[3] = 120;
|
||||
task->data[4] = 120;
|
||||
task->data[5] = 80;
|
||||
task->data[6] = 81;
|
||||
task->tWin0Left = 120;
|
||||
task->tWin0Right = 120;
|
||||
task->tWin0Top = 80;
|
||||
task->tWin0Bottom = 81;
|
||||
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON);
|
||||
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->data[3], task->data[4]));
|
||||
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->data[5], task->data[6]));
|
||||
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->tWin0Left, task->tWin0Right));
|
||||
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->tWin0Top, task->tWin0Bottom));
|
||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR);
|
||||
SetGpuReg(REG_OFFSET_WINOUT, 0);
|
||||
break;
|
||||
case 1:
|
||||
task->data[7] = GetGpuReg(REG_OFFSET_BLDCNT);
|
||||
task->data[8] = GetGpuReg(REG_OFFSET_BLDY);
|
||||
task->tBldCntBak = GetGpuReg(REG_OFFSET_BLDCNT);
|
||||
task->tBldYBak = GetGpuReg(REG_OFFSET_BLDY);
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_TGT1_BG1 | BLDCNT_TGT1_BG2 | BLDCNT_TGT1_BG3 | BLDCNT_TGT1_OBJ | BLDCNT_TGT1_BD | BLDCNT_EFFECT_LIGHTEN);
|
||||
SetGpuReg(REG_OFFSET_BLDY, 16);
|
||||
break;
|
||||
case 2:
|
||||
task->data[3] -= task->data[1];
|
||||
task->data[4] += task->data[1];
|
||||
if (task->data[3] <= 0 || task->data[4] >= DISPLAY_WIDTH)
|
||||
task->tWin0Left -= task->tXSpeed;
|
||||
task->tWin0Right += task->tXSpeed;
|
||||
if (task->tWin0Left <= 0 || task->tWin0Right >= DISPLAY_WIDTH)
|
||||
{
|
||||
task->data[3] = 0;
|
||||
task->data[4] = DISPLAY_WIDTH;
|
||||
task->tWin0Left = 0;
|
||||
task->tWin0Right = DISPLAY_WIDTH;
|
||||
SetGpuReg(REG_OFFSET_BLDY, 0);
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, task->data[7]);
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, task->tBldCntBak);
|
||||
BlendPalettes(0xFFFFFFFF, 0, RGB_BLACK);
|
||||
gPlttBufferFaded[0] = 0;
|
||||
}
|
||||
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->data[3], task->data[4]));
|
||||
if (task->data[3])
|
||||
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->tWin0Left, task->tWin0Right));
|
||||
if (task->tWin0Left)
|
||||
return;
|
||||
break;
|
||||
case 3:
|
||||
task->data[5] -= task->data[2];
|
||||
task->data[6] += task->data[2];
|
||||
if (task->data[5] <= 0 || task->data[6] >= DISPLAY_HEIGHT)
|
||||
task->tWin0Top -= task->tYSpeed;
|
||||
task->tWin0Bottom += task->tYSpeed;
|
||||
if (task->tWin0Top <= 0 || task->tWin0Bottom >= DISPLAY_HEIGHT)
|
||||
{
|
||||
task->data[5] = 0;
|
||||
task->data[6] = DISPLAY_HEIGHT;
|
||||
task->tWin0Top = 0;
|
||||
task->tWin0Bottom = DISPLAY_HEIGHT;
|
||||
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON);
|
||||
}
|
||||
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->data[5], task->data[6]));
|
||||
if (task->data[5])
|
||||
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->tWin0Top, task->tWin0Bottom));
|
||||
if (task->tWin0Top)
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, task->data[7]);
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, task->tBldCntBak);
|
||||
DestroyTask(taskId);
|
||||
return;
|
||||
}
|
||||
++task->data[0];
|
||||
++task->tState;
|
||||
}
|
||||
|
||||
static void sub_80A0C78(u8 taskId)
|
||||
static void Task_PCScreenEffect_TurnOff(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[0])
|
||||
switch (task->tState)
|
||||
{
|
||||
case 0:
|
||||
gPlttBufferFaded[0] = 0;
|
||||
break;
|
||||
case 1:
|
||||
task->data[3] = 0;
|
||||
task->data[4] = DISPLAY_WIDTH;
|
||||
task->data[5] = 0;
|
||||
task->data[6] = DISPLAY_HEIGHT;
|
||||
task->tWin0Left = 0;
|
||||
task->tWin0Right = DISPLAY_WIDTH;
|
||||
task->tWin0Top = 0;
|
||||
task->tWin0Bottom = DISPLAY_HEIGHT;
|
||||
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON);
|
||||
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->data[3], task->data[4]));
|
||||
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->data[5], task->data[6]));
|
||||
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->tWin0Left, task->tWin0Right));
|
||||
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->tWin0Top, task->tWin0Bottom));
|
||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR);
|
||||
SetGpuReg(REG_OFFSET_WINOUT, 0);
|
||||
break;
|
||||
case 2:
|
||||
task->data[5] += task->data[2];
|
||||
task->data[6] -= task->data[2];
|
||||
if (task->data[5] >= 80 || task->data[6] <= 81)
|
||||
task->tWin0Top += task->tYSpeed;
|
||||
task->tWin0Bottom -= task->tYSpeed;
|
||||
if (task->tWin0Top >= 80 || task->tWin0Bottom <= 81)
|
||||
{
|
||||
task->data[5] = 80;
|
||||
task->data[6] = 81;
|
||||
task->tWin0Top = 80;
|
||||
task->tWin0Bottom = 81;
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_TGT1_BG1 | BLDCNT_TGT1_BG2 | BLDCNT_TGT1_BG3 | BLDCNT_TGT1_OBJ | BLDCNT_TGT1_BD | BLDCNT_EFFECT_LIGHTEN);
|
||||
SetGpuReg(REG_OFFSET_BLDY, 16);
|
||||
}
|
||||
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->data[5], task->data[6]));
|
||||
if (task->data[5] != 80)
|
||||
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->tWin0Top, task->tWin0Bottom));
|
||||
if (task->tWin0Top != 80)
|
||||
return;
|
||||
break;
|
||||
case 3:
|
||||
task->data[3] += task->data[1];
|
||||
task->data[4] -= task->data[1];
|
||||
if (task->data[3] >= 120 || task->data[4] <= 120)
|
||||
task->tWin0Left += task->tXSpeed;
|
||||
task->tWin0Right -= task->tXSpeed;
|
||||
if (task->tWin0Left >= 120 || task->tWin0Right <= 120)
|
||||
{
|
||||
task->data[3] = 120;
|
||||
task->data[4] = 120;
|
||||
task->tWin0Left = 120;
|
||||
task->tWin0Right = 120;
|
||||
BlendPalettes(0xFFFFFFFF, 0x10, RGB_BLACK);
|
||||
gPlttBufferFaded[0] = 0;
|
||||
}
|
||||
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->data[3], task->data[4]));
|
||||
if (task->data[3] != 120)
|
||||
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->tWin0Left, task->tWin0Right));
|
||||
if (task->tWin0Left != 120)
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
@@ -152,5 +166,15 @@ static void sub_80A0C78(u8 taskId)
|
||||
DestroyTask(taskId);
|
||||
return;
|
||||
}
|
||||
++task->data[0];
|
||||
++task->tState;
|
||||
}
|
||||
|
||||
#undef tBldYBak
|
||||
#undef tBldCntBak
|
||||
#undef tWin0Bottom
|
||||
#undef tWin0Top
|
||||
#undef tWin0Right
|
||||
#undef tWin0Left
|
||||
#undef tYSpeed
|
||||
#undef tXSpeed
|
||||
#undef tState
|
||||
|
||||
@@ -36,11 +36,11 @@ static void sub_808CD64(struct Sprite * sprite);
|
||||
|
||||
// Forward declarations
|
||||
|
||||
static const u16 gBoxSelectionPopupPalette[];
|
||||
static const u16 gBoxSelectionPopupCenterTiles[];
|
||||
static const u16 gBoxSelectionPopupSidesTiles[];
|
||||
static const u16 sBoxSelectionPopupPalette[];
|
||||
static const u16 sBoxSelectionPopupCenterTiles[];
|
||||
static const u16 sBoxSelectionPopupSidesTiles[];
|
||||
|
||||
static const struct PSS_MenuStringPtrs gUnknown_83CDA20[] = {
|
||||
static const struct PSS_MenuStringPtrs sUnknown_83CDA20[] = {
|
||||
{gText_WithdrawPokemon, gText_WithdrawMonDescription},
|
||||
{gText_DepositPokemon, gText_DepositMonDescription },
|
||||
{gText_MovePokemon, gText_MoveMonDescription },
|
||||
@@ -60,7 +60,7 @@ void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 zero1, u8 zero
|
||||
winTemplate.height = 2;
|
||||
windowId = AddWindow(&winTemplate);
|
||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(zero2));
|
||||
tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
||||
tileData1 = (u8*)GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
||||
tileData2 = (winTemplate.width * 32) + tileData1;
|
||||
|
||||
if (!zero1)
|
||||
@@ -107,7 +107,7 @@ static void PrintStringToBufferCopyNow(const u8 *string, void *dst, u16 rise, u8
|
||||
var = winTemplate.width * 32;
|
||||
windowId = AddWindow(&winTemplate);
|
||||
FillWindowPixelBuffer(windowId, PIXEL_FILL(bgClr));
|
||||
tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
||||
tileData1 = (u8*)GetWindowAttribute(windowId, WINDOW_TILE_DATA);
|
||||
tileData2 = (winTemplate.width * 32) + tileData1;
|
||||
txtColor[0] = bgClr;
|
||||
txtColor[1] = fgClr;
|
||||
@@ -246,7 +246,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId)
|
||||
LoadStdWindowFrameGfx();
|
||||
DrawDialogueFrame(0, 0);
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 2, gUnknown_83CDA20[task->data[1]].desc, TEXT_SPEED_FF, NULL, TEXT_COLOR_DARK_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GREY);
|
||||
AddTextPrinterParameterized2(0, 2, sUnknown_83CDA20[task->data[1]].desc, TEXT_SPEED_FF, NULL, TEXT_COLOR_DARK_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GREY);
|
||||
CopyWindowToVram(0, 3);
|
||||
CopyWindowToVram(task->data[15], 3);
|
||||
task->data[0]++;
|
||||
@@ -263,16 +263,16 @@ static void Task_PokemonStorageSystemPC(u8 taskId)
|
||||
{
|
||||
case MENU_NOTHING_CHOSEN:
|
||||
task->data[3] = task->data[1];
|
||||
if (gMain.newKeys & DPAD_UP && --task->data[3] < 0)
|
||||
if (JOY_NEW(DPAD_UP) && --task->data[3] < 0)
|
||||
task->data[3] = 4;
|
||||
|
||||
if (gMain.newKeys & DPAD_DOWN && ++task->data[3] > 4)
|
||||
if (JOY_NEW(DPAD_DOWN) && ++task->data[3] > 4)
|
||||
task->data[3] = 0;
|
||||
if (task->data[1] != task->data[3])
|
||||
{
|
||||
task->data[1] = task->data[3];
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 2, gUnknown_83CDA20[task->data[1]].desc, 0, NULL, TEXT_COLOR_DARK_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GREY);
|
||||
AddTextPrinterParameterized2(0, 2, sUnknown_83CDA20[task->data[1]].desc, 0, NULL, TEXT_COLOR_DARK_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GREY);
|
||||
}
|
||||
break;
|
||||
case MENU_B_PRESSED:
|
||||
@@ -305,30 +305,30 @@ static void Task_PokemonStorageSystemPC(u8 taskId)
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
|
||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||
{
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 2, gUnknown_83CDA20[task->data[1]].desc, 0, NULL, TEXT_COLOR_DARK_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GREY);
|
||||
AddTextPrinterParameterized2(0, 2, sUnknown_83CDA20[task->data[1]].desc, 0, NULL, TEXT_COLOR_DARK_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GREY);
|
||||
task->data[0] = 2;
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_UP)
|
||||
else if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
if (--task->data[1] < 0)
|
||||
task->data[1] = 4;
|
||||
Menu_MoveCursor(-1);
|
||||
task->data[1] = Menu_GetCursorPos();
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 2, gUnknown_83CDA20[task->data[1]].desc, 0, NULL, TEXT_COLOR_DARK_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GREY);
|
||||
AddTextPrinterParameterized2(0, 2, sUnknown_83CDA20[task->data[1]].desc, 0, NULL, TEXT_COLOR_DARK_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GREY);
|
||||
task->data[0] = 2;
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_DOWN)
|
||||
else if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
if (++task->data[1] > 3)
|
||||
task->data[1] = 0;
|
||||
Menu_MoveCursor(1);
|
||||
task->data[1] = Menu_GetCursorPos();
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 2, gUnknown_83CDA20[task->data[1]].desc, 0, NULL, TEXT_COLOR_DARK_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GREY);
|
||||
AddTextPrinterParameterized2(0, 2, sUnknown_83CDA20[task->data[1]].desc, 0, NULL, TEXT_COLOR_DARK_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GREY);
|
||||
task->data[0] = 2;
|
||||
}
|
||||
break;
|
||||
@@ -365,7 +365,7 @@ static void FieldCb_ReturnToPcMenu(void)
|
||||
FadeInFromBlack();
|
||||
}
|
||||
|
||||
static const struct WindowTemplate gUnknown_83CDA48 = {
|
||||
static const struct WindowTemplate sUnknown_83CDA48 = {
|
||||
.bg = 0,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 1,
|
||||
@@ -378,11 +378,11 @@ static const struct WindowTemplate gUnknown_83CDA48 = {
|
||||
static void PSS_CreatePCMenu(u8 whichMenu, s16 *windowIdPtr)
|
||||
{
|
||||
s16 windowId;
|
||||
windowId = AddWindow(&gUnknown_83CDA48);
|
||||
windowId = AddWindow(&sUnknown_83CDA48);
|
||||
|
||||
DrawStdWindowFrame(windowId, FALSE);
|
||||
PrintTextArray(windowId, 2, GetMenuCursorDimensionByFont(2, 0), 2, 16, NELEMS(gUnknown_83CDA20), (void *)gUnknown_83CDA20);
|
||||
Menu_InitCursor(windowId, 2, 0, 2, 16, NELEMS(gUnknown_83CDA20), whichMenu);
|
||||
PrintTextArray(windowId, 2, GetMenuCursorDimensionByFont(2, 0), 2, 16, NELEMS(sUnknown_83CDA20), (void *)sUnknown_83CDA20);
|
||||
Menu_InitCursor(windowId, 2, 0, 2, 16, NELEMS(sUnknown_83CDA20), whichMenu);
|
||||
*windowIdPtr = windowId;
|
||||
}
|
||||
|
||||
@@ -417,11 +417,11 @@ void ResetPokemonStorageSystem(void)
|
||||
void LoadBoxSelectionPopupSpriteGfx(struct UnkPSSStruct_2002370 *a0, u16 tileTag, u16 palTag, u8 a3, bool32 loadPal)
|
||||
{
|
||||
struct SpritePalette palette = {
|
||||
gBoxSelectionPopupPalette, palTag
|
||||
sBoxSelectionPopupPalette, palTag
|
||||
};
|
||||
struct SpriteSheet sheets[] = {
|
||||
{gBoxSelectionPopupCenterTiles, 0x800, tileTag},
|
||||
{gBoxSelectionPopupSidesTiles, 0x180, tileTag + 1},
|
||||
{sBoxSelectionPopupCenterTiles, 0x800, tileTag},
|
||||
{sBoxSelectionPopupSidesTiles, 0x180, tileTag + 1},
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -456,22 +456,22 @@ void sub_808C950(void)
|
||||
|
||||
u8 HandleBoxChooseSelectionInput(void)
|
||||
{
|
||||
if (gMain.newKeys & B_BUTTON)
|
||||
if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
return 201;
|
||||
}
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
return sBoxSelectionPopupSpriteManager->curBox;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
UpdateBoxNameAndCountSprite_WraparoundLeft();
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_RIGHT)
|
||||
else if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
UpdateBoxNameAndCountSprite_WraparoundRight();
|
||||
@@ -648,6 +648,6 @@ static void sub_808CD64(struct Sprite *sprite)
|
||||
|
||||
// Forward-declared rodata
|
||||
|
||||
static const u16 gBoxSelectionPopupPalette[] = INCBIN_U16("graphics/interface/pss_unk_83CDA98.gbapal");
|
||||
static const u16 gBoxSelectionPopupCenterTiles[] = INCBIN_U16("graphics/interface/pss_unk_83CDAB8.4bpp");
|
||||
static const u16 gBoxSelectionPopupSidesTiles[] = INCBIN_U16("graphics/interface/pss_unk_83CE2B8.4bpp");
|
||||
static const u16 sBoxSelectionPopupPalette[] = INCBIN_U16("graphics/interface/pss_unk_83CDA98.gbapal");
|
||||
static const u16 sBoxSelectionPopupCenterTiles[] = INCBIN_U16("graphics/interface/pss_unk_83CDAB8.4bpp");
|
||||
static const u16 sBoxSelectionPopupSidesTiles[] = INCBIN_U16("graphics/interface/pss_unk_83CE2B8.4bpp");
|
||||
|
||||
+354
-354
File diff suppressed because it is too large
Load Diff
+291
-291
File diff suppressed because it is too large
Load Diff
+300
-300
File diff suppressed because it is too large
Load Diff
@@ -8,11 +8,11 @@
|
||||
|
||||
void InitMenu(void)
|
||||
{
|
||||
sPSSData->menuItemsCount = 0;
|
||||
sPSSData->menuWidth = 0;
|
||||
sPSSData->menuWindow.bg = 0;
|
||||
sPSSData->menuWindow.paletteNum = 15;
|
||||
sPSSData->menuWindow.baseBlock = 92;
|
||||
gPSSData->menuItemsCount = 0;
|
||||
gPSSData->menuWidth = 0;
|
||||
gPSSData->menuWindow.bg = 0;
|
||||
gPSSData->menuWindow.paletteNum = 15;
|
||||
gPSSData->menuWindow.baseBlock = 92;
|
||||
}
|
||||
|
||||
static const u8 *const sMenuTexts[] = {
|
||||
@@ -58,42 +58,42 @@ static const u8 *const sMenuTexts[] = {
|
||||
|
||||
void SetMenuText(u8 textId)
|
||||
{
|
||||
if (sPSSData->menuItemsCount < MAX_MENU_ITEMS)
|
||||
if (gPSSData->menuItemsCount < MAX_MENU_ITEMS)
|
||||
{
|
||||
u8 len;
|
||||
struct StorageMenu *menu = &sPSSData->menuItems[sPSSData->menuItemsCount];
|
||||
struct StorageMenu *menu = &gPSSData->menuItems[gPSSData->menuItemsCount];
|
||||
|
||||
menu->text = sMenuTexts[textId];
|
||||
menu->textId = textId;
|
||||
len = StringLength(menu->text);
|
||||
if (len > sPSSData->menuWidth)
|
||||
sPSSData->menuWidth = len;
|
||||
if (len > gPSSData->menuWidth)
|
||||
gPSSData->menuWidth = len;
|
||||
|
||||
sPSSData->menuItemsCount++;
|
||||
gPSSData->menuItemsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
s8 sub_8094E50(u8 arg0)
|
||||
{
|
||||
if (arg0 >= sPSSData->menuItemsCount)
|
||||
if (arg0 >= gPSSData->menuItemsCount)
|
||||
return -1;
|
||||
else
|
||||
return sPSSData->menuItems[arg0].textId;
|
||||
return gPSSData->menuItems[arg0].textId;
|
||||
}
|
||||
|
||||
void AddMenu(void)
|
||||
{
|
||||
sPSSData->menuWindow.width = sPSSData->menuWidth + 2;
|
||||
sPSSData->menuWindow.height = 2 * sPSSData->menuItemsCount;
|
||||
sPSSData->menuWindow.tilemapLeft = 29 - sPSSData->menuWindow.width;
|
||||
sPSSData->menuWindow.tilemapTop = 15 - sPSSData->menuWindow.height;
|
||||
sPSSData->field_CB0 = AddWindow(&sPSSData->menuWindow);
|
||||
ClearWindowTilemap(sPSSData->field_CB0);
|
||||
DrawStdFrameWithCustomTileAndPalette(sPSSData->field_CB0, FALSE, 0x00b, 14);
|
||||
PrintTextArray(sPSSData->field_CB0, 1, 8, 2, 16, sPSSData->menuItemsCount, (void*)sPSSData->menuItems);
|
||||
Menu_InitCursor(sPSSData->field_CB0, 1, 0, 2, 16, sPSSData->menuItemsCount, 0);
|
||||
gPSSData->menuWindow.width = gPSSData->menuWidth + 2;
|
||||
gPSSData->menuWindow.height = 2 * gPSSData->menuItemsCount;
|
||||
gPSSData->menuWindow.tilemapLeft = 29 - gPSSData->menuWindow.width;
|
||||
gPSSData->menuWindow.tilemapTop = 15 - gPSSData->menuWindow.height;
|
||||
gPSSData->field_CB0 = AddWindow(&gPSSData->menuWindow);
|
||||
ClearWindowTilemap(gPSSData->field_CB0);
|
||||
DrawStdFrameWithCustomTileAndPalette(gPSSData->field_CB0, FALSE, 0x00b, 14);
|
||||
PrintTextArray(gPSSData->field_CB0, 1, 8, 2, 16, gPSSData->menuItemsCount, (void*)gPSSData->menuItems);
|
||||
Menu_InitCursor(gPSSData->field_CB0, 1, 0, 2, 16, gPSSData->menuItemsCount, 0);
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
sPSSData->field_CAE = 0;
|
||||
gPSSData->field_CAE = 0;
|
||||
}
|
||||
|
||||
bool8 sub_8094F90(void)
|
||||
@@ -135,13 +135,13 @@ s16 sub_8094F94(void)
|
||||
sub_8095024();
|
||||
|
||||
if (textId >= 0)
|
||||
textId = sPSSData->menuItems[textId].textId;
|
||||
textId = gPSSData->menuItems[textId].textId;
|
||||
|
||||
return textId;
|
||||
}
|
||||
|
||||
void sub_8095024(void)
|
||||
{
|
||||
ClearStdWindowAndFrameToTransparent(sPSSData->field_CB0, TRUE);
|
||||
RemoveWindow(sPSSData->field_CB0);
|
||||
ClearStdWindowAndFrameToTransparent(gPSSData->field_CB0, TRUE);
|
||||
RemoveWindow(gPSSData->field_CB0);
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@ bool8 sub_8095050(void)
|
||||
sMoveMonsPtr = Alloc(sizeof(*sMoveMonsPtr));
|
||||
if (sMoveMonsPtr != NULL)
|
||||
{
|
||||
sPSSData->field_2200 = AddWindow8Bit(&gUnknown_83D35D4);
|
||||
if (sPSSData->field_2200 != 0xFF)
|
||||
gPSSData->field_2200 = AddWindow8Bit(&gUnknown_83D35D4);
|
||||
if (gPSSData->field_2200 != 0xFF)
|
||||
{
|
||||
FillWindowPixelBuffer(sPSSData->field_2200, PIXEL_FILL(0));
|
||||
FillWindowPixelBuffer(gPSSData->field_2200, PIXEL_FILL(0));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -124,11 +124,11 @@ static bool8 sub_8095138(void)
|
||||
ChangeBgX(0, -1024, 0);
|
||||
ChangeBgY(0, -1024, 0);
|
||||
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20);
|
||||
FillWindowPixelBuffer8Bit(sPSSData->field_2200, PIXEL_FILL(0));
|
||||
FillWindowPixelBuffer8Bit(gPSSData->field_2200, PIXEL_FILL(0));
|
||||
sub_80956A4(sMoveMonsPtr->fromRow, sMoveMonsPtr->fromColumn);
|
||||
SetBgAttribute(0, BG_ATTR_PALETTEMODE, 1);
|
||||
PutWindowTilemap(sPSSData->field_2200);
|
||||
CopyWindowToVram8Bit(sPSSData->field_2200, 3);
|
||||
PutWindowTilemap(gPSSData->field_2200);
|
||||
CopyWindowToVram8Bit(gPSSData->field_2200, 3);
|
||||
BlendPalettes(0x3F00, 8, RGB_WHITE);
|
||||
sub_8094D14(2);
|
||||
SetGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR);
|
||||
@@ -184,7 +184,7 @@ static bool8 sub_80952A0(void)
|
||||
sub_8095520();
|
||||
sMoveMonsPtr->toRow = sMoveMonsPtr->field_6;
|
||||
sMoveMonsPtr->toColumn = sMoveMonsPtr->field_7;
|
||||
CopyWindowToVram8Bit(sPSSData->field_2200, 2);
|
||||
CopyWindowToVram8Bit(gPSSData->field_2200, 2);
|
||||
sMoveMonsPtr->state++;
|
||||
}
|
||||
break;
|
||||
@@ -404,7 +404,7 @@ static void sub_80956A4(u8 x, u8 y)
|
||||
const u8 *iconGfx = GetMonIconPtr(species, personality, 1);
|
||||
u8 index = GetValidMonIconPalIndex(species) + 8;
|
||||
|
||||
BlitBitmapRectToWindow4BitTo8Bit(sPSSData->field_2200,
|
||||
BlitBitmapRectToWindow4BitTo8Bit(gPSSData->field_2200,
|
||||
iconGfx,
|
||||
0,
|
||||
0,
|
||||
@@ -425,7 +425,7 @@ static void sub_809572C(u8 x, u8 y)
|
||||
|
||||
if (species != SPECIES_NONE)
|
||||
{
|
||||
FillWindowPixelRect8Bit(sPSSData->field_2200,
|
||||
FillWindowPixelRect8Bit(gPSSData->field_2200,
|
||||
PIXEL_FILL(0),
|
||||
24 * x,
|
||||
24 * y,
|
||||
|
||||
@@ -34,13 +34,13 @@ static const struct OamData gUnknown_83D365C = {
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_NORMAL,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x32),
|
||||
.x = 0,
|
||||
.matrixNum = 0,
|
||||
.size = SPRITE_SIZE(32x32),
|
||||
.tileNum = 0,
|
||||
.tileNum = 0x000,
|
||||
.priority = 1,
|
||||
.paletteNum = 0,
|
||||
.affineParam = 0
|
||||
@@ -116,7 +116,7 @@ void sub_8095B5C(void)
|
||||
struct SpriteTemplate spriteTemplate;
|
||||
static u32 gUnknown_3000FE8[0x61];
|
||||
|
||||
if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS)
|
||||
if (gPSSData->boxOption == BOX_OPTION_MOVE_ITEMS)
|
||||
{
|
||||
spriteSheet.data = gUnknown_3000FE8;
|
||||
spriteSheet.size = 0x200;
|
||||
@@ -126,26 +126,26 @@ void sub_8095B5C(void)
|
||||
{
|
||||
spriteSheet.tag = TAG_TILE_7 + i;
|
||||
LoadCompressedSpriteSheet(&spriteSheet);
|
||||
sPSSData->itemIconSprites[i].tiles = GetSpriteTileStartByTag(spriteSheet.tag) * 32 + (void*)(OBJ_VRAM0);
|
||||
sPSSData->itemIconSprites[i].palIndex = AllocSpritePalette(TAG_PAL_DACB + i);
|
||||
sPSSData->itemIconSprites[i].palIndex *= 16;
|
||||
sPSSData->itemIconSprites[i].palIndex += 0x100;
|
||||
gPSSData->itemIconSprites[i].tiles = GetSpriteTileStartByTag(spriteSheet.tag) * 32 + (void*)(OBJ_VRAM0);
|
||||
gPSSData->itemIconSprites[i].palIndex = AllocSpritePalette(TAG_PAL_DACB + i);
|
||||
gPSSData->itemIconSprites[i].palIndex *= 16;
|
||||
gPSSData->itemIconSprites[i].palIndex += 0x100;
|
||||
spriteTemplate.tileTag = TAG_TILE_7 + i;
|
||||
spriteTemplate.paletteTag = TAG_PAL_DACB + i;
|
||||
spriteId = CreateSprite(&spriteTemplate, 0, 0, 11);
|
||||
sPSSData->itemIconSprites[i].sprite = &gSprites[spriteId];
|
||||
sPSSData->itemIconSprites[i].sprite->invisible = TRUE;
|
||||
sPSSData->itemIconSprites[i].active = 0;
|
||||
gPSSData->itemIconSprites[i].sprite = &gSprites[spriteId];
|
||||
gPSSData->itemIconSprites[i].sprite->invisible = TRUE;
|
||||
gPSSData->itemIconSprites[i].active = 0;
|
||||
}
|
||||
}
|
||||
sPSSData->movingItem = ITEM_NONE;
|
||||
gPSSData->movingItem = ITEM_NONE;
|
||||
}
|
||||
|
||||
void sub_8095C84(u8 cursorArea, u8 cursorPos)
|
||||
{
|
||||
u16 heldItem;
|
||||
|
||||
if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
if (gPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
return;
|
||||
if (sub_8096210(cursorArea, cursorPos))
|
||||
return;
|
||||
@@ -183,7 +183,7 @@ void sub_8095D44(u8 cursorArea, u8 cursorPos)
|
||||
{
|
||||
u8 id;
|
||||
|
||||
if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
if (gPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
return;
|
||||
|
||||
id = sub_8096258(cursorArea, cursorPos);
|
||||
@@ -196,7 +196,7 @@ void Item_FromMonToMoving(u8 cursorArea, u8 cursorPos)
|
||||
u8 id;
|
||||
u16 item;
|
||||
|
||||
if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
if (gPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
return;
|
||||
|
||||
id = sub_8096258(cursorArea, cursorPos);
|
||||
@@ -215,7 +215,7 @@ void Item_FromMonToMoving(u8 cursorArea, u8 cursorPos)
|
||||
SetPartyMonIconObjMode(cursorPos, ST_OAM_OBJ_BLEND);
|
||||
}
|
||||
|
||||
sPSSData->movingItem = sPSSData->cursorMonItem;
|
||||
gPSSData->movingItem = gPSSData->cursorMonItem;
|
||||
}
|
||||
|
||||
void sub_8095E2C(u16 item)
|
||||
@@ -229,7 +229,7 @@ void sub_8095E2C(u16 item)
|
||||
sub_80964E8(id, 1, CURSOR_AREA_IN_BOX, 0);
|
||||
sub_80962F0(id, CURSOR_AREA_BOX, 0);
|
||||
sub_8096624(id, TRUE);
|
||||
sPSSData->movingItem = item;
|
||||
gPSSData->movingItem = item;
|
||||
}
|
||||
|
||||
void Item_SwitchMonsWithMoving(u8 cursorArea, u8 cursorPos)
|
||||
@@ -237,7 +237,7 @@ void Item_SwitchMonsWithMoving(u8 cursorArea, u8 cursorPos)
|
||||
u8 id;
|
||||
u16 item;
|
||||
|
||||
if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
if (gPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
return;
|
||||
|
||||
id = sub_8096258(cursorArea, cursorPos);
|
||||
@@ -246,14 +246,14 @@ void Item_SwitchMonsWithMoving(u8 cursorArea, u8 cursorPos)
|
||||
if (cursorArea == CURSOR_AREA_IN_BOX)
|
||||
{
|
||||
item = GetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM);
|
||||
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sPSSData->movingItem);
|
||||
sPSSData->movingItem = item;
|
||||
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &gPSSData->movingItem);
|
||||
gPSSData->movingItem = item;
|
||||
}
|
||||
else
|
||||
{
|
||||
item = GetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM);
|
||||
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sPSSData->movingItem);
|
||||
sPSSData->movingItem = item;
|
||||
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &gPSSData->movingItem);
|
||||
gPSSData->movingItem = item;
|
||||
}
|
||||
|
||||
id = sub_8096258(2, 0);
|
||||
@@ -265,7 +265,7 @@ void Item_GiveMovingToMon(u8 cursorArea, u8 cursorPos)
|
||||
{
|
||||
u8 id;
|
||||
|
||||
if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
if (gPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
return;
|
||||
|
||||
id = sub_8096258(2, 0);
|
||||
@@ -273,12 +273,12 @@ void Item_GiveMovingToMon(u8 cursorArea, u8 cursorPos)
|
||||
sub_80964E8(id, 2, cursorArea, cursorPos);
|
||||
if (cursorArea == CURSOR_AREA_IN_BOX)
|
||||
{
|
||||
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sPSSData->movingItem);
|
||||
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &gPSSData->movingItem);
|
||||
SetBoxMonIconObjMode(cursorPos, ST_OAM_OBJ_NORMAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sPSSData->movingItem);
|
||||
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &gPSSData->movingItem);
|
||||
SetPartyMonIconObjMode(cursorPos, ST_OAM_OBJ_NORMAL);
|
||||
}
|
||||
}
|
||||
@@ -288,7 +288,7 @@ void Item_TakeMons(u8 cursorArea, u8 cursorPos)
|
||||
u8 id;
|
||||
u16 item;
|
||||
|
||||
if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
if (gPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
return;
|
||||
|
||||
item = 0;
|
||||
@@ -309,7 +309,7 @@ void Item_TakeMons(u8 cursorArea, u8 cursorPos)
|
||||
|
||||
void sub_8096088(void)
|
||||
{
|
||||
if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS)
|
||||
if (gPSSData->boxOption == BOX_OPTION_MOVE_ITEMS)
|
||||
{
|
||||
u8 id = sub_8096258(2, 0);
|
||||
sub_80964B8(id, 5);
|
||||
@@ -321,12 +321,12 @@ void sub_80960C0(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
if (gPSSData->boxOption != BOX_OPTION_MOVE_ITEMS)
|
||||
return;
|
||||
|
||||
for (i = 0; i < MAX_ITEM_ICONS; i++)
|
||||
{
|
||||
if (sPSSData->itemIconSprites[i].active && sPSSData->itemIconSprites[i].cursorArea == CURSOR_AREA_IN_PARTY)
|
||||
if (gPSSData->itemIconSprites[i].active && gPSSData->itemIconSprites[i].cursorArea == CURSOR_AREA_IN_PARTY)
|
||||
sub_80964E8(i, 7, CURSOR_AREA_BOX, 0);
|
||||
}
|
||||
}
|
||||
@@ -337,11 +337,11 @@ bool8 sub_809610C(void)
|
||||
|
||||
for (i = 0; i < MAX_ITEM_ICONS; i++)
|
||||
{
|
||||
if (sPSSData->itemIconSprites[i].active)
|
||||
if (gPSSData->itemIconSprites[i].active)
|
||||
{
|
||||
if (!sPSSData->itemIconSprites[i].sprite->affineAnimEnded && sPSSData->itemIconSprites[i].sprite->affineAnimBeginning)
|
||||
if (!gPSSData->itemIconSprites[i].sprite->affineAnimEnded && gPSSData->itemIconSprites[i].sprite->affineAnimBeginning)
|
||||
return TRUE;
|
||||
if (sPSSData->itemIconSprites[i].sprite->callback != SpriteCallbackDummy && sPSSData->itemIconSprites[i].sprite->callback != sub_80969BC)
|
||||
if (gPSSData->itemIconSprites[i].sprite->callback != SpriteCallbackDummy && gPSSData->itemIconSprites[i].sprite->callback != sub_80969BC)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -353,11 +353,11 @@ bool8 IsActiveItemMoving(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS)
|
||||
if (gPSSData->boxOption == BOX_OPTION_MOVE_ITEMS)
|
||||
{
|
||||
for (i = 0; i < MAX_ITEM_ICONS; i++)
|
||||
{
|
||||
if (sPSSData->itemIconSprites[i].active && sPSSData->itemIconSprites[i].cursorArea == CURSOR_AREA_BOX)
|
||||
if (gPSSData->itemIconSprites[i].active && gPSSData->itemIconSprites[i].cursorArea == CURSOR_AREA_BOX)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -367,12 +367,12 @@ bool8 IsActiveItemMoving(void)
|
||||
|
||||
const u8 *GetMovingItemName(void)
|
||||
{
|
||||
return ItemId_GetName(sPSSData->movingItem);
|
||||
return ItemId_GetName(gPSSData->movingItem);
|
||||
}
|
||||
|
||||
u16 GetMovingItem(void)
|
||||
{
|
||||
return sPSSData->movingItem;
|
||||
return gPSSData->movingItem;
|
||||
}
|
||||
|
||||
static u8 sub_80961D8(void)
|
||||
@@ -381,9 +381,9 @@ static u8 sub_80961D8(void)
|
||||
|
||||
for (i = 0; i < MAX_ITEM_ICONS; i++)
|
||||
{
|
||||
if (!sPSSData->itemIconSprites[i].active)
|
||||
if (!gPSSData->itemIconSprites[i].active)
|
||||
{
|
||||
sPSSData->itemIconSprites[i].active = TRUE;
|
||||
gPSSData->itemIconSprites[i].active = TRUE;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -397,9 +397,9 @@ static bool32 sub_8096210(u8 cursorArea, u8 cursorPos)
|
||||
|
||||
for (i = 0; i < MAX_ITEM_ICONS; i++)
|
||||
{
|
||||
if (sPSSData->itemIconSprites[i].active
|
||||
&& sPSSData->itemIconSprites[i].cursorArea == cursorArea
|
||||
&& sPSSData->itemIconSprites[i].cursorPos == cursorPos)
|
||||
if (gPSSData->itemIconSprites[i].active
|
||||
&& gPSSData->itemIconSprites[i].cursorArea == cursorArea
|
||||
&& gPSSData->itemIconSprites[i].cursorPos == cursorPos)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -412,9 +412,9 @@ static u8 sub_8096258(u8 cursorArea, u8 cursorPos)
|
||||
|
||||
for (i = 0; i < MAX_ITEM_ICONS; i++)
|
||||
{
|
||||
if (sPSSData->itemIconSprites[i].active
|
||||
&& sPSSData->itemIconSprites[i].cursorArea == cursorArea
|
||||
&& sPSSData->itemIconSprites[i].cursorPos == cursorPos)
|
||||
if (gPSSData->itemIconSprites[i].active
|
||||
&& gPSSData->itemIconSprites[i].cursorArea == cursorArea
|
||||
&& gPSSData->itemIconSprites[i].cursorPos == cursorPos)
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -427,8 +427,8 @@ static u8 sub_80962A8(struct Sprite *sprite)
|
||||
|
||||
for (i = 0; i < MAX_ITEM_ICONS; i++)
|
||||
{
|
||||
if (sPSSData->itemIconSprites[i].active
|
||||
&& sPSSData->itemIconSprites[i].sprite == sprite)
|
||||
if (gPSSData->itemIconSprites[i].active
|
||||
&& gPSSData->itemIconSprites[i].sprite == sprite)
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -447,27 +447,27 @@ static void sub_80962F0(u8 id, u8 cursorArea, u8 cursorPos)
|
||||
case CURSOR_AREA_IN_BOX:
|
||||
row = cursorPos % IN_BOX_ROWS;
|
||||
column = cursorPos / IN_BOX_ROWS;
|
||||
sPSSData->itemIconSprites[id].sprite->pos1.x = (24 * row) + 112;
|
||||
sPSSData->itemIconSprites[id].sprite->pos1.y = (24 * column) + 56;
|
||||
sPSSData->itemIconSprites[id].sprite->oam.priority = 2;
|
||||
gPSSData->itemIconSprites[id].sprite->pos1.x = (24 * row) + 112;
|
||||
gPSSData->itemIconSprites[id].sprite->pos1.y = (24 * column) + 56;
|
||||
gPSSData->itemIconSprites[id].sprite->oam.priority = 2;
|
||||
break;
|
||||
case CURSOR_AREA_IN_PARTY:
|
||||
if (cursorPos == 0)
|
||||
{
|
||||
sPSSData->itemIconSprites[id].sprite->pos1.x = 116;
|
||||
sPSSData->itemIconSprites[id].sprite->pos1.y = 76;
|
||||
gPSSData->itemIconSprites[id].sprite->pos1.x = 116;
|
||||
gPSSData->itemIconSprites[id].sprite->pos1.y = 76;
|
||||
}
|
||||
else
|
||||
{
|
||||
sPSSData->itemIconSprites[id].sprite->pos1.x = 164;
|
||||
sPSSData->itemIconSprites[id].sprite->pos1.y = 24 * (cursorPos - 1) + 28;
|
||||
gPSSData->itemIconSprites[id].sprite->pos1.x = 164;
|
||||
gPSSData->itemIconSprites[id].sprite->pos1.y = 24 * (cursorPos - 1) + 28;
|
||||
}
|
||||
sPSSData->itemIconSprites[id].sprite->oam.priority = 1;
|
||||
gPSSData->itemIconSprites[id].sprite->oam.priority = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
sPSSData->itemIconSprites[id].cursorArea = cursorArea;
|
||||
sPSSData->itemIconSprites[id].cursorPos = cursorPos;
|
||||
gPSSData->itemIconSprites[id].cursorArea = cursorArea;
|
||||
gPSSData->itemIconSprites[id].cursorPos = cursorPos;
|
||||
}
|
||||
|
||||
static void sub_8096408(u8 id, const u32 *itemTiles, const u32 *itemPal)
|
||||
@@ -477,14 +477,14 @@ static void sub_8096408(u8 id, const u32 *itemTiles, const u32 *itemPal)
|
||||
if (id >= MAX_ITEM_ICONS)
|
||||
return;
|
||||
|
||||
CpuFastFill(0, sPSSData->field_42C4, 0x200);
|
||||
LZ77UnCompWram(itemTiles, sPSSData->field_22C4);
|
||||
CpuFastFill(0, gPSSData->field_42C4, 0x200);
|
||||
LZ77UnCompWram(itemTiles, gPSSData->field_22C4);
|
||||
for (i = 0; i < 3; i++)
|
||||
CpuFastCopy(sPSSData->field_22C4 + (i * 0x60), sPSSData->field_42C4 + (i * 0x80), 0x60);
|
||||
CpuFastCopy(gPSSData->field_22C4 + (i * 0x60), gPSSData->field_42C4 + (i * 0x80), 0x60);
|
||||
|
||||
CpuFastCopy(sPSSData->field_42C4, sPSSData->itemIconSprites[id].tiles, 0x200);
|
||||
LZ77UnCompWram(itemPal, sPSSData->field_42C4);
|
||||
LoadPalette(sPSSData->field_42C4, sPSSData->itemIconSprites[id].palIndex, 0x20);
|
||||
CpuFastCopy(gPSSData->field_42C4, gPSSData->itemIconSprites[id].tiles, 0x200);
|
||||
LZ77UnCompWram(itemPal, gPSSData->field_42C4);
|
||||
LoadPalette(gPSSData->field_42C4, gPSSData->itemIconSprites[id].palIndex, 0x20);
|
||||
}
|
||||
|
||||
static void sub_80964B8(u8 id, u8 animNum)
|
||||
@@ -492,7 +492,7 @@ static void sub_80964B8(u8 id, u8 animNum)
|
||||
if (id >= MAX_ITEM_ICONS)
|
||||
return;
|
||||
|
||||
StartSpriteAffineAnim(sPSSData->itemIconSprites[id].sprite, animNum);
|
||||
StartSpriteAffineAnim(gPSSData->itemIconSprites[id].sprite, animNum);
|
||||
}
|
||||
|
||||
static void sub_80964E8(u8 id, u8 command, u8 cursorArea, u8 cursorPos)
|
||||
@@ -503,33 +503,33 @@ static void sub_80964E8(u8 id, u8 command, u8 cursorArea, u8 cursorPos)
|
||||
switch (command)
|
||||
{
|
||||
case 0:
|
||||
sPSSData->itemIconSprites[id].sprite->data[0] = id;
|
||||
sPSSData->itemIconSprites[id].sprite->callback = sub_809692C;
|
||||
gPSSData->itemIconSprites[id].sprite->data[0] = id;
|
||||
gPSSData->itemIconSprites[id].sprite->callback = sub_809692C;
|
||||
break;
|
||||
case 1:
|
||||
sPSSData->itemIconSprites[id].sprite->data[0] = 0;
|
||||
sPSSData->itemIconSprites[id].sprite->callback = sub_8096958;
|
||||
gPSSData->itemIconSprites[id].sprite->data[0] = 0;
|
||||
gPSSData->itemIconSprites[id].sprite->callback = sub_8096958;
|
||||
break;
|
||||
case 2:
|
||||
sPSSData->itemIconSprites[id].sprite->data[0] = 0;
|
||||
sPSSData->itemIconSprites[id].sprite->data[6] = cursorArea;
|
||||
sPSSData->itemIconSprites[id].sprite->data[7] = cursorPos;
|
||||
sPSSData->itemIconSprites[id].sprite->callback = sub_80969F4;
|
||||
gPSSData->itemIconSprites[id].sprite->data[0] = 0;
|
||||
gPSSData->itemIconSprites[id].sprite->data[6] = cursorArea;
|
||||
gPSSData->itemIconSprites[id].sprite->data[7] = cursorPos;
|
||||
gPSSData->itemIconSprites[id].sprite->callback = sub_80969F4;
|
||||
break;
|
||||
case 3:
|
||||
sPSSData->itemIconSprites[id].sprite->data[0] = 0;
|
||||
sPSSData->itemIconSprites[id].sprite->callback = sub_8096A74;
|
||||
sPSSData->itemIconSprites[id].sprite->data[6] = cursorArea;
|
||||
sPSSData->itemIconSprites[id].sprite->data[7] = cursorPos;
|
||||
gPSSData->itemIconSprites[id].sprite->data[0] = 0;
|
||||
gPSSData->itemIconSprites[id].sprite->callback = sub_8096A74;
|
||||
gPSSData->itemIconSprites[id].sprite->data[6] = cursorArea;
|
||||
gPSSData->itemIconSprites[id].sprite->data[7] = cursorPos;
|
||||
break;
|
||||
case 4:
|
||||
sPSSData->itemIconSprites[id].sprite->data[0] = 0;
|
||||
sPSSData->itemIconSprites[id].sprite->data[6] = cursorArea;
|
||||
sPSSData->itemIconSprites[id].sprite->data[7] = cursorPos;
|
||||
sPSSData->itemIconSprites[id].sprite->callback = sub_8096B10;
|
||||
gPSSData->itemIconSprites[id].sprite->data[0] = 0;
|
||||
gPSSData->itemIconSprites[id].sprite->data[6] = cursorArea;
|
||||
gPSSData->itemIconSprites[id].sprite->data[7] = cursorPos;
|
||||
gPSSData->itemIconSprites[id].sprite->callback = sub_8096B10;
|
||||
break;
|
||||
case 7:
|
||||
sPSSData->itemIconSprites[id].sprite->callback = sub_8096BAC;
|
||||
gPSSData->itemIconSprites[id].sprite->callback = sub_8096BAC;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -539,8 +539,8 @@ static void sub_8096624(u8 id, bool8 show)
|
||||
if (id >= MAX_ITEM_ICONS)
|
||||
return;
|
||||
|
||||
sPSSData->itemIconSprites[id].active = show;
|
||||
sPSSData->itemIconSprites[id].sprite->invisible = (show == FALSE);
|
||||
gPSSData->itemIconSprites[id].active = show;
|
||||
gPSSData->itemIconSprites[id].sprite->invisible = (show == FALSE);
|
||||
}
|
||||
|
||||
static const u32 *GetItemIconPic(u16 itemId)
|
||||
@@ -558,9 +558,9 @@ void PrintItemDescription(void)
|
||||
const u8 *description;
|
||||
|
||||
if (IsActiveItemMoving())
|
||||
description = ItemId_GetDescription(sPSSData->movingItem);
|
||||
description = ItemId_GetDescription(gPSSData->movingItem);
|
||||
else
|
||||
description = ItemId_GetDescription(sPSSData->cursorMonItem);
|
||||
description = ItemId_GetDescription(gPSSData->cursorMonItem);
|
||||
|
||||
FillWindowPixelBuffer(2, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized5(2, 2, description, 2, 0, 0, NULL, 0, 0);
|
||||
@@ -568,7 +568,7 @@ void PrintItemDescription(void)
|
||||
|
||||
void sub_80966F4(void)
|
||||
{
|
||||
sPSSData->field_2236 = 25;
|
||||
gPSSData->field_2236 = 25;
|
||||
LoadBgTiles(0, gUnknown_83D35DC, 0x80, 0x1A4);
|
||||
sub_8096898(0);
|
||||
}
|
||||
@@ -577,41 +577,41 @@ bool8 sub_8096728(void)
|
||||
{
|
||||
s32 i, var;
|
||||
|
||||
if (sPSSData->field_2236 == 0)
|
||||
if (gPSSData->field_2236 == 0)
|
||||
return FALSE;
|
||||
|
||||
sPSSData->field_2236--;
|
||||
var = 25 - sPSSData->field_2236;
|
||||
gPSSData->field_2236--;
|
||||
var = 25 - gPSSData->field_2236;
|
||||
for (i = 0; i < var; i++)
|
||||
{
|
||||
WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + sPSSData->field_2236 + i, i, 12, 1, 8, 15, 25);
|
||||
WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + gPSSData->field_2236 + i, i, 12, 1, 8, 15, 25);
|
||||
}
|
||||
|
||||
sub_8096898(var);
|
||||
return (sPSSData->field_2236 != 0);
|
||||
return (gPSSData->field_2236 != 0);
|
||||
}
|
||||
|
||||
bool8 sub_80967C0(void)
|
||||
{
|
||||
s32 i, var;
|
||||
|
||||
if (sPSSData->field_2236 == 25)
|
||||
if (gPSSData->field_2236 == 25)
|
||||
return FALSE;
|
||||
|
||||
if (sPSSData->field_2236 == 0)
|
||||
if (gPSSData->field_2236 == 0)
|
||||
FillBgTilemapBufferRect(0, 0, 25, 11, 1, 10, 17);
|
||||
|
||||
sPSSData->field_2236++;
|
||||
var = 25 - sPSSData->field_2236;
|
||||
gPSSData->field_2236++;
|
||||
var = 25 - gPSSData->field_2236;
|
||||
for (i = 0; i < var; i++)
|
||||
{
|
||||
WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + sPSSData->field_2236 + i, i, 12, 1, 8, 15, 25);
|
||||
WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + gPSSData->field_2236 + i, i, 12, 1, 8, 15, 25);
|
||||
}
|
||||
|
||||
sub_8096898(var);
|
||||
|
||||
FillBgTilemapBufferRect(0, 0, var, 11, 1, 10, 0x11);
|
||||
return (sPSSData->field_2236 != 25);
|
||||
return (gPSSData->field_2236 != 25);
|
||||
}
|
||||
|
||||
static void sub_8096898(u32 x)
|
||||
@@ -660,9 +660,9 @@ static void sub_8096958(struct Sprite *sprite)
|
||||
|
||||
static void sub_80969BC(struct Sprite *sprite)
|
||||
{
|
||||
sprite->pos1.x = sPSSData->field_CB4->pos1.x + 4;
|
||||
sprite->pos1.y = sPSSData->field_CB4->pos1.y + sPSSData->field_CB4->pos2.y + 8;
|
||||
sprite->oam.priority = sPSSData->field_CB4->oam.priority;
|
||||
sprite->pos1.x = gPSSData->field_CB4->pos1.x + 4;
|
||||
sprite->pos1.y = gPSSData->field_CB4->pos1.y + gPSSData->field_CB4->pos2.y + 8;
|
||||
sprite->oam.priority = gPSSData->field_CB4->oam.priority;
|
||||
}
|
||||
|
||||
static void sub_80969F4(struct Sprite *sprite)
|
||||
|
||||
@@ -54,7 +54,7 @@ static void sub_8096CDC(struct UnkStruct_2000028 *unkStruct)
|
||||
|
||||
for (i = 0; i < unkStruct->newField; i++)
|
||||
{
|
||||
CpuSet(unkStruct->unk_00, unkStruct->unk_04, (unkStruct->unk_08 / 2));
|
||||
CpuCopy16(unkStruct->unk_00, unkStruct->unk_04, unkStruct->unk_08);
|
||||
unkStruct->unk_04 += 64;
|
||||
unkStruct->unk_00 += (unkStruct->unk_0a * 2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user