mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 19:47:35 +01:00
Merge with master
This commit is contained in:
commit
c23b1acc5e
@ -59,6 +59,8 @@ struct LockedAnimEventObjects
|
||||
};
|
||||
|
||||
extern const struct SpriteFrameImage gEventObjectPicTable_PechaBerryTree[];
|
||||
extern const struct OamData gEventObjectBaseOam_32x8;
|
||||
extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[];
|
||||
extern const u8 gReflectionEffectPaletteMap[];
|
||||
|
||||
void ResetEventObjects(void);
|
||||
|
@ -579,4 +579,9 @@ extern const u8 BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88[];
|
||||
extern const u8 BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F[];
|
||||
extern const u8 BattleFrontier_BattlePyramidEmptySquare_EventScript_252C6A[];
|
||||
|
||||
// fldeff misc
|
||||
extern const u8 EventScript_275A86[];
|
||||
extern const u8 EventScript_275ADF[];
|
||||
extern const u8 EventScript_275B38[];
|
||||
|
||||
#endif // GUARD_EVENT_SCRIPTS_H
|
||||
|
@ -1,24 +1,37 @@
|
||||
#ifndef GUARD_FLDEFF_MISC_H
|
||||
#define GUARD_FLDEFF_MISC_H
|
||||
|
||||
void PopSecretBaseBalloon(s16 id, s16 x, s16 y);
|
||||
void sub_80F9BCC(u16 a0, u16 a1, u8 a2);
|
||||
void sub_80F9BF4(u16 a0, u16 a1, u8 a2);
|
||||
bool8 sub_80F9C1C(void);
|
||||
bool8 sub_80F9C30(void);
|
||||
bool8 SetUpFieldMove_SecretPower(void);
|
||||
bool8 FldEff_UseSecretPowerCave(void);
|
||||
bool8 FldEff_SecretPowerCave(void);
|
||||
bool8 FldEff_UseSecretPowerTree(void);
|
||||
bool8 FldEff_SecretPowerTree(void);
|
||||
bool8 FldEff_UseSecretPowerShrub(void);
|
||||
bool8 FldEff_SecretPowerShrub(void);
|
||||
bool8 FldEff_SecretBasePCTurnOn(void);
|
||||
void DoSecretBasePCTurnOffEffect(void);
|
||||
void PopSecretBaseBalloon(s16 metatileId, s16 x, s16 y);
|
||||
bool8 FldEff_NopA6FC(void);
|
||||
bool8 FldEff_NopA700(void);
|
||||
void ShatterSecretBaseBreakableDoor(s16 x, s16 y);
|
||||
u8 CreateRecordMixingSprite(void);
|
||||
void DestroyRecordMixingSprite(void);
|
||||
void FldEffPoison_Start(void);
|
||||
void PlaySecretBaseMusicNoteMatSound(s16 metatileId);
|
||||
void DoSecretBaseGlitterMatSparkle(void);
|
||||
bool8 sub_80FADE4(u16, u8);
|
||||
|
||||
extern struct MapPosition gPlayerFacingPosition;
|
||||
extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[];
|
||||
|
||||
extern u8 EventScript_275A86[];
|
||||
extern u8 EventScript_275ADF[];
|
||||
extern u8 EventScript_275B38[];
|
||||
|
||||
extern const struct OamData gEventObjectBaseOam_32x8;
|
||||
bool8 FldEff_SandPillar(void);
|
||||
void GetShieldToyTVDecorationInfo(void);
|
||||
bool8 sub_80FADE4(u16 arg0, u8 arg1);
|
||||
void FldEffPoison_Start(void);
|
||||
bool32 FldEffPoison_IsActive(void);
|
||||
void DoWateringBerryTreeAnim(void);
|
||||
u8 CreateRecordMixingSprite(void);
|
||||
void DestroyRecordMixingSprite(void);
|
||||
|
||||
extern const struct SpritePalette gFieldEffectObjectPaletteInfo7;
|
||||
extern const struct SpritePalette gFieldEffectObjectPaletteInfo8;
|
||||
extern const struct SpritePalette gFieldEffectObjectPaletteInfo9;
|
||||
extern const u16 gTilesetPalettes_SecretBase[][16];
|
||||
|
||||
#endif //GUARD_FLDEFF_MISC_H
|
||||
|
241
src/electric.c
241
src/electric.c
@ -462,7 +462,7 @@ static void sub_810A1A8(struct Sprite *sprite)
|
||||
sprite->pos1.x -= gBattleAnimArgs[0];
|
||||
else
|
||||
sprite->pos1.x += gBattleAnimArgs[0];
|
||||
|
||||
|
||||
sprite->pos1.y += gBattleAnimArgs[1];
|
||||
sprite->callback = sub_810A1F8;
|
||||
}
|
||||
@ -479,7 +479,7 @@ static void sub_810A214(struct Sprite *sprite)
|
||||
sprite->pos1.x -= gBattleAnimArgs[0];
|
||||
else
|
||||
sprite->pos1.x += gBattleAnimArgs[0];
|
||||
|
||||
|
||||
sprite->callback = sub_810A258;
|
||||
}
|
||||
|
||||
@ -493,7 +493,7 @@ static void sub_810A274(struct Sprite *sprite)
|
||||
{
|
||||
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
|
||||
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
|
||||
|
||||
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
{
|
||||
sprite->pos1.x -= gBattleAnimArgs[0];
|
||||
@ -615,7 +615,7 @@ static void sub_810A5BC(struct Sprite *sprite)
|
||||
{
|
||||
if (IsContest() || GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
|
||||
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
|
||||
|
||||
|
||||
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[1];
|
||||
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[2];
|
||||
sprite->data[3] = gBattleAnimArgs[0];
|
||||
@ -686,17 +686,16 @@ void sub_810A7DC(u8 taskId)
|
||||
gTasks[taskId].func = sub_810A834;
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING // couldn't get the proper tail merging in the "CreateSprite" switch cases.(ported from ruby)
|
||||
static void sub_810A834(u8 taskId)
|
||||
{
|
||||
u16 r8;
|
||||
u16 r2;
|
||||
s16 r12;
|
||||
s16 r2;
|
||||
u8 spriteId = 0;
|
||||
u8 r7 = 0;
|
||||
u8 sp = gTasks[taskId].data[2];
|
||||
s16 r4 = gTasks[taskId].data[0];
|
||||
s16 r6 = gTasks[taskId].data[1];
|
||||
s16 x = gTasks[taskId].data[0];
|
||||
s16 y = gTasks[taskId].data[1];
|
||||
|
||||
if (!gTasks[taskId].data[2])
|
||||
{
|
||||
@ -714,27 +713,31 @@ static void sub_810A834(u8 taskId)
|
||||
switch (gTasks[taskId].data[10])
|
||||
{
|
||||
case 0:
|
||||
r8 += r2 * 0;
|
||||
spriteId = CreateSprite(&gUnknown_08595828, r4, r6 + (r12 * 1), 2);
|
||||
r12 *= 1;
|
||||
spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2);
|
||||
r7++;
|
||||
break;
|
||||
case 2:
|
||||
r12 *= 2;
|
||||
r8 += r2;
|
||||
spriteId = CreateSprite(&gUnknown_08595828, r4, r6 + (r12 * 2), 2);
|
||||
spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2);
|
||||
r7++;
|
||||
break;
|
||||
case 4:
|
||||
r12 *= 3;
|
||||
r8 += r2 * 2;
|
||||
spriteId = CreateSprite(&gUnknown_08595828, r4, r6 + (r12 * 3), 2);
|
||||
spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2);
|
||||
r7++;
|
||||
break;
|
||||
case 6:
|
||||
r12 *= 4;
|
||||
r8 += r2 * 3;
|
||||
spriteId = CreateSprite(&gUnknown_08595828, r4, r6 + (r12 * 4), 2);
|
||||
spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2);
|
||||
r7++;
|
||||
break;
|
||||
case 8:
|
||||
spriteId = CreateSprite(&gUnknown_08595828, r4, r6 + (r12 * 5), 2);
|
||||
r12 *= 5;
|
||||
spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2);
|
||||
r7++;
|
||||
break;
|
||||
case 10:
|
||||
@ -751,211 +754,6 @@ static void sub_810A834(u8 taskId)
|
||||
|
||||
gTasks[taskId].data[10]++;
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
static void sub_810A834(u8 taskId)
|
||||
{
|
||||
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\
|
||||
lsls r0, 24\n\
|
||||
lsrs r0, 24\n\
|
||||
mov r9, r0\n\
|
||||
movs r5, 0\n\
|
||||
movs r7, 0\n\
|
||||
ldr r1, =gTasks\n\
|
||||
lsls r0, 2\n\
|
||||
add r0, r9\n\
|
||||
lsls r0, 3\n\
|
||||
adds r0, r1\n\
|
||||
ldrb r2, [r0, 0xC]\n\
|
||||
str r2, [sp]\n\
|
||||
ldrh r4, [r0, 0x8]\n\
|
||||
ldrh r6, [r0, 0xA]\n\
|
||||
movs r3, 0xC\n\
|
||||
ldrsh r0, [r0, r3]\n\
|
||||
mov r10, r1\n\
|
||||
cmp r0, 0\n\
|
||||
bne _0810A878\n\
|
||||
movs r0, 0\n\
|
||||
mov r8, r0\n\
|
||||
movs r2, 0x1\n\
|
||||
movs r1, 0x10\n\
|
||||
mov r12, r1\n\
|
||||
b _0810A882\n\
|
||||
.pool\n\
|
||||
_0810A878:\n\
|
||||
movs r2, 0x10\n\
|
||||
mov r12, r2\n\
|
||||
movs r3, 0x8\n\
|
||||
mov r8, r3\n\
|
||||
movs r2, 0x4\n\
|
||||
_0810A882:\n\
|
||||
mov r0, r9\n\
|
||||
lsls r1, r0, 2\n\
|
||||
adds r0, r1, r0\n\
|
||||
lsls r0, 3\n\
|
||||
add r0, r10\n\
|
||||
movs r3, 0x1C\n\
|
||||
ldrsh r0, [r0, r3]\n\
|
||||
mov r10, r1\n\
|
||||
cmp r0, 0xA\n\
|
||||
bhi _0810A978\n\
|
||||
lsls r0, 2\n\
|
||||
ldr r1, =_0810A8A4\n\
|
||||
adds r0, r1\n\
|
||||
ldr r0, [r0]\n\
|
||||
mov pc, r0\n\
|
||||
.pool\n\
|
||||
.align 2, 0\n\
|
||||
_0810A8A4:\n\
|
||||
.4byte _0810A8D0\n\
|
||||
.4byte _0810A978\n\
|
||||
.4byte _0810A8E4\n\
|
||||
.4byte _0810A978\n\
|
||||
.4byte _0810A904\n\
|
||||
.4byte _0810A978\n\
|
||||
.4byte _0810A91A\n\
|
||||
.4byte _0810A978\n\
|
||||
.4byte _0810A93C\n\
|
||||
.4byte _0810A978\n\
|
||||
.4byte _0810A970\n\
|
||||
_0810A8D0:\n\
|
||||
ldr r0, =gUnknown_08595828\n\
|
||||
lsls r1, r4, 16\n\
|
||||
asrs r1, 16\n\
|
||||
lsls r2, r6, 16\n\
|
||||
asrs r2, 16\n\
|
||||
mov r4, r12\n\
|
||||
lsls r3, r4, 16\n\
|
||||
b _0810A952\n\
|
||||
.pool\n\
|
||||
_0810A8E4:\n\
|
||||
mov r0, r12\n\
|
||||
lsls r3, r0, 17\n\
|
||||
mov r1, r8\n\
|
||||
adds r0, r1, r2\n\
|
||||
lsls r0, 16\n\
|
||||
lsrs r0, 16\n\
|
||||
mov r8, r0\n\
|
||||
ldr r0, =gUnknown_08595828\n\
|
||||
lsls r1, r4, 16\n\
|
||||
asrs r1, 16\n\
|
||||
lsls r2, r6, 16\n\
|
||||
asrs r2, 16\n\
|
||||
b _0810A952\n\
|
||||
.pool\n\
|
||||
_0810A904:\n\
|
||||
mov r3, r12\n\
|
||||
lsls r0, r3, 16\n\
|
||||
asrs r0, 16\n\
|
||||
lsls r3, r0, 1\n\
|
||||
adds r3, r0\n\
|
||||
lsls r0, r2, 1\n\
|
||||
add r0, r8\n\
|
||||
lsls r0, 16\n\
|
||||
lsrs r0, 16\n\
|
||||
mov r8, r0\n\
|
||||
b _0810A946\n\
|
||||
_0810A91A:\n\
|
||||
mov r0, r12\n\
|
||||
lsls r3, r0, 18\n\
|
||||
lsls r0, r2, 1\n\
|
||||
adds r0, r2\n\
|
||||
add r0, r8\n\
|
||||
lsls r0, 16\n\
|
||||
lsrs r0, 16\n\
|
||||
mov r8, r0\n\
|
||||
ldr r0, =gUnknown_08595828\n\
|
||||
lsls r1, r4, 16\n\
|
||||
asrs r1, 16\n\
|
||||
lsls r2, r6, 16\n\
|
||||
asrs r2, 16\n\
|
||||
b _0810A952\n\
|
||||
.pool\n\
|
||||
_0810A93C:\n\
|
||||
mov r1, r12\n\
|
||||
lsls r0, r1, 16\n\
|
||||
asrs r0, 16\n\
|
||||
lsls r3, r0, 2\n\
|
||||
adds r3, r0\n\
|
||||
_0810A946:\n\
|
||||
ldr r0, =gUnknown_08595828\n\
|
||||
lsls r1, r4, 16\n\
|
||||
asrs r1, 16\n\
|
||||
lsls r2, r6, 16\n\
|
||||
asrs r2, 16\n\
|
||||
lsls r3, 16\n\
|
||||
_0810A952:\n\
|
||||
asrs r3, 16\n\
|
||||
adds r2, r3\n\
|
||||
lsls r2, 16\n\
|
||||
asrs r2, 16\n\
|
||||
movs r3, 0x2\n\
|
||||
bl CreateSprite\n\
|
||||
lsls r0, 24\n\
|
||||
lsrs r5, r0, 24\n\
|
||||
adds r0, r7, 0x1\n\
|
||||
lsls r0, 24\n\
|
||||
lsrs r7, r0, 24\n\
|
||||
b _0810A978\n\
|
||||
.pool\n\
|
||||
_0810A970:\n\
|
||||
mov r0, r9\n\
|
||||
bl DestroyAnimVisualTask\n\
|
||||
b _0810A9BC\n\
|
||||
_0810A978:\n\
|
||||
cmp r7, 0\n\
|
||||
beq _0810A9AC\n\
|
||||
ldr r4, =gSprites\n\
|
||||
lsls r3, r5, 4\n\
|
||||
adds r3, r5\n\
|
||||
lsls r3, 2\n\
|
||||
adds r0, r3, r4\n\
|
||||
ldrh r5, [r0, 0x4]\n\
|
||||
lsls r2, r5, 22\n\
|
||||
lsrs r2, 22\n\
|
||||
add r2, r8\n\
|
||||
ldr r6, =0x000003ff\n\
|
||||
adds r1, r6, 0\n\
|
||||
ands r2, r1\n\
|
||||
ldr r1, =0xfffffc00\n\
|
||||
ands r1, r5\n\
|
||||
orrs r1, r2\n\
|
||||
strh r1, [r0, 0x4]\n\
|
||||
mov r1, sp\n\
|
||||
ldrh r1, [r1]\n\
|
||||
strh r1, [r0, 0x2E]\n\
|
||||
adds r4, 0x1C\n\
|
||||
adds r3, r4\n\
|
||||
ldr r1, [r3]\n\
|
||||
bl _call_via_r1\n\
|
||||
_0810A9AC:\n\
|
||||
ldr r0, =gTasks\n\
|
||||
mov r1, r10\n\
|
||||
add r1, r9\n\
|
||||
lsls r1, 3\n\
|
||||
adds r1, r0\n\
|
||||
ldrh r0, [r1, 0x1C]\n\
|
||||
adds r0, 0x1\n\
|
||||
strh r0, [r1, 0x1C]\n\
|
||||
_0810A9BC:\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\n\
|
||||
.pool\n\
|
||||
");
|
||||
}
|
||||
#endif
|
||||
|
||||
static void sub_810A9DC(struct Sprite *sprite)
|
||||
{
|
||||
@ -1002,7 +800,7 @@ void sub_810AAFC(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
if (!gBattleAnimArgs[0])
|
||||
if (!gBattleAnimArgs[0])
|
||||
{
|
||||
task->data[14] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
|
||||
task->data[15] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
|
||||
@ -1188,7 +986,7 @@ void sub_810AE5C(u8 taskId)
|
||||
}
|
||||
else
|
||||
task->data[0]++;
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
@ -1334,6 +1132,7 @@ static void sub_810B23C(struct Sprite *sprite)
|
||||
case 1:
|
||||
if (sprite->affineAnimEnded)
|
||||
DestroySpriteAndMatrix(sprite);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,8 +11,10 @@
|
||||
#include "field_effect.h"
|
||||
#include "field_camera.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "fldeff_misc.h"
|
||||
#include "secret_base.h"
|
||||
#include "event_data.h"
|
||||
#include "event_scripts.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "metatile_behavior.h"
|
||||
#include "string_util.h"
|
||||
@ -20,70 +22,71 @@
|
||||
#include "constants/metatile_behaviors.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/vars.h"
|
||||
#include "fldeff_misc.h"
|
||||
|
||||
void sub_80F9C90(u8);
|
||||
void sub_80F9DFC(u8);
|
||||
extern struct MapPosition gPlayerFacingPosition;
|
||||
|
||||
void Task_SecretBasePCTurnOn(u8);
|
||||
static void sub_80F9C90(u8);
|
||||
static void sub_80F9DFC(u8);
|
||||
|
||||
void Task_PopSecretBaseBalloon(u8);
|
||||
void DoBalloonSoundEffect(s16);
|
||||
static void Task_SecretBasePCTurnOn(u8);
|
||||
|
||||
void Task_WateringBerryTreeAnim_1(u8);
|
||||
void Task_WateringBerryTreeAnim_2(u8);
|
||||
void Task_WateringBerryTreeAnim_3(u8);
|
||||
static void Task_PopSecretBaseBalloon(u8);
|
||||
static void DoBalloonSoundEffect(s16);
|
||||
|
||||
void sub_80F9C44(TaskFunc, u16, u16, u8);
|
||||
static void Task_WateringBerryTreeAnim_1(u8);
|
||||
static void Task_WateringBerryTreeAnim_2(u8);
|
||||
static void Task_WateringBerryTreeAnim_3(u8);
|
||||
|
||||
void FieldCallback_SecretBaseCave(void);
|
||||
static void sub_80F9C44(TaskFunc, u16, u16, u8);
|
||||
|
||||
static void FieldCallback_SecretBaseCave(void);
|
||||
static void CaveEntranceSpriteCallback1(struct Sprite *);
|
||||
static void CaveEntranceSpriteCallback2(struct Sprite *);
|
||||
static void CaveEntranceSpriteCallbackEnd(struct Sprite *);
|
||||
static void StartSecretBaseCaveFieldEffect(void);
|
||||
|
||||
void FieldCallback_SecretBaseTree(void);
|
||||
static void FieldCallback_SecretBaseTree(void);
|
||||
static void TreeEntranceSpriteCallback1(struct Sprite *);
|
||||
static void TreeEntranceSpriteCallback2(struct Sprite *);
|
||||
static void TreeEntranceSpriteCallbackEnd(struct Sprite *);
|
||||
static void StartSecretBaseTreeFieldEffect(void);
|
||||
|
||||
void FieldCallback_SecretBaseShrub(void);
|
||||
static void FieldCallback_SecretBaseShrub(void);
|
||||
static void ShrubEntranceSpriteCallback1(struct Sprite *);
|
||||
static void ShrubEntranceSpriteCallback2(struct Sprite *);
|
||||
static void ShrubEntranceSpriteCallbackEnd(struct Sprite *);
|
||||
static void StartSecretBaseShrubFieldEffect(void);
|
||||
|
||||
void SpriteCB_SandPillar_0(struct Sprite *);
|
||||
void SpriteCB_SandPillar_1(struct Sprite *);
|
||||
void SpriteCB_SandPillar_2(struct Sprite *);
|
||||
static void SpriteCB_SandPillar_0(struct Sprite *);
|
||||
static void SpriteCB_SandPillar_1(struct Sprite *);
|
||||
static void SpriteCB_SandPillar_2(struct Sprite *);
|
||||
|
||||
const u8 gSpriteImage_858D978[] = INCBIN_U8("graphics/unknown/858E588/0.4bpp");
|
||||
const u8 gSpriteImage_858D9F8[] = INCBIN_U8("graphics/unknown/858E588/1.4bpp");
|
||||
const u8 gSpriteImage_858DA78[] = INCBIN_U8("graphics/unknown/858E588/2.4bpp");
|
||||
const u8 gSpriteImage_858DAF8[] = INCBIN_U8("graphics/unknown/858E588/3.4bpp");
|
||||
const u8 gSpriteImage_858DB78[] = INCBIN_U8("graphics/unknown/858E588/4.4bpp");
|
||||
static const u8 gSpriteImage_858D978[] = INCBIN_U8("graphics/unknown/858E588/0.4bpp");
|
||||
static const u8 gSpriteImage_858D9F8[] = INCBIN_U8("graphics/unknown/858E588/1.4bpp");
|
||||
static const u8 gSpriteImage_858DA78[] = INCBIN_U8("graphics/unknown/858E588/2.4bpp");
|
||||
static const u8 gSpriteImage_858DAF8[] = INCBIN_U8("graphics/unknown/858E588/3.4bpp");
|
||||
static const u8 gSpriteImage_858DB78[] = INCBIN_U8("graphics/unknown/858E588/4.4bpp");
|
||||
|
||||
const u8 gUnusedEmptySpace_858DBF8[32] = {0};
|
||||
static const u8 gUnusedEmptySpace_858DBF8[32] = {0};
|
||||
|
||||
const u16 gFieldEffectObjectPalette7[] = INCBIN_U16("graphics/event_objects/palettes/field_effect_object_palette_07.gbapal");
|
||||
const u8 gSpriteImage_858DC38[] = INCBIN_U8("graphics/unknown/858E5D8/0.4bpp");
|
||||
const u8 gSpriteImage_858DCB8[] = INCBIN_U8("graphics/unknown/858E5D8/1.4bpp");
|
||||
const u8 gSpriteImage_858DD38[] = INCBIN_U8("graphics/unknown/858E5D8/2.4bpp");
|
||||
const u8 gSpriteImage_858DDB8[] = INCBIN_U8("graphics/unknown/858E5D8/3.4bpp");
|
||||
const u8 gSpriteImage_858DE38[] = INCBIN_U8("graphics/unknown/858E5D8/4.4bpp");
|
||||
const u8 gSpriteImage_858DEB8[] = INCBIN_U8("graphics/unknown/858E5B0/0.4bpp");
|
||||
const u8 gSpriteImage_858DF38[] = INCBIN_U8("graphics/unknown/858E5B0/1.4bpp");
|
||||
const u8 gSpriteImage_858DFB8[] = INCBIN_U8("graphics/unknown/858E5B0/2.4bpp");
|
||||
const u8 gSpriteImage_858E038[] = INCBIN_U8("graphics/unknown/858E5B0/3.4bpp");
|
||||
const u8 gSpriteImage_858E0B8[] = INCBIN_U8("graphics/unknown/858E5B0/4.4bpp");
|
||||
const u8 gSpriteImage_858E138[] = INCBIN_U8("graphics/unknown/858E5B0/5.4bpp");
|
||||
const u16 gFieldEffectObjectPalette8[] = INCBIN_U16("graphics/event_objects/palettes/field_effect_object_palette_08.gbapal");
|
||||
const u8 gSpriteImage_858E1D8[] = INCBIN_U8("graphics/unknown/858E674/0.4bpp");
|
||||
const u8 gSpriteImage_858E2D8[] = INCBIN_U8("graphics/unknown/858E674/1.4bpp");
|
||||
const u8 gSpriteImage_858E3D8[] = INCBIN_U8("graphics/unknown/858E674/2.4bpp");
|
||||
static const u16 gFieldEffectObjectPalette7[] = INCBIN_U16("graphics/event_objects/palettes/field_effect_object_palette_07.gbapal");
|
||||
static const u8 gSpriteImage_858DC38[] = INCBIN_U8("graphics/unknown/858E5D8/0.4bpp");
|
||||
static const u8 gSpriteImage_858DCB8[] = INCBIN_U8("graphics/unknown/858E5D8/1.4bpp");
|
||||
static const u8 gSpriteImage_858DD38[] = INCBIN_U8("graphics/unknown/858E5D8/2.4bpp");
|
||||
static const u8 gSpriteImage_858DDB8[] = INCBIN_U8("graphics/unknown/858E5D8/3.4bpp");
|
||||
static const u8 gSpriteImage_858DE38[] = INCBIN_U8("graphics/unknown/858E5D8/4.4bpp");
|
||||
static const u8 gSpriteImage_858DEB8[] = INCBIN_U8("graphics/unknown/858E5B0/0.4bpp");
|
||||
static const u8 gSpriteImage_858DF38[] = INCBIN_U8("graphics/unknown/858E5B0/1.4bpp");
|
||||
static const u8 gSpriteImage_858DFB8[] = INCBIN_U8("graphics/unknown/858E5B0/2.4bpp");
|
||||
static const u8 gSpriteImage_858E038[] = INCBIN_U8("graphics/unknown/858E5B0/3.4bpp");
|
||||
static const u8 gSpriteImage_858E0B8[] = INCBIN_U8("graphics/unknown/858E5B0/4.4bpp");
|
||||
static const u8 gSpriteImage_858E138[] = INCBIN_U8("graphics/unknown/858E5B0/5.4bpp");
|
||||
static const u16 gFieldEffectObjectPalette8[] = INCBIN_U16("graphics/event_objects/palettes/field_effect_object_palette_08.gbapal");
|
||||
static const u8 gSpriteImage_858E1D8[] = INCBIN_U8("graphics/unknown/858E674/0.4bpp");
|
||||
static const u8 gSpriteImage_858E2D8[] = INCBIN_U8("graphics/unknown/858E674/1.4bpp");
|
||||
static const u8 gSpriteImage_858E3D8[] = INCBIN_U8("graphics/unknown/858E674/2.4bpp");
|
||||
|
||||
const struct OamData gOamData_858E4D8 =
|
||||
static const struct OamData gOamData_858E4D8 =
|
||||
{
|
||||
.y = 0,
|
||||
.x = 0,
|
||||
@ -95,7 +98,7 @@ const struct OamData gOamData_858E4D8 =
|
||||
.priority = 2,
|
||||
};
|
||||
|
||||
const union AnimCmd gSpriteAnim_858E4E0[] =
|
||||
static const union AnimCmd gSpriteAnim_858E4E0[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 8),
|
||||
ANIMCMD_FRAME(1, 8),
|
||||
@ -105,7 +108,7 @@ const union AnimCmd gSpriteAnim_858E4E0[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd gSpriteAnim_858E4F8[] =
|
||||
static const union AnimCmd gSpriteAnim_858E4F8[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 8),
|
||||
ANIMCMD_FRAME(1, 8),
|
||||
@ -115,7 +118,7 @@ const union AnimCmd gSpriteAnim_858E4F8[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd gSpriteAnim_858E510[] =
|
||||
static const union AnimCmd gSpriteAnim_858E510[] =
|
||||
{
|
||||
ANIMCMD_FRAME(4, 8),
|
||||
ANIMCMD_FRAME(3, 8),
|
||||
@ -125,7 +128,7 @@ const union AnimCmd gSpriteAnim_858E510[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd gSpriteAnim_858E528[] =
|
||||
static const union AnimCmd gSpriteAnim_858E528[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 8, .hFlip = TRUE),
|
||||
ANIMCMD_FRAME(1, 8, .hFlip = TRUE),
|
||||
@ -135,7 +138,7 @@ const union AnimCmd gSpriteAnim_858E528[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd gSpriteAnim_858E540[] =
|
||||
static const union AnimCmd gSpriteAnim_858E540[] =
|
||||
{
|
||||
ANIMCMD_FRAME(4, 8, .hFlip = TRUE),
|
||||
ANIMCMD_FRAME(3, 8, .hFlip = TRUE),
|
||||
@ -145,7 +148,7 @@ const union AnimCmd gSpriteAnim_858E540[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd gSpriteAnim_858E558[] =
|
||||
static const union AnimCmd gSpriteAnim_858E558[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 8),
|
||||
ANIMCMD_FRAME(1, 8),
|
||||
@ -155,12 +158,12 @@ const union AnimCmd gSpriteAnim_858E558[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd *const gSpriteAnimTable_858E570[] =
|
||||
static const union AnimCmd *const gSpriteAnimTable_858E570[] =
|
||||
{
|
||||
gSpriteAnim_858E4E0,
|
||||
};
|
||||
|
||||
const union AnimCmd *const gSpriteAnimTable_858E574[] =
|
||||
static const union AnimCmd *const gSpriteAnimTable_858E574[] =
|
||||
{
|
||||
gSpriteAnim_858E4F8,
|
||||
gSpriteAnim_858E510,
|
||||
@ -168,12 +171,12 @@ const union AnimCmd *const gSpriteAnimTable_858E574[] =
|
||||
gSpriteAnim_858E540,
|
||||
};
|
||||
|
||||
const union AnimCmd *const gSpriteAnimTable_858E584[] =
|
||||
static const union AnimCmd *const gSpriteAnimTable_858E584[] =
|
||||
{
|
||||
gSpriteAnim_858E558,
|
||||
};
|
||||
|
||||
const struct SpriteFrameImage gUnknown_858E588[] =
|
||||
static const struct SpriteFrameImage gUnknown_858E588[] =
|
||||
{
|
||||
{gSpriteImage_858D978, 0x80},
|
||||
{gSpriteImage_858D9F8, 0x80},
|
||||
@ -182,7 +185,7 @@ const struct SpriteFrameImage gUnknown_858E588[] =
|
||||
{gSpriteImage_858DB78, 0x80},
|
||||
};
|
||||
|
||||
const struct SpriteFrameImage gUnknown_858E5B0[] =
|
||||
static const struct SpriteFrameImage gUnknown_858E5B0[] =
|
||||
{
|
||||
{gSpriteImage_858DEB8, 0x80},
|
||||
{gSpriteImage_858DF38, 0x80},
|
||||
@ -191,7 +194,7 @@ const struct SpriteFrameImage gUnknown_858E5B0[] =
|
||||
{gSpriteImage_858E0B8, 0x80},
|
||||
};
|
||||
|
||||
const struct SpriteFrameImage gUnknown_858E5D8[] =
|
||||
static const struct SpriteFrameImage gUnknown_858E5D8[] =
|
||||
{
|
||||
{gSpriteImage_858DC38, 0x80},
|
||||
{gSpriteImage_858DCB8, 0x80},
|
||||
@ -200,7 +203,7 @@ const struct SpriteFrameImage gUnknown_858E5D8[] =
|
||||
{gSpriteImage_858DE38, 0x80},
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gUnknown_0858E600 =
|
||||
static const struct SpriteTemplate gUnknown_0858E600 =
|
||||
{
|
||||
.tileTag = 0xFFFF,
|
||||
.paletteTag = 0x1003,
|
||||
@ -211,7 +214,7 @@ const struct SpriteTemplate gUnknown_0858E600 =
|
||||
.callback = CaveEntranceSpriteCallback1,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gUnknown_0858E618 =
|
||||
static const struct SpriteTemplate gUnknown_0858E618 =
|
||||
{
|
||||
.tileTag = 0xFFFF,
|
||||
.paletteTag = 0x1008,
|
||||
@ -222,7 +225,7 @@ const struct SpriteTemplate gUnknown_0858E618 =
|
||||
.callback = TreeEntranceSpriteCallback1,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gUnknown_0858E630 =
|
||||
static const struct SpriteTemplate gUnknown_0858E630 =
|
||||
{
|
||||
.tileTag = 0xFFFF,
|
||||
.paletteTag = 0x1008,
|
||||
@ -236,7 +239,7 @@ const struct SpriteTemplate gUnknown_0858E630 =
|
||||
const struct SpritePalette gFieldEffectObjectPaletteInfo7 = {gFieldEffectObjectPalette7, 0x1003};
|
||||
const struct SpritePalette gFieldEffectObjectPaletteInfo8 = {gFieldEffectObjectPalette8, 0x1008};
|
||||
|
||||
const struct OamData gOamData_858E658 =
|
||||
static const struct OamData gOamData_858E658 =
|
||||
{
|
||||
.x = 0,
|
||||
.y = 0,
|
||||
@ -248,7 +251,7 @@ const struct OamData gOamData_858E658 =
|
||||
.priority = 2,
|
||||
};
|
||||
|
||||
const union AnimCmd gSpriteAnim_858E660[] =
|
||||
static const union AnimCmd gSpriteAnim_858E660[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 6),
|
||||
ANIMCMD_FRAME(1, 6),
|
||||
@ -256,19 +259,19 @@ const union AnimCmd gSpriteAnim_858E660[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
const union AnimCmd *const gSpriteAnimTable_858E670[] =
|
||||
static const union AnimCmd *const gSpriteAnimTable_858E670[] =
|
||||
{
|
||||
gSpriteAnim_858E660,
|
||||
};
|
||||
|
||||
const struct SpriteFrameImage gUnknown_0858E674[] =
|
||||
static const struct SpriteFrameImage gUnknown_0858E674[] =
|
||||
{
|
||||
{gSpriteImage_858E1D8, 0x100},
|
||||
{gSpriteImage_858E2D8, 0x100},
|
||||
{gSpriteImage_858E3D8, 0x100},
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gUnknown_0858E68C =
|
||||
static const struct SpriteTemplate gUnknown_0858E68C =
|
||||
{
|
||||
.tileTag = 0xFFFF,
|
||||
.paletteTag = 0x100E,
|
||||
@ -340,7 +343,7 @@ bool8 sub_80F9C30(void)
|
||||
return FuncIsActiveTask(sub_80F9DFC);
|
||||
}
|
||||
|
||||
void sub_80F9C44(void (*taskfunc) (u8), u16 a1, u16 a2, u8 a3)
|
||||
static void sub_80F9C44(void (*taskfunc) (u8), u16 a1, u16 a2, u8 a3)
|
||||
{
|
||||
u8 taskId = CreateTask(taskfunc, a3);
|
||||
|
||||
@ -350,12 +353,11 @@ void sub_80F9C44(void (*taskfunc) (u8), u16 a1, u16 a2, u8 a3)
|
||||
gTasks[taskId].func(taskId);
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
void sub_80F9C90(u8 taskId)
|
||||
static void sub_80F9C90(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch(task->data[0])
|
||||
switch (task->data[0])
|
||||
{
|
||||
case 0:
|
||||
task->data[3] = 0x78;
|
||||
@ -365,7 +367,7 @@ void sub_80F9C90(u8 taskId)
|
||||
|
||||
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON);
|
||||
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->data[3], task->data[4]));
|
||||
SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->data[5], task->data[6]));
|
||||
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->data[5], task->data[6]));
|
||||
SetGpuReg(REG_OFFSET_WININ, 0x3F);
|
||||
SetGpuReg(REG_OFFSET_WINOUT, 0);
|
||||
|
||||
@ -400,7 +402,7 @@ void sub_80F9C90(u8 taskId)
|
||||
task->data[5] -= task->data[2];
|
||||
task->data[6] += task->data[2];
|
||||
|
||||
if (task->data[5] < 1 || task->data[2] > 0x9F)
|
||||
if (task->data[5] < 1 || task->data[6] > 0x9F)
|
||||
{
|
||||
task->data[5] = 0;
|
||||
task->data[6] = 0xA0;
|
||||
@ -416,189 +418,10 @@ void sub_80F9C90(u8 taskId)
|
||||
DestroyTask(taskId);
|
||||
return;
|
||||
}
|
||||
task->data[0] += 1;
|
||||
task->data[0]++;
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_80F9C90(u8 taskId)
|
||||
{
|
||||
asm_unified("\tpush {r4,r5,lr}\n"
|
||||
"\tlsls r0, 24\n"
|
||||
"\tlsrs r5, r0, 24\n"
|
||||
"\tlsls r0, r5, 2\n"
|
||||
"\tadds r0, r5\n"
|
||||
"\tlsls r0, 3\n"
|
||||
"\tldr r1, =gTasks\n"
|
||||
"\tadds r4, r0, r1\n"
|
||||
"\tmovs r1, 0x8\n"
|
||||
"\tldrsh r0, [r4, r1]\n"
|
||||
"\tcmp r0, 0x1\n"
|
||||
"\tbeq _080F9D10\n"
|
||||
"\tcmp r0, 0x1\n"
|
||||
"\tbgt _080F9CB8\n"
|
||||
"\tcmp r0, 0\n"
|
||||
"\tbeq _080F9CC2\n"
|
||||
"\tb _080F9DDE\n"
|
||||
"\t.pool\n"
|
||||
"_080F9CB8:\n"
|
||||
"\tcmp r0, 0x2\n"
|
||||
"\tbeq _080F9D32\n"
|
||||
"\tcmp r0, 0x3\n"
|
||||
"\tbeq _080F9D94\n"
|
||||
"\tb _080F9DDE\n"
|
||||
"_080F9CC2:\n"
|
||||
"\tmovs r0, 0x78\n"
|
||||
"\tstrh r0, [r4, 0xE]\n"
|
||||
"\tstrh r0, [r4, 0x10]\n"
|
||||
"\tmovs r0, 0x50\n"
|
||||
"\tstrh r0, [r4, 0x12]\n"
|
||||
"\tmovs r0, 0x51\n"
|
||||
"\tstrh r0, [r4, 0x14]\n"
|
||||
"\tmovs r1, 0x80\n"
|
||||
"\tlsls r1, 6\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tbl SetGpuRegBits\n"
|
||||
"\tldrh r1, [r4, 0xE]\n"
|
||||
"\tlsls r1, 8\n"
|
||||
"\tldrh r0, [r4, 0x10]\n"
|
||||
"\torrs r1, r0\n"
|
||||
"\tlsls r1, 16\n"
|
||||
"\tlsrs r1, 16\n"
|
||||
"\tmovs r0, 0x40\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tldrh r1, [r4, 0x12]\n"
|
||||
"\tlsls r1, 8\n"
|
||||
"\tldrh r0, [r4, 0x14]\n"
|
||||
"\torrs r1, r0\n"
|
||||
"\tlsls r1, 16\n"
|
||||
"\tlsrs r1, 16\n"
|
||||
"\tmovs r0, 0x44\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r0, 0x48\n"
|
||||
"\tmovs r1, 0x3F\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r0, 0x4A\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tb _080F9DEE\n"
|
||||
"_080F9D10:\n"
|
||||
"\tmovs r0, 0x50\n"
|
||||
"\tbl GetGpuReg\n"
|
||||
"\tstrh r0, [r4, 0x16]\n"
|
||||
"\tmovs r0, 0x54\n"
|
||||
"\tbl GetGpuReg\n"
|
||||
"\tstrh r0, [r4, 0x18]\n"
|
||||
"\tmovs r0, 0x50\n"
|
||||
"\tmovs r1, 0xBF\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r0, 0x54\n"
|
||||
"\tmovs r1, 0x10\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tb _080F9DEE\n"
|
||||
"_080F9D32:\n"
|
||||
"\tldrh r0, [r4, 0xE]\n"
|
||||
"\tldrh r1, [r4, 0xA]\n"
|
||||
"\tsubs r0, r1\n"
|
||||
"\tmovs r5, 0\n"
|
||||
"\tstrh r0, [r4, 0xE]\n"
|
||||
"\tldrh r2, [r4, 0x10]\n"
|
||||
"\tadds r1, r2\n"
|
||||
"\tstrh r1, [r4, 0x10]\n"
|
||||
"\tlsls r0, 16\n"
|
||||
"\tcmp r0, 0\n"
|
||||
"\tble _080F9D50\n"
|
||||
"\tlsls r0, r1, 16\n"
|
||||
"\tasrs r0, 16\n"
|
||||
"\tcmp r0, 0xEF\n"
|
||||
"\tble _080F9D76\n"
|
||||
"_080F9D50:\n"
|
||||
"\tstrh r5, [r4, 0xE]\n"
|
||||
"\tmovs r0, 0xF0\n"
|
||||
"\tstrh r0, [r4, 0x10]\n"
|
||||
"\tmovs r0, 0x54\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tldrh r1, [r4, 0x16]\n"
|
||||
"\tmovs r0, 0x50\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r0, 0x1\n"
|
||||
"\tnegs r0, r0\n"
|
||||
"\tmovs r1, 0\n"
|
||||
"\tmovs r2, 0\n"
|
||||
"\tbl BlendPalettes\n"
|
||||
"\tldr r0, =gPlttBufferFaded\n"
|
||||
"\tstrh r5, [r0]\n"
|
||||
"_080F9D76:\n"
|
||||
"\tldrh r1, [r4, 0xE]\n"
|
||||
"\tlsls r1, 8\n"
|
||||
"\tldrh r0, [r4, 0x10]\n"
|
||||
"\torrs r1, r0\n"
|
||||
"\tlsls r1, 16\n"
|
||||
"\tlsrs r1, 16\n"
|
||||
"\tmovs r0, 0x40\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r1, 0xE\n"
|
||||
"\tldrsh r0, [r4, r1]\n"
|
||||
"\tb _080F9DD8\n"
|
||||
"\t.pool\n"
|
||||
"_080F9D94:\n"
|
||||
"\tldrh r0, [r4, 0x12]\n"
|
||||
"\tldrh r1, [r4, 0xC]\n"
|
||||
"\tsubs r0, r1\n"
|
||||
"\tstrh r0, [r4, 0x12]\n"
|
||||
"\tldrh r2, [r4, 0x14]\n"
|
||||
"\tadds r1, r2\n"
|
||||
"\tstrh r1, [r4, 0x14]\n"
|
||||
"\tlsls r0, 16\n"
|
||||
"\tcmp r0, 0\n"
|
||||
"\tble _080F9DB0\n"
|
||||
"\tlsls r0, r1, 16\n"
|
||||
"\tasrs r0, 16\n"
|
||||
"\tcmp r0, 0x9F\n"
|
||||
"\tble _080F9DC2\n"
|
||||
"_080F9DB0:\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tstrh r0, [r4, 0x12]\n"
|
||||
"\tmovs r0, 0xA0\n"
|
||||
"\tstrh r0, [r4, 0x14]\n"
|
||||
"\tmovs r1, 0x80\n"
|
||||
"\tlsls r1, 6\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"\tbl ClearGpuRegBits\n"
|
||||
"_080F9DC2:\n"
|
||||
"\tldrh r1, [r4, 0x12]\n"
|
||||
"\tlsls r1, 8\n"
|
||||
"\tldrh r0, [r4, 0x14]\n"
|
||||
"\torrs r1, r0\n"
|
||||
"\tlsls r1, 16\n"
|
||||
"\tlsrs r1, 16\n"
|
||||
"\tmovs r0, 0x44\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tmovs r1, 0x12\n"
|
||||
"\tldrsh r0, [r4, r1]\n"
|
||||
"_080F9DD8:\n"
|
||||
"\tcmp r0, 0\n"
|
||||
"\tbne _080F9DF4\n"
|
||||
"\tb _080F9DEE\n"
|
||||
"_080F9DDE:\n"
|
||||
"\tldrh r1, [r4, 0x16]\n"
|
||||
"\tmovs r0, 0x50\n"
|
||||
"\tbl SetGpuReg\n"
|
||||
"\tadds r0, r5, 0\n"
|
||||
"\tbl DestroyTask\n"
|
||||
"\tb _080F9DF4\n"
|
||||
"_080F9DEE:\n"
|
||||
"\tldrh r0, [r4, 0x8]\n"
|
||||
"\tadds r0, 0x1\n"
|
||||
"\tstrh r0, [r4, 0x8]\n"
|
||||
"_080F9DF4:\n"
|
||||
"\tpop {r4,r5}\n"
|
||||
"\tpop {r0}\n"
|
||||
"\tbx r0");
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_80F9DFC(u8 taskId)
|
||||
static void sub_80F9DFC(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
@ -660,16 +483,16 @@ void sub_80F9DFC(u8 taskId)
|
||||
DestroyTask(taskId);
|
||||
return;
|
||||
}
|
||||
task->data[0] += 1;
|
||||
task->data[0]++;
|
||||
}
|
||||
|
||||
void SetCurrentSecretBase(void)
|
||||
static void SetCurrentSecretBase(void)
|
||||
{
|
||||
sub_80E9608(&gPlayerFacingPosition, gMapHeader.events);
|
||||
sub_80E8B6C();
|
||||
}
|
||||
|
||||
void AdjustSecretPowerSpritePixelOffsets(void)
|
||||
static void AdjustSecretPowerSpritePixelOffsets(void)
|
||||
{
|
||||
if (gPlayerAvatar.flags & 0x6)
|
||||
{
|
||||
@ -756,7 +579,7 @@ bool8 SetUpFieldMove_SecretPower(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void FieldCallback_SecretBaseCave(void)
|
||||
static void FieldCallback_SecretBaseCave(void)
|
||||
{
|
||||
gFieldEffectArguments[0] = GetCursorSelectionMonId();
|
||||
ScriptContext1_SetupScript(EventScript_275A86);
|
||||
@ -818,7 +641,7 @@ static void CaveEntranceSpriteCallbackEnd(struct Sprite *sprite)
|
||||
EnableBothScriptContexts();
|
||||
}
|
||||
|
||||
void FieldCallback_SecretBaseTree(void)
|
||||
static void FieldCallback_SecretBaseTree(void)
|
||||
{
|
||||
gFieldEffectArguments[0] = GetCursorSelectionMonId();
|
||||
ScriptContext1_SetupScript(EventScript_275ADF);
|
||||
@ -892,7 +715,7 @@ static void TreeEntranceSpriteCallbackEnd(struct Sprite *sprite)
|
||||
EnableBothScriptContexts();
|
||||
}
|
||||
|
||||
void FieldCallback_SecretBaseShrub(void)
|
||||
static void FieldCallback_SecretBaseShrub(void)
|
||||
{
|
||||
gFieldEffectArguments[0] = GetCursorSelectionMonId();
|
||||
ScriptContext1_SetupScript(EventScript_275B38);
|
||||
@ -956,7 +779,7 @@ static void ShrubEntranceSpriteCallbackEnd(struct Sprite *sprite)
|
||||
EnableBothScriptContexts();
|
||||
}
|
||||
|
||||
u32 FldEff_SecretBasePCTurnOn(void)
|
||||
bool8 FldEff_SecretBasePCTurnOn(void)
|
||||
{
|
||||
s16 x, y;
|
||||
u8 taskId;
|
||||
@ -968,10 +791,10 @@ u32 FldEff_SecretBasePCTurnOn(void)
|
||||
gTasks[taskId].data[1] = y;
|
||||
gTasks[taskId].data[2] = 0;
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void Task_SecretBasePCTurnOn(u8 taskId)
|
||||
static void Task_SecretBasePCTurnOn(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
@ -1025,7 +848,7 @@ void PopSecretBaseBalloon(s16 metatileId, s16 x, s16 y)
|
||||
gTasks[taskId].data[4] = 1;
|
||||
}
|
||||
|
||||
void Task_PopSecretBaseBalloon(u8 taskId)
|
||||
static void Task_PopSecretBaseBalloon(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
@ -1049,7 +872,7 @@ void Task_PopSecretBaseBalloon(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
void DoBalloonSoundEffect(s16 metatileId)
|
||||
static void DoBalloonSoundEffect(s16 metatileId)
|
||||
{
|
||||
switch (metatileId)
|
||||
{
|
||||
@ -1078,7 +901,7 @@ bool8 FldEff_NopA700(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void DoSecretBaseBreakableDoorEffect(s16 x, s16 y)
|
||||
static void DoSecretBaseBreakableDoorEffect(s16 x, s16 y)
|
||||
{
|
||||
PlaySE(SE_TOY_KABE);
|
||||
MapGridSetMetatileIdAt(x, y, 630);
|
||||
@ -1087,7 +910,7 @@ void DoSecretBaseBreakableDoorEffect(s16 x, s16 y)
|
||||
CurrentMapDrawMetatileAt(x, y - 1);
|
||||
}
|
||||
|
||||
void Task_ShatterSecretBaseBreakableDoor(u8 taskId)
|
||||
static void Task_ShatterSecretBaseBreakableDoor(u8 taskId)
|
||||
{
|
||||
if (gTasks[taskId].data[0] == 7)
|
||||
{
|
||||
@ -1118,7 +941,7 @@ void ShatterSecretBaseBreakableDoor(s16 x, s16 y)
|
||||
}
|
||||
|
||||
#define tMetatileID data[0]
|
||||
void Task_SecretBaseMusicNoteMatSound(u8 taskId)
|
||||
static void Task_SecretBaseMusicNoteMatSound(u8 taskId)
|
||||
{
|
||||
if (gTasks[taskId].data[1] == 7)
|
||||
{
|
||||
@ -1167,7 +990,7 @@ void PlaySecretBaseMusicNoteMatSound(s16 metatileId)
|
||||
}
|
||||
#undef tMetatileID
|
||||
|
||||
void SpriteCB_GlitterMatSparkle(struct Sprite *sprite)
|
||||
static void SpriteCB_GlitterMatSparkle(struct Sprite *sprite)
|
||||
{
|
||||
sprite->data[0]++;
|
||||
|
||||
@ -1222,30 +1045,30 @@ bool8 FldEff_SandPillar(void)
|
||||
gSprites[gPlayerAvatar.spriteId].oam.x + 8,
|
||||
gSprites[gPlayerAvatar.spriteId].oam.y,
|
||||
148);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case DIR_WEST:
|
||||
CreateSprite(&gUnknown_0858E68C,
|
||||
gSprites[gPlayerAvatar.spriteId].oam.x - 8,
|
||||
gSprites[gPlayerAvatar.spriteId].oam.y + 16,
|
||||
148);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case DIR_EAST:
|
||||
CreateSprite(&gUnknown_0858E68C,
|
||||
gSprites[gPlayerAvatar.spriteId].oam.x + 24,
|
||||
gSprites[gPlayerAvatar.spriteId].oam.y + 16,
|
||||
148);
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void SpriteCB_SandPillar_0(struct Sprite *sprite)
|
||||
static void SpriteCB_SandPillar_0(struct Sprite *sprite)
|
||||
{
|
||||
PlaySE(SE_W088);
|
||||
|
||||
@ -1253,16 +1076,16 @@ void SpriteCB_SandPillar_0(struct Sprite *sprite)
|
||||
MapGridSetMetatileIdAt(gFieldEffectArguments[5], gFieldEffectArguments[6] - 1, 3586);
|
||||
else
|
||||
MapGridSetMetatileIdAt(gFieldEffectArguments[5], gFieldEffectArguments[6] - 1, 644);
|
||||
|
||||
|
||||
MapGridSetMetatileIdAt(gFieldEffectArguments[5], gFieldEffectArguments[6], 522);
|
||||
CurrentMapDrawMetatileAt(gFieldEffectArguments[5], gFieldEffectArguments[6] - 1);
|
||||
CurrentMapDrawMetatileAt(gFieldEffectArguments[5], gFieldEffectArguments[6]);
|
||||
|
||||
|
||||
sprite->data[0] = 0;
|
||||
sprite->callback = SpriteCB_SandPillar_1;
|
||||
}
|
||||
|
||||
void SpriteCB_SandPillar_1(struct Sprite *sprite)
|
||||
static void SpriteCB_SandPillar_1(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[0] < 18)
|
||||
{
|
||||
@ -1277,7 +1100,7 @@ void SpriteCB_SandPillar_1(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
void SpriteCB_SandPillar_2(struct Sprite *sprite)
|
||||
static void SpriteCB_SandPillar_2(struct Sprite *sprite)
|
||||
{
|
||||
FieldEffectStop(sprite, FLDEFF_SAND_PILLAR);
|
||||
EnableBothScriptContexts();
|
||||
@ -1343,71 +1166,30 @@ void GetShieldToyTVDecorationInfo(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
bool8 sub_80FADE4(u16 arg0, u8 arg1)
|
||||
{
|
||||
if (CurrentMapIsSecretBase())
|
||||
if (!CurrentMapIsSecretBase())
|
||||
return FALSE;
|
||||
|
||||
if (!arg1)
|
||||
{
|
||||
if (arg1 == 0)
|
||||
{
|
||||
if ((u16)(arg0 + 0xfffffd7b) <= 1 || (arg0 == 0x237))
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (arg0 == 0x28d || arg0 == 0x23f)
|
||||
return TRUE;
|
||||
}
|
||||
if (arg0 == 0x285 || arg0 == 0x286)
|
||||
return TRUE;
|
||||
if (arg0 == 0x237)
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (arg0 == 0x28d)
|
||||
return TRUE;
|
||||
if (arg0 == 0x23F)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
bool8 sub_80FADE4(u16 arg0, u8 arg1)
|
||||
{
|
||||
asm_unified("\tpush {r4-r6,lr}\n"
|
||||
"\tlsls r0, 16\n"
|
||||
"\tlsrs r4, r0, 16\n"
|
||||
"\tadds r6, r4, 0\n"
|
||||
"\tlsls r1, 24\n"
|
||||
"\tlsrs r5, r1, 24\n"
|
||||
"\tbl CurrentMapIsSecretBase\n"
|
||||
"\tlsls r0, 24\n"
|
||||
"\tcmp r0, 0\n"
|
||||
"\tbeq _080FAE28\n"
|
||||
"\tcmp r5, 0\n"
|
||||
"\tbne _080FAE1C\n"
|
||||
"\tldr r1, =0xfffffd7b\n"
|
||||
"\tadds r0, r4, r1\n"
|
||||
"\tlsls r0, 16\n"
|
||||
"\tlsrs r0, 16\n"
|
||||
"\tcmp r0, 0x1\n"
|
||||
"\tbls _080FAE10\n"
|
||||
"\tldr r0, =0x00000237\n"
|
||||
"\tcmp r4, r0\n"
|
||||
"\tbne _080FAE28\n"
|
||||
"_080FAE10:\n"
|
||||
"\tmovs r0, 0x1\n"
|
||||
"\tb _080FAE2A\n"
|
||||
"\t.pool\n"
|
||||
"_080FAE1C:\n"
|
||||
"\tldr r0, =0x0000028d\n"
|
||||
"\tcmp r4, r0\n"
|
||||
"\tbeq _080FAE10\n"
|
||||
"\tldr r0, =0x0000023f\n"
|
||||
"\tcmp r6, r0\n"
|
||||
"\tbeq _080FAE10\n"
|
||||
"_080FAE28:\n"
|
||||
"\tmovs r0, 0\n"
|
||||
"_080FAE2A:\n"
|
||||
"\tpop {r4-r6}\n"
|
||||
"\tpop {r1}\n"
|
||||
"\tbx r1\n"
|
||||
"\t.pool");
|
||||
}
|
||||
#endif
|
||||
|
||||
void Task_FieldPoisonEffect(u8 taskId)
|
||||
static void Task_FieldPoisonEffect(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
@ -1441,15 +1223,15 @@ bool32 FldEffPoison_IsActive(void)
|
||||
return FuncIsActiveTask(Task_FieldPoisonEffect);
|
||||
}
|
||||
|
||||
void Task_WateringBerryTreeAnim_0(u8 taskId)
|
||||
static void Task_WateringBerryTreeAnim_0(u8 taskId)
|
||||
{
|
||||
gTasks[taskId].func = Task_WateringBerryTreeAnim_1;
|
||||
}
|
||||
|
||||
void Task_WateringBerryTreeAnim_1(u8 taskId)
|
||||
static void Task_WateringBerryTreeAnim_1(u8 taskId)
|
||||
{
|
||||
struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId];
|
||||
|
||||
|
||||
if (!EventObjectIsMovementOverridden(playerEventObj)
|
||||
|| EventObjectClearHeldMovementIfFinished(playerEventObj))
|
||||
{
|
||||
@ -1459,23 +1241,23 @@ void Task_WateringBerryTreeAnim_1(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
void Task_WateringBerryTreeAnim_2(u8 taskId)
|
||||
static void Task_WateringBerryTreeAnim_2(u8 taskId)
|
||||
{
|
||||
struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId];
|
||||
|
||||
|
||||
if (EventObjectClearHeldMovementIfFinished(playerEventObj))
|
||||
{
|
||||
s16 value = gTasks[taskId].data[1]++;
|
||||
|
||||
|
||||
if (value < 10)
|
||||
EventObjectSetHeldMovement(playerEventObj, GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection()));
|
||||
|
||||
|
||||
else
|
||||
gTasks[taskId].func = Task_WateringBerryTreeAnim_3;
|
||||
}
|
||||
}
|
||||
|
||||
void Task_WateringBerryTreeAnim_3(u8 taskId)
|
||||
static void Task_WateringBerryTreeAnim_3(u8 taskId)
|
||||
{
|
||||
SetPlayerAvatarTransitionFlags(sub_808BCD0());
|
||||
DestroyTask(taskId);
|
||||
|
2902
src/party_menu.c
2902
src/party_menu.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user