finished menu_indicators
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ _0807F65E:
|
|||||||
ldr r0, _0807F68C @ =sub_800FD9C
|
ldr r0, _0807F68C @ =sub_800FD9C
|
||||||
bl SetMainCallback2
|
bl SetMainCallback2
|
||||||
bl sub_806D7E8
|
bl sub_806D7E8
|
||||||
bl DoPoisonFieldEffect_timer_set
|
bl ClearPoisonStepCounter
|
||||||
adds r0, r5, 0
|
adds r0, r5, 0
|
||||||
bl DestroyTask
|
bl DestroyTask
|
||||||
_0807F686:
|
_0807F686:
|
||||||
|
|||||||
@@ -1901,8 +1901,8 @@ _0806D780: .4byte 0x00004021
|
|||||||
_0806D784: .4byte gPlayerParty
|
_0806D784: .4byte gPlayerParty
|
||||||
thumb_func_end AdjustFriendship_step
|
thumb_func_end AdjustFriendship_step
|
||||||
|
|
||||||
thumb_func_start DoPoisonFieldEffect_timer_set
|
thumb_func_start ClearPoisonStepCounter
|
||||||
DoPoisonFieldEffect_timer_set: @ 806D788
|
ClearPoisonStepCounter: @ 806D788
|
||||||
push {lr}
|
push {lr}
|
||||||
ldr r0, _0806D798 @ =0x00004022
|
ldr r0, _0806D798 @ =0x00004022
|
||||||
movs r1, 0
|
movs r1, 0
|
||||||
@@ -1911,7 +1911,7 @@ DoPoisonFieldEffect_timer_set: @ 806D788
|
|||||||
bx r0
|
bx r0
|
||||||
.align 2, 0
|
.align 2, 0
|
||||||
_0806D798: .4byte 0x00004022
|
_0806D798: .4byte 0x00004022
|
||||||
thumb_func_end DoPoisonFieldEffect_timer_set
|
thumb_func_end ClearPoisonStepCounter
|
||||||
|
|
||||||
thumb_func_start DoPoisonFieldEffect_step
|
thumb_func_start DoPoisonFieldEffect_step
|
||||||
DoPoisonFieldEffect_step: @ 806D79C
|
DoPoisonFieldEffect_step: @ 806D79C
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,46 +0,0 @@
|
|||||||
.section .rodata
|
|
||||||
.align 2
|
|
||||||
gUnknown_846325C:: @ 846325C
|
|
||||||
.incbin "baserom.gba", 0x46325C, 0x48
|
|
||||||
|
|
||||||
gUnknown_84632A4:: @ 84632A4
|
|
||||||
.incbin "baserom.gba", 0x4632A4, 0x18
|
|
||||||
|
|
||||||
gUnknown_84632BC:: @ 84632BC
|
|
||||||
.incbin "baserom.gba", 0x4632BC, 0x4
|
|
||||||
|
|
||||||
gUnknown_84632C0:: @ 84632C0
|
|
||||||
.incbin "baserom.gba", 0x4632C0, 0x4
|
|
||||||
|
|
||||||
gUnknown_84632C4:: @ 84632C4
|
|
||||||
.incbin "baserom.gba", 0x4632C4, 0x4
|
|
||||||
|
|
||||||
gUnknown_84632C8:: @ 84632C8
|
|
||||||
.incbin "baserom.gba", 0x4632C8, 0x4
|
|
||||||
|
|
||||||
gUnknown_84632CC:: @ 84632CC
|
|
||||||
.incbin "baserom.gba", 0x4632CC, 0x4
|
|
||||||
|
|
||||||
gUnknown_84632D0:: @ 84632D0
|
|
||||||
.incbin "baserom.gba", 0x4632D0, 0x4
|
|
||||||
|
|
||||||
gUnknown_84632D4:: @ 84632D4
|
|
||||||
.incbin "baserom.gba", 0x4632D4, 0x4
|
|
||||||
|
|
||||||
gUnknown_84632D8:: @ 84632D8
|
|
||||||
.incbin "baserom.gba", 0x4632D8, 0x18
|
|
||||||
|
|
||||||
gUnknown_84632F0:: @ 84632F0
|
|
||||||
.incbin "baserom.gba", 0x4632F0, 0x18
|
|
||||||
|
|
||||||
gUnknown_8463308:: @ 8463308
|
|
||||||
.incbin "baserom.gba", 0x463308, 0x20
|
|
||||||
|
|
||||||
gUnknown_8463328:: @ 8463328
|
|
||||||
.incbin "baserom.gba", 0x463328, 0x70
|
|
||||||
|
|
||||||
gUnknown_8463398:: @ 8463398
|
|
||||||
.incbin "baserom.gba", 0x463398, 0x40
|
|
||||||
|
|
||||||
gUnknown_84633D8:: @ 84633D8
|
|
||||||
.incbin "baserom.gba", 0x4633D8, 0x44
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
JASC-PAL
|
||||||
|
0100
|
||||||
|
16
|
||||||
|
115 164 197
|
||||||
|
255 82 0
|
||||||
|
131 32 0
|
||||||
|
255 0 255
|
||||||
|
255 0 255
|
||||||
|
255 0 255
|
||||||
|
255 0 255
|
||||||
|
255 0 255
|
||||||
|
255 0 255
|
||||||
|
255 0 255
|
||||||
|
255 0 255
|
||||||
|
255 0 255
|
||||||
|
255 0 255
|
||||||
|
255 0 255
|
||||||
|
255 0 255
|
||||||
|
255 0 255
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 167 B |
Binary file not shown.
|
After Width: | Height: | Size: 197 B |
Binary file not shown.
|
After Width: | Height: | Size: 156 B |
@@ -6,7 +6,7 @@
|
|||||||
enum {
|
enum {
|
||||||
FLDPSN_NONE,
|
FLDPSN_NONE,
|
||||||
FLDPSN_PSN,
|
FLDPSN_PSN,
|
||||||
FLDPSN_FNT
|
FLDPSN_FNT,
|
||||||
};
|
};
|
||||||
|
|
||||||
void ExecuteWhiteOut(void);
|
void ExecuteWhiteOut(void);
|
||||||
|
|||||||
+7
-9
@@ -202,11 +202,11 @@ extern const u8 gItemPcBgPals[];
|
|||||||
extern const u8 gItemPcTilemap[];
|
extern const u8 gItemPcTilemap[];
|
||||||
|
|
||||||
// item_menu_icons
|
// item_menu_icons
|
||||||
extern const u8 gUnknown_8E8362C[];
|
extern const u32 gUnknown_8E8362C[];
|
||||||
extern const u8 gUnknown_8E83DBC[];
|
extern const u32 gUnknown_8E83DBC[];
|
||||||
extern const u8 gUnknown_8E84560[];
|
extern const u32 gUnknown_8E84560[];
|
||||||
extern const u8 gFile_graphics_interface_bag_swap_sheet[];
|
extern const u32 gFile_graphics_interface_bag_swap_sheet[];
|
||||||
extern const u8 gFile_graphics_interface_bag_swap_palette[];
|
extern const u32 gFile_graphics_interface_bag_swap_palette[];
|
||||||
extern const u8 gFile_graphics_items_icons_question_mark_sheet[];
|
extern const u8 gFile_graphics_items_icons_question_mark_sheet[];
|
||||||
extern const u8 gFile_graphics_items_icon_palettes_question_mark_palette[];
|
extern const u8 gFile_graphics_items_icon_palettes_question_mark_palette[];
|
||||||
extern const u8 gFile_graphics_items_icons_master_ball_sheet[];
|
extern const u8 gFile_graphics_items_icons_master_ball_sheet[];
|
||||||
@@ -266,12 +266,10 @@ extern const u8 gFile_graphics_items_icon_palettes_soda_pop_palette[];
|
|||||||
extern const u8 gFile_graphics_items_icons_lemonade_sheet[];
|
extern const u8 gFile_graphics_items_icons_lemonade_sheet[];
|
||||||
extern const u8 gFile_graphics_items_icon_palettes_lemonade_palette[];
|
extern const u8 gFile_graphics_items_icon_palettes_lemonade_palette[];
|
||||||
extern const u8 gFile_graphics_items_icons_moomoo_milk_sheet[];
|
extern const u8 gFile_graphics_items_icons_moomoo_milk_sheet[];
|
||||||
extern const u8 gFile_graphics_items_icon_palettes_moomoo_milk_palette[];
|
extern const u8 gFile_graphics_items_icon_palettes_moomoo_milk_palette[];;
|
||||||
extern const u8 gFile_graphics_items_icons_powder_sheet[];
|
|
||||||
extern const u8 gFile_graphics_items_icon_palettes_energy_powder_palette[];
|
extern const u8 gFile_graphics_items_icon_palettes_energy_powder_palette[];
|
||||||
extern const u8 gFile_graphics_items_icons_energy_root_sheet[];
|
extern const u8 gFile_graphics_items_icons_energy_root_sheet[];
|
||||||
extern const u8 gFile_graphics_items_icon_palettes_energy_root_palette[];
|
extern const u8 gFile_graphics_items_icon_palettes_energy_root_palette[];
|
||||||
extern const u8 gFile_graphics_items_icons_powder_sheet[];
|
|
||||||
extern const u8 gFile_graphics_items_icon_palettes_heal_powder_palette[];
|
extern const u8 gFile_graphics_items_icon_palettes_heal_powder_palette[];
|
||||||
extern const u8 gFile_graphics_items_icons_revival_herb_sheet[];
|
extern const u8 gFile_graphics_items_icons_revival_herb_sheet[];
|
||||||
extern const u8 gFile_graphics_items_icon_palettes_revival_herb_palette[];
|
extern const u8 gFile_graphics_items_icon_palettes_revival_herb_palette[];
|
||||||
@@ -299,7 +297,7 @@ extern const u8 gFile_graphics_items_icons_berry_juice_sheet[];
|
|||||||
extern const u8 gFile_graphics_items_icon_palettes_berry_juice_palette[];
|
extern const u8 gFile_graphics_items_icon_palettes_berry_juice_palette[];
|
||||||
extern const u8 gFile_graphics_items_icons_sacred_ash_sheet[];
|
extern const u8 gFile_graphics_items_icons_sacred_ash_sheet[];
|
||||||
extern const u8 gFile_graphics_items_icon_palettes_sacred_ash_palette[];
|
extern const u8 gFile_graphics_items_icon_palettes_sacred_ash_palette[];
|
||||||
extern const u8 gFile_graphics_items_icons_powder_sheet[];
|
extern const u32 gFile_graphics_items_icons_powder_sheet[];
|
||||||
extern const u8 gFile_graphics_items_icon_palettes_shoal_salt_palette[];
|
extern const u8 gFile_graphics_items_icon_palettes_shoal_salt_palette[];
|
||||||
extern const u8 gFile_graphics_items_icons_shoal_shell_sheet[];
|
extern const u8 gFile_graphics_items_icons_shoal_shell_sheet[];
|
||||||
extern const u8 gFile_graphics_items_icon_palettes_shell_palette[];
|
extern const u8 gFile_graphics_items_icon_palettes_shell_palette[];
|
||||||
|
|||||||
+26
-4
@@ -4,9 +4,21 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
// Exported type declarations
|
#define LIST_NOTHING_CHOSEN -1
|
||||||
|
#define LIST_CANCEL -2
|
||||||
|
#define LIST_HEADER -3
|
||||||
|
|
||||||
// Exported RAM declarations
|
#define LIST_NO_MULTIPLE_SCROLL 0
|
||||||
|
#define LIST_MULTIPLE_SCROLL_DPAD 1
|
||||||
|
#define LIST_MULTIPLE_SCROLL_L_R 2
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
SCROLL_ARROW_LEFT,
|
||||||
|
SCROLL_ARROW_RIGHT,
|
||||||
|
SCROLL_ARROW_UP,
|
||||||
|
SCROLL_ARROW_DOWN,
|
||||||
|
};
|
||||||
|
|
||||||
struct ListMenuItem
|
struct ListMenuItem
|
||||||
{
|
{
|
||||||
@@ -38,8 +50,9 @@ struct ListMenuTemplate
|
|||||||
u8 cursorKind:2; // x40, x80
|
u8 cursorKind:2; // x40, x80
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ListMenu {
|
struct ListMenu
|
||||||
struct ListMenuTemplate _template;
|
{
|
||||||
|
struct ListMenuTemplate template;
|
||||||
u16 scrollOffset;
|
u16 scrollOffset;
|
||||||
u16 selectedRow;
|
u16 selectedRow;
|
||||||
u8 unk_1C;
|
u8 unk_1C;
|
||||||
@@ -48,6 +61,15 @@ struct ListMenu {
|
|||||||
u8 unk_1F;
|
u8 unk_1F;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ListMenuWindowRect
|
||||||
|
{
|
||||||
|
u8 x;
|
||||||
|
u8 y;
|
||||||
|
u8 width;
|
||||||
|
u8 height;
|
||||||
|
u8 palNum;
|
||||||
|
};
|
||||||
|
|
||||||
extern struct ListMenuTemplate gUnknown_03006310;
|
extern struct ListMenuTemplate gUnknown_03006310;
|
||||||
extern struct ListMenuTemplate gMultiuseListMenuTemplate;
|
extern struct ListMenuTemplate gMultiuseListMenuTemplate;
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,18 @@
|
|||||||
|
|
||||||
// Exported RAM declarations
|
// Exported RAM declarations
|
||||||
|
|
||||||
|
struct ScrollIndicatorPair
|
||||||
|
{
|
||||||
|
u8 field_0;
|
||||||
|
u16 *scrollOffset;
|
||||||
|
u16 fullyUpThreshold;
|
||||||
|
u16 fullyDownThreshold;
|
||||||
|
u8 topSpriteId;
|
||||||
|
u8 bottomSpriteId;
|
||||||
|
u16 tileTag;
|
||||||
|
u16 palTag;
|
||||||
|
};
|
||||||
|
|
||||||
struct ScrollArrowsTemplate
|
struct ScrollArrowsTemplate
|
||||||
{
|
{
|
||||||
u8 firstArrowType;
|
u8 firstArrowType;
|
||||||
@@ -22,9 +34,48 @@ struct ScrollArrowsTemplate
|
|||||||
u8 palNum;
|
u8 palNum;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ScrollIndicatorTemplate
|
||||||
|
{
|
||||||
|
u8 animNum:4;
|
||||||
|
u8 bounceDir:4;
|
||||||
|
u8 multiplier;
|
||||||
|
s16 frequency;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CursorStruct
|
||||||
|
{
|
||||||
|
u8 left;
|
||||||
|
u8 top;
|
||||||
|
u16 rowWidth;
|
||||||
|
u16 rowHeight;
|
||||||
|
u16 tileTag;
|
||||||
|
u16 palTag;
|
||||||
|
u8 palNum;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RedOutlineCursor
|
||||||
|
{
|
||||||
|
struct SubspriteTable subspriteTable;
|
||||||
|
struct Subsprite *subspritesPtr;
|
||||||
|
u8 spriteId;
|
||||||
|
u16 tileTag;
|
||||||
|
u16 palTag;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RedArrowCursor
|
||||||
|
{
|
||||||
|
u8 spriteId;
|
||||||
|
u16 tileTag;
|
||||||
|
u16 palTag;
|
||||||
|
};
|
||||||
|
|
||||||
// Exported ROM declarations
|
// Exported ROM declarations
|
||||||
u8 AddScrollIndicatorArrowPairParameterized(u8, u8, u8, u8, s32, u16, u16, u16 *);
|
u8 AddScrollIndicatorArrowPairParameterized(u32 arrowType, s32 commonPos, s32 firstPos, s32 secondPos, s32 fullyDownThreshold, s32 tileTag, s32 palTag, u16 *scrollOffset);
|
||||||
u8 AddScrollIndicatorArrowPair(const struct ScrollArrowsTemplate * template, u16 * a1);
|
u8 AddScrollIndicatorArrowPair(const struct ScrollArrowsTemplate * template, u16 * a1);
|
||||||
void RemoveScrollIndicatorArrowPair(u8);
|
void RemoveScrollIndicatorArrowPair(u8);
|
||||||
|
u8 ListMenuAddCursorObjectInternal(struct CursorStruct *cursor, u32 cursorKind);
|
||||||
|
u8 ListMenuAddRedOutlineCursorObject(struct CursorStruct *cursor);
|
||||||
|
void ListMenuUpdateRedOutlineCursorObject(u8 taskId, u16 x, u16 y);
|
||||||
|
void ListMenuRemoveRedOutlineCursorObject(u8 taskId);
|
||||||
|
|
||||||
#endif //GUARD_MENU_INDICATORS_H
|
#endif //GUARD_MENU_INDICATORS_H
|
||||||
|
|||||||
+2
-2
@@ -625,8 +625,8 @@ u32 CanMonLearnTMHM(struct Pokemon *, u8);
|
|||||||
u32 CanSpeciesLearnTMHM(u16 species, u8 tm);
|
u32 CanSpeciesLearnTMHM(u16 species, u8 tm);
|
||||||
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves);
|
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves);
|
||||||
void ClearBattleMonForms(void);
|
void ClearBattleMonForms(void);
|
||||||
const u8 *GetMonFrontSpritePal(struct Pokemon *mon);
|
const u32 *GetMonFrontSpritePal(struct Pokemon *mon);
|
||||||
const u8 *GetFrontSpritePalFromSpeciesAndPersonality(u16, u32, u32);
|
const u32 *GetFrontSpritePalFromSpeciesAndPersonality(u16, u32, u32);
|
||||||
const struct CompressedSpritePalette *sub_80409C8(u16, u32, u32);
|
const struct CompressedSpritePalette *sub_80409C8(u16, u32, u32);
|
||||||
bool8 IsOtherTrainer(u32, u8 *);
|
bool8 IsOtherTrainer(u32, u8 *);
|
||||||
void SetWildMonHeldItem(void);
|
void SetWildMonHeldItem(void);
|
||||||
|
|||||||
+19
-9
@@ -4,28 +4,30 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
#define MAX_SPRITES 64
|
#define MAX_SPRITES 64
|
||||||
|
#define SPRITE_INVALID_TAG 0xFFFF
|
||||||
|
|
||||||
struct SpriteSheet
|
struct SpriteSheet
|
||||||
{
|
{
|
||||||
const u8 *data; // Raw uncompressed pixel data
|
const void *data; // Raw uncompressed pixel data
|
||||||
u16 size;
|
u16 size;
|
||||||
u16 tag;
|
u16 tag;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CompressedSpriteSheet
|
struct CompressedSpriteSheet
|
||||||
{
|
{
|
||||||
const u8 *data; // LZ77 compressed pixel data
|
const u32 *data; // LZ77 compressed pixel data
|
||||||
u16 size; // Uncompressed size of pixel data
|
u16 size; // Uncompressed size of pixel data
|
||||||
u16 tag;
|
u16 tag;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SpriteFrameImage
|
struct SpriteFrameImage
|
||||||
{
|
{
|
||||||
const u8 *data;
|
const void *data;
|
||||||
u16 size;
|
u16 size;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define obj_frame_tiles(ptr) {.data = (u8 *)ptr, .size = sizeof ptr}
|
#define obj_frame_tiles(ptr) {.data = (u8 *)ptr, .size = sizeof ptr}
|
||||||
|
#define overworld_frame(ptr, width, height, frame) {.data = (u8 *)ptr + (width * height * frame * 64)/2, .size = (width * height * 64)/2}
|
||||||
|
|
||||||
struct SpritePalette
|
struct SpritePalette
|
||||||
{
|
{
|
||||||
@@ -35,7 +37,7 @@ struct SpritePalette
|
|||||||
|
|
||||||
struct CompressedSpritePalette
|
struct CompressedSpritePalette
|
||||||
{
|
{
|
||||||
const u8 *data; // LZ77 compressed palette data
|
const u32 *data; // LZ77 compressed palette data
|
||||||
u16 tag;
|
u16 tag;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -102,6 +104,12 @@ struct AffineAnimJumpCmd
|
|||||||
u16 target;
|
u16 target;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct AffineAnimEndCmdAlt
|
||||||
|
{
|
||||||
|
s16 type;
|
||||||
|
u16 val;
|
||||||
|
};
|
||||||
|
|
||||||
union AffineAnimCmd
|
union AffineAnimCmd
|
||||||
{
|
{
|
||||||
s16 type;
|
s16 type;
|
||||||
@@ -126,6 +134,8 @@ union AffineAnimCmd
|
|||||||
{.loop = {.type = AFFINEANIMCMDTYPE_LOOP, .count = _count}}
|
{.loop = {.type = AFFINEANIMCMDTYPE_LOOP, .count = _count}}
|
||||||
#define AFFINEANIMCMD_JUMP(_target) \
|
#define AFFINEANIMCMD_JUMP(_target) \
|
||||||
{.jump = {.type = AFFINEANIMCMDTYPE_JUMP, .target = _target}}
|
{.jump = {.type = AFFINEANIMCMDTYPE_JUMP, .target = _target}}
|
||||||
|
#define AFFINEANIMCMD_END_ALT(_val) \
|
||||||
|
{.end = {.type = AFFINEANIMCMDTYPE_END, .val = _val}}
|
||||||
|
|
||||||
struct AffineAnimState
|
struct AffineAnimState
|
||||||
{
|
{
|
||||||
@@ -163,6 +173,8 @@ struct SubspriteTable
|
|||||||
|
|
||||||
struct Sprite;
|
struct Sprite;
|
||||||
|
|
||||||
|
typedef void (*SpriteCallback)(struct Sprite *);
|
||||||
|
|
||||||
struct SpriteTemplate
|
struct SpriteTemplate
|
||||||
{
|
{
|
||||||
u16 tileTag;
|
u16 tileTag;
|
||||||
@@ -171,7 +183,7 @@ struct SpriteTemplate
|
|||||||
const union AnimCmd *const *anims;
|
const union AnimCmd *const *anims;
|
||||||
const struct SpriteFrameImage *images;
|
const struct SpriteFrameImage *images;
|
||||||
const union AffineAnimCmd *const *affineAnims;
|
const union AffineAnimCmd *const *affineAnims;
|
||||||
void (*callback)(struct Sprite *);
|
SpriteCallback callback;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Sprite
|
struct Sprite
|
||||||
@@ -182,7 +194,7 @@ struct Sprite
|
|||||||
/*0x10*/ const union AffineAnimCmd *const *affineAnims;
|
/*0x10*/ const union AffineAnimCmd *const *affineAnims;
|
||||||
/*0x14*/ const struct SpriteTemplate *template;
|
/*0x14*/ const struct SpriteTemplate *template;
|
||||||
/*0x18*/ const struct SubspriteTable *subspriteTables;
|
/*0x18*/ const struct SubspriteTable *subspriteTables;
|
||||||
/*0x1C*/ void (*callback)(struct Sprite *);
|
/*0x1C*/ SpriteCallback callback;
|
||||||
|
|
||||||
/*0x20*/ struct Coords16 pos1;
|
/*0x20*/ struct Coords16 pos1;
|
||||||
/*0x24*/ struct Coords16 pos2;
|
/*0x24*/ struct Coords16 pos2;
|
||||||
@@ -232,14 +244,12 @@ struct OamMatrix
|
|||||||
s16 d;
|
s16 d;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*SpriteCallback)(struct Sprite *);
|
|
||||||
|
|
||||||
extern const struct OamData gDummyOamData;
|
extern const struct OamData gDummyOamData;
|
||||||
extern const union AnimCmd *const gDummySpriteAnimTable[];
|
extern const union AnimCmd *const gDummySpriteAnimTable[];
|
||||||
extern const union AffineAnimCmd *const gDummySpriteAffineAnimTable[];
|
extern const union AffineAnimCmd *const gDummySpriteAffineAnimTable[];
|
||||||
extern s16 gSpriteCoordOffsetX;
|
extern s16 gSpriteCoordOffsetX;
|
||||||
extern s16 gSpriteCoordOffsetY;
|
extern s16 gSpriteCoordOffsetY;
|
||||||
|
extern const struct SpriteTemplate gDummySpriteTemplate;
|
||||||
extern struct Sprite gSprites[];
|
extern struct Sprite gSprites[];
|
||||||
|
|
||||||
void ResetSpriteData(void);
|
void ResetSpriteData(void);
|
||||||
|
|||||||
+2
-2
@@ -246,7 +246,7 @@ SECTIONS {
|
|||||||
src/menu2.o(.text);
|
src/menu2.o(.text);
|
||||||
src/oak_speech.o(.text);
|
src/oak_speech.o(.text);
|
||||||
src/tm_case.o(.text);
|
src/tm_case.o(.text);
|
||||||
asm/menu_indicators.o(.text);
|
src/menu_indicators.o(.text);
|
||||||
asm/pokedex_area_markers.o(.text);
|
asm/pokedex_area_markers.o(.text);
|
||||||
asm/pokemon_summary_screen.o(.text);
|
asm/pokemon_summary_screen.o(.text);
|
||||||
src/help_system.o(.text);
|
src/help_system.o(.text);
|
||||||
@@ -437,7 +437,7 @@ SECTIONS {
|
|||||||
src/menu2.o(.rodata);
|
src/menu2.o(.rodata);
|
||||||
src/oak_speech.o(.rodata);
|
src/oak_speech.o(.rodata);
|
||||||
src/tm_case.o(.rodata);
|
src/tm_case.o(.rodata);
|
||||||
data/menu_indicators.o(.rodata);
|
src/menu_indicators.o(.rodata);
|
||||||
data/pokedex_area_markers.o(.rodata);
|
data/pokedex_area_markers.o(.rodata);
|
||||||
data/pokemon_summary_screen.o(.rodata);
|
data/pokemon_summary_screen.o(.rodata);
|
||||||
src/help_system.o(.rodata);
|
src/help_system.o(.rodata);
|
||||||
|
|||||||
@@ -0,0 +1,626 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "malloc.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "task.h"
|
||||||
|
#include "decompress.h"
|
||||||
|
#include "palette.h"
|
||||||
|
#include "strings.h"
|
||||||
|
#include "sprite.h"
|
||||||
|
#include "window.h"
|
||||||
|
#include "trig.h"
|
||||||
|
#include "text_window.h"
|
||||||
|
#include "list_menu.h"
|
||||||
|
#include "menu_indicators.h"
|
||||||
|
|
||||||
|
static EWRAM_DATA struct ScrollArrowsTemplate sTempScrollArrowTemplate = {0};
|
||||||
|
|
||||||
|
static void SpriteCallback_ScrollIndicatorArrow(struct Sprite *sprite);
|
||||||
|
static void SpriteCallback_RedArrowCursor(struct Sprite *sprite);
|
||||||
|
static void Task_ScrollIndicatorArrowPair(u8 taskId);
|
||||||
|
static u8 ListMenuAddRedArrowCursorObject(struct CursorStruct *cursor);
|
||||||
|
static void ListMenuUpdateRedArrowCursorObject(u8 taskId, u16 x, u16 y);
|
||||||
|
static void ListMenuRemoveRedArrowCursorObject(u8 taskId);
|
||||||
|
|
||||||
|
static const struct ScrollIndicatorTemplate sScrollIndicatorTemplates[] =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
.animNum = 0,
|
||||||
|
.bounceDir = 0,
|
||||||
|
.multiplier = 2,
|
||||||
|
.frequency = 8,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.animNum = 1,
|
||||||
|
.bounceDir = 0,
|
||||||
|
.multiplier = 2,
|
||||||
|
.frequency = -8,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.animNum = 2,
|
||||||
|
.bounceDir = 1,
|
||||||
|
.multiplier = 2,
|
||||||
|
.frequency = 8,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.animNum = 3,
|
||||||
|
.bounceDir = 1,
|
||||||
|
.multiplier = 2,
|
||||||
|
.frequency = -8,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct OamData sOamData_ScrollArrowIndicator =
|
||||||
|
{
|
||||||
|
.y = 0,
|
||||||
|
.affineMode = 0,
|
||||||
|
.objMode = 0,
|
||||||
|
.mosaic = 0,
|
||||||
|
.bpp = 0,
|
||||||
|
.shape = SPRITE_SHAPE(16x16),
|
||||||
|
.x = 0,
|
||||||
|
.matrixNum = 0,
|
||||||
|
.size = SPRITE_SIZE(16x16),
|
||||||
|
.tileNum = 0,
|
||||||
|
.priority = 0,
|
||||||
|
.paletteNum = 0,
|
||||||
|
.affineParam = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const union AnimCmd sSpriteAnim_ScrollArrowIndicator0[] =
|
||||||
|
{
|
||||||
|
ANIMCMD_FRAME(0, 30),
|
||||||
|
ANIMCMD_END,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const union AnimCmd sSpriteAnim_ScrollArrowIndicator1[] =
|
||||||
|
{
|
||||||
|
ANIMCMD_FRAME(0, 30, 1, 0),
|
||||||
|
ANIMCMD_END,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const union AnimCmd sSpriteAnim_ScrollArrowIndicator2[] =
|
||||||
|
{
|
||||||
|
ANIMCMD_FRAME(4, 30),
|
||||||
|
ANIMCMD_END,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const union AnimCmd sSpriteAnim_ScrollArrowIndicator3[] =
|
||||||
|
{
|
||||||
|
ANIMCMD_FRAME(4, 30, 0, 1),
|
||||||
|
ANIMCMD_END,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const union AnimCmd *const sSpriteAnimTable_ScrollArrowIndicator[] =
|
||||||
|
{
|
||||||
|
sSpriteAnim_ScrollArrowIndicator0,
|
||||||
|
sSpriteAnim_ScrollArrowIndicator1,
|
||||||
|
sSpriteAnim_ScrollArrowIndicator2,
|
||||||
|
sSpriteAnim_ScrollArrowIndicator3,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct SpriteTemplate sSpriteTemplate_ScrollArrowIndicator =
|
||||||
|
{
|
||||||
|
.tileTag = 0,
|
||||||
|
.paletteTag = 0,
|
||||||
|
.oam = &sOamData_ScrollArrowIndicator,
|
||||||
|
.anims = sSpriteAnimTable_ScrollArrowIndicator,
|
||||||
|
.images = NULL,
|
||||||
|
.affineAnims = gDummySpriteAffineAnimTable,
|
||||||
|
.callback = SpriteCallback_ScrollIndicatorArrow,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct Subsprite sSubsprite_RedOutline1 =
|
||||||
|
{
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.shape = SPRITE_SHAPE(8x8),
|
||||||
|
.size = SPRITE_SIZE(8x8),
|
||||||
|
.tileOffset = 0,
|
||||||
|
.priority = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct Subsprite sSubsprite_RedOutline2 =
|
||||||
|
{
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.shape = SPRITE_SHAPE(8x8),
|
||||||
|
.size = SPRITE_SIZE(8x8),
|
||||||
|
.tileOffset = 1,
|
||||||
|
.priority = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct Subsprite sSubsprite_RedOutline3 =
|
||||||
|
{
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.shape = SPRITE_SHAPE(8x8),
|
||||||
|
.size = SPRITE_SIZE(8x8),
|
||||||
|
.tileOffset = 2,
|
||||||
|
.priority = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct Subsprite sSubsprite_RedOutline4 =
|
||||||
|
{
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.shape = SPRITE_SHAPE(8x8),
|
||||||
|
.size = SPRITE_SIZE(8x8),
|
||||||
|
.tileOffset = 3,
|
||||||
|
.priority = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct Subsprite sSubsprite_RedOutline5 =
|
||||||
|
{
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.shape = SPRITE_SHAPE(8x8),
|
||||||
|
.size = SPRITE_SIZE(8x8),
|
||||||
|
.tileOffset = 4,
|
||||||
|
.priority = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct Subsprite sSubsprite_RedOutline6 =
|
||||||
|
{
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.shape = SPRITE_SHAPE(8x8),
|
||||||
|
.size = SPRITE_SIZE(8x8),
|
||||||
|
.tileOffset = 5,
|
||||||
|
.priority = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct Subsprite sSubsprite_RedOutline7 =
|
||||||
|
{
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.shape = SPRITE_SHAPE(8x8),
|
||||||
|
.size = SPRITE_SIZE(8x8),
|
||||||
|
.tileOffset = 6,
|
||||||
|
.priority = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct Subsprite sSubsprite_RedOutline8 =
|
||||||
|
{
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.shape = SPRITE_SHAPE(8x8),
|
||||||
|
.size = SPRITE_SIZE(8x8),
|
||||||
|
.tileOffset = 7,
|
||||||
|
.priority = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct OamData sOamData_RedArrowCursor =
|
||||||
|
{
|
||||||
|
.y = 0,
|
||||||
|
.affineMode = 0,
|
||||||
|
.objMode = 0,
|
||||||
|
.mosaic = 0,
|
||||||
|
.bpp = 0,
|
||||||
|
.shape = SPRITE_SHAPE(16x16),
|
||||||
|
.x = 0,
|
||||||
|
.matrixNum = 0,
|
||||||
|
.size = SPRITE_SIZE(16x16),
|
||||||
|
.tileNum = 0,
|
||||||
|
.priority = 0,
|
||||||
|
.paletteNum = 0,
|
||||||
|
.affineParam = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const union AnimCmd sSpriteAnim_RedArrowCursor[] =
|
||||||
|
{
|
||||||
|
ANIMCMD_FRAME(0, 30),
|
||||||
|
ANIMCMD_END,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const union AnimCmd *const sSpriteAnimTable_RedArrowCursor[] = { sSpriteAnim_RedArrowCursor };
|
||||||
|
|
||||||
|
static const struct SpriteTemplate sSpriteTemplate_RedArrowCursor =
|
||||||
|
{
|
||||||
|
.tileTag = 0,
|
||||||
|
.paletteTag = 0,
|
||||||
|
.oam = &sOamData_RedArrowCursor,
|
||||||
|
.anims = sSpriteAnimTable_RedArrowCursor,
|
||||||
|
.images = NULL,
|
||||||
|
.affineAnims = gDummySpriteAffineAnimTable,
|
||||||
|
.callback = SpriteCallback_RedArrowCursor,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const u16 sRedArrowPal[] = INCBIN_U16("graphics/interface/red_arrow.gbapal");
|
||||||
|
static const u32 sRedArrowOtherGfx[] = INCBIN_U32("graphics/interface/red_arrow_other.4bpp.lz");
|
||||||
|
static const u32 sSelectorOutlineGfx[] = INCBIN_U32("graphics/interface/selector_outline.4bpp.lz");
|
||||||
|
static const u32 sRedArrowGfx[] = INCBIN_U32("graphics/interface/red_arrow.4bpp.lz");
|
||||||
|
|
||||||
|
#define tState data[0]
|
||||||
|
#define tAnimNum data[1]
|
||||||
|
#define tBounceDir data[2]
|
||||||
|
#define tMultiplier data[3]
|
||||||
|
#define tFrequency data[4]
|
||||||
|
#define tSinePos data[5]
|
||||||
|
|
||||||
|
static void SpriteCallback_ScrollIndicatorArrow(struct Sprite *sprite)
|
||||||
|
{
|
||||||
|
s32 multiplier;
|
||||||
|
|
||||||
|
switch (sprite->tState)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
StartSpriteAnim(sprite, sprite->tAnimNum);
|
||||||
|
sprite->tState++;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
switch (sprite->tBounceDir)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
multiplier = sprite->tMultiplier;
|
||||||
|
sprite->pos2.x = (gSineTable[(u8)(sprite->tSinePos)] * multiplier) / 256;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
multiplier = sprite->tMultiplier;
|
||||||
|
sprite->pos2.y = (gSineTable[(u8)(sprite->tSinePos)] * multiplier) / 256;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sprite->tSinePos += sprite->tFrequency;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static u8 AddScrollIndicatorArrowObject(u8 arrowDir, u8 x, u8 y, u16 tileTag, u16 palTag)
|
||||||
|
{
|
||||||
|
u8 spriteId;
|
||||||
|
struct SpriteTemplate spriteTemplate;
|
||||||
|
|
||||||
|
spriteTemplate = sSpriteTemplate_ScrollArrowIndicator;
|
||||||
|
spriteTemplate.tileTag = tileTag;
|
||||||
|
spriteTemplate.paletteTag = palTag;
|
||||||
|
spriteId = CreateSprite(&spriteTemplate, x, y, 0);
|
||||||
|
gSprites[spriteId].invisible = TRUE;
|
||||||
|
gSprites[spriteId].tState = 0;
|
||||||
|
gSprites[spriteId].tAnimNum = sScrollIndicatorTemplates[arrowDir].animNum;
|
||||||
|
gSprites[spriteId].tBounceDir = sScrollIndicatorTemplates[arrowDir].bounceDir;
|
||||||
|
gSprites[spriteId].tMultiplier = sScrollIndicatorTemplates[arrowDir].multiplier;
|
||||||
|
gSprites[spriteId].tFrequency = sScrollIndicatorTemplates[arrowDir].frequency;
|
||||||
|
gSprites[spriteId].tSinePos = 0;
|
||||||
|
return spriteId;
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef tState
|
||||||
|
#undef tAnimNum
|
||||||
|
#undef tBounceDir
|
||||||
|
#undef tMultiplier
|
||||||
|
#undef tFrequency
|
||||||
|
#undef tSinePos
|
||||||
|
|
||||||
|
u8 AddScrollIndicatorArrowPair(const struct ScrollArrowsTemplate *arrowInfo, u16 *scrollOffset)
|
||||||
|
{
|
||||||
|
struct CompressedSpriteSheet spriteSheet;
|
||||||
|
struct SpritePalette spritePal;
|
||||||
|
struct ScrollIndicatorPair *data;
|
||||||
|
u8 taskId;
|
||||||
|
|
||||||
|
spriteSheet.data = sRedArrowOtherGfx;
|
||||||
|
spriteSheet.size = 0x100;
|
||||||
|
spriteSheet.tag = arrowInfo->tileTag;
|
||||||
|
LoadCompressedSpriteSheet(&spriteSheet);
|
||||||
|
if (arrowInfo->palTag == SPRITE_INVALID_TAG)
|
||||||
|
{
|
||||||
|
LoadPalette(sRedArrowPal, (16 * arrowInfo->palNum) + 0x100, 0x20);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spritePal.data = sRedArrowPal;
|
||||||
|
spritePal.tag = arrowInfo->palTag;
|
||||||
|
LoadSpritePalette(&spritePal);
|
||||||
|
}
|
||||||
|
taskId = CreateTask(Task_ScrollIndicatorArrowPair, 0);
|
||||||
|
data = (struct ScrollIndicatorPair *)gTasks[taskId].data;
|
||||||
|
|
||||||
|
data->field_0 = 0;
|
||||||
|
data->scrollOffset = scrollOffset;
|
||||||
|
data->fullyUpThreshold = arrowInfo->fullyUpThreshold;
|
||||||
|
data->fullyDownThreshold = arrowInfo->fullyDownThreshold;
|
||||||
|
data->tileTag = arrowInfo->tileTag;
|
||||||
|
data->palTag = arrowInfo->palTag;
|
||||||
|
data->topSpriteId = AddScrollIndicatorArrowObject(arrowInfo->firstArrowType, arrowInfo->firstX, arrowInfo->firstY, arrowInfo->tileTag, arrowInfo->palTag);
|
||||||
|
data->bottomSpriteId = AddScrollIndicatorArrowObject(arrowInfo->secondArrowType, arrowInfo->secondX, arrowInfo->secondY, arrowInfo->tileTag, arrowInfo->palTag);
|
||||||
|
|
||||||
|
if (arrowInfo->palTag == SPRITE_INVALID_TAG)
|
||||||
|
{
|
||||||
|
gSprites[data->topSpriteId].oam.paletteNum = arrowInfo->palNum;
|
||||||
|
gSprites[data->bottomSpriteId].oam.paletteNum = arrowInfo->palNum;
|
||||||
|
}
|
||||||
|
return taskId;
|
||||||
|
}
|
||||||
|
|
||||||
|
u8 AddScrollIndicatorArrowPairParameterized(u32 arrowType, s32 commonPos, s32 firstPos, s32 secondPos, s32 fullyDownThreshold, s32 tileTag, s32 palTag, u16 *scrollOffset)
|
||||||
|
{
|
||||||
|
if (arrowType == SCROLL_ARROW_UP || arrowType == SCROLL_ARROW_DOWN)
|
||||||
|
{
|
||||||
|
sTempScrollArrowTemplate.firstArrowType = SCROLL_ARROW_UP;
|
||||||
|
sTempScrollArrowTemplate.firstX = commonPos;
|
||||||
|
sTempScrollArrowTemplate.firstY = firstPos;
|
||||||
|
sTempScrollArrowTemplate.secondArrowType = SCROLL_ARROW_DOWN;
|
||||||
|
sTempScrollArrowTemplate.secondX = commonPos;
|
||||||
|
sTempScrollArrowTemplate.secondY = secondPos;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sTempScrollArrowTemplate.firstArrowType = SCROLL_ARROW_LEFT;
|
||||||
|
sTempScrollArrowTemplate.firstX = firstPos;
|
||||||
|
sTempScrollArrowTemplate.firstY = commonPos;
|
||||||
|
sTempScrollArrowTemplate.secondArrowType = SCROLL_ARROW_RIGHT;
|
||||||
|
sTempScrollArrowTemplate.secondX = secondPos;
|
||||||
|
sTempScrollArrowTemplate.secondY = commonPos;
|
||||||
|
}
|
||||||
|
sTempScrollArrowTemplate.fullyUpThreshold = 0;
|
||||||
|
sTempScrollArrowTemplate.fullyDownThreshold = fullyDownThreshold;
|
||||||
|
sTempScrollArrowTemplate.tileTag = tileTag;
|
||||||
|
sTempScrollArrowTemplate.palTag = palTag;
|
||||||
|
sTempScrollArrowTemplate.palNum = 0;
|
||||||
|
|
||||||
|
return AddScrollIndicatorArrowPair(&sTempScrollArrowTemplate, scrollOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_ScrollIndicatorArrowPair(u8 taskId)
|
||||||
|
{
|
||||||
|
struct ScrollIndicatorPair *data = (struct ScrollIndicatorPair *)gTasks[taskId].data;
|
||||||
|
u16 currItem = (*data->scrollOffset);
|
||||||
|
|
||||||
|
if (currItem == data->fullyUpThreshold)
|
||||||
|
gSprites[data->topSpriteId].invisible = TRUE;
|
||||||
|
else
|
||||||
|
gSprites[data->topSpriteId].invisible = FALSE;
|
||||||
|
|
||||||
|
if (currItem == data->fullyDownThreshold)
|
||||||
|
gSprites[data->bottomSpriteId].invisible = TRUE;
|
||||||
|
else
|
||||||
|
gSprites[data->bottomSpriteId].invisible = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RemoveScrollIndicatorArrowPair(u8 taskId)
|
||||||
|
{
|
||||||
|
struct ScrollIndicatorPair *data = (struct ScrollIndicatorPair *)gTasks[taskId].data;
|
||||||
|
|
||||||
|
if (data->tileTag != SPRITE_INVALID_TAG)
|
||||||
|
FreeSpriteTilesByTag(data->tileTag);
|
||||||
|
if (data->palTag != SPRITE_INVALID_TAG)
|
||||||
|
FreeSpritePaletteByTag(data->palTag);
|
||||||
|
DestroySprite(&gSprites[data->topSpriteId]);
|
||||||
|
DestroySprite(&gSprites[data->bottomSpriteId]);
|
||||||
|
DestroyTask(taskId);
|
||||||
|
}
|
||||||
|
|
||||||
|
u8 ListMenuAddCursorObjectInternal(struct CursorStruct *cursor, u32 cursorKind)
|
||||||
|
{
|
||||||
|
switch (cursorKind)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
return ListMenuAddRedOutlineCursorObject(cursor);
|
||||||
|
case 1:
|
||||||
|
return ListMenuAddRedArrowCursorObject(cursor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ListMenuUpdateCursorObject(u8 taskId, u16 x, u16 y, u32 cursorKind)
|
||||||
|
{
|
||||||
|
switch (cursorKind)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
ListMenuUpdateRedOutlineCursorObject(taskId, x, y);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
ListMenuUpdateRedArrowCursorObject(taskId, x, y);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ListMenuRemoveCursorObject(u8 taskId, u32 cursorKind)
|
||||||
|
{
|
||||||
|
switch (cursorKind)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
ListMenuRemoveRedOutlineCursorObject(taskId);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
ListMenuRemoveRedArrowCursorObject(taskId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Task_RedOutlineCursor(u8 taskId)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
u8 ListMenuGetRedOutlineCursorSpriteCount(u16 rowWidth, u16 rowHeight)
|
||||||
|
{
|
||||||
|
s32 i, count = 4;
|
||||||
|
|
||||||
|
if (rowWidth > 16)
|
||||||
|
for (i = 8; i < (rowWidth - 8); i += 8)
|
||||||
|
count += 2;
|
||||||
|
if (rowHeight > 16)
|
||||||
|
for (i = 8; i < (rowHeight - 8); i += 8)
|
||||||
|
count += 2;
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ListMenuSetUpRedOutlineCursorSpriteOamTable(u16 rowWidth, u16 rowHeight, struct Subsprite *subsprites)
|
||||||
|
{
|
||||||
|
s32 i, j, id = 0;
|
||||||
|
|
||||||
|
subsprites[id] = sSubsprite_RedOutline1;
|
||||||
|
subsprites[id].x = 136;
|
||||||
|
subsprites[id].y = 136;
|
||||||
|
id++;
|
||||||
|
subsprites[id] = sSubsprite_RedOutline2;
|
||||||
|
subsprites[id].x = rowWidth + 128;
|
||||||
|
subsprites[id].y = 136;
|
||||||
|
id++;
|
||||||
|
subsprites[id] = sSubsprite_RedOutline7;
|
||||||
|
subsprites[id].x = 136;
|
||||||
|
subsprites[id].y = rowHeight + 128;
|
||||||
|
id++;
|
||||||
|
subsprites[id] = sSubsprite_RedOutline8;
|
||||||
|
subsprites[id].x = rowWidth + 128;
|
||||||
|
subsprites[id].y = rowHeight + 128;
|
||||||
|
id++;
|
||||||
|
if (rowWidth > 16)
|
||||||
|
{
|
||||||
|
for (i = 8; i < rowWidth - 8; i += 8)
|
||||||
|
{
|
||||||
|
subsprites[id] = sSubsprite_RedOutline3;
|
||||||
|
subsprites[id].x = i - 120;
|
||||||
|
subsprites[id].y = 136;
|
||||||
|
id++;
|
||||||
|
|
||||||
|
subsprites[id] = sSubsprite_RedOutline6;
|
||||||
|
subsprites[id].x = i - 120;
|
||||||
|
subsprites[id].y = rowHeight + 128;
|
||||||
|
id++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rowHeight > 16)
|
||||||
|
{
|
||||||
|
for (j = 8; j < rowHeight - 8; j += 8)
|
||||||
|
{
|
||||||
|
subsprites[id] = sSubsprite_RedOutline4;
|
||||||
|
subsprites[id].x = 136;
|
||||||
|
subsprites[id].y = j - 120;
|
||||||
|
id++;
|
||||||
|
subsprites[id] = sSubsprite_RedOutline5;
|
||||||
|
subsprites[id].x = rowWidth + 128;
|
||||||
|
subsprites[id].y = j - 120;
|
||||||
|
id++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
u8 ListMenuAddRedOutlineCursorObject(struct CursorStruct *cursor)
|
||||||
|
{
|
||||||
|
struct CompressedSpriteSheet spriteSheet;
|
||||||
|
struct SpritePalette spritePal;
|
||||||
|
struct RedOutlineCursor *data;
|
||||||
|
struct SpriteTemplate spriteTemplate;
|
||||||
|
u8 taskId;
|
||||||
|
|
||||||
|
spriteSheet.data = sSelectorOutlineGfx;
|
||||||
|
spriteSheet.size = 0x100;
|
||||||
|
spriteSheet.tag = cursor->tileTag;
|
||||||
|
LoadCompressedSpriteSheet(&spriteSheet);
|
||||||
|
if (cursor->palTag == SPRITE_INVALID_TAG)
|
||||||
|
{
|
||||||
|
LoadPalette(sRedArrowPal, (16 * cursor->palNum) + 0x100, 0x20);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spritePal.data = sRedArrowPal;
|
||||||
|
spritePal.tag = cursor->palTag;
|
||||||
|
LoadSpritePalette(&spritePal);
|
||||||
|
}
|
||||||
|
taskId = CreateTask(Task_RedOutlineCursor, 0);
|
||||||
|
data = (struct RedOutlineCursor *)gTasks[taskId].data;
|
||||||
|
data->tileTag = cursor->tileTag;
|
||||||
|
data->palTag = cursor->palTag;
|
||||||
|
data->subspriteTable.subspriteCount = ListMenuGetRedOutlineCursorSpriteCount(cursor->rowWidth, cursor->rowHeight);
|
||||||
|
data->subspriteTable.subsprites = data->subspritesPtr = Alloc(data->subspriteTable.subspriteCount * 4);
|
||||||
|
ListMenuSetUpRedOutlineCursorSpriteOamTable(cursor->rowWidth, cursor->rowHeight, data->subspritesPtr);
|
||||||
|
spriteTemplate = gDummySpriteTemplate;
|
||||||
|
spriteTemplate.tileTag = cursor->tileTag;
|
||||||
|
spriteTemplate.paletteTag = cursor->palTag;
|
||||||
|
data->spriteId = CreateSprite(&spriteTemplate, cursor->left + 120, cursor->top + 120, 0);
|
||||||
|
SetSubspriteTables(&gSprites[data->spriteId], &data->subspriteTable);
|
||||||
|
gSprites[data->spriteId].oam.priority = 0;
|
||||||
|
gSprites[data->spriteId].subpriority = 0;
|
||||||
|
gSprites[data->spriteId].subspriteTableNum = 0;
|
||||||
|
if (cursor->palTag == SPRITE_INVALID_TAG)
|
||||||
|
gSprites[data->spriteId].oam.paletteNum = cursor->palNum;
|
||||||
|
return taskId;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ListMenuUpdateRedOutlineCursorObject(u8 taskId, u16 x, u16 y)
|
||||||
|
{
|
||||||
|
struct RedOutlineCursor *data = (struct RedOutlineCursor *)gTasks[taskId].data;
|
||||||
|
|
||||||
|
gSprites[data->spriteId].pos1.x = x + 120;
|
||||||
|
gSprites[data->spriteId].pos1.y = y + 120;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ListMenuRemoveRedOutlineCursorObject(u8 taskId)
|
||||||
|
{
|
||||||
|
struct RedOutlineCursor *data = (struct RedOutlineCursor *)gTasks[taskId].data;
|
||||||
|
|
||||||
|
Free(data->subspritesPtr);
|
||||||
|
if (data->tileTag != SPRITE_INVALID_TAG)
|
||||||
|
FreeSpriteTilesByTag(data->tileTag);
|
||||||
|
if (data->palTag != SPRITE_INVALID_TAG)
|
||||||
|
FreeSpritePaletteByTag(data->palTag);
|
||||||
|
DestroySprite(&gSprites[data->spriteId]);
|
||||||
|
DestroyTask(taskId);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SpriteCallback_RedArrowCursor(struct Sprite *sprite)
|
||||||
|
{
|
||||||
|
sprite->pos2.x = gSineTable[(u8)(sprite->data[0])] / 64;
|
||||||
|
sprite->data[0] += 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_RedArrowCursor(u8 taskId)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static u8 ListMenuAddRedArrowCursorObject(struct CursorStruct *cursor)
|
||||||
|
{
|
||||||
|
struct CompressedSpriteSheet spriteSheet;
|
||||||
|
struct SpritePalette spritePal;
|
||||||
|
struct RedArrowCursor *data;
|
||||||
|
struct SpriteTemplate spriteTemplate;
|
||||||
|
u8 taskId;
|
||||||
|
|
||||||
|
spriteSheet.data = sRedArrowGfx;
|
||||||
|
spriteSheet.size = 0x80;
|
||||||
|
spriteSheet.tag = cursor->tileTag;
|
||||||
|
LoadCompressedSpriteSheet(&spriteSheet);
|
||||||
|
if (cursor->palTag == SPRITE_INVALID_TAG)
|
||||||
|
{
|
||||||
|
LoadPalette(sRedArrowPal, (16 * cursor->palNum) + 0x100, 0x20);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spritePal.data = sRedArrowPal;
|
||||||
|
spritePal.tag = cursor->palTag;
|
||||||
|
LoadSpritePalette(&spritePal);
|
||||||
|
}
|
||||||
|
taskId = CreateTask(Task_RedArrowCursor, 0);
|
||||||
|
data = (struct RedArrowCursor *)gTasks[taskId].data;
|
||||||
|
data->tileTag = cursor->tileTag;
|
||||||
|
data->palTag = cursor->palTag;
|
||||||
|
spriteTemplate = sSpriteTemplate_RedArrowCursor;
|
||||||
|
spriteTemplate.tileTag = cursor->tileTag;
|
||||||
|
spriteTemplate.paletteTag = cursor->palTag;
|
||||||
|
data->spriteId = CreateSprite(&spriteTemplate, cursor->left, cursor->top, 0);
|
||||||
|
gSprites[data->spriteId].pos2.x = 8;
|
||||||
|
gSprites[data->spriteId].pos2.y = 8;
|
||||||
|
if (cursor->palTag == SPRITE_INVALID_TAG)
|
||||||
|
gSprites[data->spriteId].oam.paletteNum = cursor->palNum;
|
||||||
|
return taskId;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ListMenuUpdateRedArrowCursorObject(u8 taskId, u16 x, u16 y)
|
||||||
|
{
|
||||||
|
struct RedArrowCursor *data = (struct RedArrowCursor *)gTasks[taskId].data;
|
||||||
|
|
||||||
|
gSprites[data->spriteId].pos1.x = x;
|
||||||
|
gSprites[data->spriteId].pos1.y = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ListMenuRemoveRedArrowCursorObject(u8 taskId)
|
||||||
|
{
|
||||||
|
struct RedArrowCursor *data = (struct RedArrowCursor *)gTasks[taskId].data;
|
||||||
|
|
||||||
|
if (data->tileTag != SPRITE_INVALID_TAG)
|
||||||
|
FreeSpriteTilesByTag(data->tileTag);
|
||||||
|
if (data->palTag != SPRITE_INVALID_TAG)
|
||||||
|
FreeSpritePaletteByTag(data->palTag);
|
||||||
|
DestroySprite(&gSprites[data->spriteId]);
|
||||||
|
DestroyTask(taskId);
|
||||||
|
}
|
||||||
@@ -97,7 +97,7 @@ const u16 gUnknown_8467E74[] = INCBIN_U16("data/graphics/mevent/pal_467E74.gbapa
|
|||||||
const u16 gUnknown_8467E94[] = INCBIN_U16("data/graphics/mevent/pal_467E94.gbapal");
|
const u16 gUnknown_8467E94[] = INCBIN_U16("data/graphics/mevent/pal_467E94.gbapal");
|
||||||
const u16 gUnknown_8467EB4[] = INCBIN_U16("data/graphics/mevent/pal_467EB4.gbapal");
|
const u16 gUnknown_8467EB4[] = INCBIN_U16("data/graphics/mevent/pal_467EB4.gbapal");
|
||||||
const u16 gUnknown_8467ED4[] = INCBIN_U16("data/graphics/mevent/pal_467ED4.gbapal");
|
const u16 gUnknown_8467ED4[] = INCBIN_U16("data/graphics/mevent/pal_467ED4.gbapal");
|
||||||
const u8 gUnknown_8467EF4[] = INCBIN_U8("data/graphics/mevent/gfx_467EF4.4bpp.lz");
|
const u32 gUnknown_8467EF4[] = INCBIN_U32("data/graphics/mevent/gfx_467EF4.4bpp.lz");
|
||||||
|
|
||||||
const struct CompressedSpriteSheet gUnknown_8467F58 = {
|
const struct CompressedSpriteSheet gUnknown_8467F58 = {
|
||||||
gUnknown_8467EF4, 0x100, 0x8000
|
gUnknown_8467EF4, 0x100, 0x8000
|
||||||
|
|||||||
+2
-2
@@ -5423,7 +5423,7 @@ void PlayMapChosenOrBattleBGM(u16 songId)
|
|||||||
PlayNewMapMusic(GetMUS_ForBattle());
|
PlayNewMapMusic(GetMUS_ForBattle());
|
||||||
}
|
}
|
||||||
|
|
||||||
const u8 *GetMonFrontSpritePal(struct Pokemon *mon)
|
const u32 *GetMonFrontSpritePal(struct Pokemon *mon)
|
||||||
{
|
{
|
||||||
u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
|
u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
|
||||||
u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0);
|
u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0);
|
||||||
@@ -5431,7 +5431,7 @@ const u8 *GetMonFrontSpritePal(struct Pokemon *mon)
|
|||||||
return GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality);
|
return GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality);
|
||||||
}
|
}
|
||||||
|
|
||||||
const u8 *GetFrontSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality)
|
const u32 *GetFrontSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality)
|
||||||
{
|
{
|
||||||
u32 shinyValue;
|
u32 shinyValue;
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -1353,9 +1353,7 @@ gUnknown_203B0E8: @ 203B0E8
|
|||||||
.include "src/oak_speech.o"
|
.include "src/oak_speech.o"
|
||||||
.align 2
|
.align 2
|
||||||
.include "src/tm_case.o"
|
.include "src/tm_case.o"
|
||||||
|
.include "src/menu_indicators.o"
|
||||||
gUnknown_203B130: @ 203B130
|
|
||||||
.space 0x10
|
|
||||||
|
|
||||||
gUnknown_203B140: @ 203B140
|
gUnknown_203B140: @ 203B140
|
||||||
.space 0x4
|
.space 0x4
|
||||||
|
|||||||
Reference in New Issue
Block a user