Merge branch 'master' into weather

This commit is contained in:
DizzyEggg 2018-12-08 22:10:20 +01:00
commit b94ae8bb92
12 changed files with 1694 additions and 3860 deletions

2397
asm/fire.s

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@
#include "battle.h"
#include "constants/battle_anim.h"
#include "task.h"
enum
{
@ -124,6 +125,11 @@ void sub_80A6D60(struct UnknownAnimStruct2*, const void*, u32);
void sub_80A6CC0(u32, const void*, u32);
void sub_80A6DAC(bool8);
void sub_80A634C(struct Sprite *);
void sub_80A653C(struct Sprite *);
void sub_80A7E6C(u8 spriteId);
void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7);
u8 sub_80A80C8(struct Task *task);
void sub_80A8EE4(struct Sprite *);
enum
{

34
include/roulette.h Executable file
View File

@ -0,0 +1,34 @@
#ifndef GUARD_ROULETTE_H
#define GUARD_ROULETTE_H
struct UnkStruct1
{
u16 var00;
u16 var02;
u8 var04;
u8 var05;
u8 var06;
s8 var07_0:5;
s8 var07_5:2;
s8 var07_7:1;
};
struct UnkStruct3
{
u8 var00_0:7;
u8 var00_7:1;
u8 var01;
s8 var02;
s8 var03;
struct UnkStruct1 var04;
};
struct UnkStruct0
{
u8 var00;
u8 var01;
u16 var02; //flag for each UnkStruct3
struct UnkStruct3 var04[0x10];
};
#endif // GUARD_ROULETTE_H

View File

@ -1,17 +1,46 @@
#ifndef GUARD_ROULETTE_UTIL_H
#define GUARD_ROULETTE_UTIL_H
struct InnerStruct203CF18_3
{
u16 unk0;
u16 unk2;
u8 unk4;
u8 unk5;
u8 unk6;
s8 unk7_0:4;
s8 unk7_4:2;
s8 unk7_6:1;
s8 unk7_7:1;
};
struct InnerStruct203CF18_2
{
u8 unk0;
u8 unk1_0:4;
u8 unk1_4:1;
s8 unk1_5:1;
s8 unk1_6:1;
u32 unk1_7:1;
u8 unk2;
u8 unk3;
struct InnerStruct203CF18_3 unk4;
};
// structures
struct InnerStruct203CF18
{
u8 filler[0xC4];
u16 unk0;
struct InnerStruct203CF18_2 unk4[16];
};
void sub_8151B68(struct InnerStruct203CF18 *, const u8*);
int sub_8151B68(struct InnerStruct203CF18 *, const struct InnerStruct203CF18_3 *);
void sub_8151B3C(struct InnerStruct203CF18 *);
void sub_8151CA8(struct InnerStruct203CF18 *, u8, u8);
void sub_8151C50(struct InnerStruct203CF18 *, u8, u8);
void sub_8151D28(struct InnerStruct203CF18 *, u8, u8);
void sub_8151CA8(struct InnerStruct203CF18 *, u16, u8);
void sub_8151C50(struct InnerStruct203CF18 *, u16, u8);
void sub_8151D28(struct InnerStruct203CF18 *, u16, u8);
void sub_8151E50(struct InnerStruct203CF18 *);
void sub_8152008(u16 *dest, u16 src, u8 left, u8 top, u8 width, u8 height);
void sub_8152058(u16 *dest, u16 *src, u8 left, u8 top, u8 width, u8 height);
#endif // GUARD_ROULETTE_UTIL_H

View File

@ -1034,7 +1034,7 @@ extern const u8 gText_DexSortAtoZDescription[];
extern const u8 gText_DexSortHeaviestDescription[];
extern const u8 gText_DexSortLightestDescription[];
extern const u8 gText_DexSortTallestDescription[];
extern const u8 ggText_DexSortSmallestDescription[];
extern const u8 gText_DexSortSmallestDescription[];
extern const u8 gText_DexEmptyString[];
extern const u8 gText_DexSearchDontSpecify[];
extern const u8 gText_DexSearchTypeNone[];

View File

@ -161,7 +161,7 @@ SECTIONS {
asm/battle_anim_effects_1.o(.text);
asm/battle_anim_effects_2.o(.text);
asm/water.o(.text);
asm/fire.o(.text);
src/fire.o(.text);
asm/electric.o(.text);
asm/ice.o(.text);
src/fight.o(.text);
@ -217,7 +217,7 @@ SECTIONS {
src/battle_message.o(.text);
asm/cable_car.o(.text);
src/math_util.o(.text);
asm/roulette_util.o(.text);
src/roulette_util.o(.text);
src/rom_81520A8.o(.text);
src/save.o(.text);
src/mystery_event_script.o(.text);

View File

@ -1,24 +1,43 @@
#include "global.h"
#include "battle_anim.h"
#include "constants/rgb.h"
#include "constants/songs.h"
#include "sound.h"
#include "util.h"
#include "task.h"
#include "trig.h"
extern void sub_8108EC8(struct Sprite *);
extern void sub_8108F08(struct Sprite *);
extern void sub_8108FBC(struct Sprite *);
extern void sub_8108F4C(struct Sprite *);
extern void sub_8109064(struct Sprite *);
extern void sub_810916C(struct Sprite *);
extern void TranslateAnimSpriteToTargetMonLocation(struct Sprite *);
extern void sub_8109198(struct Sprite *);
extern void sub_8109200(struct Sprite *);
extern void sub_810921C(struct Sprite *);
extern void sub_8109364(struct Sprite *);
extern void sub_81093A4(struct Sprite *);
extern void sub_80A8EE4(struct Sprite *);
extern void sub_81098EC(struct Sprite *);
extern void sub_8109A10(struct Sprite *);
extern void sub_8109AFC(struct Sprite *);
extern void sub_8109CB0(struct Sprite *);
static void sub_8108EC8(struct Sprite *);
static void sub_8108F08(struct Sprite *);
static void sub_8108F4C(struct Sprite *);
static void sub_8108FBC(struct Sprite *);
static void sub_8109028(struct Sprite *);
static void sub_8109064(struct Sprite *);
static void sub_81090D8(struct Sprite *);
static void sub_810916C(struct Sprite *);
static void AnimEmberFlare(struct Sprite *);
static void sub_8109200(struct Sprite *);
static void AnimFireRing(struct Sprite *);
static void AnimFireRingStep1(struct Sprite *);
static void AnimFireRingStep2(struct Sprite *);
static void AnimFireRingStep3(struct Sprite *);
static void UpdateFireRingCircleOffset(struct Sprite *);
static void AnimFireCross(struct Sprite *);
static void sub_81093A4(struct Sprite *);
static void sub_81093E4(struct Sprite *);
static void sub_810940C(struct Sprite *);
static void sub_81094D0(u8 taskId);
static void sub_81097B4(u8 spriteId, u8 taskId, u8 a3);
static void sub_81098EC(struct Sprite *);
static u16 sub_8109930(u8 spriteId);
static void sub_8109984(struct Sprite *sprite, s16 x, s16 y);
static void sub_81099A0(struct Sprite *);
static void sub_8109A10(struct Sprite *);
static void sub_8109A64(struct Sprite *);
static void sub_8109AFC(struct Sprite *);
static void sub_8109C4C(struct Sprite *);
static void sub_8109CB0(struct Sprite *);
static void sub_8109E2C(u8 taskId);
const union AnimCmd gUnknown_08595340[] =
{
@ -234,7 +253,7 @@ const struct SpriteTemplate gEmberFlareSpriteTemplate =
.anims = gUnknown_085954D0,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_8109198,
.callback = AnimEmberFlare,
};
const struct SpriteTemplate gUnknown_08595504 =
@ -256,7 +275,7 @@ const struct SpriteTemplate gUnknown_0859551C =
.anims = gUnknown_085954D0,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810921C,
.callback = AnimFireRing,
};
const union AnimCmd gUnknown_08595534[] =
@ -297,7 +316,7 @@ const struct SpriteTemplate gUnknown_0859556C =
.anims = gUnknown_08595540,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_8109364,
.callback = AnimFireCross,
};
const struct SpriteTemplate gBattleAnimSpriteTemplate_8595584 =
@ -436,3 +455,867 @@ const s8 gUnknown_08595694[16] =
{
-1, 0, 1, 0, -1, 1, 0, -1, 0, 1, 0, -1, 0, 1, 0, 1,
};
static void sub_8108EC8(struct Sprite *sprite)
{
sprite->data[0] = gBattleAnimArgs[0];
sprite->data[1] = 0x3C;
sprite->data[2] = 0x9;
sprite->data[3] = 0x1E;
sprite->data[4] = 0xFE00;
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
sprite->callback = sub_80A634C;
sprite->callback(sprite);
}
static void sub_8108F08(struct Sprite *sprite)
{
sub_80A6864(sprite, gBattleAnimArgs[0]);
sprite->pos1.y += gBattleAnimArgs[1];
sprite->data[0] = gBattleAnimArgs[4];
sprite->data[1] = gBattleAnimArgs[2];
sprite->data[2] = gBattleAnimArgs[3];
sprite->callback = sub_80A656C;
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
}
static void sub_8108F4C(struct Sprite *sprite)
{
sub_80A6838(sprite);
if (GetBattlerSide(gBattleAnimAttacker))
{
sprite->pos1.x -= gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1];
sprite->data[2] = -gBattleAnimArgs[4];
}
else
{
sprite->pos1.x += gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1];
sprite->data[2] = gBattleAnimArgs[4];
}
sprite->data[1] = gBattleAnimArgs[2];
sprite->data[4] = gBattleAnimArgs[3];
sprite->data[3] = gBattleAnimArgs[5];
sprite->callback = sub_8109028;
}
static void sub_8108FBC(struct Sprite *sprite)
{
if (GetBattlerSide(gBattleAnimAttacker))
{
sprite->pos1.x -= gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1];
sprite->data[2] = gBattleAnimArgs[4];
}
else
{
sprite->pos1.x += gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1];
sprite->data[2] = -gBattleAnimArgs[4];
}
sprite->data[1] = gBattleAnimArgs[2];
sprite->data[4] = gBattleAnimArgs[3];
sprite->data[3] = gBattleAnimArgs[5];
sprite->callback = sub_8109028;
}
static void sub_8109028(struct Sprite *sprite)
{
if (++sprite->data[0] < sprite->data[4])
{
sprite->pos2.x += sprite->data[2];
sprite->pos2.y += sprite->data[3];
}
if (sprite->data[0] == sprite->data[1])
move_anim_8074EE0(sprite);
}
static void sub_8109064(struct Sprite *sprite)
{
sub_80A6838(sprite);
if (GetBattlerSide(gBattleAnimAttacker))
{
sprite->pos1.x -= gBattleAnimArgs[0];
}
else
{
sprite->pos1.x += gBattleAnimArgs[0];
sprite->subpriority = 8;
}
sprite->pos1.y += gBattleAnimArgs[1];
sprite->data[0] = gBattleAnimArgs[2];
sprite->data[1] = gBattleAnimArgs[3];
sprite->data[2] = gBattleAnimArgs[4];
sprite->data[3] = gBattleAnimArgs[5];
sprite->data[4] = gBattleAnimArgs[6];
sprite->data[5] = 0;
sprite->callback = sub_81090D8;
}
static void sub_81090D8(struct Sprite *sprite)
{
if (sprite->data[3])
{
if(sprite->data[5] > 10000)
sprite->subpriority = 1;
sprite->pos2.x = Sin(sprite->data[0], sprite->data[1] + (sprite->data[5] >> 8));
sprite->pos2.y = Cos(sprite->data[0], sprite->data[1] + (sprite->data[5] >> 8));
sprite->data[0] += sprite->data[2];
sprite->data[5] += sprite->data[4];
if (sprite->data[0] > 255)
sprite->data[0] -= 256;
else if (sprite->data[0] < 0)
sprite->data[0] += 256;
sprite->data[3]--;
}
else
{
move_anim_8074EE0(sprite);
}
}
//sunlight
static void sub_810916C(struct Sprite *sprite)
{
sprite->pos1.x = 0;
sprite->pos1.y = 0;
sprite->data[0] = 60;
sprite->data[2] = 140;
sprite->data[4] = 80;
sprite->callback = StartAnimLinearTranslation;
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
}
//fire 2
// Animates the secondary effect of MOVE_EMBER, where the flames grow and slide
// horizontally a bit.
// arg 0: initial x pixel offset
// arg 1: initial y pixel offset
// arg 2: target x pixel offset
// arg 3: target y pixel offset
// arg 4: duration
// arg 5: ? (todo: something related to which mon the pixel offsets are based on)
// arg 6: ? (todo: something related to which mon the pixel offsets are based on)
static void AnimEmberFlare(struct Sprite *sprite)
{
if (GetBattlerSide(gBattleAnimAttacker) == GetBattlerSide(gBattleAnimTarget)
&& (gBattleAnimAttacker == GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT)
|| gBattleAnimAttacker == GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT)))
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
sprite->callback = sub_80A7938;
sprite->callback(sprite);
}
static void sub_8109200(struct Sprite *sprite)
{
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
sprite->callback = sub_80A7938;
}
// Animates the a fire sprite in the first-half of the MOVE_FIRE_BLAST
// animation. The fire sprite first moves in a circle around the mon,
// and then it is translated towards the target mon, while still rotating.
// Lastly, it moves in a circle around the target mon.
// arg 0: initial x pixel offset
// arg 1: initial y pixel offset
// arg 2: initial wave offset
//void AnimFireRing(struct Sprite *sprite)
void AnimFireRing(struct Sprite *sprite)
{
InitAnimSpritePos(sprite, 1);
sprite->data[7] = gBattleAnimArgs[2];
sprite->data[0] = 0;
sprite->callback = AnimFireRingStep1;
}
static void AnimFireRingStep1(struct Sprite *sprite)
{
UpdateFireRingCircleOffset(sprite);
if (++sprite->data[0] == 0x12)
{
sprite->data[0] = 0x19;
sprite->data[1] = sprite->pos1.x;
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
sprite->data[3] = sprite->pos1.y;
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
InitAnimLinearTranslation(sprite);
sprite->callback = AnimFireRingStep2;
}
}
static void AnimFireRingStep2(struct Sprite *sprite)
{
if (TranslateAnimLinear(sprite))
{
sprite->data[0] = 0;
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
sprite->pos2.y = 0;
sprite->pos2.x = 0;
sprite->callback = AnimFireRingStep3;
sprite->callback(sprite);
}
else
{
sprite->pos2.x += Sin(sprite->data[7], 28);
sprite->pos2.y += Cos(sprite->data[7], 28);
sprite->data[7] = (sprite->data[7] + 20) & 0xFF;
}
}
static void AnimFireRingStep3(struct Sprite *sprite)
{
UpdateFireRingCircleOffset(sprite);
if (++sprite->data[0] == 0x1F)
DestroyAnimSprite(sprite);
}
static void UpdateFireRingCircleOffset(struct Sprite *sprite)
{
sprite->pos2.x = Sin(sprite->data[7], 28);
sprite->pos2.y = Cos(sprite->data[7], 28);
sprite->data[7] = (sprite->data[7] + 20) & 0xFF;
}
// arg 0: initial x pixel offset
// arg 1: initial y pixel offset
// arg 2: duration
// arg 3: x delta
// arg 4: y delta
// AnimFireCross(struct Sprite *sprite)
static void AnimFireCross(struct Sprite *sprite)
{
sprite->pos1.x += gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1];
sprite->data[0] = gBattleAnimArgs[2];
sprite->data[1] = gBattleAnimArgs[3];
sprite->data[2] = gBattleAnimArgs[4];
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
sprite->callback = sub_80A653C; //TranslateSpriteOverDuration
}
static void sub_81093A4(struct Sprite *sprite)
{
InitAnimSpritePos(sprite, 1);
sprite->data[1] = gBattleAnimArgs[2];
sprite->data[0] = gBattleAnimArgs[3];
sprite->invisible = TRUE;
sprite->callback = WaitAnimForDuration;
StoreSpriteCallbackInData6(sprite, sub_81093E4);
}
static void sub_81093E4(struct Sprite *sprite)
{
sprite->invisible = FALSE;
sprite->data[0] = sprite->data[1];
sprite->data[1] = 0;
sprite->callback = sub_810940C;
sprite->callback(sprite);
}
static void sub_810940C(struct Sprite *sprite)
{
sprite->pos2.x = Sin(sprite->data[1], sprite->data[2] >> 8);
sprite->pos2.y = Cos(sprite->data[1], sprite->data[2] >> 8);
sprite->data[1] = (sprite->data[1] + 10) & 0xFF;
sprite->data[2] += 0xD0;
if (--sprite->data[0] == -1)
DestroyAnimSprite(sprite);
}
void sub_8109460(u8 taskId) // initialize animation task for Move_ERUPTION?
{
struct Task *task = &gTasks[taskId];
task->data[15] = GetAnimBattlerSpriteId(0);
task->data[0] = 0;
task->data[1] = 0;
task->data[2] = 0;
task->data[3] = 0;
task->data[4] = gSprites[task->data[15]].pos1.y;
task->data[5] = GetBattlerSide(gBattleAnimAttacker);
task->data[6] = 0;
sub_80A7270(task->data[15], 0);
task->func = sub_81094D0;
}
static void sub_81094D0(u8 taskId) // animate Move_ERUPTION?
{
struct Task *task = &gTasks[taskId];
switch (task->data[0])
{
case 0:
sub_80A805C(task, task->data[15], 0x100, 0x100, 0xE0, 0x200, 0x20);
task->data[0]++;
case 1:
if (++task->data[1] > 1)
{
task->data[1] = 0;
if (++task->data[2] & 0x1)
gSprites[task->data[15]].pos2.x = 3;
else
gSprites[task->data[15]].pos2.x = -3;
}
if (task->data[5])
{
if (++task->data[3] > 4)
{
task->data[3] = 0;
gSprites[task->data[15]].pos1.y++;
}
}
if(!sub_80A80C8(task))
{
sub_80A7E6C(task->data[15]);
gSprites[task->data[15]].pos2.x = 0;
task->data[1] = 0;
task->data[2] = 0;
task->data[3] = 0;
task->data[0]++;
}
break;
case 2:
if (++task->data[1] > 4)
{
if (task->data[5])
sub_80A805C(task, task->data[15], 0xE0, 0x200, 0x180, 0xF0, 0x6);
else
sub_80A805C(task, task->data[15], 0xE0, 0x200, 0x180, 0xC0, 0x6);
task->data[1] = 0;
task->data[0]++;
}
break;
case 3:
if (!sub_80A80C8(task))
{
sub_81097B4(task->data[15], taskId, 6);
task->data[0]++;
}
break;
case 4:
if (++task->data[1] > 1)
{
task->data[1] = 0;
if (++task->data[2] & 1)
gSprites[task->data[15]].pos2.y += 3;
else
gSprites[task->data[15]].pos2.y -= 3;
}
if (++task->data[3] > 0x18)
{
if (task->data[5])
sub_80A805C(task, task->data[15], 0x180, 0xF0, 0x100, 0x100, 0x8);
else
sub_80A805C(task, task->data[15], 0x180, 0xC0, 0x100, 0x100, 0x8);
if (task->data[2] & 1)
gSprites[task->data[15]].pos2.y -= 3;
task->data[1] = 0;
task->data[2] = 0;
task->data[3] = 0;
task->data[0]++;
}
break;
case 5:
if (task->data[5])
gSprites[task->data[15]].pos1.y--;
if (!sub_80A80C8(task))
{
gSprites[task->data[15]].pos1.y = task->data[4];
sub_80A7344(task->data[15]);
task->data[2] = 0;
task->data[0]++;
}
break;
case 6:
if (!task->data[6])
DestroyAnimVisualTask(taskId);
break;
default:
}
}
static void sub_81097B4(u8 spriteId, u8 taskId, u8 a3)
{
u16 i, j;
s8 sign;
u16 y = sub_8109930(spriteId);
u16 x = gSprites[spriteId].pos1.x;
if(!GetBattlerSide(gBattleAnimAttacker))
{
x -= 0xC;
sign = 1;
}
else
{
x += 0x10;
sign = -1;
}
for (i = 0, j = 0; i <= 6; i++)
{
u8 spriteId = CreateSprite(&gUnknown_085955B4, x, y, 2);
if (spriteId != 0x40)
{
gSprites[spriteId].oam.tileNum += j * 4 + 0x40;
if (++j >= 5)
j = 0;
//gHeatedRockCoords
sub_8109984(&gSprites[spriteId], gUnknown_085955CC[i][0] * sign, gUnknown_085955CC[i][1]);
gSprites[spriteId].data[6] = taskId;
gSprites[spriteId].data[7] = a3;
gTasks[taskId].data[a3]++;
}
}
}
static void sub_81098EC(struct Sprite *sprite)
{
sub_81099A0(sprite);
if (sprite->invisible)
{
gTasks[sprite->data[6]].data[sprite->data[7]]--;
DestroySprite(sprite);
}
}
static u16 sub_8109930(u8 spriteId)
{
u16 var1 = gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y + gSprites[spriteId].centerToCornerVecY;
if (GetBattlerSide(gBattleAnimAttacker) == 0)
{
var1 = ((var1 << 16) + 0x4A0000) >> 16;
}
else
{
var1 = ((var1 << 16) + 0x2C0000) >> 16;
}
return var1;
}
static void sub_8109984(struct Sprite *sprite, s16 x, s16 y)
{
sprite->data[0] = 0;
sprite->data[1] = 0;
sprite->data[2] = (u16)sprite->pos1.x * 8;
sprite->data[3] = (u16)sprite->pos1.y * 8;
sprite->data[4] = x * 8;
sprite->data[5] = y * 8;
}
static void sub_81099A0(struct Sprite *sprite)
{
int var1;
if (++sprite->data[0] > 2)
{
sprite->data[0] = 0;
++sprite->data[1];
var1 = (u16)sprite->data[1] * (u16)sprite->data[1];
sprite->data[3] += var1;
}
sprite->data[2] += sprite->data[4];
sprite->pos1.x = sprite->data[2] >> 3;
sprite->data[3] += sprite->data[5];
sprite->pos1.y = sprite->data[3] >> 3;
if (sprite->pos1.x < -8 || sprite->pos1.x > 0xf8 || sprite->pos1.y < -8 || sprite->pos1.y > 120)
sprite->invisible = TRUE;
}
static void sub_8109A10(struct Sprite *sprite)
{
sprite->pos1.x = gBattleAnimArgs[0];
sprite->pos1.y = gBattleAnimArgs[1];
sprite->data[0] = 0;
sprite->data[1] = 0;
sprite->data[2] = 0;
sprite->data[6] = gBattleAnimArgs[2];
sprite->data[7] = gBattleAnimArgs[3];
sprite->oam.tileNum += gBattleAnimArgs[4] * 16;
sprite->callback = sub_8109A64;
}
static void sub_8109A64(struct Sprite *sprite)
{
switch (sprite->data[0])
{
case 0:
if (sprite->data[6] != 0)
{
sprite->data[6]--;
return;
}
sprite->data[0]++;
// fall through
case 1:
sprite->pos1.y += 8;
if (sprite->pos1.y >= sprite->data[7])
{
sprite->pos1.y = sprite->data[7];
sprite->data[0]++;
}
break;
case 2:
if (++sprite->data[1] > 1)
{
sprite->data[1] = 0;
if ((++sprite->data[2] & 1) != 0)
{
sprite->pos2.y = -3;
}
else
{
sprite->pos2.y = 3;
}
}
if (++sprite->data[3] > 16)
{
DestroyAnimSprite(sprite);
}
break;
}
}
//wisp orb
static void sub_8109AFC(struct Sprite *sprite)
{
switch (sprite->data[0])
{
case 0:
InitAnimSpritePos(sprite, 0);
StartSpriteAnim(sprite, gBattleAnimArgs[2]);
sprite->data[7] = gBattleAnimArgs[2];
if (GetBattlerSide(gBattleAnimAttacker) != 0)
{
sprite->data[4] = 4;
}
else
{
sprite->data[4] = -4;
}
sprite->oam.priority = sub_80A8328(gBattleAnimTarget);
sprite->data[0]++;
break;
case 1:
sprite->data[1] += 192;
if (GetBattlerSide(gBattleAnimAttacker) != 0)
{
sprite->pos2.y = -(sprite->data[1] >> 8);
}
else
{
sprite->pos2.y = sprite->data[1] >> 8;
}
sprite->pos2.x = Sin(sprite->data[2], sprite->data[4]);
sprite->data[2] = (sprite->data[2] + 4) & 0xFF;
if (++sprite->data[3] == 1)
{
sprite->data[3] = 0;
sprite->data[0]++;
}
break;
case 2:
sprite->pos2.x = Sin(sprite->data[2], sprite->data[4]);
sprite->data[2] = (sprite->data[2] + 4) & 0xFF;
if (++sprite->data[3] == 31)
{
sprite->pos1.x += sprite->pos2.x;
sprite->pos1.y += sprite->pos2.y;
sprite->pos2.y = 0;
sprite->pos2.x = 0;
sprite->data[0] = 256;
sprite->data[1] = sprite->pos1.x;
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
sprite->data[3] = sprite->pos1.y;
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
sub_80A6FD4(sprite);
sprite->callback = sub_8109C4C;
}
break;
}
}
static void sub_8109C4C(struct Sprite *sprite)
{
s16 initialData5;
s16 newData5;
if (!TranslateAnimLinear(sprite))
{
sprite->pos2.x += Sin(sprite->data[5], 16);
initialData5 = sprite->data[5];
sprite->data[5] = (sprite->data[5] + 4) & 0xFF;
newData5 = sprite->data[5];
if ((initialData5 == 0 || initialData5 > 196) && newData5 > 0 && sprite->data[7] == 0)
{
PlaySE12WithPanning(SE_W172, gUnknown_02038440);
}
}
else
{
DestroyAnimSprite(sprite);
}
}
//wisp fire
void sub_8109CB0(struct Sprite *sprite)
{
if (!sprite->data[0])
{
sprite->data[1] = gBattleAnimArgs[0];
sprite->data[0] += 1;
}
sprite->data[3] += 0xC0 * 2;
sprite->data[4] += 0xA0;
sprite->pos2.x = Sin(sprite->data[1], sprite->data[3] >> 8);
sprite->pos2.y = Cos(sprite->data[1], sprite->data[4] >> 8);
sprite->data[1] = (sprite->data[1] + 7) & 0xFF;
if (!IsContest())
{
if (sprite->data[1] < 64 || sprite->data[1] > 195)
sprite->oam.priority = sub_80A8328(gBattleAnimTarget);
else
sprite->oam.priority = sub_80A8328(gBattleAnimTarget) + 1;
}
else
{
if (sprite->data[1] < 64 || sprite->data[1] > 195)
sprite->subpriority = 0x1D;
else
sprite->subpriority = 0x1F;
}
if (++sprite->data[2] > 0x14)
sprite->invisible ^= 1;
if (sprite->data[2] == 0x1E)
DestroyAnimSprite(sprite);
}
void sub_8109DBC(u8 taskId)
{
struct Task *task = &gTasks[taskId];
task->data[12] = !GetBattlerSide(gBattleAnimAttacker) ? 1 : -1;
task->data[13] = IsBattlerSpriteVisible(gBattleAnimTarget ^ 2) + 1;
task->data[14] = GetAnimBattlerSpriteId(1);
task->data[15] = GetAnimBattlerSpriteId(3);
task->func = sub_8109E2C;
}
static void sub_8109E2C(u8 taskId)
{
struct Task *task = &gTasks[taskId];
switch (task->data[0])
{
case 0:
task->data[10] += task->data[12] * 2;
if (++task->data[1] >= 2)
{
task->data[1] = 0;
task->data[2]++;
if (task->data[2] & 1)
task->data[11] = 2;
else
task->data[11] = -2;
}
for (task->data[3] = 0; task->data[3] < task->data[13]; task->data[3]++)
{
gSprites[task->data[task->data[3] + 14]].pos2.x = task->data[10] + task->data[11];
}
if (++task->data[9] == 16)
{
task->data[9] = 0;
task->data[0]++;
}
break;
case 1:
if (++task->data[1] >= 5)
{
task->data[1] = 0;
task->data[2]++;
if (task->data[2] & 1)
task->data[11] = 2;
else
task->data[11] = -2;
}
for (task->data[3] = 0; task->data[3] < task->data[13]; task->data[3]++)
{
gSprites[task->data[task->data[3] + 14]].pos2.x = task->data[10] + task->data[11];
}
if (++task->data[9] == 96)
{
task->data[9] = 0;
task->data[0]++;
}
break;
case 2:
task->data[10] -= task->data[12] * 2;
if (++task->data[1] >= 2)
{
task->data[1] = 0;
task->data[2]++;
if (task->data[2] & 1)
task->data[11] = 2;
else
task->data[11] = -2;
}
for (task->data[3] = 0; task->data[3] < task->data[13]; task->data[3]++)
{
gSprites[task->data[task->data[3] + 14]].pos2.x = task->data[10] + task->data[11];
}
if (++task->data[9] == 16)
{
task->data[0]++;
}
break;
case 3:
for (task->data[3] = 0; task->data[3] < task->data[13]; task->data[3]++)
{
gSprites[task->data[task->data[3] + 14]].pos2.x = 0;
}
DestroyAnimVisualTask(taskId);
break;
}
}
// Used to add a color mask to the battle interface / HUD in Heat Wave.
// arg 0: opacity
// arg 1: color code
void AnimTask_BlendBackground(u8 taskId)
{
struct UnknownAnimStruct2 unk;
sub_80A6B30(&unk);
BlendPalette(unk.unk8 << 4, 16, gBattleAnimArgs[0], gBattleAnimArgs[1]); // u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor
DestroyAnimVisualTask(taskId);
}
void sub_810A094(u8 taskId)
{
s8 unk;
u8 spriteId;
if (gTasks[taskId].data[0] == 0)
{
gTasks[taskId].data[1] = gBattleAnimArgs[0];
gTasks[taskId].data[2] = gBattleAnimArgs[1];
gTasks[taskId].data[3] = gBattleAnimArgs[2];
gTasks[taskId].data[4] = gBattleAnimArgs[3];
}
gTasks[taskId].data[0]++;
spriteId = gBattlerSpriteIds[gBattleAnimTarget];
if (!gTasks[taskId].data[4])
unk = gUnknown_08595684[gTasks[taskId].data[0] % 10];
else
unk = gUnknown_08595694[gTasks[taskId].data[0] % 10];
if (gTasks[taskId].data[3] == 1)
gSprites[spriteId].pos2.y = gBattleAnimArgs[1] * unk < 0 ? -(gBattleAnimArgs[1] * unk) : gBattleAnimArgs[1] * unk;
else
gSprites[spriteId].pos2.x = gBattleAnimArgs[1] * unk;
if (gTasks[taskId].data[0] == gTasks[taskId].data[1])
{
gSprites[spriteId].pos2.x = 0;
gSprites[spriteId].pos2.y = 0;
DestroyAnimVisualTask(taskId);
}
}

