2017-10-13 17:09:36 +02:00
|
|
|
#ifndef GUARD_REGION_MAP_H
|
|
|
|
#define GUARD_REGION_MAP_H
|
|
|
|
|
2017-10-30 13:39:39 +01:00
|
|
|
#include "bg.h"
|
|
|
|
|
2017-10-13 17:09:36 +02:00
|
|
|
// Exported type declarations
|
|
|
|
|
2017-11-01 04:11:48 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
INPUT_EVENT_NONE,
|
|
|
|
INPUT_EVENT_MOVE_START,
|
|
|
|
INPUT_EVENT_MOVE_CONT,
|
|
|
|
INPUT_EVENT_MOVE_END,
|
|
|
|
INPUT_EVENT_A_BUTTON,
|
|
|
|
INPUT_EVENT_B_BUTTON,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
MAPSECTYPE_NONE,
|
|
|
|
MAPSECTYPE_PLAIN,
|
|
|
|
MAPSECTYPE_CITY_CANFLY,
|
|
|
|
MAPSECTYPE_CITY_CANTFLY,
|
|
|
|
MAPSECTYPE_BATTLE_FRONTIER
|
|
|
|
};
|
|
|
|
|
2017-10-29 16:05:42 +01:00
|
|
|
struct RegionMap {
|
2017-10-30 01:49:49 +01:00
|
|
|
/*0x000*/ u16 mapSecId;
|
2017-10-31 02:34:19 +01:00
|
|
|
/*0x002*/ u8 iconDrawType;
|
2017-11-01 01:58:47 +01:00
|
|
|
/*0x003*/ u8 posWithinMapSec;
|
2017-10-30 00:33:53 +01:00
|
|
|
/*0x004*/ u8 mapSecName[0x14];
|
|
|
|
/*0x018*/ u8 (*inputCallback)(void);
|
2017-10-30 03:05:15 +01:00
|
|
|
/*0x01c*/ struct Sprite *cursorSprite;
|
|
|
|
/*0x020*/ struct Sprite *playerIconSprite;
|
2017-10-30 13:39:39 +01:00
|
|
|
/*0x024*/ s32 bg2x;
|
|
|
|
/*0x028*/ s32 bg2y;
|
|
|
|
/*0x02c*/ u32 bg2pa;
|
|
|
|
/*0x034*/ u32 bg2pc;
|
2017-10-30 13:46:36 +01:00
|
|
|
/*0x030*/ u32 bg2pb;
|
2017-10-30 13:39:39 +01:00
|
|
|
/*0x038*/ u32 bg2pd;
|
2017-10-30 04:08:06 +01:00
|
|
|
/*0x03c*/ s32 unk_03c;
|
|
|
|
/*0x040*/ s32 unk_040;
|
|
|
|
/*0x044*/ s32 unk_044;
|
|
|
|
/*0x048*/ s32 unk_048;
|
|
|
|
/*0x04c*/ s32 unk_04c;
|
|
|
|
/*0x050*/ s32 unk_050;
|
2017-10-30 03:05:15 +01:00
|
|
|
/*0x054*/ u16 cursorPosX;
|
|
|
|
/*0x056*/ u16 cursorPosY;
|
|
|
|
/*0x058*/ u16 cursorTileTag;
|
|
|
|
/*0x05a*/ u16 cursorPaletteTag;
|
|
|
|
/*0x05c*/ s16 scrollX;
|
|
|
|
/*0x05e*/ s16 scrollY;
|
2017-10-30 04:08:06 +01:00
|
|
|
/*0x060*/ s16 unk_060;
|
|
|
|
/*0x062*/ s16 unk_062;
|
2017-10-31 03:35:28 +01:00
|
|
|
/*0x064*/ u16 zoomedCursorPosX;
|
|
|
|
/*0x066*/ u16 zoomedCursorPosY;
|
2017-10-30 03:05:15 +01:00
|
|
|
/*0x068*/ s16 zoomedCursorDeltaY;
|
|
|
|
/*0x06a*/ s16 zoomedCursorDeltaX;
|
|
|
|
/*0x06c*/ u16 zoomedCursorMovementFrameCounter;
|
2017-10-30 04:08:06 +01:00
|
|
|
/*0x06e*/ u16 unk_06e;
|
2017-10-30 03:05:15 +01:00
|
|
|
/*0x070*/ u16 playerIconTileTag;
|
|
|
|
/*0x072*/ u16 playerIconPaletteTag;
|
2017-11-01 00:40:35 +01:00
|
|
|
/*0x074*/ u16 playerIconSpritePosX;
|
|
|
|
/*0x076*/ u16 playerIconSpritePosY;
|
2017-10-30 03:05:15 +01:00
|
|
|
/*0x078*/ bool8 zoomed;
|
|
|
|
/*0x079*/ u8 initStep;
|
|
|
|
/*0x07a*/ s8 cursorMovementFrameCounter;
|
|
|
|
/*0x07b*/ s8 cursorDeltaX;
|
|
|
|
/*0x07c*/ s8 cursorDeltaY;
|
2017-10-30 13:39:39 +01:00
|
|
|
/*0x07d*/ bool8 needUpdateVideoRegs;
|
2017-10-30 03:05:15 +01:00
|
|
|
/*0x07e*/ bool8 blinkPlayerIcon;
|
2017-10-31 02:08:28 +01:00
|
|
|
/*0x07f*/ bool8 playerIsInCave;
|
2017-10-30 03:05:15 +01:00
|
|
|
/*0x080*/ u8 bgNum;
|
2017-10-30 13:39:39 +01:00
|
|
|
/*0x081*/ u8 charBaseIdx;
|
|
|
|
/*0x082*/ u8 mapBaseIdx;
|
|
|
|
/*0x083*/ bool8 bgManaged;
|
2017-10-30 01:49:49 +01:00
|
|
|
/*0x084*/ u8 filler_084[0x100];
|
2017-10-30 03:05:15 +01:00
|
|
|
/*0x184*/ u8 cursorSmallImage[0x100];
|
|
|
|
/*0x284*/ u8 cursorLargeImage[0x600];
|
2017-10-29 16:05:42 +01:00
|
|
|
}; // size = 0x884
|
|
|
|
|
2018-11-30 17:41:03 +01:00
|
|
|
struct RegionMapLocation
|
|
|
|
{
|
|
|
|
u8 x;
|
|
|
|
u8 y;
|
|
|
|
u8 width;
|
|
|
|
u8 height;
|
|
|
|
const u8 *name;
|
|
|
|
};
|
|
|
|
|
2017-10-13 17:09:36 +02:00
|
|
|
// Exported RAM declarations
|
|
|
|
|
|
|
|
// Exported ROM declarations
|
2017-10-30 13:39:39 +01:00
|
|
|
void sub_8122CF8(struct RegionMap *regionMap, struct BgTemplate *template, bool8 zoomed);
|
2017-10-30 02:14:53 +01:00
|
|
|
bool8 sub_8122DB0(void);
|
2017-10-31 03:20:09 +01:00
|
|
|
void UpdateRegionMapVideoRegs(void);
|
2017-10-30 13:39:39 +01:00
|
|
|
void InitRegionMap(struct RegionMap *regionMap, u8 argument);
|
2017-10-29 15:58:33 +01:00
|
|
|
u8 sub_81230AC(void);
|
2017-11-01 01:58:47 +01:00
|
|
|
bool8 sub_8123514(void);
|
2017-10-30 13:39:39 +01:00
|
|
|
void FreeRegionMapIconResources(void);
|
2017-11-01 01:58:47 +01:00
|
|
|
u16 GetRegionMapSectionIdAt(u16 x, u16 y);
|
|
|
|
void CreateRegionMapPlayerIcon(u16 x, u16 y);
|
2017-10-31 13:38:17 +01:00
|
|
|
void CreateRegionMapCursor(u16 tileTag, u16 paletteTag);
|
2017-11-01 02:51:11 +01:00
|
|
|
u8 *GetMapName(u8 *, u16, u16);
|
2017-11-01 03:05:23 +01:00
|
|
|
bool32 sub_8124668(u8 mapSecId);
|
2018-02-07 03:37:54 +01:00
|
|
|
u8 *sub_81245DC(u8 *dest, u16 mapSecId);
|
2018-08-15 06:56:11 +02:00
|
|
|
u8 *sub_8124610(u8 *dest, u16 mapSecId);
|
2018-11-30 17:41:03 +01:00
|
|
|
u16 CorrectSpecialMapSecId(u16 mapSecId);
|
|
|
|
void sub_8122D88(struct RegionMap *regionMap);
|
|
|
|
void PokedexAreaScreen_UpdateRegionMapVariablesAndVideoRegs(s16 x, s16 y);
|
2018-12-13 04:55:39 +01:00
|
|
|
void MCB2_FlyMap(void);
|
2018-11-30 17:41:03 +01:00
|
|
|
|
|
|
|
extern const struct RegionMapLocation gRegionMapEntries[];
|
2017-10-13 17:09:36 +02:00
|
|
|
|
|
|
|
#endif //GUARD_REGION_MAP_H
|