mirror of
https://github.com/pret/pokeemerald.git
synced 2026-04-26 09:33:41 -05:00
Improve undefined map assembler messages (#2196)
Some checks failed
CI / build (push) Has been cancelled
Some checks failed
CI / build (push) Has been cancelled
This commit is contained in:
parent
1de27646d2
commit
d1d5435487
|
|
@ -667,6 +667,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
|
||||||
|
|
@ -674,6 +682,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)
|
||||||
|
|
|
||||||
|
|
@ -787,7 +787,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
|
||||||
|
|
@ -802,7 +802,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
|
||||||
|
|
@ -1380,7 +1380,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
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -526,11 +526,13 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
|
||||||
ostringstream text;
|
ostringstream text;
|
||||||
text << get_include_guard_start(guard_name) << get_generated_warning("data/maps/map_groups.json", false);
|
text << get_include_guard_start(guard_name) << get_generated_warning("data/maps/map_groups.json", false);
|
||||||
|
|
||||||
|
text << "enum\n{\n";
|
||||||
|
|
||||||
int group_num = 0;
|
int group_num = 0;
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
|
@ -548,14 +550,16 @@ 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";
|
||||||
|
|
||||||
group_num++;
|
group_num++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user