View File

@ -32,7 +32,17 @@ static void sub_81BEA20(void);
static void sub_81BEAD8(struct Sprite* sprite);
// rodata
static const u8 gUnknown_08617E18[] = {0x3b, 0x43, 0x61, 0x00, 0x0f, 0x05, 0xff, 0x9b};
const struct InnerStruct203CF18_3 gUnknown_08617E18 = {
.unk0 = 0x433b,
.unk2 = 0x61,
.unk4 = 0x0F,
.unk5 = 0x05,
.unk6 = 0xFF,
.unk7_0 = 0xB,
.unk7_4 = 0x1,
.unk7_6 = 0,
.unk7_7 = 1,
};
static const union AnimCmd gSpriteAnim_8617E20[] =
{
@ -131,7 +141,7 @@ void sub_81BE6B8(void)
gUnknown_0203CF18 = (struct Struct203CF18 *)AllocZeroed(sizeof(struct Struct203CF18));
sub_8151B3C(&(gUnknown_0203CF18->unk4));
sub_8151B68(&(gUnknown_0203CF18->unk4), gUnknown_08617E18);
sub_8151B68(&(gUnknown_0203CF18->unk4), &gUnknown_08617E18);
sub_8151CA8(&(gUnknown_0203CF18->unk4), 1, 1);
gUnknown_0203CF18->taskId = CreateTask(sub_81BE698, 0xFF);
}

