From 7fa9819d9a91ea6641b966d13b5135d6a40074c9 Mon Sep 17 00:00:00 2001 From: Icedude907 <34080011+Icedude907@users.noreply.github.com> Date: Sat, 11 Nov 2023 22:51:04 +1300 Subject: [PATCH 01/48] Makefile uses make_tools, mapjson takes out dir. Removed generated files (layouts.h, map_groups.h) from git. --- Makefile | 55 ++- include/constants/.gitignore | 3 + include/constants/layouts.h | 450 ------------------------- include/constants/map_groups.h | 596 --------------------------------- make_tools.mk | 18 +- map_data_rules.mk | 34 +- tools/jsonproc/jsonproc.cpp | 2 + tools/mapjson/mapjson.cpp | 122 ++++--- 8 files changed, 133 insertions(+), 1147 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 5c073b36ca18..7d92bad21c01 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 @@ -121,24 +124,21 @@ endif LDFLAGS = -Map ../../$(MAP) +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 @@ -151,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)))) @@ -161,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 @@ -211,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 @@ -232,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 @@ -265,6 +254,8 @@ include spritesheet_rules.mk include json_data_rules.mk include songs.mk +generated: $(AUTO_GEN_TARGETS) + %.s: ; %.png: ; %.pal: ; @@ -282,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 @@ -291,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 @@ -322,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) $$< charmap.txt -i | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ - @@ -349,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) $$< charmap.txt -i | $$(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 000000000000..761af9db7625 --- /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 db92c9594264..000000000000 --- 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 eaf40a525d00..000000000000 --- 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 7e0baf89006e..00824adda6a3 100644 --- a/make_tools.mk +++ b/make_tools.mk @@ -1,12 +1,24 @@ +# 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) $(CHECKTOOLDIRS) + +tools: $(TOOLDIRS) +check-tools: $(CHECKTOOLDIRS) $(TOOLDIRS): @$(MAKE) -C $@ + +$(CHECKTOOLDIRS): + @$(MAKE) -C $@ + +clean-tools: + @$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);) diff --git a/map_data_rules.mk b/map_data_rules.mk index 626cd4724080..974a82f14a64 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 - | $(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 ; - -$(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)/%/header.inc $(MAPS_OUTDIR)/%/events.inc $(MAPS_OUTDIR)/%/connections.inc: $(MAPS_DIR)/%/map.json + $(MAPJSON) map emerald $< $(LAYOUTS_DIR)/layouts.json $(@D) + +$(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) \ No newline at end of file diff --git a/tools/jsonproc/jsonproc.cpp b/tools/jsonproc/jsonproc.cpp index 23056a5ff3c3..a43c5b7624c2 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 e53ac7924d0f..1632b56be62e 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,16 +365,16 @@ 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) { 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 /map_groups.json\n@\n\n"; for (auto &key : groups_data["group_order"].array_items()) { string group = json_to_string(key); @@ -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()) @@ -404,15 +415,15 @@ string generate_connections_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 /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()) @@ -421,15 +432,15 @@ string generate_headers_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 /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,24 +449,23 @@ 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; text << "#ifndef GUARD_CONSTANTS_MAP_GROUPS_H\n" << "#define GUARD_CONSTANTS_MAP_GROUPS_H\n\n"; - 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 /map_groups.json\n//\n\n"; int group_num = 0; @@ -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,25 +515,22 @@ 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) { ostringstream text; - text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/layouts/layouts.json\n@\n\n"; + text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from layouts.json\n@\n\n"; for (auto &layout : layouts_data["layouts"].array_items()) { if (layout == Json::object()) continue; @@ -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; From 2198ca31c7a5239176b92bc577408bc1e7715cd4 Mon Sep 17 00:00:00 2001 From: Icedude907 <34080011+Icedude907@users.noreply.github.com> Date: Sun, 12 Nov 2023 13:20:09 +1300 Subject: [PATCH 02/48] Reordered makefile. Added some documentation and simplified dependency scanning. --- Makefile | 343 ++++++++++++++++++++++++-------------------------- make_tools.mk | 4 +- 2 files changed, 170 insertions(+), 177 deletions(-) diff --git a/Makefile b/Makefile index 7d92bad21c01..1eb4b8b55a75 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,22 @@ -TOOLCHAIN := $(DEVKITARM) -COMPARE ?= 0 +# GBA rom header +TITLE := POKEMON EMER +GAME_CODE := BPEE +MAKER_CODE := 01 +REVISION := 0 +MODERN ?= 0 + +# `File name`.gba ('_modern' will be appended to the modern builds) +FILE_NAME := pokeemerald +BUILD_DIR := build +# Builds the ROM using a modern compiler +MODERN ?= 0 +# Compares the ROM to a checksum of the original - only makes sense using when non-modern +COMPARE ?= 0 + +ifeq (modern,$(MAKECMDGOALS)) + MODERN := 1 +endif ifeq (compare,$(MAKECMDGOALS)) COMPARE := 1 endif @@ -8,45 +24,29 @@ endif # Default make rule all: rom +# Toolchain selection +TOOLCHAIN := $(DEVKITARM) # don't use dkP's base_tools anymore # because the redefinition of $(CC) conflicts # with when we want to use $(CC) to preprocess files # thus, manually create the variables for the bin # files, or use arm-none-eabi binaries on the system # if dkP is not installed on this system - ifneq (,$(TOOLCHAIN)) -ifneq ($(wildcard $(TOOLCHAIN)/bin),) -export PATH := $(TOOLCHAIN)/bin:$(PATH) -endif + ifneq ($(wildcard $(TOOLCHAIN)/bin),) + export PATH := $(TOOLCHAIN)/bin:$(PATH) + endif endif PREFIX := arm-none-eabi- OBJCOPY := $(PREFIX)objcopy OBJDUMP := $(PREFIX)objdump AS := $(PREFIX)as - LD := $(PREFIX)ld -# note: the makefile must be set up so MODERNCC is never called -# if MODERN=0 -MODERNCC := $(PREFIX)gcc -PATH_MODERNCC := PATH="$(PATH)" $(MODERNCC) - -ifeq ($(OS),Windows_NT) -EXE := .exe -else EXE := -endif - -TITLE := POKEMON EMER -GAME_CODE := BPEE -MAKER_CODE := 01 -REVISION := 0 -MODERN ?= 0 - -ifeq (modern,$(MAKECMDGOALS)) - MODERN := 1 +ifeq ($(OS),Windows_NT) + EXE := .exe endif # use arm-none-eabi-cpp for macOS @@ -66,22 +66,29 @@ else CPP := $(PREFIX)cpp endif -ROM_NAME := pokeemerald.gba +ROM_NAME := $(FILE_NAME).gba +OBJ_DIR_NAME := $(BUILD_DIR)/emerald +MODERN_ROM_NAME := $(FILE_NAME)_modern.gba +MODERN_OBJ_DIR_NAME := $(BUILD_DIR)/modern + ELF_NAME := $(ROM_NAME:.gba=.elf) MAP_NAME := $(ROM_NAME:.gba=.map) -OBJ_DIR_NAME := build/emerald - -MODERN_ROM_NAME := pokeemerald_modern.gba MODERN_ELF_NAME := $(MODERN_ROM_NAME:.gba=.elf) MODERN_MAP_NAME := $(MODERN_ROM_NAME:.gba=.map) -MODERN_OBJ_DIR_NAME := build/modern - -SHELL := /bin/bash -o pipefail -ELF = $(ROM:.gba=.elf) -MAP = $(ROM:.gba=.map) -SYM = $(ROM:.gba=.sym) +# Pick our active variables +ifeq ($(MODERN),0) + ROM := $(ROM_NAME) + OBJ_DIR := $(OBJ_DIR_NAME) +else + ROM := $(MODERN_ROM_NAME) + OBJ_DIR := $(MODERN_OBJ_DIR_NAME) +endif +ELF := $(ROM:.gba=.elf) +MAP := $(ROM:.gba=.map) +SYM := $(ROM:.gba=.sym) +# Commonly used directories C_SUBDIR = src GFLIB_SUBDIR = gflib ASM_SUBDIR = asm @@ -99,34 +106,43 @@ DATA_ASM_BUILDDIR = $(OBJ_DIR)/$(DATA_ASM_SUBDIR) SONG_BUILDDIR = $(OBJ_DIR)/$(SONG_SUBDIR) MID_BUILDDIR = $(OBJ_DIR)/$(MID_SUBDIR) +SHELL := /bin/bash -o pipefail + +# Set flags for tools ASFLAGS := -mcpu=arm7tdmi --defsym MODERN=$(MODERN) +INCLUDE_DIRS := include +INCLUDE_CPP_ARGS := $(INCLUDE_DIRS:%=-iquote %) +INCLUDE_SCANINC_ARGS := $(INCLUDE_DIRS:%=-I %) + +O_LEVEL ?= 2 +CPPFLAGS := $(INCLUDE_CPP_ARGS) -iquote $(GFLIB_SUBDIR) -Wno-trigraphs -DMODERN=$(MODERN) ifeq ($(MODERN),0) -CC1 := tools/agbcc/bin/agbcc$(EXE) -override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex-asm -g -ROM := $(ROM_NAME) -OBJ_DIR := $(OBJ_DIR_NAME) -LIBPATH := -L ../../tools/agbcc/lib -LIB := $(LIBPATH) -lgcc -lc -L../../libagbsyscall -lagbsyscall + CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef + CC1 := tools/agbcc/bin/agbcc$(EXE) + override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O$(O_LEVEL) -fhex-asm -g + LIBPATH := -L ../../tools/agbcc/lib + LIB := $(LIBPATH) -lgcc -lc -L../../libagbsyscall -lagbsyscall else -CC1 = $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet -override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -ROM := $(MODERN_ROM_NAME) -OBJ_DIR := $(MODERN_OBJ_DIR_NAME) -LIBPATH := -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libc.a))" -LIB := $(LIBPATH) -lc -lnosys -lgcc -L../../libagbsyscall -lagbsyscall + # Note: The makefile must be set up to not call these if modern == 0 + MODERNCC := $(PREFIX)gcc + PATH_MODERNCC := PATH="$(PATH)" $(MODERNCC) + CC1 := $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet + override CFLAGS += -mthumb -mthumb-interwork -O$(O_LEVEL) -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast + LIBPATH := -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libc.a))" + LIB := $(LIBPATH) -lc -lnosys -lgcc -L../../libagbsyscall -lagbsyscall endif - -CPPFLAGS := -iquote include -iquote $(GFLIB_SUBDIR) -Wno-trigraphs -DMODERN=$(MODERN) -ifneq ($(MODERN),1) -CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef +# Enable debug info if set +ifeq ($(DINFO),1) + override CFLAGS += -g endif LDFLAGS = -Map ../../$(MAP) +# 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 +# Tool executables GFX := $(TOOLS_DIR)/gbagfx/gbagfx$(EXE) AIF := $(TOOLS_DIR)/aif2pcm/aif2pcm$(EXE) MID := $(TOOLS_DIR)/mid2agb/mid2agb$(EXE) @@ -138,6 +154,7 @@ MAPJSON := $(TOOLS_DIR)/mapjson/mapjson$(EXE) JSONPROC := $(TOOLS_DIR)/jsonproc/jsonproc$(EXE) PERL := perl +SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c MAKEFLAGS += --no-print-directory @@ -147,39 +164,36 @@ MAKEFLAGS += --no-print-directory .SECONDARY: # Delete files that weren't built properly .DELETE_ON_ERROR: - # Secondary expansion is required for dependency variables in object rules. .SECONDEXPANSION: -.PHONY: all rom clean compare tidy mostlyclean libagbsyscall modern tidymodern tidynonmodern +RULES_NO_SCAN += libagbsyscall clean clean-assets tidy tidymodern tidynonmodern generated clean-generated +.PHONY: all rom modern compare +.PHONY: $(RULES_NO_SCAN) infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) -# Build tools when building the rom -# Disable dependency scanning for clean/tidy/tools -# Use a separate minimal makefile for speed -# 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 +# Check if we need to scan dependencies based on the chosen rule OR user preference +NODEP ?= 0 +# Check if we need to pre-build tools and generate assets based on the chosen rule. +SETUP_PREREQS ?= 1 +# Disable dependency scanning for rules that don't need it. +ifneq (,$(MAKECMDGOALS)) + ifeq (,$(filter-out $(RULES_NO_SCAN),$(MAKECMDGOALS))) + NODEP := 1 + SETUP_PREREQS := 0 + endif endif -# check if we need to scan dependencies based on the rule -ifeq (,$(MAKECMDGOALS)) - SCAN_DEPS ?= 1 -else - # clean, tidy, tools, mostlyclean, clean-tools, $(TOOLDIRS), tidymodern, tidynonmodern don't even build the ROM - # libagbsyscall does its own thing - ifeq (,$(filter-out clean tidy tools mostlyclean clean-tools $(TOOLDIRS) tidymodern tidynonmodern libagbsyscall,$(MAKECMDGOALS))) - SCAN_DEPS ?= 0 - else - SCAN_DEPS ?= 1 - endif +ifeq ($(SETUP_PREREQS),1) + # If set on: Default target or a rule requiring a scan + # Forcibly execute `make tools` since we need them for what we are doing. + $(call infoshell, $(MAKE) -f make_tools.mk) + # Oh and also generate mapjson sources before we use `SCANINC`. + $(call infoshell, $(MAKE) generated) endif -ifeq ($(SCAN_DEPS),1) +# Collect sources C_SRCS_IN := $(wildcard $(C_SUBDIR)/*.c $(C_SUBDIR)/*/*.c $(C_SUBDIR)/*/*/*.c) C_SRCS := $(foreach src,$(C_SRCS_IN),$(if $(findstring .inc.c,$(src)),,$(src))) C_OBJS := $(patsubst $(C_SUBDIR)/%.c,$(C_BUILDDIR)/%.o,$(C_SRCS)) @@ -187,7 +201,7 @@ C_OBJS := $(patsubst $(C_SUBDIR)/%.c,$(C_BUILDDIR)/%.o,$(C_SRCS)) GFLIB_SRCS := $(wildcard $(GFLIB_SUBDIR)/*.c) GFLIB_OBJS := $(patsubst $(GFLIB_SUBDIR)/%.c,$(GFLIB_BUILDDIR)/%.o,$(GFLIB_SRCS)) -C_ASM_SRCS += $(wildcard $(C_SUBDIR)/*.s $(C_SUBDIR)/*/*.s $(C_SUBDIR)/*/*/*.s) +C_ASM_SRCS := $(wildcard $(C_SUBDIR)/*.s $(C_SUBDIR)/*/*.s $(C_SUBDIR)/*/*/*.s) C_ASM_OBJS := $(patsubst $(C_SUBDIR)/%.s,$(C_BUILDDIR)/%.o,$(C_ASM_SRCS)) ASM_SRCS := $(wildcard $(ASM_SUBDIR)/*.s) @@ -210,29 +224,29 @@ OBJS_REL := $(patsubst $(OBJ_DIR)/%,%,$(OBJS)) SUBDIRS := $(sort $(dir $(OBJS))) $(shell mkdir -p $(SUBDIRS)) -endif -syms: $(SYM) +# Pretend rules that are actually flags defer to `make all` +modern: all +compare: all +# Other rules rom: $(ROM) ifeq ($(COMPARE),1) @$(SHA1) rom.sha1 endif -# For contributors to make sure a change didn't affect the contents of the ROM. -compare: all +syms: $(SYM) -clean: mostlyclean clean-tools +clean: tidy clean-tools clean-generated clean-assets + @$(MAKE) clean -C libagbsyscall -mostlyclean: tidynonmodern tidymodern - find sound -iname '*.bin' -exec rm {} + +clean-assets: rm -f $(MID_SUBDIR)/*.s - find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + rm -f $(DATA_ASM_SUBDIR)/layouts/layouts.inc $(DATA_ASM_SUBDIR)/layouts/layouts_table.inc rm -f $(DATA_ASM_SUBDIR)/maps/connections.inc $(DATA_ASM_SUBDIR)/maps/events.inc $(DATA_ASM_SUBDIR)/maps/groups.inc $(DATA_ASM_SUBDIR)/maps/headers.inc + find sound -iname '*.bin' -exec rm {} + + find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + find $(DATA_ASM_SUBDIR)/maps \( -iname 'connections.inc' -o -iname 'events.inc' -o -iname 'header.inc' \) -exec rm {} + - rm -f $(AUTO_GEN_TARGETS) - @$(MAKE) clean -C libagbsyscall tidy: tidynonmodern tidymodern @@ -244,18 +258,13 @@ tidymodern: rm -f $(MODERN_ROM_NAME) $(MODERN_ELF_NAME) $(MODERN_MAP_NAME) rm -rf $(MODERN_OBJ_DIR_NAME) -ifneq ($(MODERN),0) -$(C_BUILDDIR)/berry_crush.o: override CFLAGS += -Wno-address-of-packed-member -endif - +# Other rules include graphics_file_rules.mk include map_data_rules.mk include spritesheet_rules.mk include json_data_rules.mk include songs.mk -generated: $(AUTO_GEN_TARGETS) - %.s: ; %.png: ; %.pal: ; @@ -271,119 +280,101 @@ generated: $(AUTO_GEN_TARGETS) $(CRY_SUBDIR)/%.bin: $(CRY_SUBDIR)/%.aif ; $(AIF) $< $@ --compress sound/%.bin: sound/%.aif ; $(AIF) $< $@ +# NOTE: Tools must have been built prior (FIXME) +generated: tools $(AUTO_GEN_TARGETS) +clean-generated: + -rm -f $(AUTO_GEN_TARGETS) ifeq ($(MODERN),0) -$(C_BUILDDIR)/libc.o: CC1 := $(TOOLS_DIR)/agbcc/bin/old_agbcc$(EXE) +$(C_BUILDDIR)/libc.o: CC1 := tools/agbcc/bin/old_agbcc$(EXE) $(C_BUILDDIR)/libc.o: CFLAGS := -O2 - $(C_BUILDDIR)/siirtc.o: CFLAGS := -mthumb-interwork - $(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_DIR)/agbcc/bin/old_agbcc$(EXE) - +$(C_BUILDDIR)/m4a.o: CC1 := tools/agbcc/bin/old_agbcc$(EXE) $(C_BUILDDIR)/record_mixing.o: CFLAGS += -ffreestanding -$(C_BUILDDIR)/librfu_intr.o: CC1 := $(TOOLS_DIR)/agbcc/bin/agbcc_arm$(EXE) +$(C_BUILDDIR)/librfu_intr.o: CC1 := tools/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 +$(C_BUILDDIR)/berry_crush.o: override CFLAGS += -Wno-address-of-packed-member endif -ifeq ($(DINFO),1) -override CFLAGS += -g -endif +# Dependency rules (for the *.c & *.s sources to .o files) +# Have to be explicit or else missing files won't be reported. -# The dep rules have to be explicit or else missing files won't be reported. # As a side effect, they're evaluated immediately instead of when the rule is invoked. -# It doesn't look like $(shell) can be deferred so there might not be a better way. +# It doesn't look like $(shell) can be deferred so there might not be a better way (Icedude_907: there is soon). -ifeq ($(SCAN_DEPS),1) -ifeq ($(NODEP),1) -$(C_BUILDDIR)/%.o: $(C_SUBDIR)/%.c -ifeq (,$(KEEP_TEMPS)) - @echo "$(CC1) -o $@ $<" - @$(CPP) $(CPPFLAGS) $< | $(PREPROC) $< charmap.txt -i | $(CC1) $(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $(AS) $(ASFLAGS) -o $@ - -else - @$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i - @$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(C_BUILDDIR)/$*.s - @echo -e ".text\n\t.align\t2, 0\n" >> $(C_BUILDDIR)/$*.s - $(AS) $(ASFLAGS) -o $@ $(C_BUILDDIR)/$*.s -endif -else +# For C dependencies. +# Args: $1 = Output file without extension (build/assets/src/data), $2 = Input file (src/data.c) define C_DEP -$1: $2 $$(shell $(SCANINC) -I include -I $(TOOLS_DIR)/agbcc/include -I gflib $2) -ifeq (,$$(KEEP_TEMPS)) - @echo "$$(CC1) -o $$@ $$<" - @$$(CPP) $$(CPPFLAGS) $$< | $$(PREPROC) $$< charmap.txt -i | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ - -else - @$$(CPP) $$(CPPFLAGS) $$< -o $$(C_BUILDDIR)/$3.i - @$$(PREPROC) $$(C_BUILDDIR)/$3.i charmap.txt | $$(CC1) $$(CFLAGS) -o $$(C_BUILDDIR)/$3.s - @echo -e ".text\n\t.align\t2, 0\n" >> $$(C_BUILDDIR)/$3.s - $$(AS) $$(ASFLAGS) -o $$@ $$(C_BUILDDIR)/$3.s -endif +$(call C_DEP_IMPL,$1,$2,$1) endef -$(foreach src, $(C_SRCS), $(eval $(call C_DEP,$(patsubst $(C_SUBDIR)/%.c,$(C_BUILDDIR)/%.o,$(src)),$(src),$(patsubst $(C_SUBDIR)/%.c,%,$(src))))) -endif - -ifeq ($(NODEP),1) -$(GFLIB_BUILDDIR)/%.o: $(GFLIB_SUBDIR)/%.c $$(c_dep) +# Internal implementation details. +# $1: Output file without extension, $2 input file, $3 temp path (if keeping) +define C_DEP_IMPL +$1.o: $2 ifeq (,$(KEEP_TEMPS)) - @echo "$(CC1) -o $@ $<" - @$(CPP) $(CPPFLAGS) $< | $(PREPROC) $< charmap.txt -i | $(CC1) $(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $(AS) $(ASFLAGS) -o $@ - -else - @$(CPP) $(CPPFLAGS) $< -o $(GFLIB_BUILDDIR)/$*.i - @$(PREPROC) $(GFLIB_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(GFLIB_BUILDDIR)/$*.s - @echo -e ".text\n\t.align\t2, 0\n" >> $(GFLIB_BUILDDIR)/$*.s - $(AS) $(ASFLAGS) -o $@ $(GFLIB_BUILDDIR)/$*.s -endif -else -define GFLIB_DEP -$1: $2 $$(shell $(SCANINC) -I include -I $(TOOLS_DIR)/agbcc/include -I gflib $2) -ifeq (,$$(KEEP_TEMPS)) @echo "$$(CC1) -o $$@ $$<" @$$(CPP) $$(CPPFLAGS) $$< | $$(PREPROC) $$< charmap.txt -i | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ - else - @$$(CPP) $$(CPPFLAGS) $$< -o $$(GFLIB_BUILDDIR)/$3.i - @$$(PREPROC) $$(GFLIB_BUILDDIR)/$3.i charmap.txt | $$(CC1) $$(CFLAGS) -o $$(GFLIB_BUILDDIR)/$3.s - @echo -e ".text\n\t.align\t2, 0\n" >> $$(GFLIB_BUILDDIR)/$3.s - $$(AS) $$(ASFLAGS) -o $$@ $$(GFLIB_BUILDDIR)/$3.s + @$$(CPP) $$(CPPFLAGS) $$< -o $3.i + @$$(PREPROC) $3.i charmap.txt | $$(CC1) $$(CFLAGS) -o $3.s + @echo -e ".text\n\t.align\t2, 0\n" >> $3.s + $$(AS) $$(ASFLAGS) -o $$@ $3.s endif +$(call C_SCANINC,$1,$2) endef -$(foreach src, $(GFLIB_SRCS), $(eval $(call GFLIB_DEP,$(patsubst $(GFLIB_SUBDIR)/%.c,$(GFLIB_BUILDDIR)/%.o, $(src)),$(src),$(patsubst $(GFLIB_SUBDIR)/%.c,%, $(src))))) +# Calls SCANINC to find dependencies +define C_SCANINC +ifneq ($(NODEP),1) +$1.o: $2 $$(shell $(SCANINC) $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include -I gflib $2) endif +endef +# Create generic rules if no dependency scanning, else create the real rules ifeq ($(NODEP),1) -$(C_BUILDDIR)/%.o: $(C_SUBDIR)/%.s - $(PREPROC) $< charmap.txt | $(CPP) -I include - | $(AS) $(ASFLAGS) -o $@ +$(eval $(call C_DEP,$(C_BUILDDIR)/%,$(C_SUBDIR)/%.c)) +$(eval $(call C_DEP,$(GFLIB_BUILDDIR)/%,$(GFLIB_SUBDIR)/%.c)) else -define SRC_ASM_DATA_DEP -$1: $2 $$(shell $(SCANINC) -I include -I "" $2) - $$(PREPROC) $$< charmap.txt | $$(CPP) -I include - | $$(AS) $$(ASFLAGS) -o $$@ -endef -$(foreach src, $(C_ASM_SRCS), $(eval $(call SRC_ASM_DATA_DEP,$(patsubst $(C_SUBDIR)/%.s,$(C_BUILDDIR)/%.o, $(src)),$(src)))) +$(foreach src,$(C_SRCS),$(eval $(call C_DEP,$(OBJ_DIR)/$(basename $(src)),$(src)))) +$(foreach src,$(GFLIB_SRCS),$(eval $(call C_DEP,$(OBJ_DIR)/$(basename $(src)),$(src)))) endif -ifeq ($(NODEP),1) -$(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s - $(AS) $(ASFLAGS) -o $@ $< -else +# Similar methodology for Assembly files +# $1: Output path without extension, $2: Input file (`*.s`) define ASM_DEP -$1: $2 $$(shell $(SCANINC) -I include -I "" $2) +$1.o: $2 $$(AS) $$(ASFLAGS) -o $$@ $$< +$(call ASM_SCANINC,$1,$2) +endef +# As above but first doing a preprocessor pass +define ASM_DEP_PREPROC +$1.o: $2 + $$(PREPROC) $$< charmap.txt | $$(CPP) $(INCLUDE_SCANINC_ARGS) - | $$(AS) $$(ASFLAGS) -o $$@ +$(call ASM_SCANINC,$1,$2) endef -$(foreach src, $(ASM_SRCS), $(eval $(call ASM_DEP,$(patsubst $(ASM_SUBDIR)/%.s,$(ASM_BUILDDIR)/%.o, $(src)),$(src)))) + +define ASM_SCANINC +ifneq ($(NODEP),1) +$1.o: $2 $$(shell $(SCANINC) $(INCLUDE_SCANINC_ARGS) -I "" $2) endif +endef +# Dummy rules or real rules ifeq ($(NODEP),1) -$(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s - $(PREPROC) $< charmap.txt | $(CPP) -I include - | $(AS) $(ASFLAGS) -o $@ +$(eval $(call ASM_DEP,$(ASM_BUILDDIR)/%,$(ASM_SUBDIR)/%.s)) +$(eval $(call ASM_DEP_PREPROC,$(C_BUILDDIR)/%,$(C_SUBDIR)/%.s)) +$(eval $(call ASM_DEP_PREPROC,$(DATA_ASM_BUILDDIR)/%,$(DATA_ASM_SUBDIR)/%.s)) else -$(foreach src, $(REGULAR_DATA_ASM_SRCS), $(eval $(call SRC_ASM_DATA_DEP,$(patsubst $(DATA_ASM_SUBDIR)/%.s,$(DATA_ASM_BUILDDIR)/%.o, $(src)),$(src)))) -endif +$(foreach src, $(ASM_SRCS), $(eval $(call ASM_DEP,$(src:%.s=$(OBJ_DIR)/%),$(src)))) +$(foreach src, $(C_ASM_SRCS), $(eval $(call ASM_DEP_PREPROC,$(src:%.s=$(OBJ_DIR)/%),$(src)))) +$(foreach src, $(REGULAR_DATA_ASM_SRCS), $(eval $(call ASM_DEP_PREPROC,$(src:%.s=$(OBJ_DIR)/%),$(src)))) endif +# Additional rules $(SONG_BUILDDIR)/%.o: $(SONG_SUBDIR)/%.s $(AS) $(ASFLAGS) -I sound -o $@ $< @@ -396,6 +387,7 @@ $(OBJ_DIR)/sym_common.ld: sym_common.txt $(C_OBJS) $(wildcard common_syms/*.txt) $(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt $(RAMSCRGEN) ewram_data $< ENGLISH > $@ +# Linker script ifeq ($(MODERN),0) LD_SCRIPT := ld_script.txt LD_SCRIPT_DEPS := $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld @@ -405,25 +397,24 @@ LD_SCRIPT_DEPS := endif $(OBJ_DIR)/ld_script.ld: $(LD_SCRIPT) $(LD_SCRIPT_DEPS) - cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../$(LD_SCRIPT) > ld_script.ld + sed "s#tools/#tools/#g" $(LD_SCRIPT) > $(OBJ_DIR)/ld_script.ld + +# Final rules + +libagbsyscall: + @$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) MODERN=$(MODERN) +# Elf from object files $(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) libagbsyscall @echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ " @cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) $(LIB) $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent +# Builds the rom from the elf file $(ROM): $(ELF) $(OBJCOPY) -O binary $< $@ $(FIX) $@ -p --silent -modern: all - -libagbsyscall: - @$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) MODERN=$(MODERN) - -################### -### Symbol file ### -################### - +# Symbol file (`make syms`) $(SYM): $(ELF) $(OBJDUMP) -t $< | sort -u | grep -E "^0[2389]" | $(PERL) -p -e 's/^(\w{8}) (\w).{6} \S+\t(\w{8}) (\S+)$$/\1 \2 \3 \4/g' > $@ diff --git a/make_tools.mk b/make_tools.mk index 00824adda6a3..78ff1beeb097 100644 --- a/make_tools.mk +++ b/make_tools.mk @@ -9,7 +9,9 @@ TOOL_NAMES := aif2pcm bin2c gbafix gbagfx jsonproc mapjson mid2agb preproc ramsc TOOLDIRS := $(TOOL_NAMES:%=$(TOOLS_DIR)/%) -.PHONY: tools check-tools clean-tools $(TOOLDIRS) $(CHECKTOOLDIRS) +# Tool making doesnt require a pokeemerald dependency scan. +RULES_NO_SCAN += tools check-tools clean-tools $(TOOLDIRS) $(CHECKTOOLDIRS) +.PHONY: $(RULES_NO_SCAN) tools: $(TOOLDIRS) check-tools: $(CHECKTOOLDIRS) From 4b2054c3ea1f0240ba6bed903f4e960da2d3716e Mon Sep 17 00:00:00 2001 From: Icedude907 <34080011+Icedude907@users.noreply.github.com> Date: Sun, 12 Nov 2023 16:38:32 +1300 Subject: [PATCH 03/48] Parallel SCANINC via `.d` generation. Secondary expansion is redundant. --- Makefile | 12 ++++++---- tools/scaninc/scaninc.cpp | 49 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 1eb4b8b55a75..56d1e3812f90 100644 --- a/Makefile +++ b/Makefile @@ -164,8 +164,6 @@ MAKEFLAGS += --no-print-directory .SECONDARY: # Delete files that weren't built properly .DELETE_ON_ERROR: -# Secondary expansion is required for dependency variables in object rules. -.SECONDEXPANSION: RULES_NO_SCAN += libagbsyscall clean clean-assets tidy tidymodern tidynonmodern generated clean-generated .PHONY: all rom modern compare @@ -330,7 +328,10 @@ endef # Calls SCANINC to find dependencies define C_SCANINC ifneq ($(NODEP),1) -$1.o: $2 $$(shell $(SCANINC) $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include -I gflib $2) +$1.o: $1.d +$1.d: $2 + $(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include -I gflib $2 +include $1.d endif endef @@ -359,7 +360,10 @@ endef define ASM_SCANINC ifneq ($(NODEP),1) -$1.o: $2 $$(shell $(SCANINC) $(INCLUDE_SCANINC_ARGS) -I "" $2) +$1.o: $1.d +$1.d: $2 + $(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I "" $2 +include $1.d endif endef diff --git a/tools/scaninc/scaninc.cpp b/tools/scaninc/scaninc.cpp index dcb16c0e7944..f5ee7ad6deeb 100644 --- a/tools/scaninc/scaninc.cpp +++ b/tools/scaninc/scaninc.cpp @@ -24,6 +24,9 @@ #include #include #include +#include +#include +#include #include "scaninc.h" #include "source_file.h" @@ -38,15 +41,19 @@ bool CanOpenFile(std::string path) return true; } -const char *const USAGE = "Usage: scaninc [-I INCLUDE_PATH] FILE_PATH\n"; +const char *const USAGE = "Usage: scaninc [-I INCLUDE_PATH] [-M DEPENDENCY_OUT_PATH] FILE_PATH\n"; int main(int argc, char **argv) { std::queue filesToProcess; std::set dependencies; + std::set dependencies_includes; std::vector includeDirs; + bool makeformat = false; + std::string make_outfile; + argc--; argv++; @@ -68,6 +75,13 @@ int main(int argc, char **argv) } includeDirs.push_back(includeDir); } + else if(arg.substr(0, 2) == "-M") + { + makeformat = true; + argc--; + argv++; + make_outfile = std::string(argv[0]); + } else { FATAL_ERROR(USAGE); @@ -112,6 +126,7 @@ int main(int argc, char **argv) { path = include; } + dependencies_includes.insert(path); bool inserted = dependencies.insert(path).second; if (inserted && exists) { @@ -121,8 +136,36 @@ int main(int argc, char **argv) includeDirs.pop_back(); } - for (const std::string &path : dependencies) + if(!makeformat) + { + for (const std::string &path : dependencies) + { + std::printf("%s\n", path.c_str()); + } + std::cout << std::endl; + } + else { - std::printf("%s\n", path.c_str()); + // Write out make rules to a file + std::ofstream output(make_outfile); + + // Print a make rule for the object file + size_t ext_pos = make_outfile.find_last_of("."); + auto object_file = make_outfile.substr(0, ext_pos + 1) + "o"; + output << object_file.c_str() << ": "; + for (const std::string &path : dependencies) + { + output << path << " "; + } + + // Dependency list rule. + // Although these rules are identical, they need to be separate, else make will trigger the rule again after the file is created for the first time. + output << "\n" << make_outfile.c_str() << ": "; + for (const std::string &path : dependencies_includes) + { + output << path << " "; + } + output.flush(); + output.close(); } } From 85f4ca69434a9bfe05fe8e0f3c16efe953eded2a Mon Sep 17 00:00:00 2001 From: Icedude907 <34080011+Icedude907@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:26:49 +1300 Subject: [PATCH 04/48] All `mid2agb` songs are controlled by a `midi.cfg` file --- songs.mk | 1277 +------------------------------------ sound/songs/midi/midi.cfg | 420 ++++++++++++ 2 files changed, 438 insertions(+), 1259 deletions(-) create mode 100644 sound/songs/midi/midi.cfg diff --git a/songs.mk b/songs.mk index 698f983cebcb..feef64cf5bff 100644 --- a/songs.mk +++ b/songs.mk @@ -1,1264 +1,23 @@ -STD_REVERB = 50 +# This file contains rules for making assemblies for most music in the game. -$(MID_BUILDDIR)/%.o: $(MID_SUBDIR)/%.s - $(AS) $(ASFLAGS) -I sound -o $@ $< +MID_ASM_DIR = $(MID_SUBDIR) -$(MID_SUBDIR)/mus_aqua_magma_hideout.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G076 -V084 +# For each line in midi.cfg, we do some trickery to convert it into a make rule for the `.mid` file described on the line +# Data following the colon in said file corresponds to arguments passed into mid2agb +MID_CFG_PATH := $(MID_SUBDIR)/midi.cfg -$(MID_SUBDIR)/mus_encounter_aqua.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G065 -V086 +# $1: Source path no extension, $2 Options +define MID_RULE +$(MID_ASM_DIR)/$1.s: $(MID_SUBDIR)/$1.mid + $(MID) $$< $$@ $2 +endef +# source path, remaining text (options) +define MID_EXPANSION + $(eval $(call MID_RULE,$(basename $(patsubst %:,%,$(word 1,$1))),$(wordlist 2,999,$1))) +endef -$(MID_SUBDIR)/mus_route111.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G055 -V076 +$(foreach line,$(shell cat $(MID_CFG_PATH) | sed "s/ /__SPACE__/g"),$(call MID_EXPANSION,$(subst __SPACE__, ,$(line)))) -$(MID_SUBDIR)/mus_encounter_suspicious.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G069 -V078 - -$(MID_SUBDIR)/mus_b_arena.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G104 -V090 - -$(MID_SUBDIR)/mus_b_dome.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G111 -V090 - -$(MID_SUBDIR)/mus_b_dome_lobby.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G111 -V056 - -$(MID_SUBDIR)/mus_b_factory.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G113 -V100 - -$(MID_SUBDIR)/mus_b_frontier.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G103 -V094 - -$(MID_SUBDIR)/mus_b_palace.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G108 -V105 - -$(MID_SUBDIR)/mus_b_tower_rs.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G035 -V080 - -$(MID_SUBDIR)/mus_b_pike.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G112 -V092 - -$(MID_SUBDIR)/mus_vs_trainer.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G119 -V080 -P1 - -$(MID_SUBDIR)/mus_vs_wild.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G117 -V080 -P1 - -$(MID_SUBDIR)/mus_vs_aqua_magma_leader.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G126 -V080 -P1 - -$(MID_SUBDIR)/mus_vs_aqua_magma.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G118 -V080 -P1 - -$(MID_SUBDIR)/mus_vs_gym_leader.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G120 -V080 -P1 - -$(MID_SUBDIR)/mus_vs_champion.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G121 -V080 -P1 - -$(MID_SUBDIR)/mus_vs_kyogre_groudon.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G123 -V080 -P1 - -$(MID_SUBDIR)/mus_vs_rival.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G124 -V080 -P1 - -$(MID_SUBDIR)/mus_vs_regi.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G122 -V080 -P1 - -$(MID_SUBDIR)/mus_vs_elite_four.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G125 -V080 -P1 - -$(MID_SUBDIR)/mus_roulette.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G038 -V080 - -$(MID_SUBDIR)/mus_lilycove_museum.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G020 -V080 - -$(MID_SUBDIR)/mus_encounter_brendan.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G067 -V078 - -$(MID_SUBDIR)/mus_encounter_male.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G028 -V080 - -$(MID_SUBDIR)/mus_victory_road.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G075 -V076 - -$(MID_SUBDIR)/mus_game_corner.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G072 -V072 - -$(MID_SUBDIR)/mus_contest_winner.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G085 -V100 - -$(MID_SUBDIR)/mus_contest_results.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G092 -V080 - -$(MID_SUBDIR)/mus_contest_lobby.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G098 -V060 - -$(MID_SUBDIR)/mus_contest.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G086 -V088 - -$(MID_SUBDIR)/mus_cycling.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G049 -V083 - -$(MID_SUBDIR)/mus_encounter_champion.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G100 -V076 - -$(MID_SUBDIR)/mus_petalburg_woods.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G018 -V080 - -$(MID_SUBDIR)/mus_abandoned_ship.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G030 -V080 - -$(MID_SUBDIR)/mus_cave_of_origin.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G037 -V080 - -$(MID_SUBDIR)/mus_underwater.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G057 -V094 - -$(MID_SUBDIR)/mus_intro.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G060 -V090 - -$(MID_SUBDIR)/mus_hall_of_fame.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G082 -V078 - -$(MID_SUBDIR)/mus_route110.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G010 -V080 - -$(MID_SUBDIR)/mus_route120.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G014 -V080 - -$(MID_SUBDIR)/mus_route122.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G021 -V080 - -$(MID_SUBDIR)/mus_route101.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G011 -V080 - -$(MID_SUBDIR)/mus_dummy.s: %.s: %.mid - $(MID) $< $@ -E -R40 - -$(MID_SUBDIR)/mus_hall_of_fame_room.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G093 -V080 - -$(MID_SUBDIR)/mus_end.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G102 -V036 - -$(MID_SUBDIR)/mus_help.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G056 -V078 - -$(MID_SUBDIR)/mus_level_up.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G012 -V090 -P5 - -$(MID_SUBDIR)/mus_obtain_item.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G012 -V090 -P5 - -$(MID_SUBDIR)/mus_evolved.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G012 -V090 -P5 - -$(MID_SUBDIR)/mus_gsc_route38.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -V080 - -$(MID_SUBDIR)/mus_slateport.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G079 -V070 - -$(MID_SUBDIR)/mus_poke_mart.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G050 -V085 - -$(MID_SUBDIR)/mus_oceanic_museum.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G023 -V080 - -$(MID_SUBDIR)/mus_gym.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G013 -V080 - -$(MID_SUBDIR)/mus_encounter_may.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G061 -V078 - -$(MID_SUBDIR)/mus_encounter_female.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G053 -V072 - -$(MID_SUBDIR)/mus_verdanturf.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G044 -V090 - -$(MID_SUBDIR)/mus_rustboro.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G045 -V085 - -$(MID_SUBDIR)/mus_route119.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G048 -V096 - -$(MID_SUBDIR)/mus_encounter_intense.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G062 -V078 - -$(MID_SUBDIR)/mus_weather_groudon.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G090 -V050 - -$(MID_SUBDIR)/mus_dewford.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G073 -V078 - -$(MID_SUBDIR)/mus_encounter_twins.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G095 -V075 - -$(MID_SUBDIR)/mus_encounter_interviewer.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G099 -V062 - -$(MID_SUBDIR)/mus_victory_trainer.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G058 -V091 - -$(MID_SUBDIR)/mus_victory_wild.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G025 -V080 - -$(MID_SUBDIR)/mus_victory_gym_leader.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G024 -V080 - -$(MID_SUBDIR)/mus_victory_aqua_magma.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G070 -V088 - -$(MID_SUBDIR)/mus_victory_league.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G029 -V080 - -$(MID_SUBDIR)/mus_caught.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G025 -V080 - -$(MID_SUBDIR)/mus_encounter_cool.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G063 -V086 - -$(MID_SUBDIR)/mus_trick_house.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G094 -V070 - -$(MID_SUBDIR)/mus_route113.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G064 -V084 - -$(MID_SUBDIR)/mus_sailing.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G077 -V086 - -$(MID_SUBDIR)/mus_mt_pyre.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G078 -V088 - -$(MID_SUBDIR)/mus_sealed_chamber.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G084 -V100 - -$(MID_SUBDIR)/mus_petalburg.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G015 -V080 - -$(MID_SUBDIR)/mus_fortree.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G032 -V080 - -$(MID_SUBDIR)/mus_oldale.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G019 -V080 - -$(MID_SUBDIR)/mus_mt_pyre_exterior.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G080 -V080 - -$(MID_SUBDIR)/mus_heal.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G012 -V090 -P5 - -$(MID_SUBDIR)/mus_slots_jackpot.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G012 -V090 -P5 - -$(MID_SUBDIR)/mus_slots_win.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G012 -V090 -P5 - -$(MID_SUBDIR)/mus_obtain_badge.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G012 -V090 -P5 - -$(MID_SUBDIR)/mus_obtain_berry.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G012 -V090 -P5 - -$(MID_SUBDIR)/mus_obtain_b_points.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G103 -V090 -P5 - -$(MID_SUBDIR)/mus_rg_photo.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G180 -V100 -P5 - -$(MID_SUBDIR)/mus_evolution_intro.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G026 -V080 - -$(MID_SUBDIR)/mus_obtain_symbol.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G103 -V100 -P5 - -$(MID_SUBDIR)/mus_awaken_legend.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G012 -V090 -P5 - -$(MID_SUBDIR)/mus_register_match_call.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G105 -V090 -P5 - -$(MID_SUBDIR)/mus_move_deleted.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G012 -V090 -P5 - -$(MID_SUBDIR)/mus_obtain_tmhm.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G012 -V090 -P5 - -$(MID_SUBDIR)/mus_too_bad.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G012 -V090 -P5 - -$(MID_SUBDIR)/mus_encounter_magma.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G087 -V072 - -$(MID_SUBDIR)/mus_lilycove.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G054 -V085 - -$(MID_SUBDIR)/mus_littleroot.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G051 -V100 - -$(MID_SUBDIR)/mus_surf.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G017 -V080 - -$(MID_SUBDIR)/mus_route104.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G047 -V097 - -$(MID_SUBDIR)/mus_gsc_pewter.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -V080 - -$(MID_SUBDIR)/mus_birch_lab.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G033 -V080 - -$(MID_SUBDIR)/mus_abnormal_weather.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G089 -V080 - -$(MID_SUBDIR)/mus_school.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G081 -V100 - -$(MID_SUBDIR)/mus_c_comm_center.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -V080 - -$(MID_SUBDIR)/mus_poke_center.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G046 -V092 - -$(MID_SUBDIR)/mus_b_pyramid.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G106 -V079 - -$(MID_SUBDIR)/mus_b_pyramid_top.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G107 -V077 - -$(MID_SUBDIR)/mus_ever_grande.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G068 -V086 - -$(MID_SUBDIR)/mus_rayquaza_appears.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G109 -V090 - -$(MID_SUBDIR)/mus_rg_rocket_hideout.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G133 -V090 - -$(MID_SUBDIR)/mus_rg_follow_me.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G131 -V068 - -$(MID_SUBDIR)/mus_rg_victory_road.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G154 -V090 - -$(MID_SUBDIR)/mus_rg_cycling.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G141 -V090 - -$(MID_SUBDIR)/mus_rg_intro_fight.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G136 -V090 - -$(MID_SUBDIR)/mus_rg_hall_of_fame.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G145 -V079 - -$(MID_SUBDIR)/mus_rg_encounter_deoxys.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G184 -V079 - -$(MID_SUBDIR)/mus_rg_credits.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G149 -V090 - -$(MID_SUBDIR)/mus_rg_encounter_gym_leader.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G144 -V090 - -$(MID_SUBDIR)/mus_rg_dex_rating.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G175 -V070 -P5 - -$(MID_SUBDIR)/mus_rg_obtain_key_item.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G178 -V077 -P5 - -$(MID_SUBDIR)/mus_rg_caught_intro.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G179 -V094 -P5 - -$(MID_SUBDIR)/mus_rg_caught.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G170 -V100 - -$(MID_SUBDIR)/mus_rg_cinnabar.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G138 -V090 - -$(MID_SUBDIR)/mus_rg_gym.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G134 -V090 - -$(MID_SUBDIR)/mus_rg_fuchsia.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G167 -V090 - -$(MID_SUBDIR)/mus_rg_poke_jump.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G132 -V090 - -$(MID_SUBDIR)/mus_rg_heal.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G140 -V090 - -$(MID_SUBDIR)/mus_rg_oak_lab.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G160 -V075 - -$(MID_SUBDIR)/mus_rg_berry_pick.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G132 -V090 - -$(MID_SUBDIR)/mus_rg_vermillion.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G172 -V090 - -$(MID_SUBDIR)/mus_rg_route1.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G150 -V079 - -$(MID_SUBDIR)/mus_rg_route3.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G152 -V083 - -$(MID_SUBDIR)/mus_rg_route11.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G153 -V090 - -$(MID_SUBDIR)/mus_rg_pallet.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G159 -V100 - -$(MID_SUBDIR)/mus_rg_surf.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G164 -V071 - -$(MID_SUBDIR)/mus_rg_sevii_45.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G188 -V084 - -$(MID_SUBDIR)/mus_rg_sevii_67.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G189 -V084 - -$(MID_SUBDIR)/mus_rg_sevii_123.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G173 -V084 - -$(MID_SUBDIR)/mus_rg_sevii_cave.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G147 -V090 - -$(MID_SUBDIR)/mus_rg_sevii_dungeon.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G146 -V090 - -$(MID_SUBDIR)/mus_rg_sevii_route.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G187 -V080 - -$(MID_SUBDIR)/mus_rg_net_center.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G162 -V096 - -$(MID_SUBDIR)/mus_rg_pewter.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G173 -V084 - -$(MID_SUBDIR)/mus_rg_oak.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G161 -V086 - -$(MID_SUBDIR)/mus_rg_mystery_gift.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G183 -V100 - -$(MID_SUBDIR)/mus_rg_route24.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G151 -V086 - -$(MID_SUBDIR)/mus_rg_teachy_tv_show.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G131 -V068 - -$(MID_SUBDIR)/mus_rg_mt_moon.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G147 -V090 - -$(MID_SUBDIR)/mus_rg_poke_tower.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G165 -V090 - -$(MID_SUBDIR)/mus_rg_poke_center.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G162 -V096 - -$(MID_SUBDIR)/mus_rg_poke_flute.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G165 -V048 -P5 - -$(MID_SUBDIR)/mus_rg_poke_mansion.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G148 -V090 - -$(MID_SUBDIR)/mus_rg_jigglypuff.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G135 -V068 -P5 - -$(MID_SUBDIR)/mus_rg_encounter_rival.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G174 -V079 - -$(MID_SUBDIR)/mus_rg_rival_exit.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G174 -V079 - -$(MID_SUBDIR)/mus_rg_encounter_rocket.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G142 -V096 - -$(MID_SUBDIR)/mus_rg_ss_anne.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G163 -V090 - -$(MID_SUBDIR)/mus_rg_new_game_exit.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G182 -V088 - -$(MID_SUBDIR)/mus_rg_new_game_intro.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G182 -V088 - -$(MID_SUBDIR)/mus_rg_lavender.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G139 -V090 - -$(MID_SUBDIR)/mus_rg_silph.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G166 -V076 - -$(MID_SUBDIR)/mus_rg_encounter_girl.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G143 -V051 - -$(MID_SUBDIR)/mus_rg_encounter_boy.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G144 -V090 - -$(MID_SUBDIR)/mus_rg_game_corner.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G132 -V090 - -$(MID_SUBDIR)/mus_rg_slow_pallet.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G159 -V092 - -$(MID_SUBDIR)/mus_rg_new_game_instruct.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G182 -V085 - -$(MID_SUBDIR)/mus_rg_viridian_forest.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G146 -V090 - -$(MID_SUBDIR)/mus_rg_trainer_tower.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G134 -V090 - -$(MID_SUBDIR)/mus_rg_celadon.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G168 -V070 - -$(MID_SUBDIR)/mus_rg_title.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G137 -V090 - -$(MID_SUBDIR)/mus_rg_game_freak.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G181 -V075 - -$(MID_SUBDIR)/mus_rg_teachy_tv_menu.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G186 -V059 - -$(MID_SUBDIR)/mus_rg_union_room.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G132 -V090 - -$(MID_SUBDIR)/mus_rg_vs_legend.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G157 -V090 - -$(MID_SUBDIR)/mus_rg_vs_deoxys.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G185 -V080 - -$(MID_SUBDIR)/mus_rg_vs_gym_leader.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G155 -V090 - -$(MID_SUBDIR)/mus_rg_vs_champion.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G158 -V090 - -$(MID_SUBDIR)/mus_rg_vs_mewtwo.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G157 -V090 - -$(MID_SUBDIR)/mus_rg_vs_trainer.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G156 -V090 - -$(MID_SUBDIR)/mus_rg_vs_wild.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G157 -V090 - -$(MID_SUBDIR)/mus_rg_victory_gym_leader.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G171 -V090 - -$(MID_SUBDIR)/mus_rg_victory_trainer.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G169 -V089 - -$(MID_SUBDIR)/mus_rg_victory_wild.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G170 -V090 - -$(MID_SUBDIR)/mus_cable_car.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G071 -V078 - -$(MID_SUBDIR)/mus_sootopolis.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G091 -V062 - -$(MID_SUBDIR)/mus_safari_zone.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G074 -V082 - -$(MID_SUBDIR)/mus_b_tower.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G110 -V100 - -$(MID_SUBDIR)/mus_evolution.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G026 -V080 - -$(MID_SUBDIR)/mus_encounter_elite_four.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G096 -V078 - -$(MID_SUBDIR)/mus_c_vs_legend_beast.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -V080 - -$(MID_SUBDIR)/mus_encounter_swimmer.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G036 -V080 - -$(MID_SUBDIR)/mus_encounter_girl.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G027 -V080 - -$(MID_SUBDIR)/mus_intro_battle.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G088 -V088 - -$(MID_SUBDIR)/mus_encounter_rich.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G043 -V094 - -$(MID_SUBDIR)/mus_link_contest_p1.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G039 -V079 - -$(MID_SUBDIR)/mus_link_contest_p2.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G040 -V090 - -$(MID_SUBDIR)/mus_link_contest_p3.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G041 -V075 - -$(MID_SUBDIR)/mus_link_contest_p4.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G042 -V090 - -$(MID_SUBDIR)/mus_littleroot_test.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G034 -V099 - -$(MID_SUBDIR)/mus_credits.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G101 -V100 - -$(MID_SUBDIR)/mus_title.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G059 -V090 - -$(MID_SUBDIR)/mus_fallarbor.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G083 -V100 - -$(MID_SUBDIR)/mus_mt_chimney.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G052 -V078 - -$(MID_SUBDIR)/mus_follow_me.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G066 -V074 - -$(MID_SUBDIR)/mus_vs_frontier_brain.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G115 -V090 -P1 - -$(MID_SUBDIR)/mus_vs_mew.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G116 -V090 - -$(MID_SUBDIR)/mus_vs_rayquaza.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G114 -V080 -P1 - -$(MID_SUBDIR)/mus_encounter_hiker.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G097 -V076 - -$(MID_SUBDIR)/ph_choice_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_choice_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_choice_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_cloth_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_cloth_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_cloth_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_cure_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_cure_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_cure_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_dress_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_dress_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_dress_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_face_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_face_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_face_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_fleece_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_fleece_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_fleece_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_foot_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_foot_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_foot_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_goat_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_goat_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_goat_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_goose_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_goose_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_goose_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_kit_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_kit_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_kit_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_lot_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_lot_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_lot_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_mouth_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_mouth_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_mouth_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_nurse_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_nurse_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_nurse_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_price_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_price_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_price_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_strut_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_strut_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_strut_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_thought_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_thought_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_thought_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_trap_blend.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_trap_held.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/ph_trap_solo.s: %.s: %.mid - $(MID) $< $@ -E -G130 -P4 - -$(MID_SUBDIR)/se_a.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V095 -P4 - -$(MID_SUBDIR)/se_bang.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_taillow_wing_flap.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V105 -P5 - -$(MID_SUBDIR)/se_glass_flute.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V105 -P5 - -$(MID_SUBDIR)/se_boo.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V110 -P4 - -$(MID_SUBDIR)/se_ball.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V070 -P4 - -$(MID_SUBDIR)/se_ball_open.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P5 - -$(MID_SUBDIR)/se_mugshot.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V090 -P5 - -$(MID_SUBDIR)/se_contest_heart.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V090 -P5 - -$(MID_SUBDIR)/se_contest_curtain_fall.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V070 -P5 - -$(MID_SUBDIR)/se_contest_curtain_rise.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V070 -P5 - -$(MID_SUBDIR)/se_contest_icon_change.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P5 - -$(MID_SUBDIR)/se_contest_mons_turn.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V090 -P5 - -$(MID_SUBDIR)/se_contest_icon_clear.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V090 -P5 - -$(MID_SUBDIR)/se_card.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P4 - -$(MID_SUBDIR)/se_pike_curtain_close.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -P5 - -$(MID_SUBDIR)/se_pike_curtain_open.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -P5 - -$(MID_SUBDIR)/se_ledge.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P4 - -$(MID_SUBDIR)/se_itemfinder.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V090 -P5 - -$(MID_SUBDIR)/se_applause.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P5 - -$(MID_SUBDIR)/se_field_poison.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V110 -P5 - -$(MID_SUBDIR)/se_door.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V080 -P5 - -$(MID_SUBDIR)/se_e.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V120 -P4 - -$(MID_SUBDIR)/se_elevator.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P4 - -$(MID_SUBDIR)/se_escalator.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P4 - -$(MID_SUBDIR)/se_exp.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V080 -P5 - -$(MID_SUBDIR)/se_exp_max.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V094 -P5 - -$(MID_SUBDIR)/se_fu_zaku.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V120 -P4 - -$(MID_SUBDIR)/se_contest_condition_lose.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V110 -P4 - -$(MID_SUBDIR)/se_lavaridge_fall_warp.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -P4 - -$(MID_SUBDIR)/se_balloon_red.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V105 -P4 - -$(MID_SUBDIR)/se_balloon_blue.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V105 -P4 - -$(MID_SUBDIR)/se_balloon_yellow.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V105 -P4 - -$(MID_SUBDIR)/se_arena_timeup1.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -P5 - -$(MID_SUBDIR)/se_arena_timeup2.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -P5 - -$(MID_SUBDIR)/se_bridge_walk.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V095 -P4 - -$(MID_SUBDIR)/se_failure.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V120 -P4 - -$(MID_SUBDIR)/se_rotating_gate.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V090 -P4 - -$(MID_SUBDIR)/se_low_health.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P3 - -$(MID_SUBDIR)/se_i.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V120 -P4 - -$(MID_SUBDIR)/se_sliding_door.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V095 -P4 - -$(MID_SUBDIR)/se_vend.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_bike_hop.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V090 -P4 - -$(MID_SUBDIR)/se_bike_bell.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V090 -P4 - -$(MID_SUBDIR)/se_contest_place.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V110 -P4 - -$(MID_SUBDIR)/se_exit.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V120 -P5 - -$(MID_SUBDIR)/se_use_item.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P5 - -$(MID_SUBDIR)/se_unlock.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P4 - -$(MID_SUBDIR)/se_ball_bounce_1.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P4 - -$(MID_SUBDIR)/se_ball_bounce_2.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P4 - -$(MID_SUBDIR)/se_ball_bounce_3.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P4 - -$(MID_SUBDIR)/se_ball_bounce_4.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P4 - -$(MID_SUBDIR)/se_super_effective.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V110 -P5 - -$(MID_SUBDIR)/se_not_effective.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V110 -P5 - -$(MID_SUBDIR)/se_effective.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V110 -P5 - -$(MID_SUBDIR)/se_puddle.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V020 -P4 - -$(MID_SUBDIR)/se_berry_blender.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V090 -P4 - -$(MID_SUBDIR)/se_switch.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P4 - -$(MID_SUBDIR)/se_n.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -P4 - -$(MID_SUBDIR)/se_ball_throw.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V120 -P5 - -$(MID_SUBDIR)/se_ship.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V075 -P4 - -$(MID_SUBDIR)/se_flee.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V090 -P5 - -$(MID_SUBDIR)/se_o.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V120 -P4 - -$(MID_SUBDIR)/se_intro_blast.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P5 - -$(MID_SUBDIR)/se_pc_login.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P5 - -$(MID_SUBDIR)/se_pc_off.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P5 - -$(MID_SUBDIR)/se_pc_on.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P5 - -$(MID_SUBDIR)/se_pin.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V060 -P4 - -$(MID_SUBDIR)/se_ding_dong.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V090 -P5 - -$(MID_SUBDIR)/se_pokenav_off.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P5 - -$(MID_SUBDIR)/se_pokenav_on.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P5 - -$(MID_SUBDIR)/se_faint.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V110 -P5 - -$(MID_SUBDIR)/se_shiny.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V095 -P5 - -$(MID_SUBDIR)/se_shop.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V090 -P5 - -$(MID_SUBDIR)/se_rg_bag_cursor.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -P5 - -$(MID_SUBDIR)/se_rg_bag_pocket.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -P5 - -$(MID_SUBDIR)/se_rg_card_flip.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -P5 - -$(MID_SUBDIR)/se_rg_card_flipping.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -P5 - -$(MID_SUBDIR)/se_rg_card_open.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -V112 -P5 - -$(MID_SUBDIR)/se_rg_deoxys_move.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -V080 -P5 - -$(MID_SUBDIR)/se_rg_poke_jump_success.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P5 - -$(MID_SUBDIR)/se_rg_ball_click.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -V100 -P5 - -$(MID_SUBDIR)/se_rg_help_close.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -V095 -P5 - -$(MID_SUBDIR)/se_rg_help_error.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -V125 -P5 - -$(MID_SUBDIR)/se_rg_help_open.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -V096 -P5 - -$(MID_SUBDIR)/se_rg_ss_anne_horn.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -V096 -P5 - -$(MID_SUBDIR)/se_rg_poke_jump_failure.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -P5 - -$(MID_SUBDIR)/se_rg_shop.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -V080 -P5 - -$(MID_SUBDIR)/se_rg_door.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -V100 -P5 - -$(MID_SUBDIR)/se_ice_crack.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P4 - -$(MID_SUBDIR)/se_ice_stairs.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V090 -P4 - -$(MID_SUBDIR)/se_ice_break.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P4 - -$(MID_SUBDIR)/se_fall.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_save.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V080 -P5 - -$(MID_SUBDIR)/se_success.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V080 -P4 - -$(MID_SUBDIR)/se_select.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V080 -P5 - -$(MID_SUBDIR)/se_ball_trade.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P5 - -$(MID_SUBDIR)/se_thunderstorm.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V080 -P2 - -$(MID_SUBDIR)/se_thunderstorm_stop.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V080 -P2 - -$(MID_SUBDIR)/se_thunder.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P3 - -$(MID_SUBDIR)/se_thunder2.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P3 - -$(MID_SUBDIR)/se_rain.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V080 -P2 - -$(MID_SUBDIR)/se_rain_stop.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V080 -P2 - -$(MID_SUBDIR)/se_downpour.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P2 - -$(MID_SUBDIR)/se_downpour_stop.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P2 - -$(MID_SUBDIR)/se_orb.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P5 - -$(MID_SUBDIR)/se_egg_hatch.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V120 -P5 - -$(MID_SUBDIR)/se_roulette_ball.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P2 - -$(MID_SUBDIR)/se_roulette_ball2.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P2 - -$(MID_SUBDIR)/se_ball_tray_exit.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V100 -P5 - -$(MID_SUBDIR)/se_ball_tray_ball.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P5 - -$(MID_SUBDIR)/se_ball_tray_enter.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P5 - -$(MID_SUBDIR)/se_click.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V110 -P4 - -$(MID_SUBDIR)/se_warp_in.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V090 -P4 - -$(MID_SUBDIR)/se_warp_out.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V090 -P4 - -$(MID_SUBDIR)/se_pokenav_call.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -V120 -P5 - -$(MID_SUBDIR)/se_pokenav_hang_up.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -V110 -P5 - -$(MID_SUBDIR)/se_note_a.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_note_b.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_note_c.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_note_c_high.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_note_d.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_mud_ball.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_note_e.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_note_f.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_note_g.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_breakable_door.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_truck_door.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_truck_unload.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -P4 - -$(MID_SUBDIR)/se_truck_move.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -P4 - -$(MID_SUBDIR)/se_truck_stop.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -P4 - -$(MID_SUBDIR)/se_repel.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -V090 -P4 - -$(MID_SUBDIR)/se_u.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -P4 - -$(MID_SUBDIR)/se_sudowoodo_shake.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G129 -V077 -P5 - -$(MID_SUBDIR)/se_m_double_slap.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_comet_punch.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V120 -P4 - -$(MID_SUBDIR)/se_m_pay_day.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V095 -P4 - -$(MID_SUBDIR)/se_m_fire_punch.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_scratch.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_vicegrip.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_razor_wind.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_razor_wind2.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V090 -P4 - -$(MID_SUBDIR)/se_m_swords_dance.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P4 - -$(MID_SUBDIR)/se_m_cut.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V120 -P4 - -$(MID_SUBDIR)/se_m_gust.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_gust2.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_wing_attack.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V105 -P4 - -$(MID_SUBDIR)/se_m_fly.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_bind.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V100 -P4 - -$(MID_SUBDIR)/se_m_mega_kick.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V090 -P4 - -$(MID_SUBDIR)/se_m_mega_kick2.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_jump_kick.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_sand_attack.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_headbutt.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_horn_attack.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_take_down.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V105 -P4 - -$(MID_SUBDIR)/se_m_tail_whip.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_m_leer.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G128 -V110 -P4 - -$(MID_SUBDIR)/se_dex_search.s: %.s: %.mid - $(MID) $< $@ -E -R$(STD_REVERB) -G127 -v100 -P5 +# Warn users building without a .cfg - build will fail at link time +$(MID_ASM_DIR)/%.s: $(MID_SUBDIR)/%.mid + $(warning $< does not have an associated entry in midi.cfg! It cannot be built) \ No newline at end of file diff --git a/sound/songs/midi/midi.cfg b/sound/songs/midi/midi.cfg new file mode 100644 index 000000000000..439778e9bdcd --- /dev/null +++ b/sound/songs/midi/midi.cfg @@ -0,0 +1,420 @@ +mus_abandoned_ship.mid: -E -R50 -G030 -V080 +mus_abnormal_weather.mid: -E -R50 -G089 -V080 +mus_aqua_magma_hideout.mid: -E -R50 -G076 -V084 +mus_awaken_legend.mid: -E -R50 -G012 -V090 -P5 +mus_b_arena.mid: -E -R50 -G104 -V090 +mus_b_dome_lobby.mid: -E -R50 -G111 -V056 +mus_b_dome.mid: -E -R50 -G111 -V090 +mus_b_factory.mid: -E -R50 -G113 -V100 +mus_b_frontier.mid: -E -R50 -G103 -V094 +mus_b_palace.mid: -E -R50 -G108 -V105 +mus_b_pike.mid: -E -R50 -G112 -V092 +mus_b_pyramid_top.mid: -E -R50 -G107 -V077 +mus_b_pyramid.mid: -E -R50 -G106 -V079 +mus_b_tower_rs.mid: -E -R50 -G035 -V080 +mus_b_tower.mid: -E -R50 -G110 -V100 +mus_birch_lab.mid: -E -R50 -G033 -V080 +mus_c_comm_center.mid: -E -R50 -V080 +mus_c_vs_legend_beast.mid: -E -R50 -V080 +mus_cable_car.mid: -E -R50 -G071 -V078 +mus_caught.mid: -E -R50 -G025 -V080 +mus_cave_of_origin.mid: -E -R50 -G037 -V080 +mus_contest_lobby.mid: -E -R50 -G098 -V060 +mus_contest_results.mid: -E -R50 -G092 -V080 +mus_contest_winner.mid: -E -R50 -G085 -V100 +mus_contest.mid: -E -R50 -G086 -V088 +mus_credits.mid: -E -R50 -G101 -V100 +mus_cycling.mid: -E -R50 -G049 -V083 +mus_dewford.mid: -E -R50 -G073 -V078 +mus_dummy.mid: -E -R40 +mus_encounter_aqua.mid: -E -R50 -G065 -V086 +mus_encounter_brendan.mid: -E -R50 -G067 -V078 +mus_encounter_champion.mid: -E -R50 -G100 -V076 +mus_encounter_cool.mid: -E -R50 -G063 -V086 +mus_encounter_elite_four.mid: -E -R50 -G096 -V078 +mus_encounter_female.mid: -E -R50 -G053 -V072 +mus_encounter_girl.mid: -E -R50 -G027 -V080 +mus_encounter_hiker.mid: -E -R50 -G097 -V076 +mus_encounter_intense.mid: -E -R50 -G062 -V078 +mus_encounter_interviewer.mid: -E -R50 -G099 -V062 +mus_encounter_magma.mid: -E -R50 -G087 -V072 +mus_encounter_male.mid: -E -R50 -G028 -V080 +mus_encounter_may.mid: -E -R50 -G061 -V078 +mus_encounter_rich.mid: -E -R50 -G043 -V094 +mus_encounter_suspicious.mid: -E -R50 -G069 -V078 +mus_encounter_swimmer.mid: -E -R50 -G036 -V080 +mus_encounter_twins.mid: -E -R50 -G095 -V075 +mus_end.mid: -E -R50 -G102 -V036 +mus_ever_grande.mid: -E -R50 -G068 -V086 +mus_evolution_intro.mid: -E -R50 -G026 -V080 +mus_evolution.mid: -E -R50 -G026 -V080 +mus_evolved.mid: -E -R50 -G012 -V090 -P5 +mus_fallarbor.mid: -E -R50 -G083 -V100 +mus_follow_me.mid: -E -R50 -G066 -V074 +mus_fortree.mid: -E -R50 -G032 -V080 +mus_game_corner.mid: -E -R50 -G072 -V072 +mus_gsc_pewter.mid: -E -R50 -V080 +mus_gsc_route38.mid: -E -R50 -V080 +mus_gym.mid: -E -R50 -G013 -V080 +mus_hall_of_fame_room.mid: -E -R50 -G093 -V080 +mus_hall_of_fame.mid: -E -R50 -G082 -V078 +mus_heal.mid: -E -R50 -G012 -V090 -P5 +mus_help.mid: -E -R50 -G056 -V078 +mus_intro_battle.mid: -E -R50 -G088 -V088 +mus_intro.mid: -E -R50 -G060 -V090 +mus_level_up.mid: -E -R50 -G012 -V090 -P5 +mus_lilycove_museum.mid: -E -R50 -G020 -V080 +mus_lilycove.mid: -E -R50 -G054 -V085 +mus_link_contest_p1.mid: -E -R50 -G039 -V079 +mus_link_contest_p2.mid: -E -R50 -G040 -V090 +mus_link_contest_p3.mid: -E -R50 -G041 -V075 +mus_link_contest_p4.mid: -E -R50 -G042 -V090 +mus_littleroot_test.mid: -E -R50 -G034 -V099 +mus_littleroot.mid: -E -R50 -G051 -V100 +mus_move_deleted.mid: -E -R50 -G012 -V090 -P5 +mus_mt_chimney.mid: -E -R50 -G052 -V078 +mus_mt_pyre_exterior.mid: -E -R50 -G080 -V080 +mus_mt_pyre.mid: -E -R50 -G078 -V088 +mus_obtain_b_points.mid: -E -R50 -G103 -V090 -P5 +mus_obtain_badge.mid: -E -R50 -G012 -V090 -P5 +mus_obtain_berry.mid: -E -R50 -G012 -V090 -P5 +mus_obtain_item.mid: -E -R50 -G012 -V090 -P5 +mus_obtain_symbol.mid: -E -R50 -G103 -V100 -P5 +mus_obtain_tmhm.mid: -E -R50 -G012 -V090 -P5 +mus_oceanic_museum.mid: -E -R50 -G023 -V080 +mus_oldale.mid: -E -R50 -G019 -V080 +mus_petalburg_woods.mid: -E -R50 -G018 -V080 +mus_petalburg.mid: -E -R50 -G015 -V080 +mus_poke_center.mid: -E -R50 -G046 -V092 +mus_poke_mart.mid: -E -R50 -G050 -V085 +mus_rayquaza_appears.mid: -E -R50 -G109 -V090 +mus_register_match_call.mid: -E -R50 -G105 -V090 -P5 +mus_rg_berry_pick.mid: -E -R50 -G132 -V090 +mus_rg_caught_intro.mid: -E -R50 -G179 -V094 -P5 +mus_rg_caught.mid: -E -R50 -G170 -V100 +mus_rg_celadon.mid: -E -R50 -G168 -V070 +mus_rg_cinnabar.mid: -E -R50 -G138 -V090 +mus_rg_credits.mid: -E -R50 -G149 -V090 +mus_rg_cycling.mid: -E -R50 -G141 -V090 +mus_rg_dex_rating.mid: -E -R50 -G175 -V070 -P5 +mus_rg_encounter_boy.mid: -E -R50 -G144 -V090 +mus_rg_encounter_deoxys.mid: -E -R50 -G184 -V079 +mus_rg_encounter_girl.mid: -E -R50 -G143 -V051 +mus_rg_encounter_gym_leader: -E -R50 -G144 -V090 +mus_rg_encounter_rival.mid: -E -R50 -G174 -V079 +mus_rg_encounter_rocket.mid: -E -R50 -G142 -V096 +mus_rg_follow_me.mid: -E -R50 -G131 -V068 +mus_rg_fuchsia.mid: -E -R50 -G167 -V090 +mus_rg_game_corner.mid: -E -R50 -G132 -V090 +mus_rg_game_freak.mid: -E -R50 -G181 -V075 +mus_rg_gym.mid: -E -R50 -G134 -V090 +mus_rg_hall_of_fame.mid: -E -R50 -G145 -V079 +mus_rg_heal.mid: -E -R50 -G140 -V090 +mus_rg_intro_fight.mid: -E -R50 -G136 -V090 +mus_rg_jigglypuff.mid: -E -R50 -G135 -V068 -P5 +mus_rg_lavender.mid: -E -R50 -G139 -V090 +mus_rg_mt_moon.mid: -E -R50 -G147 -V090 +mus_rg_mystery_gift.mid: -E -R50 -G183 -V100 +mus_rg_net_center.mid: -E -R50 -G162 -V096 +mus_rg_new_game_exit.mid: -E -R50 -G182 -V088 +mus_rg_new_game_instruct.mid: -E -R50 -G182 -V085 +mus_rg_new_game_intro.mid: -E -R50 -G182 -V088 +mus_rg_oak_lab.mid: -E -R50 -G160 -V075 +mus_rg_oak.mid: -E -R50 -G161 -V086 +mus_rg_obtain_key_item.mid: -E -R50 -G178 -V077 -P5 +mus_rg_pallet.mid: -E -R50 -G159 -V100 +mus_rg_pewter.mid: -E -R50 -G173 -V084 +mus_rg_photo.mid: -E -R50 -G180 -V100 -P5 +mus_rg_poke_center.mid: -E -R50 -G162 -V096 +mus_rg_poke_flute.mid: -E -R50 -G165 -V048 -P5 +mus_rg_poke_jump.mid: -E -R50 -G132 -V090 +mus_rg_poke_mansion.mid: -E -R50 -G148 -V090 +mus_rg_poke_tower.mid: -E -R50 -G165 -V090 +mus_rg_rival_exit.mid: -E -R50 -G174 -V079 +mus_rg_rocket_hideout.mid: -E -R50 -G133 -V090 +mus_rg_route1.mid: -E -R50 -G150 -V079 +mus_rg_route3.mid: -E -R50 -G152 -V083 +mus_rg_route11.mid: -E -R50 -G153 -V090 +mus_rg_route24.mid: -E -R50 -G151 -V086 +mus_rg_sevii_45.mid: -E -R50 -G188 -V084 +mus_rg_sevii_67.mid: -E -R50 -G189 -V084 +mus_rg_sevii_123.mid: -E -R50 -G173 -V084 +mus_rg_sevii_cave.mid: -E -R50 -G147 -V090 +mus_rg_sevii_dungeon.mid: -E -R50 -G146 -V090 +mus_rg_sevii_route.mid: -E -R50 -G187 -V080 +mus_rg_silph.mid: -E -R50 -G166 -V076 +mus_rg_slow_pallet.mid: -E -R50 -G159 -V092 +mus_rg_ss_anne.mid: -E -R50 -G163 -V090 +mus_rg_surf.mid: -E -R50 -G164 -V071 +mus_rg_teachy_tv_menu.mid: -E -R50 -G186 -V059 +mus_rg_teachy_tv_show.mid: -E -R50 -G131 -V068 +mus_rg_title.mid: -E -R50 -G137 -V090 +mus_rg_trainer_tower.mid: -E -R50 -G134 -V090 +mus_rg_union_room.mid: -E -R50 -G132 -V090 +mus_rg_vermillion.mid: -E -R50 -G172 -V090 +mus_rg_victory_gym_leader.mid: -E -R50 -G171 -V090 +mus_rg_victory_road.mid: -E -R50 -G154 -V090 +mus_rg_victory_trainer.mid: -E -R50 -G169 -V089 +mus_rg_victory_wild.mid: -E -R50 -G170 -V090 +mus_rg_viridian_forest.mid: -E -R50 -G146 -V090 +mus_rg_vs_champion.mid: -E -R50 -G158 -V090 +mus_rg_vs_deoxys.mid: -E -R50 -G185 -V080 +mus_rg_vs_gym_leader.mid: -E -R50 -G155 -V090 +mus_rg_vs_legend.mid: -E -R50 -G157 -V090 +mus_rg_vs_mewtwo.mid: -E -R50 -G157 -V090 +mus_rg_vs_trainer.mid: -E -R50 -G156 -V090 +mus_rg_vs_wild.mid: -E -R50 -G157 -V090 +mus_roulette.mid: -E -R50 -G038 -V080 +mus_route101.mid: -E -R50 -G011 -V080 +mus_route104.mid: -E -R50 -G047 -V097 +mus_route110.mid: -E -R50 -G010 -V080 +mus_route111.mid: -E -R50 -G055 -V076 +mus_route113.mid: -E -R50 -G064 -V084 +mus_route119.mid: -E -R50 -G048 -V096 +mus_route120.mid: -E -R50 -G014 -V080 +mus_route122.mid: -E -R50 -G021 -V080 +mus_rustboro.mid: -E -R50 -G045 -V085 +mus_safari_zone.mid: -E -R50 -G074 -V082 +mus_sailing.mid: -E -R50 -G077 -V086 +mus_school.mid: -E -R50 -G081 -V100 +mus_sealed_chamber.mid: -E -R50 -G084 -V100 +mus_slateport.mid: -E -R50 -G079 -V070 +mus_slots_jackpot.mid: -E -R50 -G012 -V090 -P5 +mus_slots_win.mid: -E -R50 -G012 -V090 -P5 +mus_sootopolis.mid: -E -R50 -G091 -V062 +mus_surf.mid: -E -R50 -G017 -V080 +mus_title.mid: -E -R50 -G059 -V090 +mus_too_bad.mid: -E -R50 -G012 -V090 -P5 +mus_trick_house.mid: -E -R50 -G094 -V070 +mus_underwater.mid: -E -R50 -G057 -V094 +mus_verdanturf.mid: -E -R50 -G044 -V090 +mus_victory_aqua_magma.mid: -E -R50 -G070 -V088 +mus_victory_gym_leader.mid: -E -R50 -G024 -V080 +mus_victory_league.mid: -E -R50 -G029 -V080 +mus_victory_road.mid: -E -R50 -G075 -V076 +mus_victory_trainer.mid: -E -R50 -G058 -V091 +mus_victory_wild.mid: -E -R50 -G025 -V080 +mus_vs_aqua_magma_leader.mid: -E -R50 -G126 -V080 -P1 +mus_vs_aqua_magma.mid: -E -R50 -G118 -V080 -P1 +mus_vs_champion.mid: -E -R50 -G121 -V080 -P1 +mus_vs_elite_four.mid: -E -R50 -G125 -V080 -P1 +mus_vs_frontier_brain.mid: -E -R50 -G115 -V090 -P1 +mus_vs_gym_leader.mid: -E -R50 -G120 -V080 -P1 +mus_vs_kyogre_groudon.mid: -E -R50 -G123 -V080 -P1 +mus_vs_mew.mid: -E -R50 -G116 -V090 +mus_vs_rayquaza.mid: -E -R50 -G114 -V080 -P1 +mus_vs_regi.mid: -E -R50 -G122 -V080 -P1 +mus_vs_rival.mid: -E -R50 -G124 -V080 -P1 +mus_vs_trainer.mid: -E -R50 -G119 -V080 -P1 +mus_vs_wild.mid: -E -R50 -G117 -V080 -P1 +mus_weather_groudon.mid: -E -R50 -G090 -V050 +ph_choice_blend.mid: -E -G130 -P4 +ph_choice_held.mid: -E -G130 -P4 +ph_choice_solo.mid: -E -G130 -P4 +ph_cloth_blend.mid: -E -G130 -P4 +ph_cloth_held.mid: -E -G130 -P4 +ph_cloth_solo.mid: -E -G130 -P4 +ph_cure_blend.mid: -E -G130 -P4 +ph_cure_held.mid: -E -G130 -P4 +ph_cure_solo.mid: -E -G130 -P4 +ph_dress_blend.mid: -E -G130 -P4 +ph_dress_held.mid: -E -G130 -P4 +ph_dress_solo.mid: -E -G130 -P4 +ph_face_blend.mid: -E -G130 -P4 +ph_face_held.mid: -E -G130 -P4 +ph_face_solo.mid: -E -G130 -P4 +ph_fleece_blend.mid: -E -G130 -P4 +ph_fleece_held.mid: -E -G130 -P4 +ph_fleece_solo.mid: -E -G130 -P4 +ph_foot_blend.mid: -E -G130 -P4 +ph_foot_held.mid: -E -G130 -P4 +ph_foot_solo.mid: -E -G130 -P4 +ph_goat_blend.mid: -E -G130 -P4 +ph_goat_held.mid: -E -G130 -P4 +ph_goat_solo.mid: -E -G130 -P4 +ph_goose_blend.mid: -E -G130 -P4 +ph_goose_held.mid: -E -G130 -P4 +ph_goose_solo.mid: -E -G130 -P4 +ph_kit_blend.mid: -E -G130 -P4 +ph_kit_held.mid: -E -G130 -P4 +ph_kit_solo.mid: -E -G130 -P4 +ph_lot_blend.mid: -E -G130 -P4 +ph_lot_held.mid: -E -G130 -P4 +ph_lot_solo.mid: -E -G130 -P4 +ph_mouth_blend.mid: -E -G130 -P4 +ph_mouth_held.mid: -E -G130 -P4 +ph_mouth_solo.mid: -E -G130 -P4 +ph_nurse_blend.mid: -E -G130 -P4 +ph_nurse_held.mid: -E -G130 -P4 +ph_nurse_solo.mid: -E -G130 -P4 +ph_price_blend.mid: -E -G130 -P4 +ph_price_held.mid: -E -G130 -P4 +ph_price_solo.mid: -E -G130 -P4 +ph_strut_blend.mid: -E -G130 -P4 +ph_strut_held.mid: -E -G130 -P4 +ph_strut_solo.mid: -E -G130 -P4 +ph_thought_blend.mid: -E -G130 -P4 +ph_thought_held.mid: -E -G130 -P4 +ph_thought_solo.mid: -E -G130 -P4 +ph_trap_blend.mid: -E -G130 -P4 +ph_trap_held.mid: -E -G130 -P4 +ph_trap_solo.mid: -E -G130 -P4 +se_a.mid: -E -R50 -G128 -V095 -P4 +se_applause.mid: -E -R50 -G128 -V100 -P5 +se_arena_timeup1.mid: -E -R50 -G129 -P5 +se_arena_timeup2.mid: -E -R50 -G129 -P5 +se_ball_bounce_1.mid: -E -R50 -G128 -V100 -P4 +se_ball_bounce_2.mid: -E -R50 -G128 -V100 -P4 +se_ball_bounce_3.mid: -E -R50 -G128 -V100 -P4 +se_ball_bounce_4.mid: -E -R50 -G128 -V100 -P4 +se_ball_open.mid: -E -R50 -G127 -V100 -P5 +se_ball_throw.mid: -E -R50 -G128 -V120 -P5 +se_ball_trade.mid: -E -R50 -G127 -V100 -P5 +se_ball_tray_ball.mid: -E -R50 -G128 -V110 -P5 +se_ball_tray_enter.mid: -E -R50 -G128 -V110 -P5 +se_ball_tray_exit.mid: -E -R50 -G127 -V100 -P5 +se_ball.mid: -E -R50 -G127 -V070 -P4 +se_balloon_blue.mid: -E -R50 -G128 -V105 -P4 +se_balloon_red.mid: -E -R50 -G128 -V105 -P4 +se_balloon_yellow.mid: -E -R50 -G128 -V105 -P4 +se_bang.mid: -E -R50 -G128 -V110 -P4 +se_berry_blender.mid: -E -R50 -G128 -V090 -P4 +se_bike_bell.mid: -E -R50 -G128 -V090 -P4 +se_bike_hop.mid: -E -R50 -G127 -V090 -P4 +se_boo.mid: -E -R50 -G127 -V110 -P4 +se_breakable_door.mid: -E -R50 -G128 -V110 -P4 +se_bridge_walk.mid: -E -R50 -G128 -V095 -P4 +se_card.mid: -E -R50 -G127 -V100 -P4 +se_click.mid: -E -R50 -G127 -V110 -P4 +se_contest_condition_lose.mid: -E -R50 -G127 -V110 -P4 +se_contest_curtain_fall.mid: -E -R50 -G128 -V070 -P5 +se_contest_curtain_rise.mid: -E -R50 -G128 -V070 -P5 +se_contest_heart.mid: -E -R50 -G128 -V090 -P5 +se_contest_icon_change.mid: -E -R50 -G128 -V110 -P5 +se_contest_icon_clear.mid: -E -R50 -G128 -V090 -P5 +se_contest_mons_turn.mid: -E -R50 -G128 -V090 -P5 +se_contest_place.mid: -E -R50 -G127 -V110 -P4 +se_dex_search.mid: -E -R50 -G127 -v100 -P5 +se_ding_dong.mid: -E -R50 -G127 -V090 -P5 +se_door.mid: -E -R50 -G127 -V080 -P5 +se_downpour_stop.mid: -E -R50 -G128 -V100 -P2 +se_downpour.mid: -E -R50 -G128 -V100 -P2 +se_e.mid: -E -R50 -G128 -V120 -P4 +se_effective.mid: -E -R50 -G127 -V110 -P5 +se_egg_hatch.mid: -E -R50 -G128 -V120 -P5 +se_elevator.mid: -E -R50 -G128 -V100 -P4 +se_escalator.mid: -E -R50 -G128 -V100 -P4 +se_exit.mid: -E -R50 -G127 -V120 -P5 +se_exp_max.mid: -E -R50 -G128 -V094 -P5 +se_exp.mid: -E -R50 -G127 -V080 -P5 +se_failure.mid: -E -R50 -G127 -V120 -P4 +se_faint.mid: -E -R50 -G127 -V110 -P5 +se_fall.mid: -E -R50 -G128 -V110 -P4 +se_field_poison.mid: -E -R50 -G127 -V110 -P5 +se_flee.mid: -E -R50 -G127 -V090 -P5 +se_fu_zaku.mid: -E -R50 -G127 -V120 -P4 +se_glass_flute.mid: -E -R50 -G128 -V105 -P5 +se_i.mid: -E -R50 -G128 -V120 -P4 +se_ice_break.mid: -E -R50 -G128 -V100 -P4 +se_ice_crack.mid: -E -R50 -G127 -V100 -P4 +se_ice_stairs.mid: -E -R50 -G128 -V090 -P4 +se_intro_blast.mid: -E -R50 -G127 -V100 -P5 +se_itemfinder.mid: -E -R50 -G127 -V090 -P5 +se_lavaridge_fall_warp.mid: -E -R50 -G127 -P4 +se_ledge.mid: -E -R50 -G127 -V100 -P4 +se_low_health.mid: -E -R50 -G127 -V100 -P3 +se_m_bind.mid: -E -R50 -G128 -V100 -P4 +se_m_comet_punch.mid: -E -R50 -G128 -V120 -P4 +se_m_cut.mid: -E -R50 -G128 -V120 -P4 +se_m_double_slap.mid: -E -R50 -G128 -V110 -P4 +se_m_fire_punch.mid: -E -R50 -G128 -V110 -P4 +se_m_fly.mid: -E -R50 -G128 -V110 -P4 +se_m_gust.mid: -E -R50 -G128 -V110 -P4 +se_m_gust2.mid: -E -R50 -G128 -V110 -P4 +se_m_headbutt.mid: -E -R50 -G128 -V110 -P4 +se_m_horn_attack.mid: -E -R50 -G128 -V110 -P4 +se_m_jump_kick.mid: -E -R50 -G128 -V110 -P4 +se_m_leer.mid: -E -R50 -G128 -V110 -P4 +se_m_mega_kick.mid: -E -R50 -G128 -V090 -P4 +se_m_mega_kick2.mid: -E -R50 -G128 -V110 -P4 +se_m_pay_day.mid: -E -R50 -G128 -V095 -P4 +se_m_razor_wind.mid: -E -R50 -G128 -V110 -P4 +se_m_razor_wind2.mid: -E -R50 -G128 -V090 -P4 +se_m_sand_attack.mid: -E -R50 -G128 -V110 -P4 +se_m_scratch.mid: -E -R50 -G128 -V110 -P4 +se_m_swords_dance.mid: -E -R50 -G128 -V100 -P4 +se_m_tail_whip.mid: -E -R50 -G128 -V110 -P4 +se_m_take_down.mid: -E -R50 -G128 -V105 -P4 +se_m_vicegrip.mid: -E -R50 -G128 -V110 -P4 +se_m_wing_attack.mid: -E -R50 -G128 -V105 -P4 +se_mud_ball.mid: -E -R50 -G128 -V110 -P4 +se_mugshot.mid: -E -R50 -G128 -V090 -P5 +se_n.mid: -E -R50 -G128 -P4 +se_not_effective.mid: -E -R50 -G127 -V110 -P5 +se_note_a.mid: -E -R50 -G128 -V110 -P4 +se_note_b.mid: -E -R50 -G128 -V110 -P4 +se_note_c_high.mid: -E -R50 -G128 -V110 -P4 +se_note_c.mid: -E -R50 -G128 -V110 -P4 +se_note_d.mid: -E -R50 -G128 -V110 -P4 +se_note_e.mid: -E -R50 -G128 -V110 -P4 +se_note_f.mid: -E -R50 -G128 -V110 -P4 +se_note_g.mid: -E -R50 -G128 -V110 -P4 +se_o.mid: -E -R50 -G128 -V120 -P4 +se_orb.mid: -E -R50 -G128 -V100 -P5 +se_pc_login.mid: -E -R50 -G127 -V100 -P5 +se_pc_off.mid: -E -R50 -G127 -V100 -P5 +se_pc_on.mid: -E -R50 -G127 -V100 -P5 +se_pike_curtain_close.mid: -E -R50 -G129 -P5 +se_pike_curtain_open.mid: -E -R50 -G129 -P5 +se_pin.mid: -E -R50 -G127 -V060 -P4 +se_pokenav_call.mid: -E -R50 -G129 -V120 -P5 +se_pokenav_hang_up.mid: -E -R50 -G129 -V110 -P5 +se_pokenav_off.mid: -E -R50 -G127 -V100 -P5 +se_pokenav_on.mid: -E -R50 -G127 -V100 -P5 +se_puddle.mid: -E -R50 -G128 -V020 -P4 +se_rain_stop.mid: -E -R50 -G128 -V080 -P2 +se_rain.mid: -E -R50 -G128 -V080 -P2 +se_repel.mid: -E -R50 -G127 -V090 -P4 +se_rg_bag_cursor.mid: -E -R50 -G129 -P5 +se_rg_bag_pocket.mid: -E -R50 -G129 -P5 +se_rg_ball_click.mid: -E -R50 -G129 -V100 -P5 +se_rg_card_flip.mid: -E -R50 -G129 -P5 +se_rg_card_flipping.mid: -E -R50 -G129 -P5 +se_rg_card_open.mid: -E -R50 -G129 -V112 -P5 +se_rg_deoxys_move.mid: -E -R50 -G129 -V080 -P5 +se_rg_door.mid: -E -R50 -G129 -V100 -P5 +se_rg_help_close.mid: -E -R50 -G129 -V095 -P5 +se_rg_help_error.mid: -E -R50 -G129 -V125 -P5 +se_rg_help_open.mid: -E -R50 -G129 -V096 -P5 +se_rg_poke_jump_failure.mid: -E -R50 -G127 -P5 +se_rg_poke_jump_success.mid: -E -R50 -G128 -V110 -P5 +se_rg_shop.mid: -E -R50 -G129 -V080 -P5 +se_rg_ss_anne_horn.mid: -E -R50 -G129 -V096 -P5 +se_rotating_gate.mid: -E -R50 -G128 -V090 -P4 +se_roulette_ball.mid: -E -R50 -G128 -V110 -P2 +se_roulette_ball2.mid: -E -R50 -G128 -V110 -P2 +se_save.mid: -E -R50 -G128 -V080 -P5 +se_select.mid: -E -R50 -G127 -V080 -P5 +se_shiny.mid: -E -R50 -G128 -V095 -P5 +se_ship.mid: -E -R50 -G127 -V075 -P4 +se_shop.mid: -E -R50 -G127 -V090 -P5 +se_sliding_door.mid: -E -R50 -G128 -V095 -P4 +se_success.mid: -E -R50 -G127 -V080 -P4 +se_sudowoodo_shake.mid: -E -R50 -G129 -V077 -P5 +se_super_effective.mid: -E -R50 -G127 -V110 -P5 +se_switch.mid: -E -R50 -G127 -V100 -P4 +se_taillow_wing_flap.mid: -E -R50 -G128 -V105 -P5 +se_thunder.mid: -E -R50 -G128 -V110 -P3 +se_thunder2.mid: -E -R50 -G128 -V110 -P3 +se_thunderstorm_stop.mid: -E -R50 -G128 -V080 -P2 +se_thunderstorm.mid: -E -R50 -G128 -V080 -P2 +se_truck_door.mid: -E -R50 -G128 -V110 -P4 +se_truck_move.mid: -E -R50 -G128 -P4 +se_truck_stop.mid: -E -R50 -G128 -P4 +se_truck_unload.mid: -E -R50 -G127 -P4 +se_u.mid: -E -R50 -G128 -P4 +se_unlock.mid: -E -R50 -G128 -V100 -P4 +se_use_item.mid: -E -R50 -G127 -V100 -P5 +se_vend.mid: -E -R50 -G128 -V110 -P4 +se_warp_in.mid: -E -R50 -G127 -V090 -P4 +se_warp_out.mid: -E -R50 -G127 -V090 -P4 \ No newline at end of file From cf1eaea7f7dbe438ab28a7949e94e9b0c453be74 Mon Sep 17 00:00:00 2001 From: Icedude907 <34080011+Icedude907@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:36:35 +1300 Subject: [PATCH 05/48] Coalesced audio rules into `audio.mk` --- Makefile | 9 +-------- songs.mk => audio_rules.mk | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 9 deletions(-) rename songs.mk => audio_rules.mk (58%) diff --git a/Makefile b/Makefile index 5c073b36ca18..df574e45451b 100644 --- a/Makefile +++ b/Makefile @@ -86,8 +86,6 @@ DATA_SRC_SUBDIR = src/data DATA_ASM_SUBDIR = data SONG_SUBDIR = sound/songs MID_SUBDIR = sound/songs/midi -SAMPLE_SUBDIR = sound/direct_sound_samples -CRY_SUBDIR = sound/direct_sound_samples/cries C_BUILDDIR = $(OBJ_DIR)/$(C_SUBDIR) GFLIB_BUILDDIR = $(OBJ_DIR)/$(GFLIB_SUBDIR) @@ -263,7 +261,7 @@ include graphics_file_rules.mk include map_data_rules.mk include spritesheet_rules.mk include json_data_rules.mk -include songs.mk +include audio_rules.mk %.s: ; %.png: ; @@ -277,8 +275,6 @@ include songs.mk %.gbapal: %.png ; $(GFX) $< $@ %.lz: % ; $(GFX) $< $@ %.rl: % ; $(GFX) $< $@ -$(CRY_SUBDIR)/%.bin: $(CRY_SUBDIR)/%.aif ; $(AIF) $< $@ --compress -sound/%.bin: sound/%.aif ; $(AIF) $< $@ ifeq ($(MODERN),0) @@ -393,9 +389,6 @@ $(foreach src, $(REGULAR_DATA_ASM_SRCS), $(eval $(call SRC_ASM_DATA_DEP,$(patsub endif endif -$(SONG_BUILDDIR)/%.o: $(SONG_SUBDIR)/%.s - $(AS) $(ASFLAGS) -I sound -o $@ $< - $(OBJ_DIR)/sym_bss.ld: sym_bss.txt $(RAMSCRGEN) .bss $< ENGLISH > $@ diff --git a/songs.mk b/audio_rules.mk similarity index 58% rename from songs.mk rename to audio_rules.mk index feef64cf5bff..69d482fdfa1c 100644 --- a/songs.mk +++ b/audio_rules.mk @@ -1,6 +1,28 @@ # This file contains rules for making assemblies for most music in the game. -MID_ASM_DIR = $(MID_SUBDIR) +CRY_SUBDIR := sound/direct_sound_samples/cries + +MID_ASM_DIR := $(MID_SUBDIR) +CRY_BIN_DIR := $(CRY_SUBDIR) +SOUND_BIN_DIR := sound + +SPECIAL_OUTDIRS := $(MID_ASM_DIR) $(CRY_BIN_DIR) +SPECIAL_OUTDIRS += $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/direct_sound_samples/phonemes $(SOUND_BIN_DIR)/direct_sound_samples/cries +$(shell mkdir -p $(SPECIAL_OUTDIRS) ) + +# Assembly song compilation +$(SONG_BUILDDIR)/%.o: $(SONG_SUBDIR)/%.s + $(AS) $(ASFLAGS) -I sound -o $@ $< +$(MID_BUILDDIR)/%.o: $(MID_ASM_DIR)/%.s + $(AS) $(ASFLAGS) -I sound -o $@ $< + +# Compressed cries +$(CRY_BIN_DIR)/%.bin: $(CRY_SUBDIR)/%.aif + $(AIF) $< $@ --compress + +# Uncompressed sounds +$(SOUND_BIN_DIR)/%.bin: sound/%.aif + $(AIF) $< $@ # For each line in midi.cfg, we do some trickery to convert it into a make rule for the `.mid` file described on the line # Data following the colon in said file corresponds to arguments passed into mid2agb From 5e4e522d9264cd6c6c139293887acda3cf5e0909 Mon Sep 17 00:00:00 2001 From: Icedude907 <34080011+Icedude907@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:33:25 +1300 Subject: [PATCH 06/48] `.cfg` edits now rebuild `.mid` --- audio_rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio_rules.mk b/audio_rules.mk index 69d482fdfa1c..fccb9fc548b9 100644 --- a/audio_rules.mk +++ b/audio_rules.mk @@ -30,7 +30,7 @@ MID_CFG_PATH := $(MID_SUBDIR)/midi.cfg # $1: Source path no extension, $2 Options define MID_RULE -$(MID_ASM_DIR)/$1.s: $(MID_SUBDIR)/$1.mid +$(MID_ASM_DIR)/$1.s: $(MID_SUBDIR)/$1.mid $(MID_CFG_PATH) $(MID) $$< $$@ $2 endef # source path, remaining text (options) From 5eea3d39cd50955e62904d146f67f65dc001b735 Mon Sep 17 00:00:00 2001 From: cawtds <38510667+cawtds@users.noreply.github.com> Date: Tue, 25 Jun 2024 21:53:05 +0200 Subject: [PATCH 07/48] UB fix ClockwiseWipe_TopRight --- src/battle_transition.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/battle_transition.c b/src/battle_transition.c index 11f9cddf4bb5..c23578e60817 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -1907,7 +1907,11 @@ static bool8 ClockwiseWipe_TopRight(struct Task *task) { sTransitionData->VBlank_DMA = FALSE; +#ifdef UBFIX + InitBlackWipe(sTransitionData->data, DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sTransitionData->tWipeEndX, 0, 1, 1); +#else InitBlackWipe(sTransitionData->data, DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sTransitionData->tWipeEndX, -1, 1, 1); +#endif do { gScanlineEffectRegBuffers[0][sTransitionData->tWipeCurrY] = (sTransitionData->tWipeCurrX + 1) | ((DISPLAY_WIDTH / 2) << 8); From 7d921fa89b877ec0a76d6441453c005fa516590d Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Wed, 14 Aug 2024 18:27:44 -0400 Subject: [PATCH 08/48] Slight storage system documentation --- src/pokemon_storage_system.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index b398b887527d..48eefd66fdef 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -4824,7 +4824,7 @@ static void MovePartySpriteToNextSlot(struct Sprite *sprite, u16 partyId) sprite->sMonY = (u16)(sprite->y) * 8; sprite->sSpeedX = ((x * 8) - sprite->sMonX) / 8; sprite->sSpeedY = ((y * 8) - sprite->sMonY) / 8; - sprite->data[6] = 8; + sprite->sMoveSteps = 8; sprite->callback = SpriteCB_MovePartyMonToNextSlot; } @@ -8258,7 +8258,7 @@ static bool8 MultiMove_GrabSelection(void) if (!DoMonPlaceChange()) { StartCursorAnim(CURSOR_ANIM_FIST); - MultiMove_InitMove(0, 256, 8); + MultiMove_InitMove(0, Q_8_8(1), 8); InitMultiMonPlaceChange(TRUE); sMultiMove->state++; } @@ -8291,7 +8291,7 @@ static bool8 MultiMove_PlaceMons(void) { case 0: MultiMove_SetPlacedMonData(); - MultiMove_InitMove(0, -256, 8); + MultiMove_InitMove(0, Q_8_8(-1), 8); InitMultiMonPlaceChange(FALSE); sMultiMove->state++; break; @@ -8335,25 +8335,25 @@ static bool8 MultiMove_TryMoveGroup(u8 dir) if (sMultiMove->minRow == 0) return FALSE; sMultiMove->minRow--; - MultiMove_InitMove(0, 1024, 6); + MultiMove_InitMove(0, Q_8_8(4), 6); break; case 1: // Down if (sMultiMove->minRow + sMultiMove->rowsTotal >= IN_BOX_ROWS) return FALSE; sMultiMove->minRow++; - MultiMove_InitMove(0, -1024, 6); + MultiMove_InitMove(0, Q_8_8(-4), 6); break; case 2: // Left if (sMultiMove->minColumn == 0) return FALSE; sMultiMove->minColumn--; - MultiMove_InitMove(1024, 0, 6); + MultiMove_InitMove(Q_8_8(4), 0, 6); break; case 3: // Right if (sMultiMove->minColumn + sMultiMove->columnsTotal >= IN_BOX_COLUMNS) return FALSE; sMultiMove->minColumn++; - MultiMove_InitMove(-1024, 0, 6); + MultiMove_InitMove(Q_8_8(-4), 0, 6); break; } return TRUE; From c1ee43254e7f9e5032fd61eac65e090c3a80049f Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 15 Aug 2024 19:34:56 +0200 Subject: [PATCH 09/48] Clean up defines lacking spaces --- include/battle.h | 16 ++++++++-------- include/battle_main.h | 6 +++--- include/battle_util.h | 6 +++--- include/constants/items.h | 4 ++-- include/data.h | 8 ++++---- include/gba/defines.h | 2 +- include/global.h | 4 ++-- include/mail.h | 2 +- include/menu_specialized.h | 2 +- include/random.h | 4 ++-- src/battle_setup.c | 2 +- src/data/decoration/tilemaps.h | 2 +- src/data/pokemon/experience_tables.h | 12 ++++++------ src/data/union_room.h | 8 ++++---- src/field_specials.c | 16 ++++++++-------- src/fieldmap.c | 2 +- src/frontier_pass.c | 2 +- src/link_rfu_2.c | 2 +- src/menu_specialized.c | 2 +- src/pokemon_jump.c | 2 +- src/pokenav_ribbons_summary.c | 2 +- src/region_map.c | 2 +- src/roulette.c | 10 +++++----- src/union_room_player_avatar.c | 2 +- 24 files changed, 60 insertions(+), 60 deletions(-) diff --git a/include/battle.h b/include/battle.h index eb25b96550b9..1edd784030dc 100644 --- a/include/battle.h +++ b/include/battle.h @@ -460,26 +460,26 @@ STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLER typeArg = gBattleMoves[move].type; \ } -#define IS_TYPE_PHYSICAL(moveType)(moveType < TYPE_MYSTERY) -#define IS_TYPE_SPECIAL(moveType)(moveType > TYPE_MYSTERY) +#define IS_TYPE_PHYSICAL(moveType) (moveType < TYPE_MYSTERY) +#define IS_TYPE_SPECIAL(moveType) (moveType > TYPE_MYSTERY) #define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0)) -#define IS_BATTLER_OF_TYPE(battlerId, type)((gBattleMons[battlerId].types[0] == type || gBattleMons[battlerId].types[1] == type)) +#define IS_BATTLER_OF_TYPE(battlerId, type) ((gBattleMons[battlerId].types[0] == type || gBattleMons[battlerId].types[1] == type)) #define SET_BATTLER_TYPE(battlerId, type) \ { \ gBattleMons[battlerId].types[0] = type; \ gBattleMons[battlerId].types[1] = type; \ } -#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8 -#define GET_STAT_BUFF_VALUE2(n)((n & 0xF0)) -#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40 +#define GET_STAT_BUFF_ID(n) ((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8 +#define GET_STAT_BUFF_VALUE2(n) ((n & 0xF0)) +#define GET_STAT_BUFF_VALUE(n) (((n >> 4) & 7)) // 0x10, 0x20, 0x40 #define STAT_BUFF_NEGATIVE 0x80 // 0x80, the sign bit -#define SET_STAT_BUFF_VALUE(n)((((n) << 4) & 0xF0)) +#define SET_STAT_BUFF_VALUE(n) ((((n) << 4) & 0xF0)) -#define SET_STATCHANGER(statId, stage, goesDown)(gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7)) +#define SET_STATCHANGER(statId, stage, goesDown) (gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7)) // NOTE: The members of this struct have hard-coded offsets // in include/constants/battle_script_commands.h diff --git a/include/battle_main.h b/include/battle_main.h index e3e0cb7ea4b2..ae970286ca16 100644 --- a/include/battle_main.h +++ b/include/battle_main.h @@ -23,9 +23,9 @@ struct MultiPartnerMenuPokemon }; // defines for the u8 array gTypeEffectiveness -#define TYPE_EFFECT_ATK_TYPE(i)((gTypeEffectiveness[i + 0])) -#define TYPE_EFFECT_DEF_TYPE(i)((gTypeEffectiveness[i + 1])) -#define TYPE_EFFECT_MULTIPLIER(i)((gTypeEffectiveness[i + 2])) +#define TYPE_EFFECT_ATK_TYPE(i) ((gTypeEffectiveness[i + 0])) +#define TYPE_EFFECT_DEF_TYPE(i) ((gTypeEffectiveness[i + 1])) +#define TYPE_EFFECT_MULTIPLIER(i) ((gTypeEffectiveness[i + 2])) // defines for the gTypeEffectiveness multipliers #define TYPE_MUL_NO_EFFECT 0 diff --git a/include/battle_util.h b/include/battle_util.h index c7de9aae86de..870990e9f596 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -33,9 +33,9 @@ #define ABILITYEFFECT_WATER_SPORT 254 #define ABILITYEFFECT_SWITCH_IN_WEATHER 255 -#define ABILITY_ON_OPPOSING_FIELD(battlerId, abilityId)(AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, battlerId, abilityId, 0, 0)) -#define ABILITY_ON_FIELD(abilityId)(AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, abilityId, 0, 0)) -#define ABILITY_ON_FIELD2(abilityId)(AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, abilityId, 0, 0)) +#define ABILITY_ON_OPPOSING_FIELD(battlerId, abilityId) (AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, battlerId, abilityId, 0, 0)) +#define ABILITY_ON_FIELD(abilityId) (AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, abilityId, 0, 0)) +#define ABILITY_ON_FIELD2(abilityId) (AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, abilityId, 0, 0)) // For the first argument of ItemBattleEffects, to deteremine which block of item effects to try #define ITEMEFFECT_ON_SWITCH_IN 0 diff --git a/include/constants/items.h b/include/constants/items.h index ed9bfb5ec82b..9e6fecf0142a 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -441,8 +441,8 @@ #define NUM_ROUTE_114_MAN_BERRIES (LAST_ROUTE_114_MAN_BERRY - FIRST_ROUTE_114_MAN_BERRY + 1) #define NUM_ROUTE_114_MAN_BERRIES_SKIPPED (FIRST_ROUTE_114_MAN_BERRY - FIRST_BERRY_INDEX) -#define ITEM_TO_BERRY(itemId)(((itemId) - FIRST_BERRY_INDEX) + 1) -#define ITEM_TO_MAIL(itemId)((itemId) - FIRST_MAIL_INDEX) +#define ITEM_TO_BERRY(itemId) (((itemId) - FIRST_BERRY_INDEX) + 1) +#define ITEM_TO_MAIL(itemId) ((itemId) - FIRST_MAIL_INDEX) #define MAIL_NONE 0xFF #define NUM_TECHNICAL_MACHINES 50 diff --git a/include/data.h b/include/data.h index 41b34d73e24f..558b1dfff395 100644 --- a/include/data.h +++ b/include/data.h @@ -28,9 +28,9 @@ struct MonCoords u8 y_offset; }; -#define MON_COORDS_SIZE(width, height)(DIV_ROUND_UP(width, 8) << 4 | DIV_ROUND_UP(height, 8)) -#define GET_MON_COORDS_WIDTH(size)((size >> 4) * 8) -#define GET_MON_COORDS_HEIGHT(size)((size & 0xF) * 8) +#define MON_COORDS_SIZE(width, height) (DIV_ROUND_UP(width, 8) << 4 | DIV_ROUND_UP(height, 8)) +#define GET_MON_COORDS_WIDTH(size) ((size >> 4) * 8) +#define GET_MON_COORDS_HEIGHT(size) ((size & 0xF) * 8) struct TrainerMonNoItemDefaultMoves { @@ -91,7 +91,7 @@ struct Trainer /*0x24*/ union TrainerMonPtr party; }; -#define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F)) +#define TRAINER_ENCOUNTER_MUSIC(trainer) ((gTrainers[trainer].encounterMusic_gender & 0x7F)) extern const u16 gMinigameDigits_Pal[]; extern const u32 gMinigameDigits_Gfx[]; diff --git a/include/gba/defines.h b/include/gba/defines.h index fa3a30fd6e22..febe6882cf35 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -75,7 +75,7 @@ #define DISPLAY_TILE_HEIGHT (DISPLAY_HEIGHT / TILE_HEIGHT) // Size of different tile formats in bytes -#define TILE_SIZE(bpp)((bpp) * TILE_WIDTH * TILE_HEIGHT / 8) +#define TILE_SIZE(bpp) ((bpp) * TILE_WIDTH * TILE_HEIGHT / 8) #define TILE_SIZE_1BPP TILE_SIZE(1) // 8 #define TILE_SIZE_4BPP TILE_SIZE(4) // 32 #define TILE_SIZE_8BPP TILE_SIZE(8) // 64 diff --git a/include/global.h b/include/global.h index 658af43da79c..00d608e672ad 100644 --- a/include/global.h +++ b/include/global.h @@ -89,7 +89,7 @@ // There are cases where GF does a&(n-1) where we would really like to have a%n, because // if n is changed to a value that isn't a power of 2 then a&(n-1) is unlikely to work as // intended, and a%n for powers of 2 isn't always optimized to use &. -#define MOD(a, n)(((n) & ((n)-1)) ? ((a) % (n)) : ((a) & ((n)-1))) +#define MOD(a, n) (((n) & ((n)-1)) ? ((a) % (n)) : ((a) & ((n)-1))) // Extracts the upper 16 bits of a 32-bit number #define HIHALF(n) (((n) & 0xFFFF0000) >> 16) @@ -130,7 +130,7 @@ f; \ }) -#define DIV_ROUND_UP(val, roundBy)(((val) / (roundBy)) + (((val) % (roundBy)) ? 1 : 0)) +#define DIV_ROUND_UP(val, roundBy) (((val) / (roundBy)) + (((val) % (roundBy)) ? 1 : 0)) #define ROUND_BITS_TO_BYTES(numBits) DIV_ROUND_UP(numBits, 8) diff --git a/include/mail.h b/include/mail.h index f4590a70ec44..403078f0975f 100644 --- a/include/mail.h +++ b/include/mail.h @@ -1,7 +1,7 @@ #ifndef GUARD_MAIL_H #define GUARD_MAIL_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_GLITTER_MAIL \ || itemId == ITEM_MECH_MAIL \ diff --git a/include/menu_specialized.h b/include/menu_specialized.h index 06a188b8a06f..152afb59ac9e 100644 --- a/include/menu_specialized.h +++ b/include/menu_specialized.h @@ -44,7 +44,7 @@ enum { // The number of extra sparkles shown on a Pokémon's condition screen. // All Pokémon start with 1, so the max here is MAX_CONDITION_SPARKLES - 1 -#define GET_NUM_CONDITION_SPARKLES(sheen)((sheen) != MAX_SHEEN) ? (sheen) / ((u32)MAX_SHEEN / (MAX_CONDITION_SPARKLES - 1) + 1) : MAX_CONDITION_SPARKLES - 1; +#define GET_NUM_CONDITION_SPARKLES(sheen) ((sheen) != MAX_SHEEN) ? (sheen) / ((u32)MAX_SHEEN / (MAX_CONDITION_SPARKLES - 1) + 1) : MAX_CONDITION_SPARKLES - 1; #define CONDITION_GRAPH_TOP_Y 56 #define CONDITION_GRAPH_BOTTOM_Y 121 diff --git a/include/random.h b/include/random.h index 6bf61de6c6e6..ba7aeccc1a03 100644 --- a/include/random.h +++ b/include/random.h @@ -13,8 +13,8 @@ u16 Random2(void); // The number 1103515245 comes from the example implementation of rand and srand // in the ISO C standard. -#define ISO_RANDOMIZE1(val)(1103515245 * (val) + 24691) -#define ISO_RANDOMIZE2(val)(1103515245 * (val) + 12345) +#define ISO_RANDOMIZE1(val) (1103515245 * (val) + 24691) +#define ISO_RANDOMIZE2(val) (1103515245 * (val) + 12345) //Sets the initial seed value of the pseudorandom number generator void SeedRng(u16 seed); diff --git a/src/battle_setup.c b/src/battle_setup.c index e87ce6dd2718..be5b09e5e5a0 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -859,7 +859,7 @@ static u8 GetTrainerBattleTransition(void) return sBattleTransitionTable_Trainer[transitionType][1]; } -#define RANDOM_TRANSITION(table)(table[Random() % ARRAY_COUNT(table)]) +#define RANDOM_TRANSITION(table) (table[Random() % ARRAY_COUNT(table)]) u8 GetSpecialBattleTransition(s32 id) { u16 var; diff --git a/src/data/decoration/tilemaps.h b/src/data/decoration/tilemaps.h index eebb3acb251d..d6c351ae85f3 100644 --- a/src/data/decoration/tilemaps.h +++ b/src/data/decoration/tilemaps.h @@ -171,7 +171,7 @@ static const u8 sDecorTilemap_3x2_X[] = { 0x06, 0x07, 0x06, 0x07, 0x06, 0x07 }; -#define DECORSIZE(width, height)((width) * (height) * 4) +#define DECORSIZE(width, height) ((width) * (height) * 4) static const struct { const u8 *tiles; diff --git a/src/data/pokemon/experience_tables.h b/src/data/pokemon/experience_tables.h index 8f50e1091856..848d5c5016bd 100644 --- a/src/data/pokemon/experience_tables.h +++ b/src/data/pokemon/experience_tables.h @@ -1,10 +1,10 @@ -#define SQUARE(n)((n) * (n)) -#define CUBE(n)((n) * (n) * (n)) +#define SQUARE(n) ((n) * (n)) +#define CUBE(n) ((n) * (n) * (n)) -#define EXP_SLOW(n)((5 * CUBE(n)) / 4) // (5 * (n)^3) / 4 -#define EXP_FAST(n)((4 * CUBE(n)) / 5) // (4 * (n)^3) / 5 -#define EXP_MEDIUM_FAST(n)(CUBE(n)) // (n)^3 -#define EXP_MEDIUM_SLOW(n)((6 * CUBE(n)) / 5 - (15 * SQUARE(n)) + (100 * n) - 140) // (6 * (n)^3) / 5 - (15 * (n)^2) + (100 * n) - 140 +#define EXP_SLOW(n) ((5 * CUBE(n)) / 4) // (5 * (n)^3) / 4 +#define EXP_FAST(n) ((4 * CUBE(n)) / 5) // (4 * (n)^3) / 5 +#define EXP_MEDIUM_FAST(n) (CUBE(n)) // (n)^3 +#define EXP_MEDIUM_SLOW(n) ((6 * CUBE(n)) / 5 - (15 * SQUARE(n)) + (100 * n) - 140) // (6 * (n)^3) / 5 - (15 * (n)^2) + (100 * n) - 140 #define EXP_ERRATIC(n) \ (n <= 50) ? ((100 - n) * CUBE(n) / 50) \ :(n <= 68) ? ((150 - n) * CUBE(n) / 100) \ diff --git a/src/data/union_room.h b/src/data/union_room.h index 129c62994114..c4bd98473607 100644 --- a/src/data/union_room.h +++ b/src/data/union_room.h @@ -633,10 +633,10 @@ static const struct WindowTemplate sWindowTemplate_BButtonCancel = { // Minimum and maximum number of players for a link group // A minimum of 0 means the min and max are equal -#define LINK_GROUP_CAPACITY(min, max)(((min) << 12) | ((max) << 8)) -#define GROUP_MAX(capacity)(capacity & 0x0F) -#define GROUP_MIN(capacity)(capacity >> 4) -#define GROUP_MIN2(capacity)(capacity & 0xF0) // Unnecessary to have both, but needed to match +#define LINK_GROUP_CAPACITY(min, max) (((min) << 12) | ((max) << 8)) +#define GROUP_MAX(capacity) (capacity & 0x0F) +#define GROUP_MIN(capacity) (capacity >> 4) +#define GROUP_MIN2(capacity) (capacity & 0xF0) // Unnecessary to have both, but needed to match static const u32 sLinkGroupToActivityAndCapacity[NUM_LINK_GROUP_TYPES] = { [LINK_GROUP_SINGLE_BATTLE] = ACTIVITY_BATTLE_SINGLE | LINK_GROUP_CAPACITY(0, 2), diff --git a/src/field_specials.c b/src/field_specials.c index 7d20d3571d0c..d8fc96c49d46 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -3957,14 +3957,14 @@ bool8 InPokemonCenter(void) #define FANCLUB_BITFIELD (gSaveBlock1Ptr->vars[VAR_FANCLUB_FAN_COUNTER - VARS_START]) #define FANCLUB_COUNTER 0x007F -#define GET_TRAINER_FAN_CLUB_FLAG(flag) (FANCLUB_BITFIELD >> (flag) & 1) -#define SET_TRAINER_FAN_CLUB_FLAG(flag) (FANCLUB_BITFIELD |= 1 << (flag)) -#define FLIP_TRAINER_FAN_CLUB_FLAG(flag)(FANCLUB_BITFIELD ^= 1 << (flag)) - -#define GET_TRAINER_FAN_CLUB_COUNTER (FANCLUB_BITFIELD & FANCLUB_COUNTER) -#define SET_TRAINER_FAN_CLUB_COUNTER(count) (FANCLUB_BITFIELD = (FANCLUB_BITFIELD & ~FANCLUB_COUNTER) | (count)) -#define INCR_TRAINER_FAN_CLUB_COUNTER(count)(FANCLUB_BITFIELD += (count)) -#define CLEAR_TRAINER_FAN_CLUB_COUNTER (FANCLUB_BITFIELD &= ~FANCLUB_COUNTER) +#define GET_TRAINER_FAN_CLUB_FLAG(flag) (FANCLUB_BITFIELD >> (flag) & 1) +#define SET_TRAINER_FAN_CLUB_FLAG(flag) (FANCLUB_BITFIELD |= 1 << (flag)) +#define FLIP_TRAINER_FAN_CLUB_FLAG(flag) (FANCLUB_BITFIELD ^= 1 << (flag)) + +#define GET_TRAINER_FAN_CLUB_COUNTER (FANCLUB_BITFIELD & FANCLUB_COUNTER) +#define SET_TRAINER_FAN_CLUB_COUNTER(count) (FANCLUB_BITFIELD = (FANCLUB_BITFIELD & ~FANCLUB_COUNTER) | (count)) +#define INCR_TRAINER_FAN_CLUB_COUNTER(count) (FANCLUB_BITFIELD += (count)) +#define CLEAR_TRAINER_FAN_CLUB_COUNTER (FANCLUB_BITFIELD &= ~FANCLUB_COUNTER) void ResetFanClub(void) { diff --git a/src/fieldmap.c b/src/fieldmap.c index 5fdc4cbfb721..e4dc0026a388 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -48,7 +48,7 @@ static const struct MapConnection *GetIncomingConnection(u8 direction, int x, in static bool8 IsPosInIncomingConnectingMap(u8 direction, int x, int y, const struct MapConnection *connection); static bool8 IsCoordInIncomingConnectingMap(int coord, int srcMax, int destMax, int offset); -#define GetBorderBlockAt(x, y)({ \ +#define GetBorderBlockAt(x, y) ({ \ u16 block; \ int i; \ const u16 *border = gMapHeader.mapLayout->border; /* Unused, they read it again below */ \ diff --git a/src/frontier_pass.c b/src/frontier_pass.c index 07e06ad3b9a3..a351d81ce940 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -1241,7 +1241,7 @@ static void ShowHideZoomingArea(bool8 show, bool8 zoomedIn) static void UpdateAreaHighlight(u8 cursorArea, u8 previousCursorArea) { - #define NON_HIGHLIGHT_AREA(area)((area) == CURSOR_AREA_NOTHING || (area) > CURSOR_AREA_CANCEL) + #define NON_HIGHLIGHT_AREA(area) ((area) == CURSOR_AREA_NOTHING || (area) > CURSOR_AREA_CANCEL) // If moving off highlightable area, unhighlight it switch (previousCursorArea) diff --git a/src/link_rfu_2.c b/src/link_rfu_2.c index 9979097a49a9..b34c7184cf0a 100644 --- a/src/link_rfu_2.c +++ b/src/link_rfu_2.c @@ -138,7 +138,7 @@ static const u8 sAvailSlots[] = { [4] = AVAIL_SLOT4 }; -#define BLOCK_MASK(bitNum)((1 << (bitNum)) - 1) +#define BLOCK_MASK(bitNum) ((1 << (bitNum)) - 1) static const u32 sAllBlocksReceived[] = { BLOCK_MASK(0), BLOCK_MASK(1), diff --git a/src/menu_specialized.c b/src/menu_specialized.c index 20ddce1f44e7..1272277aa550 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -317,7 +317,7 @@ void MailboxMenu_Free(void) // filled with the graph color. //--------------------------------------- -#define SHIFT_RIGHT_ADJUSTED(n, s)(((n) >> (s)) + (((n) >> ((s) - 1)) & 1)) +#define SHIFT_RIGHT_ADJUSTED(n, s) (((n) >> (s)) + (((n) >> ((s) - 1)) & 1)) void ConditionGraph_Init(struct ConditionGraph *graph) { diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c index d744ff66505b..a1c401c6df4a 100755 --- a/src/pokemon_jump.c +++ b/src/pokemon_jump.c @@ -108,7 +108,7 @@ enum { // the lower 8 bits are a timer to the next state. // When the timer is incremented above 255, it increments // the vine state and the timer is reset. -#define VINE_STATE_TIMER(vineState)(((vineState) << 8) | 0xFF) +#define VINE_STATE_TIMER(vineState) (((vineState) << 8) | 0xFF) enum { MONSTATE_NORMAL, // Pokémon is either on the ground or in the middle of a jump diff --git a/src/pokenav_ribbons_summary.c b/src/pokenav_ribbons_summary.c index e77f839a808c..c799daf57bbf 100644 --- a/src/pokenav_ribbons_summary.c +++ b/src/pokenav_ribbons_summary.c @@ -1080,7 +1080,7 @@ enum { RIBBONGFX_GIFT_3, }; -#define TO_PAL_OFFSET(palNum)((palNum) - PALTAG_RIBBON_ICONS_1) +#define TO_PAL_OFFSET(palNum) ((palNum) - PALTAG_RIBBON_ICONS_1) struct { diff --git a/src/region_map.c b/src/region_map.c index 21c6314d30a2..8fa53a0e7b98 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -189,7 +189,7 @@ static const u16 sTerraOrMarineCaveMapSecIds[ABNORMAL_WEATHER_LOCATIONS] = [ABNORMAL_WEATHER_ROUTE_129_EAST - 1] = MAPSEC_ROUTE_129 }; -#define MARINE_CAVE_COORD(location)(ABNORMAL_WEATHER_##location - MARINE_CAVE_LOCATIONS_START) +#define MARINE_CAVE_COORD(location) (ABNORMAL_WEATHER_##location - MARINE_CAVE_LOCATIONS_START) static const struct UCoords16 sMarineCaveLocationCoords[MARINE_CAVE_LOCATIONS] = { diff --git a/src/roulette.c b/src/roulette.c index ec4c8cfcfeb3..f4e6012a8dcd 100644 --- a/src/roulette.c +++ b/src/roulette.c @@ -70,13 +70,13 @@ // Get the id of the col/row from the selection ID // e.g. GET_ROW(SQU_PURPLE_SKITTY) is ROW_PURPLE -#define GET_COL(selectionId)((selectionId) % (NUM_BOARD_POKES + 1)) -#define GET_ROW(selectionId)((selectionId) / (NUM_BOARD_POKES + 1) * (NUM_BOARD_POKES + 1)) +#define GET_COL(selectionId) ((selectionId) % (NUM_BOARD_POKES + 1)) +#define GET_ROW(selectionId) ((selectionId) / (NUM_BOARD_POKES + 1) * (NUM_BOARD_POKES + 1)) // Get the col/row index from the selection ID // e.g. GET_ROW_IDX(SQU_PURPLE_SKITTY) is 2 (purple being the 3rd row) -#define GET_COL_IDX(selectionId)(selectionId - 1) -#define GET_ROW_IDX(selectionId)(selectionId / 5 - 1) +#define GET_COL_IDX(selectionId) (selectionId - 1) +#define GET_ROW_IDX(selectionId) (selectionId / 5 - 1) // Flags for the above selections, used to set which spaces have been hit or bet on #define F_WYNAUT_COL (1 << COL_WYNAUT) @@ -149,7 +149,7 @@ // 2 different Roulette tables with 2 different rates (normal vs service day special) // & 1 gets which table, >> 7 gets if ROULETTE_SPECIAL_RATE is set -#define GET_MIN_BET_ID(var)(((var) & 1) + (((var) >> 7) * 2)) +#define GET_MIN_BET_ID(var) (((var) & 1) + (((var) >> 7) * 2)) // Having Shroomish or Taillow in the party can make rolls more consistent in length // It also increases the likelihood that, if they appear to unstick a ball, they'll move it to a slot the player bet on diff --git a/src/union_room_player_avatar.c b/src/union_room_player_avatar.c index a7d5045b38ad..1bb7968359c0 100644 --- a/src/union_room_player_avatar.c +++ b/src/union_room_player_avatar.c @@ -14,7 +14,7 @@ // Each parent player can lead a group of up to MAX_RFU_PLAYERS (including themselves). // Multiply the leader's id by MAX_RFU_PLAYERS and add the member's id (0 if the leader) to // get the sprite index of that player. -#define UR_PLAYER_SPRITE_ID(leaderId, memberId)(MAX_RFU_PLAYERS * leaderId + memberId) +#define UR_PLAYER_SPRITE_ID(leaderId, memberId) (MAX_RFU_PLAYERS * leaderId + memberId) static EWRAM_DATA struct UnionRoomObject * sUnionObjWork = NULL; static EWRAM_DATA u32 sUnionObjRefreshTimer = 0; From 3f49c5cbaf5bd8bdb02cb54d0a44e61faba114f4 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 7 Aug 2024 16:24:30 -0400 Subject: [PATCH 10/48] Fix trainer match call flags --- include/constants/flags.h | 164 +++++++++++++++++----------------- include/constants/rematches.h | 89 ++++++++++++++++++ include/gym_leader_rematch.h | 85 +----------------- map_data_rules.mk | 4 +- src/battle_setup.c | 4 +- src/field_specials.c | 2 +- src/match_call.c | 11 +-- src/pokenav_match_call_data.c | 16 ++-- src/pokenav_match_call_list.c | 2 +- 9 files changed, 194 insertions(+), 183 deletions(-) create mode 100644 include/constants/rematches.h diff --git a/include/constants/flags.h b/include/constants/flags.h index 8d98e3aa0491..5b1b5efd190d 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -2,6 +2,7 @@ #define GUARD_CONSTANTS_FLAGS_H #include "constants/opponents.h" +#include "constants/rematches.h" // Temporary Flags // These temporary flags are are cleared every time a map is loaded. They are used @@ -375,86 +376,89 @@ #define FLAG_MET_FRONTIER_BEAUTY_MOVE_TUTOR 0x15A #define FLAG_MET_FRONTIER_SWIMMER_MOVE_TUTOR 0x15B -// Trainer Rematch Flags -#define FLAG_MATCH_CALL_REGISTERED 0x15C -#define FLAG_REMATCH_ROSE 0x15D -#define FLAG_REMATCH_ANDRES 0x15E -#define FLAG_REMATCH_DUSTY 0x15F -#define FLAG_REMATCH_LOLA 0x160 -#define FLAG_REMATCH_RICKY 0x161 -#define FLAG_REMATCH_LILA_AND_ROY 0x162 -#define FLAG_REMATCH_CRISTIN 0x163 -#define FLAG_REMATCH_BROOKE 0x164 -#define FLAG_REMATCH_WILTON 0x165 -#define FLAG_REMATCH_VALERIE 0x166 -#define FLAG_REMATCH_CINDY 0x167 -#define FLAG_REMATCH_THALIA 0x168 -#define FLAG_REMATCH_JESSICA 0x169 -#define FLAG_REMATCH_WINSTON 0x16A -#define FLAG_REMATCH_STEVE 0x16B -#define FLAG_REMATCH_TONY 0x16C -#define FLAG_REMATCH_NOB 0x16D -#define FLAG_REMATCH_KOJI 0x16E -#define FLAG_REMATCH_FERNANDO 0x16F -#define FLAG_REMATCH_DALTON 0x170 -#define FLAG_REMATCH_BERNIE 0x171 -#define FLAG_REMATCH_ETHAN 0x172 -#define FLAG_REMATCH_JOHN_AND_JAY 0x173 -#define FLAG_REMATCH_JEFFREY 0x174 -#define FLAG_REMATCH_CAMERON 0x175 -#define FLAG_REMATCH_JACKI 0x176 -#define FLAG_REMATCH_WALTER 0x177 -#define FLAG_REMATCH_KAREN 0x178 -#define FLAG_REMATCH_JERRY 0x179 -#define FLAG_REMATCH_ANNA_AND_MEG 0x17A -#define FLAG_REMATCH_ISABEL 0x17B -#define FLAG_REMATCH_MIGUEL 0x17C -#define FLAG_REMATCH_TIMOTHY 0x17D -#define FLAG_REMATCH_SHELBY 0x17E -#define FLAG_REMATCH_CALVIN 0x17F -#define FLAG_REMATCH_ELLIOT 0x180 -#define FLAG_REMATCH_ISAIAH 0x181 -#define FLAG_REMATCH_MARIA 0x182 -#define FLAG_REMATCH_ABIGAIL 0x183 -#define FLAG_REMATCH_DYLAN 0x184 -#define FLAG_REMATCH_KATELYN 0x185 -#define FLAG_REMATCH_BENJAMIN 0x186 -#define FLAG_REMATCH_PABLO 0x187 -#define FLAG_REMATCH_NICOLAS 0x188 -#define FLAG_REMATCH_ROBERT 0x189 -#define FLAG_REMATCH_LAO 0x18A -#define FLAG_REMATCH_CYNDY 0x18B -#define FLAG_REMATCH_MADELINE 0x18C -#define FLAG_REMATCH_JENNY 0x18D -#define FLAG_REMATCH_DIANA 0x18E -#define FLAG_REMATCH_AMY_AND_LIV 0x18F -#define FLAG_REMATCH_ERNEST 0x190 -#define FLAG_REMATCH_CORY 0x191 -#define FLAG_REMATCH_EDWIN 0x192 -#define FLAG_REMATCH_LYDIA 0x193 -#define FLAG_REMATCH_ISAAC 0x194 -#define FLAG_REMATCH_GABRIELLE 0x195 -#define FLAG_REMATCH_CATHERINE 0x196 -#define FLAG_REMATCH_JACKSON 0x197 -#define FLAG_REMATCH_HALEY 0x198 -#define FLAG_REMATCH_JAMES 0x199 -#define FLAG_REMATCH_TRENT 0x19A -#define FLAG_REMATCH_SAWYER 0x19B -#define FLAG_REMATCH_KIRA_AND_DAN 0x19C -#define FLAG_REMATCH_WALLY 0x19D -#define FLAG_REMATCH_ROXANNE 0x19E -#define FLAG_REMATCH_BRAWLY 0x19F -#define FLAG_REMATCH_WATTSON 0x1A0 -#define FLAG_REMATCH_FLANNERY 0x1A1 -#define FLAG_REMATCH_NORMAN 0x1A2 -#define FLAG_REMATCH_WINONA 0x1A3 -#define FLAG_REMATCH_TATE_AND_LIZA 0x1A4 -// Note: FLAG_REMATCH_JUAN is handled by FLAG_ENABLE_JUAN_MATCH_CALL instead. -#define FLAG_REMATCH_SIDNEY 0x1A5 -#define FLAG_REMATCH_PHOEBE 0x1A6 -#define FLAG_REMATCH_GLACIA 0x1A7 -#define FLAG_REMATCH_DRAKE 0x1A8 -#define FLAG_REMATCH_WALLACE 0x1A9 +// Flags for whether a rematchable trainer has been registered in the player's Match Call. +// Most are used implicitly by adding their REMATCH_* id to TRAINER_REGISTERED_FLAGS_START. +// Some Match Call entries (like those for gym leaders, Wally, and all non-trainer NPCs like Prof. Birch) +// have their own separate flag that needs to be set to be enabled; see src/pokenav_match_call_data.c +#define TRAINER_REGISTERED_FLAGS_START 0x15C +#define FLAG_REGISTERED_ROSE (TRAINER_REGISTERED_FLAGS_START + REMATCH_ROSE) +#define FLAG_REGISTERED_ANDRES (TRAINER_REGISTERED_FLAGS_START + REMATCH_ANDRES) +#define FLAG_REGISTERED_DUSTY (TRAINER_REGISTERED_FLAGS_START + REMATCH_DUSTY) +#define FLAG_REGISTERED_LOLA (TRAINER_REGISTERED_FLAGS_START + REMATCH_LOLA) +#define FLAG_REGISTERED_RICKY (TRAINER_REGISTERED_FLAGS_START + REMATCH_RICKY) +#define FLAG_REGISTERED_LILA_AND_ROY (TRAINER_REGISTERED_FLAGS_START + REMATCH_LILA_AND_ROY) +#define FLAG_REGISTERED_CRISTIN (TRAINER_REGISTERED_FLAGS_START + REMATCH_CRISTIN) +#define FLAG_REGISTERED_BROOKE (TRAINER_REGISTERED_FLAGS_START + REMATCH_BROOKE) +#define FLAG_REGISTERED_WILTON (TRAINER_REGISTERED_FLAGS_START + REMATCH_WILTON) +#define FLAG_REGISTERED_VALERIE (TRAINER_REGISTERED_FLAGS_START + REMATCH_VALERIE) +#define FLAG_REGISTERED_CINDY (TRAINER_REGISTERED_FLAGS_START + REMATCH_CINDY) +#define FLAG_REGISTERED_THALIA (TRAINER_REGISTERED_FLAGS_START + REMATCH_THALIA) +#define FLAG_REGISTERED_JESSICA (TRAINER_REGISTERED_FLAGS_START + REMATCH_JESSICA) +#define FLAG_REGISTERED_WINSTON (TRAINER_REGISTERED_FLAGS_START + REMATCH_WINSTON) +#define FLAG_REGISTERED_STEVE (TRAINER_REGISTERED_FLAGS_START + REMATCH_STEVE) +#define FLAG_REGISTERED_TONY (TRAINER_REGISTERED_FLAGS_START + REMATCH_TONY) +#define FLAG_REGISTERED_NOB (TRAINER_REGISTERED_FLAGS_START + REMATCH_NOB) +#define FLAG_REGISTERED_KOJI (TRAINER_REGISTERED_FLAGS_START + REMATCH_KOJI) +#define FLAG_REGISTERED_FERNANDO (TRAINER_REGISTERED_FLAGS_START + REMATCH_FERNANDO) +#define FLAG_REGISTERED_DALTON (TRAINER_REGISTERED_FLAGS_START + REMATCH_DALTON) +#define FLAG_REGISTERED_BERNIE (TRAINER_REGISTERED_FLAGS_START + REMATCH_BERNIE) +#define FLAG_REGISTERED_ETHAN (TRAINER_REGISTERED_FLAGS_START + REMATCH_ETHAN) +#define FLAG_REGISTERED_JOHN_AND_JAY (TRAINER_REGISTERED_FLAGS_START + REMATCH_JOHN_AND_JAY) +#define FLAG_REGISTERED_JEFFREY (TRAINER_REGISTERED_FLAGS_START + REMATCH_JEFFREY) +#define FLAG_REGISTERED_CAMERON (TRAINER_REGISTERED_FLAGS_START + REMATCH_CAMERON) +#define FLAG_REGISTERED_JACKI (TRAINER_REGISTERED_FLAGS_START + REMATCH_JACKI) +#define FLAG_REGISTERED_WALTER (TRAINER_REGISTERED_FLAGS_START + REMATCH_WALTER) +#define FLAG_REGISTERED_KAREN (TRAINER_REGISTERED_FLAGS_START + REMATCH_KAREN) +#define FLAG_REGISTERED_JERRY (TRAINER_REGISTERED_FLAGS_START + REMATCH_JERRY) +#define FLAG_REGISTERED_ANNA_AND_MEG (TRAINER_REGISTERED_FLAGS_START + REMATCH_ANNA_AND_MEG) +#define FLAG_REGISTERED_ISABEL (TRAINER_REGISTERED_FLAGS_START + REMATCH_ISABEL) +#define FLAG_REGISTERED_MIGUEL (TRAINER_REGISTERED_FLAGS_START + REMATCH_MIGUEL) +#define FLAG_REGISTERED_TIMOTHY (TRAINER_REGISTERED_FLAGS_START + REMATCH_TIMOTHY) +#define FLAG_REGISTERED_SHELBY (TRAINER_REGISTERED_FLAGS_START + REMATCH_SHELBY) +#define FLAG_REGISTERED_CALVIN (TRAINER_REGISTERED_FLAGS_START + REMATCH_CALVIN) +#define FLAG_REGISTERED_ELLIOT (TRAINER_REGISTERED_FLAGS_START + REMATCH_ELLIOT) +#define FLAG_REGISTERED_ISAIAH (TRAINER_REGISTERED_FLAGS_START + REMATCH_ISAIAH) +#define FLAG_REGISTERED_MARIA (TRAINER_REGISTERED_FLAGS_START + REMATCH_MARIA) +#define FLAG_REGISTERED_ABIGAIL (TRAINER_REGISTERED_FLAGS_START + REMATCH_ABIGAIL) +#define FLAG_REGISTERED_DYLAN (TRAINER_REGISTERED_FLAGS_START + REMATCH_DYLAN) +#define FLAG_REGISTERED_KATELYN (TRAINER_REGISTERED_FLAGS_START + REMATCH_KATELYN) +#define FLAG_REGISTERED_BENJAMIN (TRAINER_REGISTERED_FLAGS_START + REMATCH_BENJAMIN) +#define FLAG_REGISTERED_PABLO (TRAINER_REGISTERED_FLAGS_START + REMATCH_PABLO) +#define FLAG_REGISTERED_NICOLAS (TRAINER_REGISTERED_FLAGS_START + REMATCH_NICOLAS) +#define FLAG_REGISTERED_ROBERT (TRAINER_REGISTERED_FLAGS_START + REMATCH_ROBERT) +#define FLAG_REGISTERED_LAO (TRAINER_REGISTERED_FLAGS_START + REMATCH_LAO) +#define FLAG_REGISTERED_CYNDY (TRAINER_REGISTERED_FLAGS_START + REMATCH_CYNDY) +#define FLAG_REGISTERED_MADELINE (TRAINER_REGISTERED_FLAGS_START + REMATCH_MADELINE) +#define FLAG_REGISTERED_JENNY (TRAINER_REGISTERED_FLAGS_START + REMATCH_JENNY) +#define FLAG_REGISTERED_DIANA (TRAINER_REGISTERED_FLAGS_START + REMATCH_DIANA) +#define FLAG_REGISTERED_AMY_AND_LIV (TRAINER_REGISTERED_FLAGS_START + REMATCH_AMY_AND_LIV) +#define FLAG_REGISTERED_ERNEST (TRAINER_REGISTERED_FLAGS_START + REMATCH_ERNEST) +#define FLAG_REGISTERED_CORY (TRAINER_REGISTERED_FLAGS_START + REMATCH_CORY) +#define FLAG_REGISTERED_EDWIN (TRAINER_REGISTERED_FLAGS_START + REMATCH_EDWIN) +#define FLAG_REGISTERED_LYDIA (TRAINER_REGISTERED_FLAGS_START + REMATCH_LYDIA) +#define FLAG_REGISTERED_ISAAC (TRAINER_REGISTERED_FLAGS_START + REMATCH_ISAAC) +#define FLAG_REGISTERED_GABRIELLE (TRAINER_REGISTERED_FLAGS_START + REMATCH_GABRIELLE) +#define FLAG_REGISTERED_CATHERINE (TRAINER_REGISTERED_FLAGS_START + REMATCH_CATHERINE) +#define FLAG_REGISTERED_JACKSON (TRAINER_REGISTERED_FLAGS_START + REMATCH_JACKSON) +#define FLAG_REGISTERED_HALEY (TRAINER_REGISTERED_FLAGS_START + REMATCH_HALEY) +#define FLAG_REGISTERED_JAMES (TRAINER_REGISTERED_FLAGS_START + REMATCH_JAMES) +#define FLAG_REGISTERED_TRENT (TRAINER_REGISTERED_FLAGS_START + REMATCH_TRENT) +#define FLAG_REGISTERED_SAWYER (TRAINER_REGISTERED_FLAGS_START + REMATCH_SAWYER) +#define FLAG_REGISTERED_KIRA_AND_DAN (TRAINER_REGISTERED_FLAGS_START + REMATCH_KIRA_AND_DAN) +#define FLAG_REGISTERED_WALLY (TRAINER_REGISTERED_FLAGS_START + REMATCH_WALLY) +#define FLAG_REGISTERED_ROXANNE (TRAINER_REGISTERED_FLAGS_START + REMATCH_ROXANNE) +#define FLAG_REGISTERED_BRAWLY (TRAINER_REGISTERED_FLAGS_START + REMATCH_BRAWLY) +#define FLAG_REGISTERED_WATTSON (TRAINER_REGISTERED_FLAGS_START + REMATCH_WATTSON) +#define FLAG_REGISTERED_FLANNERY (TRAINER_REGISTERED_FLAGS_START + REMATCH_FLANNERY) +#define FLAG_REGISTERED_NORMAN (TRAINER_REGISTERED_FLAGS_START + REMATCH_NORMAN) +#define FLAG_REGISTERED_WINONA (TRAINER_REGISTERED_FLAGS_START + REMATCH_WINONA) +#define FLAG_REGISTERED_TATE_AND_LIZA (TRAINER_REGISTERED_FLAGS_START + REMATCH_TATE_AND_LIZA) +#define FLAG_REGISTERED_JUAN (TRAINER_REGISTERED_FLAGS_START + REMATCH_JUAN) +#define FLAG_REGISTERED_SIDNEY (TRAINER_REGISTERED_FLAGS_START + REMATCH_SIDNEY) +#define FLAG_REGISTERED_PHOEBE (TRAINER_REGISTERED_FLAGS_START + REMATCH_PHOEBE) +#define FLAG_REGISTERED_GLACIA (TRAINER_REGISTERED_FLAGS_START + REMATCH_GLACIA) +#define FLAG_REGISTERED_DRAKE (TRAINER_REGISTERED_FLAGS_START + REMATCH_DRAKE) +#define FLAG_REGISTERED_WALLACE (TRAINER_REGISTERED_FLAGS_START + REMATCH_WALLACE) #define FLAG_UNUSED_0x1AA 0x1AA // Unused Flag #define FLAG_UNUSED_0x1AB 0x1AB // Unused Flag diff --git a/include/constants/rematches.h b/include/constants/rematches.h new file mode 100644 index 000000000000..2ddefcc578a8 --- /dev/null +++ b/include/constants/rematches.h @@ -0,0 +1,89 @@ +#ifndef GUARD_REMATCHES_H +#define GUARD_REMATCHES_H + +enum { + REMATCH_ROSE, + REMATCH_ANDRES, + REMATCH_DUSTY, + REMATCH_LOLA, + REMATCH_RICKY, + REMATCH_LILA_AND_ROY, + REMATCH_CRISTIN, + REMATCH_BROOKE, + REMATCH_WILTON, + REMATCH_VALERIE, + REMATCH_CINDY, + REMATCH_THALIA, + REMATCH_JESSICA, + REMATCH_WINSTON, + REMATCH_STEVE, + REMATCH_TONY, + REMATCH_NOB, + REMATCH_KOJI, + REMATCH_FERNANDO, + REMATCH_DALTON, + REMATCH_BERNIE, + REMATCH_ETHAN, + REMATCH_JOHN_AND_JAY, + REMATCH_JEFFREY, + REMATCH_CAMERON, + REMATCH_JACKI, + REMATCH_WALTER, + REMATCH_KAREN, + REMATCH_JERRY, + REMATCH_ANNA_AND_MEG, + REMATCH_ISABEL, + REMATCH_MIGUEL, + REMATCH_TIMOTHY, + REMATCH_SHELBY, + REMATCH_CALVIN, + REMATCH_ELLIOT, + REMATCH_ISAIAH, + REMATCH_MARIA, + REMATCH_ABIGAIL, + REMATCH_DYLAN, + REMATCH_KATELYN, + REMATCH_BENJAMIN, + REMATCH_PABLO, + REMATCH_NICOLAS, + REMATCH_ROBERT, + REMATCH_LAO, + REMATCH_CYNDY, + REMATCH_MADELINE, + REMATCH_JENNY, + REMATCH_DIANA, + REMATCH_AMY_AND_LIV, + REMATCH_ERNEST, + REMATCH_CORY, + REMATCH_EDWIN, + REMATCH_LYDIA, + REMATCH_ISAAC, + REMATCH_GABRIELLE, + REMATCH_CATHERINE, + REMATCH_JACKSON, + REMATCH_HALEY, + REMATCH_JAMES, + REMATCH_TRENT, + REMATCH_SAWYER, + REMATCH_KIRA_AND_DAN, + REMATCH_WALLY_VR, // Entries above WALLY are considered normal trainers, from Wally below are special trainers + REMATCH_ROXANNE, + REMATCH_BRAWLY, + REMATCH_WATTSON, + REMATCH_FLANNERY, + REMATCH_NORMAN, + REMATCH_WINONA, + REMATCH_TATE_AND_LIZA, + REMATCH_JUAN, + REMATCH_SIDNEY, // Entries from SIDNEY below are considered part of REMATCH_ELITE_FOUR_ENTRIES. + REMATCH_PHOEBE, + REMATCH_GLACIA, + REMATCH_DRAKE, + REMATCH_WALLACE, + REMATCH_TABLE_ENTRIES // The total number of rematch entries. Must be last in enum +}; + +#define REMATCH_SPECIAL_TRAINER_START REMATCH_WALLY_VR +#define REMATCH_ELITE_FOUR_ENTRIES REMATCH_SIDNEY + +#endif // GUARD_REMATCHES_H diff --git a/include/gym_leader_rematch.h b/include/gym_leader_rematch.h index b31fb5e22863..622d2db1bc2c 100644 --- a/include/gym_leader_rematch.h +++ b/include/gym_leader_rematch.h @@ -1,90 +1,7 @@ #ifndef GUARD_TRAINER_REMATCH_H #define GUARD_TRAINER_REMATCH_H -enum { - REMATCH_ROSE, - REMATCH_ANDRES, - REMATCH_DUSTY, - REMATCH_LOLA, - REMATCH_RICKY, - REMATCH_LILA_AND_ROY, - REMATCH_CRISTIN, - REMATCH_BROOKE, - REMATCH_WILTON, - REMATCH_VALERIE, - REMATCH_CINDY, - REMATCH_THALIA, - REMATCH_JESSICA, - REMATCH_WINSTON, - REMATCH_STEVE, - REMATCH_TONY, - REMATCH_NOB, - REMATCH_KOJI, - REMATCH_FERNANDO, - REMATCH_DALTON, - REMATCH_BERNIE, - REMATCH_ETHAN, - REMATCH_JOHN_AND_JAY, - REMATCH_JEFFREY, - REMATCH_CAMERON, - REMATCH_JACKI, - REMATCH_WALTER, - REMATCH_KAREN, - REMATCH_JERRY, - REMATCH_ANNA_AND_MEG, - REMATCH_ISABEL, - REMATCH_MIGUEL, - REMATCH_TIMOTHY, - REMATCH_SHELBY, - REMATCH_CALVIN, - REMATCH_ELLIOT, - REMATCH_ISAIAH, - REMATCH_MARIA, - REMATCH_ABIGAIL, - REMATCH_DYLAN, - REMATCH_KATELYN, - REMATCH_BENJAMIN, - REMATCH_PABLO, - REMATCH_NICOLAS, - REMATCH_ROBERT, - REMATCH_LAO, - REMATCH_CYNDY, - REMATCH_MADELINE, - REMATCH_JENNY, - REMATCH_DIANA, - REMATCH_AMY_AND_LIV, - REMATCH_ERNEST, - REMATCH_CORY, - REMATCH_EDWIN, - REMATCH_LYDIA, - REMATCH_ISAAC, - REMATCH_GABRIELLE, - REMATCH_CATHERINE, - REMATCH_JACKSON, - REMATCH_HALEY, - REMATCH_JAMES, - REMATCH_TRENT, - REMATCH_SAWYER, - REMATCH_KIRA_AND_DAN, - REMATCH_WALLY_VR, // Entries above WALLY are considered normal trainers, from Wally below are special trainers - REMATCH_ROXANNE, - REMATCH_BRAWLY, - REMATCH_WATTSON, - REMATCH_FLANNERY, - REMATCH_NORMAN, - REMATCH_WINONA, - REMATCH_TATE_AND_LIZA, - REMATCH_JUAN, - REMATCH_SIDNEY, // Entries from SIDNEY below are considered part of REMATCH_ELITE_FOUR_ENTRIES. - REMATCH_PHOEBE, - REMATCH_GLACIA, - REMATCH_DRAKE, - REMATCH_WALLACE, - REMATCH_TABLE_ENTRIES // The total number of rematch entries. Must be last in enum -}; - -#define REMATCH_SPECIAL_TRAINER_START REMATCH_WALLY_VR -#define REMATCH_ELITE_FOUR_ENTRIES REMATCH_SIDNEY +#include "constants/rematches.h" void UpdateGymLeaderRematch(void); diff --git a/map_data_rules.mk b/map_data_rules.mk index 626cd4724080..d3f47a352e03 100755 --- a/map_data_rules.mk +++ b/map_data_rules.mk @@ -9,9 +9,9 @@ MAP_EVENTS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/events.inc,$(MAP_DIRS)) MAP_HEADERS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/header.inc,$(MAP_DIRS)) $(DATA_ASM_BUILDDIR)/maps.o: $(DATA_ASM_SUBDIR)/maps.s $(LAYOUTS_DIR)/layouts.inc $(LAYOUTS_DIR)/layouts_table.inc $(MAPS_DIR)/headers.inc $(MAPS_DIR)/groups.inc $(MAPS_DIR)/connections.inc $(MAP_CONNECTIONS) $(MAP_HEADERS) - $(PREPROC) $< charmap.txt | $(CPP) -I include - | $(AS) $(ASFLAGS) -o $@ + $(PREPROC) $< charmap.txt | $(CPP) -I include - | $(PREPROC) -ie $< charmap.txt | $(AS) $(ASFLAGS) -o $@ $(DATA_ASM_BUILDDIR)/map_events.o: $(DATA_ASM_SUBDIR)/map_events.s $(MAPS_DIR)/events.inc $(MAP_EVENTS) - $(PREPROC) $< charmap.txt | $(CPP) -I include - | $(AS) $(ASFLAGS) -o $@ + $(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 diff --git a/src/battle_setup.c b/src/battle_setup.c index e87ce6dd2718..435ba4b8a382 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -1615,7 +1615,7 @@ static bool32 UpdateRandomTrainerRematches(const struct RematchTrainer *table, u // Trainer already wants a rematch. Don't bother updating it. ret = TRUE; } - else if (FlagGet(FLAG_MATCH_CALL_REGISTERED + i) + else if (FlagGet(TRAINER_REGISTERED_FLAGS_START + i) && (Random() % 100) <= 30) // 31% chance of getting a rematch. { SetRematchIdForTrainer(table, i); @@ -1744,7 +1744,7 @@ static u32 GetTrainerMatchCallFlag(u32 trainerId) for (i = 0; i < REMATCH_TABLE_ENTRIES; i++) { if (gRematchTable[i].trainerIds[0] == trainerId) - return FLAG_MATCH_CALL_REGISTERED + i; + return TRAINER_REGISTERED_FLAGS_START + i; } return 0xFFFF; diff --git a/src/field_specials.c b/src/field_specials.c index 7d20d3571d0c..1bbbbf4e17b6 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -3620,7 +3620,7 @@ bool32 IsTrainerRegistered(void) int index = GetRematchIdxByTrainerIdx(gSpecialVar_0x8004); if (index >= 0) { - if (FlagGet(FLAG_MATCH_CALL_REGISTERED + index) == TRUE) + if (FlagGet(TRAINER_REGISTERED_FLAGS_START + index) == TRUE) return TRUE; } return FALSE; diff --git a/src/match_call.c b/src/match_call.c index a9d18b3477a0..2c1ad924a589 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -131,7 +131,7 @@ static EWRAM_DATA struct MatchCallState sMatchCallState = {0}; static EWRAM_DATA struct BattleFrontierStreakInfo sBattleFrontierStreakInfo = {0}; static u32 GetCurrentTotalMinutes(struct Time *); -static u32 GetNumRegisteredNPCs(void); +static u32 GetNumRegisteredTrainers(void); static u32 GetActiveMatchCallTrainerId(u32); static int GetTrainerMatchCallId(int); static u16 GetRematchTrainerLocation(int); @@ -1098,7 +1098,7 @@ static bool32 UpdateMatchCallStepCounter(void) static bool32 SelectMatchCallTrainer(void) { u32 matchCallId; - u32 numRegistered = GetNumRegisteredNPCs(); + u32 numRegistered = GetNumRegisteredTrainers(); if (numRegistered == 0) return FALSE; @@ -1114,12 +1114,13 @@ static bool32 SelectMatchCallTrainer(void) return TRUE; } -static u32 GetNumRegisteredNPCs(void) +// Ignores registrable non-trainer NPCs, and special trainers like Wally and the gym leaders. +static u32 GetNumRegisteredTrainers(void) { u32 i, count; for (i = 0, count = 0; i < REMATCH_SPECIAL_TRAINER_START; i++) { - if (FlagGet(FLAG_MATCH_CALL_REGISTERED + i)) + if (FlagGet(TRAINER_REGISTERED_FLAGS_START + i)) count++; } @@ -1131,7 +1132,7 @@ static u32 GetActiveMatchCallTrainerId(u32 activeMatchCallId) u32 i; for (i = 0; i < REMATCH_SPECIAL_TRAINER_START; i++) { - if (FlagGet(FLAG_MATCH_CALL_REGISTERED + i)) + if (FlagGet(TRAINER_REGISTERED_FLAGS_START + i)) { if (!activeMatchCallId) return gRematchTable[i].trainerIds[0]; diff --git a/src/pokenav_match_call_data.c b/src/pokenav_match_call_data.c index f6d71009bbe7..1c3cf9aeeb02 100644 --- a/src/pokenav_match_call_data.c +++ b/src/pokenav_match_call_data.c @@ -506,7 +506,7 @@ static const struct MatchCallStructTrainer sSidneyMatchCallHeader = { .type = MC_TYPE_LEADER, .mapSec = MAPSEC_EVER_GRANDE_CITY, - .flag = FLAG_REMATCH_SIDNEY, + .flag = FLAG_REGISTERED_SIDNEY, .rematchTableIdx = REMATCH_SIDNEY, .desc = gText_EliteFourMatchCallDesc, .name = NULL, @@ -522,7 +522,7 @@ static const struct MatchCallStructTrainer sPhoebeMatchCallHeader = { .type = MC_TYPE_LEADER, .mapSec = MAPSEC_EVER_GRANDE_CITY, - .flag = FLAG_REMATCH_PHOEBE, + .flag = FLAG_REGISTERED_PHOEBE, .rematchTableIdx = REMATCH_PHOEBE, .desc = gText_EliteFourMatchCallDesc, .name = NULL, @@ -538,7 +538,7 @@ static const struct MatchCallStructTrainer sGlaciaMatchCallHeader = { .type = MC_TYPE_LEADER, .mapSec = MAPSEC_EVER_GRANDE_CITY, - .flag = FLAG_REMATCH_GLACIA, + .flag = FLAG_REGISTERED_GLACIA, .rematchTableIdx = REMATCH_GLACIA, .desc = gText_EliteFourMatchCallDesc, .name = NULL, @@ -554,7 +554,7 @@ static const struct MatchCallStructTrainer sDrakeMatchCallHeader = { .type = MC_TYPE_LEADER, .mapSec = MAPSEC_EVER_GRANDE_CITY, - .flag = FLAG_REMATCH_DRAKE, + .flag = FLAG_REGISTERED_DRAKE, .rematchTableIdx = REMATCH_DRAKE, .desc = gText_EliteFourMatchCallDesc, .name = NULL, @@ -570,7 +570,7 @@ static const struct MatchCallStructTrainer sWallaceMatchCallHeader = { .type = MC_TYPE_LEADER, .mapSec = MAPSEC_EVER_GRANDE_CITY, - .flag = FLAG_REMATCH_WALLACE, + .flag = FLAG_REGISTERED_WALLACE, .rematchTableIdx = REMATCH_WALLACE, .desc = gText_ChampionMatchCallDesc, .name = NULL, @@ -1136,7 +1136,7 @@ bool32 MatchCall_HasRematchId(u32 idx) void SetMatchCallRegisteredFlag(void) { - int r0 = GetRematchIdxByTrainerIdx(gSpecialVar_0x8004); - if (r0 >= 0) - FlagSet(FLAG_MATCH_CALL_REGISTERED + r0); + int index = GetRematchIdxByTrainerIdx(gSpecialVar_0x8004); + if (index >= 0) + FlagSet(TRAINER_REGISTERED_FLAGS_START + index); } diff --git a/src/pokenav_match_call_list.c b/src/pokenav_match_call_list.c index 8d1a73f55718..fb89e33e0b23 100755 --- a/src/pokenav_match_call_list.c +++ b/src/pokenav_match_call_list.c @@ -261,7 +261,7 @@ static u32 LoopedTask_BuildMatchCallList(s32 taskState) bool32 IsRematchEntryRegistered(int rematchIndex) { if (rematchIndex < REMATCH_TABLE_ENTRIES) - return FlagGet(FLAG_MATCH_CALL_REGISTERED + rematchIndex); + return FlagGet(TRAINER_REGISTERED_FLAGS_START + rematchIndex); return FALSE; } From 5c55cc374815fb99ef43f55b8d2332d3798efc59 Mon Sep 17 00:00:00 2001 From: Martin Griffin Date: Wed, 21 Aug 2024 07:50:41 +0100 Subject: [PATCH 11/48] [preproc] support arbitrary expressions in enums --- tools/preproc/asm_file.cpp | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/tools/preproc/asm_file.cpp b/tools/preproc/asm_file.cpp index ca8b8cc4ae96..36b6c7ed0681 100644 --- a/tools/preproc/asm_file.cpp +++ b/tools/preproc/asm_file.cpp @@ -520,6 +520,7 @@ bool AsmFile::ParseEnum() long currentHeaderLine = SkipWhitespaceAndEol(); std::string enumName = ReadIdentifier(); currentHeaderLine += SkipWhitespaceAndEol(); + std::string enumBase = "0"; long enumCounter = 0; long symbolCount = 0; @@ -542,11 +543,28 @@ bool AsmFile::ParseEnum() if (m_buffer[m_pos] == '=') { m_pos++; - currentHeaderLine += SkipWhitespaceAndEol(); - enumCounter = ReadInteger(headerFilename, currentHeaderLine); - currentHeaderLine += SkipWhitespaceAndEol(); + SkipWhitespace(); + enumBase.clear(); + for (;;) + { + if (m_pos == m_size) + RaiseError("unexpected EOF"); + if (m_buffer[m_pos] == ',') + break; + if (m_buffer[m_pos] == '\n') + { + currentHeaderLine++; + enumBase.push_back(' '); + } + else + { + enumBase.push_back(m_buffer[m_pos]); + } + m_pos++; + } + enumCounter = 0; } - std::printf(".equiv %s, %ld\n", currentIdentName.c_str(), enumCounter); + std::printf(".equiv %s, (%s) + %ld\n", currentIdentName.c_str(), enumBase.c_str(), enumCounter); enumCounter++; symbolCount++; } 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 12/48] [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 | 34 +- tools/jsonproc/jsonproc.cpp | 2 + tools/mapjson/mapjson.cpp | 112 ++++--- 8 files changed, 126 insertions(+), 1142 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 bf74e0331af1..15cbd709e44b 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 000000000000..761af9db7625 --- /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 db92c9594264..000000000000 --- 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 eaf40a525d00..000000000000 --- 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 7e0baf89006e..7adf51031965 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 d3f47a352e03..ed7c08edeaf5 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 ; - -$(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)/%/header.inc $(MAPS_OUTDIR)/%/events.inc $(MAPS_OUTDIR)/%/connections.inc: $(MAPS_DIR)/%/map.json + $(MAPJSON) map emerald $< $(LAYOUTS_DIR)/layouts.json $(@D) + +$(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 9ef23cd43e58..03e51b765a0a 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 e53ac7924d0f..1a10c9dab89a 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; From a4dd8216587f73841ba9016678c1af88cb78b62c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 31 Aug 2024 00:32:43 -0400 Subject: [PATCH 13/48] Restore review changes from dependent PR --- map_data_rules.mk | 1 + tools/mapjson/mapjson.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/map_data_rules.mk b/map_data_rules.mk index 3ec86da7dda0..ed7c08edeaf5 100755 --- a/map_data_rules.mk +++ b/map_data_rules.mk @@ -22,6 +22,7 @@ $(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_OUTDIR)/%/header.inc $(MAPS_OUTDIR)/%/events.inc $(MAPS_OUTDIR)/%/connections.inc: $(MAPS_DIR)/%/map.json $(MAPJSON) map emerald $< $(LAYOUTS_DIR)/layouts.json $(@D) diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index 1632b56be62e..1a10c9dab89a 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -374,7 +374,7 @@ void process_map(string map_filepath, string layouts_filepath, string output_dir string generate_groups_text(Json groups_data) { ostringstream text; - text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from /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"; for (auto &key : groups_data["group_order"].array_items()) { string group = json_to_string(key); @@ -415,7 +415,7 @@ string generate_connections_text(Json groups_data, string include_path) { ostringstream text; - text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from /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"; for (Json map_name : map_names) text << "\t.include \"" << include_path << "/" << json_to_string(map_name) << "/connections.inc\"\n"; @@ -432,7 +432,7 @@ string generate_headers_text(Json groups_data, string include_path) { ostringstream text; - text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from /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"; for (string map_name : map_names) text << "\t.include \"" << include_path << "/" << map_name << "/header.inc\"\n"; @@ -465,7 +465,7 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { text << "#ifndef GUARD_CONSTANTS_MAP_GROUPS_H\n" << "#define GUARD_CONSTANTS_MAP_GROUPS_H\n\n"; - text << "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from /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"; int group_num = 0; @@ -530,7 +530,7 @@ void process_groups(string groups_filepath, string output_asm, string output_c) string generate_layout_headers_text(Json layouts_data) { ostringstream text; - text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from layouts.json\n@\n\n"; + text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/layouts/layouts.json\n@\n\n"; for (auto &layout : layouts_data["layouts"].array_items()) { if (layout == Json::object()) continue; From 32f05269a3c96b45464ca0e1f5c4090c2f37d75f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 31 Aug 2024 00:53:23 -0400 Subject: [PATCH 14/48] Add missing terminal newlines --- audio_rules.mk | 2 +- sound/songs/midi/midi.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/audio_rules.mk b/audio_rules.mk index fccb9fc548b9..0acbccec0750 100644 --- a/audio_rules.mk +++ b/audio_rules.mk @@ -42,4 +42,4 @@ $(foreach line,$(shell cat $(MID_CFG_PATH) | sed "s/ /__SPACE__/g"),$(call MID_E # Warn users building without a .cfg - build will fail at link time $(MID_ASM_DIR)/%.s: $(MID_SUBDIR)/%.mid - $(warning $< does not have an associated entry in midi.cfg! It cannot be built) \ No newline at end of file + $(warning $< does not have an associated entry in midi.cfg! It cannot be built) diff --git a/sound/songs/midi/midi.cfg b/sound/songs/midi/midi.cfg index 439778e9bdcd..5802904b4130 100644 --- a/sound/songs/midi/midi.cfg +++ b/sound/songs/midi/midi.cfg @@ -417,4 +417,4 @@ se_unlock.mid: -E -R50 -G128 -V100 -P4 se_use_item.mid: -E -R50 -G127 -V100 -P5 se_vend.mid: -E -R50 -G128 -V110 -P4 se_warp_in.mid: -E -R50 -G127 -V090 -P4 -se_warp_out.mid: -E -R50 -G127 -V090 -P4 \ No newline at end of file +se_warp_out.mid: -E -R50 -G127 -V090 -P4 From 04197b49126604a310fae1d314709334f6d2460d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 31 Aug 2024 01:54:25 -0400 Subject: [PATCH 15/48] Fix swapped cycling road entrances --- data/event_scripts.s | 2 +- data/maps/Route110/map.json | 8 ++++---- .../map.json | 8 ++++---- .../scripts.inc | 16 ++++++++++++++++ .../map.json | 8 ++++---- .../scripts.inc | 16 ---------------- data/maps/map_groups.json | 4 ++-- src/field_specials.c | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/data/event_scripts.s b/data/event_scripts.s index e8fb9dcbd18c..55720a6addf2 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -563,8 +563,8 @@ gStdScripts_End:: .include "data/maps/Route110_TrickHousePuzzle6/scripts.inc" .include "data/maps/Route110_TrickHousePuzzle7/scripts.inc" .include "data/maps/Route110_TrickHousePuzzle8/scripts.inc" - .include "data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc" .include "data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc" + .include "data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc" .include "data/maps/Route113_GlassWorkshop/scripts.inc" .include "data/maps/Route123_BerryMastersHouse/scripts.inc" .include "data/maps/Route119_WeatherInstitute_1F/scripts.inc" diff --git a/data/maps/Route110/map.json b/data/maps/Route110/map.json index 2b521641133a..6e4982fa22c1 100644 --- a/data/maps/Route110/map.json +++ b/data/maps/Route110/map.json @@ -518,28 +518,28 @@ "x": 15, "y": 16, "elevation": 0, - "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE", + "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE", "dest_warp_id": "0" }, { "x": 18, "y": 16, "elevation": 0, - "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE", + "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE", "dest_warp_id": "2" }, { "x": 16, "y": 88, "elevation": 0, - "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE", + "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE", "dest_warp_id": "0" }, { "x": 19, "y": 88, "elevation": 0, - "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE", + "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE", "dest_warp_id": "2" } ], diff --git a/data/maps/Route110_SeasideCyclingRoadNorthEntrance/map.json b/data/maps/Route110_SeasideCyclingRoadNorthEntrance/map.json index 6f3c6c75c574..88cbf1cc882b 100644 --- a/data/maps/Route110_SeasideCyclingRoadNorthEntrance/map.json +++ b/data/maps/Route110_SeasideCyclingRoadNorthEntrance/map.json @@ -34,28 +34,28 @@ "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "4" + "dest_warp_id": "2" }, { "x": 2, "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "4" + "dest_warp_id": "2" }, { "x": 12, "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "5" + "dest_warp_id": "3" }, { "x": 13, "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "5" + "dest_warp_id": "3" } ], "coord_events": [ diff --git a/data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc b/data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc index 5eb1f3dea2a2..fb1cdc5c7122 100644 --- a/data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc +++ b/data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc @@ -1,6 +1,16 @@ Route110_SeasideCyclingRoadNorthEntrance_MapScripts:: + map_script MAP_SCRIPT_ON_TRANSITION, Route110_SeasideCyclingRoadNorthEntrance_OnTransition .byte 0 +Route110_SeasideCyclingRoadNorthEntrance_OnTransition: + call_if_eq VAR_CYCLING_CHALLENGE_STATE, 3, Route110_SeasideCyclingRoadNorthEntrance_EventScript_RestartChallenge + call_if_eq VAR_CYCLING_CHALLENGE_STATE, 2, Route110_SeasideCyclingRoadNorthEntrance_EventScript_RestartChallenge + end + +Route110_SeasideCyclingRoadNorthEntrance_EventScript_RestartChallenge:: + setvar VAR_CYCLING_CHALLENGE_STATE, 1 + return + Route110_SeasideCyclingRoadNorthEntrance_EventScript_Clerk:: lock faceplayer @@ -11,12 +21,17 @@ Route110_SeasideCyclingRoadNorthEntrance_EventScript_Clerk:: Route110_SeasideCyclingRoadNorthEntrance_EventScript_BikeCheck:: lockall specialvar VAR_RESULT, GetPlayerAvatarBike + call_if_eq VAR_RESULT, 2, Route110_SeasideCyclingRoadNorthEntrance_EventScript_OnMachBike goto_if_eq VAR_RESULT, 0, Route110_SeasideCyclingRoadNorthEntrance_EventScript_NoBike setflag FLAG_SYS_CYCLING_ROAD setvar VAR_TEMP_1, 1 releaseall end +Route110_SeasideCyclingRoadNorthEntrance_EventScript_OnMachBike:: + setvar VAR_CYCLING_CHALLENGE_STATE, 1 + return + Route110_SeasideCyclingRoadNorthEntrance_EventScript_NoBike:: msgbox Route110_SeasideCyclingRoadNorthEntrance_Text_TooDangerousToWalk, MSGBOX_DEFAULT closemessage @@ -31,6 +46,7 @@ Route110_SeasideCyclingRoadNorthEntrance_Movement_PushPlayerBackFromCounter: Route110_SeasideCyclingRoadNorthEntrance_EventScript_ClearCyclingRoad:: lockall + setvar VAR_CYCLING_CHALLENGE_STATE, 0 clearflag FLAG_SYS_CYCLING_ROAD setvar VAR_TEMP_1, 0 releaseall diff --git a/data/maps/Route110_SeasideCyclingRoadSouthEntrance/map.json b/data/maps/Route110_SeasideCyclingRoadSouthEntrance/map.json index 59e3e5be6501..943984075d19 100644 --- a/data/maps/Route110_SeasideCyclingRoadSouthEntrance/map.json +++ b/data/maps/Route110_SeasideCyclingRoadSouthEntrance/map.json @@ -34,28 +34,28 @@ "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "2" + "dest_warp_id": "4" }, { "x": 2, "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "2" + "dest_warp_id": "4" }, { "x": 12, "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "3" + "dest_warp_id": "5" }, { "x": 13, "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "3" + "dest_warp_id": "5" } ], "coord_events": [ diff --git a/data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc b/data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc index df53f55ccf17..5c4dcfa2194c 100644 --- a/data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc +++ b/data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc @@ -1,16 +1,6 @@ Route110_SeasideCyclingRoadSouthEntrance_MapScripts:: - map_script MAP_SCRIPT_ON_TRANSITION, Route110_SeasideCyclingRoadSouthEntrance_OnTransition .byte 0 -Route110_SeasideCyclingRoadSouthEntrance_OnTransition: - call_if_eq VAR_CYCLING_CHALLENGE_STATE, 3, Route110_SeasideCyclingRoadSouthEntrance_EventScript_RestartChallenge - call_if_eq VAR_CYCLING_CHALLENGE_STATE, 2, Route110_SeasideCyclingRoadSouthEntrance_EventScript_RestartChallenge - end - -Route110_SeasideCyclingRoadSouthEntrance_EventScript_RestartChallenge:: - setvar VAR_CYCLING_CHALLENGE_STATE, 1 - return - Route110_SeasideCyclingRoadSouthEntrance_EventScript_Clerk:: lock faceplayer @@ -21,17 +11,12 @@ Route110_SeasideCyclingRoadSouthEntrance_EventScript_Clerk:: Route110_SeasideCyclingRoadSouthEntrance_EventScript_BikeCheck:: lockall specialvar VAR_RESULT, GetPlayerAvatarBike - call_if_eq VAR_RESULT, 2, Route110_SeasideCyclingRoadSouthEntrance_EventScript_OnMachBike goto_if_eq VAR_RESULT, 0, Route110_SeasideCyclingRoadSouthEntrance_EventScript_NoBike setflag FLAG_SYS_CYCLING_ROAD setvar VAR_TEMP_1, 1 releaseall end -Route110_SeasideCyclingRoadSouthEntrance_EventScript_OnMachBike:: - setvar VAR_CYCLING_CHALLENGE_STATE, 1 - return - Route110_SeasideCyclingRoadSouthEntrance_EventScript_NoBike:: msgbox Route110_SeasideCyclingRoadSouthEntrance_Text_TooDangerousToWalk, MSGBOX_DEFAULT closemessage @@ -46,7 +31,6 @@ Route110_SeasideCyclingRoadSouthEntrance_Movement_PushPlayerBackFromCounter: Route110_SeasideCyclingRoadSouthEntrance_EventScript_ClearCyclingRoad:: lockall - setvar VAR_CYCLING_CHALLENGE_STATE, 0 clearflag FLAG_SYS_CYCLING_ROAD setvar VAR_TEMP_1, 0 releaseall diff --git a/data/maps/map_groups.json b/data/maps/map_groups.json index ebef431b300d..8a90679c8ddb 100644 --- a/data/maps/map_groups.json +++ b/data/maps/map_groups.json @@ -604,8 +604,8 @@ "Route110_TrickHousePuzzle6", "Route110_TrickHousePuzzle7", "Route110_TrickHousePuzzle8", - "Route110_SeasideCyclingRoadNorthEntrance", - "Route110_SeasideCyclingRoadSouthEntrance" + "Route110_SeasideCyclingRoadSouthEntrance", + "Route110_SeasideCyclingRoadNorthEntrance" ], "gMapGroup_IndoorRoute113": [ "Route113_GlassWorkshop" diff --git a/src/field_specials.c b/src/field_specials.c index f1e5d7bb2de0..f8d493493c43 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -263,7 +263,7 @@ u16 GetRecordedCyclingRoadResults(void) void UpdateCyclingRoadState(void) { - if (gLastUsedWarp.mapNum == MAP_NUM(ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE) && gLastUsedWarp.mapGroup == MAP_GROUP(ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE)) + if (gLastUsedWarp.mapNum == MAP_NUM(ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE) && gLastUsedWarp.mapGroup == MAP_GROUP(ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE)) return; if (VarGet(VAR_CYCLING_CHALLENGE_STATE) == 2 || VarGet(VAR_CYCLING_CHALLENGE_STATE) == 3) From 71fcb2e7b5b24d5bd64717d2ca7d9d760b55722c Mon Sep 17 00:00:00 2001 From: NT_x86 Date: Sun, 8 Sep 2024 12:50:35 +0300 Subject: [PATCH 16/48] Fix incorrect point macros in contest_ai_script.inc --- asm/macros/contest_ai_script.inc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/asm/macros/contest_ai_script.inc b/asm/macros/contest_ai_script.inc index 9ab7184c3cc5..d66d9a8ffd99 100644 --- a/asm/macros/contest_ai_script.inc +++ b/asm/macros/contest_ai_script.inc @@ -141,25 +141,25 @@ .macro if_points_less_than num:req, destination:req .byte 0x16 - .byte \num + .2byte \num .4byte \destination .endm .macro if_points_more_than num:req, destination:req .byte 0x17 - .byte \num + .2byte \num .4byte \destination .endm .macro if_points_eq num:req, destination:req .byte 0x18 - .byte \num + .2byte \num .4byte \destination .endm .macro if_points_not_eq num:req, destination:req .byte 0x19 - .byte \num + .2byte \num .4byte \destination .endm @@ -171,25 +171,25 @@ .macro if_preliminary_points_less_than num:req, destination:req .byte 0x1B - .byte \num + .2byte \num .4byte \destination .endm .macro if_preliminary_points_more_than num:req, destination:req .byte 0x1C - .byte \num + .2byte \num .4byte \destination .endm .macro if_preliminary_points_eq num:req, destination:req .byte 0x1D - .byte \num + .2byte \num .4byte \destination .endm .macro if_preliminary_points_not_eq num:req, destination:req .byte 0x1E - .byte \num + .2byte \num .4byte \destination .endm From 28786b42a6cf2f31333d9bc618ef63eae1553d0b Mon Sep 17 00:00:00 2001 From: Skye Chappelle Date: Tue, 10 Sep 2024 23:36:13 -0400 Subject: [PATCH 17/48] Update INSTALL.md to state that Windows 8 is no longer supported by Microsoft --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 7ffcdee07b85..03b28ba464e2 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -24,7 +24,7 @@ Unscientific benchmarks suggest **msys2 is 2x slower** than WSL1, and **Cygwin i All of the Windows instructions assume that the default drive is C:\\. If this differs to your actual drive letter, then replace C with the correct drive letter when reading the instructions. -**A note of caution**: As Windows 7 is officially unsupported by Microsoft and Windows 8 has very little usage, some maintainers are unwilling to maintain the Windows 7/8 instructions. Thus, these instructions may break in the future with fixes taking longer than fixes to the Windows 10 instructions. +**A note of caution**: As Windows 7 and Windows 8 are officially unsupported by Microsoft, some maintainers are unwilling to maintain the Windows 7/8 instructions. Thus, these instructions may break in the future with fixes taking longer than fixes to the Windows 10/11 instructions. ## Windows 10/11 (WSL1) WSL1 is the preferred terminal to build **pokeemerald**. The following instructions will explain how to install WSL1 (referred to interchangeably as WSL). From a75be4124d9d06524ef42c9eb670f3bb93c5749b Mon Sep 17 00:00:00 2001 From: Skye Chappelle Date: Tue, 10 Sep 2024 23:39:41 -0400 Subject: [PATCH 18/48] Update pull_request_template.md to include Discord username update --- .github/pull_request_template.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c381b50f1bae..6bf2034006d0 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,5 +4,5 @@ ## **Discord contact info** - - \ No newline at end of file + + From 20e937a7241b86766657a6c5bf2cde05a164ee9e Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 11 Sep 2024 16:33:11 -0300 Subject: [PATCH 19/48] Rebuild of makefile 1: Modern as default --- Makefile | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index bb0e3e706459..fde014f8156b 100644 --- a/Makefile +++ b/Makefile @@ -3,19 +3,20 @@ TITLE := POKEMON EMER GAME_CODE := BPEE MAKER_CODE := 01 REVISION := 0 -MODERN ?= 0 -# `File name`.gba ('_modern' will be appended to the modern builds) +# `File name`.gba ('_agbcc' will be appended to the non-modern builds) FILE_NAME := pokeemerald BUILD_DIR := build # Builds the ROM using a modern compiler -MODERN ?= 0 +MODERN ?= 1 # Compares the ROM to a checksum of the original - only makes sense using when non-modern COMPARE ?= 0 +# Executes the Test Runner System that checks that all mechanics work as expected +TEST ?= 0 -ifeq (modern,$(MAKECMDGOALS)) - MODERN := 1 +ifeq (agbcc,$(MAKECMDGOALS)) + MODERN := 0 endif ifeq (compare,$(MAKECMDGOALS)) COMPARE := 1 @@ -66,9 +67,9 @@ else CPP := $(PREFIX)cpp endif -ROM_NAME := $(FILE_NAME).gba +ROM_NAME := $(FILE_NAME)_agbcc.gba OBJ_DIR_NAME := $(BUILD_DIR)/emerald -MODERN_ROM_NAME := $(FILE_NAME)_modern.gba +MODERN_ROM_NAME := $(FILE_NAME).gba MODERN_OBJ_DIR_NAME := $(BUILD_DIR)/modern ELF_NAME := $(ROM_NAME:.gba=.elf) @@ -116,7 +117,7 @@ INCLUDE_CPP_ARGS := $(INCLUDE_DIRS:%=-iquote %) INCLUDE_SCANINC_ARGS := $(INCLUDE_DIRS:%=-I %) O_LEVEL ?= 2 -CPPFLAGS := $(INCLUDE_CPP_ARGS) -iquote $(GFLIB_SUBDIR) -Wno-trigraphs -DMODERN=$(MODERN) +CPPFLAGS := $(INCLUDE_CPP_ARGS) -iquote $(GFLIB_SUBDIR) -Wno-trigraphs -DMODERN=$(MODERN) -DTESTING=$(TEST) ifeq ($(MODERN),0) CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef CC1 := tools/agbcc/bin/agbcc$(EXE) @@ -166,7 +167,7 @@ MAKEFLAGS += --no-print-directory .SECONDEXPANSION: RULES_NO_SCAN += libagbsyscall clean clean-assets tidy tidymodern tidynonmodern generated clean-generated -.PHONY: all rom modern compare +.PHONY: all rom agbcc modern compare .PHONY: $(RULES_NO_SCAN) infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) @@ -226,6 +227,12 @@ $(shell mkdir -p $(SUBDIRS)) # Pretend rules that are actually flags defer to `make all` modern: all compare: all +# Uncomment the next line, and then comment the 4 lines after it to reenable agbcc. +#agbcc: all +agbcc: + @echo "'make agbcc' is deprecated as of pokeemerald-expansion 1.9 and will be removed in 1.10." + @echo "Search for 'agbcc: all' in Makefile to reenable agbcc." + @exit 1 # Other rules rom: $(ROM) From 83872ab89fb9e92f7fc9976fe0c8af6254d1082e Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 11 Sep 2024 19:31:40 -0300 Subject: [PATCH 20/48] Rebuild of makefile 2: -Wall and UNUSED_ERROR --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fde014f8156b..2611eed2ef36 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ MODERN ?= 1 COMPARE ?= 0 # Executes the Test Runner System that checks that all mechanics work as expected TEST ?= 0 +# Count unused warnings as errors. Used by RH-Hideout's repo +UNUSED_ERROR ?= 0 ifeq (agbcc,$(MAKECMDGOALS)) MODERN := 0 @@ -129,7 +131,13 @@ else MODERNCC := $(PREFIX)gcc PATH_MODERNCC := PATH="$(PATH)" $(MODERNCC) CC1 := $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet - override CFLAGS += -mthumb -mthumb-interwork -O$(O_LEVEL) -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast + override CFLAGS += -mthumb -mthumb-interwork -O$(O_LEVEL) -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias -Woverride-init + # Only throw an error for unused elements if its RH-Hideout's repo + ifeq ($(UNUSED_ERROR),0) + ifneq ($(GITHUB_REPOSITORY_OWNER),rh-hideout) + override CFLAGS += -Wno-error=unused-variable -Wno-error=unused-const-variable -Wno-error=unused-parameter -Wno-error=unused-function -Wno-error=unused-but-set-parameter -Wno-error=unused-but-set-variable -Wno-error=unused-value -Wno-error=unused-local-typedefs + endif + endif LIBPATH := -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libc.a))" LIB := $(LIBPATH) -lc -lnosys -lgcc -L../../libagbsyscall -lagbsyscall endif From 5f8c9158267b83482e538e224abfd4d35fce7d0a Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 11 Sep 2024 19:40:52 -0300 Subject: [PATCH 21/48] Rebuild of makefile 3: ANALYZE --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 2611eed2ef36..6f87e1aa7442 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ MODERN ?= 1 COMPARE ?= 0 # Executes the Test Runner System that checks that all mechanics work as expected TEST ?= 0 +# Enables -fanalyzer C flag to analyze in depth potential UBs +ANALYZE ?= 0 # Count unused warnings as errors. Used by RH-Hideout's repo UNUSED_ERROR ?= 0 @@ -132,6 +134,9 @@ else PATH_MODERNCC := PATH="$(PATH)" $(MODERNCC) CC1 := $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet override CFLAGS += -mthumb -mthumb-interwork -O$(O_LEVEL) -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias -Woverride-init + ifeq ($(ANALYZE),1) + override CFLAGS += -fanalyzer + endif # Only throw an error for unused elements if its RH-Hideout's repo ifeq ($(UNUSED_ERROR),0) ifneq ($(GITHUB_REPOSITORY_OWNER),rh-hideout) From 5790200e2d602b1b9eb40b7ea7b25ec2b6ff0b20 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 11 Sep 2024 20:05:18 -0300 Subject: [PATCH 22/48] Rebuild of makefile 4: Teachable learnset helper --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 6f87e1aa7442..2b87d61e08db 100644 --- a/Makefile +++ b/Makefile @@ -407,6 +407,10 @@ $(OBJ_DIR)/sym_common.ld: sym_common.txt $(C_OBJS) $(wildcard common_syms/*.txt) $(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt $(RAMSCRGEN) ewram_data $< ENGLISH > $@ +# NOTE: Depending on event_scripts.o is hacky, but we want to depend on everything event_scripts.s depends on without having to alter scaninc +$(DATA_SRC_SUBDIR)/pokemon/teachable_learnsets.h: $(DATA_ASM_BUILDDIR)/event_scripts.o + python3 $(TOOLS_DIR)/learnset_helpers/teachable.py + # Linker script ifeq ($(MODERN),0) LD_SCRIPT := ld_script.ld From d9b824db3f6ede8007be70b58c03874451f9d046 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 12 Sep 2024 12:27:31 -0400 Subject: [PATCH 23/48] Sync missing alignment from pokefirered --- tools/mapjson/mapjson.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index 1a10c9dab89a..94328b48575f 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -197,7 +197,7 @@ string generate_map_events_text(Json map_data) { string mapName = json_to_string(map_data, "name"); - text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/" << mapName << "/map.json\n@\n\n"; + text << "@\n@ DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/" << mapName << "/map.json\n@\n\n\t.align 2\n\n"; string objects_label, warps_label, coords_label, bgs_label; From 7007439be899cd0901c2145f5eb219c9d7776a51 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 12 Sep 2024 13:50:47 -0400 Subject: [PATCH 24/48] Remove old ld_script processing --- Makefile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7e5e14cd61e1..ce868f06bd86 100644 --- a/Makefile +++ b/Makefile @@ -392,18 +392,14 @@ LD_SCRIPT := ld_script_modern.ld LD_SCRIPT_DEPS := endif -$(OBJ_DIR)/ld_script.ld: $(LD_SCRIPT) $(LD_SCRIPT_DEPS) - sed "s#tools/#tools/#g" $(LD_SCRIPT) > $(OBJ_DIR)/ld_script.ld - # Final rules libagbsyscall: @$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) MODERN=$(MODERN) # Elf from object files -$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) libagbsyscall - @echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ " - @cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld --print-memory-usage -o ../../$@ $(OBJS_REL) $(LIB) | cat +$(ELF): $(LD_SCRIPT) $(LD_SCRIPT_DEPS) $(OBJS) libagbsyscall + @cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ $(OBJS_REL) $(LIB) | cat $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent # Builds the rom from the elf file From 5ea1f39a9dde753c5787d211c97963037daadfa5 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 13 Sep 2024 14:27:40 -0300 Subject: [PATCH 25/48] Rebuild of makefile 5: trainerproc --- Makefile | 24 +++++++++++++++--------- make_tools.mk | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 2b87d61e08db..dde15c644afb 100644 --- a/Makefile +++ b/Makefile @@ -155,15 +155,16 @@ endif AUTO_GEN_TARGETS := include make_tools.mk # Tool executables -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) +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) +TRAINERPROC := $(TOOLS_DIR)/trainerproc/trainerproc$(EXE) PERL := perl SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c @@ -305,6 +306,11 @@ generated: tools $(AUTO_GEN_TARGETS) clean-generated: -rm -f $(AUTO_GEN_TARGETS) +COMPETITIVE_PARTY_SYNTAX := $(shell PATH="$(PATH)"; echo 'COMPETITIVE_PARTY_SYNTAX' | $(CPP) $(CPPFLAGS) -imacros include/gba/defines.h -imacros include/config/general.h | tail -n1) +ifeq ($(COMPETITIVE_PARTY_SYNTAX),1) +%.h: %.party tools ; $(CPP) $(CPPFLAGS) -traditional-cpp - < $< | $(TRAINERPROC) -o $@ -i $< - +endif + ifeq ($(MODERN),0) $(C_BUILDDIR)/libc.o: CC1 := $(TOOLS_DIR)/agbcc/bin/old_agbcc$(EXE) $(C_BUILDDIR)/libc.o: CFLAGS := -O2 diff --git a/make_tools.mk b/make_tools.mk index 4a6a929a86ee..df9696f518b9 100644 --- a/make_tools.mk +++ b/make_tools.mk @@ -5,7 +5,7 @@ MAKEFLAGS += --no-print-directory # Inclusive list. If you don't want a tool to be built, don't add it here. TOOLS_DIR := tools -TOOL_NAMES := aif2pcm bin2c gbafix gbagfx jsonproc mapjson mid2agb preproc ramscrgen rsfont scaninc +TOOL_NAMES := aif2pcm bin2c gbafix gbagfx jsonproc mapjson mid2agb preproc ramscrgen rsfont scaninc trainerproc TOOLDIRS := $(TOOL_NAMES:%=$(TOOLS_DIR)/%) From bee1452c8e7d8b23667b4bc06a8200277ec6817d Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 13 Sep 2024 14:38:43 -0300 Subject: [PATCH 26/48] Rebuild of makefile 6: File-specific stuff --- Makefile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index dde15c644afb..6db6c62428bb 100644 --- a/Makefile +++ b/Makefile @@ -262,7 +262,7 @@ clean: tidy clean-tools clean-generated clean-assets clean-assets: rm -f $(MID_SUBDIR)/*.s rm -f $(DATA_ASM_SUBDIR)/layouts/layouts.inc $(DATA_ASM_SUBDIR)/layouts/layouts_table.inc - rm -f $(DATA_ASM_SUBDIR)/maps/connections.inc $(DATA_ASM_SUBDIR)/maps/events.inc $(DATA_ASM_SUBDIR)/maps/groups.inc $(DATA_ASM_SUBDIR)/maps/headers.inc + rm -f $(DATA_ASM_SUBDIR)/maps/connections.inc $(DATA_ASM_SUBDIR)/maps/events.inc $(DATA_ASM_SUBDIR)/maps/groups.inc $(DATA_ASM_SUBDIR)/maps/headers.inc $(DATA_SRC_SUBDIR)/map_group_count.h find sound -iname '*.bin' -exec rm {} + find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + find $(DATA_ASM_SUBDIR)/maps \( -iname 'connections.inc' -o -iname 'events.inc' -o -iname 'header.inc' \) -exec rm {} + @@ -298,6 +298,7 @@ generated: $(AUTO_GEN_TARGETS) %.gbapal: %.png ; $(GFX) $< $@ %.lz: % ; $(GFX) $< $@ %.rl: % ; $(GFX) $< $@ +$(CRY_SUBDIR)/uncomp_%.bin: $(CRY_SUBDIR)/uncomp_%.aif ; $(AIF) $< $@ $(CRY_SUBDIR)/%.bin: $(CRY_SUBDIR)/%.aif ; $(AIF) $< $@ --compress sound/%.bin: sound/%.aif ; $(AIF) $< $@ @@ -325,6 +326,9 @@ $(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 $(C_BUILDDIR)/berry_crush.o: override CFLAGS += -Wno-address-of-packed-member +$(C_BUILDDIR)/pokedex_plus_hgss.o: CFLAGS := -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias -Woverride-init +# Annoyingly we can't turn this on just for src/data/trainers.h +$(C_BUILDDIR)/data.o: CFLAGS += -fno-show-column -fno-diagnostics-show-caret endif # Dependency rules (for the *.c & *.s sources to .o files) @@ -417,6 +421,14 @@ $(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt $(DATA_SRC_SUBDIR)/pokemon/teachable_learnsets.h: $(DATA_ASM_BUILDDIR)/event_scripts.o python3 $(TOOLS_DIR)/learnset_helpers/teachable.py +# NOTE: Based on C_DEP above, but without NODEP and KEEP_TEMPS handling. +define TEST_DEP +$1: $2 $$(shell $(SCANINC) -I include -I $(TOOLS_DIR)/agbcc/include -I gflib $2) + @echo "$$(CC1) -o $$@ $$<" + @$$(CPP) $$(CPPFLAGS) $$< | $$(PREPROC) -i $$< charmap.txt | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ - +endef +$(foreach src, $(TEST_SRCS), $(eval $(call TEST_DEP,$(patsubst $(TEST_SUBDIR)/%.c,$(TEST_BUILDDIR)/%.o,$(src)),$(src),$(patsubst $(TEST_SUBDIR)/%.c,%,$(src))))) + # Linker script ifeq ($(MODERN),0) LD_SCRIPT := ld_script.ld From 5954d662a5762d73b073731aa1d46feab2481c5c Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 13 Sep 2024 15:26:42 -0300 Subject: [PATCH 27/48] Rebuild of makefile 7: Test Runner --- Makefile | 89 +++++++++++++++++++++++++++++++++++++++++---------- make_tools.mk | 12 ++++++- 2 files changed, 83 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 6db6c62428bb..71b98016a3bc 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,9 @@ endif ifeq (compare,$(MAKECMDGOALS)) COMPARE := 1 endif +ifeq (check,$(MAKECMDGOALS)) + TEST := 1 +endif # Default make rule all: rom @@ -73,21 +76,36 @@ endif ROM_NAME := $(FILE_NAME)_agbcc.gba OBJ_DIR_NAME := $(BUILD_DIR)/emerald +OBJ_DIR_NAME_TEST := $(BUILD_DIR)/test MODERN_ROM_NAME := $(FILE_NAME).gba MODERN_OBJ_DIR_NAME := $(BUILD_DIR)/modern +MODERN_OBJ_DIR_NAME_TEST := $(BUILD_DIR)/modern-test ELF_NAME := $(ROM_NAME:.gba=.elf) MAP_NAME := $(ROM_NAME:.gba=.map) MODERN_ELF_NAME := $(MODERN_ROM_NAME:.gba=.elf) MODERN_MAP_NAME := $(MODERN_ROM_NAME:.gba=.map) +TESTELF = $(ROM_NAME:.gba=-test.elf) +HEADLESSELF = $(ROM_NAME:.gba=-test-headless.elf) # Pick our active variables ifeq ($(MODERN),0) ROM := $(ROM_NAME) - OBJ_DIR := $(OBJ_DIR_NAME) + ifeq ($(TEST), 0) + OBJ_DIR := $(OBJ_DIR_NAME) + else + OBJ_DIR := $(OBJ_DIR_NAME_TEST) + endif else ROM := $(MODERN_ROM_NAME) - OBJ_DIR := $(MODERN_OBJ_DIR_NAME) + ifeq ($(TEST), 0) + OBJ_DIR := $(MODERN_OBJ_DIR_NAME) + else + OBJ_DIR := $(MODERN_OBJ_DIR_NAME_TEST) + endif +endif +ifeq ($(TESTELF),$(MAKECMDGOALS)) + TEST := 1 endif ELF := $(ROM:.gba=.elf) MAP := $(ROM:.gba=.map) @@ -103,6 +121,7 @@ SONG_SUBDIR = sound/songs MID_SUBDIR = sound/songs/midi SAMPLE_SUBDIR = sound/direct_sound_samples CRY_SUBDIR = sound/direct_sound_samples/cries +TEST_SUBDIR = test C_BUILDDIR = $(OBJ_DIR)/$(C_SUBDIR) GFLIB_BUILDDIR = $(OBJ_DIR)/$(GFLIB_SUBDIR) @@ -110,6 +129,7 @@ ASM_BUILDDIR = $(OBJ_DIR)/$(ASM_SUBDIR) DATA_ASM_BUILDDIR = $(OBJ_DIR)/$(DATA_ASM_SUBDIR) SONG_BUILDDIR = $(OBJ_DIR)/$(SONG_SUBDIR) MID_BUILDDIR = $(OBJ_DIR)/$(MID_SUBDIR) +TEST_BUILDDIR = $(OBJ_DIR)/$(TEST_SUBDIR) SHELL := bash -o pipefail @@ -155,16 +175,19 @@ endif AUTO_GEN_TARGETS := include make_tools.mk # Tool executables -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) -TRAINERPROC := $(TOOLS_DIR)/trainerproc/trainerproc$(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) +TRAINERPROC := $(TOOLS_DIR)/trainerproc/trainerproc$(EXE) +PATCHELF := $(TOOLS_DIR)/patchelf/patchelf$(EXE) +ROMTEST ?= $(shell { command -v mgba-rom-test || command -v $(TOOLS_DIR)/mgba/mgba-rom-test$(EXE); } 2>/dev/null) +ROMTESTHYDRA := $(TOOLS_DIR)/mgba-rom-test-hydra/mgba-rom-test-hydra$(EXE) PERL := perl SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c @@ -180,8 +203,8 @@ MAKEFLAGS += --no-print-directory # Secondary expansion is required for dependency variables in object rules. .SECONDEXPANSION: -RULES_NO_SCAN += libagbsyscall clean clean-assets tidy tidymodern tidynonmodern generated clean-generated -.PHONY: all rom agbcc modern compare +RULES_NO_SCAN += libagbsyscall clean clean-assets tidy tidymodern tidynonmodern tidycheck generated clean-generated $(TESTELF) +.PHONY: all rom agbcc modern compare check .PHONY: $(RULES_NO_SCAN) infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) @@ -211,6 +234,11 @@ C_SRCS_IN := $(wildcard $(C_SUBDIR)/*.c $(C_SUBDIR)/*/*.c $(C_SUBDIR)/*/*/*.c) C_SRCS := $(foreach src,$(C_SRCS_IN),$(if $(findstring .inc.c,$(src)),,$(src))) C_OBJS := $(patsubst $(C_SUBDIR)/%.c,$(C_BUILDDIR)/%.o,$(C_SRCS)) +TEST_SRCS_IN := $(wildcard $(TEST_SUBDIR)/*.c $(TEST_SUBDIR)/*/*.c $(TEST_SUBDIR)/*/*/*.c) +TEST_SRCS := $(foreach src,$(TEST_SRCS_IN),$(if $(findstring .inc.c,$(src)),,$(src))) +TEST_OBJS := $(patsubst $(TEST_SUBDIR)/%.c,$(TEST_BUILDDIR)/%.o,$(TEST_SRCS)) +TEST_OBJS_REL := $(patsubst $(OBJ_DIR)/%,%,$(TEST_OBJS)) + GFLIB_SRCS := $(wildcard $(GFLIB_SUBDIR)/*.c) GFLIB_OBJS := $(patsubst $(GFLIB_SUBDIR)/%.c,$(GFLIB_BUILDDIR)/%.o,$(GFLIB_SRCS)) @@ -235,7 +263,7 @@ MID_OBJS := $(patsubst $(MID_SUBDIR)/%.mid,$(MID_BUILDDIR)/%.o,$(MID_SRCS)) OBJS := $(C_OBJS) $(GFLIB_OBJS) $(C_ASM_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS) $(SONG_OBJS) $(MID_OBJS) OBJS_REL := $(patsubst $(OBJ_DIR)/%,%,$(OBJS)) -SUBDIRS := $(sort $(dir $(OBJS))) +SUBDIRS := $(sort $(dir $(OBJS) $(dir $(TEST_OBJS)))) $(shell mkdir -p $(SUBDIRS)) # Pretend rules that are actually flags defer to `make all` @@ -248,6 +276,28 @@ agbcc: @echo "Search for 'agbcc: all' in Makefile to reenable agbcc." @exit 1 +LD_SCRIPT_TEST := ld_script_test.ld + +$(OBJ_DIR)/ld_script_test.ld: $(LD_SCRIPT_TEST) $(LD_SCRIPT_DEPS) + cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../$(LD_SCRIPT_TEST) > ld_script_test.ld + +$(TESTELF): $(OBJ_DIR)/ld_script_test.ld $(OBJS) $(TEST_OBJS) libagbsyscall tools check-tools + @echo "cd $(OBJ_DIR) && $(LD) -T ld_script_test.ld -o ../../$@ " + @cd $(OBJ_DIR) && $(LD) $(TESTLDFLAGS) -T ld_script_test.ld -o ../../$@ $(OBJS_REL) $(TEST_OBJS_REL) $(LIB) + $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) -d0 --silent + $(PATCHELF) $(TESTELF) gTestRunnerArgv "$(TESTS)\0" + +ifeq ($(GITHUB_REPOSITORY_OWNER),rh-hideout) +TEST_SKIP_IS_FAIL := \x01 +else +TEST_SKIP_IS_FAIL := \x00 +endif + +check: $(TESTELF) + @cp $< $(HEADLESSELF) + $(PATCHELF) $(HEADLESSELF) gTestRunnerHeadless '\x01' gTestRunnerSkipIsFail "$(TEST_SKIP_IS_FAIL)" + $(ROMTESTHYDRA) $(ROMTEST) $(OBJCOPY) $(HEADLESSELF) + # Other rules rom: $(ROM) ifeq ($(COMPARE),1) @@ -256,7 +306,7 @@ endif syms: $(SYM) -clean: tidy clean-tools clean-generated clean-assets +clean: tidy clean-tools clean-check-tools clean-generated clean-assets @$(MAKE) clean -C libagbsyscall clean-assets: @@ -267,7 +317,7 @@ clean-assets: find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + find $(DATA_ASM_SUBDIR)/maps \( -iname 'connections.inc' -o -iname 'events.inc' -o -iname 'header.inc' \) -exec rm {} + -tidy: tidynonmodern tidymodern +tidy: tidynonmodern tidymodern tidycheck tidynonmodern: rm -f $(ROM_NAME) $(ELF_NAME) $(MAP_NAME) @@ -277,6 +327,11 @@ tidymodern: rm -f $(MODERN_ROM_NAME) $(MODERN_ELF_NAME) $(MODERN_MAP_NAME) rm -rf $(MODERN_OBJ_DIR_NAME) +tidycheck: + rm -f $(TESTELF) $(HEADLESSELF) + rm -rf $(MODERN_OBJ_DIR_NAME_TEST) + rm -rf $(OBJ_DIR_NAME_TEST) + # Other rules include graphics_file_rules.mk include map_data_rules.mk diff --git a/make_tools.mk b/make_tools.mk index df9696f518b9..75ebc05c9625 100644 --- a/make_tools.mk +++ b/make_tools.mk @@ -6,17 +6,27 @@ MAKEFLAGS += --no-print-directory # Inclusive list. If you don't want a tool to be built, don't add it here. TOOLS_DIR := tools TOOL_NAMES := aif2pcm bin2c gbafix gbagfx jsonproc mapjson mid2agb preproc ramscrgen rsfont scaninc trainerproc +CHECK_TOOL_NAMES = patchelf mgba-rom-test-hydra TOOLDIRS := $(TOOL_NAMES:%=$(TOOLS_DIR)/%) +CHECKTOOLDIRS := $(CHECK_TOOL_NAMES:%=$(TOOLS_DIR)/%) # Tool making doesnt require a pokeemerald dependency scan. -RULES_NO_SCAN += tools check-tools clean-tools $(TOOLDIRS) +RULES_NO_SCAN += tools check-tools clean-tools clean-check-tools $(TOOLDIRS) $(CHECKTOOLDIRS) .PHONY: $(RULES_NO_SCAN) tools: $(TOOLDIRS) +check-tools: $(CHECKTOOLDIRS) + $(TOOLDIRS): @$(MAKE) -C $@ +$(CHECKTOOLDIRS): + @$(MAKE) -C $@ + clean-tools: @$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);) + +clean-check-tools: + @$(foreach tooldir,$(CHECKTOOLDIRS),$(MAKE) clean -C $(tooldir);) From b8c71fa84d7d590006b94b0b5b46aa9a74cf2f41 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 13 Sep 2024 23:38:50 -0400 Subject: [PATCH 28/48] Fix .d files not updating if .o fails, fix clean rule, remove some unnecessary warnings --- Makefile | 31 ++++++++++++++----------------- tools/mapjson/json11.cpp | 17 ++++++++--------- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index ce868f06bd86..48350147a493 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ GAME_CODE := BPEE MAKER_CODE := 01 REVISION := 0 MODERN ?= 0 +KEEP_TEMPS ?= 0 # `File name`.gba ('_modern' will be appended to the modern builds) FILE_NAME := pokeemerald @@ -261,18 +262,18 @@ include audio_rules.mk generated: $(AUTO_GEN_TARGETS) -%.s: ; +%.s: ; %.png: ; %.pal: ; %.aif: ; -%.1bpp: %.png ; $(GFX) $< $@ -%.4bpp: %.png ; $(GFX) $< $@ -%.8bpp: %.png ; $(GFX) $< $@ -%.gbapal: %.pal ; $(GFX) $< $@ -%.gbapal: %.png ; $(GFX) $< $@ -%.lz: % ; $(GFX) $< $@ -%.rl: % ; $(GFX) $< $@ +%.1bpp: %.png ; $(GFX) $< $@ +%.4bpp: %.png ; $(GFX) $< $@ +%.8bpp: %.png ; $(GFX) $< $@ +%.gbapal: %.pal ; $(GFX) $< $@ +%.gbapal: %.png ; $(GFX) $< $@ +%.lz: % ; $(GFX) $< $@ +%.rl: % ; $(GFX) $< $@ # NOTE: Tools must have been built prior (FIXME) generated: tools $(AUTO_GEN_TARGETS) @@ -310,7 +311,7 @@ endef # $1: Output file without extension, $2 input file, $3 temp path (if keeping) define C_DEP_IMPL $1.o: $2 -ifeq (,$(KEEP_TEMPS)) +ifneq ($(KEEP_TEMPS),1) @echo "$$(CC1) -o $$@ $$<" @$$(CPP) $$(CPPFLAGS) $$< | $$(PREPROC) -i $$< charmap.txt | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ - else @@ -319,15 +320,11 @@ else @echo -e ".text\n\t.align\t2, 0\n" >> $3.s $$(AS) $$(ASFLAGS) -o $$@ $3.s endif -$(call C_SCANINC,$1,$2) -endef -# Calls SCANINC to find dependencies -define C_SCANINC -ifneq ($(NODEP),1) -$1.o: $1.d $1.d: $2 $(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include -I gflib $2 -include $1.d +ifneq ($(NODEP),1) +$1.o: $1.d +-include $1.d endif endef @@ -359,7 +356,7 @@ ifneq ($(NODEP),1) $1.o: $1.d $1.d: $2 $(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I "" $2 -include $1.d +-include $1.d endif endef diff --git a/tools/mapjson/json11.cpp b/tools/mapjson/json11.cpp index 1da530206bd7..3ac5f392a0bd 100644 --- a/tools/mapjson/json11.cpp +++ b/tools/mapjson/json11.cpp @@ -33,7 +33,6 @@ using std::vector; using std::map; using std::make_shared; using std::initializer_list; -using std::move; /* Helper for representing null - just a do-nothing struct, plus comparison * operators so the helpers in JsonValue work. We can't use nullptr_t because @@ -149,7 +148,7 @@ class Value : public JsonValue { // Constructors explicit Value(const T &value) : m_value(value) {} - explicit Value(T &&value) : m_value(move(value)) {} + explicit Value(T &&value) : m_value(std::move(value)) {} // Get type tag Json::Type type() const override { @@ -196,7 +195,7 @@ class JsonString final : public Value { const string &string_value() const override { return m_value; } public: explicit JsonString(const string &value) : Value(value) {} - explicit JsonString(string &&value) : Value(move(value)) {} + explicit JsonString(string &&value) : Value(std::move(value)) {} }; class JsonArray final : public Value { @@ -204,7 +203,7 @@ class JsonArray final : public Value { const Json & operator[](size_t i) const override; public: explicit JsonArray(const Json::array &value) : Value(value) {} - explicit JsonArray(Json::array &&value) : Value(move(value)) {} + explicit JsonArray(Json::array &&value) : Value(std::move(value)) {} }; class JsonObject final : public Value { @@ -212,7 +211,7 @@ class JsonObject final : public Value { const Json & operator[](const string &key) const override; public: explicit JsonObject(const Json::object &value) : Value(value) {} - explicit JsonObject(Json::object &&value) : Value(move(value)) {} + explicit JsonObject(Json::object &&value) : Value(std::move(value)) {} }; class JsonNull final : public Value { @@ -254,12 +253,12 @@ Json::Json(double value) : m_ptr(make_shared(value)) { Json::Json(int value) : m_ptr(make_shared(value)) {} Json::Json(bool value) : m_ptr(value ? statics().t : statics().f) {} Json::Json(const string &value) : m_ptr(make_shared(value)) {} -Json::Json(string &&value) : m_ptr(make_shared(move(value))) {} +Json::Json(string &&value) : m_ptr(make_shared(std::move(value))) {} Json::Json(const char * value) : m_ptr(make_shared(value)) {} Json::Json(const Json::array &values) : m_ptr(make_shared(values)) {} -Json::Json(Json::array &&values) : m_ptr(make_shared(move(values))) {} +Json::Json(Json::array &&values) : m_ptr(make_shared(std::move(values))) {} Json::Json(const Json::object &values) : m_ptr(make_shared(values)) {} -Json::Json(Json::object &&values) : m_ptr(make_shared(move(values))) {} +Json::Json(Json::object &&values) : m_ptr(make_shared(std::move(values))) {} /* * * * * * * * * * * * * * * * * * * * * Accessors @@ -357,7 +356,7 @@ struct JsonParser final { * Mark this parse as failed. */ Json fail(string &&msg) { - return fail(move(msg), Json()); + return fail(std::move(msg), Json()); } template From 302193a814ffcf12fa2a5c394ce2ce85e6c49250 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 13 Sep 2024 23:40:00 -0400 Subject: [PATCH 29/48] Have scaninc ignore non-existing files --- tools/scaninc/scaninc.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/scaninc/scaninc.cpp b/tools/scaninc/scaninc.cpp index f5ee7ad6deeb..c1b7987a5a4c 100644 --- a/tools/scaninc/scaninc.cpp +++ b/tools/scaninc/scaninc.cpp @@ -125,7 +125,12 @@ int main(int argc, char **argv) if (!exists && (file.FileType() == SourceFileType::Asm || file.FileType() == SourceFileType::Inc)) { path = include; + if (CanOpenFile(path)) + exists = true; } + if (!exists) + continue; + dependencies_includes.insert(path); bool inserted = dependencies.insert(path).second; if (inserted && exists) From c4b5818d986b6c4525ee78a360342ec2cb534e68 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 14 Sep 2024 19:13:02 +0200 Subject: [PATCH 30/48] remove ScriptContext_Enable from secret_base.h --- include/secret_base.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/secret_base.h b/include/secret_base.h index cb3b95ee780e..567316cf9cb8 100644 --- a/include/secret_base.h +++ b/include/secret_base.h @@ -24,7 +24,6 @@ void SetCurSecretBaseIdFromPosition(const struct MapPosition *position, const st void TrySetCurSecretBaseIndex(void); void CheckPlayerHasSecretBase(void); void ToggleSecretBaseEntranceMetatile(void); -void ScriptContext_Enable(void); void ReceiveSecretBasesData(void *records, size_t recordSize, u8 linkIdx); #endif //GUARD_SECRET_BASE_H From f7209166338cf881490519e8334882d740875f51 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 15 Sep 2024 02:25:12 -0300 Subject: [PATCH 31/48] CI fix attempt --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0322cbe11f00..0cd9583984d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,5 +59,4 @@ jobs: MODERN: 1 TEST: 1 run: | - make -j${nproc} -O pokeemerald-test.elf make -j${nproc} check From 52c2728ff6d07a5d8d420cbe39c08365aa1ca01e Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Wed, 18 Sep 2024 10:37:34 -0400 Subject: [PATCH 32/48] remove gflib --- Makefile | 13 ++------- {gflib => include}/bg.h | 0 {gflib => include}/blit.h | 0 {gflib => include/constants}/characters.h | 0 {gflib => include}/dma3.h | 0 {gflib => include}/gpu_regs.h | 0 {gflib => include}/io_reg.h | 0 {gflib => include}/malloc.h | 0 {gflib => include}/sprite.h | 0 {gflib => include}/string_util.h | 0 {gflib => include}/text.h | 2 +- {gflib => include}/window.h | 0 ld_script.ld | 34 ++++++++++------------- ld_script_modern.ld | 5 ---- {gflib => src}/bg.c | 0 {gflib => src}/blit.c | 0 {gflib => src}/dma3_manager.c | 0 {gflib => src}/gpu_regs.c | 0 {gflib => src}/io_reg.c | 0 {gflib => src}/malloc.c | 0 src/mini_printf.c | 2 +- {gflib => src}/sprite.c | 0 {gflib => src}/string_util.c | 0 {gflib => src}/text.c | 0 {gflib => src}/window.c | 0 sym_bss.txt | 12 ++++---- sym_common.txt | 8 +++--- sym_ewram.txt | 10 +++---- tools/preproc/asm_file.cpp | 2 +- 29 files changed, 36 insertions(+), 52 deletions(-) rename {gflib => include}/bg.h (100%) rename {gflib => include}/blit.h (100%) rename {gflib => include/constants}/characters.h (100%) rename {gflib => include}/dma3.h (100%) rename {gflib => include}/gpu_regs.h (100%) rename {gflib => include}/io_reg.h (100%) rename {gflib => include}/malloc.h (100%) rename {gflib => include}/sprite.h (100%) rename {gflib => include}/string_util.h (100%) rename {gflib => include}/text.h (99%) rename {gflib => include}/window.h (100%) rename {gflib => src}/bg.c (100%) rename {gflib => src}/blit.c (100%) rename {gflib => src}/dma3_manager.c (100%) rename {gflib => src}/gpu_regs.c (100%) rename {gflib => src}/io_reg.c (100%) rename {gflib => src}/malloc.c (100%) rename {gflib => src}/sprite.c (100%) rename {gflib => src}/string_util.c (100%) rename {gflib => src}/text.c (100%) rename {gflib => src}/window.c (100%) diff --git a/Makefile b/Makefile index ce868f06bd86..9082680c8ca2 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,6 @@ SYM := $(ROM:.gba=.sym) # Commonly used directories C_SUBDIR = src -GFLIB_SUBDIR = gflib ASM_SUBDIR = asm DATA_SRC_SUBDIR = src/data DATA_ASM_SUBDIR = data @@ -98,7 +97,6 @@ SONG_SUBDIR = sound/songs MID_SUBDIR = sound/songs/midi C_BUILDDIR = $(OBJ_DIR)/$(C_SUBDIR) -GFLIB_BUILDDIR = $(OBJ_DIR)/$(GFLIB_SUBDIR) ASM_BUILDDIR = $(OBJ_DIR)/$(ASM_SUBDIR) DATA_ASM_BUILDDIR = $(OBJ_DIR)/$(DATA_ASM_SUBDIR) SONG_BUILDDIR = $(OBJ_DIR)/$(SONG_SUBDIR) @@ -114,7 +112,7 @@ INCLUDE_CPP_ARGS := $(INCLUDE_DIRS:%=-iquote %) INCLUDE_SCANINC_ARGS := $(INCLUDE_DIRS:%=-I %) O_LEVEL ?= 2 -CPPFLAGS := $(INCLUDE_CPP_ARGS) -iquote $(GFLIB_SUBDIR) -Wno-trigraphs -DMODERN=$(MODERN) +CPPFLAGS := $(INCLUDE_CPP_ARGS) -Wno-trigraphs -DMODERN=$(MODERN) ifeq ($(MODERN),0) CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef CC1 := tools/agbcc/bin/agbcc$(EXE) @@ -192,9 +190,6 @@ C_SRCS_IN := $(wildcard $(C_SUBDIR)/*.c $(C_SUBDIR)/*/*.c $(C_SUBDIR)/*/*/*.c) C_SRCS := $(foreach src,$(C_SRCS_IN),$(if $(findstring .inc.c,$(src)),,$(src))) C_OBJS := $(patsubst $(C_SUBDIR)/%.c,$(C_BUILDDIR)/%.o,$(C_SRCS)) -GFLIB_SRCS := $(wildcard $(GFLIB_SUBDIR)/*.c) -GFLIB_OBJS := $(patsubst $(GFLIB_SUBDIR)/%.c,$(GFLIB_BUILDDIR)/%.o,$(GFLIB_SRCS)) - C_ASM_SRCS := $(wildcard $(C_SUBDIR)/*.s $(C_SUBDIR)/*/*.s $(C_SUBDIR)/*/*/*.s) C_ASM_OBJS := $(patsubst $(C_SUBDIR)/%.s,$(C_BUILDDIR)/%.o,$(C_ASM_SRCS)) @@ -213,7 +208,7 @@ SONG_OBJS := $(patsubst $(SONG_SUBDIR)/%.s,$(SONG_BUILDDIR)/%.o,$(SONG_SRCS)) MID_SRCS := $(wildcard $(MID_SUBDIR)/*.mid) MID_OBJS := $(patsubst $(MID_SUBDIR)/%.mid,$(MID_BUILDDIR)/%.o,$(MID_SRCS)) -OBJS := $(C_OBJS) $(GFLIB_OBJS) $(C_ASM_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS) $(SONG_OBJS) $(MID_OBJS) +OBJS := $(C_OBJS) $(C_ASM_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS) $(SONG_OBJS) $(MID_OBJS) OBJS_REL := $(patsubst $(OBJ_DIR)/%,%,$(OBJS)) SUBDIRS := $(sort $(dir $(OBJS))) @@ -326,7 +321,7 @@ define C_SCANINC ifneq ($(NODEP),1) $1.o: $1.d $1.d: $2 - $(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include -I gflib $2 + $(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include $2 include $1.d endif endef @@ -334,10 +329,8 @@ endef # Create generic rules if no dependency scanning, else create the real rules ifeq ($(NODEP),1) $(eval $(call C_DEP,$(C_BUILDDIR)/%,$(C_SUBDIR)/%.c)) -$(eval $(call C_DEP,$(GFLIB_BUILDDIR)/%,$(GFLIB_SUBDIR)/%.c)) else $(foreach src,$(C_SRCS),$(eval $(call C_DEP,$(OBJ_DIR)/$(basename $(src)),$(src)))) -$(foreach src,$(GFLIB_SRCS),$(eval $(call C_DEP,$(OBJ_DIR)/$(basename $(src)),$(src)))) endif # Similar methodology for Assembly files diff --git a/gflib/bg.h b/include/bg.h similarity index 100% rename from gflib/bg.h rename to include/bg.h diff --git a/gflib/blit.h b/include/blit.h similarity index 100% rename from gflib/blit.h rename to include/blit.h diff --git a/gflib/characters.h b/include/constants/characters.h similarity index 100% rename from gflib/characters.h rename to include/constants/characters.h diff --git a/gflib/dma3.h b/include/dma3.h similarity index 100% rename from gflib/dma3.h rename to include/dma3.h diff --git a/gflib/gpu_regs.h b/include/gpu_regs.h similarity index 100% rename from gflib/gpu_regs.h rename to include/gpu_regs.h diff --git a/gflib/io_reg.h b/include/io_reg.h similarity index 100% rename from gflib/io_reg.h rename to include/io_reg.h diff --git a/gflib/malloc.h b/include/malloc.h similarity index 100% rename from gflib/malloc.h rename to include/malloc.h diff --git a/gflib/sprite.h b/include/sprite.h similarity index 100% rename from gflib/sprite.h rename to include/sprite.h diff --git a/gflib/string_util.h b/include/string_util.h similarity index 100% rename from gflib/string_util.h rename to include/string_util.h diff --git a/gflib/text.h b/include/text.h similarity index 99% rename from gflib/text.h rename to include/text.h index ff13efa9a82a..db9f4db873b9 100644 --- a/gflib/text.h +++ b/include/text.h @@ -1,7 +1,7 @@ #ifndef GUARD_TEXT_H #define GUARD_TEXT_H -#include "characters.h" +#include "constants/characters.h" // Given as a text speed when all the text should be // loaded at once but not copied to vram yet. diff --git a/gflib/window.h b/include/window.h similarity index 100% rename from gflib/window.h rename to include/window.h diff --git a/ld_script.ld b/ld_script.ld index c4abf075f8ae..1e08a8d61c3a 100644 --- a/ld_script.ld +++ b/ld_script.ld @@ -23,7 +23,6 @@ SECTIONS { { INCLUDE "sym_ewram.ld" src/*.o(ewram_data); - gflib/*.o(ewram_data); *libc.a:impure.o(.data); *libc.a:locale.o(.data); @@ -36,7 +35,6 @@ SECTIONS { /* .bss starts at 0x3000000 */ INCLUDE "sym_bss.ld" src/*.o(.bss); - gflib/*.o(.bss); data/*.o(.bss); /* .bss.code starts at 0x3001AA8 */ @@ -57,15 +55,15 @@ SECTIONS { src/rom_header_gf.o(.text.*); src/crt0.o(.text); src/main.o(.text); - gflib/malloc.o(.text); - gflib/dma3_manager.o(.text); - gflib/gpu_regs.o(.text); - gflib/bg.o(.text); - gflib/blit.o(.text); - gflib/window.o(.text); - gflib/text.o(.text); - gflib/sprite.o(.text); - gflib/string_util.o(.text); + src/malloc.o(.text); + src/dma3_manager.o(.text); + src/gpu_regs.o(.text); + src/bg.o(.text); + src/blit.o(.text); + src/window.o(.text); + src/text.o(.text); + src/sprite.o(.text); + src/string_util.o(.text); src/link.o(.text); src/AgbRfu_LinkManager.o(.text); src/link_rfu_3.o(.text); @@ -446,12 +444,12 @@ SECTIONS { src/rom_header.o(.rodata); src/rom_header_gf.o(.rodata); src/main.o(.rodata); - gflib/bg.o(.rodata); - gflib/window.o(.rodata); - gflib/text.o(.rodata); - gflib/sprite.o(.rodata); - gflib/io_reg.o(.rodata); - gflib/string_util.o(.rodata); + src/bg.o(.rodata); + src/window.o(.rodata); + src/text.o(.rodata); + src/sprite.o(.rodata); + src/io_reg.o(.rodata); + src/string_util.o(.rodata); src/link.o(.rodata); src/link.o(.rodata.str1.4); src/AgbRfu_LinkManager.o(.rodata); @@ -1317,9 +1315,7 @@ SECTIONS { ALIGN(4) { src/*.o(.text); - gflib/*.o(.text); src/*.o(.rodata); - gflib/*.o(.rodata); data/*.o(.rodata); } > ROM = 0 diff --git a/ld_script_modern.ld b/ld_script_modern.ld index 4ccbfbaa0f75..fac4a134c32c 100644 --- a/ld_script_modern.ld +++ b/ld_script_modern.ld @@ -16,14 +16,12 @@ SECTIONS { ALIGN(4) { src/*.o(ewram_data); - gflib/*.o(ewram_data); } > EWRAM iwram 0x3000000 (NOLOAD) : ALIGN(4) { src/*.o(.bss); - gflib/*.o(.bss); data/*.o(.bss); *libc.a:*.o(.bss*); *libnosys.a:*.o(.bss*); @@ -31,7 +29,6 @@ SECTIONS { src/m4a.o(.bss.code); src/*.o(COMMON); - gflib/*.o(COMMON); *libc.a:*.o(COMMON); *libnosys.a:*.o(COMMON); } > IWRAM @@ -46,7 +43,6 @@ SECTIONS { src/rom_header_gf.o(.text.*); src/crt0.o(.text); src/main.o(.text); - gflib/*.o(.text*); src/*.o(.text*); asm/*.o(.text*); } > ROM =0 @@ -82,7 +78,6 @@ SECTIONS { ALIGN(4) { src/*.o(.rodata*); - gflib/*.o(.rodata*); data/*.o(.rodata*); } > ROM =0 diff --git a/gflib/bg.c b/src/bg.c similarity index 100% rename from gflib/bg.c rename to src/bg.c diff --git a/gflib/blit.c b/src/blit.c similarity index 100% rename from gflib/blit.c rename to src/blit.c diff --git a/gflib/dma3_manager.c b/src/dma3_manager.c similarity index 100% rename from gflib/dma3_manager.c rename to src/dma3_manager.c diff --git a/gflib/gpu_regs.c b/src/gpu_regs.c similarity index 100% rename from gflib/gpu_regs.c rename to src/gpu_regs.c diff --git a/gflib/io_reg.c b/src/io_reg.c similarity index 100% rename from gflib/io_reg.c rename to src/io_reg.c diff --git a/gflib/malloc.c b/src/malloc.c similarity index 100% rename from gflib/malloc.c rename to src/malloc.c diff --git a/src/mini_printf.c b/src/mini_printf.c index cab78d761195..ac8a0ef12774 100644 --- a/src/mini_printf.c +++ b/src/mini_printf.c @@ -36,7 +36,7 @@ #include "gba/types.h" #include "gba/defines.h" #include "config.h" -#include "characters.h" +#include "constants/characters.h" #include "string_util.h" #ifndef NDEBUG diff --git a/gflib/sprite.c b/src/sprite.c similarity index 100% rename from gflib/sprite.c rename to src/sprite.c diff --git a/gflib/string_util.c b/src/string_util.c similarity index 100% rename from gflib/string_util.c rename to src/string_util.c diff --git a/gflib/text.c b/src/text.c similarity index 100% rename from gflib/text.c rename to src/text.c diff --git a/gflib/window.c b/src/window.c similarity index 100% rename from gflib/window.c rename to src/window.c diff --git a/sym_bss.txt b/sym_bss.txt index 3a23e747890e..0520e0b5b0a9 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -1,10 +1,10 @@ .include "src/main.o" - .include "gflib/malloc.o" - .include "gflib/dma3_manager.o" - .include "gflib/gpu_regs.o" - .include "gflib/bg.o" - .include "gflib/text.o" - .include "gflib/sprite.o" + .include "src/malloc.o" + .include "src/dma3_manager.o" + .include "src/gpu_regs.o" + .include "src/bg.o" + .include "src/text.o" + .include "src/sprite.o" .include "src/link.o" .include "src/AgbRfu_LinkManager.o" .include "src/link_rfu_3.o" diff --git a/sym_common.txt b/sym_common.txt index 7eebcac74e62..bffabfbdf323 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -1,17 +1,17 @@ .space 0x8 .include "main.o" - @ ../gflib/bg.o + @ ../src/bg.o .align 2 gWindowTileAutoAllocEnabled: .space 4 - @ ../gflib/window.o + @ ../src/window.o .align 4 gTransparentTileNumber: .space 1 .align 4 gWindowBgTilemapBuffers: .space 16 - @ ../gflib/text.o + @ ../src/text.o .align 4 gFonts: .space 4 @@ -24,7 +24,7 @@ gCurGlyph: .align 2 gTextFlags: .space 4 - @ ../gflib/sprite.o + @ ../src/sprite.o .align 2 gOamMatrixAllocBitmap: .space 4 diff --git a/sym_ewram.txt b/sym_ewram.txt index 31c507ee9bf4..92a69cc4c992 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -1,10 +1,10 @@ - .include "gflib/malloc.o" + .include "src/malloc.o" .include "src/decompress.o" .include "src/main.o" - .include "gflib/window.o" - .include "gflib/text.o" - .include "gflib/sprite.o" - .include "gflib/string_util.o" + .include "src/window.o" + .include "src/text.o" + .include "src/sprite.o" + .include "src/string_util.o" .include "src/link.o" .include "src/AgbRfu_LinkManager.o" .include "src/link_rfu_3.o" diff --git a/tools/preproc/asm_file.cpp b/tools/preproc/asm_file.cpp index 36b6c7ed0681..4eda54a3aad1 100644 --- a/tools/preproc/asm_file.cpp +++ b/tools/preproc/asm_file.cpp @@ -26,7 +26,7 @@ #include "char_util.h" #include "utf8.h" #include "string_parser.h" -#include "../../gflib/characters.h" +#include "../../include/constants/characters.h" #include "io.h" AsmFile::AsmFile(std::string filename, bool isStdin, bool doEnum) : m_filename(filename) From 9cb353179ba77e9d1247e003d018d5f005df8861 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Wed, 18 Sep 2024 10:42:28 -0400 Subject: [PATCH 33/48] fix indentation --- sym_common.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sym_common.txt b/sym_common.txt index bffabfbdf323..335af85a303f 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -4,14 +4,14 @@ .align 2 gWindowTileAutoAllocEnabled: .space 4 - @ ../src/window.o + @ ../src/window.o .align 4 gTransparentTileNumber: .space 1 .align 4 gWindowBgTilemapBuffers: .space 16 - @ ../src/text.o + @ ../src/text.o .align 4 gFonts: .space 4 @@ -24,7 +24,7 @@ gCurGlyph: .align 2 gTextFlags: .space 4 - @ ../src/sprite.o + @ ../src/sprite.o .align 2 gOamMatrixAllocBitmap: .space 4 From 80a37c16beb71698903836e7bf583a03ea78c112 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 25 Sep 2024 13:35:52 -0400 Subject: [PATCH 34/48] Remove explicit symbol sizes in sym_common.txt --- common_syms/ereader_screen.txt | 1 + src/ereader_screen.c | 3 +++ sym_common.txt | 48 +++++----------------------------- 3 files changed, 11 insertions(+), 41 deletions(-) diff --git a/common_syms/ereader_screen.txt b/common_syms/ereader_screen.txt index 2189eedbc925..26b01f678de1 100644 --- a/common_syms/ereader_screen.txt +++ b/common_syms/ereader_screen.txt @@ -1 +1,2 @@ +gUnknownSpace gEReaderData diff --git a/src/ereader_screen.c b/src/ereader_screen.c index c625c78a9e3c..cb048d2ae359 100755 --- a/src/ereader_screen.c +++ b/src/ereader_screen.c @@ -40,6 +40,9 @@ struct EReaderData static void Task_EReader(u8); +// This belongs in COMMON somewhere between party_menu and ereader_screen, but it's unused so it's unclear where. +UNUSED u8 gUnknownSpace[64]; + struct EReaderData gEReaderData; extern const u8 gMultiBootProgram_EReader_Start[]; diff --git a/sym_common.txt b/sym_common.txt index 335af85a303f..e001c2ca59d5 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -1,37 +1,10 @@ - .space 0x8 - .include "main.o" - @ ../src/bg.o - .align 2 -gWindowTileAutoAllocEnabled: - .space 4 - @ ../src/window.o - .align 4 -gTransparentTileNumber: - .space 1 - .align 4 -gWindowBgTilemapBuffers: - .space 16 - @ ../src/text.o - .align 4 -gFonts: - .space 4 - .align 2 -gDisableTextPrinters: - .space 1 .align 4 -gCurGlyph: - .space 132 - .align 2 -gTextFlags: - .space 4 - @ ../src/sprite.o - .align 2 -gOamMatrixAllocBitmap: - .space 4 - .align 2 -gReservedSpritePaletteCount: - .space 1 + .include "main.o" + .include "bg.o" .align 4 + .include "window.o" + .include "text.o" + .include "sprite.o" .include "link.o" .include "AgbRfu_LinkManager.o" .include "link_rfu_2.o" @@ -53,9 +26,7 @@ gReservedSpritePaletteCount: .include "tv.o" .include "mauville_old_man.o" .include "image_processing_effects.o" - - .space 0x4 - + .align 4 .include "contest_painting.o" .include "field_specials.o" .include "evolution_scene.o" @@ -66,14 +37,9 @@ gReservedSpritePaletteCount: .include "battle_anim_throw.o" .include "battle_factory_screen.o" .include "apprentice.o" - - .space 0x8 - + .align 4 .include "list_menu.o" .include "party_menu.o" - - .space 0x44 - .include "ereader_screen.o" .include "m4a.o" .include "agb_flash.o" From 8e2c3ca3f2238765e993d005a00dbe4a6abf4a83 Mon Sep 17 00:00:00 2001 From: Scyrous <74797764+Scyrous@users.noreply.github.com> Date: Sun, 29 Sep 2024 14:13:50 +0200 Subject: [PATCH 35/48] Bugfix for cable car sprite array count --- src/cable_car.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cable_car.c b/src/cable_car.c index 8a666a536e46..9a6166b59906 100644 --- a/src/cable_car.c +++ b/src/cable_car.c @@ -880,8 +880,12 @@ static void CreateCableCarSprites(void) // 1/64 chance for an NPC to appear hiking on the ground below the Cable Car if ((rval % 64) == 0) { - // Unclear if this was intentional, but the - 1 in the below ARRAY_COUNT means the Zigzagoon is never used + // BUGFIX: The - 1 in the below ARRAY_COUNT means the Zigzagoon is never used +#ifdef #BUGFIX + spriteId = CreateObjectGraphicsSprite(hikerGraphicsIds[rval % ARRAY_COUNT(hikerGraphicsIds)], hikerCallbacks[GOING_DOWN], hikerCoords[GOING_DOWN][0], hikerCoords[GOING_DOWN][1], 106); +#else spriteId = CreateObjectGraphicsSprite(hikerGraphicsIds[rval % (ARRAY_COUNT(hikerGraphicsIds) - 1)], hikerCallbacks[GOING_DOWN], hikerCoords[GOING_DOWN][0], hikerCoords[GOING_DOWN][1], 106); +#endif if (spriteId != MAX_SPRITES) { gSprites[spriteId].oam.priority = 2; From 1dc85df1f0ab617dc402ee2da1f37097e3758461 Mon Sep 17 00:00:00 2001 From: Scyrous <74797764+Scyrous@users.noreply.github.com> Date: Sun, 29 Sep 2024 14:38:08 +0200 Subject: [PATCH 36/48] Update cable_car.c --- src/cable_car.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cable_car.c b/src/cable_car.c index 9a6166b59906..522ea01a97ab 100644 --- a/src/cable_car.c +++ b/src/cable_car.c @@ -881,7 +881,7 @@ static void CreateCableCarSprites(void) if ((rval % 64) == 0) { // BUGFIX: The - 1 in the below ARRAY_COUNT means the Zigzagoon is never used -#ifdef #BUGFIX +#ifdef BUGFIX spriteId = CreateObjectGraphicsSprite(hikerGraphicsIds[rval % ARRAY_COUNT(hikerGraphicsIds)], hikerCallbacks[GOING_DOWN], hikerCoords[GOING_DOWN][0], hikerCoords[GOING_DOWN][1], 106); #else spriteId = CreateObjectGraphicsSprite(hikerGraphicsIds[rval % (ARRAY_COUNT(hikerGraphicsIds) - 1)], hikerCallbacks[GOING_DOWN], hikerCoords[GOING_DOWN][0], hikerCoords[GOING_DOWN][1], 106); From c8cc0fa5a34f15b2ff1841dc380f215da677ff1f Mon Sep 17 00:00:00 2001 From: Jaizu Date: Tue, 1 Oct 2024 10:07:45 +0200 Subject: [PATCH 37/48] Ignore mGBA screenshots Everytime I make a new project I suffer, please merge. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 9fa431e14320..f940d26b217b 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,5 @@ prefabs.json *.diff *.sym *.js +/pokeemerald-*.png +/pokeemerald_modern-*.png From 9a24c031bb21e5f9d198a93ef7b8acb66bbcdec7 Mon Sep 17 00:00:00 2001 From: psf <77138753+pkmnsnfrn@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:48:54 -0700 Subject: [PATCH 38/48] Replaced copyright magic numbers in intro.c with constants (#2035) --- src/intro.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/intro.c b/src/intro.c index 195374bba0c9..02c3a1f9488f 100644 --- a/src/intro.c +++ b/src/intro.c @@ -112,6 +112,12 @@ extern const struct CompressedSpriteSheet gBattleAnimPicTable[]; extern const struct CompressedSpritePalette gBattleAnimPaletteTable[]; extern const struct SpriteTemplate gAncientPowerRockSpriteTemplate[]; +enum { + COPYRIGHT_INITIALIZE, + COPYRIGHT_START_FADE = 140, + COPYRIGHT_START_INTRO, +}; + #define TAG_VOLBEAT 1500 #define TAG_TORCHIC 1501 #define TAG_MANECTRIC 1502 @@ -1067,7 +1073,7 @@ static u8 SetUpCopyrightScreen(void) { switch (gMain.state) { - case 0: + case COPYRIGHT_INITIALIZE: SetVBlankCallback(NULL); SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0); @@ -1101,7 +1107,7 @@ static u8 SetUpCopyrightScreen(void) gMain.state++; GameCubeMultiBoot_Main(&gMultibootProgramStruct); break; - case 140: + case COPYRIGHT_START_FADE: GameCubeMultiBoot_Main(&gMultibootProgramStruct); if (gMultibootProgramStruct.gcmb_field_2 != 1) { @@ -1109,7 +1115,7 @@ static u8 SetUpCopyrightScreen(void) gMain.state++; } break; - case 141: + case COPYRIGHT_START_INTRO: if (UpdatePaletteFade()) break; CreateTask(Task_Scene1_Load, 0); From 9ad0018c176092ea3ff2a1884cf11ae1b5a194b7 Mon Sep 17 00:00:00 2001 From: Rose <83477269+AreaZR@users.noreply.github.com> Date: Thu, 10 Oct 2024 10:27:33 -0400 Subject: [PATCH 39/48] Fix typo: | should be || in Task_TryFieldPoisonWhiteOut Yes, this is honestly overkill, as it doesn't actually fix any behavioral bugs, but I was suggested to do this. This was a typo made in the source that GameFreak made, and the compiler warns against this. I opened a PR in pokeemerald expansion and was suggested to open one here. --- src/field_poison.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/field_poison.c b/src/field_poison.c index f254a6d142e4..d952b4b640a5 100644 --- a/src/field_poison.c +++ b/src/field_poison.c @@ -89,7 +89,11 @@ static void Task_TryFieldPoisonWhiteOut(u8 taskId) if (AllMonsFainted()) { // Battle facilities have their own white out script to handle the challenge loss +#ifdef BUGFIX + if (InBattlePyramid() || InBattlePike() || InTrainerHillChallenge()) +#else if (InBattlePyramid() | InBattlePike() || InTrainerHillChallenge()) +#endif gSpecialVar_Result = FLDPSN_FRONTIER_WHITEOUT; else gSpecialVar_Result = FLDPSN_WHITEOUT; From 6d24d8a78f4e0fb9bc139343a970b84beabb6560 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 11 Oct 2024 13:05:56 -0400 Subject: [PATCH 40/48] Fix libpng installation for workflow on Ubuntu 24.04 --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 283e6f8fb565..a99c99283ded 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,8 +32,9 @@ jobs: repository: pret/agbcc - name: Install binutils - run: sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi - # build-essential, git, and libpng-dev are already installed + run: | + sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi libpng-dev + # build-essential and git are already installed # gcc-arm-none-eabi is only needed for the modern build # as an alternative to dkP From fcc067e5154bedc92a2e8ab009718d97d1fc94e5 Mon Sep 17 00:00:00 2001 From: Martin Griffin Date: Fri, 11 Oct 2024 18:50:26 +0100 Subject: [PATCH 41/48] [preproc] support C23 enum underlying type syntax (#2043) --- tools/preproc/asm_file.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/preproc/asm_file.cpp b/tools/preproc/asm_file.cpp index 4eda54a3aad1..a82354cb5f10 100644 --- a/tools/preproc/asm_file.cpp +++ b/tools/preproc/asm_file.cpp @@ -524,6 +524,17 @@ bool AsmFile::ParseEnum() long enumCounter = 0; long symbolCount = 0; + if (m_buffer[m_pos] == ':') // : + { + m_pos++; + std::string underlyingType; + do { + currentHeaderLine += SkipWhitespaceAndEol(); + underlyingType = ReadIdentifier(); + } while (!underlyingType.empty()); + currentHeaderLine += SkipWhitespaceAndEol(); + } + if (m_buffer[m_pos] != '{') // assume assembly macro, otherwise assume enum and report errors accordingly { m_pos = fallbackPosition - 4; From 2c7964dbc273b0bed4456cdbd31ed4ee9b0bc783 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Fri, 11 Oct 2024 18:33:32 +0000 Subject: [PATCH 42/48] Fix deleting files with dependency files (#2045) --- Makefile | 4 +--- tools/scaninc/scaninc.cpp | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 5eaf4cf0bca3..ee36562b1389 100644 --- a/Makefile +++ b/Makefile @@ -315,10 +315,9 @@ else @echo -e ".text\n\t.align\t2, 0\n" >> $3.s $$(AS) $$(ASFLAGS) -o $$@ $3.s endif +ifneq ($(NODEP),1) $1.d: $2 $(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include $2 -ifneq ($(NODEP),1) -$1.o: $1.d -include $1.d endif endef @@ -346,7 +345,6 @@ endef define ASM_SCANINC ifneq ($(NODEP),1) -$1.o: $1.d $1.d: $2 $(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I "" $2 -include $1.d diff --git a/tools/scaninc/scaninc.cpp b/tools/scaninc/scaninc.cpp index c1b7987a5a4c..d470a3f163e3 100644 --- a/tools/scaninc/scaninc.cpp +++ b/tools/scaninc/scaninc.cpp @@ -157,19 +157,29 @@ int main(int argc, char **argv) // Print a make rule for the object file size_t ext_pos = make_outfile.find_last_of("."); auto object_file = make_outfile.substr(0, ext_pos + 1) + "o"; - output << object_file.c_str() << ": "; + output << object_file.c_str() << ":"; for (const std::string &path : dependencies) { - output << path << " "; + output << " " << path; } + output << '\n'; // Dependency list rule. // Although these rules are identical, they need to be separate, else make will trigger the rule again after the file is created for the first time. - output << "\n" << make_outfile.c_str() << ": "; + output << make_outfile.c_str() << ":"; for (const std::string &path : dependencies_includes) { - output << path << " "; + output << " " << path; } + output << '\n'; + + // Dummy rules + // If a dependency is deleted, make will try to make it, instead of rescanning the dependencies before trying to do that. + for (const std::string &path : dependencies) + { + output << path << ":\n"; + } + output.flush(); output.close(); } From b6892f5b67782afe05fcd31eaa2d1850bc4e3bc1 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 11 Oct 2024 15:03:38 -0400 Subject: [PATCH 43/48] Let scaninc ignore empty C files --- tools/scaninc/c_file.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/scaninc/c_file.cpp b/tools/scaninc/c_file.cpp index 595f366cbe38..c1fe10d374a3 100644 --- a/tools/scaninc/c_file.cpp +++ b/tools/scaninc/c_file.cpp @@ -33,6 +33,11 @@ CFile::CFile(std::string path) m_size = std::ftell(fp); + if (m_size < 0) + FATAL_ERROR("File size of \"%s\" is less than zero.\n", path.c_str()); + else if (m_size == 0) + return; // Empty file + m_buffer = new char[m_size + 1]; m_buffer[m_size] = 0; @@ -49,7 +54,7 @@ CFile::CFile(std::string path) CFile::~CFile() { - delete[] m_buffer; + if (m_size > 0) delete[] m_buffer; } void CFile::FindIncbins() From a0be2cbf7b451f20cc5940fa04caf0dc3c5221a3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 12 Oct 2024 23:50:12 -0400 Subject: [PATCH 44/48] Fix Fallorbor typo --- data/maps/FallarborTown_PokemonCenter_1F/map.json | 2 +- include/constants/flags.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/maps/FallarborTown_PokemonCenter_1F/map.json b/data/maps/FallarborTown_PokemonCenter_1F/map.json index 93204a215a0d..0c3dd726df4b 100644 --- a/data/maps/FallarborTown_PokemonCenter_1F/map.json +++ b/data/maps/FallarborTown_PokemonCenter_1F/map.json @@ -64,7 +64,7 @@ "trainer_type": "TRAINER_TYPE_NONE", "trainer_sight_or_berry_tree_id": "0", "script": "FallarborTown_PokemonCenter_1F_EventScript_Lanette", - "flag": "FLAG_HIDE_FALLORBOR_POKEMON_CENTER_LANETTE" + "flag": "FLAG_HIDE_FALLARBOR_POKEMON_CENTER_LANETTE" } ], "warp_events": [ diff --git a/include/constants/flags.h b/include/constants/flags.h index 5b1b5efd190d..f291a6187192 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -919,7 +919,7 @@ #define FLAG_HIDE_LITTLEROOT_TOWN_FAT_MAN 0x364 #define FLAG_HIDE_SLATEPORT_CITY_STERNS_SHIPYARD_MR_BRINEY 0x365 #define FLAG_HIDE_LANETTES_HOUSE_LANETTE 0x366 -#define FLAG_HIDE_FALLORBOR_POKEMON_CENTER_LANETTE 0x367 +#define FLAG_HIDE_FALLARBOR_POKEMON_CENTER_LANETTE 0x367 #define FLAG_HIDE_TRICK_HOUSE_ENTRANCE_MAN 0x368 #define FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER_REPLACEMENT 0x369 #define FLAG_HIDE_DESERT_UNDERPASS_FOSSIL 0x36A From 253d3dd7ef1cd123d4ba2cce4117da13a503a8b9 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Tue, 15 Oct 2024 03:47:07 +0000 Subject: [PATCH 45/48] Remove unnecessary looping for rule generation and unroll macros (#2046) --- Makefile | 87 +++++++++++++++++++++++--------------------------------- 1 file changed, 35 insertions(+), 52 deletions(-) diff --git a/Makefile b/Makefile index ee36562b1389..58f6c14513a9 100644 --- a/Makefile +++ b/Makefile @@ -297,69 +297,52 @@ endif # As a side effect, they're evaluated immediately instead of when the rule is invoked. # It doesn't look like $(shell) can be deferred so there might not be a better way (Icedude_907: there is soon). -# For C dependencies. -# Args: $1 = Output file without extension (build/assets/src/data), $2 = Input file (src/data.c) -define C_DEP -$(call C_DEP_IMPL,$1,$2,$1) -endef -# Internal implementation details. -# $1: Output file without extension, $2 input file, $3 temp path (if keeping) -define C_DEP_IMPL -$1.o: $2 +$(C_BUILDDIR)/%.o: $(C_SUBDIR)/%.c ifneq ($(KEEP_TEMPS),1) - @echo "$$(CC1) -o $$@ $$<" - @$$(CPP) $$(CPPFLAGS) $$< | $$(PREPROC) -i $$< charmap.txt | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ - + @echo "$(CC1) -o $@ $<" + @$(CPP) $(CPPFLAGS) $< | $(PREPROC) -i $< charmap.txt | $(CC1) $(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $(AS) $(ASFLAGS) -o $@ - else - @$$(CPP) $$(CPPFLAGS) $$< -o $3.i - @$$(PREPROC) $3.i charmap.txt | $$(CC1) $$(CFLAGS) -o $3.s - @echo -e ".text\n\t.align\t2, 0\n" >> $3.s - $$(AS) $$(ASFLAGS) -o $$@ $3.s + @$(CPP) $(CPPFLAGS) $< -o $*.i + @$(PREPROC) $*.i charmap.txt | $(CC1) $(CFLAGS) -o $*.s + @echo -e ".text\n\t.align\t2, 0\n" >> $*.s + $(AS) $(ASFLAGS) -o $@ $*.s endif + +$(C_BUILDDIR)/%.d: $(C_SUBDIR)/%.c + $(SCANINC) -M $@ $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include $< + ifneq ($(NODEP),1) -$1.d: $2 - $(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include $2 --include $1.d +-include $(addprefix $(OBJ_DIR)/,$(C_SRCS:.c=.d)) endif -endef -# Create generic rules if no dependency scanning, else create the real rules -ifeq ($(NODEP),1) -$(eval $(call C_DEP,$(C_BUILDDIR)/%,$(C_SUBDIR)/%.c)) -else -$(foreach src,$(C_SRCS),$(eval $(call C_DEP,$(OBJ_DIR)/$(basename $(src)),$(src)))) +$(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s + $(AS) $(ASFLAGS) -o $@ $< + +$(ASM_BUILDDIR)/%.d: $(ASM_SUBDIR)/%.s + $(SCANINC) -M $@ $(INCLUDE_SCANINC_ARGS) -I "" $< + +ifneq ($(NODEP),1) +-include $(addprefix $(OBJ_DIR)/,$(ASM_SRCS:.s=.d)) endif -# Similar methodology for Assembly files -# $1: Output path without extension, $2: Input file (`*.s`) -define ASM_DEP -$1.o: $2 - $$(AS) $$(ASFLAGS) -o $$@ $$< -$(call ASM_SCANINC,$1,$2) -endef -# As above but first doing a preprocessor pass -define ASM_DEP_PREPROC -$1.o: $2 - $$(PREPROC) $$< charmap.txt | $$(CPP) $(INCLUDE_SCANINC_ARGS) - | $$(PREPROC) -ie $$< charmap.txt | $$(AS) $$(ASFLAGS) -o $$@ -$(call ASM_SCANINC,$1,$2) -endef - -define ASM_SCANINC +$(C_BUILDDIR)/%.o: $(C_SUBDIR)/%.s + $(PREPROC) $< charmap.txt | $(CPP) $(INCLUDE_SCANINC_ARGS) - | $(PREPROC) -ie $< charmap.txt | $(AS) $(ASFLAGS) -o $@ + +$(C_BUILDDIR)/%.d: $(C_SUBDIR)/%.s + $(SCANINC) -M $@ $(INCLUDE_SCANINC_ARGS) -I "" $< + ifneq ($(NODEP),1) -$1.d: $2 - $(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I "" $2 --include $1.d +-include $(addprefix $(OBJ_DIR)/,$(C_ASM_SRCS:.s=.d)) endif -endef -# Dummy rules or real rules -ifeq ($(NODEP),1) -$(eval $(call ASM_DEP,$(ASM_BUILDDIR)/%,$(ASM_SUBDIR)/%.s)) -$(eval $(call ASM_DEP_PREPROC,$(C_BUILDDIR)/%,$(C_SUBDIR)/%.s)) -$(eval $(call ASM_DEP_PREPROC,$(DATA_ASM_BUILDDIR)/%,$(DATA_ASM_SUBDIR)/%.s)) -else -$(foreach src, $(ASM_SRCS), $(eval $(call ASM_DEP,$(src:%.s=$(OBJ_DIR)/%),$(src)))) -$(foreach src, $(C_ASM_SRCS), $(eval $(call ASM_DEP_PREPROC,$(src:%.s=$(OBJ_DIR)/%),$(src)))) -$(foreach src, $(REGULAR_DATA_ASM_SRCS), $(eval $(call ASM_DEP_PREPROC,$(src:%.s=$(OBJ_DIR)/%),$(src)))) +$(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s + $(PREPROC) $< charmap.txt | $(CPP) $(INCLUDE_SCANINC_ARGS) - | $(PREPROC) -ie $< charmap.txt | $(AS) $(ASFLAGS) -o $@ + +$(DATA_ASM_BUILDDIR)/%.d: $(DATA_ASM_SUBDIR)/%.s + $(SCANINC) -M $@ $(INCLUDE_SCANINC_ARGS) -I "" $< + +ifneq ($(NODEP),1) +-include $(addprefix $(OBJ_DIR)/,$(REGULAR_DATA_ASM_SRCS:.s=.d)) endif $(OBJ_DIR)/sym_bss.ld: sym_bss.txt From a55c75d350969624745a357711ba01edf8ce9590 Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Mon, 14 Oct 2024 23:52:11 -0400 Subject: [PATCH 46/48] Get rid of common syms (#2040) --- Makefile | 17 ++- common_syms/AgbRfu_LinkManager.txt | 1 - common_syms/agb_flash.txt | 10 -- common_syms/apprentice.txt | 3 - common_syms/battle_anim_throw.txt | 3 - common_syms/battle_factory_screen.txt | 1 - common_syms/battle_main.txt | 9 -- common_syms/battle_tower.txt | 1 - common_syms/berry_blender.txt | 1 - common_syms/bg.txt | 1 - common_syms/contest.txt | 1 - common_syms/contest_painting.txt | 4 - common_syms/ereader_screen.txt | 2 - common_syms/evolution_scene.txt | 1 - common_syms/faraway_island.txt | 3 - common_syms/field_camera.txt | 3 - common_syms/field_control_avatar.txt | 1 - common_syms/field_specials.txt | 1 - common_syms/fieldmap.txt | 1 - common_syms/image_processing_effects.txt | 10 -- common_syms/intro.txt | 2 - common_syms/librfu_rfu.txt | 5 - common_syms/librfu_sio32id.txt | 1 - common_syms/librfu_stwi.txt | 1 - common_syms/link.txt | 35 ------ common_syms/link_rfu_2.txt | 2 - common_syms/list_menu.txt | 2 - common_syms/load_save.txt | 4 - common_syms/m4a.txt | 12 --- common_syms/main.txt | 9 -- common_syms/mauville_old_man.txt | 1 - common_syms/overworld.txt | 8 -- common_syms/party_menu.txt | 1 - common_syms/pokedex.txt | 2 - common_syms/pokedex_cry_screen.txt | 1 - common_syms/random.txt | 2 - common_syms/rtc.txt | 1 - common_syms/save.txt | 13 --- common_syms/sound.txt | 1 - common_syms/sprite.txt | 2 - common_syms/start_menu.txt | 1 - common_syms/task.txt | 1 - common_syms/text.txt | 4 - common_syms/trainer_see.txt | 5 - common_syms/tv.txt | 4 - common_syms/window.txt | 2 - include/gba/defines.h | 1 + ld_script.ld | 1 + ld_script_modern.ld | 1 + src/AgbRfu_LinkManager.c | 2 +- src/agb_flash.c | 20 ++-- src/apprentice.c | 6 +- src/battle_anim_throw.c | 6 +- src/battle_factory_screen.c | 2 +- src/battle_main.c | 18 ++-- src/battle_tower.c | 2 +- src/berry_blender.c | 2 +- src/bg.c | 2 +- src/contest.c | 2 +- src/contest_painting.c | 8 +- src/ereader_screen.c | 4 +- src/evolution_scene.c | 2 +- src/field_camera.c | 6 +- src/field_control_avatar.c | 2 +- src/field_specials.c | 2 +- src/fieldmap.c | 2 +- src/image_processing_effects.c | 20 ++-- src/intro.c | 4 +- src/librfu_rfu.c | 10 +- src/librfu_sio32id.c | 2 +- src/librfu_stwi.c | 2 +- src/link.c | 70 ++++++------ src/link_rfu_2.c | 4 +- src/list_menu.c | 6 +- src/load_save.c | 8 +- src/m4a.c | 24 ++--- src/main.c | 18 ++-- src/mauville_old_man.c | 2 +- src/overworld.c | 16 +-- src/party_menu.c | 2 +- src/pokedex.c | 4 +- src/pokedex_cry_screen.c | 2 +- src/random.c | 4 +- src/rtc.c | 2 +- src/save.c | 26 ++--- src/sound.c | 2 +- src/sprite.c | 4 +- src/start_menu.c | 2 +- src/task.c | 2 +- src/text.c | 8 +- src/trainer_see.c | 10 +- src/tv.c | 10 +- src/window.c | 4 +- tools/ramscrgen/elf.cpp | 129 +++++++---------------- tools/ramscrgen/elf.h | 4 +- tools/ramscrgen/main.cpp | 57 ++-------- 96 files changed, 244 insertions(+), 501 deletions(-) delete mode 100644 common_syms/AgbRfu_LinkManager.txt delete mode 100644 common_syms/agb_flash.txt delete mode 100644 common_syms/apprentice.txt delete mode 100755 common_syms/battle_anim_throw.txt delete mode 100644 common_syms/battle_factory_screen.txt delete mode 100644 common_syms/battle_main.txt delete mode 100644 common_syms/battle_tower.txt delete mode 100644 common_syms/berry_blender.txt delete mode 100644 common_syms/bg.txt delete mode 100644 common_syms/contest.txt delete mode 100644 common_syms/contest_painting.txt delete mode 100644 common_syms/ereader_screen.txt delete mode 100644 common_syms/evolution_scene.txt delete mode 100755 common_syms/faraway_island.txt delete mode 100644 common_syms/field_camera.txt delete mode 100644 common_syms/field_control_avatar.txt delete mode 100644 common_syms/field_specials.txt delete mode 100644 common_syms/fieldmap.txt delete mode 100644 common_syms/image_processing_effects.txt delete mode 100644 common_syms/intro.txt delete mode 100644 common_syms/librfu_rfu.txt delete mode 100644 common_syms/librfu_sio32id.txt delete mode 100644 common_syms/librfu_stwi.txt delete mode 100644 common_syms/link.txt delete mode 100644 common_syms/link_rfu_2.txt delete mode 100644 common_syms/list_menu.txt delete mode 100644 common_syms/load_save.txt delete mode 100644 common_syms/m4a.txt delete mode 100644 common_syms/main.txt delete mode 100644 common_syms/mauville_old_man.txt delete mode 100644 common_syms/overworld.txt delete mode 100644 common_syms/party_menu.txt delete mode 100644 common_syms/pokedex.txt delete mode 100644 common_syms/pokedex_cry_screen.txt delete mode 100644 common_syms/random.txt delete mode 100644 common_syms/rtc.txt delete mode 100644 common_syms/save.txt delete mode 100644 common_syms/sound.txt delete mode 100644 common_syms/sprite.txt delete mode 100644 common_syms/start_menu.txt delete mode 100644 common_syms/task.txt delete mode 100644 common_syms/text.txt delete mode 100644 common_syms/trainer_see.txt delete mode 100644 common_syms/tv.txt delete mode 100644 common_syms/window.txt diff --git a/Makefile b/Makefile index 58f6c14513a9..6d66c34d65cc 100644 --- a/Makefile +++ b/Makefile @@ -178,12 +178,20 @@ ifneq (,$(MAKECMDGOALS)) endif endif +.SHELLSTATUS ?= 0 + ifeq ($(SETUP_PREREQS),1) # If set on: Default target or a rule requiring a scan # Forcibly execute `make tools` since we need them for what we are doing. - $(call infoshell, $(MAKE) -f make_tools.mk) + $(foreach line, $(shell $(MAKE) -f make_tools.mk | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) + ifneq ($(.SHELLSTATUS),0) + $(error Errors occurred while building tools. See error messages above for more details) + endif # Oh and also generate mapjson sources before we use `SCANINC`. - $(call infoshell, $(MAKE) generated) + $(foreach line, $(shell $(MAKE) generated | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) + ifneq ($(.SHELLSTATUS),0) + $(error Errors occurred while generating map-related sources. See error messages above for more details) + endif endif # Collect sources @@ -255,6 +263,8 @@ include spritesheet_rules.mk include json_data_rules.mk include audio_rules.mk +# NOTE: Tools must have been built prior (FIXME) +# so you can't really call this rule directly generated: $(AUTO_GEN_TARGETS) %.s: ; @@ -270,8 +280,6 @@ generated: $(AUTO_GEN_TARGETS) %.lz: % ; $(GFX) $< $@ %.rl: % ; $(GFX) $< $@ -# NOTE: Tools must have been built prior (FIXME) -generated: tools $(AUTO_GEN_TARGETS) clean-generated: -rm -f $(AUTO_GEN_TARGETS) @@ -371,6 +379,7 @@ libagbsyscall: # Elf from object files $(ELF): $(LD_SCRIPT) $(LD_SCRIPT_DEPS) $(OBJS) libagbsyscall @cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ $(OBJS_REL) $(LIB) | cat + @echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ | cat" $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent # Builds the rom from the elf file diff --git a/common_syms/AgbRfu_LinkManager.txt b/common_syms/AgbRfu_LinkManager.txt deleted file mode 100644 index 7ff8cd53dd5d..000000000000 --- a/common_syms/AgbRfu_LinkManager.txt +++ /dev/null @@ -1 +0,0 @@ -lman diff --git a/common_syms/agb_flash.txt b/common_syms/agb_flash.txt deleted file mode 100644 index cb421ec80d1a..000000000000 --- a/common_syms/agb_flash.txt +++ /dev/null @@ -1,10 +0,0 @@ -gFlashTimeoutFlag -PollFlashStatus -WaitForFlashWrite -ProgramFlashSector -gFlash -ProgramFlashByte -gFlashNumRemainingBytes -EraseFlashChip -EraseFlashSector -gFlashMaxTime diff --git a/common_syms/apprentice.txt b/common_syms/apprentice.txt deleted file mode 100644 index 0d3569dcbbca..000000000000 --- a/common_syms/apprentice.txt +++ /dev/null @@ -1,3 +0,0 @@ -gApprenticePartyMovesData -gApprenticeQuestionData -gApprenticeFunc diff --git a/common_syms/battle_anim_throw.txt b/common_syms/battle_anim_throw.txt deleted file mode 100755 index 5e2e8b3ff39d..000000000000 --- a/common_syms/battle_anim_throw.txt +++ /dev/null @@ -1,3 +0,0 @@ -gMonShrinkDuration -gMonShrinkDelta -gMonShrinkDistance diff --git a/common_syms/battle_factory_screen.txt b/common_syms/battle_factory_screen.txt deleted file mode 100644 index 3ddeb6d3b188..000000000000 --- a/common_syms/battle_factory_screen.txt +++ /dev/null @@ -1 +0,0 @@ -gFactorySelect_CurrentOptionFunc diff --git a/common_syms/battle_main.txt b/common_syms/battle_main.txt deleted file mode 100644 index f6f02c48d32c..000000000000 --- a/common_syms/battle_main.txt +++ /dev/null @@ -1,9 +0,0 @@ -gPreBattleCallback1 -gBattleMainFunc -gBattleResults -gLeveledUpInBattle -gBattlerControllerFuncs -gHealthboxSpriteIds -gMultiUsePlayerCursor -gNumberOfMovesToChoose -gBattleControllerData diff --git a/common_syms/battle_tower.txt b/common_syms/battle_tower.txt deleted file mode 100644 index 7371109d51f3..000000000000 --- a/common_syms/battle_tower.txt +++ /dev/null @@ -1 +0,0 @@ -gFrontierTempParty diff --git a/common_syms/berry_blender.txt b/common_syms/berry_blender.txt deleted file mode 100644 index 1b15a33d6113..000000000000 --- a/common_syms/berry_blender.txt +++ /dev/null @@ -1 +0,0 @@ -gInGameOpponentsNo diff --git a/common_syms/bg.txt b/common_syms/bg.txt deleted file mode 100644 index 0a3c3aecca31..000000000000 --- a/common_syms/bg.txt +++ /dev/null @@ -1 +0,0 @@ -gWindowTileAutoAllocEnabled diff --git a/common_syms/contest.txt b/common_syms/contest.txt deleted file mode 100644 index 6a519fb463d7..000000000000 --- a/common_syms/contest.txt +++ /dev/null @@ -1 +0,0 @@ -gContestRngValue diff --git a/common_syms/contest_painting.txt b/common_syms/contest_painting.txt deleted file mode 100644 index 32bb8be16153..000000000000 --- a/common_syms/contest_painting.txt +++ /dev/null @@ -1,4 +0,0 @@ -gContestMonPixels -gImageProcessingContext -gContestPaintingWinner -gContestPaintingMonPalette diff --git a/common_syms/ereader_screen.txt b/common_syms/ereader_screen.txt deleted file mode 100644 index 26b01f678de1..000000000000 --- a/common_syms/ereader_screen.txt +++ /dev/null @@ -1,2 +0,0 @@ -gUnknownSpace -gEReaderData diff --git a/common_syms/evolution_scene.txt b/common_syms/evolution_scene.txt deleted file mode 100644 index 137cd3e05df7..000000000000 --- a/common_syms/evolution_scene.txt +++ /dev/null @@ -1 +0,0 @@ -gCB2_AfterEvolution diff --git a/common_syms/faraway_island.txt b/common_syms/faraway_island.txt deleted file mode 100755 index e02ca2ec2528..000000000000 --- a/common_syms/faraway_island.txt +++ /dev/null @@ -1,3 +0,0 @@ -sPlayerToMewDeltaX -sPlayerToMewDeltaY -sMewDirectionCandidates diff --git a/common_syms/field_camera.txt b/common_syms/field_camera.txt deleted file mode 100644 index 02301ce23cd1..000000000000 --- a/common_syms/field_camera.txt +++ /dev/null @@ -1,3 +0,0 @@ -gFieldCamera -gTotalCameraPixelOffsetY -gTotalCameraPixelOffsetX diff --git a/common_syms/field_control_avatar.txt b/common_syms/field_control_avatar.txt deleted file mode 100644 index 268f60c64177..000000000000 --- a/common_syms/field_control_avatar.txt +++ /dev/null @@ -1 +0,0 @@ -gSelectedObjectEvent diff --git a/common_syms/field_specials.txt b/common_syms/field_specials.txt deleted file mode 100644 index 7adb3f669235..000000000000 --- a/common_syms/field_specials.txt +++ /dev/null @@ -1 +0,0 @@ -gScrollableMultichoice_ListMenuTemplate diff --git a/common_syms/fieldmap.txt b/common_syms/fieldmap.txt deleted file mode 100644 index 0ead758462c9..000000000000 --- a/common_syms/fieldmap.txt +++ /dev/null @@ -1 +0,0 @@ -gBackupMapLayout diff --git a/common_syms/image_processing_effects.txt b/common_syms/image_processing_effects.txt deleted file mode 100644 index 134f7e88b25c..000000000000 --- a/common_syms/image_processing_effects.txt +++ /dev/null @@ -1,10 +0,0 @@ -gCanvasColumnStart -gCanvasPixels -gCanvasRowEnd -gCanvasHeight -gCanvasColumnEnd -gCanvasRowStart -gCanvasMonPersonality -gCanvasWidth -gCanvasPalette -gCanvasPaletteStart diff --git a/common_syms/intro.txt b/common_syms/intro.txt deleted file mode 100644 index d069b1014ff4..000000000000 --- a/common_syms/intro.txt +++ /dev/null @@ -1,2 +0,0 @@ -gIntroFrameCounter -gMultibootProgramStruct diff --git a/common_syms/librfu_rfu.txt b/common_syms/librfu_rfu.txt deleted file mode 100644 index 4b742dcd256c..000000000000 --- a/common_syms/librfu_rfu.txt +++ /dev/null @@ -1,5 +0,0 @@ -gRfuSlotStatusUNI -gRfuSlotStatusNI -gRfuLinkStatus -gRfuStatic -gRfuFixed diff --git a/common_syms/librfu_sio32id.txt b/common_syms/librfu_sio32id.txt deleted file mode 100644 index 97395e84b310..000000000000 --- a/common_syms/librfu_sio32id.txt +++ /dev/null @@ -1 +0,0 @@ -gRfuSIO32Id diff --git a/common_syms/librfu_stwi.txt b/common_syms/librfu_stwi.txt deleted file mode 100644 index a1f773553591..000000000000 --- a/common_syms/librfu_stwi.txt +++ /dev/null @@ -1 +0,0 @@ -gSTWIStatus diff --git a/common_syms/link.txt b/common_syms/link.txt deleted file mode 100644 index 4118d1eb4bee..000000000000 --- a/common_syms/link.txt +++ /dev/null @@ -1,35 +0,0 @@ -gLinkPartnersHeldKeys -gLinkDebugSeed -gLocalLinkPlayerBlock -gLinkErrorOccurred -gLinkDebugFlags -gLinkFiller1 -gRemoteLinkPlayersNotReceived -gBlockReceivedStatus -gLinkFiller2 -gLinkHeldKeys -gRecvCmds -gLinkStatus -gLinkDummy1 -gLinkDummy2 -gReadyToExitStandby -gReadyToCloseLink -gReadyCloseLinkType -gSuppressLinkErrorMessage -gWirelessCommType -gSavedLinkPlayerCount -gSendCmd -gSavedMultiplayerId -gReceivedRemoteLinkPlayers -gLinkTestBGInfo -gLinkCallback -gShouldAdvanceLinkState -gLinkTestBlockChecksums -gBlockRequestType -gLinkFiller3 -gLinkFiller4 -gLinkFiller5 -gLastSendQueueCount -gLink -gLastRecvQueueCount -gLinkSavedIme diff --git a/common_syms/link_rfu_2.txt b/common_syms/link_rfu_2.txt deleted file mode 100644 index 4b8f02bad8f2..000000000000 --- a/common_syms/link_rfu_2.txt +++ /dev/null @@ -1,2 +0,0 @@ -gRfuAPIBuffer -gRfu diff --git a/common_syms/list_menu.txt b/common_syms/list_menu.txt deleted file mode 100644 index ed5343618ccc..000000000000 --- a/common_syms/list_menu.txt +++ /dev/null @@ -1,2 +0,0 @@ -gListMenuOverride -gMultiuseListMenuTemplate diff --git a/common_syms/load_save.txt b/common_syms/load_save.txt deleted file mode 100644 index 2d3d9b802ffc..000000000000 --- a/common_syms/load_save.txt +++ /dev/null @@ -1,4 +0,0 @@ -gFlashMemoryPresent -gSaveBlock1Ptr -gSaveBlock2Ptr -gPokemonStoragePtr diff --git a/common_syms/m4a.txt b/common_syms/m4a.txt deleted file mode 100644 index 0d6b13a79bd1..000000000000 --- a/common_syms/m4a.txt +++ /dev/null @@ -1,12 +0,0 @@ -gSoundInfo -gPokemonCrySongs -gPokemonCryMusicPlayers -gMPlayInfo_BGM -gMPlayJumpTable -gCgbChans -gMPlayInfo_SE1 -gMPlayInfo_SE2 -gPokemonCryTracks -gPokemonCrySong -gMPlayMemAccArea -gMPlayInfo_SE3 diff --git a/common_syms/main.txt b/common_syms/main.txt deleted file mode 100644 index a620083d19de..000000000000 --- a/common_syms/main.txt +++ /dev/null @@ -1,9 +0,0 @@ -gKeyRepeatStartDelay -gLinkTransferringData -gMain -gKeyRepeatContinueDelay -gSoftResetDisabled -gIntrTable -gLinkVSyncDisabled -IntrMain_Buffer -gPcmDmaCounter diff --git a/common_syms/mauville_old_man.txt b/common_syms/mauville_old_man.txt deleted file mode 100644 index 9d77b8692b70..000000000000 --- a/common_syms/mauville_old_man.txt +++ /dev/null @@ -1 +0,0 @@ -gBardSong diff --git a/common_syms/overworld.txt b/common_syms/overworld.txt deleted file mode 100644 index dcada0bbefe8..000000000000 --- a/common_syms/overworld.txt +++ /dev/null @@ -1,8 +0,0 @@ -gOverworldTilemapBuffer_Bg2 -gOverworldTilemapBuffer_Bg1 -gOverworldTilemapBuffer_Bg3 -gHeldKeyCodeToSend -gFieldCallback -gFieldCallback2 -gLocalLinkPlayerId -gFieldLinkPlayerCount diff --git a/common_syms/party_menu.txt b/common_syms/party_menu.txt deleted file mode 100644 index 6ed37392c2de..000000000000 --- a/common_syms/party_menu.txt +++ /dev/null @@ -1 +0,0 @@ -gItemUseCB diff --git a/common_syms/pokedex.txt b/common_syms/pokedex.txt deleted file mode 100644 index c7a297b2af90..000000000000 --- a/common_syms/pokedex.txt +++ /dev/null @@ -1,2 +0,0 @@ -gUnusedPokedexU8 -gPokedexVBlankCB diff --git a/common_syms/pokedex_cry_screen.txt b/common_syms/pokedex_cry_screen.txt deleted file mode 100644 index d16ec36d64fa..000000000000 --- a/common_syms/pokedex_cry_screen.txt +++ /dev/null @@ -1 +0,0 @@ -gDexCryScreenState diff --git a/common_syms/random.txt b/common_syms/random.txt deleted file mode 100644 index 8037c69586b1..000000000000 --- a/common_syms/random.txt +++ /dev/null @@ -1,2 +0,0 @@ -gRngValue -gRng2Value diff --git a/common_syms/rtc.txt b/common_syms/rtc.txt deleted file mode 100644 index fa00a34d5172..000000000000 --- a/common_syms/rtc.txt +++ /dev/null @@ -1 +0,0 @@ -gLocalTime diff --git a/common_syms/save.txt b/common_syms/save.txt deleted file mode 100644 index 131031d5063b..000000000000 --- a/common_syms/save.txt +++ /dev/null @@ -1,13 +0,0 @@ -gLastWrittenSector -gLastSaveCounter -gLastKnownGoodSector -gDamagedSaveSectors -gSaveCounter -gReadWriteSector -gIncrementalSectorId -gSaveUnusedVar -gSaveFileStatus -gGameContinueCallback -gRamSaveSectorLocations -gSaveUnusedVar2 -gSaveAttemptStatus diff --git a/common_syms/sound.txt b/common_syms/sound.txt deleted file mode 100644 index 0f6f2fc75888..000000000000 --- a/common_syms/sound.txt +++ /dev/null @@ -1 +0,0 @@ -gDisableMusic diff --git a/common_syms/sprite.txt b/common_syms/sprite.txt deleted file mode 100644 index 627c01c0d073..000000000000 --- a/common_syms/sprite.txt +++ /dev/null @@ -1,2 +0,0 @@ -gOamMatrixAllocBitmap -gReservedSpritePaletteCount diff --git a/common_syms/start_menu.txt b/common_syms/start_menu.txt deleted file mode 100644 index 05beaf57c23b..000000000000 --- a/common_syms/start_menu.txt +++ /dev/null @@ -1 +0,0 @@ -gMenuCallback diff --git a/common_syms/task.txt b/common_syms/task.txt deleted file mode 100644 index 6601bd11bb84..000000000000 --- a/common_syms/task.txt +++ /dev/null @@ -1 +0,0 @@ -gTasks diff --git a/common_syms/text.txt b/common_syms/text.txt deleted file mode 100644 index cd8886e5b1f5..000000000000 --- a/common_syms/text.txt +++ /dev/null @@ -1,4 +0,0 @@ -gFonts -gDisableTextPrinters -gCurGlyph -gTextFlags diff --git a/common_syms/trainer_see.txt b/common_syms/trainer_see.txt deleted file mode 100644 index 0b30a632a005..000000000000 --- a/common_syms/trainer_see.txt +++ /dev/null @@ -1,5 +0,0 @@ -gWhichTrainerToFaceAfterBattle -gPostBattleMovementScript -gApproachingTrainers -gNoOfApproachingTrainers -gTrainerApproachedPlayer diff --git a/common_syms/tv.txt b/common_syms/tv.txt deleted file mode 100644 index 0370f65e1f67..000000000000 --- a/common_syms/tv.txt +++ /dev/null @@ -1,4 +0,0 @@ -sCurTVShowSlot -sTV_SecretBaseVisitMovesTemp -sTV_DecorationsBuffer -sTV_SecretBaseVisitMonsTemp diff --git a/common_syms/window.txt b/common_syms/window.txt deleted file mode 100644 index 24c093a22612..000000000000 --- a/common_syms/window.txt +++ /dev/null @@ -1,2 +0,0 @@ -gTransparentTileNumber -gWindowBgTilemapBuffers diff --git a/include/gba/defines.h b/include/gba/defines.h index febe6882cf35..a549bab7e22d 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -8,6 +8,7 @@ #define IWRAM_DATA __attribute__((section("iwram_data"))) #define EWRAM_DATA __attribute__((section("ewram_data"))) +#define COMMON_DATA __attribute__((section("common_data"))) #define UNUSED __attribute__((unused)) #if MODERN diff --git a/ld_script.ld b/ld_script.ld index 1e08a8d61c3a..316b5fe20f4e 100644 --- a/ld_script.ld +++ b/ld_script.ld @@ -42,6 +42,7 @@ SECTIONS { /* COMMON starts at 0x30022A8 */ INCLUDE "sym_common.ld" + src/*.o(COMMON); *libc.a:sbrkr.o(COMMON); } > IWRAM diff --git a/ld_script_modern.ld b/ld_script_modern.ld index fac4a134c32c..788a5736f0de 100644 --- a/ld_script_modern.ld +++ b/ld_script_modern.ld @@ -28,6 +28,7 @@ SECTIONS { src/m4a.o(.bss.code); + src/*.o(common_data); src/*.o(COMMON); *libc.a:*.o(COMMON); *libnosys.a:*.o(COMMON); diff --git a/src/AgbRfu_LinkManager.c b/src/AgbRfu_LinkManager.c index e4ee377f7b7d..d696c01d3c14 100644 --- a/src/AgbRfu_LinkManager.c +++ b/src/AgbRfu_LinkManager.c @@ -14,7 +14,7 @@ #define FSP_ON 0x01 #define FSP_START 0x02 -LINK_MANAGER lman; +COMMON_DATA LINK_MANAGER lman = {0}; static void rfu_LMAN_clearVariables(void); static void rfu_LMAN_settingPCSWITCH(u32 rand); diff --git a/src/agb_flash.c b/src/agb_flash.c index 6b9381c704da..ffec206fee09 100644 --- a/src/agb_flash.c +++ b/src/agb_flash.c @@ -6,16 +6,16 @@ static u16 sTimerCount; static vu16 *sTimerReg; static u16 sSavedIme; -u8 gFlashTimeoutFlag; -u8 (*PollFlashStatus)(u8 *); -u16 (*WaitForFlashWrite)(u8 phase, u8 *addr, u8 lastData); -u16 (*ProgramFlashSector)(u16 sectorNum, u8 *src); -const struct FlashType *gFlash; -u16 (*ProgramFlashByte)(u16 sectorNum, u32 offset, u8 data); -u16 gFlashNumRemainingBytes; -u16 (*EraseFlashChip)(); -u16 (*EraseFlashSector)(u16 sectorNum); -const u16 *gFlashMaxTime; +COMMON_DATA u8 gFlashTimeoutFlag = 0; +COMMON_DATA u8 (*PollFlashStatus)(u8 *) = NULL; +COMMON_DATA u16 (*WaitForFlashWrite)(u8 phase, u8 *addr, u8 lastData) = NULL; +COMMON_DATA u16 (*ProgramFlashSector)(u16 sectorNum, u8 *src) = NULL; +COMMON_DATA const struct FlashType *gFlash = NULL; +COMMON_DATA u16 (*ProgramFlashByte)(u16 sectorNum, u32 offset, u8 data) = NULL; +COMMON_DATA u16 gFlashNumRemainingBytes = 0; +COMMON_DATA u16 (*EraseFlashChip)() = NULL; +COMMON_DATA u16 (*EraseFlashSector)(u16 sectorNum) = 0; +COMMON_DATA const u16 *gFlashMaxTime = NULL; void SetReadFlash1(u16 *dest); diff --git a/src/apprentice.c b/src/apprentice.c index 2280412fe7af..72ab8f24c823 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -75,9 +75,9 @@ struct ApprenticeQuestionData }; // IWRAM common -struct ApprenticePartyMovesData *gApprenticePartyMovesData; -struct ApprenticeQuestionData *gApprenticeQuestionData; -void (*gApprenticeFunc)(void); +COMMON_DATA struct ApprenticePartyMovesData *gApprenticePartyMovesData = NULL; +COMMON_DATA struct ApprenticeQuestionData *gApprenticeQuestionData = NULL; +COMMON_DATA void (*gApprenticeFunc)(void) = NULL; // This file's functions. static u16 GetRandomAlternateMove(u8 monId); diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c index 8296126f149b..951794fc54c9 100755 --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -23,9 +23,9 @@ #include "constants/rgb.h" // iwram -u32 gMonShrinkDuration; -u16 gMonShrinkDelta; -u16 gMonShrinkDistance; +COMMON_DATA u32 gMonShrinkDuration = 0; +COMMON_DATA u16 gMonShrinkDelta = 0; +COMMON_DATA u16 gMonShrinkDistance = 0; enum { BALL_ROLL_1, diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 0533d1e2a326..adf241153fdb 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -256,7 +256,7 @@ static struct FactorySelectScreen *sFactorySelectScreen; static void (*sSwap_CurrentOptionFunc)(u8 taskId); static struct FactorySwapScreen *sFactorySwapScreen; -u8 (*gFactorySelect_CurrentOptionFunc)(void); +COMMON_DATA u8 (*gFactorySelect_CurrentOptionFunc)(void) = NULL; static const u16 sPokeballGray_Pal[] = INCBIN_U16("graphics/battle_frontier/factory_screen/pokeball_gray.gbapal"); static const u16 sPokeballSelected_Pal[] = INCBIN_U16("graphics/battle_frontier/factory_screen/pokeball_selected.gbapal"); diff --git a/src/battle_main.c b/src/battle_main.c index 9039655c4d8e..7ee8d8cf55a3 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -237,15 +237,15 @@ EWRAM_DATA u16 gBattleMovePower = 0; EWRAM_DATA u16 gMoveToLearn = 0; EWRAM_DATA u8 gBattleMonForms[MAX_BATTLERS_COUNT] = {0}; -void (*gPreBattleCallback1)(void); -void (*gBattleMainFunc)(void); -struct BattleResults gBattleResults; -u8 gLeveledUpInBattle; -void (*gBattlerControllerFuncs[MAX_BATTLERS_COUNT])(void); -u8 gHealthboxSpriteIds[MAX_BATTLERS_COUNT]; -u8 gMultiUsePlayerCursor; -u8 gNumberOfMovesToChoose; -u8 gBattleControllerData[MAX_BATTLERS_COUNT]; // Used by the battle controllers to store misc sprite/task IDs for each battler +COMMON_DATA void (*gPreBattleCallback1)(void) = NULL; +COMMON_DATA void (*gBattleMainFunc)(void) = NULL; +COMMON_DATA struct BattleResults gBattleResults = {0}; +COMMON_DATA u8 gLeveledUpInBattle = 0; +COMMON_DATA void (*gBattlerControllerFuncs[MAX_BATTLERS_COUNT])(void) = {0}; +COMMON_DATA u8 gHealthboxSpriteIds[MAX_BATTLERS_COUNT] = {0}; +COMMON_DATA u8 gMultiUsePlayerCursor = 0; +COMMON_DATA u8 gNumberOfMovesToChoose = 0; +COMMON_DATA u8 gBattleControllerData[MAX_BATTLERS_COUNT] = {0}; // Used by the battle controllers to store misc sprite/task IDs for each battler static const struct ScanlineEffectParams sIntroScanlineParams16Bit = { diff --git a/src/battle_tower.c b/src/battle_tower.c index ec6019afb0e7..0420a15f63d1 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -45,7 +45,7 @@ EWRAM_DATA const struct BattleFrontierTrainer *gFacilityTrainers = NULL; EWRAM_DATA const struct FacilityMon *gFacilityTrainerMons = NULL; // IWRAM common -u16 gFrontierTempParty[MAX_FRONTIER_PARTY_SIZE]; +COMMON_DATA u16 gFrontierTempParty[MAX_FRONTIER_PARTY_SIZE] = {0}; // This file's functions. static void InitTowerChallenge(void); diff --git a/src/berry_blender.c b/src/berry_blender.c index a5102d48fb78..5f0e1706077b 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -246,7 +246,7 @@ static s16 sPokeblockPresentFlavors[FLAVOR_COUNT + 1]; static s16 sDebug_MaxRPMStage; static s16 sDebug_GameTimeStage; -u8 gInGameOpponentsNo; +COMMON_DATA u8 gInGameOpponentsNo = 0; static const u16 sBlenderCenter_Pal[] = INCBIN_U16("graphics/berry_blender/center.gbapal"); static const u8 sBlenderCenter_Tilemap[] = INCBIN_U8("graphics/berry_blender/center_map.bin"); diff --git a/src/bg.c b/src/bg.c index 4ccb95eb6ba6..166c59df0c32 100644 --- a/src/bg.c +++ b/src/bg.c @@ -42,7 +42,7 @@ static struct BgControl sGpuBgConfigs; static struct BgConfig2 sGpuBgConfigs2[NUM_BACKGROUNDS]; static u32 sDmaBusyBitfield[NUM_BACKGROUNDS]; -u32 gWindowTileAutoAllocEnabled; +COMMON_DATA u32 gWindowTileAutoAllocEnabled = 0; static const struct BgConfig sZeroedBgControlStruct = { 0 }; diff --git a/src/contest.c b/src/contest.c index 8f0ad7fbfee2..5b9560faf558 100644 --- a/src/contest.c +++ b/src/contest.c @@ -358,7 +358,7 @@ EWRAM_DATA bool8 gCurContestWinnerIsForArtist = 0; EWRAM_DATA u8 gCurContestWinnerSaveIdx = 0; // IWRAM common vars. -u32 gContestRngValue; +COMMON_DATA u32 gContestRngValue = 0; extern const u8 gText_LinkStandby4[]; extern const u8 gText_BDot[]; diff --git a/src/contest_painting.c b/src/contest_painting.c index 30ca51c96638..c72d0dc6af20 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -21,10 +21,10 @@ #include "window.h" #include "constants/rgb.h" -u16 (*gContestMonPixels)[][32]; -struct ImageProcessingContext gImageProcessingContext; -struct ContestWinner *gContestPaintingWinner; -u16 *gContestPaintingMonPalette; +COMMON_DATA u16 (*gContestMonPixels)[][32] = {0}; +COMMON_DATA struct ImageProcessingContext gImageProcessingContext = {0}; +COMMON_DATA struct ContestWinner *gContestPaintingWinner = {0}; +COMMON_DATA u16 *gContestPaintingMonPalette = NULL; static u8 sHoldState; static u16 sMosaicVal; diff --git a/src/ereader_screen.c b/src/ereader_screen.c index cb048d2ae359..556acf8e3c59 100755 --- a/src/ereader_screen.c +++ b/src/ereader_screen.c @@ -41,9 +41,9 @@ struct EReaderData static void Task_EReader(u8); // This belongs in COMMON somewhere between party_menu and ereader_screen, but it's unused so it's unclear where. -UNUSED u8 gUnknownSpace[64]; +COMMON_DATA UNUSED u8 gUnknownSpace[64] = {0}; -struct EReaderData gEReaderData; +COMMON_DATA struct EReaderData gEReaderData = {0}; extern const u8 gMultiBootProgram_EReader_Start[]; extern const u8 gMultiBootProgram_EReader_End[]; diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 133afe3b0dd2..db28ceb8f245 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -48,7 +48,7 @@ struct EvoInfo static EWRAM_DATA struct EvoInfo *sEvoStructPtr = NULL; static EWRAM_DATA u16 *sBgAnimPal = NULL; -void (*gCB2_AfterEvolution)(void); +COMMON_DATA void (*gCB2_AfterEvolution)(void) = NULL; #define sEvoCursorPos gBattleCommunication[1] // when learning a new move #define sEvoGraphicsTaskId gBattleCommunication[2] diff --git a/src/field_camera.c b/src/field_camera.c index 31ebc63c0529..290ddddaf178 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -39,9 +39,9 @@ static s16 sVerticalCameraPan; static bool8 sBikeCameraPanFlag; static void (*sFieldCameraPanningCallback)(void); -struct CameraObject gFieldCamera; -u16 gTotalCameraPixelOffsetY; -u16 gTotalCameraPixelOffsetX; +COMMON_DATA struct CameraObject gFieldCamera = {0}; +COMMON_DATA u16 gTotalCameraPixelOffsetY = 0; +COMMON_DATA u16 gTotalCameraPixelOffsetX = 0; static void ResetCameraOffset(struct FieldCameraOffset *cameraOffset) { diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 09d6ae7838a0..b1c3aa6d8e9e 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -38,7 +38,7 @@ static EWRAM_DATA u8 sWildEncounterImmunitySteps = 0; static EWRAM_DATA u16 sPrevMetatileBehavior = 0; -u8 gSelectedObjectEvent; +COMMON_DATA u8 gSelectedObjectEvent = 0; static void GetPlayerPosition(struct MapPosition *); static void GetInFrontOfPlayerPosition(struct MapPosition *); diff --git a/src/field_specials.c b/src/field_specials.c index f8d493493c43..43d07356aa0b 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -92,7 +92,7 @@ static EWRAM_DATA u8 sFrontierExchangeCorner_ItemIconWindowId = 0; static EWRAM_DATA u8 sPCBoxToSendMon = 0; static EWRAM_DATA u32 sBattleTowerMultiBattleTypeFlags = 0; -struct ListMenuTemplate gScrollableMultichoice_ListMenuTemplate; +COMMON_DATA struct ListMenuTemplate gScrollableMultichoice_ListMenuTemplate = {0}; void TryLoseFansFromPlayTime(void); void SetPlayerGotFirstFans(void); diff --git a/src/fieldmap.c b/src/fieldmap.c index e4dc0026a388..8c0e416f4576 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -31,7 +31,7 @@ EWRAM_DATA struct Camera gCamera = {0}; EWRAM_DATA static struct ConnectionFlags sMapConnectionFlags = {0}; EWRAM_DATA static u32 UNUSED sFiller = 0; // without this, the next file won't align properly -struct BackupMapLayout gBackupMapLayout; +COMMON_DATA struct BackupMapLayout gBackupMapLayout = {0}; static const struct ConnectionFlags sDummyConnectionFlags = {0}; diff --git a/src/image_processing_effects.c b/src/image_processing_effects.c index 51a5d13993a9..b09e881fe0d0 100644 --- a/src/image_processing_effects.c +++ b/src/image_processing_effects.c @@ -4,16 +4,16 @@ #include "constants/rgb.h" // IWRAM common -u8 gCanvasColumnStart; -u16 *gCanvasPixels; -u8 gCanvasRowEnd; -u8 gCanvasHeight; -u8 gCanvasColumnEnd; -u8 gCanvasRowStart; -u8 gCanvasMonPersonality; -u8 gCanvasWidth; -u16 *gCanvasPalette; -u16 gCanvasPaletteStart; +COMMON_DATA u8 gCanvasColumnStart = 0; +COMMON_DATA u16 *gCanvasPixels = NULL; +COMMON_DATA u8 gCanvasRowEnd = 0; +COMMON_DATA u8 gCanvasHeight = 0; +COMMON_DATA u8 gCanvasColumnEnd = 0; +COMMON_DATA u8 gCanvasRowStart = 0; +COMMON_DATA u8 gCanvasMonPersonality = 0; +COMMON_DATA u8 gCanvasWidth = 0; +COMMON_DATA u16 *gCanvasPalette = NULL; +COMMON_DATA u16 gCanvasPaletteStart = 0; static void ApplyImageEffect_Pointillism(void); static void ApplyImageEffect_Blur(void); diff --git a/src/intro.c b/src/intro.c index 02c3a1f9488f..68432b5b9899 100644 --- a/src/intro.c +++ b/src/intro.c @@ -178,8 +178,8 @@ static EWRAM_DATA u16 sIntroCharacterGender = 0; static EWRAM_DATA u16 UNUSED sUnusedVar = 0; static EWRAM_DATA u16 sFlygonYOffset = 0; -u32 gIntroFrameCounter; -struct GcmbStruct gMultibootProgramStruct; +COMMON_DATA u32 gIntroFrameCounter = 0; +COMMON_DATA struct GcmbStruct gMultibootProgramStruct = {0}; static const u16 sIntroDrops_Pal[] = INCBIN_U16("graphics/intro/scene_1/drops.gbapal"); static const u16 sIntroLogo_Pal[] = INCBIN_U16("graphics/intro/scene_1/logo.gbapal"); diff --git a/src/librfu_rfu.c b/src/librfu_rfu.c index 828d6450bc1b..ee5dbe6af4c5 100644 --- a/src/librfu_rfu.c +++ b/src/librfu_rfu.c @@ -76,11 +76,11 @@ static void rfu_STC_NI_receive_Sender(u8, u8, const struct RfuLocalStruct *, UNU static void rfu_STC_NI_initSlot_asRecvDataEntity(u8, struct NIComm *); static void rfu_STC_NI_initSlot_asRecvControllData(u8, struct NIComm *); -struct RfuSlotStatusUNI *gRfuSlotStatusUNI[RFU_CHILD_MAX]; -struct RfuSlotStatusNI *gRfuSlotStatusNI[RFU_CHILD_MAX]; -struct RfuLinkStatus *gRfuLinkStatus; -struct RfuStatic *gRfuStatic; -struct RfuFixed *gRfuFixed; +COMMON_DATA struct RfuSlotStatusUNI *gRfuSlotStatusUNI[RFU_CHILD_MAX] = {0}; +COMMON_DATA struct RfuSlotStatusNI *gRfuSlotStatusNI[RFU_CHILD_MAX] = {0}; +COMMON_DATA struct RfuLinkStatus *gRfuLinkStatus = NULL; +COMMON_DATA struct RfuStatic *gRfuStatic = NULL; +COMMON_DATA struct RfuFixed *gRfuFixed = NULL; static const struct LLSFStruct llsf_struct[2] = { [MODE_CHILD] = { diff --git a/src/librfu_sio32id.c b/src/librfu_sio32id.c index 1c02840e85d1..32391d781c43 100644 --- a/src/librfu_sio32id.c +++ b/src/librfu_sio32id.c @@ -15,7 +15,7 @@ struct RfuSIO32Id u16 lastId; }; -struct RfuSIO32Id gRfuSIO32Id; +COMMON_DATA struct RfuSIO32Id gRfuSIO32Id = {0}; static const u16 Sio32ConnectionData[] = { 0x494e, 0x544e, 0x4e45, 0x4f44 }; // NINTENDO static const char Sio32IDLib_Var[] = "Sio32ID_030820"; diff --git a/src/librfu_stwi.c b/src/librfu_stwi.c index b515f338e0ef..13a7e340828c 100644 --- a/src/librfu_stwi.c +++ b/src/librfu_stwi.c @@ -8,7 +8,7 @@ static void STWI_stop_timer(void); static s32 STWI_restart_Command(void); static s32 STWI_reset_ClockCounter(void); -struct STWIStatus *gSTWIStatus; +COMMON_DATA struct STWIStatus *gSTWIStatus = NULL; void STWI_init_all(struct RfuIntrStruct *interruptStruct, IntrFunc *interrupt, bool8 copyInterruptToRam) { diff --git a/src/link.c b/src/link.c index f784a36c679a..bb74574a316e 100644 --- a/src/link.c +++ b/src/link.c @@ -68,41 +68,41 @@ static u16 sRecvNonzeroCheck; static u8 sChecksumAvailable; static u8 sHandshakePlayerCount; -u16 gLinkPartnersHeldKeys[6]; -u32 gLinkDebugSeed; -struct LinkPlayerBlock gLocalLinkPlayerBlock; -bool8 gLinkErrorOccurred; -u32 gLinkDebugFlags; -u32 gLinkFiller1; -bool8 gRemoteLinkPlayersNotReceived[MAX_LINK_PLAYERS]; -u8 gBlockReceivedStatus[MAX_LINK_PLAYERS]; -u32 gLinkFiller2; -u16 gLinkHeldKeys; -u16 ALIGNED(4) gRecvCmds[MAX_RFU_PLAYERS][CMD_LENGTH]; -u32 gLinkStatus; -bool8 gLinkDummy1; // Never read -bool8 gLinkDummy2; // Never read -bool8 gReadyToExitStandby[MAX_LINK_PLAYERS]; -bool8 gReadyToCloseLink[MAX_LINK_PLAYERS]; -u16 gReadyCloseLinkType; // Never read -u8 gSuppressLinkErrorMessage; -bool8 gWirelessCommType; -bool8 gSavedLinkPlayerCount; -u16 gSendCmd[CMD_LENGTH]; -u8 gSavedMultiplayerId; -bool8 gReceivedRemoteLinkPlayers; -struct LinkTestBGInfo gLinkTestBGInfo; -void (*gLinkCallback)(void); -u8 gShouldAdvanceLinkState; -u16 gLinkTestBlockChecksums[MAX_LINK_PLAYERS]; -u8 gBlockRequestType; -u32 gLinkFiller3; -u32 gLinkFiller4; -u32 gLinkFiller5; -u8 gLastSendQueueCount; -struct Link gLink; -u8 gLastRecvQueueCount; -u16 gLinkSavedIme; +COMMON_DATA u16 gLinkPartnersHeldKeys[6] = {0}; +COMMON_DATA u32 gLinkDebugSeed = 0; +COMMON_DATA struct LinkPlayerBlock gLocalLinkPlayerBlock = {0}; +COMMON_DATA bool8 gLinkErrorOccurred = 0; +COMMON_DATA u32 gLinkDebugFlags = 0; +COMMON_DATA u32 gLinkFiller1 = 0; +COMMON_DATA bool8 gRemoteLinkPlayersNotReceived[MAX_LINK_PLAYERS] = {0}; +COMMON_DATA u8 gBlockReceivedStatus[MAX_LINK_PLAYERS] = {0}; +COMMON_DATA u32 gLinkFiller2 = 0; +COMMON_DATA u16 gLinkHeldKeys = 0; +COMMON_DATA u16 ALIGNED(4) gRecvCmds[MAX_RFU_PLAYERS][CMD_LENGTH] = {0}; +COMMON_DATA u32 gLinkStatus = 0; +COMMON_DATA bool8 gLinkDummy1 = 0; // Never read +COMMON_DATA bool8 gLinkDummy2 = 0; // Never read +COMMON_DATA bool8 gReadyToExitStandby[MAX_LINK_PLAYERS] = {0}; +COMMON_DATA bool8 gReadyToCloseLink[MAX_LINK_PLAYERS] = {0}; +COMMON_DATA u16 gReadyCloseLinkType = 0; // Never read +COMMON_DATA u8 gSuppressLinkErrorMessage = 0; +COMMON_DATA bool8 gWirelessCommType = 0; +COMMON_DATA bool8 gSavedLinkPlayerCount = 0; +COMMON_DATA u16 gSendCmd[CMD_LENGTH] = {0}; +COMMON_DATA u8 gSavedMultiplayerId = 0; +COMMON_DATA bool8 gReceivedRemoteLinkPlayers = 0; +COMMON_DATA struct LinkTestBGInfo gLinkTestBGInfo = {0}; +COMMON_DATA void (*gLinkCallback)(void) = NULL; +COMMON_DATA u8 gShouldAdvanceLinkState = 0; +COMMON_DATA u16 gLinkTestBlockChecksums[MAX_LINK_PLAYERS] = {0}; +COMMON_DATA u8 gBlockRequestType = 0; +COMMON_DATA u32 gLinkFiller3 = 0; +COMMON_DATA u32 gLinkFiller4 = 0; +COMMON_DATA u32 gLinkFiller5 = 0; +COMMON_DATA u8 gLastSendQueueCount = 0; +COMMON_DATA struct Link gLink = {0}; +COMMON_DATA u8 gLastRecvQueueCount = 0; +COMMON_DATA u16 gLinkSavedIme = 0; static EWRAM_DATA u8 sLinkTestDebugValuesEnabled = 0; static EWRAM_DATA u8 sDummyFlag = FALSE; diff --git a/src/link_rfu_2.c b/src/link_rfu_2.c index b34c7184cf0a..4c4323c1edc7 100644 --- a/src/link_rfu_2.c +++ b/src/link_rfu_2.c @@ -77,8 +77,8 @@ struct RfuDebug u8 unused4[88]; }; -u32 gRfuAPIBuffer[RFU_API_BUFF_SIZE_RAM / 4]; -struct RfuManager gRfu; +COMMON_DATA u32 gRfuAPIBuffer[RFU_API_BUFF_SIZE_RAM / 4] = {0}; +COMMON_DATA struct RfuManager gRfu = {0}; static u8 sHeldKeyCount; static u8 sResendBlock8[CMD_LENGTH * 2]; diff --git a/src/list_menu.c b/src/list_menu.c index e24442ca023c..8201caa34d47 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -99,7 +99,7 @@ static EWRAM_DATA struct { EWRAM_DATA struct ScrollArrowsTemplate gTempScrollArrowTemplate = {0}; // IWRAM common -struct { +COMMON_DATA struct { u8 cursorPal:4; u8 fillValue:4; u8 cursorShadowPal:4; @@ -107,9 +107,9 @@ struct { u8 field_2_2:6; // unused u8 fontId:7; bool8 enabled:1; -} gListMenuOverride; +} gListMenuOverride = {0}; -struct ListMenuTemplate gMultiuseListMenuTemplate; +COMMON_DATA struct ListMenuTemplate gMultiuseListMenuTemplate = {0}; // const rom data static const struct diff --git a/src/load_save.c b/src/load_save.c index 44e08b5e9c46..a6284ffebd63 100644 --- a/src/load_save.c +++ b/src/load_save.c @@ -37,10 +37,10 @@ EWRAM_DATA struct LoadedSaveData gLoadedSaveData = {0}; EWRAM_DATA u32 gLastEncryptionKey = 0; // IWRAM common -bool32 gFlashMemoryPresent; -struct SaveBlock1 *gSaveBlock1Ptr; -struct SaveBlock2 *gSaveBlock2Ptr; -struct PokemonStorage *gPokemonStoragePtr; +COMMON_DATA bool32 gFlashMemoryPresent = 0; +COMMON_DATA struct SaveBlock1 *gSaveBlock1Ptr = NULL; +COMMON_DATA struct SaveBlock2 *gSaveBlock2Ptr = NULL; +COMMON_DATA struct PokemonStorage *gPokemonStoragePtr = NULL; // code void CheckForFlashMemory(void) diff --git a/src/m4a.c b/src/m4a.c index 7774d09cba57..9caedd34a061 100644 --- a/src/m4a.c +++ b/src/m4a.c @@ -7,18 +7,18 @@ extern const u8 gCgb3Vol[]; BSS_CODE ALIGNED(4) char SoundMainRAM_Buffer[0x800] = {0}; -struct SoundInfo gSoundInfo; -struct PokemonCrySong gPokemonCrySongs[MAX_POKEMON_CRIES]; -struct MusicPlayerInfo gPokemonCryMusicPlayers[MAX_POKEMON_CRIES]; -MPlayFunc gMPlayJumpTable[36]; -struct CgbChannel gCgbChans[4]; -struct MusicPlayerTrack gPokemonCryTracks[MAX_POKEMON_CRIES * 2]; -struct PokemonCrySong gPokemonCrySong; -struct MusicPlayerInfo gMPlayInfo_BGM; -struct MusicPlayerInfo gMPlayInfo_SE1; -struct MusicPlayerInfo gMPlayInfo_SE2; -struct MusicPlayerInfo gMPlayInfo_SE3; -u8 gMPlayMemAccArea[0x10]; +COMMON_DATA struct SoundInfo gSoundInfo = {0}; +COMMON_DATA struct PokemonCrySong gPokemonCrySongs[MAX_POKEMON_CRIES] = {0}; +COMMON_DATA struct MusicPlayerInfo gPokemonCryMusicPlayers[MAX_POKEMON_CRIES] = {0}; +COMMON_DATA struct MusicPlayerInfo gMPlayInfo_BGM = {0}; +COMMON_DATA MPlayFunc gMPlayJumpTable[36] = {0}; +COMMON_DATA struct CgbChannel gCgbChans[4] = {0}; +COMMON_DATA struct MusicPlayerInfo gMPlayInfo_SE1 = {0}; +COMMON_DATA struct MusicPlayerInfo gMPlayInfo_SE2 = {0}; +COMMON_DATA struct MusicPlayerTrack gPokemonCryTracks[MAX_POKEMON_CRIES * 2] = {0}; +COMMON_DATA struct PokemonCrySong gPokemonCrySong = {0}; +COMMON_DATA u8 gMPlayMemAccArea[0x10] = {0}; +COMMON_DATA struct MusicPlayerInfo gMPlayInfo_SE3 = {0}; u32 MidiKeyToFreq(struct WaveData *wav, u8 key, u8 fineAdjust) { diff --git a/src/main.c b/src/main.c index 5f12a2996e44..5750ad217108 100644 --- a/src/main.c +++ b/src/main.c @@ -59,15 +59,15 @@ const IntrFunc gIntrTableTemplate[] = static u16 sUnusedVar; // Never read -u16 gKeyRepeatStartDelay; -bool8 gLinkTransferringData; -struct Main gMain; -u16 gKeyRepeatContinueDelay; -bool8 gSoftResetDisabled; -IntrFunc gIntrTable[INTR_COUNT]; -u8 gLinkVSyncDisabled; -u32 IntrMain_Buffer[0x200]; -s8 gPcmDmaCounter; +COMMON_DATA u16 gKeyRepeatStartDelay = 0; +COMMON_DATA bool8 gLinkTransferringData = 0; +COMMON_DATA struct Main gMain = {0}; +COMMON_DATA u16 gKeyRepeatContinueDelay = 0; +COMMON_DATA bool8 gSoftResetDisabled = 0; +COMMON_DATA IntrFunc gIntrTable[INTR_COUNT] = {0}; +COMMON_DATA u8 gLinkVSyncDisabled = 0; +COMMON_DATA u32 IntrMain_Buffer[0x200] = {0}; +COMMON_DATA s8 gPcmDmaCounter = 0; static EWRAM_DATA u16 sTrainerId = 0; diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index 287419f90143..dda6e6bffaf7 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -31,7 +31,7 @@ static void Storyteller_ResetFlag(void); static u8 sSelectedStory; -struct BardSong gBardSong; +COMMON_DATA struct BardSong gBardSong = {0}; static EWRAM_DATA u16 sUnknownBardRelated = 0; static EWRAM_DATA struct MauvilleManStoryteller * sStorytellerPtr = NULL; diff --git a/src/overworld.c b/src/overworld.c index e1cb0a1cad74..e2c47530be05 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -180,14 +180,14 @@ static u16 (*sPlayerKeyInterceptCallback)(u32); static bool8 sReceivingFromLink; static u8 sRfuKeepAliveTimer; -u16 *gOverworldTilemapBuffer_Bg2; -u16 *gOverworldTilemapBuffer_Bg1; -u16 *gOverworldTilemapBuffer_Bg3; -u16 gHeldKeyCodeToSend; -void (*gFieldCallback)(void); -bool8 (*gFieldCallback2)(void); -u8 gLocalLinkPlayerId; // This is our player id in a multiplayer mode. -u8 gFieldLinkPlayerCount; +COMMON_DATA u16 *gOverworldTilemapBuffer_Bg2 = NULL; +COMMON_DATA u16 *gOverworldTilemapBuffer_Bg1 = NULL; +COMMON_DATA u16 *gOverworldTilemapBuffer_Bg3 = NULL; +COMMON_DATA u16 gHeldKeyCodeToSend = 0; +COMMON_DATA void (*gFieldCallback)(void) = NULL; +COMMON_DATA bool8 (*gFieldCallback2)(void) = NULL; +COMMON_DATA u8 gLocalLinkPlayerId = 0; // This is our player id in a multiplayer mode. +COMMON_DATA u8 gFieldLinkPlayerCount = 0; EWRAM_DATA static u8 sObjectEventLoadFlag = 0; EWRAM_DATA struct WarpData gLastUsedWarp = {0}; diff --git a/src/party_menu.c b/src/party_menu.c index adf833fe895e..56625d09a3f9 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -231,7 +231,7 @@ static EWRAM_DATA u16 sUnused = 0; EWRAM_DATA u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2] = {0}; // bits 0-3 are the current pos of Slot 1, 4-7 are Slot 2, and so on // IWRAM common -void (*gItemUseCB)(u8, TaskFunc); +COMMON_DATA void (*gItemUseCB)(u8, TaskFunc) = NULL; static void ResetPartyMenu(void); static void CB2_InitPartyMenu(void); diff --git a/src/pokedex.c b/src/pokedex.c index 09a25b872b2d..c0b20bf9d6b3 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -121,8 +121,8 @@ static EWRAM_DATA u8 sPokeBallRotation = 0; static EWRAM_DATA struct PokedexListItem *sPokedexListItem = NULL; // This is written to, but never read. -u8 gUnusedPokedexU8; -void (*gPokedexVBlankCB)(void); +COMMON_DATA u8 gUnusedPokedexU8 = 0; +COMMON_DATA void (*gPokedexVBlankCB)(void) = NULL; struct SearchOptionText { diff --git a/src/pokedex_cry_screen.c b/src/pokedex_cry_screen.c index 437ef8cf5a68..2fb3d55a2455 100644 --- a/src/pokedex_cry_screen.c +++ b/src/pokedex_cry_screen.c @@ -60,7 +60,7 @@ static void SpriteCB_CryMeterNeedle(struct Sprite *); static void SetCryMeterNeedleTarget(s8); // IWRAM common -u8 gDexCryScreenState; +COMMON_DATA u8 gDexCryScreenState = 0; // EWRAM vars static EWRAM_DATA struct PokedexCryScreen *sDexCryScreen = NULL; diff --git a/src/random.c b/src/random.c index de923fba6383..aa2c67750da6 100644 --- a/src/random.c +++ b/src/random.c @@ -5,8 +5,8 @@ EWRAM_DATA static u8 sUnknown = 0; EWRAM_DATA static u32 sRandCount = 0; // IWRAM common -u32 gRngValue; -u32 gRng2Value; +COMMON_DATA u32 gRngValue = 0; +COMMON_DATA u32 gRng2Value = 0; u16 Random(void) { diff --git a/src/rtc.c b/src/rtc.c index b79f62a3c468..08d5ec4c982d 100644 --- a/src/rtc.c +++ b/src/rtc.c @@ -10,7 +10,7 @@ static u8 sProbeResult; static u16 sSavedIme; // iwram common -struct Time gLocalTime; +COMMON_DATA struct Time gLocalTime = {0}; // const rom diff --git a/src/save.c b/src/save.c index 765fb045c3c0..31230bacb5c9 100644 --- a/src/save.c +++ b/src/save.c @@ -79,19 +79,19 @@ STATIC_ASSERT(sizeof(struct SaveBlock2) <= SECTOR_DATA_SIZE, SaveBlock2FreeSpace STATIC_ASSERT(sizeof(struct SaveBlock1) <= SECTOR_DATA_SIZE * (SECTOR_ID_SAVEBLOCK1_END - SECTOR_ID_SAVEBLOCK1_START + 1), SaveBlock1FreeSpace); STATIC_ASSERT(sizeof(struct PokemonStorage) <= SECTOR_DATA_SIZE * (SECTOR_ID_PKMN_STORAGE_END - SECTOR_ID_PKMN_STORAGE_START + 1), PokemonStorageFreeSpace); -u16 gLastWrittenSector; -u32 gLastSaveCounter; -u16 gLastKnownGoodSector; -u32 gDamagedSaveSectors; -u32 gSaveCounter; -struct SaveSector *gReadWriteSector; // Pointer to a buffer for reading/writing a sector -u16 gIncrementalSectorId; -u16 gSaveUnusedVar; -u16 gSaveFileStatus; -void (*gGameContinueCallback)(void); -struct SaveSectorLocation gRamSaveSectorLocations[NUM_SECTORS_PER_SLOT]; -u16 gSaveUnusedVar2; -u16 gSaveAttemptStatus; +COMMON_DATA u16 gLastWrittenSector = 0; +COMMON_DATA u32 gLastSaveCounter = 0; +COMMON_DATA u16 gLastKnownGoodSector = 0; +COMMON_DATA u32 gDamagedSaveSectors = 0; +COMMON_DATA u32 gSaveCounter = 0; +COMMON_DATA struct SaveSector *gReadWriteSector = NULL; // Pointer to a buffer for reading/writing a sector +COMMON_DATA u16 gIncrementalSectorId = 0; +COMMON_DATA u16 gSaveUnusedVar = 0; +COMMON_DATA u16 gSaveFileStatus = 0; +COMMON_DATA void (*gGameContinueCallback)(void) = NULL; +COMMON_DATA struct SaveSectorLocation gRamSaveSectorLocations[NUM_SECTORS_PER_SLOT] = {0}; +COMMON_DATA u16 gSaveUnusedVar2 = 0; +COMMON_DATA u16 gSaveAttemptStatus = 0; EWRAM_DATA struct SaveSector gSaveDataBuffer = {0}; // Buffer used for reading/writing sectors EWRAM_DATA static u8 sUnusedVar = 0; diff --git a/src/sound.c b/src/sound.c index 8685383f783a..c41d6f2c4e2d 100644 --- a/src/sound.c +++ b/src/sound.c @@ -23,7 +23,7 @@ static u8 sMapMusicState; static u8 sMapMusicFadeInSpeed; static u16 sFanfareCounter; -bool8 gDisableMusic; +COMMON_DATA bool8 gDisableMusic = 0; extern struct ToneData gCryTable[]; extern struct ToneData gCryTable_Reverse[]; diff --git a/src/sprite.c b/src/sprite.c index 80fba81fe309..0736269be0a3 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -276,8 +276,8 @@ static struct AffineAnimState sAffineAnimStates[OAM_MATRIX_COUNT]; static u16 sSpritePaletteTags[16]; // iwram common -u32 gOamMatrixAllocBitmap; -u8 gReservedSpritePaletteCount; +COMMON_DATA u32 gOamMatrixAllocBitmap = 0; +COMMON_DATA u8 gReservedSpritePaletteCount = 0; EWRAM_DATA struct Sprite gSprites[MAX_SPRITES + 1] = {0}; EWRAM_DATA static u16 sSpritePriorities[MAX_SPRITES] = {0}; diff --git a/src/start_menu.c b/src/start_menu.c index 63914cbb72ac..0910fad84dbd 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -75,7 +75,7 @@ enum }; // IWRAM common -bool8 (*gMenuCallback)(void); +COMMON_DATA bool8 (*gMenuCallback)(void) = NULL; // EWRAM EWRAM_DATA static u8 sSafariBallsWindowId = 0; diff --git a/src/task.c b/src/task.c index 68fb679b3e59..b188cbbcba75 100644 --- a/src/task.c +++ b/src/task.c @@ -1,7 +1,7 @@ #include "global.h" #include "task.h" -struct Task gTasks[NUM_TASKS]; +COMMON_DATA struct Task gTasks[NUM_TASKS] = {0}; static void InsertTask(u8 newTaskId); static u8 FindFirstActiveTask(void); diff --git a/src/text.c b/src/text.c index bc917c7ced85..1c8a64d5c7d3 100644 --- a/src/text.c +++ b/src/text.c @@ -43,10 +43,10 @@ static u16 sLastTextBgColor; static u16 sLastTextFgColor; static u16 sLastTextShadowColor; -const struct FontInfo *gFonts; -bool8 gDisableTextPrinters; -struct TextGlyph gCurGlyph; -TextFlags gTextFlags; +COMMON_DATA const struct FontInfo *gFonts = NULL; +COMMON_DATA bool8 gDisableTextPrinters = 0; +COMMON_DATA struct TextGlyph gCurGlyph = {0}; +COMMON_DATA TextFlags gTextFlags = {0}; static const u8 sFontHalfRowOffsets[] = { diff --git a/src/trainer_see.c b/src/trainer_see.c index 51cc64f4a07e..212cbbdec354 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -49,11 +49,11 @@ static bool8 WaitRevealBuriedTrainer(u8 taskId, struct Task *task, struct Object static void SpriteCB_TrainerIcons(struct Sprite *sprite); // IWRAM common -u16 gWhichTrainerToFaceAfterBattle; -u8 gPostBattleMovementScript[4]; -struct ApproachingTrainer gApproachingTrainers[2]; -u8 gNoOfApproachingTrainers; -bool8 gTrainerApproachedPlayer; +COMMON_DATA u16 gWhichTrainerToFaceAfterBattle = 0; +COMMON_DATA u8 gPostBattleMovementScript[4] = {0}; +COMMON_DATA struct ApproachingTrainer gApproachingTrainers[2] = {0}; +COMMON_DATA u8 gNoOfApproachingTrainers = 0; +COMMON_DATA bool8 gTrainerApproachedPlayer = 0; // EWRAM EWRAM_DATA u8 gApproachingTrainerId = 0; diff --git a/src/tv.c b/src/tv.c index 0152dffa3e92..9ab9fc8969a4 100644 --- a/src/tv.c +++ b/src/tv.c @@ -63,14 +63,14 @@ enum { ROULETTE, }; -s8 sCurTVShowSlot; -u16 sTV_SecretBaseVisitMovesTemp[8]; -u8 sTV_DecorationsBuffer[DECOR_MAX_SECRET_BASE]; -struct { +COMMON_DATA s8 sCurTVShowSlot = 0; +COMMON_DATA u16 sTV_SecretBaseVisitMovesTemp[8] = {0}; +COMMON_DATA u8 sTV_DecorationsBuffer[DECOR_MAX_SECRET_BASE] = {0}; +COMMON_DATA struct { u8 level; u16 species; u16 move; -} sTV_SecretBaseVisitMonsTemp[10]; +} sTV_SecretBaseVisitMonsTemp[10] = {0}; static u8 sTVShowMixingNumPlayers; static u8 sTVShowNewsMixingNumPlayers; diff --git a/src/window.c b/src/window.c index 6f7af457d3ed..ab61610b82d7 100644 --- a/src/window.c +++ b/src/window.c @@ -5,8 +5,8 @@ #include "blit.h" // This global is set to 0 and never changed. -u8 gTransparentTileNumber; -void *gWindowBgTilemapBuffers[NUM_BACKGROUNDS]; +COMMON_DATA u8 gTransparentTileNumber = 0; +COMMON_DATA void *gWindowBgTilemapBuffers[NUM_BACKGROUNDS] = {0}; extern u32 gWindowTileAutoAllocEnabled; EWRAM_DATA struct Window gWindows[WINDOWS_MAX] = {0}; diff --git a/tools/ramscrgen/elf.cpp b/tools/ramscrgen/elf.cpp index 7e78704b8c11..077fcc82a4f3 100644 --- a/tools/ramscrgen/elf.cpp +++ b/tools/ramscrgen/elf.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include "ramscrgen.h" @@ -22,6 +21,7 @@ static int s_shstrtabIndex; static std::uint32_t s_symtabOffset; static std::uint32_t s_strtabOffset; +static std::uint32_t s_pseudoCommonSectionIndex; static std::uint32_t s_symbolCount; static std::uint32_t s_elfFileOffset; @@ -101,18 +101,6 @@ static void VerifyElfIdent() FATAL_ERROR("error: \"%s\" not little-endian ELF\n", s_elfPath.c_str()); } -static void VerifyAr() -{ - char expectedMagic[8] = {'!', '<', 'a', 'r', 'c', 'h', '>', '\n'}; - char magic[8]; - - if (std::fread(magic, 8, 1, s_file) != 1) - FATAL_ERROR("error: failed to read AR magic from \"%s\"\n", s_archiveFilePath.c_str()); - - if (std::memcmp(magic, expectedMagic, 8) != 0) - FATAL_ERROR("error: AR magic did not match in \"%s\"\n", s_archiveFilePath.c_str()); -} - static void ReadElfHeader() { Seek(0x20); @@ -123,40 +111,6 @@ static void ReadElfHeader() s_shstrtabIndex = ReadInt16(); } -static void FindArObj() -{ - char file_ident[17] = {0}; - char filesize_s[11] = {0}; - char expectedEndMagic[2] = { 0x60, 0x0a }; - char end_magic[2]; - std::size_t filesize; - - Seek(8); - while (!std::feof(s_file)) { - if (std::fread(file_ident, 16, 1, s_file) != 1) - FATAL_ERROR("error: failed to read file ident in \"%s\"\n", s_archiveFilePath.c_str()); - Skip(32); - if (std::fread(filesize_s, 10, 1, s_file) != 1) - FATAL_ERROR("error: failed to read filesize in \"%s\"\n", s_archiveFilePath.c_str()); - if (std::fread(end_magic, 2, 1, s_file) != 1) - FATAL_ERROR("error: failed to read end sentinel in \"%s\"\n", s_archiveFilePath.c_str()); - if (std::memcmp(end_magic, expectedEndMagic, 2) != 0) - FATAL_ERROR("error: corrupted archive header in \"%s\" at \"%s\"\n", s_archiveFilePath.c_str(), file_ident); - - char * ptr = std::strchr(file_ident, '/'); - if (ptr != nullptr) - *ptr = 0; - filesize = std::strtoul(filesize_s, nullptr, 10); - if (std::strncmp(s_archiveObjectPath.c_str(), file_ident, 16) == 0) { - s_elfFileOffset = std::ftell(s_file); - return; - } - Skip(filesize); - } - - FATAL_ERROR("error: could not find object \"%s\" in archive \"%s\"\n", s_archiveObjectPath.c_str(), s_archiveFilePath.c_str()); -} - static std::string GetSectionName(std::uint32_t shstrtabOffset, int index) { Seek(s_sectionHeaderOffset + s_sectionHeaderEntrySize * index); @@ -169,6 +123,7 @@ static void FindTableOffsets() { s_symtabOffset = 0; s_strtabOffset = 0; + s_pseudoCommonSectionIndex = 0; Seek(s_sectionHeaderOffset + s_sectionHeaderEntrySize * s_shstrtabIndex + 0x10); std::uint32_t shstrtabOffset = ReadInt32(); @@ -192,6 +147,11 @@ static void FindTableOffsets() FATAL_ERROR("error: mutiple .strtab sections found in \"%s\"\n", s_elfPath.c_str()); Seek(s_sectionHeaderOffset + s_sectionHeaderEntrySize * i + 0x10); s_strtabOffset = ReadInt32(); + } else if (name == "common_data") { + if (s_pseudoCommonSectionIndex) { + FATAL_ERROR("error: mutiple common_data sections found in \"%s\"\n", s_elfPath.c_str()); + } + s_pseudoCommonSectionIndex = i; } } @@ -202,65 +162,50 @@ static void FindTableOffsets() FATAL_ERROR("error: couldn't find .strtab section in \"%s\"\n", s_elfPath.c_str()); } -static std::map GetCommonSymbols_Shared() +static std::vector> GetCommonSymbols_Shared() { VerifyElfIdent(); ReadElfHeader(); FindTableOffsets(); - std::map commonSymbols; - - std::vector commonSymbolVec; - - Seek(s_symtabOffset); - - for (std::uint32_t i = 0; i < s_symbolCount; i++) - { - Symbol sym; - sym.nameOffset = ReadInt32(); - Skip(4); - sym.size = ReadInt32(); - Skip(2); - std::uint16_t sectionIndex = ReadInt16(); - if (sectionIndex == SHN_COMMON) - commonSymbolVec.push_back(sym); - } + std::vector> commonSymbols; - for (const Symbol& sym : commonSymbolVec) - { - Seek(s_strtabOffset + sym.nameOffset); - std::string name = ReadString(); - commonSymbols[name] = sym.size; + if (s_pseudoCommonSectionIndex) { + std::vector commonSymbolVec; + + Seek(s_symtabOffset); + + for (std::uint32_t i = 0; i < s_symbolCount; i++) + { + Symbol sym; + sym.nameOffset = ReadInt32(); + Skip(4); + sym.size = ReadInt32(); + Skip(2); + std::uint16_t sectionIndex = ReadInt16(); + if (sectionIndex == s_pseudoCommonSectionIndex) + commonSymbolVec.push_back(sym); + } + + for (const Symbol& sym : commonSymbolVec) + { + Seek(s_strtabOffset + sym.nameOffset); + std::string name = ReadString(); + if (name == "$d" || name == "") { + continue; + } + commonSymbols.emplace_back(name, sym.size); + } } return commonSymbols; } -std::map GetCommonSymbolsFromLib(std::string sourcePath, std::string libpath) -{ - std::size_t colonPos = libpath.find(':'); - if (colonPos == std::string::npos) - FATAL_ERROR("error: missing colon separator in libfile \"%s\"\n", s_elfPath.c_str()); - - s_archiveObjectPath = libpath.substr(colonPos + 1); - s_archiveFilePath = sourcePath + "/" + libpath.substr(1, colonPos - 1); - s_elfPath = sourcePath + "/" + libpath.substr(1); - - s_file = std::fopen(s_archiveFilePath.c_str(), "rb"); - - if (s_file == NULL) - FATAL_ERROR("error: failed to open \"%s\" for reading\n", s_archiveFilePath.c_str()); - - VerifyAr(); - FindArObj(); - return GetCommonSymbols_Shared(); -} - -std::map GetCommonSymbols(std::string sourcePath, std::string path) +std::vector> GetCommonSymbols(std::string sourcePath, std::string path) { s_elfFileOffset = 0; if (path[0] == '*') - return GetCommonSymbolsFromLib(sourcePath, path); + FATAL_ERROR("error: library common syms are unsupported (filename: \"%s\")\n", path.c_str()); s_elfPath = sourcePath + "/" + path; s_file = std::fopen(s_elfPath.c_str(), "rb"); diff --git a/tools/ramscrgen/elf.h b/tools/ramscrgen/elf.h index 3704860c0e47..bf79a954e08b 100644 --- a/tools/ramscrgen/elf.h +++ b/tools/ramscrgen/elf.h @@ -22,9 +22,9 @@ #define ELF_H #include -#include +#include #include -std::map GetCommonSymbols(std::string sourcePath, std::string path); +std::vector> GetCommonSymbols(std::string sourcePath, std::string path); #endif // ELF_H diff --git a/tools/ramscrgen/main.cpp b/tools/ramscrgen/main.cpp index 5e5894f470de..e99cf9fa307a 100644 --- a/tools/ramscrgen/main.cpp +++ b/tools/ramscrgen/main.cpp @@ -28,54 +28,19 @@ void HandleCommonInclude(std::string filename, std::string sourcePath, std::string symOrderPath, std::string lang) { auto commonSymbols = GetCommonSymbols(sourcePath, filename); - std::size_t dotIndex; - if (filename[0] == '*') { - dotIndex = filename.find_last_of(':'); - filename = filename.substr(dotIndex + 1); - } - - dotIndex = filename.find_last_of('.'); - - if (dotIndex == std::string::npos) - FATAL_ERROR("error: \"%s\" doesn't have a file extension\n", filename.c_str()); - - std::string symOrderFilename = filename.substr(0, dotIndex + 1) + "txt"; - - SymFile symFile(symOrderPath + "/" + symOrderFilename); - - while (!symFile.IsAtEnd()) + for (const auto& commonSym : commonSymbols) { - symFile.HandleLangConditional(lang); - - std::string label = symFile.GetLabel(false); - - if (label.length() == 0) - { - unsigned long length; - if (symFile.ReadInteger(length)) - { - if (length & 3) - symFile.RaiseWarning("gap length %d is not multiple of 4", length); - printf(". += 0x%lX;\n", length); - } - } - else - { - if (commonSymbols.count(label) == 0) - symFile.RaiseError("no common symbol named \"%s\"", label.c_str()); - unsigned long size = commonSymbols[label]; - int alignment = 4; - if (size > 4) - alignment = 8; - if (size > 8) - alignment = 16; - printf(". = ALIGN(%d);\n", alignment); - printf("%s = .;\n", label.c_str()); - printf(". += 0x%lX;\n", size); - } - - symFile.ExpectEmptyRestOfLine(); + unsigned long size = commonSym.second; + + int alignment = 4; + if (size > 4) + alignment = 8; + if (size > 8) + alignment = 16; + printf(". = ALIGN(%d);\n", alignment); + printf("%s = .;\n", commonSym.first.c_str()); + printf(". += 0x%lX;\n", size); } } From d58bbe2a6f3abe628594b3bb6700bb1c1240041d Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 16 Oct 2024 09:44:48 -0300 Subject: [PATCH 47/48] Removed all instances of gflib from ld_scripts --- Makefile | 2 +- ld_script.ld | 1 - ld_script_modern.ld | 1 - ld_script_test.ld | 5 ----- 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 87de7037af8d..a807cbf8bf56 100644 --- a/Makefile +++ b/Makefile @@ -452,7 +452,7 @@ $(DATA_SRC_SUBDIR)/pokemon/teachable_learnsets.h: $(DATA_ASM_BUILDDIR)/event_scr # NOTE: Based on C_DEP above, but without NODEP and KEEP_TEMPS handling. define TEST_DEP -$1: $2 $$(shell $(SCANINC) -I include -I $(TOOLS_DIR)/agbcc/include -I gflib $2) +$1: $2 $$(shell $(SCANINC) -I include -I $(TOOLS_DIR)/agbcc/include $2) @echo "$$(CC1) -o $$@ $$<" @$$(CPP) $$(CPPFLAGS) $$< | $$(PREPROC) -i $$< charmap.txt | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ - endef diff --git a/ld_script.ld b/ld_script.ld index ccf5f813d8bb..4e7a368fc38b 100644 --- a/ld_script.ld +++ b/ld_script.ld @@ -27,7 +27,6 @@ SECTIONS { { INCLUDE "sym_ewram.ld" src/*.o(.sbss); - gflib/*.o(.sbss); *libc.a:impure.o(.data); *libc.a:locale.o(.data); diff --git a/ld_script_modern.ld b/ld_script_modern.ld index 8e63ad55a6a5..ee4713ab177e 100644 --- a/ld_script_modern.ld +++ b/ld_script_modern.ld @@ -27,7 +27,6 @@ SECTIONS { ALIGN(4) { src/*.o(.sbss); - gflib/*.o(.sbss); } > EWRAM .iwram ORIGIN(IWRAM) : AT (__iwram_lma) diff --git a/ld_script_test.ld b/ld_script_test.ld index 05cd56d11823..8972a97b008d 100644 --- a/ld_script_test.ld +++ b/ld_script_test.ld @@ -25,7 +25,6 @@ SECTIONS { ALIGN(4) { src/*.o(.sbss); - gflib/*.o(.sbss); test/*.o(.sbss); . = ALIGN(4); } > EWRAM @@ -43,7 +42,6 @@ SECTIONS { ALIGN(4) { src/*.o(.bss); - gflib/*.o(.bss); data/*.o(.bss); test/*.o(.bss); *libc.a:*.o(.bss*); @@ -54,7 +52,6 @@ SECTIONS { src/*.o(common_data); src/*.o(COMMON); - gflib/*.o(COMMON); data/*.o(COMMON); test/*.o(COMMON); *libc.a:sbrkr.o(COMMON); @@ -77,7 +74,6 @@ SECTIONS { src/rom_header_gf.o(.text.*); src/rom_header_rhh.o(.text.*); src/*.o(.text); - gflib/*.o(.text); } > ROM =0 script_data : @@ -99,7 +95,6 @@ SECTIONS { ALIGN(4) { src/*.o(.rodata*); - gflib/*.o(.rodata*); data/*.o(.rodata*); } > ROM =0 From 20c5df74e4d0812a7eeaafbbee809b8e43a2453f Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 16 Oct 2024 09:45:58 -0300 Subject: [PATCH 48/48] Updated .gitignore for agbcc screenshot suffix --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 06cdfc023fa4..abad67b044aa 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,6 @@ prefabs.json *.sym *.js /pokeemerald-*.png -/pokeemerald_modern-*.png +/pokeemerald_agbcc-*.png src/data/map_group_count.h tools/trainerproc/trainerproc