From 625a006cabbf44734be2d0324264d86c3edba51b Mon Sep 17 00:00:00 2001 From: Icedude907 <34080011+Icedude907@users.noreply.github.com> Date: Fri, 30 Aug 2024 06:01:01 +1200 Subject: [PATCH] [Build System Rewrite] `mapjson` now takes output directory parameters. (#1949) --- Makefile | 57 ++-- include/constants/.gitignore | 3 + include/constants/layouts.h | 450 ------------------------- include/constants/map_groups.h | 596 --------------------------------- make_tools.mk | 14 +- map_data_rules.mk | 30 +- tools/jsonproc/jsonproc.cpp | 2 + tools/mapjson/mapjson.cpp | 112 ++++--- 8 files changed, 124 insertions(+), 1140 deletions(-) create mode 100644 include/constants/.gitignore delete mode 100755 include/constants/layouts.h delete mode 100755 include/constants/map_groups.h diff --git a/Makefile b/Makefile index bf74e0331a..15cbd709e4 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ ifeq (compare,$(MAKECMDGOALS)) COMPARE := 1 endif +# Default make rule +all: rom + # don't use dkP's base_tools anymore # because the redefinition of $(CC) conflicts # with when we want to use $(CC) to preprocess files @@ -119,24 +122,23 @@ ifneq ($(MODERN),1) CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef endif +# Variable filled out in other make files +AUTO_GEN_TARGETS := +include make_tools.mk + SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c -GFX := tools/gbagfx/gbagfx$(EXE) -AIF := tools/aif2pcm/aif2pcm$(EXE) -MID := tools/mid2agb/mid2agb$(EXE) -SCANINC := tools/scaninc/scaninc$(EXE) -PREPROC := tools/preproc/preproc$(EXE) -RAMSCRGEN := tools/ramscrgen/ramscrgen$(EXE) -FIX := tools/gbafix/gbafix$(EXE) -MAPJSON := tools/mapjson/mapjson$(EXE) -JSONPROC := tools/jsonproc/jsonproc$(EXE) +GFX := $(TOOLS_DIR)/gbagfx/gbagfx$(EXE) +AIF := $(TOOLS_DIR)/aif2pcm/aif2pcm$(EXE) +MID := $(TOOLS_DIR)/mid2agb/mid2agb$(EXE) +SCANINC := $(TOOLS_DIR)/scaninc/scaninc$(EXE) +PREPROC := $(TOOLS_DIR)/preproc/preproc$(EXE) +RAMSCRGEN := $(TOOLS_DIR)/ramscrgen/ramscrgen$(EXE) +FIX := $(TOOLS_DIR)/gbafix/gbafix$(EXE) +MAPJSON := $(TOOLS_DIR)/mapjson/mapjson$(EXE) +JSONPROC := $(TOOLS_DIR)/jsonproc/jsonproc$(EXE) PERL := perl -# Inclusive list. If you don't want a tool to be built, don't add it here. -TOOLDIRS := tools/aif2pcm tools/bin2c tools/gbafix tools/gbagfx tools/jsonproc tools/mapjson tools/mid2agb tools/preproc tools/ramscrgen tools/rsfont tools/scaninc -TOOLBASE = $(TOOLDIRS:tools/%=%) -TOOLS = $(foreach tool,$(TOOLBASE),tools/$(tool)/$(tool)$(EXE)) - MAKEFLAGS += --no-print-directory # Clear the default suffixes @@ -149,7 +151,7 @@ MAKEFLAGS += --no-print-directory # Secondary expansion is required for dependency variables in object rules. .SECONDEXPANSION: -.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS) libagbsyscall modern tidymodern tidynonmodern +.PHONY: all rom clean compare tidy mostlyclean libagbsyscall modern tidymodern tidynonmodern infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) @@ -159,6 +161,7 @@ infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst # Since we don't need to reload most of this makefile ifeq (,$(filter-out all rom compare modern libagbsyscall syms,$(MAKECMDGOALS))) $(call infoshell, $(MAKE) -f make_tools.mk) +$(call infoshell, $(MAKE) generated) else NODEP ?= 1 endif @@ -209,17 +212,8 @@ SUBDIRS := $(sort $(dir $(OBJS))) $(shell mkdir -p $(SUBDIRS)) endif -AUTO_GEN_TARGETS := - -all: rom - -tools: $(TOOLDIRS) - syms: $(SYM) -$(TOOLDIRS): - @$(MAKE) -C $@ - rom: $(ROM) ifeq ($(COMPARE),1) @$(SHA1) rom.sha1 @@ -230,9 +224,6 @@ compare: all clean: mostlyclean clean-tools -clean-tools: - @$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);) - mostlyclean: tidynonmodern tidymodern find sound -iname '*.bin' -exec rm {} + rm -f $(MID_SUBDIR)/*.s @@ -263,6 +254,8 @@ include spritesheet_rules.mk include json_data_rules.mk include songs.mk +generated: $(AUTO_GEN_TARGETS) + %.s: ; %.png: ; %.pal: ; @@ -280,7 +273,7 @@ sound/%.bin: sound/%.aif ; $(AIF) $< $@ ifeq ($(MODERN),0) -$(C_BUILDDIR)/libc.o: CC1 := tools/agbcc/bin/old_agbcc$(EXE) +$(C_BUILDDIR)/libc.o: CC1 := $(TOOLS_DIR)/agbcc/bin/old_agbcc$(EXE) $(C_BUILDDIR)/libc.o: CFLAGS := -O2 $(C_BUILDDIR)/siirtc.o: CFLAGS := -mthumb-interwork @@ -289,10 +282,10 @@ $(C_BUILDDIR)/agb_flash.o: CFLAGS := -O -mthumb-interwork $(C_BUILDDIR)/agb_flash_1m.o: CFLAGS := -O -mthumb-interwork $(C_BUILDDIR)/agb_flash_mx.o: CFLAGS := -O -mthumb-interwork -$(C_BUILDDIR)/m4a.o: CC1 := tools/agbcc/bin/old_agbcc$(EXE) +$(C_BUILDDIR)/m4a.o: CC1 := $(TOOLS_DIR)/agbcc/bin/old_agbcc$(EXE) $(C_BUILDDIR)/record_mixing.o: CFLAGS += -ffreestanding -$(C_BUILDDIR)/librfu_intr.o: CC1 := tools/agbcc/bin/agbcc_arm$(EXE) +$(C_BUILDDIR)/librfu_intr.o: CC1 := $(TOOLS_DIR)/agbcc/bin/agbcc_arm$(EXE) $(C_BUILDDIR)/librfu_intr.o: CFLAGS := -O2 -mthumb-interwork -quiet else $(C_BUILDDIR)/librfu_intr.o: CFLAGS := -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast @@ -320,7 +313,7 @@ else endif else define C_DEP -$1: $2 $$(shell $(SCANINC) -I include -I tools/agbcc/include -I gflib $2) +$1: $2 $$(shell $(SCANINC) -I include -I $(TOOLS_DIR)/agbcc/include -I gflib $2) ifeq (,$$(KEEP_TEMPS)) @echo "$$(CC1) -o $$@ $$<" @$$(CPP) $$(CPPFLAGS) $$< | $$(PREPROC) -i $$< charmap.txt | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ - @@ -347,7 +340,7 @@ else endif else define GFLIB_DEP -$1: $2 $$(shell $(SCANINC) -I include -I tools/agbcc/include -I gflib $2) +$1: $2 $$(shell $(SCANINC) -I include -I $(TOOLS_DIR)/agbcc/include -I gflib $2) ifeq (,$$(KEEP_TEMPS)) @echo "$$(CC1) -o $$@ $$<" @$$(CPP) $$(CPPFLAGS) $$< | $$(PREPROC) -i $$< charmap.txt | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ - diff --git a/include/constants/.gitignore b/include/constants/.gitignore new file mode 100644 index 0000000000..761af9db76 --- /dev/null +++ b/include/constants/.gitignore @@ -0,0 +1,3 @@ +# Will be moved to build/ eventually +map_groups.h +layouts.h \ No newline at end of file diff --git a/include/constants/layouts.h b/include/constants/layouts.h deleted file mode 100755 index db92c95942..0000000000 --- a/include/constants/layouts.h +++ /dev/null @@ -1,450 +0,0 @@ -#ifndef GUARD_CONSTANTS_LAYOUTS_H -#define GUARD_CONSTANTS_LAYOUTS_H - -// -// DO NOT MODIFY THIS FILE! It is auto-generated from data/layouts/layouts.json -// - -#define LAYOUT_PETALBURG_CITY 1 -#define LAYOUT_SLATEPORT_CITY 2 -#define LAYOUT_MAUVILLE_CITY 3 -#define LAYOUT_RUSTBORO_CITY 4 -#define LAYOUT_FORTREE_CITY 5 -#define LAYOUT_LILYCOVE_CITY 6 -#define LAYOUT_MOSSDEEP_CITY 7 -#define LAYOUT_SOOTOPOLIS_CITY 8 -#define LAYOUT_EVER_GRANDE_CITY 9 -#define LAYOUT_LITTLEROOT_TOWN 10 -#define LAYOUT_OLDALE_TOWN 11 -#define LAYOUT_DEWFORD_TOWN 12 -#define LAYOUT_LAVARIDGE_TOWN 13 -#define LAYOUT_FALLARBOR_TOWN 14 -#define LAYOUT_VERDANTURF_TOWN 15 -#define LAYOUT_PACIFIDLOG_TOWN 16 -#define LAYOUT_ROUTE101 17 -#define LAYOUT_ROUTE102 18 -#define LAYOUT_ROUTE103 19 -#define LAYOUT_ROUTE104 20 -#define LAYOUT_ROUTE105 21 -#define LAYOUT_ROUTE106 22 -#define LAYOUT_ROUTE107 23 -#define LAYOUT_ROUTE108 24 -#define LAYOUT_ROUTE109 25 -#define LAYOUT_ROUTE110 26 -#define LAYOUT_ROUTE111 27 -#define LAYOUT_ROUTE112 28 -#define LAYOUT_ROUTE113 29 -#define LAYOUT_ROUTE114 30 -#define LAYOUT_ROUTE115 31 -#define LAYOUT_ROUTE116 32 -#define LAYOUT_ROUTE117 33 -#define LAYOUT_ROUTE118 34 -#define LAYOUT_ROUTE119 35 -#define LAYOUT_ROUTE120 36 -#define LAYOUT_ROUTE121 37 -#define LAYOUT_ROUTE122 38 -#define LAYOUT_ROUTE123 39 -#define LAYOUT_ROUTE124 40 -#define LAYOUT_ROUTE125 41 -#define LAYOUT_ROUTE126 42 -#define LAYOUT_ROUTE127 43 -#define LAYOUT_ROUTE128 44 -#define LAYOUT_ROUTE129 45 -#define LAYOUT_ROUTE130_MIRAGE_ISLAND 46 -#define LAYOUT_ROUTE131 47 -#define LAYOUT_ROUTE132 48 -#define LAYOUT_ROUTE133 49 -#define LAYOUT_ROUTE134 50 -#define LAYOUT_UNDERWATER_ROUTE126 51 -#define LAYOUT_UNDERWATER_ROUTE127 52 -#define LAYOUT_UNDERWATER_ROUTE128 53 -#define LAYOUT_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F 54 -#define LAYOUT_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F 55 -#define LAYOUT_LITTLEROOT_TOWN_MAYS_HOUSE_1F 56 -#define LAYOUT_LITTLEROOT_TOWN_MAYS_HOUSE_2F 57 -#define LAYOUT_LITTLEROOT_TOWN_PROFESSOR_BIRCHS_LAB 58 -#define LAYOUT_HOUSE1 59 -#define LAYOUT_HOUSE2 60 -#define LAYOUT_POKEMON_CENTER_1F 61 -#define LAYOUT_POKEMON_CENTER_2F 62 -#define LAYOUT_MART 63 -#define LAYOUT_HOUSE3 64 -#define LAYOUT_DEWFORD_TOWN_GYM 65 -#define LAYOUT_DEWFORD_TOWN_HALL 66 -#define LAYOUT_HOUSE4 67 -#define LAYOUT_LAVARIDGE_TOWN_HERB_SHOP 68 -#define LAYOUT_LAVARIDGE_TOWN_GYM_1F 69 -#define LAYOUT_LAVARIDGE_TOWN_GYM_B1F 70 -#define LAYOUT_LAVARIDGE_TOWN_POKEMON_CENTER_1F 71 -#define LAYOUT_FALLARBOR_TOWN_LEFTOVER_RSCONTEST_LOBBY 72 -#define LAYOUT_FALLARBOR_TOWN_LEFTOVER_RSCONTEST_HALL 73 -#define LAYOUT_LILYCOVE_CITY_HOUSE2 74 -#define LAYOUT_UNUSED_CONTEST_ROOM1 75 -#define LAYOUT_VERDANTURF_TOWN_WANDAS_HOUSE 76 -#define LAYOUT_PACIFIDLOG_TOWN_HOUSE1 77 -#define LAYOUT_PACIFIDLOG_TOWN_HOUSE2 78 -#define LAYOUT_PETALBURG_CITY_GYM 79 -#define LAYOUT_HOUSE_WITH_BED 80 -#define LAYOUT_SLATEPORT_CITY_STERNS_SHIPYARD_1F 81 -#define LAYOUT_SLATEPORT_CITY_STERNS_SHIPYARD_2F 82 -#define LAYOUT_UNUSED_CONTEST_ROOM2 83 -#define LAYOUT_UNUSED_CONTEST_ROOM3 84 -#define LAYOUT_SLATEPORT_CITY_POKEMON_FAN_CLUB 85 -#define LAYOUT_SLATEPORT_CITY_OCEANIC_MUSEUM_1F 86 -#define LAYOUT_SLATEPORT_CITY_OCEANIC_MUSEUM_2F 87 -#define LAYOUT_HARBOR 88 -#define LAYOUT_MAUVILLE_CITY_GYM 89 -#define LAYOUT_MAUVILLE_CITY_BIKE_SHOP 90 -#define LAYOUT_MAUVILLE_CITY_GAME_CORNER 91 -#define LAYOUT_RUSTBORO_CITY_DEVON_CORP_1F 92 -#define LAYOUT_RUSTBORO_CITY_DEVON_CORP_2F 93 -#define LAYOUT_RUSTBORO_CITY_GYM 94 -#define LAYOUT_RUSTBORO_CITY_POKEMON_SCHOOL 95 -#define LAYOUT_RUSTBORO_CITY_HOUSE 96 -#define LAYOUT_RUSTBORO_CITY_HOUSE1 97 -#define LAYOUT_RUSTBORO_CITY_CUTTERS_HOUSE 98 -#define LAYOUT_FORTREE_CITY_HOUSE1 99 -#define LAYOUT_FORTREE_CITY_GYM 100 -#define LAYOUT_FORTREE_CITY_HOUSE2 101 -#define LAYOUT_ROUTE104_MR_BRINEYS_HOUSE 102 -#define LAYOUT_LILYCOVE_CITY_LILYCOVE_MUSEUM_1F 103 -#define LAYOUT_LILYCOVE_CITY_LILYCOVE_MUSEUM_2F 104 -#define LAYOUT_LILYCOVE_CITY_CONTEST_LOBBY 105 -#define LAYOUT_LILYCOVE_CITY_CONTEST_HALL 106 -#define LAYOUT_LILYCOVE_CITY_POKEMON_TRAINER_FAN_CLUB 107 -#define LAYOUT_MOSSDEEP_CITY_GYM 108 -#define LAYOUT_SOOTOPOLIS_CITY_GYM_1F 109 -#define LAYOUT_SOOTOPOLIS_CITY_GYM_B1F 110 -#define LAYOUT_EVER_GRANDE_CITY_SIDNEYS_ROOM 111 -#define LAYOUT_EVER_GRANDE_CITY_PHOEBES_ROOM 112 -#define LAYOUT_EVER_GRANDE_CITY_GLACIAS_ROOM 113 -#define LAYOUT_EVER_GRANDE_CITY_DRAKES_ROOM 114 -#define LAYOUT_EVER_GRANDE_CITY_CHAMPIONS_ROOM 115 -#define LAYOUT_EVER_GRANDE_CITY_SHORT_HALL 116 -#define LAYOUT_ROUTE104_PRETTY_PETAL_FLOWER_SHOP 117 -#define LAYOUT_CABLE_CAR_STATION 118 -#define LAYOUT_ROUTE114_FOSSIL_MANIACS_HOUSE 119 -#define LAYOUT_ROUTE114_FOSSIL_MANIACS_TUNNEL 120 -#define LAYOUT_ROUTE114_LANETTES_HOUSE 121 -#define LAYOUT_ROUTE116_TUNNELERS_REST_HOUSE 122 -#define LAYOUT_ROUTE117_POKEMON_DAY_CARE 123 -#define LAYOUT_ROUTE121_SAFARI_ZONE_ENTRANCE 124 -#define LAYOUT_METEOR_FALLS_1F_1R 125 -#define LAYOUT_METEOR_FALLS_1F_2R 126 -#define LAYOUT_METEOR_FALLS_B1F_1R 127 -#define LAYOUT_METEOR_FALLS_B1F_2R 128 -#define LAYOUT_RUSTURF_TUNNEL 129 -#define LAYOUT_UNDERWATER_SOOTOPOLIS_CITY 130 -#define LAYOUT_DESERT_RUINS 131 -#define LAYOUT_GRANITE_CAVE_1F 132 -#define LAYOUT_GRANITE_CAVE_B1F 133 -#define LAYOUT_GRANITE_CAVE_B2F 134 -#define LAYOUT_PETALBURG_WOODS 135 -#define LAYOUT_MT_CHIMNEY 136 -#define LAYOUT_MT_PYRE_1F 137 -#define LAYOUT_MT_PYRE_2F 138 -#define LAYOUT_MT_PYRE_3F 139 -#define LAYOUT_MT_PYRE_4F 140 -#define LAYOUT_MT_PYRE_5F 141 -#define LAYOUT_MT_PYRE_6F 142 -#define LAYOUT_AQUA_HIDEOUT_1F 143 -#define LAYOUT_AQUA_HIDEOUT_B1F 144 -#define LAYOUT_AQUA_HIDEOUT_B2F 145 -#define LAYOUT_UNDERWATER_SEAFLOOR_CAVERN 146 -#define LAYOUT_SEAFLOOR_CAVERN_ENTRANCE 147 -#define LAYOUT_SEAFLOOR_CAVERN_ROOM1 148 -#define LAYOUT_SEAFLOOR_CAVERN_ROOM2 149 -#define LAYOUT_SEAFLOOR_CAVERN_ROOM3 150 -#define LAYOUT_SEAFLOOR_CAVERN_ROOM4 151 -#define LAYOUT_SEAFLOOR_CAVERN_ROOM5 152 -#define LAYOUT_SEAFLOOR_CAVERN_ROOM6 153 -#define LAYOUT_SEAFLOOR_CAVERN_ROOM7 154 -#define LAYOUT_SEAFLOOR_CAVERN_ROOM8 155 -#define LAYOUT_SEAFLOOR_CAVERN_ROOM9 156 -#define LAYOUT_CAVE_OF_ORIGIN_ENTRANCE 157 -#define LAYOUT_CAVE_OF_ORIGIN_1F 158 -#define LAYOUT_CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP1 159 -#define LAYOUT_CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP2 160 -#define LAYOUT_CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP3 161 -#define LAYOUT_CAVE_OF_ORIGIN_B1F 162 -#define LAYOUT_VICTORY_ROAD_1F 163 -#define LAYOUT_SHOAL_CAVE_LOW_TIDE_ENTRANCE_ROOM 164 -#define LAYOUT_SHOAL_CAVE_LOW_TIDE_INNER_ROOM 165 -#define LAYOUT_SHOAL_CAVE_LOW_TIDE_STAIRS_ROOM 166 -#define LAYOUT_SHOAL_CAVE_LOW_TIDE_LOWER_ROOM 167 -#define LAYOUT_SHOAL_CAVE_HIGH_TIDE_ENTRANCE_ROOM 168 -#define LAYOUT_SHOAL_CAVE_HIGH_TIDE_INNER_ROOM 169 -#define LAYOUT_UNUSED_CAVE1 170 -#define LAYOUT_UNUSED_CAVE2 171 -#define LAYOUT_UNUSED_CAVE3 172 -#define LAYOUT_UNUSED_CAVE4 173 -#define LAYOUT_UNUSED_CAVE5 174 -#define LAYOUT_UNUSED_CAVE6 175 -#define LAYOUT_UNUSED_CAVE7 176 -#define LAYOUT_UNUSED_CAVE8 177 -#define LAYOUT_UNUSED_CAVE9 178 -#define LAYOUT_UNUSED_CAVE10 179 -#define LAYOUT_UNUSED_CAVE11 180 -#define LAYOUT_UNUSED_CAVE12 181 -#define LAYOUT_UNUSED_CAVE13 182 -#define LAYOUT_UNUSED_CAVE14 183 -#define LAYOUT_NEW_MAUVILLE_ENTRANCE 184 -#define LAYOUT_NEW_MAUVILLE_INSIDE 185 -#define LAYOUT_ABANDONED_SHIP_DECK 186 -#define LAYOUT_ABANDONED_SHIP_CORRIDORS_1F 187 -#define LAYOUT_ABANDONED_SHIP_ROOMS_1F 188 -#define LAYOUT_ABANDONED_SHIP_CORRIDORS_B1F 189 -#define LAYOUT_ABANDONED_SHIP_ROOMS_B1F 190 -#define LAYOUT_ABANDONED_SHIP_ROOMS2_B1F 191 -#define LAYOUT_ABANDONED_SHIP_UNDERWATER1 192 -#define LAYOUT_ABANDONED_SHIP_ROOM_B1F 193 -#define LAYOUT_ABANDONED_SHIP_ROOMS2_1F 194 -#define LAYOUT_ABANDONED_SHIP_CAPTAINS_OFFICE 195 -#define LAYOUT_ABANDONED_SHIP_UNDERWATER2 196 -#define LAYOUT_SECRET_BASE_RED_CAVE1 197 -#define LAYOUT_SECRET_BASE_BROWN_CAVE1 198 -#define LAYOUT_SECRET_BASE_BLUE_CAVE1 199 -#define LAYOUT_SECRET_BASE_YELLOW_CAVE1 200 -#define LAYOUT_SECRET_BASE_TREE1 201 -#define LAYOUT_SECRET_BASE_SHRUB1 202 -#define LAYOUT_SECRET_BASE_RED_CAVE2 203 -#define LAYOUT_SECRET_BASE_BROWN_CAVE2 204 -#define LAYOUT_SECRET_BASE_BLUE_CAVE2 205 -#define LAYOUT_SECRET_BASE_YELLOW_CAVE2 206 -#define LAYOUT_SECRET_BASE_TREE2 207 -#define LAYOUT_SECRET_BASE_SHRUB2 208 -#define LAYOUT_SECRET_BASE_RED_CAVE3 209 -#define LAYOUT_SECRET_BASE_BROWN_CAVE3 210 -#define LAYOUT_SECRET_BASE_BLUE_CAVE3 211 -#define LAYOUT_SECRET_BASE_YELLOW_CAVE3 212 -#define LAYOUT_SECRET_BASE_TREE3 213 -#define LAYOUT_SECRET_BASE_SHRUB3 214 -#define LAYOUT_SECRET_BASE_RED_CAVE4 215 -#define LAYOUT_SECRET_BASE_BROWN_CAVE4 216 -#define LAYOUT_SECRET_BASE_BLUE_CAVE4 217 -#define LAYOUT_SECRET_BASE_YELLOW_CAVE4 218 -#define LAYOUT_SECRET_BASE_TREE4 219 -#define LAYOUT_SECRET_BASE_SHRUB4 220 -#define LAYOUT_BATTLE_COLOSSEUM_2P 221 -#define LAYOUT_TRADE_CENTER 222 -#define LAYOUT_RECORD_CORNER 223 -#define LAYOUT_BATTLE_COLOSSEUM_4P 224 -#define LAYOUT_CONTEST_HALL 225 -#define LAYOUT_UNUSED_CONTEST_HALL1 226 -#define LAYOUT_UNUSED_CONTEST_HALL2 227 -#define LAYOUT_UNUSED_CONTEST_HALL3 228 -#define LAYOUT_UNUSED_CONTEST_HALL4 229 -#define LAYOUT_UNUSED_CONTEST_HALL5 230 -#define LAYOUT_UNUSED_CONTEST_HALL6 231 -#define LAYOUT_CONTEST_HALL_BEAUTY 232 -#define LAYOUT_CONTEST_HALL_TOUGH 233 -#define LAYOUT_CONTEST_HALL_COOL 234 -#define LAYOUT_CONTEST_HALL_SMART 235 -#define LAYOUT_CONTEST_HALL_CUTE 236 -#define LAYOUT_INSIDE_OF_TRUCK 237 -#define LAYOUT_SAFARI_ZONE_NORTHWEST 238 -#define LAYOUT_SAFARI_ZONE_NORTH 239 -#define LAYOUT_SAFARI_ZONE_SOUTHWEST 240 -#define LAYOUT_SAFARI_ZONE_SOUTH 241 -#define LAYOUT_UNUSED_OUTDOOR_AREA 242 -#define LAYOUT_ROUTE109_SEASHORE_HOUSE 243 -#define LAYOUT_ROUTE110_TRICK_HOUSE_ENTRANCE 244 -#define LAYOUT_ROUTE110_TRICK_HOUSE_END 245 -#define LAYOUT_ROUTE110_TRICK_HOUSE_CORRIDOR 246 -#define LAYOUT_ROUTE110_TRICK_HOUSE_PUZZLE1 247 -#define LAYOUT_ROUTE110_TRICK_HOUSE_PUZZLE2 248 -#define LAYOUT_ROUTE110_TRICK_HOUSE_PUZZLE3 249 -#define LAYOUT_ROUTE110_TRICK_HOUSE_PUZZLE4 250 -#define LAYOUT_ROUTE110_TRICK_HOUSE_PUZZLE5 251 -#define LAYOUT_ROUTE110_TRICK_HOUSE_PUZZLE6 252 -#define LAYOUT_ROUTE110_TRICK_HOUSE_PUZZLE7 253 -#define LAYOUT_ROUTE110_TRICK_HOUSE_PUZZLE8 254 -#define LAYOUT_FORTREE_CITY_DECORATION_SHOP 255 -#define LAYOUT_ROUTE110_SEASIDE_CYCLING_ROAD_ENTRANCE 256 -#define LAYOUT_LILYCOVE_CITY_DEPARTMENT_STORE_1F 257 -#define LAYOUT_LILYCOVE_CITY_DEPARTMENT_STORE_2F 258 -#define LAYOUT_LILYCOVE_CITY_DEPARTMENT_STORE_3F 259 -#define LAYOUT_LILYCOVE_CITY_DEPARTMENT_STORE_4F 260 -#define LAYOUT_LILYCOVE_CITY_DEPARTMENT_STORE_5F 261 -#define LAYOUT_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP 262 -#define LAYOUT_ROUTE130 263 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_TOWER_LOBBY 264 -#define LAYOUT_BATTLE_FRONTIER_OUTSIDE_WEST 265 -#define LAYOUT_BATTLE_ELEVATOR 266 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_TOWER_CORRIDOR 267 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM 268 -#define LAYOUT_RUSTBORO_CITY_DEVON_CORP_3F 269 -#define LAYOUT_EVER_GRANDE_CITY_POKEMON_LEAGUE_1F 270 -#define LAYOUT_ROUTE119_WEATHER_INSTITUTE_1F 271 -#define LAYOUT_ROUTE119_WEATHER_INSTITUTE_2F 272 -#define LAYOUT_LILYCOVE_CITY_DEPARTMENT_STORE_ELEVATOR 273 -#define LAYOUT_UNDERWATER_ROUTE124 274 -#define LAYOUT_MOSSDEEP_CITY_SPACE_CENTER_1F 275 -#define LAYOUT_MOSSDEEP_CITY_SPACE_CENTER_2F 276 -#define LAYOUT_SS_TIDAL_CORRIDOR 277 -#define LAYOUT_SS_TIDAL_LOWER_DECK 278 -#define LAYOUT_SS_TIDAL_ROOMS 279 -#define LAYOUT_ISLAND_CAVE 280 -#define LAYOUT_ANCIENT_TOMB 281 -#define LAYOUT_UNDERWATER_ROUTE134 282 -#define LAYOUT_UNDERWATER_SEALED_CHAMBER 283 -#define LAYOUT_SEALED_CHAMBER_OUTER_ROOM 284 -#define LAYOUT_VICTORY_ROAD_B1F 285 -#define LAYOUT_VICTORY_ROAD_B2F 286 -#define LAYOUT_ROUTE104_PROTOTYPE 287 -#define LAYOUT_GRANITE_CAVE_STEVENS_ROOM 288 -#define LAYOUT_ABANDONED_SHIP_HIDDEN_FLOOR_CORRIDORS 289 -#define LAYOUT_SOUTHERN_ISLAND_EXTERIOR 290 -#define LAYOUT_SOUTHERN_ISLAND_INTERIOR 291 -#define LAYOUT_JAGGED_PASS 292 -#define LAYOUT_FIERY_PATH 293 -#define LAYOUT_RUSTBORO_CITY_FLAT2_1F 294 -#define LAYOUT_RUSTBORO_CITY_FLAT2_2F 295 -#define LAYOUT_RUSTBORO_CITY_FLAT2_3F 296 -#define LAYOUT_SOOTOPOLIS_CITY_LOTAD_AND_SEEDOT_HOUSE 297 -#define LAYOUT_EVER_GRANDE_CITY_HALL_OF_FAME 298 -#define LAYOUT_LILYCOVE_CITY_COVE_LILY_MOTEL_1F 299 -#define LAYOUT_LILYCOVE_CITY_COVE_LILY_MOTEL_2F 300 -#define LAYOUT_ROUTE124_DIVING_TREASURE_HUNTERS_HOUSE 301 -#define LAYOUT_MT_PYRE_EXTERIOR 302 -#define LAYOUT_MT_PYRE_SUMMIT 303 -#define LAYOUT_SEALED_CHAMBER_INNER_ROOM 304 -#define LAYOUT_MOSSDEEP_CITY_GAME_CORNER_1F 305 -#define LAYOUT_MOSSDEEP_CITY_GAME_CORNER_B1F 306 -#define LAYOUT_SOOTOPOLIS_CITY_HOUSE1 307 -#define LAYOUT_SOOTOPOLIS_CITY_HOUSE2 308 -#define LAYOUT_SOOTOPOLIS_CITY_HOUSE3 309 -#define LAYOUT_ABANDONED_SHIP_HIDDEN_FLOOR_ROOMS 310 -#define LAYOUT_SCORCHED_SLAB 311 -#define LAYOUT_CAVE_OF_ORIGIN_UNUSED_B4F_LAVA 312 -#define LAYOUT_RUSTBORO_CITY_FLAT1_1F 313 -#define LAYOUT_RUSTBORO_CITY_FLAT1_2F 314 -#define LAYOUT_EVER_GRANDE_CITY_HALL4 315 -#define LAYOUT_AQUA_HIDEOUT_UNUSED_RUBY_MAP1 316 -#define LAYOUT_AQUA_HIDEOUT_UNUSED_RUBY_MAP2 317 -#define LAYOUT_AQUA_HIDEOUT_UNUSED_RUBY_MAP3 318 -#define LAYOUT_ROUTE131_SKY_PILLAR 319 -#define LAYOUT_SKY_PILLAR_ENTRANCE 320 -#define LAYOUT_SKY_PILLAR_OUTSIDE 321 -#define LAYOUT_SKY_PILLAR_1F 322 -#define LAYOUT_SKY_PILLAR_2F 323 -#define LAYOUT_SKY_PILLAR_3F 324 -#define LAYOUT_SKY_PILLAR_4F 325 -#define LAYOUT_SEAFLOOR_CAVERN_ROOM9_LAVA 326 -#define LAYOUT_MOSSDEEP_CITY_STEVENS_HOUSE 327 -#define LAYOUT_SHOAL_CAVE_LOW_TIDE_ICE_ROOM 328 -#define LAYOUT_SAFARI_ZONE_REST_HOUSE 329 -#define LAYOUT_SKY_PILLAR_5F 330 -#define LAYOUT_SKY_PILLAR_TOP 331 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_DOME_LOBBY 332 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_DOME_CORRIDOR 333 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_DOME_PRE_BATTLE_ROOM 334 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_DOME_BATTLE_ROOM 335 -#define LAYOUT_MAGMA_HIDEOUT_1F 336 -#define LAYOUT_MAGMA_HIDEOUT_2F_1R 337 -#define LAYOUT_MAGMA_HIDEOUT_2F_2R 338 -#define LAYOUT_MAGMA_HIDEOUT_3F_1R 339 -#define LAYOUT_MAGMA_HIDEOUT_3F_2R 340 -#define LAYOUT_MAGMA_HIDEOUT_4F 341 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_PALACE_LOBBY 342 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_PALACE_CORRIDOR 343 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM 344 -#define LAYOUT_BATTLE_FRONTIER_OUTSIDE_EAST 345 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_FACTORY_LOBBY 346 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_FACTORY_PRE_BATTLE_ROOM 347 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM 348 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_LOBBY 349 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_CORRIDOR 350 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_THREE_PATH_ROOM 351 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_NORMAL 352 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_FINAL 353 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_ARENA_LOBBY 354 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_ARENA_CORRIDOR 355 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_ARENA_BATTLE_ROOM 356 -#define LAYOUT_SOOTOPOLIS_CITY_LEGENDS_BATTLE 357 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_WILD_MONS 358 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_UNUSED 359 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY 360 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_FLOOR 361 -#define LAYOUT_BATTLE_PYRAMID_SQUARE01 362 -#define LAYOUT_BATTLE_PYRAMID_SQUARE02 363 -#define LAYOUT_BATTLE_PYRAMID_SQUARE03 364 -#define LAYOUT_BATTLE_PYRAMID_SQUARE04 365 -#define LAYOUT_BATTLE_PYRAMID_SQUARE05 366 -#define LAYOUT_BATTLE_PYRAMID_SQUARE06 367 -#define LAYOUT_BATTLE_PYRAMID_SQUARE07 368 -#define LAYOUT_BATTLE_PYRAMID_SQUARE08 369 -#define LAYOUT_BATTLE_PYRAMID_SQUARE09 370 -#define LAYOUT_BATTLE_PYRAMID_SQUARE10 371 -#define LAYOUT_BATTLE_PYRAMID_SQUARE11 372 -#define LAYOUT_BATTLE_PYRAMID_SQUARE12 373 -#define LAYOUT_BATTLE_PYRAMID_SQUARE13 374 -#define LAYOUT_BATTLE_PYRAMID_SQUARE14 375 -#define LAYOUT_BATTLE_PYRAMID_SQUARE15 376 -#define LAYOUT_BATTLE_PYRAMID_SQUARE16 377 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP 378 -#define LAYOUT_MAGMA_HIDEOUT_3F_3R 379 -#define LAYOUT_MAGMA_HIDEOUT_2F_3R 380 -#define LAYOUT_MIRAGE_TOWER_1F 381 -#define LAYOUT_MIRAGE_TOWER_2F 382 -#define LAYOUT_MIRAGE_TOWER_3F 383 -#define LAYOUT_BATTLE_TENT_LOBBY 384 -#define LAYOUT_BATTLE_TENT_CORRIDOR 385 -#define LAYOUT_BATTLE_TENT_BATTLE_ROOM 386 -#define LAYOUT_VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM 387 -#define LAYOUT_MIRAGE_TOWER_4F 388 -#define LAYOUT_DESERT_UNDERPASS 389 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_PARTNER_ROOM 390 -#define LAYOUT_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR 391 -#define LAYOUT_ROUTE111_NO_MIRAGE_TOWER 392 -#define LAYOUT_UNION_ROOM 393 -#define LAYOUT_SAFARI_ZONE_NORTHEAST 394 -#define LAYOUT_SAFARI_ZONE_SOUTHEAST 395 -#define LAYOUT_BATTLE_FRONTIER_RANKING_HALL 396 -#define LAYOUT_BATTLE_FRONTIER_LOUNGE1 397 -#define LAYOUT_BATTLE_FRONTIER_EXCHANGE_SERVICE_CORNER 398 -#define LAYOUT_BATTLE_FRONTIER_RECEPTION_GATE 399 -#define LAYOUT_ARTISAN_CAVE_B1F 400 -#define LAYOUT_ARTISAN_CAVE_1F 401 -#define LAYOUT_FARAWAY_ISLAND_ENTRANCE 402 -#define LAYOUT_FARAWAY_ISLAND_INTERIOR 403 -#define LAYOUT_BIRTH_ISLAND_EXTERIOR 404 -#define LAYOUT_ISLAND_HARBOR 405 -#define LAYOUT_UNDERWATER_MARINE_CAVE 406 -#define LAYOUT_MARINE_CAVE_ENTRANCE 407 -#define LAYOUT_TERRA_CAVE_ENTRANCE 408 -#define LAYOUT_TERRA_CAVE_END 409 -#define LAYOUT_UNDERWATER_ROUTE105 410 -#define LAYOUT_UNDERWATER_ROUTE125 411 -#define LAYOUT_UNDERWATER_ROUTE129 412 -#define LAYOUT_MARINE_CAVE_END 413 -#define LAYOUT_TRAINER_HILL_ENTRANCE 414 -#define LAYOUT_TRAINER_HILL_1F 415 -#define LAYOUT_TRAINER_HILL_2F 416 -#define LAYOUT_TRAINER_HILL_3F 417 -#define LAYOUT_TRAINER_HILL_4F 418 -#define LAYOUT_TRAINER_HILL_ROOF 419 -#define LAYOUT_ALTERING_CAVE 420 -#define LAYOUT_NAVEL_ROCK_EXTERIOR 421 -#define LAYOUT_NAVEL_ROCK_ENTRANCE 422 -#define LAYOUT_NAVEL_ROCK_TOP 423 -#define LAYOUT_NAVEL_ROCK_BOTTOM 424 -#define LAYOUT_NAVEL_ROCK_LADDER_ROOM1 425 -#define LAYOUT_NAVEL_ROCK_LADDER_ROOM2 426 -#define LAYOUT_NAVEL_ROCK_B1F 427 -#define LAYOUT_NAVEL_ROCK_FORK 428 -#define LAYOUT_BATTLE_FRONTIER_LOUNGE2 429 -#define LAYOUT_BATTLE_FRONTIER_SCOTTS_HOUSE 430 -#define LAYOUT_METEOR_FALLS_STEVENS_CAVE 431 -#define LAYOUT_LITTLEROOT_TOWN_PROFESSOR_BIRCHS_LAB_WITH_TABLE 432 -#define LAYOUT_SKY_PILLAR_1F_CLEAN 433 -#define LAYOUT_SKY_PILLAR_2F_CLEAN 434 -#define LAYOUT_SKY_PILLAR_3F_CLEAN 435 -#define LAYOUT_SKY_PILLAR_4F_CLEAN 436 -#define LAYOUT_SKY_PILLAR_5F_CLEAN 437 -#define LAYOUT_SKY_PILLAR_TOP_CLEAN 438 -#define LAYOUT_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_1F 439 -#define LAYOUT_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_B1F 440 -#define LAYOUT_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_1F_STAIRS_UNBLOCKED 441 - -#endif // GUARD_CONSTANTS_LAYOUTS_H diff --git a/include/constants/map_groups.h b/include/constants/map_groups.h deleted file mode 100755 index eaf40a525d..0000000000 --- a/include/constants/map_groups.h +++ /dev/null @@ -1,596 +0,0 @@ -#ifndef GUARD_CONSTANTS_MAP_GROUPS_H -#define GUARD_CONSTANTS_MAP_GROUPS_H - -// -// DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json -// - -// gMapGroup_TownsAndRoutes -#define MAP_PETALBURG_CITY (0 | (0 << 8)) -#define MAP_SLATEPORT_CITY (1 | (0 << 8)) -#define MAP_MAUVILLE_CITY (2 | (0 << 8)) -#define MAP_RUSTBORO_CITY (3 | (0 << 8)) -#define MAP_FORTREE_CITY (4 | (0 << 8)) -#define MAP_LILYCOVE_CITY (5 | (0 << 8)) -#define MAP_MOSSDEEP_CITY (6 | (0 << 8)) -#define MAP_SOOTOPOLIS_CITY (7 | (0 << 8)) -#define MAP_EVER_GRANDE_CITY (8 | (0 << 8)) -#define MAP_LITTLEROOT_TOWN (9 | (0 << 8)) -#define MAP_OLDALE_TOWN (10 | (0 << 8)) -#define MAP_DEWFORD_TOWN (11 | (0 << 8)) -#define MAP_LAVARIDGE_TOWN (12 | (0 << 8)) -#define MAP_FALLARBOR_TOWN (13 | (0 << 8)) -#define MAP_VERDANTURF_TOWN (14 | (0 << 8)) -#define MAP_PACIFIDLOG_TOWN (15 | (0 << 8)) -#define MAP_ROUTE101 (16 | (0 << 8)) -#define MAP_ROUTE102 (17 | (0 << 8)) -#define MAP_ROUTE103 (18 | (0 << 8)) -#define MAP_ROUTE104 (19 | (0 << 8)) -#define MAP_ROUTE105 (20 | (0 << 8)) -#define MAP_ROUTE106 (21 | (0 << 8)) -#define MAP_ROUTE107 (22 | (0 << 8)) -#define MAP_ROUTE108 (23 | (0 << 8)) -#define MAP_ROUTE109 (24 | (0 << 8)) -#define MAP_ROUTE110 (25 | (0 << 8)) -#define MAP_ROUTE111 (26 | (0 << 8)) -#define MAP_ROUTE112 (27 | (0 << 8)) -#define MAP_ROUTE113 (28 | (0 << 8)) -#define MAP_ROUTE114 (29 | (0 << 8)) -#define MAP_ROUTE115 (30 | (0 << 8)) -#define MAP_ROUTE116 (31 | (0 << 8)) -#define MAP_ROUTE117 (32 | (0 << 8)) -#define MAP_ROUTE118 (33 | (0 << 8)) -#define MAP_ROUTE119 (34 | (0 << 8)) -#define MAP_ROUTE120 (35 | (0 << 8)) -#define MAP_ROUTE121 (36 | (0 << 8)) -#define MAP_ROUTE122 (37 | (0 << 8)) -#define MAP_ROUTE123 (38 | (0 << 8)) -#define MAP_ROUTE124 (39 | (0 << 8)) -#define MAP_ROUTE125 (40 | (0 << 8)) -#define MAP_ROUTE126 (41 | (0 << 8)) -#define MAP_ROUTE127 (42 | (0 << 8)) -#define MAP_ROUTE128 (43 | (0 << 8)) -#define MAP_ROUTE129 (44 | (0 << 8)) -#define MAP_ROUTE130 (45 | (0 << 8)) -#define MAP_ROUTE131 (46 | (0 << 8)) -#define MAP_ROUTE132 (47 | (0 << 8)) -#define MAP_ROUTE133 (48 | (0 << 8)) -#define MAP_ROUTE134 (49 | (0 << 8)) -#define MAP_UNDERWATER_ROUTE124 (50 | (0 << 8)) -#define MAP_UNDERWATER_ROUTE126 (51 | (0 << 8)) -#define MAP_UNDERWATER_ROUTE127 (52 | (0 << 8)) -#define MAP_UNDERWATER_ROUTE128 (53 | (0 << 8)) -#define MAP_UNDERWATER_ROUTE129 (54 | (0 << 8)) -#define MAP_UNDERWATER_ROUTE105 (55 | (0 << 8)) -#define MAP_UNDERWATER_ROUTE125 (56 | (0 << 8)) - -// gMapGroup_IndoorLittleroot -#define MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F (0 | (1 << 8)) -#define MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F (1 | (1 << 8)) -#define MAP_LITTLEROOT_TOWN_MAYS_HOUSE_1F (2 | (1 << 8)) -#define MAP_LITTLEROOT_TOWN_MAYS_HOUSE_2F (3 | (1 << 8)) -#define MAP_LITTLEROOT_TOWN_PROFESSOR_BIRCHS_LAB (4 | (1 << 8)) - -// gMapGroup_IndoorOldale -#define MAP_OLDALE_TOWN_HOUSE1 (0 | (2 << 8)) -#define MAP_OLDALE_TOWN_HOUSE2 (1 | (2 << 8)) -#define MAP_OLDALE_TOWN_POKEMON_CENTER_1F (2 | (2 << 8)) -#define MAP_OLDALE_TOWN_POKEMON_CENTER_2F (3 | (2 << 8)) -#define MAP_OLDALE_TOWN_MART (4 | (2 << 8)) - -// gMapGroup_IndoorDewford -#define MAP_DEWFORD_TOWN_HOUSE1 (0 | (3 << 8)) -#define MAP_DEWFORD_TOWN_POKEMON_CENTER_1F (1 | (3 << 8)) -#define MAP_DEWFORD_TOWN_POKEMON_CENTER_2F (2 | (3 << 8)) -#define MAP_DEWFORD_TOWN_GYM (3 | (3 << 8)) -#define MAP_DEWFORD_TOWN_HALL (4 | (3 << 8)) -#define MAP_DEWFORD_TOWN_HOUSE2 (5 | (3 << 8)) - -// gMapGroup_IndoorLavaridge -#define MAP_LAVARIDGE_TOWN_HERB_SHOP (0 | (4 << 8)) -#define MAP_LAVARIDGE_TOWN_GYM_1F (1 | (4 << 8)) -#define MAP_LAVARIDGE_TOWN_GYM_B1F (2 | (4 << 8)) -#define MAP_LAVARIDGE_TOWN_HOUSE (3 | (4 << 8)) -#define MAP_LAVARIDGE_TOWN_MART (4 | (4 << 8)) -#define MAP_LAVARIDGE_TOWN_POKEMON_CENTER_1F (5 | (4 << 8)) -#define MAP_LAVARIDGE_TOWN_POKEMON_CENTER_2F (6 | (4 << 8)) - -// gMapGroup_IndoorFallarbor -#define MAP_FALLARBOR_TOWN_MART (0 | (5 << 8)) -#define MAP_FALLARBOR_TOWN_BATTLE_TENT_LOBBY (1 | (5 << 8)) -#define MAP_FALLARBOR_TOWN_BATTLE_TENT_CORRIDOR (2 | (5 << 8)) -#define MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM (3 | (5 << 8)) -#define MAP_FALLARBOR_TOWN_POKEMON_CENTER_1F (4 | (5 << 8)) -#define MAP_FALLARBOR_TOWN_POKEMON_CENTER_2F (5 | (5 << 8)) -#define MAP_FALLARBOR_TOWN_COZMOS_HOUSE (6 | (5 << 8)) -#define MAP_FALLARBOR_TOWN_MOVE_RELEARNERS_HOUSE (7 | (5 << 8)) - -// gMapGroup_IndoorVerdanturf -#define MAP_VERDANTURF_TOWN_BATTLE_TENT_LOBBY (0 | (6 << 8)) -#define MAP_VERDANTURF_TOWN_BATTLE_TENT_CORRIDOR (1 | (6 << 8)) -#define MAP_VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM (2 | (6 << 8)) -#define MAP_VERDANTURF_TOWN_MART (3 | (6 << 8)) -#define MAP_VERDANTURF_TOWN_POKEMON_CENTER_1F (4 | (6 << 8)) -#define MAP_VERDANTURF_TOWN_POKEMON_CENTER_2F (5 | (6 << 8)) -#define MAP_VERDANTURF_TOWN_WANDAS_HOUSE (6 | (6 << 8)) -#define MAP_VERDANTURF_TOWN_FRIENDSHIP_RATERS_HOUSE (7 | (6 << 8)) -#define MAP_VERDANTURF_TOWN_HOUSE (8 | (6 << 8)) - -// gMapGroup_IndoorPacifidlog -#define MAP_PACIFIDLOG_TOWN_POKEMON_CENTER_1F (0 | (7 << 8)) -#define MAP_PACIFIDLOG_TOWN_POKEMON_CENTER_2F (1 | (7 << 8)) -#define MAP_PACIFIDLOG_TOWN_HOUSE1 (2 | (7 << 8)) -#define MAP_PACIFIDLOG_TOWN_HOUSE2 (3 | (7 << 8)) -#define MAP_PACIFIDLOG_TOWN_HOUSE3 (4 | (7 << 8)) -#define MAP_PACIFIDLOG_TOWN_HOUSE4 (5 | (7 << 8)) -#define MAP_PACIFIDLOG_TOWN_HOUSE5 (6 | (7 << 8)) - -// gMapGroup_IndoorPetalburg -#define MAP_PETALBURG_CITY_WALLYS_HOUSE (0 | (8 << 8)) -#define MAP_PETALBURG_CITY_GYM (1 | (8 << 8)) -#define MAP_PETALBURG_CITY_HOUSE1 (2 | (8 << 8)) -#define MAP_PETALBURG_CITY_HOUSE2 (3 | (8 << 8)) -#define MAP_PETALBURG_CITY_POKEMON_CENTER_1F (4 | (8 << 8)) -#define MAP_PETALBURG_CITY_POKEMON_CENTER_2F (5 | (8 << 8)) -#define MAP_PETALBURG_CITY_MART (6 | (8 << 8)) - -// gMapGroup_IndoorSlateport -#define MAP_SLATEPORT_CITY_STERNS_SHIPYARD_1F (0 | (9 << 8)) -#define MAP_SLATEPORT_CITY_STERNS_SHIPYARD_2F (1 | (9 << 8)) -#define MAP_SLATEPORT_CITY_BATTLE_TENT_LOBBY (2 | (9 << 8)) -#define MAP_SLATEPORT_CITY_BATTLE_TENT_CORRIDOR (3 | (9 << 8)) -#define MAP_SLATEPORT_CITY_BATTLE_TENT_BATTLE_ROOM (4 | (9 << 8)) -#define MAP_SLATEPORT_CITY_NAME_RATERS_HOUSE (5 | (9 << 8)) -#define MAP_SLATEPORT_CITY_POKEMON_FAN_CLUB (6 | (9 << 8)) -#define MAP_SLATEPORT_CITY_OCEANIC_MUSEUM_1F (7 | (9 << 8)) -#define MAP_SLATEPORT_CITY_OCEANIC_MUSEUM_2F (8 | (9 << 8)) -#define MAP_SLATEPORT_CITY_HARBOR (9 | (9 << 8)) -#define MAP_SLATEPORT_CITY_HOUSE (10 | (9 << 8)) -#define MAP_SLATEPORT_CITY_POKEMON_CENTER_1F (11 | (9 << 8)) -#define MAP_SLATEPORT_CITY_POKEMON_CENTER_2F (12 | (9 << 8)) -#define MAP_SLATEPORT_CITY_MART (13 | (9 << 8)) - -// gMapGroup_IndoorMauville -#define MAP_MAUVILLE_CITY_GYM (0 | (10 << 8)) -#define MAP_MAUVILLE_CITY_BIKE_SHOP (1 | (10 << 8)) -#define MAP_MAUVILLE_CITY_HOUSE1 (2 | (10 << 8)) -#define MAP_MAUVILLE_CITY_GAME_CORNER (3 | (10 << 8)) -#define MAP_MAUVILLE_CITY_HOUSE2 (4 | (10 << 8)) -#define MAP_MAUVILLE_CITY_POKEMON_CENTER_1F (5 | (10 << 8)) -#define MAP_MAUVILLE_CITY_POKEMON_CENTER_2F (6 | (10 << 8)) -#define MAP_MAUVILLE_CITY_MART (7 | (10 << 8)) - -// gMapGroup_IndoorRustboro -#define MAP_RUSTBORO_CITY_DEVON_CORP_1F (0 | (11 << 8)) -#define MAP_RUSTBORO_CITY_DEVON_CORP_2F (1 | (11 << 8)) -#define MAP_RUSTBORO_CITY_DEVON_CORP_3F (2 | (11 << 8)) -#define MAP_RUSTBORO_CITY_GYM (3 | (11 << 8)) -#define MAP_RUSTBORO_CITY_POKEMON_SCHOOL (4 | (11 << 8)) -#define MAP_RUSTBORO_CITY_POKEMON_CENTER_1F (5 | (11 << 8)) -#define MAP_RUSTBORO_CITY_POKEMON_CENTER_2F (6 | (11 << 8)) -#define MAP_RUSTBORO_CITY_MART (7 | (11 << 8)) -#define MAP_RUSTBORO_CITY_FLAT1_1F (8 | (11 << 8)) -#define MAP_RUSTBORO_CITY_FLAT1_2F (9 | (11 << 8)) -#define MAP_RUSTBORO_CITY_HOUSE1 (10 | (11 << 8)) -#define MAP_RUSTBORO_CITY_CUTTERS_HOUSE (11 | (11 << 8)) -#define MAP_RUSTBORO_CITY_HOUSE2 (12 | (11 << 8)) -#define MAP_RUSTBORO_CITY_FLAT2_1F (13 | (11 << 8)) -#define MAP_RUSTBORO_CITY_FLAT2_2F (14 | (11 << 8)) -#define MAP_RUSTBORO_CITY_FLAT2_3F (15 | (11 << 8)) -#define MAP_RUSTBORO_CITY_HOUSE3 (16 | (11 << 8)) - -// gMapGroup_IndoorFortree -#define MAP_FORTREE_CITY_HOUSE1 (0 | (12 << 8)) -#define MAP_FORTREE_CITY_GYM (1 | (12 << 8)) -#define MAP_FORTREE_CITY_POKEMON_CENTER_1F (2 | (12 << 8)) -#define MAP_FORTREE_CITY_POKEMON_CENTER_2F (3 | (12 << 8)) -#define MAP_FORTREE_CITY_MART (4 | (12 << 8)) -#define MAP_FORTREE_CITY_HOUSE2 (5 | (12 << 8)) -#define MAP_FORTREE_CITY_HOUSE3 (6 | (12 << 8)) -#define MAP_FORTREE_CITY_HOUSE4 (7 | (12 << 8)) -#define MAP_FORTREE_CITY_HOUSE5 (8 | (12 << 8)) -#define MAP_FORTREE_CITY_DECORATION_SHOP (9 | (12 << 8)) - -// gMapGroup_IndoorLilycove -#define MAP_LILYCOVE_CITY_COVE_LILY_MOTEL_1F (0 | (13 << 8)) -#define MAP_LILYCOVE_CITY_COVE_LILY_MOTEL_2F (1 | (13 << 8)) -#define MAP_LILYCOVE_CITY_LILYCOVE_MUSEUM_1F (2 | (13 << 8)) -#define MAP_LILYCOVE_CITY_LILYCOVE_MUSEUM_2F (3 | (13 << 8)) -#define MAP_LILYCOVE_CITY_CONTEST_LOBBY (4 | (13 << 8)) -#define MAP_LILYCOVE_CITY_CONTEST_HALL (5 | (13 << 8)) -#define MAP_LILYCOVE_CITY_POKEMON_CENTER_1F (6 | (13 << 8)) -#define MAP_LILYCOVE_CITY_POKEMON_CENTER_2F (7 | (13 << 8)) -#define MAP_LILYCOVE_CITY_UNUSED_MART (8 | (13 << 8)) -#define MAP_LILYCOVE_CITY_POKEMON_TRAINER_FAN_CLUB (9 | (13 << 8)) -#define MAP_LILYCOVE_CITY_HARBOR (10 | (13 << 8)) -#define MAP_LILYCOVE_CITY_MOVE_DELETERS_HOUSE (11 | (13 << 8)) -#define MAP_LILYCOVE_CITY_HOUSE1 (12 | (13 << 8)) -#define MAP_LILYCOVE_CITY_HOUSE2 (13 | (13 << 8)) -#define MAP_LILYCOVE_CITY_HOUSE3 (14 | (13 << 8)) -#define MAP_LILYCOVE_CITY_HOUSE4 (15 | (13 << 8)) -#define MAP_LILYCOVE_CITY_DEPARTMENT_STORE_1F (16 | (13 << 8)) -#define MAP_LILYCOVE_CITY_DEPARTMENT_STORE_2F (17 | (13 << 8)) -#define MAP_LILYCOVE_CITY_DEPARTMENT_STORE_3F (18 | (13 << 8)) -#define MAP_LILYCOVE_CITY_DEPARTMENT_STORE_4F (19 | (13 << 8)) -#define MAP_LILYCOVE_CITY_DEPARTMENT_STORE_5F (20 | (13 << 8)) -#define MAP_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP (21 | (13 << 8)) -#define MAP_LILYCOVE_CITY_DEPARTMENT_STORE_ELEVATOR (22 | (13 << 8)) - -// gMapGroup_IndoorMossdeep -#define MAP_MOSSDEEP_CITY_GYM (0 | (14 << 8)) -#define MAP_MOSSDEEP_CITY_HOUSE1 (1 | (14 << 8)) -#define MAP_MOSSDEEP_CITY_HOUSE2 (2 | (14 << 8)) -#define MAP_MOSSDEEP_CITY_POKEMON_CENTER_1F (3 | (14 << 8)) -#define MAP_MOSSDEEP_CITY_POKEMON_CENTER_2F (4 | (14 << 8)) -#define MAP_MOSSDEEP_CITY_MART (5 | (14 << 8)) -#define MAP_MOSSDEEP_CITY_HOUSE3 (6 | (14 << 8)) -#define MAP_MOSSDEEP_CITY_STEVENS_HOUSE (7 | (14 << 8)) -#define MAP_MOSSDEEP_CITY_HOUSE4 (8 | (14 << 8)) -#define MAP_MOSSDEEP_CITY_SPACE_CENTER_1F (9 | (14 << 8)) -#define MAP_MOSSDEEP_CITY_SPACE_CENTER_2F (10 | (14 << 8)) -#define MAP_MOSSDEEP_CITY_GAME_CORNER_1F (11 | (14 << 8)) -#define MAP_MOSSDEEP_CITY_GAME_CORNER_B1F (12 | (14 << 8)) - -// gMapGroup_IndoorSootopolis -#define MAP_SOOTOPOLIS_CITY_GYM_1F (0 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_GYM_B1F (1 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_POKEMON_CENTER_1F (2 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_POKEMON_CENTER_2F (3 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_MART (4 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_HOUSE1 (5 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_HOUSE2 (6 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_HOUSE3 (7 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_HOUSE4 (8 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_HOUSE5 (9 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_HOUSE6 (10 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_HOUSE7 (11 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_LOTAD_AND_SEEDOT_HOUSE (12 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_1F (13 | (15 << 8)) -#define MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_B1F (14 | (15 << 8)) - -// gMapGroup_IndoorEverGrande -#define MAP_EVER_GRANDE_CITY_SIDNEYS_ROOM (0 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_PHOEBES_ROOM (1 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_GLACIAS_ROOM (2 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_DRAKES_ROOM (3 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_CHAMPIONS_ROOM (4 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_HALL1 (5 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_HALL2 (6 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_HALL3 (7 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_HALL4 (8 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_HALL5 (9 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_POKEMON_LEAGUE_1F (10 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_HALL_OF_FAME (11 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_POKEMON_CENTER_1F (12 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_POKEMON_CENTER_2F (13 | (16 << 8)) -#define MAP_EVER_GRANDE_CITY_POKEMON_LEAGUE_2F (14 | (16 << 8)) - -// gMapGroup_IndoorRoute104 -#define MAP_ROUTE104_MR_BRINEYS_HOUSE (0 | (17 << 8)) -#define MAP_ROUTE104_PRETTY_PETAL_FLOWER_SHOP (1 | (17 << 8)) - -// gMapGroup_IndoorRoute111 -#define MAP_ROUTE111_WINSTRATE_FAMILYS_HOUSE (0 | (18 << 8)) -#define MAP_ROUTE111_OLD_LADYS_REST_STOP (1 | (18 << 8)) - -// gMapGroup_IndoorRoute112 -#define MAP_ROUTE112_CABLE_CAR_STATION (0 | (19 << 8)) -#define MAP_MT_CHIMNEY_CABLE_CAR_STATION (1 | (19 << 8)) - -// gMapGroup_IndoorRoute114 -#define MAP_ROUTE114_FOSSIL_MANIACS_HOUSE (0 | (20 << 8)) -#define MAP_ROUTE114_FOSSIL_MANIACS_TUNNEL (1 | (20 << 8)) -#define MAP_ROUTE114_LANETTES_HOUSE (2 | (20 << 8)) - -// gMapGroup_IndoorRoute116 -#define MAP_ROUTE116_TUNNELERS_REST_HOUSE (0 | (21 << 8)) - -// gMapGroup_IndoorRoute117 -#define MAP_ROUTE117_POKEMON_DAY_CARE (0 | (22 << 8)) - -// gMapGroup_IndoorRoute121 -#define MAP_ROUTE121_SAFARI_ZONE_ENTRANCE (0 | (23 << 8)) - -// gMapGroup_Dungeons -#define MAP_METEOR_FALLS_1F_1R (0 | (24 << 8)) -#define MAP_METEOR_FALLS_1F_2R (1 | (24 << 8)) -#define MAP_METEOR_FALLS_B1F_1R (2 | (24 << 8)) -#define MAP_METEOR_FALLS_B1F_2R (3 | (24 << 8)) -#define MAP_RUSTURF_TUNNEL (4 | (24 << 8)) -#define MAP_UNDERWATER_SOOTOPOLIS_CITY (5 | (24 << 8)) -#define MAP_DESERT_RUINS (6 | (24 << 8)) -#define MAP_GRANITE_CAVE_1F (7 | (24 << 8)) -#define MAP_GRANITE_CAVE_B1F (8 | (24 << 8)) -#define MAP_GRANITE_CAVE_B2F (9 | (24 << 8)) -#define MAP_GRANITE_CAVE_STEVENS_ROOM (10 | (24 << 8)) -#define MAP_PETALBURG_WOODS (11 | (24 << 8)) -#define MAP_MT_CHIMNEY (12 | (24 << 8)) -#define MAP_JAGGED_PASS (13 | (24 << 8)) -#define MAP_FIERY_PATH (14 | (24 << 8)) -#define MAP_MT_PYRE_1F (15 | (24 << 8)) -#define MAP_MT_PYRE_2F (16 | (24 << 8)) -#define MAP_MT_PYRE_3F (17 | (24 << 8)) -#define MAP_MT_PYRE_4F (18 | (24 << 8)) -#define MAP_MT_PYRE_5F (19 | (24 << 8)) -#define MAP_MT_PYRE_6F (20 | (24 << 8)) -#define MAP_MT_PYRE_EXTERIOR (21 | (24 << 8)) -#define MAP_MT_PYRE_SUMMIT (22 | (24 << 8)) -#define MAP_AQUA_HIDEOUT_1F (23 | (24 << 8)) -#define MAP_AQUA_HIDEOUT_B1F (24 | (24 << 8)) -#define MAP_AQUA_HIDEOUT_B2F (25 | (24 << 8)) -#define MAP_UNDERWATER_SEAFLOOR_CAVERN (26 | (24 << 8)) -#define MAP_SEAFLOOR_CAVERN_ENTRANCE (27 | (24 << 8)) -#define MAP_SEAFLOOR_CAVERN_ROOM1 (28 | (24 << 8)) -#define MAP_SEAFLOOR_CAVERN_ROOM2 (29 | (24 << 8)) -#define MAP_SEAFLOOR_CAVERN_ROOM3 (30 | (24 << 8)) -#define MAP_SEAFLOOR_CAVERN_ROOM4 (31 | (24 << 8)) -#define MAP_SEAFLOOR_CAVERN_ROOM5 (32 | (24 << 8)) -#define MAP_SEAFLOOR_CAVERN_ROOM6 (33 | (24 << 8)) -#define MAP_SEAFLOOR_CAVERN_ROOM7 (34 | (24 << 8)) -#define MAP_SEAFLOOR_CAVERN_ROOM8 (35 | (24 << 8)) -#define MAP_SEAFLOOR_CAVERN_ROOM9 (36 | (24 << 8)) -#define MAP_CAVE_OF_ORIGIN_ENTRANCE (37 | (24 << 8)) -#define MAP_CAVE_OF_ORIGIN_1F (38 | (24 << 8)) -#define MAP_CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP1 (39 | (24 << 8)) -#define MAP_CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP2 (40 | (24 << 8)) -#define MAP_CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP3 (41 | (24 << 8)) -#define MAP_CAVE_OF_ORIGIN_B1F (42 | (24 << 8)) -#define MAP_VICTORY_ROAD_1F (43 | (24 << 8)) -#define MAP_VICTORY_ROAD_B1F (44 | (24 << 8)) -#define MAP_VICTORY_ROAD_B2F (45 | (24 << 8)) -#define MAP_SHOAL_CAVE_LOW_TIDE_ENTRANCE_ROOM (46 | (24 << 8)) -#define MAP_SHOAL_CAVE_LOW_TIDE_INNER_ROOM (47 | (24 << 8)) -#define MAP_SHOAL_CAVE_LOW_TIDE_STAIRS_ROOM (48 | (24 << 8)) -#define MAP_SHOAL_CAVE_LOW_TIDE_LOWER_ROOM (49 | (24 << 8)) -#define MAP_SHOAL_CAVE_HIGH_TIDE_ENTRANCE_ROOM (50 | (24 << 8)) -#define MAP_SHOAL_CAVE_HIGH_TIDE_INNER_ROOM (51 | (24 << 8)) -#define MAP_NEW_MAUVILLE_ENTRANCE (52 | (24 << 8)) -#define MAP_NEW_MAUVILLE_INSIDE (53 | (24 << 8)) -#define MAP_ABANDONED_SHIP_DECK (54 | (24 << 8)) -#define MAP_ABANDONED_SHIP_CORRIDORS_1F (55 | (24 << 8)) -#define MAP_ABANDONED_SHIP_ROOMS_1F (56 | (24 << 8)) -#define MAP_ABANDONED_SHIP_CORRIDORS_B1F (57 | (24 << 8)) -#define MAP_ABANDONED_SHIP_ROOMS_B1F (58 | (24 << 8)) -#define MAP_ABANDONED_SHIP_ROOMS2_B1F (59 | (24 << 8)) -#define MAP_ABANDONED_SHIP_UNDERWATER1 (60 | (24 << 8)) -#define MAP_ABANDONED_SHIP_ROOM_B1F (61 | (24 << 8)) -#define MAP_ABANDONED_SHIP_ROOMS2_1F (62 | (24 << 8)) -#define MAP_ABANDONED_SHIP_CAPTAINS_OFFICE (63 | (24 << 8)) -#define MAP_ABANDONED_SHIP_UNDERWATER2 (64 | (24 << 8)) -#define MAP_ABANDONED_SHIP_HIDDEN_FLOOR_CORRIDORS (65 | (24 << 8)) -#define MAP_ABANDONED_SHIP_HIDDEN_FLOOR_ROOMS (66 | (24 << 8)) -#define MAP_ISLAND_CAVE (67 | (24 << 8)) -#define MAP_ANCIENT_TOMB (68 | (24 << 8)) -#define MAP_UNDERWATER_ROUTE134 (69 | (24 << 8)) -#define MAP_UNDERWATER_SEALED_CHAMBER (70 | (24 << 8)) -#define MAP_SEALED_CHAMBER_OUTER_ROOM (71 | (24 << 8)) -#define MAP_SEALED_CHAMBER_INNER_ROOM (72 | (24 << 8)) -#define MAP_SCORCHED_SLAB (73 | (24 << 8)) -#define MAP_AQUA_HIDEOUT_UNUSED_RUBY_MAP1 (74 | (24 << 8)) -#define MAP_AQUA_HIDEOUT_UNUSED_RUBY_MAP2 (75 | (24 << 8)) -#define MAP_AQUA_HIDEOUT_UNUSED_RUBY_MAP3 (76 | (24 << 8)) -#define MAP_SKY_PILLAR_ENTRANCE (77 | (24 << 8)) -#define MAP_SKY_PILLAR_OUTSIDE (78 | (24 << 8)) -#define MAP_SKY_PILLAR_1F (79 | (24 << 8)) -#define MAP_SKY_PILLAR_2F (80 | (24 << 8)) -#define MAP_SKY_PILLAR_3F (81 | (24 << 8)) -#define MAP_SKY_PILLAR_4F (82 | (24 << 8)) -#define MAP_SHOAL_CAVE_LOW_TIDE_ICE_ROOM (83 | (24 << 8)) -#define MAP_SKY_PILLAR_5F (84 | (24 << 8)) -#define MAP_SKY_PILLAR_TOP (85 | (24 << 8)) -#define MAP_MAGMA_HIDEOUT_1F (86 | (24 << 8)) -#define MAP_MAGMA_HIDEOUT_2F_1R (87 | (24 << 8)) -#define MAP_MAGMA_HIDEOUT_2F_2R (88 | (24 << 8)) -#define MAP_MAGMA_HIDEOUT_3F_1R (89 | (24 << 8)) -#define MAP_MAGMA_HIDEOUT_3F_2R (90 | (24 << 8)) -#define MAP_MAGMA_HIDEOUT_4F (91 | (24 << 8)) -#define MAP_MAGMA_HIDEOUT_3F_3R (92 | (24 << 8)) -#define MAP_MAGMA_HIDEOUT_2F_3R (93 | (24 << 8)) -#define MAP_MIRAGE_TOWER_1F (94 | (24 << 8)) -#define MAP_MIRAGE_TOWER_2F (95 | (24 << 8)) -#define MAP_MIRAGE_TOWER_3F (96 | (24 << 8)) -#define MAP_MIRAGE_TOWER_4F (97 | (24 << 8)) -#define MAP_DESERT_UNDERPASS (98 | (24 << 8)) -#define MAP_ARTISAN_CAVE_B1F (99 | (24 << 8)) -#define MAP_ARTISAN_CAVE_1F (100 | (24 << 8)) -#define MAP_UNDERWATER_MARINE_CAVE (101 | (24 << 8)) -#define MAP_MARINE_CAVE_ENTRANCE (102 | (24 << 8)) -#define MAP_MARINE_CAVE_END (103 | (24 << 8)) -#define MAP_TERRA_CAVE_ENTRANCE (104 | (24 << 8)) -#define MAP_TERRA_CAVE_END (105 | (24 << 8)) -#define MAP_ALTERING_CAVE (106 | (24 << 8)) -#define MAP_METEOR_FALLS_STEVENS_CAVE (107 | (24 << 8)) - -// gMapGroup_IndoorDynamic -#define MAP_SECRET_BASE_RED_CAVE1 (0 | (25 << 8)) -#define MAP_SECRET_BASE_BROWN_CAVE1 (1 | (25 << 8)) -#define MAP_SECRET_BASE_BLUE_CAVE1 (2 | (25 << 8)) -#define MAP_SECRET_BASE_YELLOW_CAVE1 (3 | (25 << 8)) -#define MAP_SECRET_BASE_TREE1 (4 | (25 << 8)) -#define MAP_SECRET_BASE_SHRUB1 (5 | (25 << 8)) -#define MAP_SECRET_BASE_RED_CAVE2 (6 | (25 << 8)) -#define MAP_SECRET_BASE_BROWN_CAVE2 (7 | (25 << 8)) -#define MAP_SECRET_BASE_BLUE_CAVE2 (8 | (25 << 8)) -#define MAP_SECRET_BASE_YELLOW_CAVE2 (9 | (25 << 8)) -#define MAP_SECRET_BASE_TREE2 (10 | (25 << 8)) -#define MAP_SECRET_BASE_SHRUB2 (11 | (25 << 8)) -#define MAP_SECRET_BASE_RED_CAVE3 (12 | (25 << 8)) -#define MAP_SECRET_BASE_BROWN_CAVE3 (13 | (25 << 8)) -#define MAP_SECRET_BASE_BLUE_CAVE3 (14 | (25 << 8)) -#define MAP_SECRET_BASE_YELLOW_CAVE3 (15 | (25 << 8)) -#define MAP_SECRET_BASE_TREE3 (16 | (25 << 8)) -#define MAP_SECRET_BASE_SHRUB3 (17 | (25 << 8)) -#define MAP_SECRET_BASE_RED_CAVE4 (18 | (25 << 8)) -#define MAP_SECRET_BASE_BROWN_CAVE4 (19 | (25 << 8)) -#define MAP_SECRET_BASE_BLUE_CAVE4 (20 | (25 << 8)) -#define MAP_SECRET_BASE_YELLOW_CAVE4 (21 | (25 << 8)) -#define MAP_SECRET_BASE_TREE4 (22 | (25 << 8)) -#define MAP_SECRET_BASE_SHRUB4 (23 | (25 << 8)) -#define MAP_BATTLE_COLOSSEUM_2P (24 | (25 << 8)) -#define MAP_TRADE_CENTER (25 | (25 << 8)) -#define MAP_RECORD_CORNER (26 | (25 << 8)) -#define MAP_BATTLE_COLOSSEUM_4P (27 | (25 << 8)) -#define MAP_CONTEST_HALL (28 | (25 << 8)) -#define MAP_UNUSED_CONTEST_HALL1 (29 | (25 << 8)) -#define MAP_UNUSED_CONTEST_HALL2 (30 | (25 << 8)) -#define MAP_UNUSED_CONTEST_HALL3 (31 | (25 << 8)) -#define MAP_UNUSED_CONTEST_HALL4 (32 | (25 << 8)) -#define MAP_UNUSED_CONTEST_HALL5 (33 | (25 << 8)) -#define MAP_UNUSED_CONTEST_HALL6 (34 | (25 << 8)) -#define MAP_CONTEST_HALL_BEAUTY (35 | (25 << 8)) -#define MAP_CONTEST_HALL_TOUGH (36 | (25 << 8)) -#define MAP_CONTEST_HALL_COOL (37 | (25 << 8)) -#define MAP_CONTEST_HALL_SMART (38 | (25 << 8)) -#define MAP_CONTEST_HALL_CUTE (39 | (25 << 8)) -#define MAP_INSIDE_OF_TRUCK (40 | (25 << 8)) -#define MAP_SS_TIDAL_CORRIDOR (41 | (25 << 8)) -#define MAP_SS_TIDAL_LOWER_DECK (42 | (25 << 8)) -#define MAP_SS_TIDAL_ROOMS (43 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE01 (44 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE02 (45 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE03 (46 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE04 (47 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE05 (48 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE06 (49 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE07 (50 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE08 (51 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE09 (52 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE10 (53 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE11 (54 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE12 (55 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE13 (56 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE14 (57 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE15 (58 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE16 (59 | (25 << 8)) -#define MAP_UNION_ROOM (60 | (25 << 8)) - -// gMapGroup_SpecialArea -#define MAP_SAFARI_ZONE_NORTHWEST (0 | (26 << 8)) -#define MAP_SAFARI_ZONE_NORTH (1 | (26 << 8)) -#define MAP_SAFARI_ZONE_SOUTHWEST (2 | (26 << 8)) -#define MAP_SAFARI_ZONE_SOUTH (3 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_OUTSIDE_WEST (4 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_TOWER_LOBBY (5 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_TOWER_ELEVATOR (6 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_TOWER_CORRIDOR (7 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM (8 | (26 << 8)) -#define MAP_SOUTHERN_ISLAND_EXTERIOR (9 | (26 << 8)) -#define MAP_SOUTHERN_ISLAND_INTERIOR (10 | (26 << 8)) -#define MAP_SAFARI_ZONE_REST_HOUSE (11 | (26 << 8)) -#define MAP_SAFARI_ZONE_NORTHEAST (12 | (26 << 8)) -#define MAP_SAFARI_ZONE_SOUTHEAST (13 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_OUTSIDE_EAST (14 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_PARTNER_ROOM (15 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_CORRIDOR (16 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM (17 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_DOME_LOBBY (18 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_DOME_CORRIDOR (19 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_DOME_PRE_BATTLE_ROOM (20 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_DOME_BATTLE_ROOM (21 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_PALACE_LOBBY (22 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_PALACE_CORRIDOR (23 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM (24 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY (25 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_FLOOR (26 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP (27 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_ARENA_LOBBY (28 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_ARENA_CORRIDOR (29 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_ARENA_BATTLE_ROOM (30 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_FACTORY_LOBBY (31 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_FACTORY_PRE_BATTLE_ROOM (32 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM (33 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_PIKE_LOBBY (34 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_PIKE_CORRIDOR (35 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_PIKE_THREE_PATH_ROOM (36 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_NORMAL (37 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_FINAL (38 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_WILD_MONS (39 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_RANKING_HALL (40 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_LOUNGE1 (41 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_EXCHANGE_SERVICE_CORNER (42 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_LOUNGE2 (43 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_LOUNGE3 (44 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_LOUNGE4 (45 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_SCOTTS_HOUSE (46 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_LOUNGE5 (47 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_LOUNGE6 (48 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_LOUNGE7 (49 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_RECEPTION_GATE (50 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_LOUNGE8 (51 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_LOUNGE9 (52 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_POKEMON_CENTER_1F (53 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_POKEMON_CENTER_2F (54 | (26 << 8)) -#define MAP_BATTLE_FRONTIER_MART (55 | (26 << 8)) -#define MAP_FARAWAY_ISLAND_ENTRANCE (56 | (26 << 8)) -#define MAP_FARAWAY_ISLAND_INTERIOR (57 | (26 << 8)) -#define MAP_BIRTH_ISLAND_EXTERIOR (58 | (26 << 8)) -#define MAP_BIRTH_ISLAND_HARBOR (59 | (26 << 8)) -#define MAP_TRAINER_HILL_ENTRANCE (60 | (26 << 8)) -#define MAP_TRAINER_HILL_1F (61 | (26 << 8)) -#define MAP_TRAINER_HILL_2F (62 | (26 << 8)) -#define MAP_TRAINER_HILL_3F (63 | (26 << 8)) -#define MAP_TRAINER_HILL_4F (64 | (26 << 8)) -#define MAP_TRAINER_HILL_ROOF (65 | (26 << 8)) -#define MAP_NAVEL_ROCK_EXTERIOR (66 | (26 << 8)) -#define MAP_NAVEL_ROCK_HARBOR (67 | (26 << 8)) -#define MAP_NAVEL_ROCK_ENTRANCE (68 | (26 << 8)) -#define MAP_NAVEL_ROCK_B1F (69 | (26 << 8)) -#define MAP_NAVEL_ROCK_FORK (70 | (26 << 8)) -#define MAP_NAVEL_ROCK_UP1 (71 | (26 << 8)) -#define MAP_NAVEL_ROCK_UP2 (72 | (26 << 8)) -#define MAP_NAVEL_ROCK_UP3 (73 | (26 << 8)) -#define MAP_NAVEL_ROCK_UP4 (74 | (26 << 8)) -#define MAP_NAVEL_ROCK_TOP (75 | (26 << 8)) -#define MAP_NAVEL_ROCK_DOWN01 (76 | (26 << 8)) -#define MAP_NAVEL_ROCK_DOWN02 (77 | (26 << 8)) -#define MAP_NAVEL_ROCK_DOWN03 (78 | (26 << 8)) -#define MAP_NAVEL_ROCK_DOWN04 (79 | (26 << 8)) -#define MAP_NAVEL_ROCK_DOWN05 (80 | (26 << 8)) -#define MAP_NAVEL_ROCK_DOWN06 (81 | (26 << 8)) -#define MAP_NAVEL_ROCK_DOWN07 (82 | (26 << 8)) -#define MAP_NAVEL_ROCK_DOWN08 (83 | (26 << 8)) -#define MAP_NAVEL_ROCK_DOWN09 (84 | (26 << 8)) -#define MAP_NAVEL_ROCK_DOWN10 (85 | (26 << 8)) -#define MAP_NAVEL_ROCK_DOWN11 (86 | (26 << 8)) -#define MAP_NAVEL_ROCK_BOTTOM (87 | (26 << 8)) -#define MAP_TRAINER_HILL_ELEVATOR (88 | (26 << 8)) - -// gMapGroup_IndoorRoute104Prototype -#define MAP_ROUTE104_PROTOTYPE (0 | (27 << 8)) -#define MAP_ROUTE104_PROTOTYPE_PRETTY_PETAL_FLOWER_SHOP (1 | (27 << 8)) - -// gMapGroup_IndoorRoute109 -#define MAP_ROUTE109_SEASHORE_HOUSE (0 | (28 << 8)) - -// gMapGroup_IndoorRoute110 -#define MAP_ROUTE110_TRICK_HOUSE_ENTRANCE (0 | (29 << 8)) -#define MAP_ROUTE110_TRICK_HOUSE_END (1 | (29 << 8)) -#define MAP_ROUTE110_TRICK_HOUSE_CORRIDOR (2 | (29 << 8)) -#define MAP_ROUTE110_TRICK_HOUSE_PUZZLE1 (3 | (29 << 8)) -#define MAP_ROUTE110_TRICK_HOUSE_PUZZLE2 (4 | (29 << 8)) -#define MAP_ROUTE110_TRICK_HOUSE_PUZZLE3 (5 | (29 << 8)) -#define MAP_ROUTE110_TRICK_HOUSE_PUZZLE4 (6 | (29 << 8)) -#define MAP_ROUTE110_TRICK_HOUSE_PUZZLE5 (7 | (29 << 8)) -#define MAP_ROUTE110_TRICK_HOUSE_PUZZLE6 (8 | (29 << 8)) -#define MAP_ROUTE110_TRICK_HOUSE_PUZZLE7 (9 | (29 << 8)) -#define MAP_ROUTE110_TRICK_HOUSE_PUZZLE8 (10 | (29 << 8)) -#define MAP_ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE (11 | (29 << 8)) -#define MAP_ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE (12 | (29 << 8)) - -// gMapGroup_IndoorRoute113 -#define MAP_ROUTE113_GLASS_WORKSHOP (0 | (30 << 8)) - -// gMapGroup_IndoorRoute123 -#define MAP_ROUTE123_BERRY_MASTERS_HOUSE (0 | (31 << 8)) - -// gMapGroup_IndoorRoute119 -#define MAP_ROUTE119_WEATHER_INSTITUTE_1F (0 | (32 << 8)) -#define MAP_ROUTE119_WEATHER_INSTITUTE_2F (1 | (32 << 8)) -#define MAP_ROUTE119_HOUSE (2 | (32 << 8)) - -// gMapGroup_IndoorRoute124 -#define MAP_ROUTE124_DIVING_TREASURE_HUNTERS_HOUSE (0 | (33 << 8)) - -#define MAP_GROUPS_COUNT 34 - -#endif // GUARD_CONSTANTS_MAP_GROUPS_H diff --git a/make_tools.mk b/make_tools.mk index 7e0baf8900..7adf510319 100644 --- a/make_tools.mk +++ b/make_tools.mk @@ -1,12 +1,20 @@ +# This controls building executables in the `tools` folder. +# Can be invoked through the `Makefile` or standalone. MAKEFLAGS += --no-print-directory # Inclusive list. If you don't want a tool to be built, don't add it here. -TOOLDIRS := tools/aif2pcm tools/bin2c tools/gbafix tools/gbagfx tools/jsonproc tools/mapjson tools/mid2agb tools/preproc tools/ramscrgen tools/rsfont tools/scaninc +TOOLS_DIR := tools +TOOL_NAMES := aif2pcm bin2c gbafix gbagfx jsonproc mapjson mid2agb preproc ramscrgen rsfont scaninc -.PHONY: all $(TOOLDIRS) +TOOLDIRS := $(TOOL_NAMES:%=$(TOOLS_DIR)/%) -all: $(TOOLDIRS) +.PHONY: tools check-tools clean-tools $(TOOLDIRS) + +tools: $(TOOLDIRS) $(TOOLDIRS): @$(MAKE) -C $@ + +clean-tools: + @$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);) diff --git a/map_data_rules.mk b/map_data_rules.mk index d3f47a352e..ed7c08edea 100755 --- a/map_data_rules.mk +++ b/map_data_rules.mk @@ -1,8 +1,17 @@ # Map JSON data +# Inputs MAPS_DIR = $(DATA_ASM_SUBDIR)/maps LAYOUTS_DIR = $(DATA_ASM_SUBDIR)/layouts +# Outputs +MAPS_OUTDIR := $(MAPS_DIR) +LAYOUTS_OUTDIR := $(LAYOUTS_DIR) +INCLUDECONSTS_OUTDIR := include/constants + +AUTO_GEN_TARGETS += $(INCLUDECONSTS_OUTDIR)/map_groups.h +AUTO_GEN_TARGETS += $(INCLUDECONSTS_OUTDIR)/layouts.h + MAP_DIRS := $(dir $(wildcard $(MAPS_DIR)/*/map.json)) MAP_CONNECTIONS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/connections.inc,$(MAP_DIRS)) MAP_EVENTS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/events.inc,$(MAP_DIRS)) @@ -13,19 +22,12 @@ $(DATA_ASM_BUILDDIR)/maps.o: $(DATA_ASM_SUBDIR)/maps.s $(LAYOUTS_DIR)/layouts.in $(DATA_ASM_BUILDDIR)/map_events.o: $(DATA_ASM_SUBDIR)/map_events.s $(MAPS_DIR)/events.inc $(MAP_EVENTS) $(PREPROC) $< charmap.txt | $(CPP) -I include - | $(PREPROC) -ie $< charmap.txt | $(AS) $(ASFLAGS) -o $@ -$(MAPS_DIR)/%/header.inc: $(MAPS_DIR)/%/map.json - $(MAPJSON) map emerald $< $(LAYOUTS_DIR)/layouts.json -$(MAPS_DIR)/%/events.inc: $(MAPS_DIR)/%/header.inc ; -$(MAPS_DIR)/%/connections.inc: $(MAPS_DIR)/%/events.inc ; -$(MAPS_DIR)/groups.inc: $(MAPS_DIR)/map_groups.json - $(MAPJSON) groups emerald $< -$(MAPS_DIR)/connections.inc: $(MAPS_DIR)/groups.inc ; -$(MAPS_DIR)/events.inc: $(MAPS_DIR)/connections.inc ; -$(MAPS_DIR)/headers.inc: $(MAPS_DIR)/events.inc ; -include/constants/map_groups.h: $(MAPS_DIR)/headers.inc ; +$(MAPS_OUTDIR)/%/header.inc $(MAPS_OUTDIR)/%/events.inc $(MAPS_OUTDIR)/%/connections.inc: $(MAPS_DIR)/%/map.json + $(MAPJSON) map emerald $< $(LAYOUTS_DIR)/layouts.json $(@D) -$(LAYOUTS_DIR)/layouts.inc: $(LAYOUTS_DIR)/layouts.json - $(MAPJSON) layouts emerald $< -$(LAYOUTS_DIR)/layouts_table.inc: $(LAYOUTS_DIR)/layouts.inc ; -include/constants/layouts.h: $(LAYOUTS_DIR)/layouts_table.inc ; +$(MAPS_OUTDIR)/connections.inc $(MAPS_OUTDIR)/groups.inc $(MAPS_OUTDIR)/events.inc $(MAPS_OUTDIR)/headers.inc $(INCLUDECONSTS_OUTDIR)/map_groups.h: $(MAPS_DIR)/map_groups.json + $(MAPJSON) groups emerald $< $(MAPS_OUTDIR) $(INCLUDECONSTS_OUTDIR) + +$(LAYOUTS_OUTDIR)/layouts.inc $(LAYOUTS_OUTDIR)/layouts_table.inc $(INCLUDECONSTS_OUTDIR)/layouts.h: $(LAYOUTS_DIR)/layouts.json + $(MAPJSON) layouts emerald $< $(LAYOUTS_OUTDIR) $(INCLUDECONSTS_OUTDIR) diff --git a/tools/jsonproc/jsonproc.cpp b/tools/jsonproc/jsonproc.cpp index 9ef23cd43e..03e51b765a 100755 --- a/tools/jsonproc/jsonproc.cpp +++ b/tools/jsonproc/jsonproc.cpp @@ -1,4 +1,6 @@ // jsonproc.cpp +// jsonproc converts JSON data to an output file based on an Inja template. +// https://github.com/pantor/inja #include "jsonproc.h" diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index e53ac7924d..1a10c9dab8 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -30,6 +30,8 @@ using json11::Json; #include "mapjson.h" string version; +// System directory separator +string sep; string read_text_file(string filepath) { ifstream in_file(filepath); @@ -330,13 +332,22 @@ string generate_map_events_text(Json map_data) { return text.str(); } -string get_directory_name(string filename) { - size_t dir_pos = filename.find_last_of("/\\"); +string strip_trailing_separator(string filename) { + if(filename.back() == '/' || filename.back() == '\\') + filename.pop_back(); + return filename; +} +void infer_separator(string filename) { + size_t dir_pos = filename.find_last_of("/\\"); + sep = filename[dir_pos]; +} +string file_parent(string filename){ + size_t dir_pos = filename.find_last_of("/\\"); return filename.substr(0, dir_pos + 1); } -void process_map(string map_filepath, string layouts_filepath) { +void process_map(string map_filepath, string layouts_filepath, string output_dir) { string mapdata_err, layouts_err; string mapdata_json_text = read_text_file(map_filepath); @@ -354,10 +365,10 @@ void process_map(string map_filepath, string layouts_filepath) { string events_text = generate_map_events_text(map_data); string connections_text = generate_map_connections_text(map_data); - string files_dir = get_directory_name(map_filepath); - write_text_file(files_dir + "header.inc", header_text); - write_text_file(files_dir + "events.inc", events_text); - write_text_file(files_dir + "connections.inc", connections_text); + string out_dir = strip_trailing_separator(output_dir).append(sep); + write_text_file(out_dir + "header.inc", header_text); + write_text_file(out_dir + "events.inc", events_text); + write_text_file(out_dir + "connections.inc", connections_text); } string generate_groups_text(Json groups_data) { @@ -382,7 +393,7 @@ string generate_groups_text(Json groups_data) { return text.str(); } -string generate_connections_text(Json groups_data) { +string generate_connections_text(Json groups_data, string include_path) { vector map_names; for (auto &group : groups_data["group_order"].array_items()) @@ -407,12 +418,12 @@ string generate_connections_text(Json groups_data) { text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n@\n\n"; for (Json map_name : map_names) - text << "\t.include \"data/maps/" << json_to_string(map_name) << "/connections.inc\"\n"; + text << "\t.include \"" << include_path << "/" << json_to_string(map_name) << "/connections.inc\"\n"; return text.str(); } -string generate_headers_text(Json groups_data) { +string generate_headers_text(Json groups_data, string include_path) { vector map_names; for (auto &group : groups_data["group_order"].array_items()) @@ -424,12 +435,12 @@ string generate_headers_text(Json groups_data) { text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n@\n\n"; for (string map_name : map_names) - text << "\t.include \"data/maps/" << map_name << "/header.inc\"\n"; + text << "\t.include \"" << include_path << "/" << map_name << "/header.inc\"\n"; return text.str(); } -string generate_events_text(Json groups_data) { +string generate_events_text(Json groups_data, string include_path) { vector map_names; for (auto &group : groups_data["group_order"].array_items()) @@ -438,17 +449,16 @@ string generate_events_text(Json groups_data) { ostringstream text; - 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 " << include_path << "/map_groups.json\n@\n\n"; for (string map_name : map_names) - text << "\t.include \"data/maps/" << map_name << "/events.inc\"\n"; + text << "\t.include \"" << include_path << "/" << map_name << "/events.inc\"\n"; return text.str(); } string generate_map_constants_text(string groups_filepath, Json groups_data) { - string file_dir = get_directory_name(groups_filepath); - char dir_separator = file_dir.back(); + string file_dir = file_parent(groups_filepath) + sep; ostringstream text; @@ -466,7 +476,7 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { size_t max_length = 0; for (auto &map_name : groups_data[groupName].array_items()) { - string map_filepath = file_dir + json_to_string(map_name) + dir_separator + "map.json"; + string map_filepath = file_dir + json_to_string(map_name) + sep + "map.json"; string err_str; Json map_data = Json::parse(read_text_file(map_filepath), err_str); if (map_data == Json()) @@ -493,7 +503,11 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { return text.str(); } -void process_groups(string groups_filepath) { +// Output paths are directories with trailing path separators +void process_groups(string groups_filepath, string output_asm, string output_c) { + output_asm = strip_trailing_separator(output_asm); // Remove separator if existing. + output_c = strip_trailing_separator(output_c); + string err; Json groups_data = Json::parse(read_text_file(groups_filepath), err); @@ -501,19 +515,16 @@ void process_groups(string groups_filepath) { FATAL_ERROR("%s\n", err.c_str()); string groups_text = generate_groups_text(groups_data); - string connections_text = generate_connections_text(groups_data); - string headers_text = generate_headers_text(groups_data); - string events_text = generate_events_text(groups_data); + string connections_text = generate_connections_text(groups_data, output_asm); + string headers_text = generate_headers_text(groups_data, output_asm); + string events_text = generate_events_text(groups_data, output_asm); string map_header_text = generate_map_constants_text(groups_filepath, groups_data); - string file_dir = get_directory_name(groups_filepath); - char s = file_dir.back(); - - write_text_file(file_dir + "groups.inc", groups_text); - write_text_file(file_dir + "connections.inc", connections_text); - write_text_file(file_dir + "headers.inc", headers_text); - write_text_file(file_dir + "events.inc", events_text); - write_text_file(file_dir + ".." + s + ".." + s + "include" + s + "constants" + s + "map_groups.h", map_header_text); + write_text_file(output_asm + sep + "groups.inc", groups_text); + write_text_file(output_asm + sep + "connections.inc", connections_text); + write_text_file(output_asm + sep + "headers.inc", headers_text); + write_text_file(output_asm + sep + "events.inc", events_text); + write_text_file(output_c + sep + "map_groups.h", map_header_text); } string generate_layout_headers_text(Json layouts_data) { @@ -586,7 +597,10 @@ string generate_layouts_constants_text(Json layouts_data) { return text.str(); } -void process_layouts(string layouts_filepath) { +void process_layouts(string layouts_filepath, string output_asm, string output_c) { + output_asm = strip_trailing_separator(output_asm).append(sep); + output_c = strip_trailing_separator(output_c).append(sep); + string err; Json layouts_data = Json::parse(read_text_file(layouts_filepath), err); @@ -597,12 +611,9 @@ void process_layouts(string layouts_filepath) { string layouts_table_text = generate_layouts_table_text(layouts_data); string layouts_constants_text = generate_layouts_constants_text(layouts_data); - string file_dir = get_directory_name(layouts_filepath); - char s = file_dir.back(); - - write_text_file(file_dir + "layouts.inc", layout_headers_text); - write_text_file(file_dir + "layouts_table.inc", layouts_table_text); - write_text_file(file_dir + ".." + s + ".." + s + "include" + s + "constants" + s + "layouts.h", layouts_constants_text); + write_text_file(output_asm + "layouts.inc", layout_headers_text); + write_text_file(output_asm + "layouts_table.inc", layouts_table_text); + write_text_file(output_c + "layouts.h", layouts_constants_text); } int main(int argc, char *argv[]) { @@ -620,29 +631,40 @@ int main(int argc, char *argv[]) { FATAL_ERROR("ERROR: must be 'layouts', 'map', or 'groups'.\n"); if (mode == "map") { - if (argc != 5) - FATAL_ERROR("USAGE: mapjson map \n"); + if (argc != 6) + FATAL_ERROR("USAGE: mapjson map \n"); + infer_separator(argv[3]); string filepath(argv[3]); string layouts_filepath(argv[4]); + string output_dir(argv[5]); - process_map(filepath, layouts_filepath); + process_map(filepath, layouts_filepath, output_dir); } else if (mode == "groups") { - if (argc != 4) - FATAL_ERROR("USAGE: mapjson groups \n"); + if (argc != 6) + FATAL_ERROR("USAGE: mapjson groups \n"); + infer_separator(argv[3]); string filepath(argv[3]); + string output_asm(argv[4]); + string output_c(argv[5]); - process_groups(filepath); + process_groups(filepath, output_asm, output_c); } else if (mode == "layouts") { - if (argc != 4) - FATAL_ERROR("USAGE: mapjson layouts \n"); + if (argc != 6) + FATAL_ERROR("USAGE: mapjson layouts \n"); + infer_separator(argv[3]); string filepath(argv[3]); + string output_asm(argv[4]); + string output_c(argv[5]); - process_layouts(filepath); + process_layouts(filepath, output_asm, output_c); + } + else { + FATAL_ERROR("ERROR: must be 'layouts', 'map', or 'groups'.\n"); } return 0;