From 99a038284bcbbf3a0f5ee95982f761a71a72850d Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sun, 19 Dec 2021 20:05:40 +0100 Subject: Translate all .include to #include MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This decision was made to reduce the complexity of using .include whilst juggling with tools/scaninc and tools/preproc: - tools/scaninc doesn't apply the proper search rules for .include (it assumes #include behavior). In particular, it doesn't consider paths starting from $PWD, and doesn't scan the included files as a result. - .include had to be processed before #include by preproc in many cases, as code was being included that had to be preprocessed by CPP (think of #define). This contradicts standard GCC behavior. To make include paths consistent across the asm/ data/ and src/ directories, the following files were moved: - constants/ → include/asm/constants/ - asm/macros/ → include/asm/macros/ - asm/macros.inc → include/asm/macros.inc - include/macros/m4a.inc → include/asm/macros/m4a.inc As part of the necessary changes for this to work, the scaninc method in the makefile was improved to generate .d files that don't choke when files are missing. --- Makefile | 44 ++- asm/arm_func.s | 4 +- asm/code_2.s | 4 +- asm/code_8002774.s | 4 +- asm/code_80035F0.s | 4 +- asm/code_8004AA0.s | 4 +- asm/code_800558C.s | 4 +- asm/code_8009804.s | 4 +- asm/code_800B5F0.s | 4 +- asm/code_800D090.s | 4 +- asm/code_8012A18.s | 4 +- asm/code_801B3C0.s | 4 +- asm/code_801C620.s | 4 +- asm/code_801D760.s | 4 +- asm/code_801DCC4.s | 4 +- asm/code_801EE10.s | 4 +- asm/code_803B050.s | 4 +- asm/code_803C1D0.s | 4 +- asm/code_803D110.s | 4 +- asm/code_8040094.s | 4 +- asm/code_8041AD0.s | 4 +- asm/code_80428A0.s | 4 +- asm/code_80450F8.s | 4 +- asm/code_8045A00.s | 4 +- asm/code_8048480.s | 4 +- asm/code_8049590.s | 4 +- asm/code_804ACA0.s | 4 +- asm/code_80521D0.s | 4 +- asm/code_8057144.s | 4 +- asm/code_8057824.s | 4 +- asm/code_806CD90.s | 4 +- asm/code_807001C.s | 4 +- asm/code_8070BC0.s | 4 +- asm/code_8070D04.s | 4 +- asm/code_8071518.s | 4 +- asm/code_807167C.s | 4 +- asm/code_8071858.s | 4 +- asm/code_80718D8.s | 4 +- asm/code_8073B78.s | 4 +- asm/code_8075BA4.s | 4 +- asm/code_808333C.s | 6 +- asm/code_808411C.s | 4 +- asm/code_8084160.s | 4 +- asm/code_80848F0.s | 4 +- asm/code_8085B0C.s | 4 +- asm/code_80869E4.s | 4 +- asm/code_8086A3C.s | 4 +- asm/code_809017C.s | 4 +- asm/code_8090208.s | 4 +- asm/code_8094148.s | 4 +- asm/code_8094D28.s | 4 +- asm/code_8095014.s | 4 +- asm/code_80958E8.s | 4 +- asm/code_809747C.s | 4 +- asm/code_8097670.s | 4 +- asm/code_80983D8.s | 4 +- asm/code_8098468.s | 4 +- asm/code_8098BDC.s | 4 +- asm/code_809D148.s | 4 +- asm/code_80A26CC.s | 4 +- asm/code_8272724.s | 4 +- asm/credits.s | 4 +- asm/crt0.s | 4 +- asm/debug_menu.s | 4 +- asm/debug_menu_1.s | 4 +- asm/debug_menu_2.s | 4 +- asm/event_flag.s | 4 +- asm/exclusive_pokemon.s | 4 +- asm/felicity_bank.s | 4 +- asm/friend_area_1.s | 4 +- asm/friend_area_action_menu.s | 4 +- asm/friend_list_menu.s | 4 +- asm/friend_rescue.s | 4 +- asm/ground_effect.s | 4 +- asm/ground_event.s | 4 +- asm/ground_link.s | 4 +- asm/ground_lives.s | 4 +- asm/ground_map.s | 4 +- asm/ground_object.s | 4 +- asm/ground_script.s | 4 +- asm/ground_sprite.s | 4 +- asm/gulpin_shop.s | 4 +- asm/jirachi_wish.s | 4 +- asm/kangaskhan_storage.s | 4 +- asm/kangaskhan_storage_1.s | 4 +- asm/kangaskhan_storage_2.s | 4 +- asm/kecleon_items.s | 4 +- asm/kecleon_items_1.s | 4 +- asm/m4a_1.s | 6 +- asm/macros.inc | 3 - asm/macros/function.inc | 29 -- asm/macros/music_voice.inc | 140 ------- asm/macros/script.inc | 415 -------------------- asm/mailbox.s | 4 +- asm/makuhita_dojo.s | 4 +- asm/memory.s | 4 +- asm/memory_1.s | 4 +- asm/moves_1.s | 4 +- asm/music.s | 4 +- asm/other_menus.s | 4 +- asm/pelipper_board.s | 4 +- asm/pokemon.s | 4 +- asm/pokemon_2.s | 4 +- asm/pokemon_3.s | 4 +- asm/rescue_password_menu.s | 4 +- asm/sprite.s | 4 +- asm/text.s | 4 +- asm/unk_menu_203B360.s | 4 +- asm/unk_menu_203B364.s | 4 +- asm/wonder_mail_2.s | 4 +- asm/wonder_mail_3.s | 4 +- asm/wonder_mail_3_mid.s | 4 +- asm/wonder_mail_4.s | 4 +- asm/wonder_mail_5.s | 4 +- constants/gba_constants.inc | 490 ------------------------ constants/m4a_constants.inc | 199 ---------- constants/script_func_constants.inc | 14 - data/cutscenes.s | 6 +- data/cutscenes_1.s | 18 +- data/data.s | 2 +- data/data_80D47B8.s | 6 +- data/data_80DED44.s | 4 +- data/data_80E2068.s | 2 +- data/data_80F4278.s | 6 +- data/dungeon/floor_id.inc | 128 +++---- data/dungeon/main_data.inc | 46 +-- data/dungeon/pokemon_found.inc | 40 +- data/dungeon_sbin.s | 34 +- data/sound_data.s | 6 +- data/system_sbin.s | 14 +- include/asm/constants/gba_constants.inc | 490 ++++++++++++++++++++++++ include/asm/constants/m4a_constants.inc | 199 ++++++++++ include/asm/constants/script_func_constants.inc | 14 + include/asm/macros.inc | 3 + include/asm/macros/function.inc | 29 ++ include/asm/macros/m4a.inc | 13 + include/asm/macros/music_voice.inc | 140 +++++++ include/asm/macros/script.inc | 415 ++++++++++++++++++++ include/macros/m4a.inc | 13 - libagbsyscall/libagbsyscall.s | 4 +- tools/dungeonjson/dungeonjson.cpp | 20 +- 141 files changed, 1715 insertions(+), 1711 deletions(-) delete mode 100644 asm/macros.inc delete mode 100644 asm/macros/function.inc delete mode 100644 asm/macros/music_voice.inc delete mode 100644 asm/macros/script.inc delete mode 100644 constants/gba_constants.inc delete mode 100644 constants/m4a_constants.inc delete mode 100644 constants/script_func_constants.inc create mode 100644 include/asm/constants/gba_constants.inc create mode 100644 include/asm/constants/m4a_constants.inc create mode 100644 include/asm/constants/script_func_constants.inc create mode 100644 include/asm/macros.inc create mode 100644 include/asm/macros/function.inc create mode 100644 include/asm/macros/m4a.inc create mode 100644 include/asm/macros/music_voice.inc create mode 100644 include/asm/macros/script.inc delete mode 100644 include/macros/m4a.inc diff --git a/Makefile b/Makefile index 609786f..cc39e09 100755 --- a/Makefile +++ b/Makefile @@ -65,7 +65,8 @@ TOOLS = $(foreach tool,$(TOOLBASE),tools/$(tool)/$(tool)$(EXE)) ASFLAGS := -mcpu=arm7tdmi override CC1FLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Wunused -Werror -O2 -fhex-asm -CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef +INCLUDE_PATHS := -I include -I tools/agbcc/include +CPPFLAGS := -iquote include -I tools/agbcc/include -nostdinc -undef #### Files #### @@ -77,7 +78,6 @@ ELF := $(ROM:%.gba=%.elf) MAP := $(ROM:%.gba=%.map) C_SUBDIR = src -GFLIB_SUBDIR = gflib ASM_SUBDIR = asm DATA_SRC_SUBDIR = src/data DATA_ASM_SUBDIR = data @@ -86,7 +86,6 @@ MID_SUBDIR = sound/songs/midi SAMPLE_SUBDIR = sound/direct_sound_samples C_BUILDDIR = $(BUILD_DIR)/$(C_SUBDIR) -GFLIB_BUILDDIR = $(BUILD_DIR)/$(GFLIB_SUBDIR) ASM_BUILDDIR = $(BUILD_DIR)/$(ASM_SUBDIR) DATA_ASM_BUILDDIR = $(BUILD_DIR)/$(DATA_ASM_SUBDIR) SONG_BUILDDIR = $(BUILD_DIR)/$(SONG_SUBDIR) @@ -137,10 +136,8 @@ infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst # Disable dependency scanning for clean/tidy/tools # Use a separate minimal makefile for speed # Since we don't need to reload most of this makefile -ifeq (,$(filter-out all rom compare libagbsyscall syms,$(MAKECMDGOALS))) +ifeq (,$(filter-out clean,$(MAKECMDGOALS))) $(call infoshell, $(MAKE) -f make_tools.mk) -else -NODEP ?= 1 endif .PRECIOUS: %.1bpp %.4bpp %.8bpp %.gbapal %.lz %.rl %.pcm %.bin @@ -163,9 +160,8 @@ include graphics.mk $(TOOLDIRS): @$(MAKE) -C $@ CC=$(HOSTCC) CXX=$(HOSTCXX) -$(SCANINC): tools/scaninc -compare: all +compare: $(ROM) @$(SHA1SUM) $(BUILD_NAME).sha1 clean: tidy clean-tools @@ -179,29 +175,37 @@ tidy: $(RM) -r $(BUILD_DIR) @$(MAKE) clean -C libagbsyscall +define scaninc + ( paths="$$($(SCANINC) $1 $<)"; \ + echo -n "$(@:.d=.o): " > $@; \ + echo "$$paths" | xargs printf "%s " >> $@; \ + test -n "$$paths" && echo "$$paths" | xargs printf "\n%s:" >> $@; \ + echo >> $@; ) +endef + $(C_BUILDDIR)/%.o: $(C_SUBDIR)/%.c @$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i @$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CC1FLAGS) -o $(C_BUILDDIR)/$*.s @echo -e ".text\n\t.align\t2, 0\n" >> $(C_BUILDDIR)/$*.s $(AS) $(ASFLAGS) -o $@ $(C_BUILDDIR)/$*.s -$(C_BUILDDIR)/%.d: $(C_SUBDIR)/%.c $(SCANINC) - @echo -n "$(@:.d=.o): " > $@ - @$(SCANINC) -I include -I tools/agbcc/include -I gflib $< | xargs printf "%s " >> $@ +$(C_BUILDDIR)/%.d: $(C_SUBDIR)/%.c + @$(call scaninc,$(INCLUDE_PATHS)) $(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s dungeon_pokemon dungeon_floor data_pokemon data_item data_move - $(PREPROC) $< charmap.txt | $(CPP) -I include - | $(AS) $(ASFLAGS) -o $@ + @$(CPP) -x assembler-with-cpp $(CPPFLAGS) $< -o $(DATA_ASM_BUILDDIR)/$*.i.s + @$(PREPROC) $(DATA_ASM_BUILDDIR)/$*.i.s charmap.txt > $(DATA_ASM_BUILDDIR)/$*.s + $(AS) $(ASFLAGS) -o $@ $(DATA_ASM_BUILDDIR)/$*.s -$(DATA_ASM_BUILDDIR)/%.d: $(DATA_ASM_SUBDIR)/%.s $(SCANINC) - @echo -n "$(@:.d=.o): " > $@ - @$(SCANINC) -I include $< | xargs printf "%s " >> $@ +$(DATA_ASM_BUILDDIR)/%.d: $(DATA_ASM_SUBDIR)/%.s + @$(call scaninc,$(INCLUDE_PATHS)) $(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s - $(AS) $(ASFLAGS) $< -o $@ + @$(CPP) -x assembler-with-cpp $(CPPFLAGS) $< -o $(ASM_BUILDDIR)/$*.s + $(AS) $(ASFLAGS) -o $@ $(ASM_BUILDDIR)/$*.s -$(ASM_BUILDDIR)/%.d: $(ASM_SUBDIR)/%.s $(SCANINC) - @echo -n "$(@:.d=.o): " > $@ - @$(SCANINC) $< | xargs printf "%s " >> $@ +$(ASM_BUILDDIR)/%.d: $(ASM_SUBDIR)/%.s + @$(call scaninc,$(INCLUDE_PATHS)) libagbsyscall: @$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) @@ -220,5 +224,5 @@ $(ROM): %.gba: $(ELF) $(GBAFIX) $@ -p -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent ifeq (,$(filter clean,$(MAKECMDGOALS))) -include $(ALL_OBJECTS:.o=.d) +-include $(ALL_OBJECTS:.o=.d) endif diff --git a/asm/arm_func.s b/asm/arm_func.s index a84435f..f10e342 100644 --- a/asm/arm_func.s +++ b/asm/arm_func.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_2.s b/asm/code_2.s index a9dbf43..b062aab 100644 --- a/asm/code_2.s +++ b/asm/code_2.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8002774.s b/asm/code_8002774.s index c1e3140..14c5b6c 100644 --- a/asm/code_8002774.s +++ b/asm/code_8002774.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_80035F0.s b/asm/code_80035F0.s index 19bb1c3..dd96da9 100644 --- a/asm/code_80035F0.s +++ b/asm/code_80035F0.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8004AA0.s b/asm/code_8004AA0.s index 44d52f6..2f1f5bf 100644 --- a/asm/code_8004AA0.s +++ b/asm/code_8004AA0.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_800558C.s b/asm/code_800558C.s index ad90f29..9ae474a 100644 --- a/asm/code_800558C.s +++ b/asm/code_800558C.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8009804.s b/asm/code_8009804.s index 8273b0f..9498ccd 100644 --- a/asm/code_8009804.s +++ b/asm/code_8009804.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_800B5F0.s b/asm/code_800B5F0.s index 2afdbed..bcad95a 100644 --- a/asm/code_800B5F0.s +++ b/asm/code_800B5F0.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_800D090.s b/asm/code_800D090.s index 505b5e1..dd890d8 100644 --- a/asm/code_800D090.s +++ b/asm/code_800D090.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8012A18.s b/asm/code_8012A18.s index 0a2d752..53f3185 100644 --- a/asm/code_8012A18.s +++ b/asm/code_8012A18.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_801B3C0.s b/asm/code_801B3C0.s index 435b731..9b84072 100644 --- a/asm/code_801B3C0.s +++ b/asm/code_801B3C0.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_801C620.s b/asm/code_801C620.s index 2cbc4a8..4770bb5 100644 --- a/asm/code_801C620.s +++ b/asm/code_801C620.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_801D760.s b/asm/code_801D760.s index 6f026d5..3b4d8df 100644 --- a/asm/code_801D760.s +++ b/asm/code_801D760.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_801DCC4.s b/asm/code_801DCC4.s index 52212b1..9ac7c8a 100644 --- a/asm/code_801DCC4.s +++ b/asm/code_801DCC4.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_801EE10.s b/asm/code_801EE10.s index 4de5bb1..84256f9 100644 --- a/asm/code_801EE10.s +++ b/asm/code_801EE10.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_803B050.s b/asm/code_803B050.s index 7e62294..c13b2b6 100644 --- a/asm/code_803B050.s +++ b/asm/code_803B050.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_803C1D0.s b/asm/code_803C1D0.s index fe52d74..fb6c7cf 100644 --- a/asm/code_803C1D0.s +++ b/asm/code_803C1D0.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_803D110.s b/asm/code_803D110.s index 1bf4f5d..8ee110e 100644 --- a/asm/code_803D110.s +++ b/asm/code_803D110.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8040094.s b/asm/code_8040094.s index 1e11d74..5ea38ec 100644 --- a/asm/code_8040094.s +++ b/asm/code_8040094.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8041AD0.s b/asm/code_8041AD0.s index 7d4f30a..2b216de 100644 --- a/asm/code_8041AD0.s +++ b/asm/code_8041AD0.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_80428A0.s b/asm/code_80428A0.s index 321afa0..49ef590 100644 --- a/asm/code_80428A0.s +++ b/asm/code_80428A0.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_80450F8.s b/asm/code_80450F8.s index ddd60e7..6d391de 100644 --- a/asm/code_80450F8.s +++ b/asm/code_80450F8.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8045A00.s b/asm/code_8045A00.s index 3731a1a..529fb22 100644 --- a/asm/code_8045A00.s +++ b/asm/code_8045A00.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8048480.s b/asm/code_8048480.s index 7520dd1..37e3310 100644 --- a/asm/code_8048480.s +++ b/asm/code_8048480.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8049590.s b/asm/code_8049590.s index 93dc942..846f24c 100644 --- a/asm/code_8049590.s +++ b/asm/code_8049590.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_804ACA0.s b/asm/code_804ACA0.s index f5172dc..7e25d6d 100644 --- a/asm/code_804ACA0.s +++ b/asm/code_804ACA0.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_80521D0.s b/asm/code_80521D0.s index 5156376..8e97c19 100644 --- a/asm/code_80521D0.s +++ b/asm/code_80521D0.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8057144.s b/asm/code_8057144.s index 8973709..8aecb64 100644 --- a/asm/code_8057144.s +++ b/asm/code_8057144.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8057824.s b/asm/code_8057824.s index 456278c..7ea4a18 100644 --- a/asm/code_8057824.s +++ b/asm/code_8057824.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_806CD90.s b/asm/code_806CD90.s index 14e2d70..535fa42 100644 --- a/asm/code_806CD90.s +++ b/asm/code_806CD90.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_807001C.s b/asm/code_807001C.s index 96457c9..958db4f 100644 --- a/asm/code_807001C.s +++ b/asm/code_807001C.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8070BC0.s b/asm/code_8070BC0.s index 36d911a..4435a85 100644 --- a/asm/code_8070BC0.s +++ b/asm/code_8070BC0.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8070D04.s b/asm/code_8070D04.s index d995bdc..7a511ab 100644 --- a/asm/code_8070D04.s +++ b/asm/code_8070D04.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8071518.s b/asm/code_8071518.s index 4a5f226..f33352f 100644 --- a/asm/code_8071518.s +++ b/asm/code_8071518.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_807167C.s b/asm/code_807167C.s index acb27c6..ee32631 100644 --- a/asm/code_807167C.s +++ b/asm/code_807167C.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8071858.s b/asm/code_8071858.s index d0cb318..9fc337a 100644 --- a/asm/code_8071858.s +++ b/asm/code_8071858.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_80718D8.s b/asm/code_80718D8.s index 35f9c8b..699dad9 100644 --- a/asm/code_80718D8.s +++ b/asm/code_80718D8.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8073B78.s b/asm/code_8073B78.s index 55f8418..84affaa 100644 --- a/asm/code_8073B78.s +++ b/asm/code_8073B78.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8075BA4.s b/asm/code_8075BA4.s index 841838c..2cf8274 100644 --- a/asm/code_8075BA4.s +++ b/asm/code_8075BA4.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_808333C.s b/asm/code_808333C.s index 9256eec..5677a42 100644 --- a/asm/code_808333C.s +++ b/asm/code_808333C.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified @@ -1876,4 +1876,4 @@ sub_80840D8: _080840E4: .4byte gDungeonRngState thumb_func_end sub_80840D8 - .align 2, 0 \ No newline at end of file + .align 2, 0 diff --git a/asm/code_808411C.s b/asm/code_808411C.s index 385dd10..cf6bc94 100644 --- a/asm/code_808411C.s +++ b/asm/code_808411C.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8084160.s b/asm/code_8084160.s index 54f31d7..fce2f1b 100644 --- a/asm/code_8084160.s +++ b/asm/code_8084160.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_80848F0.s b/asm/code_80848F0.s index 189480c..3b54680 100644 --- a/asm/code_80848F0.s +++ b/asm/code_80848F0.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8085B0C.s b/asm/code_8085B0C.s index 0080472..fa3b3f5 100644 --- a/asm/code_8085B0C.s +++ b/asm/code_8085B0C.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_80869E4.s b/asm/code_80869E4.s index 0d39418..2083a2e 100644 --- a/asm/code_80869E4.s +++ b/asm/code_80869E4.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8086A3C.s b/asm/code_8086A3C.s index d0cd7dc..0d2aead 100644 --- a/asm/code_8086A3C.s +++ b/asm/code_8086A3C.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_809017C.s b/asm/code_809017C.s index 3ef1c2c..fefed28 100644 --- a/asm/code_809017C.s +++ b/asm/code_809017C.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8090208.s b/asm/code_8090208.s index 463cffa..81ff2ec 100644 --- a/asm/code_8090208.s +++ b/asm/code_8090208.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8094148.s b/asm/code_8094148.s index 8a2e077..d894e66 100644 --- a/asm/code_8094148.s +++ b/asm/code_8094148.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8094D28.s b/asm/code_8094D28.s index 10991a1..81210da 100644 --- a/asm/code_8094D28.s +++ b/asm/code_8094D28.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8095014.s b/asm/code_8095014.s index bd88144..228811d 100644 --- a/asm/code_8095014.s +++ b/asm/code_8095014.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_80958E8.s b/asm/code_80958E8.s index b8d3c7a..b73e519 100644 --- a/asm/code_80958E8.s +++ b/asm/code_80958E8.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_809747C.s b/asm/code_809747C.s index 5c2e04f..05ec4f8 100644 --- a/asm/code_809747C.s +++ b/asm/code_809747C.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8097670.s b/asm/code_8097670.s index 0039819..c4d68ec 100644 --- a/asm/code_8097670.s +++ b/asm/code_8097670.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_80983D8.s b/asm/code_80983D8.s index aed2fc9..31cc100 100644 --- a/asm/code_80983D8.s +++ b/asm/code_80983D8.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8098468.s b/asm/code_8098468.s index 1f46809..62154f7 100644 --- a/asm/code_8098468.s +++ b/asm/code_8098468.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8098BDC.s b/asm/code_8098BDC.s index ce93c0d..32f6f5d 100644 --- a/asm/code_8098BDC.s +++ b/asm/code_8098BDC.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_809D148.s b/asm/code_809D148.s index c3a3f96..aa255fb 100644 --- a/asm/code_809D148.s +++ b/asm/code_809D148.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_80A26CC.s b/asm/code_80A26CC.s index c7d5fd0..63543ff 100644 --- a/asm/code_80A26CC.s +++ b/asm/code_80A26CC.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/code_8272724.s b/asm/code_8272724.s index b2cad11..b1dd9d4 100644 --- a/asm/code_8272724.s +++ b/asm/code_8272724.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/credits.s b/asm/credits.s index e4ae06b..b95d3dc 100644 --- a/asm/credits.s +++ b/asm/credits.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/crt0.s b/asm/crt0.s index fe1f127..ac6b515 100644 --- a/asm/crt0.s +++ b/asm/crt0.s @@ -1,4 +1,4 @@ - .include "constants/gba_constants.inc" + #include "asm/constants/gba_constants.inc" .syntax unified @@ -11,7 +11,7 @@ Start: @ 8000000 b Init - .include "asm/rom_header.inc" + #include "rom_header.inc" .arm .align 2, 0 diff --git a/asm/debug_menu.s b/asm/debug_menu.s index 1a1454a..794249f 100644 --- a/asm/debug_menu.s +++ b/asm/debug_menu.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/debug_menu_1.s b/asm/debug_menu_1.s index 08a2888..82f7163 100644 --- a/asm/debug_menu_1.s +++ b/asm/debug_menu_1.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/debug_menu_2.s b/asm/debug_menu_2.s index 1cd5fab..19719a6 100644 --- a/asm/debug_menu_2.s +++ b/asm/debug_menu_2.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/event_flag.s b/asm/event_flag.s index 6777a5b..0623be2 100644 --- a/asm/event_flag.s +++ b/asm/event_flag.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/exclusive_pokemon.s b/asm/exclusive_pokemon.s index 79cd1ff..71152bc 100644 --- a/asm/exclusive_pokemon.s +++ b/asm/exclusive_pokemon.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/felicity_bank.s b/asm/felicity_bank.s index 7711bc9..410f394 100644 --- a/asm/felicity_bank.s +++ b/asm/felicity_bank.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/friend_area_1.s b/asm/friend_area_1.s index b6fe42d..0a16b66 100644 --- a/asm/friend_area_1.s +++ b/asm/friend_area_1.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/friend_area_action_menu.s b/asm/friend_area_action_menu.s index 15b6f88..75d3dd2 100644 --- a/asm/friend_area_action_menu.s +++ b/asm/friend_area_action_menu.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/friend_list_menu.s b/asm/friend_list_menu.s index 391bd3f..98a68a4 100644 --- a/asm/friend_list_menu.s +++ b/asm/friend_list_menu.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/friend_rescue.s b/asm/friend_rescue.s index ef88261..241bbf6 100644 --- a/asm/friend_rescue.s +++ b/asm/friend_rescue.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/ground_effect.s b/asm/ground_effect.s index 8591bbc..3610df8 100644 --- a/asm/ground_effect.s +++ b/asm/ground_effect.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/ground_event.s b/asm/ground_event.s index 871ec68..ba241ec 100644 --- a/asm/ground_event.s +++ b/asm/ground_event.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/ground_link.s b/asm/ground_link.s index 4e8b43b..16e8578 100644 --- a/asm/ground_link.s +++ b/asm/ground_link.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/ground_lives.s b/asm/ground_lives.s index 2c1819b..c85d536 100644 --- a/asm/ground_lives.s +++ b/asm/ground_lives.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/ground_map.s b/asm/ground_map.s index 43ad583..204fda8 100644 --- a/asm/ground_map.s +++ b/asm/ground_map.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/ground_object.s b/asm/ground_object.s index 6425371..71f46eb 100644 --- a/asm/ground_object.s +++ b/asm/ground_object.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/ground_script.s b/asm/ground_script.s index 0bc3285..3a8bf35 100644 --- a/asm/ground_script.s +++ b/asm/ground_script.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/ground_sprite.s b/asm/ground_sprite.s index aa23ef4..1a0d2ac 100644 --- a/asm/ground_sprite.s +++ b/asm/ground_sprite.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/gulpin_shop.s b/asm/gulpin_shop.s index 6482a8a..a8f910d 100644 --- a/asm/gulpin_shop.s +++ b/asm/gulpin_shop.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/jirachi_wish.s b/asm/jirachi_wish.s index f641862..9055379 100644 --- a/asm/jirachi_wish.s +++ b/asm/jirachi_wish.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/kangaskhan_storage.s b/asm/kangaskhan_storage.s index 65f009a..c1cac72 100644 --- a/asm/kangaskhan_storage.s +++ b/asm/kangaskhan_storage.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/kangaskhan_storage_1.s b/asm/kangaskhan_storage_1.s index 4652c29..9890fe4 100644 --- a/asm/kangaskhan_storage_1.s +++ b/asm/kangaskhan_storage_1.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/kangaskhan_storage_2.s b/asm/kangaskhan_storage_2.s index ec64f19..98fc275 100644 --- a/asm/kangaskhan_storage_2.s +++ b/asm/kangaskhan_storage_2.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/kecleon_items.s b/asm/kecleon_items.s index 90bf697..87f2bdd 100644 --- a/asm/kecleon_items.s +++ b/asm/kecleon_items.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/kecleon_items_1.s b/asm/kecleon_items_1.s index 1b20264..e892e48 100644 --- a/asm/kecleon_items_1.s +++ b/asm/kecleon_items_1.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/m4a_1.s b/asm/m4a_1.s index 8c1d78a..b6fe6f9 100644 --- a/asm/m4a_1.s +++ b/asm/m4a_1.s @@ -1,6 +1,6 @@ - .include "asm/macros.inc" - .include "constants/gba_constants.inc" - .include "constants/m4a_constants.inc" + #include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/constants/m4a_constants.inc" .syntax unified diff --git a/asm/macros.inc b/asm/macros.inc deleted file mode 100644 index d821836..0000000 --- a/asm/macros.inc +++ /dev/null @@ -1,3 +0,0 @@ - .include "asm/macros/function.inc" - .include "asm/macros/music_voice.inc" - .include "asm/macros/script.inc" diff --git a/asm/macros/function.inc b/asm/macros/function.inc deleted file mode 100644 index 67fb373..0000000 --- a/asm/macros/function.inc +++ /dev/null @@ -1,29 +0,0 @@ - .macro arm_func_start name - .align 2, 0 - .global \name - .arm - .type \name, function - .endm - - .macro arm_func_end name - .size \name, .-\name - .endm - - .macro thumb_func_start name - .align 2, 0 - .global \name - .thumb - .thumb_func - .type \name, function - .endm - - .macro non_word_aligned_thumb_func_start name - .global \name - .thumb - .thumb_func - .type \name, function - .endm - - .macro thumb_func_end name - .size \name, .-\name - .endm diff --git a/asm/macros/music_voice.inc b/asm/macros/music_voice.inc deleted file mode 100644 index 7dd6c74..0000000 --- a/asm/macros/music_voice.inc +++ /dev/null @@ -1,140 +0,0 @@ - .macro voice_directsound base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req - .byte 0 - _voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release - .endm - - .macro voice_directsound_no_resample base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req - .byte 8 - _voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release - .endm - - .macro voice_directsound_alt base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req - .byte 16 - _voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release - .endm - - .macro _voice_directsound base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req - .byte \base_midi_key - .byte 0 - .if \pan != 0 - .byte (0x80 | \pan) - .else - .byte 0 - .endif - .4byte \sample_data_pointer - .byte \attack - .byte \decay - .byte \sustain - .byte \release - .endm - - .macro voice_square_1 base_midi_key:req, pan:req, sweep:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req - _voice_square_1 1, \base_midi_key, \pan, \sweep, \duty_cycle, \attack, \decay, \sustain, \release - .endm - - .macro voice_square_1_alt base_midi_key:req, pan:req, sweep:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req - _voice_square_1 9, \base_midi_key, \pan, \sweep, \duty_cycle, \attack, \decay, \sustain, \release - .endm - - .macro _voice_square_1 type:req, base_midi_key:req, pan:req, sweep:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req - .byte \type - .byte \base_midi_key - .if \pan != 0 - .byte (0x80 | \pan) - .else - .byte 0 - .endif - .byte \sweep - .byte (\duty_cycle & 0x3) - .byte 0, 0, 0 - .byte (\attack & 0x7) - .byte (\decay & 0x7) - .byte (\sustain & 0xF) - .byte (\release & 0x7) - .endm - - .macro voice_square_2 base_midi_key:req, pan:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req - _voice_square_2 2, \base_midi_key, \pan, \duty_cycle, \attack, \decay, \sustain, \release - .endm - - .macro voice_square_2_alt base_midi_key:req, pan:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req - _voice_square_2 10, \base_midi_key, \pan, \duty_cycle, \attack, \decay, \sustain, \release - .endm - - .macro _voice_square_2 type:req, base_midi_key:req, pan:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req - .byte \type - .byte \base_midi_key - .if \pan != 0 - .byte (0x80 | \pan) - .else - .byte 0 - .endif - .byte 0 - .byte (\duty_cycle & 0x3) - .byte 0, 0, 0 - .byte (\attack & 0x7) - .byte (\decay & 0x7) - .byte (\sustain & 0xF) - .byte (\release & 0x7) - .endm - - .macro voice_programmable_wave base_midi_key:req, pan:req, wave_samples_pointer:req, attack:req, decay:req, sustain:req, release:req - _voice_programmable_wave 3, \base_midi_key, \pan, \wave_samples_pointer, \attack, \decay, \sustain, \release - .endm - - .macro voice_programmable_wave_alt base_midi_key:req, pan:req, wave_samples_pointer:req, attack:req, decay:req, sustain:req, release:req - _voice_programmable_wave 11, \base_midi_key, \pan, \wave_samples_pointer, \attack, \decay, \sustain, \release - .endm - - .macro _voice_programmable_wave type:req, base_midi_key:req, pan:req, wave_samples_pointer:req, attack:req, decay:req, sustain:req, release:req - .byte \type - .byte \base_midi_key - .if \pan != 0 - .byte (0x80 | \pan) - .else - .byte 0 - .endif - .byte 0 - .4byte \wave_samples_pointer - .byte (\attack & 0x7) - .byte (\decay & 0x7) - .byte (\sustain & 0xF) - .byte (\release & 0x7) - .endm - - .macro voice_noise base_midi_key:req, pan:req, period:req, attack:req, decay:req, sustain:req, release:req - _voice_noise 4, \base_midi_key, \pan, \period, \attack, \decay, \sustain, \release - .endm - - .macro voice_noise_alt base_midi_key:req, pan:req, period:req, attack:req, decay:req, sustain:req, release:req - _voice_noise 12, \base_midi_key, \pan, \period, \attack, \decay, \sustain, \release - .endm - - .macro _voice_noise type:req, base_midi_key:req, pan:req, period:req, attack:req, decay:req, sustain:req, release:req - .byte \type - .byte \base_midi_key - .if \pan != 0 - .byte (0x80 | \pan) - .else - .byte 0 - .endif - .byte 0 - .byte (\period & 0x1) - .byte 0, 0, 0 - .byte (\attack & 0x7) - .byte (\decay & 0x7) - .byte (\sustain & 0xF) - .byte (\release & 0x7) - .endm - - .macro voice_keysplit voice_group_pointer:req, keysplit_table_pointer:req - .byte 0x40, 0, 0, 0 - .4byte \voice_group_pointer - .4byte \keysplit_table_pointer - .endm - - .macro voice_keysplit_all voice_group_pointer:req - .byte 0x80, 0, 0, 0 - .4byte \voice_group_pointer - .4byte 0 - .endm diff --git a/asm/macros/script.inc b/asm/macros/script.inc deleted file mode 100644 index 8ef4bd8..0000000 --- a/asm/macros/script.inc +++ /dev/null @@ -1,415 +0,0 @@ -.macro warpLocation id:req - .byte 0x01 - .byte 0x00 - .2byte \id - .4byte 0x00, 0x00, 0x00 -.endm - -.macro warpDungeon id:req - .byte 0x02 - .byte 0x00 - .2byte \id - .4byte 0x00, 0x00, 0x00 -.endm - -.macro warpFriendArea time:req - .byte 0x02 - .byte 0x00 - .2byte \time - .4byte 0x00, 0x00, 0x00 -.endm - -.macro ConfirmDungeonRules - .byte 0x05 - .4byte 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00 -.endm - -.macro changeTileset id:req - .byte 0x08, 0x00, 0x00, 0x00 - .2byte \id - .4byte 0x00, 0x00 - .2byte 0x00 -.endm - -@ Start Scene? Run Call? -.macro StartSceneRunCall id:req - .byte 0x0C - .byte \id - .byte 0xFF, 0xFF - .4byte 0x00, 0x00, 0x00 -.endm - -.macro RunCall id:req - .byte 0x0D - .byte \id - .byte 0xFF, 0xFF - .4byte 0x00, 0x00, 0x00 -.endm - -.macro triggerCutscene id:req - .byte 0x1B - .byte 0x00 - .2byte \id - .4byte 0x00, 0x00, 0x00 -.endm - -.macro fadeOut arg0:req time:req arg2:req - .byte 0x23 - .byte \arg0 - .2byte \time - .4byte \arg2 - .4byte 0x00, 0x00 -.endm - -.macro fadeColorOut arg0:req arg1:req time:req color:req - .byte 0x27 - .byte \arg0 - .2byte \arg1 - .4byte \time - .4byte \color - .4byte 0x00 -.endm - -.macro fadeColorIn arg0:req arg1:req time:req color:req - .byte 0x28 - .byte \arg0 - .2byte \arg1 - .4byte \time - .4byte \color - .4byte 0x00 -.endm - -.macro loadData type:req charac:req source:req - .byte 0x2D - .byte \type - .2byte \charac - .2byte \source - .4byte 0x00, 0x00 - .2byte 0x00 -.endm - -@ Face Locations -.set bottomL, 0x2 -.set bottomR, 0x3 -.set insetTopL, 0xE -.set insetTopR, 0xF - -.set previousLoc, 0x15 - -.macro selectFace loc:req charac:req face:req - .byte 0x2E - .byte \loc - .2byte \charac - .4byte \face - .4byte 0x00, 0x00 -.endm - -.macro closeTextBox - .byte 0x30 - .4byte 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00 -.endm - -.macro scrollTextBox character:req textPtr:req - .byte 0x33, 0x00 - .2byte \character - .4byte 0x00, 0x00 - .4byte \textPtr -.endm - -.macro PicNameTextBox character:req textPtr:req - .byte 0x34, 0x00 - .2byte \character - .4byte 0x00, 0x00 - .4byte \textPtr -.endm - -.macro quickCloseTextBox character:req textPtr:req - .byte 0x36, 0x00 - .2byte \character - .4byte 0x00, 0x00 - .4byte \textPtr -.endm - -@ Is it always 0xff, 0xff? -.macro floatingText textPtr:req - .byte 0x37, 0x00 - .byte 0xff, 0xff - .4byte 0x00, 0x00 - .4byte \textPtr -.endm - -.macro fadeFloatingText time:req textPtr:req - .byte 0x39, 0x00 - .2byte \time - .4byte 0x00, 0x00 - .4byte \textPtr -.endm - -.macro YesNoTextBox eventID:req character:req textPtr:req - .byte 0x3A, 0x00 - .2byte \eventID - .2byte \character - .2byte 0x00 - .4byte 0x00 - .4byte \textPtr -.endm - -.macro showName arg0:req - .byte 0x3B - .byte \arg0 - .2byte 0x00 - .4byte 0x00, 0x00, 0x00 -.endm - -@ TODO: 0x3C has a lot of different cases... - -.macro renamePoke id:req - .byte 0x3D, 0x00, 0x00, 0x00 - .byte \id, 0x00, 0x00, 0x00 - .4byte 0x00, 0x00 -.endm - -.macro renameTeam - .byte 0x3D, 0x00, 0x00, 0x00 - .4byte 0x00, 0x00, 0x00 -.endm - -.macro abruptStopMusic - .byte 0x42 - .4byte 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00 -.endm - -.macro fadeMusic time:req - .byte 0x43 - .byte 0x00 - .2byte \time - .4byte 0x00, 0x00, 0x00 -.endm - -.macro PlayMusic id:req - .byte 0x44 - .byte 0x00 - .2byte 0x0 - .2byte \id - .2byte 0x00 - .4byte 0x00, 0x00 -.endm - -.macro fadeInMusic id:req time:req - .byte 0x45, 0x00 - .2byte \id - .2byte \time - .4byte 0x00, 0x00 - .2byte 0x00 -.endm - -@ Also seen referred to as StopSng -.macro pushR14 - .byte 0x47 - .4byte 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00 -.endm - -.macro fadeMusicOut time:req - .byte 0x48 - .byte 0x00 - .2byte \time - .4byte 0x00, 0x00, 0x00 -.endm - -.macro playSound id:req - .byte 0x4C - .byte 0x00, 0x00, 0x00 - .2byte \id - .4byte 0x00, 0x00 - .2byte 0x00 -.endm - -.macro stopSound id:req - .byte 0x4D - .byte 0x00, 0x00, 0x00 - .2byte \id - .4byte 0x00, 0x00 - .2byte 0x00 -.endm - -.macro setAnimation anim:req - .byte 0x54 - .byte 0x00 - .2byte \anim - .4byte 0x00, 0x00, 0x00 -.endm - -.macro warpToLoc id:req - .byte 0x5B, 0x00 - .2byte 0x00 - .byte \id - .byte 0x00, 0x00, 0x00 - .4byte 0x00, 0x00 -.endm - -@ move to prefined location along grid -.macro gridMoveTo speed:req id:req - .byte 0x6B, 0x00 - .2byte \speed - .byte \id - .4byte 0x00, 0x00 - .byte 0x00, 0x00, 0x00 -.endm - -.macro changeSpriteZ speed:req targetHeight:req - .byte 0x70, 0x00 - .byte \speed - .3byte \targetHeight - .4byte 0x00, 0x00 - .2byte 0x00 -.endm - -@ Rotation Directions -.set CW, 1 -.set CCW, 2 -.set shortestDir, 0xA - -@ Cardinal Directions / Facing Directions -.set south, 0 -.set southeast, 1 -.set east, 2 -.set northeast, 3 -.set north, 4 -.set northwest, 5 -.set west, 6 -.set southwest, 7 - -.macro setFaceDir delay:req faceDir:req - .byte 0x8B - .byte \delay - .byte \faceDir - .byte 0x00 - .4byte 0x00, 0x00, 0x00 -.endm - -.macro rotate time:req rotDir:req faceDir:req - .byte 0x91 - .byte \time - .byte \rotDir - .byte 0x00 - .byte \faceDir - .byte 0x00 - .4byte 0x00, 0x00 - .2byte 0x00 -.endm - -.macro initVariableTextBox arg0:req arg1:req speaker:req - .byte 0xCF - .byte \arg0 - .byte \arg1 - .byte 0x00 - .4byte \speaker - .4byte 0x00, 0x00 -.endm - -.macro variableTextBox version:req textPtr:req - .byte 0xD0, 0x00 - .2byte \version - .4byte 0x00, 0x00 - .4byte \textPtr -.endm - -.macro elseTextBox textPtr:req - .byte 0xD1, 0x00 - .4byte 0x00, 0x00 - .byte 0x00, 0x00 - .4byte \textPtr -.endm - -.macro pause time:req - .byte 0xDB - .byte 0x00 - .2byte \time - .4byte 0x00, 0x00, 0x00 -.endm - -@ Wait for sound to finish playing? -.macro waitSound id:req - .byte 0xE2 - .byte 0x00 - .2byte \id - .4byte 0x00, 0x00, 0x00 -.endm - -.macro waitFlag flagnum:req - .byte 0xE3 - .byte 0x00 - .2byte \flagnum - .4byte 0x00, 0x00, 0x00 -.endm - -.macro setFlag flagnum:req - .byte 0xE4 - .byte 0x00 - .2byte \flagnum - .4byte 0x00, 0x00, 0x00 -.endm - -.macro goTo id:req - .byte 0xE5 - .byte 0x00 - .byte \id - .byte 0x00 - .4byte 0x00, 0x00, 0x00 -.endm - -@ Loop at label until end of scene -.macro loopLabel id:req - .byte 0xE7, 0x00 - .byte \id, 0x00 - .4byte 0x00, 0x00, 0x00 -.endm - -.macro executeScript scriptNum:req - .byte 0xE8 - .byte 0x00 - .2byte \scriptNum - .4byte 0x00, 0x00, 0x00 -.endm - -.macro MsgEnd arg0:req - .byte 0xE9 - .byte 0x00 - .2byte \arg0 - .4byte 0x00, 0x00, 0x00 -.endm - -.macro endFuncContinueScript - .byte 0xEE - .4byte 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00 -.endm - -.macro endFuncandScript - .byte 0xEF - .4byte 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00 -.endm - -.macro closeThread - .byte 0xF0 - .4byte 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00 -.endm - -.macro closeThreadRemoveObject - .byte 0xF1 - .4byte 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00 -.endm - -@ Set label for loop -.macro label id:req - .byte 0xF4, 0x00 - .byte \id, 0x00 - .4byte 0x00, 0x00, 0x00 -.endm diff --git a/asm/mailbox.s b/asm/mailbox.s index f164a29..d99fbde 100644 --- a/asm/mailbox.s +++ b/asm/mailbox.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/makuhita_dojo.s b/asm/makuhita_dojo.s index ef01d6d..f43f21f 100644 --- a/asm/makuhita_dojo.s +++ b/asm/makuhita_dojo.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/memory.s b/asm/memory.s index e856585..8fd07a2 100644 --- a/asm/memory.s +++ b/asm/memory.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/memory_1.s b/asm/memory_1.s index 97833ca..7896523 100644 --- a/asm/memory_1.s +++ b/asm/memory_1.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/moves_1.s b/asm/moves_1.s index c9f1ce8..969c450 100644 --- a/asm/moves_1.s +++ b/asm/moves_1.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/music.s b/asm/music.s index 4d617a6..c617794 100644 --- a/asm/music.s +++ b/asm/music.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/other_menus.s b/asm/other_menus.s index 676ba9a..9fe889d 100644 --- a/asm/other_menus.s +++ b/asm/other_menus.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/pelipper_board.s b/asm/pelipper_board.s index 20119ed..3ab0db1 100644 --- a/asm/pelipper_board.s +++ b/asm/pelipper_board.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/pokemon.s b/asm/pokemon.s index 3682c14..105c4ed 100644 --- a/asm/pokemon.s +++ b/asm/pokemon.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/pokemon_2.s b/asm/pokemon_2.s index dec099a..2ffbf37 100644 --- a/asm/pokemon_2.s +++ b/asm/pokemon_2.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/pokemon_3.s b/asm/pokemon_3.s index fc29dfb..43173ec 100644 --- a/asm/pokemon_3.s +++ b/asm/pokemon_3.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/rescue_password_menu.s b/asm/rescue_password_menu.s index 44675db..99e1211 100644 --- a/asm/rescue_password_menu.s +++ b/asm/rescue_password_menu.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/sprite.s b/asm/sprite.s index 284526c..2714e7e 100644 --- a/asm/sprite.s +++ b/asm/sprite.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/text.s b/asm/text.s index 404a250..2afc507 100644 --- a/asm/text.s +++ b/asm/text.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/unk_menu_203B360.s b/asm/unk_menu_203B360.s index 5ac6b47..d2962a7 100644 --- a/asm/unk_menu_203B360.s +++ b/asm/unk_menu_203B360.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/unk_menu_203B364.s b/asm/unk_menu_203B364.s index 40e9de2..d0a2b6e 100644 --- a/asm/unk_menu_203B364.s +++ b/asm/unk_menu_203B364.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/wonder_mail_2.s b/asm/wonder_mail_2.s index dd6f99f..383a1c6 100644 --- a/asm/wonder_mail_2.s +++ b/asm/wonder_mail_2.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/wonder_mail_3.s b/asm/wonder_mail_3.s index 2423107..043c1e7 100644 --- a/asm/wonder_mail_3.s +++ b/asm/wonder_mail_3.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/wonder_mail_3_mid.s b/asm/wonder_mail_3_mid.s index 4aa1e3b..90c0c25 100644 --- a/asm/wonder_mail_3_mid.s +++ b/asm/wonder_mail_3_mid.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/wonder_mail_4.s b/asm/wonder_mail_4.s index ea27a3f..8103af1 100644 --- a/asm/wonder_mail_4.s +++ b/asm/wonder_mail_4.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/asm/wonder_mail_5.s b/asm/wonder_mail_5.s index cad53b3..e461b13 100644 --- a/asm/wonder_mail_5.s +++ b/asm/wonder_mail_5.s @@ -1,5 +1,5 @@ - .include "constants/gba_constants.inc" - .include "asm/macros.inc" + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" .syntax unified diff --git a/constants/gba_constants.inc b/constants/gba_constants.inc deleted file mode 100644 index 9d59c8f..0000000 --- a/constants/gba_constants.inc +++ /dev/null @@ -1,490 +0,0 @@ - .set PSR_USR_MODE, 0x00000010 - .set PSR_FIQ_MODE, 0x00000011 - .set PSR_IRQ_MODE, 0x00000012 - .set PSR_SVC_MODE, 0x00000013 - .set PSR_ABT_MODE, 0x00000017 - .set PSR_UND_MODE, 0x0000001b - .set PSR_SYS_MODE, 0x0000001f - .set PSR_MODE_MASK, 0x0000001f - .set PSR_T_BIT, 0x00000020 - .set PSR_F_BIT, 0x00000040 - .set PSR_I_BIT, 0x00000080 - - .set EWRAM_START, 0x02000000 - .set EWRAM_END, EWRAM_START + 0x40000 - .set IWRAM_START, 0x03000000 - .set IWRAM_END, IWRAM_START + 0x8000 - - .set PLTT, 0x5000000 - .set BG_PLTT, PLTT - .set OBJ_PLTT, PLTT + 0x200 - - .set VRAM, 0x6000000 - .set BG_VRAM, VRAM - .set OBJ_VRAM0, VRAM + 0x10000 @ text-mode BG - .set OBJ_VRAM1, VRAM + 0x14000 @ bitmap-mode BG - - .set OAM, 0x7000000 - - .set SOUND_INFO_PTR, 0x3007FF0 - .set INTR_CHECK, 0x3007FF8 - .set INTR_VECTOR, 0x3007FFC - - .set INTR_FLAG_VBLANK, 1 << 0 - .set INTR_FLAG_HBLANK, 1 << 1 - .set INTR_FLAG_VCOUNT, 1 << 2 - .set INTR_FLAG_TIMER0, 1 << 3 - .set INTR_FLAG_TIMER1, 1 << 4 - .set INTR_FLAG_TIMER2, 1 << 5 - .set INTR_FLAG_TIMER3, 1 << 6 - .set INTR_FLAG_SERIAL, 1 << 7 - .set INTR_FLAG_DMA0, 1 << 8 - .set INTR_FLAG_DMA1, 1 << 9 - .set INTR_FLAG_DMA2, 1 << 10 - .set INTR_FLAG_DMA3, 1 << 11 - .set INTR_FLAG_KEYPAD, 1 << 12 - .set INTR_FLAG_GAMEPAK, 1 << 13 - - .set VCOUNT_VBLANK, 160 - .set TOTAL_SCANLINES, 228 - - .set REG_BASE, 0x4000000 @ I/O register base address - -@ I/O register offsets - .set OFFSET_REG_DISPCNT, 0x0 - .set OFFSET_REG_DISPSTAT, 0x4 - .set OFFSET_REG_VCOUNT, 0x6 - .set OFFSET_REG_BG0CNT, 0x8 - .set OFFSET_REG_BG1CNT, 0xa - .set OFFSET_REG_BG2CNT, 0xc - .set OFFSET_REG_BG3CNT, 0xe - .set OFFSET_REG_BG0HOFS, 0x10 - .set OFFSET_REG_BG0VOFS, 0x12 - .set OFFSET_REG_BG1HOFS, 0x14 - .set OFFSET_REG_BG1VOFS, 0x16 - .set OFFSET_REG_BG2HOFS, 0x18 - .set OFFSET_REG_BG2VOFS, 0x1a - .set OFFSET_REG_BG3HOFS, 0x1c - .set OFFSET_REG_BG3VOFS, 0x1e - .set OFFSET_REG_BG2PA, 0x20 - .set OFFSET_REG_BG2PB, 0x22 - .set OFFSET_REG_BG2PC, 0x24 - .set OFFSET_REG_BG2PD, 0x26 - .set OFFSET_REG_BG2X_L, 0x28 - .set OFFSET_REG_BG2X_H, 0x2a - .set OFFSET_REG_BG2Y_L, 0x2c - .set OFFSET_REG_BG2Y_H, 0x2e - .set OFFSET_REG_BG3PA, 0x30 - .set OFFSET_REG_BG3PB, 0x32 - .set OFFSET_REG_BG3PC, 0x34 - .set OFFSET_REG_BG3PD, 0x36 - .set OFFSET_REG_BG3X_L, 0x38 - .set OFFSET_REG_BG3X_H, 0x3a - .set OFFSET_REG_BG3Y_L, 0x3c - .set OFFSET_REG_BG3Y_H, 0x3e - .set OFFSET_REG_WIN0H, 0x40 - .set OFFSET_REG_WIN1H, 0x42 - .set OFFSET_REG_WIN0V, 0x44 - .set OFFSET_REG_WIN1V, 0x46 - .set OFFSET_REG_WININ, 0x48 - .set OFFSET_REG_WINOUT, 0x4a - .set OFFSET_REG_MOSAIC, 0x4c - .set OFFSET_REG_BLDCNT, 0x50 - .set OFFSET_REG_BLDALPHA, 0x52 - .set OFFSET_REG_BLDY, 0x54 - - .set OFFSET_REG_SOUND1CNT, 0x60 - .set OFFSET_REG_SOUND1CNT_L, 0x60 - .set OFFSET_REG_NR10, 0x60 - .set OFFSET_REG_SOUND1CNT_H, 0x62 - .set OFFSET_REG_NR11, 0x62 - .set OFFSET_REG_NR12, 0x63 - .set OFFSET_REG_SOUND1CNT_X, 0x64 - .set OFFSET_REG_NR13, 0x64 - .set OFFSET_REG_NR14, 0x65 - .set OFFSET_REG_SOUND2CNT, 0x68 - .set OFFSET_REG_SOUND2CNT_L, 0x68 - .set OFFSET_REG_NR21, 0x68 - .set OFFSET_REG_NR22, 0x69 - .set OFFSET_REG_SOUND2CNT_H, 0x6c - .set OFFSET_REG_NR23, 0x6c - .set OFFSET_REG_NR24, 0x6d - .set OFFSET_REG_SOUND3CNT, 0x70 - .set OFFSET_REG_SOUND3CNT_L, 0x70 - .set OFFSET_REG_NR30, 0x70 - .set OFFSET_REG_SOUND3CNT_H, 0x72 - .set OFFSET_REG_NR31, 0x72 - .set OFFSET_REG_NR32, 0x73 - .set OFFSET_REG_SOUND3CNT_X, 0x74 - .set OFFSET_REG_NR33, 0x74 - .set OFFSET_REG_NR34, 0x75 - .set OFFSET_REG_SOUND4CNT, 0x78 - .set OFFSET_REG_SOUND4CNT_L, 0x78 - .set OFFSET_REG_NR41, 0x78 - .set OFFSET_REG_NR42, 0x79 - .set OFFSET_REG_SOUND4CNT_H, 0x7c - .set OFFSET_REG_NR43, 0x7c - .set OFFSET_REG_NR44, 0x7d - .set OFFSET_REG_SOUNDCNT, 0x80 - .set OFFSET_REG_SOUNDCNT_L, 0x80 - .set OFFSET_REG_NR50, 0x80 - .set OFFSET_REG_NR51, 0x81 - .set OFFSET_REG_SOUNDCNT_H, 0x82 - .set OFFSET_REG_SOUNDCNT_X, 0x84 - .set OFFSET_REG_NR52, 0x84 - .set OFFSET_REG_SOUNDBIAS, 0x88 - .set OFFSET_REG_WAVE_RAM, 0x90 - .set OFFSET_REG_WAVE_RAM0, 0x90 - .set OFFSET_REG_WAVE_RAM0_L, 0x90 - .set OFFSET_REG_WAVE_RAM0_H, 0x92 - .set OFFSET_REG_WAVE_RAM1, 0x94 - .set OFFSET_REG_WAVE_RAM1_L, 0x94 - .set OFFSET_REG_WAVE_RAM1_H, 0x96 - .set OFFSET_REG_WAVE_RAM2, 0x98 - .set OFFSET_REG_WAVE_RAM2_L, 0x98 - .set OFFSET_REG_WAVE_RAM2_H, 0x9a - .set OFFSET_REG_WAVE_RAM3, 0x9c - .set OFFSET_REG_WAVE_RAM3_L, 0x9c - .set OFFSET_REG_WAVE_RAM3_H, 0x9e - .set OFFSET_REG_FIFO, 0xa0 - .set OFFSET_REG_FIFO_A, 0xa0 - .set OFFSET_REG_FIFO_A_L, 0xa0 - .set OFFSET_REG_FIFO_A_H, 0xa2 - .set OFFSET_REG_FIFO_B, 0xa4 - .set OFFSET_REG_FIFO_B_L, 0xa4 - .set OFFSET_REG_FIFO_B_H, 0xa6 - - .set OFFSET_REG_DMA0, 0xb0 - .set OFFSET_REG_DMA0SAD, 0xb0 - .set OFFSET_REG_DMA0SAD_L, 0xb0 - .set OFFSET_REG_DMA0SAD_H, 0xb2 - .set OFFSET_REG_DMA0DAD, 0xb4 - .set OFFSET_REG_DMA0DAD_L, 0xb4 - .set OFFSET_REG_DMA0DAD_H, 0xb6 - .set OFFSET_REG_DMA0CNT, 0xb8 - .set OFFSET_REG_DMA0CNT_L, 0xb8 - .set OFFSET_REG_DMA0CNT_H, 0xba - .set OFFSET_REG_DMA1, 0xbc - .set OFFSET_REG_DMA1SAD, 0xbc - .set OFFSET_REG_DMA1SAD_L, 0xbc - .set OFFSET_REG_DMA1SAD_H, 0xbe - .set OFFSET_REG_DMA1DAD, 0xc0 - .set OFFSET_REG_DMA1DAD_L, 0xc0 - .set OFFSET_REG_DMA1DAD_H, 0xc2 - .set OFFSET_REG_DMA1CNT, 0xc4 - .set OFFSET_REG_DMA1CNT_L, 0xc4 - .set OFFSET_REG_DMA1CNT_H, 0xc6 - .set OFFSET_REG_DMA2, 0xc8 - .set OFFSET_REG_DMA2SAD, 0xc8 - .set OFFSET_REG_DMA2SAD_L, 0xc8 - .set OFFSET_REG_DMA2SAD_H, 0xca - .set OFFSET_REG_DMA2DAD, 0xcc - .set OFFSET_REG_DMA2DAD_L, 0xcc - .set OFFSET_REG_DMA2DAD_H, 0xce - .set OFFSET_REG_DMA2CNT, 0xd0 - .set OFFSET_REG_DMA2CNT_L, 0xd0 - .set OFFSET_REG_DMA2CNT_H, 0xd2 - .set OFFSET_REG_DMA3, 0xd4 - .set OFFSET_REG_DMA3SAD, 0xd4 - .set OFFSET_REG_DMA3SAD_L, 0xd4 - .set OFFSET_REG_DMA3SAD_H, 0xd6 - .set OFFSET_REG_DMA3DAD, 0xd8 - .set OFFSET_REG_DMA3DAD_L, 0xd8 - .set OFFSET_REG_DMA3DAD_H, 0xda - .set OFFSET_REG_DMA3CNT, 0xdc - .set OFFSET_REG_DMA3CNT_L, 0xdc - .set OFFSET_REG_DMA3CNT_H, 0xde - - .set OFFSET_REG_TM0CNT, 0x100 - .set OFFSET_REG_TM0CNT_L, 0x100 - .set OFFSET_REG_TM0CNT_H, 0x102 - .set OFFSET_REG_TM1CNT, 0x104 - .set OFFSET_REG_TM1CNT_L, 0x104 - .set OFFSET_REG_TM1CNT_H, 0x106 - .set OFFSET_REG_TM2CNT, 0x108 - .set OFFSET_REG_TM2CNT_L, 0x108 - .set OFFSET_REG_TM2CNT_H, 0x10a - .set OFFSET_REG_TM3CNT, 0x10c - .set OFFSET_REG_TM3CNT_L, 0x10c - .set OFFSET_REG_TM3CNT_H, 0x10e - - .set OFFSET_REG_SIOCNT, 0x128 - .set OFFSET_REG_SIODATA8, 0x12a - .set OFFSET_REG_SIODATA32, 0x120 - .set OFFSET_REG_SIOMLT_SEND, 0x12a - .set OFFSET_REG_SIOMLT_RECV, 0x120 - .set OFFSET_REG_SIOMULTI0, 0x120 - .set OFFSET_REG_SIOMULTI1, 0x122 - .set OFFSET_REG_SIOMULTI2, 0x124 - .set OFFSET_REG_SIOMULTI3, 0x126 - - .set OFFSET_REG_KEYINPUT, 0x130 - .set OFFSET_REG_KEYCNT, 0x132 - - .set OFFSET_REG_RCNT, 0x134 - - .set OFFSET_REG_JOYCNT, 0x140 - .set OFFSET_REG_JOYSTAT, 0x158 - .set OFFSET_REG_JOY_RECV, 0x150 - .set OFFSET_REG_JOY_RECV_L, 0x150 - .set OFFSET_REG_JOY_RECV_H, 0x152 - .set OFFSET_REG_JOY_TRANS, 0x154 - .set OFFSET_REG_JOY_TRANS_L, 0x154 - .set OFFSET_REG_JOY_TRANS_H, 0x156 - - .set OFFSET_REG_IME, 0x208 - .set OFFSET_REG_IE, 0x200 - .set OFFSET_REG_IF, 0x202 - - .set OFFSET_REG_WAITCNT, 0x204 - -@ I/O register addresses - .set REG_DISPCNT, REG_BASE + OFFSET_REG_DISPCNT - .set REG_DISPSTAT, REG_BASE + OFFSET_REG_DISPSTAT - .set REG_VCOUNT, REG_BASE + OFFSET_REG_VCOUNT - .set REG_BG0CNT, REG_BASE + OFFSET_REG_BG0CNT - .set REG_BG1CNT, REG_BASE + OFFSET_REG_BG1CNT - .set REG_BG2CNT, REG_BASE + OFFSET_REG_BG2CNT - .set REG_BG3CNT, REG_BASE + OFFSET_REG_BG3CNT - .set REG_BG0HOFS, REG_BASE + OFFSET_REG_BG0HOFS - .set REG_BG0VOFS, REG_BASE + OFFSET_REG_BG0VOFS - .set REG_BG1HOFS, REG_BASE + OFFSET_REG_BG1HOFS - .set REG_BG1VOFS, REG_BASE + OFFSET_REG_BG1VOFS - .set REG_BG2HOFS, REG_BASE + OFFSET_REG_BG2HOFS - .set REG_BG2VOFS, REG_BASE + OFFSET_REG_BG2VOFS - .set REG_BG3HOFS, REG_BASE + OFFSET_REG_BG3HOFS - .set REG_BG3VOFS, REG_BASE + OFFSET_REG_BG3VOFS - .set REG_BG2PA, REG_BASE + OFFSET_REG_BG2PA - .set REG_BG2PB, REG_BASE + OFFSET_REG_BG2PB - .set REG_BG2PC, REG_BASE + OFFSET_REG_BG2PC - .set REG_BG2PD, REG_BASE + OFFSET_REG_BG2PD - .set REG_BG2X_L, REG_BASE + OFFSET_REG_BG2X_L - .set REG_BG2X_H, REG_BASE + OFFSET_REG_BG2X_H - .set REG_BG2Y_L, REG_BASE + OFFSET_REG_BG2Y_L - .set REG_BG2Y_H, REG_BASE + OFFSET_REG_BG2Y_H - .set REG_BG3PA, REG_BASE + OFFSET_REG_BG3PA - .set REG_BG3PB, REG_BASE + OFFSET_REG_BG3PB - .set REG_BG3PC, REG_BASE + OFFSET_REG_BG3PC - .set REG_BG3PD, REG_BASE + OFFSET_REG_BG3PD - .set REG_BG3X_L, REG_BASE + OFFSET_REG_BG3X_L - .set REG_BG3X_H, REG_BASE + OFFSET_REG_BG3X_H - .set REG_BG3Y_L, REG_BASE + OFFSET_REG_BG3Y_L - .set REG_BG3Y_H, REG_BASE + OFFSET_REG_BG3Y_H - .set REG_WIN0H, REG_BASE + OFFSET_REG_WIN0H - .set REG_WIN1H, REG_BASE + OFFSET_REG_WIN1H - .set REG_WIN0V, REG_BASE + OFFSET_REG_WIN0V - .set REG_WIN1V, REG_BASE + OFFSET_REG_WIN1V - .set REG_WININ, REG_BASE + OFFSET_REG_WININ - .set REG_WINOUT, REG_BASE + OFFSET_REG_WINOUT - .set REG_MOSAIC, REG_BASE + OFFSET_REG_MOSAIC - .set REG_BLDCNT, REG_BASE + OFFSET_REG_BLDCNT - .set REG_BLDALPHA, REG_BASE + OFFSET_REG_BLDALPHA - .set REG_BLDY, REG_BASE + OFFSET_REG_BLDY - - .set REG_SOUND1CNT, REG_BASE + OFFSET_REG_SOUND1CNT - .set REG_SOUND1CNT_L, REG_BASE + OFFSET_REG_SOUND1CNT_L - .set REG_NR10, REG_BASE + OFFSET_REG_NR10 - .set REG_SOUND1CNT_H, REG_BASE + OFFSET_REG_SOUND1CNT_H - .set REG_NR11, REG_BASE + OFFSET_REG_NR11 - .set REG_NR12, REG_BASE + OFFSET_REG_NR12 - .set REG_SOUND1CNT_X, REG_BASE + OFFSET_REG_SOUND1CNT_X - .set REG_NR13, REG_BASE + OFFSET_REG_NR13 - .set REG_NR14, REG_BASE + OFFSET_REG_NR14 - .set REG_SOUND2CNT, REG_BASE + OFFSET_REG_SOUND2CNT - .set REG_SOUND2CNT_L, REG_BASE + OFFSET_REG_SOUND2CNT_L - .set REG_NR21, REG_BASE + OFFSET_REG_NR21 - .set REG_NR22, REG_BASE + OFFSET_REG_NR22 - .set REG_SOUND2CNT_H, REG_BASE + OFFSET_REG_SOUND2CNT_H - .set REG_NR23, REG_BASE + OFFSET_REG_NR23 - .set REG_NR24, REG_BASE + OFFSET_REG_NR24 - .set REG_SOUND3CNT, REG_BASE + OFFSET_REG_SOUND3CNT - .set REG_SOUND3CNT_L, REG_BASE + OFFSET_REG_SOUND3CNT_L - .set REG_NR30, REG_BASE + OFFSET_REG_NR30 - .set REG_SOUND3CNT_H, REG_BASE + OFFSET_REG_SOUND3CNT_H - .set REG_NR31, REG_BASE + OFFSET_REG_NR31 - .set REG_NR32, REG_BASE + OFFSET_REG_NR32 - .set REG_SOUND3CNT_X, REG_BASE + OFFSET_REG_SOUND3CNT_X - .set REG_NR33, REG_BASE + OFFSET_REG_NR33 - .set REG_NR34, REG_BASE + OFFSET_REG_NR34 - .set REG_SOUND4CNT, REG_BASE + OFFSET_REG_SOUND4CNT - .set REG_SOUND4CNT_L, REG_BASE + OFFSET_REG_SOUND4CNT_L - .set REG_NR41, REG_BASE + OFFSET_REG_NR41 - .set REG_NR42, REG_BASE + OFFSET_REG_NR42 - .set REG_SOUND4CNT_H, REG_BASE + OFFSET_REG_SOUND4CNT_H - .set REG_NR43, REG_BASE + OFFSET_REG_NR43 - .set REG_NR44, REG_BASE + OFFSET_REG_NR44 - .set REG_SOUNDCNT, REG_BASE + OFFSET_REG_SOUNDCNT - .set REG_SOUNDCNT_L, REG_BASE + OFFSET_REG_SOUNDCNT_L - .set REG_NR50, REG_BASE + OFFSET_REG_NR50 - .set REG_NR51, REG_BASE + OFFSET_REG_NR51 - .set REG_SOUNDCNT_H, REG_BASE + OFFSET_REG_SOUNDCNT_H - .set REG_SOUNDCNT_X, REG_BASE + OFFSET_REG_SOUNDCNT_X - .set REG_NR52, REG_BASE + OFFSET_REG_NR52 - .set REG_SOUNDBIAS, REG_BASE + OFFSET_REG_SOUNDBIAS - .set REG_WAVE_RAM, REG_BASE + OFFSET_REG_WAVE_RAM - .set REG_WAVE_RAM0, REG_BASE + OFFSET_REG_WAVE_RAM0 - .set REG_WAVE_RAM0_L, REG_BASE + OFFSET_REG_WAVE_RAM0_L - .set REG_WAVE_RAM0_H, REG_BASE + OFFSET_REG_WAVE_RAM0_H - .set REG_WAVE_RAM1, REG_BASE + OFFSET_REG_WAVE_RAM1 - .set REG_WAVE_RAM1_L, REG_BASE + OFFSET_REG_WAVE_RAM1_L - .set REG_WAVE_RAM1_H, REG_BASE + OFFSET_REG_WAVE_RAM1_H - .set REG_WAVE_RAM2, REG_BASE + OFFSET_REG_WAVE_RAM2 - .set REG_WAVE_RAM2_L, REG_BASE + OFFSET_REG_WAVE_RAM2_L - .set REG_WAVE_RAM2_H, REG_BASE + OFFSET_REG_WAVE_RAM2_H - .set REG_WAVE_RAM3, REG_BASE + OFFSET_REG_WAVE_RAM3 - .set REG_WAVE_RAM3_L, REG_BASE + OFFSET_REG_WAVE_RAM3_L - .set REG_WAVE_RAM3_H, REG_BASE + OFFSET_REG_WAVE_RAM3_H - .set REG_FIFO, REG_BASE + OFFSET_REG_FIFO - .set REG_FIFO_A, REG_BASE + OFFSET_REG_FIFO_A - .set REG_FIFO_A_L, REG_BASE + OFFSET_REG_FIFO_A_L - .set REG_FIFO_A_H, REG_BASE + OFFSET_REG_FIFO_A_H - .set REG_FIFO_B, REG_BASE + OFFSET_REG_FIFO_B - .set REG_FIFO_B_L, REG_BASE + OFFSET_REG_FIFO_B_L - .set REG_FIFO_B_H, REG_BASE + OFFSET_REG_FIFO_B_H - - .set REG_DMA0, REG_BASE + OFFSET_REG_DMA0 - .set REG_DMA0SAD, REG_BASE + OFFSET_REG_DMA0SAD - .set REG_DMA0SAD_L, REG_BASE + OFFSET_REG_DMA0SAD_L - .set REG_DMA0SAD_H, REG_BASE + OFFSET_REG_DMA0SAD_H - .set REG_DMA0DAD, REG_BASE + OFFSET_REG_DMA0DAD - .set REG_DMA0DAD_L, REG_BASE + OFFSET_REG_DMA0DAD_L - .set REG_DMA0DAD_H, REG_BASE + OFFSET_REG_DMA0DAD_H - .set REG_DMA0CNT, REG_BASE + OFFSET_REG_DMA0CNT - .set REG_DMA0CNT_L, REG_BASE + OFFSET_REG_DMA0CNT_L - .set REG_DMA0CNT_H, REG_BASE + OFFSET_REG_DMA0CNT_H - .set REG_DMA1, REG_BASE + OFFSET_REG_DMA1 - .set REG_DMA1SAD, REG_BASE + OFFSET_REG_DMA1SAD - .set REG_DMA1SAD_L, REG_BASE + OFFSET_REG_DMA1SAD_L - .set REG_DMA1SAD_H, REG_BASE + OFFSET_REG_DMA1SAD_H - .set REG_DMA1DAD, REG_BASE + OFFSET_REG_DMA1DAD - .set REG_DMA1DAD_L, REG_BASE + OFFSET_REG_DMA1DAD_L - .set REG_DMA1DAD_H, REG_BASE + OFFSET_REG_DMA1DAD_H - .set REG_DMA1CNT, REG_BASE + OFFSET_REG_DMA1CNT - .set REG_DMA1CNT_L, REG_BASE + OFFSET_REG_DMA1CNT_L - .set REG_DMA1CNT_H, REG_BASE + OFFSET_REG_DMA1CNT_H - .set REG_DMA2, REG_BASE + OFFSET_REG_DMA2 - .set REG_DMA2SAD, REG_BASE + OFFSET_REG_DMA2SAD - .set REG_DMA2SAD_L, REG_BASE + OFFSET_REG_DMA2SAD_L - .set REG_DMA2SAD_H, REG_BASE + OFFSET_REG_DMA2SAD_H - .set REG_DMA2DAD, REG_BASE + OFFSET_REG_DMA2DAD - .set REG_DMA2DAD_L, REG_BASE + OFFSET_REG_DMA2DAD_L - .set REG_DMA2DAD_H, REG_BASE + OFFSET_REG_DMA2DAD_H - .set REG_DMA2CNT, REG_BASE + OFFSET_REG_DMA2CNT - .set REG_DMA2CNT_L, REG_BASE + OFFSET_REG_DMA2CNT_L - .set REG_DMA2CNT_H, REG_BASE + OFFSET_REG_DMA2CNT_H - .set REG_DMA3, REG_BASE + OFFSET_REG_DMA3 - .set REG_DMA3SAD, REG_BASE + OFFSET_REG_DMA3SAD - .set REG_DMA3SAD_L, REG_BASE + OFFSET_REG_DMA3SAD_L - .set REG_DMA3SAD_H, REG_BASE + OFFSET_REG_DMA3SAD_H - .set REG_DMA3DAD, REG_BASE + OFFSET_REG_DMA3DAD - .set REG_DMA3DAD_L, REG_BASE + OFFSET_REG_DMA3DAD_L - .set REG_DMA3DAD_H, REG_BASE + OFFSET_REG_DMA3DAD_H - .set REG_DMA3CNT, REG_BASE + OFFSET_REG_DMA3CNT - .set REG_DMA3CNT_L, REG_BASE + OFFSET_REG_DMA3CNT_L - .set REG_DMA3CNT_H, REG_BASE + OFFSET_REG_DMA3CNT_H - - .set REG_TM0CNT, REG_BASE + OFFSET_REG_TM0CNT - .set REG_TM0CNT_L, REG_BASE + OFFSET_REG_TM0CNT_L - .set REG_TM0CNT_H, REG_BASE + OFFSET_REG_TM0CNT_H - .set REG_TM1CNT, REG_BASE + OFFSET_REG_TM1CNT - .set REG_TM1CNT_L, REG_BASE + OFFSET_REG_TM1CNT_L - .set REG_TM1CNT_H, REG_BASE + OFFSET_REG_TM1CNT_H - .set REG_TM2CNT, REG_BASE + OFFSET_REG_TM2CNT - .set REG_TM2CNT_L, REG_BASE + OFFSET_REG_TM2CNT_L - .set REG_TM2CNT_H, REG_BASE + OFFSET_REG_TM2CNT_H - .set REG_TM3CNT, REG_BASE + OFFSET_REG_TM3CNT - .set REG_TM3CNT_L, REG_BASE + OFFSET_REG_TM3CNT_L - .set REG_TM3CNT_H, REG_BASE + OFFSET_REG_TM3CNT_H - - .set REG_SIOCNT, REG_BASE + OFFSET_REG_SIOCNT - .set REG_SIODATA8, REG_BASE + OFFSET_REG_SIODATA8 - .set REG_SIODATA32, REG_BASE + OFFSET_REG_SIODATA32 - .set REG_SIOMLT_SEND, REG_BASE + OFFSET_REG_SIOMLT_SEND - .set REG_SIOMLT_RECV, REG_BASE + OFFSET_REG_SIOMLT_RECV - .set REG_SIOMULTI0, REG_BASE + OFFSET_REG_SIOMULTI0 - .set REG_SIOMULTI1, REG_BASE + OFFSET_REG_SIOMULTI1 - .set REG_SIOMULTI2, REG_BASE + OFFSET_REG_SIOMULTI2 - .set REG_SIOMULTI3, REG_BASE + OFFSET_REG_SIOMULTI3 - - .set REG_KEYINPUT, REG_BASE + OFFSET_REG_KEYINPUT - .set REG_KEYCNT, REG_BASE + OFFSET_REG_KEYCNT - - .set REG_RCNT, REG_BASE + OFFSET_REG_RCNT - - .set REG_JOYCNT, REG_BASE + OFFSET_REG_JOYCNT - .set REG_JOYSTAT, REG_BASE + OFFSET_REG_JOYSTAT - .set REG_JOY_RECV, REG_BASE + OFFSET_REG_JOY_RECV - .set REG_JOY_RECV_L, REG_BASE + OFFSET_REG_JOY_RECV_L - .set REG_JOY_RECV_H, REG_BASE + OFFSET_REG_JOY_RECV_H - .set REG_JOY_TRANS, REG_BASE + OFFSET_REG_JOY_TRANS - .set REG_JOY_TRANS_L, REG_BASE + OFFSET_REG_JOY_TRANS_L - .set REG_JOY_TRANS_H, REG_BASE + OFFSET_REG_JOY_TRANS_H - - .set REG_IME, REG_BASE + OFFSET_REG_IME - .set REG_IE, REG_BASE + OFFSET_REG_IE - .set REG_IF, REG_BASE + OFFSET_REG_IF - - .set REG_WAITCNT, REG_BASE + OFFSET_REG_WAITCNT - -@ DMA register constants - - .set DMA_DEST_INC, 0x0000 - .set DMA_DEST_DEC, 0x0020 - .set DMA_DEST_FIXED, 0x0040 - .set DMA_DEST_RELOAD, 0x0060 - .set DMA_SRC_INC, 0x0000 - .set DMA_SRC_DEC, 0x0080 - .set DMA_SRC_FIXED, 0x0100 - .set DMA_REPEAT, 0x0200 - .set DMA_16BIT, 0x0000 - .set DMA_32BIT, 0x0400 - .set DMA_DREQ_ON, 0x0800 - .set DMA_START_NOW, 0x0000 - .set DMA_START_VBLANK, 0x1000 - .set DMA_START_HBLANK, 0x2000 - .set DMA_START_SPECIAL, 0x3000 - .set DMA_INTR_ENABLE, 0x4000 - .set DMA_ENABLE, 0x8000 - -@ OAM attribute constants - - .set OAM_OBJ_NORMAL, 0x00000000 - .set OAM_OBJ_BLEND, 0x00000400 - .set OAM_OBJ_WINDOW, 0x00000800 - - .set OAM_AFFINE_NONE, 0x00000000 - .set OAM_AFFINE_NORMAL_SIZE, 0x00000100 - .set OAM_OBJ_DISABLED, 0x00000200 - .set OAM_AFFINE_DOUBLE_SIZE, 0x00000300 - - .set OAM_MOSAIC_OFF, 0x00000000 - .set OAM_MOSAIC_ON, 0x00001000 - - .set OAM_4BPP, 0x00000000 - .set OAM_8BPP, 0x00002000 - - .set OAM_H_FLIP, 0x10000000 - .set OAM_V_FLIP, 0x20000000 - - .set OAM_SQUARE, 0x00000000 - .set OAM_H_RECTANGLE, 0x00004000 - .set OAM_V_RECTANGLE, 0x00008000 - .set OAM_SIZE_0, 0x00000000 - .set OAM_SIZE_1, 0x40000000 - .set OAM_SIZE_2, 0x80000000 - .set OAM_SIZE_3, 0xc0000000 - - .set OAM_SIZE_8x8, OAM_SIZE_0 | OAM_SQUARE - .set OAM_SIZE_16x16, OAM_SIZE_1 | OAM_SQUARE - .set OAM_SIZE_32x32, OAM_SIZE_2 | OAM_SQUARE - .set OAM_SIZE_64x64, OAM_SIZE_3 | OAM_SQUARE - - .set OAM_SIZE_16x8, OAM_SIZE_0 | OAM_H_RECTANGLE - .set OAM_SIZE_32x8, OAM_SIZE_1 | OAM_H_RECTANGLE - .set OAM_SIZE_32x16, OAM_SIZE_2 | OAM_H_RECTANGLE - .set OAM_SIZE_64x32, OAM_SIZE_3 | OAM_H_RECTANGLE - - .set OAM_SIZE_8x16, OAM_SIZE_0 | OAM_V_RECTANGLE - .set OAM_SIZE_8x32, OAM_SIZE_1 | OAM_V_RECTANGLE - .set OAM_SIZE_16x32, OAM_SIZE_2 | OAM_V_RECTANGLE - .set OAM_SIZE_32x64, OAM_SIZE_3 | OAM_V_RECTANGLE diff --git a/constants/m4a_constants.inc b/constants/m4a_constants.inc deleted file mode 100644 index 62ca5bb..0000000 --- a/constants/m4a_constants.inc +++ /dev/null @@ -1,199 +0,0 @@ - .equiv ID_NUMBER, 0x68736d53 - - .equiv PCM_DMA_BUF_SIZE, 1584 - - .equiv TONEDATA_TYPE_CGB, 0x07 - .equiv TONEDATA_TYPE_FIX, 0x08 - .equiv TONEDATA_TYPE_SPL, 0x40 @ key split - .equiv TONEDATA_TYPE_RHY, 0x80 @ rhythm - - .macro struct_begin - .struct 0 - .endm - - .macro struct_field name, size -\name: - .struct \name + \size - .endm - - struct_begin - struct_field o_SoundInfo_ident, 4 - struct_field o_SoundInfo_pcmDmaCounter, 1 - struct_field o_SoundInfo_reverb, 1 - struct_field o_SoundInfo_maxChans, 1 - struct_field o_SoundInfo_masterVolume, 1 - struct_field o_SoundInfo_freq, 1 - struct_field o_SoundInfo_mode, 1 - struct_field o_SoundInfo_c15, 1 - struct_field o_SoundInfo_pcmDmaPeriod, 1 - struct_field o_SoundInfo_maxLines, 1 - struct_field o_SoundInfo_gap, 3 - struct_field o_SoundInfo_pcmSamplesPerVBlank, 4 - struct_field o_SoundInfo_pcmFreq, 4 - struct_field o_SoundInfo_divFreq, 4 - struct_field o_SoundInfo_cgbChans, 4 - struct_field o_SoundInfo_func, 4 - struct_field o_SoundInfo_intp, 4 - struct_field o_SoundInfo_CgbSound, 4 - struct_field o_SoundInfo_CgbOscOff, 4 - struct_field o_SoundInfo_MidiKeyToCgbFreq, 4 - struct_field o_SoundInfo_MPlayJumpTable, 4 - struct_field o_SoundInfo_plynote, 4 - struct_field o_SoundInfo_ExtVolPit, 4 - struct_field o_SoundInfo_gap2, 16 - struct_field o_SoundInfo_chans, 768 - struct_field o_SoundInfo_pcmBuffer, PCM_DMA_BUF_SIZE * 2 - struct_field SoundInfo_size, 0 - - struct_begin - struct_field o_SoundChannel_status, 1 - struct_field o_SoundChannel_type, 1 - struct_field o_SoundChannel_rightVolume, 1 - struct_field o_SoundChannel_leftVolume, 1 - struct_field o_SoundChannel_attack, 1 - struct_field o_SoundChannel_decay, 1 - struct_field o_SoundChannel_sustain, 1 - struct_field o_SoundChannel_release, 1 - struct_field o_SoundChannel_ky, 1 - struct_field o_SoundChannel_ev, 1 - struct_field o_SoundChannel_er, 1 - struct_field o_SoundChannel_el, 1 - struct_field o_SoundChannel_iev, 1 - struct_field o_SoundChannel_iel, 1 - struct_field o_SoundChannel_d1, 1 - struct_field o_SoundChannel_d2, 1 - struct_field o_SoundChannel_gt, 1 - struct_field o_SoundChannel_mk, 1 - struct_field o_SoundChannel_ve, 1 - struct_field o_SoundChannel_pr, 1 - struct_field o_SoundChannel_rp, 1 - struct_field o_SoundChannel_d3, 3 - struct_field o_SoundChannel_ct, 4 - struct_field o_SoundChannel_fw, 4 - struct_field o_SoundChannel_freq, 4 - struct_field o_SoundChannel_wav, 4 - struct_field o_SoundChannel_cp, 4 - struct_field o_SoundChannel_track, 4 - struct_field o_SoundChannel_pp, 4 - struct_field o_SoundChannel_np, 4 - struct_field o_SoundChannel_d4, 4 - struct_field o_SoundChannel_xpi, 2 - struct_field o_SoundChannel_xpc, 2 - struct_field SoundChannel_size, 0 - - struct_begin - struct_field o_MusicPlayerTrack_flags, 1 - struct_field o_MusicPlayerTrack_wait, 1 - struct_field o_MusicPlayerTrack_patternLevel, 1 - struct_field o_MusicPlayerTrack_repN, 1 - struct_field o_MusicPlayerTrack_gateTime, 1 - struct_field o_MusicPlayerTrack_key, 1 - struct_field o_MusicPlayerTrack_velocity, 1 - struct_field o_MusicPlayerTrack_runningStatus, 1 - struct_field o_MusicPlayerTrack_keyM, 1 - struct_field o_MusicPlayerTrack_pitM, 1 - struct_field o_MusicPlayerTrack_keyShift, 1 - struct_field o_MusicPlayerTrack_keyShiftX, 1 - struct_field o_MusicPlayerTrack_tune, 1 - struct_field o_MusicPlayerTrack_pitX, 1 - struct_field o_MusicPlayerTrack_bend, 1 - struct_field o_MusicPlayerTrack_bendRange, 1 - struct_field o_MusicPlayerTrack_volMR, 1 - struct_field o_MusicPlayerTrack_volML, 1 - struct_field o_MusicPlayerTrack_vol, 1 - struct_field o_MusicPlayerTrack_volX, 1 - struct_field o_MusicPlayerTrack_pan, 1 - struct_field o_MusicPlayerTrack_panX, 1 - struct_field o_MusicPlayerTrack_modM, 1 - struct_field o_MusicPlayerTrack_mod, 1 - struct_field o_MusicPlayerTrack_modT, 1 - struct_field o_MusicPlayerTrack_lfoSpeed, 1 - struct_field o_MusicPlayerTrack_lfoSpeedC, 1 - struct_field o_MusicPlayerTrack_lfoDelay, 1 - struct_field o_MusicPlayerTrack_lfoDelayC, 1 - struct_field o_MusicPlayerTrack_priority, 1 - struct_field o_MusicPlayerTrack_echoVolume, 1 - struct_field o_MusicPlayerTrack_echoLength, 1 - struct_field o_MusicPlayerTrack_chan, 4 - struct_field o_MusicPlayerTrack_ToneData_type, 1 - struct_field o_MusicPlayerTrack_ToneData_key, 1 - struct_field o_MusicPlayerTrack_ToneData_length, 1 - struct_field o_MusicPlayerTrack_ToneData_pan_sweep, 1 - struct_field o_MusicPlayerTrack_ToneData_wav, 4 - struct_field o_MusicPlayerTrack_ToneData_attack, 1 - struct_field o_MusicPlayerTrack_ToneData_decay, 1 - struct_field o_MusicPlayerTrack_ToneData_sustain, 1 - struct_field o_MusicPlayerTrack_ToneData_release, 1 - struct_field o_MusicPlayerTrack_gap, 10 - struct_field o_MusicPlayerTrack_unk_3A, 2 - struct_field o_MusicPlayerTrack_unk_3C, 4 - struct_field o_MusicPlayerTrack_cmdPtr, 4 - struct_field o_MusicPlayerTrack_patternStack, 12 - struct_field MusicPlayerTrack_size, 0 - - .equiv o_MusicPlayerTrack_ToneData_keySplitTable, o_MusicPlayerTrack_ToneData_attack - - struct_begin - struct_field o_MusicPlayerInfo_songHeader, 4 - struct_field o_MusicPlayerInfo_status, 4 - struct_field o_MusicPlayerInfo_trackCount, 1 - struct_field o_MusicPlayerInfo_priority, 1 - struct_field o_MusicPlayerInfo_cmd, 1 - struct_field o_MusicPlayerInfo_unk_B, 1 - struct_field o_MusicPlayerInfo_clock, 4 - struct_field o_MusicPlayerInfo_gap, 8 - struct_field o_MusicPlayerInfo_memAccArea, 4 - struct_field o_MusicPlayerInfo_tempoD, 2 - struct_field o_MusicPlayerInfo_tempoU, 2 - struct_field o_MusicPlayerInfo_tempoI, 2 - struct_field o_MusicPlayerInfo_tempoC, 2 - struct_field o_MusicPlayerInfo_fadeOI, 2 - struct_field o_MusicPlayerInfo_fadeOC, 2 - struct_field o_MusicPlayerInfo_fadeOV, 2 - struct_field o_MusicPlayerInfo_padding, 2 - struct_field o_MusicPlayerInfo_tracks, 4 - struct_field o_MusicPlayerInfo_tone, 4 - struct_field o_MusicPlayerInfo_ident, 4 - struct_field o_MusicPlayerInfo_func, 4 - struct_field o_MusicPlayerInfo_intp, 4 - struct_field MusicPlayerInfo_size, 0 - - struct_begin - struct_field o_CgbChannel_sf, 1 - struct_field o_CgbChannel_ty, 1 - struct_field o_CgbChannel_rightVolume, 1 - struct_field o_CgbChannel_leftVolume, 1 - struct_field o_CgbChannel_at, 1 - struct_field o_CgbChannel_de, 1 - struct_field o_CgbChannel_su, 1 - struct_field o_CgbChannel_re, 1 - struct_field o_CgbChannel_ky, 1 - struct_field o_CgbChannel_ev, 1 - struct_field o_CgbChannel_eg, 1 - struct_field o_CgbChannel_ec, 1 - struct_field o_CgbChannel_echoVolume, 1 - struct_field o_CgbChannel_echoLength, 1 - struct_field o_CgbChannel_d1, 1 - struct_field o_CgbChannel_d2, 1 - struct_field o_CgbChannel_gt, 1 - struct_field o_CgbChannel_mk, 1 - struct_field o_CgbChannel_ve, 1 - struct_field o_CgbChannel_pr, 1 - struct_field o_CgbChannel_rp, 1 - struct_field o_CgbChannel_d3, 3 - struct_field o_CgbChannel_d5, 1 - struct_field o_CgbChannel_sg, 1 - struct_field o_CgbChannel_n4, 1 - struct_field o_CgbChannel_pan, 1 - struct_field o_CgbChannel_panMask, 1 - struct_field o_CgbChannel_mo, 1 - struct_field o_CgbChannel_le, 1 - struct_field o_CgbChannel_sw, 1 - struct_field o_CgbChannel_fr, 4 - struct_field o_CgbChannel_wp, 4 - struct_field o_CgbChannel_cp, 4 - struct_field o_CgbChannel_tp, 4 - struct_field o_CgbChannel_pp, 4 - struct_field o_CgbChannel_np, 4 - struct_field o_CgbChannel_d4, 8 - struct_field CgbChannel_size, 0 diff --git a/constants/script_func_constants.inc b/constants/script_func_constants.inc deleted file mode 100644 index 157153d..0000000 --- a/constants/script_func_constants.inc +++ /dev/null @@ -1,14 +0,0 @@ -.set WAIT_START_FUNC, 0x03 -.set WAKEUP_FUNC, 0x20 -.set LOOK_AROUND_FUNC, 0x21 -.set JUMP_HAPPY_FUNC, 0x25 -.set JUMP_ANGRY_FUNC, 0x27 -.set NOTICE_FUNC, 0x28 -.set QUESTION_FUNC, 0x29 -.set SWEAT_FUNC, 0x2A -.set SHOCK_FUNC, 0x2B -.set SMILE_START_FUNC, 0x2E -.set SMILE_END_FUNC, 0x2F -.set INIT_SLEEP_FUNC, 0x35 -.set LIVES_WARP_ARRIVE_FUNC, 0x51 -.set LIVES_WARP_ARRIVE2_FUNC, 0x52 diff --git a/data/cutscenes.s b/data/cutscenes.s index fecbf45..cad1fe1 100644 --- a/data/cutscenes.s +++ b/data/cutscenes.s @@ -1,8 +1,8 @@ .section .rodata - .include "asm/macros.inc" - .include "constants/script_func_constants.inc" - .include "include/constants/bg_music.h" + #include "asm/macros.inc" + #include "asm/constants/script_func_constants.inc" + #include "constants/bg_music.h" @ Debug Room .global Cutscene_DebugRoom_Main diff --git a/data/cutscenes_1.s b/data/cutscenes_1.s index e3f197c..096fae4 100644 --- a/data/cutscenes_1.s +++ b/data/cutscenes_1.s @@ -1,8 +1,8 @@ .section .rodata - .include "asm/macros.inc" - .include "constants/script_func_constants.inc" - .include "include/constants/bg_music.h" + #include "asm/macros.inc" + #include "asm/constants/script_func_constants.inc" + #include "constants/bg_music.h" .global Unk_822C248 Unk_822C248: @@ -9156,25 +9156,25 @@ .string "pksdir0\0" .align 2,0 - .include "data/scripts/personality_test.inc" + #include "scripts/personality_test.inc" .string "pksdir0\0" .align 2,0 - .include "data/scripts/title.inc" + #include "scripts/title.inc" .string "pksdir0\0" .align 2,0 - .include "data/scripts/intro.inc" + #include "scripts/intro.inc" .string "pksdir0\0" .align 2,0 - .include "data/scripts/company_screens.inc" + #include "scripts/company_screens.inc" .string "pksdir0\0" .align 2,0 - .include "data/scripts/health_safety.inc" + #include "scripts/health_safety.inc" .string "pksdir0\0" .align 2,0 - .include "data/scripts/world_map.inc" + #include "scripts/world_map.inc" diff --git a/data/data.s b/data/data.s index c51e2d1..e00d0ce 100644 --- a/data/data.s +++ b/data/data.s @@ -99,7 +99,7 @@ gLoadScreenBackgroundPaletteFileNames: @ 80B6A28 .4byte titlen1p_text .4byte titlen2p_text - .include "data/text/save.inc" + #include "text/save.inc" .global gUnknown_80B6D90 gUnknown_80B6D90: @ 80B6D90 diff --git a/data/data_80D47B8.s b/data/data_80D47B8.s index 25fb2b1..1b63067 100644 --- a/data/data_80D47B8.s +++ b/data/data_80D47B8.s @@ -4617,11 +4617,11 @@ gUnknown_80DCA2C: @ 80DCA2C .align 2,0 .4byte gUnknown_80DCA2C - .include "data/text/luminous_cave.inc" + #include "text/luminous_cave.inc" - .include "data/friend_area.inc" + #include "friend_area.inc" - .include "data/text/party_menu.inc" + #include "text/party_menu.inc" .global gUnknown_80DD6EC gUnknown_80DD6EC: @ 80DD6EC diff --git a/data/data_80DED44.s b/data/data_80DED44.s index 4989dea..758d88b 100644 --- a/data/data_80DED44.s +++ b/data/data_80DED44.s @@ -257,7 +257,7 @@ gUnknown_80DFE1C: @ 80DFE1C .byte 0x03, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 - .include "data/text/wonder_mail_3.inc" + #include "text/wonder_mail_3.inc" .global gUnknown_80E016C gUnknown_80E016C: @ 80E016C @@ -268,7 +268,7 @@ gUnknown_80E016C: @ 80E016C .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 - .include "data/text/wonder_mail_complete.inc" + #include "text/wonder_mail_complete.inc" .global gUnknown_80E0248 gUnknown_80E0248: @ 80E0248 diff --git a/data/data_80E2068.s b/data/data_80E2068.s index d00a658..e7e5921 100644 --- a/data/data_80E2068.s +++ b/data/data_80E2068.s @@ -1219,7 +1219,7 @@ gUnknown_80E4A40: @ 80E4A40 .byte 0x18, 0xff .byte 0x19, 0xff - .include "data/text/credits.inc" + #include "text/credits.inc" .global gUnknown_80E5990 gUnknown_80E5990: @ 80E5990 diff --git a/data/data_80F4278.s b/data/data_80F4278.s index 8a64e9e..339464f 100644 --- a/data/data_80F4278.s +++ b/data/data_80F4278.s @@ -1,5 +1,5 @@ -.include "include/constants/status.h" -.include "include/constants/targeting.h" +#include "constants/status.h" +#include "constants/targeting.h" .section .rodata .global gUnknown_80F42D0 @@ -7430,7 +7430,7 @@ gChargeMovesToStatuses: @ 81069F4 .global gMultiTurnChargingStatuses gMultiTurnChargingStatuses: @ 8106A1C - .include "include/constants/status.h" + #include "constants/status.h" .4byte CHARGING_STATUS_SOLARBEAM .4byte CHARGING_STATUS_SKY_ATTACK .4byte CHARGING_STATUS_RAZOR_WIND diff --git a/data/dungeon/floor_id.inc b/data/dungeon/floor_id.inc index accd20e..8214573 100644 --- a/data/dungeon/floor_id.inc +++ b/data/dungeon/floor_id.inc @@ -1,67 +1,67 @@ -.include "data/dungeon/TinyWoods/floor_id.inc" -.include "data/dungeon/ThunderwaveCave/floor_id.inc" -.include "data/dungeon/MtSteel/floor_id.inc" -.include "data/dungeon/SinisterWoods/floor_id.inc" -.include "data/dungeon/SilentChasm/floor_id.inc" -.include "data/dungeon/MtThunder/floor_id.inc" -.include "data/dungeon/MtThunderPeak/floor_id.inc" -.include "data/dungeon/GreatCanyon/floor_id.inc" -.include "data/dungeon/LapisCave/floor_id.inc" -.include "data/dungeon/MtBlaze/floor_id.inc" -.include "data/dungeon/MtBlazePeak/floor_id.inc" -.include "data/dungeon/FrostyForest/floor_id.inc" -.include "data/dungeon/FrostyGrotto/floor_id.inc" -.include "data/dungeon/MtFreeze/floor_id.inc" -.include "data/dungeon/MtFreezePeak/floor_id.inc" -.include "data/dungeon/MagmaCavern/floor_id.inc" -.include "data/dungeon/MagmaCavernPit/floor_id.inc" -.include "data/dungeon/SkyTower/floor_id.inc" -.include "data/dungeon/SkyTowerSummit/floor_id.inc" -.include "data/dungeon/StormySea/floor_id.inc" -.include "data/dungeon/SilverTrench/floor_id.inc" -.include "data/dungeon/MeteorCave/floor_id.inc" -.include "data/dungeon/MtFreezePeakAlt/floor_id.inc" -.include "data/dungeon/WesternCave/floor_id.inc" -.include "data/dungeon/Boss3/floor_id.inc" -.include "data/dungeon/Boss4/floor_id.inc" -.include "data/dungeon/WishCave/floor_id.inc" -.include "data/dungeon/BuriedRelic/floor_id.inc" -.include "data/dungeon/PitfallValley/floor_id.inc" -.include "data/dungeon/NorthernRange/floor_id.inc" -.include "data/dungeon/Boss9/floor_id.inc" -.include "data/dungeon/DesertRegion/floor_id.inc" -.include "data/dungeon/SouthernCavern/floor_id.inc" -.include "data/dungeon/WyvernHill/floor_id.inc" -.include "data/dungeon/FieryField/floor_id.inc" -.include "data/dungeon/NorthwindField/floor_id.inc" -.include "data/dungeon/SolarCave/floor_id.inc" -.include "data/dungeon/LightningField/floor_id.inc" -.include "data/dungeon/DarknightRelic/floor_id.inc" -.include "data/dungeon/WondrousSea/floor_id.inc" -.include "data/dungeon/MurkyCave/floor_id.inc" -.include "data/dungeon/GrandSea/floor_id.inc" -.include "data/dungeon/UproarForest/floor_id.inc" -.include "data/dungeon/OddityCave/floor_id.inc" -.include "data/dungeon/RemainsIsland/floor_id.inc" -.include "data/dungeon/MarvelousSea/floor_id.inc" -.include "data/dungeon/FantasyStrait/floor_id.inc" -.include "data/dungeon/RockPath/floor_id.inc" -.include "data/dungeon/SnowPath/floor_id.inc" -.include "data/dungeon/Autopilot/floor_id.inc" -.include "data/dungeon/D50/floor_id.inc" -.include "data/dungeon/D51/floor_id.inc" -.include "data/dungeon/DojoRegistration/floor_id.inc" -.include "data/dungeon/HowlingForest/floor_id.inc" -.include "data/dungeon/D54/floor_id.inc" -.include "data/dungeon/FantasyStraitAlt/floor_id.inc" -.include "data/dungeon/WaterfallPond/floor_id.inc" -.include "data/dungeon/UnownRelic/floor_id.inc" -.include "data/dungeon/JoyousTower/floor_id.inc" -.include "data/dungeon/FaroffSea/floor_id.inc" -.include "data/dungeon/MtFaraway/floor_id.inc" -.include "data/dungeon/D61/floor_id.inc" -.include "data/dungeon/PurityForest/floor_id.inc" -.include "data/dungeon/D63/floor_id.inc" +#include "TinyWoods/floor_id.inc" +#include "ThunderwaveCave/floor_id.inc" +#include "MtSteel/floor_id.inc" +#include "SinisterWoods/floor_id.inc" +#include "SilentChasm/floor_id.inc" +#include "MtThunder/floor_id.inc" +#include "MtThunderPeak/floor_id.inc" +#include "GreatCanyon/floor_id.inc" +#include "LapisCave/floor_id.inc" +#include "MtBlaze/floor_id.inc" +#include "MtBlazePeak/floor_id.inc" +#include "FrostyForest/floor_id.inc" +#include "FrostyGrotto/floor_id.inc" +#include "MtFreeze/floor_id.inc" +#include "MtFreezePeak/floor_id.inc" +#include "MagmaCavern/floor_id.inc" +#include "MagmaCavernPit/floor_id.inc" +#include "SkyTower/floor_id.inc" +#include "SkyTowerSummit/floor_id.inc" +#include "StormySea/floor_id.inc" +#include "SilverTrench/floor_id.inc" +#include "MeteorCave/floor_id.inc" +#include "MtFreezePeakAlt/floor_id.inc" +#include "WesternCave/floor_id.inc" +#include "Boss3/floor_id.inc" +#include "Boss4/floor_id.inc" +#include "WishCave/floor_id.inc" +#include "BuriedRelic/floor_id.inc" +#include "PitfallValley/floor_id.inc" +#include "NorthernRange/floor_id.inc" +#include "Boss9/floor_id.inc" +#include "DesertRegion/floor_id.inc" +#include "SouthernCavern/floor_id.inc" +#include "WyvernHill/floor_id.inc" +#include "FieryField/floor_id.inc" +#include "NorthwindField/floor_id.inc" +#include "SolarCave/floor_id.inc" +#include "LightningField/floor_id.inc" +#include "DarknightRelic/floor_id.inc" +#include "WondrousSea/floor_id.inc" +#include "MurkyCave/floor_id.inc" +#include "GrandSea/floor_id.inc" +#include "UproarForest/floor_id.inc" +#include "OddityCave/floor_id.inc" +#include "RemainsIsland/floor_id.inc" +#include "MarvelousSea/floor_id.inc" +#include "FantasyStrait/floor_id.inc" +#include "RockPath/floor_id.inc" +#include "SnowPath/floor_id.inc" +#include "Autopilot/floor_id.inc" +#include "D50/floor_id.inc" +#include "D51/floor_id.inc" +#include "DojoRegistration/floor_id.inc" +#include "HowlingForest/floor_id.inc" +#include "D54/floor_id.inc" +#include "FantasyStraitAlt/floor_id.inc" +#include "WaterfallPond/floor_id.inc" +#include "UnownRelic/floor_id.inc" +#include "JoyousTower/floor_id.inc" +#include "FaroffSea/floor_id.inc" +#include "MtFaraway/floor_id.inc" +#include "D61/floor_id.inc" +#include "PurityForest/floor_id.inc" +#include "D63/floor_id.inc" @ Start of Dungeon Floor ID Table .global DungeonPointerTable diff --git a/data/dungeon/main_data.inc b/data/dungeon/main_data.inc index de8e282..6ea5946 100644 --- a/data/dungeon/main_data.inc +++ b/data/dungeon/main_data.inc @@ -2,29 +2,29 @@ .global DungeonMainData DungeonMainData: -.include "data/dungeon/TinyWoods/main_data.inc" -.include "data/dungeon/ThunderwaveCave/main_data.inc" -.include "data/dungeon/MtSteel/main_data.inc" -.include "data/dungeon/SinisterWoods/main_data.inc" -.include "data/dungeon/SilentChasm/main_data.inc" -.include "data/dungeon/MtThunder/main_data.inc" -.include "data/dungeon/MtThunderPeak/main_data.inc" -.include "data/dungeon/GreatCanyon/main_data.inc" -.include "data/dungeon/LapisCave/main_data.inc" -.include "data/dungeon/MtBlaze/main_data.inc" -.include "data/dungeon/MtBlazePeak/main_data.inc" -.include "data/dungeon/FrostyForest/main_data.inc" -.include "data/dungeon/FrostyGrotto/main_data.inc" -.include "data/dungeon/MtFreeze/main_data.inc" -.include "data/dungeon/MtFreezePeak/main_data.inc" -.include "data/dungeon/MagmaCavern/main_data.inc" -.include "data/dungeon/MagmaCavernPit/main_data.inc" -.include "data/dungeon/SkyTower/main_data.inc" -.include "data/dungeon/SkyTowerSummit/main_data.inc" -.include "data/dungeon/StormySea/main_data.inc" -.include "data/dungeon/SilverTrench/main_data.inc" -.include "data/dungeon/MeteorCave/main_data.inc" -.include "data/dungeon/MtFreezePeakAlt/main_data.inc" +#include "TinyWoods/main_data.inc" +#include "ThunderwaveCave/main_data.inc" +#include "MtSteel/main_data.inc" +#include "SinisterWoods/main_data.inc" +#include "SilentChasm/main_data.inc" +#include "MtThunder/main_data.inc" +#include "MtThunderPeak/main_data.inc" +#include "GreatCanyon/main_data.inc" +#include "LapisCave/main_data.inc" +#include "MtBlaze/main_data.inc" +#include "MtBlazePeak/main_data.inc" +#include "FrostyForest/main_data.inc" +#include "FrostyGrotto/main_data.inc" +#include "MtFreeze/main_data.inc" +#include "MtFreezePeak/main_data.inc" +#include "MagmaCavern/main_data.inc" +#include "MagmaCavernPit/main_data.inc" +#include "SkyTower/main_data.inc" +#include "SkyTowerSummit/main_data.inc" +#include "StormySea/main_data.inc" +#include "SilverTrench/main_data.inc" +#include "MeteorCave/main_data.inc" +#include "MtFreezePeakAlt/main_data.inc" diff --git a/data/dungeon/pokemon_found.inc b/data/dungeon/pokemon_found.inc index 67ca464..c32676b 100644 --- a/data/dungeon/pokemon_found.inc +++ b/data/dungeon/pokemon_found.inc @@ -1,26 +1,26 @@ @ Start of Pokemon Found (0x84b6064) -.include "include/constants/species.h" +#include "constants/species.h" -.include "data/dungeon/TinyWoods/pokemon_found.inc" -.include "data/dungeon/ThunderwaveCave/pokemon_found.inc" -.include "data/dungeon/MtSteel/pokemon_found.inc" -.include "data/dungeon/SinisterWoods/pokemon_found.inc" -.include "data/dungeon/SilentChasm/pokemon_found.inc" -.include "data/dungeon/MtThunder/pokemon_found.inc" -.include "data/dungeon/MtThunderPeak/pokemon_found.inc" -.include "data/dungeon/GreatCanyon/pokemon_found.inc" -.include "data/dungeon/LapisCave/pokemon_found.inc" -.include "data/dungeon/MtBlaze/pokemon_found.inc" -.include "data/dungeon/MtBlazePeak/pokemon_found.inc" -.include "data/dungeon/FrostyForest/pokemon_found.inc" -.include "data/dungeon/FrostyGrotto/pokemon_found.inc" -.include "data/dungeon/MtFreeze/pokemon_found.inc" -.include "data/dungeon/MtFreezePeak/pokemon_found.inc" -.include "data/dungeon/MagmaCavern/pokemon_found.inc" -.include "data/dungeon/MagmaCavernPit/pokemon_found.inc" -.include "data/dungeon/SkyTower/pokemon_found.inc" -.include "data/dungeon/SkyTowerSummit/pokemon_found.inc" +#include "TinyWoods/pokemon_found.inc" +#include "ThunderwaveCave/pokemon_found.inc" +#include "MtSteel/pokemon_found.inc" +#include "SinisterWoods/pokemon_found.inc" +#include "SilentChasm/pokemon_found.inc" +#include "MtThunder/pokemon_found.inc" +#include "MtThunderPeak/pokemon_found.inc" +#include "GreatCanyon/pokemon_found.inc" +#include "LapisCave/pokemon_found.inc" +#include "MtBlaze/pokemon_found.inc" +#include "MtBlazePeak/pokemon_found.inc" +#include "FrostyForest/pokemon_found.inc" +#include "FrostyGrotto/pokemon_found.inc" +#include "MtFreeze/pokemon_found.inc" +#include "MtFreezePeak/pokemon_found.inc" +#include "MagmaCavern/pokemon_found.inc" +#include "MagmaCavernPit/pokemon_found.inc" +#include "SkyTower/pokemon_found.inc" +#include "SkyTowerSummit/pokemon_found.inc" .byte 0x48, 0x32, 0x1a, 0x07, 0x1a, 0x07, 0x00, 0x00 diff --git a/data/dungeon_sbin.s b/data/dungeon_sbin.s index d24b3b7..95f455e 100644 --- a/data/dungeon_sbin.s +++ b/data/dungeon_sbin.s @@ -30725,16 +30725,16 @@ b00pal: .byte 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80 -.include "data/dungeon/banfont.inc" -.include "data/dungeon/banrpal.inc" -.include "data/dungeon/colvec.inc" -.include "data/dungeon/etcfont.inc" -.include "data/dungeon/etcfonta.inc" -.include "data/dungeon/fixedmap.inc" -.include "data/dungeon/hp5font.inc" -.include "data/dungeon/itempat.inc" -.include "data/dungeon/jyochu.inc" -.include "data/dungeon/levfont.inc" +#include "dungeon/banfont.inc" +#include "dungeon/banrpal.inc" +#include "dungeon/colvec.inc" +#include "dungeon/etcfont.inc" +#include "dungeon/etcfonta.inc" +#include "dungeon/fixedmap.inc" +#include "dungeon/hp5font.inc" +#include "dungeon/itempat.inc" +#include "dungeon/jyochu.inc" +#include "dungeon/levfont.inc" @ Dungoeon Floor SIRO HEADER .global Mapparam_SIRO @@ -30744,11 +30744,11 @@ Mapparam_SIRO: .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 -.include "data/dungeon/floor_id.inc" -.include "data/dungeon/main_data.inc" -.include "data/dungeon/pokemon_found.inc" -.include "data/dungeon/traps_found.inc" -.include "data/dungeon/items_found.inc" +#include "dungeon/floor_id.inc" +#include "dungeon/main_data.inc" +#include "dungeon/pokemon_found.inc" +#include "dungeon/traps_found.inc" +#include "dungeon/items_found.inc" .global DungeonMasterTable DungeonMasterTable: @@ -36413,5 +36413,5 @@ PartnerConversion9SIRO: .byte 0x30, 0x5f, 0x30, 0x32, 0x00, 0x00, 0x00, 0x00, 0x24, 0x6d, 0x30, 0x3a, 0x20, 0x5f, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f .byte 0x6e, 0x5f, 0x30, 0x39, 0x30, 0x5f, 0x30, 0x31, 0x00, 0x00, 0x00, 0x00 -.include "data/dungeon/trappat.inc" -.include "data/dungeon/zmappat.inc" +#include "dungeon/trappat.inc" +#include "dungeon/zmappat.inc" diff --git a/data/sound_data.s b/data/sound_data.s index d21dfbb..32367fd 100644 --- a/data/sound_data.s +++ b/data/sound_data.s @@ -1,8 +1,8 @@ .section .rodata - .include "include/macros/m4a.inc" + #include "asm/macros/m4a.inc" - .include "sound/music_player_table.inc" - .include "sound/song_table.inc" + #include "../sound/music_player_table.inc" + #include "../sound/song_table.inc" .incbin "baserom.gba", 0x1E8841C, 0x177BE4 diff --git a/data/system_sbin.s b/data/system_sbin.s index 6742b67..7ea8cd5 100644 --- a/data/system_sbin.s +++ b/data/system_sbin.s @@ -1583,14 +1583,14 @@ DataRootTable: .byte 0x28, 0xcc, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 @ Address 0x306580 -.include "data/item/item_descriptions.s" +#include "item/item_descriptions.s" .align 2,0 @ Address 0x30cc28 -.include "data/item/item_data.inc" +#include "item/item_data.inc" @ Address 0x30ea28 -.include "data/item/item_names.s" +#include "item/item_names.s" .string "SIRO" .byte 0xb0, 0x91, 0x31, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 @@ -10923,10 +10923,10 @@ DataRootTable: .byte 0x00, 0x00, 0x00, 0x00 @ Address 0x357b98 -.include "data/pokemon/species_data.inc" +#include "pokemon/species_data.inc" @ Address 0x35f2d8 -.include "data/pokemon/species_names.s" +#include "pokemon/species_names.s" .string "SIRO" .byte 0x38, 0x33, 0x37, 0x08, 0x00, 0x00, 0x00, 0x00 @@ -11809,10 +11809,10 @@ DataRootTable: .byte 0x0f, 0x83, 0x10, 0x83, 0x11, 0x83, 0x12, 0x83, 0x13, 0x83, 0x14, 0x83, 0x15, 0x83, 0x16, 0x83, 0x17, 0x83, 0x18, 0x83, 0x19, 0x83, 0x1a, 0x83, 0x1b, 0x83, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00 @ Address 0x3679a0 -.include "data/move/move_data.inc" +#include "move/move_data.inc" @ Address 0x36b3b4 -.include "data/move/move_names.s" +#include "move/move_names.s" .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 .byte 0x06, 0x0c, 0x36, 0x08, 0x26, 0x0c, 0x36, 0x08, 0x4a, 0x0c, 0x36, 0x08, 0x70, 0x0c, 0x36, 0x08, 0x94, 0x0c, 0x36, 0x08, 0xc0, 0x0c, 0x36, 0x08, 0xe9, 0x0c, 0x36, 0x08, 0x06, 0x0d, 0x36, 0x08 diff --git a/include/asm/constants/gba_constants.inc b/include/asm/constants/gba_constants.inc new file mode 100644 index 0000000..9d59c8f --- /dev/null +++ b/include/asm/constants/gba_constants.inc @@ -0,0 +1,490 @@ + .set PSR_USR_MODE, 0x00000010 + .set PSR_FIQ_MODE, 0x00000011 + .set PSR_IRQ_MODE, 0x00000012 + .set PSR_SVC_MODE, 0x00000013 + .set PSR_ABT_MODE, 0x00000017 + .set PSR_UND_MODE, 0x0000001b + .set PSR_SYS_MODE, 0x0000001f + .set PSR_MODE_MASK, 0x0000001f + .set PSR_T_BIT, 0x00000020 + .set PSR_F_BIT, 0x00000040 + .set PSR_I_BIT, 0x00000080 + + .set EWRAM_START, 0x02000000 + .set EWRAM_END, EWRAM_START + 0x40000 + .set IWRAM_START, 0x03000000 + .set IWRAM_END, IWRAM_START + 0x8000 + + .set PLTT, 0x5000000 + .set BG_PLTT, PLTT + .set OBJ_PLTT, PLTT + 0x200 + + .set VRAM, 0x6000000 + .set BG_VRAM, VRAM + .set OBJ_VRAM0, VRAM + 0x10000 @ text-mode BG + .set OBJ_VRAM1, VRAM + 0x14000 @ bitmap-mode BG + + .set OAM, 0x7000000 + + .set SOUND_INFO_PTR, 0x3007FF0 + .set INTR_CHECK, 0x3007FF8 + .set INTR_VECTOR, 0x3007FFC + + .set INTR_FLAG_VBLANK, 1 << 0 + .set INTR_FLAG_HBLANK, 1 << 1 + .set INTR_FLAG_VCOUNT, 1 << 2 + .set INTR_FLAG_TIMER0, 1 << 3 + .set INTR_FLAG_TIMER1, 1 << 4 + .set INTR_FLAG_TIMER2, 1 << 5 + .set INTR_FLAG_TIMER3, 1 << 6 + .set INTR_FLAG_SERIAL, 1 << 7 + .set INTR_FLAG_DMA0, 1 << 8 + .set INTR_FLAG_DMA1, 1 << 9 + .set INTR_FLAG_DMA2, 1 << 10 + .set INTR_FLAG_DMA3, 1 << 11 + .set INTR_FLAG_KEYPAD, 1 << 12 + .set INTR_FLAG_GAMEPAK, 1 << 13 + + .set VCOUNT_VBLANK, 160 + .set TOTAL_SCANLINES, 228 + + .set REG_BASE, 0x4000000 @ I/O register base address + +@ I/O register offsets + .set OFFSET_REG_DISPCNT, 0x0 + .set OFFSET_REG_DISPSTAT, 0x4 + .set OFFSET_REG_VCOUNT, 0x6 + .set OFFSET_REG_BG0CNT, 0x8 + .set OFFSET_REG_BG1CNT, 0xa + .set OFFSET_REG_BG2CNT, 0xc + .set OFFSET_REG_BG3CNT, 0xe + .set OFFSET_REG_BG0HOFS, 0x10 + .set OFFSET_REG_BG0VOFS, 0x12 + .set OFFSET_REG_BG1HOFS, 0x14 + .set OFFSET_REG_BG1VOFS, 0x16 + .set OFFSET_REG_BG2HOFS, 0x18 + .set OFFSET_REG_BG2VOFS, 0x1a + .set OFFSET_REG_BG3HOFS, 0x1c + .set OFFSET_REG_BG3VOFS, 0x1e + .set OFFSET_REG_BG2PA, 0x20 + .set OFFSET_REG_BG2PB, 0x22 + .set OFFSET_REG_BG2PC, 0x24 + .set OFFSET_REG_BG2PD, 0x26 + .set OFFSET_REG_BG2X_L, 0x28 + .set OFFSET_REG_BG2X_H, 0x2a + .set OFFSET_REG_BG2Y_L, 0x2c + .set OFFSET_REG_BG2Y_H, 0x2e + .set OFFSET_REG_BG3PA, 0x30 + .set OFFSET_REG_BG3PB, 0x32 + .set OFFSET_REG_BG3PC, 0x34 + .set OFFSET_REG_BG3PD, 0x36 + .set OFFSET_REG_BG3X_L, 0x38 + .set OFFSET_REG_BG3X_H, 0x3a + .set OFFSET_REG_BG3Y_L, 0x3c + .set OFFSET_REG_BG3Y_H, 0x3e + .set OFFSET_REG_WIN0H, 0x40 + .set OFFSET_REG_WIN1H, 0x42 + .set OFFSET_REG_WIN0V, 0x44 + .set OFFSET_REG_WIN1V, 0x46 + .set OFFSET_REG_WININ, 0x48 + .set OFFSET_REG_WINOUT, 0x4a + .set OFFSET_REG_MOSAIC, 0x4c + .set OFFSET_REG_BLDCNT, 0x50 + .set OFFSET_REG_BLDALPHA, 0x52 + .set OFFSET_REG_BLDY, 0x54 + + .set OFFSET_REG_SOUND1CNT, 0x60 + .set OFFSET_REG_SOUND1CNT_L, 0x60 + .set OFFSET_REG_NR10, 0x60 + .set OFFSET_REG_SOUND1CNT_H, 0x62 + .set OFFSET_REG_NR11, 0x62 + .set OFFSET_REG_NR12, 0x63 + .set OFFSET_REG_SOUND1CNT_X, 0x64 + .set OFFSET_REG_NR13, 0x64 + .set OFFSET_REG_NR14, 0x65 + .set OFFSET_REG_SOUND2CNT, 0x68 + .set OFFSET_REG_SOUND2CNT_L, 0x68 + .set OFFSET_REG_NR21, 0x68 + .set OFFSET_REG_NR22, 0x69 + .set OFFSET_REG_SOUND2CNT_H, 0x6c + .set OFFSET_REG_NR23, 0x6c + .set OFFSET_REG_NR24, 0x6d + .set OFFSET_REG_SOUND3CNT, 0x70 + .set OFFSET_REG_SOUND3CNT_L, 0x70 + .set OFFSET_REG_NR30, 0x70 + .set OFFSET_REG_SOUND3CNT_H, 0x72 + .set OFFSET_REG_NR31, 0x72 + .set OFFSET_REG_NR32, 0x73 + .set OFFSET_REG_SOUND3CNT_X, 0x74 + .set OFFSET_REG_NR33, 0x74 + .set OFFSET_REG_NR34, 0x75 + .set OFFSET_REG_SOUND4CNT, 0x78 + .set OFFSET_REG_SOUND4CNT_L, 0x78 + .set OFFSET_REG_NR41, 0x78 + .set OFFSET_REG_NR42, 0x79 + .set OFFSET_REG_SOUND4CNT_H, 0x7c + .set OFFSET_REG_NR43, 0x7c + .set OFFSET_REG_NR44, 0x7d + .set OFFSET_REG_SOUNDCNT, 0x80 + .set OFFSET_REG_SOUNDCNT_L, 0x80 + .set OFFSET_REG_NR50, 0x80 + .set OFFSET_REG_NR51, 0x81 + .set OFFSET_REG_SOUNDCNT_H, 0x82 + .set OFFSET_REG_SOUNDCNT_X, 0x84 + .set OFFSET_REG_NR52, 0x84 + .set OFFSET_REG_SOUNDBIAS, 0x88 + .set OFFSET_REG_WAVE_RAM, 0x90 + .set OFFSET_REG_WAVE_RAM0, 0x90 + .set OFFSET_REG_WAVE_RAM0_L, 0x90 + .set OFFSET_REG_WAVE_RAM0_H, 0x92 + .set OFFSET_REG_WAVE_RAM1, 0x94 + .set OFFSET_REG_WAVE_RAM1_L, 0x94 + .set OFFSET_REG_WAVE_RAM1_H, 0x96 + .set OFFSET_REG_WAVE_RAM2, 0x98 + .set OFFSET_REG_WAVE_RAM2_L, 0x98 + .set OFFSET_REG_WAVE_RAM2_H, 0x9a + .set OFFSET_REG_WAVE_RAM3, 0x9c + .set OFFSET_REG_WAVE_RAM3_L, 0x9c + .set OFFSET_REG_WAVE_RAM3_H, 0x9e + .set OFFSET_REG_FIFO, 0xa0 + .set OFFSET_REG_FIFO_A, 0xa0 + .set OFFSET_REG_FIFO_A_L, 0xa0 + .set OFFSET_REG_FIFO_A_H, 0xa2 + .set OFFSET_REG_FIFO_B, 0xa4 + .set OFFSET_REG_FIFO_B_L, 0xa4 + .set OFFSET_REG_FIFO_B_H, 0xa6 + + .set OFFSET_REG_DMA0, 0xb0 + .set OFFSET_REG_DMA0SAD, 0xb0 + .set OFFSET_REG_DMA0SAD_L, 0xb0 + .set OFFSET_REG_DMA0SAD_H, 0xb2 + .set OFFSET_REG_DMA0DAD, 0xb4 + .set OFFSET_REG_DMA0DAD_L, 0xb4 + .set OFFSET_REG_DMA0DAD_H, 0xb6 + .set OFFSET_REG_DMA0CNT, 0xb8 + .set OFFSET_REG_DMA0CNT_L, 0xb8 + .set OFFSET_REG_DMA0CNT_H, 0xba + .set OFFSET_REG_DMA1, 0xbc + .set OFFSET_REG_DMA1SAD, 0xbc + .set OFFSET_REG_DMA1SAD_L, 0xbc + .set OFFSET_REG_DMA1SAD_H, 0xbe + .set OFFSET_REG_DMA1DAD, 0xc0 + .set OFFSET_REG_DMA1DAD_L, 0xc0 + .set OFFSET_REG_DMA1DAD_H, 0xc2 + .set OFFSET_REG_DMA1CNT, 0xc4 + .set OFFSET_REG_DMA1CNT_L, 0xc4 + .set OFFSET_REG_DMA1CNT_H, 0xc6 + .set OFFSET_REG_DMA2, 0xc8 + .set OFFSET_REG_DMA2SAD, 0xc8 + .set OFFSET_REG_DMA2SAD_L, 0xc8 + .set OFFSET_REG_DMA2SAD_H, 0xca + .set OFFSET_REG_DMA2DAD, 0xcc + .set OFFSET_REG_DMA2DAD_L, 0xcc + .set OFFSET_REG_DMA2DAD_H, 0xce + .set OFFSET_REG_DMA2CNT, 0xd0 + .set OFFSET_REG_DMA2CNT_L, 0xd0 + .set OFFSET_REG_DMA2CNT_H, 0xd2 + .set OFFSET_REG_DMA3, 0xd4 + .set OFFSET_REG_DMA3SAD, 0xd4 + .set OFFSET_REG_DMA3SAD_L, 0xd4 + .set OFFSET_REG_DMA3SAD_H, 0xd6 + .set OFFSET_REG_DMA3DAD, 0xd8 + .set OFFSET_REG_DMA3DAD_L, 0xd8 + .set OFFSET_REG_DMA3DAD_H, 0xda + .set OFFSET_REG_DMA3CNT, 0xdc + .set OFFSET_REG_DMA3CNT_L, 0xdc + .set OFFSET_REG_DMA3CNT_H, 0xde + + .set OFFSET_REG_TM0CNT, 0x100 + .set OFFSET_REG_TM0CNT_L, 0x100 + .set OFFSET_REG_TM0CNT_H, 0x102 + .set OFFSET_REG_TM1CNT, 0x104 + .set OFFSET_REG_TM1CNT_L, 0x104 + .set OFFSET_REG_TM1CNT_H, 0x106 + .set OFFSET_REG_TM2CNT, 0x108 + .set OFFSET_REG_TM2CNT_L, 0x108 + .set OFFSET_REG_TM2CNT_H, 0x10a + .set OFFSET_REG_TM3CNT, 0x10c + .set OFFSET_REG_TM3CNT_L, 0x10c + .set OFFSET_REG_TM3CNT_H, 0x10e + + .set OFFSET_REG_SIOCNT, 0x128 + .set OFFSET_REG_SIODATA8, 0x12a + .set OFFSET_REG_SIODATA32, 0x120 + .set OFFSET_REG_SIOMLT_SEND, 0x12a + .set OFFSET_REG_SIOMLT_RECV, 0x120 + .set OFFSET_REG_SIOMULTI0, 0x120 + .set OFFSET_REG_SIOMULTI1, 0x122 + .set OFFSET_REG_SIOMULTI2, 0x124 + .set OFFSET_REG_SIOMULTI3, 0x126 + + .set OFFSET_REG_KEYINPUT, 0x130 + .set OFFSET_REG_KEYCNT, 0x132 + + .set OFFSET_REG_RCNT, 0x134 + + .set OFFSET_REG_JOYCNT, 0x140 + .set OFFSET_REG_JOYSTAT, 0x158 + .set OFFSET_REG_JOY_RECV, 0x150 + .set OFFSET_REG_JOY_RECV_L, 0x150 + .set OFFSET_REG_JOY_RECV_H, 0x152 + .set OFFSET_REG_JOY_TRANS, 0x154 + .set OFFSET_REG_JOY_TRANS_L, 0x154 + .set OFFSET_REG_JOY_TRANS_H, 0x156 + + .set OFFSET_REG_IME, 0x208 + .set OFFSET_REG_IE, 0x200 + .set OFFSET_REG_IF, 0x202 + + .set OFFSET_REG_WAITCNT, 0x204 + +@ I/O register addresses + .set REG_DISPCNT, REG_BASE + OFFSET_REG_DISPCNT + .set REG_DISPSTAT, REG_BASE + OFFSET_REG_DISPSTAT + .set REG_VCOUNT, REG_BASE + OFFSET_REG_VCOUNT + .set REG_BG0CNT, REG_BASE + OFFSET_REG_BG0CNT + .set REG_BG1CNT, REG_BASE + OFFSET_REG_BG1CNT + .set REG_BG2CNT, REG_BASE + OFFSET_REG_BG2CNT + .set REG_BG3CNT, REG_BASE + OFFSET_REG_BG3CNT + .set REG_BG0HOFS, REG_BASE + OFFSET_REG_BG0HOFS + .set REG_BG0VOFS, REG_BASE + OFFSET_REG_BG0VOFS + .set REG_BG1HOFS, REG_BASE + OFFSET_REG_BG1HOFS + .set REG_BG1VOFS, REG_BASE + OFFSET_REG_BG1VOFS + .set REG_BG2HOFS, REG_BASE + OFFSET_REG_BG2HOFS + .set REG_BG2VOFS, REG_BASE + OFFSET_REG_BG2VOFS + .set REG_BG3HOFS, REG_BASE + OFFSET_REG_BG3HOFS + .set REG_BG3VOFS, REG_BASE + OFFSET_REG_BG3VOFS + .set REG_BG2PA, REG_BASE + OFFSET_REG_BG2PA + .set REG_BG2PB, REG_BASE + OFFSET_REG_BG2PB + .set REG_BG2PC, REG_BASE + OFFSET_REG_BG2PC + .set REG_BG2PD, REG_BASE + OFFSET_REG_BG2PD + .set REG_BG2X_L, REG_BASE + OFFSET_REG_BG2X_L + .set REG_BG2X_H, REG_BASE + OFFSET_REG_BG2X_H + .set REG_BG2Y_L, REG_BASE + OFFSET_REG_BG2Y_L + .set REG_BG2Y_H, REG_BASE + OFFSET_REG_BG2Y_H + .set REG_BG3PA, REG_BASE + OFFSET_REG_BG3PA + .set REG_BG3PB, REG_BASE + OFFSET_REG_BG3PB + .set REG_BG3PC, REG_BASE + OFFSET_REG_BG3PC + .set REG_BG3PD, REG_BASE + OFFSET_REG_BG3PD + .set REG_BG3X_L, REG_BASE + OFFSET_REG_BG3X_L + .set REG_BG3X_H, REG_BASE + OFFSET_REG_BG3X_H + .set REG_BG3Y_L, REG_BASE + OFFSET_REG_BG3Y_L + .set REG_BG3Y_H, REG_BASE + OFFSET_REG_BG3Y_H + .set REG_WIN0H, REG_BASE + OFFSET_REG_WIN0H + .set REG_WIN1H, REG_BASE + OFFSET_REG_WIN1H + .set REG_WIN0V, REG_BASE + OFFSET_REG_WIN0V + .set REG_WIN1V, REG_BASE + OFFSET_REG_WIN1V + .set REG_WININ, REG_BASE + OFFSET_REG_WININ + .set REG_WINOUT, REG_BASE + OFFSET_REG_WINOUT + .set REG_MOSAIC, REG_BASE + OFFSET_REG_MOSAIC + .set REG_BLDCNT, REG_BASE + OFFSET_REG_BLDCNT + .set REG_BLDALPHA, REG_BASE + OFFSET_REG_BLDALPHA + .set REG_BLDY, REG_BASE + OFFSET_REG_BLDY + + .set REG_SOUND1CNT, REG_BASE + OFFSET_REG_SOUND1CNT + .set REG_SOUND1CNT_L, REG_BASE + OFFSET_REG_SOUND1CNT_L + .set REG_NR10, REG_BASE + OFFSET_REG_NR10 + .set REG_SOUND1CNT_H, REG_BASE + OFFSET_REG_SOUND1CNT_H + .set REG_NR11, REG_BASE + OFFSET_REG_NR11 + .set REG_NR12, REG_BASE + OFFSET_REG_NR12 + .set REG_SOUND1CNT_X, REG_BASE + OFFSET_REG_SOUND1CNT_X + .set REG_NR13, REG_BASE + OFFSET_REG_NR13 + .set REG_NR14, REG_BASE + OFFSET_REG_NR14 + .set REG_SOUND2CNT, REG_BASE + OFFSET_REG_SOUND2CNT + .set REG_SOUND2CNT_L, REG_BASE + OFFSET_REG_SOUND2CNT_L + .set REG_NR21, REG_BASE + OFFSET_REG_NR21 + .set REG_NR22, REG_BASE + OFFSET_REG_NR22 + .set REG_SOUND2CNT_H, REG_BASE + OFFSET_REG_SOUND2CNT_H + .set REG_NR23, REG_BASE + OFFSET_REG_NR23 + .set REG_NR24, REG_BASE + OFFSET_REG_NR24 + .set REG_SOUND3CNT, REG_BASE + OFFSET_REG_SOUND3CNT + .set REG_SOUND3CNT_L, REG_BASE + OFFSET_REG_SOUND3CNT_L + .set REG_NR30, REG_BASE + OFFSET_REG_NR30 + .set REG_SOUND3CNT_H, REG_BASE + OFFSET_REG_SOUND3CNT_H + .set REG_NR31, REG_BASE + OFFSET_REG_NR31 + .set REG_NR32, REG_BASE + OFFSET_REG_NR32 + .set REG_SOUND3CNT_X, REG_BASE + OFFSET_REG_SOUND3CNT_X + .set REG_NR33, REG_BASE + OFFSET_REG_NR33 + .set REG_NR34, REG_BASE + OFFSET_REG_NR34 + .set REG_SOUND4CNT, REG_BASE + OFFSET_REG_SOUND4CNT + .set REG_SOUND4CNT_L, REG_BASE + OFFSET_REG_SOUND4CNT_L + .set REG_NR41, REG_BASE + OFFSET_REG_NR41 + .set REG_NR42, REG_BASE + OFFSET_REG_NR42 + .set REG_SOUND4CNT_H, REG_BASE + OFFSET_REG_SOUND4CNT_H + .set REG_NR43, REG_BASE + OFFSET_REG_NR43 + .set REG_NR44, REG_BASE + OFFSET_REG_NR44 + .set REG_SOUNDCNT, REG_BASE + OFFSET_REG_SOUNDCNT + .set REG_SOUNDCNT_L, REG_BASE + OFFSET_REG_SOUNDCNT_L + .set REG_NR50, REG_BASE + OFFSET_REG_NR50 + .set REG_NR51, REG_BASE + OFFSET_REG_NR51 + .set REG_SOUNDCNT_H, REG_BASE + OFFSET_REG_SOUNDCNT_H + .set REG_SOUNDCNT_X, REG_BASE + OFFSET_REG_SOUNDCNT_X + .set REG_NR52, REG_BASE + OFFSET_REG_NR52 + .set REG_SOUNDBIAS, REG_BASE + OFFSET_REG_SOUNDBIAS + .set REG_WAVE_RAM, REG_BASE + OFFSET_REG_WAVE_RAM + .set REG_WAVE_RAM0, REG_BASE + OFFSET_REG_WAVE_RAM0 + .set REG_WAVE_RAM0_L, REG_BASE + OFFSET_REG_WAVE_RAM0_L + .set REG_WAVE_RAM0_H, REG_BASE + OFFSET_REG_WAVE_RAM0_H + .set REG_WAVE_RAM1, REG_BASE + OFFSET_REG_WAVE_RAM1 + .set REG_WAVE_RAM1_L, REG_BASE + OFFSET_REG_WAVE_RAM1_L + .set REG_WAVE_RAM1_H, REG_BASE + OFFSET_REG_WAVE_RAM1_H + .set REG_WAVE_RAM2, REG_BASE + OFFSET_REG_WAVE_RAM2 + .set REG_WAVE_RAM2_L, REG_BASE + OFFSET_REG_WAVE_RAM2_L + .set REG_WAVE_RAM2_H, REG_BASE + OFFSET_REG_WAVE_RAM2_H + .set REG_WAVE_RAM3, REG_BASE + OFFSET_REG_WAVE_RAM3 + .set REG_WAVE_RAM3_L, REG_BASE + OFFSET_REG_WAVE_RAM3_L + .set REG_WAVE_RAM3_H, REG_BASE + OFFSET_REG_WAVE_RAM3_H + .set REG_FIFO, REG_BASE + OFFSET_REG_FIFO + .set REG_FIFO_A, REG_BASE + OFFSET_REG_FIFO_A + .set REG_FIFO_A_L, REG_BASE + OFFSET_REG_FIFO_A_L + .set REG_FIFO_A_H, REG_BASE + OFFSET_REG_FIFO_A_H + .set REG_FIFO_B, REG_BASE + OFFSET_REG_FIFO_B + .set REG_FIFO_B_L, REG_BASE + OFFSET_REG_FIFO_B_L + .set REG_FIFO_B_H, REG_BASE + OFFSET_REG_FIFO_B_H + + .set REG_DMA0, REG_BASE + OFFSET_REG_DMA0 + .set REG_DMA0SAD, REG_BASE + OFFSET_REG_DMA0SAD + .set REG_DMA0SAD_L, REG_BASE + OFFSET_REG_DMA0SAD_L + .set REG_DMA0SAD_H, REG_BASE + OFFSET_REG_DMA0SAD_H + .set REG_DMA0DAD, REG_BASE + OFFSET_REG_DMA0DAD + .set REG_DMA0DAD_L, REG_BASE + OFFSET_REG_DMA0DAD_L + .set REG_DMA0DAD_H, REG_BASE + OFFSET_REG_DMA0DAD_H + .set REG_DMA0CNT, REG_BASE + OFFSET_REG_DMA0CNT + .set REG_DMA0CNT_L, REG_BASE + OFFSET_REG_DMA0CNT_L + .set REG_DMA0CNT_H, REG_BASE + OFFSET_REG_DMA0CNT_H + .set REG_DMA1, REG_BASE + OFFSET_REG_DMA1 + .set REG_DMA1SAD, REG_BASE + OFFSET_REG_DMA1SAD + .set REG_DMA1SAD_L, REG_BASE + OFFSET_REG_DMA1SAD_L + .set REG_DMA1SAD_H, REG_BASE + OFFSET_REG_DMA1SAD_H + .set REG_DMA1DAD, REG_BASE + OFFSET_REG_DMA1DAD + .set REG_DMA1DAD_L, REG_BASE + OFFSET_REG_DMA1DAD_L + .set REG_DMA1DAD_H, REG_BASE + OFFSET_REG_DMA1DAD_H + .set REG_DMA1CNT, REG_BASE + OFFSET_REG_DMA1CNT + .set REG_DMA1CNT_L, REG_BASE + OFFSET_REG_DMA1CNT_L + .set REG_DMA1CNT_H, REG_BASE + OFFSET_REG_DMA1CNT_H + .set REG_DMA2, REG_BASE + OFFSET_REG_DMA2 + .set REG_DMA2SAD, REG_BASE + OFFSET_REG_DMA2SAD + .set REG_DMA2SAD_L, REG_BASE + OFFSET_REG_DMA2SAD_L + .set REG_DMA2SAD_H, REG_BASE + OFFSET_REG_DMA2SAD_H + .set REG_DMA2DAD, REG_BASE + OFFSET_REG_DMA2DAD + .set REG_DMA2DAD_L, REG_BASE + OFFSET_REG_DMA2DAD_L + .set REG_DMA2DAD_H, REG_BASE + OFFSET_REG_DMA2DAD_H + .set REG_DMA2CNT, REG_BASE + OFFSET_REG_DMA2CNT + .set REG_DMA2CNT_L, REG_BASE + OFFSET_REG_DMA2CNT_L + .set REG_DMA2CNT_H, REG_BASE + OFFSET_REG_DMA2CNT_H + .set REG_DMA3, REG_BASE + OFFSET_REG_DMA3 + .set REG_DMA3SAD, REG_BASE + OFFSET_REG_DMA3SAD + .set REG_DMA3SAD_L, REG_BASE + OFFSET_REG_DMA3SAD_L + .set REG_DMA3SAD_H, REG_BASE + OFFSET_REG_DMA3SAD_H + .set REG_DMA3DAD, REG_BASE + OFFSET_REG_DMA3DAD + .set REG_DMA3DAD_L, REG_BASE + OFFSET_REG_DMA3DAD_L + .set REG_DMA3DAD_H, REG_BASE + OFFSET_REG_DMA3DAD_H + .set REG_DMA3CNT, REG_BASE + OFFSET_REG_DMA3CNT + .set REG_DMA3CNT_L, REG_BASE + OFFSET_REG_DMA3CNT_L + .set REG_DMA3CNT_H, REG_BASE + OFFSET_REG_DMA3CNT_H + + .set REG_TM0CNT, REG_BASE + OFFSET_REG_TM0CNT + .set REG_TM0CNT_L, REG_BASE + OFFSET_REG_TM0CNT_L + .set REG_TM0CNT_H, REG_BASE + OFFSET_REG_TM0CNT_H + .set REG_TM1CNT, REG_BASE + OFFSET_REG_TM1CNT + .set REG_TM1CNT_L, REG_BASE + OFFSET_REG_TM1CNT_L + .set REG_TM1CNT_H, REG_BASE + OFFSET_REG_TM1CNT_H + .set REG_TM2CNT, REG_BASE + OFFSET_REG_TM2CNT + .set REG_TM2CNT_L, REG_BASE + OFFSET_REG_TM2CNT_L + .set REG_TM2CNT_H, REG_BASE + OFFSET_REG_TM2CNT_H + .set REG_TM3CNT, REG_BASE + OFFSET_REG_TM3CNT + .set REG_TM3CNT_L, REG_BASE + OFFSET_REG_TM3CNT_L + .set REG_TM3CNT_H, REG_BASE + OFFSET_REG_TM3CNT_H + + .set REG_SIOCNT, REG_BASE + OFFSET_REG_SIOCNT + .set REG_SIODATA8, REG_BASE + OFFSET_REG_SIODATA8 + .set REG_SIODATA32, REG_BASE + OFFSET_REG_SIODATA32 + .set REG_SIOMLT_SEND, REG_BASE + OFFSET_REG_SIOMLT_SEND + .set REG_SIOMLT_RECV, REG_BASE + OFFSET_REG_SIOMLT_RECV + .set REG_SIOMULTI0, REG_BASE + OFFSET_REG_SIOMULTI0 + .set REG_SIOMULTI1, REG_BASE + OFFSET_REG_SIOMULTI1 + .set REG_SIOMULTI2, REG_BASE + OFFSET_REG_SIOMULTI2 + .set REG_SIOMULTI3, REG_BASE + OFFSET_REG_SIOMULTI3 + + .set REG_KEYINPUT, REG_BASE + OFFSET_REG_KEYINPUT + .set REG_KEYCNT, REG_BASE + OFFSET_REG_KEYCNT + + .set REG_RCNT, REG_BASE + OFFSET_REG_RCNT + + .set REG_JOYCNT, REG_BASE + OFFSET_REG_JOYCNT + .set REG_JOYSTAT, REG_BASE + OFFSET_REG_JOYSTAT + .set REG_JOY_RECV, REG_BASE + OFFSET_REG_JOY_RECV + .set REG_JOY_RECV_L, REG_BASE + OFFSET_REG_JOY_RECV_L + .set REG_JOY_RECV_H, REG_BASE + OFFSET_REG_JOY_RECV_H + .set REG_JOY_TRANS, REG_BASE + OFFSET_REG_JOY_TRANS + .set REG_JOY_TRANS_L, REG_BASE + OFFSET_REG_JOY_TRANS_L + .set REG_JOY_TRANS_H, REG_BASE + OFFSET_REG_JOY_TRANS_H + + .set REG_IME, REG_BASE + OFFSET_REG_IME + .set REG_IE, REG_BASE + OFFSET_REG_IE + .set REG_IF, REG_BASE + OFFSET_REG_IF + + .set REG_WAITCNT, REG_BASE + OFFSET_REG_WAITCNT + +@ DMA register constants + + .set DMA_DEST_INC, 0x0000 + .set DMA_DEST_DEC, 0x0020 + .set DMA_DEST_FIXED, 0x0040 + .set DMA_DEST_RELOAD, 0x0060 + .set DMA_SRC_INC, 0x0000 + .set DMA_SRC_DEC, 0x0080 + .set DMA_SRC_FIXED, 0x0100 + .set DMA_REPEAT, 0x0200 + .set DMA_16BIT, 0x0000 + .set DMA_32BIT, 0x0400 + .set DMA_DREQ_ON, 0x0800 + .set DMA_START_NOW, 0x0000 + .set DMA_START_VBLANK, 0x1000 + .set DMA_START_HBLANK, 0x2000 + .set DMA_START_SPECIAL, 0x3000 + .set DMA_INTR_ENABLE, 0x4000 + .set DMA_ENABLE, 0x8000 + +@ OAM attribute constants + + .set OAM_OBJ_NORMAL, 0x00000000 + .set OAM_OBJ_BLEND, 0x00000400 + .set OAM_OBJ_WINDOW, 0x00000800 + + .set OAM_AFFINE_NONE, 0x00000000 + .set OAM_AFFINE_NORMAL_SIZE, 0x00000100 + .set OAM_OBJ_DISABLED, 0x00000200 + .set OAM_AFFINE_DOUBLE_SIZE, 0x00000300 + + .set OAM_MOSAIC_OFF, 0x00000000 + .set OAM_MOSAIC_ON, 0x00001000 + + .set OAM_4BPP, 0x00000000 + .set OAM_8BPP, 0x00002000 + + .set OAM_H_FLIP, 0x10000000 + .set OAM_V_FLIP, 0x20000000 + + .set OAM_SQUARE, 0x00000000 + .set OAM_H_RECTANGLE, 0x00004000 + .set OAM_V_RECTANGLE, 0x00008000 + .set OAM_SIZE_0, 0x00000000 + .set OAM_SIZE_1, 0x40000000 + .set OAM_SIZE_2, 0x80000000 + .set OAM_SIZE_3, 0xc0000000 + + .set OAM_SIZE_8x8, OAM_SIZE_0 | OAM_SQUARE + .set OAM_SIZE_16x16, OAM_SIZE_1 | OAM_SQUARE + .set OAM_SIZE_32x32, OAM_SIZE_2 | OAM_SQUARE + .set OAM_SIZE_64x64, OAM_SIZE_3 | OAM_SQUARE + + .set OAM_SIZE_16x8, OAM_SIZE_0 | OAM_H_RECTANGLE + .set OAM_SIZE_32x8, OAM_SIZE_1 | OAM_H_RECTANGLE + .set OAM_SIZE_32x16, OAM_SIZE_2 | OAM_H_RECTANGLE + .set OAM_SIZE_64x32, OAM_SIZE_3 | OAM_H_RECTANGLE + + .set OAM_SIZE_8x16, OAM_SIZE_0 | OAM_V_RECTANGLE + .set OAM_SIZE_8x32, OAM_SIZE_1 | OAM_V_RECTANGLE + .set OAM_SIZE_16x32, OAM_SIZE_2 | OAM_V_RECTANGLE + .set OAM_SIZE_32x64, OAM_SIZE_3 | OAM_V_RECTANGLE diff --git a/include/asm/constants/m4a_constants.inc b/include/asm/constants/m4a_constants.inc new file mode 100644 index 0000000..62ca5bb --- /dev/null +++ b/include/asm/constants/m4a_constants.inc @@ -0,0 +1,199 @@ + .equiv ID_NUMBER, 0x68736d53 + + .equiv PCM_DMA_BUF_SIZE, 1584 + + .equiv TONEDATA_TYPE_CGB, 0x07 + .equiv TONEDATA_TYPE_FIX, 0x08 + .equiv TONEDATA_TYPE_SPL, 0x40 @ key split + .equiv TONEDATA_TYPE_RHY, 0x80 @ rhythm + + .macro struct_begin + .struct 0 + .endm + + .macro struct_field name, size +\name: + .struct \name + \size + .endm + + struct_begin + struct_field o_SoundInfo_ident, 4 + struct_field o_SoundInfo_pcmDmaCounter, 1 + struct_field o_SoundInfo_reverb, 1 + struct_field o_SoundInfo_maxChans, 1 + struct_field o_SoundInfo_masterVolume, 1 + struct_field o_SoundInfo_freq, 1 + struct_field o_SoundInfo_mode, 1 + struct_field o_SoundInfo_c15, 1 + struct_field o_SoundInfo_pcmDmaPeriod, 1 + struct_field o_SoundInfo_maxLines, 1 + struct_field o_SoundInfo_gap, 3 + struct_field o_SoundInfo_pcmSamplesPerVBlank, 4 + struct_field o_SoundInfo_pcmFreq, 4 + struct_field o_SoundInfo_divFreq, 4 + struct_field o_SoundInfo_cgbChans, 4 + struct_field o_SoundInfo_func, 4 + struct_field o_SoundInfo_intp, 4 + struct_field o_SoundInfo_CgbSound, 4 + struct_field o_SoundInfo_CgbOscOff, 4 + struct_field o_SoundInfo_MidiKeyToCgbFreq, 4 + struct_field o_SoundInfo_MPlayJumpTable, 4 + struct_field o_SoundInfo_plynote, 4 + struct_field o_SoundInfo_ExtVolPit, 4 + struct_field o_SoundInfo_gap2, 16 + struct_field o_SoundInfo_chans, 768 + struct_field o_SoundInfo_pcmBuffer, PCM_DMA_BUF_SIZE * 2 + struct_field SoundInfo_size, 0 + + struct_begin + struct_field o_SoundChannel_status, 1 + struct_field o_SoundChannel_type, 1 + struct_field o_SoundChannel_rightVolume, 1 + struct_field o_SoundChannel_leftVolume, 1 + struct_field o_SoundChannel_attack, 1 + struct_field o_SoundChannel_decay, 1 + struct_field o_SoundChannel_sustain, 1 + struct_field o_SoundChannel_release, 1 + struct_field o_SoundChannel_ky, 1 + struct_field o_SoundChannel_ev, 1 + struct_field o_SoundChannel_er, 1 + struct_field o_SoundChannel_el, 1 + struct_field o_SoundChannel_iev, 1 + struct_field o_SoundChannel_iel, 1 + struct_field o_SoundChannel_d1, 1 + struct_field o_SoundChannel_d2, 1 + struct_field o_SoundChannel_gt, 1 + struct_field o_SoundChannel_mk, 1 + struct_field o_SoundChannel_ve, 1 + struct_field o_SoundChannel_pr, 1 + struct_field o_SoundChannel_rp, 1 + struct_field o_SoundChannel_d3, 3 + struct_field o_SoundChannel_ct, 4 + struct_field o_SoundChannel_fw, 4 + struct_field o_SoundChannel_freq, 4 + struct_field o_SoundChannel_wav, 4 + struct_field o_SoundChannel_cp, 4 + struct_field o_SoundChannel_track, 4 + struct_field o_SoundChannel_pp, 4 + struct_field o_SoundChannel_np, 4 + struct_field o_SoundChannel_d4, 4 + struct_field o_SoundChannel_xpi, 2 + struct_field o_SoundChannel_xpc, 2 + struct_field SoundChannel_size, 0 + + struct_begin + struct_field o_MusicPlayerTrack_flags, 1 + struct_field o_MusicPlayerTrack_wait, 1 + struct_field o_MusicPlayerTrack_patternLevel, 1 + struct_field o_MusicPlayerTrack_repN, 1 + struct_field o_MusicPlayerTrack_gateTime, 1 + struct_field o_MusicPlayerTrack_key, 1 + struct_field o_MusicPlayerTrack_velocity, 1 + struct_field o_MusicPlayerTrack_runningStatus, 1 + struct_field o_MusicPlayerTrack_keyM, 1 + struct_field o_MusicPlayerTrack_pitM, 1 + struct_field o_MusicPlayerTrack_keyShift, 1 + struct_field o_MusicPlayerTrack_keyShiftX, 1 + struct_field o_MusicPlayerTrack_tune, 1 + struct_field o_MusicPlayerTrack_pitX, 1 + struct_field o_MusicPlayerTrack_bend, 1 + struct_field o_MusicPlayerTrack_bendRange, 1 + struct_field o_MusicPlayerTrack_volMR, 1 + struct_field o_MusicPlayerTrack_volML, 1 + struct_field o_MusicPlayerTrack_vol, 1 + struct_field o_MusicPlayerTrack_volX, 1 + struct_field o_MusicPlayerTrack_pan, 1 + struct_field o_MusicPlayerTrack_panX, 1 + struct_field o_MusicPlayerTrack_modM, 1 + struct_field o_MusicPlayerTrack_mod, 1 + struct_field o_MusicPlayerTrack_modT, 1 + struct_field o_MusicPlayerTrack_lfoSpeed, 1 + struct_field o_MusicPlayerTrack_lfoSpeedC, 1 + struct_field o_MusicPlayerTrack_lfoDelay, 1 + struct_field o_MusicPlayerTrack_lfoDelayC, 1 + struct_field o_MusicPlayerTrack_priority, 1 + struct_field o_MusicPlayerTrack_echoVolume, 1 + struct_field o_MusicPlayerTrack_echoLength, 1 + struct_field o_MusicPlayerTrack_chan, 4 + struct_field o_MusicPlayerTrack_ToneData_type, 1 + struct_field o_MusicPlayerTrack_ToneData_key, 1 + struct_field o_MusicPlayerTrack_ToneData_length, 1 + struct_field o_MusicPlayerTrack_ToneData_pan_sweep, 1 + struct_field o_MusicPlayerTrack_ToneData_wav, 4 + struct_field o_MusicPlayerTrack_ToneData_attack, 1 + struct_field o_MusicPlayerTrack_ToneData_decay, 1 + struct_field o_MusicPlayerTrack_ToneData_sustain, 1 + struct_field o_MusicPlayerTrack_ToneData_release, 1 + struct_field o_MusicPlayerTrack_gap, 10 + struct_field o_MusicPlayerTrack_unk_3A, 2 + struct_field o_MusicPlayerTrack_unk_3C, 4 + struct_field o_MusicPlayerTrack_cmdPtr, 4 + struct_field o_MusicPlayerTrack_patternStack, 12 + struct_field MusicPlayerTrack_size, 0 + + .equiv o_MusicPlayerTrack_ToneData_keySplitTable, o_MusicPlayerTrack_ToneData_attack + + struct_begin + struct_field o_MusicPlayerInfo_songHeader, 4 + struct_field o_MusicPlayerInfo_status, 4 + struct_field o_MusicPlayerInfo_trackCount, 1 + struct_field o_MusicPlayerInfo_priority, 1 + struct_field o_MusicPlayerInfo_cmd, 1 + struct_field o_MusicPlayerInfo_unk_B, 1 + struct_field o_MusicPlayerInfo_clock, 4 + struct_field o_MusicPlayerInfo_gap, 8 + struct_field o_MusicPlayerInfo_memAccArea, 4 + struct_field o_MusicPlayerInfo_tempoD, 2 + struct_field o_MusicPlayerInfo_tempoU, 2 + struct_field o_MusicPlayerInfo_tempoI, 2 + struct_field o_MusicPlayerInfo_tempoC, 2 + struct_field o_MusicPlayerInfo_fadeOI, 2 + struct_field o_MusicPlayerInfo_fadeOC, 2 + struct_field o_MusicPlayerInfo_fadeOV, 2 + struct_field o_MusicPlayerInfo_padding, 2 + struct_field o_MusicPlayerInfo_tracks, 4 + struct_field o_MusicPlayerInfo_tone, 4 + struct_field o_MusicPlayerInfo_ident, 4 + struct_field o_MusicPlayerInfo_func, 4 + struct_field o_MusicPlayerInfo_intp, 4 + struct_field MusicPlayerInfo_size, 0 + + struct_begin + struct_field o_CgbChannel_sf, 1 + struct_field o_CgbChannel_ty, 1 + struct_field o_CgbChannel_rightVolume, 1 + struct_field o_CgbChannel_leftVolume, 1 + struct_field o_CgbChannel_at, 1 + struct_field o_CgbChannel_de, 1 + struct_field o_CgbChannel_su, 1 + struct_field o_CgbChannel_re, 1 + struct_field o_CgbChannel_ky, 1 + struct_field o_CgbChannel_ev, 1 + struct_field o_CgbChannel_eg, 1 + struct_field o_CgbChannel_ec, 1 + struct_field o_CgbChannel_echoVolume, 1 + struct_field o_CgbChannel_echoLength, 1 + struct_field o_CgbChannel_d1, 1 + struct_field o_CgbChannel_d2, 1 + struct_field o_CgbChannel_gt, 1 + struct_field o_CgbChannel_mk, 1 + struct_field o_CgbChannel_ve, 1 + struct_field o_CgbChannel_pr, 1 + struct_field o_CgbChannel_rp, 1 + struct_field o_CgbChannel_d3, 3 + struct_field o_CgbChannel_d5, 1 + struct_field o_CgbChannel_sg, 1 + struct_field o_CgbChannel_n4, 1 + struct_field o_CgbChannel_pan, 1 + struct_field o_CgbChannel_panMask, 1 + struct_field o_CgbChannel_mo, 1 + struct_field o_CgbChannel_le, 1 + struct_field o_CgbChannel_sw, 1 + struct_field o_CgbChannel_fr, 4 + struct_field o_CgbChannel_wp, 4 + struct_field o_CgbChannel_cp, 4 + struct_field o_CgbChannel_tp, 4 + struct_field o_CgbChannel_pp, 4 + struct_field o_CgbChannel_np, 4 + struct_field o_CgbChannel_d4, 8 + struct_field CgbChannel_size, 0 diff --git a/include/asm/constants/script_func_constants.inc b/include/asm/constants/script_func_constants.inc new file mode 100644 index 0000000..157153d --- /dev/null +++ b/include/asm/constants/script_func_constants.inc @@ -0,0 +1,14 @@ +.set WAIT_START_FUNC, 0x03 +.set WAKEUP_FUNC, 0x20 +.set LOOK_AROUND_FUNC, 0x21 +.set JUMP_HAPPY_FUNC, 0x25 +.set JUMP_ANGRY_FUNC, 0x27 +.set NOTICE_FUNC, 0x28 +.set QUESTION_FUNC, 0x29 +.set SWEAT_FUNC, 0x2A +.set SHOCK_FUNC, 0x2B +.set SMILE_START_FUNC, 0x2E +.set SMILE_END_FUNC, 0x2F +.set INIT_SLEEP_FUNC, 0x35 +.set LIVES_WARP_ARRIVE_FUNC, 0x51 +.set LIVES_WARP_ARRIVE2_FUNC, 0x52 diff --git a/include/asm/macros.inc b/include/asm/macros.inc new file mode 100644 index 0000000..21adecd --- /dev/null +++ b/include/asm/macros.inc @@ -0,0 +1,3 @@ + #include "macros/function.inc" + #include "macros/music_voice.inc" + #include "macros/script.inc" diff --git a/include/asm/macros/function.inc b/include/asm/macros/function.inc new file mode 100644 index 0000000..67fb373 --- /dev/null +++ b/include/asm/macros/function.inc @@ -0,0 +1,29 @@ + .macro arm_func_start name + .align 2, 0 + .global \name + .arm + .type \name, function + .endm + + .macro arm_func_end name + .size \name, .-\name + .endm + + .macro thumb_func_start name + .align 2, 0 + .global \name + .thumb + .thumb_func + .type \name, function + .endm + + .macro non_word_aligned_thumb_func_start name + .global \name + .thumb + .thumb_func + .type \name, function + .endm + + .macro thumb_func_end name + .size \name, .-\name + .endm diff --git a/include/asm/macros/m4a.inc b/include/asm/macros/m4a.inc new file mode 100644 index 0000000..6c5abc0 --- /dev/null +++ b/include/asm/macros/m4a.inc @@ -0,0 +1,13 @@ + .macro song label, music_player, unknown + .4byte \label + .2byte \music_player + .2byte \unknown + .endm + + .macro music_player info_struct, track_struct, unknown_1, unknown_2 + .4byte \info_struct + .4byte \track_struct + .byte \unknown_1 + .space 1 + .2byte \unknown_2 + .endm diff --git a/include/asm/macros/music_voice.inc b/include/asm/macros/music_voice.inc new file mode 100644 index 0000000..7dd6c74 --- /dev/null +++ b/include/asm/macros/music_voice.inc @@ -0,0 +1,140 @@ + .macro voice_directsound base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req + .byte 0 + _voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release + .endm + + .macro voice_directsound_no_resample base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req + .byte 8 + _voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release + .endm + + .macro voice_directsound_alt base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req + .byte 16 + _voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release + .endm + + .macro _voice_directsound base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req + .byte \base_midi_key + .byte 0 + .if \pan != 0 + .byte (0x80 | \pan) + .else + .byte 0 + .endif + .4byte \sample_data_pointer + .byte \attack + .byte \decay + .byte \sustain + .byte \release + .endm + + .macro voice_square_1 base_midi_key:req, pan:req, sweep:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req + _voice_square_1 1, \base_midi_key, \pan, \sweep, \duty_cycle, \attack, \decay, \sustain, \release + .endm + + .macro voice_square_1_alt base_midi_key:req, pan:req, sweep:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req + _voice_square_1 9, \base_midi_key, \pan, \sweep, \duty_cycle, \attack, \decay, \sustain, \release + .endm + + .macro _voice_square_1 type:req, base_midi_key:req, pan:req, sweep:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req + .byte \type + .byte \base_midi_key + .if \pan != 0 + .byte (0x80 | \pan) + .else + .byte 0 + .endif + .byte \sweep + .byte (\duty_cycle & 0x3) + .byte 0, 0, 0 + .byte (\attack & 0x7) + .byte (\decay & 0x7) + .byte (\sustain & 0xF) + .byte (\release & 0x7) + .endm + + .macro voice_square_2 base_midi_key:req, pan:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req + _voice_square_2 2, \base_midi_key, \pan, \duty_cycle, \attack, \decay, \sustain, \release + .endm + + .macro voice_square_2_alt base_midi_key:req, pan:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req + _voice_square_2 10, \base_midi_key, \pan, \duty_cycle, \attack, \decay, \sustain, \release + .endm + + .macro _voice_square_2 type:req, base_midi_key:req, pan:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req + .byte \type + .byte \base_midi_key + .if \pan != 0 + .byte (0x80 | \pan) + .else + .byte 0 + .endif + .byte 0 + .byte (\duty_cycle & 0x3) + .byte 0, 0, 0 + .byte (\attack & 0x7) + .byte (\decay & 0x7) + .byte (\sustain & 0xF) + .byte (\release & 0x7) + .endm + + .macro voice_programmable_wave base_midi_key:req, pan:req, wave_samples_pointer:req, attack:req, decay:req, sustain:req, release:req + _voice_programmable_wave 3, \base_midi_key, \pan, \wave_samples_pointer, \attack, \decay, \sustain, \release + .endm + + .macro voice_programmable_wave_alt base_midi_key:req, pan:req, wave_samples_pointer:req, attack:req, decay:req, sustain:req, release:req + _voice_programmable_wave 11, \base_midi_key, \pan, \wave_samples_pointer, \attack, \decay, \sustain, \release + .endm + + .macro _voice_programmable_wave type:req, base_midi_key:req, pan:req, wave_samples_pointer:req, attack:req, decay:req, sustain:req, release:req + .byte \type + .byte \base_midi_key + .if \pan != 0 + .byte (0x80 | \pan) + .else + .byte 0 + .endif + .byte 0 + .4byte \wave_samples_pointer + .byte (\attack & 0x7) + .byte (\decay & 0x7) + .byte (\sustain & 0xF) + .byte (\release & 0x7) + .endm + + .macro voice_noise base_midi_key:req, pan:req, period:req, attack:req, decay:req, sustain:req, release:req + _voice_noise 4, \base_midi_key, \pan, \period, \attack, \decay, \sustain, \release + .endm + + .macro voice_noise_alt base_midi_key:req, pan:req, period:req, attack:req, decay:req, sustain:req, release:req + _voice_noise 12, \base_midi_key, \pan, \period, \attack, \decay, \sustain, \release + .endm + + .macro _voice_noise type:req, base_midi_key:req, pan:req, period:req, attack:req, decay:req, sustain:req, release:req + .byte \type + .byte \base_midi_key + .if \pan != 0 + .byte (0x80 | \pan) + .else + .byte 0 + .endif + .byte 0 + .byte (\period & 0x1) + .byte 0, 0, 0 + .byte (\attack & 0x7) + .byte (\decay & 0x7) + .byte (\sustain & 0xF) + .byte (\release & 0x7) + .endm + + .macro voice_keysplit voice_group_pointer:req, keysplit_table_pointer:req + .byte 0x40, 0, 0, 0 + .4byte \voice_group_pointer + .4byte \keysplit_table_pointer + .endm + + .macro voice_keysplit_all voice_group_pointer:req + .byte 0x80, 0, 0, 0 + .4byte \voice_group_pointer + .4byte 0 + .endm diff --git a/include/asm/macros/script.inc b/include/asm/macros/script.inc new file mode 100644 index 0000000..8ef4bd8 --- /dev/null +++ b/include/asm/macros/script.inc @@ -0,0 +1,415 @@ +.macro warpLocation id:req + .byte 0x01 + .byte 0x00 + .2byte \id + .4byte 0x00, 0x00, 0x00 +.endm + +.macro warpDungeon id:req + .byte 0x02 + .byte 0x00 + .2byte \id + .4byte 0x00, 0x00, 0x00 +.endm + +.macro warpFriendArea time:req + .byte 0x02 + .byte 0x00 + .2byte \time + .4byte 0x00, 0x00, 0x00 +.endm + +.macro ConfirmDungeonRules + .byte 0x05 + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro changeTileset id:req + .byte 0x08, 0x00, 0x00, 0x00 + .2byte \id + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +@ Start Scene? Run Call? +.macro StartSceneRunCall id:req + .byte 0x0C + .byte \id + .byte 0xFF, 0xFF + .4byte 0x00, 0x00, 0x00 +.endm + +.macro RunCall id:req + .byte 0x0D + .byte \id + .byte 0xFF, 0xFF + .4byte 0x00, 0x00, 0x00 +.endm + +.macro triggerCutscene id:req + .byte 0x1B + .byte 0x00 + .2byte \id + .4byte 0x00, 0x00, 0x00 +.endm + +.macro fadeOut arg0:req time:req arg2:req + .byte 0x23 + .byte \arg0 + .2byte \time + .4byte \arg2 + .4byte 0x00, 0x00 +.endm + +.macro fadeColorOut arg0:req arg1:req time:req color:req + .byte 0x27 + .byte \arg0 + .2byte \arg1 + .4byte \time + .4byte \color + .4byte 0x00 +.endm + +.macro fadeColorIn arg0:req arg1:req time:req color:req + .byte 0x28 + .byte \arg0 + .2byte \arg1 + .4byte \time + .4byte \color + .4byte 0x00 +.endm + +.macro loadData type:req charac:req source:req + .byte 0x2D + .byte \type + .2byte \charac + .2byte \source + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +@ Face Locations +.set bottomL, 0x2 +.set bottomR, 0x3 +.set insetTopL, 0xE +.set insetTopR, 0xF + +.set previousLoc, 0x15 + +.macro selectFace loc:req charac:req face:req + .byte 0x2E + .byte \loc + .2byte \charac + .4byte \face + .4byte 0x00, 0x00 +.endm + +.macro closeTextBox + .byte 0x30 + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro scrollTextBox character:req textPtr:req + .byte 0x33, 0x00 + .2byte \character + .4byte 0x00, 0x00 + .4byte \textPtr +.endm + +.macro PicNameTextBox character:req textPtr:req + .byte 0x34, 0x00 + .2byte \character + .4byte 0x00, 0x00 + .4byte \textPtr +.endm + +.macro quickCloseTextBox character:req textPtr:req + .byte 0x36, 0x00 + .2byte \character + .4byte 0x00, 0x00 + .4byte \textPtr +.endm + +@ Is it always 0xff, 0xff? +.macro floatingText textPtr:req + .byte 0x37, 0x00 + .byte 0xff, 0xff + .4byte 0x00, 0x00 + .4byte \textPtr +.endm + +.macro fadeFloatingText time:req textPtr:req + .byte 0x39, 0x00 + .2byte \time + .4byte 0x00, 0x00 + .4byte \textPtr +.endm + +.macro YesNoTextBox eventID:req character:req textPtr:req + .byte 0x3A, 0x00 + .2byte \eventID + .2byte \character + .2byte 0x00 + .4byte 0x00 + .4byte \textPtr +.endm + +.macro showName arg0:req + .byte 0x3B + .byte \arg0 + .2byte 0x00 + .4byte 0x00, 0x00, 0x00 +.endm + +@ TODO: 0x3C has a lot of different cases... + +.macro renamePoke id:req + .byte 0x3D, 0x00, 0x00, 0x00 + .byte \id, 0x00, 0x00, 0x00 + .4byte 0x00, 0x00 +.endm + +.macro renameTeam + .byte 0x3D, 0x00, 0x00, 0x00 + .4byte 0x00, 0x00, 0x00 +.endm + +.macro abruptStopMusic + .byte 0x42 + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro fadeMusic time:req + .byte 0x43 + .byte 0x00 + .2byte \time + .4byte 0x00, 0x00, 0x00 +.endm + +.macro PlayMusic id:req + .byte 0x44 + .byte 0x00 + .2byte 0x0 + .2byte \id + .2byte 0x00 + .4byte 0x00, 0x00 +.endm + +.macro fadeInMusic id:req time:req + .byte 0x45, 0x00 + .2byte \id + .2byte \time + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +@ Also seen referred to as StopSng +.macro pushR14 + .byte 0x47 + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro fadeMusicOut time:req + .byte 0x48 + .byte 0x00 + .2byte \time + .4byte 0x00, 0x00, 0x00 +.endm + +.macro playSound id:req + .byte 0x4C + .byte 0x00, 0x00, 0x00 + .2byte \id + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +.macro stopSound id:req + .byte 0x4D + .byte 0x00, 0x00, 0x00 + .2byte \id + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +.macro setAnimation anim:req + .byte 0x54 + .byte 0x00 + .2byte \anim + .4byte 0x00, 0x00, 0x00 +.endm + +.macro warpToLoc id:req + .byte 0x5B, 0x00 + .2byte 0x00 + .byte \id + .byte 0x00, 0x00, 0x00 + .4byte 0x00, 0x00 +.endm + +@ move to prefined location along grid +.macro gridMoveTo speed:req id:req + .byte 0x6B, 0x00 + .2byte \speed + .byte \id + .4byte 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro changeSpriteZ speed:req targetHeight:req + .byte 0x70, 0x00 + .byte \speed + .3byte \targetHeight + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +@ Rotation Directions +.set CW, 1 +.set CCW, 2 +.set shortestDir, 0xA + +@ Cardinal Directions / Facing Directions +.set south, 0 +.set southeast, 1 +.set east, 2 +.set northeast, 3 +.set north, 4 +.set northwest, 5 +.set west, 6 +.set southwest, 7 + +.macro setFaceDir delay:req faceDir:req + .byte 0x8B + .byte \delay + .byte \faceDir + .byte 0x00 + .4byte 0x00, 0x00, 0x00 +.endm + +.macro rotate time:req rotDir:req faceDir:req + .byte 0x91 + .byte \time + .byte \rotDir + .byte 0x00 + .byte \faceDir + .byte 0x00 + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +.macro initVariableTextBox arg0:req arg1:req speaker:req + .byte 0xCF + .byte \arg0 + .byte \arg1 + .byte 0x00 + .4byte \speaker + .4byte 0x00, 0x00 +.endm + +.macro variableTextBox version:req textPtr:req + .byte 0xD0, 0x00 + .2byte \version + .4byte 0x00, 0x00 + .4byte \textPtr +.endm + +.macro elseTextBox textPtr:req + .byte 0xD1, 0x00 + .4byte 0x00, 0x00 + .byte 0x00, 0x00 + .4byte \textPtr +.endm + +.macro pause time:req + .byte 0xDB + .byte 0x00 + .2byte \time + .4byte 0x00, 0x00, 0x00 +.endm + +@ Wait for sound to finish playing? +.macro waitSound id:req + .byte 0xE2 + .byte 0x00 + .2byte \id + .4byte 0x00, 0x00, 0x00 +.endm + +.macro waitFlag flagnum:req + .byte 0xE3 + .byte 0x00 + .2byte \flagnum + .4byte 0x00, 0x00, 0x00 +.endm + +.macro setFlag flagnum:req + .byte 0xE4 + .byte 0x00 + .2byte \flagnum + .4byte 0x00, 0x00, 0x00 +.endm + +.macro goTo id:req + .byte 0xE5 + .byte 0x00 + .byte \id + .byte 0x00 + .4byte 0x00, 0x00, 0x00 +.endm + +@ Loop at label until end of scene +.macro loopLabel id:req + .byte 0xE7, 0x00 + .byte \id, 0x00 + .4byte 0x00, 0x00, 0x00 +.endm + +.macro executeScript scriptNum:req + .byte 0xE8 + .byte 0x00 + .2byte \scriptNum + .4byte 0x00, 0x00, 0x00 +.endm + +.macro MsgEnd arg0:req + .byte 0xE9 + .byte 0x00 + .2byte \arg0 + .4byte 0x00, 0x00, 0x00 +.endm + +.macro endFuncContinueScript + .byte 0xEE + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro endFuncandScript + .byte 0xEF + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro closeThread + .byte 0xF0 + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro closeThreadRemoveObject + .byte 0xF1 + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +@ Set label for loop +.macro label id:req + .byte 0xF4, 0x00 + .byte \id, 0x00 + .4byte 0x00, 0x00, 0x00 +.endm diff --git a/include/macros/m4a.inc b/include/macros/m4a.inc deleted file mode 100644 index 6c5abc0..0000000 --- a/include/macros/m4a.inc +++ /dev/null @@ -1,13 +0,0 @@ - .macro song label, music_player, unknown - .4byte \label - .2byte \music_player - .2byte \unknown - .endm - - .macro music_player info_struct, track_struct, unknown_1, unknown_2 - .4byte \info_struct - .4byte \track_struct - .byte \unknown_1 - .space 1 - .2byte \unknown_2 - .endm diff --git a/libagbsyscall/libagbsyscall.s b/libagbsyscall/libagbsyscall.s index 0c90da9..e4968b2 100644 --- a/libagbsyscall/libagbsyscall.s +++ b/libagbsyscall/libagbsyscall.s @@ -1,5 +1,5 @@ - .include "../constants/gba_constants.inc" - .include "../asm/macros/function.inc" + .include "../include/asm/constants/gba_constants.inc" + .include "../include/asm/macros/function.inc" .syntax unified diff --git a/tools/dungeonjson/dungeonjson.cpp b/tools/dungeonjson/dungeonjson.cpp index 48ef147..50ef81a 100644 --- a/tools/dungeonjson/dungeonjson.cpp +++ b/tools/dungeonjson/dungeonjson.cpp @@ -387,13 +387,13 @@ string generate_species_data_text(Json data) { ostringstream text; text << "@ This is auto-generated by species_data.json.\n"; - text << ".include \"include/constants/ability.h\"\n"; - text << ".include \"include/constants/evolve_type.h\"\n"; - text << ".include \"include/constants/friend_area.h\"\n"; - text << ".include \"include/constants/item.h\"\n"; - text << ".include \"include/constants/species.h\"\n"; - text << ".include \"include/constants/type.h\"\n"; - text << ".include \"include/constants/walkable_tile.h\"\n"; + text << "#include \"constants/ability.h\"\n"; + text << "#include \"constants/evolve_type.h\"\n"; + text << "#include \"constants/friend_area.h\"\n"; + text << "#include \"constants/item.h\"\n"; + text << "#include \"constants/species.h\"\n"; + text << "#include \"constants/type.h\"\n"; + text << "#include \"constants/walkable_tile.h\"\n"; text << ".global gSpeciesData\n"; text << "gSpeciesData:"; for (Json data_entry : data.array_items()) { @@ -447,8 +447,8 @@ string generate_item_data_text(Json data) { ostringstream text; text << "@ This is auto-generated by item_data.json.\n"; - text << ".include \"include/constants/item.h\"\n"; - text << ".include \"include/constants/move_id.h\"\n"; + text << "#include \"constants/item.h\"\n"; + text << "#include \"constants/move_id.h\"\n"; text << ".global gItemData\n"; text << "gItemData:"; for (Json data_entry : data.array_items()) { @@ -476,7 +476,7 @@ string generate_move_data_text(Json data) { ostringstream text; text << "@ This is auto-generated by move_data.json.\n"; - text << ".include \"include/constants/type.h\"\n"; + text << "#include \"constants/type.h\"\n"; text << ".global gMoveData\n"; text << "gMoveData:"; for (Json data_entry : data.array_items()) { -- cgit v1.2.3