mirror of
https://github.com/pret/pokefirered.git
synced 2026-06-02 22:04:27 -05:00
pokemon_storage_system_7
This commit is contained in:
parent
8908b7d47a
commit
be742e6741
File diff suppressed because it is too large
Load Diff
|
|
@ -6,10 +6,6 @@
|
|||
.section .rodata
|
||||
.align 2
|
||||
|
||||
gUnknown_83D35D4:: @ 83D35D4
|
||||
.byte 0, 10, 3, 20, 18, 9
|
||||
.2byte 0x000a
|
||||
|
||||
gUnknown_83D35DC:: @ 83D35DC
|
||||
.incbin "graphics/interface/pss_unk_83D35DC.4bpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -28,5 +28,7 @@ void FreeMonIconPalette(u16 iconId);
|
|||
void SetPartyHPBarSprite(struct Sprite * sprite, u8 animNum);
|
||||
u8 GetMonIconPaletteIndexFromSpecies(u16 species);
|
||||
u16 GetIconSpecies(u16 species, u32 personality);
|
||||
void LoadMonIconPalettesAt(u16 offset);
|
||||
u8 GetValidMonIconPalIndex(u16 species);
|
||||
|
||||
#endif // GUARD_POKEMON_ICON_H
|
||||
|
|
|
|||
|
|
@ -506,5 +506,9 @@ bool8 sub_8095474(u8 action);
|
|||
u8 sub_8095AA0(void);
|
||||
bool8 sub_8095ABC(void);
|
||||
void sub_8095D44(u8 cursorArea, u8 cursorPos);
|
||||
void sub_8094CD4(u8 *arg0, u8 *arg1);
|
||||
void sub_8094D40(void);
|
||||
void sub_8092BAC(bool8 arg0);
|
||||
void DestroyBoxMonIconAtPosition(u8 boxPosition);
|
||||
|
||||
#endif //GUARD_POKEMON_STORAGE_SYSTEM_INTERNAL_H
|
||||
|
|
|
|||
|
|
@ -69,10 +69,10 @@ void ScrollWindow(u8 windowId, u8 direction, u8 distance, u8 fillValue);
|
|||
void CallWindowFunction(u8 windowId, WindowFunc func);
|
||||
bool8 SetWindowAttribute(u8 windowId, u8 attributeId, u32 value);
|
||||
u32 GetWindowAttribute(u8 windowId, u8 attributeId);
|
||||
u16 AddWindow8Bit(struct WindowTemplate *template);
|
||||
u16 AddWindow8Bit(struct WindowTemplate *template);
|
||||
u16 AddWindow8Bit(const struct WindowTemplate *template);
|
||||
void FillWindowPixelBuffer8Bit(u8 windowId, u8 fillValue);
|
||||
void FillWindowPixelRect8Bit(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height);
|
||||
void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteNum);
|
||||
void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteNum);
|
||||
void CopyWindowToVram8Bit(u8 windowId, u8 mode);
|
||||
|
||||
extern void *gWindowBgTilemapBuffers[];
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ SECTIONS {
|
|||
src/pokemon_storage_system_4.o(.text);
|
||||
src/pokemon_storage_system_5.o(.text);
|
||||
src/pokemon_storage_system_6.o(.text);
|
||||
src/pokemon_storage_system_7.o(.text);
|
||||
asm/pokemon_storage_system.o(.text);
|
||||
src/pokemon_icon.o(.text);
|
||||
src/script_movement.o(.text);
|
||||
|
|
@ -459,6 +460,7 @@ SECTIONS {
|
|||
src/pokemon_storage_system_4.o(.rodata);
|
||||
src/pokemon_storage_system_5.o(.rodata);
|
||||
src/pokemon_storage_system_6.o(.rodata);
|
||||
src/pokemon_storage_system_7.o(.rodata);
|
||||
data/pokemon_storage_system.o(.rodata);
|
||||
src/pokemon_icon.o(.rodata);
|
||||
src/fldeff_cut.o(.rodata);
|
||||
|
|
|
|||
582
src/pokemon_storage_system_7.c
Normal file
582
src/pokemon_storage_system_7.c
Normal file
|
|
@ -0,0 +1,582 @@
|
|||
#include <stdlib.h> // to declare abs
|
||||
#include "global.h"
|
||||
#include "gflib.h"
|
||||
#include "pokemon_icon.h"
|
||||
#include "pokemon_storage_system_internal.h"
|
||||
#include "text_window.h"
|
||||
#include "constants/species.h"
|
||||
|
||||
struct MoveMons
|
||||
{
|
||||
u8 field_0;
|
||||
u8 state;
|
||||
u8 fromRow;
|
||||
u8 fromColumn;
|
||||
u8 toRow;
|
||||
u8 toColumn;
|
||||
u8 field_6;
|
||||
u8 field_7;
|
||||
u8 minRow;
|
||||
u8 minColumn;
|
||||
u8 rowsTotal;
|
||||
u8 columsTotal;
|
||||
u16 bgX;
|
||||
u16 bgY;
|
||||
u16 field_10;
|
||||
struct BoxPokemon boxMons[IN_BOX_COUNT];
|
||||
};
|
||||
|
||||
EWRAM_DATA struct MoveMons *sMoveMonsPtr = NULL;
|
||||
|
||||
bool8 sub_8095138(void);
|
||||
bool8 sub_8095234(void);
|
||||
bool8 sub_80952A0(void);
|
||||
bool8 sub_8095314(void);
|
||||
bool8 sub_8095394(void);
|
||||
bool8 sub_80953BC(void);
|
||||
void sub_8095520(void);
|
||||
void sub_80955C4(u8 arg0, u8 arg1, u8 arg2);
|
||||
void sub_80955FC(u8 arg0, u8 arg1, u8 arg2);
|
||||
void sub_8095634(u8 arg0, u8 arg1, u8 arg2);
|
||||
void sub_809566C(u8 arg0, u8 arg1, u8 arg2);
|
||||
void sub_80956A4(u8 x, u8 y);
|
||||
void sub_809572C(u8 x, u8 y);
|
||||
void sub_8095780(u16 bgX, u16 bgY, u16 duration);
|
||||
u8 sub_8095790(void);
|
||||
void sub_80957C8(void);
|
||||
void sub_80958A0(void);
|
||||
void sub_8095918(void);
|
||||
void sub_80959A8(void);
|
||||
void sub_8095A58(void);
|
||||
|
||||
const struct WindowTemplate gUnknown_83D35D4 = {
|
||||
.bg = 0,
|
||||
.tilemapLeft = 10,
|
||||
.tilemapTop = 3,
|
||||
.width = 20,
|
||||
.height = 18,
|
||||
.paletteNum = 9,
|
||||
.baseBlock = 0x00a
|
||||
};
|
||||
|
||||
bool8 sub_8095050(void)
|
||||
{
|
||||
sMoveMonsPtr = Alloc(sizeof(*sMoveMonsPtr));
|
||||
if (sMoveMonsPtr != NULL)
|
||||
{
|
||||
sPSSData->field_2200 = AddWindow8Bit(&gUnknown_83D35D4);
|
||||
if (sPSSData->field_2200 != 0xFF)
|
||||
{
|
||||
FillWindowPixelBuffer(sPSSData->field_2200, PIXEL_FILL(0));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_80950A4(void)
|
||||
{
|
||||
if (sMoveMonsPtr != NULL)
|
||||
Free(sMoveMonsPtr);
|
||||
}
|
||||
|
||||
void sub_80950BC(u8 arg0)
|
||||
{
|
||||
sMoveMonsPtr->field_0 = arg0;
|
||||
sMoveMonsPtr->state = 0;
|
||||
}
|
||||
|
||||
bool8 sub_80950D0(void)
|
||||
{
|
||||
switch (sMoveMonsPtr->field_0)
|
||||
{
|
||||
case 0:
|
||||
return sub_8095138();
|
||||
case 1:
|
||||
return sub_8095234();
|
||||
case 2:
|
||||
return sub_80952A0();
|
||||
case 3:
|
||||
return sub_8095314();
|
||||
case 4:
|
||||
return sub_8095394();
|
||||
case 5:
|
||||
return sub_80953BC();
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_8095138(void)
|
||||
{
|
||||
switch (sMoveMonsPtr->state)
|
||||
{
|
||||
case 0:
|
||||
HideBg(0);
|
||||
LoadMonIconPalettesAt(0x80);
|
||||
sMoveMonsPtr->state++;
|
||||
break;
|
||||
case 1:
|
||||
sub_8094CD4(&sMoveMonsPtr->fromRow, &sMoveMonsPtr->fromColumn);
|
||||
sMoveMonsPtr->toRow = sMoveMonsPtr->fromRow;
|
||||
sMoveMonsPtr->toColumn = sMoveMonsPtr->fromColumn;
|
||||
ChangeBgX(0, -1024, 0);
|
||||
ChangeBgY(0, -1024, 0);
|
||||
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20);
|
||||
FillWindowPixelBuffer8Bit(sPSSData->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);
|
||||
BlendPalettes(0x3F00, 8, RGB_WHITE);
|
||||
sub_8094D14(2);
|
||||
SetGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR);
|
||||
sMoveMonsPtr->state++;
|
||||
break;
|
||||
case 2:
|
||||
if (!IsDma3ManagerBusyWithBgCopy())
|
||||
{
|
||||
ShowBg(0);
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_8095234(void)
|
||||
{
|
||||
switch (sMoveMonsPtr->state)
|
||||
{
|
||||
case 0:
|
||||
HideBg(0);
|
||||
sMoveMonsPtr->state++;
|
||||
break;
|
||||
case 1:
|
||||
sub_8095A58();
|
||||
sub_8094D14(0);
|
||||
sMoveMonsPtr->state++;
|
||||
break;
|
||||
case 2:
|
||||
if (!IsDma3ManagerBusyWithBgCopy())
|
||||
{
|
||||
sub_8094D40();
|
||||
LoadPalette(stdpal_get(3), 0xD0, 0x20);
|
||||
ShowBg(0);
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_80952A0(void)
|
||||
{
|
||||
switch (sMoveMonsPtr->state)
|
||||
{
|
||||
case 0:
|
||||
if (!sub_80924A8())
|
||||
{
|
||||
sub_8094CD4(&sMoveMonsPtr->field_6, &sMoveMonsPtr->field_7);
|
||||
sub_8095520();
|
||||
sMoveMonsPtr->toRow = sMoveMonsPtr->field_6;
|
||||
sMoveMonsPtr->toColumn = sMoveMonsPtr->field_7;
|
||||
CopyWindowToVram8Bit(sPSSData->field_2200, 2);
|
||||
sMoveMonsPtr->state++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
return IsDma3ManagerBusyWithBgCopy();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_8095314(void)
|
||||
{
|
||||
u8 var1, var2;
|
||||
|
||||
switch (sMoveMonsPtr->state)
|
||||
{
|
||||
case 0:
|
||||
sub_80957C8();
|
||||
sub_80958A0();
|
||||
sub_8092BAC(FALSE);
|
||||
sMoveMonsPtr->state++;
|
||||
break;
|
||||
case 1:
|
||||
if (!DoMonPlaceChange())
|
||||
{
|
||||
sub_8094D14(3);
|
||||
sub_8095780(0, 256, 8);
|
||||
sub_8092BAC(TRUE);
|
||||
sMoveMonsPtr->state++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
var1 = sub_8095790();
|
||||
var2 = DoMonPlaceChange();
|
||||
if (!var1 && !var2)
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_8095394(void)
|
||||
{
|
||||
u8 var1 = sub_80924A8();
|
||||
u8 var2 = sub_8095790();
|
||||
|
||||
if (!var1 && !var2)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_80953BC(void)
|
||||
{
|
||||
switch (sMoveMonsPtr->state)
|
||||
{
|
||||
case 0:
|
||||
sub_80959A8();
|
||||
sub_8095780(0, -256, 8);
|
||||
sub_8092BAC(FALSE);
|
||||
sMoveMonsPtr->state++;
|
||||
break;
|
||||
case 1:
|
||||
if (!DoMonPlaceChange() && !sub_8095790())
|
||||
{
|
||||
sub_8095918();
|
||||
sub_8094D14(2);
|
||||
sub_8092BAC(TRUE);
|
||||
HideBg(0);
|
||||
sMoveMonsPtr->state++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (!DoMonPlaceChange())
|
||||
{
|
||||
sub_8094D14(0);
|
||||
sub_8095A58();
|
||||
sMoveMonsPtr->state++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (!IsDma3ManagerBusyWithBgCopy())
|
||||
{
|
||||
LoadPalette(stdpal_get(3), 0xD0, 0x20);
|
||||
sub_8094D40();
|
||||
ShowBg(0);
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_8095474(u8 arg0)
|
||||
{
|
||||
switch (arg0)
|
||||
{
|
||||
case 0: // up
|
||||
if (sMoveMonsPtr->minColumn == 0)
|
||||
return FALSE;
|
||||
sMoveMonsPtr->minColumn--;
|
||||
sub_8095780(0, 1024, 6);
|
||||
break;
|
||||
case 1: // down
|
||||
if (sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal >= 5)
|
||||
return FALSE;
|
||||
sMoveMonsPtr->minColumn++;
|
||||
sub_8095780(0, -1024, 6);
|
||||
break;
|
||||
case 2: // left
|
||||
if (sMoveMonsPtr->minRow == 0)
|
||||
return FALSE;
|
||||
sMoveMonsPtr->minRow--;
|
||||
sub_8095780(1024, 0, 6);
|
||||
break;
|
||||
case 3: // right
|
||||
if (sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal > 5)
|
||||
return FALSE;
|
||||
sMoveMonsPtr->minRow++;
|
||||
sub_8095780(-1024, 0, 6);
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void sub_8095520(void)
|
||||
{
|
||||
s16 var = (abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->field_6)) - (abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->toRow));
|
||||
s16 var2 = (abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->field_7)) - (abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->toColumn));
|
||||
|
||||
if (var > 0)
|
||||
sub_80955C4(sMoveMonsPtr->field_6, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn);
|
||||
|
||||
if (var < 0)
|
||||
{
|
||||
sub_8095634(sMoveMonsPtr->toRow, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn);
|
||||
sub_80955C4(sMoveMonsPtr->field_6, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn);
|
||||
}
|
||||
|
||||
if (var2 > 0)
|
||||
sub_80955FC(sMoveMonsPtr->field_7, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow);
|
||||
|
||||
if (var2 < 0)
|
||||
{
|
||||
sub_809566C(sMoveMonsPtr->toColumn, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow);
|
||||
sub_80955FC(sMoveMonsPtr->field_7, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80955C4(u8 arg0, u8 arg1, u8 arg2)
|
||||
{
|
||||
u8 var1 = arg1;
|
||||
|
||||
if (arg1 > arg2)
|
||||
{
|
||||
arg1 = arg2;
|
||||
arg2 = var1;
|
||||
}
|
||||
|
||||
while (arg1 <= arg2)
|
||||
sub_80956A4(arg0, arg1++);
|
||||
}
|
||||
|
||||
void sub_80955FC(u8 arg0, u8 arg1, u8 arg2)
|
||||
{
|
||||
u8 var1 = arg1;
|
||||
|
||||
if (arg1 > arg2)
|
||||
{
|
||||
arg1 = arg2;
|
||||
arg2 = var1;
|
||||
}
|
||||
|
||||
while (arg1 <= arg2)
|
||||
sub_80956A4(arg1++, arg0);
|
||||
}
|
||||
|
||||
void sub_8095634(u8 arg0, u8 arg1, u8 arg2)
|
||||
{
|
||||
u8 var1 = arg1;
|
||||
|
||||
if (arg1 > arg2)
|
||||
{
|
||||
arg1 = arg2;
|
||||
arg2 = var1;
|
||||
}
|
||||
|
||||
while (arg1 <= arg2)
|
||||
sub_809572C(arg0, arg1++);
|
||||
}
|
||||
|
||||
void sub_809566C(u8 arg0, u8 arg1, u8 arg2)
|
||||
{
|
||||
u8 var1 = arg1;
|
||||
|
||||
if (arg1 > arg2)
|
||||
{
|
||||
arg1 = arg2;
|
||||
arg2 = var1;
|
||||
}
|
||||
|
||||
while (arg1 <= arg2)
|
||||
sub_809572C(arg1++, arg0);
|
||||
}
|
||||
|
||||
void sub_80956A4(u8 x, u8 y)
|
||||
{
|
||||
u8 position = x + (IN_BOX_ROWS * y);
|
||||
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2);
|
||||
u32 personality = GetCurrentBoxMonData(position, MON_DATA_PERSONALITY);
|
||||
|
||||
if (species != SPECIES_NONE)
|
||||
{
|
||||
const u8 *iconGfx = GetMonIconPtr(species, personality, 1);
|
||||
u8 index = GetValidMonIconPalIndex(species) + 8;
|
||||
|
||||
BlitBitmapRectToWindow4BitTo8Bit(sPSSData->field_2200,
|
||||
iconGfx,
|
||||
0,
|
||||
0,
|
||||
32,
|
||||
32,
|
||||
24 * x,
|
||||
24 * y,
|
||||
32,
|
||||
32,
|
||||
index);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_809572C(u8 x, u8 y)
|
||||
{
|
||||
u8 position = x + (IN_BOX_ROWS * y);
|
||||
u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2);
|
||||
|
||||
if (species != SPECIES_NONE)
|
||||
{
|
||||
FillWindowPixelRect8Bit(sPSSData->field_2200,
|
||||
PIXEL_FILL(0),
|
||||
24 * x,
|
||||
24 * y,
|
||||
32,
|
||||
32);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8095780(u16 bgX, u16 bgY, u16 duration)
|
||||
{
|
||||
sMoveMonsPtr->bgX = bgX;
|
||||
sMoveMonsPtr->bgY = bgY;
|
||||
sMoveMonsPtr->field_10 = duration;
|
||||
}
|
||||
|
||||
u8 sub_8095790(void)
|
||||
{
|
||||
if (sMoveMonsPtr->field_10 != 0)
|
||||
{
|
||||
ChangeBgX(0, sMoveMonsPtr->bgX, 1);
|
||||
ChangeBgY(0, sMoveMonsPtr->bgY, 1);
|
||||
sMoveMonsPtr->field_10--;
|
||||
}
|
||||
|
||||
return sMoveMonsPtr->field_10;
|
||||
}
|
||||
|
||||
void sub_80957C8(void)
|
||||
{
|
||||
s32 i, j;
|
||||
s32 rowCount, columnCount;
|
||||
u8 boxId;
|
||||
u8 monArrayId;
|
||||
|
||||
sMoveMonsPtr->minRow = min(sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow);
|
||||
sMoveMonsPtr->minColumn = min(sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn);
|
||||
sMoveMonsPtr->rowsTotal = abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->toRow) + 1;
|
||||
sMoveMonsPtr->columsTotal = abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->toColumn) + 1;
|
||||
boxId = StorageGetCurrentBox();
|
||||
monArrayId = 0;
|
||||
rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal;
|
||||
columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal;
|
||||
for (i = sMoveMonsPtr->minColumn; i < columnCount; i++)
|
||||
{
|
||||
u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow;
|
||||
for (j = sMoveMonsPtr->minRow; j < rowCount; j++)
|
||||
{
|
||||
struct BoxPokemon *boxMon = GetBoxedMonPtr(boxId, boxPosition);
|
||||
|
||||
sMoveMonsPtr->boxMons[monArrayId] = *boxMon;
|
||||
monArrayId++;
|
||||
boxPosition++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80958A0(void)
|
||||
{
|
||||
s32 i, j;
|
||||
s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal;
|
||||
s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal;
|
||||
u8 boxId = StorageGetCurrentBox();
|
||||
|
||||
for (i = sMoveMonsPtr->minColumn; i < columnCount; i++)
|
||||
{
|
||||
u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow;
|
||||
for (j = sMoveMonsPtr->minRow; j < rowCount; j++)
|
||||
{
|
||||
DestroyBoxMonIconAtPosition(boxPosition);
|
||||
ZeroBoxMonAt(boxId, boxPosition);
|
||||
boxPosition++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8095918(void)
|
||||
{
|
||||
s32 i, j;
|
||||
s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal;
|
||||
s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal;
|
||||
u8 monArrayId = 0;
|
||||
|
||||
for (i = sMoveMonsPtr->minColumn; i < columnCount; i++)
|
||||
{
|
||||
u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow;
|
||||
for (j = sMoveMonsPtr->minRow; j < rowCount; j++)
|
||||
{
|
||||
if (GetBoxMonData(&sMoveMonsPtr->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES))
|
||||
sub_80901EC(boxPosition);
|
||||
monArrayId++;
|
||||
boxPosition++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80959A8(void)
|
||||
{
|
||||
s32 i, j;
|
||||
s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal;
|
||||
s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal;
|
||||
u8 boxId = StorageGetCurrentBox();
|
||||
u8 monArrayId = 0;
|
||||
|
||||
for (i = sMoveMonsPtr->minColumn; i < columnCount; i++)
|
||||
{
|
||||
u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow;
|
||||
for (j = sMoveMonsPtr->minRow; j < rowCount; j++)
|
||||
{
|
||||
if (GetBoxMonData(&sMoveMonsPtr->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES))
|
||||
SetBoxMonAt(boxId, boxPosition, &sMoveMonsPtr->boxMons[monArrayId]);
|
||||
boxPosition++;
|
||||
monArrayId++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8095A58(void)
|
||||
{
|
||||
ChangeBgX(0, 0, 0);
|
||||
ChangeBgY(0, 0, 0);
|
||||
SetBgAttribute(0, BG_ATTR_PALETTEMODE, 0);
|
||||
ClearGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR);
|
||||
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
}
|
||||
|
||||
u8 sub_8095AA0(void)
|
||||
{
|
||||
return (IN_BOX_ROWS * sMoveMonsPtr->fromColumn) + sMoveMonsPtr->fromRow;
|
||||
}
|
||||
|
||||
bool8 sub_8095ABC(void)
|
||||
{
|
||||
s32 i, j;
|
||||
s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal;
|
||||
s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal;
|
||||
u8 monArrayId = 0;
|
||||
|
||||
for (i = sMoveMonsPtr->minColumn; i < columnCount; i++)
|
||||
{
|
||||
u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow;
|
||||
for (j = sMoveMonsPtr->minRow; j < rowCount; j++)
|
||||
{
|
||||
if (GetBoxMonData(&sMoveMonsPtr->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES)
|
||||
&& GetCurrentBoxMonData(boxPosition, MON_DATA_SANITY_HAS_SPECIES))
|
||||
return FALSE;
|
||||
|
||||
monArrayId++;
|
||||
boxPosition++;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ static void nullsub_9(void)
|
|||
{
|
||||
}
|
||||
|
||||
u16 AddWindow8Bit(struct WindowTemplate *template)
|
||||
u16 AddWindow8Bit(const struct WindowTemplate *template)
|
||||
{
|
||||
u16 windowId;
|
||||
u8* memAddress;
|
||||
|
|
@ -81,7 +81,7 @@ void FillWindowPixelRect8Bit(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width,
|
|||
FillBitmapRect8Bit(&pixelRect, x, y, width, height, fillValue);
|
||||
}
|
||||
|
||||
void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteNum)
|
||||
void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteNum)
|
||||
{
|
||||
struct Bitmap sourceRect;
|
||||
struct Bitmap destRect;
|
||||
|
|
|
|||
|
|
@ -162,11 +162,10 @@ gUnknown_20386A8: @ 20386A8
|
|||
.include "src/pokemon_storage_system_3.o"
|
||||
.align 2
|
||||
.include "src/pokemon_storage_system_5.o"
|
||||
.align 2
|
||||
.include "src/pokemon_storage_system_7.o"
|
||||
|
||||
.align 2
|
||||
gUnknown_2039828: @ 2039828
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203982C: @ 203982C
|
||||
.space 0x4
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user