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 01/28] 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 1eb4b8b55a..56d1e3812f 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 dcb16c0e79..f5ee7ad6de 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) { - std::printf("%s\n", path.c_str()); + for (const std::string &path : dependencies) + { + std::printf("%s\n", path.c_str()); + } + std::cout << std::endl; + } + else + { + // 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 02/28] 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 698f983ceb..feef64cf5b 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 0000000000..439778e9bd --- /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 03/28] 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 5c073b36ca..df574e4545 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 feef64cf5b..69d482fdfa 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 04/28] `.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 69d482fdfa..fccb9fc548 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 32f05269a3c96b45464ca0e1f5c4090c2f37d75f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 31 Aug 2024 00:53:23 -0400 Subject: [PATCH 05/28] 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 fccb9fc548..0acbccec07 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 439778e9bd..5802904b41 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 71fcb2e7b5b24d5bd64717d2ca7d9d760b55722c Mon Sep 17 00:00:00 2001 From: NT_x86 Date: Sun, 8 Sep 2024 12:50:35 +0300 Subject: [PATCH 06/28] 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 9ab7184c3c..d66d9a8ffd 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 07/28] 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 7ffcdee07b..03b28ba464 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 08/28] 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 c381b50f1b..6bf2034006 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 d9b824db3f6ede8007be70b58c03874451f9d046 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 12 Sep 2024 12:27:31 -0400 Subject: [PATCH 09/28] 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 1a10c9dab8..94328b4857 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 10/28] Remove old ld_script processing --- Makefile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7e5e14cd61..ce868f06bd 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 b8c71fa84d7d590006b94b0b5b46aa9a74cf2f41 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 13 Sep 2024 23:38:50 -0400 Subject: [PATCH 11/28] 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 ce868f06bd..48350147a4 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 1da530206b..3ac5f392a0 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 @@ protected: // 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 12/28] 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 f5ee7ad6de..c1b7987a5a 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 13/28] 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 cb3b95ee78..567316cf9c 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 52c2728ff6d07a5d8d420cbe39c08365aa1ca01e Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Wed, 18 Sep 2024 10:37:34 -0400 Subject: [PATCH 14/28] 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 ce868f06bd..9082680c8c 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 ff13efa9a8..db9f4db873 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 c4abf075f8..1e08a8d61c 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 4ccbfbaa0f..fac4a134c3 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 cab78d7611..ac8a0ef127 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 3a23e74789..0520e0b5b0 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 7eebcac74e..bffabfbdf3 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 31c507ee9b..92a69cc4c9 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 36b6c7ed06..4eda54a3aa 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 15/28] fix indentation --- sym_common.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sym_common.txt b/sym_common.txt index bffabfbdf3..335af85a30 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 16/28] 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 2189eedbc9..26b01f678d 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 c625c78a9e..cb048d2ae3 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 335af85a30..e001c2ca59 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -1,37 +1,10 @@ - .space 0x8 + .align 4 .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 "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 17/28] 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 8a666a536e..9a6166b599 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 18/28] 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 9a6166b599..522ea01a97 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 19/28] 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 9fa431e143..f940d26b21 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 20/28] 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 195374bba0..02c3a1f948 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 21/28] 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 f254a6d142..d952b4b640 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 22/28] 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 283e6f8fb5..a99c99283d 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 23/28] [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 4eda54a3aa..a82354cb5f 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 24/28] 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 5eaf4cf0bc..ee36562b13 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 c1b7987a5a..d470a3f163 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 25/28] 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 595f366cbe..c1fe10d374 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 26/28] 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 93204a215a..0c3dd726df 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 5b1b5efd19..f291a61871 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 27/28] Remove unnecessary looping for rule generation and unroll macros (#2046) --- Makefile | 89 +++++++++++++++++++++++--------------------------------- 1 file changed, 36 insertions(+), 53 deletions(-) diff --git a/Makefile b/Makefile index ee36562b13..58f6c14513 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 -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)))) +-include $(addprefix $(OBJ_DIR)/,$(C_SRCS:.c=.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 +$(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s + $(AS) $(ASFLAGS) -o $@ $< + +$(ASM_BUILDDIR)/%.d: $(ASM_SUBDIR)/%.s + $(SCANINC) -M $@ $(INCLUDE_SCANINC_ARGS) -I "" $< -define ASM_SCANINC ifneq ($(NODEP),1) -$1.d: $2 - $(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I "" $2 --include $1.d +-include $(addprefix $(OBJ_DIR)/,$(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)))) +$(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) +-include $(addprefix $(OBJ_DIR)/,$(C_ASM_SRCS:.s=.d)) +endif + +$(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 28/28] 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 | 55 ++-------- 96 files changed, 243 insertions(+), 500 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 58f6c14513..6d66c34d65 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 7ff8cd53dd..0000000000 --- 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 cb421ec80d..0000000000 --- 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 0d3569dcbb..0000000000 --- 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 5e2e8b3ff3..0000000000 --- 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 3ddeb6d3b1..0000000000 --- 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 f6f02c48d3..0000000000 --- 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 7371109d51..0000000000 --- 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 1b15a33d61..0000000000 --- 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 0a3c3aecca..0000000000 --- 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 6a519fb463..0000000000 --- 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 32bb8be161..0000000000 --- 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 26b01f678d..0000000000 --- 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 137cd3e05d..0000000000 --- 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 e02ca2ec25..0000000000 --- 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 02301ce23c..0000000000 --- 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 268f60c641..0000000000 --- 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 7adb3f6692..0000000000 --- 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 0ead758462..0000000000 --- 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 134f7e88b2..0000000000 --- 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 d069b1014f..0000000000 --- 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 4b742dcd25..0000000000 --- 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 97395e84b3..0000000000 --- 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 a1f7735535..0000000000 --- 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 4118d1eb4b..0000000000 --- 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 4b8f02bad8..0000000000 --- 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 ed5343618c..0000000000 --- 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 2d3d9b802f..0000000000 --- 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 0d6b13a79b..0000000000 --- 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 a620083d19..0000000000 --- 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 9d77b8692b..0000000000 --- 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 dcada0bbef..0000000000 --- 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 6ed37392c2..0000000000 --- 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 c7a297b2af..0000000000 --- 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 d16ec36d64..0000000000 --- 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 8037c69586..0000000000 --- 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 fa00a34d51..0000000000 --- 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 131031d506..0000000000 --- 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 0f6f2fc758..0000000000 --- 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 627c01c0d0..0000000000 --- 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 05beaf57c2..0000000000 --- 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 6601bd11bb..0000000000 --- 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 cd8886e5b1..0000000000 --- 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 0b30a632a0..0000000000 --- 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 0370f65e1f..0000000000 --- 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 24c093a226..0000000000 --- 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 febe6882cf..a549bab7e2 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 1e08a8d61c..316b5fe20f 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 fac4a134c3..788a5736f0 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 e4ee377f7b..d696c01d3c 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 6b9381c704..ffec206fee 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 2280412fe7..72ab8f24c8 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 8296126f14..951794fc54 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 0533d1e2a3..adf241153f 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 9039655c4d..7ee8d8cf55 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 ec6019afb0..0420a15f63 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 a5102d48fb..5f0e170607 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 4ccb95eb6b..166c59df0c 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 8f0ad7fbfe..5b9560faf5 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 30ca51c966..c72d0dc6af 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 cb048d2ae3..556acf8e3c 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 133afe3b0d..db28ceb8f2 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 31ebc63c05..290ddddaf1 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 09d6ae7838..b1c3aa6d8e 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 f8d493493c..43d07356aa 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 e4dc0026a3..8c0e416f45 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 51a5d13993..b09e881fe0 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 02c3a1f948..68432b5b98 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 828d6450bc..ee5dbe6af4 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 1c02840e85..32391d781c 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 b515f338e0..13a7e34082 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 f784a36c67..bb74574a31 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 b34c7184cf..4c4323c1ed 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 e24442ca02..8201caa34d 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 44e08b5e9c..a6284ffebd 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 7774d09cba..9caedd34a0 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 5f12a2996e..5750ad2171 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 287419f901..dda6e6bffa 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 e1cb0a1cad..e2c47530be 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 adf833fe89..56625d09a3 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 09a25b872b..c0b20bf9d6 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 437ef8cf5a..2fb3d55a24 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 de923fba63..aa2c67750d 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 b79f62a3c4..08d5ec4c98 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 765fb045c3..31230bacb5 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 8685383f78..c41d6f2c4e 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 80fba81fe3..0736269be0 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 63914cbb72..0910fad84d 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 68fb679b3e..b188cbbcba 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 bc917c7ced..1c8a64d5c7 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 51cc64f4a0..212cbbdec3 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 0152dffa3e..9ab9fc8969 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 6f7af457d3..ab61610b82 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 7e78704b8c..077fcc82a4 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> 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); - } - - 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 3704860c0e..bf79a954e0 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 5e5894f470..e99cf9fa30 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); + unsigned long size = commonSym.second; - 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(); + 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); } }