Pret merge (1st of November, 2025) (#8103)
@ -684,6 +684,14 @@
|
|||||||
map \map
|
map \map
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
@ Set the player object's invisibility to FALSE.
|
||||||
|
.macro showplayer
|
||||||
|
.byte SCR_OP_SHOWOBJECTAT
|
||||||
|
.2byte LOCALID_PLAYER
|
||||||
|
.byte 0 @ map group
|
||||||
|
.byte 0 @ map num
|
||||||
|
.endm
|
||||||
|
|
||||||
@ Sets the specified object's invisibility to TRUE.
|
@ Sets the specified object's invisibility to TRUE.
|
||||||
.macro hideobjectat localId:req, map:req
|
.macro hideobjectat localId:req, map:req
|
||||||
.byte SCR_OP_HIDEOBJECTAT
|
.byte SCR_OP_HIDEOBJECTAT
|
||||||
@ -691,6 +699,14 @@
|
|||||||
map \map
|
map \map
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
@ Set the player object's invisibility to TRUE.
|
||||||
|
.macro hideplayer
|
||||||
|
.byte SCR_OP_HIDEOBJECTAT
|
||||||
|
.2byte LOCALID_PLAYER
|
||||||
|
.byte 0 @ map group
|
||||||
|
.byte 0 @ map num
|
||||||
|
.endm
|
||||||
|
|
||||||
@ Turns the currently selected object (if there is one) to face the player.
|
@ Turns the currently selected object (if there is one) to face the player.
|
||||||
.macro faceplayer
|
.macro faceplayer
|
||||||
.byte SCR_OP_FACEPLAYER
|
.byte SCR_OP_FACEPLAYER
|
||||||
|
|||||||
@ -2,8 +2,12 @@
|
|||||||
|
|
||||||
@ Takes a MAP constant and outputs the map group and map number as separate bytes
|
@ Takes a MAP constant and outputs the map group and map number as separate bytes
|
||||||
.macro map map_id:req
|
.macro map map_id:req
|
||||||
|
.ifdef \map_id
|
||||||
.byte \map_id >> 8 @ map group
|
.byte \map_id >> 8 @ map group
|
||||||
.byte \map_id & 0xFF @ map num
|
.byte \map_id & 0xFF @ map num
|
||||||
|
.else
|
||||||
|
.error "undefined map (check for typos)"
|
||||||
|
.endif
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
@ Defines a map script. 'type' is any MAP_SCRIPT_* constant (see include/constants/map_scripts.h)
|
@ Defines a map script. 'type' is any MAP_SCRIPT_* constant (see include/constants/map_scripts.h)
|
||||||
|
|||||||
@ -835,7 +835,7 @@ EventScript_UnusedBoardFerry::
|
|||||||
delay 30
|
delay 30
|
||||||
applymovement LOCALID_PLAYER, Common_Movement_WalkInPlaceFasterUp
|
applymovement LOCALID_PLAYER, Common_Movement_WalkInPlaceFasterUp
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
showobjectat LOCALID_PLAYER, 0
|
showplayer
|
||||||
delay 30
|
delay 30
|
||||||
applymovement LOCALID_PLAYER, Movement_UnusedBoardFerry
|
applymovement LOCALID_PLAYER, Movement_UnusedBoardFerry
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
@ -850,7 +850,7 @@ Common_EventScript_FerryDepartIsland::
|
|||||||
call_if_eq VAR_FACING, DIR_SOUTH, Ferry_EventScript_DepartIslandSouth
|
call_if_eq VAR_FACING, DIR_SOUTH, Ferry_EventScript_DepartIslandSouth
|
||||||
call_if_eq VAR_FACING, DIR_WEST, Ferry_EventScript_DepartIslandWest
|
call_if_eq VAR_FACING, DIR_WEST, Ferry_EventScript_DepartIslandWest
|
||||||
delay 30
|
delay 30
|
||||||
hideobjectat LOCALID_PLAYER, 0
|
hideplayer
|
||||||
call Common_EventScript_FerryDepart
|
call Common_EventScript_FerryDepart
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@ -333,7 +333,7 @@ LilycoveCity_Harbor_EventScript_BoardFerryWithSailor::
|
|||||||
call_if_eq VAR_FACING, DIR_NORTH, LilycoveCity_Harbor_EventScript_PlayerBoardFerryNorth
|
call_if_eq VAR_FACING, DIR_NORTH, LilycoveCity_Harbor_EventScript_PlayerBoardFerryNorth
|
||||||
call_if_eq VAR_FACING, DIR_EAST, LilycoveCity_Harbor_EventScript_PlayerBoardFerryEast
|
call_if_eq VAR_FACING, DIR_EAST, LilycoveCity_Harbor_EventScript_PlayerBoardFerryEast
|
||||||
delay 30
|
delay 30
|
||||||
hideobjectat LOCALID_PLAYER, 0
|
hideplayer
|
||||||
setvar VAR_0x8004, LOCALID_LILYCOVE_HARBOR_SS_TIDAL
|
setvar VAR_0x8004, LOCALID_LILYCOVE_HARBOR_SS_TIDAL
|
||||||
call Common_EventScript_FerryDepart
|
call Common_EventScript_FerryDepart
|
||||||
return
|
return
|
||||||
@ -393,7 +393,7 @@ LilycoveCity_Harbor_EventScript_BoardFerry::
|
|||||||
call_if_eq VAR_FACING, DIR_NORTH, LilycoveCity_Harbor_EventScript_PlayerBoardFerryNorth
|
call_if_eq VAR_FACING, DIR_NORTH, LilycoveCity_Harbor_EventScript_PlayerBoardFerryNorth
|
||||||
call_if_eq VAR_FACING, DIR_EAST, LilycoveCity_Harbor_EventScript_PlayerBoardFerryEast
|
call_if_eq VAR_FACING, DIR_EAST, LilycoveCity_Harbor_EventScript_PlayerBoardFerryEast
|
||||||
delay 30
|
delay 30
|
||||||
hideobjectat LOCALID_PLAYER, 0
|
hideplayer
|
||||||
setvar VAR_0x8004, LOCALID_LILYCOVE_HARBOR_SS_TIDAL
|
setvar VAR_0x8004, LOCALID_LILYCOVE_HARBOR_SS_TIDAL
|
||||||
call Common_EventScript_FerryDepart
|
call Common_EventScript_FerryDepart
|
||||||
return
|
return
|
||||||
|
|||||||
@ -156,7 +156,7 @@ LittlerootTown_EventScript_GoInsideWithMom::
|
|||||||
waitmovement 0
|
waitmovement 0
|
||||||
setflag FLAG_HIDE_LITTLEROOT_TOWN_MOM_OUTSIDE
|
setflag FLAG_HIDE_LITTLEROOT_TOWN_MOM_OUTSIDE
|
||||||
setvar VAR_LITTLEROOT_INTRO_STATE, 3
|
setvar VAR_LITTLEROOT_INTRO_STATE, 3
|
||||||
hideobjectat LOCALID_PLAYER, 0
|
hideplayer
|
||||||
closedoor VAR_0x8004, VAR_0x8005
|
closedoor VAR_0x8004, VAR_0x8005
|
||||||
waitdooranim
|
waitdooranim
|
||||||
clearflag FLAG_HIDE_LITTLEROOT_TOWN_FAT_MAN
|
clearflag FLAG_HIDE_LITTLEROOT_TOWN_FAT_MAN
|
||||||
|
|||||||
@ -228,7 +228,7 @@ SlateportCity_Harbor_EventScript_BoardFerry::
|
|||||||
call_if_eq VAR_FACING, DIR_NORTH, SlateportCity_Harbor_EventScript_BoardFerryNorth
|
call_if_eq VAR_FACING, DIR_NORTH, SlateportCity_Harbor_EventScript_BoardFerryNorth
|
||||||
call_if_eq VAR_FACING, DIR_EAST, SlateportCity_Harbor_EventScript_BoardFerryEast
|
call_if_eq VAR_FACING, DIR_EAST, SlateportCity_Harbor_EventScript_BoardFerryEast
|
||||||
delay 30
|
delay 30
|
||||||
hideobjectat LOCALID_PLAYER, 0
|
hideplayer
|
||||||
setvar VAR_0x8004, LOCALID_SLATEPORT_HARBOR_SS_TIDAL
|
setvar VAR_0x8004, LOCALID_SLATEPORT_HARBOR_SS_TIDAL
|
||||||
call Common_EventScript_FerryDepart
|
call Common_EventScript_FerryDepart
|
||||||
return
|
return
|
||||||
|
|||||||
@ -356,7 +356,7 @@ CableClub_EventScript_EnterColosseum::
|
|||||||
waitdooranim
|
waitdooranim
|
||||||
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
|
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
hideobjectat LOCALID_PLAYER, 0
|
hideplayer
|
||||||
closedoor 9, 1
|
closedoor 9, 1
|
||||||
waitdooranim
|
waitdooranim
|
||||||
release
|
release
|
||||||
@ -450,7 +450,7 @@ CableClub_EventScript_EnterTradeCenter::
|
|||||||
waitdooranim
|
waitdooranim
|
||||||
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
|
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
hideobjectat LOCALID_PLAYER, 0
|
hideplayer
|
||||||
closedoor 9, 1
|
closedoor 9, 1
|
||||||
waitdooranim
|
waitdooranim
|
||||||
release
|
release
|
||||||
@ -515,7 +515,7 @@ CableClub_EventScript_EnterRecordCorner::
|
|||||||
waitdooranim
|
waitdooranim
|
||||||
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
|
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
hideobjectat LOCALID_PLAYER, 0
|
hideplayer
|
||||||
closedoor 9, 1
|
closedoor 9, 1
|
||||||
waitdooranim
|
waitdooranim
|
||||||
release
|
release
|
||||||
@ -902,7 +902,7 @@ CableClub_EventScript_EnterUnionRoom::
|
|||||||
waitdooranim
|
waitdooranim
|
||||||
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
|
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
hideobjectat LOCALID_PLAYER, 0
|
hideplayer
|
||||||
closedoor 5, 1
|
closedoor 5, 1
|
||||||
waitdooranim
|
waitdooranim
|
||||||
special Script_ResetUnionRoomTrade
|
special Script_ResetUnionRoomTrade
|
||||||
@ -1202,7 +1202,7 @@ CableClub_EventScript_EnterWirelessLinkRoom::
|
|||||||
waitdooranim
|
waitdooranim
|
||||||
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
|
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
hideobjectat LOCALID_PLAYER, 0
|
hideplayer
|
||||||
closedoor 9, 1
|
closedoor 9, 1
|
||||||
waitdooranim
|
waitdooranim
|
||||||
release
|
release
|
||||||
@ -1384,7 +1384,7 @@ MossdeepCity_GameCorner_1F_EventScript_EnterMinigameRoom::
|
|||||||
closemessage
|
closemessage
|
||||||
applymovement LOCALID_PLAYER, Movement_PlayerEnterMinigameRoom
|
applymovement LOCALID_PLAYER, Movement_PlayerEnterMinigameRoom
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
hideobjectat LOCALID_PLAYER, 0
|
hideplayer
|
||||||
release
|
release
|
||||||
waitstate
|
waitstate
|
||||||
end
|
end
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 284 B After Width: | Height: | Size: 277 B |
|
Before Width: | Height: | Size: 293 B After Width: | Height: | Size: 282 B |
|
Before Width: | Height: | Size: 297 B After Width: | Height: | Size: 284 B |
|
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 278 B |
|
Before Width: | Height: | Size: 336 B After Width: | Height: | Size: 328 B |
@ -13,6 +13,7 @@
|
|||||||
#include "battle_util2.h"
|
#include "battle_util2.h"
|
||||||
#include "battle_bg.h"
|
#include "battle_bg.h"
|
||||||
#include "pokeball.h"
|
#include "pokeball.h"
|
||||||
|
#include "main.h"
|
||||||
#include "battle_debug.h"
|
#include "battle_debug.h"
|
||||||
#include "battle_dynamax.h"
|
#include "battle_dynamax.h"
|
||||||
#include "battle_terastal.h"
|
#include "battle_terastal.h"
|
||||||
@ -1118,7 +1119,7 @@ extern u16 gBattleTurnCounter;
|
|||||||
extern u8 gBattlerAbility;
|
extern u8 gBattlerAbility;
|
||||||
extern struct QueuedStatBoost gQueuedStatBoosts[MAX_BATTLERS_COUNT];
|
extern struct QueuedStatBoost gQueuedStatBoosts[MAX_BATTLERS_COUNT];
|
||||||
|
|
||||||
extern void (*gPreBattleCallback1)(void);
|
extern MainCallback gPreBattleCallback1;
|
||||||
extern void (*gBattleMainFunc)(void);
|
extern void (*gBattleMainFunc)(void);
|
||||||
extern struct BattleResults gBattleResults;
|
extern struct BattleResults gBattleResults;
|
||||||
extern u8 gLeveledUpInBattle;
|
extern u8 gLeveledUpInBattle;
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
#define GUARD_BATTLE_PYRAMID_BAG_H
|
#define GUARD_BATTLE_PYRAMID_BAG_H
|
||||||
|
|
||||||
#include "list_menu.h"
|
#include "list_menu.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "task.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PYRAMIDBAG_LOC_FIELD,
|
PYRAMIDBAG_LOC_FIELD,
|
||||||
@ -29,7 +31,7 @@ enum {
|
|||||||
|
|
||||||
struct PyramidBagMenu
|
struct PyramidBagMenu
|
||||||
{
|
{
|
||||||
void (*newScreenCallback)(void);
|
MainCallback newScreenCallback;
|
||||||
u8 tilemapBuffer[BG_SCREEN_SIZE];
|
u8 tilemapBuffer[BG_SCREEN_SIZE];
|
||||||
u8 spriteIds[PBAG_SPRITE_COUNT];
|
u8 spriteIds[PBAG_SPRITE_COUNT];
|
||||||
u8 windowIds[5];
|
u8 windowIds[5];
|
||||||
@ -49,7 +51,7 @@ struct PyramidBagMenu
|
|||||||
|
|
||||||
struct PyramidBagMenuState
|
struct PyramidBagMenuState
|
||||||
{
|
{
|
||||||
void (*exitCallback)(void);
|
MainCallback exitCallback;
|
||||||
u8 location;
|
u8 location;
|
||||||
u16 cursorPosition;
|
u16 cursorPosition;
|
||||||
u16 scrollPosition;
|
u16 scrollPosition;
|
||||||
@ -63,11 +65,11 @@ void CB2_PyramidBagMenuFromStartMenu(void);
|
|||||||
void CB2_ReturnToPyramidBagMenu(void);
|
void CB2_ReturnToPyramidBagMenu(void);
|
||||||
void UpdatePyramidBagList(void);
|
void UpdatePyramidBagList(void);
|
||||||
void UpdatePyramidBagCursorPos(void);
|
void UpdatePyramidBagCursorPos(void);
|
||||||
void GoToBattlePyramidBagMenu(u8 location, void (*exitCallback)(void));
|
void GoToBattlePyramidBagMenu(u8 location, MainCallback exitCallback);
|
||||||
void Task_CloseBattlePyramidBagMessage(u8 taskId);
|
void Task_CloseBattlePyramidBagMessage(u8 taskId);
|
||||||
void TryStoreHeldItemsInPyramidBag(void);
|
void TryStoreHeldItemsInPyramidBag(void);
|
||||||
void ChooseItemsToTossFromPyramidBag(void);
|
void ChooseItemsToTossFromPyramidBag(void);
|
||||||
void CloseBattlePyramidBag(u8 taskId);
|
void CloseBattlePyramidBag(u8 taskId);
|
||||||
void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback)(u8 taskId));
|
void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, TaskFunc callback);
|
||||||
|
|
||||||
#endif // GUARD_BATTLE_PYRAMID_BAG_H
|
#endif // GUARD_BATTLE_PYRAMID_BAG_H
|
||||||
|
|||||||
@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
#include "map_groups.h"
|
#include "map_groups.h"
|
||||||
|
|
||||||
// Warps using this map will instead use the warp data stored in gSaveBlock1Ptr->dynamicWarp.
|
enum
|
||||||
// Used for warps that need to change destinations, e.g. when stepping off an elevator.
|
{
|
||||||
#define MAP_DYNAMIC (0x7F | (0x7F << 8))
|
// Warps using this map will instead use the warp data stored in gSaveBlock1Ptr->dynamicWarp.
|
||||||
|
// Used for warps that need to change destinations, e.g. when stepping off an elevator.
|
||||||
|
MAP_DYNAMIC = (0x7F | (0x7F << 8)),
|
||||||
|
|
||||||
#define MAP_UNDEFINED (0xFF | (0xFF << 8))
|
MAP_UNDEFINED = (0xFF | (0xFF << 8)),
|
||||||
|
};
|
||||||
|
|
||||||
#define MAP_GROUP(map) (map >> 8)
|
#define MAP_GROUP(map) (map >> 8)
|
||||||
#define MAP_NUM(map) (map & 0xFF)
|
#define MAP_NUM(map) (map & 0xFF)
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
#ifndef GUARD_DODRIO_BERRY_PICKING_H
|
#ifndef GUARD_DODRIO_BERRY_PICKING_H
|
||||||
#define GUARD_DODRIO_BERRY_PICKING_H
|
#define GUARD_DODRIO_BERRY_PICKING_H
|
||||||
|
|
||||||
void StartDodrioBerryPicking(u16 partyId, void (*exitCallback)(void));
|
#include "main.h"
|
||||||
|
|
||||||
|
void StartDodrioBerryPicking(u16 partyId, MainCallback exitCallback);
|
||||||
void IsDodrioInParty(void);
|
void IsDodrioInParty(void);
|
||||||
void ShowDodrioBerryPickingRecords(void);
|
void ShowDodrioBerryPickingRecords(void);
|
||||||
|
|
||||||
|
|||||||
67
include/gametypes.h
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
#ifndef GUARD_GAMETYPES_H
|
||||||
|
#define GUARD_GAMETYPES_H
|
||||||
|
|
||||||
|
#include "gba/types.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// This header includes typedefs for fields that commonly appear throughout
|
||||||
|
// the codebase, and which ROM hacks might benefit from being able to widen.
|
||||||
|
//
|
||||||
|
// These typedefs include the underlying type in their name for two reasons:
|
||||||
|
//
|
||||||
|
// - Game Freak wasn't fully consistent about field widths throughout
|
||||||
|
// their codebase. For example, when Region Map Sections are persistently
|
||||||
|
// stored in savedata, they're stored as 8-bit values; but much of the
|
||||||
|
// codebase handles them as 16-bit values.
|
||||||
|
//
|
||||||
|
// - Although Pokemon Emerald doesn't come close to maxing out RAM, it *does*
|
||||||
|
// use nearly all of its EEPROM. That is: the vanilla game uses 96% of the
|
||||||
|
// flash memory available for storing players' save files, leaving 2172
|
||||||
|
// bytes to spare within each of the game's two save files (primary and
|
||||||
|
// backup). These spare bytes are not contiguous: SaveBlock1 can only grow
|
||||||
|
// by 84 bytes, and SaveBlock2 can only grow by 120 bytes, with the rest
|
||||||
|
// of the free space located after the player's PC-boxed Pokemon.
|
||||||
|
//
|
||||||
|
// With so little flash memory to spare, keeping track of how much space
|
||||||
|
// you're using is vital -- and so is arranging struct members to minimize
|
||||||
|
// compiler-inserted padding. It's easier to deal with this when you can
|
||||||
|
// see these types' widths at a glance.
|
||||||
|
//
|
||||||
|
// Accordingly, this file generally doesn't contain just single types, but
|
||||||
|
// rather families of types. For example, Region Map Sections are saved as
|
||||||
|
// u8s within the player's save file, but are sometimes handled as u16s or
|
||||||
|
// even s16s and ints; and so there are multiple typedefs for Map Sections
|
||||||
|
// corresponding to each of these underlying types, and each typedef has a
|
||||||
|
// name which indicates the underlying type.
|
||||||
|
//
|
||||||
|
// For a given family of typedefs, the smallest one should be considered
|
||||||
|
// the "real" or "canonical" type. Continuing with Map Sections as our
|
||||||
|
// example, the smallest type is an 8-bit integer, and so any values that
|
||||||
|
// can't fit in an 8-bit integer will be truncated and lost at some point
|
||||||
|
// within the codebase. Therefore mapsec_u8_t is the "canonical" type for
|
||||||
|
// Map Sections, and the larger typedefs just exist to describe situations
|
||||||
|
// where the game handles Map Sections inconsistently with that "canon."
|
||||||
|
//
|
||||||
|
|
||||||
|
// Map Sections are named areas that can appear in the region map. Each
|
||||||
|
// individual map can be assigned to a Map Section as appropriate. The
|
||||||
|
// possible values are in constants/region_map_sections.h.
|
||||||
|
//
|
||||||
|
// If you choose to widen Map Sections, be aware that Met Locations (below)
|
||||||
|
// are based on Map Sections and will also be widened.
|
||||||
|
typedef u8 mapsec_u8_t;
|
||||||
|
typedef u16 mapsec_u16_t;
|
||||||
|
typedef s16 mapsec_s16_t;
|
||||||
|
typedef s32 mapsec_s32_t;
|
||||||
|
|
||||||
|
// Met Locations for caught Pokemon use the same values as Map Sections,
|
||||||
|
// except that 0xFD, 0xFE, and 0xFF have special meanings.
|
||||||
|
//
|
||||||
|
// Because this value appears inside every Pokemon's data, widening it will
|
||||||
|
// consume a lot more space within flash memory. The space usage will be
|
||||||
|
// greater than you expect due to how Pokemon substructs are laid out; you
|
||||||
|
// would have to rearrange the substructs' contents in order to minimize
|
||||||
|
// how much more space a wider Met Location would consume.
|
||||||
|
typedef mapsec_u8_t metloc_u8_t;
|
||||||
|
|
||||||
|
#endif //GUARD_GAMETYPES_H
|
||||||
@ -169,7 +169,7 @@ struct MapHeader
|
|||||||
/* 0x0C */ const struct MapConnections *connections;
|
/* 0x0C */ const struct MapConnections *connections;
|
||||||
/* 0x10 */ u16 music;
|
/* 0x10 */ u16 music;
|
||||||
/* 0x12 */ u16 mapLayoutId;
|
/* 0x12 */ u16 mapLayoutId;
|
||||||
/* 0x14 */ u8 regionMapSectionId;
|
/* 0x14 */ mapsec_u8_t regionMapSectionId;
|
||||||
/* 0x15 */ u8 cave;
|
/* 0x15 */ u8 cave;
|
||||||
/* 0x16 */ u8 weather;
|
/* 0x16 */ u8 weather;
|
||||||
/* 0x17 */ u8 mapType;
|
/* 0x17 */ u8 mapType;
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include "config/general.h" // we need to define config before gba headers as print stuff needs the functions nulled before defines.
|
#include "config/general.h" // we need to define config before gba headers as print stuff needs the functions nulled before defines.
|
||||||
#include "gba/gba.h"
|
#include "gba/gba.h"
|
||||||
|
#include "gametypes.h"
|
||||||
#include "siirtc.h"
|
#include "siirtc.h"
|
||||||
#include "fpmath.h"
|
#include "fpmath.h"
|
||||||
#include "metaprogram.h"
|
#include "metaprogram.h"
|
||||||
|
|||||||
@ -226,7 +226,7 @@ typedef union // size = 0x24
|
|||||||
/*0x04*/ u8 filler_04[2];
|
/*0x04*/ u8 filler_04[2];
|
||||||
/*0x06*/ u16 itemIds[SMARTSHOPPER_NUM_ITEMS];
|
/*0x06*/ u16 itemIds[SMARTSHOPPER_NUM_ITEMS];
|
||||||
/*0x0C*/ u16 itemAmounts[SMARTSHOPPER_NUM_ITEMS];
|
/*0x0C*/ u16 itemAmounts[SMARTSHOPPER_NUM_ITEMS];
|
||||||
/*0x12*/ u8 shopLocation;
|
/*0x12*/ mapsec_u8_t shopLocation;
|
||||||
/*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
/*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
||||||
/*0x1B*/ //u8 padding;
|
/*0x1B*/ //u8 padding;
|
||||||
} smartshopperShow;
|
} smartshopperShow;
|
||||||
@ -241,7 +241,7 @@ typedef union // size = 0x24
|
|||||||
/*0x0E*/ u16 species2;
|
/*0x0E*/ u16 species2;
|
||||||
/*0x10*/ u8 nBallsUsed;
|
/*0x10*/ u8 nBallsUsed;
|
||||||
/*0x11*/ u8 outcome;
|
/*0x11*/ u8 outcome;
|
||||||
/*0x12*/ u8 location;
|
/*0x12*/ mapsec_u8_t location;
|
||||||
/*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
/*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
||||||
/*0x1B*/ //u8 padding;
|
/*0x1B*/ //u8 padding;
|
||||||
} pokemonTodayFailed;
|
} pokemonTodayFailed;
|
||||||
@ -267,7 +267,7 @@ typedef union // size = 0x24
|
|||||||
/*0x04*/ u16 caughtPoke;
|
/*0x04*/ u16 caughtPoke;
|
||||||
/*0x06*/ u16 steps;
|
/*0x06*/ u16 steps;
|
||||||
/*0x08*/ u16 species;
|
/*0x08*/ u16 species;
|
||||||
/*0x0A*/ u8 location;
|
/*0x0A*/ mapsec_u8_t location;
|
||||||
/*0x0B*/ u8 language;
|
/*0x0B*/ u8 language;
|
||||||
/*0x0C*/ u8 filler_0C[7];
|
/*0x0C*/ u8 filler_0C[7];
|
||||||
/*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
/*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
||||||
@ -282,7 +282,7 @@ typedef union // size = 0x24
|
|||||||
/*0x04*/ u8 badgeCount;
|
/*0x04*/ u8 badgeCount;
|
||||||
/*0x05*/ u8 nSilverSymbols;
|
/*0x05*/ u8 nSilverSymbols;
|
||||||
/*0x06*/ u8 nGoldSymbols;
|
/*0x06*/ u8 nGoldSymbols;
|
||||||
/*0x07*/ u8 location;
|
/*0x07*/ mapsec_u8_t location;
|
||||||
/*0x08*/ u16 battlePoints;
|
/*0x08*/ u16 battlePoints;
|
||||||
/*0x0A*/ u16 mapLayoutId;
|
/*0x0A*/ u16 mapLayoutId;
|
||||||
/*0x0C*/ u8 language;
|
/*0x0C*/ u8 language;
|
||||||
@ -309,7 +309,7 @@ typedef union // size = 0x24
|
|||||||
/*0x00*/ u8 kind;
|
/*0x00*/ u8 kind;
|
||||||
/*0x01*/ bool8 active;
|
/*0x01*/ bool8 active;
|
||||||
/*0x02*/ u16 item;
|
/*0x02*/ u16 item;
|
||||||
/*0x04*/ u8 location;
|
/*0x04*/ mapsec_u8_t location;
|
||||||
/*0x05*/ u8 language;
|
/*0x05*/ u8 language;
|
||||||
/*0x06*/ u16 mapLayoutId;
|
/*0x06*/ u16 mapLayoutId;
|
||||||
/*0x08*/ u8 filler_08[11];
|
/*0x08*/ u8 filler_08[11];
|
||||||
@ -336,7 +336,7 @@ typedef union // size = 0x24
|
|||||||
/*0x00*/ u8 kind;
|
/*0x00*/ u8 kind;
|
||||||
/*0x01*/ bool8 active;
|
/*0x01*/ bool8 active;
|
||||||
/*0x02*/ u16 lastOpponentSpecies;
|
/*0x02*/ u16 lastOpponentSpecies;
|
||||||
/*0x04*/ u8 location;
|
/*0x04*/ mapsec_u8_t location;
|
||||||
/*0x05*/ u8 outcome;
|
/*0x05*/ u8 outcome;
|
||||||
/*0x06*/ u16 caughtMonBall;
|
/*0x06*/ u16 caughtMonBall;
|
||||||
/*0x08*/ u16 balls;
|
/*0x08*/ u16 balls;
|
||||||
@ -505,7 +505,7 @@ struct GabbyAndTyData
|
|||||||
/*2BA6*/ u16 mon2;
|
/*2BA6*/ u16 mon2;
|
||||||
/*2BA8*/ u16 lastMove;
|
/*2BA8*/ u16 lastMove;
|
||||||
/*2BAA*/ u16 quote[1];
|
/*2BAA*/ u16 quote[1];
|
||||||
/*2BAC*/ u8 mapnum;
|
/*2BAC*/ mapsec_u8_t mapnum;
|
||||||
/*2BAD*/ u8 battleNum;
|
/*2BAD*/ u8 battleNum;
|
||||||
/*2BAE*/ u8 battleTookMoreThanOneTurn:1;
|
/*2BAE*/ u8 battleTookMoreThanOneTurn:1;
|
||||||
u8 playerLostAMon:1;
|
u8 playerLostAMon:1;
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
#define GUARD_ITEM_MENU_H
|
#define GUARD_ITEM_MENU_H
|
||||||
|
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
|
#include "main.h"
|
||||||
#include "menu_helpers.h"
|
#include "menu_helpers.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -57,7 +58,7 @@ enum {
|
|||||||
|
|
||||||
struct BagPosition
|
struct BagPosition
|
||||||
{
|
{
|
||||||
void (*exitCallback)(void);
|
MainCallback exitCallback;
|
||||||
u8 location;
|
u8 location;
|
||||||
u8 pocket;
|
u8 pocket;
|
||||||
u16 pocketSwitchArrowPos;
|
u16 pocketSwitchArrowPos;
|
||||||
@ -69,7 +70,7 @@ extern struct BagPosition gBagPosition;
|
|||||||
|
|
||||||
struct BagMenu
|
struct BagMenu
|
||||||
{
|
{
|
||||||
void (*newScreenCallback)(void);
|
MainCallback newScreenCallback;
|
||||||
u8 tilemapBuffer[BG_SCREEN_SIZE];
|
u8 tilemapBuffer[BG_SCREEN_SIZE];
|
||||||
u8 spriteIds[ITEMMENUSPRITE_COUNT];
|
u8 spriteIds[ITEMMENUSPRITE_COUNT];
|
||||||
u8 windowIds[ITEMWIN_COUNT];
|
u8 windowIds[ITEMWIN_COUNT];
|
||||||
@ -106,16 +107,16 @@ void CB2_BagMenuFromStartMenu(void);
|
|||||||
u8 GetItemListPosition(u8 pocketId);
|
u8 GetItemListPosition(u8 pocketId);
|
||||||
bool8 UseRegisteredKeyItemOnField(void);
|
bool8 UseRegisteredKeyItemOnField(void);
|
||||||
void CB2_GoToSellMenu(void);
|
void CB2_GoToSellMenu(void);
|
||||||
void GoToBagMenu(u8 location, u8 pocket, void ( *exitCallback)());
|
void GoToBagMenu(u8 location, u8 pocket, MainCallback exitCallback);
|
||||||
void DoWallyTutorialBagMenu(void);
|
void DoWallyTutorialBagMenu(void);
|
||||||
void ResetBagScrollPositions(void);
|
void ResetBagScrollPositions(void);
|
||||||
void ChooseBerryForMachine(void (*exitCallback)(void));
|
void ChooseBerryForMachine(MainCallback exitCallback);
|
||||||
void CB2_ChooseBerry(void);
|
void CB2_ChooseBerry(void);
|
||||||
void CB2_ChooseMulch(void);
|
void CB2_ChooseMulch(void);
|
||||||
void Task_FadeAndCloseBagMenu(u8 taskId);
|
void Task_FadeAndCloseBagMenu(u8 taskId);
|
||||||
void BagMenu_YesNo(u8 taskId, u8 windowType, const struct YesNoFuncTable *funcTable);
|
void BagMenu_YesNo(u8 taskId, u8 windowType, const struct YesNoFuncTable *funcTable);
|
||||||
void UpdatePocketItemList(enum Pocket pocketId);
|
void UpdatePocketItemList(enum Pocket pocketId);
|
||||||
void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void (*callback)(u8 taskId));
|
void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, TaskFunc callback);
|
||||||
void DisplayItemMessageOnField(u8 taskId, const u8 *string, TaskFunc callback);
|
void DisplayItemMessageOnField(u8 taskId, const u8 *string, TaskFunc callback);
|
||||||
void CloseItemMessage(u8 taskId);
|
void CloseItemMessage(u8 taskId);
|
||||||
void ItemMenu_RotomCatalog(u8 taskId);
|
void ItemMenu_RotomCatalog(u8 taskId);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#ifndef GUARD_LANDMARK_H
|
#ifndef GUARD_LANDMARK_H
|
||||||
#define GUARD_LANDMARK_H
|
#define GUARD_LANDMARK_H
|
||||||
|
|
||||||
const u8 *GetLandmarkName(u8 mapSection, u8 id, u8 count);
|
const u8 *GetLandmarkName(mapsec_u8_t mapSection, u8 id, u8 count);
|
||||||
|
|
||||||
#endif // GUARD_LANDMARK_H
|
#endif // GUARD_LANDMARK_H
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
#ifndef GUARD_MAIL_H
|
#ifndef GUARD_MAIL_H
|
||||||
#define GUARD_MAIL_H
|
#define GUARD_MAIL_H
|
||||||
|
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
#define IS_ITEM_MAIL(itemId) ((itemId == ITEM_ORANGE_MAIL \
|
#define IS_ITEM_MAIL(itemId) ((itemId == ITEM_ORANGE_MAIL \
|
||||||
|| itemId == ITEM_HARBOR_MAIL \
|
|| itemId == ITEM_HARBOR_MAIL \
|
||||||
|| itemId == ITEM_GLITTER_MAIL \
|
|| itemId == ITEM_GLITTER_MAIL \
|
||||||
@ -15,7 +17,7 @@
|
|||||||
|| itemId == ITEM_RETRO_MAIL))
|
|| itemId == ITEM_RETRO_MAIL))
|
||||||
|
|
||||||
// mail.h
|
// mail.h
|
||||||
void ReadMail(struct Mail *mail, void (*exitCallback)(void), bool8 hasText);
|
void ReadMail(struct Mail *mail, MainCallback exitCallback, bool8 hasText);
|
||||||
|
|
||||||
// mail_data.h
|
// mail_data.h
|
||||||
void ClearAllMail(void);
|
void ClearAllMail(void);
|
||||||
|
|||||||
@ -135,8 +135,8 @@ enum MapType GetLastUsedWarpMapType(void);
|
|||||||
bool8 IsMapTypeOutdoors(enum MapType mapType);
|
bool8 IsMapTypeOutdoors(enum MapType mapType);
|
||||||
bool8 Overworld_MapTypeAllowsTeleportAndFly(enum MapType mapType);
|
bool8 Overworld_MapTypeAllowsTeleportAndFly(enum MapType mapType);
|
||||||
bool8 IsMapTypeIndoors(enum MapType mapType);
|
bool8 IsMapTypeIndoors(enum MapType mapType);
|
||||||
u8 GetSavedWarpRegionMapSectionId(void);
|
mapsec_u8_t GetSavedWarpRegionMapSectionId(void);
|
||||||
u8 GetCurrentRegionMapSectionId(void);
|
mapsec_u8_t GetCurrentRegionMapSectionId(void);
|
||||||
enum MapBattleScene GetCurrentMapBattleScene(void);
|
enum MapBattleScene GetCurrentMapBattleScene(void);
|
||||||
void CleanupOverworldWindowsAndTilemaps(void);
|
void CleanupOverworldWindowsAndTilemaps(void);
|
||||||
bool32 IsOverworldLinkActive(void);
|
bool32 IsOverworldLinkActive(void);
|
||||||
|
|||||||
@ -17,7 +17,7 @@ struct PokenavMonListItem
|
|||||||
struct PokenavMatchCallEntry
|
struct PokenavMatchCallEntry
|
||||||
{
|
{
|
||||||
bool8 isSpecialTrainer;
|
bool8 isSpecialTrainer;
|
||||||
u8 mapSec;
|
mapsec_u8_t mapSec;
|
||||||
u16 headerId;
|
u16 headerId;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -413,7 +413,7 @@ void FreeMatchCallSubstruct1(void);
|
|||||||
int IsMatchCallListInitFinished(void);
|
int IsMatchCallListInitFinished(void);
|
||||||
int GetNumberRegistered(void);
|
int GetNumberRegistered(void);
|
||||||
struct PokenavMatchCallEntry *GetMatchCallList(void);
|
struct PokenavMatchCallEntry *GetMatchCallList(void);
|
||||||
u16 GetMatchCallMapSec(int index);
|
mapsec_u16_t GetMatchCallMapSec(int index);
|
||||||
bool32 ShouldDrawRematchPokeballIcon(int index);
|
bool32 ShouldDrawRematchPokeballIcon(int index);
|
||||||
void ClearRematchPokeballIcon(u16 windowId, u32 tileOffset);
|
void ClearRematchPokeballIcon(u16 windowId, u32 tileOffset);
|
||||||
int GetMatchCallTrainerPic(int index);
|
int GetMatchCallTrainerPic(int index);
|
||||||
@ -422,7 +422,7 @@ const u8 *GetMatchCallMessageText(int index, bool8 *newRematchRequest);
|
|||||||
u16 GetMatchCallOptionCursorPos(void);
|
u16 GetMatchCallOptionCursorPos(void);
|
||||||
u16 GetMatchCallOptionId(int optionId);
|
u16 GetMatchCallOptionId(int optionId);
|
||||||
void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntry *matchCallEntry, u8 *str);
|
void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntry *matchCallEntry, u8 *str);
|
||||||
u8 GetMatchTableMapSectionId(int rematchIndex);
|
mapsec_u8_t GetMatchTableMapSectionId(int rematchIndex);
|
||||||
int GetIndexDeltaOfNextCheckPageDown(int index);
|
int GetIndexDeltaOfNextCheckPageDown(int index);
|
||||||
int GetIndexDeltaOfNextCheckPageUp(int index);
|
int GetIndexDeltaOfNextCheckPageUp(int index);
|
||||||
bool32 IsRematchEntryRegistered(int rematchIndex);
|
bool32 IsRematchEntryRegistered(int rematchIndex);
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
#ifndef GUARD_RAYQUAZA_SCENE_H
|
#ifndef GUARD_RAYQUAZA_SCENE_H
|
||||||
#define GUARD_RAYQUAZA_SCENE_H
|
#define GUARD_RAYQUAZA_SCENE_H
|
||||||
|
|
||||||
void DoRayquazaScene(u8 animId, bool8 endEarly, void (*exitCallback)(void));
|
#include "main.h"
|
||||||
|
|
||||||
|
void DoRayquazaScene(u8 animId, bool8 endEarly, MainCallback exitCallback);
|
||||||
|
|
||||||
#endif // GUARD_RAYQUAZA_SCENE_H
|
#endif // GUARD_RAYQUAZA_SCENE_H
|
||||||
|
|||||||
@ -27,7 +27,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct RegionMap {
|
struct RegionMap {
|
||||||
/*0x000*/ u16 mapSecId;
|
/*0x000*/ mapsec_u16_t mapSecId;
|
||||||
/*0x002*/ u8 mapSecType;
|
/*0x002*/ u8 mapSecType;
|
||||||
/*0x003*/ u8 posWithinMapSec;
|
/*0x003*/ u8 posWithinMapSec;
|
||||||
/*0x004*/ u8 mapSecName[20];
|
/*0x004*/ u8 mapSecName[20];
|
||||||
@ -100,14 +100,14 @@ void InitRegionMap(struct RegionMap *regionMap, bool8 zoomed);
|
|||||||
u8 DoRegionMapInputCallback(void);
|
u8 DoRegionMapInputCallback(void);
|
||||||
bool8 UpdateRegionMapZoom(void);
|
bool8 UpdateRegionMapZoom(void);
|
||||||
void FreeRegionMapIconResources(void);
|
void FreeRegionMapIconResources(void);
|
||||||
u16 GetRegionMapSecIdAt(u16 x, u16 y);
|
mapsec_u16_t GetRegionMapSecIdAt(u16 x, u16 y);
|
||||||
void CreateRegionMapPlayerIcon(u16 tileTag, u16 paletteTag);
|
void CreateRegionMapPlayerIcon(u16 tileTag, u16 paletteTag);
|
||||||
void CreateRegionMapCursor(u16 tileTag, u16 paletteTag);
|
void CreateRegionMapCursor(u16 tileTag, u16 paletteTag);
|
||||||
bool32 IsEventIslandMapSecId(u8 mapSecId);
|
bool32 IsEventIslandMapSecId(mapsec_u8_t mapSecId);
|
||||||
u8 *GetMapName(u8 *dest, u16 regionMapId, u16 padLength);
|
u8 *GetMapName(u8 *dest, mapsec_u16_t regionMapId, u16 padLength);
|
||||||
u8 *GetMapNameGeneric(u8 *dest, u16 mapSecId);
|
u8 *GetMapNameGeneric(u8 *dest, mapsec_u16_t mapSecId);
|
||||||
u8 *GetMapNameHandleAquaHideout(u8 *dest, u16 mapSecId);
|
u8 *GetMapNameHandleAquaHideout(u8 *dest, mapsec_u16_t mapSecId);
|
||||||
u16 CorrectSpecialMapSecId(u16 mapSecId);
|
mapsec_u16_t CorrectSpecialMapSecId(mapsec_u16_t mapSecId);
|
||||||
void ShowRegionMapForPokedexAreaScreen(struct RegionMap *regionMap);
|
void ShowRegionMapForPokedexAreaScreen(struct RegionMap *regionMap);
|
||||||
void PokedexAreaScreen_UpdateRegionMapVariablesAndVideoRegs(s16 x, s16 y);
|
void PokedexAreaScreen_UpdateRegionMapVariablesAndVideoRegs(s16 x, s16 y);
|
||||||
void CB2_OpenFlyMap(void);
|
void CB2_OpenFlyMap(void);
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
#ifndef GUARD_SAVE_H
|
#ifndef GUARD_SAVE_H
|
||||||
#define GUARD_SAVE_H
|
#define GUARD_SAVE_H
|
||||||
|
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
// Each 4 KiB flash sector contains 3968 bytes of actual data followed by 116 bytes of SaveBlock3 and then 12 bytes of footer.
|
// Each 4 KiB flash sector contains 3968 bytes of actual data followed by 116 bytes of SaveBlock3 and then 12 bytes of footer.
|
||||||
#define SECTOR_DATA_SIZE 3968
|
#define SECTOR_DATA_SIZE 3968
|
||||||
#define SAVE_BLOCK_3_CHUNK_SIZE 116
|
#define SAVE_BLOCK_3_CHUNK_SIZE 116
|
||||||
@ -87,7 +89,7 @@ extern u32 gSaveCounter;
|
|||||||
extern struct SaveSector *gFastSaveSector;
|
extern struct SaveSector *gFastSaveSector;
|
||||||
extern u16 gIncrementalSectorId;
|
extern u16 gIncrementalSectorId;
|
||||||
extern u16 gSaveFileStatus;
|
extern u16 gSaveFileStatus;
|
||||||
extern void (*gGameContinueCallback)(void);
|
extern MainCallback gGameContinueCallback;
|
||||||
extern struct SaveSectorLocation gRamSaveSectorLocations[];
|
extern struct SaveSectorLocation gRamSaveSectorLocations[];
|
||||||
|
|
||||||
extern struct SaveSector gSaveDataBuffer;
|
extern struct SaveSector gSaveDataBuffer;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
POKEMONGFXDIR := graphics/pokemon
|
POKEMONGFXDIR := graphics/pokemon
|
||||||
OBJEVENTGFXDIR := graphics/object_events/pics
|
OBJEVENTGFXDIR := graphics/object_events/pics
|
||||||
FLDEFFGFXDIR := graphics/field_effects/pics
|
FLDEFFGFXDIR := graphics/field_effects/pics
|
||||||
|
BATINTGFXDIR := graphics/battle_interface
|
||||||
MISCGFXDIR := graphics/misc
|
MISCGFXDIR := graphics/misc
|
||||||
|
|
||||||
$(OBJEVENTGFXDIR)/people/brendan/walking.4bpp: %.4bpp: %.png
|
$(OBJEVENTGFXDIR)/people/brendan/walking.4bpp: %.4bpp: %.png
|
||||||
@ -4934,3 +4935,18 @@ $(OBJEVENTGFXDIR)/misc/ball_%.4bpp: $(OBJEVENTGFXDIR)/misc/ball_%.png ; $(GFX) $
|
|||||||
|
|
||||||
graphics/door_anims/battle_tower_multi_corridor.4bpp: %.4bpp: %.png
|
graphics/door_anims/battle_tower_multi_corridor.4bpp: %.4bpp: %.png
|
||||||
$(GFX) $< $@ -mwidth 2 -mheight 4
|
$(GFX) $< $@ -mwidth 2 -mheight 4
|
||||||
|
|
||||||
|
$(BATINTGFXDIR)/healthbox_doubles_opponent.4bpp: %.4bpp: %.png
|
||||||
|
$(GFX) $< $@ -mwidth 8 -mheight 4
|
||||||
|
|
||||||
|
$(BATINTGFXDIR)/healthbox_doubles_player.4bpp: %.4bpp: %.png
|
||||||
|
$(GFX) $< $@ -mwidth 8 -mheight 4
|
||||||
|
|
||||||
|
$(BATINTGFXDIR)/healthbox_safari.4bpp: %.4bpp: %.png
|
||||||
|
$(GFX) $< $@ -mwidth 8 -mheight 8
|
||||||
|
|
||||||
|
$(BATINTGFXDIR)/healthbox_singles_opponent.4bpp: %.4bpp: %.png
|
||||||
|
$(GFX) $< $@ -mwidth 8 -mheight 4
|
||||||
|
|
||||||
|
$(BATINTGFXDIR)/healthbox_singles_player.4bpp: %.4bpp: %.png
|
||||||
|
$(GFX) $< $@ -mwidth 8 -mheight 8
|
||||||
|
|||||||
@ -125,7 +125,7 @@ struct FactorySelectScreen
|
|||||||
struct SwapScreenAction
|
struct SwapScreenAction
|
||||||
{
|
{
|
||||||
u8 id;
|
u8 id;
|
||||||
void (*func)(u8 taskId);
|
TaskFunc func;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FactorySwapScreen
|
struct FactorySwapScreen
|
||||||
@ -253,7 +253,7 @@ static EWRAM_DATA u8 *sSwapMenuTilemapBuffer = NULL;
|
|||||||
static EWRAM_DATA u8 *sSwapMonPicBgTilemapBuffer = NULL;
|
static EWRAM_DATA u8 *sSwapMonPicBgTilemapBuffer = NULL;
|
||||||
|
|
||||||
static struct FactorySelectScreen *sFactorySelectScreen;
|
static struct FactorySelectScreen *sFactorySelectScreen;
|
||||||
static void (*sSwap_CurrentOptionFunc)(u8 taskId);
|
static TaskFunc sSwap_CurrentOptionFunc;
|
||||||
static struct FactorySwapScreen *sFactorySwapScreen;
|
static struct FactorySwapScreen *sFactorySwapScreen;
|
||||||
|
|
||||||
COMMON_DATA u8 (*gFactorySelect_CurrentOptionFunc)(void) = NULL;
|
COMMON_DATA u8 (*gFactorySelect_CurrentOptionFunc)(void) = NULL;
|
||||||
@ -886,7 +886,7 @@ static const struct SpriteTemplate sSpriteTemplate_Swap_MonPicBgAnim =
|
|||||||
.callback = SpriteCallbackDummy
|
.callback = SpriteCallbackDummy
|
||||||
};
|
};
|
||||||
|
|
||||||
void static (*const sSwap_MenuOptionFuncs[])(u8 taskId) =
|
static const TaskFunc sSwap_MenuOptionFuncs[] =
|
||||||
{
|
{
|
||||||
Swap_OptionSummary,
|
Swap_OptionSummary,
|
||||||
Swap_OptionSwap,
|
Swap_OptionSwap,
|
||||||
|
|||||||
@ -244,7 +244,7 @@ EWRAM_DATA u8 gPartyCriticalHits[PARTY_SIZE] = {0};
|
|||||||
EWRAM_DATA static u8 sTriedEvolving = 0;
|
EWRAM_DATA static u8 sTriedEvolving = 0;
|
||||||
EWRAM_DATA u8 gCategoryIconSpriteId = 0;
|
EWRAM_DATA u8 gCategoryIconSpriteId = 0;
|
||||||
|
|
||||||
COMMON_DATA void (*gPreBattleCallback1)(void) = NULL;
|
COMMON_DATA MainCallback gPreBattleCallback1 = NULL;
|
||||||
COMMON_DATA void (*gBattleMainFunc)(void) = NULL;
|
COMMON_DATA void (*gBattleMainFunc)(void) = NULL;
|
||||||
COMMON_DATA struct BattleResults gBattleResults = {0};
|
COMMON_DATA struct BattleResults gBattleResults = {0};
|
||||||
COMMON_DATA u8 gLeveledUpInBattle = 0;
|
COMMON_DATA u8 gLeveledUpInBattle = 0;
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
#include "item_use.h"
|
#include "item_use.h"
|
||||||
#include "list_menu.h"
|
#include "list_menu.h"
|
||||||
#include "mail.h"
|
#include "mail.h"
|
||||||
#include "main.h"
|
|
||||||
#include "malloc.h"
|
#include "malloc.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
#include "menu_helpers.h"
|
#include "menu_helpers.h"
|
||||||
@ -414,7 +413,7 @@ void CB2_ReturnToPyramidBagMenu(void)
|
|||||||
GoToBattlePyramidBagMenu(PYRAMIDBAG_LOC_PREV, gPyramidBagMenuState.exitCallback);
|
GoToBattlePyramidBagMenu(PYRAMIDBAG_LOC_PREV, gPyramidBagMenuState.exitCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoToBattlePyramidBagMenu(u8 location, void (*exitCallback)(void))
|
void GoToBattlePyramidBagMenu(u8 location, MainCallback exitCallback)
|
||||||
{
|
{
|
||||||
gPyramidBagMenu = AllocZeroed(sizeof(*gPyramidBagMenu));
|
gPyramidBagMenu = AllocZeroed(sizeof(*gPyramidBagMenu));
|
||||||
|
|
||||||
@ -1526,7 +1525,7 @@ static void CreatePyramidBagYesNo(u8 taskId, const struct YesNoFuncTable *yesNoT
|
|||||||
CreateYesNoMenuWithCallbacks(taskId, &sWindowTemplates_MenuActions[MENU_WIN_YESNO], 1, 0, 2, 1, 0xE, yesNoTable);
|
CreateYesNoMenuWithCallbacks(taskId, &sWindowTemplates_MenuActions[MENU_WIN_YESNO], 1, 0, 2, 1, 0xE, yesNoTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback)(u8 taskId))
|
void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, TaskFunc callback)
|
||||||
{
|
{
|
||||||
FillWindowPixelBuffer(WIN_MSG, PIXEL_FILL(1));
|
FillWindowPixelBuffer(WIN_MSG, PIXEL_FILL(1));
|
||||||
DisplayMessageAndContinueTask(taskId, WIN_MSG, 0xA, 0xD, FONT_NORMAL, GetPlayerTextSpeedDelay(), str, callback);
|
DisplayMessageAndContinueTask(taskId, WIN_MSG, 0xA, 0xD, FONT_NORMAL, GetPlayerTextSpeedDelay(), str, callback);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
static const u8 sRegionMap_MapSectionLayout[MAP_HEIGHT][MAP_WIDTH] = {
|
static const mapsec_u8_t sRegionMap_MapSectionLayout[MAP_HEIGHT][MAP_WIDTH] = {
|
||||||
{MAPSEC_NONE, MAPSEC_ROUTE_114, MAPSEC_ROUTE_114, MAPSEC_FALLARBOR_TOWN, MAPSEC_ROUTE_113, MAPSEC_ROUTE_113, MAPSEC_ROUTE_113, MAPSEC_ROUTE_113, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_FORTREE_CITY, MAPSEC_ROUTE_120, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE},
|
{MAPSEC_NONE, MAPSEC_ROUTE_114, MAPSEC_ROUTE_114, MAPSEC_FALLARBOR_TOWN, MAPSEC_ROUTE_113, MAPSEC_ROUTE_113, MAPSEC_ROUTE_113, MAPSEC_ROUTE_113, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_FORTREE_CITY, MAPSEC_ROUTE_120, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE},
|
||||||
{MAPSEC_NONE, MAPSEC_ROUTE_114, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_MT_CHIMNEY, MAPSEC_MT_CHIMNEY, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_NONE, MAPSEC_ROUTE_120, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE},
|
{MAPSEC_NONE, MAPSEC_ROUTE_114, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_MT_CHIMNEY, MAPSEC_MT_CHIMNEY, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_NONE, MAPSEC_ROUTE_120, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE},
|
||||||
{MAPSEC_ROUTE_115, MAPSEC_ROUTE_114, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_MT_CHIMNEY, MAPSEC_MT_CHIMNEY, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_NONE, MAPSEC_ROUTE_120, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_SAFARI_ZONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE},
|
{MAPSEC_ROUTE_115, MAPSEC_ROUTE_114, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_MT_CHIMNEY, MAPSEC_MT_CHIMNEY, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_NONE, MAPSEC_ROUTE_120, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_SAFARI_ZONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE},
|
||||||
|
|||||||
@ -1107,7 +1107,7 @@ void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation)
|
|||||||
u8 metLevel;
|
u8 metLevel;
|
||||||
enum PokeBall ball;
|
enum PokeBall ball;
|
||||||
u8 language;
|
u8 language;
|
||||||
u8 metLocation;
|
metloc_u8_t metLocation;
|
||||||
u8 isEgg;
|
u8 isEgg;
|
||||||
|
|
||||||
CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);
|
CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);
|
||||||
|
|||||||
@ -11,7 +11,6 @@
|
|||||||
#include "link.h"
|
#include "link.h"
|
||||||
#include "link_rfu.h"
|
#include "link_rfu.h"
|
||||||
#include "m4a.h"
|
#include "m4a.h"
|
||||||
#include "main.h"
|
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
#include "minigame_countdown.h"
|
#include "minigame_countdown.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
@ -224,7 +223,7 @@ struct DodrioGame_ScoreResults
|
|||||||
|
|
||||||
struct DodrioGame
|
struct DodrioGame
|
||||||
{
|
{
|
||||||
/*0x0000*/ void (*exitCallback)(void);
|
/*0x0000*/ MainCallback exitCallback;
|
||||||
/*0x0004*/ u8 ALIGNED(4) taskId;
|
/*0x0004*/ u8 ALIGNED(4) taskId;
|
||||||
/*0x0008*/ u8 ALIGNED(4) playersReceived;
|
/*0x0008*/ u8 ALIGNED(4) playersReceived;
|
||||||
/*0x000C*/ u8 ALIGNED(4) startState;
|
/*0x000C*/ u8 ALIGNED(4) startState;
|
||||||
@ -662,7 +661,7 @@ static void (*const sMemberFuncs[])(void) =
|
|||||||
[FUNC_WAIT_END_GAME] = WaitEndGame_Member
|
[FUNC_WAIT_END_GAME] = WaitEndGame_Member
|
||||||
};
|
};
|
||||||
|
|
||||||
void StartDodrioBerryPicking(u16 partyId, void (*exitCallback)(void))
|
void StartDodrioBerryPicking(u16 partyId, MainCallback exitCallback)
|
||||||
{
|
{
|
||||||
sExitingGame = FALSE;
|
sExitingGame = FALSE;
|
||||||
|
|
||||||
|
|||||||
@ -365,7 +365,7 @@ static void AddHatchedMonToParty(u8 id)
|
|||||||
enum NationalDexOrder species;
|
enum NationalDexOrder species;
|
||||||
u8 name[POKEMON_NAME_LENGTH + 1];
|
u8 name[POKEMON_NAME_LENGTH + 1];
|
||||||
u16 metLevel;
|
u16 metLevel;
|
||||||
u8 metLocation;
|
metloc_u8_t metLocation;
|
||||||
struct Pokemon *mon = &gPlayerParty[id];
|
struct Pokemon *mon = &gPlayerParty[id];
|
||||||
|
|
||||||
CreateHatchedMon(mon, &gEnemyParty[0]);
|
CreateHatchedMon(mon, &gEnemyParty[0]);
|
||||||
|
|||||||
@ -339,9 +339,9 @@ bool8 IsComputerScreenCloseEffectActive(void)
|
|||||||
#define tBlendCnt data[7]
|
#define tBlendCnt data[7]
|
||||||
#define tBlendY data[8]
|
#define tBlendY data[8]
|
||||||
|
|
||||||
static void CreateComputerScreenEffectTask(void (*taskfunc) (u8), u16 increment, u16 unused, u8 priority)
|
static void CreateComputerScreenEffectTask(TaskFunc func, u16 increment, u16 unused, u8 priority)
|
||||||
{
|
{
|
||||||
u8 taskId = CreateTask(taskfunc, priority);
|
u8 taskId = CreateTask(func, priority);
|
||||||
|
|
||||||
gTasks[taskId].tState = 0;
|
gTasks[taskId].tState = 0;
|
||||||
gTasks[taskId].tHorzIncrement = increment == 0 ? 16 : increment;
|
gTasks[taskId].tHorzIncrement = increment == 0 ? 16 : increment;
|
||||||
|
|||||||
@ -106,7 +106,7 @@ enum {
|
|||||||
|
|
||||||
struct FrontierPassData
|
struct FrontierPassData
|
||||||
{
|
{
|
||||||
void (*callback)(void);
|
MainCallback callback;
|
||||||
u16 state;
|
u16 state;
|
||||||
u16 battlePoints;
|
u16 battlePoints;
|
||||||
s16 cursorX;
|
s16 cursorX;
|
||||||
@ -137,14 +137,14 @@ struct FrontierPassGfx
|
|||||||
|
|
||||||
struct FrontierPassSaved
|
struct FrontierPassSaved
|
||||||
{
|
{
|
||||||
void (*callback)(void);
|
MainCallback callback;
|
||||||
s16 cursorX;
|
s16 cursorX;
|
||||||
s16 cursorY;
|
s16 cursorY;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FrontierMapData
|
struct FrontierMapData
|
||||||
{
|
{
|
||||||
void (*callback)(void);
|
MainCallback callback;
|
||||||
struct Sprite *cursorSprite;
|
struct Sprite *cursorSprite;
|
||||||
struct Sprite *playerHeadSprite;
|
struct Sprite *playerHeadSprite;
|
||||||
struct Sprite *mapIndicatorSprite;
|
struct Sprite *mapIndicatorSprite;
|
||||||
@ -160,8 +160,8 @@ static EWRAM_DATA struct FrontierPassGfx *sPassGfx = NULL;
|
|||||||
static EWRAM_DATA struct FrontierMapData *sMapData = NULL;
|
static EWRAM_DATA struct FrontierMapData *sMapData = NULL;
|
||||||
static EWRAM_DATA struct FrontierPassSaved sSavedPassData = {0};
|
static EWRAM_DATA struct FrontierPassSaved sSavedPassData = {0};
|
||||||
|
|
||||||
static u32 AllocateFrontierPassData(void (*callback)(void));
|
static u32 AllocateFrontierPassData(MainCallback callback);
|
||||||
static void ShowFrontierMap(void (*callback)(void));
|
static void ShowFrontierMap(MainCallback callback);
|
||||||
static void CB2_InitFrontierPass(void);
|
static void CB2_InitFrontierPass(void);
|
||||||
static void DrawFrontierPassBg(void);
|
static void DrawFrontierPassBg(void);
|
||||||
static void FreeCursorAndSymbolSprites(void);
|
static void FreeCursorAndSymbolSprites(void);
|
||||||
@ -604,9 +604,11 @@ static void LeaveFrontierPass(void)
|
|||||||
FreeFrontierPassData();
|
FreeFrontierPassData();
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 AllocateFrontierPassData(void (*callback)(void))
|
static u32 AllocateFrontierPassData(MainCallback callback)
|
||||||
{
|
{
|
||||||
u8 i;
|
// This variable is a MAPSEC initially, but is recycled as a
|
||||||
|
// bare integer near the end of the function.
|
||||||
|
mapsec_u8_t i;
|
||||||
|
|
||||||
if (sPassData != NULL)
|
if (sPassData != NULL)
|
||||||
return ERR_ALREADY_DONE;
|
return ERR_ALREADY_DONE;
|
||||||
@ -1363,7 +1365,7 @@ static void PrintOnFrontierMap(void);
|
|||||||
static void InitFrontierMapSprites(void);
|
static void InitFrontierMapSprites(void);
|
||||||
static void HandleFrontierMapCursorMove(u8 direction);
|
static void HandleFrontierMapCursorMove(u8 direction);
|
||||||
|
|
||||||
static void ShowFrontierMap(void (*callback)(void))
|
static void ShowFrontierMap(MainCallback callback)
|
||||||
{
|
{
|
||||||
if (sMapData != NULL)
|
if (sMapData != NULL)
|
||||||
SetMainCallback2(callback); // This line doesn't make sense at all, since it gets overwritten later anyway.
|
SetMainCallback2(callback); // This line doesn't make sense at all, since it gets overwritten later anyway.
|
||||||
|
|||||||
@ -24,7 +24,6 @@
|
|||||||
#include "list_menu.h"
|
#include "list_menu.h"
|
||||||
#include "link.h"
|
#include "link.h"
|
||||||
#include "mail.h"
|
#include "mail.h"
|
||||||
#include "main.h"
|
|
||||||
#include "malloc.h"
|
#include "malloc.h"
|
||||||
#include "map_name_popup.h"
|
#include "map_name_popup.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
@ -614,7 +613,7 @@ void CB2_ChooseMulch(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Choosing berry for Berry Blender or Berry Crush
|
// Choosing berry for Berry Blender or Berry Crush
|
||||||
void ChooseBerryForMachine(void (*exitCallback)(void))
|
void ChooseBerryForMachine(MainCallback exitCallback)
|
||||||
{
|
{
|
||||||
GoToBagMenu(ITEMMENULOCATION_BERRY_BLENDER_CRUSH, POCKET_BERRIES, exitCallback);
|
GoToBagMenu(ITEMMENULOCATION_BERRY_BLENDER_CRUSH, POCKET_BERRIES, exitCallback);
|
||||||
}
|
}
|
||||||
@ -648,7 +647,7 @@ void QuizLadyOpenBagMenu(void)
|
|||||||
gSpecialVar_Result = FALSE;
|
gSpecialVar_Result = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoToBagMenu(u8 location, u8 pocket, void ( *exitCallback)())
|
void GoToBagMenu(u8 location, u8 pocket, MainCallback exitCallback)
|
||||||
{
|
{
|
||||||
gBagMenu = AllocZeroed(sizeof(*gBagMenu));
|
gBagMenu = AllocZeroed(sizeof(*gBagMenu));
|
||||||
if (gBagMenu == NULL)
|
if (gBagMenu == NULL)
|
||||||
@ -1208,7 +1207,7 @@ u8 GetItemListPosition(u8 pocketId)
|
|||||||
return gBagPosition.scrollPosition[pocketId] + gBagPosition.cursorPosition[pocketId];
|
return gBagPosition.scrollPosition[pocketId] + gBagPosition.cursorPosition[pocketId];
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void (*callback)(u8 taskId))
|
void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, TaskFunc callback)
|
||||||
{
|
{
|
||||||
s16 *data = gTasks[taskId].data;
|
s16 *data = gTasks[taskId].data;
|
||||||
|
|
||||||
|
|||||||
@ -97,7 +97,7 @@ static const u8 sText_PlayedPokeFlute[] = _("Played the POKé FLUTE.");
|
|||||||
static const u8 sText_PokeFluteAwakenedMon[] = _("The POKé FLUTE awakened sleeping\nPOKéMON.{PAUSE_UNTIL_PRESS}");
|
static const u8 sText_PokeFluteAwakenedMon[] = _("The POKé FLUTE awakened sleeping\nPOKéMON.{PAUSE_UNTIL_PRESS}");
|
||||||
|
|
||||||
// EWRAM variables
|
// EWRAM variables
|
||||||
EWRAM_DATA static void(*sItemUseOnFieldCB)(u8 taskId) = NULL;
|
EWRAM_DATA static TaskFunc sItemUseOnFieldCB = NULL;
|
||||||
|
|
||||||
// Below is set TRUE by UseRegisteredKeyItemOnField
|
// Below is set TRUE by UseRegisteredKeyItemOnField
|
||||||
#define tUsingRegisteredKeyItem data[3]
|
#define tUsingRegisteredKeyItem data[3]
|
||||||
|
|||||||
@ -10,7 +10,7 @@ struct Landmark
|
|||||||
|
|
||||||
struct LandmarkList
|
struct LandmarkList
|
||||||
{
|
{
|
||||||
u8 mapSection;
|
mapsec_u8_t mapSection;
|
||||||
u8 id;
|
u8 id;
|
||||||
const struct Landmark *const *landmarks;
|
const struct Landmark *const *landmarks;
|
||||||
};
|
};
|
||||||
@ -392,9 +392,9 @@ static const struct LandmarkList sLandmarkLists[] =
|
|||||||
{MAPSEC_NONE, 0, NULL},
|
{MAPSEC_NONE, 0, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct Landmark *const *GetLandmarks(u8 mapSection, u8 id);
|
static const struct Landmark *const *GetLandmarks(mapsec_u8_t mapSection, u8 id);
|
||||||
|
|
||||||
const u8 *GetLandmarkName(u8 mapSection, u8 id, u8 count)
|
const u8 *GetLandmarkName(mapsec_u8_t mapSection, u8 id, u8 count)
|
||||||
{
|
{
|
||||||
const struct Landmark *const *landmarks = GetLandmarks(mapSection, id);
|
const struct Landmark *const *landmarks = GetLandmarks(mapSection, id);
|
||||||
|
|
||||||
@ -421,7 +421,7 @@ const u8 *GetLandmarkName(u8 mapSection, u8 id, u8 count)
|
|||||||
return (*landmarks)->name;
|
return (*landmarks)->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct Landmark *const *GetLandmarks(u8 mapSection, u8 id)
|
static const struct Landmark *const *GetLandmarks(mapsec_u8_t mapSection, u8 id)
|
||||||
{
|
{
|
||||||
u16 i = 0;
|
u16 i = 0;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "mail.h"
|
#include "mail.h"
|
||||||
#include "constants/items.h"
|
#include "constants/items.h"
|
||||||
#include "main.h"
|
|
||||||
#include "overworld.h"
|
#include "overworld.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
#include "scanline_effect.h"
|
#include "scanline_effect.h"
|
||||||
@ -443,7 +442,7 @@ static const struct MailLayout sMailLayouts_Tall[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
void ReadMail(struct Mail *mail, void (*exitCallback)(void), bool8 hasText)
|
void ReadMail(struct Mail *mail, MainCallback exitCallback, bool8 hasText)
|
||||||
{
|
{
|
||||||
u16 buffer[2];
|
u16 buffer[2];
|
||||||
u16 species;
|
u16 species;
|
||||||
|
|||||||
@ -615,7 +615,7 @@ static void LoadMapNamePopUpWindowBg(void)
|
|||||||
{
|
{
|
||||||
u8 popUpThemeId;
|
u8 popUpThemeId;
|
||||||
u8 popupWindowId = GetMapNamePopUpWindowId();
|
u8 popupWindowId = GetMapNamePopUpWindowId();
|
||||||
u16 regionMapSectionId = gMapHeader.regionMapSectionId;
|
mapsec_u16_t regionMapSectionId = gMapHeader.regionMapSectionId;
|
||||||
u8 secondaryPopUpWindowId;
|
u8 secondaryPopUpWindowId;
|
||||||
|
|
||||||
if (OW_POPUP_GENERATION == GEN_5)
|
if (OW_POPUP_GENERATION == GEN_5)
|
||||||
|
|||||||
@ -135,7 +135,7 @@ static u32 GetCurrentTotalMinutes(struct Time *);
|
|||||||
static u32 GetNumRegisteredTrainers(void);
|
static u32 GetNumRegisteredTrainers(void);
|
||||||
static u32 GetActiveMatchCallTrainerId(u32);
|
static u32 GetActiveMatchCallTrainerId(u32);
|
||||||
static int GetTrainerMatchCallId(int);
|
static int GetTrainerMatchCallId(int);
|
||||||
static u16 GetRematchTrainerLocation(int);
|
static mapsec_u16_t GetRematchTrainerLocation(int);
|
||||||
static bool32 TrainerIsEligibleForRematch(int);
|
static bool32 TrainerIsEligibleForRematch(int);
|
||||||
static void StartMatchCall(void);
|
static void StartMatchCall(void);
|
||||||
static void ExecuteMatchCall(u8);
|
static void ExecuteMatchCall(u8);
|
||||||
@ -1468,7 +1468,7 @@ static bool32 TrainerIsEligibleForRematch(int matchCallId)
|
|||||||
#endif //FREE_MATCH_CALL
|
#endif //FREE_MATCH_CALL
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 GetRematchTrainerLocation(int matchCallId)
|
static mapsec_u16_t GetRematchTrainerLocation(int matchCallId)
|
||||||
{
|
{
|
||||||
const struct MapHeader *mapHeader = Overworld_GetMapHeaderByGroupAndId(gRematchTable[matchCallId].mapGroup, gRematchTable[matchCallId].mapNum);
|
const struct MapHeader *mapHeader = Overworld_GetMapHeaderByGroupAndId(gRematchTable[matchCallId].mapGroup, gRematchTable[matchCallId].mapNum);
|
||||||
return mapHeader->regionMapSectionId;
|
return mapHeader->regionMapSectionId;
|
||||||
|
|||||||
@ -211,7 +211,7 @@ EWRAM_DATA struct WarpData gLastUsedWarp = {0};
|
|||||||
EWRAM_DATA static struct WarpData sWarpDestination = {0}; // new warp position
|
EWRAM_DATA static struct WarpData sWarpDestination = {0}; // new warp position
|
||||||
EWRAM_DATA static struct WarpData sFixedDiveWarp = {0};
|
EWRAM_DATA static struct WarpData sFixedDiveWarp = {0};
|
||||||
EWRAM_DATA static struct WarpData sFixedHoleWarp = {0};
|
EWRAM_DATA static struct WarpData sFixedHoleWarp = {0};
|
||||||
EWRAM_DATA static u16 sLastMapSectionId = 0;
|
EWRAM_DATA static mapsec_u16_t sLastMapSectionId = 0;
|
||||||
EWRAM_DATA static struct InitialPlayerAvatarState sInitialPlayerAvatarState = {0};
|
EWRAM_DATA static struct InitialPlayerAvatarState sInitialPlayerAvatarState = {0};
|
||||||
EWRAM_DATA static u16 sAmbientCrySpecies = 0;
|
EWRAM_DATA static u16 sAmbientCrySpecies = 0;
|
||||||
EWRAM_DATA static bool8 sIsAmbientCryWaterMon = FALSE;
|
EWRAM_DATA static bool8 sIsAmbientCryWaterMon = FALSE;
|
||||||
@ -1464,12 +1464,12 @@ bool8 IsMapTypeIndoors(enum MapType mapType)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 GetSavedWarpRegionMapSectionId(void)
|
mapsec_u8_t GetSavedWarpRegionMapSectionId(void)
|
||||||
{
|
{
|
||||||
return Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->dynamicWarp.mapGroup, gSaveBlock1Ptr->dynamicWarp.mapNum)->regionMapSectionId;
|
return Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->dynamicWarp.mapGroup, gSaveBlock1Ptr->dynamicWarp.mapNum)->regionMapSectionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 GetCurrentRegionMapSectionId(void)
|
mapsec_u8_t GetCurrentRegionMapSectionId(void)
|
||||||
{
|
{
|
||||||
return Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum)->regionMapSectionId;
|
return Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum)->regionMapSectionId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1271,7 +1271,7 @@ void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTa
|
|||||||
{
|
{
|
||||||
u8 taskId;
|
u8 taskId;
|
||||||
|
|
||||||
taskId = CreateTask((void *)Task_BlendPalettesGradually, priority);
|
taskId = CreateTask(Task_BlendPalettesGradually, priority);
|
||||||
gTasks[taskId].tCoeff = coeff;
|
gTasks[taskId].tCoeff = coeff;
|
||||||
gTasks[taskId].tCoeffTarget = coeffTarget;
|
gTasks[taskId].tCoeffTarget = coeffTarget;
|
||||||
|
|
||||||
|
|||||||
@ -62,7 +62,7 @@ enum {
|
|||||||
struct PokeblockMenuStruct
|
struct PokeblockMenuStruct
|
||||||
{
|
{
|
||||||
u8 tilemap[BG_SCREEN_SIZE];
|
u8 tilemap[BG_SCREEN_SIZE];
|
||||||
void (*callbackOnUse)(void);
|
MainCallback callbackOnUse;
|
||||||
const u8 *pokeblockActionIds;
|
const u8 *pokeblockActionIds;
|
||||||
u8 numActions;
|
u8 numActions;
|
||||||
u8 caseId;
|
u8 caseId;
|
||||||
@ -80,7 +80,7 @@ struct PokeblockMenuStruct
|
|||||||
|
|
||||||
struct PokeblockSavedData
|
struct PokeblockSavedData
|
||||||
{
|
{
|
||||||
void (*callback)(void);
|
MainCallback callback;
|
||||||
u16 selectedRow;
|
u16 selectedRow;
|
||||||
u16 scrollOffset;
|
u16 scrollOffset;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -75,7 +75,7 @@ struct OverworldArea
|
|||||||
{
|
{
|
||||||
u8 mapGroup;
|
u8 mapGroup;
|
||||||
u8 mapNum;
|
u8 mapNum;
|
||||||
u16 regionMapSectionId;
|
mapsec_u16_t regionMapSectionId;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct
|
struct
|
||||||
@ -96,7 +96,7 @@ struct
|
|||||||
/*0x61C*/ u16 areaShadeBldArgHi;
|
/*0x61C*/ u16 areaShadeBldArgHi;
|
||||||
/*0x61E*/ bool8 showingMarkers;
|
/*0x61E*/ bool8 showingMarkers;
|
||||||
/*0x61F*/ u8 markerFlashCounter;
|
/*0x61F*/ u8 markerFlashCounter;
|
||||||
/*0x620*/ u16 specialAreaRegionMapSectionIds[MAX_AREA_MARKERS];
|
/*0x620*/ mapsec_u16_t specialAreaRegionMapSectionIds[MAX_AREA_MARKERS];
|
||||||
/*0x660*/ struct Sprite *areaMarkerSprites[MAX_AREA_MARKERS];
|
/*0x660*/ struct Sprite *areaMarkerSprites[MAX_AREA_MARKERS];
|
||||||
/*0x6E0*/ u16 numAreaMarkerSprites;
|
/*0x6E0*/ u16 numAreaMarkerSprites;
|
||||||
/*0x6E2*/ u16 alteringCaveCounter;
|
/*0x6E2*/ u16 alteringCaveCounter;
|
||||||
@ -116,7 +116,7 @@ static void FindMapsWithMon(u16);
|
|||||||
static void BuildAreaGlowTilemap(void);
|
static void BuildAreaGlowTilemap(void);
|
||||||
static void SetAreaHasMon(u16, u16);
|
static void SetAreaHasMon(u16, u16);
|
||||||
static void SetSpecialMapHasMon(u16, u16);
|
static void SetSpecialMapHasMon(u16, u16);
|
||||||
static u16 GetRegionMapSectionId(u8, u8);
|
static mapsec_u16_t GetRegionMapSectionId(u8, u8);
|
||||||
static bool8 MapHasSpecies(const struct WildEncounterTypes *, u16);
|
static bool8 MapHasSpecies(const struct WildEncounterTypes *, u16);
|
||||||
static bool8 MonListHasSpecies(const struct WildPokemonInfo *, u16, u16);
|
static bool8 MonListHasSpecies(const struct WildPokemonInfo *, u16, u16);
|
||||||
static void DoAreaGlow(void);
|
static void DoAreaGlow(void);
|
||||||
@ -144,7 +144,7 @@ static void LoadHGSSScreenSelectBarSubmenu(void);
|
|||||||
|
|
||||||
static const u16 sSpeciesHiddenFromAreaScreen[] = { SPECIES_WYNAUT };
|
static const u16 sSpeciesHiddenFromAreaScreen[] = { SPECIES_WYNAUT };
|
||||||
|
|
||||||
static const u16 sMovingRegionMapSections[3] =
|
static const mapsec_u16_t sMovingRegionMapSections[3] =
|
||||||
{
|
{
|
||||||
MAPSEC_MARINE_CAVE,
|
MAPSEC_MARINE_CAVE,
|
||||||
MAPSEC_UNDERWATER_MARINE_CAVE,
|
MAPSEC_UNDERWATER_MARINE_CAVE,
|
||||||
@ -157,7 +157,7 @@ static const u16 sFeebasData[][3] =
|
|||||||
{NUM_SPECIES}
|
{NUM_SPECIES}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u16 sLandmarkData[][2] =
|
static const mapsec_u16_t sLandmarkData[][2] =
|
||||||
{
|
{
|
||||||
{MAPSEC_SKY_PILLAR, FLAG_LANDMARK_SKY_PILLAR},
|
{MAPSEC_SKY_PILLAR, FLAG_LANDMARK_SKY_PILLAR},
|
||||||
{MAPSEC_SEAFLOOR_CAVERN, FLAG_LANDMARK_SEAFLOOR_CAVERN},
|
{MAPSEC_SEAFLOOR_CAVERN, FLAG_LANDMARK_SEAFLOOR_CAVERN},
|
||||||
@ -389,7 +389,7 @@ static void SetSpecialMapHasMon(u16 mapGroup, u16 mapNum)
|
|||||||
|
|
||||||
if (sPokedexAreaScreen->numSpecialAreas < MAX_AREA_MARKERS)
|
if (sPokedexAreaScreen->numSpecialAreas < MAX_AREA_MARKERS)
|
||||||
{
|
{
|
||||||
u16 regionMapSectionId = GetRegionMapSectionId(mapGroup, mapNum);
|
mapsec_u16_t regionMapSectionId = GetRegionMapSectionId(mapGroup, mapNum);
|
||||||
if (regionMapSectionId < MAPSEC_NONE)
|
if (regionMapSectionId < MAPSEC_NONE)
|
||||||
{
|
{
|
||||||
// Don't highlight the area if it's a moving area (Marine/Terra Cave)
|
// Don't highlight the area if it's a moving area (Marine/Terra Cave)
|
||||||
@ -423,7 +423,7 @@ static void SetSpecialMapHasMon(u16 mapGroup, u16 mapNum)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 GetRegionMapSectionId(u8 mapGroup, u8 mapNum)
|
static mapsec_u16_t GetRegionMapSectionId(u8 mapGroup, u8 mapNum)
|
||||||
{
|
{
|
||||||
return Overworld_GetMapHeaderByGroupAndId(mapGroup, mapNum)->regionMapSectionId;
|
return Overworld_GetMapHeaderByGroupAndId(mapGroup, mapNum)->regionMapSectionId;
|
||||||
}
|
}
|
||||||
@ -947,7 +947,7 @@ static void CreateAreaMarkerSprites(void)
|
|||||||
s16 x;
|
s16 x;
|
||||||
s16 y;
|
s16 y;
|
||||||
s16 i;
|
s16 i;
|
||||||
s16 mapSecId;
|
mapsec_u16_t mapSecId;
|
||||||
s16 numSprites;
|
s16 numSprites;
|
||||||
|
|
||||||
LoadSpriteSheet(&sAreaMarkerSpriteSheet);
|
LoadSpriteSheet(&sAreaMarkerSpriteSheet);
|
||||||
|
|||||||
@ -2842,6 +2842,19 @@ u32 GetBoxMonData2(struct BoxPokemon *boxMon, s32 field)
|
|||||||
#define SET8(lhs) (lhs) = *data
|
#define SET8(lhs) (lhs) = *data
|
||||||
#define SET16(lhs) (lhs) = data[0] + (data[1] << 8)
|
#define SET16(lhs) (lhs) = data[0] + (data[1] << 8)
|
||||||
#define SET32(lhs) (lhs) = data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24)
|
#define SET32(lhs) (lhs) = data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24)
|
||||||
|
//
|
||||||
|
// Prefer SET_BY_WIDTH for fields whose types might be extended (e.g.
|
||||||
|
// anything whose typedef is in gametypes.h).
|
||||||
|
//
|
||||||
|
#define SET_BY_WIDTH(lhs) \
|
||||||
|
do { \
|
||||||
|
if (sizeof(lhs) == 1) \
|
||||||
|
SET8(lhs); \
|
||||||
|
else if (sizeof(lhs) == 2) \
|
||||||
|
SET16(lhs); \
|
||||||
|
else if (sizeof(lhs) == 4) \
|
||||||
|
SET32(lhs); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg)
|
void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -142,7 +142,7 @@ static EWRAM_DATA struct PokemonSummaryScreenData
|
|||||||
u8 ribbonCount; // 0x6
|
u8 ribbonCount; // 0x6
|
||||||
u8 ailment; // 0x7
|
u8 ailment; // 0x7
|
||||||
u8 abilityNum; // 0x8
|
u8 abilityNum; // 0x8
|
||||||
u8 metLocation; // 0x9
|
metloc_u8_t metLocation; // 0x9
|
||||||
u8 metLevel; // 0xA
|
u8 metLevel; // 0xA
|
||||||
u8 metGame; // 0xB
|
u8 metGame; // 0xB
|
||||||
u32 pid; // 0xC
|
u32 pid; // 0xC
|
||||||
@ -735,7 +735,7 @@ static void (*const sTextPrinterFunctions[])(void) =
|
|||||||
[PSS_PAGE_CONTEST_MOVES] = PrintContestMoves
|
[PSS_PAGE_CONTEST_MOVES] = PrintContestMoves
|
||||||
};
|
};
|
||||||
|
|
||||||
static void (*const sTextPrinterTasks[])(u8 taskId) =
|
static const TaskFunc sTextPrinterTasks[] =
|
||||||
{
|
{
|
||||||
[PSS_PAGE_INFO] = Task_PrintInfoPage,
|
[PSS_PAGE_INFO] = Task_PrintInfoPage,
|
||||||
[PSS_PAGE_SKILLS] = Task_PrintSkillsPage,
|
[PSS_PAGE_SKILLS] = Task_PrintSkillsPage,
|
||||||
|
|||||||
@ -34,13 +34,13 @@ typedef struct MatchCallTextDataStruct {
|
|||||||
|
|
||||||
struct MatchCallStructCommon {
|
struct MatchCallStructCommon {
|
||||||
u8 type;
|
u8 type;
|
||||||
u8 mapSec;
|
mapsec_u8_t mapSec;
|
||||||
u16 flag;
|
u16 flag;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MatchCallStructNPC {
|
struct MatchCallStructNPC {
|
||||||
u8 type;
|
u8 type;
|
||||||
u8 mapSec;
|
mapsec_u8_t mapSec;
|
||||||
u16 flag;
|
u16 flag;
|
||||||
const u8 *desc;
|
const u8 *desc;
|
||||||
const u8 *name;
|
const u8 *name;
|
||||||
@ -50,7 +50,7 @@ struct MatchCallStructNPC {
|
|||||||
// Shared by MC_TYPE_TRAINER and MC_TYPE_LEADER
|
// Shared by MC_TYPE_TRAINER and MC_TYPE_LEADER
|
||||||
struct MatchCallStructTrainer {
|
struct MatchCallStructTrainer {
|
||||||
u8 type;
|
u8 type;
|
||||||
u8 mapSec;
|
mapsec_u8_t mapSec;
|
||||||
u16 flag;
|
u16 flag;
|
||||||
u16 rematchTableIdx;
|
u16 rematchTableIdx;
|
||||||
const u8 *desc;
|
const u8 *desc;
|
||||||
@ -60,12 +60,12 @@ struct MatchCallStructTrainer {
|
|||||||
|
|
||||||
struct MatchCallLocationOverride {
|
struct MatchCallLocationOverride {
|
||||||
u16 flag;
|
u16 flag;
|
||||||
u8 mapSec;
|
mapsec_u8_t mapSec;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MatchCallWally {
|
struct MatchCallWally {
|
||||||
u8 type;
|
u8 type;
|
||||||
u8 mapSec;
|
mapsec_u8_t mapSec;
|
||||||
u16 flag;
|
u16 flag;
|
||||||
u16 rematchTableIdx;
|
u16 rematchTableIdx;
|
||||||
const u8 *desc;
|
const u8 *desc;
|
||||||
@ -75,7 +75,7 @@ struct MatchCallWally {
|
|||||||
|
|
||||||
struct MatchCallBirch {
|
struct MatchCallBirch {
|
||||||
u8 type;
|
u8 type;
|
||||||
u8 mapSec;
|
mapsec_u8_t mapSec;
|
||||||
u16 flag;
|
u16 flag;
|
||||||
const u8 *desc;
|
const u8 *desc;
|
||||||
const u8 *name;
|
const u8 *name;
|
||||||
@ -117,11 +117,11 @@ static bool32 MatchCall_GetEnabled_Wally(match_call_t);
|
|||||||
static bool32 MatchCall_GetEnabled_Birch(match_call_t);
|
static bool32 MatchCall_GetEnabled_Birch(match_call_t);
|
||||||
static bool32 MatchCall_GetEnabled_Rival(match_call_t);
|
static bool32 MatchCall_GetEnabled_Rival(match_call_t);
|
||||||
|
|
||||||
static u8 MatchCall_GetMapSec_NPC(match_call_t);
|
static mapsec_u8_t MatchCall_GetMapSec_NPC(match_call_t);
|
||||||
static u8 MatchCall_GetMapSec_Trainer(match_call_t);
|
static mapsec_u8_t MatchCall_GetMapSec_Trainer(match_call_t);
|
||||||
static u8 MatchCall_GetMapSec_Wally(match_call_t);
|
static mapsec_u8_t MatchCall_GetMapSec_Wally(match_call_t);
|
||||||
static u8 MatchCall_GetMapSec_Birch(match_call_t);
|
static mapsec_u8_t MatchCall_GetMapSec_Birch(match_call_t);
|
||||||
static u8 MatchCall_GetMapSec_Rival(match_call_t);
|
static mapsec_u8_t MatchCall_GetMapSec_Rival(match_call_t);
|
||||||
|
|
||||||
static bool32 MatchCall_IsRematchable_NPC(match_call_t);
|
static bool32 MatchCall_IsRematchable_NPC(match_call_t);
|
||||||
static bool32 MatchCall_IsRematchable_Trainer(match_call_t);
|
static bool32 MatchCall_IsRematchable_Trainer(match_call_t);
|
||||||
@ -613,7 +613,7 @@ static bool32 (*const sMatchCallGetEnabledFuncs[])(match_call_t) = {
|
|||||||
MatchCall_GetEnabled_Birch
|
MatchCall_GetEnabled_Birch
|
||||||
};
|
};
|
||||||
|
|
||||||
static u8 (*const sMatchCallGetMapSecFuncs[])(match_call_t) = {
|
static mapsec_u8_t (*const sMatchCallGetMapSecFuncs[])(match_call_t) = {
|
||||||
MatchCall_GetMapSec_NPC,
|
MatchCall_GetMapSec_NPC,
|
||||||
MatchCall_GetMapSec_Trainer,
|
MatchCall_GetMapSec_Trainer,
|
||||||
MatchCall_GetMapSec_Wally,
|
MatchCall_GetMapSec_Wally,
|
||||||
@ -796,7 +796,7 @@ static bool32 MatchCall_GetEnabled_Birch(match_call_t matchCall)
|
|||||||
return FlagGet(matchCall.birch->flag);
|
return FlagGet(matchCall.birch->flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 MatchCall_GetMapSec(u32 idx)
|
mapsec_u8_t MatchCall_GetMapSec(u32 idx)
|
||||||
{
|
{
|
||||||
match_call_t matchCall;
|
match_call_t matchCall;
|
||||||
u32 i;
|
u32 i;
|
||||||
@ -808,17 +808,17 @@ u8 MatchCall_GetMapSec(u32 idx)
|
|||||||
return sMatchCallGetMapSecFuncs[i](matchCall);
|
return sMatchCallGetMapSecFuncs[i](matchCall);
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 MatchCall_GetMapSec_NPC(match_call_t matchCall)
|
static mapsec_u8_t MatchCall_GetMapSec_NPC(match_call_t matchCall)
|
||||||
{
|
{
|
||||||
return matchCall.npc->mapSec;
|
return matchCall.npc->mapSec;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 MatchCall_GetMapSec_Trainer(match_call_t matchCall)
|
static mapsec_u8_t MatchCall_GetMapSec_Trainer(match_call_t matchCall)
|
||||||
{
|
{
|
||||||
return matchCall.trainer->mapSec;
|
return matchCall.trainer->mapSec;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 MatchCall_GetMapSec_Wally(match_call_t matchCall)
|
static mapsec_u8_t MatchCall_GetMapSec_Wally(match_call_t matchCall)
|
||||||
{
|
{
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
@ -830,12 +830,12 @@ static u8 MatchCall_GetMapSec_Wally(match_call_t matchCall)
|
|||||||
return matchCall.wally->locationData[i].mapSec;
|
return matchCall.wally->locationData[i].mapSec;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 MatchCall_GetMapSec_Rival(match_call_t matchCall)
|
static mapsec_u8_t MatchCall_GetMapSec_Rival(match_call_t matchCall)
|
||||||
{
|
{
|
||||||
return MAPSEC_NONE;
|
return MAPSEC_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 MatchCall_GetMapSec_Birch(match_call_t matchCall)
|
static mapsec_u8_t MatchCall_GetMapSec_Birch(match_call_t matchCall)
|
||||||
{
|
{
|
||||||
return MAPSEC_NONE;
|
return MAPSEC_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1027,7 +1027,7 @@ static void PrintMatchCallLocation(struct Pokenav_MatchCallGfx *gfx, int delta)
|
|||||||
u8 mapName[32];
|
u8 mapName[32];
|
||||||
int x;
|
int x;
|
||||||
int index = PokenavList_GetSelectedIndex() + delta;
|
int index = PokenavList_GetSelectedIndex() + delta;
|
||||||
int mapSec = GetMatchCallMapSec(index);
|
mapsec_s32_t mapSec = GetMatchCallMapSec(index);
|
||||||
if (mapSec != MAPSEC_NONE)
|
if (mapSec != MAPSEC_NONE)
|
||||||
GetMapName(mapName, mapSec, 0);
|
GetMapName(mapName, mapSec, 0);
|
||||||
else
|
else
|
||||||
|
|||||||
@ -308,7 +308,7 @@ struct PokenavMatchCallEntry *GetMatchCallList(void)
|
|||||||
return state->matchCallEntries;
|
return state->matchCallEntries;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 GetMatchCallMapSec(int index)
|
mapsec_u16_t GetMatchCallMapSec(int index)
|
||||||
{
|
{
|
||||||
struct Pokenav_MatchCallMenu *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
|
struct Pokenav_MatchCallMenu *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
|
||||||
return state->matchCallEntries[index].mapSec;
|
return state->matchCallEntries[index].mapSec;
|
||||||
@ -430,7 +430,7 @@ void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntry *matchCallEntry, u8
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 GetMatchTableMapSectionId(int rematchIndex)
|
mapsec_u8_t GetMatchTableMapSectionId(int rematchIndex)
|
||||||
{
|
{
|
||||||
int mapGroup = gRematchTable[rematchIndex].mapGroup;
|
int mapGroup = gRematchTable[rematchIndex].mapGroup;
|
||||||
int mapNum = gRematchTable[rematchIndex].mapNum;
|
int mapNum = gRematchTable[rematchIndex].mapNum;
|
||||||
|
|||||||
@ -44,7 +44,7 @@ struct Pokenav_RegionMapGfx
|
|||||||
|
|
||||||
struct CityMapEntry
|
struct CityMapEntry
|
||||||
{
|
{
|
||||||
u16 mapSecId;
|
mapsec_u16_t mapSecId;
|
||||||
u16 index;
|
u16 index;
|
||||||
const u32 *tilemap;
|
const u32 *tilemap;
|
||||||
};
|
};
|
||||||
@ -66,8 +66,8 @@ static bool32 IsDma3ManagerBusyWithBgCopy_(struct Pokenav_RegionMapGfx *);
|
|||||||
static void ChangeBgYForZoom(bool32);
|
static void ChangeBgYForZoom(bool32);
|
||||||
static bool32 IsChangeBgYForZoomActive(void);
|
static bool32 IsChangeBgYForZoomActive(void);
|
||||||
static void CreateCityZoomTextSprites(void);
|
static void CreateCityZoomTextSprites(void);
|
||||||
static void DrawCityMap(struct Pokenav_RegionMapGfx *, int, int);
|
static void DrawCityMap(struct Pokenav_RegionMapGfx *, mapsec_s32_t, int);
|
||||||
static void PrintLandmarkNames(struct Pokenav_RegionMapGfx *, int, int);
|
static void PrintLandmarkNames(struct Pokenav_RegionMapGfx *, mapsec_s32_t, int);
|
||||||
static void SetCityZoomTextInvisibility(bool32);
|
static void SetCityZoomTextInvisibility(bool32);
|
||||||
static void Task_ChangeBgYForZoom(u8 taskId);
|
static void Task_ChangeBgYForZoom(u8 taskId);
|
||||||
static void UpdateCityZoomTextPosition(void);
|
static void UpdateCityZoomTextPosition(void);
|
||||||
@ -664,7 +664,7 @@ static u32 LoopedTask_DecompressCityMaps(s32 taskState)
|
|||||||
return LT_FINISH;
|
return LT_FINISH;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DrawCityMap(struct Pokenav_RegionMapGfx *state, int mapSecId, int pos)
|
static void DrawCityMap(struct Pokenav_RegionMapGfx *state, mapsec_s32_t mapSecId, int pos)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < NUM_CITY_MAPS && (sPokenavCityMaps[i].mapSecId != mapSecId || sPokenavCityMaps[i].index != pos); i++)
|
for (i = 0; i < NUM_CITY_MAPS && (sPokenavCityMaps[i].mapSecId != mapSecId || sPokenavCityMaps[i].index != pos); i++)
|
||||||
@ -677,7 +677,7 @@ static void DrawCityMap(struct Pokenav_RegionMapGfx *state, int mapSecId, int po
|
|||||||
CopyToBgTilemapBufferRect(1, state->cityZoomPics[i], 18, 6, 10, 10);
|
CopyToBgTilemapBufferRect(1, state->cityZoomPics[i], 18, 6, 10, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PrintLandmarkNames(struct Pokenav_RegionMapGfx *state, int mapSecId, int pos)
|
static void PrintLandmarkNames(struct Pokenav_RegionMapGfx *state, mapsec_s32_t mapSecId, int pos)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (1)
|
while (1)
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
#include "task.h"
|
#include "task.h"
|
||||||
#include "graphics.h"
|
#include "graphics.h"
|
||||||
#include "bg.h"
|
#include "bg.h"
|
||||||
#include "main.h"
|
|
||||||
#include "malloc.h"
|
#include "malloc.h"
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
#include "scanline_effect.h"
|
#include "scanline_effect.h"
|
||||||
@ -1287,7 +1286,7 @@ static const struct BgTemplate sBgTemplates_ChasesAway[] =
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void DoRayquazaScene(u8 animId, bool8 endEarly, void (*exitCallback)(void))
|
void DoRayquazaScene(u8 animId, bool8 endEarly, MainCallback exitCallback)
|
||||||
{
|
{
|
||||||
sRayScene = AllocZeroed(sizeof(*sRayScene));
|
sRayScene = AllocZeroed(sizeof(*sRayScene));
|
||||||
sRayScene->animId = animId;
|
sRayScene->animId = animId;
|
||||||
|
|||||||
@ -63,7 +63,7 @@ enum {
|
|||||||
struct MultiNameFlyDest
|
struct MultiNameFlyDest
|
||||||
{
|
{
|
||||||
const u8 *const *name;
|
const u8 *const *name;
|
||||||
u16 mapSecId;
|
mapsec_u16_t mapSecId;
|
||||||
u16 flag;
|
u16 flag;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ static EWRAM_DATA struct RegionMap *sRegionMap = NULL;
|
|||||||
static EWRAM_DATA struct {
|
static EWRAM_DATA struct {
|
||||||
void (*callback)(void);
|
void (*callback)(void);
|
||||||
u16 state;
|
u16 state;
|
||||||
u16 mapSecId;
|
mapsec_u16_t mapSecId;
|
||||||
struct RegionMap regionMap;
|
struct RegionMap regionMap;
|
||||||
u8 tileBuffer[0x1c0];
|
u8 tileBuffer[0x1c0];
|
||||||
u8 nameBuffer[0x26]; // never read
|
u8 nameBuffer[0x26]; // never read
|
||||||
@ -86,15 +86,15 @@ static u8 MoveRegionMapCursor_Full(void);
|
|||||||
static u8 ProcessRegionMapInput_Zoomed(void);
|
static u8 ProcessRegionMapInput_Zoomed(void);
|
||||||
static u8 MoveRegionMapCursor_Zoomed(void);
|
static u8 MoveRegionMapCursor_Zoomed(void);
|
||||||
static void CalcZoomScrollParams(s16 scrollX, s16 scrollY, s16 c, s16 d, u16 e, u16 f, u8 rotation);
|
static void CalcZoomScrollParams(s16 scrollX, s16 scrollY, s16 c, s16 d, u16 e, u16 f, u8 rotation);
|
||||||
static u16 GetMapSecIdAt(u16 x, u16 y);
|
static mapsec_u16_t GetMapSecIdAt(u16 x, u16 y);
|
||||||
static void RegionMap_SetBG2XAndBG2Y(s16 x, s16 y);
|
static void RegionMap_SetBG2XAndBG2Y(s16 x, s16 y);
|
||||||
static void InitMapBasedOnPlayerLocation(void);
|
static void InitMapBasedOnPlayerLocation(void);
|
||||||
static void RegionMap_InitializeStateBasedOnSSTidalLocation(void);
|
static void RegionMap_InitializeStateBasedOnSSTidalLocation(void);
|
||||||
static u8 GetMapsecType(u16 mapSecId);
|
static u8 GetMapsecType(mapsec_u16_t mapSecId);
|
||||||
static u16 CorrectSpecialMapSecId_Internal(u16 mapSecId);
|
static mapsec_u16_t CorrectSpecialMapSecId_Internal(mapsec_u16_t mapSecId);
|
||||||
static u16 GetTerraOrMarineCaveMapSecId(void);
|
static mapsec_u16_t GetTerraOrMarineCaveMapSecId(void);
|
||||||
static void GetMarineCaveCoords(u16 *x, u16 *y);
|
static void GetMarineCaveCoords(u16 *x, u16 *y);
|
||||||
static bool32 IsPlayerInAquaHideout(u8 mapSecId);
|
static bool32 IsPlayerInAquaHideout(mapsec_u8_t mapSecId);
|
||||||
static void GetPositionOfCursorWithinMapSec(void);
|
static void GetPositionOfCursorWithinMapSec(void);
|
||||||
static bool8 RegionMap_IsMapSecIdInNextRow(u16 y);
|
static bool8 RegionMap_IsMapSecIdInNextRow(u16 y);
|
||||||
static void SpriteCB_CursorMapFull(struct Sprite *sprite);
|
static void SpriteCB_CursorMapFull(struct Sprite *sprite);
|
||||||
@ -130,7 +130,7 @@ static const u8 sRegionMapPlayerIcon_MayGfx[] = INCBIN_U8("graphics/pokenav/regi
|
|||||||
#include "data/region_map/region_map_layout.h"
|
#include "data/region_map/region_map_layout.h"
|
||||||
#include "data/region_map/region_map_entries.h"
|
#include "data/region_map/region_map_entries.h"
|
||||||
|
|
||||||
static const u16 sRegionMap_SpecialPlaceLocations[][2] =
|
static const mapsec_u16_t sRegionMap_SpecialPlaceLocations[][2] =
|
||||||
{
|
{
|
||||||
{MAPSEC_UNDERWATER_105, MAPSEC_ROUTE_105},
|
{MAPSEC_UNDERWATER_105, MAPSEC_ROUTE_105},
|
||||||
{MAPSEC_UNDERWATER_124, MAPSEC_ROUTE_124},
|
{MAPSEC_UNDERWATER_124, MAPSEC_ROUTE_124},
|
||||||
@ -162,14 +162,14 @@ static const u16 sRegionMap_SpecialPlaceLocations[][2] =
|
|||||||
{MAPSEC_NONE, MAPSEC_NONE}
|
{MAPSEC_NONE, MAPSEC_NONE}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u16 sMarineCaveMapSecIds[] =
|
static const mapsec_u16_t sMarineCaveMapSecIds[] =
|
||||||
{
|
{
|
||||||
MAPSEC_MARINE_CAVE,
|
MAPSEC_MARINE_CAVE,
|
||||||
MAPSEC_UNDERWATER_MARINE_CAVE,
|
MAPSEC_UNDERWATER_MARINE_CAVE,
|
||||||
MAPSEC_UNDERWATER_MARINE_CAVE
|
MAPSEC_UNDERWATER_MARINE_CAVE
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u16 sTerraOrMarineCaveMapSecIds[ABNORMAL_WEATHER_LOCATIONS] =
|
static const mapsec_u16_t sTerraOrMarineCaveMapSecIds[ABNORMAL_WEATHER_LOCATIONS] =
|
||||||
{
|
{
|
||||||
[ABNORMAL_WEATHER_ROUTE_114_NORTH - 1] = MAPSEC_ROUTE_114,
|
[ABNORMAL_WEATHER_ROUTE_114_NORTH - 1] = MAPSEC_ROUTE_114,
|
||||||
[ABNORMAL_WEATHER_ROUTE_114_SOUTH - 1] = MAPSEC_ROUTE_114,
|
[ABNORMAL_WEATHER_ROUTE_114_SOUTH - 1] = MAPSEC_ROUTE_114,
|
||||||
@ -203,7 +203,7 @@ static const struct UCoords16 sMarineCaveLocationCoords[MARINE_CAVE_LOCATIONS] =
|
|||||||
[MARINE_CAVE_COORD(ROUTE_129_EAST)] = {24, 10}
|
[MARINE_CAVE_COORD(ROUTE_129_EAST)] = {24, 10}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u8 sMapSecAquaHideoutOld[] =
|
static const mapsec_u8_t sMapSecAquaHideoutOld[] =
|
||||||
{
|
{
|
||||||
MAPSEC_AQUA_HIDEOUT_OLD
|
MAPSEC_AQUA_HIDEOUT_OLD
|
||||||
};
|
};
|
||||||
@ -273,7 +273,7 @@ static const union AnimCmd *const sRegionMapPlayerIconAnimTable[] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Event islands that don't appear on map. (Southern Island does)
|
// Event islands that don't appear on map. (Southern Island does)
|
||||||
static const u8 sMapSecIdsOffMap[] =
|
static const mapsec_u8_t sMapSecIdsOffMap[] =
|
||||||
{
|
{
|
||||||
MAPSEC_BIRTH_ISLAND,
|
MAPSEC_BIRTH_ISLAND,
|
||||||
MAPSEC_FARAWAY_ISLAND,
|
MAPSEC_FARAWAY_ISLAND,
|
||||||
@ -421,7 +421,7 @@ static const struct SpritePalette sFlyTargetIconsSpritePalette =
|
|||||||
.tag = TAG_FLY_ICON
|
.tag = TAG_FLY_ICON
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u16 sRedOutlineFlyDestinations[][2] =
|
static const mapsec_u16_t sRedOutlineFlyDestinations[][2] =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
FLAG_LANDMARK_BATTLE_FRONTIER,
|
FLAG_LANDMARK_BATTLE_FRONTIER,
|
||||||
@ -694,7 +694,7 @@ static u8 ProcessRegionMapInput_Full(void)
|
|||||||
|
|
||||||
static u8 MoveRegionMapCursor_Full(void)
|
static u8 MoveRegionMapCursor_Full(void)
|
||||||
{
|
{
|
||||||
u16 mapSecId;
|
mapsec_u16_t mapSecId;
|
||||||
|
|
||||||
if (sRegionMap->cursorMovementFrameCounter != 0)
|
if (sRegionMap->cursorMovementFrameCounter != 0)
|
||||||
return MAP_INPUT_MOVE_CONT;
|
return MAP_INPUT_MOVE_CONT;
|
||||||
@ -779,7 +779,7 @@ static u8 MoveRegionMapCursor_Zoomed(void)
|
|||||||
{
|
{
|
||||||
u16 x;
|
u16 x;
|
||||||
u16 y;
|
u16 y;
|
||||||
u16 mapSecId;
|
mapsec_u16_t mapSecId;
|
||||||
|
|
||||||
sRegionMap->scrollY += sRegionMap->zoomedCursorDeltaY;
|
sRegionMap->scrollY += sRegionMap->zoomedCursorDeltaY;
|
||||||
sRegionMap->scrollX += sRegionMap->zoomedCursorDeltaX;
|
sRegionMap->scrollX += sRegionMap->zoomedCursorDeltaX;
|
||||||
@ -962,7 +962,7 @@ void PokedexAreaScreen_UpdateRegionMapVariablesAndVideoRegs(s16 x, s16 y)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 GetMapSecIdAt(u16 x, u16 y)
|
static mapsec_u16_t GetMapSecIdAt(u16 x, u16 y)
|
||||||
{
|
{
|
||||||
if (y < MAPCURSOR_Y_MIN || y > MAPCURSOR_Y_MAX || x < MAPCURSOR_X_MIN || x > MAPCURSOR_X_MAX)
|
if (y < MAPCURSOR_Y_MIN || y > MAPCURSOR_Y_MAX || x < MAPCURSOR_X_MIN || x > MAPCURSOR_X_MAX)
|
||||||
{
|
{
|
||||||
@ -1180,7 +1180,7 @@ static void RegionMap_InitializeStateBasedOnSSTidalLocation(void)
|
|||||||
sRegionMap->cursorPosY = gRegionMapEntries[sRegionMap->mapSecId].y + y + MAPCURSOR_Y_MIN;
|
sRegionMap->cursorPosY = gRegionMapEntries[sRegionMap->mapSecId].y + y + MAPCURSOR_Y_MIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 GetMapsecType(u16 mapSecId)
|
static u8 GetMapsecType(mapsec_u16_t mapSecId)
|
||||||
{
|
{
|
||||||
switch (mapSecId)
|
switch (mapSecId)
|
||||||
{
|
{
|
||||||
@ -1227,12 +1227,12 @@ static u8 GetMapsecType(u16 mapSecId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 GetRegionMapSecIdAt(u16 x, u16 y)
|
mapsec_u16_t GetRegionMapSecIdAt(u16 x, u16 y)
|
||||||
{
|
{
|
||||||
return GetMapSecIdAt(x, y);
|
return GetMapSecIdAt(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 CorrectSpecialMapSecId_Internal(u16 mapSecId)
|
static mapsec_u16_t CorrectSpecialMapSecId_Internal(mapsec_u16_t mapSecId)
|
||||||
{
|
{
|
||||||
u32 i;
|
u32 i;
|
||||||
|
|
||||||
@ -1253,7 +1253,7 @@ static u16 CorrectSpecialMapSecId_Internal(u16 mapSecId)
|
|||||||
return mapSecId;
|
return mapSecId;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 GetTerraOrMarineCaveMapSecId(void)
|
static mapsec_u16_t GetTerraOrMarineCaveMapSecId(void)
|
||||||
{
|
{
|
||||||
s16 idx;
|
s16 idx;
|
||||||
|
|
||||||
@ -1282,7 +1282,7 @@ static void GetMarineCaveCoords(u16 *x, u16 *y)
|
|||||||
|
|
||||||
// Probably meant to be an "IsPlayerInIndoorDungeon" function, but in practice it only has the one mapsec
|
// Probably meant to be an "IsPlayerInIndoorDungeon" function, but in practice it only has the one mapsec
|
||||||
// Additionally, because the mapsec doesnt exist in Emerald, this function always returns FALSE
|
// Additionally, because the mapsec doesnt exist in Emerald, this function always returns FALSE
|
||||||
static bool32 IsPlayerInAquaHideout(u8 mapSecId)
|
static bool32 IsPlayerInAquaHideout(mapsec_u8_t mapSecId)
|
||||||
{
|
{
|
||||||
u32 i;
|
u32 i;
|
||||||
|
|
||||||
@ -1294,7 +1294,7 @@ static bool32 IsPlayerInAquaHideout(u8 mapSecId)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 CorrectSpecialMapSecId(u16 mapSecId)
|
mapsec_u16_t CorrectSpecialMapSecId(mapsec_u16_t mapSecId)
|
||||||
{
|
{
|
||||||
return CorrectSpecialMapSecId_Internal(mapSecId);
|
return CorrectSpecialMapSecId_Internal(mapSecId);
|
||||||
}
|
}
|
||||||
@ -1573,7 +1573,7 @@ void TrySetPlayerIconBlink(void)
|
|||||||
#undef sVisible
|
#undef sVisible
|
||||||
#undef sTimer
|
#undef sTimer
|
||||||
|
|
||||||
u8 *GetMapName(u8 *dest, u16 regionMapId, u16 padLength)
|
u8 *GetMapName(u8 *dest, mapsec_u16_t regionMapId, u16 padLength)
|
||||||
{
|
{
|
||||||
u8 *str;
|
u8 *str;
|
||||||
u16 i;
|
u16 i;
|
||||||
@ -1606,7 +1606,7 @@ u8 *GetMapName(u8 *dest, u16 regionMapId, u16 padLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: probably needs a better name
|
// TODO: probably needs a better name
|
||||||
u8 *GetMapNameGeneric(u8 *dest, u16 mapSecId)
|
u8 *GetMapNameGeneric(u8 *dest, mapsec_u16_t mapSecId)
|
||||||
{
|
{
|
||||||
switch (mapSecId)
|
switch (mapSecId)
|
||||||
{
|
{
|
||||||
@ -1619,7 +1619,7 @@ u8 *GetMapNameGeneric(u8 *dest, u16 mapSecId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 *GetMapNameHandleAquaHideout(u8 *dest, u16 mapSecId)
|
u8 *GetMapNameHandleAquaHideout(u8 *dest, mapsec_u16_t mapSecId)
|
||||||
{
|
{
|
||||||
if (mapSecId == MAPSEC_AQUA_HIDEOUT_OLD)
|
if (mapSecId == MAPSEC_AQUA_HIDEOUT_OLD)
|
||||||
return StringCopy(dest, gText_Hideout);
|
return StringCopy(dest, gText_Hideout);
|
||||||
@ -1627,7 +1627,7 @@ u8 *GetMapNameHandleAquaHideout(u8 *dest, u16 mapSecId)
|
|||||||
return GetMapNameGeneric(dest, mapSecId);
|
return GetMapNameGeneric(dest, mapSecId);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void GetMapSecDimensions(u16 mapSecId, u16 *x, u16 *y, u16 *width, u16 *height)
|
static void GetMapSecDimensions(mapsec_u16_t mapSecId, u16 *x, u16 *y, u16 *width, u16 *height)
|
||||||
{
|
{
|
||||||
*x = gRegionMapEntries[mapSecId].x;
|
*x = gRegionMapEntries[mapSecId].x;
|
||||||
*y = gRegionMapEntries[mapSecId].y;
|
*y = gRegionMapEntries[mapSecId].y;
|
||||||
@ -1640,7 +1640,7 @@ bool8 IsRegionMapZoomed(void)
|
|||||||
return sRegionMap->zoomed;
|
return sRegionMap->zoomed;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 IsEventIslandMapSecId(u8 mapSecId)
|
bool32 IsEventIslandMapSecId(mapsec_u8_t mapSecId)
|
||||||
{
|
{
|
||||||
u32 i;
|
u32 i;
|
||||||
|
|
||||||
@ -1847,7 +1847,7 @@ static void LoadFlyDestIcons(void)
|
|||||||
static void CreateFlyDestIcons(void)
|
static void CreateFlyDestIcons(void)
|
||||||
{
|
{
|
||||||
u16 canFlyFlag;
|
u16 canFlyFlag;
|
||||||
u16 mapSecId;
|
mapsec_u16_t mapSecId;
|
||||||
u16 x;
|
u16 x;
|
||||||
u16 y;
|
u16 y;
|
||||||
u16 width;
|
u16 width;
|
||||||
@ -1895,7 +1895,7 @@ static void TryCreateRedOutlineFlyDestIcons(void)
|
|||||||
u16 y;
|
u16 y;
|
||||||
u16 width;
|
u16 width;
|
||||||
u16 height;
|
u16 height;
|
||||||
u16 mapSecId;
|
mapsec_u16_t mapSecId;
|
||||||
u8 spriteId;
|
u8 spriteId;
|
||||||
|
|
||||||
for (i = 0; sRedOutlineFlyDestinations[i][1] != MAPSEC_NONE; i++)
|
for (i = 0; sRedOutlineFlyDestinations[i][1] != MAPSEC_NONE; i++)
|
||||||
|
|||||||
@ -9,7 +9,6 @@
|
|||||||
#include "overworld.h"
|
#include "overworld.h"
|
||||||
#include "hall_of_fame.h"
|
#include "hall_of_fame.h"
|
||||||
#include "pokemon_storage_system.h"
|
#include "pokemon_storage_system.h"
|
||||||
#include "main.h"
|
|
||||||
#include "trainer_hill.h"
|
#include "trainer_hill.h"
|
||||||
#include "link.h"
|
#include "link.h"
|
||||||
#include "constants/game_stat.h"
|
#include "constants/game_stat.h"
|
||||||
@ -92,7 +91,7 @@ COMMON_DATA struct SaveSector *gReadWriteSector = NULL; // Pointer to a buffer f
|
|||||||
COMMON_DATA u16 gIncrementalSectorId = 0;
|
COMMON_DATA u16 gIncrementalSectorId = 0;
|
||||||
COMMON_DATA u16 gSaveUnusedVar = 0;
|
COMMON_DATA u16 gSaveUnusedVar = 0;
|
||||||
COMMON_DATA u16 gSaveFileStatus = 0;
|
COMMON_DATA u16 gSaveFileStatus = 0;
|
||||||
COMMON_DATA void (*gGameContinueCallback)(void) = NULL;
|
COMMON_DATA MainCallback gGameContinueCallback = NULL;
|
||||||
COMMON_DATA struct SaveSectorLocation gRamSaveSectorLocations[NUM_SECTORS_PER_SLOT] = {0};
|
COMMON_DATA struct SaveSectorLocation gRamSaveSectorLocations[NUM_SECTORS_PER_SLOT] = {0};
|
||||||
COMMON_DATA u16 gSaveUnusedVar2 = 0;
|
COMMON_DATA u16 gSaveUnusedVar2 = 0;
|
||||||
COMMON_DATA u16 gSaveAttemptStatus = 0;
|
COMMON_DATA u16 gSaveAttemptStatus = 0;
|
||||||
@ -897,7 +896,7 @@ u8 LoadGameSave(u8 saveType)
|
|||||||
status = TryLoadSaveSlot(FULL_SAVE_SLOT, gRamSaveSectorLocations);
|
status = TryLoadSaveSlot(FULL_SAVE_SLOT, gRamSaveSectorLocations);
|
||||||
CopyPartyAndObjectsFromSave();
|
CopyPartyAndObjectsFromSave();
|
||||||
gSaveFileStatus = status;
|
gSaveFileStatus = status;
|
||||||
gGameContinueCallback = 0;
|
gGameContinueCallback = NULL;
|
||||||
break;
|
break;
|
||||||
case SAVE_HALL_OF_FAME:
|
case SAVE_HALL_OF_FAME:
|
||||||
if (gHoFSaveBuffer != NULL)
|
if (gHoFSaveBuffer != NULL)
|
||||||
|
|||||||
@ -336,7 +336,7 @@ static void CB2_ReturnToTitleScreen(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetMainCallback2((MainCallback)gGameContinueCallback);
|
SetMainCallback2(gGameContinueCallback);
|
||||||
gGameContinueCallback = NULL;
|
gGameContinueCallback = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -458,7 +458,7 @@ static void Task_GoToBuyOrSellMenu(u8 taskId)
|
|||||||
if (!gPaletteFade.active)
|
if (!gPaletteFade.active)
|
||||||
{
|
{
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
SetMainCallback2((void *)((u16)tCallbackHi << 16 | (u16)tCallbackLo));
|
SetMainCallback2((MainCallback)((u16)tCallbackHi << 16 | (u16)tCallbackLo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -314,6 +314,11 @@ enum {
|
|||||||
DIG_DISPLAY_BONUS_BIG
|
DIG_DISPLAY_BONUS_BIG
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// IDs for the text windows
|
||||||
|
enum {
|
||||||
|
WIN_MSG,
|
||||||
|
WIN_INFO,
|
||||||
|
};
|
||||||
|
|
||||||
// How ReelTime works
|
// How ReelTime works
|
||||||
// ==================
|
// ==================
|
||||||
@ -1249,7 +1254,7 @@ static void SlotMachineSetup_LoadGfxAndTilemaps(void)
|
|||||||
LoadSlotMachineGfx();
|
LoadSlotMachineGfx();
|
||||||
LoadMessageBoxGfx(0, 0x200, BG_PLTT_ID(15));
|
LoadMessageBoxGfx(0, 0x200, BG_PLTT_ID(15));
|
||||||
LoadUserWindowBorderGfx(0, 0x214, BG_PLTT_ID(14));
|
LoadUserWindowBorderGfx(0, 0x214, BG_PLTT_ID(14));
|
||||||
PutWindowTilemap(0);
|
PutWindowTilemap(WIN_MSG);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CreateSlotMachineSprites(void)
|
static void CreateSlotMachineSprites(void)
|
||||||
@ -1390,9 +1395,9 @@ static bool8 SlotTask_HandleBetInput(struct Task *task)
|
|||||||
// SLOTTASK_MSG_NEED_3_COINS
|
// SLOTTASK_MSG_NEED_3_COINS
|
||||||
static bool8 SlotTask_PrintMsg_Need3Coins(struct Task *task)
|
static bool8 SlotTask_PrintMsg_Need3Coins(struct Task *task)
|
||||||
{
|
{
|
||||||
DrawDialogueFrame(0, FALSE);
|
DrawDialogueFrame(WIN_MSG, FALSE);
|
||||||
AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouDontHaveThreeCoins, 0, 1, 0, 0);
|
AddTextPrinterParameterized(WIN_MSG, FONT_NORMAL, gText_YouDontHaveThreeCoins, 0, 1, 0, 0);
|
||||||
CopyWindowToVram(0, COPYWIN_FULL);
|
CopyWindowToVram(WIN_MSG, COPYWIN_FULL);
|
||||||
sSlotMachine->state = SLOTTASK_WAIT_MSG_NEED_3_COINS;
|
sSlotMachine->state = SLOTTASK_WAIT_MSG_NEED_3_COINS;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1402,7 +1407,7 @@ static bool8 SlotTask_WaitMsg_Need3Coins(struct Task *task)
|
|||||||
{
|
{
|
||||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||||
{
|
{
|
||||||
ClearDialogWindowAndFrame(0, TRUE);
|
ClearDialogWindowAndFrame(WIN_MSG, TRUE);
|
||||||
sSlotMachine->state = SLOTTASK_BET_INPUT;
|
sSlotMachine->state = SLOTTASK_BET_INPUT;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1655,9 +1660,9 @@ static bool8 SlotTask_NoMatches(struct Task *task)
|
|||||||
// SLOTTASK_ASK_QUIT
|
// SLOTTASK_ASK_QUIT
|
||||||
static bool8 SlotTask_AskQuit(struct Task *task)
|
static bool8 SlotTask_AskQuit(struct Task *task)
|
||||||
{
|
{
|
||||||
DrawDialogueFrame(0, FALSE);
|
DrawDialogueFrame(WIN_MSG, FALSE);
|
||||||
AddTextPrinterParameterized(0, FONT_NORMAL, gText_QuitTheGame, 0, 1, 0, 0);
|
AddTextPrinterParameterized(WIN_MSG, FONT_NORMAL, gText_QuitTheGame, 0, 1, 0, 0);
|
||||||
CopyWindowToVram(0, COPYWIN_FULL);
|
CopyWindowToVram(WIN_MSG, COPYWIN_FULL);
|
||||||
CreateYesNoMenuParameterized(0x15, 7, 0x214, 0x180, 0xE, 0xF);
|
CreateYesNoMenuParameterized(0x15, 7, 0x214, 0x180, 0xE, 0xF);
|
||||||
sSlotMachine->state = SLOTTASK_HANDLE_QUIT_INPUT;
|
sSlotMachine->state = SLOTTASK_HANDLE_QUIT_INPUT;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1669,16 +1674,16 @@ static bool8 SlotTask_HandleQuitInput(struct Task *task)
|
|||||||
s8 input = Menu_ProcessInputNoWrapClearOnChoose();
|
s8 input = Menu_ProcessInputNoWrapClearOnChoose();
|
||||||
if (input == 0) // Chose to quit
|
if (input == 0) // Chose to quit
|
||||||
{
|
{
|
||||||
ClearDialogWindowAndFrame(0, TRUE);
|
ClearDialogWindowAndFrame(WIN_MSG, TRUE);
|
||||||
DarkenBetTiles(0);
|
DarkenBetTiles(0);
|
||||||
DarkenBetTiles(1);
|
DarkenBetTiles(1);
|
||||||
DarkenBetTiles(2);
|
DarkenBetTiles(2);
|
||||||
sSlotMachine->coins += sSlotMachine->bet;
|
sSlotMachine->coins += sSlotMachine->bet;
|
||||||
sSlotMachine->state = SLOTTASK_END;
|
sSlotMachine->state = SLOTTASK_END;
|
||||||
}
|
}
|
||||||
else if (input == 1 || input == -1) // Chose not to quit
|
else if (input == 1 || input == MENU_B_PRESSED) // Chose not to quit
|
||||||
{
|
{
|
||||||
ClearDialogWindowAndFrame(0, TRUE);
|
ClearDialogWindowAndFrame(WIN_MSG, TRUE);
|
||||||
sSlotMachine->state = SLOTTASK_BET_INPUT;
|
sSlotMachine->state = SLOTTASK_BET_INPUT;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1687,9 +1692,9 @@ static bool8 SlotTask_HandleQuitInput(struct Task *task)
|
|||||||
// SLOTTASK_MSG_MAX_COINS
|
// SLOTTASK_MSG_MAX_COINS
|
||||||
static bool8 SlotTask_PrintMsg_MaxCoins(struct Task *task)
|
static bool8 SlotTask_PrintMsg_MaxCoins(struct Task *task)
|
||||||
{
|
{
|
||||||
DrawDialogueFrame(0, FALSE);
|
DrawDialogueFrame(WIN_MSG, FALSE);
|
||||||
AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouveGot9999Coins, 0, 1, 0, 0);
|
AddTextPrinterParameterized(WIN_MSG, FONT_NORMAL, gText_YouveGot9999Coins, 0, 1, 0, 0);
|
||||||
CopyWindowToVram(0, COPYWIN_FULL);
|
CopyWindowToVram(WIN_MSG, COPYWIN_FULL);
|
||||||
sSlotMachine->state = SLOTTASK_WAIT_MSG_MAX_COINS;
|
sSlotMachine->state = SLOTTASK_WAIT_MSG_MAX_COINS;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1699,7 +1704,7 @@ static bool8 SlotTask_WaitMsg_MaxCoins(struct Task *task)
|
|||||||
{
|
{
|
||||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||||
{
|
{
|
||||||
ClearDialogWindowAndFrame(0, TRUE);
|
ClearDialogWindowAndFrame(WIN_MSG, TRUE);
|
||||||
sSlotMachine->state = SLOTTASK_BET_INPUT;
|
sSlotMachine->state = SLOTTASK_BET_INPUT;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1708,9 +1713,9 @@ static bool8 SlotTask_WaitMsg_MaxCoins(struct Task *task)
|
|||||||
// SLOTTASK_MSG_NO_MORE_COINS
|
// SLOTTASK_MSG_NO_MORE_COINS
|
||||||
static bool8 SlotTask_PrintMsg_NoMoreCoins(struct Task *task)
|
static bool8 SlotTask_PrintMsg_NoMoreCoins(struct Task *task)
|
||||||
{
|
{
|
||||||
DrawDialogueFrame(0, FALSE);
|
DrawDialogueFrame(WIN_MSG, FALSE);
|
||||||
AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouveRunOutOfCoins, 0, 1, 0, 0);
|
AddTextPrinterParameterized(WIN_MSG, FONT_NORMAL, gText_YouveRunOutOfCoins, 0, 1, 0, 0);
|
||||||
CopyWindowToVram(0, COPYWIN_FULL);
|
CopyWindowToVram(WIN_MSG, COPYWIN_FULL);
|
||||||
sSlotMachine->state = SLOTTASK_WAIT_MSG_NO_MORE_COINS;
|
sSlotMachine->state = SLOTTASK_WAIT_MSG_NO_MORE_COINS;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1720,7 +1725,7 @@ static bool8 SlotTask_WaitMsg_NoMoreCoins(struct Task *task)
|
|||||||
{
|
{
|
||||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||||
{
|
{
|
||||||
ClearDialogWindowAndFrame(0, TRUE);
|
ClearDialogWindowAndFrame(WIN_MSG, TRUE);
|
||||||
sSlotMachine->state = SLOTTASK_END;
|
sSlotMachine->state = SLOTTASK_END;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -3922,15 +3927,15 @@ static void InfoBox_DrawWindow(struct Task *task)
|
|||||||
DestroyDigitalDisplayScene();
|
DestroyDigitalDisplayScene();
|
||||||
LoadInfoBoxTilemap();
|
LoadInfoBoxTilemap();
|
||||||
AddWindow(&sWindowTemplate_InfoBox);
|
AddWindow(&sWindowTemplate_InfoBox);
|
||||||
PutWindowTilemap(1);
|
PutWindowTilemap(WIN_INFO);
|
||||||
FillWindowPixelBuffer(1, PIXEL_FILL(0));
|
FillWindowPixelBuffer(WIN_INFO, PIXEL_FILL(0));
|
||||||
task->tState++;
|
task->tState++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InfoBox_AddText(struct Task *task)
|
static void InfoBox_AddText(struct Task *task)
|
||||||
{
|
{
|
||||||
AddTextPrinterParameterized3(1, FONT_NORMAL, 2, 5, sColors_ReeltimeHelp, 0, gText_ReelTimeHelp);
|
AddTextPrinterParameterized3(WIN_INFO, FONT_NORMAL, 2, 5, sColors_ReeltimeHelp, 0, gText_ReelTimeHelp);
|
||||||
CopyWindowToVram(1, COPYWIN_FULL);
|
CopyWindowToVram(WIN_INFO, COPYWIN_FULL);
|
||||||
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
|
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
|
||||||
task->tState++;
|
task->tState++;
|
||||||
}
|
}
|
||||||
@ -3939,10 +3944,10 @@ static void InfoBox_WaitInput(struct Task *task)
|
|||||||
{
|
{
|
||||||
if (JOY_NEW(B_BUTTON | SELECT_BUTTON))
|
if (JOY_NEW(B_BUTTON | SELECT_BUTTON))
|
||||||
{
|
{
|
||||||
FillWindowPixelBuffer(1, PIXEL_FILL(0));
|
FillWindowPixelBuffer(WIN_INFO, PIXEL_FILL(0));
|
||||||
ClearWindowTilemap(1);
|
ClearWindowTilemap(WIN_INFO);
|
||||||
CopyWindowToVram(1, COPYWIN_MAP);
|
CopyWindowToVram(WIN_INFO, COPYWIN_MAP);
|
||||||
RemoveWindow(1);
|
RemoveWindow(WIN_INFO);
|
||||||
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
|
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
|
||||||
task->tState++;
|
task->tState++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4535,7 +4535,7 @@ static void CreateInGameTradePokemonInternal(u8 whichPlayerMon, u8 whichInGameTr
|
|||||||
u8 level = GetMonData(&gPlayerParty[whichPlayerMon], MON_DATA_LEVEL);
|
u8 level = GetMonData(&gPlayerParty[whichPlayerMon], MON_DATA_LEVEL);
|
||||||
|
|
||||||
struct Mail mail;
|
struct Mail mail;
|
||||||
u8 metLocation = METLOC_IN_GAME_TRADE;
|
metloc_u8_t metLocation = METLOC_IN_GAME_TRADE;
|
||||||
u8 mailNum;
|
u8 mailNum;
|
||||||
struct Pokemon *pokemon = &gEnemyParty[0];
|
struct Pokemon *pokemon = &gEnemyParty[0];
|
||||||
|
|
||||||
|
|||||||
@ -78,7 +78,7 @@ struct TrainerCardData
|
|||||||
u8 cardType;
|
u8 cardType;
|
||||||
bool8 isHoenn;
|
bool8 isHoenn;
|
||||||
u16 blendColor;
|
u16 blendColor;
|
||||||
void (*callback2)(void);
|
MainCallback callback2;
|
||||||
struct TrainerCard trainerCard;
|
struct TrainerCard trainerCard;
|
||||||
u16 frontTilemap[600];
|
u16 frontTilemap[600];
|
||||||
u16 backTilemap[600];
|
u16 backTilemap[600];
|
||||||
|
|||||||
@ -50,7 +50,7 @@ enum {
|
|||||||
struct UsePokeblockSession
|
struct UsePokeblockSession
|
||||||
{
|
{
|
||||||
void (*callback)(void);
|
void (*callback)(void);
|
||||||
void (*exitCallback)(void);
|
MainCallback exitCallback;
|
||||||
struct Pokeblock *pokeblock;
|
struct Pokeblock *pokeblock;
|
||||||
struct Pokemon *mon;
|
struct Pokemon *mon;
|
||||||
u8 stringBuffer[64];
|
u8 stringBuffer[64];
|
||||||
@ -162,7 +162,7 @@ extern const u16 gConditionText_Pal[];
|
|||||||
// The below 3 are saved for returning to the screen after feeding a pokeblock to a mon
|
// The below 3 are saved for returning to the screen after feeding a pokeblock to a mon
|
||||||
// so that the rest of the data can be freed
|
// so that the rest of the data can be freed
|
||||||
static EWRAM_DATA struct UsePokeblockSession *sInfo = NULL;
|
static EWRAM_DATA struct UsePokeblockSession *sInfo = NULL;
|
||||||
static EWRAM_DATA void (*sExitCallback)(void) = NULL;
|
static EWRAM_DATA MainCallback sExitCallback = NULL;
|
||||||
static EWRAM_DATA struct Pokeblock *sPokeblock = NULL;
|
static EWRAM_DATA struct Pokeblock *sPokeblock = NULL;
|
||||||
EWRAM_DATA u8 gPokeblockMonId = 0;
|
EWRAM_DATA u8 gPokeblockMonId = 0;
|
||||||
EWRAM_DATA s16 gPokeblockGain = 0;
|
EWRAM_DATA s16 gPokeblockGain = 0;
|
||||||
|
|||||||
@ -1,20 +1,23 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "wild_encounter.h"
|
#include "battle_setup.h"
|
||||||
#include "pokemon.h"
|
#include "battle_pike.h"
|
||||||
#include "metatile_behavior.h"
|
#include "battle_pyramid.h"
|
||||||
|
#include "event_data.h"
|
||||||
#include "fieldmap.h"
|
#include "fieldmap.h"
|
||||||
#include "follower_npc.h"
|
#include "follower_npc.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "field_player_avatar.h"
|
#include "field_player_avatar.h"
|
||||||
#include "event_data.h"
|
#include "link.h"
|
||||||
#include "safari_zone.h"
|
#include "metatile_behavior.h"
|
||||||
#include "overworld.h"
|
#include "overworld.h"
|
||||||
#include "pokeblock.h"
|
#include "pokeblock.h"
|
||||||
#include "battle_setup.h"
|
#include "pokemon.h"
|
||||||
|
#include "random.h"
|
||||||
#include "roamer.h"
|
#include "roamer.h"
|
||||||
#include "tv.h"
|
#include "safari_zone.h"
|
||||||
#include "link.h"
|
|
||||||
#include "script.h"
|
#include "script.h"
|
||||||
|
#include "tv.h"
|
||||||
|
#include "wild_encounter.h"
|
||||||
#include "battle_debug.h"
|
#include "battle_debug.h"
|
||||||
#include "battle_pike.h"
|
#include "battle_pike.h"
|
||||||
#include "battle_pyramid.h"
|
#include "battle_pyramid.h"
|
||||||
|
|||||||
@ -530,12 +530,14 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
|
|||||||
|
|
||||||
text << "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n//\n\n";
|
text << "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n//\n\n";
|
||||||
|
|
||||||
|
text << "enum\n{\n";
|
||||||
|
|
||||||
int group_num = 0;
|
int group_num = 0;
|
||||||
vector<int> map_count_vec; //DEBUG
|
vector<int> map_count_vec; //DEBUG
|
||||||
|
|
||||||
for (auto &group : groups_data["group_order"].array_items()) {
|
for (auto &group : groups_data["group_order"].array_items()) {
|
||||||
string groupName = json_to_string(group);
|
string groupName = json_to_string(group);
|
||||||
text << "// " << groupName << "\n";
|
text << " // " << groupName << "\n";
|
||||||
vector<string> map_ids;
|
vector<string> map_ids;
|
||||||
size_t max_length = 0;
|
size_t max_length = 0;
|
||||||
|
|
||||||
@ -556,8 +558,8 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
|
|||||||
|
|
||||||
int map_id_num = 0;
|
int map_id_num = 0;
|
||||||
for (string map_id : map_ids) {
|
for (string map_id : map_ids) {
|
||||||
text << "#define " << map_id << string((max_length - map_id.length() + 1), ' ')
|
text << " " << map_id << string(max_length - map_id.length(), ' ')
|
||||||
<< "(" << map_id_num++ << " | (" << group_num << " << 8))\n";
|
<< " = (" << map_id_num++ << " | (" << group_num << " << 8)),\n";
|
||||||
}
|
}
|
||||||
text << "\n";
|
text << "\n";
|
||||||
|
|
||||||
@ -565,6 +567,8 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
|
|||||||
map_count_vec.push_back(map_count); //DEBUG
|
map_count_vec.push_back(map_count); //DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
text << "};\n\n";
|
||||||
|
|
||||||
text << "#define MAP_GROUPS_COUNT " << group_num << "\n\n";
|
text << "#define MAP_GROUPS_COUNT " << group_num << "\n\n";
|
||||||
text << get_include_guard_end(guard_name);
|
text << get_include_guard_end(guard_name);
|
||||||
|
|
||||||
|
|||||||