View File

@ -1083,7 +1083,7 @@ static const struct PokedexOption gDexSortOptions[] =
{gText_DexSortHeaviestDescription, gText_DexSortHeaviestTitle},
{gText_DexSortLightestDescription, gText_DexSortLightestTitle},
{gText_DexSortTallestDescription, gText_DexSortTallestTitle},
{ggText_DexSortSmallestDescription, gText_DexSortSmallestTitle},
{gText_DexSortSmallestDescription, gText_DexSortSmallestTitle},
{NULL, NULL},
};

700
src/roulette_util.c Executable file
View File

@ -0,0 +1,700 @@
#include "global.h"
#include "palette.h"
#include "roulette.h"
#include "roulette_util.h"
#include "util.h"
void sub_8151678(struct UnkStruct0 *r0)
{
r0->var00 = 0;
r0->var02 = 0;
memset(&r0->var04, 0, sizeof(r0->var04));
}
u8 sub_815168C(struct UnkStruct0 *r0, u8 r1, struct UnkStruct1 *r2)
{
if (!(r1 < 16) || (r0->var04[r1].var00_7))
return 0xFF;
r0->var04[r1].var04.var00 = r2->var00;
r0->var04[r1].var04.var02 = r2->var02;
r0->var04[r1].var04.var04 = r2->var04;
r0->var04[r1].var04.var05 = r2->var05;
r0->var04[r1].var04.var06 = r2->var06;
r0->var04[r1].var04.var07_0 = r2->var07_0;
r0->var04[r1].var04.var07_5 = r2->var07_5;
r0->var04[r1].var04.var07_7 = r2->var07_7;
r0->var04[r1].var00_0 = 0;
r0->var04[r1].var00_7 = 1;
r0->var04[r1].var02 = 0;
r0->var04[r1].var01 = 0;
if (r0->var04[r1].var04.var07_7 < 0)
r0->var04[r1].var03 = 0xFF;
else
r0->var04[r1].var03 = 1;
return r1;
}
u8 sub_8151710(struct UnkStruct0 *r0, u8 r1)
{
if (r1 >= 16)
return 0xFF;
if (!r0->var04[r1].var00_7)
return 0xFF;
memset(&r0->var04[r1], 0, sizeof(r0->var04[r1]));
return r1;
}
u8 sub_8151744(struct UnkStruct3 *r0)
{
u8 i;
u8 returnval;
for (i = 0; i < r0->var04.var04; i++)
{
struct PlttData *faded = (struct PlttData *)&gPlttBufferFaded[r0->var04.var02 + i];
struct PlttData *unfaded = (struct PlttData *)&gPlttBufferUnfaded[r0->var04.var02 + i];
switch (r0->var00_0)
{
case 1:
if (faded->r + r0->var03 >= 0 && faded->r + r0->var03 < 32)
faded->r += r0->var03;
if (faded->g + r0->var03 >= 0 && faded->g + r0->var03 < 32)
faded->g += r0->var03;
if (faded->b + r0->var03 >= 0 && faded->b + r0->var03 < 32)
faded->b += r0->var03;
break;
case 2:
if (r0->var03 < 0)
{
if (faded->r + r0->var03 >= unfaded->r)
faded->r += r0->var03;
if (faded->g + r0->var03 >= unfaded->g)
faded->g += r0->var03;
if (faded->b + r0->var03 >= unfaded->b)
faded->b += r0->var03;
}
else
{
if (faded->r + r0->var03 <= unfaded->r)
faded->r += r0->var03;
if (faded->g + r0->var03 <= unfaded->g)
faded->g += r0->var03;
if (faded->b + r0->var03 <= unfaded->b)
faded->b += r0->var03;
}
break;
}
}
if ((u32)r0->var02++ != r0->var04.var07_0)
{
returnval = 0;
}
else
{
r0->var02 = 0;
r0->var03 *= -1;
if (r0->var00_0 == 1)
r0->var00_0++;
else
r0->var00_0--;
returnval = 1;
}
return returnval;
}
u8 sub_815194C(struct UnkStruct3 *r0)
{
u8 rg2 = 0;
switch (r0->var00_0)
{
case 1:
for (rg2 = 0; rg2 < r0->var04.var04; rg2++)
gPlttBufferFaded[r0->var04.var02 + rg2] = r0->var04.var00;
r0->var00_0++;
break;
case 2:
for (rg2 = 0; rg2 < r0->var04.var04; rg2++)
gPlttBufferFaded[r0->var04.var02 + rg2] = gPlttBufferUnfaded[r0->var04.var02 + rg2];
r0->var00_0--;
break;
}
return 1;
}
void task_tutorial_controls_fadein(struct UnkStruct0 *r0)
{
u8 i = 0;
if (r0->var00)
{
for (i = 0; i < 16; i++)
{
if ((r0->var02 >> i) & 1)
{
if (--r0->var04[i].var01 == 0xFF) // if underflow ?
{
if (r0->var04[i].var04.var00 & 0x8000) // PlttData->unused_15 ?
sub_8151744(&r0->var04[i]);
else
sub_815194C(&r0->var04[i]);
r0->var04[i].var01 = r0->var04[i].var04.var05;
}
}
}
}
}
void sub_8151A48(struct UnkStruct0 *r0, u16 r1)
{
u8 i = 0;
r0->var00++;
for (i = 0; i < 16; i++)
{
if ((r1 >> i) & 1)
{
if (r0->var04[i].var00_7)
{
r0->var02 |= 1 << i;
r0->var04[i].var00_0 = 1;
}
}
}
}
void sub_8151A9C(struct UnkStruct0 *r0, u16 r1)
{
u8 i;
for (i = 0; i < 16; i++)
{
if ((r0->var02 >> i) & 1)
{
if (r0->var04[i].var00_7)
{
if ((r1 >> i) & 1)
{
u32 offset = r0->var04[i].var04.var02;
u16 *faded = &gPlttBufferFaded[offset];
u16 *unfaded = &gPlttBufferUnfaded[offset];
memcpy(faded, unfaded, r0->var04[i].var04.var04 * 2);
r0->var04[i].var00_0 = 0;
r0->var04[i].var02 = 0;
r0->var04[i].var01 = 0;
if (r0->var04[i].var04.var07_7 < 0)
r0->var04[i].var03 = 0xFF;
else
r0->var04[i].var03 = 0x1;
}
}
}
}
if (r1 == 0xFFFF)
{
r0->var00 = 0;
r0->var02 = 0;
}
else
{
r0->var02 = r0->var02 & ~r1;
}
}
void sub_8151B3C(struct InnerStruct203CF18 *arg0)
{
u8 i = 0;
arg0->unk0 = 0;
memset(&arg0->unk4, 0, sizeof(arg0->unk4));
for (; i < 16; i++)
{
arg0->unk4[i].unk0 = i;
}
}
int sub_8151B68(struct InnerStruct203CF18 *arg0, const struct InnerStruct203CF18_3 *arg1)
{
u8 i = 0;
struct InnerStruct203CF18_2 *r4 = NULL;
if (!arg0->unk4[0].unk1_7)
{
r4 = &arg0->unk4[0];
}
else
{
while (++i < 16)
{
if (!arg0->unk4[i].unk1_7)
{
r4 = &arg0->unk4[i];
break;
}
}
}
if (r4 == 0)
return 0xFF;
r4->unk1_0 = 0;
r4->unk1_4 = 0;
r4->unk1_6 = 1;
r4->unk1_7 = 1;
r4->unk2 = 0;
r4->unk3 = 0;
memcpy(&r4->unk4, arg1, sizeof(*arg1));
return i;
}
void sub_8151BD4(struct InnerStruct203CF18_2 *arg0)
{
u16 i;
if (!arg0->unk1_6 && arg0->unk4.unk7_6)
{
for (i = arg0->unk4.unk2; i < arg0->unk4.unk2 + arg0->unk4.unk4; i++)
gPlttBufferFaded[i] = gPlttBufferUnfaded[i];
}
memset(&arg0->unk4, 0, sizeof(arg0->unk4));
arg0->unk1_0 = 0;
arg0->unk1_4 = 0;
arg0->unk1_5 = 0;
arg0->unk1_6 = 1;
arg0->unk1_7 = 0;
arg0->unk3 = 0;
arg0->unk2 = 0;
}
void sub_8151C50(struct InnerStruct203CF18 *arg0, u16 arg1, u8 arg2)
{
u16 i = 0;
if (!arg2)
{
sub_8151BD4(&arg0->unk4[arg1 & 0xF]);
}
else
{
for (i = 0; i < 16; i++)
{
if ((arg1 & 1) && arg0->unk4[i].unk1_7)
sub_8151BD4(&arg0->unk4[i]);
arg1 >>= 1;
}
}
}
// there seems to be a temp var involved inside the first if block
void sub_8151CA8(struct InnerStruct203CF18 *arg0, u16 arg1, u8 arg2)
{
u8 i = 0;
if (!arg2)
{
i = arg1 & 0xF;
arg0->unk4[i].unk1_6 = 0;
arg0->unk0 |= 1 << i;
}
else
{
for (i = 0; i < 16; i++)
{
if (!(arg1 & 1) || !arg0->unk4[i].unk1_7 || !arg0->unk4[i].unk1_6)
{
arg1 <<= 1;
}
else
{
arg0->unk4[i].unk1_6 = 0;
arg0->unk0 |= 1 << i;
}
}
}
}
void sub_8151D28(struct InnerStruct203CF18 *arg0, u16 arg1, u8 arg2)
{
u16 i;
struct InnerStruct203CF18_2 *var0;
u8 j = 0;
if (!arg2)
{
var0 = &arg0->unk4[arg1 & 0xF];
if (!var0->unk1_6 && var0->unk1_7)
{
if (var0->unk4.unk7_6)
{
for (i = var0->unk4.unk2; i < var0->unk4.unk2 + var0->unk4.unk4; i++)
gPlttBufferFaded[i] = gPlttBufferUnfaded[i];
}
var0->unk1_6 = 1;
arg0->unk0 &= ~(1 << j);
}
}
else
{
for (j = 0; j < 16; j++)
{
var0 = &arg0->unk4[j];
if (!(arg1 & 1) || var0->unk1_6 || !var0->unk1_7)
{
arg1 <<= 1;
}
else
{
if (var0->unk4.unk7_6)
{
for (i = var0->unk4.unk2; i < var0->unk4.unk2 + var0->unk4.unk4; i++)
gPlttBufferFaded[i] = gPlttBufferUnfaded[i];
}
var0->unk1_6 = 1;
arg0->unk0 &= ~(1 << j);
}
}
}
}
#ifdef NONMATCHING
void sub_8151E50(struct InnerStruct203CF18 *arg0)
{
struct InnerStruct203CF18_2 *var0;
u8 i = 0;
if (arg0->unk0)
{
for (i = 0; i < 16; i++)
{
var0 = &arg0->unk4[i];
if ((!var0->unk1_6 && var0->unk1_7) && (!gPaletteFade.active || !var0->unk4.unk7_7))
{
if (--var0->unk2 == 0xFF)
{
var0->unk2 = var0->unk4.unk5;
BlendPalette(var0->unk4.unk2, var0->unk4.unk4, var0->unk1_0, var0->unk4.unk0);
switch (var0->unk4.unk7_4)
{
case 0:
if (var0->unk1_0++ == var0->unk4.unk7_0)
{
var0->unk3++;
var0->unk1_0 = 0;
}
break;
case 1:
if (var0->unk1_4)
{
if (--var0->unk1_0 == 0)
{
var0->unk3++;
var0->unk1_4 ^= 1;
}
}
else
{
if (var0->unk1_0++ == var0->unk4.unk7_0 - 1)
{
var0->unk3++;
var0->unk1_4 ^= 1;
}
}
break;
case 2:
if (var0->unk1_4)
var0->unk1_0 = 0;
else
var0->unk1_0 = var0->unk4.unk7_0;
var0->unk1_4 ^= 1;
var0->unk3++;
break;
}
if (var0->unk4.unk6 != 0xFF && var0->unk3 == 0xFF)
sub_8151D28(arg0, var0->unk0, 0);
}
}
}
}
}
#else
NAKED
void sub_8151E50(struct InnerStruct203CF18 *arg0)
{
asm_unified("\n\
push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x4\n\
str r0, [sp]\n\
movs r0, 0\n\
mov r10, r0\n\
ldr r1, [sp]\n\
ldrh r0, [r1]\n\
cmp r0, 0\n\
bne _08151E6C\n\
b _08151FF6\n\
_08151E6C:\n\
movs r2, 0xF\n\
mov r9, r2\n\
movs r3, 0x10\n\
negs r3, r3\n\
mov r8, r3\n\
movs r7, 0x1\n\
_08151E78:\n\
mov r5, r10\n\
lsls r0, r5, 1\n\
add r0, r10\n\
lsls r0, 2\n\
adds r0, 0x4\n\
ldr r1, [sp]\n\
adds r4, r1, r0\n\
ldrb r2, [r4, 0x1]\n\
movs r3, 0xC0\n\
ands r3, r2\n\
cmp r3, 0x80\n\
beq _08151E92\n\
b _08151FE6\n\
_08151E92:\n\
ldr r0, =gPaletteFade\n\
ldrb r1, [r0, 0x7]\n\
adds r0, r3, 0\n\
ands r0, r1\n\
cmp r0, 0\n\
beq _08151EA8\n\
ldrb r0, [r4, 0xB]\n\
ands r3, r0\n\
cmp r3, 0\n\
beq _08151EA8\n\
b _08151FE6\n\
_08151EA8:\n\
ldrb r0, [r4, 0x2]\n\
subs r0, 0x1\n\
strb r0, [r4, 0x2]\n\
lsls r0, 24\n\
lsrs r0, 24\n\
cmp r0, 0xFF\n\
beq _08151EB8\n\
b _08151FE6\n\
_08151EB8:\n\
ldrb r0, [r4, 0x9]\n\
strb r0, [r4, 0x2]\n\
ldrh r0, [r4, 0x6]\n\
ldrb r1, [r4, 0x8]\n\
lsls r2, 28\n\
lsrs r2, 28\n\
ldrh r3, [r4, 0x4]\n\
bl BlendPalette\n\
ldrb r5, [r4, 0xB]\n\
lsls r0, r5, 26\n\
asrs r0, 30\n\
cmp r0, 0x1\n\
beq _08151F16\n\
cmp r0, 0x1\n\
bgt _08151EE4\n\
cmp r0, 0\n\
beq _08151EEA\n\
b _08151FD0\n\
.pool\n\
_08151EE4:\n\
cmp r0, 0x2\n\
beq _08151F92\n\
b _08151FD0\n\
_08151EEA:\n\
ldrb r2, [r4, 0x1]\n\
lsls r1, r2, 28\n\
lsrs r0, r1, 28\n\
adds r0, 0x1\n\
mov r3, r9\n\
ands r0, r3\n\
mov r6, r8\n\
adds r3, r6, 0\n\
ands r3, r2\n\
orrs r3, r0\n\
strb r3, [r4, 0x1]\n\
lsrs r1, 28\n\
lsls r0, r5, 28\n\
asrs r0, 28\n\
cmp r1, r0\n\
bne _08151FD0\n\
ldrb r0, [r4, 0x3]\n\
adds r0, 0x1\n\
strb r0, [r4, 0x3]\n\
ands r3, r6\n\
strb r3, [r4, 0x1]\n\
b _08151FD0\n\
_08151F16:\n\
ldrb r3, [r4, 0x1]\n\
movs r0, 0x10\n\
ands r0, r3\n\
cmp r0, 0\n\
beq _08151F54\n\
lsls r0, r3, 28\n\
lsrs r0, 28\n\
subs r0, 0x1\n\
mov r5, r9\n\
ands r0, r5\n\
mov r2, r8\n\
ands r2, r3\n\
orrs r2, r0\n\
strb r2, [r4, 0x1]\n\
cmp r0, 0\n\
bne _08151FD0\n\
ldrb r0, [r4, 0x3]\n\
adds r0, 0x1\n\
strb r0, [r4, 0x3]\n\
lsls r0, r2, 27\n\
lsrs r0, 31\n\
eors r0, r7\n\
ands r0, r7\n\
lsls r0, 4\n\
movs r3, 0x11\n\
negs r3, r3\n\
adds r1, r3, 0\n\
ands r2, r1\n\
orrs r2, r0\n\
strb r2, [r4, 0x1]\n\
b _08151FD0\n\
_08151F54:\n\
lsls r0, r5, 28\n\
asrs r0, 28\n\
subs r0, 0x1\n\
mov r5, r9\n\
ands r0, r5\n\
lsls r2, r3, 28\n\
lsrs r1, r2, 28\n\
adds r1, 0x1\n\
ands r1, r5\n\
mov r5, r8\n\
ands r3, r5\n\
orrs r3, r1\n\
strb r3, [r4, 0x1]\n\
lsrs r2, 28\n\
cmp r2, r0\n\
bne _08151FD0\n\
ldrb r0, [r4, 0x3]\n\
adds r0, 0x1\n\
strb r0, [r4, 0x3]\n\
lsls r0, r3, 27\n\
lsrs r0, 31\n\
eors r0, r7\n\
ands r0, r7\n\
lsls r0, 4\n\
movs r2, 0x11\n\
negs r2, r2\n\
adds r1, r2, 0\n\
ands r3, r1\n\
orrs r3, r0\n\
strb r3, [r4, 0x1]\n\
b _08151FD0\n\
_08151F92:\n\
ldrb r2, [r4, 0x1]\n\
movs r0, 0x10\n\
ands r0, r2\n\
cmp r0, 0\n\
beq _08151FA2\n\
mov r0, r8\n\
ands r0, r2\n\
b _08151FB0\n\
_08151FA2:\n\
lsls r1, r5, 28\n\
asrs r1, 28\n\
mov r3, r9\n\
ands r1, r3\n\
mov r0, r8\n\
ands r0, r2\n\
orrs r0, r1\n\
_08151FB0:\n\
strb r0, [r4, 0x1]\n\
ldrb r2, [r4, 0x1]\n\
lsls r0, r2, 27\n\
lsrs r0, 31\n\
eors r0, r7\n\
ands r0, r7\n\
lsls r0, 4\n\
movs r5, 0x11\n\
negs r5, r5\n\
adds r1, r5, 0\n\
ands r2, r1\n\
orrs r2, r0\n\
strb r2, [r4, 0x1]\n\
ldrb r0, [r4, 0x3]\n\
adds r0, 0x1\n\
strb r0, [r4, 0x3]\n\
_08151FD0:\n\
ldrb r1, [r4, 0xA]\n\
cmp r1, 0xFF\n\
beq _08151FE6\n\
ldrb r0, [r4, 0x3]\n\
cmp r0, r1\n\
bne _08151FE6\n\
ldrb r1, [r4]\n\
ldr r0, [sp]\n\
movs r2, 0\n\
bl sub_8151D28\n\
_08151FE6:\n\
mov r0, r10\n\
adds r0, 0x1\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r10, r0\n\
cmp r0, 0xF\n\
bhi _08151FF6\n\
b _08151E78\n\
_08151FF6:\n\
add sp, 0x4\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0");
}
#endif // NONMATCHING
void sub_8152008(u16 *dest, u16 src, u8 left, u8 top, u8 width, u8 height)
{
u16 *_dest;
u8 i;
u8 j;
i = 0;
dest = &dest[top * 32 + left];
for (; i < height; i++)
{
_dest = dest + i * 32;
for (j = 0; j < width; j++)
{
*_dest++ = src;
}
}
}
void sub_8152058(u16 *dest, u16 *src, u8 left, u8 top, u8 width, u8 height)
{
u16 *_dest;
u16 *_src = src;
u8 i;
u8 j;
i = 0;
dest = &dest[top * 32 + left];
for (; i < height; i++)
{
_dest = dest + i * 32;
for (j = 0; j < width; j++)
{
*_dest++ = *_src++;
}
}
}

View File

@ -155,7 +155,7 @@ const u8 gText_DexSortAtoZDescription[] = _("Spotted and owned POKéMON are list
const u8 gText_DexSortHeaviestDescription[] = _("Owned POKéMON are listed from the\nheaviest to the lightest.");
const u8 gText_DexSortLightestDescription[] = _("Owned POKéMON are listed from the\nlightest to the heaviest.");
const u8 gText_DexSortTallestDescription[] = _("Owned POKéMON are listed from the\ntallest to the smallest.");
const u8 ggText_DexSortSmallestDescription[] = _("Owned POKéMON are listed from the\nsmallest to the tallest.");
const u8 gText_DexSortSmallestDescription[] = _("Owned POKéMON are listed from the\nsmallest to the tallest.");
const u8 gText_DexEmptyString[] = _("");
const u8 gText_DexSearchDontSpecify[] = _("DON'T SPECIFY.");
const u8 gText_DexSearchTypeNone[] = _("NONE");